# Go Source: https://docs.corsair.dev/clients/go Call your hosted Corsair Cloud project from Go. Standard library only. `corsaircloud` is a small Go client for a hosted [Corsair Cloud](/cloud/overview) project. It uses only the standard library. Give it your API key, and every plugin your runtime has is callable over HTTP. ## 1. Install ```bash theme={null} go get github.com/corsairdev/corsair/clients/go ``` The module lives in a subdirectory of the `corsair` monorepo, so `go get` resolves it against subdirectory-scoped tags (`clients/go/vX.Y.Z`). To pin an exact version: ```bash theme={null} go get github.com/corsairdev/corsair/clients/go@v0.1.0 ``` ## 2. Add your API key Copy your project's **API key** (`ck_cloud_…`) from the dashboard Overview page. It's a server secret; keep it in an environment variable, not in source. The client derives its own URL from the key: ```go theme={null} import ( "os" corsaircloud "github.com/corsairdev/corsair/clients/go" ) corsair := corsaircloud.New(os.Getenv("CORSAIR_CLOUD_KEY")) // dev/testing: point at a local runtime with corsaircloud.WithURL("http://localhost:…") ``` ## 3. Make a call Pick a user (a "tenant"), then call any operation on any plugin your runtime has. `Call` returns the raw JSON result, which you unmarshal into your own type: ```go theme={null} raw, err := corsair.Tenant("acme").Call(ctx, "notion", "pages.searchPage", map[string]any{"query": "roadmap"}) if err != nil { return err } var pages NotionPages if err := json.Unmarshal(raw, &pages); err != nil { return err } ``` `Tenant("acme")` runs the call as your user "acme". The arguments map onto one request: `POST /acme/notion/call/pages.searchPage` with body `{"args": {"query": "roadmap"}}`. ## 4. Connect a user's account A tenant can only call Notion after they have connected their Notion account. Create a connect link and send the user to it: ```go theme={null} link, err := corsair.CreateConnectLink(ctx, "notion", "acme", "") // last arg: optional redirectURI if err != nil { return err } // redirect the user to link.ConnectURL ``` After they authorize, check who is connected: ```go theme={null} status, err := corsair.ConnectionStatus(ctx, "acme") if err != nil { return err } // status is map[string]string{"notion": "connected"} ``` ## Handle errors A non-2xx response comes back as `*corsaircloud.CorsairError`: ```go theme={null} raw, err := corsair.Tenant("acme").Call(ctx, "notion", "pages.searchPage", nil) var cerr *corsaircloud.CorsairError if errors.As(err, &cerr) && cerr.Code == "not_connected" { // send the user through CreateConnectLink first } ``` Its fields: `Code` (machine reason, branch on this), `Message`, `Reason`, and `ProviderStatus` (the upstream provider's status, when the error came from them). # Python Source: https://docs.corsair.dev/clients/python Call your hosted Corsair Cloud project from Python. Pure stdlib, no dependencies. `corsair-cloud` is a small Python client for a hosted [Corsair Cloud](/cloud/overview) project. It has no dependencies and works on Python 3.10+. Give it your API key, and every plugin your runtime has is callable over HTTP. ## 1. Install ```bash theme={null} pip install corsair-cloud ``` ## 2. Add your API key Copy your project's **API key** (`ck_cloud_…`) from the dashboard Overview page. It's a server secret; keep it in an environment variable, not in source. The client derives its own URL from the key, so it's the only value you pass: ```python theme={null} import os from corsair_cloud import CorsairCloud corsair = CorsairCloud(api_key=os.environ["CORSAIR_CLOUD_KEY"]) ``` ## 3. Make a call Pick a user (a "tenant"), then call any operation on any plugin your runtime has: ```python theme={null} pages = corsair.with_tenant("acme").call("notion", "pages.searchPage", {"query": "roadmap"}) ``` `with_tenant("acme")` runs the call as your user "acme", using that user's connected account. `call(plugin, op, args)` returns the operation's result directly. The three arguments map onto one request: `POST /acme/notion/call/pages.searchPage` with body `{"args": {"query": "roadmap"}}`. ## 4. Connect a user's account A tenant can only call Notion after they have connected their Notion account. Create a connect link and send the user to it: ```python theme={null} link = corsair.manage.create_connect_link("notion", "acme") # redirect the user to link["connectUrl"] ``` After they authorize, check who is connected: ```python theme={null} status = corsair.manage.connection_status("acme") # {"notion": "connected"} ``` ## Manage tenants and connections ```python theme={null} corsair.manage.create_tenant("acme") # add a tenant corsair.manage.tenants() # list tenants corsair.manage.connection_status("acme") # {"notion": "connected"} corsair.manage.create_connect_link("notion", "acme") corsair.manage.disconnect("notion", "acme") # revoke a connection ``` ## Handle errors Any non-2xx response raises `CorsairError`: ```python theme={null} from corsair_cloud import CorsairError try: corsair.with_tenant("acme").call("notion", "pages.searchPage", {}) except CorsairError as e: if e.code == "not_connected": # send the user through create_connect_link first ... else: raise ``` The fields you will use most: | Field | Example | Meaning | | - | - | - | | `.code` | `not_connected` | Machine-readable reason. Branch on this. | | `.status` | `409` | HTTP status. | | `.message` | `"Notion is not connected for acme"` | Human-readable detail. | | `.provider_status` | `429` | The upstream provider's status, when the error came from them. | # Swift Source: https://docs.corsair.dev/clients/swift Call your hosted Corsair Cloud project from Swift, with async/await and typed decoding. `CorsairCloud` is a small Swift client for a hosted [Corsair Cloud](/cloud/overview) project. It uses `URLSession` and `async`/`await`. Give it your API key, and every plugin your runtime has is callable over HTTP. ## 1. Install Add it to your `Package.swift`. The package lives under `clients/swift` in the `corsair` monorepo. Until a root-level Swift mirror ships, add it as a local path dependency from a checkout of `corsair`: ```swift theme={null} .package(path: "../corsair/clients/swift"), // then in your target: .product(name: "CorsairCloud", package: "CorsairCloud") ``` ## 2. Add your API key Copy your project's **API key** (`ck_cloud_…`) from the dashboard Overview page. Keep it on a server; don't ship it inside an app you distribute. The client derives its own URL from the key: ```swift theme={null} import CorsairCloud let corsair = CorsairCloud(apiKey: ProcessInfo.processInfo.environment["CORSAIR_CLOUD_KEY"]!) ``` ## 3. Make a call Pick a user (a "tenant"), then call any operation on any plugin your runtime has: ```swift theme={null} let result = try await corsair.tenant("acme").call("notion", "pages.searchPage", args: ["query": "roadmap"]) ``` `tenant("acme")` runs the call as your user "acme". By default `result` is a `JSONValue`. To get a typed result, pass your own `Decodable` and Corsair decodes it for you: ```swift theme={null} struct Page: Decodable { let id: String } struct SearchResult: Decodable { let results: [Page] } let typed = try await corsair.tenant("acme") .call("notion", "pages.searchPage", as: SearchResult.self) ``` ## 4. Connect a user's account A tenant can only call Notion after they have connected their Notion account. Create a connect link and send the user to it: ```swift theme={null} let link = try await corsair.manage.createConnectLink(plugin: "notion", tenantId: "acme") // open link.connectUrl ``` After they authorize, check who is connected: ```swift theme={null} let status = try await corsair.manage.connectionStatus(tenantId: "acme") // ["notion": "connected"] try await corsair.manage.disconnect(plugin: "notion", tenantId: "acme") ``` ## Handle errors Any non-2xx response throws `CorsairError`: ```swift theme={null} do { _ = try await corsair.tenant("acme").call("notion", "pages.searchPage", args: [:]) } catch let error as CorsairError { if error.code == "not_connected" { // send the user through createConnectLink first } } ``` Its fields: `code` (machine reason, branch on this), `status` (HTTP status), `message`, and the upstream provider's status when the error came from them. # Corsair MCP Source: https://docs.corsair.dev/cloud/mcp One address, https://mcp.corsair.dev/mcp, that lets Claude, ChatGPT, Cursor and other agents use the apps you've connected to Corsair. Corsair MCP lets an AI agent use the apps you've connected to Corsair. It can read your inbox, post in Slack, open a GitHub issue, search data Corsair has synced, or set up an automation that runs when something happens in one of your apps. Every client uses the same address: ``` https://mcp.corsair.dev/mcp ``` You add it once, sign in to Corsair, and choose which of your links the client uses. ## Before you start * A Corsair account. Sign up at [hub.corsair.dev](https://hub.corsair.dev) with Google, GitHub or an emailed sign-in link. * Apps to use. You can connect them in Corsair first, or ask the agent to connect one later. It hands you a sign-in link for that app. ## How sign-in works **1. Add the address to your client** See [Add it to your client](#add-it-to-your-client) below. **2. Sign in to Corsair** The client opens Corsair in your browser. **3. Pick a link** A link is a set of your connected apps plus a [mode](#modes-and-approvals) that decides what the agent may do without asking. Pick an existing link or make a new one for this client. If you have no link yet, Corsair asks you to make one first. **4. Allow** The client gets the apps on that link and your email address. Nothing else on your account is shared. One connection uses one link. To switch links, remove Corsair from the client, add it again and pick the other link. You can sign a client out of a link at any time from [hub.corsair.dev/me](https://hub.corsair.dev/me). ## Add it to your client **Claude** 1. In Claude, open **Customize → Connectors → Add custom connector**. 2. Name it Corsair, paste `https://mcp.corsair.dev/mcp` and add it. 3. Select **Connect** and sign in to Corsair. On a Team or Enterprise plan, an owner adds connectors under Organization settings. **ChatGPT** 1. In ChatGPT, add a custom MCP server and paste `https://mcp.corsair.dev/mcp`. 2. Choose OAuth, then sign in to Corsair. On personal plans, ChatGPT currently uses only the read tools from a custom server, so Corsair can look things up but not make changes. Write tools such as `run_script` need a Business or Enterprise/Edu workspace, where an admin adds the server or gives you permission to. OpenAI's [guide to custom MCP servers](https://help.openai.com/en/articles/12584461-connecting-custom-mcp-servers-in-chatgpt) has the current rules. **Cursor** [Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=corsair\&config=eyJ1cmwiOiJodHRwczovL21jcC5jb3JzYWlyLmRldi9tY3AifQ==), or add this to `~/.cursor/mcp.json`: ```json theme={null} { "mcpServers": { "corsair": { "url": "https://mcp.corsair.dev/mcp" } } } ``` Cursor opens Corsair to sign in the first time it connects. **VS Code** Add this to `.vscode/mcp.json`, or run **MCP: Add Server → HTTP** and paste the address: ```json theme={null} { "servers": { "corsair": { "type": "http", "url": "https://mcp.corsair.dev/mcp" } } } ``` VS Code signs you in when it first connects. **Claude Code** ```bash theme={null} claude mcp add --transport http corsair https://mcp.corsair.dev/mcp ``` Then run `/mcp` in Claude Code to sign in. Add `--scope user` to have it in every project. **Codex** ```bash theme={null} codex mcp add corsair --url https://mcp.corsair.dev/mcp codex mcp login corsair ``` **Gemini CLI** ```bash theme={null} gemini mcp add --transport http corsair https://mcp.corsair.dev/mcp ``` Then run `/mcp auth corsair` to sign in. **Zed** Add this to your Zed settings. Zed signs you in when it first connects. ```json theme={null} { "context_servers": { "corsair": { "url": "https://mcp.corsair.dev/mcp" } } } ``` Any other client that supports remote MCP servers with OAuth sign-in works the same way. > [!NOTE] > > Some clients can't sign in to an MCP server, such as GitHub Copilot's coding agent. For those, use a link's own address with an API key. Open the link at [hub.corsair.dev/me](https://hub.corsair.dev/me) and follow the steps for your client there. ## What the agent can do | Tool | What it does | Changes anything | | - | - | - | | `list_integrations` | Lists the apps on this link and whether each is ready, or searches the apps Corsair supports | No | | `list_integration_operations` | Shows what a connected app can do and the arguments each action takes | No | | `add_integrations` | Starts connecting an app and returns a sign-in link for you to open | Adds the app once you sign in | | `search_data` | Searches data Corsair has synced from your apps, such as Slack messages, email and calendar events | No | | `read_data` | Reads your apps live with a short script. It stops before any action that would change something | No | | `run_script` | Makes changes in your apps with a short script: send, create, update or delete | Yes | | `add_triggers` | Sets up an automation that runs on an app event or a schedule | Yes | | `list_triggers` | Lists the automations on this link | No | | `remove_triggers` | Stops an automation. Its steps stay saved so it can be turned back on | Yes | | `list_runs` | Lists recent automation runs and how each went | No | | `get_run` | Shows one run step by step, with the error if it failed | No | Scripts run in a sandbox that can only call your connected apps' actions. They have no network, filesystem or other system access, and the agent never sees your app credentials. Not every link shows every tool. A link that isn't allowed to add apps has no `add_integrations`, and a Read link has no `add_triggers` or `remove_triggers`. `read_data`, `search_data` and the `list_` and `get_` tools are marked read-only, so most clients run them without asking. Clients usually ask you before running the others. ## Modes and approvals Each link has a mode. Corsair checks every action against it, whatever the client allows. | Mode | What it allows | | - | - | | Read | Reads only. Writes are refused. | | Cautious (default) | Writes go through. A destructive action, such as a delete, needs your approval. | | Strict | Every write needs your approval. Destructive actions are refused. | | Open | Everything, without asking. | When an action needs approval, the agent gives you a link. It shows exactly what will run and with which arguments. Approve or deny it there, then tell the agent to carry on. An approval covers that one action once. Change a link's mode at [hub.corsair.dev/me](https://hub.corsair.dev/me). ## Troubleshooting > **The agent says an app isn't connected** > > Ask it to connect the app. It calls `add_integrations` and gives you a sign-in link. Open it, sign in to the app, then tell the agent you're done. > **An app needs setting up before it can be connected** > > The project behind your link has to finish setting the app up first, for example by adding its OAuth credentials. Whoever manages the project does this in Corsair. > **An action is blocked by the permission mode** > > The link's mode doesn't allow that kind of action. Change the mode at [hub.corsair.dev/me](https://hub.corsair.dev/me), or use a link with a different mode. > **I want this client to use a different link** > > Remove Corsair from the client, add it again and pick the other link when you sign in. > **I added [https://mcp.corsair.cloud/mcp](https://mcp.corsair.cloud/mcp) earlier** > > That address still works and reaches the same server, so nothing needs to change. New setups use `https://mcp.corsair.dev/mcp`. ## Support and privacy Email [primary@corsair.dev](mailto:primary@corsair.dev). See the [privacy policy](https://corsair.dev/privacy-policy) and [terms](https://corsair.dev/terms-of-service). # Corsair Cloud Source: https://docs.corsair.dev/cloud/overview A hosted runtime for your integrations. You have an API key, and every tool call is one HTTP request. Corsair Cloud runs the integration layer for you. Instead of building and hosting a server that talks to Notion, Slack, GitHub, and the rest, you get a project with its own hosted runtime and call any plugin operation over HTTP. Nothing to deploy, no OAuth server to write, no tokens to store. Connect your users' accounts once, then make calls. ## Set up You need one thing: your project's **API key**, from the dashboard Overview page. It looks like `ck_cloud_…`. The client derives its own URL from the key, so that's the whole configuration. > [!WARNING] > > The API key is a server secret, sent as a bearer token. Keep it on your > server; never put it in browser code or a mobile app you ship. For the browser, > see [Server vs. browser](#server-vs-browser). ## Your first call Install the client for your language and make one call. Every language takes the key and nothing else. ```ts TypeScript theme={null} import { corsairCloud } from "corsair"; const corsair = corsairCloud({ apiKey: process.env.CORSAIR_CLOUD_KEY! }); const pages = await corsair.withTenant("acme").notion.api.pages.searchPage({}); ``` ```python Python theme={null} from corsair_cloud import CorsairCloud import os corsair = CorsairCloud(api_key=os.environ["CORSAIR_CLOUD_KEY"]) pages = corsair.with_tenant("acme").call("notion", "pages.searchPage", {}) ``` ```go Go theme={null} corsair := corsaircloud.New(os.Getenv("CORSAIR_CLOUD_KEY")) raw, err := corsair.Tenant("acme").Call(ctx, "notion", "pages.searchPage", map[string]any{}) ``` ```swift Swift theme={null} let corsair = CorsairCloud(apiKey: ProcessInfo.processInfo.environment["CORSAIR_CLOUD_KEY"]!) let pages = try await corsair.tenant("acme").call("notion", "pages.searchPage", args: [:]) ``` ```bash curl theme={null} # The clients derive the URL from the key; for raw curl, build it from your key's # slug (the segment between ck_cloud_ and the first '.'): https://api.corsair.cloud//api/corsair curl -X POST "https://api.corsair.cloud//api/corsair/acme/notion/call/pages.searchPage" \ -H "authorization: Bearer $CORSAIR_CLOUD_KEY" \ -H "content-type: application/json" \ -d '{"args":{}}' ``` That runs Notion's `pages.searchPage` as your user "acme" and returns the result. It's always one request, `POST /{tenant}/{plugin}/call/{op}` with a `{ "args": {...} }` body, so the language clients are thin wrappers over the same shape. ## What is a tenant? A tenant is one of your users. `withTenant("acme")` (or `with_tenant`, `Tenant`, `tenant`) picks which user a call acts as, so it uses that user's connected account. One runtime serves all your tenants at once. Building for a single user? Pick one tenant id and forget about it. The runtime rejects an empty tenant id rather than guessing, so a call is never silently scoped to the wrong user. ## Map your tenants The runtime holds the tenants and which accounts each has connected. List them to line up against your own users: ```ts TypeScript theme={null} const tenants = await corsair.manage.tenants.list(); // [{ id: "acme", connectedPlugins: ["notion"] }, …] ``` ```python Python theme={null} tenants = corsair.manage.tenants() ``` > [!NOTE] > > `tenants` gives you each tenant's id and connected plugins, `connectionStatus` > gives the per-plugin auth state, and `manage.permissions.get({ id })` reads a > permission grant (its scopes and approval status). All redact secrets: you see > *that* a tenant connected Notion, never their token. Reading a tenant's stored > *data* rows directly, or pointing the runtime at your own database, comes with > bring-your-own-DB (coming soon). ## Connect a user's account Before a tenant can call Notion, they have to connect their Notion account. Corsair Cloud runs the OAuth. Create a connect link and send your user to it: ```ts TypeScript theme={null} const link = await corsair.manage.connect.createLink({ plugin: "notion", tenantId: "acme", }); // send the user to link.connectUrl ``` ```python Python theme={null} link = corsair.manage.create_connect_link("notion", "acme") # send the user to link["connectUrl"] ``` When they finish authorizing, the runtime stores their token, encrypted at rest with a key Corsair holds. Raw provider tokens never sit in your store. Check who is connected any time: ```ts TypeScript theme={null} const status = await corsair.manage.connectionStatus.get({ tenantId: "acme" }); // { notion: "connected" } ``` ```python Python theme={null} status = corsair.manage.connection_status("acme") # {"notion": "connected"} ``` ## Server vs. browser The runtime has one contract and two ways to reach it: * **From a server or agent.** Use the client directly. It holds the key and calls the runtime, the path in every example above. * **From a browser (React).** Browser code must never see the key. Stand up a route in *your own* app that injects the bearer server-side. `corsair/connect` builds that route from just the key: ```ts app/api/corsair/[...path]/route.ts theme={null} import { corsairConnect } from 'corsair/connect'; import { getSession } from '@/lib/auth'; const proxy = corsairConnect({ apiKey: process.env.CORSAIR_CLOUD_KEY!, // Runs before every forwarded request. The caller's own credentials // never reach this handler, so this is where you check who's asking. authorize: async (req) => Boolean(await getSession(req)), }); export const GET = proxy; export const POST = proxy; ``` Pair it with `` in the browser. The provider only ever calls this same-origin route and never sees the key. `authorize` is required: without it, `corsairConnect` throws at startup, since anyone who can reach the route could otherwise invoke any tenant/plugin/operation the project key allows. To intentionally run an open proxy, pass `allowUnauthenticated: true`. Then wrap your app in `CorsairProvider` and use `useCorsair()` to drive the connect flow and read connection state. The key stays on your server the whole time. ## Type hints for your calls (TypeScript) `corsairCloud` takes no plugin list, since the plugins live on the runtime, so by default `corsair.withTenant(t).notion.api…` is typed as `any`. For autocomplete, run the CLI once: ```bash theme={null} pnpm corsair cloud pull ``` It reads the exact plugins and operations your runtime has, down to the scopes you allowed, and writes a local `corsair-env.d.ts` that TypeScript picks up, with no plugin import to maintain. Coding agents can skip it and list operations with `pnpm corsair cloud list`. ## Where calls go Your call goes straight to the runtime, not through the dashboard. The dashboard creates and configures the runtime, then steps out of the request path, so a call is one hop out (your code to the runtime) and one hop on (the runtime to the provider). ## Next steps * [Python client](/clients/python) * [Go client](/clients/go) * [Swift client](/clients/swift) # API Source: https://docs.corsair.dev/concepts/api Corsair API. When you create a Corsair instance, every plugin exposes its API endpoints directly on the instance under a nested structure. ```ts corsair.ts theme={null} import { createCorsair } from "corsair"; import { slack } from "@corsair-dev/slack"; import { linear } from "@corsair-dev/linear"; export const corsair = createCorsair({ plugins: [ slack({ authType: "api_key", credentials: { botToken: "xoxb-..." } }), linear({ authType: "api_key", credentials: { apiKey: "lin_..." } }), ], }); // Send a message to Slack await corsair.slack.api.messages.post({ channel: "C01234567", text: "Hello from Corsair!", }); // Create a Linear issue await corsair.linear.api.issues.create({ title: "New feature request", teamId: "TEAM_123", }); ``` ## API structure All plugins follow the same pattern: `corsair.[plugin].api.[resource].[action]()`. ```ts example.ts theme={null} // Slack examples corsair.slack.api.channels.create({ name: "engineering" }); corsair.slack.api.channels.list({ limit: 50 }); corsair.slack.api.messages.post({ channel: "C01", text: "Hello" }); corsair.slack.api.messages.delete({ channel: "C01", ts: "123.456" }); corsair.slack.api.users.get({ user: "U01234567" }); // Linear examples corsair.linear.api.issues.create({ title: "Bug", teamId: "T1" }); corsair.linear.api.issues.update({ id: "ISS-1", input: { title: "Fixed" } }); corsair.linear.api.projects.list({ first: 10 }); corsair.linear.api.comments.create({ issueId: "ISS-1", body: "Done!" }); ``` ## 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. ```ts example.ts theme={null} // TypeScript knows exactly what parameters are available const channel = await corsair.slack.api.channels.create({ name: "engineering", is_private: true, // optional — TypeScript tells you }); // Response is also strongly typed console.log(channel.id, channel.name, channel.is_member); ``` ## With multi-tenancy When multi-tenancy is enabled, use `withTenant()` to scope operations. ```ts example.ts theme={null} const tenant = corsair.withTenant("tenant_abc123"); await tenant.slack.api.messages.post({ channel: "C01234567", text: "Scoped to tenant_abc123", }); ``` See [Multi-Tenancy](/concepts/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. ```ts example.ts theme={null} // Create a channel — Corsair stores it const channel = await corsair.slack.api.channels.create({ name: "support" }); // Later, retrieve from the database const stored = await corsair.slack.db.channels.findByResourceId(channel.id); ``` See [Database](/concepts/database) for the full ORM API. ## Hooks Add before/after hooks to customize API behavior. ```ts corsair.ts theme={null} slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, hooks: { channels: { create: { before: (ctx, args) => { console.log("Creating channel:", args.name); return { ctx, args }; }, after: (ctx, result) => { console.log("Created:", result.id); }, }, }, }, }) ``` # Authentication Source: https://docs.corsair.dev/concepts/auth OAuth, API keys, and bot tokens, handled automatically. Corsair supports several authentication modes across its plugins. You choose an `authType` when registering a plugin — you do not pass tokens or secrets in your application code. Corsair stores credentials encrypted and retrieves the right ones for each tenant at request time. Check each plugin's [overview page](/plugins/slack/overview) to see which auth types it supports and follow its setup steps. ```ts corsair.ts theme={null} import { createCorsair } from "corsair"; import { slack } from "@corsair-dev/slack"; import { linear } from "@corsair-dev/linear"; export const corsair = createCorsair({ multiTenancy: true, kek: process.env.CORSAIR_KEK!, database: db, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, plugins: [ slack({ authType: "managed" }), linear({ authType: "oauth_2" }), ], }); ``` ## Auth types Not every plugin supports every mode. Open the plugin's docs — for example [Slack](/plugins/slack/overview) or [Linear](/plugins/linear/overview) — and use the **Choose authentication** section as the source of truth. ### Managed OAuth Corsair hosts the OAuth app, so you register nothing in the provider console. Set `authType: "managed"` and tenants connect through [Hub](/hub/overview). ```ts theme={null} github({ authType: "managed", }) ``` ### OAuth 2.0 For integrations where you bring your own OAuth app. Set `authType: "oauth_2"` in your plugin config, then enter the **client ID** and **client secret** in the [Hub dashboard](https://hub.corsair.dev/dashboard) — not in `corsair.ts` or environment variables. Tenants authorize their accounts through Hub's connect flow. ```ts theme={null} linear({ authType: "oauth_2", }) ``` See [OAuth 2.0](/concepts/oauth) for connect links, solo vs multi-tenant setup, and token lifecycle. ### API key For integrations that use static API keys or personal access tokens. At the plugin level you only declare the auth type (or omit it when `api_key` is the default). Each tenant supplies their own key during onboarding or on first use — keys are stored encrypted per tenant, not configured once for the whole plugin. ```ts theme={null} linear({ authType: "api_key", }) ``` See [API Key](/concepts/api-key) for storing and scoping keys with `withTenant`. ### Bot token Some plugins accept a bot or app-user token instead of a user API key. Like API keys, bot tokens are **tenant-level**: each tenant provides their own token when connecting. Check the plugin's docs for the exact field name and setup flow. ## Automatic token refresh When using OAuth, tokens expire. Corsair handles this automatically: 1. Before making a request, checks if the token is expired 2. If expired, uses the refresh token to get a new access token 3. Stores the new token and continues with the request You never have to think about token rotation. ## Envelope encryption Corsair uses envelope encryption to protect credentials: 1. You set one **KEK** (Key Encryption Key) in your environment variables 2. Each connection gets its own **DEK** (Data Encryption Key) 3. All credentials are encrypted with the connection's DEK 4. The DEK is encrypted with your KEK ```bash .env theme={null} CORSAIR_KEK=your-key-encryption-key ``` Each connection has a different DEK, so compromising one connection's key doesn't expose others. > [!NOTE] > > This holds whether you self-host or use [Hub](/hub/overview). Hub is a relay for connect, approval, and webhook surfaces; it stores none of your tenants' tokens. Encrypted tokens are persisted only in your database in both modes. ## Multi-tenant credentials With multi-tenancy, each tenant has their own credentials stored securely. ```ts example.ts theme={null} // Tenant A's Slack token const tenantA = corsair.withTenant("tenant_a"); await tenantA.slack.api.messages.post({ ... }); // Tenant B's Slack token — completely separate const tenantB = corsair.withTenant("tenant_b"); await tenantB.slack.api.messages.post({ ... }); ``` Corsair retrieves the correct credentials for each tenant automatically. # Database Source: https://docs.corsair.dev/concepts/database Five tables, always-fresh integration data, tenant-scoped by default. Every API call and webhook that flows through Corsair is stored in your database automatically. When something changes in Slack, GitHub, or Linear, Corsair updates the same row, so your UI can read from `*.db.*` instead of hitting third-party APIs on every page load. Third-party data becomes an extension of your own DB, always fresh. ## Get started Run the migration once, then pass your connection to `createCorsair({ database, ... })`. See [Quick Start](/quick-start) for a full setup example. **SQLite** Install the driver, then run the migration: ```bash npm theme={null} npm install better-sqlite3 ``` ```bash yarn theme={null} yarn add better-sqlite3 ``` ```bash pnpm theme={null} pnpm install better-sqlite3 ``` ```bash bun theme={null} bun add better-sqlite3 ``` ```bash npm theme={null} npm install --save-dev @types/better-sqlite3 ``` ```bash yarn theme={null} yarn add --dev @types/better-sqlite3 ``` ```bash pnpm theme={null} pnpm install --save-dev @types/better-sqlite3 ``` ```bash bun theme={null} bun add --dev @types/better-sqlite3 ``` **PostgreSQL** Install the driver, then run the migration: ```bash npm theme={null} npm install pg ``` ```bash yarn theme={null} yarn add pg ``` ```bash pnpm theme={null} pnpm install pg ``` ```bash bun theme={null} bun add pg ``` ```bash npm theme={null} npm install --save-dev @types/pg ``` ```bash yarn theme={null} yarn add --dev @types/pg ``` ```bash pnpm theme={null} pnpm install --save-dev @types/pg ``` ```bash bun theme={null} bun add --dev @types/pg ``` **SQLite** > **View migration SQL** > > ```sql migration.sql theme={null} > CREATE TABLE IF NOT EXISTS corsair_integrations ( > id TEXT PRIMARY KEY, > created_at INTEGER NOT NULL, > updated_at INTEGER NOT NULL, > name TEXT NOT NULL, > config TEXT NOT NULL DEFAULT '{}', > dek TEXT NULL > ); > > CREATE TABLE IF NOT EXISTS corsair_accounts ( > id TEXT PRIMARY KEY, > created_at INTEGER NOT NULL, > updated_at INTEGER NOT NULL, > tenant_id TEXT NOT NULL, > integration_id TEXT NOT NULL, > config TEXT NOT NULL DEFAULT '{}', > dek TEXT NULL, > FOREIGN KEY (integration_id) REFERENCES corsair_integrations(id) > ); > > CREATE TABLE IF NOT EXISTS corsair_entities ( > id TEXT PRIMARY KEY, > created_at INTEGER NOT NULL, > updated_at INTEGER NOT NULL, > account_id TEXT NOT NULL, > entity_id TEXT NOT NULL, > entity_type TEXT NOT NULL, > version TEXT NOT NULL, > data TEXT NOT NULL DEFAULT '{}', > FOREIGN KEY (account_id) REFERENCES corsair_accounts(id) > ); > > CREATE TABLE IF NOT EXISTS corsair_events ( > id TEXT PRIMARY KEY, > created_at INTEGER NOT NULL, > updated_at INTEGER NOT NULL, > account_id TEXT NOT NULL, > event_type TEXT NOT NULL, > payload TEXT NOT NULL DEFAULT '{}', > status TEXT, > FOREIGN KEY (account_id) REFERENCES corsair_accounts(id) > ); > > CREATE TABLE IF NOT EXISTS corsair_permissions ( > id TEXT PRIMARY KEY, > created_at INTEGER NOT NULL, > updated_at INTEGER NOT NULL, > token TEXT NOT NULL, > plugin TEXT NOT NULL, > endpoint TEXT NOT NULL, > args TEXT NOT NULL, > tenant_id TEXT NOT NULL, > status TEXT NOT NULL DEFAULT 'pending', > expires_at TEXT NOT NULL, > error TEXT > ); > ``` **macOS / Linux** ```bash theme={null} sqlite3 corsair.db < migration.sql ``` **Windows (PowerShell)** PowerShell syntax Bash redirection and \$VAR env vars do not work in PowerShell. Use the Windows commands shown in this tab instead. ```powershell theme={null} Get-Content migration.sql | sqlite3 corsair.db ``` **PostgreSQL** **SQL** > **View migration SQL** > > ```sql migration.sql theme={null} > CREATE TABLE IF NOT EXISTS corsair_integrations ( > id TEXT PRIMARY KEY, > created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > name TEXT NOT NULL, > config JSONB NOT NULL DEFAULT '{}', > dek TEXT NULL > ); > > CREATE TABLE IF NOT EXISTS corsair_accounts ( > id TEXT PRIMARY KEY, > created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > tenant_id TEXT NOT NULL, > integration_id TEXT NOT NULL REFERENCES corsair_integrations(id), > config JSONB NOT NULL DEFAULT '{}', > dek TEXT NULL > ); > > CREATE TABLE IF NOT EXISTS corsair_entities ( > id TEXT PRIMARY KEY, > created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > account_id TEXT NOT NULL REFERENCES corsair_accounts(id), > entity_id TEXT NOT NULL, > entity_type TEXT NOT NULL, > version TEXT NOT NULL, > data JSONB NOT NULL DEFAULT '{}' > ); > > CREATE TABLE IF NOT EXISTS corsair_events ( > id TEXT PRIMARY KEY, > created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > account_id TEXT NOT NULL REFERENCES corsair_accounts(id), > event_type TEXT NOT NULL, > payload JSONB NOT NULL DEFAULT '{}', > status TEXT > ); > > CREATE TABLE IF NOT EXISTS corsair_permissions ( > id TEXT PRIMARY KEY, > created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > token TEXT NOT NULL, > plugin TEXT NOT NULL, > endpoint TEXT NOT NULL, > args TEXT NOT NULL, > tenant_id TEXT NOT NULL, > status TEXT NOT NULL DEFAULT 'pending', > expires_at TEXT NOT NULL, > error TEXT > ); > ``` **macOS / Linux** ```bash theme={null} psql $DATABASE_URL -f migration.sql ``` **Windows (PowerShell)** PowerShell syntax Bash redirection and \$VAR env vars do not work in PowerShell. Use the Windows commands shown in this tab instead. ```powershell theme={null} psql $env:DATABASE_URL -f migration.sql ``` **Drizzle** > **View Drizzle schema** > > ```ts src/server/db/schema.ts theme={null} > import { pgTable, text, jsonb, timestamp } from 'drizzle-orm/pg-core'; > > export const corsairIntegrations = pgTable('corsair_integrations', { > id: text('id').primaryKey(), > createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(), > updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(), > name: text('name').notNull(), > config: jsonb('config').notNull().default({}), > dek: text('dek'), > }); > > export const corsairAccounts = pgTable('corsair_accounts', { > id: text('id').primaryKey(), > createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(), > updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(), > tenantId: text('tenant_id').notNull(), > integrationId: text('integration_id').notNull().references(() => corsairIntegrations.id), > config: jsonb('config').notNull().default({}), > dek: text('dek'), > }); > > export const corsairEntities = pgTable('corsair_entities', { > id: text('id').primaryKey(), > createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(), > updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(), > accountId: text('account_id').notNull().references(() => corsairAccounts.id), > entityId: text('entity_id').notNull(), > entityType: text('entity_type').notNull(), > version: text('version').notNull(), > data: jsonb('data').notNull().default({}), > }); > > export const corsairEvents = pgTable('corsair_events', { > id: text('id').primaryKey(), > createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(), > updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(), > accountId: text('account_id').notNull().references(() => corsairAccounts.id), > eventType: text('event_type').notNull(), > payload: jsonb('payload').notNull().default({}), > status: text('status'), > }); > > export const corsairPermissions = pgTable('corsair_permissions', { > id: text('id').primaryKey(), > createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(), > updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(), > token: text('token').notNull(), > plugin: text('plugin').notNull(), > endpoint: text('endpoint').notNull(), > args: text('args').notNull(), > tenantId: text('tenant_id').notNull(), > status: text('status').notNull().default('pending'), > expiresAt: text('expires_at').notNull(), > error: text('error'), > }); > ``` Then push the schema to your database: ```bash theme={null} npx drizzle-kit push ``` **Prisma** > **View Prisma schema** > > ```prisma schema.prisma theme={null} > model CorsairIntegration { > id String @id > createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz > updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz > name String > config Json @default("{}") > dek String? > accounts CorsairAccount[] > > @@map("corsair_integrations") > } > > model CorsairAccount { > id String @id > createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz > updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz > tenantId String @map("tenant_id") > integrationId String @map("integration_id") > config Json @default("{}") > dek String? > integration CorsairIntegration @relation(fields: [integrationId], references: [id]) > entities CorsairEntity[] > events CorsairEvent[] > > @@map("corsair_accounts") > } > > model CorsairEntity { > id String @id > createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz > updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz > accountId String @map("account_id") > entityId String @map("entity_id") > entityType String @map("entity_type") > version String > data Json @default("{}") > account CorsairAccount @relation(fields: [accountId], references: [id]) > > @@map("corsair_entities") > } > > model CorsairEvent { > id String @id > createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz > updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz > accountId String @map("account_id") > eventType String @map("event_type") > payload Json @default("{}") > status String? > account CorsairAccount @relation(fields: [accountId], references: [id]) > > @@map("corsair_events") > } > > model CorsairPermission { > id String @id > createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz > updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz > token String > plugin String > endpoint String > args String > tenantId String @map("tenant_id") > status String @default("pending") > expiresAt String @map("expires_at") > error String? > > @@map("corsair_permissions") > } > ``` Then run the migration: ```bash theme={null} npx prisma migrate dev ``` ## Example: Slack All data is scoped to tenants. `withTenant()` ensures you only read and write that tenant's rows, with no cross-contamination. ```ts theme={null} const tenant = corsair.withTenant('user_abc123'); // 1. Send a message — Corsair stores it in corsair_entities const posted = await tenant.slack.api.messages.post({ channel: 'C01234567', text: 'Hello from Corsair!', }); const messageId = posted.ts!; // 2. Someone edits the message in Slack — a webhook updates the same row // 3. Your UI reads from the local DB — always up to date const [message] = await tenant.slack.db.messages.search({ entity_id: messageId, }); console.log(message?.data.text); ``` Use `*.api.*` to write or force a fresh read. Use `*.db.*` for lists, search, and detail pages. Plugin-specific filters are in each plugin's database reference (e.g. [Slack](/plugins/slack/database)). ## Core tables Five tables, shared by every integration — Slack, GitHub, Linear, and the rest use the same schema. Connect prompts are recorded in `corsair_events`. | Table | Purpose | | - | - | | `corsair_integrations` | One row per enabled plugin (`slack`, `github`, …) | | `corsair_accounts` | Per-tenant connection + encrypted credentials (`tenant_id`, `integration_id`) | | `corsair_entities` | Synced resources like messages, channels, issues, repos (`entity_id`, `entity_type`, `data`) | | `corsair_events` | Audit log of API calls and webhooks | | `corsair_permissions` | Approval queue for gated [permissions](/concepts/permissions) (`token`, `tenant_id`, `endpoint`, `args`, `status`) | ```sql theme={null} -- corsair_entities example (a Slack message) account_id: "acc_1" entity_id: "1234567890.123456" entity_type: "messages" data: { text: "Hello!", channel: "C01234567", ts: "1234567890.123456" } ``` Schema types: [`packages/corsair/db/index.ts`](https://github.com/corsairdev/corsair/blob/main/packages/corsair/db/index.ts). ## Keeping data fresh Corsair doesn't snapshot data once and forget it. Every write path keeps the same row current: 1. **API calls**: when you call `tenant.slack.api.messages.post`, Corsair sends the request and upserts the response into `corsair_entities`. 2. **Webhooks**: when Slack notifies you that a message changed, Corsair finds the row by `entity_id` and updates it in place. 3. **Out-of-order events**: if an update arrives before you've seen the create, Corsair fetches from the API and backfills the row (see [Webhooks](/concepts/webhooks)). You don't build a sync layer or poll for changes. Query `corsair_entities` (or `*.db.*`) and trust that Corsair is maintaining it. ## How to use it ### Query through Corsair Use the typed ORM on each plugin, no raw SQL required for most reads: ```ts theme={null} const tenant = corsair.withTenant('user_abc123'); await tenant.slack.db.messages.list({ limit: 50 }); await tenant.slack.db.messages.findByEntityId('1234567890.123456'); await tenant.github.db.repositories.search({ data: { name: { contains: 'api' } } }); ``` ### Join to your own tables Reference `corsair_entities.id` from your schema and treat third-party data like first-class rows in your app: ```sql theme={null} CREATE TABLE support_tickets ( id UUID PRIMARY KEY, title TEXT NOT NULL, slack_message_id TEXT NOT NULL REFERENCES corsair_entities(id) ); ``` ```ts theme={null} // Create a ticket linked to a Corsair entity const posted = await tenant.slack.api.messages.post({ channel, text }); const [entity] = await tenant.slack.db.messages.search({ entity_id: posted.ts! }); await db.insert(supportTickets).values({ title: 'Customer issue', slackMessageId: entity!.id, // corsair_entities.id }); // Join your table to live Slack data const rows = await db .select() .from(supportTickets) .innerJoin(corsairEntities, eq(supportTickets.slackMessageId, corsairEntities.id)); // rows[].corsair_entities.data.text stays fresh via webhooks ``` Because Corsair updates `corsair_entities` on every API call and webhook, foreign keys to that table always point at current data, not a stale cache you wrote once. ### When to use API vs DB | Use | When | | - | - | | `*.api.*` | Writes, deletes, or you need the latest value right now from the source | | `*.db.*` | UI lists, search, detail pages; fast reads, no rate limits | ## SQLite, Postgres, and ORMs Corsair runs on **your** database. Pass a connection to `createCorsair`, and it works alongside whatever ORM you already use for your own tables. **SQLite** Best for local dev and small apps. Pass a `better-sqlite3` instance: ```ts theme={null} import Database from 'better-sqlite3'; export const corsair = createCorsair({ database: new Database('corsair.db'), plugins: [slack()], kek: process.env.CORSAIR_KEK!, }); ``` **PostgreSQL** Production default. Pass a `pg` Pool: ```ts theme={null} import { Pool } from 'pg'; export const corsair = createCorsair({ database: new Pool({ connectionString: process.env.DATABASE_URL }), plugins: [slack()], kek: process.env.CORSAIR_KEK!, }); ``` **Drizzle / Prisma** Define the six Corsair tables in your ORM schema (see migration tabs above), run your normal migrations, and pass the **underlying connection** to Corsair, not the ORM client: ```ts theme={null} const pool = new Pool({ connectionString: process.env.DATABASE_URL }); export const corsair = createCorsair({ database: pool, ... }); // Drizzle — your app tables export const db = drizzle(pool); // Prisma — your app tables (same pool, not PrismaClient) export const prisma = new PrismaClient(); ``` Corsair also accepts **postgres.js** and a typed **Kysely** instance if you want to share a single query builder. Supported connection types: `pg` Pool, `better-sqlite3`, postgres.js `Sql`, and Kysely. Use the same database for Corsair tables and your app tables: one migration, one connection string. ## What's next > **[Multi-Tenancy](/concepts/multi-tenancy)** > > Scope credentials and data per user with `withTenant()`. > **[Webhooks](/concepts/webhooks)** > > How incoming events update your rows automatically. > **[API](/concepts/api)** > > Call third-party APIs with full type safety. # Hooks Source: https://docs.corsair.dev/concepts/hooks Hook into API calls and webhooks to customize behavior. Hooks let you "hook into" the lifecycle of API calls and webhook processing. Use them to add custom logic like logging, validation, and transformations without modifying your core application code. ```ts corsair.ts theme={null} slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, hooks: { channels: { create: { before: (ctx, args) => { console.log("Creating channel:", args.name); return { ctx, args }; }, }, }, }, }) ``` ## Before hooks **Before hooks** run *before* an operation executes. Use them to: * Log or audit actions * Validate or modify input * Add default values * Short-circuit operations ### Modify arguments Transform the arguments before the API call is made. ```ts corsair.ts theme={null} slack({ hooks: { channels: { create: { before: (ctx, args) => { // Prefix all channel names return { ctx, args: { ...args, name: `team-${args.name}`, }, }; }, }, }, }, }) ``` ### Validate input Check conditions before proceeding. ```ts corsair.ts theme={null} slack({ hooks: { messages: { post: { before: (ctx, args) => { if (args.text && args.text.length > 4000) { throw new Error("Message too long"); } return { ctx, args }; }, }, }, }, }) ``` ### Log actions Track every API call for debugging or auditing. ```ts corsair.ts theme={null} slack({ hooks: { channels: { create: { before: (ctx, args) => { console.log(`[Slack] Creating channel: ${args.name}`); return { ctx, args }; }, }, }, }, }) ``` ## After hooks **After hooks** run *after* an operation completes. Use them to: * Log results * Trigger side effects * Transform responses * Send notifications ### Send notifications Notify your team when something happens. ```ts corsair.ts theme={null} slack({ hooks: { channels: { create: { after: async (ctx, result) => { await sendSlackNotification({ channel: "#ops", text: `New channel created: #${result.name}`, }); }, }, }, }, }) ``` ### Log results Track successful operations. ```ts corsair.ts theme={null} slack({ hooks: { messages: { post: { after: (ctx, result) => { console.log(`Message sent: ${result.ts} in ${result.channel}`); }, }, }, }, }) ``` ## API hooks API hooks are defined under `hooks` in your plugin configuration. They follow the structure: `hooks.[resource].[action].before/after`. ```ts corsair.ts theme={null} slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, hooks: { // Resource: channels channels: { // Action: create create: { before: (ctx, args) => { return { ctx, args }; }, after: (ctx, result) => { console.log("Channel created:", result.id); }, }, // Action: archive archive: { before: (ctx, args) => { console.log("Archiving:", args.channel); return { ctx, args }; }, }, }, // Resource: messages messages: { post: { after: (ctx, result) => { console.log("Message posted:", result.ts); }, }, }, }, }) ``` ## Webhook hooks Webhook hooks are defined under `webhookHooks`. They guarantee your logic runs every time a webhook is processed, even if Corsair handles the database update automatically. ```ts corsair.ts theme={null} slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, webhookHooks: { messages: { message: { before: async (ctx, payload) => { console.log("Incoming message from:", payload.user); return { ctx, payload }; }, after: async (ctx, result) => { // Sync to your analytics await analytics.track("slack_message_received", { channel: result.channel, user: result.user, }); }, }, }, reactions: { added: { after: async (ctx, result) => { console.log(`Reaction ${result.reaction} added`); }, }, }, }, }) ``` See [Webhooks](/concepts/webhooks) for more on webhook processing. ## Context object Both before and after hooks receive a `ctx` object with useful properties: * **`ctx.options`**: plugin configuration options * **`ctx.db`**: database service clients for this plugin * **`ctx.endpoints`**: bound API endpoints (call other APIs within hooks) ```ts example.ts theme={null} before: (ctx, args) => { // Access plugin options console.log(ctx.options.credentials); // Query the database const existing = await ctx.db.channels.findByResourceId(args.channel); return { ctx, args }; } ``` ## Hook order When both plugin-level and operation-level hooks exist: 1. **Before hooks** run in order: plugin then operation 2. The **operation** executes 3. **After hooks** run in order: operation then plugin This lets you add global logging at the plugin level while keeping operation-specific logic separate. # Integrations Source: https://docs.corsair.dev/concepts/integrations Add as many as you want, same syntax, same patterns. Corsair supports hundreds of integrations through its SDK. Add as many as you need and interact with them all using the same consistent syntax. ```ts corsair.ts theme={null} import { createCorsair } from "corsair"; import { slack } from "@corsair-dev/slack"; import { linear } from "@corsair-dev/linear"; export const corsair = createCorsair({ plugins: [ slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, }), linear({ authType: "api_key", credentials: { apiKey: "lin_..." }, }), ], }); ``` ## Consistent syntax Every integration uses the exact same patterns. No need to learn each SDK's unique quirks. ```ts example.ts theme={null} // Slack await corsair.slack.api.messages.post({ channel: "C01234567", text: "Hello from Slack!", }); // Linear await corsair.linear.api.issues.create({ title: "New feature request", teamId: "TEAM_123", }); // Same structure: corsair.[integration].api.[resource].[action]() ``` ## Strong typing everywhere Every integration is fully typed. Your editor shows available methods, required parameters, and response shapes. ```ts example.ts theme={null} // TypeScript knows all available endpoints corsair.slack.api.channels.create({ name: "engineering" }); corsair.slack.api.channels.archive({ channel: "C01234567" }); corsair.slack.api.messages.post({ channel: "C01", text: "Hi" }); // And all response types const channel = await corsair.slack.api.channels.get({ channel: "C01" }); console.log(channel.name, channel.is_member, channel.num_members); ``` ## No database bloat Adding more integrations doesn't add more tables. Corsair always uses the same five tables, no matter how many integrations you have. ```ts theme={null} plugins: [ slack({ ... }), linear({ ... }), github({ ... }), gmail({ ... }), // 100 more integrations — still just 5 tables ] ``` ## Adding integrations Just add plugins to the array. Each integration is configured independently. ```ts corsair.ts theme={null} export const corsair = createCorsair({ plugins: [ slack({ authType: "api_key", credentials: { botToken: process.env.SLACK_BOT_TOKEN }, }), linear({ authType: "api_key", credentials: { apiKey: process.env.LINEAR_API_KEY }, }), ], }); ``` ## Custom integrations Need an integration that doesn't exist? Creating a custom one takes less than 10 minutes. See the [Creating Custom Integrations](/guides/create-your-own-plugin) guide for a step-by-step walkthrough. ## Missing an endpoint? If an existing integration is missing an endpoint you need, [create an issue](https://github.com/corsairdev/corsair/issues) and we'll add it ASAP. ## Available integrations Corsair supports integrations including: * **Slack**: channels, messages, users, reactions, files * **Linear**: issues, projects, comments, teams * **GitHub**: repositories, issues, pull requests, actions * **Gmail**: messages, threads, labels, drafts And many more. Check the [Plugins](https://github.com/corsairdev/corsair/tree/main/packages) section for the full list. # Multi-tenancy Source: https://docs.corsair.dev/concepts/multi-tenancy One flag. Every user gets their own credentials, their own data, zero overlap. Multi-tenancy means each user of your app connects their own accounts. User A connects their GitHub. User B connects theirs. They never see each other's data. Enable it with one flag. Then scope every operation to a user with `withTenant()`. ## Enable it ```ts corsair.ts theme={null} export const corsair = createCorsair({ multiTenancy: true, // ← this is all it takes plugins: [github(), slack()], database: new Pool({ connectionString: process.env.DATABASE_URL }), kek: process.env.CORSAIR_KEK!, }); ``` With `multiTenancy: true`, Corsair won't let you call plugins directly. Every operation must go through `withTenant()`. This is enforced at the type level, so you'll get a compile error if you forget. ## Use `withTenant()` Pass any stable user identifier, such as a database ID or auth provider ID: ```ts theme={null} const tenant = corsair.withTenant('user_abc123'); // API calls use that user's credentials await tenant.github.api.repositories.list({ type: 'owner' }); // Database queries return only that user's data const repos = await tenant.github.db.repositories.search({}); // Credentials are stored per-user await tenant.github.keys.set_api_key(userGithubToken); ``` Every read, write, and API call is automatically scoped. There is no way to accidentally query another user's data through the normal API. ## How Corsair scopes it When you call `withTenant('user_abc123')`, Corsair: 1. **Adds `tenant_id = 'user_abc123'` to every `INSERT`**: all data written is tagged 2. **Adds `WHERE tenant_id = 'user_abc123'` to every `SELECT`**: you only ever read your own data 3. **Retrieves credentials scoped to that tenant**: API calls use that user's token, not yours 4. **Routes incoming webhooks** to the correct tenant via `?tenantId=user_abc123` in the URL No middleware, no manual filtering. Corsair handles it inside the database adapter. ## Per-user credential setup Each user connects their own accounts. Store credentials when they authenticate: ```ts auth-callback.ts theme={null} // Called after GitHub OAuth or when user pastes their token export async function saveUserCredentials(userId: string, githubToken: string) { const tenant = corsair.withTenant(userId); await tenant.github.keys.set_api_key(githubToken); } ``` Credentials are encrypted with your KEK and stored per-tenant. One user's token can never be decrypted by another tenant's context. ## Webhooks When registering webhooks, include the user's ID in the URL: ``` https://your-app.com/api/webhook?tenantId=user_abc123 ``` Corsair reads `tenantId` from the query string and automatically scopes the database write to that user. No routing logic on your end. ## What's next > **[Webhooks](/concepts/webhooks)** > > How to scope incoming events per tenant using the ?tenantId= param. > **[Vibe code your dashboard](/guides/dashboard)** > > Scaffold a Next.js app that uses Corsair with multi-tenancy. # Permissions Source: https://docs.corsair.dev/concepts/permissions Gate destructive agent actions behind human approval before they execute. When an AI agent calls Corsair, you need guardrails. Permissions let you set a policy per integration. Reads go through, writes may need sign-off, destructive actions can be blocked entirely. With Corsair Hub, permission approvals are handled automatically. If you're building the review UI yourself, see [Handling permission approvals](#handling-permission-approvals). ```ts corsair.ts highlight={14-20} theme={null} import { createCorsair } from "corsair"; import { github } from "@corsair-dev/github"; export const corsair = createCorsair({ database: db, kek: process.env.CORSAIR_KEK!, permissions: { timeout: "30m", onTimeout: "deny", mode: "asynchronous", }, plugins: [ github({ permissions: { mode: "cautious", overrides: { "repositories.delete": "deny", "releases.create": "require_approval", }, }, }), ], }); ``` ## How it works Every plugin endpoint has a **risk level** (`read`, `write`, or `destructive`). Your **permission mode** maps each risk level to a **policy**. When an agent calls a gated endpoint: 1. Corsair evaluates the policy for that endpoint 2. If `allow`, the call proceeds immediately 3. If `deny`, the call is blocked with no database record 4. If `require_approval`, Corsair writes a row to `corsair_permissions` and blocks the call until a human approves Approved actions are **single-use**. Once the endpoint runs successfully, the record moves to `completed` and cannot be replayed. ```mermaid theme={null} sequenceDiagram participant Agent participant Corsair participant DB as corsair_permissions participant Human Agent->>Corsair: github.api.repositories.delete(...) Corsair->>Corsair: evaluate policy → require_approval Corsair->>DB: INSERT pending record + token Corsair-->>Agent: blocked (async) or polls (sync) Human->>Corsair: approve via /approve/:token Corsair->>DB: status → approved Agent->>Corsair: retry (or executePermission) Corsair->>Corsair: run endpoint with frozen args Corsair->>DB: status → completed ``` > [!WARNING] > > Permissions require a database. Without `corsair_permissions`, any endpoint that needs approval falls back to **deny**. ## Add the permissions table If you already ran the [quick start](/quick-start) migration, add this table once. The schema matches what Corsair expects at runtime. **SQLite** > **View migration SQL** > > ```sql permissions.sql theme={null} > CREATE TABLE IF NOT EXISTS corsair_permissions ( > id TEXT PRIMARY KEY, > created_at INTEGER NOT NULL, > updated_at INTEGER NOT NULL, > token TEXT NOT NULL, > plugin TEXT NOT NULL, > endpoint TEXT NOT NULL, > args TEXT NOT NULL, > tenant_id TEXT NOT NULL, > status TEXT NOT NULL DEFAULT 'pending', > expires_at TEXT NOT NULL, > error TEXT NULL > ); > ``` **macOS / Linux** ```bash theme={null} sqlite3 corsair.db < permissions.sql ``` **Windows (PowerShell)** PowerShell syntax Bash redirection and \$VAR env vars do not work in PowerShell. Use the Windows commands shown in this tab instead. ```powershell theme={null} Get-Content permissions.sql | sqlite3 corsair.db ``` **PostgreSQL** > **View migration SQL** > > ```sql permissions.sql theme={null} > CREATE TABLE IF NOT EXISTS corsair_permissions ( > id TEXT PRIMARY KEY, > created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), > token TEXT NOT NULL, > plugin TEXT NOT NULL, > endpoint TEXT NOT NULL, > args TEXT NOT NULL, > tenant_id TEXT NOT NULL, > status TEXT NOT NULL DEFAULT 'pending', > expires_at TEXT NOT NULL, > error TEXT NULL > ); > ``` **macOS / Linux** ```bash theme={null} psql $DATABASE_URL -f permissions.sql ``` **Windows (PowerShell)** PowerShell syntax Bash redirection and \$VAR env vars do not work in PowerShell. Use the Windows commands shown in this tab instead. ```powershell theme={null} psql $env:DATABASE_URL -f permissions.sql ``` ### Column reference | Column | Purpose | | - | - | | `token` | 64-character hex token embedded in review URLs; the public handle for approve/deny | | `plugin` | Plugin id, e.g. `github` | | `endpoint` | Dot-notation path, e.g. `repositories.delete` | | `args` | JSON-encoded arguments frozen at request time, replayed exactly on approval | | `tenant_id` | Tenant scope. The SDK writes the active `withTenant()` id, or `default` for single-tenant instances. The column is `NOT NULL` with no SQL default. | | `status` | Lifecycle state (see below) | | `expires_at` | ISO8601 timestamp for when the request becomes invalid | | `error` | Error message when status is `failed` | ## Permission modes Set a default mode per plugin with `permissions.mode`. Each mode maps risk levels to policies: | Mode | Read | Write | Destructive | | - | - | - | - | | `open` | allow | allow | allow | | `cautious` | allow | allow | require\_approval | | `strict` | allow | require\_approval | deny | | `readonly` | allow | deny | deny | `cautious` is a good default for agent workloads. Agents can read and write freely, but destructive actions need a human in the loop. ```ts corsair.ts theme={null} github({ permissions: { mode: "cautious" }, }) ``` ## Approval policies Three resolved policies control what happens at call time: | Policy | Behavior | | - | - | | `allow` | Executes immediately, no approval record | | `deny` | Blocked by policy. Logs a message pointing you to the corsair config | | `require_approval` | Creates a `pending` record in `corsair_permissions` and blocks until approved | Policies come from the mode matrix above, unless you override a specific endpoint. ## Overrides Use `permissions.overrides` to tighten or loosen individual endpoints beyond the mode default. Keys are dot-notation paths through the plugin's endpoint tree, and invalid paths are compile-time errors. ```ts corsair.ts theme={null} github({ permissions: { mode: "cautious", overrides: { "repositories.delete": "deny", // never allowed, even with approval "releases.create": "require_approval", // escalate a write beyond mode default "issues.list": "allow", // loosen a strict-mode write (if needed) }, }, }) ``` Overrides take precedence over the mode matrix. An override of `deny` always wins, and no approval record is created. ## Status lifecycle Each approval request moves through these states: | Status | Meaning | | - | - | | `pending` | Waiting for human approval | | `approved` | Human signed off, ready to execute (single-use) | | `executing` | `executePermission` is running the frozen args | | `completed` | Action ran successfully, approval consumed | | `denied` | Human declined the request | | `expired` | `expires_at` passed before a decision | | `failed` | Endpoint threw during execution, see `error` column | Corsair deduplicates pending requests. If the same plugin, endpoint, args, and tenant already have a non-expired `pending` record, a second call returns the existing token instead of creating a duplicate. ## Timeout Configure timeouts and blocking behavior at the root with `createCorsair({ permissions: ... })`: > [!NOTE] > > The old `approval: { ... }` key still works but is **deprecated**. Rename it to `permissions`. TypeScript will strike through `approval` in your editor. A runtime warning is logged on startup if you still use it. ```ts corsair.ts theme={null} export const corsair = createCorsair({ permissions: { timeout: "30m", // duration string: '30s', '10m', '1h', '2h30m', '1d' onTimeout: "deny", // 'deny' (recommended) or 'approve' }, // ... }); ``` * **`timeout`**: how long a `pending` record stays valid. Defaults to `10m` if not set. Written to `expires_at` when the record is created. * **`onTimeout`**: intended behavior when the window closes without a response. With `deny`, expired records are treated as blocked. Use `approve` only in low-risk, fully trusted environments. After `expires_at`, the record is no longer actionable. Synchronous mode returns a timeout error; asynchronous retries see the request as expired. ## Handling permission approvals When an action requires approval, Corsair inserts a row into `corsair_permissions` with a unique **token**. That token is what you put in review URLs, Slack messages, or anywhere else you surface the request. Look up the row by token to see exactly what the agent wants to do. The `args` column holds the JSON-encoded arguments frozen at request time. ```sql theme={null} SELECT plugin, endpoint, args, status, tenant_id, expires_at FROM corsair_permissions WHERE token = 'abc123...'; ``` To resolve the request, update `status`: | Decision | Set `status` to | | - | - | | Approve | `approved` | | Deny | `denied` | ```sql theme={null} -- Approve UPDATE corsair_permissions SET status = 'approved', updated_at = NOW() WHERE token = $1 AND status = 'pending'; -- Deny UPDATE corsair_permissions SET status = 'denied', updated_at = NOW() WHERE token = $1 AND status = 'pending'; ``` That's the entire approval contract. Corsair handles the rest: polling in synchronous mode, retry matching in asynchronous mode, and execution once the status is `approved`. ### Synchronous vs asynchronous Control how blocked calls behave with `permissions.mode`. Agent-facing messages come from **hub** (hosted, automatic) or **`manual.onApprovalRequired`** (self-hosted review URLs). #### Asynchronous (default) The tool call returns immediately with an error. The agent sees the blocked result and must stop or retry after the user approves. Best when: * The agent should explicitly tell the user to visit a review page * You want the model to handle denial gracefully and not burn tokens polling With **hub** config, Corsair automatically returns a hosted approval URL in the agent message (see [Approvals on Hub](/hub/permissions)). With **manual** config, set `approvalBaseUrl` and optionally customize via `onApprovalRequired`: ```ts corsair.ts theme={null} manual: { approvalBaseUrl: `${PUBLIC_URL}/approve`, onApprovalRequired: ({ approvalUrl }) => `Action requires approval. Visit ${approvalUrl} then retry.`, }, ``` #### Synchronous The tool call **blocks** and polls `corsair_permissions` every 500 ms until the user approves, denies, or the timeout elapses. From the agent's perspective, it is just a slow tool call. The model does not need to handle a separate approval step. > [!WARNING] > > Many agents enforce automatic timeouts on tool calls to prevent hangs. If your agent cuts off long-running tools before you can approve, use **asynchronous** mode instead. The call returns immediately and the agent retries after approval. Best when: * You have a review UI open alongside the agent session * You want approval to feel immediate. Approve in the UI, and the agent continues automatically ```ts corsair.ts theme={null} permissions: { timeout: "10m", onTimeout: "deny", mode: "synchronous", }, ``` #### Dynamic mode Pass a function to switch modes per request, useful when approval behavior depends on runtime context: ```ts corsair.ts theme={null} permissions: { timeout: "30m", onTimeout: "deny", mode: () => (process.env.NODE_ENV === "production" ? "asynchronous" : "synchronous"), }, ``` ### Build your own review flow How you approve is entirely up to you. A few common patterns: **Manual review UI**: add a page in your app that lists pending requests, shows `plugin`, `endpoint`, and parsed `args`, and renders Approve / Deny buttons that run the `UPDATE` above. **Automated reviewer agent**: send the pending request to a second agent that evaluates whether the action is safe, then programmatically sets `status` to `approved` or `denied`. Useful when you want policy checks without a human in the loop for every write. ```ts review-page.ts theme={null} import { corsair } from "./corsair"; export async function getReviewDetails(token: string) { const record = await corsair.permissions.find_by_token(token); if (!record || record.status !== "pending") return null; return { plugin: record.plugin, endpoint: record.endpoint, args: JSON.parse(record.args), expiresAt: record.expires_at, }; } // Your route handler updates status directly on your database connection, // or call executePermission after approving to run immediately (see below). ``` Once `status` is `approved`, either the original agent retries the call or you invoke `executePermission` yourself to run the action without waiting for a retry. ## Integrating with an agent ### MCP / coding agents When using [MCP adapters](/mcp-adapters/mcp-adapters), permissions gate `run_script` calls automatically. Configure per-plugin `permissions: { mode, overrides }` and global `permissions: { timeout, mode }` on `createCorsair`. With **hub** config, blocked calls automatically include a hosted approval URL for the agent. With **manual** config, set `manual.approvalBaseUrl` (and optionally `manual.onApprovalRequired`) so agents receive a review link: ```ts corsair.ts theme={null} export const corsair = createCorsair({ hub: { /* connect via hosted UI */ }, permissions: { timeout: "1h", onTimeout: "deny", mode: "asynchronous", }, // manual approval only — connect can stay on hub manual: { approvalBaseUrl: `${PUBLIC_URL}/approve`, }, }); ``` After approval, the agent retries the same call. Corsair finds the `approved` record, runs the endpoint, and marks it `completed`. ### `executePermission` (optional) If you don't want to wait for the agent to retry after approval, call `executePermission` once `status` is `approved`. It replays the frozen args directly, no LLM involved: ```ts approve-handler.ts theme={null} import { executePermission } from "corsair"; import { corsair } from "./corsair"; export async function handleApprove(token: string) { // 1. SET status = 'approved' on the corsair_permissions row // 2. Execute immediately const result = await executePermission(corsair, token); return result; } ``` `executePermission` scopes to the correct tenant via `withTenant`, navigates `corsair[plugin].api[endpoint]`, and marks the record `completed` on success. > [!NOTE] > > The `corsair.permissions` namespace exposes `find_by_token` and `find_by_permission_id` for reads, but intentionally does not include approve/deny transitions. Those happen in your review flow. ## Multi-tenancy In multi-tenant setups, each approval record stores the `tenant_id` from the active `withTenant()` context. When the action executes, Corsair scopes to that tenant's credentials and data. ```ts theme={null} const tenant = corsair.withTenant("user_abc123"); await tenant.github.api.repositories.delete({ owner, repo }); // → corsair_permissions.tenant_id = 'user_abc123' ``` See [Multi-Tenancy](/concepts/multi-tenancy) for tenant scoping details. ## What's next > **[MCP Adapters](/mcp-adapters/mcp-adapters)** > > Wire Corsair into Cursor, Claude Code, or any MCP-compatible agent. > **[Multi-Tenancy](/concepts/multi-tenancy)** > > Scope approvals and credentials per user with withTenant(). > **[Database](/concepts/database)** > > The five core tables Corsair uses for synced integration data. > **[Hooks](/concepts/hooks)** > > Add custom logic before and after API calls: logging, validation, side effects. # CLI Source: https://docs.corsair.dev/concepts/provisioning Initialize integrations, accounts, and tenants with setupCorsair at runtime or the corsair CLI in ops. Provisioning creates the database rows, DEKs, and credential slots Corsair needs before a tenant can connect. The same logic runs two ways: `setupCorsair` from your backend (on signup, in production) and `pnpm corsair setup` from the CLI (local and ops). Both are idempotent, so they skip rows that already exist. ## Data model ``` corsair_integrations ← one row per plugin in createCorsair({ plugins }) corsair_accounts ← one row per (tenant, plugin with an authType) ``` | Layer | Table | Scope | Holds | | - | - | - | - | | Integration | `corsair_integrations` | Shared | OAuth app creds: `client_id`, `client_secret`, `redirect_url` | | Account | `corsair_accounts` | Per tenant | API keys, OAuth tokens, refresh tokens | | Tenant | *(no table)* | Your ID string | Materializes once account rows exist | Account rows are created only for plugins with an `authType` (`api_key`, `oauth_2`, `bot_token`, `managed`). A tenant is any stable ID you choose: user id, org id, workspace slug. Provisioning touches only these two credential tables. The other three (entities, events, permissions) are covered under [Database](/concepts/database) and [Permissions](/concepts/permissions). ## setupCorsair Call it from your backend, most often on signup, with no deploy per tenant. ```ts onboarding.ts theme={null} import { setupCorsair } from 'corsair'; import { corsair } from '@/server/corsair'; export async function onUserCreated(userId: string) { await setupCorsair(corsair, { tenantId: userId }); } ``` The same call covers single-tenant, credentials, and backfill: ```ts theme={null} // Single-tenant → provisions "default" await setupCorsair(corsair); // Multi-tenant → provision a tenant, seed a credential, backfill data await setupCorsair(corsair, { tenantId: 'workspace_123', credentials: { linear: { api_key: process.env.LINEAR_KEY! } }, backfill: true, }); ``` It returns a log string and skips existing rows. ### What it creates | Creates | Does not touch | | - | - | | `corsair_accounts` per auth-type plugin | New plugins (needs a code change) | | Account DEKs | OAuth tokens (arrive on connect) | | `corsair_integrations` rows if missing | Integration creds (set those explicitly) | ## CLI Same provisioning from the terminal, for local setup and ops: ```bash theme={null} # Single-tenant pnpm corsair setup pnpm corsair setup --slack api_key=xoxb-... --linear api_key=lin_api_... # Multi-tenant — account rows + account credentials pnpm corsair setup --tenant=workspace_123 --linear api_key=lin_api_... # Integration-level OAuth app creds — no --tenant, even on multi-tenant pnpm corsair setup --gmail client_id=... client_secret=... ``` | Flag | Effect | | - | - | | `--tenant ` | Account rows + account credentials | | `-- field=value` | Inline credentials | | `--backfill` | Seed data (`setup/backfill.config.ts`); needs `--tenant` on multi-tenant | ## Credentials **Integration-level**: shared OAuth app creds, one per plugin: ```ts theme={null} await corsair.keys.gmail.set_client_id('...'); await corsair.keys.gmail.set_client_secret('...'); ``` **Account-level**: per tenant, for `api_key` / `bot_token` fields and OAuth tokens: ```ts theme={null} // multi-tenant await corsair.withTenant('user_abc').linear.keys.set_api_key('lin_api_...'); // single-tenant await corsair.linear.keys.set_api_key('lin_api_...'); ``` `keys.set_*()` needs an account row first. Run `setupCorsair({ tenantId })` before setting API keys. > [!WARNING] > > Multi-tenant: passing integration fields together with a `tenantId` in `setupCorsair({ credentials })` throws. Set integration creds without a `tenantId`. ## Multi-tenant ```ts corsair.ts theme={null} export const corsair = createCorsair({ multiTenancy: true, plugins: [github(), linear()], database: db, kek: process.env.CORSAIR_KEK!, }); ``` | Task | `--tenant` / `tenantId` | | - | - | | Integration rows + OAuth app creds | Omit | | Account rows, account creds, backfill | Required | Every runtime call goes through `corsair.withTenant(id)`. See [Multi-tenancy](/concepts/multi-tenancy). ## OAuth Provisioning does not run OAuth; it prepares the rows. Tokens arrive when a user connects. After integration creds are set: ```bash theme={null} pnpm corsair auth --plugin=gmail --tenant=workspace_123 ``` Or in app code, [`corsair.manage.connect.oauthCallback`](/concepts/oauth-process) stores the tokens and creates the account row lazily if missing. This is the OAuth-only path. You can skip `setupCorsair({ tenantId })` on signup and let the first connect provision the row. API keys still need `setupCorsair` first. ## Adding a plugin later Plugins come from `createCorsair({ plugins: [...] })`, so adding one is a code change and deploy. After deploying: ```bash theme={null} pnpm corsair setup # integration row (+ default account, single-tenant) pnpm corsair setup --gmail client_id=... client_secret=... ``` Multi-tenant provisioning of the new plugin for existing tenants (each still authorizes it separately; rows are not copied): ```ts theme={null} for (const tenantId of await listActiveTenantIds()) { await setupCorsair(corsair, { tenantId }); } ``` > [!WARNING] > > Removing a plugin from code does not delete its database rows. > [!NOTE] > > `corsair.manage.tenants.create()` records a tenant but does **not** create account rows. Use `setupCorsair` or the CLI to provision. # Triggers Source: https://docs.corsair.dev/concepts/webhooks One endpoint for every incoming webhook, automatically routed and verified. Corsair consolidates all incoming webhooks to a single URL. It identifies which integration and service each webhook belongs to, then processes and updates your data automatically. ```ts webhook-handler.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "./corsair"; export async function handleWebhook(req: Request) { const url = new URL(req.url); const result = await processWebhook( corsair, // corsair instance Object.fromEntries(req.headers), // headers await req.json(), // body { tenantId: url.searchParams.get('tenantId') // tenant id } ); if (result.plugin) { console.log(`Handled by ${result.plugin}.${result.action}`); } return result.response; } ``` > [!NOTE] > > Note that webhooks are not guaranteed by most senders. If your project requires completely fresh data, add polling for that integration using an [api call](/concepts/api). ## Automatic routing Point all your webhooks to a single endpoint. Corsair inspects the headers and payload to determine: 1. Which **integration** the webhook is from (Slack, Linear, etc.) 2. Which **event type** it represents (message, issue created, etc.) 3. Which **tenant** it belongs to (in multi-tenant setups) ## Handling out-of-order webhooks Webhooks don't guarantee delivery order. You might receive an "updated" event before you've processed the "created" event. Most applications fail here. They don't know about a record, so they can't process its update. Corsair solves this automatically: 1. Detects when an update arrives for an unknown record 2. Fetches the latest data from the API 3. Creates the record in your database 4. Processes both the create and update Your data stays fresh, and no webhooks are lost. ## Multi-tenancy with webhooks If you have multi-tenancy enabled, we recommend adding a hashed tenant ID as a query parameter to your webhook URL. > [!WARNING] > > It is recommended you hash the tenant id in the query param so your internal IDs are not publicly known. ``` https://api.yourapp.com/webhooks?tenant=hashed_tenant_id ``` This lets Corsair identify which tenant incoming webhook data belongs to, ensuring proper isolation. ## Signature verification Corsair automatically verifies webhook signatures using your stored webhook credentials. If a signature doesn't match, the webhook is rejected, protecting you from spoofed requests. ## Webhook hooks Hooks let you add custom logic that runs every time a webhook is processed. This guarantees your code executes, even when Corsair handles the database update automatically. ```ts corsair.ts theme={null} slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, webhookHooks: { messages: { message: { before: async (ctx, payload) => { console.log("Incoming message from:", payload.user); return { ctx, payload }; }, after: async (ctx, result) => { // This always runs after the webhook is processed await analytics.track("message_received", { channel: result.channel, }); }, }, }, }, }) ``` ### Before hooks Before hooks run before the webhook is processed. Use them to: * Validate the payload * Log incoming webhooks * Modify the payload before processing * Skip processing by throwing an error Return **`{ ctx, args }`**, where `args` is what the handler receives (usually the same request body, optionally changed). ```ts corsair.ts theme={null} webhookHooks: { messages: { message: { before: async (ctx, request) => { if (yourAppShouldSkipThis(request)) { return { ctx, args: request, continue: false }; } return { ctx, args: request }; }, }, }, } ``` Optional **`continue`** (defaults to `true`) Set **`continue: false`** to stop without running the handler. That is a silent skip, which will not `throw`. ### After hooks After hooks run after the webhook is processed and the database is updated. Use them to: * Trigger side effects (notifications, syncs) * Update related records in your application * Send data to external services * Log processed webhooks ```ts corsair.ts theme={null} webhookHooks: { channels: { created: { after: async (ctx, result) => { // Notify your team when a new channel is created await sendNotification({ title: "New Slack channel", body: `#${result.name} was created`, }); }, }, }, reactions: { added: { after: async (ctx, result) => { // Track reactions for analytics await analytics.track("reaction_added", { reaction: result.reaction, channel: result.channel, }); }, }, }, } ``` ### The `passToAfter` argument You can set **`passToAfter`** on the object returned from **before**. Corsair passes that value through as the third argument to **after**, unchanged. This is useful when you need to carry a value you only know at before-time, such as an ID you generate or a record you create, into the after hook, where you finalize or clean it up once processing is complete. > [!NOTE] > > The **after** hook only runs when the webhook handler succeeds. If processing fails, **after** is skipped and `passToAfter` is never used. ```ts corsair.ts theme={null} googleCalendar({ webhookHooks: { onEventChanged: { before: async (ctx, request) => { const event = await db.events.create({ name: "Google Calendar Event", status: "processing", }) return { ctx, args: request, passToAfter: event.id }; }, after: async (ctx, result, passToAfter) => { const event = await db.events.update(passToAfter, { name: "Google Calendar Event", status: "successful", }) }, }, }, }) ``` ### Guaranteed execution The key benefit of webhook hooks is they **always run** when that webhook type is processed. Unlike manually handling webhooks where you might forget to add logging or notifications, hooks ensure your logic is centralized and guaranteed to execute. ```ts corsair.ts theme={null} webhookHooks: { issues: { update: { after: async (ctx, result) => { // This ALWAYS runs when a Linear issue is updated // No matter where the webhook comes from await syncToYourDatabase(result); await notifyAssignee(result); await updateProjectMetrics(result); }, }, }, } ``` See [Hooks](/concepts/hooks) for the full hooks documentation. # Astro Source: https://docs.corsair.dev/frameworks/astro Mount Corsair as an Astro API route, then read synced data straight from .astro frontmatter, server-rendered per request. Astro sites are mostly static, but the interesting pages pull live data at request time. Corsair suits that well. The handler is one API route, and any page that should show integration data flips to server rendering and reads Corsair's synced tables right in its frontmatter. No client fetch, no loading spinner, just HTML with the data already in it. ## Install The adapter ships in core. Each integration is its own package. Add one per service you connect. ```bash npm theme={null} npm i corsair @corsair-dev/github ``` ```bash pnpm theme={null} pnpm add corsair @corsair-dev/github ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/github ``` ```bash bun theme={null} bun add corsair @corsair-dev/github ``` Every service is its own `@corsair-dev/*` package. The full catalog with exact ids is in [Plugins](/guides/plugins). ## Create the instance Build the instance once. The handler and your read/write code both import it. ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; export const corsair = createCorsair({ database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, multiTenancy: true, plugins: [github({ authType: 'managed' })], // one entry per @corsair-dev/* package you install }); ``` The handler and every `.db` / `.api` call on this page import this `corsair`. `multiTenancy: true` is what makes `corsair.withTenant(id)` available, and a `tenant.github.*` call resolves to the `github()` entry here. Add a service by installing its `@corsair-dev/*` package and dropping it into `plugins`. Database choices and the Hub keys are in [Quick Start](/quick-start). ## Mount the handler ```ts src/pages/api/corsair/[...path].ts theme={null} import { toAstroHandler } from 'corsair'; import { corsair } from '../../../server/corsair'; export const { GET, POST, OPTIONS } = toAstroHandler(corsair, { basePath: '/api/corsair' }); export const prerender = false; ``` `../../../server/corsair` is your `createCorsair({ ... })` instance. See [Getting Started](/quick-start) if you haven't built it yet. > [!WARNING] > > `export const prerender = false` is required. The route must run on the server per request, not be frozen at build time. Any page that reads live Corsair data needs the same line. ## Resolve the tenant Every read and write is scoped to a tenant id, whatever stable id identifies the current user or org. A server-rendered page has `Astro.request` and, if you use one, your session, so resolve the id there (however your auth works) and pass it to `withTenant`. ```astro theme={null} --- export const prerender = false; const tenantId = await getTenantId(Astro.request); // getTenantId is YOUR code const tenant = corsair.withTenant(tenantId); --- ``` ## Read and write The `.db` namespace reads your own database, so a server-rendered page can query it in the frontmatter fence and the results land in the initial HTML. Because the page ran on the server, no token or query ever reaches the browser. ```astro src/pages/issues.astro theme={null} --- export const prerender = false; import { corsair } from '../server/corsair'; const tenantId = await getTenantId(Astro.request); const tenant = corsair.withTenant(tenantId); const issues = await tenant.github.db.issues.search({ data: { state: 'open' }, limit: 50, }); ---
    {issues.map((i) =>
  • {i.data.title} — {i.data.user?.login}
  • )}
``` Writes go through `.api`. From a form POST or an API route, call e.g. `await tenant.github.api.issues.create({ owner: 'acme', repo: 'app', title: '…' })`. Corsair upserts the response, so the next server render already shows it. Entity fields live on `.data` in camelCase. ## Connect a tenant Connecting is interactive, but it doesn't need a UI framework. Use the framework-agnostic [vanilla client](/adapters/client) from a small ` ``` A mutation is a `.post` handler that calls `.api`, e.g. `await tenant.github.api.issues.create({ owner: 'acme', repo: 'app', title: '…' })`. Entity fields live on `.data` in camelCase. ## Refresh after a write The `.api` write already made `.db` current, so the page just needs to re-read. `useFetch` gives you a `refresh` for that. Call it after the mutation resolves, or `refreshNuxtData('issues')` from anywhere by key. ```vue theme={null} ``` ## Connect a tenant Nuxt renders Vue, and Corsair's typed hooks client is React-only, so use the framework-agnostic [vanilla client](/adapters/client) for the connect flow. Create it once and call it from a Nitro route or a plain client script; it mints a connect link and reports status without any UI framework. **1. Create the client** ```ts corsair-client.ts theme={null} import { createCorsairClient } from "corsair"; export const client = createCorsairClient({ baseURL: "/api/corsair" }); ``` `createCorsairClient` is a typed fetch wrapper over the management API, no React required. Use it from your frontend, a worker, or a script. Every route is typed against its response. Full surface on the [Vanilla Client](/adapters/client) reference. **2. Read what's connected** ```ts connections.ts theme={null} const status = await client.connectionStatus.get({ tenantId: "acme" }); // { github: 'connected', slack: 'not_connected', notion: 'missing_credentials' } ``` `connectionStatus.get` returns a map of plugin id to `connected | missing_credentials | not_connected`, so you can show what's live and what still needs connecting. **3. Mint a connect link** ```ts connect.ts theme={null} const { connectUrl } = await client.connect.createLink({ plugin: "github", tenantId: "acme", }); window.location.href = connectUrl; // send the user to Hub's hosted connect page ``` Hub hosts the consent screen and runs the OAuth handshake. When the user returns, the tokens are already encrypted in your own database. You never saw them, and neither did Hub. Swap `"github"` for any [plugin](/guides/plugins) you configured. ## Go green ```bash theme={null} npm run dev ``` The first request to `/api/corsair` registers your delivery URL with Hub and turns the **App sync** dot in the dashboard header green. ## Deploy Deploy the Nuxt app as usual, and the Nitro server route ships with it. In production, `/api/corsair` at your deployed origin is the delivery URL Hub calls, so nothing extra to wire up. ## Next > **[Build a dashboard](/use-cases/dashboards)** > > The full read-`.db`, write-`.api` pattern behind the example above. > **[Connect / OAuth](/management/connect)** > > The full connect flow, error codes, and retry. > **[Use with an agent](/mcp-adapters/vercel-ai)** > > Give an agent the Corsair tools and let it call any endpoint. > **[Multi-tenancy](/concepts/multi-tenancy)** > > One flag and every user gets their own data and credentials. # Remix Source: https://docs.corsair.dev/frameworks/remix Loaders read from .db, actions write through .api. Corsair's read/write split lands directly on Remix's data model. Remix splits every route into a `loader` that reads and an `action` that writes. Corsair splits every plugin into `.db` for reads and `.api` for writes. The two models line up one-to-one, so a Corsair-backed route is just Remix with the data source swapped. React Router v7 works identically. ## Install ```bash npm theme={null} npm i corsair @corsair-dev/github ``` ```bash pnpm theme={null} pnpm add corsair @corsair-dev/github ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/github ``` ```bash bun theme={null} bun add corsair @corsair-dev/github ``` The adapters ship in core `corsair`; add one `@corsair-dev/*` package per service you connect. The full list is in [Plugins](/guides/plugins). ## Create the instance Build the instance once. The handler and your read/write code both import it. ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; export const corsair = createCorsair({ database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, multiTenancy: true, plugins: [github({ authType: 'managed' })], // one entry per @corsair-dev/* package you install }); ``` The handler and every `.db` / `.api` call on this page import this `corsair`. `multiTenancy: true` is what makes `corsair.withTenant(id)` available, and a `tenant.github.*` call resolves to the `github()` entry here. Add a service by installing its `@corsair-dev/*` package and dropping it into `plugins`. Database choices and the Hub keys are in [Quick Start](/quick-start). ## Mount the handler Route modules receive a standard `Request`, which is exactly what the adapter needs. Add a splat route and export the pair. ```ts app/routes/api.corsair.$.ts theme={null} import { toRemixHandler } from 'corsair'; import { corsair } from '~/server/corsair'; export const { loader, action } = toRemixHandler(corsair, { basePath: '/api/corsair', }); ``` `~/server/corsair` is your `createCorsair({ ... })` instance. On React Router v7 the file is `api.corsair.$.tsx` with the same exports. ## Resolve the tenant Both `loader` and `action` receive the `request`, so read the user off your session the way you already do and pass that id to `withTenant`. Corsair brings no auth of its own; it only needs the resolved id. ```ts theme={null} import { getTenantId } from '~/server/tenant'; // your auth, not Corsair's const tenantId = await getTenantId(request); const tenant = corsair.withTenant(tenantId); ``` ## Read and write The `loader` reads `.db` and returns it; `useLoaderData` renders it. No network call happens on navigation, so the route is as fast as a local query. ```tsx app/routes/issues.tsx theme={null} import { corsair } from '~/server/corsair'; import { getTenantId } from '~/server/tenant'; import { Form, useLoaderData } from '@remix-run/react'; export async function loader({ request }: { request: Request }) { const tenant = corsair.withTenant(await getTenantId(request)); const issues = await tenant.github.db.issues.search({ data: { state: 'open' }, limit: 50, }); return { issues }; } export async function action({ request }: { request: Request }) { const tenant = corsair.withTenant(await getTenantId(request)); const number = Number((await request.formData()).get('number')); await tenant.github.api.issues.update({ owner: 'acme', repo: 'app', issueNumber: number, state: 'closed', }); return null; } export default function Issues() { const { issues } = useLoaderData(); return (
    {issues.map((issue) => (
  • {issue.data.title}
  • ))}
); } ``` ## Refresh after a write Remix re-runs the page's `loader` automatically after an `action` returns. The `.api` write already upserted into `.db`, so that revalidation renders the closed issue out of the list with no manual invalidation and no client state to reconcile. ## Connect a tenant A tenant has to connect GitHub before the loader has anything to read. That flow is client-side, so create the React hook client once and call the hooks from any route or component. **1. Create the client** ```tsx app/corsair-client.ts theme={null} "use client"; import { createCorsairReactClient } from "corsair/client/react"; export const { useConnectionStatus, useCreateConnectLink, useTenants, client, // escape hatch — the vanilla client } = createCorsairReactClient({ baseURL: "/api/corsair" }); ``` One factory call per app. Every hook is typed against your handler, so `useTenants()` knows it returns tenants. `client` is the escape hatch to the [vanilla client](/adapters/client) for imperative calls. The full hook list is on the [React Hooks](/adapters/react) reference. **2. Read what's connected** ```tsx connections.tsx theme={null} "use client"; import { useConnectionStatus } from "./corsair-client"; export function Connections({ tenantId }: { tenantId: string }) { const { data } = useConnectionStatus({ tenantId }); if (!data) return null; return (
    {Object.entries(data).map(([plugin, status]) => (
  • {plugin}: {status === "connected" ? "✓" : "Connect →"}
  • ))}
); } ``` `useConnectionStatus` returns a map of plugin id to `connected | missing_credentials | not_connected`, so your UI knows what's live and what still needs a connect flow. **3. Mint a connect link** ```tsx connect-github.tsx theme={null} "use client"; import { useConnectionStatus, useCreateConnectLink } from "./corsair-client"; export function ConnectGitHub({ tenantId }: { tenantId: string }) { const { mutate, loading } = useCreateConnectLink(); const { data: status } = useConnectionStatus({ tenantId }); if (status?.github === "connected") return GitHub connected ✓; return ( ); } ``` Hub hosts the consent screen and runs the OAuth handshake. When the user returns, the tokens are already encrypted in your own database. You never saw them, and neither did Hub. Swap `"github"` for any [plugin](/guides/plugins) you configured. ## Go green ```bash theme={null} npm run dev ``` The first request to `/api/corsair` registers your delivery URL with Hub and flips the **App sync** dot in the dashboard header to green. ## Deploy Deploy however you already ship this app. In production the mounted `/api/corsair` route is the delivery URL Hub calls. The same splat route serves it whether you're on a Node server or a Web-standard host. ## Next > **[Build a dashboard](/use-cases/dashboards)** > > The `.db` read / `.api` write pattern in full, with refresh and webhooks. > **[React hooks](/adapters/react)** > > Every hook the client factory returns, with types and examples. > **[Connect / OAuth](/management/connect)** > > The full connect flow, error codes, and retry. > **[Multi-tenancy](/concepts/multi-tenancy)** > > One flag and every user gets their own data and credentials. # SvelteKit Source: https://docs.corsair.dev/frameworks/sveltekit Read synced data in a load function, render it in +page.svelte, and mutate through form actions. SvelteKit keeps server work in `+page.server.ts`. A `load` function fetches, `+page.svelte` renders, and form actions mutate. Corsair drops straight into that flow, with `load` reading from `.db` and form actions writing through `.api`, and the handler itself living in a Web-standard endpoint. ## Install ```bash npm theme={null} npm i corsair @corsair-dev/github ``` ```bash pnpm theme={null} pnpm add corsair @corsair-dev/github ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/github ``` ```bash bun theme={null} bun add corsair @corsair-dev/github ``` The adapters ship inside core `corsair`; add one plugin package per service you connect. ## Create the instance Build the instance once. The handler and your read/write code both import it. ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; export const corsair = createCorsair({ database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, multiTenancy: true, plugins: [github({ authType: 'managed' })], // one entry per @corsair-dev/* package you install }); ``` The handler and every `.db` / `.api` call on this page import this `corsair`. `multiTenancy: true` is what makes `corsair.withTenant(id)` available, and a `tenant.github.*` call resolves to the `github()` entry here. Add a service by installing its `@corsair-dev/*` package and dropping it into `plugins`. Database choices and the Hub keys are in [Quick Start](/quick-start). ## Project layout ``` src/ hooks.server.ts # populates event.locals.user routes/api/corsair/[...rest]/+server.ts # the handler routes/issues/+page.server.ts # load reads .db, action writes .api routes/issues/+page.svelte # renders data.issues lib/server/corsair.ts # createCorsair instance ``` ## Mount the handler An endpoint receives a `Request` and returns a `Response`, which is exactly the adapter's shape. Add a rest-parameter route and export the pair. ```ts src/routes/api/corsair/[...rest]/+server.ts theme={null} import { toSvelteKitHandler } from 'corsair'; import { corsair } from '$lib/server/corsair'; export const { GET, POST, OPTIONS } = toSvelteKitHandler(corsair, { basePath: '/api/corsair', }); ``` `$lib/server/corsair` is your `createCorsair({ ... })` instance. The `[...rest]` segment catches `/api/corsair` and every path beneath it. ## Resolve the tenant Set the signed-in user on `event.locals` in `hooks.server.ts`, which is your auth's job, not Corsair's. Then `load` and form actions read it off `locals` and hand the id to `withTenant`. ```ts theme={null} // in load / actions — event.locals.user comes from hooks.server.ts const tenant = corsair.withTenant(await getTenantId(locals)); ``` ## Read and write `load` reads `.db` and hands the data to the page, with no network on navigation. A form action writes through `.api`; because Corsair upserts the response into your database as part of the call, the next `load` sees the row already current. ```ts src/routes/issues/+page.server.ts theme={null} import { corsair } from '$lib/server/corsair'; export async function load({ locals }) { const tenant = corsair.withTenant(await getTenantId(locals)); const issues = await tenant.github.db.issues.search({ data: { state: 'open' }, limit: 50, }); return { issues }; } export const actions = { close: async ({ locals, request }) => { const tenant = corsair.withTenant(await getTenantId(locals)); const number = Number((await request.formData()).get('number')); await tenant.github.api.issues.update({ owner: 'acme', repo: 'app', issueNumber: number, state: 'closed', }); }, }; ``` The page renders `data.issues` and posts to the action. Entity fields live on `.data` in camelCase: ```svelte src/routes/issues/+page.svelte theme={null}
    {#each data.issues as issue (issue.id)}
  • {issue.data.title}
  • {/each}
``` ## Refresh after a write A form action that returns nothing makes SvelteKit re-run the page's `load`, so the closed issue drops off on its own. When a write happens outside a form, such as a button handler or a websocket message, call `invalidate` to re-run `load` yourself; the `.api` upsert means the re-read is already current. ```ts theme={null} import { invalidateAll } from '$app/navigation'; await invalidateAll(); // re-runs load; .db already reflects the write ``` ## Connect a tenant A tenant connects GitHub before `load` has anything to read. Svelte isn't React, so use the vanilla client from a component, a `load` function, or a script. **1. Create the client** ```ts corsair-client.ts theme={null} import { createCorsairClient } from "corsair"; export const client = createCorsairClient({ baseURL: "/api/corsair" }); ``` `createCorsairClient` is a typed fetch wrapper over the management API, no React required. Use it from your frontend, a worker, or a script. Every route is typed against its response. Full surface on the [Vanilla Client](/adapters/client) reference. **2. Read what's connected** ```ts connections.ts theme={null} const status = await client.connectionStatus.get({ tenantId: "acme" }); // { github: 'connected', slack: 'not_connected', notion: 'missing_credentials' } ``` `connectionStatus.get` returns a map of plugin id to `connected | missing_credentials | not_connected`, so you can show what's live and what still needs connecting. **3. Mint a connect link** ```ts connect.ts theme={null} const { connectUrl } = await client.connect.createLink({ plugin: "github", tenantId: "acme", }); window.location.href = connectUrl; // send the user to Hub's hosted connect page ``` Hub hosts the consent screen and runs the OAuth handshake. When the user returns, the tokens are already encrypted in your own database. You never saw them, and neither did Hub. Swap `"github"` for any [plugin](/guides/plugins) you configured. ## Go green ```bash theme={null} npm run dev ``` The first request to `/api/corsair` registers your delivery URL with Hub and turns the **App sync** dot in the dashboard header green. ## Deploy Pick the SvelteKit adapter for your target (`adapter-node`, `adapter-vercel`, and so on) and deploy as usual. The endpoint runs server-side under every adapter, so in production `/api/corsair` is the delivery URL Hub calls. ## Next > **[Build a dashboard](/use-cases/dashboards)** > > The `.db` read / `.api` write pattern in full, with refresh and webhooks. > **[Vanilla client](/adapters/client)** > > Every management-API method the client exposes, fully typed. > **[Connect / OAuth](/management/connect)** > > The full connect flow, error codes, and retry. > **[Multi-tenancy](/concepts/multi-tenancy)** > > One flag and every user gets their own data and credentials. # TanStack Start Source: https://docs.corsair.dev/frameworks/tanstack Mount Corsair as a TanStack Start server route, read synced data in a server function or loader, and connect tenants with React hooks. TanStack Start is full-stack React with no serialization seam you have to think about. A server function runs on the server, returns typed data, and the type flows straight into the component that called it. Corsair rides that all the way. Call `.db` inside a server function or a route loader and the entity types land in your JSX without a hand-written API boundary. ## Install The adapter ships in core. Each integration is its own package. Add one per service you connect. ```bash npm theme={null} npm i corsair @corsair-dev/github ``` ```bash pnpm theme={null} pnpm add corsair @corsair-dev/github ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/github ``` ```bash bun theme={null} bun add corsair @corsair-dev/github ``` Every service is its own `@corsair-dev/*` package. The full catalog with exact ids is in [Plugins](/guides/plugins). ## Create the instance Build the instance once. The handler and your read/write code both import it. ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; export const corsair = createCorsair({ database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, multiTenancy: true, plugins: [github({ authType: 'managed' })], // one entry per @corsair-dev/* package you install }); ``` The handler and every `.db` / `.api` call on this page import this `corsair`. `multiTenancy: true` is what makes `corsair.withTenant(id)` available, and a `tenant.github.*` call resolves to the `github()` entry here. Add a service by installing its `@corsair-dev/*` package and dropping it into `plugins`. Database choices and the Hub keys are in [Quick Start](/quick-start). ## Mount the handler Export the adapter from a splat server route. ```ts src/routes/api/corsair/$.ts theme={null} import { toTanStackHandler } from 'corsair'; import { corsair } from '~/server/corsair'; export const { GET, POST, OPTIONS } = toTanStackHandler(corsair, { basePath: '/api/corsair' }); ``` `~/server/corsair` is your `createCorsair({ ... })` instance. See [Getting Started](/quick-start) if you haven't built it yet. > [!NOTE] > > Server-route helpers have shifted across TanStack Start releases. If your version wraps routes differently, keep the shape: a splat route under `/api/corsair` whose `GET`/`POST`/`OPTIONS` come from `toTanStackHandler`. ## Resolve the tenant Every read and write is scoped to a tenant id, whatever stable id identifies the current user or org. Resolve that id inside each data server function. Read your session from its request context (however your auth works), pass the id to `corsair.withTenant(tenantId)`, and return only plain data (rows) to the client. Never return the client from `withTenant`: a server function serializes its return value across to the client, which strips the client's methods. The `getIssues` example below shows the pattern. ## Read and write Wrap the read in a server function so it runs on the server and its return type reaches the client. Load it from a route with `loader`, and the `.db` result is fully typed in the component. ```tsx src/routes/issues.tsx theme={null} import { createServerFn } from '@tanstack/react-start'; import { createFileRoute } from '@tanstack/react-router'; import { corsair } from '~/server/corsair'; const getIssues = createServerFn().handler(async () => { const tenantId = await getTenantId(); const tenant = corsair.withTenant(tenantId); return tenant.github.db.issues.search({ data: { state: 'open' }, limit: 50 }); }); export const Route = createFileRoute('/issues')({ loader: () => getIssues(), component: () => { const issues = Route.useLoaderData(); return issues.map((i) =>
  • {i.data.title} — {i.data.user?.login}
  • ); }, }); ``` To write, give a server function the mutation and call `.api`, e.g. `await tenant.github.api.issues.create({ owner: 'acme', repo: 'app', title: '…' })`. Corsair upserts the response, so the next loader read reflects it. Entity fields live on `.data` in camelCase. ## Refresh after a write The `.api` write already made `.db` current, so the loader just needs to run again. Call `router.invalidate()` after the mutating server function resolves and the route re-runs its loader with fresh `.db` data. ```tsx theme={null} const router = useRouter(); async function close(number: number) { await closeIssue({ data: { number } }); // server fn calling .api await router.invalidate(); } ``` ## Connect a tenant The connect UI is plain React, so use the typed [React hooks](/adapters/react) client. Create it once and call the hooks from any route or component. **1. Create the client** ```tsx app/corsair-client.ts theme={null} "use client"; import { createCorsairReactClient } from "corsair/client/react"; export const { useConnectionStatus, useCreateConnectLink, useTenants, client, // escape hatch — the vanilla client } = createCorsairReactClient({ baseURL: "/api/corsair" }); ``` One factory call per app. Every hook is typed against your handler, so `useTenants()` knows it returns tenants. `client` is the escape hatch to the [vanilla client](/adapters/client) for imperative calls. The full hook list is on the [React Hooks](/adapters/react) reference. **2. Read what's connected** ```tsx connections.tsx theme={null} "use client"; import { useConnectionStatus } from "./corsair-client"; export function Connections({ tenantId }: { tenantId: string }) { const { data } = useConnectionStatus({ tenantId }); if (!data) return null; return (
      {Object.entries(data).map(([plugin, status]) => (
    • {plugin}: {status === "connected" ? "✓" : "Connect →"}
    • ))}
    ); } ``` `useConnectionStatus` returns a map of plugin id to `connected | missing_credentials | not_connected`, so your UI knows what's live and what still needs a connect flow. **3. Mint a connect link** ```tsx connect-github.tsx theme={null} "use client"; import { useConnectionStatus, useCreateConnectLink } from "./corsair-client"; export function ConnectGitHub({ tenantId }: { tenantId: string }) { const { mutate, loading } = useCreateConnectLink(); const { data: status } = useConnectionStatus({ tenantId }); if (status?.github === "connected") return GitHub connected ✓; return ( ); } ``` Hub hosts the consent screen and runs the OAuth handshake. When the user returns, the tokens are already encrypted in your own database. You never saw them, and neither did Hub. Swap `"github"` for any [plugin](/guides/plugins) you configured. ## Go green ```bash theme={null} npm run dev ``` The first request to `/api/corsair` registers your delivery URL with Hub and turns the **App sync** dot in the dashboard header green. ## Deploy Deploy the TanStack Start app as usual, and the server route ships with it. In production, `/api/corsair` at your deployed origin is the delivery URL Hub calls. ## Next > **[React hooks](/adapters/react)** > > Every hook the client factory returns, with types and examples. > **[Connect / OAuth](/management/connect)** > > The full connect flow, error codes, and retry. > **[Use with an agent](/mcp-adapters/vercel-ai)** > > Give an agent the Corsair tools and let it call any endpoint. > **[Multi-tenancy](/concepts/multi-tenancy)** > > One flag and every user gets their own data and credentials. # Build a plugin Source: https://docs.corsair.dev/guides/create-your-own-plugin Scaffold a new Corsair plugin with the generator, then let Claude Code fill in the implementation. > [!TIP] > > **Use Claude Code to build your plugin.** Run the steps below in your terminal, then paste the prompt from the guide into Claude Code. It will fill in the real API calls for you. The fastest way to build a custom plugin is to use the built-in generator. It scaffolds the full directory structure, wires up types, and registers your plugin. Then you (or Claude Code) fill in the real API calls. **1. Fork or clone the Corsair repo** Plugins live inside the monorepo alongside the core library. ```bash theme={null} git clone https://github.com/corsairdev/corsair.git cd corsair pnpm install ``` **2. Run the plugin generator** Pass your plugin name in **PascalCase**, for example `Stripe`, `GoogleCalendar`, or `HubSpot`. ```bash theme={null} pnpm run generate:plugin ``` For example: ```bash theme={null} pnpm run generate:plugin Stripe ``` This creates `packages/stripe/` with the full plugin structure: ``` packages/stripe/ ├── index.ts ├── client.ts ├── error-handlers.ts ├── package.json ├── tsconfig.json ├── tsup.config.ts ├── endpoints/ │ ├── index.ts │ ├── types.ts │ └── example.ts ├── webhooks/ │ ├── index.ts │ ├── types.ts │ └── example.ts └── schema/ ├── index.ts └── database.ts ``` It also automatically registers your plugin in `packages/corsair/core/constants.ts`. **3. Choose your auth type** Open `packages//index.ts` and update the auth type to match the API you're integrating with. **API key** (most REST APIs): ```ts theme={null} authType?: PickAuth<'api_key'>; ``` **OAuth 2** (Google, GitHub, etc.): ```ts theme={null} authType?: PickAuth<'oauth_2'>; ``` Also update the `defaultAuthType` constant and `authConfig` to match: ```ts theme={null} const defaultAuthType: AuthTypes = 'api_key'; // or 'oauth_2' export const stripeAuthConfig = { api_key: { account: ['one'] as const, }, } as const satisfies PluginAuthConfig; ``` **4. Let Claude Code implement it** Point Claude Code at the API docs for your integration and let it do the heavy lifting. Open Claude Code in the repo root and give it a prompt like: ``` I've generated a Corsair plugin scaffold at packages/stripe/. Please implement it using the Stripe API docs at https://docs.stripe.com/api. - Update client.ts with the correct base URL and auth headers (Bearer token) - Replace the example endpoint with real Stripe endpoints (e.g. list customers, get invoice) - Update the schema/database.ts with relevant entity shapes - Remove the example webhook and add real Stripe webhook event types ``` Claude Code can read the scaffold, understand the patterns from existing plugins (e.g. `packages/github/`), and produce a working starting point. **5. Typecheck and build** ```bash theme={null} cd packages/ pnpm typecheck pnpm build ``` Fix any type errors, then register the plugin in your app the same way as any other Corsair plugin: ```ts src/server/corsair.ts theme={null} import { stripe } from '@corsair-dev/stripe'; export const corsair = createCorsair({ plugins: [stripe({ key: process.env.STRIPE_API_KEY })], database: db, kek: process.env.CORSAIR_KEK!, }); ``` **6. Test your plugin** The repo includes a ready-made testing sandbox at `demo/testing/`. Add your plugin there and run scripts against it without setting up a new project. **1. Add your plugin as a workspace dependency in `demo/testing/package.json`:** ```json demo/testing/package.json theme={null} { "dependencies": { "@corsair-dev/stripe": "workspace:*" } } ``` Then run `pnpm install` from the repo root to link it. **2. Register your plugin in the test corsair instance:** ```ts demo/testing/src/server/corsair.ts theme={null} import { stripe } from '@corsair-dev/stripe'; export const corsair = createCorsair({ plugins: [ // ... existing plugins stripe({ key: process.env.STRIPE_API_KEY }), ], database: sqlite, kek: process.env.CORSAIR_KEK!, }); ``` **3. Write your test in `demo/testing/src/scripts/test-script.ts`:** ```ts demo/testing/src/scripts/test-script.ts theme={null} import { corsair } from '@/server/corsair'; import 'dotenv/config'; const main = async () => { const customer = await corsair.stripe.api.customers.get({ id: 'cus_123' }); console.log(customer); }; main(); ``` **4. Run the script:** ```bash theme={null} cd demo/testing pnpm run test ``` > [!NOTE] > > **Build watch required** > In a separate terminal, run the build watcher in your plugin package so changes are picked up immediately: > > ```bash theme={null} > cd packages/stripe > pnpm run build --watch > ``` > > Without this, the test sandbox will be running stale compiled output. ## Tips * **Look at existing plugins** for reference. `packages/github/` and `packages/resend/` are good examples at different complexity levels. * **Auth headers** go in `client.ts` inside the `HEADERS` config object. Most APIs use `Authorization: Bearer ` or `Authorization: `. * **Webhook signature verification**: update the `TODO` in `webhooks/types.ts` with the HMAC logic for your provider. * **Database entities**: define Zod schemas in `schema/database.ts` for any data you want to cache locally. Leave `entities: {}` empty if you only need live API calls. # Vibe code your dashboard Source: https://docs.corsair.dev/guides/dashboard Scaffold a T3 app, wire in Google Calendar with Corsair, then let an AI agent build the whole dashboard from a single prompt. A working Next.js app with a live Google Calendar dashboard, built almost entirely by an AI agent from one prompt. ## Corsair context prompt for your agent Paste this before your feature prompt so the agent knows how Corsair works: ``` This app uses Corsair. Every Corsair plugin has two namespaces: corsair..db — reads from the local database (no network, instant) corsair..api — calls the live external API Both follow the same shape: corsair..[db|api]..(args) When to use which: - Rendering UI / reading data → .db (always the default) - Creating, updating, or deleting → .api - User-triggered refresh / sync → .api, then re-read from .db - Every .api response is auto-saved to .db Entity data is on .data in camelCase. Use .search({}) or .list() on .db to query. To see what's available, run: pnpm corsair list --plugin ``` **Step 1** ## Scaffold the T3 app ```bash npm theme={null} npm create t3-app@latest my-cal-dashboard -- --CI --trpc --tailwind --appRouter ``` ```bash yarn theme={null} yarn create t3-app@latest my-cal-dashboard -- --CI --trpc --tailwind --appRouter ``` ```bash pnpm theme={null} pnpm create t3-app@latest my-cal-dashboard -- --CI --trpc --tailwind --appRouter ``` ```bash bun theme={null} bun create t3-app@latest my-cal-dashboard -- --CI --trpc --tailwind --appRouter ``` ```bash theme={null} cd my-cal-dashboard ``` **Step 2** ## Install ```bash npm theme={null} npm install corsair @corsair-dev/googlecalendar ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googlecalendar ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googlecalendar ``` ```bash bun theme={null} bun add corsair @corsair-dev/googlecalendar ``` **Step 3** ## Generate your encryption key Corsair encrypts stored credentials with a Key Encryption Key. Click **Regenerate** for a new one, or run the command yourself: bash
    `openssl rand -base64 32`
    .env Regenerate
    
    > [!WARNING]
    >
    > **Keep this key safe**
    > If you lose it, you lose access to all stored credentials. Treat it like a root password.
    
    **Step 4**
    
    ## Migrate the database
    
    Corsair needs five tables. Install the driver, then run the migration:
    
    ```bash npm theme={null}
    npm install better-sqlite3
    ```
    
    ```bash yarn theme={null}
    yarn add better-sqlite3
    ```
    
    ```bash pnpm theme={null}
    pnpm install better-sqlite3
    ```
    
    ```bash bun theme={null}
    bun add better-sqlite3
    ```
    
    ```bash npm theme={null}
    npm install --save-dev @types/better-sqlite3
    ```
    
    ```bash yarn theme={null}
    yarn add --dev @types/better-sqlite3
    ```
    
    ```bash pnpm theme={null}
    pnpm install --save-dev @types/better-sqlite3
    ```
    
    ```bash bun theme={null}
    bun add --dev @types/better-sqlite3
    ```
    
    > **View migration SQL**
    >
    > ```sql migration.sql theme={null}
    > CREATE TABLE IF NOT EXISTS corsair_integrations (
    >     id TEXT PRIMARY KEY,
    >     created_at INTEGER NOT NULL,
    >     updated_at INTEGER NOT NULL,
    >     name TEXT NOT NULL,
    >     config TEXT NOT NULL DEFAULT '{}',
    >     dek TEXT NULL
    > );
    >
    > CREATE TABLE IF NOT EXISTS corsair_accounts (
    >     id TEXT PRIMARY KEY,
    >     created_at INTEGER NOT NULL,
    >     updated_at INTEGER NOT NULL,
    >     tenant_id TEXT NOT NULL,
    >     integration_id TEXT NOT NULL,
    >     config TEXT NOT NULL DEFAULT '{}',
    >     dek TEXT NULL,
    >     FOREIGN KEY (integration_id) REFERENCES corsair_integrations(id)
    > );
    >
    > CREATE TABLE IF NOT EXISTS corsair_entities (
    >     id TEXT PRIMARY KEY,
    >     created_at INTEGER NOT NULL,
    >     updated_at INTEGER NOT NULL,
    >     account_id TEXT NOT NULL,
    >     entity_id TEXT NOT NULL,
    >     entity_type TEXT NOT NULL,
    >     version TEXT NOT NULL,
    >     data TEXT NOT NULL DEFAULT '{}',
    >     FOREIGN KEY (account_id) REFERENCES corsair_accounts(id)
    > );
    >
    > CREATE TABLE IF NOT EXISTS corsair_events (
    >     id TEXT PRIMARY KEY,
    >     created_at INTEGER NOT NULL,
    >     updated_at INTEGER NOT NULL,
    >     account_id TEXT NOT NULL,
    >     event_type TEXT NOT NULL,
    >     payload TEXT NOT NULL DEFAULT '{}',
    >     status TEXT,
    >     FOREIGN KEY (account_id) REFERENCES corsair_accounts(id)
    > );
    > ```
    
    **macOS / Linux**
    
    ```bash theme={null}
    sqlite3 corsair.db < migration.sql
    ```
    
    **Windows (PowerShell)**
    
    PowerShell syntax
    
    Bash redirection and \$VAR env vars do not work in PowerShell.
    Use the Windows commands shown in this tab instead.
    
    ```powershell theme={null}
    Get-Content migration.sql | sqlite3 corsair.db
    ```
    
    **Step 5**
    
    ## Create src/server/corsair.ts
    
    ```ts src/server/corsair.ts theme={null}
    import 'dotenv/config';
    import Database from 'better-sqlite3';
    import { createCorsair } from 'corsair';
    import { googlecalendar } from "@corsair-dev/googlecalendar";
    
    const db = new Database('corsair.db');
    
    export const corsair = createCorsair({
        plugins: [googlecalendar()],
        database: db,
        kek: process.env.CORSAIR_KEK!,
    });
    ```
    
    **Step 6**
    
    ## Connect Google Calendar
    
    Google Calendar uses OAuth2. You'll need a GCP OAuth app first:
    
    1. Go to the [Google Cloud Console](https://console.cloud.google.com/), create a project, and enable the **Google Calendar API**.
    2. Under **APIs & Services**, then **Credentials**, create an **OAuth 2.0 Client ID** (Application type: Web application). No redirect URI needed. Corsair handles it locally.
    3. Copy your Client ID and Client Secret, then store them:
    
    ```bash npm theme={null}
    npm install @corsair-dev/cli
    ```
    
    ```bash yarn theme={null}
    yarn add @corsair-dev/cli
    ```
    
    ```bash pnpm theme={null}
    pnpm install @corsair-dev/cli
    ```
    
    ```bash bun theme={null}
    bun add @corsair-dev/cli
    ```
    
    ```bash npm theme={null}
    npx corsair setup --plugin=googlecalendar client_id=YOUR_CLIENT_ID client_secret=YOUR_CLIENT_SECRET
    ```
    
    ```bash yarn theme={null}
    yarn corsair setup --plugin=googlecalendar client_id=YOUR_CLIENT_ID client_secret=YOUR_CLIENT_SECRET
    ```
    
    ```bash pnpm theme={null}
    pnpm corsair setup --plugin=googlecalendar client_id=YOUR_CLIENT_ID client_secret=YOUR_CLIENT_SECRET
    ```
    
    ```bash bun theme={null}
    bunx corsair setup --plugin=googlecalendar client_id=YOUR_CLIENT_ID client_secret=YOUR_CLIENT_SECRET
    ```
    
    > **pnpm: command not found or setup fails?**
    >
    > If `pnpm corsair` isn't found, add this to your `package.json` so pnpm builds the native dependency correctly:
    >
    > ```json package.json theme={null}
    > {
    >   "pnpm": {
    >     "onlyBuiltDependencies": [
    >       "better-sqlite3"
    >     ]
    >   }
    > }
    > ```
    >
    > Then re-run `pnpm install` and retry the setup command.
    
    4. Start the OAuth flow:
    
    ```bash npm theme={null}
    npx corsair auth --plugin=googlecalendar
    ```
    
    ```bash yarn theme={null}
    yarn corsair auth --plugin=googlecalendar
    ```
    
    ```bash pnpm theme={null}
    pnpm corsair auth --plugin=googlecalendar
    ```
    
    ```bash bun theme={null}
    bunx corsair auth --plugin=googlecalendar
    ```
    
    Open the `authUrl` printed in the terminal. Once you authorize in the browser, tokens are saved automatically and the command exits.
    
    **Step 7**
    
    ## Vibe code the dashboard
    
    Paste this prompt into Claude, Cursor, or any AI coding agent:
    
    ```
    I have a Next.js T3 app. The Google Calendar plugin is connected via Corsair.
    
    Build me a Google Calendar dashboard on the home page. I want to see:
    
    - A stats row showing: how many events I have today, how many this week, what my next meeting is, and how many hours are blocked
    today
    - Today's full agenda — all my events for today in order with times and titles
    - An upcoming events panel — my next couple weeks of events grouped by day
    - A Create Meeting button that opens a form to schedule a new event
    - A notes field on each meeting card where I can save and edit private notes per event (store these in a local table, not on Google
    Calendar)
    - A Refresh button in the header that fetches the latest events from Google Calendar and updates what's shown on screen, including
    removing any events the user has deleted from Google Calendar
    
    The app should use await corsair.googlecalendar.db as a cache — load from there first, and only call Google Calendar when the data isn't
    cached yet, when creating an event, or when the user clicks Refresh. The page should not make any live API calls on its own after
    the first load.
    ```
    
    Run `pnpm dev` when it's done.
    
    ## What's next
    
    > **[Google Calendar plugin](/plugins/googlecalendar/api)**
    >
    > Full API reference. Create events, check availability, and handle webhook notifications.
    
    > **[Webhooks](/plugins/googlecalendar/webhooks)**
    >
    > React to calendar changes in real time. New events, updates, and deletions pushed to your server.
    
    > **[Workflows](/guides/workflows)**
    >
    > Chain calendar events to other plugins. A meeting is created, a Slack notification fires, then a Linear task is added.
    
    > **[Multi-tenancy](/concepts/multi-tenancy)**
    >
    > Building a product? Each user gets their own calendar credentials and isolated data.
    
    
    # Hatchet
    Source: https://docs.corsair.dev/guides/hatchet
    
    Push Hatchet workflow events from Corsair webhook hooks.
    
    > [!NOTE]
    >
    > **Corsair Workflows (beta)**. Durable workflows, built in. No external engine to wire. [See how](/workflows/overview)
    
    Use Corsair's `webhookHooks` to push events into Hatchet whenever something happens in a connected service. Hatchet handles durable execution and retries. Corsair handles webhook routing and integration auth.
    
    ## Install
    
    ```bash theme={null}
    npm install @hatchet-dev/typescript-sdk
    ```
    
    ## Event trigger
    
    When a message arrives in Slack's #support channel, push a Hatchet event. The workflow creates a Linear issue to track the request and replies in-thread to confirm it was received.
    
    ```ts corsair.ts theme={null}
    import { hatchet } from '@/hatchet/client';
    
    slack({
        webhookHooks: {
            messages: {
                message: {
                    before: async (ctx, payload) => {
                        // Only handle messages in the #support channel
                        if (payload.channel !== process.env.SLACK_SUPPORT_CHANNEL) {
                            throw new Error('Not the support channel, skipping');
                        }
                        // Skip bot messages
                        if (payload.bot_id) throw new Error('Bot message, skipping');
                        return { ctx, payload };
                    },
                    after: async (ctx, result) => {
                        await hatchet.client.event.push('slack:support.message', {
                            channel: result.data.channel,
                            threadTs: result.data.ts,
                            text: result.data.text,
                            userId: result.data.user,
                            tenantId: ctx.tenantId,
                        });
                    },
                },
            },
        },
    })
    ```
    
    ```ts hatchet/client.ts theme={null}
    import Hatchet from '@hatchet-dev/typescript-sdk';
    
    export const hatchet = await Hatchet.init();
    ```
    
    ```ts hatchet/workflows.ts theme={null}
    import { hatchet } from './client';
    import { corsair } from '@/server/corsair';
    
    export const supportWorkflow = hatchet.workflow({
        name: 'slack-support-ticket',
        on: { event: 'slack:support.message' },
    });
    
    supportWorkflow.task('create-linear-issue', async (ctx) => {
        const { text, userId, channel, threadTs, tenantId } = ctx.workflowInput<{
            text: string;
            userId: string;
            channel: string;
            threadTs: string;
            tenantId?: string;
        }>();
    
        const client = tenantId ? corsair.withTenant(tenantId) : corsair;
    
        // Create a Linear issue from the Slack message
        const issue = await client.linear.api.issues.create({
            title: text.slice(0, 80),
            description: `Reported via Slack by <@${userId}>:\n\n${text}`,
            teamId: process.env.LINEAR_SUPPORT_TEAM_ID!,
            labelIds: [process.env.LINEAR_SUPPORT_LABEL!],
        });
    
        // Reply in the same Slack thread to confirm
        await client.slack.api.messages.post({
            channel,
            thread_ts: threadTs,
            text: `✅ Ticket created: <${issue.data.url}|${issue.data.identifier}>`,
        });
    
        return { issueId: issue.data.id };
    });
    ```
    
    ## Workflow
    
    When commits are pushed to the main branch, run a multi-step Hatchet workflow: notify the team in Discord, update the Linear project status to reflect the deployment, then log the release in a tracking channel.
    
    ```ts corsair.ts theme={null}
    import { hatchet } from '@/hatchet/client';
    
    github({
        webhookHooks: {
            push: {
                after: async (ctx, result) => {
                    const branch = result.data.ref.replace('refs/heads/', '');
                    if (branch !== 'main') return; // only track main
    
                    await hatchet.client.event.push('github:push.main', {
                        headCommit: result.data.head_commit?.message ?? '',
                        pusher: result.data.pusher.name,
                        compareUrl: result.data.compare,
                        commitCount: result.data.commits?.length ?? 0,
                        tenantId: ctx.tenantId,
                    });
                },
            },
        },
    })
    ```
    
    ```ts hatchet/workflows.ts theme={null}
    import { hatchet } from './client';
    import { corsair } from '@/server/corsair';
    
    export const deployWorkflow = hatchet.workflow({
        name: 'main-branch-push',
        on: { event: 'github:push.main' },
    });
    
    type PushInput = {
        headCommit: string;
        pusher: string;
        compareUrl: string;
        commitCount: number;
        tenantId?: string;
    };
    
    deployWorkflow.task('notify-discord', async (ctx) => {
        const input = ctx.workflowInput();
        const client = input.tenantId ? corsair.withTenant(input.tenantId) : corsair;
    
        await client.discord.api.messages.create({
            channelId: process.env.DISCORD_DEPLOYS_CHANNEL!,
            content: `🚀 **${input.commitCount} commit(s)** pushed to \`main\` by **${input.pusher}**\n${input.headCommit}\n[View diff](${input.compareUrl})`,
        });
    });
    
    deployWorkflow.task('update-linear-project', async (ctx) => {
        const input = ctx.workflowInput();
        const client = input.tenantId ? corsair.withTenant(input.tenantId) : corsair;
    
        // Move any Linear issues marked "In Review" to "Done" (fields live on .data).
        // Rows store flat stateId/teamId, not nested objects. Compare against ids.
        const all = await client.linear.db.issues.list();
        const inReview = all.filter(
            (i) => i.data.stateId === process.env.LINEAR_IN_REVIEW_STATE_ID && i.data.teamId === process.env.LINEAR_TEAM_ID,
        );
    
        for (const issue of inReview) {
            await client.linear.api.issues.update({
                issueId: issue.data.id,
                stateId: process.env.LINEAR_DONE_STATE_ID!,
            });
        }
    });
    
    deployWorkflow.task('log-release', async (ctx) => {
        const input = ctx.workflowInput();
        const client = input.tenantId ? corsair.withTenant(input.tenantId) : corsair;
    
        await client.slack.api.messages.post({
            channel: 'C_RELEASES_CHANNEL',
            text: `🔖 Deployed to main: _${input.headCommit}_ by ${input.pusher}\n${input.compareUrl}`,
        });
    });
    ```
    
    ## Cron job
    
    Every Monday at 9 AM, run a Hatchet cron workflow that pulls the current sprint's Linear issues from Corsair's database and posts a structured report to Slack.
    
    ```ts hatchet/workflows.ts theme={null}
    import { hatchet } from './client';
    import { corsair } from '@/server/corsair';
    
    export const sprintReportWorkflow = hatchet.workflow({
        name: 'weekly-sprint-report',
        on: { cron: '0 9 * * 1' }, // Every Monday at 9am UTC
    });
    
    sprintReportWorkflow.task('post-sprint-report', async () => {
        // List once, then filter/sort in JS (fields live on .data).
        // Rows store flat stateId/assigneeId, not nested objects. Compare against ids.
        const all = await corsair.linear.db.issues.list();
        const byPriority = (a, b) => (a.data.priority ?? 0) - (b.data.priority ?? 0);
        const unstartedStateIds = process.env.LINEAR_UNSTARTED_STATE_IDS!.split(',');
    
        const inProgress = all
            .filter((i) => i.data.stateId === process.env.LINEAR_IN_PROGRESS_STATE_ID)
            .sort(byPriority);
        const blocked = all.filter((i) => i.data.stateId === process.env.LINEAR_BLOCKED_STATE_ID);
        const unstarted = all
            .filter((i) => unstartedStateIds.includes(i.data.stateId))
            .sort(byPriority)
            .slice(0, 5);
    
        // Rows carry assigneeId, not names. Resolve the related record if you need names.
        const lines = [
            `*Sprint Report — ${new Date().toDateString()}*`,
            '',
            `*🔄 In Progress (${inProgress.length})*`,
            ...inProgress.map((i) => `• *${i.data.title}* — ${i.data.assigneeId ?? 'Unassigned'}`),
            '',
            `*🚧 Blocked (${blocked.length})*`,
            ...blocked.map((i) => `• *${i.data.title}* — ${i.data.assigneeId ?? 'Unassigned'}`),
            '',
            `*📋 Up Next (${unstarted.length})*`,
            ...unstarted.map((i) => `• ${i.data.title}`),
        ];
    
        await corsair.slack.api.messages.post({
            channel: 'C_ENG_CHANNEL',
            text: lines.join('\n'),
        });
    });
    ```
    
    ```ts hatchet/worker.ts theme={null}
    import { hatchet } from './client';
    import { supportWorkflow, deployWorkflow, sprintReportWorkflow } from './workflows';
    
    const worker = await hatchet.worker('corsair-worker');
    
    worker.registerWorkflow(supportWorkflow);
    worker.registerWorkflow(deployWorkflow);
    worker.registerWorkflow(sprintReportWorkflow);
    
    await worker.start();
    ```
    
    > [!NOTE]
    >
    > Register all workflows in a single worker. The cron schedule is part of the workflow definition. Hatchet picks it up automatically when the worker connects.
    
    ## What's next
    
    > **[Inngest](/guides/inngest)**
    >
    > Durable step functions triggered from Corsair webhooks.
    
    > **[Temporal](/guides/temporal)**
    >
    > Start Temporal workflows from Corsair webhook events.
    
    > **[Trigger.dev](/guides/trigger-dev)**
    >
    > Background tasks and scheduled jobs with Trigger.dev.
    
    > **[Workflows guide](/guides/workflows)**
    >
    > Chain webhook events without a job queue.
    
    
    # Inngest
    Source: https://docs.corsair.dev/guides/inngest
    
    Trigger durable Inngest functions from Corsair webhook events.
    
    > [!NOTE]
    >
    > **Corsair Workflows (beta)**. Durable workflows, built in. No external engine to wire. [See how](/workflows/overview)
    
    Use Corsair's `webhookHooks` to fire Inngest events the moment something happens in a connected service. Inngest handles retries, step execution, and scheduling. Corsair handles the webhook plumbing.
    
    ## Install
    
    ```bash theme={null}
    npm install inngest
    ```
    
    ## Event trigger
    
    Fire an Inngest function whenever a Linear issue is created. Use `before` to skip issues without an assignee, and `after` to dispatch the event. The Inngest function then sends a Slack DM to whoever was assigned.
    
    ```ts corsair.ts theme={null}
    import { inngest } from '@/inngest/client';
    
    linear({
        webhookHooks: {
            issues: {
                issueCreated: {
                    before: async (ctx, payload) => {
                        // Skip issues with no assignee — nothing to notify
                        if (!payload.data.assigneeId) {
                            throw new Error('No assignee, skipping');
                        }
                        return { ctx, payload };
                    },
                    after: async (ctx, result) => {
                        await inngest.send({
                            name: 'linear/issue.created',
                            data: {
                                issueId: result.data.id,
                                title: result.data.title,
                                url: result.data.url,
                                assigneeId: result.data.assigneeId,
                                tenantId: ctx.tenantId,
                            },
                        });
                    },
                },
            },
        },
    })
    ```
    
    ```ts inngest/functions.ts theme={null}
    import { inngest } from './client';
    import { corsair } from '@/server/corsair';
    
    export const notifyAssignee = inngest.createFunction(
        { id: 'notify-linear-assignee' },
        { event: 'linear/issue.created' },
        async ({ event }) => {
            const { title, url, assigneeId, tenantId } = event.data;
    
            // Use withTenant if you have multi-tenancy enabled
            const client = tenantId ? corsair.withTenant(tenantId) : corsair;
    
            // assigneeId is a Linear user id; resolve their email for the Slack lookup
            const assignee = await client.linear.api.users.get({ id: assigneeId });
            const user = await client.slack.api.users.lookupByEmail({
                email: assignee.data.email,
            });
    
            await client.slack.api.messages.post({
                channel: user.data.user.id,
                text: `You've been assigned a new issue: *${title}*\n${url}`,
            });
        },
    );
    ```
    
    ## Workflow
    
    When a GitHub PR is opened, kick off a multi-step Inngest workflow that generates an AI code review, posts it as a comment, then notifies Slack. Each step is retried independently on failure.
    
    ```ts corsair.ts theme={null}
    import { inngest } from '@/inngest/client';
    
    github({
        webhookHooks: {
            pullRequestOpened: {
                before: async (ctx, payload) => {
                    // Ignore draft PRs
                    if (payload.pull_request.draft) {
                        throw new Error('Skipping draft PR');
                    }
                    return { ctx, payload };
                },
                after: async (ctx, result) => {
                    const pr = result.data.pull_request;
                    await inngest.send({
                        name: 'github/pr.opened',
                        data: {
                            owner: pr.base.repo.owner.login,
                            repo: pr.base.repo.name,
                            number: pr.number,
                            title: pr.title,
                            diff_url: pr.diff_url,
                            tenantId: ctx.tenantId,
                        },
                    });
                },
            },
        },
    })
    ```
    
    ```ts inngest/functions.ts theme={null}
    import { inngest } from './client';
    import { corsair } from '@/server/corsair';
    
    export const reviewPR = inngest.createFunction(
        { id: 'ai-pr-review' },
        { event: 'github/pr.opened' },
        async ({ event, step }) => {
            const { owner, repo, number, title, diff_url, tenantId } = event.data;
            const client = tenantId ? corsair.withTenant(tenantId) : corsair;
    
            // Step 1: Fetch the diff
            const diff = await step.run('fetch-diff', async () => {
                const res = await fetch(diff_url);
                return res.text();
            });
    
            // Step 2: Generate an AI review (slow — runs in its own retryable step)
            const review = await step.run('generate-review', async () => {
                return generateCodeReview({ title, diff }); // your LLM call
            });
    
            // Step 3: Post the review as a GitHub comment
            await step.run('post-comment', async () => {
                await client.github.api.issues.createComment({
                    owner,
                    repo,
                    issueNumber: number,
                    body: review,
                });
            });
    
            // Step 4: Notify the engineering channel
            await step.run('notify-slack', async () => {
                await client.slack.api.messages.post({
                    channel: 'C_ENG_CHANNEL',
                    text: `AI review posted on PR #${number}: *${title}*`,
                });
            });
        },
    );
    ```
    
    ## Cron job
    
    Every Monday at 9 AM, pull open Linear issues from Corsair's local database and post a sprint digest to Slack. No webhook needed. This runs on a schedule.
    
    ```ts inngest/functions.ts theme={null}
    import { inngest } from './client';
    import { corsair } from '@/server/corsair';
    
    export const weeklySprintDigest = inngest.createFunction(
        { id: 'weekly-sprint-digest' },
        { cron: '0 9 * * 1' }, // Every Monday at 9am UTC
        async () => {
            // Query Corsair's synced database — no API call needed
            const all = await corsair.linear.db.issues.list();
            // Rows store flat stateId/teamId/assigneeId, not nested objects.
            // Compare stateId against configured open-state ids (comma-separated).
            const openStateIds = process.env.LINEAR_OPEN_STATE_IDS!.split(',');
            // Filter and sort in JS (list returns all rows; fields live on .data)
            const issues = all
                .filter((i) => openStateIds.includes(i.data.stateId))
                .sort((a, b) => (a.data.priority ?? 0) - (b.data.priority ?? 0));
    
            if (issues.length === 0) {
                await corsair.slack.api.messages.post({
                    channel: 'C_ENG_CHANNEL',
                    text: '✅ No open issues — clean slate this week!',
                });
                return;
            }
    
            const lines = [
                `*Sprint Digest — ${issues.length} open issue${issues.length === 1 ? '' : 's'}*`,
                '',
                // Rows carry assigneeId/stateId, not names. Resolve the related
                // records separately if you need human-readable names.
                ...issues.map(
                    (i) => `• *${i.data.title}* (${i.data.identifier}) — ${i.data.assigneeId ?? 'Unassigned'}`,
                ),
            ];
    
            await corsair.slack.api.messages.post({
                channel: 'C_ENG_CHANNEL',
                text: lines.join('\n'),
            });
        },
    );
    ```
    
    > [!NOTE]
    >
    > `corsair.linear.db.issues.list()` queries your local synced database. It's fast and doesn't count against Linear's API rate limits.
    
    ## What's next
    
    > **[Workflows guide](/guides/workflows)**
    >
    > Chain webhook events into multi-step automations with plain TypeScript.
    
    > **[Temporal](/guides/temporal)**
    >
    > Use Temporal workflows and activities with Corsair.
    
    > **[Trigger.dev](/guides/trigger-dev)**
    >
    > Background tasks and scheduled jobs with Trigger.dev.
    
    > **[Hatchet](/guides/hatchet)**
    >
    > Durable workflows with Hatchet and Corsair webhooks.
    
    
    # Plugin credentials guide
    Source: https://docs.corsair.dev/guides/plugin-credentials
    
    Step-by-step instructions for obtaining API keys, tokens, client IDs, secrets, and webhook credentials for all Corsair plugins.
    
    This guide provides detailed instructions for obtaining all required credentials for each Corsair plugin. Each plugin section includes step-by-step instructions, required vs optional credentials, and webhook setup where applicable.
    
    ## Overview
    
    Corsair plugins require different types of credentials depending on their authentication method:
    
    * **API Keys**: Static keys or tokens used for authentication (e.g., Slack bot tokens, Linear API keys)
    * **OAuth 2.0**: Client ID, Client Secret, Access Token, and Refresh Token for user authorization
    * **Webhook Secrets**: Secrets used to verify incoming webhook requests
    
    For general information about how Corsair handles authentication, see [Authentication](/concepts/auth).
    
    ## Table of contents
    
    * [Slack](#slack)
    * [GitHub](#github)
    * [Gmail](#gmail)
    * [Google Sheets](#google-sheets)
    * [Google Drive](#google-drive)
    * [Google Calendar](#google-calendar)
    * [HubSpot](#hubspot)
    * [Linear](#linear)
    * [PostHog](#posthog)
    * [Resend](#resend)
    
    ## Slack
    
    The Slack plugin supports both API key (bot token) and OAuth 2.0 authentication methods.
    
    ### Authentication methods
    
    * **`api_key`** (default) - Bot token authentication
    * **`oauth_2`** - OAuth 2.0 user authentication
    
    ### API key authentication (bot token)
    
    #### Step 1: create a Slack app
    
    1. Go to [api.slack.com/apps](https://api.slack.com/apps)
    2. Click **Create New App**
    3. Choose **From scratch**
    4. Enter your app name and select your workspace
    5. Click **Create App**
    
    #### Step 2: configure bot token scopes
    
    1. In your app settings, go to **OAuth & Permissions** in the left sidebar
    2. Scroll to **Scopes** > **Bot Token Scopes**
    3. Add the required scopes:
       * `channels:read` - View basic information about public channels
       * `channels:write` - Manage public channels
       * `chat:write` - Send messages
       * `files:read` - View files shared in channels
       * `files:write` - Upload, edit, and delete files
       * `users:read` - View people in a workspace
       * `reactions:write` - Add and remove emoji reactions
       * Add any other scopes your application needs
    
    #### Step 3: install app to workspace
    
    1. Scroll to the top of the **OAuth & Permissions** page
    2. Click **Install to Workspace**
    3. Review the permissions and click **Allow**
    
    #### Step 4: copy bot token
    
    1. After installation, you'll be redirected back to **OAuth & Permissions**
    2. Under **OAuth Tokens for Your Workspace**, find **Bot User OAuth Token**
    3. Click **Copy** to copy the token (starts with `xoxb-`)
    4. Store this token securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    slack({
        authType: "api_key",
        key: process.env.SLACK_BOT_TOKEN,
    })
    ```
    
    ### OAuth 2.0 authentication
    
    #### Step 1: create a Slack app
    
    Follow steps 1-3 from the API Key Authentication section above.
    
    #### Step 2: configure OAuth settings
    
    1. Go to **OAuth & Permissions** in the left sidebar
    2. Under **Redirect URLs**, click **Add New Redirect URL**
    3. Add your OAuth redirect URL (e.g., `https://yourapp.com/auth/slack/callback`)
    4. Click **Save URLs**
    
    #### Step 3: get client credentials
    
    1. Scroll to **App Credentials** section
    2. Copy the **Client ID** and **Client Secret**
    3. Store these securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    slack({
        authType: "oauth_2",
    })
    ```
    
    The plugin will automatically retrieve access tokens from your database after users complete the OAuth flow.
    
    ### Webhook signing secret
    
    #### Step 1: enable event subscriptions
    
    1. In your Slack app settings, go to **Event Subscriptions** in the left sidebar
    2. Toggle **Enable Events** to **On**
    3. Enter your **Request URL** (e.g., `https://yourapp.com/api/webhook`)
    4. Slack will send a verification request - ensure your endpoint handles it
    
    #### Step 2: subscribe to bot events
    
    1. Scroll to **Subscribe to bot events**
    2. Click **Add Bot User Event**
    3. Add events you want to receive:
       * `message.channels` - Messages posted to channels
       * `channel_created` - A channel was created
       * `reaction_added` - A reaction was added
       * `team_join` - A new member joined
       * `user_change` - A user's profile was updated
       * `file_created` - A file was created
       * `file_public` - A file was made public
       * `file_shared` - A file was shared
    
    #### Step 3: get signing secret
    
    1. Scroll to the top of the **Event Subscriptions** page
    2. Under **Signing Secret**, click **Show** and copy the secret
    3. Store this securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    slack({
        signingSecret: process.env.SLACK_SIGNING_SECRET,
    })
    ```
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | Bot Token (`xoxb-...`) | API Key auth | OAuth & Permissions > Bot User OAuth Token |
    | Client ID | OAuth 2.0 | OAuth & Permissions > App Credentials |
    | Client Secret | OAuth 2.0 | OAuth & Permissions > App Credentials |
    | Signing Secret | Webhooks | Event Subscriptions > Signing Secret |
    
    ## GitHub
    
    The GitHub plugin supports both API key (Personal Access Token) and OAuth 2.0 authentication methods.
    
    ### Authentication methods
    
    * **`api_key`** - Personal Access Token authentication
    * **`oauth_2`** - OAuth App authentication
    
    ### API key authentication (personal access token)
    
    #### Step 1: create personal access token
    
    1. Go to [GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)](https://github.com/settings/tokens)
    2. Click **Generate new token** > **Generate new token (classic)**
    3. Give your token a descriptive name
    4. Set an expiration (or select "No expiration" for long-lived tokens)
    5. Select the required scopes:
       * `repo` - Full control of private repositories
       * `read:org` - Read org and team membership
       * `read:user` - Read user profile data
       * `workflow` - Update GitHub Action workflows
       * Add any other scopes your application needs
    6. Click **Generate token**
    7. **Important**: Copy the token immediately - you won't be able to see it again
    8. Store the token securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    github({
        authType: "api_key",
        credentials: {
            token: process.env.GITHUB_TOKEN,
        },
    })
    ```
    
    ### OAuth 2.0 authentication
    
    #### Step 1: register OAuth app
    
    1. Go to [GitHub Settings > Developer settings > OAuth Apps](https://github.com/settings/developers)
    2. Click **New OAuth App**
    3. Fill in the application details:
       * **Application name**: Your app name
       * **Homepage URL**: Your application URL
       * **Authorization callback URL**: Your OAuth callback URL (e.g., `https://yourapp.com/auth/github/callback`)
    4. Click **Register application**
    
    #### Step 2: get client credentials
    
    1. After registration, you'll see your **Client ID**
    2. Click **Generate a new client secret**
    3. Copy the **Client ID** and **Client Secret**
    4. Store these securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    github({
        authType: "oauth_2",
        credentials: {
            clientId: process.env.GITHUB_CLIENT_ID,
            clientSecret: process.env.GITHUB_CLIENT_SECRET,
        },
    })
    ```
    
    ### Webhook secret
    
    #### Step 1: create webhook
    
    1. Go to your repository on GitHub
    2. Navigate to **Settings** > **Webhooks**
    3. Click **Add webhook**
    4. Configure the webhook:
       * **Payload URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`)
       * **Content type**: `application/json`
       * **Secret**: Generate a random secret string (save this)
       * **Events**: Select the events you want to receive:
         * Pull requests
         * Pushes
         * Issues
         * Stars
         * Releases
    5. Click **Add webhook**
    
    #### Step 2: store webhook secret
    
    Copy the secret you generated and store it securely.
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    github({
        webhookSecret: process.env.GITHUB_WEBHOOK_SECRET,
    })
    ```
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | Personal Access Token | API Key auth | Settings > Developer settings > Personal access tokens |
    | Client ID | OAuth 2.0 | Settings > Developer settings > OAuth Apps |
    | Client Secret | OAuth 2.0 | Settings > Developer settings > OAuth Apps |
    | Webhook Secret | Webhooks | Repository Settings > Webhooks > Secret |
    
    ## Gmail
    
    The Gmail plugin uses OAuth 2.0 authentication exclusively.
    
    ### Authentication method
    
    * **`oauth_2`** (default) - OAuth 2.0 authentication
    
    ### OAuth 2.0 setup
    
    #### Step 1: create Google Cloud project
    
    1. Go to [Google Cloud Console](https://console.cloud.google.com/)
    2. Click **Select a project** > **New Project**
    3. Enter a project name and click **Create**
    4. Wait for the project to be created and select it
    
    #### Step 2: enable Gmail API
    
    1. In the Google Cloud Console, go to **APIs & Services** > **Library**
    2. Search for "Gmail API"
    3. Click on **Gmail API**
    4. Click **Enable**
    
    #### Step 3: create OAuth 2.0 credentials
    
    1. Go to **APIs & Services** > **Credentials**
    2. Click **Create Credentials** > **OAuth client ID**
    3. If prompted, configure the OAuth consent screen:
       * Choose **External** (unless you have a Google Workspace)
       * Fill in the required information:
         * App name
         * User support email
         * Developer contact information
       * Add scopes:
         * `https://www.googleapis.com/auth/gmail.modify`
       * Add test users (for testing)
       * Click **Save and Continue** through all steps
    4. Back in **Credentials**, click **Create Credentials** > **OAuth client ID**
    5. Select **Web application**
    6. Configure:
       * **Name**: Your application name
       * **Authorized redirect URIs**: Add your callback URL (e.g., `https://yourapp.com/auth/gmail/callback`)
    7. Click **Create**
    8. Copy the **Client ID** and **Client Secret**
    9. Store these securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    gmail({
        authType: "oauth_2",
        credentials: {
            clientId: process.env.GMAIL_CLIENT_ID,
            clientSecret: process.env.GMAIL_CLIENT_SECRET,
        },
    })
    ```
    
    The plugin will automatically handle access token and refresh token storage after users complete the OAuth flow.
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | Client ID | OAuth 2.0 | Google Cloud Console > APIs & Services > Credentials |
    | Client Secret | OAuth 2.0 | Google Cloud Console > APIs & Services > Credentials |
    | Access Token | OAuth 2.0 | Obtained automatically after OAuth flow |
    | Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow |
    
    ## Google Sheets
    
    The Google Sheets plugin uses OAuth 2.0 authentication exclusively.
    
    ### Authentication method
    
    * **`oauth_2`** (default) - OAuth 2.0 authentication
    
    ### OAuth 2.0 setup
    
    #### Step 1: create Google Cloud project
    
    1. Go to [Google Cloud Console](https://console.cloud.google.com/)
    2. Click **Select a project** > **New Project**
    3. Enter a project name and click **Create**
    4. Wait for the project to be created and select it
    
    #### Step 2: enable Google Sheets API
    
    1. In the Google Cloud Console, go to **APIs & Services** > **Library**
    2. Search for "Google Sheets API"
    3. Click on **Google Sheets API**
    4. Click **Enable**
    
    #### Step 3: create OAuth 2.0 credentials
    
    1. Go to **APIs & Services** > **Credentials**
    2. Click **Create Credentials** > **OAuth client ID**
    3. If prompted, configure the OAuth consent screen (see Gmail section for details)
    4. Select **Web application**
    5. Configure:
       * **Name**: Your application name
       * **Authorized redirect URIs**: Add your callback URL (e.g., `https://yourapp.com/auth/googlesheets/callback`)
    6. Click **Create**
    7. Copy the **Client ID** and **Client Secret**
    8. Store these securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    googlesheets({
        authType: "oauth_2",
        credentials: {
            clientId: process.env.GOOGLE_SHEETS_CLIENT_ID,
            clientSecret: process.env.GOOGLE_SHEETS_CLIENT_SECRET,
        },
    })
    ```
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | Client ID | OAuth 2.0 | Google Cloud Console > APIs & Services > Credentials |
    | Client Secret | OAuth 2.0 | Google Cloud Console > APIs & Services > Credentials |
    | Access Token | OAuth 2.0 | Obtained automatically after OAuth flow |
    | Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow |
    
    ## Google Drive
    
    The Google Drive plugin uses OAuth 2.0 authentication exclusively.
    
    ### Authentication method
    
    * **`oauth_2`** (default) - OAuth 2.0 authentication
    
    ### OAuth 2.0 setup
    
    #### Step 1: create Google Cloud project
    
    1. Go to [Google Cloud Console](https://console.cloud.google.com/)
    2. Click **Select a project** > **New Project**
    3. Enter a project name and click **Create**
    4. Wait for the project to be created and select it
    
    #### Step 2: enable Google Drive API
    
    1. In the Google Cloud Console, go to **APIs & Services** > **Library**
    2. Search for "Google Drive API"
    3. Click on **Google Drive API**
    4. Click **Enable**
    
    #### Step 3: create OAuth 2.0 credentials
    
    1. Go to **APIs & Services** > **Credentials**
    2. Click **Create Credentials** > **OAuth client ID**
    3. If prompted, configure the OAuth consent screen (see Gmail section for details)
    4. Select **Web application**
    5. Configure:
       * **Name**: Your application name
       * **Authorized redirect URIs**: Add your callback URL (e.g., `https://yourapp.com/auth/googledrive/callback`)
    6. Click **Create**
    7. Copy the **Client ID** and **Client Secret**
    8. Store these securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    googledrive({
        authType: "oauth_2",
        credentials: {
            clientId: process.env.GOOGLE_DRIVE_CLIENT_ID,
            clientSecret: process.env.GOOGLE_DRIVE_CLIENT_SECRET,
        },
    })
    ```
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | Client ID | OAuth 2.0 | Google Cloud Console > APIs & Services > Credentials |
    | Client Secret | OAuth 2.0 | Google Cloud Console > APIs & Services > Credentials |
    | Access Token | OAuth 2.0 | Obtained automatically after OAuth flow |
    | Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow |
    
    ## Google Calendar
    
    The Google Calendar plugin uses OAuth 2.0 authentication exclusively.
    
    ### Authentication method
    
    * **`oauth_2`** (default) - OAuth 2.0 authentication
    
    ### OAuth 2.0 setup
    
    #### Step 1: create Google Cloud project
    
    1. Go to [Google Cloud Console](https://console.cloud.google.com/)
    2. Click **Select a project** > **New Project**
    3. Enter a project name and click **Create**
    4. Wait for the project to be created and select it
    
    #### Step 2: enable Google Calendar API
    
    1. In the Google Cloud Console, go to **APIs & Services** > **Library**
    2. Search for "Google Calendar API"
    3. Click on **Google Calendar API**
    4. Click **Enable**
    
    #### Step 3: create OAuth 2.0 credentials
    
    1. Go to **APIs & Services** > **Credentials**
    2. Click **Create Credentials** > **OAuth client ID**
    3. If prompted, configure the OAuth consent screen (see Gmail section for details)
    4. Select **Web application**
    5. Configure:
       * **Name**: Your application name
       * **Authorized redirect URIs**: Add your callback URL (e.g., `https://yourapp.com/auth/googlecalendar/callback`)
    6. Click **Create**
    7. Copy the **Client ID** and **Client Secret**
    8. Store these securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    googlecalendar({
        authType: "oauth_2",
        credentials: {
            clientId: process.env.GOOGLE_CALENDAR_CLIENT_ID,
            clientSecret: process.env.GOOGLE_CALENDAR_CLIENT_SECRET,
        },
    })
    ```
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | Client ID | OAuth 2.0 | Google Cloud Console > APIs & Services > Credentials |
    | Client Secret | OAuth 2.0 | Google Cloud Console > APIs & Services > Credentials |
    | Access Token | OAuth 2.0 | Obtained automatically after OAuth flow |
    | Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow |
    
    ## HubSpot
    
    The HubSpot plugin supports both API key and OAuth 2.0 authentication methods.
    
    ### Authentication methods
    
    * **`api_key`** - Private App API key authentication
    * **`oauth_2`** - OAuth 2.0 authentication
    
    ### API key authentication (private app)
    
    #### Step 1: create private app
    
    1. Go to [HubSpot Settings](https://app.hubspot.com/settings)
    2. Navigate to **Integrations** > **Private Apps**
    3. Click **Create a private app**
    4. Enter an app name
    5. Click **Create app**
    
    #### Step 2: configure scopes
    
    1. In your private app settings, go to **Scopes** tab
    2. Select the required scopes:
       * `crm.objects.contacts.read`
       * `crm.objects.contacts.write`
       * `crm.objects.companies.read`
       * `crm.objects.companies.write`
       * `crm.objects.deals.read`
       * `crm.objects.deals.write`
       * `crm.objects.tickets.read`
       * `crm.objects.tickets.write`
       * `engagements.read`
       * `engagements.write`
       * Add any other scopes your application needs
    3. Click **Save**
    
    #### Step 3: get API key
    
    1. Go to the **Overview** tab
    2. Under **API key**, click **Show** to reveal the key
    3. Copy the API key
    4. Store it securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    hubspot({
        authType: "api_key",
        credentials: {
            apiKey: process.env.HUBSPOT_API_KEY,
        },
    })
    ```
    
    ### OAuth 2.0 authentication
    
    #### Step 1: create app
    
    1. Go to [HubSpot Developer Portal](https://developers.hubspot.com/)
    2. Click **Create app**
    3. Enter your app name and click **Create app**
    
    #### Step 2: configure OAuth settings
    
    1. In your app settings, go to **Auth** tab
    2. Under **Redirect URLs**, click **Add**
    3. Add your OAuth redirect URL (e.g., `https://yourapp.com/auth/hubspot/callback`)
    4. Click **Save**
    
    #### Step 3: get client credentials
    
    1. In the **Auth** tab, you'll see your **Client ID**
    2. Click **Show** next to **Client Secret** to reveal it
    3. Copy the **Client ID** and **Client Secret**
    4. Store these securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    hubspot({
        authType: "oauth_2",
        credentials: {
            clientId: process.env.HUBSPOT_CLIENT_ID,
            clientSecret: process.env.HUBSPOT_CLIENT_SECRET,
        },
    })
    ```
    
    ### Webhook secret
    
    #### Step 1: create webhook subscription
    
    1. Go to [HubSpot Settings](https://app.hubspot.com/settings)
    2. Navigate to **Integrations** > **Private Apps**
    3. Select your private app (or create one if needed)
    4. Go to **Webhooks** tab
    5. Click **Create subscription**
    6. Configure:
       * **Event type**: Select from:
         * Contact created/updated/deleted
         * Company created/updated/deleted
         * Deal created/updated/deleted
         * Ticket created/updated/deleted
       * **Webhook URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`)
    7. Click **Save**
    8. If a webhook secret is provided, copy it and store securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    hubspot({
        webhookSecret: process.env.HUBSPOT_WEBHOOK_SECRET,
    })
    ```
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | API Key | API Key auth | Settings > Integrations > Private Apps > Overview |
    | Client ID | OAuth 2.0 | Developer Portal > App Settings > Auth |
    | Client Secret | OAuth 2.0 | Developer Portal > App Settings > Auth |
    | Webhook Secret | Webhooks | Settings > Integrations > Private Apps > Webhooks |
    
    ## Linear
    
    The Linear plugin uses API key authentication.
    
    ### Authentication method
    
    * **`api_key`** (default) - Personal API key authentication
    
    ### API key setup
    
    #### Step 1: generate API key
    
    1. Go to [Linear Settings > API](https://linear.app/settings/api)
    2. Navigate to the **API** section
    3. Under **Personal API keys**, click **Create API key**
    4. Give your key a name (e.g., "Corsair Integration")
    5. Copy the API key immediately
    6. **Important**: Store the key securely - you won't be able to see it again
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    linear({
        authType: "api_key",
        key: process.env.LINEAR_API_KEY,
    })
    ```
    
    ### Webhook secret
    
    #### Step 1: create webhook
    
    1. Go to [Linear Settings > API](https://linear.app/settings/api)
    2. Navigate to **Webhooks** section
    3. Click **Create Webhook**
    4. Configure:
       * **Label**: Your webhook name
       * **URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`)
       * **Resource types**: Select:
         * Issues
         * Comments
         * Projects
    5. Click **Create Webhook**
    6. After creation, copy the **Signing Secret** shown
    7. Store it securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    linear({
        webhookSecret: process.env.LINEAR_WEBHOOK_SECRET,
    })
    ```
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | API Key | API Key auth | Settings > API > Personal API keys |
    | Webhook Secret | Webhooks | Settings > API > Webhooks > Signing Secret |
    
    ## PostHog
    
    The PostHog plugin uses API key authentication.
    
    ### Authentication method
    
    * **`api_key`** (default) - Project API key authentication
    
    ### API key setup
    
    #### Step 1: get project API key
    
    1. Log in to your [PostHog account](https://app.posthog.com)
    2. Navigate to **Project Settings**
    3. Click on **Project API Key** in the left sidebar
    4. Copy your **Project API Key**
    5. Store it securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    posthog({
        authType: "api_key",
        key: process.env.POSTHOG_API_KEY,
    })
    ```
    
    ### Personal API key (optional)
    
    For advanced API access, you can also create a Personal API Key:
    
    1. In PostHog, click on your profile icon (top right)
    2. Go to **Personal API Keys**
    3. Click **Create Personal API Key**
    4. Give it a name and copy the key
    5. **Important**: Store this key securely - you won't be able to see it again
    
    ### Webhook secret
    
    #### Step 1: create webhook destination
    
    1. Go to your PostHog project settings
    2. Navigate to **Data Pipelines** > **Destinations**
    3. Click **New destination**
    4. Select **Webhook** as the destination type
    5. Configure:
       * **Webhook URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`)
       * **Events**: Select `event_captured` or all events
    6. Click **Save**
    7. If a webhook secret is provided, copy it and store securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    posthog({
        webhookSecret: process.env.POSTHOG_WEBHOOK_SECRET,
    })
    ```
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | Project API Key | API Key auth | Project Settings > Project API Key |
    | Personal API Key | Advanced API access (optional) | Profile > Personal API Keys |
    | Webhook Secret | Webhooks | Data Pipelines > Destinations > Webhook |
    
    ## Resend
    
    The Resend plugin uses API key authentication.
    
    ### Authentication method
    
    * **`api_key`** (default) - API key authentication
    
    ### API key setup
    
    #### Step 1: get API key
    
    1. Log in to your [Resend account](https://resend.com)
    2. Navigate to **API Keys** in the dashboard
    3. Click **Create API Key**
    4. Give your key a name (e.g., "Corsair Integration")
    5. Select the required permissions
    6. Click **Create**
    7. Copy the API key immediately
    8. **Important**: Store the key securely - you won't be able to see it again
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    resend({
        authType: "api_key",
        key: process.env.RESEND_API_KEY,
    })
    ```
    
    ### Webhook secret
    
    #### Step 1: create webhook
    
    1. In your Resend dashboard, go to **Webhooks**
    2. Click **Add Webhook**
    3. Configure:
       * **Webhook URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`)
       * **Events**: Select the events you want to receive:
         * `email.sent`
         * `email.delivered`
         * `email.bounced`
         * `email.opened`
         * `email.clicked`
         * `email.complained`
         * `email.failed`
         * `email.received`
         * `domain.created`
         * `domain.updated`
    4. Click **Add Webhook**
    5. After creation, copy the **Signing Secret** shown
    6. Store it securely
    
    **Example Configuration:**
    
    ```ts corsair.ts theme={null}
    resend({
        webhookSecret: process.env.RESEND_WEBHOOK_SECRET,
    })
    ```
    
    ### Required credentials summary
    
    | Credential | Required For | Where to Find |
    | - | - | - |
    | API Key | API Key auth | Dashboard > API Keys |
    | Webhook Secret | Webhooks | Dashboard > Webhooks > Signing Secret |
    
    ## Security best practices
    
    When working with credentials:
    
    1. **Never commit credentials to version control** - Use environment variables or a secrets manager
    2. **Use environment variables** - Store credentials in `.env` files (and add `.env` to `.gitignore`)
    3. **Rotate credentials regularly** - Periodically regenerate API keys and tokens
    4. **Use least privilege** - Only grant the minimum scopes/permissions needed
    5. **Monitor usage** - Regularly check for unauthorized access or unusual activity
    6. **Use secrets managers** - For production, consider using AWS Secrets Manager, HashiCorp Vault, or similar
    
    For more information on how Corsair handles credential security, see [Authentication](/concepts/auth).
    
    
    # Plugins
    Source: https://docs.corsair.dev/guides/plugins
    
    Install an integration package, register it on your Corsair instance, and browse reference docs for each provider.
    
    Corsair integrations ship as **npm packages** under `@corsair-dev/`. Each plugin adds typed API calls, optional webhooks, and a local database layer for that provider.
    
    ## Install the package
    
    Add the core SDK and the plugins you need alongside your other dependencies:
    
    ```bash theme={null}
    npm install corsair @corsair-dev/slack @corsair-dev/linear
    ```
    
    Use the package name that matches the integration (for example `@corsair-dev/gmail`, `@corsair-dev/github`). Every published plugin follows the same `@corsair-dev/` pattern.
    
    ## Add plugins to your Corsair instance
    
    Import `createCorsair` from `corsair` and each plugin's factory from its package. Pass the plugin functions into `plugins`:
    
    ```ts theme={null}
    import { createCorsair } from 'corsair';
    import { slack } from '@corsair-dev/slack';
    import { linear } from '@corsair-dev/linear';
    
    export const corsair = createCorsair({
      plugins: [slack(), linear()],
      database: db,
      kek: process.env.CORSAIR_KEK!,
      multiTenancy: false,
    });
    ```
    
    Then configure credentials for each integration (CLI, env, or your app's setup flow). For a full walkthrough covering integrations, accounts, tenants, and `setupCorsair`, see [Provisioning](/concepts/provisioning).
    
    ## Find a specific integration
    
    Use the sidebar under **Plugins** to open an integration's docs: overview, credentials, API reference, webhooks, and database where applicable.
    
    ## Need something that isn't listed?
    
    If there is no package for the API you need, you can scaffold and ship your own plugin in the Corsair repo:
    
    > **[Build a plugin](/guides/create-your-own-plugin)**
    >
    > Use the generator, wire auth and endpoints, and publish alongside your app.
    
    For storing and rotating credentials across plugins, see [Plugin credentials](/guides/plugin-credentials).
    
    
    # Temporal
    Source: https://docs.corsair.dev/guides/temporal
    
    Start Temporal workflows from Corsair webhook events.
    
    > [!NOTE]
    >
    > **Corsair Workflows (beta)**. Durable workflows, built in. No external engine to wire. [See how](/workflows/overview)
    
    Use Corsair's `webhookHooks` to start Temporal workflows the moment an event fires. Temporal handles durability, retries, and long-running execution. Corsair handles the webhook plumbing and integration auth.
    
    ## Install
    
    ```bash theme={null}
    npm install @temporalio/client @temporalio/workflow @temporalio/activity @temporalio/worker
    ```
    
    ## Event trigger
    
    When a Stripe payment fails, start a Temporal workflow that notifies the customer via Resend. One activity, one action.
    
    ```ts corsair.ts theme={null}
    import { temporalClient } from '@/temporal/client';
    import { handleFailedPayment } from '@/temporal/workflows';
    
    stripe({
        webhookHooks: {
            charge: {
                chargeFailed: {
                    after: async (ctx, result) => {
                        const charge = result.data;
                        await temporalClient.workflow.start(handleFailedPayment, {
                            taskQueue: 'payments',
                            workflowId: `failed-payment-${charge.id}`,
                            args: [{
                                chargeId: charge.id,
                                customerId: charge.customer as string,
                                amount: charge.amount,
                                currency: charge.currency,
                                tenantId: ctx.tenantId,
                            }],
                        });
                    },
                },
            },
        },
    })
    ```
    
    ```ts temporal/workflows.ts theme={null}
    import { proxyActivities } from '@temporalio/workflow';
    import type * as activities from './activities';
    
    const acts = proxyActivities({
        startToCloseTimeout: '30 seconds',
        retry: { maximumAttempts: 3 },
    });
    
    export interface FailedPaymentInput {
        chargeId: string;
        customerId: string;
        amount: number;
        currency: string;
        tenantId?: string;
    }
    
    export async function handleFailedPayment(input: FailedPaymentInput): Promise {
        await acts.sendFailureEmail(input);
    }
    ```
    
    ```ts temporal/activities.ts theme={null}
    import { corsair } from '@/server/corsair';
    import type { FailedPaymentInput } from './workflows';
    
    export async function sendFailureEmail({ customerId, amount, currency, tenantId }: FailedPaymentInput) {
        const client = tenantId ? corsair.withTenant(tenantId) : corsair;
    
        const customer = await client.stripe.api.customers.retrieve({ id: customerId });
    
        await client.resend.api.emails.send({
            from: 'billing@yourapp.com',
            to: customer.data.email!,
            subject: 'Your payment failed',
            html: `

    We couldn't process your payment of ${amount / 100} ${currency.toUpperCase()}. Please update your payment method.

    `, }); } ``` ## Workflow When a new trial contact is created in HubSpot, send a welcome email immediately, wait 3 days, then check if they upgraded. If not, send a follow-up. The `sleep` is durable across restarts, no cron or external scheduler needed. ```ts corsair.ts theme={null} hubspot({ webhookHooks: { contacts: { contactCreated: { before: async (ctx, payload) => { if (payload.properties?.hs_lead_status !== 'trial') { throw new Error('Not a trial contact, skipping'); } return { ctx, payload }; }, after: async (ctx, result) => { const contact = result.data; await temporalClient.workflow.start(trialOnboarding, { taskQueue: 'onboarding', workflowId: `trial-${contact.id}`, args: [{ contactId: contact.id, email: contact.properties.email, firstName: contact.properties.firstname ?? '', tenantId: ctx.tenantId, }], }); }, }, }, }, }) ``` ```ts temporal/workflows.ts theme={null} import { proxyActivities, sleep } from '@temporalio/workflow'; import type * as activities from './activities'; const acts = proxyActivities({ startToCloseTimeout: '30 seconds', retry: { maximumAttempts: 3 }, }); export interface TrialOnboardingInput { contactId: string; email: string; firstName: string; tenantId?: string; } export async function trialOnboarding(input: TrialOnboardingInput): Promise { // Day 0: welcome email await acts.sendWelcomeEmail(input); // Durably wait 3 days — survives worker restarts await sleep('3 days'); // Day 3: check if they upgraded const upgraded = await acts.checkUpgradeStatus(input); if (upgraded) return; // Still on trial — send follow-up await acts.sendFollowUpEmail(input); // Wait another 4 days await sleep('4 days'); // Day 7: final nudge if still on trial const upgradedLate = await acts.checkUpgradeStatus(input); if (!upgradedLate) { await acts.sendTrialEndingEmail(input); } } ``` ```ts temporal/activities.ts theme={null} import { corsair } from '@/server/corsair'; import type { TrialOnboardingInput } from './workflows'; export async function sendWelcomeEmail({ email, firstName, tenantId }: TrialOnboardingInput) { const client = tenantId ? corsair.withTenant(tenantId) : corsair; await client.resend.api.emails.send({ from: 'hello@yourapp.com', to: email, subject: 'Welcome to your trial!', html: `

    Hi ${firstName || 'there'}, your 7-day trial has started. Here's how to get the most out of it...

    `, }); } export async function checkUpgradeStatus({ contactId, tenantId }: TrialOnboardingInput) { const client = tenantId ? corsair.withTenant(tenantId) : corsair; const contact = await client.hubspot.api.contacts.get({ contactId }); return contact.data.properties.hs_lead_status === 'customer'; } export async function sendFollowUpEmail({ email, firstName, tenantId }: TrialOnboardingInput) { const client = tenantId ? corsair.withTenant(tenantId) : corsair; await client.resend.api.emails.send({ from: 'hello@yourapp.com', to: email, subject: 'How\'s your trial going?', html: `

    Hi ${firstName || 'there'}, you're halfway through your trial. Any questions?

    `, }); } export async function sendTrialEndingEmail({ email, firstName, tenantId }: TrialOnboardingInput) { const client = tenantId ? corsair.withTenant(tenantId) : corsair; await client.resend.api.emails.send({ from: 'hello@yourapp.com', to: email, subject: 'Your trial ends tomorrow', html: `

    Hi ${firstName || 'there'}, your trial ends tomorrow. Upgrade now to keep access.

    `, }); } ``` ## Cron job Create a Temporal schedule that runs every morning and posts a standup digest to Slack. The digest lists all open Linear issues, pulled from Corsair's local database. ```ts temporal/schedules.ts theme={null} import { Client } from '@temporalio/client'; import { morningStandupWorkflow } from './workflows'; const client = new Client(); // Run once at startup to register the schedule await client.schedule.create({ scheduleId: 'morning-standup-digest', spec: { cronExpressions: ['0 9 * * 1-5'], // Weekdays at 9am UTC }, action: { type: 'startWorkflow', workflowType: morningStandupWorkflow, taskQueue: 'corsair-queue', }, }); ``` ```ts temporal/workflows.ts theme={null} import { proxyActivities } from '@temporalio/workflow'; import type * as activities from './activities'; const acts = proxyActivities({ startToCloseTimeout: '60 seconds', }); export async function morningStandupWorkflow(): Promise { await acts.postStandupDigest(); } ``` ```ts temporal/activities.ts theme={null} import { corsair } from '@/server/corsair'; export async function postStandupDigest() { // Query Corsair's synced Linear database (fields live on .data) const all = await corsair.linear.db.issues.list(); // Rows store flat stateId/assigneeId, not nested objects. // Compare stateId against your configured Linear state ids. const inProgress = all .filter((i) => i.data.stateId === process.env.LINEAR_IN_PROGRESS_STATE_ID) // Sort newest-first in JS .sort((a, b) => Date.parse(b.data.updatedAt) - Date.parse(a.data.updatedAt)); const blocked = all.filter((i) => i.data.stateId === process.env.LINEAR_BLOCKED_STATE_ID); // Rows carry assigneeId, not names. Resolve the related record if you need names. const lines = [ `*Morning Standup — ${new Date().toDateString()}*`, '', `*In Progress (${inProgress.length})*`, ...inProgress.map((i) => `• ${i.data.title} — ${i.data.assigneeId ?? 'Unassigned'}`), '', `*Blocked (${blocked.length})*`, ...blocked.map((i) => `• ${i.data.title} — ${i.data.assigneeId ?? 'Unassigned'}`), ]; await corsair.slack.api.messages.post({ channel: 'C_ENG_STANDUP', text: lines.join('\n'), }); } ``` > [!NOTE] > > Register the schedule once, ideally in a migration or a one-off setup script. A `scheduleId` must be unique, so calling `client.schedule.create()` again with the same id throws `ScheduleAlreadyRunning`. If you register on every server startup, wrap the call and swallow only that error: > > ```ts theme={null} > import { ScheduleAlreadyRunning } from '@temporalio/client'; > > try { > await client.schedule.create({ scheduleId: 'morning-standup-digest', /* ... */ }); > } catch (err) { > if (!(err instanceof ScheduleAlreadyRunning)) throw err; > } > ``` ## What's next > **[Inngest](/guides/inngest)** > > Durable step functions triggered from Corsair webhooks. > **[Trigger.dev](/guides/trigger-dev)** > > Background tasks and scheduled jobs with Trigger.dev. > **[Hatchet](/guides/hatchet)** > > Event-driven workflows with Hatchet. > **[Workflows guide](/guides/workflows)** > > Chain webhook events without a job queue. # Trigger.dev Source: https://docs.corsair.dev/guides/trigger-dev Run Trigger.dev background tasks from Corsair webhook events. > [!NOTE] > > **Corsair Workflows (beta)**. Durable workflows, built in. No external engine to wire. [See how](/workflows/overview) Use Corsair's `webhookHooks` to dispatch Trigger.dev tasks the moment an event fires. Trigger.dev handles retries, logging, and scheduling. Corsair handles webhook verification and integration auth. ## Install ```bash theme={null} npm install @trigger.dev/sdk ``` ## Event trigger When a PagerDuty incident is created, use `before` to skip low-severity alerts, and `after` to trigger a background task that creates a GitHub issue and pages the on-call team in Slack. ```ts corsair.ts theme={null} import { notifyOnCall } from '@/trigger/functions'; pagerduty({ webhookHooks: { incident: { incidentTriggered: { before: async (ctx, payload) => { // Only react to high-severity incidents if (payload.incident.urgency !== 'high') { throw new Error('Low severity, skipping'); } return { ctx, payload }; }, after: async (ctx, result) => { const incident = result.data.incident; await notifyOnCall.trigger({ incidentId: incident.id, title: incident.title, htmlUrl: incident.html_url, serviceId: incident.service.id, tenantId: ctx.tenantId, }); }, }, }, }, }) ``` ```ts trigger/functions.ts theme={null} import { task } from '@trigger.dev/sdk/v3'; import { corsair } from '@/server/corsair'; export const notifyOnCall = task({ id: 'notify-on-call', run: async (payload: { incidentId: string; title: string; htmlUrl: string; serviceId: string; tenantId?: string; }) => { const client = payload.tenantId ? corsair.withTenant(payload.tenantId) : corsair; // Create a GitHub issue to track the incident const issue = await client.github.api.issues.create({ owner: process.env.GITHUB_ORG!, repo: process.env.GITHUB_OPS_REPO!, title: `[Incident] ${payload.title}`, body: `PagerDuty incident: ${payload.htmlUrl}\n\nService ID: ${payload.serviceId}`, labels: ['incident', 'high-severity'], }); // Page the on-call channel in Slack await client.slack.api.messages.post({ channel: 'C_ONCALL_CHANNEL', text: `🚨 *High severity incident*: ${payload.title}\nPagerDuty: ${payload.htmlUrl}\nGitHub: ${issue.data.html_url}`, }); }, }); ``` ## Workflow When a new HubSpot contact is created, run a multi-step task that enriches the contact, sends a personalized welcome email, and notifies the sales team in Slack. ```ts corsair.ts theme={null} import { onboardNewContact } from '@/trigger/functions'; hubspot({ webhookHooks: { contacts: { contactCreated: { before: async (ctx, payload) => { // Only process contacts with an email address if (!payload.properties?.email) { throw new Error('No email address, skipping'); } return { ctx, payload }; }, after: async (ctx, result) => { await onboardNewContact.trigger({ contactId: result.data.id, email: result.data.properties.email, firstName: result.data.properties.firstname ?? '', company: result.data.properties.company ?? '', tenantId: ctx.tenantId, }); }, }, }, }, }) ``` ```ts trigger/functions.ts theme={null} import { task, wait } from '@trigger.dev/sdk/v3'; import { corsair } from '@/server/corsair'; export const onboardNewContact = task({ id: 'onboard-new-contact', run: async (payload: { contactId: string; email: string; firstName: string; company: string; tenantId?: string; }) => { const client = payload.tenantId ? corsair.withTenant(payload.tenantId) : corsair; // Step 1: Enrich the contact with company data const companyData = await enrichCompany(payload.company); // your enrichment logic await client.hubspot.api.contacts.update({ contactId: payload.contactId, properties: { industry: companyData.industry, numberofemployees: companyData.headcount?.toString(), }, }); // Step 2: Send a personalized welcome email await client.resend.api.emails.send({ from: 'hello@yourapp.com', to: payload.email, subject: `Welcome${payload.firstName ? `, ${payload.firstName}` : ''}!`, html: `

    Thanks for signing up${payload.company ? ` from ${payload.company}` : ''}. Here's how to get started...

    `, }); // Step 3: Wait 5 minutes, then notify sales in Slack await wait.for({ minutes: 5 }); await client.slack.api.messages.post({ channel: 'C_SALES_CHANNEL', text: `New contact: *${payload.firstName || payload.email}*${payload.company ? ` from ${payload.company}` : ''}\nIndustry: ${companyData.industry ?? 'Unknown'}`, }); }, }); ``` ## Cron job Every Friday at 5 PM, pull unresolved Sentry issues from Corsair's database and post a weekly error report to Slack so the team can triage before the weekend. ```ts trigger/functions.ts theme={null} import { schedules } from '@trigger.dev/sdk/v3'; import { corsair } from '@/server/corsair'; export const weeklyErrorReport = schedules.task({ id: 'weekly-error-report', cron: '0 17 * * 5', // Every Friday at 5pm UTC run: async () => { // Query Corsair's synced Sentry database (fields live on .data) const unresolved = await corsair.sentry.db.issues.search({ data: { status: 'unresolved' }, }); // Sort newest-first and take the top 10 in JS const issues = unresolved .sort((a, b) => Date.parse(b.data.lastSeen) - Date.parse(a.data.lastSeen)) .slice(0, 10); if (issues.length === 0) { await corsair.slack.api.messages.post({ channel: 'C_ENG_CHANNEL', text: '✅ No unresolved Sentry issues — great week!', }); return; } const lines = [ `*Weekly Error Report — Top ${issues.length} unresolved issues*`, '', ...issues.map( (i, idx) => `${idx + 1}. *${i.data.title}* — ${i.data.count} events, last seen ${new Date(i.data.lastSeen).toLocaleDateString()}`, ), '', `_Triage before Monday_ 👆`, ]; await corsair.slack.api.messages.post({ channel: 'C_ENG_CHANNEL', text: lines.join('\n'), }); }, }); ``` > [!NOTE] > > Register scheduled tasks in your Trigger.dev worker entry point. They're automatically deployed and managed, so you need no separate cron infrastructure. ## What's next > **[Inngest](/guides/inngest)** > > Durable step functions triggered from Corsair webhooks. > **[Temporal](/guides/temporal)** > > Start Temporal workflows from Corsair webhook events. > **[Hatchet](/guides/hatchet)** > > Event-driven workflows with Hatchet. > **[Workflows guide](/guides/workflows)** > > Chain webhook events without a job queue. # Webhooks Source: https://docs.corsair.dev/guides/webhooks Receive real-time events from any plugin in three steps. Webhooks let external services push events to you the moment something happens, like a GitHub star, a Slack message, or a PR merged. You expose one endpoint. Corsair verifies the signature, identifies the plugin, and calls your handler. **Three steps: ngrok, register, react.** ## Step 1: expose a public URL GitHub and Slack can't reach `localhost`. Use ngrok to tunnel your local server: ```bash theme={null} # Install ngrok — https://ngrok.com/download ngrok http 3000 ``` You'll get a URL like `https://abc123.ngrok-free.app`. Copy it. > [!NOTE] > > **Get a stable URL (recommended)** > Free ngrok accounts get a random URL on every restart, so you'd have to re-register your webhook every time. Claim a **free static domain** at [dashboard.ngrok.com/domains](https://dashboard.ngrok.com/domains) and it'll never change. ## Step 2: create the webhook endpoint Add one route to your server. All plugins share this single URL: ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from 'corsair'; import type { NextRequest } from 'next/server'; import { NextResponse } from 'next/server'; import { corsair } from '@/server/corsair'; export async function POST(request: NextRequest) { const headers: Record = {}; request.headers.forEach((value, key) => { headers[key] = value; }); const body = request.headers.get('content-type')?.includes('application/json') ? await request.json() : await request.text(); // Include tenantId if you're using multi-tenancy const tenantId = new URL(request.url).searchParams.get('tenantId') ?? undefined; const result = await processWebhook(corsair, headers, body, { tenantId }); if (!result.response) { return NextResponse.json({ success: false }, { status: 404 }); } return NextResponse.json(result.response); } ``` `processWebhook` handles everything: it identifies which plugin sent the event, verifies the signature, updates your local database, and runs your hooks. ## Step 3: register and react **GitHub** **Register in GitHub:** 1. Go to your repo, then **Settings**, **Webhooks**, **Add webhook** 2. Set **Payload URL**: `https://your-ngrok-url.ngrok-free.app/api/webhook` 3. Set **Content type**: `application/json` 4. Add a **Secret**, then save it 5. Choose events (or "Send me everything") 6. Click **Add webhook** **Store the secret:** Pass the secret to the plugin in `createCorsair`. Corsair uses it to verify incoming webhook signatures. ```ts corsair.ts theme={null} github({ webhookSecret: process.env.GITHUB_WEBHOOK_SECRET, }) ``` **React to events:** ```ts corsair.ts theme={null} github({ webhookHooks: { starCreated: { after: async (ctx, result) => { console.log(`⭐ ${result?.data?.sender?.login} starred ${result?.data?.repository?.full_name}`); }, }, pullRequestOpened: { after: async (ctx, result) => { const pr = result?.data?.pull_request; console.log(`PR opened: "${pr?.title}" by ${pr?.user?.login}`); }, }, push: { after: async (ctx, result) => { const branch = result?.data?.ref.replace('refs/heads/', ''); console.log(`${result?.data?.commits?.length} commit(s) pushed to ${branch}`); }, }, }, }) ``` **Slack** **Register in Slack:** 1. Go to [api.slack.com/apps](https://api.slack.com/apps), then your app 2. Navigate to **Event Subscriptions** 3. Enable events and set the **Request URL**: `https://your-ngrok-url.ngrok-free.app/api/webhook` 4. Slack will send a challenge. Corsair handles verification automatically 5. Subscribe to bot events: `message.channels`, `team_join`, `reaction_added` **Store the signing secret:** Pass the signing secret to the plugin in `createCorsair`. Corsair uses it to verify incoming webhook signatures. ```ts corsair.ts theme={null} slack({ signingSecret: process.env.SLACK_SIGNING_SECRET, }) ``` **React to events:** ```ts corsair.ts theme={null} slack({ webhookHooks: { messages: { message: { after: async (ctx, result) => { if (result.data.bot_id) return; // skip bots console.log(`Message: ${result.data.text}`); }, }, }, users: { teamJoin: { after: async (ctx, result) => { console.log(`New member: ${result.data.user.name}`); }, }, }, }, }) ``` ## How it works ``` Incoming webhook → Corsair reads headers to identify the plugin → Verifies signature against stored secret → Updates local database → Runs your webhookHooks.after() handler ``` Every plugin shares the same endpoint. You never write routing logic. ## What's next > **[Workflows](/guides/workflows)** > > Chain webhook events into multi-step automations. > **[Multi-tenancy](/concepts/multi-tenancy)** > > Scope incoming webhooks per user with ?tenantId= param. > **[GitHub webhooks](/plugins/github/webhooks)** > > All available GitHub events and payload shapes. > **[Slack webhooks](/plugins/slack/webhooks)** > > All available Slack events and payload shapes. # Workflows Source: https://docs.corsair.dev/guides/workflows Chain webhook events into multi-step automations across any plugin. Workflows are event-driven automations built on Corsair's webhook hooks. When something happens in one service, you trigger actions in another. **Pattern:** an event fires, the webhook hook runs, then you call any plugin API. No separate workflow engine needed. It's just TypeScript. ## How it works Every webhook event in Corsair supports an `after` hook, a function that runs after the event is saved to your database. Inside it, you have full access to `corsair` and can call any plugin API. ```ts corsair.ts theme={null} github({ webhookHooks: { pullRequestOpened: { after: async (ctx, result) => { const pr = result?.data?.pull_request; // Do anything here — call Slack, send email, create Linear issue await corsair.slack.api.messages.post({ channel: 'C_ENG_CHANNEL', text: `New PR: *${pr?.title}* by ${pr?.user?.login}\n${pr?.html_url}`, }); }, }, }, }) ``` That's a workflow. A GitHub PR opens, and a Slack message is sent. ## Common patterns **GitHub to Slack** **Notify Slack when a PR is merged:** ```ts corsair.ts theme={null} github({ webhookHooks: { pullRequestClosed: { after: async (ctx, result) => { const pr = result.data.pull_request; if (!pr.merged) return; // closed without merging await corsair.slack.api.messages.post({ channel: 'C_RELEASES_CHANNEL', text: `✅ Merged: *${pr.title}*\n${pr.html_url}`, }); }, }, }, }) ``` **Alert on new stars:** ```ts corsair.ts theme={null} github({ webhookHooks: { starCreated: { after: async (ctx, result) => { const { sender, repository } = result.data; await corsair.slack.api.messages.post({ channel: 'C_GROWTH_CHANNEL', text: `⭐ ${sender.login} starred ${repository.full_name} — now at ${repository.stargazers_count} stars`, }); }, }, }, }) ``` **Slack to GitHub** **Create a GitHub issue when someone posts in #bugs:** ```ts corsair.ts theme={null} slack({ webhookHooks: { messages: { message: { after: async (ctx, result) => { // Only react to messages in the #bugs channel if (result.data.channel !== 'C_BUGS_CHANNEL') return; if (result.data.bot_id) return; // skip bots await corsair.github.api.issues.create({ owner: 'your-org', repo: 'your-repo', title: `[Slack] ${result.data.text.slice(0, 80)}`, body: `Reported via Slack by <@${result.data.user}>:\n\n${result.data.text}`, labels: ['from-slack'], }); }, }, }, }, }) ``` **Multi-step** **When a PR merges, post a Slack message, then create a Linear issue to track follow-up:** ```ts corsair.ts theme={null} github({ webhookHooks: { pullRequestClosed: { after: async (ctx, result) => { const pr = result.data.pull_request; if (!pr.merged) return; // Step 1: Notify Slack await corsair.slack.api.messages.post({ channel: 'C_ENG_CHANNEL', text: `✅ Merged: *${pr.title}*`, }); // Step 2: Create a Linear issue for post-merge follow-up await corsair.linear.api.issues.create({ title: `Post-merge: ${pr.title}`, description: `Follow up after merging ${pr.html_url}`, teamId: process.env.LINEAR_TEAM_ID!, labelIds: [process.env.LINEAR_POST_MERGE_LABEL!], }); }, }, }, }) ``` ## Filter with `before` hooks Use `before` to reject events before they hit your database or `after` handler: ```ts corsair.ts theme={null} github({ webhookHooks: { pullRequestOpened: { before: async (ctx, payload) => { // Ignore draft PRs entirely if (payload.pull_request.draft) { throw new Error('Skipping draft PR'); } return { ctx, payload }; }, after: async (ctx, result) => { // Only runs for non-draft PRs await corsair.slack.api.messages.post({ channel: 'C_ENG_CHANNEL', text: `PR ready for review: ${result.data.pull_request.title}`, }); }, }, }, }) ``` Throwing in `before` stops processing entirely. The event isn't saved to your database. ## Background jobs For heavy processing (LLM calls, sending emails, generating reports), fire a background job instead of doing work inline: ```ts corsair.ts theme={null} github({ webhookHooks: { pullRequestOpened: { after: async (ctx, result) => { // Send to your job queue — don't block the webhook response await inngest.send({ name: 'github/pr-opened', data: { tenantId: ctx.tenantId, pr: result.data.pull_request, }, }); }, }, }, }) ``` ```ts inngest/functions.ts theme={null} export const reviewPR = inngest.createFunction( { id: 'review-pr' }, { event: 'github/pr-opened' }, async ({ event }) => { const { pr } = event.data; // Now you can do slow work: call an LLM, send emails, etc. const review = await generateCodeReview(pr); await corsair.github.api.issues.createComment({ owner: pr.base.repo.owner.login, repo: pr.base.repo.name, issueNumber: pr.number, body: review, }); } ); ``` Webhook response stays fast. The work happens in the background. ## What's next > **[Webhooks setup](/guides/webhooks)** > > Get ngrok running and register your first webhook endpoint. > **[GitHub webhooks](/plugins/github/webhooks)** > > All available GitHub events you can react to. > **[Slack webhooks](/plugins/slack/webhooks)** > > All available Slack events you can react to. > **[Hooks reference](/concepts/hooks)** > > Full before/after hook API and all available options. # Hub Source: https://docs.corsair.dev/hub/overview The hosted relay for the parts of Corsair that need a public URL, connect flows and approvals. Your users' API tokens land in your database, not Hub. Corsair runs in your own app. A few things, though, need a stable public URL a third party can reach: OAuth callbacks and approval pages. Hub handles them. It is a hosted relay that provides those surfaces so you skip the boilerplate. Hub is the same `createCorsair` instance with one extra config block: add it and Corsair routes the public-URL surfaces through Hub. There is no separate product or SDK to adopt. ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; export const corsair = createCorsair({ plugins: [github({ authType: 'managed' })], database: db, kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` ## Where your credentials live Hub stores **zero** of your tenants' tokens. Their access and refresh tokens live only in **your** database, encrypted under your [KEK](/concepts/auth#envelope-encryption). What Hub keeps is the OAuth **client** credentials that run the flow, the app-level client id and secret, whether Corsair manages them for you or you bring your own. Those are your app's credentials, not your users'. That split is the point of Hub. Once a tenant connects, the token sits in your database and you call the provider as many times as you want, with no per-call round-trip to Corsair and no usage cap from us. Other integration products keep your users' tokens on their side and meter every call through their gateway. Corsair hands you the tokens and stays out of the path. ```mermaid theme={null} flowchart LR Prov[OAuth Provider] Hub["Corsair Hub
    relays tokens to your app"] App[Your App] DB[(Your Database)] Prov <--> Hub Hub <--> App App -->|encrypted tokens| DB ``` The same envelope encryption described in [Authentication](/concepts/auth#envelope-encryption) still applies. Each connection gets its own DEK, encrypted with your KEK, and the plaintext credential lives in your database. ## What Hub provides Three surfaces normally need a public URL. Hub hosts all three: > **OAuth callbacks** > > Register one callback URL with the provider. Hub holds it for both [development and production](/hub/environments). No more swapping redirect URIs between environments. > **Hosted connect page** > > When an action needs a connection the user has not made yet, call `createLink()` to mint a Hub sign-in link. Hub hosts the connect page, so there is none to build. The user connects and retries. > **Approval UI** > > For gated [permissions](/concepts/permissions), the SDK generates a link to a hosted approve/deny page. You do not build a review UI. ## Connecting an account When an action needs a connection the user hasn't made yet, recover in four steps: 1. Corsair throws an auth-missing error. No connection exists for this tenant. 2. Call `createLink()` to mint a Hub sign-in link and send the user to it. 3. The user connects on Hub's hosted page. Tokens land encrypted in your database. 4. Retry the original action. It succeeds. You can also copy sign-in links from the [Hub dashboard](/hub/dashboard) without writing code. ## One callback, two environments Without Hub, the OAuth redirect URI you register with each provider has to match the environment that is running, so you end up juggling separate provider apps (or rewriting redirect URIs) for local and production. With Hub you register **one** callback URL with the provider. Hub receives the callback and delivers the result to your app. Development and production use separate API keys and different delivery paths. See [Environments](/hub/environments) for why (signed POST over a Corsair tunnel locally, signed POST to your public URL in production). ## Turning Hub on Set up a project in the [Hub dashboard](https://hub.corsair.dev/dashboard), then pass the `hub` block to `createCorsair`. **1. Create an organization and project** Sign in to the dashboard, create an organization, then create your first project. You get **development** and **production** environments automatically. **2. Copy development credentials** Open the **Keys** tab (development environment). Add the API key and signing secret to your local env. Use development keys locally; switch to production keys when you deploy. ```bash .env.local theme={null} CORSAIR_API_KEY=ck_dev_... CORSAIR_SIGNING_SECRET=... CORSAIR_KEK=... ``` **3. Register the OAuth redirect URL (BYO plugins)** For plugins where you bring your own OAuth app, register `https://auth.corsair.dev/oauth/callback` in each provider console (GitHub, Google, etc.). This is the single callback Hub holds for every environment. Managed plugins skip this step; Corsair hosts the OAuth app. **4. Mount the handler and run locally** Mount `toNextJsHandler` at `/api/corsair`. In development, Hub auto-detects your localhost delivery URL, so no dashboard registration is needed. **5. Activate production when you deploy** Switch to the **production** environment in the dashboard, register your public HTTPS delivery URL, and set `ck_prod_…` credentials in your deployed env. See [Environments](/hub/environments). The `hub` block carries two required fields: | Field | Purpose | | - | - | | `projectApiKey` | Identifies your project and environment (`ck_dev_…` or `ck_prod_…`) | | `signingSecret` | Verifies signed deliveries so only your app accepts them | Optional: `apiUrl` (self-hosted Hub API), `oauthCallbackUrl` (override callback URL). Mount the handler once and it serves both Hub delivery and the [management API](/management/overview): ```ts app/api/corsair/[[...path]]/route.ts theme={null} import { toNextJsHandler } from 'corsair'; import { corsair } from '@/server/corsair'; export const { GET, POST, OPTIONS } = toNextJsHandler(corsair, { basePath: '/api/corsair', }); ``` From there, minting a connect link is one API call. See [Connect / OAuth](/management/connect) for the reference. ## Why Hub Hub saves you from building and hosting connect pages, approval UIs, and per-environment OAuth callbacks. One provider callback covers local development and production. > [!NOTE] > > Hub does not change how your agents call APIs. `corsair.slack.api.*`, `withTenant`, hooks, and the database layer all behave the same. Hub only affects the public-URL surfaces. ## What's next > **[Environments](/hub/environments)** > > Development vs production keys and delivery. > **[Hub dashboard](/hub/dashboard)** > > Connections, sign-in links, and production activation. > **[Delivery URLs](/hub/delivery-urls)** > > Tunnel vs public-URL signed POST delivery. # Introduction Source: https://docs.corsair.dev/introduction Open-source integration layer for agents and apps. Corsair is an open-source integration layer for apps and agents. Connect to GitHub, Slack, Gmail, and 200+ other services through one syntax. Corsair handles OAuth, token refresh, webhooks, and rate limits. You run it inside your own app. Credentials stay encrypted in your database. [Hub](/hub/overview) hosts connect pages and OAuth callbacks so you don't build those public URLs yourself. Install plugins, wire up Corsair once, then call any integration the same way: ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; import { slack } from '@corsair-dev/slack'; export const corsair = createCorsair({ plugins: [github(), slack()], database: db, kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` ```ts route.ts theme={null} await corsair.github.api.issues.create({ owner: 'acme', repo: 'app', title: 'Bug' }); await corsair.slack.api.messages.post({ channel: 'C123', text: 'On it.' }); ``` ## Get started > **[Quick start](/quick-start)** > > Empty project to a connected integration in five steps. > **[Set up with your agent](/getting-started/set-up-with-your-agent)** > > One prompt for your coding agent to wire Corsair in. > **[Pick your framework](/frameworks/next)** > > Next, Node, Express, Hono, SvelteKit, Remix, Astro. Mount the route in yours. > **[Browse plugins](/guides/plugins)** > > Slack, Linear, Gmail, GitHub, HubSpot, Stripe, and hundreds more. # Anthropic SDK Source: https://docs.corsair.dev/mcp-adapters/anthropic-sdk Connect Corsair to the Anthropic SDK using tool use. Use `AnthropicProvider` to connect Corsair to the [Anthropic SDK](https://github.com/anthropics/anthropic-sdk-typescript) via native tool use. ## Install ```bash theme={null} npm install @anthropic-ai/sdk ``` ## Usage ```ts agent.ts theme={null} import Anthropic from '@anthropic-ai/sdk'; import { AnthropicProvider } from '@corsair-dev/mcp'; import { corsair } from './corsair'; const provider = new AnthropicProvider(); const tools = provider.build({ corsair }); const client = new Anthropic(); const message = await client.beta.messages.toolRunner({ model: 'claude-sonnet-4-6', max_tokens: 4096, tools, messages: [ { role: 'user', content: 'Setup corsair, then list all Slack channels.', }, ], }); for (const block of message.content) { if (block.type === 'text') console.log(block.text); } ``` `AnthropicProvider.build()` is synchronous. It returns the tools array directly, ready to pass to any Anthropic API call. `toolRunner` handles the tool call loop automatically, invoking each tool and feeding results back until the model produces a final response. # Claude Code Source: https://docs.corsair.dev/mcp-adapters/claude-code Connect Corsair to Claude Code via MCP or use the CLI directly. **MCP** Use `runStdioMcpServer` to expose Corsair as a local MCP server that Claude Code spawns on demand. ## Install ```bash theme={null} npm install @corsair-dev/mcp ``` ## Create the server script ```ts mcp-server.ts theme={null} import 'dotenv/config'; import { runStdioMcpServer } from '@corsair-dev/mcp'; import { corsair } from './corsair'; runStdioMcpServer({ corsair }).catch((err) => { console.error('[corsair-mcp] Fatal:', err); process.exit(1); }); ``` ## Configure Claude Code Add a `.mcp.json` file at your project root. Claude Code reads this automatically when you open the project. ```json .mcp.json theme={null} { "mcpServers": { "corsair": { "command": "npx", "args": ["tsx", "mcp-server.ts"] } } } ``` If your credentials aren't loaded from a `.env` file, pass them via `env`: ```json .mcp.json theme={null} { "mcpServers": { "corsair": { "command": "npx", "args": ["tsx", "mcp-server.ts"], "env": { "CORSAIR_KEK": "your-key-here" } } } } ``` Restart Claude Code after adding the config. You can verify the server is connected by running `/mcp` in the Claude Code prompt. `corsair` should appear in the list. ## Usage Once connected, Claude Code can call Corsair tools directly. Start a conversation: ``` Setup corsair, then list all Slack channels. ``` Claude calls `list_operations` to discover available endpoints, `get_schema` to inspect parameters, then `run_script` to execute. **CLI** ```bash npm theme={null} npm install @corsair-dev/cli ``` ```bash yarn theme={null} yarn add @corsair-dev/cli ``` ```bash pnpm theme={null} pnpm install @corsair-dev/cli ``` ```bash bun theme={null} bun add @corsair-dev/cli ``` Copy and paste this prompt into Claude Code to give it everything it needs to work with Corsair: ``` Run `pnpm corsair` to access Corsair's integrations. ``` # Claude Agent SDK Source: https://docs.corsair.dev/mcp-adapters/claude-sdk Use Corsair with the Claude Agent SDK via an in-process MCP server, no HTTP transport needed. Use `ClaudeProvider` to connect Corsair to the [Claude Agent SDK](https://github.com/anthropics/claude-agent-sdk) with an in-process MCP server. No HTTP transport needed. ## Install ```bash theme={null} npm install @anthropic-ai/claude-agent-sdk @corsair-dev/mcp ``` ## Usage ```ts agent.ts theme={null} import { createSdkMcpServer, query } from '@anthropic-ai/claude-agent-sdk'; import { ClaudeProvider } from '@corsair-dev/mcp'; import { corsair } from './corsair'; const provider = new ClaudeProvider(); const tools = await provider.build({ corsair }); const server = createSdkMcpServer({ name: 'corsair', tools }); const stream = query({ prompt: 'List my GitHub repos with the most open issues.', options: { model: 'claude-opus-4-6', mcpServers: { corsair: server }, }, }); for await (const event of stream) { if ('result' in event) process.stdout.write(event.result); } ``` `ClaudeProvider.build()` is async. It dynamically imports the Claude Agent SDK as an optional peer dependency. The Claude Agent SDK handles the tool-call loop automatically via `query()`. # Codex Source: https://docs.corsair.dev/mcp-adapters/codex Connect Corsair to OpenAI's Codex CLI via MCP, or use the Corsair CLI directly. **MCP** Use `runStdioMcpServer` to expose Corsair as a local MCP server that Codex spawns on demand. ## Install ```bash theme={null} npm install @corsair-dev/mcp ``` ## Create the server script ```ts mcp-server.ts theme={null} import 'dotenv/config'; import { runStdioMcpServer } from '@corsair-dev/mcp'; import { corsair } from './corsair'; runStdioMcpServer({ corsair }).catch((err) => { console.error('[corsair-mcp] Fatal:', err); process.exit(1); }); ``` ## Configure Codex Codex reads MCP servers from `~/.codex/config.toml`. Add a `corsair` server: ```toml ~/.codex/config.toml theme={null} [mcp_servers.corsair] command = "npx" args = ["tsx", "mcp-server.ts"] ``` If your credentials aren't loaded from a `.env` file, pass them under an `env` table: ```toml ~/.codex/config.toml theme={null} [mcp_servers.corsair] command = "npx" args = ["tsx", "mcp-server.ts"] [mcp_servers.corsair.env] CORSAIR_KEK = "your-key-here" ``` Restart Codex after editing the config. Run `codex mcp list` to confirm `corsair` is registered. ## Usage Once connected, Codex can call Corsair tools directly: ``` Setup corsair, then list all Slack channels. ``` Codex calls `list_operations` to discover available endpoints, `get_schema` to inspect parameters, then `run_script` to execute. **CLI** ```bash npm theme={null} npm install @corsair-dev/cli ``` ```bash yarn theme={null} yarn add @corsair-dev/cli ``` ```bash pnpm theme={null} pnpm install @corsair-dev/cli ``` ```bash bun theme={null} bun add @corsair-dev/cli ``` Copy and paste this prompt into Codex to give it everything it needs to work with Corsair: ``` Run `pnpm corsair` to access Corsair's integrations. ``` # Cursor Source: https://docs.corsair.dev/mcp-adapters/cursor Connect Corsair to Cursor via MCP or use the CLI directly. **MCP** Use `runStdioMcpServer` to expose Corsair as a local MCP server that Cursor spawns on demand. ## Install ```bash theme={null} npm install @corsair-dev/mcp ``` ## Create the server script ```ts mcp-server.ts theme={null} import 'dotenv/config'; import { runStdioMcpServer } from '@corsair-dev/mcp'; import { corsair } from './corsair'; runStdioMcpServer({ corsair }).catch((err) => { console.error('[corsair-mcp] Fatal:', err); process.exit(1); }); ``` ## Configure Cursor Add a `.cursor/mcp.json` file at your project root. Cursor reads this automatically when you open the project. ```json .cursor/mcp.json theme={null} { "mcpServers": { "corsair": { "command": "npx", "args": ["tsx", "mcp-server.ts"] } } } ``` If your credentials aren't loaded from a `.env` file, pass them via `env`: ```json .cursor/mcp.json theme={null} { "mcpServers": { "corsair": { "command": "npx", "args": ["tsx", "mcp-server.ts"], "env": { "CORSAIR_KEK": "your-key-here" } } } } ``` Restart Cursor after adding the config. You can verify the server is connected in **Settings, Cursor Settings, MCP**. `corsair` should appear with a green indicator. ## Usage Once connected, use Corsair tools in Cursor's agent (Cmd+I or the chat panel): ``` Setup corsair, then list all GitHub issues assigned to me. ``` The agent calls `list_operations` to discover available endpoints, `get_schema` to inspect parameters, then `run_script` to execute. **CLI** ```bash npm theme={null} npm install @corsair-dev/cli ``` ```bash yarn theme={null} yarn add @corsair-dev/cli ``` ```bash pnpm theme={null} pnpm install @corsair-dev/cli ``` ```bash bun theme={null} bun add @corsair-dev/cli ``` Copy and paste this prompt into Cursor to give it everything it needs to work with Corsair: ``` Run `pnpm corsair` to access Corsair's integrations. ``` # Hermes Source: https://docs.corsair.dev/mcp-adapters/hermes Connect Corsair to the Hermes agent via MCP, or use the Corsair CLI directly. **MCP** Use `runStdioMcpServer` to expose Corsair as a local MCP server that Hermes spawns on demand. The Corsair side is identical to every other harness. The only difference is where you register the server in Hermes. ## Install ```bash theme={null} npm install @corsair-dev/mcp ``` ## Create the server script ```ts mcp-server.ts theme={null} import 'dotenv/config'; import { runStdioMcpServer } from '@corsair-dev/mcp'; import { corsair } from './corsair'; runStdioMcpServer({ corsair }).catch((err) => { console.error('[corsair-mcp] Fatal:', err); process.exit(1); }); ``` ## Configure Hermes Register the server with Hermes using the standard stdio MCP shape, a `command` and its `args`: ```json theme={null} { "mcpServers": { "corsair": { "command": "npx", "args": ["tsx", "mcp-server.ts"] } } } ``` If your credentials aren't loaded from a `.env` file, add an `env` block with `CORSAIR_KEK`. > [!NOTE] > > Register this under Hermes's MCP configuration. Check the Hermes docs for the exact config path, as it differs per version. ## Usage Once connected, Hermes can call Corsair tools directly: ``` Setup corsair, then list all Slack channels. ``` Hermes calls `list_operations` to discover available endpoints, `get_schema` to inspect parameters, then `run_script` to execute. **CLI** ```bash npm theme={null} npm install @corsair-dev/cli ``` ```bash yarn theme={null} yarn add @corsair-dev/cli ``` ```bash pnpm theme={null} pnpm install @corsair-dev/cli ``` ```bash bun theme={null} bun add @corsair-dev/cli ``` Copy and paste this prompt into Hermes to give it everything it needs to work with Corsair: ``` Run `pnpm corsair` to access Corsair's integrations. ``` # LangChain Source: https://docs.corsair.dev/mcp-adapters/langchain Expose Corsair's 200+ integrations to LangChain.js and LangGraph agents as tools. `corsairTools` turns a Corsair instance into [LangChain.js](https://docs.langchain.com/oss/javascript) tools, one tool per API operation. Hand them to `createReactAgent({ tools })` or `model.bindTools(...)` and the model can call Slack, GitHub, Gmail, Linear, Stripe, and the rest of the [plugin catalog](/guides/plugins). The credentials never leave your database. Corsair runs OAuth server-side, stores the encrypted tokens under your own key, and the tool call reads them at execution time. The model sees tool names and results, never a token. ## Install ```bash npm theme={null} npm install @corsair-dev/langchain @langchain/core corsair ``` ```bash pnpm theme={null} pnpm add @corsair-dev/langchain @langchain/core corsair ``` ```bash yarn theme={null} yarn add @corsair-dev/langchain @langchain/core corsair ``` Then add one `@corsair-dev/*` package per service you connect, plus your LangChain model and agent runtime: ```bash theme={null} npm install @corsair-dev/slack # one per integration npm install @langchain/openai @langchain/langgraph ``` > [!NOTE] > > `@langchain/core` is a peer dependency. The adapter imports it lazily, so installing `@corsair-dev/langchain` alone never pulls LangChain into a project that does not use this entrypoint. ## Quickstart **1. Create the Corsair instance** Build it once and reuse it. `authType: 'managed'` lets Corsair hold the OAuth connection; the tokens stay encrypted in your database under your `kek`. ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { slack } from '@corsair-dev/slack'; import { database } from './db'; export const corsair = createCorsair({ plugins: [slack({ authType: 'managed' })], database, kek: process.env.CORSAIR_KEK, hub: { projectApiKey: process.env.CORSAIR_API_KEY }, }); ``` **2. Build the tools** `corsairTools` is async. It returns one `DynamicStructuredTool` per operation, ready for any LangChain agent. ```ts theme={null} import { corsairTools } from '@corsair-dev/langchain'; import { corsair } from './corsair'; const tools = await corsairTools({ corsair, plugin: 'slack' }); ``` **3. Give them to an agent** ```ts agent.ts theme={null} import { ChatOpenAI } from '@langchain/openai'; import { createReactAgent } from '@langchain/langgraph/prebuilt'; import { corsairTools } from '@corsair-dev/langchain'; import { corsair } from './corsair'; const tools = await corsairTools({ corsair, plugin: 'slack' }); const llm = new ChatOpenAI({ model: 'gpt-4.1-mini', configuration: { baseURL: 'https://llm.corsair.dev/v1', apiKey: process.env.LITELLM_API_KEY, }, }); const agent = createReactAgent({ llm, tools }); const result = await agent.invoke({ messages: [{ role: 'user', content: 'List the Slack channels.' }], }); console.log(result.messages.at(-1)?.content); ``` > [!TIP] > > Route model calls through the Corsair LLM gateway (`llm.corsair.dev`, OpenAI-compatible) to keep spend on budget-limited keys. Point any `@langchain/openai` model at it with the `configuration.baseURL` shown above. See [LLM gateway](/llm-gateway). ## Choosing which tools Scope the toolset so the model only sees what the task needs. Fewer tools means cleaner prompts and fewer wrong turns. ```ts theme={null} // A whole plugin, as a toolkit: await corsairTools({ corsair, plugin: 'slack' }); // Specific operations only: await corsairTools({ corsair, operations: ['slack.api.channels.list', 'slack.api.messages.post'], }); // Every operation of every registered plugin (omit both): await corsairTools({ corsair }); ``` ## Multi-tenancy On a multi-tenant instance, pin the tenant whose stored credentials the tools should use. Each tenant owns its own connections, so the same code serves every user: ```ts theme={null} const tools = await corsairTools({ corsair, plugin: 'slack', tenantId: user.orgId, }); ``` Single-tenant instances ignore `tenantId`. ## API ```ts theme={null} function corsairTools(options: CorsairToolsOptions): Promise ``` **corsair** `CorsairInstance` *required* The value from `createCorsair()` (or `corsair.withTenant(...)`). **plugin** `string` Include every operation of one plugin. Omit `plugin` and `operations` to include all registered plugins. **operations** `string[]` Include only these operation paths, e.g. `slack.api.channels.list`. **tenantId** `string` Use the stored credentials of this tenant. Ignored on single-tenant instances. ## Notes * **Tool names.** The operation path becomes the tool name with `.` replaced by `_` (`slack.api.channels.list` becomes `slack_api_channels_list`), so it satisfies the model's function-name constraint. * **Schemas.** Corsair is on Zod v4, which current `@langchain/core` accepts directly. No JSON Schema conversion step. * **Results.** String results pass through; anything else is JSON-encoded into the tool message the model reads. > [!WARNING] > > The tool runs whatever operation the model picks with the tenant's real credentials. Scope with `plugin` or `operations` so an agent can only reach the APIs the task actually needs. # LlamaIndex Source: https://docs.corsair.dev/mcp-adapters/llamaindex Expose Corsair's 200+ integrations to LlamaIndex.TS agents as tools. `corsairTools` turns a Corsair instance into [LlamaIndex.TS](https://developers.llamaindex.ai/typescript) tools, one tool per API operation. Hand them to `agent({ tools })` and the model can call Slack, GitHub, Gmail, Linear, Stripe, and the rest of the [plugin catalog](/guides/plugins). The credentials never leave your database. Corsair runs OAuth server-side, stores the encrypted tokens under your own key, and the tool call reads them at execution time. The model sees tool names and results, never a token. ## Install ```bash npm theme={null} npm install @corsair-dev/llamaindex @llamaindex/core corsair ``` ```bash pnpm theme={null} pnpm add @corsair-dev/llamaindex @llamaindex/core corsair ``` ```bash yarn theme={null} yarn add @corsair-dev/llamaindex @llamaindex/core corsair ``` Then add the agent runtime, an LLM binding, and one `@corsair-dev/*` package per service you connect: ```bash theme={null} npm install @llamaindex/workflow @llamaindex/openai npm install @corsair-dev/slack # one per integration ``` > [!NOTE] > > `@llamaindex/core` is a peer dependency. npm marks it deprecated as a standalone install, but it stays the correct peer for LlamaIndex.TS tooling: the `llamaindex` meta-package itself depends on `@llamaindex/core`, and it exposes the tool API this adapter builds on. The adapter imports it lazily, so installing `@corsair-dev/llamaindex` alone never pulls LlamaIndex into a project that does not use this entrypoint. ## Quickstart **1. Create the Corsair instance** Build it once and reuse it. `authType: 'managed'` lets Corsair hold the OAuth connection; the tokens stay encrypted in your database under your `kek`. ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { slack } from '@corsair-dev/slack'; import { database } from './db'; export const corsair = createCorsair({ plugins: [slack({ authType: 'managed' })], database, kek: process.env.CORSAIR_KEK, hub: { projectApiKey: process.env.CORSAIR_API_KEY }, }); ``` **2. Build the tools** `corsairTools` is async. It returns one LlamaIndex tool per operation, ready for any agent. ```ts theme={null} import { corsairTools } from '@corsair-dev/llamaindex'; import { corsair } from './corsair'; const tools = await corsairTools({ corsair, plugin: 'slack' }); ``` **3. Give them to an agent** ```ts agent.ts theme={null} import { agent } from '@llamaindex/workflow'; import { openai } from '@llamaindex/openai'; import { corsairTools } from '@corsair-dev/llamaindex'; import { corsair } from './corsair'; const tools = await corsairTools({ corsair, plugin: 'slack' }); const llm = openai({ model: 'gpt-4.1-mini', additionalChatOptions: { baseURL: 'https://llm.corsair.dev/v1', apiKey: process.env.LITELLM_API_KEY, }, }); const slackAgent = agent({ tools, llm }); const response = await slackAgent.run('List the Slack channels.'); console.log(response.data); ``` > [!TIP] > > Route model calls through the Corsair LLM gateway (`llm.corsair.dev`, OpenAI-compatible) to keep spend on budget-limited keys. Point the `openai(...)` binding at it with `additionalChatOptions.baseURL` as shown. See [LLM gateway](/llm-gateway). ## Choosing which tools Scope the toolset so the model only sees what the task needs. Fewer tools means cleaner prompts and fewer wrong turns. ```ts theme={null} // A whole plugin, as a toolkit: await corsairTools({ corsair, plugin: 'slack' }); // Specific operations only: await corsairTools({ corsair, operations: ['slack.api.channels.list', 'slack.api.messages.post'], }); // Every operation of every registered plugin (omit both): await corsairTools({ corsair }); ``` ## Multi-tenancy On a multi-tenant instance, pin the tenant whose stored credentials the tools should use. Each tenant owns its own connections, so the same code serves every user: ```ts theme={null} const tools = await corsairTools({ corsair, plugin: 'slack', tenantId: user.orgId, }); ``` Single-tenant instances ignore `tenantId`. ## API ```ts theme={null} function corsairTools(options: CorsairToolsOptions): Promise ``` **corsair** `CorsairInstance` *required* The value from `createCorsair()` (or `corsair.withTenant(...)`). **plugin** `string` Include every operation of one plugin. Omit `plugin` and `operations` to include all registered plugins. **operations** `string[]` Include only these operation paths, e.g. `slack.api.channels.list`. **tenantId** `string` Use the stored credentials of this tenant. Ignored on single-tenant instances. ## Notes * **Tool names.** The operation path becomes the tool name with `.` replaced by `_` (`slack.api.channels.list` becomes `slack_api_channels_list`), so it satisfies the model's function-name constraint. * **Schemas.** Corsair is on Zod v4, which `@llamaindex/core` accepts directly as a tool's `parameters`. The adapter parses model-generated args through the schema before the operation runs, so invalid input is rejected early. * **Results.** String results pass through; anything else is JSON-encoded into the tool output the model reads. > [!WARNING] > > The tool runs whatever operation the model picks with the tenant's real credentials. Scope with `plugin` or `operations` so an agent can only reach the APIs the task actually needs. # Mastra Source: https://docs.corsair.dev/mcp-adapters/mastra Connect Corsair to the Mastra agent framework. Use `MastraProvider` to connect Corsair to [Mastra](https://mastra.ai). ## Install ```bash theme={null} npm install @mastra/core ``` ## Usage ```ts agent.ts theme={null} import { Agent } from '@mastra/core/agent'; import { anthropic } from '@ai-sdk/anthropic'; import { MastraProvider } from '@corsair-dev/mcp'; import { corsair } from './corsair'; const provider = new MastraProvider(); const tools = await provider.build({ corsair }); const agent = new Agent({ name: 'corsair-agent', model: anthropic('claude-sonnet-4-6'), instructions: 'You have access to Corsair tools. Use list_operations to discover available APIs, get_schema to understand required arguments, and run_script to execute them.', tools: Object.fromEntries(tools.map((t) => [t.id, t])), }); const response = await agent.generate( 'Setup corsair, then list all Slack channels.', ); console.log(response.text); ``` `MastraProvider.build()` is async. It dynamically imports `@mastra/core` as an optional peer dependency. The returned tools are standard Mastra `createTool` instances ready to pass to any Mastra agent. # OpenAI Source: https://docs.corsair.dev/mcp-adapters/openai Connect Corsair to OpenAI via the Agents SDK or the Responses API over HTTP. There are two ways to give an OpenAI model Corsair's tools. Use the **Agents SDK** if you're building with `@openai/agents`; use the **Responses API** if you're calling the model directly over HTTP. **Agents SDK** Use `OpenAIAgentsProvider` to connect Corsair to the [OpenAI Agents SDK](https://github.com/openai/openai-agents-js). ## Install ```bash theme={null} npm install @openai/agents ``` ## Usage ```ts agent.ts theme={null} import { OpenAIAgentsProvider } from '@corsair-dev/mcp'; import { Agent, run, tool } from '@openai/agents'; import { corsair } from './corsair'; const provider = new OpenAIAgentsProvider(); const tools = provider.build({ corsair, tool }); const agent = new Agent({ name: 'corsair-agent', model: 'gpt-4.1', instructions: 'You have access to Corsair tools. Use list_operations to discover available APIs, get_schema to understand required arguments, and run_script to execute them. When referencing resources (like channels), always use their ID, not their name.', tools, }); const result = await run(agent, 'Setup corsair, then list all Slack channels.'); console.log(result.finalOutput); ``` `OpenAIAgentsProvider.build()` is async. It dynamically imports `@openai/agents` as an optional peer dependency. Pass the `tool` function from `@openai/agents` so the provider can wrap each Corsair tool in the correct format. **Responses API** Use `getOpenAIMcpConfig` to connect Corsair to the [OpenAI API](https://platform.openai.com/docs) over HTTP. You expose Corsair as an MCP server endpoint and pass the config to the OpenAI client. ## Install ```bash theme={null} npm install openai ``` ## Server Expose Corsair as an MCP HTTP endpoint using `createBaseMcpServer` and `createMcpRouter`. ```ts server.ts theme={null} import express from 'express'; import { createBaseMcpServer, createMcpRouter } from '@corsair-dev/mcp'; import { corsair } from './corsair'; const app = express(); app.use(express.json()); app.use('/mcp', createMcpRouter(() => createBaseMcpServer({ corsair }))); app.listen(3000, () => console.log('MCP server running on :3000')); ``` ## Client ```ts agent.ts theme={null} import OpenAI from 'openai'; import { getOpenAIMcpConfig } from '@corsair-dev/mcp'; const client = new OpenAI(); const response = await client.responses.create({ model: 'gpt-4.1', tools: [ { type: 'mcp', ...getOpenAIMcpConfig('http://localhost:3000/mcp'), }, ], input: 'Setup corsair, then list all Slack channels.', }); console.log(response.output_text); ``` `getOpenAIMcpConfig` returns the `serverLabel` and `serverUrl` fields expected by OpenAI's `mcp` tool type. # OpenCode Source: https://docs.corsair.dev/mcp-adapters/opencode Connect Corsair to OpenCode via MCP, or use the Corsair CLI directly. **MCP** Use `runStdioMcpServer` to expose Corsair as a local MCP server that OpenCode spawns on demand. ## Install ```bash theme={null} npm install @corsair-dev/mcp ``` ## Create the server script ```ts mcp-server.ts theme={null} import 'dotenv/config'; import { runStdioMcpServer } from '@corsair-dev/mcp'; import { corsair } from './corsair'; runStdioMcpServer({ corsair }).catch((err) => { console.error('[corsair-mcp] Fatal:', err); process.exit(1); }); ``` ## Configure OpenCode Add a local MCP server to your `opencode.json`. OpenCode reads it when you open the project. ```json opencode.json theme={null} { "$schema": "https://opencode.ai/config.json", "mcp": { "corsair": { "type": "local", "command": ["npx", "tsx", "mcp-server.ts"], "enabled": true } } } ``` If your credentials aren't loaded from a `.env` file, pass them under `environment`: ```json opencode.json theme={null} { "mcp": { "corsair": { "type": "local", "command": ["npx", "tsx", "mcp-server.ts"], "enabled": true, "environment": { "CORSAIR_KEK": "your-key-here" } } } } ``` Restart OpenCode after editing the config so it picks up the new server. ## Usage Once connected, OpenCode can call Corsair tools directly: ``` Setup corsair, then list all Slack channels. ``` OpenCode calls `list_operations` to discover available endpoints, `get_schema` to inspect parameters, then `run_script` to execute. **CLI** ```bash npm theme={null} npm install @corsair-dev/cli ``` ```bash yarn theme={null} yarn add @corsair-dev/cli ``` ```bash pnpm theme={null} pnpm install @corsair-dev/cli ``` ```bash bun theme={null} bun add @corsair-dev/cli ``` Copy and paste this prompt into OpenCode to give it everything it needs to work with Corsair: ``` Run `pnpm corsair` to access Corsair's integrations. ``` # Vercel AI SDK Source: https://docs.corsair.dev/mcp-adapters/vercel-ai Connect Corsair to the Vercel AI SDK over HTTP. Use `createVercelAiMcpClient` to connect Corsair to the [Vercel AI SDK](https://sdk.vercel.ai) via HTTP transport. Unlike the direct SDK adapters, Vercel AI connects over HTTP. You expose Corsair as an MCP server endpoint and the client connects to it. ## Install ```bash theme={null} npm install ai ``` ## Server Expose Corsair as an MCP HTTP endpoint using `createBaseMcpServer` and `createMcpRouter`. ```ts server.ts theme={null} import express from 'express'; import { createBaseMcpServer, createMcpRouter } from '@corsair-dev/mcp'; import { corsair } from './corsair'; const app = express(); app.use(express.json()); app.use('/mcp', createMcpRouter(() => createBaseMcpServer({ corsair }))); app.listen(3000, () => console.log('MCP server running on :3000')); ``` ## Client Connect from your Vercel AI application using `createVercelAiMcpClient`. ```ts agent.ts theme={null} import { generateText, stepCountIs } from 'ai'; import { anthropic } from '@ai-sdk/anthropic'; import { createVercelAiMcpClient } from '@corsair-dev/mcp'; const client = await createVercelAiMcpClient({ url: 'http://localhost:3000/mcp', }); const tools = await client.tools(); const { text } = await generateText({ model: anthropic('claude-sonnet-4-6'), tools, prompt: 'Setup corsair, then list all Slack channels.', stopWhen: stepCountIs(10), }); console.log(text); await client.close(); ``` `createVercelAiMcpClient` returns a client that speaks the MCP protocol over HTTP. Call `client.tools()` to retrieve the tool definitions, then pass them to any Vercel AI `generateText` or `streamText` call. ## AI SDK 6 In AI SDK 6, `maxSteps` was replaced by `stopWhen`. Without it, tool-calling agents may never complete or return output. Use `stopWhen: stepCountIs(10)` to cap the number of tool-call steps, or `stopWhen: isLoopFinished()` to run until the model finishes naturally: ```ts theme={null} import { generateText, isLoopFinished } from 'ai'; const { text } = await generateText({ model: anthropic('claude-sonnet-4-6'), tools, prompt: 'List my GitHub repos with the most open issues.', stopWhen: isLoopFinished(), }); ``` # API Source: https://docs.corsair.dev/plugins/ably/api API reference for Ably: every `ably.api.*` operation with input and output types. Every `ably.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Application ### getServiceTime `application.getServiceTime` Get the current Ably service time. **Risk:** `read` ```ts theme={null} await corsair.ably.api.application.getServiceTime({}); ``` **Input:** *empty object* **Output:** `number[]` *** ### getStats `application.getStats` Retrieve application usage statistics. **Risk:** `read` ```ts theme={null} await corsair.ably.api.application.getStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `start` | `number` | No | — | | `end` | `number` | No | — | | `direction` | `forwards \| backwards` | No | — | | `unit` | `minute \| hour \| day \| month` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### requestAccessToken `application.requestAccessToken` Request an Ably access token. **Risk:** `write` ```ts theme={null} await corsair.ably.api.application.requestAccessToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyName` | `string` | Yes | — | | `clientId` | `string` | No | — | | `ttl` | `number` | No | — | | `capability` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | Yes | — | | `expires` | `number` | No | — | | `issued` | `number` | No | — | | `capability` | `string` | No | — | | `clientId` | `string` | No | — | *** ## Channels ### batchPresence `channels.batchPresence` Retrieve presence information for multiple channels. **Risk:** `read` ```ts theme={null} await corsair.ably.api.channels.batchPresence({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channels` | `string[]` | Yes | — | **Output:** `any[]` *** ### batchPresenceHistory `channels.batchPresenceHistory` Retrieve presence history for multiple channels. **Risk:** `read` ```ts theme={null} await corsair.ably.api.channels.batchPresenceHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channels` | `string[]` | Yes | — | | `limit` | `number` | No | — | | `start` | `number` | No | — | | `end` | `number` | No | — | | `direction` | `forwards \| backwards` | No | — | **Output:** `any[]` *** ### getChannelDetails `channels.getChannelDetails` Retrieve details for an active channel. **Risk:** `read` ```ts theme={null} await corsair.ably.api.channels.getChannelDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channelId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `channelId` | `string` | No | — | | `status` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > isActive?: boolean, > occupancy?: { > metrics?: { > } > } > } > ``` *** ### getChannelHistory `channels.getChannelHistory` Retrieve message history for a channel. **Risk:** `read` ```ts theme={null} await corsair.ably.api.channels.getChannelHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channelId` | `string` | Yes | — | | `limit` | `number` | No | — | | `start` | `number` | No | — | | `end` | `number` | No | — | | `direction` | `forwards \| backwards` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > data?: any, > clientId?: string, > connectionId?: string, > timestamp?: number, > encoding?: string, > extras?: { > } > }[] > ``` *** ### getChannelPresence `channels.getChannelPresence` Retrieve current channel presence members. **Risk:** `read` ```ts theme={null} await corsair.ably.api.channels.getChannelPresence({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channelId` | `string` | Yes | — | | `clientId` | `string` | No | — | | `connectionId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > action?: string | number, > clientId?: string, > connectionId?: string, > data?: any, > timestamp?: number, > encoding?: string > }[] > ``` *** ### getMessageVersions `channels.getMessageVersions` Retrieve historical versions of a message. **Risk:** `read` ```ts theme={null} await corsair.ably.api.channels.getMessageVersions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channelId` | `string` | Yes | — | | `serial` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > data?: any, > clientId?: string, > connectionId?: string, > timestamp?: number, > encoding?: string, > extras?: { > } > }[] > ``` *** ### getPresenceHistory `channels.getPresenceHistory` Retrieve presence history for a channel. **Risk:** `read` ```ts theme={null} await corsair.ably.api.channels.getPresenceHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channelId` | `string` | Yes | — | | `limit` | `number` | No | — | | `start` | `number` | No | — | | `end` | `number` | No | — | | `direction` | `forwards \| backwards` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > action?: string | number, > clientId?: string, > connectionId?: string, > data?: any, > timestamp?: number, > encoding?: string > }[] > ``` *** ### listChannels `channels.listChannels` List active Ably channels. **Risk:** `read` ```ts theme={null} await corsair.ably.api.channels.listChannels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `prefix` | `string` | No | — | | `by` | `id \| value` | No | — | | `next` | `object` | No | — | > **next full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next` | `object` | No | — | > **items full type** > > ```ts theme={null} > ( > string | { > channelId?: string, > status?: { > isActive?: boolean, > occupancy?: { > metrics?: { > } > } > } > } > )[] > ``` > **next full type** > > ```ts theme={null} > { > } > ``` *** ### publishBatchMessages `channels.publishBatchMessages` Publish messages to multiple Ably channels. **Risk:** `write` ```ts theme={null} await corsair.ably.api.channels.publishBatchMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > channels: string[], > messages: { > id?: string, > name?: string, > data?: any, > clientId?: string, > connectionId?: string, > timestamp?: number, > encoding?: string, > extras?: { > } > }[] > }[] > ``` **Output:** `any[]` *** ### publishMessageToChannel `channels.publishMessageToChannel` Publish a message to an Ably channel. **Risk:** `write` ```ts theme={null} await corsair.ably.api.channels.publishMessageToChannel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channelId` | `string` | Yes | — | | `name` | `string` | No | — | | `data` | `any` | Yes | — | | `clientId` | `string` | No | — | | `extras` | `object` | No | — | > **extras full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Push ### createPushChannelSubscription `push.createPushChannelSubscription` Subscribe a device or client to a push channel. **Risk:** `write` ```ts theme={null} await corsair.ably.api.push.createPushChannelSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `deviceId` | `string` | No | — | | `clientId` | `string` | No | — | **Output:** `any` *** ### deleteChannelSubscription `push.deleteChannelSubscription` Delete matching push channel subscriptions. **Risk:** `destructive` ```ts theme={null} await corsair.ably.api.push.deleteChannelSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `deviceId` | `string` | No | — | | `clientId` | `string` | No | — | **Output:** `any` *** ### getPushDevice `push.getPushDevice` Retrieve a push device registration. **Risk:** `read` ```ts theme={null} await corsair.ably.api.push.getPushDevice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `clientId` | `string` | No | — | | `platform` | `string` | No | — | | `formFactor` | `string` | No | — | | `metadata` | `object` | No | — | | `updateToken` | `string` | No | — | | `push` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **push full type** > > ```ts theme={null} > { > state?: string, > recipient?: { > } > } > ``` *** ### listPushChannels `push.listPushChannels` List channels with push subscribers. **Risk:** `read` ```ts theme={null} await corsair.ably.api.push.listPushChannels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `prefix` | `string` | No | — | | `next` | `object` | No | — | > **next full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `string[]` | Yes | — | | `next` | `object` | No | — | > **next full type** > > ```ts theme={null} > { > } > ``` *** ### listPushChannelSubscriptions `push.listPushChannelSubscriptions` List push channel subscriptions. **Risk:** `read` ```ts theme={null} await corsair.ably.api.push.listPushChannelSubscriptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `channel` | `string` | No | — | | `deviceId` | `string` | No | — | | `clientId` | `string` | No | — | | `next` | `object` | No | — | > **next full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > channel: string, > deviceId?: string, > clientId?: string > }[] > ``` > **next full type** > > ```ts theme={null} > { > } > ``` *** ### listRegisteredPushDevices `push.listRegisteredPushDevices` List registered push notification devices. **Risk:** `read` ```ts theme={null} await corsair.ably.api.push.listRegisteredPushDevices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `deviceId` | `string` | No | — | | `clientId` | `string` | No | — | | `next` | `object` | No | — | > **next full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > clientId?: string, > platform?: string, > formFactor?: string, > metadata?: { > }, > updateToken?: string, > push?: { > state?: string, > recipient?: { > } > } > }[] > ``` > **next full type** > > ```ts theme={null} > { > } > ``` *** ### patchPushDeviceRegistration `push.patchPushDeviceRegistration` Partially update a push device registration. **Risk:** `write` ```ts theme={null} await corsair.ably.api.push.patchPushDeviceRegistration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceId` | `string` | Yes | — | | `clientId` | `string` | No | — | | `metadata` | `object` | No | — | | `push` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **push full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `clientId` | `string` | No | — | | `platform` | `string` | No | — | | `formFactor` | `string` | No | — | | `metadata` | `object` | No | — | | `updateToken` | `string` | No | — | | `push` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **push full type** > > ```ts theme={null} > { > state?: string, > recipient?: { > } > } > ``` *** ### publishPushNotification `push.publishPushNotification` Publish a push notification. **Risk:** `write` ```ts theme={null} await corsair.ably.api.push.publishPushNotification({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recipient` | `object` | Yes | — | | `data` | `object` | No | — | | `notification` | `object` | No | — | > **recipient full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` > **notification full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### publishPushNotificationsBatch `push.publishPushNotificationsBatch` Publish a batch of push notifications. **Risk:** `write` ```ts theme={null} await corsair.ably.api.push.publishPushNotificationsBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `notifications` | `object[]` | Yes | — | > **notifications full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `any[]` *** ### registerPushDevice `push.registerPushDevice` Register a device for push notifications. **Risk:** `write` ```ts theme={null} await corsair.ably.api.push.registerPushDevice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `clientId` | `string` | No | — | | `platform` | `ios \| android \| browser` | Yes | — | | `formFactor` | `phone \| tablet \| desktop \| tv \| watch \| car \| embedded` | Yes | — | | `metadata` | `object` | No | — | | `updateToken` | `string` | No | — | | `push` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **push full type** > > ```ts theme={null} > { > recipient: { > transportType: fcm | apns | web > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `clientId` | `string` | No | — | | `platform` | `string` | No | — | | `formFactor` | `string` | No | — | | `metadata` | `object` | No | — | | `updateToken` | `string` | No | — | | `push` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **push full type** > > ```ts theme={null} > { > state?: string, > recipient?: { > } > } > ``` *** ### unregisterAllPushDevices `push.unregisterAllPushDevices` Delete matching push device registrations. **Risk:** `destructive` ```ts theme={null} await corsair.ably.api.push.unregisterAllPushDevices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceId` | `string` | No | — | | `clientId` | `string` | No | — | **Output:** `any` *** ### unregisterPushDevice `push.unregisterPushDevice` Delete a push device registration. **Risk:** `destructive` ```ts theme={null} await corsair.ably.api.push.unregisterPushDevice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceId` | `string` | Yes | — | **Output:** `any` *** ### updatePushDevice `push.updatePushDevice` Create or replace a push device registration. **Risk:** `write` ```ts theme={null} await corsair.ably.api.push.updatePushDevice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `clientId` | `string` | No | — | | `platform` | `ios \| android \| browser` | Yes | — | | `formFactor` | `phone \| tablet \| desktop \| tv \| watch \| car \| embedded` | Yes | — | | `metadata` | `object` | No | — | | `updateToken` | `string` | No | — | | `push` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **push full type** > > ```ts theme={null} > { > recipient: { > transportType: fcm | apns | web > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `clientId` | `string` | No | — | | `platform` | `string` | No | — | | `formFactor` | `string` | No | — | | `metadata` | `object` | No | — | | `updateToken` | `string` | No | — | | `push` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **push full type** > > ```ts theme={null} > { > state?: string, > recipient?: { > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/ably/database Ably local sync: searchable entities, `.search()` filters, and operators. The Ably plugin syncs data locally. Use `corsair.ably.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/ably/overview Realtime messaging platform for pub/sub, chat, and live data streaming at scale. Use **Ably** through Corsair: one client, typed API calls. **What you get:** * 26 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ably ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ably ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ably ``` ```bash bun theme={null} bun add corsair @corsair-dev/ably ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ably } from '@corsair-dev/ably'; export const corsair = createCorsair({ plugins: [ ably(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ably() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ably', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`application.getServiceTime`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ably.api.application.getServiceTime({}); ``` **`application.requestAccessToken`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ably.api.application.requestAccessToken({}); ``` See the full list on the [API](/plugins/ably/api) page. ## What's next > **[API reference](/plugins/ably/api)** > > Every `ably.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/abstract/api API reference for Abstract: every `abstract.api.*` operation with input and output types. Every `abstract.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Email ### reputation `email.reputation` Assess email deliverability and quality: format, disposable/free/role detection, MX and SMTP validation **Risk:** `read` ```ts theme={null} await corsair.abstract.api.email.reputation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | The email address to check the reputation of | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email_address` | `string` | Yes | — | | `suggested_correction` | `string` | No | — | | `email_deliverability` | `object` | Yes | — | | `email_quality` | `object` | Yes | — | | `email_sender` | `object` | Yes | — | | `email_domain` | `object` | Yes | — | | `email_risk` | `object` | Yes | — | | `email_breaches` | `object` | No | — | > **email\_deliverability full type** > > ```ts theme={null} > { > status: string, > status_detail: string, > is_format_valid: boolean, > is_smtp_valid: boolean, > is_mx_valid: boolean, > mx_records?: string[] | null > } > ``` > **email\_quality full type** > > ```ts theme={null} > { > score: number, > is_free_email: boolean, > is_username_suspicious: boolean, > is_disposable: boolean, > is_catchall: boolean, > is_subaddress: boolean, > is_role?: boolean, > is_dmarc_enforced?: boolean, > is_spf_strict?: boolean, > minimum_age?: number | null > } > ``` > **email\_sender full type** > > ```ts theme={null} > { > first_name?: string | null, > last_name?: string | null, > email_provider_name?: string | null, > organization_name?: string | null, > organization_type?: string | null > } > ``` > **email\_domain full type** > > ```ts theme={null} > { > domain?: string | null, > domain_age?: number | null, > is_live_site?: boolean | null, > registrar?: string | null, > registrar_url?: string | null, > date_registered?: string | null, > date_last_renewed?: string | null, > date_expires?: string | null, > is_risky_tld?: boolean | null > } > ``` > **email\_risk full type** > > ```ts theme={null} > { > address_risk_status?: string | null, > domain_risk_status?: string | null > } > ``` > **email\_breaches full type** > > ```ts theme={null} > { > total_breaches?: number | null, > date_first_breached?: string | null, > date_last_breached?: string | null, > breached_domains?: { > domain: string, > breach_date?: string | null > }[] > } > ``` *** ### validate `email.validate` Validate whether an email address is real, correctly formatted, and deliverable **Risk:** `read` ```ts theme={null} await corsair.abstract.api.email.validate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | The email address to validate | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `autocorrect` | `string` | Yes | — | | `deliverability` | `string` | Yes | — | | `quality_score` | `number` | Yes | — | | `is_valid_format` | `boolean` | Yes | — | | `is_free_email` | `boolean` | Yes | — | | `is_disposable_email` | `boolean` | Yes | — | | `is_role_email` | `boolean` | Yes | — | | `is_catchall_email` | `boolean` | Yes | — | | `is_mx_found` | `boolean` | Yes | — | | `is_smtp_valid` | `boolean` | Yes | — | *** ## Iban ### validate `iban.validate` Validate the format and country code of an IBAN number **Risk:** `read` ```ts theme={null} await corsair.abstract.api.iban.validate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iban` | `string` | Yes | The IBAN to validate | **Output** | Name | Type | Required | Description | | - | - | - | - | | `iban` | `string` | Yes | — | | `is_valid` | `boolean` | Yes | — | *** ## Vat ### getCategories `vat.getCategories` Get VAT rate categories (standard, reduced, special) for a country **Risk:** `read` ```ts theme={null} await corsair.abstract.api.vat.getCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `countryCode` | `string` | Yes | ISO 3166-1 alpha-2 country code, e.g. "DE" | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > country_code: string, > rate: string, > category: string, > description: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/abstract/database Abstract local sync: searchable entities, `.search()` filters, and operators. The Abstract plugin syncs data locally. Use `corsair.abstract.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Email Reputations Path: `abstract.db.emailReputations.search` ```ts theme={null} const rows = await corsair.abstract.db.emailReputations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `emailAddress` | `string` | equals, contains, startsWith, endsWith, in | | `deliverabilityStatus` | `string` | equals, contains, startsWith, endsWith, in | | `qualityScore` | `number` | equals, gt, gte, lt, lte, in | | `isFreeEmail` | `boolean` | equals | | `isDisposable` | `boolean` | equals | | `isCatchall` | `boolean` | equals | | `addressRiskStatus` | `string` | equals, contains, startsWith, endsWith, in | | `domainRiskStatus` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Email Validations Path: `abstract.db.emailValidations.search` ```ts theme={null} const rows = await corsair.abstract.db.emailValidations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `autocorrect` | `string` | equals, contains, startsWith, endsWith, in | | `deliverability` | `string` | equals, contains, startsWith, endsWith, in | | `qualityScore` | `number` | equals, gt, gte, lt, lte, in | | `isValidFormat` | `boolean` | equals | | `isFreeEmail` | `boolean` | equals | | `isDisposableEmail` | `boolean` | equals | | `isRoleEmail` | `boolean` | equals | | `isCatchallEmail` | `boolean` | equals | | `isMxFound` | `boolean` | equals | | `isSmtpValid` | `boolean` | equals | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Iban Validations Path: `abstract.db.ibanValidations.search` ```ts theme={null} const rows = await corsair.abstract.db.ibanValidations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `iban` | `string` | equals, contains, startsWith, endsWith, in | | `isValid` | `boolean` | equals | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Vat Categories Path: `abstract.db.vatCategories.search` ```ts theme={null} const rows = await corsair.abstract.db.vatCategories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `rate` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/abstract/overview Validation APIs for emails, phones, VAT numbers, and other business data checks. Use **Abstract** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 4 synced entities (`emailReputations`, `emailValidations`, `ibanValidations`, `vatCategories`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/abstract ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/abstract ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/abstract ``` ```bash bun theme={null} bun add corsair @corsair-dev/abstract ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { abstract } from '@corsair-dev/abstract'; export const corsair = createCorsair({ plugins: [ abstract(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} abstract() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'abstract', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`email.reputation`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.abstract.api.email.reputation({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/abstract/api) reference.* See the full list on the [API](/plugins/abstract/api) page. ## Query synced data Synced entities support `tenant.abstract.db..search()` and `.list()`: `emailReputations`, `emailValidations`, `ibanValidations`, `vatCategories`. See [Database](/plugins/abstract/database) for filters and operators. ## What's next > **[API reference](/plugins/abstract/api)** > > Every `abstract.api.*` operation with input and output types. > **[Database](/plugins/abstract/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/abuseipdb/api API reference for AbuseIPDB: every `abuseipdb.api.*` operation with input and output types. Every `abuseipdb.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Address ### clear `address.clear` Remove all reports for an IP address from your account and return the number deleted **Risk:** `destructive` ```ts theme={null} await corsair.abuseipdb.api.address.clear({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ipAddress` | `string \| string` | Yes | IPv4 or IPv6 address to clear reports for | **Output** | Name | Type | Required | Description | | - | - | - | - | | `numReportsDeleted` | `number` | Yes | — | *** ## Blacklist ### get `blacklist.get` Download the blacklist of most-reported IPs, optionally filtered by confidence minimum, country, and IP version **Risk:** `read` ```ts theme={null} await corsair.abuseipdb.api.blacklist.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `confidenceMinimum` | `number` | No | Minimum abuse confidence score (25–100) | | `limit` | `number` | No | Maximum number of entries to return | | `onlyCountries` | `string[]` | No | Only include IPs from these ISO 3166 alpha-2 country codes | | `exceptCountries` | `string[]` | No | Exclude IPs from these ISO 3166 alpha-2 country codes | | `ipVersion` | `4 \| 6` | No | Restrict to a single IP version (4 or 6) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `generatedAt` | `string` | Yes | — | | `entries` | `object[]` | Yes | — | > **entries full type** > > ```ts theme={null} > { > ipAddress: string, > abuseConfidenceScore: number, > lastReportedAt?: string | null, > countryCode?: string | null > }[] > ``` *** ## Block ### check `block.check` Check a CIDR network block and list the reported addresses within it **Risk:** `read` ```ts theme={null} await corsair.abuseipdb.api.block.check({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `string \| string` | Yes | CIDR notation network block, e.g. "127.0.0.1/24" | | `maxAgeInDays` | `number` | No | Only consider reports from the last N days (1–365) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `networkAddress` | `string` | Yes | — | | `netmask` | `string` | Yes | — | | `minAddress` | `string` | Yes | — | | `maxAddress` | `string` | Yes | — | | `numPossibleHosts` | `number` | Yes | — | | `addressSpaceDesc` | `string` | No | — | | `reportedAddress` | `object[]` | Yes | — | > **reportedAddress full type** > > ```ts theme={null} > { > ipAddress: string, > numReports: number, > mostRecentReport?: string | null, > abuseConfidenceScore: number, > countryCode?: string | null > }[] > ``` *** ## Check ### ip `check.ip` Look up an IP address and get its abuse confidence score, country, ISP, usage type, and optionally recent reports **Risk:** `read` ```ts theme={null} await corsair.abuseipdb.api.check.ip({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ipAddress` | `string \| string` | Yes | IPv4 or IPv6 address to check | | `maxAgeInDays` | `number` | No | Only consider reports from the last N days (1–365) | | `verbose` | `boolean` | No | Include the full reports array | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ipAddress` | `string` | Yes | — | | `isPublic` | `boolean` | Yes | — | | `ipVersion` | `number` | Yes | — | | `isWhitelisted` | `boolean` | No | — | | `abuseConfidenceScore` | `number` | Yes | — | | `countryCode` | `string` | No | — | | `countryName` | `string` | No | — | | `usageType` | `string` | No | — | | `isp` | `string` | No | — | | `domain` | `string` | No | — | | `hostnames` | `string[]` | Yes | — | | `isTor` | `boolean` | Yes | — | | `totalReports` | `number` | Yes | — | | `numDistinctUsers` | `number` | Yes | — | | `lastReportedAt` | `string` | No | — | | `reports` | `object[]` | No | — | > **reports full type** > > ```ts theme={null} > { > reportedAt: string, > comment?: string | null, > categories: number[], > reporterId: number, > reporterCountryCode?: string | null, > reporterCountryName?: string | null > }[] > ``` *** ## Report ### ip `report.ip` Submit an abuse report for an IP address with one or more abuse category IDs **Risk:** `write` ```ts theme={null} await corsair.abuseipdb.api.report.ip({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string \| string` | Yes | IPv4 or IPv6 address being reported | | `categories` | `number[]` | Yes | Abuse category IDs (integers 1–30) | | `comment` | `string` | No | Descriptive text of the attack; avoid any PII | | `timestamp` | `string` | No | ISO 8601 datetime of the attack, defaults to now | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ipAddress` | `string` | Yes | — | | `abuseConfidenceScore` | `number` | Yes | — | *** ## Reports ### list `reports.list` Get a paginated list of abuse reports filed against a single IP address **Risk:** `read` ```ts theme={null} await corsair.abuseipdb.api.reports.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ipAddress` | `string \| string` | Yes | IPv4 or IPv6 address to fetch reports for | | `maxAgeInDays` | `number` | No | Only consider reports from the last N days (1–365) | | `page` | `number` | No | Page number (starts at 1) | | `perPage` | `number` | No | Reports per page (1–100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | Yes | — | | `page` | `number` | Yes | — | | `count` | `number` | Yes | — | | `perPage` | `number` | Yes | — | | `lastPage` | `number` | Yes | — | | `nextPageUrl` | `string` | No | — | | `previousPageUrl` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > reportedAt: string, > comment?: string | null, > categories: number[], > reporterId: number, > reporterCountryCode?: string | null, > reporterCountryName?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/abuseipdb/database AbuseIPDB local sync: searchable entities, `.search()` filters, and operators. The AbuseIPDB plugin syncs data locally. Use `corsair.abuseipdb.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Ip Checks Path: `abuseipdb.db.ipChecks.search` ```ts theme={null} const rows = await corsair.abuseipdb.db.ipChecks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ipAddress` | `string` | equals, contains, startsWith, endsWith, in | | `abuseConfidenceScore` | `number` | equals, gt, gte, lt, lte, in | | `isPublic` | `boolean` | equals | | `ipVersion` | `number` | equals, gt, gte, lt, lte, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `countryName` | `string` | equals, contains, startsWith, endsWith, in | | `usageType` | `string` | equals, contains, startsWith, endsWith, in | | `isp` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `isTor` | `boolean` | equals | | `totalReports` | `number` | equals, gt, gte, lt, lte, in | | `numDistinctUsers` | `number` | equals, gt, gte, lt, lte, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Reports Path: `abuseipdb.db.reports.search` ```ts theme={null} const rows = await corsair.abuseipdb.db.reports.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ipAddress` | `string` | equals, contains, startsWith, endsWith, in | | `abuseConfidenceScore` | `number` | equals, gt, gte, lt, lte, in | | `reportedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/abuseipdb/overview IP address reputation database for detecting and reporting malicious network activity. Use **AbuseIPDB** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 6 typed API operations * 2 synced entities (`ipChecks`, `reports`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/abuseipdb ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/abuseipdb ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/abuseipdb ``` ```bash bun theme={null} bun add corsair @corsair-dev/abuseipdb ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { abuseipdb } from '@corsair-dev/abuseipdb'; export const corsair = createCorsair({ plugins: [ abuseipdb(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} abuseipdb() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'abuseipdb', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`blacklist.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.abuseipdb.api.blacklist.get({}); ``` **`address.clear`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.abuseipdb.api.address.clear({}); ``` See the full list on the [API](/plugins/abuseipdb/api) page. ## Query synced data Synced entities support `tenant.abuseipdb.db..search()` and `.list()`: `ipChecks`, `reports`. See [Database](/plugins/abuseipdb/database) for filters and operators. ## What's next > **[API reference](/plugins/abuseipdb/api)** > > Every `abuseipdb.api.*` operation with input and output types. > **[Database](/plugins/abuseipdb/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/abyssale/api API reference for Abyssale: every `abyssale.api.*` operation with input and output types. Every `abyssale.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Auth ### test `auth.test` Test Abyssale API key authentication validity **Risk:** `read` ```ts theme={null} await corsair.abyssale.api.auth.test({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `company` | `string` | Yes | — | | `version` | `string` | No | — | *** ## Designs ### list `designs.list` Get a list of designs in Abyssale **Risk:** `read` ```ts theme={null} await corsair.abyssale.api.designs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `type` | `static \| animated \| printer \| printer_multipage` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > template_id?: string, > name: string, > type: string, > project_id?: string, > project_name?: string, > category_id?: string, > category_name?: string, > version?: string, > created_at?: number, > updated_at?: number, > preview_url?: string > }[] > ``` *** ## Fonts ### list `fonts.list` Get a list of available fonts in Abyssale **Risk:** `read` ```ts theme={null} await corsair.abyssale.api.fonts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `google \| custom` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > type: google | custom, > available_weights: ( > number | string > )[] > }[] > ``` *** ## Generation ### batch `generation.batch` Start an asynchronous multi-format generation from an Abyssale design **Risk:** `write` ```ts theme={null} await corsair.abyssale.api.generation.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | | `elements` | `object` | No | — | | `template_format_names` | `string[]` | No | — | | `callback_url` | `string` | No | — | | `image_file_type` | `png \| jpeg \| webp \| avif \| gif \| pdf \| html5 \| mp4 \| auto` | No | — | | `file_compression_level` | `number` | No | — | | `html5` | `object` | No | — | | `gif` | `object` | No | — | | `video` | `object` | No | — | | `print` | `object` | No | — | | `original_visual_id` | `string` | No | — | | `pages` | `object` | No | — | > **elements full type** > > ```ts theme={null} > { > } > ``` > **html5 full type** > > ```ts theme={null} > { > page_title?: string, > click_tag?: string, > ad_network?: string, > include_backup_image?: boolean, > repeat?: boolean > } > ``` > **gif full type** > > ```ts theme={null} > { > max_fps?: number, > repeat?: boolean > } > ``` > **video full type** > > ```ts theme={null} > { > fps?: number > } > ``` > **print full type** > > ```ts theme={null} > { > color_profile?: string, > display_crop_marks?: boolean > } > ``` > **pages full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `generation_request_id` | `string` | Yes | — | *** ### image `generation.image` Synchronously generate a single image from an Abyssale design **Risk:** `write` ```ts theme={null} await corsair.abyssale.api.generation.image({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | | `elements` | `object` | No | — | | `template_format_name` | `string` | No | — | | `image_file_type` | `png \| jpeg \| webp \| avif \| pdf \| auto` | No | — | | `file_compression_level` | `number` | No | — | | `original_visual_id` | `string` | No | — | > **elements full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `version` | `number` | No | — | | `sharing_id` | `string` | No | — | | `file` | `object` | No | — | | `format` | `object` | No | — | | `template` | `object` | No | — | | `project` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > type?: string, > url?: string, > cdn_url?: string, > fallback_image_url?: string, > filename?: string > } > ``` > **format full type** > > ```ts theme={null} > { > id?: string, > width?: number, > height?: number, > unit?: string > } > ``` > **template full type** > > ```ts theme={null} > { > id?: string, > name?: string, > created_at?: number, > updated_at?: number > } > ``` > **project full type** > > ```ts theme={null} > { > id?: string, > name?: string > } > ``` *** ### status `generation.status` Poll the status of an asynchronous generation request **Risk:** `read` ```ts theme={null} await corsair.abyssale.api.generation.status({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `generationRequestId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `is_finalized` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `banners` | `object[]` | Yes | — | | `errors` | `object[]` | Yes | — | > **banners full type** > > ```ts theme={null} > { > id: string, > version?: number, > sharing_id?: string, > file?: { > type?: string, > url?: string, > cdn_url?: string, > fallback_image_url?: string, > filename?: string > }, > format?: { > id?: string, > width?: number, > height?: number, > unit?: string > }, > template?: { > id?: string, > name?: string, > created_at?: number, > updated_at?: number > }, > project?: { > id?: string, > name?: string > } > }[] > ``` > **errors full type** > > ```ts theme={null} > { > template_format_name: string, > reason: string > }[] > ``` *** ## Projects ### create `projects.create` Create a new project in Abyssale **Risk:** `write` ```ts theme={null} await corsair.abyssale.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `created_at_ts` | `number` | Yes | — | | `version` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/abyssale/database Abyssale local sync: searchable entities, `.search()` filters, and operators. The Abyssale plugin syncs data locally. Use `corsair.abyssale.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Banners Path: `abyssale.db.banners.search` ```ts theme={null} const rows = await corsair.abyssale.db.banners.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `number` | equals, gt, gte, lt, lte, in | | `sharing_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Designs Path: `abyssale.db.designs.search` ```ts theme={null} const rows = await corsair.abyssale.db.designs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `template_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `project_name` | `string` | equals, contains, startsWith, endsWith, in | | `category_id` | `string` | equals, contains, startsWith, endsWith, in | | `category_name` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `updated_at` | `number` | equals, gt, gte, lt, lte, in | | `preview_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Fonts Path: `abyssale.db.fonts.search` ```ts theme={null} const rows = await corsair.abyssale.db.fonts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `abyssale.db.projects.search` ```ts theme={null} const rows = await corsair.abyssale.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at_ts` | `number` | equals, gt, gte, lt, lte, in | | `category_name` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/abyssale/overview Dynamic image and video generation API for automated marketing and social creatives. Use **Abyssale** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 7 typed API operations * 4 synced entities (`banners`, `designs`, `fonts`, `projects`) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/abyssale ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/abyssale ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/abyssale ``` ```bash bun theme={null} bun add corsair @corsair-dev/abyssale ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { abyssale } from '@corsair-dev/abyssale'; export const corsair = createCorsair({ plugins: [ abyssale(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} abyssale() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'abyssale', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`auth.test`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.abyssale.api.auth.test({}); ``` **`generation.batch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.abyssale.api.generation.batch({}); ``` See the full list on the [API](/plugins/abyssale/api) page. ## Query synced data Synced entities support `tenant.abyssale.db..search()` and `.list()`: `banners`, `designs`, `fonts`, `projects`. See [Database](/plugins/abyssale/database) for filters and operators. ## Webhooks This plugin registers **4** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/abyssale/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/abyssale/api)** > > Every `abyssale.api.*` operation with input and output types. > **[Database](/plugins/abyssale/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/abyssale/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/abyssale/webhooks Abyssale incoming webhooks: event paths, payloads, and response data. The Abyssale plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/abyssale/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `banners` * `batchCompleted` (`banners.batchCompleted`) * `created` (`banners.created`) * `designs` * `statusChanged` (`designs.statusChanged`) * `exports` * `completed` (`exports.completed`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Banners ### Batch Completed `banners.batchCompleted` An asynchronous batch generation request completed (NEW\_BANNER\_BATCH event) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `NEW_BANNER_BATCH` | Yes | — | | `generation_request_id` | `string` | Yes | — | | `banners` | `object[]` | Yes | — | | `errors` | `object[]` | Yes | — | > **banners full type** > > ```ts theme={null} > { > id: string, > version?: number, > sharing_id?: string, > file?: { > type?: string, > url?: string, > cdn_url?: string, > fallback_image_url?: string, > filename?: string > }, > format?: { > id?: string, > width?: number, > height?: number, > unit?: string > }, > template?: { > id?: string, > name?: string, > created_at?: number, > updated_at?: number > }, > project?: { > id?: string, > name?: string > } > }[] > ``` > **errors full type** > > ```ts theme={null} > { > template_format_name: string, > reason: string > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > event_type: NEW_BANNER_BATCH, > generation_request_id: string, > banners: { > id: string, > version?: number, > sharing_id?: string, > file?: { > type?: string, > url?: string, > cdn_url?: string, > fallback_image_url?: string, > filename?: string > }, > format?: { > id?: string, > width?: number, > height?: number, > unit?: string > }, > template?: { > id?: string, > name?: string, > created_at?: number, > updated_at?: number > }, > project?: { > id?: string, > name?: string > } > }[], > errors: { > template_format_name: string, > reason: string > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} abyssale({ webhookHooks: { banners: { batchCompleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `banners.created` A visual was generated or saved in Abyssale (NEW\_BANNER event) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `NEW_BANNER` | Yes | — | | `id` | `string` | Yes | — | | `version` | `number` | No | — | | `sharing_id` | `string` | No | — | | `file` | `object` | No | — | | `format` | `object` | No | — | | `template` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > type?: string, > url?: string, > cdn_url?: string, > fallback_image_url?: string, > filename?: string > } > ``` > **format full type** > > ```ts theme={null} > { > id?: string, > width?: number, > height?: number, > unit?: string > } > ``` > **template full type** > > ```ts theme={null} > { > id?: string, > name?: string, > created_at?: number, > updated_at?: number > } > ``` > **Response data full type** > > ```ts theme={null} > { > event_type: NEW_BANNER, > id: string, > version?: number, > sharing_id?: string, > file?: { > type?: string, > url?: string, > cdn_url?: string, > fallback_image_url?: string, > filename?: string > }, > format?: { > id?: string, > width?: number, > height?: number, > unit?: string > }, > template?: { > id?: string, > name?: string, > created_at?: number, > updated_at?: number > } > } > ``` **`webhookHooks` example** ```ts theme={null} abyssale({ webhookHooks: { banners: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Designs ### Status Changed `designs.statusChanged` A design's workflow status was updated (TEMPLATE\_STATUS event) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `TEMPLATE_STATUS` | Yes | — | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `status_updated_at` | `number` | No | — | > **Response data full type** > > ```ts theme={null} > { > event_type: TEMPLATE_STATUS, > id: string, > name?: string, > status: string, > created_at?: number, > updated_at?: number, > status_updated_at?: number > } > ``` **`webhookHooks` example** ```ts theme={null} abyssale({ webhookHooks: { designs: { statusChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Exports ### Completed `exports.completed` A workspace export archive finished processing (NEW\_EXPORT event) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `NEW_EXPORT` | Yes | — | | `export_id` | `string` | Yes | — | | `archive_url` | `string` | Yes | — | | `requested_at` | `number` | No | — | | `generated_at` | `number` | No | — | > **Response data full type** > > ```ts theme={null} > { > event_type: NEW_EXPORT, > export_id: string, > archive_url: string, > requested_at?: number, > generated_at?: number > } > ``` **`webhookHooks` example** ```ts theme={null} abyssale({ webhookHooks: { exports: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/accrediblecertificates/api API reference for Accredible: every `accrediblecertificates.api.*` operation with input and output types. Every `accrediblecertificates.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Credentials ### get `credentials.get` Get an credential resource by ID **Risk:** `read` ```ts theme={null} await corsair.accrediblecertificates.api.credentials.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `credential` | `object` | Yes | — | > **credential full type** > > ```ts theme={null} > { > id: string | number, > name?: string | null, > description?: string | null, > approve?: boolean | null, > grade?: any | null, > complete?: boolean | null, > issued_on?: string | null, > expired_on?: string | null, > course_link?: string | null, > custom_attributes?: { > } | null, > group_name?: string | null, > group_id?: string | number | null, > url?: string | null, > encoded_id?: string | null, > private?: boolean | null, > seo_image?: string | null, > certificate?: { > image?: { > preview?: string | null > } | null > } | null, > badge?: { > image?: { > preview?: string | null > } | null > } | null, > evidence_items?: { > id?: string | number | null, > description?: string | null, > preview_image_url?: string | null, > link_url?: string | null, > type?: string | null, > string_object?: any | null, > supplemental?: boolean | null, > position?: number | null > }[] | null, > references?: { > id?: string | number | null, > description?: string | null, > relationship?: string | null, > supplemental?: boolean | null, > approve?: boolean | null, > referee?: { > name?: string | null, > email?: string | null, > avatar?: string | null > } | null > }[] | null, > recipient?: { > id?: string | number | null, > name?: string | null, > email?: string | null, > phone_number?: string | null, > meta_data?: any | null > } | null, > issuer?: { > id?: string | number | null, > name?: string | null, > description?: string | null, > url?: string | null > } | null, > meta_data?: any | null, > skills?: { > id?: string | number | null, > name?: string | null, > identifier?: string | null, > description?: string | null, > url?: string | null, > breadcrumbs?: any | null > }[] | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/accrediblecertificates/database Accredible local sync: searchable entities, `.search()` filters, and operators. The Accredible plugin syncs data locally. Use `corsair.accrediblecertificates.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Credentials Path: `accrediblecertificates.db.credentials.search` ```ts theme={null} const rows = await corsair.accrediblecertificates.db.credentials.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `group_name` | `string` | equals, contains, startsWith, endsWith, in | | `issued_on` | `string` | equals, contains, startsWith, endsWith, in | | `expired_on` | `string` | equals, contains, startsWith, endsWith, in | | `complete` | `boolean` | equals | | `approve` | `boolean` | equals | | `private` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `encoded_id` | `string` | equals, contains, startsWith, endsWith, in | | `course_link` | `string` | equals, contains, startsWith, endsWith, in | | `seo_image` | `string` | equals, contains, startsWith, endsWith, in | | `recipient_name` | `string` | equals, contains, startsWith, endsWith, in | | `recipient_email` | `string` | equals, contains, startsWith, endsWith, in | | `issuer_name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/accrediblecertificates/overview Digital certificate and badge platform for courses, events, and professional credentials. Use **Accredible** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 1 typed API operations * 1 synced entity (`credentials`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/accrediblecertificates ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/accrediblecertificates ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/accrediblecertificates ``` ```bash bun theme={null} bun add corsair @corsair-dev/accrediblecertificates ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { accrediblecertificates } from '@corsair-dev/accrediblecertificates'; export const corsair = createCorsair({ plugins: [ accrediblecertificates(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} accrediblecertificates() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'accrediblecertificates', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`credentials.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.accrediblecertificates.api.credentials.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/accrediblecertificates/api) reference.* See the full list on the [API](/plugins/accrediblecertificates/api) page. ## Query synced data Synced entities support `tenant.accrediblecertificates.db..search()` and `.list()`: `credentials`. See [Database](/plugins/accrediblecertificates/database) for filters and operators. ## What's next > **[API reference](/plugins/accrediblecertificates/api)** > > Every `accrediblecertificates.api.*` operation with input and output types. > **[Database](/plugins/accrediblecertificates/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/activecampaign/api API reference for ActiveCampaign: every `activecampaign.api.*` operation with input and output types. Every `activecampaign.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account Contacts ### create `accountContacts.create` Link a contact to an account with an optional job title **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accountContacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact` | `string` | Yes | — | | `account` | `string` | Yes | — | | `jobTitle` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountContact` | `object` | Yes | — | > **accountContact full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > account?: string | null, > jobTitle?: string | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ### delete `accountContacts.delete` Remove the link between an account and a contact **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.accountContacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `accountContacts.get` Retrieve an account-contact association by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.accountContacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountContact` | `object` | Yes | — | > **accountContact full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > account?: string | null, > jobTitle?: string | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ### list `accountContacts.list` List associations between accounts and contacts **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.accountContacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `contact` | `string` | No | — | | `account` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountContacts` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **accountContacts full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > account?: string | null, > jobTitle?: string | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `accountContacts.update` Update an account-contact association **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accountContacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact` | `string` | No | — | | `account` | `string` | No | — | | `jobTitle` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountContact` | `object` | Yes | — | > **accountContact full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > account?: string | null, > jobTitle?: string | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ## Account Custom Field Data ### create `accountCustomFieldData.create` Set a custom field value on an account **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldData.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `number` | Yes | — | | `customFieldId` | `number` | Yes | — | | `fieldValue` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountCustomFieldDatum` | `any` | Yes | — | *** ### createBulk `accountCustomFieldData.createBulk` Set many account custom field values in one request **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldData.createBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > accountId: number, > customFieldId: number, > fieldValue: string > }[] > ``` **Output:** *empty object* *** ### delete `accountCustomFieldData.delete` Delete a custom field value from an account **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldData.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `accountCustomFieldData.get` Retrieve an account custom field value by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldData.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountCustomFieldDatum` | `any` | Yes | — | *** ### list `accountCustomFieldData.list` List custom field values stored against accounts **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldData.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountCustomFieldData` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `accountCustomFieldData.update` Update a custom field value on an account **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldData.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fieldValue` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountCustomFieldDatum` | `any` | Yes | — | *** ### updateBulk `accountCustomFieldData.updateBulk` Update many account custom field values in one request **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldData.updateBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > accountId?: number, > customFieldId?: number, > fieldValue?: string, > id: number > }[] > ``` **Output:** *empty object* *** ## Account Custom Field Meta ### create `accountCustomFieldMeta.create` Define a new custom field for accounts **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldMeta.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fieldLabel` | `string` | Yes | — | | `fieldType` | `string` | Yes | — | | `fieldOptions` | `string[]` | No | — | | `fieldDefault` | `string` | No | — | | `fieldDefaultCurrency` | `string` | No | — | | `isFormVisible` | `number` | No | — | | `isRequired` | `number` | No | — | | `displayOrder` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountCustomFieldMetum` | `object` | Yes | — | > **accountCustomFieldMetum full type** > > ```ts theme={null} > { > id: string, > fieldLabel?: string | null, > fieldType?: string | null, > fieldDefault?: string | null, > fieldDefaultCurrency?: string | null, > fieldOptions?: any | null, > isFormVisible?: string | number | null, > isRequired?: string | number | null, > displayOrder?: string | number | null, > knownFieldId?: string | number | null, > hideFieldFlag?: string | number | null, > personalization?: string | null, > createdBy?: string | number | null, > updatedBy?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ### delete `accountCustomFieldMeta.delete` Delete an account custom field definition **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldMeta.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `accountCustomFieldMeta.get` Retrieve an account custom field definition by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldMeta.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountCustomFieldMetum` | `object` | Yes | — | > **accountCustomFieldMetum full type** > > ```ts theme={null} > { > id: string, > fieldLabel?: string | null, > fieldType?: string | null, > fieldDefault?: string | null, > fieldDefaultCurrency?: string | null, > fieldOptions?: any | null, > isFormVisible?: string | number | null, > isRequired?: string | number | null, > displayOrder?: string | number | null, > knownFieldId?: string | number | null, > hideFieldFlag?: string | number | null, > personalization?: string | null, > createdBy?: string | number | null, > updatedBy?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ### list `accountCustomFieldMeta.list` List custom field definitions for accounts **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldMeta.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountCustomFieldMeta` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **accountCustomFieldMeta full type** > > ```ts theme={null} > { > id: string, > fieldLabel?: string | null, > fieldType?: string | null, > fieldDefault?: string | null, > fieldDefaultCurrency?: string | null, > fieldOptions?: any | null, > isFormVisible?: string | number | null, > isRequired?: string | number | null, > displayOrder?: string | number | null, > knownFieldId?: string | number | null, > hideFieldFlag?: string | number | null, > personalization?: string | null, > createdBy?: string | number | null, > updatedBy?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `accountCustomFieldMeta.update` Update an account custom field definition **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accountCustomFieldMeta.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fieldLabel` | `string` | No | — | | `fieldType` | `string` | No | — | | `fieldOptions` | `string[]` | No | — | | `fieldDefault` | `string` | No | — | | `fieldDefaultCurrency` | `string` | No | — | | `isFormVisible` | `number` | No | — | | `isRequired` | `number` | No | — | | `displayOrder` | `number` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountCustomFieldMetum` | `object` | Yes | — | > **accountCustomFieldMetum full type** > > ```ts theme={null} > { > id: string, > fieldLabel?: string | null, > fieldType?: string | null, > fieldDefault?: string | null, > fieldDefaultCurrency?: string | null, > fieldOptions?: any | null, > isFormVisible?: string | number | null, > isRequired?: string | number | null, > displayOrder?: string | number | null, > knownFieldId?: string | number | null, > hideFieldFlag?: string | number | null, > personalization?: string | null, > createdBy?: string | number | null, > updatedBy?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ## Accounts ### create `accounts.create` Create a CRM account with a unique name **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accounts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `accountUrl` | `string` | No | — | | `owner` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > customFieldId: number, > fieldValue: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | Yes | — | > **account full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > accountUrl?: string | null, > owner?: string | null, > contactCount?: string | number | null, > dealCount?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > fields?: any | null, > customFieldSaveStatus?: any | null, > links?: any | null > } > ``` *** ### delete `accounts.delete` Delete a CRM account and its associated data **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.accounts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteBulk `accounts.deleteBulk` Delete many CRM accounts in one request **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.accounts.deleteBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `(string \| number)[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `(string \| number)[]` | Yes | — | *** ### get `accounts.get` Retrieve a CRM account by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.accounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | Yes | — | > **account full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > accountUrl?: string | null, > owner?: string | null, > contactCount?: string | number | null, > dealCount?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > fields?: any | null, > customFieldSaveStatus?: any | null, > links?: any | null > } > ``` *** ### list `accounts.list` List CRM accounts, optionally filtered by name **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.accounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accounts` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **accounts full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > accountUrl?: string | null, > owner?: string | null, > contactCount?: string | number | null, > dealCount?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > fields?: any | null, > customFieldSaveStatus?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `accounts.update` Update an existing CRM account by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accounts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `accountUrl` | `string` | No | — | | `owner` | `string` | No | — | | `fields` | `object[]` | No | — | | `id` | `string` | Yes | — | > **fields full type** > > ```ts theme={null} > { > customFieldId: number, > fieldValue: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | Yes | — | > **account full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > accountUrl?: string | null, > owner?: string | null, > contactCount?: string | number | null, > dealCount?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > fields?: any | null, > customFieldSaveStatus?: any | null, > links?: any | null > } > ``` *** ### upsert `accounts.upsert` Create a CRM account, or update the one with the same name **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.accounts.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `accountUrl` | `string` | No | — | | `owner` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > customFieldId: number, > fieldValue: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | Yes | — | > **account full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > accountUrl?: string | null, > owner?: string | null, > contactCount?: string | number | null, > dealCount?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > fields?: any | null, > customFieldSaveStatus?: any | null, > links?: any | null > } > ``` *** ## Activities ### list `activities.list` List account activity, optionally narrowed to one contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.activities.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `contact` | `string` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `activities` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Addresses ### create `addresses.create` Create a company address for campaign footers **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.addresses.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companyName` | `string` | Yes | — | | `address1` | `string` | Yes | — | | `address2` | `string` | No | — | | `city` | `string` | Yes | — | | `state` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | Yes | — | | `allgroups` | `boolean` | No | — | | `groupid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `address` | `object` | Yes | — | > **address full type** > > ```ts theme={null} > { > id: string, > companyName?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > state?: string | null, > district?: string | null, > zip?: string | null, > country?: string | null, > isDefault?: string | number | null, > allgroup?: string | null, > smsName?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### delete `addresses.delete` Delete a company address by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.addresses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `addresses.get` Retrieve a company address by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.addresses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `address` | `object` | Yes | — | > **address full type** > > ```ts theme={null} > { > id: string, > companyName?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > state?: string | null, > district?: string | null, > zip?: string | null, > country?: string | null, > isDefault?: string | number | null, > allgroup?: string | null, > smsName?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### list `addresses.list` List the company addresses used in campaigns **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.addresses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `addresses` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **addresses full type** > > ```ts theme={null} > { > id: string, > companyName?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > state?: string | null, > district?: string | null, > zip?: string | null, > country?: string | null, > isDefault?: string | number | null, > allgroup?: string | null, > smsName?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `addresses.update` Update an existing company address **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.addresses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companyName` | `string` | No | — | | `address1` | `string` | No | — | | `address2` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `allgroups` | `boolean` | No | — | | `groupid` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `address` | `object` | Yes | — | > **address full type** > > ```ts theme={null} > { > id: string, > companyName?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > state?: string | null, > district?: string | null, > zip?: string | null, > country?: string | null, > isDefault?: string | number | null, > allgroup?: string | null, > smsName?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ## Address Groups ### delete `addressGroups.delete` Delete an address group by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.addressGroups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Automations ### list `automations.list` List automation workflows **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.automations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `automations` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **automations full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > status?: string | null, > entered?: string | null, > exited?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Brandings ### get `brandings.get` Retrieve a branding configuration by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.brandings.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `branding` | `object` | Yes | — | > **branding full type** > > ```ts theme={null} > { > id: string, > siteName?: string | null, > groupid?: string | null, > siteLogo?: string | null, > siteLogoSmall?: string | null, > favicon?: string | null, > copyright?: string | null, > license?: string | null, > help?: string | null, > version?: string | null, > headerHtmlValue?: string | null, > headerTextValue?: string | null, > footerHtmlValue?: string | null, > footerTextValue?: string | null, > publicTemplateCss?: string | null, > publicTemplateHtm?: string | null, > adminTemplateCss?: string | null, > adminTemplateHtm?: string | null, > admin_template_css_backup?: string | null, > admin_template_htm_backup?: string | null, > zendeskWidgetEnabled?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### update `brandings.update` Update branding such as site name, logo and favicon **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.brandings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `siteName` | `string` | No | — | | `siteLogo` | `string` | No | — | | `favicon` | `string` | No | — | | `copyright` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `branding` | `object` | Yes | — | > **branding full type** > > ```ts theme={null} > { > id: string, > siteName?: string | null, > groupid?: string | null, > siteLogo?: string | null, > siteLogoSmall?: string | null, > favicon?: string | null, > copyright?: string | null, > license?: string | null, > help?: string | null, > version?: string | null, > headerHtmlValue?: string | null, > headerTextValue?: string | null, > footerHtmlValue?: string | null, > footerTextValue?: string | null, > publicTemplateCss?: string | null, > publicTemplateHtm?: string | null, > adminTemplateCss?: string | null, > adminTemplateHtm?: string | null, > admin_template_css_backup?: string | null, > admin_template_htm_backup?: string | null, > zendeskWidgetEnabled?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ## Browse Sessions ### addToCart `browseSessions.addToCart` Flag a browse session as having items added to cart **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.browseSessions.addToCart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectionId` | `string` | Yes | — | | `email` | `string` | Yes | — | **Output:** *empty object* *** ### save `browseSessions.save` Create a browse session in a specified state **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.browseSessions.save({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectionId` | `string` | Yes | — | | `email` | `string` | Yes | — | | `status` | `string` | Yes | — | | `products` | `object[]` | No | — | > **products full type** > > ```ts theme={null} > { > }[] > ``` **Output:** *empty object* *** ### search `browseSessions.search` Search browse sessions for a contact and connection **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.browseSessions.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectionId` | `string` | Yes | — | | `email` | `string` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `browseSessions` | `any[]` | No | — | *** ### testEvent `browseSessions.testEvent` Simulate a tracking event and return its debug output **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.browseSessions.testEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectionId` | `string` | Yes | — | | `url` | `string` | Yes | — | | `email` | `string` | No | — | **Output:** *empty object* *** ## Calendars ### create `calendars.create` Create a calendar feed for external calendar apps **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.calendars.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `type` | `string` | No | — | | `description` | `string` | No | — | | `isglobal` | `boolean` | No | — | | `inviteusers` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `calendar` | `object` | Yes | — | > **calendar full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > type?: string | null, > token?: string | null, > userid?: string | null, > notification?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > } > ``` *** ### delete `calendars.delete` Delete a calendar feed by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.calendars.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `calendars.get` Retrieve a calendar feed by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.calendars.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `calendar` | `object` | Yes | — | > **calendar full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > type?: string | null, > token?: string | null, > userid?: string | null, > notification?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > } > ``` *** ### list `calendars.list` List calendar feeds configured on the account **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.calendars.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `calendars` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **calendars full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > type?: string | null, > token?: string | null, > userid?: string | null, > notification?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `calendars.update` Update a calendar feed by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.calendars.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `type` | `string` | No | — | | `description` | `string` | No | — | | `isglobal` | `boolean` | No | — | | `inviteusers` | `string[]` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `calendar` | `object` | Yes | — | > **calendar full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > type?: string | null, > token?: string | null, > userid?: string | null, > notification?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > } > ``` *** ## Campaigns ### create `campaigns.create` Create a broadcast or automation campaign **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.campaigns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `number` | No | — | | `sdate` | `string` | No | — | | `segmentid` | `number` | No | — | | `p` | `object` | No | — | | `m` | `object` | No | — | > **p full type** > > ```ts theme={null} > { > } > ``` > **m full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaign` | `object` | Yes | — | > **campaign full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > status?: string | null, > sdate?: string | null, > mdate?: string | null, > ldate?: string | null, > send_amt?: string | null, > total_amt?: string | null, > opens?: string | null, > uniqueopens?: string | null, > linkclicks?: string | null, > uniquelinkclicks?: string | null, > subscriberclicks?: string | null, > unsubscribes?: string | null, > hardbounces?: string | null, > softbounces?: string | null, > links?: any | null > } > ``` *** ### duplicate `campaigns.duplicate` Duplicate a campaign with its content and configuration **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.campaigns.duplicate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaign` | `object` | Yes | — | > **campaign full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > status?: string | null, > sdate?: string | null, > mdate?: string | null, > ldate?: string | null, > send_amt?: string | null, > total_amt?: string | null, > opens?: string | null, > uniqueopens?: string | null, > linkclicks?: string | null, > uniquelinkclicks?: string | null, > subscriberclicks?: string | null, > unsubscribes?: string | null, > hardbounces?: string | null, > softbounces?: string | null, > links?: any | null > } > ``` *** ### get `campaigns.get` Retrieve a campaign by its ID with engagement metrics **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.campaigns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaign` | `object` | Yes | — | > **campaign full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > status?: string | null, > sdate?: string | null, > mdate?: string | null, > ldate?: string | null, > send_amt?: string | null, > total_amt?: string | null, > opens?: string | null, > uniqueopens?: string | null, > linkclicks?: string | null, > uniquelinkclicks?: string | null, > subscriberclicks?: string | null, > unsubscribes?: string | null, > hardbounces?: string | null, > softbounces?: string | null, > links?: any | null > } > ``` *** ### getAutomationLists `campaigns.getAutomationLists` List the lists a campaign automation sends to **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.campaigns.getAutomationLists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaignLists` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getAutomations `campaigns.getAutomations` List automations linked to a campaign **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.campaigns.getAutomations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `automations` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getLinks `campaigns.getLinks` List the tracked links belonging to a campaign **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.campaigns.getLinks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `links` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getMessages `campaigns.getMessages` List the messages attached to a campaign **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.campaigns.getMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaignMessages` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getUser `campaigns.getUser` Retrieve the user who owns a campaign **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.campaigns.getUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `any` | Yes | — | *** ### list `campaigns.list` List campaigns with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.campaigns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaigns` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **campaigns full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > status?: string | null, > sdate?: string | null, > mdate?: string | null, > ldate?: string | null, > send_amt?: string | null, > total_amt?: string | null, > opens?: string | null, > uniqueopens?: string | null, > linkclicks?: string | null, > uniquelinkclicks?: string | null, > subscriberclicks?: string | null, > unsubscribes?: string | null, > hardbounces?: string | null, > softbounces?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `campaigns.update` Edit an existing campaign, such as its name **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.campaigns.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaign` | `object` | Yes | — | > **campaign full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > status?: string | null, > sdate?: string | null, > mdate?: string | null, > ldate?: string | null, > send_amt?: string | null, > total_amt?: string | null, > opens?: string | null, > uniqueopens?: string | null, > linkclicks?: string | null, > uniquelinkclicks?: string | null, > subscriberclicks?: string | null, > unsubscribes?: string | null, > hardbounces?: string | null, > softbounces?: string | null, > links?: any | null > } > ``` *** ## Configs ### update `configs.update` Update an account configuration value **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.configs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `value` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `config` | `any` | Yes | — | *** ## Connections ### create `connections.create` Create a connection to an external e-commerce service **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.connections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `service` | `string` | Yes | — | | `externalid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `logoUrl` | `string` | No | — | | `linkUrl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `connection` | `object` | Yes | — | > **connection full type** > > ```ts theme={null} > { > id: string, > service?: string | null, > serviceName?: string | null, > externalid?: string | null, > name?: string | null, > logoUrl?: string | null, > linkUrl?: string | null, > status?: string | null, > syncStatus?: string | null, > connectionType?: string | null, > isInternal?: string | number | null, > listId?: string | number | null, > planTier?: string | null, > lastSync?: string | null, > sync_request_time?: string | null, > sync_start_time?: string | null, > credentialExpiration?: string | null, > disconnectDate?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### delete `connections.delete` Delete a connection by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.connections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `connections.get` Retrieve a connection by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.connections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `connection` | `object` | Yes | — | > **connection full type** > > ```ts theme={null} > { > id: string, > service?: string | null, > serviceName?: string | null, > externalid?: string | null, > name?: string | null, > logoUrl?: string | null, > linkUrl?: string | null, > status?: string | null, > syncStatus?: string | null, > connectionType?: string | null, > isInternal?: string | number | null, > listId?: string | number | null, > planTier?: string | null, > lastSync?: string | null, > sync_request_time?: string | null, > sync_start_time?: string | null, > credentialExpiration?: string | null, > disconnectDate?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### list `connections.list` List Deep Data connections to external services **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.connections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `service` | `string` | No | — | | `externalid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `connections` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **connections full type** > > ```ts theme={null} > { > id: string, > service?: string | null, > serviceName?: string | null, > externalid?: string | null, > name?: string | null, > logoUrl?: string | null, > linkUrl?: string | null, > status?: string | null, > syncStatus?: string | null, > connectionType?: string | null, > isInternal?: string | number | null, > listId?: string | number | null, > planTier?: string | null, > lastSync?: string | null, > sync_request_time?: string | null, > sync_start_time?: string | null, > credentialExpiration?: string | null, > disconnectDate?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `connections.update` Update an existing connection **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.connections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `service` | `string` | No | — | | `externalid` | `string` | No | — | | `name` | `string` | No | — | | `logoUrl` | `string` | No | — | | `linkUrl` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `connection` | `object` | Yes | — | > **connection full type** > > ```ts theme={null} > { > id: string, > service?: string | null, > serviceName?: string | null, > externalid?: string | null, > name?: string | null, > logoUrl?: string | null, > linkUrl?: string | null, > status?: string | null, > syncStatus?: string | null, > connectionType?: string | null, > isInternal?: string | number | null, > listId?: string | number | null, > planTier?: string | null, > lastSync?: string | null, > sync_request_time?: string | null, > sync_start_time?: string | null, > credentialExpiration?: string | null, > disconnectDate?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ## Contact Automations ### add `contactAutomations.add` Enrol a contact in an automation by email address **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.contactAutomations.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `automation_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactAutomation` | `any` | Yes | — | *** ### entryCounts `contactAutomations.entryCounts` Count how many times a contact entered each automation **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contactAutomations.entryCounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### get `contactAutomations.get` Retrieve a contact automation enrolment by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contactAutomations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactAutomation` | `any` | Yes | — | *** ### list `contactAutomations.list` List contact enrolments across automations **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contactAutomations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactAutomations` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### remove `contactAutomations.remove` Remove a contact from an automation, one run or all **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.contactAutomations.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `automation_id` | `string` | Yes | — | | `run_remove_option` | `all \| last` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `removed` | `number` | Yes | — | *** ## Contact Deals ### create `contactDeals.create` Add a secondary contact to a deal **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.contactDeals.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact` | `string` | Yes | — | | `deal` | `string` | Yes | — | | `role` | `string` | No | — | | `jobTitle` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactDeal` | `any` | Yes | — | *** ### delete `contactDeals.delete` Remove a secondary contact from a deal **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.contactDeals.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `contactDeals.get` Retrieve a secondary contact association by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contactDeals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactDeal` | `any` | Yes | — | *** ### list `contactDeals.list` List secondary contacts associated with deals **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contactDeals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactDeals` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `contactDeals.update` Update a secondary contact association **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.contactDeals.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact` | `string` | No | — | | `deal` | `string` | No | — | | `role` | `string` | No | — | | `jobTitle` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactDeal` | `any` | Yes | — | *** ## Contact Lists ### list `contactLists.list` List all contact-to-list memberships **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contactLists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactLists` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **contactLists full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > list?: string | null, > status?: string | null, > form?: string | null, > seriesid?: string | null, > sdate?: string | null, > udate?: string | null, > responder?: string | null, > sync?: string | null, > unsubreason?: string | null, > campaign?: string | null, > message?: string | null, > first_name?: string | null, > last_name?: string | null, > ip4Sub?: string | null, > ip4Unsub?: string | null, > ip4_last?: string | null, > sourceid?: string | null, > autosyncLog?: string | null, > unsubscribeAutomation?: string | null, > automation?: string | null, > channel?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Contacts ### createOrUpdate `contacts.createOrUpdate` Create a contact, or update it if the email already exists **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.contacts.createOrUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `phone` | `string` | No | — | | `fieldValues` | `object[]` | No | — | > **fieldValues full type** > > ```ts theme={null} > { > field: string, > value: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact` | `object` | Yes | — | > **contact full type** > > ```ts theme={null} > { > id: string, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > orgid?: string | null, > orgname?: string | null, > organization?: string | null, > cdate?: string | null, > udate?: string | null, > adate?: string | null, > edate?: string | null, > hash?: string | null, > ip?: string | null, > ua?: string | null, > gravatar?: string | null, > deleted?: string | null, > deleted_at?: string | null, > anonymized?: string | null, > email_local?: string | null, > email_domain?: string | null, > segmentio_id?: string | null, > bounced_hard?: string | null, > bounced_soft?: string | null, > bounced_date?: string | null, > sentcnt?: string | null, > rating_tstamp?: string | null, > socialdata_lastcheck?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > mpp_tracking?: string | null, > last_click_date?: string | null, > last_open_date?: string | null, > last_mpp_open_date?: string | null, > best_send_hour?: string | null, > sms_consent?: string | null, > sms_consent_updated_at?: string | null, > whatsapp_id?: string | null, > whatsapp_username?: string | null, > scoreValues?: any | null, > accountContacts?: any | null, > links?: any | null > } > ``` *** ### delete `contacts.delete` Delete a contact by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### find `contacts.find` Find a contact by email address **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **contacts full type** > > ```ts theme={null} > { > id: string, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > orgid?: string | null, > orgname?: string | null, > organization?: string | null, > cdate?: string | null, > udate?: string | null, > adate?: string | null, > edate?: string | null, > hash?: string | null, > ip?: string | null, > ua?: string | null, > gravatar?: string | null, > deleted?: string | null, > deleted_at?: string | null, > anonymized?: string | null, > email_local?: string | null, > email_domain?: string | null, > segmentio_id?: string | null, > bounced_hard?: string | null, > bounced_soft?: string | null, > bounced_date?: string | null, > sentcnt?: string | null, > rating_tstamp?: string | null, > socialdata_lastcheck?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > mpp_tracking?: string | null, > last_click_date?: string | null, > last_open_date?: string | null, > last_mpp_open_date?: string | null, > best_send_hour?: string | null, > sms_consent?: string | null, > sms_consent_updated_at?: string | null, > whatsapp_id?: string | null, > whatsapp_username?: string | null, > scoreValues?: any | null, > accountContacts?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### get `contacts.get` Retrieve a contact by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `automations` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact` | `object` | Yes | — | | `contactLists` | `any` | No | — | | `fieldValues` | `any` | No | — | | `geoIps` | `any` | No | — | | `deals` | `any` | No | — | | `accountContacts` | `any` | No | — | > **contact full type** > > ```ts theme={null} > { > id: string, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > orgid?: string | null, > orgname?: string | null, > organization?: string | null, > cdate?: string | null, > udate?: string | null, > adate?: string | null, > edate?: string | null, > hash?: string | null, > ip?: string | null, > ua?: string | null, > gravatar?: string | null, > deleted?: string | null, > deleted_at?: string | null, > anonymized?: string | null, > email_local?: string | null, > email_domain?: string | null, > segmentio_id?: string | null, > bounced_hard?: string | null, > bounced_soft?: string | null, > bounced_date?: string | null, > sentcnt?: string | null, > rating_tstamp?: string | null, > socialdata_lastcheck?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > mpp_tracking?: string | null, > last_click_date?: string | null, > last_open_date?: string | null, > last_mpp_open_date?: string | null, > best_send_hour?: string | null, > sms_consent?: string | null, > sms_consent_updated_at?: string | null, > whatsapp_id?: string | null, > whatsapp_username?: string | null, > scoreValues?: any | null, > accountContacts?: any | null, > links?: any | null > } > ``` *** ### getAccountContacts `contacts.getAccountContacts` List the accounts a contact is associated with **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getAccountContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountContacts` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getAutomations `contacts.getAutomations` List the automations a contact is enrolled in **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getAutomations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactAutomations` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getData `contacts.getData` Retrieve the geographic and tracking data of a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactDatum` | `any` | No | — | *** ### getDeals `contacts.getDeals` List the deals associated with a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getDeals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deals` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getFieldValues `contacts.getFieldValues` List the custom field values of a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getFieldValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fieldValues` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getGeoIps `contacts.getGeoIps` List the geo IP records associated with a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getGeoIps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `geoIps` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getGoals `contacts.getGoals` List the automation goals a contact has completed **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getGoals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactGoals` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getLists `contacts.getLists` List the list memberships of a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getLists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactLists` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **contactLists full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > list?: string | null, > status?: string | null, > form?: string | null, > seriesid?: string | null, > sdate?: string | null, > udate?: string | null, > responder?: string | null, > sync?: string | null, > unsubreason?: string | null, > campaign?: string | null, > message?: string | null, > first_name?: string | null, > last_name?: string | null, > ip4Sub?: string | null, > ip4Unsub?: string | null, > ip4_last?: string | null, > sourceid?: string | null, > autosyncLog?: string | null, > unsubscribeAutomation?: string | null, > automation?: string | null, > channel?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getLogs `contacts.getLogs` List the activity log entries for a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactLogs` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getNotes `contacts.getNotes` List the notes attached to a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `notes` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getOrganization `contacts.getOrganization` Retrieve the organization a contact belongs to **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `any` | No | — | *** ### getPlusAppend `contacts.getPlusAppend` Retrieve third-party enrichment data for a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getPlusAppend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `plusAppend` | `any` | No | — | *** ### getScoreValues `contacts.getScoreValues` List the score values of a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getScoreValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `scoreValues` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getTags `contacts.getTags` List the tags applied to a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactTags` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **contactTags full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > tag?: string | null, > cdate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### getTrackingLogs `contacts.getTrackingLogs` List site and event tracking records for a contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.getTrackingLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `trackingLogs` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### list `contacts.list` List contacts with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `email` | `string` | No | — | | `search` | `string` | No | — | | `listid` | `string` | No | — | | `tagid` | `string` | No | — | | `segmentid` | `string` | No | — | | `status` | `number` | No | — | | `id_greater` | `string` | No | — | | `orders_id` | `ASC \| DESC` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **contacts full type** > > ```ts theme={null} > { > id: string, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > orgid?: string | null, > orgname?: string | null, > organization?: string | null, > cdate?: string | null, > udate?: string | null, > adate?: string | null, > edate?: string | null, > hash?: string | null, > ip?: string | null, > ua?: string | null, > gravatar?: string | null, > deleted?: string | null, > deleted_at?: string | null, > anonymized?: string | null, > email_local?: string | null, > email_domain?: string | null, > segmentio_id?: string | null, > bounced_hard?: string | null, > bounced_soft?: string | null, > bounced_date?: string | null, > sentcnt?: string | null, > rating_tstamp?: string | null, > socialdata_lastcheck?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > mpp_tracking?: string | null, > last_click_date?: string | null, > last_open_date?: string | null, > last_mpp_open_date?: string | null, > best_send_hour?: string | null, > sms_consent?: string | null, > sms_consent_updated_at?: string | null, > whatsapp_id?: string | null, > whatsapp_username?: string | null, > scoreValues?: any | null, > accountContacts?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `contacts.update` Update an existing contact by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `phone` | `string` | No | — | | `fieldValues` | `object[]` | No | — | > **fieldValues full type** > > ```ts theme={null} > { > field: string, > value: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact` | `object` | Yes | — | > **contact full type** > > ```ts theme={null} > { > id: string, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > orgid?: string | null, > orgname?: string | null, > organization?: string | null, > cdate?: string | null, > udate?: string | null, > adate?: string | null, > edate?: string | null, > hash?: string | null, > ip?: string | null, > ua?: string | null, > gravatar?: string | null, > deleted?: string | null, > deleted_at?: string | null, > anonymized?: string | null, > email_local?: string | null, > email_domain?: string | null, > segmentio_id?: string | null, > bounced_hard?: string | null, > bounced_soft?: string | null, > bounced_date?: string | null, > sentcnt?: string | null, > rating_tstamp?: string | null, > socialdata_lastcheck?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > mpp_tracking?: string | null, > last_click_date?: string | null, > last_open_date?: string | null, > last_mpp_open_date?: string | null, > best_send_hour?: string | null, > sms_consent?: string | null, > sms_consent_updated_at?: string | null, > whatsapp_id?: string | null, > whatsapp_username?: string | null, > scoreValues?: any | null, > accountContacts?: any | null, > links?: any | null > } > ``` *** ## Contact Tags ### list `contactTags.list` List all contact-to-tag associations **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contactTags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactTags` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **contactTags full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > tag?: string | null, > cdate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Contact Tasks ### create `contactTasks.create` Create a task against a contact **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.contactTasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | | `title` | `string` | Yes | — | | `taskTypeId` | `string` | Yes | — | | `dueDate` | `string` | Yes | — | | `note` | `string` | No | — | | `assignee` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTask` | `object` | Yes | — | > **dealTask full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > note?: string | null, > relid?: string | null, > reltype?: string | null, > dealtasktype?: string | null, > duedate?: string | null, > done?: string | null, > status?: string | null, > owner?: string | null, > cdate?: string | null, > edate?: string | null, > links?: any | null > } > ``` *** ### find `contactTasks.find` Find contact tasks by title, optionally for one contact **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.contactTasks.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `contactId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTasks` | `any[]` | Yes | — | *** ## Custom Object Records ### delete `customObjectRecords.delete` Delete a custom object record by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.customObjectRecords.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `schemaId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `schemaId` | `string` | Yes | — | | `id` | `string` | No | — | *** ### deleteByExternalId `customObjectRecords.deleteByExternalId` Delete a custom object record by its external ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.customObjectRecords.deleteByExternalId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `schemaId` | `string` | Yes | — | | `externalId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `schemaId` | `string` | Yes | — | | `externalId` | `string` | No | — | *** ### get `customObjectRecords.get` Retrieve a custom object record by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.customObjectRecords.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `schemaId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `record` | `any` | Yes | — | *** ### getByExternalId `customObjectRecords.getByExternalId` Retrieve a custom object record by its external ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.customObjectRecords.getByExternalId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `schemaId` | `string` | Yes | — | | `externalId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `record` | `any` | Yes | — | *** ### list `customObjectRecords.list` List the records belonging to a custom object schema **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.customObjectRecords.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `schemaId` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### upsert `customObjectRecords.upsert` Create or update a custom object record by external ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.customObjectRecords.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `schemaId` | `string` | Yes | — | | `externalId` | `string` | No | — | | `fields` | `object[]` | Yes | — | > **fields full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `record` | `any` | Yes | — | *** ## Custom Object Schemas ### create `customObjectSchemas.create` Create a custom object schema **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.customObjectSchemas.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `labels` | `object` | No | — | | `fields` | `object[]` | No | — | | `relationships` | `object[]` | No | — | > **labels full type** > > ```ts theme={null} > { > } > ``` > **fields full type** > > ```ts theme={null} > { > }[] > ``` > **relationships full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `schema` | `object` | Yes | — | > **schema full type** > > ```ts theme={null} > { > id: string, > slug?: string | null, > name?: string | null, > description?: string | null, > labels?: any | null, > fields?: any | null, > relationships?: any | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ### createChild `customObjectSchemas.createChild` Create a child schema under a public parent schema **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.customObjectSchemas.createChild({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parentId` | `string` | Yes | — | | `applicationId` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `schema` | `object` | Yes | — | > **schema full type** > > ```ts theme={null} > { > id: string, > slug?: string | null, > name?: string | null, > description?: string | null, > labels?: any | null, > fields?: any | null, > relationships?: any | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ### delete `customObjectSchemas.delete` Delete a custom object schema and all its records **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.customObjectSchemas.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `customObjectSchemas.get` Retrieve a custom object schema by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.customObjectSchemas.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `schema` | `object` | Yes | — | > **schema full type** > > ```ts theme={null} > { > id: string, > slug?: string | null, > name?: string | null, > description?: string | null, > labels?: any | null, > fields?: any | null, > relationships?: any | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ### list `customObjectSchemas.list` List custom object schema definitions **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.customObjectSchemas.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `schemas` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **schemas full type** > > ```ts theme={null} > { > id: string, > slug?: string | null, > name?: string | null, > description?: string | null, > labels?: any | null, > fields?: any | null, > relationships?: any | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `customObjectSchemas.update` Update a custom object schema or add field options **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.customObjectSchemas.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `labels` | `object` | No | — | | `fields` | `object[]` | No | — | | `relationships` | `object[]` | No | — | | `id` | `string` | Yes | — | > **labels full type** > > ```ts theme={null} > { > } > ``` > **fields full type** > > ```ts theme={null} > { > }[] > ``` > **relationships full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `schema` | `object` | Yes | — | > **schema full type** > > ```ts theme={null} > { > id: string, > slug?: string | null, > name?: string | null, > description?: string | null, > labels?: any | null, > fields?: any | null, > relationships?: any | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ## Deal Activities ### list `dealActivities.list` List recent activity across deals **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealActivities.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `deal` | `string` | No | — | | `exclude` | `string` | No | — | | `data_type` | `string` | No | — | | `data_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealActivities` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Deal Custom Field Data ### delete `dealCustomFieldData.delete` Delete a custom field value from a deal **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.dealCustomFieldData.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `dealCustomFieldData.get` Retrieve a deal custom field value by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealCustomFieldData.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealCustomFieldDatum` | `any` | Yes | — | *** ### list `dealCustomFieldData.list` List custom field values stored against deals **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealCustomFieldData.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `dealId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealCustomFieldData` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `dealCustomFieldData.update` Update a custom field value on a deal **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealCustomFieldData.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `dealId` | `number` | No | — | | `customFieldId` | `number` | No | — | | `fieldValue` | `string \| number \| string[]` | Yes | — | | `fieldCurrency` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealCustomFieldDatum` | `any` | Yes | — | *** ## Deal Custom Field Meta ### create `dealCustomFieldMeta.create` Create a custom field definition for deals **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealCustomFieldMeta.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fieldLabel` | `string` | Yes | — | | `fieldType` | `text \| textarea \| date \| dropdown \| multiselect \| radio \| checkbox \| hidden \| number \| currency \| datetime` | Yes | — | | `fieldOptions` | `string[]` | No | — | | `fieldDefault` | `string \| number \| string[]` | No | — | | `fieldDefaultCurrency` | `string` | No | — | | `isFormVisible` | `number` | No | — | | `isRequired` | `number` | No | — | | `displayOrder` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealCustomFieldMetum` | `object` | Yes | — | > **dealCustomFieldMetum full type** > > ```ts theme={null} > { > id: string, > fieldLabel?: string | null, > fieldType?: string | null, > fieldDefault?: string | null, > fieldDefaultCurrency?: string | null, > fieldOptions?: any | null, > isFormVisible?: string | number | null, > isRequired?: string | number | null, > displayOrder?: string | number | null, > knownFieldId?: string | number | null, > hideFieldFlag?: string | number | null, > personalization?: string | null, > createdBy?: string | number | null, > updatedBy?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ### delete `dealCustomFieldMeta.delete` Delete a deal custom field definition **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.dealCustomFieldMeta.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `dealCustomFieldMeta.get` Retrieve a deal custom field definition by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealCustomFieldMeta.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealCustomFieldMetum` | `object` | Yes | — | > **dealCustomFieldMetum full type** > > ```ts theme={null} > { > id: string, > fieldLabel?: string | null, > fieldType?: string | null, > fieldDefault?: string | null, > fieldDefaultCurrency?: string | null, > fieldOptions?: any | null, > isFormVisible?: string | number | null, > isRequired?: string | number | null, > displayOrder?: string | number | null, > knownFieldId?: string | number | null, > hideFieldFlag?: string | number | null, > personalization?: string | null, > createdBy?: string | number | null, > updatedBy?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ### list `dealCustomFieldMeta.list` List custom field definitions for deals **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealCustomFieldMeta.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealCustomFieldMeta` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **dealCustomFieldMeta full type** > > ```ts theme={null} > { > id: string, > fieldLabel?: string | null, > fieldType?: string | null, > fieldDefault?: string | null, > fieldDefaultCurrency?: string | null, > fieldOptions?: any | null, > isFormVisible?: string | number | null, > isRequired?: string | number | null, > displayOrder?: string | number | null, > knownFieldId?: string | number | null, > hideFieldFlag?: string | number | null, > personalization?: string | null, > createdBy?: string | number | null, > updatedBy?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `dealCustomFieldMeta.update` Update a deal custom field definition **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealCustomFieldMeta.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fieldLabel` | `string` | No | — | | `fieldType` | `text \| textarea \| date \| dropdown \| multiselect \| radio \| checkbox \| hidden \| number \| currency \| datetime` | No | — | | `fieldOptions` | `string[]` | No | — | | `fieldDefault` | `string \| number \| string[]` | No | — | | `fieldDefaultCurrency` | `string` | No | — | | `isFormVisible` | `number` | No | — | | `isRequired` | `number` | No | — | | `displayOrder` | `number` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealCustomFieldMetum` | `object` | Yes | — | > **dealCustomFieldMetum full type** > > ```ts theme={null} > { > id: string, > fieldLabel?: string | null, > fieldType?: string | null, > fieldDefault?: string | null, > fieldDefaultCurrency?: string | null, > fieldOptions?: any | null, > isFormVisible?: string | number | null, > isRequired?: string | number | null, > displayOrder?: string | number | null, > knownFieldId?: string | number | null, > hideFieldFlag?: string | number | null, > personalization?: string | null, > createdBy?: string | number | null, > updatedBy?: string | number | null, > createdTimestamp?: string | null, > updatedTimestamp?: string | null, > links?: any | null > } > ``` *** ## Deal Groups ### create `dealGroups.create` Create a deal pipeline with its three default stages **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealGroups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `currency` | `string` | No | — | | `allgroups` | `0 \| 1` | No | — | | `allusers` | `0 \| 1` | No | — | | `autoassign` | `0 \| 1` | No | — | | `users` | `(string \| number)[]` | No | — | | `groups` | `(string \| number)[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealGroup` | `object` | Yes | — | > **dealGroup full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > currency?: string | null, > allgroups?: string | null, > allusers?: string | null, > autoassign?: string | null, > source?: string | null, > count?: string | null, > stages?: any | null, > win_probability_initialize_date?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### delete `dealGroups.delete` Delete a pipeline and every stage and deal in it **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.dealGroups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `dealGroups.get` Retrieve a deal pipeline by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealGroups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealGroup` | `object` | Yes | — | > **dealGroup full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > currency?: string | null, > allgroups?: string | null, > allusers?: string | null, > autoassign?: string | null, > source?: string | null, > count?: string | null, > stages?: any | null, > win_probability_initialize_date?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### list `dealGroups.list` List deal pipelines, optionally filtered by title **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealGroups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `title` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealGroups` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **dealGroups full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > currency?: string | null, > allgroups?: string | null, > allusers?: string | null, > autoassign?: string | null, > source?: string | null, > count?: string | null, > stages?: any | null, > win_probability_initialize_date?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `dealGroups.update` Update a deal pipeline by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealGroups.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `currency` | `string` | No | — | | `allgroups` | `0 \| 1` | No | — | | `allusers` | `0 \| 1` | No | — | | `autoassign` | `0 \| 1` | No | — | | `users` | `(string \| number)[]` | No | — | | `groups` | `(string \| number)[]` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealGroup` | `object` | Yes | — | > **dealGroup full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > currency?: string | null, > allgroups?: string | null, > allusers?: string | null, > autoassign?: string | null, > source?: string | null, > count?: string | null, > stages?: any | null, > win_probability_initialize_date?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ## Deal Roles ### create `dealRoles.create` Create a deal role such as Decision Maker **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealRoles.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealRole` | `object` | Yes | — | > **dealRole full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### delete `dealRoles.delete` Delete a deal role by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.dealRoles.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### list `dealRoles.list` List the roles a contact can hold on a deal **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealRoles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealRoles` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **dealRoles full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Deals ### delete `deals.delete` Delete a deal by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.deals.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `deals.get` Retrieve a deal by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.deals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deal` | `object` | Yes | — | > **deal full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > description?: string | null, > value?: string | number | null, > currency?: string | null, > status?: string | number | null, > contact?: string | null, > organization?: string | null, > group?: string | null, > stage?: string | null, > owner?: string | null, > percent?: string | number | null, > nextdate?: string | null, > cdate?: string | null, > mdate?: string | null, > edate?: string | null, > hash?: string | null, > nextdealid?: string | null, > nexttaskid?: string | null, > activitycount?: string | null, > winProbability?: string | number | null, > winProbabilityMdate?: string | null, > isDisabled?: boolean | string | number | null, > account?: string | number | null, > customerAccount?: string | number | null, > fields?: any | null, > customFieldSaveStatus?: any | null, > links?: any | null > } > ``` *** ### list `deals.list` List deals with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.deals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `search_field` | `all \| title \| contact \| org` | No | — | | `title` | `string` | No | — | | `stage` | `string` | No | — | | `group` | `string` | No | — | | `status` | `0 \| 1 \| 2` | No | — | | `owner` | `string` | No | — | | `nextdate_range` | `upcoming \| scheduled \| overdue \| no-task` | No | — | | `tag` | `string` | No | — | | `tasktype` | `string` | No | — | | `created_before` | `string` | No | — | | `created_after` | `string` | No | — | | `updated_before` | `string` | No | — | | `updated_after` | `string` | No | — | | `organization` | `string` | No | — | | `minimum_value` | `number` | No | — | | `maximum_value` | `number` | No | — | | `score_greater_than` | `number` | No | — | | `score_less_than` | `number` | No | — | | `score` | `number` | No | — | | `order_id` | `ASC \| DESC` | No | — | | `order_title` | `ASC \| DESC` | No | — | | `order_value` | `ASC \| DESC` | No | — | | `order_created` | `ASC \| DESC` | No | — | | `order_updated` | `ASC \| DESC` | No | — | | `order_contact_name` | `ASC \| DESC` | No | — | | `order_contact_orgname` | `ASC \| DESC` | No | — | | `order_next_action` | `ASC \| DESC` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deals` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **deals full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > description?: string | null, > value?: string | number | null, > currency?: string | null, > status?: string | number | null, > contact?: string | null, > organization?: string | null, > group?: string | null, > stage?: string | null, > owner?: string | null, > percent?: string | number | null, > nextdate?: string | null, > cdate?: string | null, > mdate?: string | null, > edate?: string | null, > hash?: string | null, > nextdealid?: string | null, > nexttaskid?: string | null, > activitycount?: string | null, > winProbability?: string | number | null, > winProbabilityMdate?: string | null, > isDisabled?: boolean | string | number | null, > account?: string | number | null, > customerAccount?: string | number | null, > fields?: any | null, > customFieldSaveStatus?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### listFiltered `deals.listFiltered` Search deals by title or filter by stage, pipeline, owner or status **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.deals.listFiltered({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `search_field` | `all \| title \| contact \| org` | No | — | | `title` | `string` | No | — | | `stage` | `string` | No | — | | `group` | `string` | No | — | | `status` | `0 \| 1 \| 2` | No | — | | `owner` | `string` | No | — | | `nextdate_range` | `upcoming \| scheduled \| overdue \| no-task` | No | — | | `tag` | `string` | No | — | | `tasktype` | `string` | No | — | | `created_before` | `string` | No | — | | `created_after` | `string` | No | — | | `updated_before` | `string` | No | — | | `updated_after` | `string` | No | — | | `organization` | `string` | No | — | | `minimum_value` | `number` | No | — | | `maximum_value` | `number` | No | — | | `score_greater_than` | `number` | No | — | | `score_less_than` | `number` | No | — | | `score` | `number` | No | — | | `order_id` | `ASC \| DESC` | No | — | | `order_title` | `ASC \| DESC` | No | — | | `order_value` | `ASC \| DESC` | No | — | | `order_created` | `ASC \| DESC` | No | — | | `order_updated` | `ASC \| DESC` | No | — | | `order_contact_name` | `ASC \| DESC` | No | — | | `order_contact_orgname` | `ASC \| DESC` | No | — | | `order_next_action` | `ASC \| DESC` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deals` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **deals full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > description?: string | null, > value?: string | number | null, > currency?: string | null, > status?: string | number | null, > contact?: string | null, > organization?: string | null, > group?: string | null, > stage?: string | null, > owner?: string | null, > percent?: string | number | null, > nextdate?: string | null, > cdate?: string | null, > mdate?: string | null, > edate?: string | null, > hash?: string | null, > nextdealid?: string | null, > nexttaskid?: string | null, > activitycount?: string | null, > winProbability?: string | number | null, > winProbabilityMdate?: string | null, > isDisabled?: boolean | string | number | null, > account?: string | number | null, > customerAccount?: string | number | null, > fields?: any | null, > customFieldSaveStatus?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `deals.update` Update an existing deal by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.deals.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `value` | `number` | No | — | | `currency` | `string` | No | — | | `group` | `string` | No | — | | `stage` | `string` | No | — | | `owner` | `string` | No | — | | `contact` | `string` | No | — | | `organization` | `string` | No | — | | `status` | `number` | No | — | | `percent` | `number` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > customFieldId: number, > fieldValue: string | number | string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `deal` | `object` | Yes | — | > **deal full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > description?: string | null, > value?: string | number | null, > currency?: string | null, > status?: string | number | null, > contact?: string | null, > organization?: string | null, > group?: string | null, > stage?: string | null, > owner?: string | null, > percent?: string | number | null, > nextdate?: string | null, > cdate?: string | null, > mdate?: string | null, > edate?: string | null, > hash?: string | null, > nextdealid?: string | null, > nexttaskid?: string | null, > activitycount?: string | null, > winProbability?: string | number | null, > winProbabilityMdate?: string | null, > isDisabled?: boolean | string | number | null, > account?: string | number | null, > customerAccount?: string | number | null, > fields?: any | null, > customFieldSaveStatus?: any | null, > links?: any | null > } > ``` *** ### updateOwnersBulk `deals.updateOwnersBulk` Reassign many deals to new owners in one request **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.deals.updateOwnersBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deals` | `object[]` | Yes | — | > **deals full type** > > ```ts theme={null} > { > id: number, > ownerId: number > }[] > ``` **Output:** *empty object* *** ## Deal Stages ### create `dealStages.create` Create a stage in a deal pipeline **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealStages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `group` | `string` | Yes | — | | `order` | `number` | No | — | | `width` | `number` | No | — | | `color` | `string` | No | — | | `cardRegion1` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealStage` | `object` | Yes | — | > **dealStage full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > group?: string | null, > order?: string | null, > width?: string | null, > color?: string | null, > dealOrder?: string | null, > cardRegion1?: string | null, > cardRegion2?: string | null, > cardRegion3?: string | null, > cardRegion4?: string | null, > cardRegion5?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### delete `dealStages.delete` Delete a pipeline stage by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.dealStages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteWithDeals `dealStages.deleteWithDeals` Delete a stage, optionally relocating its deals first **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.dealStages.deleteWithDeals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `action_type` | `Move \| Delete` | Yes | — | | `new_pipeline_id` | `string` | No | — | | `new_stage_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `dealStages.get` Retrieve a pipeline stage by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealStages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealStage` | `object` | Yes | — | > **dealStage full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > group?: string | null, > order?: string | null, > width?: string | null, > color?: string | null, > dealOrder?: string | null, > cardRegion1?: string | null, > cardRegion2?: string | null, > cardRegion3?: string | null, > cardRegion4?: string | null, > cardRegion5?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### list `dealStages.list` List deal pipeline stages **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealStages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `title` | `string` | No | — | | `group` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealStages` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **dealStages full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > group?: string | null, > order?: string | null, > width?: string | null, > color?: string | null, > dealOrder?: string | null, > cardRegion1?: string | null, > cardRegion2?: string | null, > cardRegion3?: string | null, > cardRegion4?: string | null, > cardRegion5?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### moveDeals `dealStages.moveDeals` Move every deal in one stage to another stage **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealStages.moveDeals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `stage` | `string` | Yes | — | **Output:** *empty object* *** ### update `dealStages.update` Update a pipeline stage by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealStages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `group` | `string` | No | — | | `order` | `number` | No | — | | `width` | `number` | No | — | | `color` | `string` | No | — | | `cardRegion1` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealStage` | `object` | Yes | — | > **dealStage full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > group?: string | null, > order?: string | null, > width?: string | null, > color?: string | null, > dealOrder?: string | null, > cardRegion1?: string | null, > cardRegion2?: string | null, > cardRegion3?: string | null, > cardRegion4?: string | null, > cardRegion5?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ## Deal Tasks ### create `dealTasks.create` Create a task against a deal, contact or account **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealTasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `relid` | `string` | Yes | — | | `reltype` | `Deal \| Subscriber \| Account` | Yes | — | | `dealTasktype` | `string` | Yes | — | | `ownerType` | `string` | No | — | | `status` | `number` | No | — | | `note` | `string` | No | — | | `duedate` | `string` | Yes | — | | `edate` | `string` | No | — | | `assignee` | `string` | No | — | | `triggerAutomationOnCreate` | `boolean` | No | — | | `doneAutomation` | `boolean` | No | — | | `outcomeId` | `string` | No | — | | `outcomeInfo` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTask` | `object` | Yes | — | > **dealTask full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > note?: string | null, > relid?: string | null, > reltype?: string | null, > dealtasktype?: string | null, > duedate?: string | null, > done?: string | null, > status?: string | null, > owner?: string | null, > cdate?: string | null, > edate?: string | null, > links?: any | null > } > ``` *** ### delete `dealTasks.delete` Delete a deal task by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.dealTasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `dealTasks.get` Retrieve a deal task by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealTasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTask` | `object` | Yes | — | > **dealTask full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > note?: string | null, > relid?: string | null, > reltype?: string | null, > dealtasktype?: string | null, > duedate?: string | null, > done?: string | null, > status?: string | null, > owner?: string | null, > cdate?: string | null, > edate?: string | null, > links?: any | null > } > ``` *** ### list `dealTasks.list` List deal tasks with pagination **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealTasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `title` | `string` | No | — | | `reltype` | `string` | No | — | | `relid` | `string` | No | — | | `status` | `number` | No | — | | `note` | `string` | No | — | | `duedate` | `string` | No | — | | `dealTasktype` | `string` | No | — | | `userid` | `string` | No | — | | `due_after` | `string` | No | — | | `due_before` | `string` | No | — | | `duedate_range` | `string` | No | — | | `assignee_userid` | `string` | No | — | | `outcome_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTasks` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **dealTasks full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > note?: string | null, > relid?: string | null, > reltype?: string | null, > dealtasktype?: string | null, > duedate?: string | null, > done?: string | null, > status?: string | null, > owner?: string | null, > cdate?: string | null, > edate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `dealTasks.update` Update an existing deal task by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealTasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `relid` | `string` | No | — | | `reltype` | `Deal \| Subscriber \| Account` | No | — | | `dealTasktype` | `string` | No | — | | `ownerType` | `string` | No | — | | `status` | `number` | No | — | | `note` | `string` | No | — | | `duedate` | `string` | No | — | | `edate` | `string` | No | — | | `assignee` | `string` | No | — | | `triggerAutomationOnCreate` | `boolean` | No | — | | `doneAutomation` | `boolean` | No | — | | `outcomeId` | `string` | No | — | | `outcomeInfo` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTask` | `object` | Yes | — | > **dealTask full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > note?: string | null, > relid?: string | null, > reltype?: string | null, > dealtasktype?: string | null, > duedate?: string | null, > done?: string | null, > status?: string | null, > owner?: string | null, > cdate?: string | null, > edate?: string | null, > links?: any | null > } > ``` *** ## Deal Task Types ### create `dealTaskTypes.create` Create a task type for categorising deal tasks **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealTaskTypes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `defduration` | `string` | No | — | | `status` | `number` | No | — | | `display_order` | `number` | No | — | | `outcomes` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTasktype` | `object` | Yes | — | > **dealTasktype full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > defduration?: string | null, > display_order?: string | null, > status?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > outcomes?: any | null, > links?: any | null > } > ``` *** ### get `dealTaskTypes.get` Retrieve a deal task type by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealTaskTypes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTasktype` | `object` | Yes | — | > **dealTasktype full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > defduration?: string | null, > display_order?: string | null, > status?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > outcomes?: any | null, > links?: any | null > } > ``` *** ### list `dealTaskTypes.list` List the task types available for deals **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.dealTaskTypes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTasktypes` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **dealTasktypes full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > defduration?: string | null, > display_order?: string | null, > status?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > outcomes?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `dealTaskTypes.update` Update a deal task type by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.dealTaskTypes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `defduration` | `string` | No | — | | `status` | `number` | No | — | | `display_order` | `number` | No | — | | `outcomes` | `string[]` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dealTasktype` | `object` | Yes | — | > **dealTasktype full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > defduration?: string | null, > display_order?: string | null, > status?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > outcomes?: any | null, > links?: any | null > } > ``` *** ## Ecom Customers ### create `ecomCustomers.create` Register an e-commerce customer against a connection **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.ecomCustomers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectionid` | `string` | Yes | — | | `externalid` | `string` | Yes | — | | `email` | `string` | Yes | — | | `acceptsMarketing` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomCustomer` | `object` | Yes | — | > **ecomCustomer full type** > > ```ts theme={null} > { > id: string, > connectionid?: string | null, > externalid?: string | null, > email?: string | null, > totalRevenue?: string | null, > totalOrders?: string | null, > totalProducts?: string | null, > avgRevenuePerOrder?: string | null, > avgProductCategory?: string | null, > acceptsMarketing?: string | null, > links?: any | null > } > ``` *** ### delete `ecomCustomers.delete` Delete an e-commerce customer and its data **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.ecomCustomers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `ecomCustomers.get` Retrieve an e-commerce customer by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.ecomCustomers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomCustomer` | `object` | Yes | — | > **ecomCustomer full type** > > ```ts theme={null} > { > id: string, > connectionid?: string | null, > externalid?: string | null, > email?: string | null, > totalRevenue?: string | null, > totalOrders?: string | null, > totalProducts?: string | null, > avgRevenuePerOrder?: string | null, > avgProductCategory?: string | null, > acceptsMarketing?: string | null, > links?: any | null > } > ``` *** ### list `ecomCustomers.list` List e-commerce customers with revenue metrics **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.ecomCustomers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `connectionid` | `string` | No | — | | `externalid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomCustomers` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **ecomCustomers full type** > > ```ts theme={null} > { > id: string, > connectionid?: string | null, > externalid?: string | null, > email?: string | null, > totalRevenue?: string | null, > totalOrders?: string | null, > totalProducts?: string | null, > avgRevenuePerOrder?: string | null, > avgProductCategory?: string | null, > acceptsMarketing?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `ecomCustomers.update` Update an e-commerce customer record **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.ecomCustomers.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectionid` | `string` | No | — | | `externalid` | `string` | No | — | | `email` | `string` | No | — | | `acceptsMarketing` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomCustomer` | `object` | Yes | — | > **ecomCustomer full type** > > ```ts theme={null} > { > id: string, > connectionid?: string | null, > externalid?: string | null, > email?: string | null, > totalRevenue?: string | null, > totalOrders?: string | null, > totalProducts?: string | null, > avgRevenuePerOrder?: string | null, > avgProductCategory?: string | null, > acceptsMarketing?: string | null, > links?: any | null > } > ``` *** ## Ecom Order Products ### get `ecomOrderProducts.get` Retrieve an order product line by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.ecomOrderProducts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomOrderProduct` | `any` | Yes | — | *** ### list `ecomOrderProducts.list` List the products attached to e-commerce orders **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.ecomOrderProducts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomOrderProducts` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### listForOrder `ecomOrderProducts.listForOrder` List the product lines belonging to one order **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.ecomOrderProducts.listForOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orderId` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomOrderProducts` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Ecom Orders ### create `ecomOrders.create` Record an e-commerce order for automation triggers **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.ecomOrders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `externalid` | `string` | Yes | — | | `source` | `number` | Yes | — | | `email` | `string` | Yes | — | | `orderProducts` | `object[]` | Yes | — | | `orderDiscounts` | `object[]` | No | — | | `totalPrice` | `number` | Yes | — | | `shippingAmount` | `number` | No | — | | `taxAmount` | `number` | No | — | | `discountAmount` | `number` | No | — | | `currency` | `string` | Yes | — | | `orderDate` | `string` | Yes | — | | `externalUpdatedDate` | `string` | No | — | | `abandonedDate` | `string` | No | — | | `externalcheckoutid` | `string` | No | — | | `connectionid` | `string` | Yes | — | | `customerid` | `string` | Yes | — | | `orderNumber` | `string` | No | — | | `shippingMethod` | `string` | No | — | > **orderProducts full type** > > ```ts theme={null} > { > }[] > ``` > **orderDiscounts full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomOrder` | `any` | Yes | — | *** ### delete `ecomOrders.delete` Delete an e-commerce order by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.ecomOrders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### find `ecomOrders.find` Find one order by its store order ID within a connection **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.ecomOrders.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectionId` | `string` | Yes | — | | `storeOrderId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomOrder` | `any` | No | — | *** ### get `ecomOrders.get` Retrieve an e-commerce order by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.ecomOrders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomOrder` | `any` | Yes | — | *** ### list `ecomOrders.list` List e-commerce orders with pagination **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.ecomOrders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `connectionid` | `string` | No | — | | `customerid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomOrders` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `ecomOrders.update` Update an existing e-commerce order **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.ecomOrders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `externalid` | `string` | No | — | | `source` | `number` | No | — | | `email` | `string` | No | — | | `orderProducts` | `object[]` | No | — | | `orderDiscounts` | `object[]` | No | — | | `totalPrice` | `number` | No | — | | `shippingAmount` | `number` | No | — | | `taxAmount` | `number` | No | — | | `discountAmount` | `number` | No | — | | `currency` | `string` | No | — | | `orderDate` | `string` | No | — | | `externalUpdatedDate` | `string` | No | — | | `abandonedDate` | `string` | No | — | | `externalcheckoutid` | `string` | No | — | | `connectionid` | `string` | No | — | | `customerid` | `string` | No | — | | `orderNumber` | `string` | No | — | | `shippingMethod` | `string` | No | — | | `id` | `string` | Yes | — | > **orderProducts full type** > > ```ts theme={null} > { > }[] > ``` > **orderDiscounts full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomOrder` | `any` | Yes | — | *** ### upsert `ecomOrders.upsert` Create an order, or update the one with the same store order ID. Concurrent upserts for the same connectionid and externalid can duplicate; serialize them or use orders.upsertBulk **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.ecomOrders.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `externalid` | `string` | Yes | — | | `source` | `number` | Yes | — | | `email` | `string` | Yes | — | | `orderProducts` | `object[]` | Yes | — | | `orderDiscounts` | `object[]` | No | — | | `totalPrice` | `number` | Yes | — | | `shippingAmount` | `number` | No | — | | `taxAmount` | `number` | No | — | | `discountAmount` | `number` | No | — | | `currency` | `string` | Yes | — | | `orderDate` | `string` | Yes | — | | `externalUpdatedDate` | `string` | No | — | | `abandonedDate` | `string` | No | — | | `externalcheckoutid` | `string` | No | — | | `connectionid` | `string` | Yes | — | | `customerid` | `string` | Yes | — | | `orderNumber` | `string` | No | — | | `shippingMethod` | `string` | No | — | > **orderProducts full type** > > ```ts theme={null} > { > }[] > ``` > **orderDiscounts full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecomOrder` | `any` | Yes | — | *** ## Email Activities ### list `emailActivities.list` List email activity for a subscriber or deal **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.emailActivities.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `subscriberid` | `string` | No | — | | `dealId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `emailActivities` | `any[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Event Tracking Events ### create `eventTrackingEvents.create` Whitelist a new event name for tracking **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.eventTrackingEvents.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `eventTrackingEvent` | `object` | Yes | — | > **eventTrackingEvent full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > links?: any | null > } > ``` *** ### delete `eventTrackingEvents.delete` Remove an event name from the tracking whitelist **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.eventTrackingEvents.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### list `eventTrackingEvents.list` List the whitelisted event tracking event names **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.eventTrackingEvents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `eventTrackingEvents` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **eventTrackingEvents full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Field Options ### createBulk `fieldOptions.createBulk` Create options in bulk for a dropdown or listbox field **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.fieldOptions.createBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `options` | `object[]` | Yes | — | > **options full type** > > ```ts theme={null} > { > field: string, > label: string, > value: string, > orderid?: number, > isdefault?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `fieldOptions` | `object[]` | Yes | — | > **fieldOptions full type** > > ```ts theme={null} > { > id: string, > field?: string | null, > label?: string | null, > value?: string | null, > orderid?: string | null, > isdefault?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > }[] > ``` *** ## Field Rels ### create `fieldRels.create` Associate a custom field with a list **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.fieldRels.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field` | `string` | Yes | — | | `relid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fieldRel` | `object` | Yes | — | > **fieldRel full type** > > ```ts theme={null} > { > id: string, > field?: string | null, > relid?: string | null, > dorder?: string | null, > cdate?: string | null, > links?: any | null > } > ``` *** ### delete `fieldRels.delete` Remove the association between a custom field and a list **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.fieldRels.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### list `fieldRels.list` List relationships between custom fields and lists **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.fieldRels.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fieldRels` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **fieldRels full type** > > ```ts theme={null} > { > id: string, > field?: string | null, > relid?: string | null, > dorder?: string | null, > cdate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Fields ### create `fields.create` Create a new custom contact field **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.fields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `type` | `text \| textarea \| date \| multiselect \| number \| datetime \| dropdown \| listbox \| radio \| checkbox \| hidden` | Yes | — | | `descript` | `string` | No | — | | `perstag` | `string` | No | — | | `defval` | `string` | No | — | | `isrequired` | `boolean` | No | — | | `visible` | `boolean` | No | — | | `ordernum` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `field` | `object` | Yes | — | > **field full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > descript?: string | null, > type?: string | null, > perstag?: string | null, > defval?: string | null, > isrequired?: string | null, > show_in_list?: string | null, > visible?: string | null, > service?: string | null, > ordernum?: string | null, > rows?: string | null, > cols?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > options?: any | null, > relations?: any | null, > links?: any | null > } > ``` *** ### delete `fields.delete` Delete a custom field and every value stored against it **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.fields.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `fields.get` Retrieve a custom field definition by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.fields.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `field` | `object` | Yes | — | > **field full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > descript?: string | null, > type?: string | null, > perstag?: string | null, > defval?: string | null, > isrequired?: string | null, > show_in_list?: string | null, > visible?: string | null, > service?: string | null, > ordernum?: string | null, > rows?: string | null, > cols?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > options?: any | null, > relations?: any | null, > links?: any | null > } > ``` *** ### list `fields.list` List custom field definitions with pagination **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.fields.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **fields full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > descript?: string | null, > type?: string | null, > perstag?: string | null, > defval?: string | null, > isrequired?: string | null, > show_in_list?: string | null, > visible?: string | null, > service?: string | null, > ordernum?: string | null, > rows?: string | null, > cols?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > options?: any | null, > relations?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `fields.update` Update an existing custom field definition **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.fields.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `type` | `text \| textarea \| date \| multiselect \| number \| datetime \| dropdown \| listbox \| radio \| checkbox \| hidden` | No | — | | `descript` | `string` | No | — | | `perstag` | `string` | No | — | | `defval` | `string` | No | — | | `isrequired` | `boolean` | No | — | | `visible` | `boolean` | No | — | | `ordernum` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `field` | `object` | Yes | — | > **field full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > descript?: string | null, > type?: string | null, > perstag?: string | null, > defval?: string | null, > isrequired?: string | null, > show_in_list?: string | null, > visible?: string | null, > service?: string | null, > ordernum?: string | null, > rows?: string | null, > cols?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > options?: any | null, > relations?: any | null, > links?: any | null > } > ``` *** ## Field Values ### delete `fieldValues.delete` Delete a custom field value by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.fieldValues.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `fieldValues.get` Retrieve a single custom field value by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.fieldValues.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fieldValue` | `object` | Yes | — | > **fieldValue full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > field?: string | null, > value?: string | null, > owner?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > links?: any | null > } > ``` *** ### list `fieldValues.list` List custom field values across all contacts **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.fieldValues.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fieldValues` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **fieldValues full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > field?: string | null, > value?: string | null, > owner?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### setForContact `fieldValues.setForContact` Set a custom field value on a contact **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.fieldValues.setForContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact` | `string` | Yes | — | | `field` | `string` | Yes | — | | `value` | `string` | Yes | — | | `useDefaults` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fieldValue` | `object` | Yes | — | > **fieldValue full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > field?: string | null, > value?: string | null, > owner?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > links?: any | null > } > ``` *** ### update `fieldValues.update` Update an existing custom field value by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.fieldValues.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `value` | `string` | Yes | — | | `useDefaults` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fieldValue` | `object` | Yes | — | > **fieldValue full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > field?: string | null, > value?: string | null, > owner?: string | null, > cdate?: string | null, > udate?: string | null, > created_by?: string | null, > updated_by?: string | null, > links?: any | null > } > ``` *** ## Forms ### createOptin `forms.createOptin` Record a form opt-in on behalf of a contact **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.forms.createOptin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formid` | `string` | Yes | — | | `email` | `string` | Yes | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | **Output:** *empty object* *** ### delete `forms.delete` Delete a form and its associated data **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.forms.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `forms.get` Retrieve a form by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.forms.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `form` | `object` | Yes | — | > **form full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > action?: string | null, > layout?: string | null, > style?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### list `forms.list` List forms with their field configuration **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.forms.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `forms` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **forms full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > action?: string | null, > layout?: string | null, > style?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Group Limits ### list `groupLimits.list` List the resource limits configured per group **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.groupLimits.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `groupLimits` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **groupLimits full type** > > ```ts theme={null} > { > id: string, > group?: string | null, > groupid?: string | null, > limitContact?: string | null, > limitList?: string | null, > limitCampaign?: string | null, > limitCampaignType?: string | null, > limitMail?: string | null, > limitMailType?: string | null, > limitUser?: string | null, > limitAttachment?: string | null, > abuseRatio?: string | null, > forceSenderInfo?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Group Members ### create `groupMembers.create` Add a custom field to a display group so it becomes visible **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.groupMembers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rel_id` | `string` | Yes | — | | `group_id` | `string` | Yes | — | | `ordernum` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `groupMember` | `object` | Yes | — | > **groupMember full type** > > ```ts theme={null} > { > id: string, > rel_id?: string | number | null, > group_id?: string | number | null, > ordernum?: string | number | null, > links?: any | null > } > ``` *** ### delete `groupMembers.delete` Remove a custom field from its display group **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.groupMembers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### list `groupMembers.list` List which custom fields belong to which display groups **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.groupMembers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `groupMembers` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **groupMembers full type** > > ```ts theme={null} > { > id: string, > rel_id?: string | number | null, > group_id?: string | number | null, > ordernum?: string | number | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `groupMembers.update` Change the display group or ordering of a custom field **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.groupMembers.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `rel_id` | `string` | No | — | | `group_id` | `string` | No | — | | `ordernum` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `groupMember` | `object` | Yes | — | > **groupMember full type** > > ```ts theme={null} > { > id: string, > rel_id?: string | number | null, > group_id?: string | number | null, > ordernum?: string | number | null, > links?: any | null > } > ``` *** ## Groups ### create `groups.create` Create a permission group **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.groups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `descript` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `group` | `object` | Yes | — | > **group full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > descript?: string | null, > p_admin?: string | null, > sdate?: string | null, > unsubscribelink?: string | null, > optinconfirm?: string | null, > socialdata?: string | null, > reqApproval?: string | null, > links?: any | null > } > ``` *** ### delete `groups.delete` Delete a permission group by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.groups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `groups.get` Retrieve a permission group by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.groups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `group` | `object` | Yes | — | > **group full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > descript?: string | null, > p_admin?: string | null, > sdate?: string | null, > unsubscribelink?: string | null, > optinconfirm?: string | null, > socialdata?: string | null, > reqApproval?: string | null, > links?: any | null > } > ``` *** ### list `groups.list` List permission groups with their settings **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.groups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `groups` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **groups full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > descript?: string | null, > p_admin?: string | null, > sdate?: string | null, > unsubscribelink?: string | null, > optinconfirm?: string | null, > socialdata?: string | null, > reqApproval?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `groups.update` Update a permission group title or description **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.groups.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `descript` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `group` | `object` | Yes | — | > **group full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > descript?: string | null, > p_admin?: string | null, > sdate?: string | null, > unsubscribelink?: string | null, > optinconfirm?: string | null, > socialdata?: string | null, > reqApproval?: string | null, > links?: any | null > } > ``` *** ## Imports ### createBulk `imports.createBulk` Queue up to 250 contacts per call (payload under 400 KB) for asynchronous import **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.imports.createBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | Yes | — | | `exclude_automations` | `boolean` | No | — | | `callback` | `object` | No | — | > **contacts full type** > > ```ts theme={null} > { > email: string, > first_name?: string, > last_name?: string, > phone?: string, > customer_acct_name?: string, > tags?: string[], > fields?: { > id: number, > value: string > }[], > subscribe?: { > listid: number > }[], > unsubscribe?: { > listid: number > }[] > }[] > ``` > **callback full type** > > ```ts theme={null} > { > url: string, > requestType?: GET | POST | PUT | PATCH, > detailed_results?: boolean | true | false, > params?: { > }, > headers?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Success` | `string \| number` | No | — | | `success` | `string \| number \| boolean` | No | — | | `batchId` | `string` | No | — | | `queued_contacts` | `number` | No | — | | `queuedContacts` | `number` | No | — | | `message` | `string` | No | — | *** ### getStatus `imports.getStatus` Retrieve the progress of a single import batch by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.imports.getStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `any` | No | — | | `success` | `any` | No | — | | `failure` | `any` | No | — | *** ### list `imports.list` List outstanding and recently completed import batches **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.imports.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `outstanding` | `any[]` | No | — | | `recentlyCompleted` | `any[]` | No | — | *** ### listAggregate `imports.listAggregate` Retrieve aggregate progress across all bulk import batches **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.imports.listAggregate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## List Groups ### create `listGroups.create` Grant a user group permissions over a mailing list **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.listGroups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listid` | `string` | Yes | — | | `groupid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `listGroup` | `object` | Yes | — | > **listGroup full type** > > ```ts theme={null} > { > id: string, > list?: string | null, > group?: string | null, > p_list_add?: string | null, > p_list_edit?: string | null, > p_list_delete?: string | null, > p_list_filter?: string | null, > p_list_sync?: string | null, > p_message_add?: string | null, > p_message_edit?: string | null, > p_message_delete?: string | null, > p_message_send?: string | null, > p_subscriber_add?: string | null, > p_subscriber_edit?: string | null, > p_subscriber_delete?: string | null, > p_subscriber_import?: string | null, > p_subscriber_approve?: string | null, > links?: any | null > } > ``` *** ## Lists ### create `lists.create` Create a new mailing list **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.lists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `stringid` | `string` | Yes | — | | `sender_url` | `string` | Yes | — | | `sender_reminder` | `string` | Yes | — | | `send_last_broadcast` | `boolean` | No | — | | `carboncopy` | `string` | No | — | | `subscription_notify` | `string` | No | — | | `unsubscription_notify` | `string` | No | — | | `user` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `list` | `object` | Yes | — | > **list full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > stringid?: string | null, > userid?: string | null, > user?: string | null, > description?: string | null, > cdate?: string | null, > udate?: string | null, > channel?: string | null, > private?: string | null, > deletestamp?: string | null, > active_subscribers?: string | null, > non_deleted_subscribers?: string | null, > subscription_notify?: string | null, > unsubscription_notify?: string | null, > require_name?: string | null, > get_unsubscribe_reason?: string | null, > to_name?: string | null, > optinoptout?: string | null, > optinmessageid?: string | null, > optoutconf?: string | null, > carboncopy?: string | null, > fulladdress?: string | null, > sender_name?: string | null, > sender_addr1?: string | null, > sender_addr2?: string | null, > sender_city?: string | null, > sender_state?: string | null, > sender_zip?: string | null, > sender_country?: string | null, > sender_phone?: string | null, > sender_url?: string | null, > sender_reminder?: string | null, > send_last_broadcast?: string | null, > analytics_domains?: string | null, > analytics_source?: string | null, > analytics_ua?: string | null, > twitter_token?: string | null, > twitter_token_secret?: string | null, > facebook_session?: string | null, > p_use_tracking?: string | null, > p_use_analytics_read?: string | null, > p_use_analytics_link?: string | null, > p_use_twitter?: string | null, > p_use_facebook?: string | null, > p_embed_image?: string | null, > p_use_captcha?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### delete `lists.delete` Delete a mailing list by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.lists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `lists.get` Retrieve a mailing list by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.lists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `list` | `object` | Yes | — | > **list full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > stringid?: string | null, > userid?: string | null, > user?: string | null, > description?: string | null, > cdate?: string | null, > udate?: string | null, > channel?: string | null, > private?: string | null, > deletestamp?: string | null, > active_subscribers?: string | null, > non_deleted_subscribers?: string | null, > subscription_notify?: string | null, > unsubscription_notify?: string | null, > require_name?: string | null, > get_unsubscribe_reason?: string | null, > to_name?: string | null, > optinoptout?: string | null, > optinmessageid?: string | null, > optoutconf?: string | null, > carboncopy?: string | null, > fulladdress?: string | null, > sender_name?: string | null, > sender_addr1?: string | null, > sender_addr2?: string | null, > sender_city?: string | null, > sender_state?: string | null, > sender_zip?: string | null, > sender_country?: string | null, > sender_phone?: string | null, > sender_url?: string | null, > sender_reminder?: string | null, > send_last_broadcast?: string | null, > analytics_domains?: string | null, > analytics_source?: string | null, > analytics_ua?: string | null, > twitter_token?: string | null, > twitter_token_secret?: string | null, > facebook_session?: string | null, > p_use_tracking?: string | null, > p_use_analytics_read?: string | null, > p_use_analytics_link?: string | null, > p_use_twitter?: string | null, > p_use_facebook?: string | null, > p_embed_image?: string | null, > p_use_captcha?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### list `lists.list` List mailing lists with pagination **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.lists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lists` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **lists full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > stringid?: string | null, > userid?: string | null, > user?: string | null, > description?: string | null, > cdate?: string | null, > udate?: string | null, > channel?: string | null, > private?: string | null, > deletestamp?: string | null, > active_subscribers?: string | null, > non_deleted_subscribers?: string | null, > subscription_notify?: string | null, > unsubscription_notify?: string | null, > require_name?: string | null, > get_unsubscribe_reason?: string | null, > to_name?: string | null, > optinoptout?: string | null, > optinmessageid?: string | null, > optoutconf?: string | null, > carboncopy?: string | null, > fulladdress?: string | null, > sender_name?: string | null, > sender_addr1?: string | null, > sender_addr2?: string | null, > sender_city?: string | null, > sender_state?: string | null, > sender_zip?: string | null, > sender_country?: string | null, > sender_phone?: string | null, > sender_url?: string | null, > sender_reminder?: string | null, > send_last_broadcast?: string | null, > analytics_domains?: string | null, > analytics_source?: string | null, > analytics_ua?: string | null, > twitter_token?: string | null, > twitter_token_secret?: string | null, > facebook_session?: string | null, > p_use_tracking?: string | null, > p_use_analytics_read?: string | null, > p_use_analytics_link?: string | null, > p_use_twitter?: string | null, > p_use_facebook?: string | null, > p_embed_image?: string | null, > p_use_captcha?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### updateSubscription `lists.updateSubscription` Subscribe or unsubscribe a contact to or from a list **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.lists.updateSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list` | `string` | Yes | — | | `contact` | `string` | Yes | — | | `status` | `1 \| 2` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactList` | `object` | Yes | — | > **contactList full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > list?: string | null, > status?: string | null, > form?: string | null, > seriesid?: string | null, > sdate?: string | null, > udate?: string | null, > responder?: string | null, > sync?: string | null, > unsubreason?: string | null, > campaign?: string | null, > message?: string | null, > first_name?: string | null, > last_name?: string | null, > ip4Sub?: string | null, > ip4Unsub?: string | null, > ip4_last?: string | null, > sourceid?: string | null, > autosyncLog?: string | null, > unsubscribeAutomation?: string | null, > automation?: string | null, > channel?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ## Messages ### create `messages.create` Create an email message with subject, sender and content **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.messages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subject` | `string` | Yes | — | | `fromname` | `string` | Yes | — | | `fromemail` | `string` | Yes | — | | `reply2` | `string` | Yes | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `name` | `string` | No | — | | `format` | `html \| text \| mime` | No | — | | `user` | `string` | No | — | | `preheader_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > subject?: string | null, > preheader_text?: string | null, > fromname?: string | null, > fromemail?: string | null, > reply2?: string | null, > html?: string | null, > text?: string | null, > htmlfetch?: string | null, > textfetch?: string | null, > charset?: string | null, > encoding?: string | null, > format?: string | null, > language_code?: string | null, > priority?: string | null, > source?: string | null, > hidden?: string | null, > user?: string | null, > userid?: string | null, > cdate?: string | null, > mdate?: string | null, > ed_instanceid?: string | null, > ed_version?: string | null, > has_predictive_content?: string | null, > preview_data?: any | null, > preview_mime?: string | null, > links?: any | null > } > ``` *** ### delete `messages.delete` Delete an email message by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `messages.get` Retrieve an email message by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > subject?: string | null, > preheader_text?: string | null, > fromname?: string | null, > fromemail?: string | null, > reply2?: string | null, > html?: string | null, > text?: string | null, > htmlfetch?: string | null, > textfetch?: string | null, > charset?: string | null, > encoding?: string | null, > format?: string | null, > language_code?: string | null, > priority?: string | null, > source?: string | null, > hidden?: string | null, > user?: string | null, > userid?: string | null, > cdate?: string | null, > mdate?: string | null, > ed_instanceid?: string | null, > ed_version?: string | null, > has_predictive_content?: string | null, > preview_data?: any | null, > preview_mime?: string | null, > links?: any | null > } > ``` *** ### list `messages.list` List email messages with pagination **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > subject?: string | null, > preheader_text?: string | null, > fromname?: string | null, > fromemail?: string | null, > reply2?: string | null, > html?: string | null, > text?: string | null, > htmlfetch?: string | null, > textfetch?: string | null, > charset?: string | null, > encoding?: string | null, > format?: string | null, > language_code?: string | null, > priority?: string | null, > source?: string | null, > hidden?: string | null, > user?: string | null, > userid?: string | null, > cdate?: string | null, > mdate?: string | null, > ed_instanceid?: string | null, > ed_version?: string | null, > has_predictive_content?: string | null, > preview_data?: any | null, > preview_mime?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `messages.update` Update an existing email message **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.messages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subject` | `string` | No | — | | `fromname` | `string` | No | — | | `fromemail` | `string` | No | — | | `reply2` | `string` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `name` | `string` | No | — | | `format` | `html \| text \| mime` | No | — | | `user` | `string` | No | — | | `preheader_text` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > subject?: string | null, > preheader_text?: string | null, > fromname?: string | null, > fromemail?: string | null, > reply2?: string | null, > html?: string | null, > text?: string | null, > htmlfetch?: string | null, > textfetch?: string | null, > charset?: string | null, > encoding?: string | null, > format?: string | null, > language_code?: string | null, > priority?: string | null, > source?: string | null, > hidden?: string | null, > user?: string | null, > userid?: string | null, > cdate?: string | null, > mdate?: string | null, > ed_instanceid?: string | null, > ed_version?: string | null, > has_predictive_content?: string | null, > preview_data?: any | null, > preview_mime?: string | null, > links?: any | null > } > ``` *** ## Notes ### addToContact `notes.addToContact` Add a note to a contact identified by email address **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.notes.addToContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `note` | `object` | Yes | — | > **note full type** > > ```ts theme={null} > { > id: string, > note?: string | null, > reltype?: string | null, > relid?: string | null, > cdate?: string | null, > mdate?: string | null, > userid?: string | null, > user?: string | null, > is_draft?: string | null, > owner?: any | null, > links?: any | null > } > ``` *** ### create `notes.create` Create a note against a contact, deal or account **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.notes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `note` | `string` | Yes | — | | `reltype` | `Subscriber \| Deal \| Account` | Yes | — | | `relid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `note` | `object` | Yes | — | > **note full type** > > ```ts theme={null} > { > id: string, > note?: string | null, > reltype?: string | null, > relid?: string | null, > cdate?: string | null, > mdate?: string | null, > userid?: string | null, > user?: string | null, > is_draft?: string | null, > owner?: any | null, > links?: any | null > } > ``` *** ### createForAccount `notes.createForAccount` Add a note to a CRM account **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.notes.createForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `note` | `object` | Yes | — | > **note full type** > > ```ts theme={null} > { > id: string, > note?: string | null, > reltype?: string | null, > relid?: string | null, > cdate?: string | null, > mdate?: string | null, > userid?: string | null, > user?: string | null, > is_draft?: string | null, > owner?: any | null, > links?: any | null > } > ``` *** ### createForDeal `notes.createForDeal` Add a note to a deal **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.notes.createForDeal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `note` | `object` | Yes | — | > **note full type** > > ```ts theme={null} > { > id: string, > note?: string | null, > reltype?: string | null, > relid?: string | null, > cdate?: string | null, > mdate?: string | null, > userid?: string | null, > user?: string | null, > is_draft?: string | null, > owner?: any | null, > links?: any | null > } > ``` *** ### delete `notes.delete` Delete a note by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.notes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `notes.get` Retrieve a note by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.notes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `note` | `object` | Yes | — | > **note full type** > > ```ts theme={null} > { > id: string, > note?: string | null, > reltype?: string | null, > relid?: string | null, > cdate?: string | null, > mdate?: string | null, > userid?: string | null, > user?: string | null, > is_draft?: string | null, > owner?: any | null, > links?: any | null > } > ``` *** ### list `notes.list` List notes across contacts, deals and accounts **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.notes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `reltype` | `string` | No | — | | `relid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `notes` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **notes full type** > > ```ts theme={null} > { > id: string, > note?: string | null, > reltype?: string | null, > relid?: string | null, > cdate?: string | null, > mdate?: string | null, > userid?: string | null, > user?: string | null, > is_draft?: string | null, > owner?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `notes.update` Update the body of an existing note **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.notes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `note` | `object` | Yes | — | > **note full type** > > ```ts theme={null} > { > id: string, > note?: string | null, > reltype?: string | null, > relid?: string | null, > cdate?: string | null, > mdate?: string | null, > userid?: string | null, > user?: string | null, > is_draft?: string | null, > owner?: any | null, > links?: any | null > } > ``` *** ### updateForAccount `notes.updateForAccount` Update a note attached to a CRM account **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.notes.updateForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `note` | `object` | Yes | — | > **note full type** > > ```ts theme={null} > { > id: string, > note?: string | null, > reltype?: string | null, > relid?: string | null, > cdate?: string | null, > mdate?: string | null, > userid?: string | null, > user?: string | null, > is_draft?: string | null, > owner?: any | null, > links?: any | null > } > ``` *** ### updateForDeal `notes.updateForDeal` Update a note attached to a deal **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.notes.updateForDeal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `note` | `object` | Yes | — | > **note full type** > > ```ts theme={null} > { > id: string, > note?: string | null, > reltype?: string | null, > relid?: string | null, > cdate?: string | null, > mdate?: string | null, > userid?: string | null, > user?: string | null, > is_draft?: string | null, > owner?: any | null, > links?: any | null > } > ``` *** ## Orders ### upsertBulk `orders.upsertBulk` Create or update many orders synchronously **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.orders.upsertBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orders` | `object[]` | Yes | — | > **orders full type** > > ```ts theme={null} > { > }[] > ``` **Output:** *empty object* *** ### upsertBulkAsync `orders.upsertBulkAsync` Create or update many orders asynchronously **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.orders.upsertBulkAsync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orders` | `object[]` | Yes | — | > **orders full type** > > ```ts theme={null} > { > }[] > ``` **Output:** *empty object* *** ## Personalizations ### create `personalizations.create` Create a personalization variable **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.personalizations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `tag` | `string` | Yes | — | | `content` | `string` | Yes | — | | `format` | `string` | No | — | | `lists` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `personalization` | `object` | Yes | — | > **personalization full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > tag?: string | null, > content?: string | null, > format?: string | null, > locked?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### delete `personalizations.delete` Delete a personalization variable **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.personalizations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteBulk `personalizations.deleteBulk` Delete many personalization variables at once **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.personalizations.deleteBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `(string \| number)[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `(string \| number)[]` | Yes | — | *** ### get `personalizations.get` Retrieve a personalization variable by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.personalizations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `personalization` | `object` | Yes | — | > **personalization full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > tag?: string | null, > content?: string | null, > format?: string | null, > locked?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### list `personalizations.list` List personalization variables **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.personalizations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `personalizations` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **personalizations full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > tag?: string | null, > content?: string | null, > format?: string | null, > locked?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### lock `personalizations.lock` Lock a personalization variable against edits **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.personalizations.lock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `personalization` | `object` | Yes | — | > **personalization full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > tag?: string | null, > content?: string | null, > format?: string | null, > locked?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### unlock `personalizations.unlock` Unlock a personalization variable for editing **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.personalizations.unlock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `personalization` | `object` | Yes | — | > **personalization full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > tag?: string | null, > content?: string | null, > format?: string | null, > locked?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ### update `personalizations.update` Edit an existing personalization variable **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.personalizations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `tag` | `string` | No | — | | `content` | `string` | No | — | | `format` | `string` | No | — | | `lists` | `string[]` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `personalization` | `object` | Yes | — | > **personalization full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > tag?: string | null, > content?: string | null, > format?: string | null, > locked?: string | null, > cdate?: string | null, > udate?: string | null, > links?: any | null > } > ``` *** ## Products ### create `products.create` Create a product in the e-commerce catalog **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.products.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `legacyConnectionId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `sku` | `string` | No | — | | `price` | `number` | No | — | | `currency` | `string` | No | — | | `description` | `string` | No | — | | `imageUrl` | `string` | No | — | | `productUrl` | `string` | No | — | | `isVariant` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `createProduct` | `any` | No | — | *** ### delete `products.delete` Delete a product from the e-commerce catalog **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.products.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleteProduct` | `any` | No | — | *** ### get `products.get` Retrieve a catalog product by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.products.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `product` | `any` | No | — | *** ### search `products.search` Search the e-commerce product catalog **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.products.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `products` | `any[]` | No | — | *** ### update `products.update` Update a catalog product **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.products.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `legacyConnectionId` | `string` | No | — | | `name` | `string` | No | — | | `sku` | `string` | No | — | | `price` | `number` | No | — | | `currency` | `string` | No | — | | `description` | `string` | No | — | | `imageUrl` | `string` | No | — | | `productUrl` | `string` | No | — | | `isVariant` | `boolean` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `updateProduct` | `any` | No | — | *** ### upsertBulk `products.upsertBulk` Create or update many catalog products in one request **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.products.upsertBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `products` | `object[]` | Yes | — | > **products full type** > > ```ts theme={null} > { > }[] > ``` **Output:** *empty object* *** ## Recurring Payments ### search `recurringPayments.search` Search recurring payment records by filter **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.recurringPayments.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `recurringPayments` | `any[]` | No | — | *** ### upsertBulk `recurringPayments.upsertBulk` Create or update many recurring payments at once **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.recurringPayments.upsertBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recurringPayments` | `object[]` | Yes | — | > **recurringPayments full type** > > ```ts theme={null} > { > }[] > ``` **Output:** *empty object* *** ## Saved Responses ### create `savedResponses.create` Create a reusable saved response template **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.savedResponses.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `subject` | `string` | Yes | — | | `body` | `string` | Yes | — | | `userid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `savedResponse` | `object` | Yes | — | > **savedResponse full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > subject?: string | null, > body?: string | null, > userid?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > } > ``` *** ### delete `savedResponses.delete` Delete a saved response template **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.savedResponses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `savedResponses.get` Retrieve a saved response by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.savedResponses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `savedResponse` | `object` | Yes | — | > **savedResponse full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > subject?: string | null, > body?: string | null, > userid?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > } > ``` *** ### list `savedResponses.list` List saved response templates **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.savedResponses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `savedResponses` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **savedResponses full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > subject?: string | null, > body?: string | null, > userid?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `savedResponses.update` Update a saved response template **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.savedResponses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `userid` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `savedResponse` | `object` | Yes | — | > **savedResponse full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > subject?: string | null, > body?: string | null, > userid?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > } > ``` *** ## Scores ### list `scores.list` List the scoring rules configured on the account **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.scores.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `scores` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **scores full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > descript?: string | null, > reltype?: string | null, > status?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Segments ### create `segments.create` Create a segment with filtering conditions **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.segments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `logic` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `object` | Yes | — | > **segment full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > logic?: string | null, > hidden?: string | null, > seriesid?: string | null, > segmentid_v2?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### delete `segments.delete` Delete a segment and its history **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.segments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `segments.get` Retrieve a segment by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `object` | Yes | — | > **segment full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > logic?: string | null, > hidden?: string | null, > seriesid?: string | null, > segmentid_v2?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### list `segments.list` List contact segments **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segments` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **segments full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > logic?: string | null, > hidden?: string | null, > seriesid?: string | null, > segmentid_v2?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### listAudiences `segments.listAudiences` List saved segment summaries, known as audiences **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segments.listAudiences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segments` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **segments full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > logic?: string | null, > hidden?: string | null, > seriesid?: string | null, > segmentid_v2?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `segments.update` Update a segment definition **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.segments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `logic` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `object` | Yes | — | > **segment full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > logic?: string | null, > hidden?: string | null, > seriesid?: string | null, > segmentid_v2?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ## Segments V2 ### countAtTimestamp `segmentsV2.countAtTimestamp` Retrieve segment counts recorded before a timestamp **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.countAtTimestamp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segmentCounts` | `any[]` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### countHistory `segmentsV2.countHistory` List historic result counts for one segment **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.countHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segmentCounts` | `any[]` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### create `segmentsV2.create` Create an advanced segment with filtering conditions **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `conditions` | `object[]` | No | — | > **conditions full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `any` | Yes | — | *** ### delete `segmentsV2.delete` Delete a segment and every historic version of it **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `any` | Yes | — | *** ### get `segmentsV2.get` Retrieve a V2 segment by its UUID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `any` | Yes | — | *** ### getAtTimestamp `segmentsV2.getAtTimestamp` Retrieve a segment as it stood at a point in time **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.getAtTimestamp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `any` | Yes | — | *** ### match `segmentsV2.match` Check whether a contact matches a segment **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.match({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `contactId` | `string` | Yes | — | **Output:** *empty object* *** ### matchAll `segmentsV2.matchAll` Start a match-all evaluation for every contact in a segment **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.matchAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `is_ready` | `boolean` | No | — | | `run_id` | `any` | No | — | *** ### matchAllResult `segmentsV2.matchAllResult` Fetch a match-all result set by its run ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.matchAllResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `is_ready` | `boolean` | No | — | | `run_id` | `any` | No | — | *** ### matchByExternalId `segmentsV2.matchByExternalId` Check segment membership using an external contact ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.matchByExternalId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `externalId` | `string` | Yes | — | **Output:** *empty object* *** ### matchSomeResult `segmentsV2.matchSomeResult` Fetch a partial segment match result set by run ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.matchSomeResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `is_ready` | `boolean` | No | — | | `run_id` | `any` | No | — | *** ### recentCounts `segmentsV2.recentCounts` Retrieve the most recent result count per segment **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.recentCounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segmentCounts` | `any[]` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### revertToTimestamp `segmentsV2.revertToTimestamp` Revert a segment to how it looked at a point in time **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.revertToTimestamp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `any` | Yes | — | *** ### update `segmentsV2.update` Update a V2 segment definition **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.segmentsV2.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `description` | `string` | No | — | | `conditions` | `object[]` | No | — | | `id` | `string` | Yes | — | > **conditions full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `any` | Yes | — | *** ## Sms Broadcast Lists ### list `smsBroadcastLists.list` List the SMS broadcast lists available on the account **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.smsBroadcastLists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lists` | `any[]` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Sms Broadcasts ### createSnapshot `smsBroadcasts.createSnapshot` Request a metrics snapshot for specific SMS broadcasts **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.smsBroadcasts.createSnapshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `broadcastIds` | `string[]` | Yes | — | **Output:** *empty object* *** ### getFailures `smsBroadcasts.getFailures` Group and count SMS delivery failures for a broadcast **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.smsBroadcasts.getFailures({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `broadcastId` | `string` | Yes | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | **Output:** *empty object* *** ### getMetrics `smsBroadcasts.getMetrics` Retrieve delivery metrics for specific SMS broadcasts **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.smsBroadcasts.getMetrics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `broadcastIds` | `string[]` | No | — | **Output:** *empty object* *** ### getRecipients `smsBroadcasts.getRecipients` List the contacts an SMS broadcast was sent to **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.smsBroadcasts.getRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** *empty object* *** ### getSnapshot `smsBroadcasts.getSnapshot` Retrieve aggregate metrics across all SMS broadcasts **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.smsBroadcasts.getSnapshot({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `snapshot` | `any` | No | — | *** ### list `smsBroadcasts.list` List SMS broadcasts with optional name and status filters **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.smsBroadcasts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `broadcasts` | `any[]` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Sms Credits ### get `smsCredits.get` Retrieve SMS credit usage and remaining balance **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.smsCredits.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `smsCredits` | `any` | No | — | *** ## Tags ### addToContact `tags.addToContact` Apply a tag to a contact **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.tags.addToContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactTag` | `object` | Yes | — | > **contactTag full type** > > ```ts theme={null} > { > id: string, > contact?: string | null, > tag?: string | null, > cdate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### create `tags.create` Create a new tag **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.tags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `string` | Yes | — | | `tagType` | `contact \| template` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `object` | Yes | — | > **tag full type** > > ```ts theme={null} > { > id: string, > tag?: string | null, > tagType?: string | null, > description?: string | null, > subscriber_count?: string | null, > deleted?: string | null, > cdate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### delete `tags.delete` Delete a tag by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `tags.get` Retrieve a tag by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.tags.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `object` | Yes | — | > **tag full type** > > ```ts theme={null} > { > id: string, > tag?: string | null, > tagType?: string | null, > description?: string | null, > subscriber_count?: string | null, > deleted?: string | null, > cdate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ### list `tags.list` List tags with pagination and search **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > id: string, > tag?: string | null, > tagType?: string | null, > description?: string | null, > subscriber_count?: string | null, > deleted?: string | null, > cdate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### removeFromContact `tags.removeFromContact` Remove a tag from a contact by its contactTag ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.tags.removeFromContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### update `tags.update` Update an existing tag by its ID **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.tags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `tag` | `string` | No | — | | `tagType` | `contact \| template` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `object` | Yes | — | > **tag full type** > > ```ts theme={null} > { > id: string, > tag?: string | null, > tagType?: string | null, > description?: string | null, > subscriber_count?: string | null, > deleted?: string | null, > cdate?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_timestamp?: string | null, > updated_timestamp?: string | null, > links?: any | null > } > ``` *** ## Task Outcomes ### create `taskOutcomes.create` Create a task outcome with an associated sentiment **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.taskOutcomes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `sentiment` | `positive \| neutral \| negative` | No | — | | `status` | `number` | No | — | | `dealTasktypes` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskOutcome` | `object` | Yes | — | > **taskOutcome full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > sentiment?: string | null, > disabled?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > dealTasktype_ids?: any | null, > links?: any | null > } > ``` *** ### get `taskOutcomes.get` Retrieve a task outcome by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.taskOutcomes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskOutcome` | `object` | Yes | — | > **taskOutcome full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > sentiment?: string | null, > disabled?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > dealTasktype_ids?: any | null, > links?: any | null > } > ``` *** ### list `taskOutcomes.list` List the outcomes that can be assigned to tasks **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.taskOutcomes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskOutcomes` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **taskOutcomes full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > sentiment?: string | null, > disabled?: string | null, > created_by?: string | null, > updated_by?: string | null, > created_utc_timestamp?: string | null, > updated_utc_timestamp?: string | null, > dealTasktype_ids?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ## Task Reminders ### create `taskReminders.create` Create a reminder ahead of a deal task due date **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.taskReminders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dealTask` | `string` | Yes | — | | `interval` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskNotification` | `any` | Yes | — | *** ## Templates ### createShareLink `templates.createShareLink` Create a shareable link for a campaign template **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.templates.createShareLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### get `templates.get` Retrieve a campaign template by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.templates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template` | `object` | Yes | — | > **template full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > subject?: string | null, > content?: string | null, > categoryid?: string | null, > userid?: string | null, > cdate?: string | null, > mdate?: string | null, > links?: any | null > } > ``` *** ## Tracking ### addWhitelist `tracking.addWhitelist` Add a domain to the site tracking whitelist **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.tracking.addWhitelist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** *empty object* *** ### getCode `tracking.getCode` Retrieve the site tracking JavaScript snippet **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.tracking.getCode({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### getEventStatus `tracking.getEventStatus` Check whether event tracking is enabled **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.tracking.getEventStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `eventTracking` | `object` | Yes | — | > **eventTracking full type** > > ```ts theme={null} > { > enabled: boolean > } > ``` *** ### getSiteStatus `tracking.getSiteStatus` Check whether site tracking is enabled **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.tracking.getSiteStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `siteTracking` | `object` | Yes | — | > **siteTracking full type** > > ```ts theme={null} > { > enabled: boolean > } > ``` *** ### listWhitelist `tracking.listWhitelist` List the domains allowed for site tracking **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.tracking.listWhitelist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `siteTrackingWhitelist` | `any[]` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### removeWhitelist `tracking.removeWhitelist` Remove a domain from the site tracking whitelist **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.tracking.removeWhitelist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### setEventStatus `tracking.setEventStatus` Enable or disable event tracking for the account **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.tracking.setEventStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `eventTracking` | `object` | Yes | — | > **eventTracking full type** > > ```ts theme={null} > { > enabled: boolean > } > ``` *** ### setSiteStatus `tracking.setSiteStatus` Enable or disable site tracking for the account **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.tracking.setSiteStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `siteTracking` | `object` | Yes | — | > **siteTracking full type** > > ```ts theme={null} > { > enabled: boolean > } > ``` *** ### trackEvent `tracking.trackEvent` Record a custom event against a contact **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.tracking.trackEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `actid` | `string` | Yes | — | | `key` | `string` | Yes | — | | `event` | `string` | Yes | — | | `email` | `string` | Yes | — | | `eventdata` | `string` | No | — | **Output:** *empty object* *** ## Users ### create `users.create` Create an account user who can sign in **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `email` | `string` | Yes | — | | `firstName` | `string` | Yes | — | | `lastName` | `string` | Yes | — | | `password` | `string` | Yes | — | | `group` | `string` | Yes | — | | `phone` | `string` | No | — | | `signature` | `string` | No | — | | `lang` | `string` | No | — | | `localZoneid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: string, > username?: string | null, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > signature?: string | null, > lang?: string | null, > localZoneid?: string | null, > mfaEnabled?: string | number | null, > roles?: any | null, > links?: any | null > } > ``` *** ### delete `users.delete` Delete an account user by their ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.users.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `users.get` Retrieve an account user by their ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: string, > username?: string | null, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > signature?: string | null, > lang?: string | null, > localZoneid?: string | null, > mfaEnabled?: string | number | null, > roles?: any | null, > links?: any | null > } > ``` *** ### getByUsername `users.getByUsername` Retrieve an account user by their username **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.users.getByUsername({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: string, > username?: string | null, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > signature?: string | null, > lang?: string | null, > localZoneid?: string | null, > mfaEnabled?: string | number | null, > roles?: any | null, > links?: any | null > } > ``` *** ### getMe `users.getMe` Retrieve the user the API token belongs to **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.users.getMe({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: string, > username?: string | null, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > signature?: string | null, > lang?: string | null, > localZoneid?: string | null, > mfaEnabled?: string | number | null, > roles?: any | null, > links?: any | null > } > ``` *** ### list `users.list` List account users with pagination and sorting **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **users full type** > > ```ts theme={null} > { > id: string, > username?: string | null, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > signature?: string | null, > lang?: string | null, > localZoneid?: string | null, > mfaEnabled?: string | number | null, > roles?: any | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `users.update` Update an account user, including group assignment **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | No | — | | `email` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `password` | `string` | No | — | | `group` | `string` | No | — | | `phone` | `string` | No | — | | `signature` | `string` | No | — | | `lang` | `string` | No | — | | `localZoneid` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: string, > username?: string | null, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > signature?: string | null, > lang?: string | null, > localZoneid?: string | null, > mfaEnabled?: string | number | null, > roles?: any | null, > links?: any | null > } > ``` *** ## Webhooks ### create `webhooks.create` Create a webhook subscription for account events **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | | `events` | `string[]` | Yes | — | | `sources` | `public \| admin \| api \| system[]` | Yes | — | | `listid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhook` | `object` | Yes | — | > **webhook full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > url?: string | null, > events?: any | null, > sources?: any | null, > listid?: string | null, > cdate?: string | null, > state?: string | null, > deactivated_date?: string | null, > links?: any | null > } > ``` *** ### delete `webhooks.delete` Delete a webhook subscription by its ID **Risk:** `destructive` ```ts theme={null} await corsair.activecampaign.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `webhooks.get` Retrieve a webhook subscription by its ID **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhook` | `object` | Yes | — | > **webhook full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > url?: string | null, > events?: any | null, > sources?: any | null, > listid?: string | null, > cdate?: string | null, > state?: string | null, > deactivated_date?: string | null, > links?: any | null > } > ``` *** ### list `webhooks.list` List configured webhook subscriptions **Risk:** `read` ```ts theme={null} await corsair.activecampaign.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **webhooks full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > url?: string | null, > events?: any | null, > sources?: any | null, > listid?: string | null, > cdate?: string | null, > state?: string | null, > deactivated_date?: string | null, > links?: any | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: string | number | null > } > ``` *** ### update `webhooks.update` Update a webhook subscription **Risk:** `write` ```ts theme={null} await corsair.activecampaign.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `url` | `string` | No | — | | `events` | `string[]` | No | — | | `sources` | `public \| admin \| api \| system[]` | No | — | | `listid` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhook` | `object` | Yes | — | > **webhook full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > url?: string | null, > events?: any | null, > sources?: any | null, > listid?: string | null, > cdate?: string | null, > state?: string | null, > deactivated_date?: string | null, > links?: any | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/activecampaign/database ActiveCampaign local sync: searchable entities, `.search()` filters, and operators. The ActiveCampaign plugin syncs data locally. Use `corsair.activecampaign.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Account Contacts Path: `activecampaign.db.accountContacts.search` ```ts theme={null} const rows = await corsair.activecampaign.db.accountContacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `contact` | `string` | equals, contains, startsWith, endsWith, in | | `account` | `string` | equals, contains, startsWith, endsWith, in | | `jobTitle` | `string` | equals, contains, startsWith, endsWith, in | | `createdTimestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updatedTimestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Account Custom Field Meta Path: `activecampaign.db.accountCustomFieldMeta.search` ```ts theme={null} const rows = await corsair.activecampaign.db.accountCustomFieldMeta.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `fieldLabel` | `string` | equals, contains, startsWith, endsWith, in | | `fieldType` | `string` | equals, contains, startsWith, endsWith, in | | `fieldDefault` | `string` | equals, contains, startsWith, endsWith, in | | `fieldDefaultCurrency` | `string` | equals, contains, startsWith, endsWith, in | | `personalization` | `string` | equals, contains, startsWith, endsWith, in | | `createdTimestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updatedTimestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Accounts Path: `activecampaign.db.accounts.search` ```ts theme={null} const rows = await corsair.activecampaign.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `accountUrl` | `string` | equals, contains, startsWith, endsWith, in | | `owner` | `string` | equals, contains, startsWith, endsWith, in | | `createdTimestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updatedTimestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Addresses Path: `activecampaign.db.addresses.search` ```ts theme={null} const rows = await corsair.activecampaign.db.addresses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `companyName` | `string` | equals, contains, startsWith, endsWith, in | | `address1` | `string` | equals, contains, startsWith, endsWith, in | | `address2` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `district` | `string` | equals, contains, startsWith, endsWith, in | | `zip` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `allgroup` | `string` | equals, contains, startsWith, endsWith, in | | `smsName` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Automations Path: `activecampaign.db.automations.search` ```ts theme={null} const rows = await corsair.activecampaign.db.automations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `entered` | `string` | equals, contains, startsWith, endsWith, in | | `exited` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `mdate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Brandings Path: `activecampaign.db.brandings.search` ```ts theme={null} const rows = await corsair.activecampaign.db.brandings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `siteName` | `string` | equals, contains, startsWith, endsWith, in | | `groupid` | `string` | equals, contains, startsWith, endsWith, in | | `siteLogo` | `string` | equals, contains, startsWith, endsWith, in | | `siteLogoSmall` | `string` | equals, contains, startsWith, endsWith, in | | `favicon` | `string` | equals, contains, startsWith, endsWith, in | | `copyright` | `string` | equals, contains, startsWith, endsWith, in | | `license` | `string` | equals, contains, startsWith, endsWith, in | | `help` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `headerHtmlValue` | `string` | equals, contains, startsWith, endsWith, in | | `headerTextValue` | `string` | equals, contains, startsWith, endsWith, in | | `footerHtmlValue` | `string` | equals, contains, startsWith, endsWith, in | | `footerTextValue` | `string` | equals, contains, startsWith, endsWith, in | | `publicTemplateCss` | `string` | equals, contains, startsWith, endsWith, in | | `publicTemplateHtm` | `string` | equals, contains, startsWith, endsWith, in | | `adminTemplateCss` | `string` | equals, contains, startsWith, endsWith, in | | `adminTemplateHtm` | `string` | equals, contains, startsWith, endsWith, in | | `admin_template_css_backup` | `string` | equals, contains, startsWith, endsWith, in | | `admin_template_htm_backup` | `string` | equals, contains, startsWith, endsWith, in | | `zendeskWidgetEnabled` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Calendars Path: `activecampaign.db.calendars.search` ```ts theme={null} const rows = await corsair.activecampaign.db.calendars.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `token` | `string` | equals, contains, startsWith, endsWith, in | | `userid` | `string` | equals, contains, startsWith, endsWith, in | | `notification` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `mdate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Campaigns Path: `activecampaign.db.campaigns.search` ```ts theme={null} const rows = await corsair.activecampaign.db.campaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `sdate` | `string` | equals, contains, startsWith, endsWith, in | | `mdate` | `string` | equals, contains, startsWith, endsWith, in | | `ldate` | `string` | equals, contains, startsWith, endsWith, in | | `send_amt` | `string` | equals, contains, startsWith, endsWith, in | | `total_amt` | `string` | equals, contains, startsWith, endsWith, in | | `opens` | `string` | equals, contains, startsWith, endsWith, in | | `uniqueopens` | `string` | equals, contains, startsWith, endsWith, in | | `linkclicks` | `string` | equals, contains, startsWith, endsWith, in | | `uniquelinkclicks` | `string` | equals, contains, startsWith, endsWith, in | | `subscriberclicks` | `string` | equals, contains, startsWith, endsWith, in | | `unsubscribes` | `string` | equals, contains, startsWith, endsWith, in | | `hardbounces` | `string` | equals, contains, startsWith, endsWith, in | | `softbounces` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Connections Path: `activecampaign.db.connections.search` ```ts theme={null} const rows = await corsair.activecampaign.db.connections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `service` | `string` | equals, contains, startsWith, endsWith, in | | `serviceName` | `string` | equals, contains, startsWith, endsWith, in | | `externalid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `logoUrl` | `string` | equals, contains, startsWith, endsWith, in | | `linkUrl` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `syncStatus` | `string` | equals, contains, startsWith, endsWith, in | | `connectionType` | `string` | equals, contains, startsWith, endsWith, in | | `planTier` | `string` | equals, contains, startsWith, endsWith, in | | `lastSync` | `string` | equals, contains, startsWith, endsWith, in | | `sync_request_time` | `string` | equals, contains, startsWith, endsWith, in | | `sync_start_time` | `string` | equals, contains, startsWith, endsWith, in | | `credentialExpiration` | `string` | equals, contains, startsWith, endsWith, in | | `disconnectDate` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contact Lists Path: `activecampaign.db.contactLists.search` ```ts theme={null} const rows = await corsair.activecampaign.db.contactLists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `contact` | `string` | equals, contains, startsWith, endsWith, in | | `list` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `form` | `string` | equals, contains, startsWith, endsWith, in | | `seriesid` | `string` | equals, contains, startsWith, endsWith, in | | `sdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | | `responder` | `string` | equals, contains, startsWith, endsWith, in | | `sync` | `string` | equals, contains, startsWith, endsWith, in | | `unsubreason` | `string` | equals, contains, startsWith, endsWith, in | | `campaign` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `ip4Sub` | `string` | equals, contains, startsWith, endsWith, in | | `ip4Unsub` | `string` | equals, contains, startsWith, endsWith, in | | `ip4_last` | `string` | equals, contains, startsWith, endsWith, in | | `sourceid` | `string` | equals, contains, startsWith, endsWith, in | | `autosyncLog` | `string` | equals, contains, startsWith, endsWith, in | | `unsubscribeAutomation` | `string` | equals, contains, startsWith, endsWith, in | | `automation` | `string` | equals, contains, startsWith, endsWith, in | | `channel` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `activecampaign.db.contacts.search` ```ts theme={null} const rows = await corsair.activecampaign.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `orgid` | `string` | equals, contains, startsWith, endsWith, in | | `orgname` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | | `adate` | `string` | equals, contains, startsWith, endsWith, in | | `edate` | `string` | equals, contains, startsWith, endsWith, in | | `hash` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `ua` | `string` | equals, contains, startsWith, endsWith, in | | `gravatar` | `string` | equals, contains, startsWith, endsWith, in | | `deleted` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | | `anonymized` | `string` | equals, contains, startsWith, endsWith, in | | `email_local` | `string` | equals, contains, startsWith, endsWith, in | | `email_domain` | `string` | equals, contains, startsWith, endsWith, in | | `segmentio_id` | `string` | equals, contains, startsWith, endsWith, in | | `bounced_hard` | `string` | equals, contains, startsWith, endsWith, in | | `bounced_soft` | `string` | equals, contains, startsWith, endsWith, in | | `bounced_date` | `string` | equals, contains, startsWith, endsWith, in | | `sentcnt` | `string` | equals, contains, startsWith, endsWith, in | | `rating_tstamp` | `string` | equals, contains, startsWith, endsWith, in | | `socialdata_lastcheck` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_utc_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_utc_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `mpp_tracking` | `string` | equals, contains, startsWith, endsWith, in | | `last_click_date` | `string` | equals, contains, startsWith, endsWith, in | | `last_open_date` | `string` | equals, contains, startsWith, endsWith, in | | `last_mpp_open_date` | `string` | equals, contains, startsWith, endsWith, in | | `best_send_hour` | `string` | equals, contains, startsWith, endsWith, in | | `sms_consent` | `string` | equals, contains, startsWith, endsWith, in | | `sms_consent_updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `whatsapp_id` | `string` | equals, contains, startsWith, endsWith, in | | `whatsapp_username` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contact Tags Path: `activecampaign.db.contactTags.search` ```ts theme={null} const rows = await corsair.activecampaign.db.contactTags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `contact` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Custom Object Schemas Path: `activecampaign.db.customObjectSchemas.search` ```ts theme={null} const rows = await corsair.activecampaign.db.customObjectSchemas.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdTimestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updatedTimestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deal Custom Field Meta Path: `activecampaign.db.dealCustomFieldMeta.search` ```ts theme={null} const rows = await corsair.activecampaign.db.dealCustomFieldMeta.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `fieldLabel` | `string` | equals, contains, startsWith, endsWith, in | | `fieldType` | `string` | equals, contains, startsWith, endsWith, in | | `fieldDefault` | `string` | equals, contains, startsWith, endsWith, in | | `fieldDefaultCurrency` | `string` | equals, contains, startsWith, endsWith, in | | `personalization` | `string` | equals, contains, startsWith, endsWith, in | | `createdTimestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updatedTimestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deal Groups Path: `activecampaign.db.dealGroups.search` ```ts theme={null} const rows = await corsair.activecampaign.db.dealGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `allgroups` | `string` | equals, contains, startsWith, endsWith, in | | `allusers` | `string` | equals, contains, startsWith, endsWith, in | | `autoassign` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `count` | `string` | equals, contains, startsWith, endsWith, in | | `win_probability_initialize_date` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deal Roles Path: `activecampaign.db.dealRoles.search` ```ts theme={null} const rows = await corsair.activecampaign.db.dealRoles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deals Path: `activecampaign.db.deals.search` ```ts theme={null} const rows = await corsair.activecampaign.db.deals.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `contact` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `group` | `string` | equals, contains, startsWith, endsWith, in | | `stage` | `string` | equals, contains, startsWith, endsWith, in | | `owner` | `string` | equals, contains, startsWith, endsWith, in | | `nextdate` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `mdate` | `string` | equals, contains, startsWith, endsWith, in | | `edate` | `string` | equals, contains, startsWith, endsWith, in | | `hash` | `string` | equals, contains, startsWith, endsWith, in | | `nextdealid` | `string` | equals, contains, startsWith, endsWith, in | | `nexttaskid` | `string` | equals, contains, startsWith, endsWith, in | | `activitycount` | `string` | equals, contains, startsWith, endsWith, in | | `winProbabilityMdate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deal Stages Path: `activecampaign.db.dealStages.search` ```ts theme={null} const rows = await corsair.activecampaign.db.dealStages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `group` | `string` | equals, contains, startsWith, endsWith, in | | `order` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `dealOrder` | `string` | equals, contains, startsWith, endsWith, in | | `cardRegion1` | `string` | equals, contains, startsWith, endsWith, in | | `cardRegion2` | `string` | equals, contains, startsWith, endsWith, in | | `cardRegion3` | `string` | equals, contains, startsWith, endsWith, in | | `cardRegion4` | `string` | equals, contains, startsWith, endsWith, in | | `cardRegion5` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deal Tasks Path: `activecampaign.db.dealTasks.search` ```ts theme={null} const rows = await corsair.activecampaign.db.dealTasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `note` | `string` | equals, contains, startsWith, endsWith, in | | `relid` | `string` | equals, contains, startsWith, endsWith, in | | `reltype` | `string` | equals, contains, startsWith, endsWith, in | | `dealtasktype` | `string` | equals, contains, startsWith, endsWith, in | | `duedate` | `string` | equals, contains, startsWith, endsWith, in | | `done` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `owner` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `edate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deal Task Types Path: `activecampaign.db.dealTaskTypes.search` ```ts theme={null} const rows = await corsair.activecampaign.db.dealTaskTypes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `defduration` | `string` | equals, contains, startsWith, endsWith, in | | `display_order` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_utc_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_utc_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Ecom Customers Path: `activecampaign.db.ecomCustomers.search` ```ts theme={null} const rows = await corsair.activecampaign.db.ecomCustomers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `connectionid` | `string` | equals, contains, startsWith, endsWith, in | | `externalid` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `totalRevenue` | `string` | equals, contains, startsWith, endsWith, in | | `totalOrders` | `string` | equals, contains, startsWith, endsWith, in | | `totalProducts` | `string` | equals, contains, startsWith, endsWith, in | | `avgRevenuePerOrder` | `string` | equals, contains, startsWith, endsWith, in | | `avgProductCategory` | `string` | equals, contains, startsWith, endsWith, in | | `acceptsMarketing` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Event Tracking Events Path: `activecampaign.db.eventTrackingEvents.search` ```ts theme={null} const rows = await corsair.activecampaign.db.eventTrackingEvents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Field Options Path: `activecampaign.db.fieldOptions.search` ```ts theme={null} const rows = await corsair.activecampaign.db.fieldOptions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `field` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `string` | equals, contains, startsWith, endsWith, in | | `orderid` | `string` | equals, contains, startsWith, endsWith, in | | `isdefault` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Field Rels Path: `activecampaign.db.fieldRels.search` ```ts theme={null} const rows = await corsair.activecampaign.db.fieldRels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `field` | `string` | equals, contains, startsWith, endsWith, in | | `relid` | `string` | equals, contains, startsWith, endsWith, in | | `dorder` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Fields Path: `activecampaign.db.fields.search` ```ts theme={null} const rows = await corsair.activecampaign.db.fields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `descript` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `perstag` | `string` | equals, contains, startsWith, endsWith, in | | `defval` | `string` | equals, contains, startsWith, endsWith, in | | `isrequired` | `string` | equals, contains, startsWith, endsWith, in | | `show_in_list` | `string` | equals, contains, startsWith, endsWith, in | | `visible` | `string` | equals, contains, startsWith, endsWith, in | | `service` | `string` | equals, contains, startsWith, endsWith, in | | `ordernum` | `string` | equals, contains, startsWith, endsWith, in | | `rows` | `string` | equals, contains, startsWith, endsWith, in | | `cols` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Field Values Path: `activecampaign.db.fieldValues.search` ```ts theme={null} const rows = await corsair.activecampaign.db.fieldValues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `contact` | `string` | equals, contains, startsWith, endsWith, in | | `field` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `string` | equals, contains, startsWith, endsWith, in | | `owner` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Forms Path: `activecampaign.db.forms.search` ```ts theme={null} const rows = await corsair.activecampaign.db.forms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `action` | `string` | equals, contains, startsWith, endsWith, in | | `layout` | `string` | equals, contains, startsWith, endsWith, in | | `style` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Group Limits Path: `activecampaign.db.groupLimits.search` ```ts theme={null} const rows = await corsair.activecampaign.db.groupLimits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `group` | `string` | equals, contains, startsWith, endsWith, in | | `groupid` | `string` | equals, contains, startsWith, endsWith, in | | `limitContact` | `string` | equals, contains, startsWith, endsWith, in | | `limitList` | `string` | equals, contains, startsWith, endsWith, in | | `limitCampaign` | `string` | equals, contains, startsWith, endsWith, in | | `limitCampaignType` | `string` | equals, contains, startsWith, endsWith, in | | `limitMail` | `string` | equals, contains, startsWith, endsWith, in | | `limitMailType` | `string` | equals, contains, startsWith, endsWith, in | | `limitUser` | `string` | equals, contains, startsWith, endsWith, in | | `limitAttachment` | `string` | equals, contains, startsWith, endsWith, in | | `abuseRatio` | `string` | equals, contains, startsWith, endsWith, in | | `forceSenderInfo` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Group Members Path: `activecampaign.db.groupMembers.search` ```ts theme={null} const rows = await corsair.activecampaign.db.groupMembers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Groups Path: `activecampaign.db.groups.search` ```ts theme={null} const rows = await corsair.activecampaign.db.groups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `descript` | `string` | equals, contains, startsWith, endsWith, in | | `p_admin` | `string` | equals, contains, startsWith, endsWith, in | | `sdate` | `string` | equals, contains, startsWith, endsWith, in | | `unsubscribelink` | `string` | equals, contains, startsWith, endsWith, in | | `optinconfirm` | `string` | equals, contains, startsWith, endsWith, in | | `socialdata` | `string` | equals, contains, startsWith, endsWith, in | | `reqApproval` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## List Groups Path: `activecampaign.db.listGroups.search` ```ts theme={null} const rows = await corsair.activecampaign.db.listGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `list` | `string` | equals, contains, startsWith, endsWith, in | | `group` | `string` | equals, contains, startsWith, endsWith, in | | `p_list_add` | `string` | equals, contains, startsWith, endsWith, in | | `p_list_edit` | `string` | equals, contains, startsWith, endsWith, in | | `p_list_delete` | `string` | equals, contains, startsWith, endsWith, in | | `p_list_filter` | `string` | equals, contains, startsWith, endsWith, in | | `p_list_sync` | `string` | equals, contains, startsWith, endsWith, in | | `p_message_add` | `string` | equals, contains, startsWith, endsWith, in | | `p_message_edit` | `string` | equals, contains, startsWith, endsWith, in | | `p_message_delete` | `string` | equals, contains, startsWith, endsWith, in | | `p_message_send` | `string` | equals, contains, startsWith, endsWith, in | | `p_subscriber_add` | `string` | equals, contains, startsWith, endsWith, in | | `p_subscriber_edit` | `string` | equals, contains, startsWith, endsWith, in | | `p_subscriber_delete` | `string` | equals, contains, startsWith, endsWith, in | | `p_subscriber_import` | `string` | equals, contains, startsWith, endsWith, in | | `p_subscriber_approve` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `activecampaign.db.lists.search` ```ts theme={null} const rows = await corsair.activecampaign.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `stringid` | `string` | equals, contains, startsWith, endsWith, in | | `userid` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | | `channel` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `string` | equals, contains, startsWith, endsWith, in | | `deletestamp` | `string` | equals, contains, startsWith, endsWith, in | | `active_subscribers` | `string` | equals, contains, startsWith, endsWith, in | | `non_deleted_subscribers` | `string` | equals, contains, startsWith, endsWith, in | | `subscription_notify` | `string` | equals, contains, startsWith, endsWith, in | | `unsubscription_notify` | `string` | equals, contains, startsWith, endsWith, in | | `require_name` | `string` | equals, contains, startsWith, endsWith, in | | `get_unsubscribe_reason` | `string` | equals, contains, startsWith, endsWith, in | | `to_name` | `string` | equals, contains, startsWith, endsWith, in | | `optinoptout` | `string` | equals, contains, startsWith, endsWith, in | | `optinmessageid` | `string` | equals, contains, startsWith, endsWith, in | | `optoutconf` | `string` | equals, contains, startsWith, endsWith, in | | `carboncopy` | `string` | equals, contains, startsWith, endsWith, in | | `fulladdress` | `string` | equals, contains, startsWith, endsWith, in | | `sender_name` | `string` | equals, contains, startsWith, endsWith, in | | `sender_addr1` | `string` | equals, contains, startsWith, endsWith, in | | `sender_addr2` | `string` | equals, contains, startsWith, endsWith, in | | `sender_city` | `string` | equals, contains, startsWith, endsWith, in | | `sender_state` | `string` | equals, contains, startsWith, endsWith, in | | `sender_zip` | `string` | equals, contains, startsWith, endsWith, in | | `sender_country` | `string` | equals, contains, startsWith, endsWith, in | | `sender_phone` | `string` | equals, contains, startsWith, endsWith, in | | `sender_url` | `string` | equals, contains, startsWith, endsWith, in | | `sender_reminder` | `string` | equals, contains, startsWith, endsWith, in | | `send_last_broadcast` | `string` | equals, contains, startsWith, endsWith, in | | `analytics_domains` | `string` | equals, contains, startsWith, endsWith, in | | `analytics_source` | `string` | equals, contains, startsWith, endsWith, in | | `analytics_ua` | `string` | equals, contains, startsWith, endsWith, in | | `twitter_token` | `string` | equals, contains, startsWith, endsWith, in | | `twitter_token_secret` | `string` | equals, contains, startsWith, endsWith, in | | `facebook_session` | `string` | equals, contains, startsWith, endsWith, in | | `p_use_tracking` | `string` | equals, contains, startsWith, endsWith, in | | `p_use_analytics_read` | `string` | equals, contains, startsWith, endsWith, in | | `p_use_analytics_link` | `string` | equals, contains, startsWith, endsWith, in | | `p_use_twitter` | `string` | equals, contains, startsWith, endsWith, in | | `p_use_facebook` | `string` | equals, contains, startsWith, endsWith, in | | `p_embed_image` | `string` | equals, contains, startsWith, endsWith, in | | `p_use_captcha` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `activecampaign.db.messages.search` ```ts theme={null} const rows = await corsair.activecampaign.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `preheader_text` | `string` | equals, contains, startsWith, endsWith, in | | `fromname` | `string` | equals, contains, startsWith, endsWith, in | | `fromemail` | `string` | equals, contains, startsWith, endsWith, in | | `reply2` | `string` | equals, contains, startsWith, endsWith, in | | `html` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `htmlfetch` | `string` | equals, contains, startsWith, endsWith, in | | `textfetch` | `string` | equals, contains, startsWith, endsWith, in | | `charset` | `string` | equals, contains, startsWith, endsWith, in | | `encoding` | `string` | equals, contains, startsWith, endsWith, in | | `format` | `string` | equals, contains, startsWith, endsWith, in | | `language_code` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `hidden` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `userid` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `mdate` | `string` | equals, contains, startsWith, endsWith, in | | `ed_instanceid` | `string` | equals, contains, startsWith, endsWith, in | | `ed_version` | `string` | equals, contains, startsWith, endsWith, in | | `has_predictive_content` | `string` | equals, contains, startsWith, endsWith, in | | `preview_mime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Notes Path: `activecampaign.db.notes.search` ```ts theme={null} const rows = await corsair.activecampaign.db.notes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `note` | `string` | equals, contains, startsWith, endsWith, in | | `reltype` | `string` | equals, contains, startsWith, endsWith, in | | `relid` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `mdate` | `string` | equals, contains, startsWith, endsWith, in | | `userid` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `is_draft` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Personalizations Path: `activecampaign.db.personalizations.search` ```ts theme={null} const rows = await corsair.activecampaign.db.personalizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `format` | `string` | equals, contains, startsWith, endsWith, in | | `locked` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `udate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Saved Responses Path: `activecampaign.db.savedResponses.search` ```ts theme={null} const rows = await corsair.activecampaign.db.savedResponses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `userid` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `mdate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scores Path: `activecampaign.db.scores.search` ```ts theme={null} const rows = await corsair.activecampaign.db.scores.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `descript` | `string` | equals, contains, startsWith, endsWith, in | | `reltype` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `mdate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Segments Path: `activecampaign.db.segments.search` ```ts theme={null} const rows = await corsair.activecampaign.db.segments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `logic` | `string` | equals, contains, startsWith, endsWith, in | | `hidden` | `string` | equals, contains, startsWith, endsWith, in | | `seriesid` | `string` | equals, contains, startsWith, endsWith, in | | `segmentid_v2` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `activecampaign.db.tags.search` ```ts theme={null} const rows = await corsair.activecampaign.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `tagType` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `subscriber_count` | `string` | equals, contains, startsWith, endsWith, in | | `deleted` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Task Outcomes Path: `activecampaign.db.taskOutcomes.search` ```ts theme={null} const rows = await corsair.activecampaign.db.taskOutcomes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `sentiment` | `string` | equals, contains, startsWith, endsWith, in | | `disabled` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `created_utc_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `updated_utc_timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `activecampaign.db.templates.search` ```ts theme={null} const rows = await corsair.activecampaign.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `categoryid` | `string` | equals, contains, startsWith, endsWith, in | | `userid` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `mdate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `activecampaign.db.users.search` ```ts theme={null} const rows = await corsair.activecampaign.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `signature` | `string` | equals, contains, startsWith, endsWith, in | | `lang` | `string` | equals, contains, startsWith, endsWith, in | | `localZoneid` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `activecampaign.db.webhooks.search` ```ts theme={null} const rows = await corsair.activecampaign.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `listid` | `string` | equals, contains, startsWith, endsWith, in | | `cdate` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `deactivated_date` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/activecampaign/overview Marketing automation platform for email campaigns, CRM, and customer journey workflows. Use **ActiveCampaign** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 304 typed API operations * 43 synced entities (`accountContacts`, `accountCustomFieldMeta`, `accounts`, `addresses`, `automations`, `brandings`, and 37 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/activecampaign ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/activecampaign ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/activecampaign ``` ```bash bun theme={null} bun add corsair @corsair-dev/activecampaign ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { activecampaign } from '@corsair-dev/activecampaign'; export const corsair = createCorsair({ plugins: [ activecampaign(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} activecampaign() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'activecampaign', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accountContacts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.activecampaign.api.accountContacts.get({}); ``` **`accountContacts.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.activecampaign.api.accountContacts.create({}); ``` See the full list on the [API](/plugins/activecampaign/api) page. ## Query synced data Synced entities support `tenant.activecampaign.db..search()` and `.list()`: `accountContacts`, `accountCustomFieldMeta`, `accounts`, `addresses`, `automations`, `brandings`, `calendars`, `campaigns`, `connections`, `contactLists`, `contacts`, `contactTags`, `customObjectSchemas`, `dealCustomFieldMeta`, `dealGroups`, `dealRoles`, `deals`, `dealStages`, `dealTasks`, `dealTaskTypes`, `ecomCustomers`, `eventTrackingEvents`, `fieldOptions`, `fieldRels`, `fields`, `fieldValues`, `forms`, `groupLimits`, `groupMembers`, `groups`, `listGroups`, `lists`, `messages`, `notes`, `personalizations`, `savedResponses`, `scores`, `segments`, `tags`, `taskOutcomes`, `templates`, `users`, `webhooks`. See [Database](/plugins/activecampaign/database) for filters and operators. ## What's next > **[API reference](/plugins/activecampaign/api)** > > Every `activecampaign.api.*` operation with input and output types. > **[Database](/plugins/activecampaign/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/activetrail/api API reference for ActiveTrail: every `activetrail.api.*` operation with input and output types. Every `activetrail.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### contactGrowth `account.contactGrowth` Retrieves daily contact growth statistics showing active (subscribed) and inactive (unsubscribed) contact counts over a specified date range. Use this to analyze contact acquisition trends and measure the growth of your subscriber base over time. Returns time-series data with daily breakdowns. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.account.contactGrowth({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createContentCategory `account.createContentCategory` Tool to create a new content category in ActiveTrail account. Use when you need to add a new category for organizing campaigns and templates. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.account.createContentCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `is_default` | `boolean` | No | — | | `display_order` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteAccountContentCategories `account.deleteAccountContentCategories` Tool to delete a specific content category by ID. Use when you need to remove a category from your ActiveTrail account. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.account.deleteAccountContentCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAccountBalance `account.getAccountBalance` Tool to retrieve email and SMS credit balance for the account. Use when you need to check available email and SMS credits. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.account.getAccountBalance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAccountContentCategories2 `account.getAccountContentCategories2` Tool to retrieve specific category details by ID. Use when you need to get information about a content category from your ActiveTrail account. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.account.getAccountContentCategories2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAccountIntegrationdata `account.getAccountIntegrationdata` Retrieves the account's ActiveCommerce integration configuration data including mailing list and group associations. This endpoint returns the integration settings that connect ActiveTrail with ActiveCommerce, showing which mailing list and group are configured for the integration. Use this when you need to verify ActiveCommerce integration setup or troubleshoot integration issues. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.account.getAccountIntegrationdata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAccountMerge `account.getAccountMerge` Check if the ActiveTrail account has any pending account merge operations. This action retrieves the current account merge status, indicating whether there are any account merges awaiting completion. Account merges are typically used when consolidating multiple ActiveTrail accounts into one. Returns information about pending merges including their status, source and target accounts, and creation dates. Use this when you need to: - Verify if any account merge operations are in progress - Monitor the status of account consolidation processes - Check for pending administrative merge tasks #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.account.getAccountMerge({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactFields `account.getContactFields` Tool to retrieve account contact fields filtered by type. Use when you need to get contact field definitions from the ActiveTrail account. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.account.getContactFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fields_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContentCategories `account.getContentCategories` Tool to retrieve all content categories from the ActiveTrail account. Use when you need to get the list of categories used for organizing campaigns and templates. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.account.getContentCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getExecutiveReport `account.getExecutiveReport` Retrieve executive performance report for the ActiveTrail account, providing email marketing metrics over the past 12 months. Returns monthly statistics including emails sent, bounce rates, open rates, click rates, click-to-open rates, complaint rates, and unsubscribe rates for both marketing campaigns and transactional emails. Use this to analyze overall account performance trends and generate summary statistics. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.account.getExecutiveReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTwoWaySmsReplies `account.getTwoWaySmsReplies` Tool to retrieve virtual number SMS replies with filtering options. Use when you need to fetch two-way SMS responses for campaigns with optional filtering by search term, campaign ID, or date range. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.account.getTwoWaySmsReplies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `campaign_id` | `number` | No | — | | `search_term` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### putAccountContentCategories `account.putAccountContentCategories` Tool to update a specific content category by ID. Use when you need to modify the name or display order of a category in your ActiveTrail account. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.account.putAccountContentCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `display_order` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Automations ### deleteAutomations `automations.deleteAutomations` Tool to delete one or more automations from Active Trail. Use when you need to remove automations by their IDs. Supports bulk deletion by providing comma-separated IDs. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.automations.deleteAutomations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAutomationLog `automations.getAutomationLog` Tool to track contacts through automation journey by retrieving detailed logs. Use when you need to see which contacts started a specific automation and their progress through each step of the workflow. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.automations.getAutomationLog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAutomationReportsLogAutomationQueue `automations.getAutomationReportsLogAutomationQueue` Tool to retrieve contacts that did not finish a specific automation. Use when you need to get the list of contacts remaining in the automation queue for a given automation ID. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.automations.getAutomationReportsLogAutomationQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAutomations `automations.getAutomations` Tool to list account automations with filtering and pagination. Use when you need to retrieve automations from the ActiveTrail account. Supports filtering by state and pagination parameters. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.automations.getAutomations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `state_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAutomationsDetails `automations.getAutomationsDetails` Tool to retrieve detailed configuration of a specific automation excluding step-by-step execution details. Use when you need metadata about automation behavior, scheduling, reporting settings, and operational constraints. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.automations.getAutomationsDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAutomationsEmailCampaignSteps `automations.getAutomationsEmailCampaignSteps` Tool to retrieve all email campaign steps in an automation workflow. Use when you need to get details about all 'send email' steps configured within a specific automation, including email content, scheduling, and tracking settings. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.automations.getAutomationsEmailCampaignSteps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAutomationsSmsCampaignSteps `automations.getAutomationsSmsCampaignSteps` Tool to retrieve all SMS campaign steps in an automation workflow. Use when you need to get details about all 'send SMS' steps configured within a specific automation, including SMS content, scheduling, and tracking settings. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.automations.getAutomationsSmsCampaignSteps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAutomationTriggerTypes `automations.getAutomationTriggerTypes` Tool to retrieve all available start trigger options for automations. Use when you need to get the list of trigger types that can initiate automation workflows in ActiveTrail. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.automations.getAutomationTriggerTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getUpdateActions `automations.getUpdateActions` Retrieves all available update action types that can be applied to contacts within automation workflows. Each action type includes its ID, name, description, type category, and required parameters. Use this to discover what contact update operations are available when building or modifying automation workflows (e.g., updating contact fields, changing status, adding tags, etc.). #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.automations.getUpdateActions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Campaign Reports ### getAllCampaignReports `campaignReports.getAllCampaignReports` Tool to retrieve a full overview of all campaign reports with comprehensive metrics. Use when you need to get reports for all campaigns including send date, opened emails, number of clicks, CTO, bounces, unsubscribers, complaints, unopened and sent emails. Default behavior: Returns campaigns filtered by last update date within the previous 3 months when date parameters are not specified. Default limit is 20 records per page, maximum is 100. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaignReports.getAllCampaignReports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAllSentCampaigns `campaignReports.getAllSentCampaigns` Tool to retrieve campaigns with optional filtering by date, mailing list, and search criteria. Use when you need to get campaigns filtered by date range (default is last 3 months), limited to a specific number (default is 100), or filtered by mailing list. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaignReports.getAllSentCampaigns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `mailing_list_id` | `string` | No | — | | `content_category_id` | `string` | No | — | | `groupid` | `string \| number` | No | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignBounces `campaignReports.getCampaignBounces` Tool to retrieve bounce details by domain for a specific campaign. Use when you need to analyze campaign bounce rates and identify problematic email domains. Defaults to campaigns updated in the last 3 months. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaignReports.getCampaignBounces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `bounce_type` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignReportsBounced `campaignReports.getCampaignReportsBounced` Tool to retrieve bounced email details filtered by bounce type for a specific campaign. Use when you need detailed information about which contacts' emails bounced and why, with the ability to filter by hard or soft bounces. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaignReports.getCampaignReportsBounced({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `bounce_type` | `any` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignReportsComplaints `campaignReports.getCampaignReportsComplaints` Tool to retrieve contacts who reported a specific campaign as spam. Use when you need to identify which contacts flagged your campaign as unwanted. The default search window is the last 3 months; if the campaign wasn't sent during the specified dates, an empty list is returned. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaignReports.getCampaignReportsComplaints({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `groupid` | `string` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignReportsSent `campaignReports.getCampaignReportsSent` Tool to retrieve contacts who received a specific campaign email. Use when you need to identify which recipients successfully received your campaign. The default search window is the last 3 months; if the campaign wasn't sent during the specified dates, an empty list is returned. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaignReports.getCampaignReportsSent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `groupid` | `string` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignReportsUnopened `campaignReports.getCampaignReportsUnopened` Tool to retrieve contacts who did not open a specific campaign. Use when you need to identify which recipients received but did not open your campaign email. The default search window is the last 3 months; if the campaign wasn't sent during the specified dates, an empty list is returned. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaignReports.getCampaignReportsUnopened({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `groupid` | `string` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignUnsubscribed `campaignReports.getCampaignUnsubscribed` Retrieves the list of contacts who unsubscribed from a specific email campaign. Use this action when you need to: - Identify which recipients opted out of receiving future communications from a campaign - Analyze unsubscribe patterns and reasons for a particular campaign - Track campaign unsubscribe metrics and contact details By default, searches campaigns updated within the last 3 months. If the campaign wasn't sent within the specified date range, an empty list is returned. Supports pagination for large unsubscribe lists. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaignReports.getCampaignUnsubscribed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPushCampaignReports `campaignReports.getPushCampaignReports` Retrieves push notification campaign performance metrics and reports filtered by date range, send type, or search term. Returns analytics including sent count, delivered count, opened count, clicked count, open rate, click rate, and delivery status for each campaign. Default behavior: Returns the last 20 campaigns from the last 3 months when no parameters are specified. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaignReports.getPushCampaignReports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Campaigns ### createCampaign `campaigns.createCampaign` Create and return a new email campaign for specific groups. The campaign can be configured as an A/B split test, E-commerce campaign, or a regular campaign. Created in draft status unless is\_sent is set to true. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.campaigns.createCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `carts` | `object` | No | — | | `pairs` | `any[]` | No | — | | `design` | `object` | Yes | — | | `details` | `object` | Yes | — | | `segment` | `object` | No | — | | `template` | `object` | No | — | | `send_test` | `string` | No | — | | `scheduling` | `object` | Yes | — | | `a_b_settings` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **carts full type** > > ```ts theme={null} > { > } > ``` > **design full type** > > ```ts theme={null} > { > } > ``` > **details full type** > > ```ts theme={null} > { > } > ``` > **segment full type** > > ```ts theme={null} > { > } > ``` > **template full type** > > ```ts theme={null} > { > } > ``` > **scheduling full type** > > ```ts theme={null} > { > } > ``` > **a\_b\_settings full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createCampaignForContacts `campaigns.createCampaignForContacts` Tool to create and send a new campaign to specific contacts in ActiveTrail. Use when you need to create campaigns targeted at selected recipients by contact IDs or email addresses. Supports regular campaigns, A/B split campaigns, and e-commerce campaigns. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.campaigns.createCampaignForContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign` | `object` | Yes | — | | `campaign_contacts` | `object` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **campaign full type** > > ```ts theme={null} > { > } > ``` > **campaign\_contacts full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteCampaign `campaigns.deleteCampaign` Tool to remove a campaign from ActiveTrail account. Use when you need to delete a campaign that is no longer needed. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.campaigns.deleteCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignDesign `campaigns.getCampaignDesign` Tool to retrieve campaign design configuration including visual layout and HTML content. Use when you need to get the design details of a specific email campaign. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaigns.getCampaignDesign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignScheduling `campaigns.getCampaignScheduling` Retrieves the scheduling configuration for a specific email campaign, including send status and scheduled datetime. Use this action when you need to check if a campaign is scheduled to send, when it's scheduled to send (in UTC), or verify the send status of a campaign. The response includes is\_sent flag (whether campaign is dispatched) and scheduled\_date\_utc (planned send datetime). Campaign ID can be obtained from campaign list actions. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaigns.getCampaignScheduling({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignsDetails `campaigns.getCampaignsDetails` Tool to retrieve detailed campaign information including name, subject, and settings. Use when you need to get comprehensive details about a specific email campaign. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaigns.getCampaignsDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignsSegment `campaigns.getCampaignsSegment` Tool to retrieve campaign sending settings including target groups and sending restrictions. Use when you need to get the segmentation configuration for a specific campaign. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaigns.getCampaignsSegment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignsSentCampaigns `campaigns.getCampaignsSentCampaigns` Tool to retrieve a list of all sent campaigns from ActiveTrail. Use when you need to view all campaigns that have been sent, including their details such as name, subject, send status, and delivery metrics. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaigns.getCampaignsSentCampaigns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignTemplate `campaigns.getCampaignTemplate` Retrieves template details (design, content, subject line, sender info) for a specific email campaign. Use this action when you need to: - View the template configuration used in a campaign - Get HTML/plain text content of a campaign template - Retrieve sender information (from name, from email, reply-to) - Access template metadata like category, creation/modification dates Note: Requires a valid campaign ID which can be obtained from the 'Get Sent Campaigns' action. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaigns.getCampaignTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPushCampaigns `campaigns.getPushCampaigns` Tool to retrieve push notification campaigns with optional filtering by date, campaign ID, and search criteria. Use when you need to get push campaigns filtered by date range (default is last 6 months and last 20 campaigns), or filtered by specific campaign ID or search term. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaigns.getPushCampaigns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `page_size` | `number` | No | — | | `campaign_id` | `string` | No | — | | `filter_type` | `string` | No | — | | `page_number` | `number` | No | — | | `search_term` | `string` | No | — | | `include_deleted` | `boolean` | No | — | | `include_not_sent` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTemplate `campaigns.getTemplate` Tool to retrieve detailed information about a specific template from the account's saved templates. Use when you need to fetch template details including name, subject, content, category, and encoding settings. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaigns.getTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listSmsCampaigns `campaigns.listSmsCampaigns` Tool to retrieve SMS campaigns with optional filtering by date, search term, and type. Use when you need to get SMS campaigns filtered by date range (default is last 3 months) or other criteria. Returns up to 20 campaigns per page by default. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.campaigns.listSmsCampaigns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `filter_type` | `string` | No | — | | `search_term` | `string` | No | — | | `is_include_not_sent` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### putCampaignsSegment `campaigns.putCampaignsSegment` Tool to update campaign sending settings including groups and sending restrictions. Use when you need to modify which groups receive a campaign. Note: Only campaigns in draft mode can be updated. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.campaigns.putCampaignsSegment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `group_ids` | `any[]` | Yes | — | | `restricted_group_ids` | `any[]` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateCampaignDesign `campaigns.updateCampaignDesign` Tool to update the design and HTML content of an email campaign in ActiveTrail. Use when you need to modify a campaign's visual layout, HTML content, or encoding settings. Important: Only campaigns in draft mode can be updated through this endpoint. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.campaigns.updateCampaignDesign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `content` | `string` | Yes | — | | `language_type` | `string` | No | — | | `is_add_print_email` | `boolean` | No | — | | `is_auto_css_inliner` | `boolean` | No | — | | `is_remove_system_links` | `boolean` | No | — | | `header_footer_language_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateCampaignScheduling `campaigns.updateCampaignScheduling` Tool to configure send schedule for draft campaigns. Use when you need to update the scheduling configuration of a campaign. Only campaigns in draft mode can be updated. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.campaigns.updateCampaignScheduling({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `is_sent` | `boolean` | Yes | — | | `scheduled_date_utc` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateCampaignSDetails `campaigns.updateCampaignSDetails` Updates an email campaign's core details including name, subject line, sender profile, category, and delivery settings. Important: Only campaigns in DRAFT status can be updated. Attempting to update sent or scheduled campaigns will fail. Use 'Get Campaign by ID' first to verify the campaign is in draft mode before updating. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.campaigns.updateCampaignSDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `subject` | `string` | Yes | — | | `preheader` | `string` | No | — | | `user_profile_id` | `number` | Yes | — | | `content_category_id` | `number` | Yes | — | | `predictive_delivery` | `boolean` | Yes | — | | `google_analytics_name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateCampaignTemplate `campaigns.updateCampaignTemplate` Tool to update the template associated with an email campaign in ActiveTrail. Use when you need to assign or change a template for a campaign. Important: Only campaigns in draft mode can be updated through this endpoint. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.campaigns.updateCampaignTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `number` | Yes | — | | `template_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Commerce ### createOrder `commerce.createOrder` Tool to create new orders in ActiveTrail commerce system. Use when you need to add order records with customer information, products, and transaction details. Accepts an array of order objects for batch creation. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.commerce.createOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orders` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCommerceSchema `commerce.getCommerceSchema` Tool to retrieve order fields schema information from the ActiveTrail commerce API. Use when you need to get information about available order fields, their types, and custom names for commerce/order management. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.commerce.getCommerceSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrder `commerce.getOrder` Tool to retrieve complete details of a specific order from ActiveTrail commerce system. Use when you need to fetch order information including customer details, financial data, products, and shipping information. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.commerce.getOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateOrder `commerce.updateOrder` Updates an existing order in the ActiveTrail commerce system. Use this action to modify order details including customer information (name, email, phone), shipping address, order status, pricing (amounts, tax, currency), or product items. You must provide the existing order\_id - this action cannot create new orders. Common use cases: - Update order status (e.g., from "pending" to "shipped") - Modify customer contact information - Adjust pricing or add/remove items - Update shipping addresses - Change order metadata (dates, custom fields) **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.commerce.updateOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tax` | `number` | No | — | | `city` | `string` | No | — | | `email` | `string` | No | — | | `items` | `any[]` | No | — | | `mobile` | `string` | No | — | | `status` | `string` | No | — | | `address` | `string` | No | — | | `orderId` | `string` | No | — | | `currency` | `string` | No | — | | `lastName` | `string` | No | — | | `order_id` | `string` | Yes | — | | `firstName` | `string` | No | — | | `netAmount` | `number` | No | — | | `orderName` | `string` | No | — | | `totalPrice` | `number` | No | — | | `totalAmount` | `number` | No | — | | `purchaseDate` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Contacts ### createContact `contacts.createContact` Creates a new contact in ActiveTrail with the provided information. At least one of email or sms must be provided as the primary identifier. All other fields are optional and can be used to enrich the contact profile. Important: Newly created contacts are not automatically assigned to any group. To enable email/SMS campaigns for this contact, you must add them to a group using a separate action after creation. Returns the complete contact record including the assigned contact ID. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.contacts.createContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fax` | `string` | No | — | | `sms` | `string` | No | — | | `city` | `string` | No | — | | `ext1` | `string` | No | — | | `ext2` | `string` | No | — | | `ext3` | `string` | No | — | | `ext4` | `string` | No | — | | `ext5` | `string` | No | — | | `ext6` | `string` | No | — | | `ext7` | `string` | No | — | | `ext8` | `string` | No | — | | `ext9` | `string` | No | — | | `num1` | `number` | No | — | | `num2` | `number` | No | — | | `num3` | `number` | No | — | | `num4` | `number` | No | — | | `num5` | `number` | No | — | | `date1` | `string` | No | — | | `date2` | `string` | No | — | | `date3` | `string` | No | — | | `date4` | `string` | No | — | | `date5` | `string` | No | — | | `email` | `string` | No | — | | `ext10` | `string` | No | — | | `ext11` | `string` | No | — | | `ext12` | `string` | No | — | | `ext13` | `string` | No | — | | `ext14` | `string` | No | — | | `ext15` | `string` | No | — | | `ext16` | `string` | No | — | | `ext17` | `string` | No | — | | `ext18` | `string` | No | — | | `ext19` | `string` | No | — | | `ext20` | `string` | No | — | | `ext21` | `string` | No | — | | `ext22` | `string` | No | — | | `ext23` | `string` | No | — | | `ext24` | `string` | No | — | | `ext25` | `string` | No | — | | `phone1` | `string` | No | — | | `phone2` | `string` | No | — | | `street` | `string` | No | — | | `birthday` | `string` | No | — | | `zip_code` | `string` | No | — | | `last_name` | `string` | No | — | | `first_name` | `string` | No | — | | `anniversary` | `string` | No | — | | `subscribe_ip` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteContact `contacts.deleteContact` Tool to permanently remove a contact from the ActiveTrail account by their unique contact ID. Use when you need to delete a specific contact. This operation is destructive and cannot be undone. Returns success status and optional message. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.contacts.deleteContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignReportsEmailActivity `contacts.getCampaignReportsEmailActivity` Tool to retrieve all contacts' activity on a specific campaign. Use when you need comprehensive activity data including opens, clicks, bounces, and other engagement metrics for each contact in a campaign. By default, the search covers campaigns updated in the last 3 months; if the campaign wasn't sent in the specified date range, an error will be returned. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getCampaignReportsEmailActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactActivity `contacts.getContactActivity` Tool to retrieve contact's email engagement history including opens and clicks. Use when you need detailed activity data showing which campaigns were sent to a contact and their engagement metrics. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactDetails `contacts.getContactDetails` Tool to retrieve complete details of a specific contact by their ID. Use when you need full contact information including personal data, contact fields, subscription status, and all custom extended fields. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactGroups `contacts.getContactGroups` Tool to retrieve all groups associated with a specific contact. Returns group details including group ID, name, member counts, and creation dates. Use when you need to list a contact's group memberships by contact ID. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactList `contacts.getContactList` Tool to retrieve account contacts filtered by status and date range. Use when you need to get a list of contacts filtered by customer status (active, unsubscribed, bounced, etc.) or by registration date. Default behavior: retrieves contacts modified within the last three months with a limit of 100 contacts per page. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `search_term` | `string` | No | — | | `customer_states` | `string` | No | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsErrors `contacts.getContactsErrors` Tool to retrieve bounce and error history for a specific contact. Use when you need to understand delivery issues or bounce patterns for a contact's email address. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsErrors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsMailinglists `contacts.getContactsMailinglists` Tool to retrieve all mailing lists associated with a specific contact. Use when you need to list a contact's mailing list memberships by contact ID. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsMailinglists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsMerges `contacts.getContactsMerges` Tool to retrieve contacts experiencing merge conflicts with filtering options. Use when you need to get the list of contacts with merge conflicts, filtered by status, date range, or limited to a specific number of conflicts. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsMerges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `state_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactSmsStatistics `contacts.getContactSmsStatistics` Tool to retrieve contact interaction statistics for a specific transactional SMS. Use when you need to see how a contact interacted with a transactional/operational SMS including delivery status, bounce information, and unsubscribe actions. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactSmsStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `number` | Yes | — | | `message_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsStatisticsCampaign `contacts.getContactsStatisticsCampaign` Tool to retrieve contact's interaction statistics for a specific campaign. Use when you need to see how a specific contact engaged with a campaign including opens, clicks, bounces, unsubscribes, and spam complaints. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsStatisticsCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `campaign_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsSubscriptionAllContacts `contacts.getContactsSubscriptionAllContacts` Tool to get contacts' subscription status and the source of their status (if known). Use when you need to retrieve all contacts with their subscription status information filtered by creation date. Defaults to three months back if date range is not specified. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsSubscriptionAllContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsSubscriptionCustomersStatus `contacts.getContactsSubscriptionCustomersStatus` Get daily breakdown of contact status statistics over a date range. Returns counts of active, unsubscribed, bounced, quarantined, spam complaints, inactive, and user-requested removal contacts for each day in the specified period. Defaults to recent days when no date range is provided. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsSubscriptionCustomersStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `page` | `string \| number` | No | — | | `limit` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsSubscriptionSubscribers `contacts.getContactsSubscriptionSubscribers` Tool to retrieve all contacts who subscribed and the source of their subscription status. Use when you need to get a comprehensive list of subscribers. The search defaults to 3 months back if date range is not specified. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsSubscriptionSubscribers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsSubscriptionUnsubscribers `contacts.getContactsSubscriptionUnsubscribers` Tool to retrieve all contacts who unsubscribed and the source of their unsubscription status. Use when you need to get a comprehensive list of unsubscribers. The search defaults to 3 months back if date range is not specified. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsSubscriptionUnsubscribers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsUnsubscribersSms `contacts.getContactsUnsubscribersSms` Tool to retrieve all contacts who unsubscribed from receiving SMS messages. Use when you need to get a list of SMS unsubscribers with optional filtering by date range and pagination support. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsUnsubscribersSms({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getContactsWithSmsState `contacts.getContactsWithSmsState` Tool to retrieve account's contacts list with SMS subscription state. Use when you need to get contacts filtered by customer status (active, unsubscribed, bounced, etc.) and by state change date range, with default filtering to three months back. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getContactsWithSmsState({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `search_term` | `string` | No | — | | `customer_states` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCustomerStatsForTransactionalMessage `contacts.getCustomerStatsForTransactionalMessage` Tool to retrieve customer interaction statistics for a specific transactional message. Use when you need to see how a contact engaged with a transactional/operational message including delivery status, opens, clicks, and other interaction metrics. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.getCustomerStatsForTransactionalMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `number` | Yes | — | | `transactional_id` | `number` | Yes | — | | `message_id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### importNewContacts `contacts.importNewContacts` Tool to import new contacts into a group in ActiveTrail. Use when you need to bulk import contacts with customer information (limited to 1000 contacts per call). Returns success count and any errors for failed contact imports. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.contacts.importNewContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group` | `number` | Yes | — | | `contacts` | `any[]` | Yes | — | | `mailing_list` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listTransactionalSmsMessages `contacts.listTransactionalSmsMessages` Tool to retrieve all SMS transactional messages with pagination support. Use when you need to fetch the list of operational SMS campaigns configured in the account. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.contacts.listTransactionalSmsMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## External ### createSmsOperationalMessage `external.createSmsOperationalMessage` Tool to create a new operational SMS transactional message. Use when you need to create an SMS campaign for later use or editing. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.external.createSmsOperationalMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `from_name` | `string` | Yes | — | | `can_unsubscribe` | `boolean` | No | — | | `unsubscribe_text` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteMailingList `external.deleteMailingList` Tool to permanently remove a mailing list from the ActiveTrail account by its unique ID. Use when you need to delete a mailing list that is no longer needed. This operation is destructive and cannot be undone. Returns success status and confirmation message. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.external.deleteMailingList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getExternalSchema `external.getExternalSchema` Tool to retrieve contact field schema information for the account. Use when you need to get the structure and metadata of all available contact fields. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.external.getExternalSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSendingProfiles `external.getSendingProfiles` Tool to retrieve account email sending profiles. Use when you need to get sending profile configurations including sender names, email addresses, and reply-to settings. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.external.getSendingProfiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsSendingProfiles `external.getSmsSendingProfiles` Tool to retrieve SMS sending profiles configured for the account. Use when you need to get SMS sender profile configurations including sender names and phone numbers. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.external.getSmsSendingProfiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### removeExternalContactFromGroup `external.removeExternalContactFromGroup` Tool to remove contacts from a group via external ID. Use when you need to delete external contacts from a specific group in ActiveTrail. Limited to 1000 contacts per call. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.external.removeExternalContactFromGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | | `external_contacts` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### sendOperationalMessage `external.sendOperationalMessage` Create and send a new operational message via the external API (limited to 500 messages per request). Recipients will be created as contacts if they don't already exist. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.external.sendOperationalMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bcc` | `object` | No | — | | `design` | `object` | Yes | — | | `details` | `object` | Yes | — | | `email_package` | `any[]` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **bcc full type** > > ```ts theme={null} > { > } > ``` > **design full type** > > ```ts theme={null} > { > } > ``` > **details full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### sendOperationalMessageEmail `external.sendOperationalMessageEmail` Send an email operational message to individual emails (limited to 500). Supports dynamic text replacement via email\_package key-value pairs. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.external.sendOperationalMessageEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bcc` | `object` | No | — | | `design` | `object` | Yes | — | | `details` | `object` | Yes | — | | `email_package` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **bcc full type** > > ```ts theme={null} > { > } > ``` > **design full type** > > ```ts theme={null} > { > } > ``` > **details full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateContact `external.updateContact` Tool to update an existing contact's information by ID. Use when you need to modify contact details such as name, email, phone, address, or custom fields. Only the fields you include in the request will be updated; other fields remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.external.updateContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `fax` | `string` | No | — | | `sms` | `string` | No | — | | `city` | `string` | No | — | | `ext1` | `string` | No | — | | `ext2` | `string` | No | — | | `ext3` | `string` | No | — | | `ext4` | `string` | No | — | | `ext5` | `string` | No | — | | `ext6` | `string` | No | — | | `ext7` | `string` | No | — | | `ext8` | `string` | No | — | | `ext9` | `string` | No | — | | `num1` | `number` | No | — | | `num2` | `number` | No | — | | `num3` | `number` | No | — | | `num4` | `number` | No | — | | `num5` | `number` | No | — | | `date1` | `string` | No | — | | `date2` | `string` | No | — | | `date3` | `string` | No | — | | `date4` | `string` | No | — | | `date5` | `string` | No | — | | `email` | `string` | No | — | | `ext10` | `string` | No | — | | `ext11` | `string` | No | — | | `ext12` | `string` | No | — | | `ext13` | `string` | No | — | | `ext14` | `string` | No | — | | `ext15` | `string` | No | — | | `ext16` | `string` | No | — | | `ext17` | `string` | No | — | | `ext18` | `string` | No | — | | `ext19` | `string` | No | — | | `ext20` | `string` | No | — | | `ext21` | `string` | No | — | | `ext22` | `string` | No | — | | `ext23` | `string` | No | — | | `ext24` | `string` | No | — | | `ext25` | `string` | No | — | | `phone1` | `string` | No | — | | `phone2` | `string` | No | — | | `status` | `string` | No | — | | `street` | `string` | No | — | | `birthday` | `string` | No | — | | `zip_code` | `string` | No | — | | `last_name` | `string` | No | — | | `first_name` | `string` | No | — | | `is_deleted` | `boolean` | No | — | | `sms_status` | `string` | No | — | | `anniversary` | `string` | No | — | | `subscribe_ip` | `string` | No | — | | `double_opt_in_config` | `object` | No | — | | `external_name` | `string \| number` | No | — | | `external_id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **double\_opt\_in\_config full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Groups ### addGroupMember `groups.addGroupMember` Tool to add a member to a group in ActiveTrail. Creates a new contact or adds an existing contact to the specified group. Supports comprehensive contact information including names, phone numbers, addresses, dates, and custom extension fields. The API will not return errors if the contact is already in the group (idempotent operation). **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.groups.addGroupMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fax` | `string` | No | — | | `city` | `string` | No | — | | `ext1` | `string` | No | — | | `ext2` | `string` | No | — | | `ext3` | `string` | No | — | | `ext4` | `string` | No | — | | `ext5` | `string` | No | — | | `ext6` | `string` | No | — | | `email` | `string` | Yes | — | | `phone1` | `string` | No | — | | `phone2` | `string` | No | — | | `status` | `string` | No | — | | `street` | `string` | No | — | | `birthday` | `string` | No | — | | `group_id` | `number` | Yes | — | | `zip_code` | `string` | No | — | | `last_name` | `string` | No | — | | `first_name` | `string` | No | — | | `anniversary` | `string` | No | — | | `campaign_id` | `number` | No | — | | `encryptedext1` | `string` | No | — | | `encryptedext2` | `string` | No | — | | `encryptedext3` | `string` | No | — | | `encryptedext4` | `string` | No | — | | `is_do_not_mail` | `boolean` | No | — | | `is_trigger_events` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createANewGroup `groups.createANewGroup` Creates a new contact group in ActiveTrail for organizing and segmenting contacts. Groups are containers for contacts that allow you to: - Organize contacts by category, campaign, or segment - Target specific groups for email/SMS campaigns - Manage contact memberships independently The newly created group will be empty. Use the "Add Group Member" action to add contacts to this group. Returns the complete group details including the assigned group ID. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.groups.createANewGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteAMemberInAGroup `groups.deleteAMemberInAGroup` Tool to delete a group member by ID. Use when you need to remove a contact from a specific group in ActiveTrail. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.groups.deleteAMemberInAGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number` | Yes | — | | `contact_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteGroupById `groups.deleteGroupById` Tool to delete a group by ID. Use when you need to permanently remove a group from ActiveTrail. This is a destructive operation that cannot be undone. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.groups.deleteGroupById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAllGroups `groups.getAllGroups` Tool to retrieve the full list of account groups with pagination and filtering. Use when you need to get all groups or search for groups by name. Default limit is 100 groups per page. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.groups.getAllGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `search_term` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getGroup `groups.getGroup` Tool to retrieve detailed information about a specific group by its unique identifier. Use when you need to fetch group details including name, contact counters, and timestamps. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.groups.getGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getGroupContentsById `groups.getGroupContentsById` Tool to retrieve all group members by group ID with pagination and filtering. Use when you need to get complete information about contacts in a specific group. Returns up to 100 contacts per page with optional filtering by status and date range. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.groups.getGroupContentsById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `group_id` | `number` | Yes | — | | `from_date` | `string` | No | — | | `search_term` | `string` | No | — | | `customer_states` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getGroupsEvents `groups.getGroupsEvents` Tool to retrieve all events for a specific group with optional filtering by event type, event date, and subscriber creation date. Use when you need to analyze group engagement metrics like opens, clicks, and unsubscribes. Default date range is 3 months back if not specified. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.groups.getGroupsEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `event_type` | `string` | No | — | | `event_to_date` | `string` | No | — | | `created_to_date` | `string` | No | — | | `event_from_date` | `string` | No | — | | `created_from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateGroup `groups.updateGroup` Updates an existing group in ActiveTrail by its ID. Primary use case: Rename a group by updating its name field. Important notes: - Only the 'name' field is reliably updateable via this endpoint - The API typically returns HTTP 204 (No Content) on success - Group must exist or will return 404 error Use 'Get All Groups' or 'Get Group by ID' actions to find the group ID first. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.groups.updateGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Landingpage ### getLandingPages `landingpage.getLandingPages` Tool to retrieve landing pages from the ActiveTrail account with pagination support. Use when you need to get all landing pages or fetch paginated results. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.landingpage.getLandingPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Mailing List ### addMailinglistMember `mailingList.addMailinglistMember` Tool to add a member to a mailing list in ActiveTrail. Creates a new contact or adds an existing contact to the specified mailing list and groups. Either email or SMS must be provided. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.mailingList.addMailinglistMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fax` | `string` | No | — | | `sms` | `string` | No | — | | `city` | `string` | No | — | | `ext1` | `string` | No | — | | `ext2` | `string` | No | — | | `ext3` | `string` | No | — | | `ext4` | `string` | No | — | | `ext5` | `string` | No | — | | `ext6` | `string` | No | — | | `ext7` | `string` | No | — | | `ext8` | `string` | No | — | | `ext9` | `string` | No | — | | `num1` | `string` | No | — | | `num2` | `string` | No | — | | `num3` | `string` | No | — | | `num4` | `string` | No | — | | `num5` | `string` | No | — | | `date1` | `string` | No | — | | `date2` | `string` | No | — | | `date3` | `string` | No | — | | `date4` | `string` | No | — | | `date5` | `string` | No | — | | `email` | `string` | No | — | | `ext10` | `string` | No | — | | `ext11` | `string` | No | — | | `ext12` | `string` | No | — | | `ext13` | `string` | No | — | | `ext14` | `string` | No | — | | `ext15` | `string` | No | — | | `ext16` | `string` | No | — | | `ext17` | `string` | No | — | | `ext18` | `string` | No | — | | `ext19` | `string` | No | — | | `ext20` | `string` | No | — | | `ext21` | `string` | No | — | | `ext22` | `string` | No | — | | `ext23` | `string` | No | — | | `ext24` | `string` | No | — | | `ext25` | `string` | No | — | | `phone1` | `string` | No | — | | `phone2` | `string` | No | — | | `status` | `string` | No | — | | `street` | `string` | No | — | | `birthday` | `string` | No | — | | `zip_code` | `string` | No | — | | `group_ids` | `any[]` | Yes | — | | `last_name` | `string` | No | — | | `first_name` | `string` | No | — | | `is_deleted` | `boolean` | No | — | | `sms_status` | `string` | No | — | | `anniversary` | `string` | No | — | | `subscribe_ip` | `string` | No | — | | `mailinglist_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createNewMailingList `mailingList.createNewMailingList` Tool to create a new mailing list in ActiveTrail. Use when you need to add a new mailing list to organize and manage contacts. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.mailingList.createNewMailingList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getMailingList `mailingList.getMailingList` Tool to retrieve basic information about a specific mailing list by its unique identifier. Returns the mailing list ID and name. Use when you need to verify a mailing list exists or get its name by ID. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.mailingList.getMailingList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getMailingListMembers `mailingList.getMailingListMembers` Tool to retrieve all members belonging to a specific mailing list. Use when you need to get contacts from a mailing list, with optional filtering by contact status and state change date range. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.mailingList.getMailingListMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `customer_states` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getMailingLists `mailingList.getMailingLists` Tool to retrieve all mailing lists from the ActiveTrail account. Use when you need to get the list of mailing lists associated with the account. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.mailingList.getMailingLists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### removeAContactFromAMailingList `mailingList.removeAContactFromAMailingList` Removes a specific contact from a mailing list in ActiveTrail. Use this action to unsubscribe or remove a contact from a particular mailing list without deleting the contact from your account entirely. The contact will no longer receive campaigns sent to this specific mailing list, but will remain in other lists they belong to. Note: This is a destructive operation that cannot be undone via API. To re-add the contact to the list, use the 'Import New Contacts' action. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.mailingList.removeAContactFromAMailingList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `mailinglist_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Operational Message ### getTransactionalMessagesClassification `operationalMessage.getTransactionalMessagesClassification` Tool to retrieve all classification options for operational/transactional messages. Use when you need to get available classifications for categorizing and filtering transactional message reports. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.operationalMessage.getTransactionalMessagesClassification({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Push Campaign Report ### getPushCampaignReportDelivered `pushCampaignReport.getPushCampaignReportDelivered` Tool to retrieve contacts who successfully received a specific push notification campaign. Use when you need to identify which recipients had the push campaign delivered to their devices. The campaign must have been sent within the specified date range (defaults to last 3 months); if not sent during these dates, an empty list is returned. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.pushCampaignReport.getPushCampaignReportDelivered({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPushCampaignReportFailed `pushCampaignReport.getPushCampaignReportFailed` Tool to retrieve the failed delivery report for a specific push campaign. Use when you need to see which contacts experienced delivery failures and why. The campaign must be sent in the specified date range (defaults to last 3 months). **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.pushCampaignReport.getPushCampaignReportFailed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPushCampaignReportSent `pushCampaignReport.getPushCampaignReportSent` Tool to retrieve the list of contacts who were sent a specific push notification campaign, including contact details, device types, and sent timestamps. Use when you need to see the complete list of recipients for a push campaign with their delivery information. Supports filtering by date range (defaults to last 3 months), send type, and search terms. Returns paginated results with contact details for each recipient. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.pushCampaignReport.getPushCampaignReportSent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Segmentation ### createSegmentation `segmentation.createSegmentation` Create a new contact segmentation in ActiveTrail. Segmentations are rule-based filters that define target audiences based on contact field values (e.g., email equals specific value, city contains text, etc.). Use this to create dynamic segments for campaign targeting, automation workflows, or contact organization. Requires a unique name and at least one base rule with field, operator, and values. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.segmentation.createSegmentation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `rules_segment` | `object` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **rules\_segment full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSegmentationRuleFieldTypes `segmentation.getSegmentationRuleFieldTypes` Retrieve a reference dictionary of all available field types that can be used in segmentation rules for ActiveTrail automation. Returns field type definitions including their identifiers, names, data types, and descriptions. This endpoint provides the foundational metadata needed to understand which contact fields (email, phone, custom fields, behavioral data, etc.) can be evaluated when constructing segmentation conditions in marketing automations. Use this when you need to discover what field types are available before building or validating segmentation rules. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.segmentation.getSegmentationRuleFieldTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSegmentationRuleOperations `segmentation.getSegmentationRuleOperations` Retrieves available rule operations for segmentation by field type. Returns operations categorized by field types (Info, Date, Action, Numeric, etc.) with their corresponding operation types (Is, IsNot, Contain, GreaterThan, etc.). Use this to understand which operations are valid when building segmentation rules based on field types. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.segmentation.getSegmentationRuleOperations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSegmentationRuleTypes `segmentation.getSegmentationRuleTypes` Tool to retrieve available segmentation rule types for automation. Returns a list of rule type names that can be used when creating or editing automation segmentations. Use this to discover what types of rules are available (e.g., Info, Numeric, Date, Group, Action, Order-related, Cart, Catalog, etc.). #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.segmentation.getSegmentationRuleTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSegmentationRuleTypesMapping `segmentation.getSegmentationRuleTypesMapping` Tool to retrieve the complete mapping of segmentation rule types with their associated field types and operations from ActiveTrail. Use this when building segmentation rules to understand which field types and operations are available for each rule type (e.g., Info rules support Email fields with 'Is' operation). #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.segmentation.getSegmentationRuleTypesMapping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSegmentations `segmentation.getSegmentations` Retrieve all contact segmentations from your ActiveTrail account. Segmentations are rule-based filters that define target audiences for campaigns and automations (e.g., contacts who opened specific campaigns, belong to certain groups, or match demographic criteria). Use this to list all configured segmentations and their IDs for use in campaign targeting or automation workflows. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.segmentation.getSegmentations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSegmentation `segmentation.updateSegmentation` Tool to update an existing segmentation's name and/or rules by its ID. Use when you need to modify segmentation criteria or rename a segment. Segmentations are rule-based filters that define target audiences based on contact attributes, behaviors, or campaign interactions. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.segmentation.updateSegmentation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `rules_segment` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **rules\_segment full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Signup Forms ### getSignupForms `signupForms.getSignupForms` Tool to retrieve all signup forms from the ActiveTrail account. Use when you need to get the list of signup forms associated with the account. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.signupForms.getSignupForms({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Smart Code Site ### createSmartCodeSite `smartCodeSite.createSmartCodeSite` Creates a new Smart Code tracking site in ActiveTrail. Smart Code is ActiveTrail's web analytics and visitor tracking solution that monitors visitor behavior on your website. Use this action to register a website for Smart Code tracking by providing a site name and domain(s). **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.smartCodeSite.createSmartCodeSite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `domains` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteSmartCodeSite `smartCodeSite.deleteSmartCodeSite` Tool to remove a Smart Code site from ActiveTrail. Use when you need to permanently delete a Smart Code site identified by its unique ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.smartCodeSite.deleteSmartCodeSite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmartCodeSites `smartCodeSite.getSmartCodeSites` Retrieves all Smart Code tracking sites configured in the ActiveTrail account. Smart Code is ActiveTrail's web analytics and visitor tracking solution. Use this action to list all registered websites with Smart Code tracking, including their IDs, names, and associated domains. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smartCodeSite.getSmartCodeSites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSmartCodeSite `smartCodeSite.updateSmartCodeSite` Updates an existing Smart Code tracking site in ActiveTrail. Use this action to modify a site's name and domain configuration. Both name and domains must be provided in the update request (the API does not support partial updates). **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.smartCodeSite.updateSmartCodeSite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `domains` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Sms Campaign ### createSmsCampaign `smsCampaign.createSmsCampaign` Tool to create a new SMS campaign in ActiveTrail. Use when you need to send SMS messages to segments of your audience with customizable content, sender name, and scheduling options. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.smsCampaign.createSmsCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `segment` | `object` | Yes | — | | `from_name` | `string` | No | — | | `scheduling` | `object` | Yes | — | | `can_unsubscribe` | `boolean` | No | — | | `is_link_tracking` | `boolean` | No | — | | `unsubscribe_text` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **segment full type** > > ```ts theme={null} > { > } > ``` > **scheduling full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignClicks `smsCampaign.getCampaignClicks` Retrieves detailed click-through data for all links in a campaign or optionally for a specific link. Returns comprehensive information including contact details (name, email), click timestamps, device information (browser, OS, device type), and click counts. Default date range: last 3 months from current date. Use this for aggregate click analysis across multiple links; for detailed analysis of a single link, consider using 'Get Click Details by Link ID' action instead. Returns an error if the campaign wasn't sent within the specified date range. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaign.getCampaignClicks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `link_id` | `string` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignOpens `smsCampaign.getCampaignOpens` Tool to retrieve contacts who opened a specific campaign email. Use when you need to identify which recipients opened your campaign, track open rates, and analyze campaign engagement. Default search covers campaigns updated in the last 3 months; if the campaign wasn't sent during the specified date range, an empty list is returned. Supports pagination and filtering by group. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaign.getCampaignOpens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `groupid` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `campaign_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignSDetails `smsCampaign.getCampaignSDetails` Tool to retrieve complete campaign information including send settings, design, template, and A/B test configuration. Use when you need comprehensive details about a specific email campaign. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaign.getCampaignSDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPushCampaignOpens `smsCampaign.getPushCampaignOpens` Retrieves a list of contacts who opened a specific push notification campaign, including contact details and when they opened the notification. Use this action to: - Track engagement metrics for push campaigns - Identify which recipients interacted with your push notifications - Filter opens by date range, send type, or search for specific contacts Note: The campaign must have been sent within the date range (defaults to last 3 months from current date if not specified). Results are paginated for campaigns with many opens. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaign.getPushCampaignOpens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaign `smsCampaign.getSmsCampaign` Tool to retrieve detailed information about a specific SMS campaign by its unique identifier. Use when you need to fetch campaign details including message content, sender, status, and delivery metrics. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaign.getSmsCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignClickers `smsCampaign.getSmsCampaignClickers` Retrieve contacts who clicked links in an SMS campaign with detailed click analytics. Returns contact information (name, email, phone), click timestamps, link details, and click counts. Supports filtering by specific links, date ranges, and contact search. Note: If the SMS was sent using "add numbers manually" instead of groups/mailing lists, you'll receive click counts but mobile numbers may not be available. Default search window is 3 months from today. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaign.getSmsCampaignClickers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `link_id` | `string` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `rows_affected` | `number` | No | — | | `previous_row_count` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignEstimate `smsCampaign.getSmsCampaignEstimate` Tool to calculate the estimated number of messages for a given SMS campaign. Use when you need to get message count estimates for campaigns that have not been sent yet. Cannot be used for already-sent campaigns. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaign.getSmsCampaignEstimate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignReports `smsCampaign.getSmsCampaignReports` Tool to retrieve SMS campaign performance metrics and reports with filtering options. Use when you need to access SMS campaign analytics including sent, delivered, failed, clicks, and engagement statistics. Returns the last 20 campaigns from the last 6 months by default when no date range or filters are specified. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaign.getSmsCampaignReports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `rows_affected` | `number` | No | — | | `previous_row_count` | `number` | No | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTransactionalSmsMessage `smsCampaign.getTransactionalSmsMessage` Tool to retrieve detailed information about a specific transactional SMS message by its unique identifier. Use when you need to fetch SMS message content, delivery statistics, and metadata for operational SMS messages. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaign.getTransactionalSmsMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transactional_sms_id` | `number` | Yes | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateCampaign `smsCampaign.updateCampaign` Tool to update draft campaigns in ActiveTrail. Use when you need to modify campaign properties such as name, subject, content, or design settings. IMPORTANT: Only campaigns in draft mode can be updated - campaigns that have been sent or are scheduled cannot be modified. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.smsCampaign.updateCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `design` | `object` | Yes | — | | `details` | `object` | Yes | — | | `send_test` | `string` | No | — | | `send_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **design full type** > > ```ts theme={null} > { > } > ``` > **details full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSmsOperationalMessage `smsCampaign.updateSmsOperationalMessage` Tool to update an operational SMS transactional message by ID. Use when you need to modify the name, sender, or content of an existing SMS campaign. Important: You cannot update a campaign that has already been sent. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.smsCampaign.updateSmsOperationalMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `from_name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Sms Campaign Report ### getAutomationReportsSmsCampaignSummary `smsCampaignReport.getAutomationReportsSmsCampaignSummary` Tool to retrieve SMS campaigns' summary reports for a specific automation. Use when you need to analyze SMS campaign performance including sent, delivered, failed, credits consumed, unsubscribe, and click metrics within an automation. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getAutomationReportsSmsCampaignSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAutomationReportsSummaryReport `smsCampaignReport.getAutomationReportsSummaryReport` Tool to retrieve email campaigns' summary reports for a specific automation. Use when you need to analyze email campaign performance metrics including opens, clicks, click-to-open rate, conversions, bounces, unsubscribes, and spam complaints within an automation for a given date range. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getAutomationReportsSummaryReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `to_date` | `string` | Yes | — | | `from_date` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignDomainsReport `smsCampaignReport.getCampaignDomainsReport` Tool to retrieve a report by domain for a specific campaign. Use when you need to analyze campaign performance grouped by recipient email domains, including sends, opens, clicks, bounces, and engagement metrics per domain. Defaults to campaigns updated in the last 3 months. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getCampaignDomainsReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `campaign_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCampaignReport `smsCampaignReport.getCampaignReport` Retrieves comprehensive performance metrics for a specific email campaign by its ID. Returns detailed statistics including send count, open rate, click rate, click-to-open rate (CTO), bounce rate, unsubscribe rate, spam complaints, and conversion data. Use this when you need detailed performance analytics for a single campaign. Default behavior: Returns data for campaigns updated in the last 3 months when date parameters are not specified. Note: Returns an error if the campaign wasn't sent/updated within the specified date range. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getCampaignReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPushCampaignReportSummary `smsCampaignReport.getPushCampaignReportSummary` Tool to retrieve aggregated summary statistics for push notification campaigns filtered by date range. Returns total counts across all campaigns including total sent, opens, clicks, clickers, unsubscribes, failed deliveries, and total devices. Use this when you need overall push campaign performance metrics rather than individual campaign details. Default behavior: Returns aggregate statistics for campaigns from the last 3 months when date parameters are not specified. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getPushCampaignReportSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignDelivered `smsCampaignReport.getSmsCampaignDelivered` Tool to retrieve delivery confirmations for a specific SMS campaign. Use when you need to see which contacts successfully received the SMS message. The campaign must be sent in the specified date range (defaults to last 3 months). Note: If SMS was sent using manual number entry instead of a group, only the delivery count is returned without specific mobile numbers. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getSmsCampaignDelivered({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `rows_affected` | `number` | No | — | | `previous_row_count` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignReport `smsCampaignReport.getSmsCampaignReport` Tool to retrieve summary report for a specific SMS campaign by ID. Use when you need detailed metrics about an SMS campaign's performance including sent count, delivery rate, clicks, and errors. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getSmsCampaignReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignReportClicks `smsCampaignReport.getSmsCampaignReportClicks` Tool to retrieve detailed click event data for links in SMS campaigns. Returns individual click records (not unique clickers) with contact information, timestamps, link details, and device/browser information. Use when you need granular click-level analytics for SMS campaign links. Note: By default, searches for clicks within the last 3 months. If the campaign wasn't sent in the specified date range, no data will be returned. If SMS recipients were added manually (not from a group), you may get click counts but not all contact details. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getSmsCampaignReportClicks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `rows_affected` | `number` | No | — | | `previous_row_count` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignReportFailed `smsCampaignReport.getSmsCampaignReportFailed` Tool to retrieve the failed delivery report for a specific SMS campaign. Use when you need to see which contacts experienced delivery failures and why. The campaign must be sent in the specified date range (defaults to last 3 months). Note: If SMS was sent using manual number entry instead of a group, only the failure count is returned without specific mobile numbers. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getSmsCampaignReportFailed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignReportSent `smsCampaignReport.getSmsCampaignReportSent` Tool to retrieve all contacts that an SMS campaign was sent to. Use when you need to see the list of recipients for a specific SMS campaign. The campaign must be sent in the specified date range (defaults to last 3 months). Note: If SMS was sent using manual number entry instead of a group, only the contact count is returned without specific mobile numbers. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getSmsCampaignReportSent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `rows_affected` | `number` | No | — | | `previous_row_count` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignReportSummary `smsCampaignReport.getSmsCampaignReportSummary` Retrieve aggregate summary metrics for SMS campaigns across a filtered date range. Returns total counts for sent messages, failed deliveries, clicks, unique clicks, unsubscribes, and credits consumed. Use this to get high-level performance statistics across all SMS campaigns in a given period. Default behavior: Returns aggregate metrics for the last 3 months when date parameters are not specified. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getSmsCampaignReportSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSmsCampaignReportUnsubscribed `smsCampaignReport.getSmsCampaignReportUnsubscribed` Tool to retrieve contacts who unsubscribed from a specific SMS campaign. Use when you need to identify recipients who opted out of receiving future SMS messages. Note: For manually added numbers, only the count is returned, not individual phone numbers. Default search range is last 3 months; if campaign wasn't sent in the given range, no information will be returned. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.smsCampaignReport.getSmsCampaignReportUnsubscribed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `to_date` | `string` | No | — | | `from_date` | `string` | No | — | | `send_type` | `string` | No | — | | `search_term` | `string` | No | — | | `rows_affected` | `number` | No | — | | `previous_row_count` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Templates ### deleteTemplate `templates.deleteTemplate` Tool to remove a template from ActiveTrail account. Use when you need to delete a template that is no longer needed. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.templates.deleteTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteTemplatesTemplateCategory `templates.deleteTemplatesTemplateCategory` Tool to delete a template category by ID. Use when you need to remove a template category. Warning: Deleting a category will cascade-delete all templates within that category. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.templates.deleteTemplatesTemplateCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTemplateContent `templates.getTemplateContent` Tool to retrieve HTML content of a specific template. Use when you need to get the HTML markup or design content of a template by its ID. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.templates.getTemplateContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTemplates `templates.getTemplates` Tool to retrieve saved templates from the ActiveTrail account. Use when you need to list all templates or search for templates by name. Supports pagination and filtering. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.templates.getTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `search_term` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTemplatesTemplateCategory `templates.getTemplatesTemplateCategory` Tool to retrieve all template categories from 'my templates' section. Use when you need to get the list of categories for organizing email templates. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.templates.getTemplatesTemplateCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### postTemplatesCampaign `templates.postTemplatesCampaign` Creates a new email campaign from an existing template. The campaign will be created in draft status. Prerequisites: - A valid template ID (obtain from 'Get Templates' action) - A valid sending profile ID (obtain from 'Get Sending Profiles' action) Use this when you need to quickly create a campaign using a pre-designed template rather than building from scratch. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.templates.postTemplatesCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | | `campaign_details` | `object` | Yes | — | | `Id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **campaign\_details full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### postTemplatesTemplateCategory `templates.postTemplatesTemplateCategory` Tool to create a new template category in ActiveTrail. Use when you need to add a new category for organizing email templates. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.templates.postTemplatesTemplateCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `name_key` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateTemplate `templates.updateTemplate` Tool to update an existing email template in ActiveTrail account. Use this action to modify template properties including: - Template name and subject line - HTML content/body - Editor type and display settings - Template categorization - Character encoding settings All fields except 'id' are optional - only provide the fields you want to update. The template will be updated with the new values while preserving any fields not specified. Note: To update only the HTML content of a template, consider using the 'Update Template Content' action instead. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.templates.updateTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `content` | `string` | No | — | | `subject` | `string` | No | — | | `editor_type` | `string` | No | — | | `AddPrintButton` | `boolean` | No | — | | `campaign_encoding` | `number` | No | — | | `template_category_id` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateTemplateCategory `templates.updateTemplateCategory` Tool to update an existing template category in ActiveTrail. Use when you need to modify the name of a template category used for organizing email templates. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.templates.updateTemplateCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `name_key` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateTemplateContent `templates.updateTemplateContent` Tool to update the HTML content of an email template in ActiveTrail. Use when you need to modify the design or layout of an existing template. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.templates.updateTemplateContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `content` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## User Social ### getUserSocialAccountsGet `userSocial.getUserSocialAccountsGet` Retrieve social media accounts (Facebook, Instagram, etc.) connected to the ActiveTrail account. Returns a list of connected social media accounts with details like platform, username, status, and connection date. Note: Social media integration is only available for ActiveTrail Plus plan customers. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.userSocial.getUserSocialAccountsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Webhooks ### createWebhook `webhooks.createWebhook` Create a new webhook for event notifications in ActiveTrail. Webhooks enable real-time notifications for events like contact changes or campaign activities. After creating the webhook, use the 'Update Webhook Parameter' action to add custom parameters (headers, query params, body data) if needed. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.webhooks.createWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `name` | `string` | Yes | — | | `event_type` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteWebhook `webhooks.deleteWebhook` Tool to remove a webhook from ActiveTrail account by its ID. Use when you need to delete a webhook that is no longer needed. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.webhooks.deleteWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteWebhooksParameters `webhooks.deleteWebhooksParameters` Removes a specific parameter from a webhook configuration in ActiveTrail. Use this when you need to delete custom headers, query parameters, or body parameters that were previously added to a webhook. Requires both the webhook ID and the specific parameter ID to delete. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.activetrail.api.webhooks.deleteWebhooksParameters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `number` | Yes | — | | `parameter_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWebhook `webhooks.getWebhook` Tool to retrieve detailed information about a specific webhook by its unique identifier. Use when you need to fetch complete webhook configuration including event type, target URL, state, and associated parameters. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.webhooks.getWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWebhooks `webhooks.getWebhooks` Tool to list account webhooks with optional filtering. Use when you need to retrieve webhooks configured for the ActiveTrail account with filtering by event type, state, or target type. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.webhooks.getWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `string` | No | — | | `state_type` | `string` | No | — | | `target_type` | `string` | No | — | | `is_ignore_parameters` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWebhooksParameters `webhooks.getWebhooksParameters` Retrieves custom parameters configured for a specific webhook. Parameters define additional data (headers, query parameters, or body fields) that ActiveTrail includes when calling the webhook URL. Use this to inspect webhook configuration details including parameter keys, values, types, and dynamic field mappings. **Risk:** `read` ```ts theme={null} await corsair.activetrail.api.webhooks.getWebhooksParameters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### postWebhooksParameters `webhooks.postWebhooksParameters` Tool to add a new parameter to an existing webhook in your ActiveTrail account. Use when you need to configure additional parameters for webhook events, such as authentication headers, custom query parameters, or body fields. Each parameter can have either a static value or dynamically pull from contact fields. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.webhooks.postWebhooksParameters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | | `value` | `string` | Yes | — | | `user_field` | `string` | No | — | | `webhook_id` | `number` | Yes | — | | `event_value_type` | `string` | Yes | — | | `event_parameter_type` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### postWebhooksTest2 `webhooks.postWebhooksTest2` Tool to send a test webhook request with configurable URL and parameters. Use when you need to validate webhook configurations by sending a test request to a specified URL with custom event types, parameters, and target types. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.webhooks.postWebhooksTest2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `format` | `number` | Yes | — | | `user_id` | `number` | No | — | | `event_type` | `string` | Yes | — | | `parameters` | `any[]` | No | — | | `target_type` | `string` | Yes | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### testWebhook `webhooks.testWebhook` Send a test request to a configured webhook to verify it's working correctly. This action triggers a test event for the specified webhook without waiting for actual events to occur. Use this to validate that the webhook URL is reachable, properly configured, and able to receive notifications from ActiveTrail. The webhook must already exist in your ActiveTrail account. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.webhooks.testWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateWebhook `webhooks.updateWebhook` Tool to update an existing webhook configuration in ActiveTrail. Use when you need to modify webhook properties such as name, URL, event type, format, or active status. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.webhooks.updateWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `url` | `string` | Yes | — | | `name` | `string` | Yes | — | | `format` | `string` | No | — | | `typeid` | `number` | No | — | | `stateid` | `number` | No | — | | `is_active` | `boolean` | No | — | | `event_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateWebhookParameter `webhooks.updateWebhookParameter` Tool to update an existing webhook parameter in your ActiveTrail account. Use when you need to modify parameter properties such as key, value, type, or field mappings for webhook events. **Risk:** `write` ```ts theme={null} await corsair.activetrail.api.webhooks.updateWebhookParameter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | No | — | | `value` | `string` | No | — | | `user_field` | `string` | No | — | | `webhook_id` | `number` | Yes | — | | `parameter_id` | `number` | Yes | — | | `event_value_type` | `string` | No | — | | `event_parameter_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/activetrail/database ActiveTrail local sync: searchable entities, `.search()` filters, and operators. The ActiveTrail plugin syncs data locally. Use `corsair.activetrail.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Campaigns Path: `activetrail.db.campaigns.search` ```ts theme={null} const rows = await corsair.activetrail.db.campaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `activetrail.db.contacts.search` ```ts theme={null} const rows = await corsair.activetrail.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Groups Path: `activetrail.db.groups.search` ```ts theme={null} const rows = await corsair.activetrail.db.groups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/activetrail/overview Email and SMS marketing platform for campaigns, automations, and subscriber management. Use **ActiveTrail** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 159 typed API operations * 3 synced entities (`campaigns`, `contacts`, `groups`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/activetrail ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/activetrail ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/activetrail ``` ```bash bun theme={null} bun add corsair @corsair-dev/activetrail ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { activetrail } from '@corsair-dev/activetrail'; export const corsair = createCorsair({ plugins: [ activetrail(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} activetrail() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'activetrail', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.contactGrowth`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.activetrail.api.account.contactGrowth({}); ``` **`account.createContentCategory`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.activetrail.api.account.createContentCategory({}); ``` See the full list on the [API](/plugins/activetrail/api) page. ## Query synced data Synced entities support `tenant.activetrail.db..search()` and `.list()`: `campaigns`, `contacts`, `groups`. See [Database](/plugins/activetrail/database) for filters and operators. ## What's next > **[API reference](/plugins/activetrail/api)** > > Every `activetrail.api.*` operation with input and output types. > **[Database](/plugins/activetrail/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/addresszen/api API reference for AddressZen: every `addresszen.api.*` operation with input and output types. Every `addresszen.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Autocomplete ### addresses `autocomplete.addresses` Get address autocomplete suggestions for a partial address query **Risk:** `read` ```ts theme={null} await corsair.addresszen.api.autocomplete.addresses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | Partial address string to autocomplete | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > hits: { > id: string, > suggestion: string, > urls?: { > } | null, > udprn?: number > }[] > } > ``` *** ## Key ### availability `key.availability` Get public information on an API key, including whether it is currently usable **Risk:** `read` ```ts theme={null} await corsair.addresszen.api.key.availability({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > available: boolean, > context?: string, > contexts?: { > }[] > } > ``` *** ## Resolve ### addressUsa `resolve.addressUsa` Resolve an address autocompletion by its address ID and return the full address in US format **Risk:** `read` ```ts theme={null} await corsair.addresszen.api.resolve.addressUsa({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `addressId` | `string` | Yes | Address suggestion ID from autocomplete (e.g. usps\_X130125796\|1600\|\|1933) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id?: string, > line_1?: string, > line_2?: string, > city?: string, > state?: string, > state_abbreviation?: string, > zip_code?: string, > country_iso_2?: string > } > ``` *** ## Verify ### address `verify.address` Verify and standardize a US address using USPS CASS validation **Risk:** `read` ```ts theme={null} await corsair.addresszen.api.verify.address({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | Address to verify. Use a full free-form address, or only the first line when city/state or zip\_code are provided separately. | | `zip_code` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `context` | `string` | No | Optional metadata tag stored with the lookup | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > query: string, > query_city?: string, > query_state?: string, > query_zip_code?: string, > match?: any | null, > count?: number, > fit?: number, > confidence?: number, > match_information?: any, > address_line_one?: string, > address_line_two?: string, > city?: string, > state?: string, > zip_code?: string, > country_iso_2?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/addresszen/database AddressZen local sync: searchable entities, `.search()` filters, and operators. The AddressZen plugin syncs data locally. Use `corsair.addresszen.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Autocomplete Results Path: `addresszen.db.autocompleteResults.search` ```ts theme={null} const rows = await corsair.addresszen.db.autocompleteResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Key Availability Path: `addresszen.db.keyAvailability.search` ```ts theme={null} const rows = await corsair.addresszen.db.keyAvailability.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `available` | `boolean` | equals | | `context` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Resolved Addresses Path: `addresszen.db.resolvedAddresses.search` ```ts theme={null} const rows = await corsair.addresszen.db.resolvedAddresses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `addressId` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Verified Addresses Path: `addresszen.db.verifiedAddresses.search` ```ts theme={null} const rows = await corsair.addresszen.db.verifiedAddresses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `zipCode` | `string` | equals, contains, startsWith, endsWith, in | | `context` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/addresszen/overview Address validation and geocoding API for verifying and standardizing postal addresses. Use **AddressZen** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 4 synced entities (`autocompleteResults`, `keyAvailability`, `resolvedAddresses`, `verifiedAddresses`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/addresszen ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/addresszen ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/addresszen ``` ```bash bun theme={null} bun add corsair @corsair-dev/addresszen ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { addresszen } from '@corsair-dev/addresszen'; export const corsair = createCorsair({ plugins: [ addresszen(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} addresszen() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'addresszen', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`autocomplete.addresses`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.addresszen.api.autocomplete.addresses({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/addresszen/api) reference.* See the full list on the [API](/plugins/addresszen/api) page. ## Query synced data Synced entities support `tenant.addresszen.db..search()` and `.list()`: `autocompleteResults`, `keyAvailability`, `resolvedAddresses`, `verifiedAddresses`. See [Database](/plugins/addresszen/database) for filters and operators. ## What's next > **[API reference](/plugins/addresszen/api)** > > Every `addresszen.api.*` operation with input and output types. > **[Database](/plugins/addresszen/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/aeroleads/api API reference for AeroLeads: every `aeroleads.api.*` operation with input and output types. Every `aeroleads.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Linkedin Details ### get `linkedinDetails.get` Retrieve detailed information about a prospect using their LinkedIn profile URL, including emails, phone numbers, job details, and company data **Risk:** `read` ```ts theme={null} await corsair.aeroleads.api.linkedinDetails.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `linkedin_url` | `string` | Yes | The LinkedIn profile URL of the prospect | **Output** | Name | Type | Required | Description | | - | - | - | - | | `full_name` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `linkedin_url` | `string` | No | — | | `location` | `string` | No | — | | `job_title` | `string` | No | — | | `job_company_name` | `string` | No | — | | `job_company_url` | `string` | No | — | | `job_company_linkedin_url` | `string` | No | — | | `job_description` | `string` | No | — | | `education` | `string \| any[]` | No | — | | `experience` | `string \| any[]` | No | — | | `interests` | `string \| any[]` | No | — | | `skills` | `string \| any[]` | No | — | | `languages` | `object[]` | No | — | | `emails` | `string \| any[]` | No | — | | `phone_numbers` | `string \| any[]` | No | — | | `cb_rank` | `string` | No | — | | `db_logo_url` | `string` | No | — | | `profile_picture_url` | `string` | No | — | | `job_company_size` | `string \| number` | No | — | | `industry` | `string` | No | — | | `job_title_detailed_role_s2` | `string` | No | — | | `organization_founded_year_s2` | `string` | No | — | | `organization_facebook_url_s2` | `string` | No | — | | `organization_twitter_url_s2` | `string` | No | — | | `organization_current_technologies_s2` | `string` | No | — | | `emails_s2` | `string` | No | — | | `phone_numbers_s2` | `string` | No | — | > **languages full type** > > ```ts theme={null} > string | { > } | any[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/aeroleads/database AeroLeads local sync: searchable entities, `.search()` filters, and operators. The AeroLeads plugin syncs data locally. Use `corsair.aeroleads.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Linkedin Details Path: `aeroleads.db.linkedinDetails.search` ```ts theme={null} const rows = await corsair.aeroleads.db.linkedinDetails.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `linkedin_url` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `job_title` | `string` | equals, contains, startsWith, endsWith, in | | `job_company_name` | `string` | equals, contains, startsWith, endsWith, in | | `job_company_url` | `string` | equals, contains, startsWith, endsWith, in | | `job_company_linkedin_url` | `string` | equals, contains, startsWith, endsWith, in | | `job_description` | `string` | equals, contains, startsWith, endsWith, in | | `cb_rank` | `string` | equals, contains, startsWith, endsWith, in | | `db_logo_url` | `string` | equals, contains, startsWith, endsWith, in | | `profile_picture_url` | `string` | equals, contains, startsWith, endsWith, in | | `industry` | `string` | equals, contains, startsWith, endsWith, in | | `job_title_detailed_role_s2` | `string` | equals, contains, startsWith, endsWith, in | | `organization_founded_year_s2` | `string` | equals, contains, startsWith, endsWith, in | | `organization_facebook_url_s2` | `string` | equals, contains, startsWith, endsWith, in | | `organization_twitter_url_s2` | `string` | equals, contains, startsWith, endsWith, in | | `organization_current_technologies_s2` | `string` | equals, contains, startsWith, endsWith, in | | `emails_s2` | `string` | equals, contains, startsWith, endsWith, in | | `phone_numbers_s2` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/aeroleads/overview B2B lead generation tool for finding business emails and prospect contact data. Use **AeroLeads** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 1 typed API operations * 1 synced entity (`linkedinDetails`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/aeroleads ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/aeroleads ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/aeroleads ``` ```bash bun theme={null} bun add corsair @corsair-dev/aeroleads ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { aeroleads } from '@corsair-dev/aeroleads'; export const corsair = createCorsair({ plugins: [ aeroleads(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} aeroleads() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'aeroleads', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`linkedinDetails.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.aeroleads.api.linkedinDetails.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/aeroleads/api) reference.* See the full list on the [API](/plugins/aeroleads/api) page. ## Query synced data Synced entities support `tenant.aeroleads.db..search()` and `.list()`: `linkedinDetails`. See [Database](/plugins/aeroleads/database) for filters and operators. ## What's next > **[API reference](/plugins/aeroleads/api)** > > Every `aeroleads.api.*` operation with input and output types. > **[Database](/plugins/aeroleads/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/affinda/api API reference for Affinda: every `affinda.api.*` operation with input and output types. Every `affinda.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Annotations ### batchUpdateAnnotations `annotations.batchUpdateAnnotations` Batch update multiple document annotations in a single API call. Use this action to efficiently update parsed values or other fields across many annotations at once, rather than making individual update requests for each annotation. Prerequisites: - Obtain annotation IDs using the 'Get Annotations' action with a document filter - Annotations must exist in documents that have been processed by Affinda Common use cases: - Correcting OCR/extraction errors in bulk - Updating parsed values after manual review - Modifying annotation data programmatically **Risk:** `write` ```ts theme={null} await corsair.affinda.api.annotations.batchUpdateAnnotations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `annotations` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createBatchAnnotations `annotations.createBatchAnnotations` Batch create multiple document annotations in a single API call. Use this action to efficiently create multiple annotations at once for documents that have been processed by Affinda. This is useful for programmatically adding structured data to documents or importing annotation data from external sources. Prerequisites: - Documents must be created first using 'Create Document' action - Obtain document identifiers from 'Create Document' or 'Get Documents' actions - Know the data point identifiers for your collection (from extractor configuration) Common use cases: - Importing annotation data from external systems - Programmatically adding structured data to documents - Creating annotations for validation or training purposes **Risk:** `write` ```ts theme={null} await corsair.affinda.api.annotations.createBatchAnnotations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `annotations` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteAnnotationsBatch `annotations.deleteAnnotationsBatch` Batch delete multiple document annotations in a single API call. Use this action to efficiently remove multiple annotations at once rather than making individual delete requests for each annotation. Prerequisites: - Obtain annotation IDs using the 'Get Annotations' action with a document filter - Annotations must exist in documents that have been processed by Affinda Common use cases: - Removing incorrect or unwanted annotations in bulk - Cleaning up annotations after document reprocessing - Deleting specific extracted data fields programmatically **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.annotations.deleteAnnotationsBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `annotation_ids` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAnnotations `annotations.getAnnotations` Retrieves all annotations for a specific document. Annotations are extracted data fields (text, dates, numbers, tables, etc.) from parsed documents. Use this after a document has been processed to access the extracted data. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.annotations.getAnnotations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `document` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateAnnotation `annotations.updateAnnotation` Tool to update data of a single annotation in Affinda. Use when you need to correct extracted values, verify annotations, or modify annotation metadata after document processing. Prerequisites: - Obtain the annotation ID using the 'Get Annotations' action with a document filter - Annotations must exist in documents that have been processed by Affinda Common use cases: - Correcting OCR or extraction errors in individual fields - Marking annotations as verified after manual review (set isClientVerified=true) - Updating parsed values to fix incorrect data extraction - Modifying annotation coordinates or page references Note: For bulk updates across multiple annotations, use the 'Batch Update Annotations' action instead for better efficiency. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.annotations.updateAnnotation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `raw` | `string` | No | — | | `field` | `string` | No | — | | `parent` | `number` | No | — | | `parsed` | `string` | No | — | | `document` | `string` | No | — | | `dataPoint` | `string` | No | — | | `pageIndex` | `number` | No | — | | `rectangles` | `any[]` | No | — | | `isClientVerified` | `boolean` | No | — | | `validationResults` | `any[]` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Api Users ### createApiUser `apiUsers.createApiUser` Tool to create a new API user within an organization. Use when you need to generate a new API user with authentication credentials for programmatic access to Affinda services. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.apiUsers.createApiUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email` | `string` | No | — | | `avatar` | `string` | No | — | | `username` | `string` | No | — | | `organization` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAllApiUsers `apiUsers.getAllApiUsers` Tool to retrieve a list of all API users. Use when you need to list API users, optionally filtered by organization. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.apiUsers.getAllApiUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `organization` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Collections ### createCollection `collections.createCollection` Tool to create a new collection. Use after you have a valid workspace ID and want to group documents by a specific extractor within that workspace. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.collections.createCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `extractor` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createDataFieldForCollection `collections.createDataFieldForCollection` Tool to create a data field for a collection along with a new data point. Use when you need to add a custom field to a collection for document processing and validation. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.collections.createDataFieldForCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field` | `object` | Yes | — | | `dataPoint` | `object` | Yes | — | | `identifier` | `string` | Yes | — | | `categoryLabel` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **field full type** > > ```ts theme={null} > { > } > ``` > **dataPoint full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteCollection `collections.deleteCollection` Permanently delete a collection from Affinda by its identifier. This is a destructive operation that cannot be undone. Use Get Collections first to verify the collection ID before deletion. Note: Documents in the collection may also be affected. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.collections.deleteCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCollection `collections.getCollection` Tool to retrieve details of a specific collection by its ID. Use when you need full metadata about a collection after confirming its identifier. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.collections.getCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCollectionFields `collections.getCollectionFields` Tool to retrieve data field configuration for a collection associated with a data point. Use when you need to understand the structure and validation rules of a specific field in a collection. Note: This endpoint is deprecated. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.collections.getCollectionFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `datapoint_identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCollections `collections.getCollections` Tool to retrieve a list of all collections. Use when you need to list collections in your Affinda workspace after authentication. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.collections.getCollections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `workspace` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCollectionUsage `collections.getCollectionUsage` Retrieves monthly credits consumption statistics for a specific collection. Returns a list of usage records showing how many credits were consumed each month. Use this to track collection activity, monitor consumption trends, or generate usage reports. Note: This endpoint is deprecated. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.collections.getCollectionUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `end` | `string` | No | — | | `start` | `string` | No | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateCollection `collections.updateCollection` Tool to update specific fields of a collection. Use when you need to rename or reassign a collection after creation. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.collections.updateCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDataFieldForCollection `collections.updateDataFieldForCollection` Tool to update a data field configuration for a collection's data point. Use when you need to modify field properties such as label, type, mandatory status, or validation settings after the field has been created. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.collections.updateDataFieldForCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | No | — | | `mapping` | `string` | No | — | | `fieldType` | `string` | No | — | | `mandatory` | `boolean` | No | — | | `dataSource` | `string` | No | — | | `identifier` | `string` | Yes | — | | `showDropdown` | `boolean` | No | — | | `displayRawText` | `string` | No | — | | `displayEnumValue` | `boolean` | No | — | | `datapoint_identifier` | `string` | Yes | — | | `autoValidationThreshold` | `number` | No | — | | `enableAutoValidationThreshold` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Data Point Choices ### createDataPointChoice `dataPointChoices.createDataPointChoice` Tool to create a custom data point choice. Use when you need to add a new choice option for a specific data point in a collection or organization. Note: This endpoint is deprecated but still functional. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.dataPointChoices.createDataPointChoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | Yes | — | | `value` | `string` | Yes | — | | `synonyms` | `any[]` | No | — | | `dataPoint` | `string` | Yes | — | | `collection` | `string` | No | — | | `description` | `string` | No | — | | `organization` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDataPointChoice `dataPointChoices.getDataPointChoice` Tool to return a specific data point choice by its ID. Use when you need details about a particular data point choice option. Note: This endpoint is deprecated but still functional. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.dataPointChoices.getDataPointChoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listDataPointChoices `dataPointChoices.listDataPointChoices` Tool to retrieve available choices for a specific enum data point. Use when you need to discover valid options for dropdown/enum fields in a collection's data schema. Note: This endpoint is deprecated but still functional for accessing data point choice metadata. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.dataPointChoices.listDataPointChoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `collection` | `string` | Yes | — | | `data_point` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### replaceDataPointChoices `dataPointChoices.replaceDataPointChoices` Tool to completely replace all choices for a data point. Use when you need to bulk update enum options - existing choices are matched by value, new values are created, updated values are modified, and values not in the incoming list are deleted. Note: This is a deprecated endpoint but still functional. Either collection or organization must be specified to scope the replacement. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.dataPointChoices.replaceDataPointChoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `choices` | `any[]` | Yes | — | | `dataPoint` | `string` | Yes | — | | `collection` | `string` | No | — | | `organization` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDataPointChoice `dataPointChoices.updateDataPointChoice` Tool to update data of a data point choice by its ID. Use when you need to modify label, value, description, synonyms, or associated collection/organization for an existing data point choice. Note: This endpoint is deprecated but still functional. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.dataPointChoices.updateDataPointChoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `label` | `string` | No | — | | `value` | `string` | No | — | | `synonyms` | `any[]` | No | — | | `dataPoint` | `string` | No | — | | `collection` | `string` | No | — | | `description` | `string` | No | — | | `organization` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Data Points ### createDataPoint `dataPoints.createDataPoint` Tool to create a custom data point for document extraction. Use when you need to define a new field that should be extracted from documents in a specific extractor. Note: This endpoint is deprecated but still functional. Data points define custom fields for extraction models. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.dataPoints.createDataPoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `noRect` | `boolean` | No | — | | `parent` | `string` | No | — | | `multiple` | `boolean` | No | — | | `extractor` | `string` | Yes | — | | `description` | `string` | No | — | | `manualEntry` | `boolean` | No | — | | `organization` | `string` | Yes | — | | `mappingDataSource` | `string` | No | — | | `annotationContentType` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDataPoint `dataPoints.deleteDataPoint` Tool to permanently delete a data point by its identifier. Use when you need to remove a data point from the database after confirming the identifier. Note: This endpoint is deprecated but still functional. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.dataPoints.deleteDataPoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDataPoint `dataPoints.getDataPoint` Tool to retrieve details of a specific data point by its identifier. Use when you need to inspect a data point's configuration, type, or structure. Data points represent individual fields that can be extracted from documents (e.g., 'name', 'email', 'date'). This endpoint is deprecated but still functional for retrieving data point metadata. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.dataPoints.getDataPoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listDataPoints `dataPoints.listDataPoints` Tool to retrieve all data points. Returns both custom data points and Affinda's off-the-shelf data points. Use when you need to list available data points for extractors. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.dataPoints.listDataPoints({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `extractor` | `string` | No | — | | `identifier` | `any[]` | No | — | | `description` | `string` | No | — | | `organization` | `string` | No | — | | `include_public` | `boolean` | No | — | | `annotation_content_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDataPoint `dataPoints.updateDataPoint` Tool to update data of a data point by its identifier. Use when you need to modify a data point's name, description, slug, parent, or mapping data source. Note: This endpoint is deprecated but still functional. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.dataPoints.updateDataPoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `slug` | `string` | No | — | | `parent` | `string` | No | — | | `identifier` | `string` | Yes | — | | `description` | `string` | No | — | | `mappingDataSource` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Data Sources ### createDataSource `dataSources.createDataSource` Tool to create a custom mapping data source. Use when you need to set up a new data source for mapping AI-extracted values to your database records. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.dataSources.createDataSource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `schema` | `object` | No | — | | `values` | `any[]` | No | — | | `workspace` | `string` | No | — | | `identifier` | `string` | Yes | — | | `keyProperty` | `string` | No | — | | `organization` | `string` | No | — | | `displayProperty` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **schema full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createDataSourceValue `dataSources.createDataSourceValue` Tool to add a new value to a mapping data source. Use when you need to add entries to a data source for mapping or validation purposes. The created value can then be referenced in document extraction and mapping workflows. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.dataSources.createDataSourceValue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | No | — | | `value` | `string` | Yes | — | | `identifier` | `string` | Yes | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDataSource `dataSources.deleteDataSource` Permanently delete a mapping data source from the database by its identifier. This is a destructive operation that cannot be undone. Use when you need to remove a data source that is no longer needed or was created in error. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.dataSources.deleteDataSource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDataSourceValue `dataSources.deleteDataSourceValue` Tool to delete a specific value from a mapping data source. Use when you need to remove an incorrect or outdated value from a data source mapping. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.dataSources.deleteDataSourceValue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `value` | `string` | Yes | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDataSource `dataSources.getDataSource` Tool to retrieve details of a specific mapping data source by its identifier. Use when you need to fetch mapping data source metadata and schema configuration. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.dataSources.getDataSource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDataSourceValue `dataSources.getDataSourceValue` Tool to retrieve a specific value from a mapping data source. Use when you need to get details about a particular value in a data source. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.dataSources.getDataSourceValue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `value` | `string` | Yes | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDataSourceValues `dataSources.getDataSourceValues` Tool to retrieve all values from a mapping data source. Use when you need to list or search values in a specific data source after authentication. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.dataSources.getDataSourceValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `document` | `string` | No | — | | `annotation` | `number` | No | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listDataSources `dataSources.listDataSources` Tool to retrieve the list of all custom mapping data sources. Use when you need to list or search for mapping data sources in your Affinda workspace. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.dataSources.listDataSources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `workspace` | `string` | No | — | | `identifier` | `string` | No | — | | `organization` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### replaceDataSourceValues `dataSources.replaceDataSourceValues` Tool to completely replace all values in a mapping data source. Use when you need to bulk update or refresh an entire data source's value list. Note: For large data sources (>1000 values), new values may take a few minutes to become searchable after the operation completes. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.dataSources.replaceDataSourceValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `values` | `any[]` | Yes | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDataSourceValue `dataSources.updateDataSourceValue` Tool to update an existing value in a mapping data source. Use when you need to modify the label or description of an existing data source value. The value identifier itself cannot be changed. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.dataSources.updateDataSourceValue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | No | — | | `value` | `string` | Yes | — | | `identifier` | `string` | Yes | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Documents ### addTagToDocuments `documents.addTagToDocuments` Tool to add a tag to multiple documents in a single operation. Use when you need to organize or categorize multiple documents by assigning them a shared tag. Tags enable efficient filtering and grouping of documents in your workspace. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.documents.addTagToDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `number` | Yes | — | | `identifiers` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createDocument `documents.createDocument` Upload a document to Affinda for parsing and data extraction. Use this action when you need to: - Parse resumes/CVs to extract candidate information - Process invoices to extract line items, amounts, and vendor details - Extract data from any supported document type (PDF, DOCX, images) You can upload either a file directly or provide a publicly accessible URL. The document will be processed by Affinda's AI extraction engine. Prerequisites: - For collection-based uploads: Get collection ID from get\_collections action - For workspace-specific uploads: Get workspace ID from get\_workspaces action **Risk:** `write` ```ts theme={null} await corsair.affinda.api.documents.createDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `file` | `object` | No | — | | `wait` | `boolean` | No | — | | `compact` | `boolean` | No | — | | `fileName` | `string` | No | — | | `language` | `string` | No | — | | `workspace` | `string` | No | — | | `collection` | `string` | No | — | | `expiryTime` | `string` | No | — | | `identifier` | `string` | No | — | | `rejectDuplicates` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createFromDataDocuments `documents.createFromDataDocuments` Create a document from structured resume or job description data for Search & Match. Use this when you have structured data to create a document programmatically without file uploads. Returns an identifier for subsequent status checks via /documents/. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.documents.createFromDataDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `string` | Yes | — | | `wait` | `boolean` | No | — | | `language` | `string` | No | — | | `file_name` | `string` | No | — | | `workspace` | `string` | No | — | | `collection` | `string` | No | — | | `identifier` | `string` | No | — | | `snake_case` | `boolean` | No | — | | `expiry_time` | `string` | No | — | | `document_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDocument `documents.deleteDocument` Tool to delete a specific document by its ID. Use when you need to remove a document that is incorrect or no longer needed, after confirming the document ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.documents.deleteDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDocument `documents.getDocument` Retrieve full details and parsed data for a specific document by its identifier. Use this tool to get comprehensive information about a document including: - Processing status (ready/failed) - Document metadata (file name, page count, language) - Parsed/extracted data results - URLs for PDF, original file, and review page - Collection and workspace information The document identifier can be either a system-generated ID or a custom identifier set during document upload. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.documents.getDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDocumentRedacted `documents.getDocumentRedacted` Tool to retrieve the redacted version of a document as a PDF file. Use when you need to get a document with sensitive information removed. The original document is not modified by this operation. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.documents.getDocumentRedacted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDocuments `documents.getDocuments` Tool to retrieve a list of all documents. Use when you need to list documents in your Affinda workspace after authentication. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.documents.getDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `boolean` | No | — | | `limit` | `number` | No | — | | `ready` | `boolean` | No | — | | `state` | `string` | No | — | | `failed` | `boolean` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `compact` | `boolean` | No | — | | `ordering` | `string` | No | — | | `workspace` | `string` | No | — | | `collection` | `string` | No | — | | `include_data` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### removeTagFromDocuments `documents.removeTagFromDocuments` Remove a tag from multiple documents in a single batch operation. Use this action to efficiently untag many documents at once rather than making individual remove requests. The operation is idempotent - removing a tag that isn't present on a document will not cause an error. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.documents.removeTagFromDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `number` | Yes | — | | `identifiers` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDocument `documents.updateDocument` Tool to update specific fields of a document. Use when you need to rename, reassign, or adjust expiry and storage settings after document creation. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.documents.updateDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileName` | `string` | No | — | | `language` | `string` | No | — | | `workspace` | `string` | No | — | | `collection` | `string` | No | — | | `expiryTime` | `string` | No | — | | `identifier` | `string` | Yes | — | | `regionBias` | `object` | No | — | | `customIdentifier` | `string` | No | — | | `deleteAfterParse` | `boolean` | No | — | | `enableValidationTool` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **regionBias full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDocumentData `documents.updateDocumentData` Update parsed data for a resume or job description document in Affinda. This endpoint is ONLY applicable for documents that have been processed with 'resume' or 'job-description' extractors. For other document types, use the batch\_update\_annotations endpoint instead. Use this tool when you need to correct or add parsed fields to an existing resume or job description document after it has been uploaded and processed. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.documents.updateDocumentData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Document Splitters ### getAllDocumentSplitters `documentSplitters.getAllDocumentSplitters` Tool to get a list of all document splitters. Use when you need to retrieve document splitters, optionally filtered by organization. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.documentSplitters.getAllDocumentSplitters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `organization` | `string` | No | — | | `includePublic` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDocumentSplitter `documentSplitters.getDocumentSplitter` Tool to retrieve details of a specific document splitter by its identifier. Use when you need to fetch metadata about a document splitter configuration. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.documentSplitters.getDocumentSplitter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Document Types ### createDocumentType `documentTypes.createDocumentType` Tool to create a new document type in the specified organization. Use when you need to define a new category of documents for processing. Document types allow you to organize and categorize documents within an organization. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.documentTypes.createDocumentType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `organization` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDocumentType `documentTypes.deleteDocumentType` Tool to permanently delete a document type by its identifier. Use when you need to remove a document type that is no longer needed. This is a destructive operation that cannot be undone. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.documentTypes.deleteDocumentType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDocumentType `documentTypes.getDocumentType` Tool to retrieve details of a specific document type by its ID. Use when you need to confirm the configuration or metadata of a document type before processing documents. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.documentTypes.getDocumentType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDocumentTypeJsonSchema `documentTypes.getDocumentTypeJsonSchema` Tool to generate a JSON schema from a document type by its identifier. Use when you need the structured schema definition for a document type to understand its field structure and validation rules. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.documentTypes.getDocumentTypeJsonSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDocumentTypePydanticModels `documentTypes.getDocumentTypePydanticModels` Tool to generate Pydantic model code from a document type's schema. Use when you need type-safe Python models for parsing documents of a specific type. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.documentTypes.getDocumentTypePydanticModels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `model_name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDocumentTypes `documentTypes.getDocumentTypes` Retrieve all document types accessible to the authenticated user. Returns a list containing each document type's identifier, name, description, ingest email, and organization. Use this to discover available document types before uploading or processing documents. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.affinda.api.documentTypes.getDocumentTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDocumentType `documentTypes.updateDocumentType` Tool to update a document type by its identifier. Use when you need to modify the name or description of an existing document type. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.documentTypes.updateDocumentType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `identifier` | `string` | Yes | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Extractors ### createExtractor `extractors.createExtractor` Tool to create a new extractor. Use when you need to define a custom document parser with specific fields and extraction rules, typically derived from a base extractor. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.extractors.createExtractor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `category` | `string` | No | — | | `namePlural` | `string` | No | — | | `fieldGroups` | `any[]` | No | — | | `validatable` | `boolean` | No | — | | `organization` | `string` | Yes | — | | `baseExtractor` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteExtractor `extractors.deleteExtractor` Permanently delete an extractor from Affinda by its identifier. This is a destructive operation that cannot be undone. Use Get Extractors first to verify the extractor ID before deletion. Note: This action is deprecated by the API. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.extractors.deleteExtractor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getExtractor `extractors.getExtractor` Tool to retrieve detailed information about a specific extractor by its identifier. Use when you need complete metadata about an extractor's configuration, fields, and capabilities. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.extractors.getExtractor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getExtractors `extractors.getExtractors` Retrieve all extractors available for an organization. Extractors are document parsing configurations that define what data to extract from documents. This includes both Affinda's built-in extractors (resumes, invoices, etc.) and any custom extractors created for the organization. Use this action to: - List available extractors before creating a collection - Find the identifier of a specific extractor type - Check if custom extractors exist for the organization **Risk:** `read` ```ts theme={null} await corsair.affinda.api.extractors.getExtractors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `string` | Yes | — | | `include_public_extractors` | `boolean` | No | — | | `name` | `string` | No | — | | `validatable` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateExtractor `extractors.updateExtractor` Tool to update specific fields of an extractor. Use when you need to modify an extractor's name, category, validation settings, or field groups after creation. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.extractors.updateExtractor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `category` | `string` | No | — | | `identifier` | `string` | Yes | — | | `namePlural` | `string` | No | — | | `fieldGroups` | `any[]` | No | — | | `validatable` | `boolean` | No | — | | `baseExtractor` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Indexes ### createIndex `indexes.createIndex` Tool to create a new index for search and match functionality. Use when you need to set up a new index for organizing and searching documents like resumes or job descriptions. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.indexes.createIndex({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `docType` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteIndex `indexes.deleteIndex` Tool to permanently delete an index from Affinda by its name. Use when you need to remove an index that is no longer needed. This is a destructive operation that cannot be undone. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.indexes.deleteIndex({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getIndexDocuments `indexes.getIndexDocuments` Tool to retrieve all indexed documents for a specific index. Use when you need to list documents in a search index after creating or accessing an index. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.indexes.getIndexDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listIndexes `indexes.listIndexes` Tool to retrieve a list of all search indexes. Use when you need to view available indexes for searching and matching documents in Affinda. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.indexes.listIndexes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `document_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateIndex `indexes.updateIndex` Tool to update the name of an existing search index. Use when you need to rename an index after creation. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.indexes.updateIndex({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `new_name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Invitations ### createInvitation `invitations.createInvitation` Tool to create a new organization invitation. Use when you need to invite a user to join an organization with a specific role. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.invitations.createInvitation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `string` | No | — | | `email` | `string` | Yes | — | | `organization` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteInvitation `invitations.deleteInvitation` Tool to delete an invitation by its identifier. Use when you need to remove or revoke an invitation after confirming the invitation identifier. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.invitations.deleteInvitation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAllInvitations `invitations.getAllInvitations` Tool to retrieve all invitations you created or sent to you. Use when you need to list organization invitations with optional filtering by status, role, or organization. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.invitations.getAllInvitations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `status` | `string` | No | — | | `organization` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getInvitation `invitations.getInvitation` Tool to retrieve details of a specific organization invitation by its identifier. Use when you need to check invitation status or get invitation metadata. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.invitations.getInvitation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateInvitation `invitations.updateInvitation` Tool to update an organization invitation's role. Use when you need to change the role assigned to an invitation before it is accepted. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.invitations.updateInvitation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `string` | No | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Job Description Search ### createJobDescriptionSearch `jobDescriptionSearch.createJobDescriptionSearch` Search through parsed job descriptions using custom criteria or resume matching. Use this action when you need to find job postings that match specific requirements such as skills, experience, location, education, or to find jobs matching a candidate's resume. Returns ranked results with detailed match scores. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.jobDescriptionSearch.createJobDescriptionSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `resume` | `string` | No | — | | `skills` | `any[]` | No | — | | `degrees` | `any[]` | No | — | | `indices` | `any[]` | Yes | — | | `socCodes` | `any[]` | No | — | | `jobTitles` | `any[]` | No | — | | `languages` | `any[]` | No | — | | `locations` | `any[]` | No | — | | `customData` | `any[]` | No | — | | `degreeTypes` | `any[]` | No | — | | `skillsWeight` | `number` | No | — | | `socCodesWeight` | `number` | No | — | | `degreesRequired` | `boolean` | No | — | | `educationWeight` | `number` | No | — | | `jobTitlesWeight` | `number` | No | — | | `languagesWeight` | `number` | No | — | | `locationsWeight` | `number` | No | — | | `managementLevel` | `string` | No | — | | `searchExpression` | `string` | No | — | | `socCodesRequired` | `boolean` | No | — | | `jobTitlesRequired` | `boolean` | No | — | | `locationsRequired` | `boolean` | No | — | | `degreeTypesRequired` | `boolean` | No | — | | `totalYearsExperience` | `number` | No | — | | `managementLevelWeight` | `number` | No | — | | `yearsExperienceWeight` | `number` | No | — | | `searchExpressionWeight` | `number` | No | — | | `managementLevelRequired` | `boolean` | No | — | | `yearsExperienceRequired` | `boolean` | No | — | | `searchExpressionRequired` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createJobDescriptionSearchEmbedUrl `jobDescriptionSearch.createJobDescriptionSearchEmbedUrl` Tool to create and return a signed URL for the embeddable job description search tool. Use this when you need to generate a URL that can be embedded on a web page to provide job description search functionality. Optionally pass config\_override to customize display settings, field weights, and theme. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.jobDescriptionSearch.createJobDescriptionSearchEmbedUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `configOverride` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **configOverride full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getJobDescriptionSearchConfig `jobDescriptionSearch.getJobDescriptionSearchConfig` Tool to get the configuration for the logged in user's embeddable job description search tool. Returns display settings, field weights, and maximum results limits. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.affinda.api.jobDescriptionSearch.getJobDescriptionSearchConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateJobDescriptionSearchConfig `jobDescriptionSearch.updateJobDescriptionSearchConfig` Tool to update the configuration for the logged in user's embeddable job description search tool. Use to configure display fields, field weights, maximum results, and UI customization options. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.jobDescriptionSearch.updateJobDescriptionSearchConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `number` | No | — | | `actions` | `any[]` | No | — | | `indices` | `any[]` | No | — | | `username` | `string` | No | — | | `maxResults` | `number` | No | — | | `hideToolbar` | `boolean` | No | — | | `distanceUnit` | `string` | No | — | | `weightSkills` | `number` | No | — | | `displaySkills` | `boolean` | No | — | | `hideSidePanel` | `boolean` | No | — | | `weightJobTitle` | `number` | No | — | | `weightKeywords` | `number` | No | — | | `weightLocation` | `number` | No | — | | `displayJobTitle` | `boolean` | No | — | | `displayKeywords` | `boolean` | No | — | | `displayLocation` | `boolean` | No | — | | `searchToolTheme` | `object` | No | — | | `weightEducation` | `number` | No | — | | `weightLanguages` | `number` | No | — | | `allowPdfDownload` | `boolean` | No | — | | `displayEducation` | `boolean` | No | — | | `displayLanguages` | `boolean` | No | — | | `showIndexDropdown` | `boolean` | No | — | | `customFieldsConfig` | `any[]` | No | — | | `weightManagementLevel` | `number` | No | — | | `weightOccupationGroup` | `number` | No | — | | `weightYearsExperience` | `number` | No | — | | `displayManagementLevel` | `boolean` | No | — | | `displayOccupationGroup` | `boolean` | No | — | | `displayYearsExperience` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **searchToolTheme full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Mappings ### createMapping `mappings.createMapping` Tool to create a custom mapping for a data source. Use when you need to configure specific lookup settings for a MappingDataSource. Note: This endpoint is deprecated. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.mappings.createMapping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orderBy` | `string` | No | — | | `dataSource` | `string` | Yes | — | | `scoreCutoff` | `number` | No | — | | `organization` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteMapping `mappings.deleteMapping` Tool to delete a specific mapping by its identifier. Use when you need to remove an unused or incorrect mapping from the database. Note: This endpoint is deprecated. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.mappings.deleteMapping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getMapping `mappings.getMapping` Tool to retrieve a specific mapping by its identifier. Use when you need to fetch mapping configuration details for a lookup against a MappingDataSource. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.mappings.getMapping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listMappings `mappings.listMappings` Tool to retrieve the list of all custom data mappings. Use when you need to list mappings for a specific data source. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.mappings.listMappings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `mappingDataSource` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateMapping `mappings.updateMapping` Tool to update a specific mapping's settings. Use when you need to adjust score cutoff or ordering for a lookup against a MappingDataSource. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.mappings.updateMapping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orderBy` | `string` | No | — | | `identifier` | `string` | Yes | — | | `scoreCutoff` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Occupation Groups ### listOccupationGroups `occupationGroups.listOccupationGroups` Tool to retrieve the list of searchable occupation groups. Use when you need to get available occupation categories for job matching or classification. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.affinda.api.occupationGroups.listOccupationGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Organization Memberships ### getAllOrganizationMemberships `organizationMemberships.getAllOrganizationMemberships` Retrieve all organization memberships across the account. Returns paginated results showing which users belong to which organizations. Use to audit organization access or find specific user memberships. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.organizationMemberships.getAllOrganizationMemberships({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `organization` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrganizationMembership `organizationMemberships.getOrganizationMembership` Tool to retrieve details of a specific organization membership by its ID. Use when you need to confirm a user's role and details within an organization. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.organizationMemberships.getOrganizationMembership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateOrganizationMembership `organizationMemberships.updateOrganizationMembership` Tool to update an organization membership's role. Use when you need to change a user's role within an organization. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.organizationMemberships.updateOrganizationMembership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `string` | No | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Organizations ### createOrganization `organizations.createOrganization` Tool to create a new organization. Use when you have a unique organization name and want to group resources under it. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.organizations.createOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteOrganization `organizations.deleteOrganization` Permanently deletes an organization from Affinda. This action is destructive and cannot be undone. All workspaces, collections, and documents associated with the organization will also be deleted. Use the get\_organizations action first to confirm the organization identifier before deletion. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.organizations.deleteOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrganization `organizations.getOrganization` Tool to retrieve details of a specific organization by its ID. Use when you need to fetch an organization's metadata after confirming its identifier. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.organizations.getOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrganizations `organizations.getOrganizations` Retrieves all organizations accessible to the authenticated user. Returns a list of organizations with details including identifier, name, user role, trial status, and configuration settings. Use the 'identifier' field from the response when calling other organization-related endpoints. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.affinda.api.organizations.getOrganizations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateOrganization `organizations.updateOrganization` Tool to update specific fields of an organization. Use when you need to modify an organization's name, avatar, or webhook and validation settings after creation. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.organizations.updateOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `avatar` | `string` | No | — | | `identifier` | `string` | Yes | — | | `resthook_signature_key` | `string` | No | — | | `validation_tool_config` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **validation\_tool\_config full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Resthooks ### createResthookSubscription `resthooks.createResthookSubscription` Tool to create a new RESTHook subscription. Use after confirming your webhook endpoint is ready to receive document event notifications. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.resthooks.createResthookSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event` | `string` | No | — | | `targetUrl` | `string` | Yes | — | | `organization` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteResthookSubscription `resthooks.deleteResthookSubscription` Tool to delete a specific resthook subscription by ID. Use after confirming the subscription identifier when the webhook is no longer needed. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.resthooks.deleteResthookSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getResthookSubscription `resthooks.getResthookSubscription` Tool to retrieve details of a specific resthook subscription by its ID. Use after confirming its creation to verify its settings. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.resthooks.getResthookSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getResthookSubscriptions `resthooks.getResthookSubscriptions` Tool to retrieve a list of all RESTHook subscriptions. Use after authenticating to list all webhook subscriptions associated with your account. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.resthooks.getResthookSubscriptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateResthookSubscription `resthooks.updateResthookSubscription` Tool to update an existing RESTHook subscription. Use after confirming the subscription identifier to modify its URL, event, or activation status. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.resthooks.updateResthookSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event` | `string` | No | — | | `active` | `boolean` | No | — | | `targetUrl` | `string` | No | — | | `identifier` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Resume Search ### createResumeSearch `resumeSearch.createResumeSearch` Tool to search through parsed resumes using three methods: match to a job description, match to a resume, or custom criteria. Use when you need to find candidates matching specific requirements. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.resumeSearch.createResumeSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `resume` | `string` | No | — | | `skills` | `any[]` | No | — | | `degrees` | `any[]` | No | — | | `indices` | `any[]` | Yes | — | | `socCodes` | `any[]` | No | — | | `jobTitles` | `any[]` | No | — | | `languages` | `any[]` | No | — | | `locations` | `any[]` | No | — | | `customData` | `any[]` | No | — | | `institutions` | `any[]` | No | — | | `skillsWeight` | `number` | No | — | | `jobDescription` | `string` | No | — | | `socCodesWeight` | `number` | No | — | | `degreesRequired` | `boolean` | No | — | | `educationWeight` | `number` | No | — | | `jobTitlesWeight` | `number` | No | — | | `languagesWeight` | `number` | No | — | | `locationsWeight` | `number` | No | — | | `managementLevel` | `string` | No | — | | `isCurrentStudent` | `boolean` | No | — | | `isRecentGraduate` | `boolean` | No | — | | `searchExpression` | `string` | No | — | | `socCodesRequired` | `boolean` | No | — | | `jobTitlesRequired` | `boolean` | No | — | | `locationsRequired` | `boolean` | No | — | | `highestDegreeTypes` | `any[]` | No | — | | `yearsExperienceMax` | `number` | No | — | | `yearsExperienceMin` | `number` | No | — | | `institutionsRequired` | `boolean` | No | — | | `jobTitlesCurrentOnly` | `boolean` | No | — | | `managementLevelWeight` | `number` | No | — | | `yearsExperienceWeight` | `number` | No | — | | `searchExpressionWeight` | `number` | No | — | | `managementLevelRequired` | `boolean` | No | — | | `yearsExperienceRequired` | `boolean` | No | — | | `isCurrentStudentRequired` | `boolean` | No | — | | `isRecentGraduateRequired` | `boolean` | No | — | | `searchExpressionRequired` | `boolean` | No | — | | `highestDegreeTypesRequired` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createResumeSearchEmbedUrl `resumeSearch.createResumeSearchEmbedUrl` Tool to create and return a signed URL for the embeddable resume search tool. Use this when you need to generate a URL that can be embedded on a web page to provide resume search functionality. Optionally pass config\_override to customize display settings, field weights, and theme. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.resumeSearch.createResumeSearchEmbedUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `configOverride` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **configOverride full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listResumeSearchConfig `resumeSearch.listResumeSearchConfig` Tool to get the configuration for the logged in user's embeddable resume search tool. Use this to retrieve display field settings, search weights, maximum results, and theme customization options for the resume search interface. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.affinda.api.resumeSearch.listResumeSearchConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listResumeSearchJobTitleSuggestions `resumeSearch.listResumeSearchJobTitleSuggestions` Tool to get job title suggestions based on provided job title(s). Use when you need to find related job titles for resume search. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.resumeSearch.listResumeSearchJobTitleSuggestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_titles` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listResumeSearchSkillSuggestions `resumeSearch.listResumeSearchSkillSuggestions` Tool to get skill suggestions based on provided skills. Use when you need to find related skills to expand or refine resume search queries. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.resumeSearch.listResumeSearchSkillSuggestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skills` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateResumeSearchConfig `resumeSearch.updateResumeSearchConfig` Tool to update the configuration for the logged in user's embeddable resume search tool. Use this to modify which fields are displayed, their search weights, maximum results limit, distance units, custom actions, and theme settings. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.resumeSearch.updateResumeSearchConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `number` | No | — | | `actions` | `any[]` | No | — | | `indices` | `any[]` | No | — | | `username` | `string` | No | — | | `maxResults` | `number` | No | — | | `hideToolbar` | `boolean` | No | — | | `distanceUnit` | `string` | No | — | | `weightSkills` | `number` | No | — | | `displaySkills` | `boolean` | No | — | | `hideSidePanel` | `boolean` | No | — | | `weightJobTitle` | `number` | No | — | | `weightKeywords` | `number` | No | — | | `weightLocation` | `number` | No | — | | `displayJobTitle` | `boolean` | No | — | | `displayKeywords` | `boolean` | No | — | | `displayLocation` | `boolean` | No | — | | `searchToolTheme` | `object` | No | — | | `weightEducation` | `number` | No | — | | `weightLanguages` | `number` | No | — | | `allowPdfDownload` | `boolean` | No | — | | `displayEducation` | `boolean` | No | — | | `displayLanguages` | `boolean` | No | — | | `showIndexDropdown` | `boolean` | No | — | | `customFieldsConfig` | `any[]` | No | — | | `weightManagementLevel` | `number` | No | — | | `weightOccupationGroup` | `number` | No | — | | `weightYearsExperience` | `number` | No | — | | `displayManagementLevel` | `boolean` | No | — | | `displayOccupationGroup` | `boolean` | No | — | | `displayYearsExperience` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **searchToolTheme full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Tags ### createTag `tags.createTag` Creates a new tag in the specified workspace. Tags can be used to categorize and label documents for organization and filtering. Each tag name must be unique within its workspace. Returns the created tag with its ID and metadata. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.tags.createTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteTag `tags.deleteTag` Permanently delete a tag from Affinda by its ID. This is a destructive operation that cannot be undone. Use Get Tags first to verify the tag ID before deletion. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.tags.deleteTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAllTags `tags.getAllTags` Tool to list all tags. Use after confirming authentication to fetch tags across workspaces. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.tags.getAllTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `workspace` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTag `tags.getTag` Tool to retrieve details of a specific tag by its ID. Use when you need to fetch information about a particular tag. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.tags.getTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateTag `tags.updateTag` Tool to update data of a tag. Use when you need to modify a tag's name or reassign it to a different workspace. Only provide the fields you want to change; other fields will remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.tags.updateTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `workspace` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Validation ### splitDocumentPages `validation.splitDocumentPages` Split a document into multiple documents by dividing its pages. Use when you need to separate a multi-page document into distinct documents based on page groupings. Prerequisites: - Obtain the document identifier from create\_document or get\_document actions - Use get\_document to retrieve page IDs for the pages you want to split Important notes: - Each page can only be assigned to one split - All pages should be accounted for across all splits - One split can optionally use the original document identifier to maintain the root document **Risk:** `write` ```ts theme={null} await corsair.affinda.api.validation.splitDocumentPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `splits` | `any[]` | Yes | — | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Validation Results ### createValidationResult `validationResults.createValidationResult` Create a validation result for document annotations in Affinda. Use this tool to record validation outcomes after parsing a document. Validation results track whether specific annotations (extracted data fields) pass or fail business rules. Prerequisites: 1. Get a document identifier from Get Documents or Create Document 2. Get annotation IDs from Get Annotations for that document 3. Define a kebab-case rule slug that identifies your validation rule Example use cases: - Recording that an invoice total matches the sum of line items - Marking that a required field is present and valid - Logging validation failures for review workflows **Risk:** `write` ```ts theme={null} await corsair.affinda.api.validationResults.createValidationResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `passed` | `boolean` | No | — | | `message` | `string` | Yes | — | | `document` | `string` | Yes | — | | `ruleSlug` | `string` | Yes | — | | `annotations` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createValidationResultsBatch `validationResults.createValidationResultsBatch` Batch create multiple validation results for document annotations in a single API call. Use this action to efficiently record validation outcomes for multiple documents or rules at once, rather than making individual create requests for each validation result. This is particularly useful for bulk validation workflows or when validating multiple rules across many documents. Prerequisites: - Obtain document identifiers from Get Documents or Create Document actions - Get annotation IDs from Get Annotations for those documents - Define kebab-case rule slugs that identify your validation rules Common use cases: - Bulk recording of validation results across multiple documents - Validating multiple business rules on the same document - Automated validation workflows for large document batches **Risk:** `write` ```ts theme={null} await corsair.affinda.api.validationResults.createValidationResultsBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `validation_results` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteValidationResults `validationResults.deleteValidationResults` Delete multiple validation results in a single API call. Use this action to efficiently remove multiple validation results at once rather than making individual delete requests for each validation result. Prerequisites: - Obtain validation result IDs using the 'Get All Validation Results' action Common use cases: - Removing obsolete validation results in bulk - Cleaning up validation results after reprocessing documents - Deleting validation results for specific documents programmatically **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.validationResults.deleteValidationResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAllValidationResults `validationResults.getAllValidationResults` Tool to list validation results for documents. Use after processing documents to inspect validation outcomes. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.validationResults.getAllValidationResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `document` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Workspace Memberships ### createWorkspaceMembership `workspaceMemberships.createWorkspaceMembership` Tool to add a user to a workspace by creating a membership. Use when you need to grant a user access to a specific workspace. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.workspaceMemberships.createWorkspaceMembership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `number` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteWorkspaceMembership `workspaceMemberships.deleteWorkspaceMembership` Tool to remove a user from a workspace by membership ID. Use after confirming the workspace membership ID to revoke access. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.workspaceMemberships.deleteWorkspaceMembership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAllWorkspaceMemberships `workspaceMemberships.getAllWorkspaceMemberships` Retrieve all workspace memberships across the account. Returns paginated results showing which users belong to which workspaces. Use to audit workspace access or find specific user memberships. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.workspaceMemberships.getAllWorkspaceMemberships({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `workspace` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWorkspaceMembership `workspaceMemberships.getWorkspaceMembership` Tool to retrieve details of a specific workspace membership by its ID. Use when you need to confirm a user's role and details within a workspace after obtaining the membership identifier. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.workspaceMemberships.getWorkspaceMembership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Workspaces ### createWorkspace `workspaces.createWorkspace` Tool to create a new workspace. Use when you need to programmatically create a workspace container within an organization. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.workspaces.createWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `visibility` | `string` | No | — | | `organization` | `string` | Yes | — | | `rejectInvalidDocuments` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteWorkspace `workspaces.deleteWorkspace` Tool to delete a specific workspace by its ID. Use when you need to remove an unused workspace after confirming the workspace ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.affinda.api.workspaces.deleteWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getUsageByWorkspace `workspaces.getUsageByWorkspace` Retrieves monthly document processing usage statistics for a specific workspace. Returns a list of usage records showing how many documents were processed each month. Use this to track workspace activity, monitor consumption trends, or generate usage reports. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.workspaces.getUsageByWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `end` | `string` | No | — | | `start` | `string` | No | — | | `workspace_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWorkspace `workspaces.getWorkspace` Tool to retrieve details of a specific workspace by its ID. Use when you need full workspace metadata after confirming its identifier. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.workspaces.getWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWorkspaces `workspaces.getWorkspaces` Tool to retrieve a list of all workspaces. Use when you need to list workspaces filtered by organization and optional name. **Risk:** `read` ```ts theme={null} await corsair.affinda.api.workspaces.getWorkspaces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `organization` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateWorkspace `workspaces.updateWorkspace` Tool to update specific fields of a workspace. Use when you need to modify a workspace's name, visibility, document rejection policy, or other settings. Only provide the fields you want to change; other fields will remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.affinda.api.workspaces.updateWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `visibility` | `string` | No | — | | `workspace_id` | `string` | Yes | — | | `documentTypes` | `any[]` | No | — | | `documentSplitter` | `string` | No | — | | `rejectDuplicates` | `boolean` | No | — | | `rejectInvalidDocuments` | `boolean` | No | — | | `whitelistIngestAddresses` | `any[]` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/affinda/database Affinda local sync: searchable entities, `.search()` filters, and operators. The Affinda plugin syncs data locally. Use `corsair.affinda.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Collections Path: `affinda.db.collections.search` ```ts theme={null} const rows = await corsair.affinda.db.collections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `identifier` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `extractor` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Documents Path: `affinda.db.documents.search` ```ts theme={null} const rows = await corsair.affinda.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `identifier` | `string` | equals, contains, startsWith, endsWith, in | | `fileName` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `ready` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `affinda.db.workspaces.search` ```ts theme={null} const rows = await corsair.affinda.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `identifier` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/affinda/overview AI document parsing for resumes, invoices, and structured data extraction from files. Use **Affinda** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 119 typed API operations * 3 synced entities (`collections`, `documents`, `workspaces`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/affinda ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/affinda ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/affinda ``` ```bash bun theme={null} bun add corsair @corsair-dev/affinda ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { affinda } from '@corsair-dev/affinda'; export const corsair = createCorsair({ plugins: [ affinda(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} affinda() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'affinda', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`annotations.getAnnotations`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.affinda.api.annotations.getAnnotations({}); ``` **`annotations.batchUpdateAnnotations`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.affinda.api.annotations.batchUpdateAnnotations({}); ``` See the full list on the [API](/plugins/affinda/api) page. ## Query synced data Synced entities support `tenant.affinda.db..search()` and `.list()`: `collections`, `documents`, `workspaces`. See [Database](/plugins/affinda/database) for filters and operators. ## What's next > **[API reference](/plugins/affinda/api)** > > Every `affinda.api.*` operation with input and output types. > **[Database](/plugins/affinda/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/agencyzoom/api API reference for AgencyZoom: every `agencyzoom.api.*` operation with input and output types. Every `agencyzoom.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Auth ### logTheUserIn `auth.logTheUserIn` Authenticates an existing AgencyZoom user using their email (as username) and password to obtain a JWT for API access; this action does not support new user creation. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.auth.logTheUserIn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `password` | `string` | Yes | — | | `username` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `jwt` | `string` | Yes | — | | `ownerAgent` | `boolean` | No | — | *** ### logTheUserOut `auth.logTheUserOut` Use this action to log the current user out of AgencyZoom by invalidating their active session token. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.auth.logTheUserOut({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### v4SsoLogTheUserIn `auth.v4SsoLogTheUserIn` Logs a user into the AgencyZoom platform via Single Sign-On (SSO). Returns JWT on success or error details on authentication failure. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.auth.v4SsoLogTheUserIn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `password` | `string` | Yes | — | | `username` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `jwt` | `string` | Yes | — | | `ownerAgent` | `boolean` | No | — | *** ## Contact ### batchCreateContact `contact.batchCreateContact` Creates 1 to 5 new contacts in AgencyZoom in a single batch API call. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.contact.batchCreateContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactDataRequests` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Customers ### createACustomerNote `customers.createACustomerNote` Adds a new note to an existing customer's profile using their ID; cannot be used to edit or retrieve existing notes. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.customers.createACustomerNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `note` | `string` | Yes | — | | `customerId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### deleteACustomer `customers.deleteACustomer` Irreversibly deletes a customer and all associated data in AgencyZoom using their `customerId`; useful for offboarding or data privacy compliance. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.customers.deleteACustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### deleteACustomerFile `customers.deleteACustomerFile` Permanently deletes a specific file, identified by `fileId`, associated with a customer, identified by `customerId`. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.customers.deleteACustomerFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `number` | Yes | — | | `customerId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### deleteACustomerPolicy `customers.deleteACustomerPolicy` Permanently deletes a specific policy associated with a customer, for instance, if it's cancelled or inactive; this action is irreversible and requires caution. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.customers.deleteACustomerPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `policyId` | `number` | Yes | — | | `customerId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAmsPoliciesForACustomer `customers.getAmsPoliciesForACustomer` Retrieves a customer's synchronized Agency Management System (AMS) policy data (typically a single policy); requires an active AMS integration, may return empty/default values if data is missing. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.customers.getAmsPoliciesForACustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getPoliciesForACustomer `customers.getPoliciesForACustomer` Retrieves from AgencyZoom all insurance policies for an existing customer (identified by `customerId`), including policy details like type, carrier, premium, effective dates, and assigned agents. Excludes premium payment history or claims information. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.customers.getPoliciesForACustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getTheCustomerDetails `customers.getTheCustomerDetails` Fetches comprehensive details for a specific customer, including personal information, policies, notes, tasks, files, and custom fields, using their unique customer ID. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.customers.getTheCustomerDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `businessName` | `string` | No | — | | `firstname` | `string` | No | — | | `lastname` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `customerType` | `string` | No | — | *** ### getTheCustomerTasks `customers.getTheCustomerTasks` Fetches all tasks (read-only task data) for a customer by `customerId` to review their activities, follow-ups, and action items; the `customerId` must be valid. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.customers.getTheCustomerTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### searchCustomers `customers.searchCustomers` Searches for customers in AgencyZoom using criteria like contact information, policy details, or custom fields, with options for filtering, sorting, and pagination. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.customers.searchCustomers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateCustomer `customers.updateCustomer` Updates an existing customer's information in AgencyZoom using their unique customerId. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.customers.updateCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zip` | `string` | No | — | | `city` | `string` | No | — | | `csrId` | `number` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `state` | `string` | No | — | | `agentId` | `number` | No | — | | `country` | `string` | No | — | | `birthday` | `string` | No | — | | `lastname` | `string` | No | — | | `tagNames` | `string` | No | — | | `firstname` | `string` | No | — | | `createDate` | `string` | No | — | | `customerId` | `number` | Yes | — | | `bizCustomer` | `number` | No | — | | `customFields` | `any[]` | No | — | | `totalPayroll` | `number` | No | — | | `annualRevenue` | `number` | No | — | | `streetAddress` | `string` | No | — | | `secondaryEmail` | `string` | No | — | | `secondaryPhone` | `string` | No | — | | `contactLastname` | `string` | No | — | | `contactFirstname` | `string` | No | — | | `contactMiddlename` | `string` | No | — | | `numberOfEmployees` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `businessName` | `string` | No | — | | `firstname` | `string` | No | — | | `lastname` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `customerType` | `string` | No | — | *** ## Email Threads ### deleteMessage `emailThreads.deleteMessage` Deletes a specific message from an email thread within AgencyZoom. Requires the message ID to identify which message to remove. Returns the updated thread information with the remaining messages after deletion. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.emailThreads.deleteMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### deleteThread `emailThreads.deleteThread` Permanently deletes a specific email thread from the AgencyZoom system, identified by its `threadId` (expected by the endpoint), provided the thread exists. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.emailThreads.deleteThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getThreadDetails `emailThreads.getThreadDetails` Searches and retrieves detailed information for email threads in AgencyZoom; no explicit search criteria are passed in this request. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.emailThreads.getThreadDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `threadId` | `string` | No | — | | `searchTerm` | `string` | No | — | | `status` | `number` | No | — | | `lastDateUTC` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### markThreadAsUnreadApiEndpoint `emailThreads.markThreadAsUnreadApiEndpoint` Marks an email thread in AgencyZoom as read or unread using its `threadId`; this action does not modify message content and the specified `threadId` must refer to an existing thread. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.emailThreads.markThreadAsUnreadApiEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `markUnread` | `boolean` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### searchEmailThreads `emailThreads.searchEmailThreads` Retrieves a list of email thread metadata from AgencyZoom, suitable for an overview when no specific filtering, sorting, or pagination is needed, as results are subject to default server-side limits and ordering. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.emailThreads.searchEmailThreads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Leads ### batchCreateLead `leads.batchCreateLead` Creates up to 5 new leads in AgencyZoom; all referenced entity IDs (e.g., pipeline, user, custom field names) must exist, and organization `name` is required if `isBusiness` is true. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.batchCreateLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadDataRequests` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### changeStatusForLead `leads.changeStatusForLead` Updates a lead's lifecycle status (e.g., Active, Won, Lost, X-Dated) and can optionally manage its workflow, pipeline, stage, source, or associated tags. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.changeStatusForLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `leadId` | `number` | Yes | — | | `status` | `number` | Yes | — | | `tagIds` | `any[]` | No | — | | `toStageId` | `number` | No | — | | `xDateType` | `string` | No | — | | `workflowId` | `number` | No | — | | `lossReasonId` | `number` | No | — | | `recycleToStage` | `number` | No | — | | `workflowStageId` | `number` | No | — | | `recycleToPipeline` | `number` | No | — | | `changeLeadSourceTo` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### createALeadNote `leads.createALeadNote` Adds a new note to an existing lead in AgencyZoom, identified by `leadId`. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.createALeadNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `note` | `string` | Yes | — | | `leadId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### createALeadOpportunity `leads.createALeadOpportunity` Adds a new sales opportunity to an existing lead in AgencyZoom, requiring a valid `leadId`, `carrierId`, `productLineId`, and that custom field names match existing definitions in AgencyZoom. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.createALeadOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `number` | No | — | | `leadId` | `number` | Yes | — | | `premium` | `number` | Yes | — | | `carrierId` | `number` | Yes | — | | `customFields` | `any[]` | No | — | | `productLineId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### createALeadQuote `leads.createALeadQuote` Creates a new insurance quote for an existing lead in AgencyZoom, using valid carrier and product line IDs, to track a proposal; this action does not bind policies or process payments. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.createALeadQuote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `number` | Yes | — | | `leadId` | `number` | Yes | — | | `premium` | `number` | Yes | — | | `carrierId` | `number` | Yes | — | | `customFields` | `any[]` | No | — | | `productLineId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### createBizLead `leads.createBizLead` Creates or updates a business lead in AgencyZoom using detailed personal and company information, for B2B sales and marketing lead management. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.createBizLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dba` | `string` | No | — | | `fax` | `string` | No | — | | `zip` | `string` | No | — | | `city` | `string` | No | — | | `fein` | `string` | No | — | | `name` | `string` | Yes | — | | `csrId` | `number` | No | — | | `email` | `string` | Yes | — | | `notes` | `string` | No | — | | `phone` | `string` | No | — | | `state` | `string` | No | — | | `xDate` | `string` | No | — | | `country` | `string` | Yes | — | | `payroll` | `string` | No | — | | `stageId` | `number` | Yes | — | | `assignTo` | `string` | Yes | — | | `lastname` | `string` | No | — | | `soldDate` | `string` | No | — | | `tagNames` | `string` | No | — | | `firstname` | `string` | Yes | — | | `groupCode` | `string` | No | — | | `otherCsrs` | `any[]` | No | — | | `quoteDate` | `string` | No | — | | `middlename` | `string` | No | — | | `pipelineId` | `number` | Yes | — | | `contactDate` | `string` | No | — | | `agencyNumber` | `string` | No | — | | `customFields` | `any[]` | No | — | | `leadSourceId` | `number` | Yes | — | | `annualRevenue` | `string` | No | — | | `streetAddress` | `string` | No | — | | `departmentCode` | `string` | No | — | | `otherProducers` | `any[]` | No | — | | `secondaryEmail` | `string` | No | — | | `secondaryPhone` | `string` | No | — | | `assignmentGroupId` | `number` | No | — | | `numberOfEmployees` | `number` | No | — | | `nextExpirationDate` | `string` | No | — | | `streetAddressLine2` | `string` | No | — | | `yearBusinessStarted` | `string` | No | — | | `businessClassification` | `number` | No | — | | `yearsOfManagementExperience` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### createLead `leads.createLead` Creates a new lead or updates an existing one in AgencyZoom; ensure `pipelineId`, `stageId`, `leadSourceId`, and `assignTo` reference valid, existing entities. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.createLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zip` | `string` | No | — | | `city` | `string` | No | — | | `name` | `string` | No | — | | `csrId` | `number` | No | — | | `email` | `string` | Yes | — | | `notes` | `string` | No | — | | `phone` | `string` | No | — | | `state` | `string` | No | — | | `xDate` | `string` | No | — | | `country` | `string` | Yes | — | | `stageId` | `number` | Yes | — | | `assignTo` | `string` | Yes | — | | `birthday` | `string` | No | — | | `lastname` | `string` | No | — | | `nickname` | `string` | No | — | | `soldDate` | `string` | No | — | | `tagNames` | `string` | No | — | | `firstname` | `string` | Yes | — | | `groupCode` | `string` | No | — | | `otherCsrs` | `any[]` | No | — | | `quoteDate` | `string` | No | — | | `isBusiness` | `boolean` | No | — | | `middlename` | `string` | No | — | | `pipelineId` | `number` | Yes | — | | `contactDate` | `string` | No | — | | `agencyNumber` | `string` | No | — | | `customFields` | `any[]` | No | — | | `leadSourceId` | `number` | Yes | — | | `maritalStatus` | `number` | No | — | | `streetAddress` | `string` | No | — | | `departmentCode` | `string` | No | — | | `otherProducers` | `any[]` | No | — | | `secondaryEmail` | `string` | No | — | | `secondaryPhone` | `string` | No | — | | `assignmentGroupId` | `number` | No | — | | `nextExpirationDate` | `string` | No | — | | `streetAddressLine2` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `firstname` | `string` | No | — | | `middlename` | `string` | No | — | | `lastname` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `status` | `string \| number` | No | — | | `leadSourceId` | `number` | No | — | | `pipelineId` | `number` | No | — | | `stageId` | `number` | No | — | *** ### deleteALeadFile `leads.deleteALeadFile` Deletes a specific file (identified by `fileId`) associated with an existing lead (identified by `leadId`); this operation is irreversible. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.leads.deleteALeadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `number` | Yes | — | | `leadId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### deleteALeadOpportunity `leads.deleteALeadOpportunity` Permanently deletes an existing opportunity (by `opportunityId`) associated with an existing lead (by `leadId`) when it's irrelevant, closed, or erroneous; the lead itself remains. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.leads.deleteALeadOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `number` | Yes | — | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### deleteALeadQuote `leads.deleteALeadQuote` Deletes a specific quote from a lead, requiring that the lead and quote exist and are associated. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.leads.deleteALeadQuote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `number` | Yes | — | | `quoteId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getLeadFiles `leads.getLeadFiles` Retrieves metadata (id, title, MIME type, size, dates, creator info) for files attached to leads in AgencyZoom. Optionally filter by `leadId` to get files for a specific lead, or omit to retrieve files across all leads. Returns file metadata only, not the actual file content. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.leads.getLeadFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `leadId` | `number` | No | — | | `fileType` | `number` | No | — | | `customerReferralId` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getLeadNotes `leads.getLeadNotes` Fetches the complete history of notes for a specific lead by `leadId` (which must exist), useful for reviewing context for communications or follow-ups; this is a read-only operation. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.leads.getLeadNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getLeadQuotes `leads.getLeadQuotes` Retrieves all insurance quotes (active and inactive) for a specific lead ID, useful for reviewing or tracking quote history. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.leads.getLeadQuotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getLeadTasks `leads.getLeadTasks` Retrieves all tasks for a specific lead, identified by its `leadId`, to review its activity history or manage follow-ups. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.leads.getLeadTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getTheLeadDetails `leads.getTheLeadDetails` Retrieves comprehensive details for a specific lead in AgencyZoom by its unique `leadId` (which must correspond to an existing lead), including contact information, status, associated opportunities, quotes/policies, custom fields, and interaction history. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.leads.getTheLeadDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `firstname` | `string` | No | — | | `middlename` | `string` | No | — | | `lastname` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `status` | `string \| number` | No | — | | `leadSourceId` | `number` | No | — | | `pipelineId` | `number` | No | — | | `stageId` | `number` | No | — | *** ### getTheOpportunitiesForALead `leads.getTheOpportunitiesForALead` Retrieves all sales opportunities and their details for a specified, existing `leadId` in AgencyZoom. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.leads.getTheOpportunitiesForALead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### moveLeadToSold `leads.moveLeadToSold` Marks an existing lead as sold by its `leadId` and records product details; `productLineId`, `premium`, `effectiveDate`, and `soldDate` are operationally required for each sold product, despite schema flexibility. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.moveLeadToSold({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `number` | Yes | — | | `keepOpen` | `boolean` | No | — | | `soldProducts` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### searchLeads `leads.searchLeads` Retrieves AgencyZoom leads, using filters, pagination, and sorting options sent in the POST body, as the request schema itself is empty. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.leads.searchLeads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalCount` | `number` | No | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `leads` | `object[]` | No | — | > **leads full type** > > ```ts theme={null} > { > id?: string | number, > firstname?: string, > middlename?: string, > lastname?: string, > email?: string, > phone?: string, > status?: string | number, > leadSourceId?: number, > pipelineId?: number, > stageId?: number > }[] > ``` *** ### searchLeadsCount `leads.searchLeadsCount` Retrieves a summary of lead counts categorized by workflow stage from AgencyZoom; this action does not support filtering and returns aggregate counts rather than individual lead details. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.leads.searchLeadsCount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateALeadFileName `leads.updateALeadFileName` Updates a lead's file name to `newFileName`; requires `fileId` of the target file, which must be associated with both the `leadId` (path parameter) and the provided `customerReferralId`. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.updateALeadFileName({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `number` | Yes | — | | `leadId` | `number` | Yes | — | | `newFileName` | `string` | Yes | — | | `customerReferralId` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateALeadOpportunity `leads.updateALeadOpportunity` Updates an existing opportunity's details (carrier, product line, premium, items, custom fields) for a specific lead; `leadId`, opportunity `id`, `carrierId`, and `productLineId` must refer to existing entities. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.updateALeadOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `items` | `number` | No | — | | `leadId` | `number` | Yes | — | | `premium` | `number` | Yes | — | | `carrierId` | `number` | Yes | — | | `customFields` | `any[]` | No | — | | `productLineId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateALeadQuote `leads.updateALeadQuote` Updates an existing quote for a specified lead in AgencyZoom when its details require revision, ensuring the provided `leadId` (path parameter), quote `id` (body parameter), `carrierId`, and `productLineId` are valid and correspond to existing entities. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.updateALeadQuote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `items` | `number` | Yes | — | | `leadId` | `number` | Yes | — | | `premium` | `number` | Yes | — | | `carrierId` | `number` | Yes | — | | `customFields` | `any[]` | No | — | | `productLineId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateBusinessLead `leads.updateBusinessLead` Updates an existing business lead in AgencyZoom. Requires leadId (path parameter) plus core business information fields: firstname, email, name (business name), pipelineId, stageId, leadSourceId, assignTo (producer ID), and country. All other fields are optional and will only update if provided. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.updateBusinessLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dba` | `string` | No | — | | `fax` | `string` | No | — | | `zip` | `string` | No | — | | `city` | `string` | No | — | | `fein` | `string` | No | — | | `name` | `string` | Yes | — | | `csrId` | `number` | No | — | | `email` | `string` | Yes | — | | `notes` | `string` | No | — | | `phone` | `string` | No | — | | `state` | `string` | No | — | | `xDate` | `string` | No | — | | `leadId` | `number` | Yes | — | | `country` | `string` | Yes | — | | `payroll` | `string` | No | — | | `stageId` | `number` | Yes | — | | `assignTo` | `string` | Yes | — | | `lastname` | `string` | No | — | | `soldDate` | `string` | No | — | | `tagNames` | `string` | No | — | | `firstname` | `string` | Yes | — | | `groupCode` | `string` | No | — | | `otherCsrs` | `any[]` | No | — | | `quoteDate` | `string` | No | — | | `middlename` | `string` | No | — | | `pipelineId` | `number` | Yes | — | | `contactDate` | `string` | No | — | | `agencyNumber` | `string` | No | — | | `customFields` | `any[]` | No | — | | `leadSourceId` | `number` | Yes | — | | `annualRevenue` | `string` | No | — | | `streetAddress` | `string` | No | — | | `departmentCode` | `string` | No | — | | `otherProducers` | `any[]` | No | — | | `secondaryEmail` | `string` | No | — | | `secondaryPhone` | `string` | No | — | | `assignmentGroupId` | `number` | No | — | | `numberOfEmployees` | `number` | No | — | | `nextExpirationDate` | `string` | No | — | | `streetAddressLine2` | `string` | No | — | | `yearBusinessStarted` | `string` | No | — | | `businessClassification` | `number` | No | — | | `yearsOfManagementExperience` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateLead `leads.updateLead` Updates an existing lead's information in AgencyZoom using the `leadId`; ensure the `leadId` corresponds to an existing lead in AgencyZoom. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.updateLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zip` | `string` | No | — | | `city` | `string` | No | — | | `name` | `string` | No | — | | `csrId` | `number` | No | — | | `email` | `string` | Yes | — | | `notes` | `string` | No | — | | `phone` | `string` | No | — | | `state` | `string` | No | — | | `xDate` | `string` | No | — | | `leadId` | `number` | Yes | — | | `country` | `string` | Yes | — | | `stageId` | `number` | Yes | — | | `assignTo` | `string` | Yes | — | | `birthday` | `string` | No | — | | `lastname` | `string` | No | — | | `nickname` | `string` | No | — | | `soldDate` | `string` | No | — | | `tagNames` | `string` | No | — | | `firstname` | `string` | Yes | — | | `groupCode` | `string` | No | — | | `otherCsrs` | `any[]` | No | — | | `quoteDate` | `string` | No | — | | `isBusiness` | `boolean` | No | — | | `middlename` | `string` | No | — | | `pipelineId` | `number` | Yes | — | | `contactDate` | `string` | No | — | | `agencyNumber` | `string` | No | — | | `customFields` | `any[]` | No | — | | `leadSourceId` | `number` | Yes | — | | `maritalStatus` | `number` | No | — | | `streetAddress` | `string` | No | — | | `departmentCode` | `string` | No | — | | `otherProducers` | `any[]` | No | — | | `secondaryEmail` | `string` | No | — | | `secondaryPhone` | `string` | No | — | | `assignmentGroupId` | `number` | No | — | | `nextExpirationDate` | `string` | No | — | | `streetAddressLine2` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `firstname` | `string` | No | — | | `middlename` | `string` | No | — | | `lastname` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `status` | `string \| number` | No | — | | `leadSourceId` | `number` | No | — | | `pipelineId` | `number` | No | — | | `stageId` | `number` | No | — | *** ### updateLeadStatusById `leads.updateLeadStatusById` Updates a lead's status (0=ACTIVE, 2=WON, 3=LOST, 5=XDATED) by `leadId`, optionally setting workflow, stage, date, loss reason, X-date type, source, recycle stage/pipeline, or tags; requires `date` and `xDateType` for status 5 (XDATED), and `lossReasonId` for status 3 (LOST). **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.leads.updateLeadStatusById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `leadId` | `number` | Yes | — | | `status` | `number` | Yes | — | | `tagIds` | `any[]` | No | — | | `toStageId` | `number` | No | — | | `xDateType` | `string` | No | — | | `workflowId` | `number` | No | — | | `lossReasonId` | `number` | No | — | | `recycleToStage` | `number` | No | — | | `workflowStageId` | `number` | No | — | | `recycleToPipeline` | `number` | No | — | | `changeLeadSourceTo` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Life ### searchLifeAndHealthLeads `life.searchLifeAndHealthLeads` Searches for life and health insurance leads by providing filter criteria (matching AlrLead fields) in the request body; an empty request may retrieve all leads or a default set. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.life.searchLifeAndHealthLeads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Opportunities ### createADriverForAnOpportunity `opportunities.createADriverForAnOpportunity` Creates a new driver record associated with an existing AgencyZoom opportunity using its ID; requires firstName and lastName, with optional fields for additional driver details. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.createADriverForAnOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gender` | `string` | No | — | | `birthday` | `string` | No | — | | `lastName` | `string` | Yes | — | | `firstName` | `string` | Yes | — | | `middleName` | `string` | No | — | | `relationship` | `string` | No | — | | `licenseNumber` | `string` | No | — | | `maritalStatus` | `number` | No | — | | `opportunityId` | `number` | Yes | — | | `stateLicensed` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### createAnOpportunity `opportunities.createAnOpportunity` Creates a new lead opportunity in AgencyZoom; this action cannot update existing opportunities. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.createAnOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `number` | No | — | | `premium` | `number` | No | — | | `carrierId` | `number` | No | — | | `expiryDate` | `string` | No | — | | `customFields` | `any[]` | No | — | | `productLineId` | `number` | Yes | — | | `property__zip` | `string` | No | — | | `property__city` | `string` | No | — | | `property__state` | `string` | No | — | | `property__country` | `string` | No | — | | `customerReferralId` | `number` | Yes | — | | `property__address1` | `string` | No | — | | `property__address2` | `string` | No | — | | `property__useMailingAddressAsLocation` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `carrierId` | `number` | No | — | | `productLineId` | `number` | No | — | | `premium` | `number` | No | — | | `items` | `number` | No | — | | `status` | `number` | No | — | *** ### createAVehicleForAnOpportunity `opportunities.createAVehicleForAnOpportunity` Adds a new vehicle record to a specified opportunity; `opportunityId` must refer to a valid, existing opportunity. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.createAVehicleForAnOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vin` | `string` | No | — | | `make` | `string` | Yes | — | | `year` | `number` | No | — | | `model` | `string` | No | — | | `ownership` | `string` | No | — | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### deleteADriver `opportunities.deleteADriver` Permanently deletes an existing driver record (a person associated with an insurance opportunity) from AgencyZoom using its unique `driverId`; this action is irreversible. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.opportunities.deleteADriver({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `driverId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### deleteAnOpportunity `opportunities.deleteAnOpportunity` Permanently deletes a specific opportunity by its unique ID; this action is irreversible and requires a valid, existing `opportunityId`. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.opportunities.deleteAnOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### deleteAVehicle `opportunities.deleteAVehicle` Permanently deletes a vehicle record by its `vehicleId`, which must correspond to an existing vehicle in the AgencyZoom system. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.opportunities.deleteAVehicle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vehicleId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfDriversForAnOpportunity `opportunities.getAListOfDriversForAnOpportunity` Retrieves a list of drivers (individuals), including their personal details, licensing information, and relationship status, associated with a specific, existing `opportunityId` in AgencyZoom. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.opportunities.getAListOfDriversForAnOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfVehiclesForAnOpportunity `opportunities.getAListOfVehiclesForAnOpportunity` Retrieves all vehicles associated with an existing opportunity, using its unique opportunityId. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.opportunities.getAListOfVehiclesForAnOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getTheDriverDetails `opportunities.getTheDriverDetails` Retrieves detailed information for a specific, existing driver (by `driverId`) associated with an AgencyZoom opportunity. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.opportunities.getTheDriverDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `driverId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getTheOpportunityDetails `opportunities.getTheOpportunityDetails` Fetches comprehensive details for an existing opportunity using its unique `opportunityId`. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.opportunities.getTheOpportunityDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `carrierId` | `number` | No | — | | `productLineId` | `number` | No | — | | `premium` | `number` | No | — | | `items` | `number` | No | — | | `status` | `number` | No | — | *** ### getTheVehicleDetails `opportunities.getTheVehicleDetails` Retrieves detailed information for a specific vehicle, often associated with an AgencyZoom opportunity, using its unique vehicleId. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.opportunities.getTheVehicleDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vehicleId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### linkADriverToOpportunity `opportunities.linkADriverToOpportunity` Assigns or reassigns an existing driver to an existing opportunity. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.linkADriverToOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `driverId` | `number` | Yes | — | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### linkAVehicleToOpportunity `opportunities.linkAVehicleToOpportunity` Links an existing vehicle to an existing sales opportunity in AgencyZoom using their respective IDs, typically for managing auto insurance policies or related services. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.linkAVehicleToOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vehicleId` | `number` | Yes | — | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### unlinkADriverFromOpportunity `opportunities.unlinkADriverFromOpportunity` Unlinks a currently associated driver from an AgencyZoom opportunity, used when the driver is no longer relevant, for policy or data updates, potentially impacting the opportunity's status or associated policy details. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.unlinkADriverFromOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `driverId` | `number` | Yes | — | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### unlinkAVehicleFromOpportunity `opportunities.unlinkAVehicleFromOpportunity` Unlinks a specific, existing vehicle from a specific, existing opportunity using their respective IDs, removing only the association and not the records themselves. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.unlinkAVehicleFromOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vehicleId` | `number` | Yes | — | | `opportunityId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateADriverSDetails `opportunities.updateADriverSDetails` Updates an existing driver's details in AgencyZoom, requiring `driverId` in the path and `firstName` and `lastName` in the request. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.updateADriverSDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gender` | `string` | No | — | | `birthday` | `string` | No | — | | `driverId` | `number` | Yes | — | | `lastName` | `string` | Yes | — | | `firstName` | `string` | Yes | — | | `middleName` | `string` | No | — | | `relationship` | `string` | No | — | | `licenseNumber` | `string` | No | — | | `maritalStatus` | `number` | No | — | | `stateLicensed` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateAnOpportunity `opportunities.updateAnOpportunity` Updates an existing opportunity with the provided details; ensure any custom field names are predefined in AgencyZoom configuration. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.updateAnOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `number` | No | — | | `premium` | `number` | No | — | | `carrierId` | `number` | No | — | | `expiryDate` | `string` | No | — | | `customFields` | `any[]` | No | — | | `opportunityId` | `number` | Yes | — | | `productLineId` | `number` | No | — | | `property__zip` | `string` | No | — | | `property__city` | `string` | No | — | | `property__state` | `string` | No | — | | `property__country` | `string` | No | — | | `property__address1` | `string` | No | — | | `property__address2` | `string` | No | — | | `property__useMailingAddressAsLocation` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `carrierId` | `number` | No | — | | `productLineId` | `number` | No | — | | `premium` | `number` | No | — | | `items` | `number` | No | — | | `status` | `number` | No | — | *** ### updateAVehicleSDetails `opportunities.updateAVehicleSDetails` Updates details for an existing vehicle within an opportunity; this action cannot be used to create new vehicle records. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.opportunities.updateAVehicleSDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vin` | `string` | No | — | | `make` | `string` | No | — | | `year` | `number` | No | — | | `model` | `string` | No | — | | `ownership` | `string` | No | — | | `vehicleId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Policies ### updateAPolicy `policies.updateAPolicy` Updates an existing insurance policy for the given `policyId`; monetary values must be in cents and dates in YYYY-MM-DD format. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.policies.updateAPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `number` | No | — | | `agentId` | `number` | No | — | | `premium` | `number` | No | — | | `policyId` | `number` | Yes | — | | `soldDate` | `string` | No | — | | `brokerFee` | `number` | No | — | | `carrierId` | `number` | No | — | | `groupCode` | `string` | No | — | | `expiryDate` | `string` | No | — | | `policyType` | `number` | No | — | | `insuredName` | `string` | No | — | | `agencyNumber` | `string` | No | — | | `leadSourceId` | `number` | No | — | | `policyNumber` | `string` | No | — | | `effectiveDate` | `string` | No | — | | `departmentCode` | `string` | No | — | | `priorExpiryDate` | `string` | No | — | | `priorCarrierName` | `string` | No | — | | `priorPolicyNumber` | `string` | No | — | | `productCategoryId` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateTagsForAPolicy `policies.updateTagsForAPolicy` Adds new comma-separated `tagNames` to a policy, requiring `tagNames` and identification by either `policyId` or `amsPolicyId`; if `amsPolicyId` is provided, `policyId` is ignored, and existing tags are not affected. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.policies.updateTagsForAPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `policyId` | `number` | No | — | | `tagNames` | `string` | Yes | — | | `amsPolicyId` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Profile ### updateMyProfile `profile.updateMyProfile` Updates the profile information (first name, last name, email, and optional phone) for the currently authenticated user in AgencyZoom; the provided email address must be unique within the system. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.profile.updateMyProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `phone` | `string` | No | — | | `lastname` | `string` | Yes | — | | `firstname` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Reference Data ### getAListOfAssignGroups `referenceData.getAListOfAssignGroups` Retrieves all assign groups configured in AgencyZoom, used for categorizing or assigning items to specific teams or units. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfAssignGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfCarriers `referenceData.getAListOfCarriers` Retrieves all insurance carriers from AgencyZoom, typically used for populating selection lists or synchronizing carrier data; does not return detailed policy or coverage information. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfCarriers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfCsrs `referenceData.getAListOfCsrs` Fetches all Customer Service Representatives (CSRs), including their ID and name, returning an empty list if none are configured. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfCsrs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfCustomFields `referenceData.getAListOfCustomFields` Retrieves metadata for all configured custom field definitions, not the specific values entered for individual records. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfCustomFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfEmployees `referenceData.getAListOfEmployees` Retrieves a complete list of all employees for the authenticated agency; returns an empty list if no employees are configured. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfEmployees({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfLeadSourceCategories `referenceData.getAListOfLeadSourceCategories` Retrieves a comprehensive list of all predefined lead source categories from AgencyZoom, used to classify lead origins. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfLeadSourceCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfLeadSources `referenceData.getAListOfLeadSources` Fetches a list of all lead sources configured in AgencyZoom, including their ID, name, sales exclusion status, and category ID. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfLeadSources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfLifeProfessionals `referenceData.getAListOfLifeProfessionals` Retrieves a list of life insurance professionals, including only their contact and status information (excluding sales or customer data), from the AgencyZoom platform. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfLifeProfessionals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfLocations `referenceData.getAListOfLocations` Retrieves all agency locations or branches from AgencyZoom; filtering options are not available. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfLocations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfLossReasons `referenceData.getAListOfLossReasons` Retrieves all predefined loss reasons (e.g., 'Lost to competitor', 'Premium too high') available in AgencyZoom. These reasons can be used when marking leads as lost or for reporting purposes. No parameters required - returns complete list. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfLossReasons({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfPipelines `referenceData.getAListOfPipelines` Retrieves all pipelines and their stages from AgencyZoom to understand workflow structures; this is a read-only operation and does not return individual items (like leads or tasks) within these pipelines. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfPipelines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfProductLinesPolicyTypes `referenceData.getAListOfProductLinesPolicyTypes` Fetches all product lines and policy types from AgencyZoom, each detailed with its ID, name, and product category ID. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfProductLinesPolicyTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getAListOfRecycleEvents `referenceData.getAListOfRecycleEvents` Retrieves the available recycle event types and any existing X-Date information for a specified lead in AgencyZoom. Returns a list of recycle event categories that can be used to trigger follow-ups (e.g., 'X-Date', 'Accident Falls Off', 'Prior Insurance Fulfilled'). **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getAListOfRecycleEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `existingXDate` | `any[]` | No | — | | `newXDate` | `any[]` | No | — | *** ### getDepartmentsGroups `referenceData.getDepartmentsGroups` Fetches department and group information for an agency, optionally filtered by a specific `agencyNumber`, to analyze its organizational structure. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getDepartmentsGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agencyNumber` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getListOfEndStages `referenceData.getListOfEndStages` Fetches a list of all defined end stages, representing final steps in processes like lead conversion or policy closure. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.getListOfEndStages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### listProductCategories `referenceData.listProductCategories` Retrieves a complete, unfiltered list of all product categories (ID and name) from AgencyZoom, useful for understanding product organization or populating UI elements. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.listProductCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### searchBusinessClassifications `referenceData.searchBusinessClassifications` Retrieves a comprehensive list of all available business classifications from AgencyZoom, each including an ID, code, and description. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.referenceData.searchBusinessClassifications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Service Tickets ### serviceTicketList `serviceTickets.serviceTicketList` Retrieves a paginated list of service tickets from AgencyZoom. Supports filtering by: - Status (0=removed, 1=active, 2=completed) - Priority ID and Category ID Returns service ticket details including subject, description, dates, assignment information, and workflow stage. Results are paginated with default page size of 20 tickets per page. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.serviceTickets.serviceTicketList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `status` | `number` | No | — | | `pageSize` | `number` | No | — | | `categoryId` | `number` | No | — | | `priorityId` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Tasks ### batchDeleteTask `tasks.batchDeleteTask` Deletes multiple AgencyZoom tasks in a batch; task deletion is permanent and the response indicates overall batch success, not individual task status. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.tasks.batchDeleteTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskIds` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### completeTask `tasks.completeTask` Marks an existing and accessible task in AgencyZoom as 'completed'; this action does not return the full updated task object. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.tasks.completeTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### createTask `tasks.createTask` Creates a new task in AgencyZoom; ensure `assigneeId`, `customerId`, or `leadId` are valid existing entities if provided, and use `contactEmail`, `customerId`, or `leadId` to link the task to a contact. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.tasks.createTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `title` | `string` | No | — | | `leadId` | `number` | No | — | | `comments` | `string` | No | — | | `duration` | `number` | No | — | | `invitees` | `any[]` | No | — | | `assigneeId` | `number` | No | — | | `customerId` | `number` | No | — | | `dueDatetime` | `string` | No | — | | `contactEmail` | `string` | No | — | | `timeSpecific` | `boolean` | No | — | | `lifeProfessionalId` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `title` | `string` | No | — | | `status` | `string \| number` | No | — | | `dueDate` | `string` | No | — | | `comments` | `string` | No | — | | `customerId` | `number` | No | — | | `leadId` | `number` | No | — | *** ### deleteATask `tasks.deleteATask` Permanently and irreversibly deletes an existing task, identified by its `taskId`. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.tasks.deleteATask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getTheTaskDetails `tasks.getTheTaskDetails` Retrieves comprehensive details for a specific task using its unique `taskId`, which must correspond to an existing task in AgencyZoom. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.tasks.getTheTaskDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `title` | `string` | No | — | | `status` | `string \| number` | No | — | | `dueDate` | `string` | No | — | | `comments` | `string` | No | — | | `customerId` | `number` | No | — | | `leadId` | `number` | No | — | *** ### reopenATask `tasks.reopenATask` Reopens an existing AgencyZoom task that is currently 'completed' or 'closed', allowing it to be reactivated with optional comments. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.tasks.reopenATask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `number` | Yes | — | | `comments` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### searchTasks `tasks.searchTasks` Searches and lists tasks, supporting pagination and accepting filter criteria in the POST request body despite an empty request schema. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.tasks.searchTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `sort` | `string` | No | — | | `type` | `string` | No | — | | `order` | `string` | No | — | | `period` | `string` | No | — | | `status` | `number` | No | — | | `endDate` | `string` | No | — | | `location` | `string` | No | — | | `pageSize` | `number` | No | — | | `startDate` | `string` | No | — | | `assigneeId` | `number` | No | — | | `leadSourceId` | `number` | No | — | | `lifeProfessionalId` | `number` | No | — | | `leadSourceCategoryId` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### updateTask `tasks.updateTask` Modifies an existing AgencyZoom task (which must be valid and identified by `taskId` in the path) with new attributes from the request body, which must also contain `taskId`. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.tasks.updateTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `title` | `string` | No | — | | `leadId` | `number` | No | — | | `taskId` | `number` | Yes | — | | `comments` | `string` | No | — | | `duration` | `number` | No | — | | `invitees` | `any[]` | No | — | | `assigneeId` | `number` | No | — | | `customerId` | `number` | No | — | | `dueDatetime` | `string` | No | — | | `contactEmail` | `string` | No | — | | `timeSpecific` | `boolean` | No | — | | `lifeProfessionalId` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `title` | `string` | No | — | | `status` | `string \| number` | No | — | | `dueDate` | `string` | No | — | | `comments` | `string` | No | — | | `customerId` | `number` | No | — | | `leadId` | `number` | No | — | *** ## Text Threads ### getAListOfProducer `textThreads.getAListOfProducer` Retrieves a list of all producers from AgencyZoom, typically related to text thread functionalities. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.textThreads.getAListOfProducer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### removeTextThreadEndpoint `textThreads.removeTextThreadEndpoint` Call this action to permanently delete an SMS/text message thread in AgencyZoom; the target thread is identified by its `threadId`. Note: This operation is idempotent - deleting a non-existent thread will return success. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agencyzoom.api.textThreads.removeTextThreadEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### searchSmsThreads `textThreads.searchSmsThreads` Searches and retrieves SMS threads from AgencyZoom, with search parameters, filters, sorting, and pagination typically provided in the request body of this POST operation. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.textThreads.searchSmsThreads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### textDetailThread `textThreads.textDetailThread` Retrieves detailed messages for a specific SMS/text thread by its thread ID. Returns all messages in the thread with their content, attachments, sender/recipient information, and metadata. The thread ID can be obtained from the search\_sms\_threads action. **Risk:** `read` ```ts theme={null} await corsair.agencyzoom.api.textThreads.textDetailThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `location` | `string` | No | — | | `searchTerm` | `string` | No | — | | `status` | `number` | No | — | | `lastDateUTC` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### unreadThread `textThreads.unreadThread` Updates the read or unread status of a specific SMS/text thread within AgencyZoom. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.textThreads.unreadThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `markUnread` | `boolean` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## V4sso ### authenticateForJwtviaV4Sso `v4sso.authenticateForJwtviaV4Sso` Completes AgencyZoom V4 Single Sign-On (SSO) authentication by exchanging an OAuth2 authorization code for a JWT token. Prerequisites: First call get\_auth\_url\_for\_v4sso to obtain the authentication URL, then redirect the user to that URL for login. After successful authentication through Vertafore's OAuth provider, the callback will include a 'code' parameter. Use that code with this action to obtain the JWT token for API access. Note: This is typically used during initial authentication setup. The code is single-use, time-limited, and must match the PKCE challenge from the original auth request. **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.v4sso.authenticateForJwtviaV4Sso({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `jwt` | `string` | Yes | — | | `ownerAgent` | `boolean` | No | — | *** ### getAuthUrlForV4Sso `v4sso.getAuthUrlForV4Sso` Retrieves a fresh authentication URL for AgencyZoom's V4 Single Sign-On (SSO) process; call before each SSO attempt as the URL may change and should not be cached. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `write` ```ts theme={null} await corsair.agencyzoom.api.v4sso.getAuthUrlForV4Sso({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/agencyzoom/database AgencyZoom local sync: searchable entities, `.search()` filters, and operators. The AgencyZoom plugin syncs data locally. Use `corsair.agencyzoom.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Customers Path: `agencyzoom.db.customers.search` ```ts theme={null} const rows = await corsair.agencyzoom.db.customers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `firstname` | `string` | equals, contains, startsWith, endsWith, in | | `lastname` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Leads Path: `agencyzoom.db.leads.search` ```ts theme={null} const rows = await corsair.agencyzoom.db.leads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `firstname` | `string` | equals, contains, startsWith, endsWith, in | | `lastname` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `agencyzoom.db.tasks.search` ```ts theme={null} const rows = await corsair.agencyzoom.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `dueDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/agencyzoom/overview Insurance agency management software for policies, clients, and producer workflows. Use **AgencyZoom** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 99 typed API operations * 3 synced entities (`customers`, `leads`, `tasks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/agencyzoom ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/agencyzoom ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/agencyzoom ``` ```bash bun theme={null} bun add corsair @corsair-dev/agencyzoom ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { agencyzoom } from '@corsair-dev/agencyzoom'; export const corsair = createCorsair({ plugins: [ agencyzoom(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} agencyzoom() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'agencyzoom', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`customers.getAmsPoliciesForACustomer`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agencyzoom.api.customers.getAmsPoliciesForACustomer({}); ``` **`auth.logTheUserIn`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agencyzoom.api.auth.logTheUserIn({}); ``` See the full list on the [API](/plugins/agencyzoom/api) page. ## Query synced data Synced entities support `tenant.agencyzoom.db..search()` and `.list()`: `customers`, `leads`, `tasks`. See [Database](/plugins/agencyzoom/database) for filters and operators. ## What's next > **[API reference](/plugins/agencyzoom/api)** > > Every `agencyzoom.api.*` operation with input and output types. > **[Database](/plugins/agencyzoom/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/agentmail/api API reference for AgentMail: every `agentmail.api.*` operation with input and output types. Every `agentmail.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Messages ### get `messages.get` Retrieve the complete details of an AgentMail message **Risk:** `read` ```ts theme={null} await corsair.agentmail.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `string` | Yes | — | | `thread_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | | `labels` | `string[]` | Yes | — | | `timestamp` | `string` | Yes | — | | `from` | `string` | Yes | — | | `to` | `string[]` | Yes | — | | `size` | `number` | Yes | — | | `updated_at` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `cc` | `string[]` | No | — | | `bcc` | `string[]` | No | — | | `subject` | `string` | No | — | | `preview` | `string` | No | — | | `attachments` | `object[]` | No | — | | `in_reply_to` | `string` | No | — | | `references` | `string[]` | No | — | | `headers` | `object` | No | — | | `reply_to` | `string[]` | No | — | | `text` | `string` | No | — | | `html` | `string` | No | — | | `extracted_text` | `string` | No | — | | `extracted_html` | `string` | No | — | > **attachments full type** > > ```ts theme={null} > { > attachment_id: string, > size: number, > filename?: string, > content_type?: string, > content_disposition?: string, > content_id?: string > }[] > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` *** ### list `messages.list` List messages from an AgentMail inbox **Risk:** `read` ```ts theme={null} await corsair.agentmail.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `page_token` | `string` | No | — | | `labels` | `string[]` | No | — | | `before` | `string` | No | — | | `after` | `string` | No | — | | `ascending` | `boolean` | No | — | | `include_spam` | `boolean` | No | — | | `include_blocked` | `boolean` | No | — | | `include_unauthenticated` | `boolean` | No | — | | `include_trash` | `boolean` | No | — | | `from` | `string[]` | No | — | | `to` | `string[]` | No | — | | `subject` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `messages` | `object[]` | Yes | — | | `limit` | `number` | Yes | — | | `next_page_token` | `string` | No | — | > **messages full type** > > ```ts theme={null} > { > inbox_id: string, > thread_id: string, > message_id: string, > labels: string[], > timestamp: string, > from: string, > to: string[], > size: number, > updated_at: string, > created_at: string, > cc?: string[], > bcc?: string[], > subject?: string, > preview?: string, > attachments?: { > attachment_id: string, > size: number, > filename?: string, > content_type?: string, > content_disposition?: string, > content_id?: string > }[], > in_reply_to?: string, > references?: string[], > headers?: { > } > }[] > ``` *** ### send `messages.send` Send an email using AgentMail **Risk:** `write` ```ts theme={null} await corsair.agentmail.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `string` | Yes | — | | `labels` | `string[]` | No | — | | `reply_to` | `string \| string[]` | No | — | | `to` | `string \| string[]` | No | — | | `cc` | `string \| string[]` | No | — | | `bcc` | `string \| string[]` | No | — | | `subject` | `string` | No | — | | `text` | `string` | No | — | | `html` | `string` | No | — | | `headers` | `object` | No | — | > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | | `thread_id` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/agentmail/database AgentMail local sync: searchable entities, `.search()` filters, and operators. The AgentMail plugin syncs data locally. Use `corsair.agentmail.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Messages Path: `agentmail.db.messages.search` ```ts theme={null} const rows = await corsair.agentmail.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `inbox_id` | `string` | equals, contains, startsWith, endsWith, in | | `thread_id` | `string` | equals, contains, startsWith, endsWith, in | | `message_id` | `string` | equals, contains, startsWith, endsWith, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `preview` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/agentmail/overview Email infrastructure for AI agents with programmatic inboxes and message handling. Use **AgentMail** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 3 typed API operations * 1 synced entity (`messages`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/agentmail ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/agentmail ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/agentmail ``` ```bash bun theme={null} bun add corsair @corsair-dev/agentmail ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { agentmail } from '@corsair-dev/agentmail'; export const corsair = createCorsair({ plugins: [ agentmail(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} agentmail() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'agentmail', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`messages.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agentmail.api.messages.get({}); ``` **`messages.send`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agentmail.api.messages.send({}); ``` See the full list on the [API](/plugins/agentmail/api) page. ## Query synced data Synced entities support `tenant.agentmail.db..search()` and `.list()`: `messages`. See [Database](/plugins/agentmail/database) for filters and operators. ## Webhooks This plugin registers **1** webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/agentmail/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/agentmail/api)** > > Every `agentmail.api.*` operation with input and output types. > **[Database](/plugins/agentmail/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/agentmail/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/agentmail/webhooks AgentMail incoming webhooks: event paths, payloads, and response data. The AgentMail plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/agentmail/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `message` * `received` (`message.received`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Message ### Received `message.received` A new email was received in an AgentMail inbox **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `event` | Yes | — | | `event_type` | `message.received` | Yes | — | | `event_id` | `string` | Yes | — | | `message` | `object` | Yes | — | | `thread` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > inbox_id: string, > thread_id: string, > message_id: string, > labels: string[], > timestamp: string, > from: string, > to: string[], > size: number, > updated_at: string, > created_at: string, > reply_to?: string[], > cc?: string[], > bcc?: string[], > subject?: string, > preview?: string, > text?: string, > html?: string, > extracted_text?: string, > extracted_html?: string, > attachments?: { > attachment_id: string, > size: number, > filename?: string, > content_type?: string, > content_disposition?: string, > content_id?: string > }[], > in_reply_to?: string, > references?: string[], > headers?: { > } > } > ``` > **thread full type** > > ```ts theme={null} > { > inbox_id: string, > thread_id: string, > labels: string[], > timestamp: string, > senders: string[], > recipients: string[], > last_message_id: string, > message_count: number, > size: number, > updated_at: string, > created_at: string, > received_timestamp?: string, > sent_timestamp?: string, > subject?: string, > preview?: string, > attachments?: { > attachment_id: string, > size: number, > filename?: string, > content_type?: string, > content_disposition?: string, > content_id?: string > }[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: event, > event_type: message.received, > event_id: string, > message: { > inbox_id: string, > thread_id: string, > message_id: string, > labels: string[], > timestamp: string, > from: string, > to: string[], > size: number, > updated_at: string, > created_at: string, > reply_to?: string[], > cc?: string[], > bcc?: string[], > subject?: string, > preview?: string, > text?: string, > html?: string, > extracted_text?: string, > extracted_html?: string, > attachments?: { > attachment_id: string, > size: number, > filename?: string, > content_type?: string, > content_disposition?: string, > content_id?: string > }[], > in_reply_to?: string, > references?: string[], > headers?: { > } > }, > thread: { > inbox_id: string, > thread_id: string, > labels: string[], > timestamp: string, > senders: string[], > recipients: string[], > last_message_id: string, > message_count: number, > size: number, > updated_at: string, > created_at: string, > received_timestamp?: string, > sent_timestamp?: string, > subject?: string, > preview?: string, > attachments?: { > attachment_id: string, > size: number, > filename?: string, > content_type?: string, > content_disposition?: string, > content_id?: string > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} agentmail({ webhookHooks: { message: { received: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/agentql/api API reference for AgentQL: every `agentql.api.*` operation with input and output types. Every `agentql.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Browser Sessions ### createRemoteBrowserSession `browserSessions.createRemoteBrowserSession` Tool to create a remote browser session. Use when you need to run browser automation on remote infrastructure. **Risk:** `write` ```ts theme={null} await corsair.agentql.api.browserSessions.createRemoteBrowserSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `browser_ua_preset` | `windows \| macos \| linux` | No | — | | `browser_profile` | `light \| stealth \| tf-browser` | No | — | | `inactivity_timeout_seconds` | `number` | No | — | | `proxy` | `object` | No | — | | `shutdown_mode` | `on_disconnect \| on_inactivity_timeout` | No | — | | `sub_user_id` | `string` | No | — | | `branding` | `boolean` | No | — | | `browser_startup_url` | `string \| about:blank` | No | — | > **proxy full type** > > ```ts theme={null} > { > type?: tetra, > country_code?: string > } | { > type?: custom, > url: string, > username?: string | null, > password?: string | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `cdp_url` | `string` | Yes | — | | `base_url` | `string` | Yes | — | *** ## Data ### query `data.query` Tool to query structured data as JSON from a web page using an AgentQL query or natural language prompt. Use after defining your query or prompt and a URL or HTML. **Risk:** `read` ```ts theme={null} await corsair.agentql.api.data.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `prompt` | `string` | No | — | | `url` | `string` | No | — | | `html` | `string` | No | — | | `params` | `object` | No | — | > **params full type** > > ```ts theme={null} > { > wait_for?: number, > is_scroll_to_bottom_enabled?: boolean, > mode?: fast | standard, > is_screenshot_enabled?: boolean, > browser_profile?: light | stealth | tf-browser, > proxy?: { > type?: tetra, > country_code?: string > } | { > type?: custom, > url: string, > username?: string | null, > password?: string | null > } | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `metadata` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > request_id?: string, > generated_query?: string | null, > screenshot?: string | null > } > ``` *** ### queryDocument `data.queryDocument` Tool to extract structured data from PDF or image documents using an AgentQL query or natural language prompt. Accepts a file upload plus query or prompt. **Risk:** `read` ```ts theme={null} await corsair.agentql.api.data.queryDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom` | Yes | — | | `fileName` | `string` | No | — | | `query` | `string` | No | — | | `prompt` | `string` | No | — | | `params` | `object` | No | — | > **params full type** > > ```ts theme={null} > { > mode?: fast | standard > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `metadata` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > request_id?: string, > generated_query?: string | null > } > ``` *** ## Usage ### get `usage.get` Retrieves API usage statistics and subscription limits for the AgentQL account. Returns current billing cycle dates, lifetime usage limits, API key usage counts, and total account usage. Useful for monitoring quota consumption and planning usage. No parameters required - uses the authenticated API key from connection settings. **Risk:** `read` ```ts theme={null} await corsair.agentql.api.usage.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `metadata` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > current_subscription?: { > lifetime_usage_limit?: number | null, > current_cycle_free_usage_limit?: number | null, > current_cycle_start?: string, > current_cycle_end?: string > } | null, > api_key_usage: { > current_cycle?: number | null, > lifetime?: number > }, > total_account_usage: { > current_cycle?: number | null, > lifetime?: number > } > } > ``` > **metadata full type** > > ```ts theme={null} > { > request_id?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/agentql/database AgentQL local sync: searchable entities, `.search()` filters, and operators. The AgentQL plugin syncs data locally. Use `corsair.agentql.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Account Usage Path: `agentql.db.accountUsage.search` ```ts theme={null} const rows = await corsair.agentql.db.accountUsage.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Browser Sessions Path: `agentql.db.browserSessions.search` ```ts theme={null} const rows = await corsair.agentql.db.browserSessions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `sessionId` | `string` | equals, contains, startsWith, endsWith, in | | `cdpUrl` | `string` | equals, contains, startsWith, endsWith, in | | `baseUrl` | `string` | equals, contains, startsWith, endsWith, in | | `browserUaPreset` | `string` | equals, contains, startsWith, endsWith, in | | `browserProfile` | `string` | equals, contains, startsWith, endsWith, in | | `inactivityTimeoutSeconds` | `number` | equals, gt, gte, lt, lte, in | | `shutdownMode` | `string` | equals, contains, startsWith, endsWith, in | | `subUserId` | `string` | equals, contains, startsWith, endsWith, in | | `branding` | `boolean` | equals | | `browserStartupUrl` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Document Query Results Path: `agentql.db.documentQueryResults.search` ```ts theme={null} const rows = await corsair.agentql.db.documentQueryResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `fileName` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `prompt` | `string` | equals, contains, startsWith, endsWith, in | | `generatedQuery` | `string` | equals, contains, startsWith, endsWith, in | | `requestId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Query Results Path: `agentql.db.queryResults.search` ```ts theme={null} const rows = await corsair.agentql.db.queryResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `prompt` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `generatedQuery` | `string` | equals, contains, startsWith, endsWith, in | | `requestId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/agentql/overview Web scraping API that turns pages into structured data using natural language queries. Use **AgentQL** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 4 synced entities (`accountUsage`, `browserSessions`, `documentQueryResults`, `queryResults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/agentql ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/agentql ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/agentql ``` ```bash bun theme={null} bun add corsair @corsair-dev/agentql ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { agentql } from '@corsair-dev/agentql'; export const corsair = createCorsair({ plugins: [ agentql(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} agentql() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'agentql', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`data.query`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agentql.api.data.query({}); ``` **`browserSessions.createRemoteBrowserSession`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agentql.api.browserSessions.createRemoteBrowserSession({}); ``` See the full list on the [API](/plugins/agentql/api) page. ## Query synced data Synced entities support `tenant.agentql.db..search()` and `.list()`: `accountUsage`, `browserSessions`, `documentQueryResults`, `queryResults`. See [Database](/plugins/agentql/database) for filters and operators. ## What's next > **[API reference](/plugins/agentql/api)** > > Every `agentql.api.*` operation with input and output types. > **[Database](/plugins/agentql/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/agenty/api API reference for Agenty: every `agenty.api.*` operation with input and output types. Every `agenty.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agents ### agentsControllerCreateAgent `agents.agentsControllerCreateAgent` Creates a new Agenty agent for web scraping, change detection, crawling, map monitoring, or brand monitoring. Use this tool to set up automated data extraction agents. Requires: - name: A descriptive name for the agent - type: One of 'scraping', 'changedetection', 'crawling', 'mapmonitoring', 'brandmonitoring' - config: Configuration object with url, browser, and collections defining what data to extract The config.collections array contains field definitions with CSS selectors or other extraction methods. Each field specifies what data to extract and how (TEXT content, ATTR for attributes, etc.). Optional: Set start=true to immediately run the agent after creation, or configure a scheduler for recurring runs. Returns the created agent with its unique agent\_id for future reference. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.agents.agentsControllerCreateAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `icon` | `string` | No | — | | `name` | `string` | Yes | — | | `tags` | `any[]` | No | — | | `type` | `string` | No | — | | `start` | `boolean` | No | — | | `config` | `object` | Yes | — | | `scripts` | `object` | No | — | | `user_id` | `number` | No | — | | `version` | `number` | No | — | | `agent_id` | `string` | No | — | | `is_public` | `boolean` | No | — | | `scheduler` | `object` | No | — | | `account_id` | `number` | No | — | | `created_at` | `string` | No | — | | `is_managed` | `boolean` | No | — | | `project_id` | `number` | No | — | | `updated_at` | `string` | No | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **config full type** > > ```ts theme={null} > { > } > ``` > **scripts full type** > > ```ts theme={null} > { > } > ``` > **scheduler full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### agentsControllerGetTemplates `agents.agentsControllerGetTemplates` Tool to fetch all public agent templates and sample agents. Use when listing available templates for users to select. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.agents.agentsControllerGetTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### agentsDeleteById `agents.agentsDeleteById` Tool to delete a single agent by its ID. Use when you need to permanently remove an agent after confirming it exists. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.agents.agentsDeleteById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agent_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### agentsGetAll `agents.agentsGetAll` Tool to fetch all active agents under an account. Use after authenticating when you need to list agents with pagination and sorting. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.agents.agentsGetAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### agentsGetById `agents.agentsGetById` Retrieves complete details of a specific agent including its configuration, input settings, scheduler, and metadata. Use this tool when you need to: - View full agent configuration and settings - Check agent type and current version - Access scheduler and script configurations - Verify agent status before executing jobs - Retrieve agent metadata for updates or cloning **Risk:** `read` ```ts theme={null} await corsair.agenty.api.agents.agentsGetById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agent_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### agentsUpdateById `agents.agentsUpdateById` Updates an existing agent's configuration, settings, and metadata. Use this tool to modify an agent's properties such as name, type, config, tags, scheduler, scripts, or visibility settings. The API only returns the fields that were updated in the response, not the complete agent object. To get the full updated agent details, use the 'Get Agent by ID' action after updating. Example uses: - "Update agent abc123 to change its name to 'Production Scraper'" - "Enable scheduling for agent xyz789 with a cron expression '0 \*/6 \* \* \*'" - "Update agent def456 config to scrape a different URL" **Risk:** `write` ```ts theme={null} await corsair.agenty.api.agents.agentsUpdateById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `icon` | `string` | No | — | | `name` | `string` | Yes | — | | `tags` | `any[]` | No | — | | `type` | `string` | No | — | | `config` | `object` | Yes | — | | `scripts` | `object` | No | — | | `user_id` | `number` | No | — | | `version` | `number` | No | — | | `agent_id` | `string` | Yes | — | | `is_public` | `boolean` | No | — | | `scheduler` | `object` | No | — | | `account_id` | `number` | No | — | | `created_at` | `string` | No | — | | `is_managed` | `boolean` | No | — | | `project_id` | `number` | No | — | | `updated_at` | `string` | No | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **config full type** > > ```ts theme={null} > { > } > ``` > **scripts full type** > > ```ts theme={null} > { > } > ``` > **scheduler full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### copyAgent `agents.copyAgent` Tool to copy an existing agent by its ID, creating a duplicate with optionally a new name. Use when you need to duplicate an agent's configuration to create a similar agent without starting from scratch. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.agents.copyAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `agent_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### transferAgentOwnership `agents.transferAgentOwnership` Tool to transfer agent ownership to another Agenty account. Use when you need to move an agent to a different user's account by specifying their email address. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.agents.transferAgentOwnership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `agent_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Api Keys ### apiKeysControllerCreateApiKeys `apiKeys.apiKeysControllerCreateApiKeys` Creates a new API key for programmatic access to the Agenty API. The generated API key can be used to authenticate API requests with different permission levels (Owner, Admin, or Manager). The key is returned in the response and should be securely stored as it provides access to your Agenty account. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.apiKeys.apiKeysControllerCreateApiKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `role` | `string` | No | — | | `is_enabled` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### apiKeysDeleteById `apiKeys.apiKeysDeleteById` Delete an API key by its unique identifier. Use this tool to permanently revoke access for a specific API key. The key\_id can be obtained from the "Get all API keys" or "Create API key" actions. This action cannot be undone. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.apiKeys.apiKeysDeleteById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### apiKeysDownload `apiKeys.apiKeysDownload` Tool to download all API keys under an account in CSV format. Use when you need a complete list of API keys for export or backup. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.apiKeys.apiKeysDownload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### apiKeysGetAll `apiKeys.apiKeysGetAll` Tool to retrieve all API keys under an account. Use after authentication when you need to list API keys with pagination and sorting. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.apiKeys.apiKeysGetAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### apiKeysGetById `apiKeys.apiKeysGetById` Retrieves detailed information about a specific API key by its ID. Use this action when you need to: - Get the full details of an API key including its value, role, and status - Verify the existence and properties of a specific API key - Check if an API key is enabled or disabled The key\_id can be obtained from the 'Get all API keys' action or when creating a new API key. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.apiKeys.apiKeysGetById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### apiKeysResetById `apiKeys.apiKeysResetById` Resets (regenerates) the secret value of an existing API key. The old secret becomes invalid immediately. Important: This action only confirms the reset was successful but does NOT return the new secret. After resetting, use the 'Get API Key By ID' action to retrieve the new secret value. Use this when you need to: - Rotate API key secrets for security - Invalidate a compromised API key and generate a new secret - Update credentials as part of security maintenance **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.apiKeys.apiKeysResetById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### apiKeysUpdateById `apiKeys.apiKeysUpdateById` Updates an existing API key's name and role by its unique identifier. This action allows you to modify the display name and permission level of an API key. Only the name and role fields can be updated; other properties are read-only. After updating, the action automatically fetches and returns the complete updated API key details. Use this when you need to: - Rename an API key for better identification - Change the permission level (Owner, Admin, or Manager) of an API key - Update multiple properties of an API key at once **Risk:** `write` ```ts theme={null} await corsair.agenty.api.apiKeys.apiKeysUpdateById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `role` | `string` | No | — | | `key_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### changeApiKeyStatusById `apiKeys.changeApiKeyStatusById` Toggles the enabled/disabled status of an API key. This endpoint switches the key between enabled and disabled states - if the key is currently enabled, it will be disabled, and vice versa. Returns a confirmation message upon successful status change. Use this after retrieving the key\_id from the list or get API key endpoints. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.apiKeys.changeApiKeyStatusById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Browser ### captureScreenshot `browser.captureScreenshot` Tool to capture a full-page or visible screenshot of any webpage URL. Use when you need to capture visual representation of a webpage as an image file. The screenshot is captured using browser automation with default settings. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.browser.captureScreenshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### captureScreenshotWithOptions `browser.captureScreenshotWithOptions` Tool to capture webpage screenshots with extensive customization options including full-page capture, image format, quality settings, viewport configuration, and post-processing. Use when you need to take screenshots of web pages with specific requirements for size, format, or rendering behavior. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.browser.captureScreenshotWithOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `html` | `string` | No | — | | `options` | `object` | No | — | | `blockAds` | `boolean` | No | — | | `viewport` | `object` | No | — | | `anonymous` | `object` | No | — | | `userAgent` | `string` | No | — | | `manipulate` | `object` | No | — | | `gotoOptions` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` > **viewport full type** > > ```ts theme={null} > { > } > ``` > **anonymous full type** > > ```ts theme={null} > { > } > ``` > **manipulate full type** > > ```ts theme={null} > { > } > ``` > **gotoOptions full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### convertUrlToPdf `browser.convertUrlToPdf` Tool to convert a webpage URL to a PDF document. Use when you need to generate a PDF file from a web page for archival, reporting, or offline viewing purposes. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.browser.convertUrlToPdf({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### convertUrlToPdfWithOptions `browser.convertUrlToPdfWithOptions` Tool to convert a URL or raw HTML to PDF with customizable options. Use when you need to generate PDFs with specific formatting requirements like custom page sizes, margins, headers/footers, or orientation. Supports both URL-based and HTML content conversion. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.browser.convertUrlToPdfWithOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `html` | `string` | No | — | | `rotate` | `number` | No | — | | `options` | `object` | No | — | | `anonymous` | `object` | No | — | | `block_ads` | `boolean` | No | — | | `user_agent` | `string` | No | — | | `goto_options` | `object` | No | — | | `emulate_media` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` > **anonymous full type** > > ```ts theme={null} > { > } > ``` > **goto\_options full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### extractBrowserStructuredData `browser.extractBrowserStructuredData` Tool to auto-extract structured data from a webpage including schema.org, RDFa, Microdata, and JSON-LD formats. Use when you need to automatically extract semantic markup from web pages without writing custom scraping rules. The API returns organized structured data in four categories: metatags, microdata, rdfa, and jsonld. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.browser.extractBrowserStructuredData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `gotoOptions` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **gotoOptions full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### extractStructuredData `browser.extractStructuredData` Tool to auto-extract structured data from a webpage URL. Use when you need to extract schema.org, RDFa, Microdata, or JSON-LD structured data from web pages. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.browser.extractStructuredData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getBrowserRedirects `browser.getBrowserRedirects` Tool to get the complete redirect chain for a URL. Use when you need to trace how a URL redirects, including both server-side (HTTP 3xx redirects) and client-side redirects (JavaScript, meta tags). Returns an ordered list of all redirect steps from the original URL to the final destination. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.browser.getBrowserRedirects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPageContent `browser.getPageContent` Tool to fetch the complete HTML content of any webpage URL. Use this when you need to retrieve the full HTML source code of a page, including content rendered after JavaScript execution. The API navigates to the URL using proxies and captures the page's source content. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.browser.getPageContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPageContentWithOptions `browser.getPageContentWithOptions` Tool to fetch HTML content of a webpage with custom options including ad blocking. Use this when you need to retrieve the full HTML source of a webpage, particularly for web scraping or content analysis tasks. The tool supports ad blocking to speed up page loads and reduce unnecessary content. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.browser.getPageContentWithOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `block_ads` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getRedirectsWithOptions `browser.getRedirectsWithOptions` Tool to get the complete redirect chain of a URL with custom navigation options. Use when you need to trace URL redirects including both server-side (3xx) and client-side redirects (JavaScript, meta tags). Supports custom timeout and navigation wait conditions to ensure all redirects are captured. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.browser.getRedirectsWithOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `gotoOptions` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **gotoOptions full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### scrapeWebpageData `browser.scrapeWebpageData` Tool to scrape data from any webpage using jQuery/CSS selectors. Use when you need to extract specific data from web pages by defining jQuery selector expressions. Each query field maps a name to a jQuery expression (e.g., "\$('h1').text()" extracts the h1 text). The browser will load the page, execute JavaScript, and run your jQuery queries to extract the data. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.browser.scrapeWebpageData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `debug` | `object` | No | — | | `query` | `object` | Yes | — | | `blockAds` | `boolean` | No | — | | `userAgent` | `string` | No | — | | `gotoOptions` | `object` | No | — | | `body` | `any` | No | — | | `headers` | `object` | No | — | > **debug full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **gotoOptions full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Connections ### connectionsGetAll `connections.connectionsGetAll` Retrieves all connections from your Agenty account. Supports pagination via limit/offset and sorting by field name. Returns an empty list if no connections exist. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.connections.connectionsGetAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Dashboard ### dashboardGetReportsUsage `dashboard.dashboardGetReportsUsage` Tool to fetch account reports like pages used by agent, date, and product. Use when analyzing usage over a date range. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.dashboard.dashboardGetReportsUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `end` | `string` | No | — | | `start` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Inputs ### inputsGetByAgentId `inputs.inputsGetByAgentId` Retrieves the input configuration for a specific agent by its ID. Returns the input source type (URL, manual list, saved list reference, or another agent's output) and associated configuration details. Use this to inspect an agent's current input setup before modifying it or starting a job, or to verify what data sources an agent will process. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.inputs.inputsGetByAgentId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agent_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### inputsUpdateByAgentId `inputs.inputsUpdateByAgentId` Updates the input configuration for a specific agent in Agenty. This tool modifies where an agent gets its input data from. You can configure the agent to: - Pull from a URL feed (type='url') - Use a manually specified list of URLs (type='manual') - Reference data from an Agenty list (type='list') - Use output from another agent (type='agent') Use this after creating or identifying an agent to set up its data source before running jobs. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.inputs.inputsUpdateByAgentId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `data` | `any[]` | No | — | | `type` | `string` | No | — | | `field` | `string` | No | — | | `agent_id` | `string` | Yes | — | | `collection` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Jobs ### downloadAgentResult `jobs.downloadAgentResult` Tool to download agent results by agent ID in CSV, TSV or JSON format. Use when you need to export or analyze agent execution results as a file. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.downloadAgentResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `format` | `string` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `agent_id` | `string` | Yes | — | | `collection` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAgentResult `jobs.getAgentResult` Tool to get the most recent result data for an agent. Use when you need to retrieve and view the scraped/collected data from an agent's latest execution. Returns result data with pagination support. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.getAgentResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `agent_id` | `string` | Yes | — | | `collection` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getJobResult `jobs.getJobResult` Tool to get the result data from a completed job. Use when you need to retrieve and view the scraped/collected data from a finished job. Returns result data with pagination support. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.getJobResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `format` | `string` | No | — | | `job_id` | `number` | Yes | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `collection` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### jobsDownload `jobs.jobsDownload` Tool to download all jobs in CSV format. Use when you need a complete list of jobs for export or analysis. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.jobsDownload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `agent_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### jobsDownloadFilesById `jobs.jobsDownloadFilesById` Tool to download output files by job ID. Use when you need to fetch a specific output file after a job completes. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.jobsDownloadFilesById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `job_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### jobsDownloadResultById `jobs.jobsDownloadResultById` Tool to download the agent output result by job ID. Use when you need to fetch the final output of a completed job in CSV, TSV, or JSON format. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.jobsDownloadResultById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `format` | `string` | No | — | | `job_id` | `number` | Yes | — | | `offset` | `number` | No | — | | `collection` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### jobsGetAll `jobs.jobsGetAll` Tool to fetch all jobs under an account. Use when you need to view and filter the list of jobs with pagination and sorting. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.jobsGetAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `agent_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### jobsGetById `jobs.jobsGetById` Retrieves comprehensive details about a specific job including its status, progress metrics (pages processed/succeeded/failed), timing information (created/started/completed times), resource consumption (page credits), and any error messages. Use this action to check job status, monitor execution progress, or diagnose job failures. Returns complete job metadata needed before downloading results. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.jobsGetById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### jobsGetLogsById `jobs.jobsGetLogsById` Tool to fetch logs for a given job by its ID. Use when you need to review or debug job execution logs with pagination support. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.jobsGetLogsById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `job_id` | `number` | Yes | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### jobsListFilesById `jobs.jobsListFilesById` Lists all output files generated by a specific job. Returns file names and sizes for available downloads including CSV/JSON/TSV data exports and compressed logs. Use this after a job completes to discover what output files are available before downloading them. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.jobs.jobsListFilesById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### jobsStart `jobs.jobsStart` Tool to start a new agent job. Use when you need to trigger execution of an existing agent. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.jobs.jobsStart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agent_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### jobsStopById `jobs.jobsStopById` Tool to stop a running job by job ID. Use when you need to halt an in-progress job before it completes. Confirm the job ID beforehand to avoid unintended stops. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.jobs.jobsStopById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Lists ### addListRows `lists.addListRows` Tool to add new rows to a list. Use when you need to insert one or more data rows into an existing list. Column names in row objects must match the list's schema. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.lists.addListRows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `any[]` | Yes | — | | `list_id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteListRow `lists.deleteListRow` Tool to delete a specific row from a list by its unique identifier. Use when you need to permanently remove a single row from a list. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.lists.deleteListRow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `list_id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteListRows `lists.deleteListRows` Tool to delete specific rows from a list by their IDs. Use when you need to remove one or more rows from a list by providing their unique identifiers. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.lists.deleteListRows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `any[]` | Yes | — | | `list_id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### downloadListRows `lists.downloadListRows` Tool to download list rows as CSV file. Use when you need to export or backup all rows from a specific list. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.lists.downloadListRows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListById `lists.getListById` Retrieves detailed information about a specific list by its ID. Use this action when you need to: - Get the full details of a list including its name, description, and metadata - Verify the existence of a specific list - Check when a list was created or last updated - Access additional data associated with a list The list\_id can be obtained from the 'Get all lists' action or when creating a new list. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.lists.getListById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListRowById `lists.getListRowById` Tool to fetch a specific row by its ID from a list. Use when you need to retrieve a single data entry from a list using its unique identifier. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.lists.getListRowById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `list_id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listsClearRows `lists.listsClearRows` Tool to clear all rows in a list by its ID. Use when you need to wipe out all data in a list before re-populating (e.g., "Clear all rows in list 123"). **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.lists.listsClearRows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listsControllerCreateList `lists.listsControllerCreateList` Tool to create a new list. Use after preparing the list name and optional description. Example: "Create a list named 'Contacts' with description 'Potential leads'." **Risk:** `write` ```ts theme={null} await corsair.agenty.api.lists.listsControllerCreateList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listsDeleteById `lists.listsDeleteById` Tool to delete a specific list by its ID. Use when you need to permanently remove a list after confirming it exists. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.lists.listsDeleteById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string \| number` | Yes | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listsDownload `lists.listsDownload` Tool to download all lists in CSV format. Use when you need a complete set of lists for export or backup. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.lists.listsDownload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listsGetAll `lists.listsGetAll` Tool to retrieve all lists under an account. Use after authentication when you need to list lists with pagination and sorting. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.lists.listsGetAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listsGetRowsById `lists.listsGetRowsById` Tool to fetch all rows in a specified list. Use when you need to retrieve all data entries from a list with optional pagination and sorting. Example: "Fetch rows from list '61db...' with limit=50". **Risk:** `read` ```ts theme={null} await corsair.agenty.api.lists.listsGetRowsById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `list_id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listsUpdateById `lists.listsUpdateById` Tool to update a list's name and optionally description by list ID. The name field is always required. Use when you need to modify list metadata after confirming its ID. Example: "Update list 123 with name 'My Updated List' and description 'New description'". **Risk:** `write` ```ts theme={null} await corsair.agenty.api.lists.listsUpdateById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `list_id` | `string \| number` | Yes | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listsUploadCsv `lists.listsUploadCsv` Tool to upload a CSV file to an Agenty list for bulk import of data rows. Use this action when you need to: - Import multiple rows of data into an existing list from a CSV file - Bulk update list data - Add structured tabular data to a list Prerequisites: The target list must already exist. Use the 'Create List' action first if needed. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.lists.listsUploadCsv({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | Yes | — | | `list_id` | `string \| number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateListRow `lists.updateListRow` Tool to update a specific row in a list by list ID and row ID. Use when you need to modify existing data in a list row. The row\_data must include the '\_id' field and any column fields (col1, col2, etc.) you want to update. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.lists.updateListRow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `list_id` | `string \| number` | Yes | — | | `row_data` | `object` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **row\_data full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Projects ### deleteProject `projects.deleteProject` Tool to delete a project by its ID. Use when you need to permanently remove a project. This action cannot be undone, so ensure the project ID is correct before deletion. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.projects.deleteProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectById `projects.getProjectById` Retrieves complete details of a specific project by its ID, including name, description, creator information, and timestamps. Use this to get project metadata before adding agents, checking project existence, or verifying project details for updates. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.projects.getProjectById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### projectsAddAgents `projects.projectsAddAgents` Add one or more agents to an Agenty project to organize and group related agents together. This action associates agents with a project, allowing better organization and management of your automation workflows. The response includes the complete updated project information with all associated agents. Prerequisites: - Project must exist (use projects\_get\_all to find valid project IDs) - Agent(s) must exist (use agents\_get\_all to find valid agent IDs) Example usage: "Add agents \['tx8lubfbun', 'o3xuc2n8es'] to project 7" **Risk:** `write` ```ts theme={null} await corsair.agenty.api.projects.projectsAddAgents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agent_ids` | `string[]` | Yes | — | | `project_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### projectsControllerCreateProject `projects.projectsControllerCreateProject` Creates a new project in Agenty. Use this to initialize a project with a name and optional description. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.projects.projectsControllerCreateProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### projectsGetAll `projects.projectsGetAll` Retrieve all projects in the authenticated user's account. Returns a paginated list of projects with metadata (total count, pagination info). Use this to discover available projects, check project existence, or get project IDs for other operations. Supports sorting by fields like 'name' or 'created\_at'. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.projects.projectsGetAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### removeAgentFromProject `projects.removeAgentFromProject` Remove an agent from an Agenty project. Use when you need to disassociate an agent from a project while keeping both the agent and project intact. The agent will no longer be part of the project's organization structure. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.projects.removeAgentFromProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agent_id` | `string` | Yes | — | | `project_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProject `projects.updateProject` Update an existing project's name and description in Agenty. Use this to modify project details such as changing the project name or updating its description. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.projects.updateProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Scheduler ### deleteSchedule `scheduler.deleteSchedule` Tool to delete a schedule for an agent by its agent ID. Use when you need to remove scheduled automation for a specific agent. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.scheduler.deleteSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agent_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSchedule `scheduler.getSchedule` Tool to retrieve the schedule configuration for a specific agent. Use when you need to check the current scheduling settings for an agent. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.scheduler.getSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agent_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### toggleSchedule `scheduler.toggleSchedule` Tool to toggle schedule on/off for an agent. Use when you need to enable or disable an agent's scheduled execution without modifying other agent settings. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.scheduler.toggleSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | Yes | — | | `agent_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSchedule `scheduler.updateSchedule` Updates the schedule configuration for a specific agent. Use when you need to modify how often an agent runs automatically. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.scheduler.updateSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `agent_id` | `string` | Yes | — | | `frequency` | `number` | No | — | | `expression` | `string` | No | — | | `is_enabled` | `boolean` | No | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Users ### downloadUsers `users.downloadUsers` Tool to download users list in CSV format. Use when you need to export or backup the complete list of team members and users. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.users.downloadUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAllTeamMembers `users.getAllTeamMembers` Tool to retrieve all team members (users) under an account. Use after authentication when you need to list team members with pagination, sorting, and search filtering. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.users.getAllTeamMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getUserById `users.getUserById` Tool to retrieve detailed information about a user by their ID. Use this to fetch user profile data including email, role, status, and activity timestamps. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.users.getUserById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateUserById `users.updateUserById` Tool to update a user's information by user ID. Use this to modify user properties including email, role, status, name, and subscription settings. Email, role, and status are required fields. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.users.updateUserById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `role` | `string` | Yes | — | | `email` | `string` | Yes | — | | `avatar` | `string` | No | — | | `status` | `string` | Yes | — | | `user_id` | `number` | Yes | — | | `is_email_verified` | `boolean` | No | — | | `is_email_subscribed` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Workflows ### createWorkflow `workflows.createWorkflow` Creates a new workflow in Agenty to automate actions based on agent events. Use this to set up automated responses like sending emails, triggering webhooks, or notifications when specific agent events occur (e.g., job completed, job failed). **Risk:** `write` ```ts theme={null} await corsair.agenty.api.workflows.createWorkflow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `agents` | `object` | Yes | — | | `actions` | `any[]` | Yes | — | | `trigger` | `object` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **agents full type** > > ```ts theme={null} > { > } > ``` > **trigger full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteWorkflow `workflows.deleteWorkflow` Tool to delete a workflow by its ID. Use when you need to permanently remove a workflow after confirming it exists. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.agenty.api.workflows.deleteWorkflow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workflow_id` | `string` | Yes | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### downloadWorkflows `workflows.downloadWorkflows` Tool to download all workflows in CSV format. Use when you need to export or backup all workflows from your account. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.agenty.api.workflows.downloadWorkflows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWorkflowById `workflows.getWorkflowById` Retrieves complete details of a specific workflow by its ID. Use this to view workflow configuration including agents, triggers, and actions before updating or deleting. **Risk:** `read` ```ts theme={null} await corsair.agenty.api.workflows.getWorkflowById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workflow_id` | `string` | Yes | — | | `id` | `string \| number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### patchWorkflow `workflows.patchWorkflow` Tool to partially update a workflow by ID. Use when you need to update specific fields of a workflow without replacing the entire workflow object. This action performs a PATCH operation, allowing you to update only the fields you specify (e.g., just the name) without affecting other workflow properties. Currently supports updating the workflow name. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.workflows.patchWorkflow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workflow_id` | `string` | Yes | — | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateWorkflow `workflows.updateWorkflow` Tool to update an existing workflow's configuration by workflow ID. Use this to modify workflow properties including name, agent selection, trigger conditions, and actions to execute. Workflows automate responses to agent events such as job completion, errors, or change detection. Common use cases include sending notifications, triggering webhooks, or updating external systems. **Risk:** `write` ```ts theme={null} await corsair.agenty.api.workflows.updateWorkflow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workflow_id` | `string` | Yes | — | | `id` | `string \| number` | No | — | | `name` | `string` | Yes | — | | `agents` | `object` | Yes | — | | `actions` | `any[]` | Yes | — | | `trigger` | `object` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **agents full type** > > ```ts theme={null} > { > } > ``` > **trigger full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/agenty/database Agenty local sync: searchable entities, `.search()` filters, and operators. The Agenty plugin syncs data locally. Use `corsair.agenty.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Agents Path: `agenty.db.agents.search` ```ts theme={null} const rows = await corsair.agenty.db.agents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `agent_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `agenty.db.jobs.search` ```ts theme={null} const rows = await corsair.agenty.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `job_id` | `number` | equals, gt, gte, lt, lte, in | | `agent_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `agenty.db.lists.search` ```ts theme={null} const rows = await corsair.agenty.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/agenty/overview Web scraping and data extraction platform for monitoring and harvesting online data. Use **Agenty** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 79 typed API operations * 3 synced entities (`agents`, `jobs`, `lists`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/agenty ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/agenty ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/agenty ``` ```bash bun theme={null} bun add corsair @corsair-dev/agenty ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { agenty } from '@corsair-dev/agenty'; export const corsair = createCorsair({ plugins: [ agenty(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} agenty() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'agenty', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`agents.agentsControllerGetTemplates`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agenty.api.agents.agentsControllerGetTemplates({}); ``` **`agents.agentsControllerCreateAgent`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agenty.api.agents.agentsControllerCreateAgent({}); ``` See the full list on the [API](/plugins/agenty/api) page. ## Query synced data Synced entities support `tenant.agenty.db..search()` and `.list()`: `agents`, `jobs`, `lists`. See [Database](/plugins/agenty/database) for filters and operators. ## What's next > **[API reference](/plugins/agenty/api)** > > Every `agenty.api.*` operation with input and output types. > **[Database](/plugins/agenty/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/agiled/api API reference for Agiled: every `agiled.api.*` operation with input and output types. Every `agiled.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Contacts ### list `contacts.list` List contacts from an Agiled workspace **Risk:** `read` ```ts theme={null} await corsair.agiled.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: number | string, > first_name: string, > last_name?: string, > email?: string, > phone?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/agiled/database Agiled local sync: searchable entities, `.search()` filters, and operators. The Agiled plugin syncs data locally. Use `corsair.agiled.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/agiled/overview Agiled plugin for Corsair Use **Agiled** through Corsair: one client, typed API calls. **What you get:** * 1 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/agiled ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/agiled ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/agiled ``` ```bash bun theme={null} bun add corsair @corsair-dev/agiled ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { agiled } from '@corsair-dev/agiled'; export const corsair = createCorsair({ plugins: [ agiled(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} agiled() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'agiled', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`contacts.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agiled.api.contacts.list({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/agiled/api) reference.* See the full list on the [API](/plugins/agiled/api) page. ## What's next > **[API reference](/plugins/agiled/api)** > > Every `agiled.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/agilitycms/api API reference for Agility CMS: every `agilitycms.api.*` operation with input and output types. Every `agilitycms.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Content ### getApiTypes `content.getApiTypes` Retrieve enum types and metadata definitions used throughout Agility CMS API **Risk:** `read` ```ts theme={null} await corsair.agilitycms.api.content.getApiTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceGuid` | `string` | Yes | Agility CMS instance GUID | | `locale` | `string` | Yes | Language locale code | | `apiType` | `fetch \| preview` | Yes | API access mode | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getContentModels `content.getContentModels` Retrieve content models and page module schema definitions **Risk:** `read` ```ts theme={null} await corsair.agilitycms.api.content.getContentModels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceGuid` | `string` | Yes | Agility CMS instance GUID | | `locale` | `string` | Yes | Language locale code (e.g. en-us) | | `apiType` | `fetch \| preview` | Yes | API access mode: fetch for live, preview for staging | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > referenceName?: string | null, > displayName: string, > description?: string | null, > fields?: { > }[] > }[] > ``` *** ### getItem `content.getItem` Fetch details of a content item by Content ID including fields and metadata **Risk:** `read` ```ts theme={null} await corsair.agilitycms.api.content.getItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceGuid` | `string` | Yes | Agility CMS instance GUID | | `locale` | `string` | Yes | Language locale code (e.g. en-us) | | `contentId` | `number` | Yes | Content item ID to retrieve | | `apiType` | `fetch \| preview` | Yes | API access mode: fetch for live, preview for staging | | `contentLinkDepth` | `number` | No | Depth of linked content items to expand (0-5) | | `expandAllContentLinks` | `boolean` | No | Whether to automatically expand all nested content links | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentID` | `number` | Yes | Unique identifier for the content item | | `properties` | `object` | No | System metadata properties | | `fields` | `object` | Yes | Dynamic content fields key-value dictionary | > **properties full type** > > ```ts theme={null} > { > state?: number, > modified?: string, > versionID?: number, > referenceName?: string, > definitionName?: string, > itemOrder?: number > } > ``` > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### getList `content.getList` Retrieve a paginated, filterable list of content items by reference name **Risk:** `read` ```ts theme={null} await corsair.agilitycms.api.content.getList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceGuid` | `string` | Yes | Agility CMS instance GUID | | `locale` | `string` | Yes | Language locale code (e.g. en-us) | | `referenceName` | `string` | Yes | Content list reference name (e.g. posts, authors) | | `apiType` | `fetch \| preview` | Yes | API access mode: fetch for live, preview for staging | | `contentLinkDepth` | `number` | No | Depth of linked content items to expand (0-5) | | `expandAllContentLinks` | `boolean` | No | Whether to automatically expand all nested content links | | `take` | `number` | No | Maximum number of items to return (page size) | | `skip` | `number` | No | Number of items to skip for pagination | | `sort` | `string` | No | Field name to sort items by (e.g. properties.modified) | | `direction` | `asc \| desc` | No | Sort direction: asc or desc | | `filter` | `string` | No | OData filter expression (e.g. fields.Title\[like]MyPost) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalCount` | `number` | No | Total number of matching content items | | `items` | `object[]` | Yes | Array of retrieved content items | > **items full type** > > ```ts theme={null} > { > contentID: number, > properties?: { > state?: number, > modified?: string, > versionID?: number, > referenceName?: string, > definitionName?: string, > itemOrder?: number > }, > fields: { > } > }[] > ``` *** ### getLogs `content.getLogs` Retrieve sync items (content change logs) incrementally using sync tokens **Risk:** `read` ```ts theme={null} await corsair.agilitycms.api.content.getLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceGuid` | `string` | Yes | Agility CMS instance GUID | | `locale` | `string` | Yes | Language locale code (e.g. en-us) | | `syncToken` | `string` | Yes | Sync token for incremental change sync; use '0' for initial sync | | `pageSize` | `number` | No | Number of sync items to return per page (max 500) | | `apiType` | `fetch \| preview` | Yes | API access mode | **Output** | Name | Type | Required | Description | | - | - | - | - | | `syncToken` | `string` | Yes | Next sync token to persist; returns '0' when sync is up to date | | `items` | `object[]` | Yes | List of content items created or updated since last sync | > **items full type** > > ```ts theme={null} > { > contentID: number, > properties?: { > state?: number, > modified?: string, > versionID?: number, > referenceName?: string, > definitionName?: string, > itemOrder?: number > }, > fields?: { > } > }[] > ``` *** ### getPage `content.getPage` Retrieve details of a Page including metadata, content zones, and components by page ID **Risk:** `read` ```ts theme={null} await corsair.agilitycms.api.content.getPage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceGuid` | `string` | Yes | Agility CMS instance GUID | | `locale` | `string` | Yes | Language locale code (e.g. en-us) | | `pageId` | `number` | Yes | Page ID to retrieve | | `apiType` | `fetch \| preview` | Yes | API access mode: fetch for live, preview for staging | | `contentLinkDepth` | `number` | No | Depth of linked content items to expand (0-5) | | `expandAllContentLinks` | `boolean` | No | Whether to automatically expand all nested content links | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pageID` | `number` | Yes | Unique identifier for the page | | `name` | `string` | Yes | Page name | | `path` | `string` | No | URL path of the page | | `title` | `string` | Yes | Browser title of the page | | `menuText` | `string` | No | Menu label text | | `pageType` | `string` | No | Page type (e.g. static, dynamic) | | `templateName` | `string` | Yes | Page template layout name | | `redirectUrl` | `string` | No | Redirect URL if configured | | `securePage` | `boolean` | No | Whether the page requires authentication | | `seo` | `object` | No | SEO and visibility configuration | | `zones` | `object` | No | Content zones dictionary mapping zone name to components | | `properties` | `object` | No | Page system metadata properties | > **seo full type** > > ```ts theme={null} > { > metaDescription?: string, > metaKeywords?: string, > metaHTML?: string, > menuVisible?: boolean, > sitemapVisible?: boolean > } > ``` > **zones full type** > > ```ts theme={null} > { > } > ``` > **properties full type** > > ```ts theme={null} > { > state?: number, > modified?: string, > versionID?: number, > referenceName?: string, > definitionName?: string, > itemOrder?: number > } > ``` *** ### getPageModules `content.getPageModules` Retrieve page module UI component definitions for building pages **Risk:** `read` ```ts theme={null} await corsair.agilitycms.api.content.getPageModules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceGuid` | `string` | Yes | Agility CMS instance GUID | | `locale` | `string` | Yes | Language locale code (e.g. en-us) | | `apiType` | `fetch \| preview` | Yes | API access mode: fetch for live, preview for staging | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > referenceName?: string | null, > displayName: string, > description?: string | null, > fields?: { > }[] > }[] > ``` *** ### getSitemapFlat `content.getSitemapFlat` Retrieve the flat sitemap dictionary for a specific channel and locale **Risk:** `read` ```ts theme={null} await corsair.agilitycms.api.content.getSitemapFlat({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceGuid` | `string` | Yes | Agility CMS instance GUID | | `locale` | `string` | Yes | Language locale code (e.g. en-us) | | `channelName` | `string` | Yes | Digital channel name (e.g. website) | | `apiType` | `fetch \| preview` | Yes | API access mode: fetch for live, preview for staging | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### syncPages `content.syncPages` Synchronize local page data with CMS incrementally using sync tokens **Risk:** `read` ```ts theme={null} await corsair.agilitycms.api.content.syncPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceGuid` | `string` | Yes | Agility CMS instance GUID | | `locale` | `string` | Yes | Language locale code (e.g. en-us) | | `syncToken` | `string` | Yes | Sync token for incremental page sync; use '0' for initial sync | | `pageSize` | `number` | No | Number of sync pages to return per page (max 500) | | `apiType` | `fetch \| preview` | Yes | API access mode | **Output** | Name | Type | Required | Description | | - | - | - | - | | `syncToken` | `string` | Yes | Next sync token to persist; returns '0' when page sync is up to date | | `items` | `object[]` | Yes | List of page items created or updated since last sync | > **items full type** > > ```ts theme={null} > { > pageID: number, > name?: string, > path?: string | null, > title?: string, > templateName?: string, > properties?: { > state?: number, > modified?: string, > versionID?: number, > referenceName?: string, > definitionName?: string, > itemOrder?: number > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/agilitycms/database Agility CMS local sync: searchable entities, `.search()` filters, and operators. The Agility CMS plugin syncs data locally. Use `corsair.agilitycms.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Content Items Path: `agilitycms.db.contentItems.search` ```ts theme={null} const rows = await corsair.agilitycms.db.contentItems.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `contentID` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Content Models Path: `agilitycms.db.contentModels.search` ```ts theme={null} const rows = await corsair.agilitycms.db.contentModels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `referenceName` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Page Modules Path: `agilitycms.db.pageModules.search` ```ts theme={null} const rows = await corsair.agilitycms.db.pageModules.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `referenceName` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pages Path: `agilitycms.db.pages.search` ```ts theme={null} const rows = await corsair.agilitycms.db.pages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `pageID` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `menuText` | `string` | equals, contains, startsWith, endsWith, in | | `pageType` | `string` | equals, contains, startsWith, endsWith, in | | `templateName` | `string` | equals, contains, startsWith, endsWith, in | | `redirectUrl` | `string` | equals, contains, startsWith, endsWith, in | | `securePage` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sitemap Nodes Path: `agilitycms.db.sitemapNodes.search` ```ts theme={null} const rows = await corsair.agilitycms.db.sitemapNodes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `pageID` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `menuText` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `isFolder` | `boolean` | equals | | `redirectUrl` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sync Items Path: `agilitycms.db.syncItems.search` ```ts theme={null} const rows = await corsair.agilitycms.db.syncItems.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `contentID` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sync Pages Path: `agilitycms.db.syncPages.search` ```ts theme={null} const rows = await corsair.agilitycms.db.syncPages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `pageID` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `templateName` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/agilitycms/overview Headless content management system for building and delivering omnichannel digital experiences. Use **Agility CMS** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 9 typed API operations * 7 synced entities (`contentItems`, `contentModels`, `pageModules`, `pages`, `sitemapNodes`, `syncItems`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/agilitycms ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/agilitycms ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/agilitycms ``` ```bash bun theme={null} bun add corsair @corsair-dev/agilitycms ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { agilitycms } from '@corsair-dev/agilitycms'; export const corsair = createCorsair({ plugins: [ agilitycms(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} agilitycms() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'agilitycms', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`content.getApiTypes`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.agilitycms.api.content.getApiTypes({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/agilitycms/api) reference.* See the full list on the [API](/plugins/agilitycms/api) page. ## Query synced data Synced entities support `tenant.agilitycms.db..search()` and `.list()`: `contentItems`, `contentModels`, `pageModules`, `pages`, `sitemapNodes`, `syncItems`, `syncPages`. See [Database](/plugins/agilitycms/database) for filters and operators. ## What's next > **[API reference](/plugins/agilitycms/api)** > > Every `agilitycms.api.*` operation with input and output types. > **[Database](/plugins/agilitycms/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/ahrefs/api API reference for Ahrefs: every `ahrefs.api.*` operation with input and output types. Every `ahrefs.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Keywords Explorer ### overview `keywordsExplorer.overview` Get keyword metrics such as volume, difficulty, CPC, clicks, and traffic potential **Risk:** `read` ```ts theme={null} await corsair.ahrefs.api.keywordsExplorer.overview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timeout` | `number` | No | — | | `limit` | `number` | No | — | | `order_by` | `string` | No | — | | `where` | `string` | No | — | | `select` | `string` | Yes | — | | `volume_monthly_date_to` | `string` | No | — | | `volume_monthly_date_from` | `string` | No | — | | `target_mode` | `exact \| prefix \| domain \| subdomains` | No | — | | `target` | `string` | No | — | | `target_position` | `in_top10 \| in_top100` | No | — | | `country` | `string` | Yes | — | | `keywords` | `string \| string[]` | No | — | | `keyword_list_id` | `number` | No | — | | `output` | `json` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `keywords` | `object[]` | Yes | — | > **keywords full type** > > ```ts theme={null} > { > clicks?: number | null, > cpc?: number | null, > cps?: number | null, > difficulty?: number | null, > first_seen?: string | null, > global_volume?: number | null, > intents?: { > informational?: boolean, > navigational?: boolean, > commercial?: boolean, > transactional?: boolean, > branded?: boolean, > local?: boolean > } | null, > keyword: string, > parent_topic?: string | null, > parent_volume?: number | null, > searches_pct_clicks_organic_and_paid?: number | null, > searches_pct_clicks_organic_only?: number | null, > searches_pct_clicks_paid_only?: number | null, > serp_features?: string[], > serp_last_update?: string | null, > traffic_potential?: number | null, > volume?: number | null, > volume_desktop_pct?: number | null, > volume_mobile_pct?: number | null, > volume_monthly?: number | null, > volume_monthly_history?: { > }[] > }[] > ``` *** ## Rank Tracker ### overview `rankTracker.overview` Get Rank Tracker keyword overview data for a project and device **Risk:** `read` ```ts theme={null} await corsair.ahrefs.api.rankTracker.overview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timeout` | `number` | No | — | | `limit` | `number` | No | — | | `order_by` | `string` | No | — | | `where` | `string` | No | — | | `select` | `string` | Yes | — | | `date_compared` | `string` | No | — | | `date` | `string` | Yes | — | | `device` | `desktop \| mobile` | Yes | — | | `project_id` | `number` | Yes | — | | `volume_mode` | `monthly \| average` | No | — | | `output` | `json` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `overviews` | `object[]` | Yes | — | > **overviews full type** > > ```ts theme={null} > { > keyword?: string | null, > country?: string, > device?: string, > position?: number | null, > previous_position?: number | null, > best_position_kind?: string | null, > clicks?: number | null, > volume?: number | null, > traffic?: number | null, > url?: string | null > }[] > ``` *** ## Serp ### overview `serp.overview` Get SERP positions for a keyword and country, including ranking page metrics **Risk:** `read` ```ts theme={null} await corsair.ahrefs.api.serp.overview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | Yes | — | | `top_positions` | `number` | No | — | | `date` | `string` | No | — | | `country` | `string` | Yes | — | | `keyword` | `string` | Yes | — | | `output` | `json` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `positions` | `object[]` | Yes | — | > **positions full type** > > ```ts theme={null} > { > position: number, > url?: string | null, > title?: string | null, > type?: string[], > domain_rating?: number | null, > ahrefs_rank?: number | null, > backlinks?: number | null, > refdomains?: number | null, > traffic?: number | null, > value?: number | null, > update_date?: string | null > }[] > ``` *** ## Site Explorer ### backlinksStats `siteExplorer.backlinksStats` Get live and all-time backlink and referring-domain counts for a target **Risk:** `read` ```ts theme={null} await corsair.ahrefs.api.siteExplorer.backlinksStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `protocol` | `both \| http \| https` | No | — | | `target` | `string` | Yes | — | | `date` | `string` | Yes | — | | `output` | `json` | No | — | | `mode` | `exact \| prefix \| domain \| subdomains` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metrics` | `object` | Yes | — | > **metrics full type** > > ```ts theme={null} > { > all_time?: number | null, > all_time_refdomains?: number | null, > live?: number | null, > live_refdomains?: number | null > } > ``` *** ### getDomainRating `siteExplorer.getDomainRating` Get Ahrefs Domain Rating and Ahrefs Rank for a target **Risk:** `read` ```ts theme={null} await corsair.ahrefs.api.siteExplorer.getDomainRating({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `protocol` | `both \| http \| https` | No | — | | `target` | `string` | Yes | — | | `date` | `string` | Yes | — | | `output` | `json` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain_rating` | `object` | Yes | — | > **domain\_rating full type** > > ```ts theme={null} > { > ahrefs_rank?: number | null, > domain_rating?: number | null > } > ``` *** ### organicKeywords `siteExplorer.organicKeywords` List organic keywords a target ranks for, including positions and traffic metrics **Risk:** `read` ```ts theme={null} await corsair.ahrefs.api.siteExplorer.organicKeywords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `protocol` | `both \| http \| https` | No | — | | `target` | `string` | Yes | — | | `date` | `string` | Yes | — | | `output` | `json` | No | — | | `timeout` | `number` | No | — | | `limit` | `number` | No | — | | `order_by` | `string` | No | — | | `where` | `string` | No | — | | `select` | `string` | Yes | — | | `mode` | `exact \| prefix \| domain \| subdomains` | No | — | | `country` | `string` | Yes | — | | `date_compared` | `string` | No | — | | `volume_mode` | `monthly \| average` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `keywords` | `object[]` | Yes | — | > **keywords full type** > > ```ts theme={null} > { > keyword?: string | null, > keyword_country?: string, > best_position?: number | null, > best_position_url?: string | null, > keyword_difficulty?: number | null, > volume?: number | null, > cpc?: number | null, > sum_traffic?: number | null, > serp_features?: string[], > last_update?: string | null, > status?: string > }[] > ``` *** ### refdomains `siteExplorer.refdomains` List referring domains linking to a target **Risk:** `read` ```ts theme={null} await corsair.ahrefs.api.siteExplorer.refdomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `protocol` | `both \| http \| https` | No | — | | `target` | `string` | Yes | — | | `date` | `string` | Yes | — | | `output` | `json` | No | — | | `timeout` | `number` | No | — | | `limit` | `number` | No | — | | `order_by` | `string` | No | — | | `where` | `string` | No | — | | `select` | `string` | Yes | — | | `mode` | `exact \| prefix \| domain \| subdomains` | No | — | | `history` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `refdomains` | `object[]` | Yes | — | > **refdomains full type** > > ```ts theme={null} > { > domain: string, > domain_rating?: number | null, > dofollow_links?: number | null, > dofollow_refdomains?: number | null, > links?: number | null, > refdomains?: number | null, > first_seen?: string | null, > last_visited?: string | null > }[] > ``` *** ### topPages `siteExplorer.topPages` List top organic pages for a target with traffic, keyword, and link metrics **Risk:** `read` ```ts theme={null} await corsair.ahrefs.api.siteExplorer.topPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `protocol` | `both \| http \| https` | No | — | | `target` | `string` | Yes | — | | `date` | `string` | Yes | — | | `output` | `json` | No | — | | `timeout` | `number` | No | — | | `limit` | `number` | No | — | | `order_by` | `string` | No | — | | `where` | `string` | No | — | | `select` | `string` | Yes | — | | `mode` | `exact \| prefix \| domain \| subdomains` | No | — | | `country` | `string` | Yes | — | | `date_compared` | `string` | No | — | | `volume_mode` | `monthly \| average` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pages` | `object[]` | Yes | — | > **pages full type** > > ```ts theme={null} > { > raw_url: string, > keywords?: number | null, > referring_domains?: number | null, > sum_traffic?: number | null, > value?: number | null, > page_type?: string | null, > status?: string > }[] > ``` *** ## Subscription Info ### limitsAndUsage `subscriptionInfo.limitsAndUsage` Get Ahrefs subscription limits and API unit usage **Risk:** `read` ```ts theme={null} await corsair.ahrefs.api.subscriptionInfo.limitsAndUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `output` | `json` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `limits_and_usage` | `object` | Yes | — | > **limits\_and\_usage full type** > > ```ts theme={null} > { > api_key_expiration_date: string, > subscription: string, > units_limit_api_key?: number | null, > units_limit_workspace?: number | null, > units_usage_api_key: number, > units_usage_workspace?: number | null, > usage_reset_date: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/ahrefs/database Ahrefs local sync: searchable entities, `.search()` filters, and operators. The Ahrefs plugin syncs data locally. Use `corsair.ahrefs.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Domain Metrics Path: `ahrefs.db.domainMetrics.search` ```ts theme={null} const rows = await corsair.ahrefs.db.domainMetrics.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `target` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `ahrefs_rank` | `number` | equals, gt, gte, lt, lte, in | | `domain_rating` | `number` | equals, gt, gte, lt, lte, in | | `backlinks` | `number` | equals, gt, gte, lt, lte, in | | `referring_domains` | `number` | equals, gt, gte, lt, lte, in | | `all_time_backlinks` | `number` | equals, gt, gte, lt, lte, in | | `all_time_referring_domains` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Keywords Path: `ahrefs.db.keywords.search` ```ts theme={null} const rows = await corsair.ahrefs.db.keywords.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `target` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `keyword` | `string` | equals, contains, startsWith, endsWith, in | | `volume` | `number` | equals, gt, gte, lt, lte, in | | `keyword_difficulty` | `number` | equals, gt, gte, lt, lte, in | | `difficulty` | `number` | equals, gt, gte, lt, lte, in | | `cpc` | `number` | equals, gt, gte, lt, lte, in | | `best_position` | `number` | equals, gt, gte, lt, lte, in | | `best_position_url` | `string` | equals, contains, startsWith, endsWith, in | | `sum_traffic` | `number` | equals, gt, gte, lt, lte, in | | `traffic_potential` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pages Path: `ahrefs.db.pages.search` ```ts theme={null} const rows = await corsair.ahrefs.db.pages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `target` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `raw_url` | `string` | equals, contains, startsWith, endsWith, in | | `keywords` | `number` | equals, gt, gte, lt, lte, in | | `referring_domains` | `number` | equals, gt, gte, lt, lte, in | | `sum_traffic` | `number` | equals, gt, gte, lt, lte, in | | `value` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Rankings Path: `ahrefs.db.rankings.search` ```ts theme={null} const rows = await corsair.ahrefs.db.rankings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `device` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `keyword` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `position` | `number` | equals, gt, gte, lt, lte, in | | `previous_position` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Refdomains Path: `ahrefs.db.refdomains.search` ```ts theme={null} const rows = await corsair.ahrefs.db.refdomains.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `target` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `domain_rating` | `number` | equals, gt, gte, lt, lte, in | | `dofollow_links` | `number` | equals, gt, gte, lt, lte, in | | `dofollow_refdomains` | `number` | equals, gt, gte, lt, lte, in | | `links` | `number` | equals, gt, gte, lt, lte, in | | `refdomains` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Serp Positions Path: `ahrefs.db.serpPositions.search` ```ts theme={null} const rows = await corsair.ahrefs.db.serpPositions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `keyword` | `string` | equals, contains, startsWith, endsWith, in | | `requestedDate` | `string` | equals, contains, startsWith, endsWith, in | | `position` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `domain_rating` | `number` | equals, gt, gte, lt, lte, in | | `backlinks` | `number` | equals, gt, gte, lt, lte, in | | `refdomains` | `number` | equals, gt, gte, lt, lte, in | | `traffic` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Subscription Usage Path: `ahrefs.db.subscriptionUsage.search` ```ts theme={null} const rows = await corsair.ahrefs.db.subscriptionUsage.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `api_key_expiration_date` | `string` | equals, contains, startsWith, endsWith, in | | `subscription` | `string` | equals, contains, startsWith, endsWith, in | | `units_limit_api_key` | `number` | equals, gt, gte, lt, lte, in | | `units_limit_workspace` | `number` | equals, gt, gte, lt, lte, in | | `units_usage_api_key` | `number` | equals, gt, gte, lt, lte, in | | `units_usage_workspace` | `number` | equals, gt, gte, lt, lte, in | | `usage_reset_date` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/ahrefs/get-credentials How to get Ahrefs API credentials ## Get your Ahrefs API Key **1. Sign up or log in** Go to [Ahrefs](https://ahrefs.com) and sign in to your account. **2. Navigate to API Settings** 1. Click on your profile in the top right 2. Go to "API" settings 3. Or directly visit: [https://ahrefs.com/api](https://ahrefs.com/api) **3. Generate API Token** 1. Click "Generate new token" or use an existing token 2. Copy the API token - you'll need this for authentication 3. Store it securely (you won't be able to see it again) **4. Store in Corsair** Run the setup command: ```bash theme={null} pnpm corsair setup --plugin=ahrefs api_key=your-api-key ``` When prompted, enter: * `api_key`: Your Ahrefs API token For multi-tenant setup: ```bash theme={null} pnpm corsair setup --plugin=ahrefs api_key=their-api-key --tenant= ``` ## API Key Notes Ahrefs API v3 uses the key in the `Authorization: Bearer ` header. Only workspace owners and admins can create API keys, and keys expire after 1 year. ## Rate Limits Ahrefs API is limited to 60 requests per minute by default. Many endpoints also consume API units based on requested fields and returned rows, with a minimum request cost unless the endpoint is marked free in Ahrefs docs. Corsair retries rate-limited responses with exponential backoff. ## Required Permissions The API key needs access to: * **Site Explorer API** - for domain metrics and backlinks data * **Keywords Explorer API** - for keyword research and metrics Check your Ahrefs subscription to ensure API access is enabled. # Overview Source: https://docs.corsair.dev/plugins/ahrefs/overview SEO toolkit for keyword research, backlink analysis, and search ranking insights. Use **Ahrefs** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 9 typed API operations * 7 synced entities (`domainMetrics`, `keywords`, `pages`, `rankings`, `refdomains`, `serpPositions`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ahrefs ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ahrefs ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ahrefs ``` ```bash bun theme={null} bun add corsair @corsair-dev/ahrefs ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ahrefs } from '@corsair-dev/ahrefs'; export const corsair = createCorsair({ plugins: [ ahrefs(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/ahrefs/get-credentials). ```ts theme={null} ahrefs() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ahrefs', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`keywordsExplorer.overview`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ahrefs.api.keywordsExplorer.overview({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/ahrefs/api) reference.* See the full list on the [API](/plugins/ahrefs/api) page. ## Query synced data Synced entities support `tenant.ahrefs.db..search()` and `.list()`: `domainMetrics`, `keywords`, `pages`, `rankings`, `refdomains`, `serpPositions`, `subscriptionUsage`. See [Database](/plugins/ahrefs/database) for filters and operators. ## What's next > **[API reference](/plugins/ahrefs/api)** > > Every `ahrefs.api.*` operation with input and output types. > **[Database](/plugins/ahrefs/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/ahrefs/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/aimlapi/api API reference for AIML API: every `aimlapi.api.*` operation with input and output types. Every `aimlapi.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Assistants ### create `assistants.create` Create a new AIMLAPI assistant. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.assistants.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `instructions` | `string` | No | — | | `tools` | `any[]` | No | — | | `toolResources` | `object` | No | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | > **toolResources full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `assistants.delete` Delete an assistant. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.assistants.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `object` | `string` | No | — | | `deleted` | `boolean` | Yes | — | *** ### get `assistants.get` Retrieve an assistant by ID. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.assistants.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `assistants.list` List configured assistants. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.assistants.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `before` | `string` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `data` | `any[]` | Yes | — | | `has_more` | `boolean` | No | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | *** ### update `assistants.update` Update an assistant definition. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.assistants.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantId` | `string` | Yes | — | | `model` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `instructions` | `string` | No | — | | `tools` | `any[]` | No | — | | `toolResources` | `object` | No | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | > **toolResources full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Batches ### list `batches.list` List or retrieve batch processing status and results. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.batches.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Billing ### getBalance `billing.getBalance` Retrieve account billing balance. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.billing.getBalance({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `current_balance` | `number` | No | — | | `balance` | `number` | No | — | | `currency` | `string` | No | — | *** ## Chat ### createCompletion `chat.createCompletion` Generate a chat completion using an AIMLAPI-compatible model. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.chat.createCompletion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `maxTokens` | `number` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `frequencyPenalty` | `number` | No | — | | `presencePenalty` | `number` | No | — | | `stop` | `string \| string[]` | No | — | | `tools` | `any[]` | No | — | | `toolChoice` | `any` | No | — | | `responseFormat` | `any` | No | — | | `seed` | `number` | No | — | | `n` | `number` | No | — | > **messages full type** > > ```ts theme={null} > { > role: string, > content: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `model` | `string` | No | — | | `choices` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > index?: number, > message: { > role: string, > content: string > }, > finish_reason?: string, > finishReason?: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ## Luma ### getGeneration `luma.getGeneration` Retrieve a Luma video generation by ID. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.luma.getGeneration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `generationId` | `string` | No | — | | `ids` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `video` | `any` | No | — | | `error` | `any` | No | — | | `meta` | `any` | No | — | *** ## Messages ### create `messages.create` Create a message in a thread. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.messages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `role` | `string` | Yes | — | | `content` | `string` | Yes | — | | `attachments` | `any[]` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `messages.delete` Delete a message. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `object` | `string` | No | — | | `deleted` | `boolean` | Yes | — | *** ### get `messages.get` Retrieve a message by ID. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `messages.list` List messages in a thread. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `before` | `string` | No | — | | `after` | `string` | No | — | | `threadId` | `string` | Yes | — | | `runId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `data` | `any[]` | Yes | — | | `has_more` | `boolean` | No | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | *** ### update `messages.update` Update a message. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.messages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Models ### list `models.list` List models currently available to the AIMLAPI account. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.models.list({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > type?: string, > name?: string, > provider?: string, > info?: { > name?: string, > developer?: string, > description?: string, > contextLength?: number, > maxTokens?: number, > url?: string, > docsUrl?: string, > docs_url?: string, > releasedAt?: string > }, > features?: string[], > endpoints?: string[], > aliases?: string[], > tags?: string[], > metadata?: { > } > }[] | { > object?: string, > data: { > id: string, > type?: string, > name?: string, > provider?: string, > info?: { > name?: string, > developer?: string, > description?: string, > contextLength?: number, > maxTokens?: number, > url?: string, > docsUrl?: string, > docs_url?: string, > releasedAt?: string > }, > features?: string[], > endpoints?: string[], > aliases?: string[], > tags?: string[], > metadata?: { > } > }[], > has_more?: boolean, > first_id?: string, > last_id?: string > } > ``` *** ### listWithDetails `models.listWithDetails` List models with pagination metadata and expanded details. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.models.listWithDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `before` | `string` | No | — | | `after` | `string` | No | — | | `model` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > type?: string, > name?: string, > provider?: string, > info?: { > name?: string, > developer?: string, > description?: string, > contextLength?: number, > maxTokens?: number, > url?: string, > docsUrl?: string, > docs_url?: string, > releasedAt?: string > }, > features?: string[], > endpoints?: string[], > aliases?: string[], > tags?: string[], > metadata?: { > } > }[] | { > object?: string, > data: { > id: string, > type?: string, > name?: string, > provider?: string, > info?: { > name?: string, > developer?: string, > description?: string, > contextLength?: number, > maxTokens?: number, > url?: string, > docsUrl?: string, > docs_url?: string, > releasedAt?: string > }, > features?: string[], > endpoints?: string[], > aliases?: string[], > tags?: string[], > metadata?: { > } > }[], > has_more?: boolean, > first_id?: string, > last_id?: string > } > ``` *** ## Responses ### get `responses.get` Retrieve a response by ID. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.responses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | | `include` | `string[]` | No | — | | `startingAfter` | `number` | No | — | | `includeObfuscation` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Runs ### cancel `runs.cancel` Cancel an in-progress run. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.runs.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### create `runs.create` Create a run for a thread and assistant. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.runs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `assistantId` | `string` | Yes | — | | `instructions` | `string` | No | — | | `additionalInstructions` | `string` | No | — | | `tools` | `any[]` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### get `runs.get` Retrieve a run by ID. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.runs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `runs.list` List runs for a thread. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.runs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `before` | `string` | No | — | | `after` | `string` | No | — | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `data` | `any[]` | Yes | — | | `has_more` | `boolean` | No | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | *** ### submitToolOutputs `runs.submitToolOutputs` Submit tool outputs for a run. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.runs.submitToolOutputs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | | `toolOutputs` | `any[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### update `runs.update` Update a run. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.runs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | | `instructions` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Run Steps ### get `runSteps.get` Retrieve a single run step. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.runSteps.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | | `stepId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `runSteps.list` List run steps for a run. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.runSteps.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `before` | `string` | No | — | | `after` | `string` | No | — | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `data` | `any[]` | Yes | — | | `has_more` | `boolean` | No | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | *** ## Threads ### create `threads.create` Create an AIMLAPI thread. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.threads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | No | — | | `toolResources` | `object` | No | — | | `metadata` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > role: string, > content: string > }[] > ``` > **toolResources full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `threads.delete` Delete a thread. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.threads.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `object` | `string` | No | — | | `deleted` | `boolean` | Yes | — | *** ### get `threads.get` Retrieve a thread by ID. **Risk:** `read` ```ts theme={null} await corsair.aimlapi.api.threads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### update `threads.update` Update thread metadata or resources. **Risk:** `write` ```ts theme={null} await corsair.aimlapi.api.threads.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `toolResources` | `object` | No | — | | `metadata` | `object` | No | — | > **toolResources full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `created_at` | `number` | No | — | | `status` | `string` | No | — | | `model` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/aimlapi/database AIML API local sync: searchable entities, `.search()` filters, and operators. The AIML API plugin syncs data locally. Use `corsair.aimlapi.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Assistants Path: `aimlapi.db.assistants.search` ```ts theme={null} const rows = await corsair.aimlapi.db.assistants.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Batches Path: `aimlapi.db.batches.search` ```ts theme={null} const rows = await corsair.aimlapi.db.batches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Models Path: `aimlapi.db.models.search` ```ts theme={null} const rows = await corsair.aimlapi.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `provider` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Threads Path: `aimlapi.db.threads.search` ```ts theme={null} const rows = await corsair.aimlapi.db.threads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/aimlapi/overview Unified API gateway for accessing many AI and machine learning models. Use **AIML API** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 29 typed API operations * 4 synced entities (`assistants`, `batches`, `models`, `threads`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/aimlapi ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/aimlapi ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/aimlapi ``` ```bash bun theme={null} bun add corsair @corsair-dev/aimlapi ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { aimlapi } from '@corsair-dev/aimlapi'; export const corsair = createCorsair({ plugins: [ aimlapi(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} aimlapi() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'aimlapi', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`assistants.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.aimlapi.api.assistants.get({}); ``` **`assistants.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.aimlapi.api.assistants.create({}); ``` See the full list on the [API](/plugins/aimlapi/api) page. ## Query synced data Synced entities support `tenant.aimlapi.db..search()` and `.list()`: `assistants`, `batches`, `models`, `threads`. See [Database](/plugins/aimlapi/database) for filters and operators. ## What's next > **[API reference](/plugins/aimlapi/api)** > > Every `aimlapi.api.*` operation with input and output types. > **[Database](/plugins/aimlapi/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/airtable/api API reference for Airtable: every `airtable.api.*` operation with input and output types. Every `airtable.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Bases ### getMany `bases.getMany` List all accessible bases **Risk:** `read` ```ts theme={null} await corsair.airtable.api.bases.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bases` | `object[]` | Yes | — | | `offset` | `string` | No | — | > **bases full type** > > ```ts theme={null} > { > id: string, > name: string, > permissionLevel: string > }[] > ``` *** ### getSchema `bases.getSchema` Get the schema (tables, fields, views) of a base **Risk:** `read` ```ts theme={null} await corsair.airtable.api.bases.getSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `baseId` | `string` | Yes | — | | `include` | `visibleFieldIds \| fieldIdsInSynced[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tables` | `object[]` | Yes | — | > **tables full type** > > ```ts theme={null} > { > id: string, > name: string, > primaryFieldId: string, > description?: string, > fields: { > id: string, > type: string, > name: string, > description?: string, > options?: { > } > }[], > views: { > id: string, > type: string, > name: string, > personalForCreator?: boolean > }[] > }[] > ``` *** ## Records ### create `records.create` Create a record in a table **Risk:** `write` ```ts theme={null} await corsair.airtable.api.records.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `baseId` | `string` | Yes | — | | `tableIdOrName` | `string` | Yes | — | | `fields` | `object` | Yes | — | | `typecast` | `boolean` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > id: string, > createdTime: string, > fields: { > } > }[] > ``` *** ### createOrUpdate `records.createOrUpdate` Create or update a record using upsert **Risk:** `write` ```ts theme={null} await corsair.airtable.api.records.createOrUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `baseId` | `string` | Yes | — | | `tableIdOrName` | `string` | Yes | — | | `fields` | `object` | Yes | — | | `fieldsToMergeOn` | `string[]` | Yes | — | | `typecast` | `boolean` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > id: string, > createdTime: string, > fields: { > } > }[] > ``` *** ### delete `records.delete` Delete a record from a table **Risk:** `destructive` ```ts theme={null} await corsair.airtable.api.records.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `baseId` | `string` | Yes | — | | `tableIdOrName` | `string` | Yes | — | | `recordId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### get `records.get` Get a single record by ID **Risk:** `read` ```ts theme={null} await corsair.airtable.api.records.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `baseId` | `string` | Yes | — | | `tableIdOrName` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `returnFieldsByFieldId` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `createdTime` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### search `records.search` Search and list records with optional filters **Risk:** `read` ```ts theme={null} await corsair.airtable.api.records.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `baseId` | `string` | Yes | — | | `tableIdOrName` | `string` | Yes | — | | `fields` | `string[]` | No | — | | `filterByFormula` | `string` | No | — | | `maxRecords` | `number` | No | — | | `pageSize` | `number` | No | — | | `sort` | `object[]` | No | — | | `view` | `string` | No | — | | `cellFormat` | `json \| string` | No | — | | `timeZone` | `string` | No | — | | `userLocale` | `string` | No | — | | `returnFieldsByFieldId` | `boolean` | No | — | | `offset` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > field: string, > direction?: asc | desc > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | | `offset` | `string` | No | — | > **records full type** > > ```ts theme={null} > { > id: string, > createdTime: string, > fields: { > } > }[] > ``` *** ### update `records.update` Update fields on an existing record **Risk:** `write` ```ts theme={null} await corsair.airtable.api.records.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `baseId` | `string` | Yes | — | | `tableIdOrName` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `fields` | `object` | Yes | — | | `typecast` | `boolean` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > id: string, > createdTime: string, > fields: { > } > }[] > ``` *** ## Webhooks ### getPayloads `webhooks.getPayloads` Get webhook payloads **Risk:** `read` ```ts theme={null} await corsair.airtable.api.webhooks.getPayloads({}); ``` **Input:** `unknown` **Output:** `unknown` *** # Database Source: https://docs.corsair.dev/plugins/airtable/database Airtable local sync: searchable entities, `.search()` filters, and operators. The Airtable plugin syncs data locally. Use `corsair.airtable.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Bases Path: `airtable.db.bases.search` ```ts theme={null} const rows = await corsair.airtable.db.bases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `permissionLevel` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Records Path: `airtable.db.records.search` ```ts theme={null} const rows = await corsair.airtable.db.records.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `baseId` | `string` | equals, contains, startsWith, endsWith, in | | `tableId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/airtable/get-credentials Step-by-step instructions for obtaining Airtable personal access tokens and webhook signing secrets. This guide walks you through obtaining all required credentials for the Airtable plugin. ## Authentication Method The Airtable plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) — Personal access token (PAT) for the REST API ## API Key (Personal Access Token) ### Step 1: Create a Personal Access Token 1. Open [Airtable token management](https://airtable.com/create/tokens) (or **Account** → **Developer hub** → **Personal access tokens**). 2. Click **Create token**. 3. Give the token a name (for example, `Corsair`). 4. Add access to the **bases** (and scopes) your integration needs — at minimum, the bases you plan to read or write. 5. Under **Scopes**, include the data permissions required by your workflows (for example, `data.records:read`, `data.records:write`, `schema.bases:read`). 6. Create the token and **copy it immediately**. You will not see it again. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=airtable api_key=patXXXXXXXX ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=airtable --credentials ``` ## Webhook Signing Secret When you configure a webhook in Airtable for a base, the provider gives you a **signing secret** used to verify incoming payloads. 1. In Airtable, open the base → **Automations** or **Extensions** flow that posts to your webhook (per your Airtable webhook setup). 2. Copy the **webhook signing secret** (or MAC secret) shown for that destination. 3. Store it with Corsair so `processWebhook` can verify signatures. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=airtable webhook_signature=your-signing-secret ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | Personal access token | [`api_key`](/concepts/api-key) auth | [create/tokens](https://airtable.com/create/tokens) | | Webhook signing secret | Webhooks | Airtable webhook / automation configuration for your base | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/airtable/overview Spreadsheet-database hybrid for organizing records, workflows, and collaborative project data. Use **Airtable** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 9 typed API operations * 2 synced entities (`bases`, `records`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/airtable ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/airtable ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/airtable ``` ```bash bun theme={null} bun add corsair @corsair-dev/airtable ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { airtable } from '@corsair-dev/airtable'; export const corsair = createCorsair({ plugins: [ airtable(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/airtable/get-credentials). ```ts theme={null} airtable() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'airtable', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List accessible bases** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.airtable.api.bases.getMany({}); ``` **Create a record** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.airtable.api.records.create({ baseId: 'appXXXXXXXXXXXXXX', tableIdOrName: 'tblXXXXXXXXXXXXXX', fields: { Name: 'Ada Lovelace' }, }); ``` See the full list on the [API](/plugins/airtable/api) page. ## Query synced data Search synced Airtable records without calling the API again. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.airtable.db.records.search({ data: { tableId: 'tblXXXXXXXXXXXXXX' }, limit: 20, }); ``` Synced entities: `bases`, `records`. See [Database](/plugins/airtable/database) for filters and operators. ## Webhooks React when an Airtable base sends a change notification. ```ts theme={null} airtable({ webhookHooks: { events: { event: { after: async (ctx, result) => { console.log('Airtable event:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/airtable/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/airtable/api)** > > Every `airtable.api.*` operation with input and output types. > **[Database](/plugins/airtable/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/airtable/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/airtable/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/airtable/webhooks Airtable incoming webhooks: event paths, payloads, and response data. The Airtable plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/airtable/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `events` * `event` (`events.event`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Events ### Event `events.event` On new Airtable event — fires when records or tables change **Payload** | Name | Type | Required | Description | | - | - | - | - | | `base` | `object` | Yes | — | | `webhook` | `object` | Yes | — | | `timestamp` | `string` | Yes | — | | `actionMetadata` | `object` | No | — | > **base full type** > > ```ts theme={null} > { > id: string > } > ``` > **webhook full type** > > ```ts theme={null} > { > id: string > } > ``` > **actionMetadata full type** > > ```ts theme={null} > { > source?: string, > sourceMetadata?: { > user?: { > id: string, > email?: string, > name?: string > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > base: { > id: string > }, > webhook: { > id: string > }, > timestamp: string, > actionMetadata?: { > source?: string, > sourceMetadata?: { > user?: { > id: string, > email?: string, > name?: string > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} airtable({ webhookHooks: { events: { event: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/aivoov/api API reference for AiVOOV: every `aivoov.api.*` operation with input and output types. Every `aivoov.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Audio ### create `audio.create` Synthesise speech from one or more voice and text pairs, returning Base64-encoded audio. Consumes character credits **Risk:** `write` ```ts theme={null} await corsair.aivoov.api.audio.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `voice_id` | `string[]` | Yes | — | | `transcribe_text` | `string[]` | Yes | — | | `transcribe_ssml_pitch_rate` | `(number \| default)[]` | No | — | | `transcribe_ssml_spk_rate` | `(number \| default)[]` | No | — | | `transcribe_ssml_volume` | `(number \| default)[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | Yes | — | | `message` | `string` | No | — | | `audio` | `string` | Yes | — | *** ## Voices ### list `voices.list` List available text-to-speech voices, optionally filtered by BCP-47 language code. Limited to 20 calls per day, so results are mirrored to the voices entity **Risk:** `read` ```ts theme={null} await corsair.aivoov.api.voices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language_code` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | Yes | — | | `message` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > voice_id: string, > name: string, > value?: string, > gender?: string, > language_code?: string, > language_name?: string, > label?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/aivoov/database AiVOOV local sync: searchable entities, `.search()` filters, and operators. The AiVOOV plugin syncs data locally. Use `corsair.aivoov.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Voices Path: `aivoov.db.voices.search` ```ts theme={null} const rows = await corsair.aivoov.db.voices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `voice_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `string` | equals, contains, startsWith, endsWith, in | | `gender` | `string` | equals, contains, startsWith, endsWith, in | | `language_code` | `string` | equals, contains, startsWith, endsWith, in | | `language_name` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/aivoov/overview Text-to-speech platform for generating natural voiceovers from written scripts. Use **AiVOOV** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 2 typed API operations * 1 synced entity (`voices`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/aivoov ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/aivoov ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/aivoov ``` ```bash bun theme={null} bun add corsair @corsair-dev/aivoov ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { aivoov } from '@corsair-dev/aivoov'; export const corsair = createCorsair({ plugins: [ aivoov(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} aivoov() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'aivoov', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`voices.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.aivoov.api.voices.list({}); ``` **`audio.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.aivoov.api.audio.create({}); ``` See the full list on the [API](/plugins/aivoov/api) page. ## Query synced data Synced entities support `tenant.aivoov.db..search()` and `.list()`: `voices`. See [Database](/plugins/aivoov/database) for filters and operators. ## What's next > **[API reference](/plugins/aivoov/api)** > > Every `aivoov.api.*` operation with input and output types. > **[Database](/plugins/aivoov/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/akta/api API reference for Akta: every `akta.api.*` operation with input and output types. Every `akta.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Company ### employeeReviews `company.employeeReviews` Get employee review ratings and individual reviews for a company **Risk:** `read` ```ts theme={null} await corsair.akta.api.company.employeeReviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company` | `string` | Yes | Company website ([https://canva.com](https://canva.com)) or Akta uuid from company.search | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `limit` | `number` | Yes | — | | `offset` | `number` | Yes | — | | `credits_consumed` | `number` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > employee_reviews: { > overall_rating?: { > }, > other_ratings?: { > type?: string, > provider?: string, > value: number > }[], > reviews?: { > data: { > id: number, > summary?: string, > pros?: string, > cons?: string, > rating?: number, > review_link?: string, > job_title?: string, > review_date?: string, > employment_status?: string, > is_current_employee?: boolean, > years_of_employment?: number, > location?: string, > country_code?: string, > helpful_count?: number, > not_helpful_count?: number, > career_opportunities_rating?: number, > ceo_rating?: string | null, > compensation_and_benefits_rating?: number, > culture_and_values_rating?: number, > diversity_and_inclusion_rating?: number, > senior_management_rating?: number, > work_life_balance_rating?: number, > language?: string, > provider?: string > }[], > total?: number, > total_by_provider?: { > } > } > } > } > ``` *** ### enrich `company.enrich` Get structured company data by section: firmographics, business model, funding, and more **Risk:** `read` ```ts theme={null} await corsair.akta.api.company.enrich({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company` | `string` | Yes | Company website ([https://canva.com](https://canva.com)) or Akta uuid from company.search | | `sections` | `firmographic \| business_model \| company_assessment \| trust_signal \| company_hierarchy \| digital_presence \| financial_estimate \| location \| management_profile \| product_offering \| strategic_signal \| customer_profile \| industry \| technology \| funding_detail \| mna_and_investment[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `credits_consumed` | `number` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > firmographic?: { > name?: string, > legal_name?: string, > website?: string, > company_type?: { > code: string, > label: string > }, > founded_year?: number, > company_description?: string, > company_description_short?: string, > operating_status?: { > code: string, > label: string > }, > ownership_category?: { > code: string, > label: string > }, > headcount_range?: string, > logo_url?: string, > akta_rank?: number > }, > business_model?: { > gtm_motion?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > } > }[], > revenue_model?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > } > }[], > marketing_channels?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > }, > stage?: { > code: string, > label: string > } > }[], > distribution_channels?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > }, > scope?: string, > target_buyer?: { > code: string, > label: string > } > }[], > cost_components?: string[], > pricing_details?: { > description?: string, > notes?: string, > model?: { > code: string, > label: string > }, > billing_cadence?: { > code: string, > label: string > }, > source?: string[] > }[], > gtm_type?: { > code: string, > label: string > }, > offering_type?: { > code: string, > label: string > } > }, > company_assessment?: { > market_position?: string, > strengths?: { > headline?: string, > details?: string, > source?: string[] > }[], > weakness?: { > headline?: string, > details?: string, > source?: string[] > }[], > competitive_moat?: { > details?: string, > type?: { > code: string, > label: string > } > }[], > key_risks?: { > headline?: string, > details?: string, > source?: string[] > }[], > key_highlights?: { > headline?: string, > details?: string, > source?: string[] > }[], > customer_concentration?: { > details?: string, > classification?: { > code: string, > label: string > } > }, > peers?: { > uuid?: string, > name: string, > description?: string, > type?: { > code: string, > label: string > } > }[] > }, > trust_signal?: { > compliance?: { > class?: { > code: string, > label: string > }, > name?: { > code: string, > label: string > }, > description?: string, > source?: string[] > }[], > regulatory_updates?: { > title?: string, > type?: string, > description?: string, > source?: string[] > }[], > awards?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > }, > body?: string > }[], > ip?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > }, > status?: { > code: string, > label: string > } > }[] > }, > company_hierarchy?: { > subsidiaries?: { > uuid?: string, > name: string, > business_focus?: string, > acquired_on?: { > year: number, > month?: number, > day?: number > }, > relationship_type?: { > code: string, > label: string > }, > type?: { > code: string, > label: string > } > }[] > }, > digital_presence?: { > social_media_profiles?: { > platform: string, > url: string > }[] > }, > financial_estimate?: { > revenue_estimate?: { > code: string, > label: string > }, > valuation_estimate?: { > code: string, > label: string > } > }, > location?: { > hq?: { > city?: string, > country?: string, > region?: string > }, > market_served?: { > is_global?: boolean > }, > offices?: { > city?: string, > country?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > } > }[] > }, > management_profile?: { > number_of_profiles?: number, > profiles?: { > name: string, > designation?: string, > designation_category?: { > code: string, > label: string > }, > overview?: string, > profile_commentary?: string, > start_date?: string, > previous_companies?: string[], > source?: string[] > }[] > }, > product_offering?: { > brand?: { > name: string, > description?: string, > source?: string[] > }[], > core_offering?: string, > differentiator?: string, > functional_benefit?: string, > problem_solved?: string, > quantifiable_outcome?: string[], > product_overview?: string, > product_and_service?: { > name: string, > category?: string, > description?: string, > url?: string, > source?: string[] > }[] > }, > strategic_signal?: { > scale_indicator?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > }, > value?: string > }[], > partnership?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > }, > uuid?: string, > name?: string, > strategic_tier?: string, > announced_on?: { > year: number, > month?: number, > day?: number > } > }[], > recent_move?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > }, > date?: { > year: number, > month?: number, > day?: number > } > }[], > leadership_change?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > } > }[], > expansion_highlight?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > } > }[] > }, > customer_profile?: { > segment?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > }, > is_primary?: boolean, > pain_point_addressed?: string, > use_case?: string > }[], > icp?: { > profile?: string, > description?: string, > buyer_persona?: string, > target_buyer?: string, > geography?: string, > industry_vertical?: string, > primary_use_case?: string, > pain_points?: string[], > evidence_proof_points?: string[], > buying_structure?: { > code: string, > label: string > }, > firmographic_size?: { > code: string, > label: string > }, > purchase_trigger?: { > code: string, > label: string > }, > sales_cycle_length?: { > code: string, > label: string > }, > sales_motion?: { > code: string, > label: string > } > }[], > select_customer?: { > uuid?: string, > name: string, > industry?: string, > use_case?: string, > source?: string[], > type?: { > code: string, > label: string > } > }[] > }, > industry?: { > keyword?: string[], > industry?: { > code: string, > label: string, > is_primary?: boolean > }[], > naics?: { > code: string, > label: string > }[], > sic?: { > code: string, > label: string > }[], > product_category?: string > }, > technology?: { > is_technology_focussed?: boolean, > api_detail?: { > has_api?: boolean, > has_mcp?: boolean, > description?: string, > docs_url?: string > }, > integration?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > } > }[], > ai_capability?: { > title?: string, > description?: string, > source?: string[], > type?: { > code: string, > label: string > } > }[], > ai_maturity?: { > label: string, > scale?: number, > description?: string > }, > app_detail?: { > has_app?: boolean, > app_url?: { > platform: string, > url: string > }[] > }, > feature?: { > title?: string, > description?: string, > differentiator?: { > code: string, > label: string > }, > source?: string[] > }[], > core_technology?: string > }, > funding_detail?: { > funding_overview?: { > funding_stage?: { > code: string, > label: string > }, > last_funding_date?: { > year: number, > month?: number, > day?: number > }, > total_funding_usd?: number > }, > funding_rounds?: { > id: number, > round?: { > code: string, > label: string > }, > date?: { > year: number, > month?: number, > day?: number > }, > amount_usd?: number, > pre_money_valuation?: number, > total_investors?: number, > investors?: { > uuid?: string, > name: string, > lead_investor?: boolean, > type?: { > code: string, > label: string > } > }[], > news?: { > publisher?: string, > title?: string, > url: string > }[] > }[], > investors?: { > uuid?: string, > name: string, > website?: string, > date_of_entry?: { > year: number, > month?: number, > day?: number > }, > rounds_participated?: { > code: string, > label: string > }[], > type?: { > code: string, > label: string > } > }[] > }, > mna_and_investment?: { > mna?: { > id: number, > acquiree: { > uuid?: string, > name: string, > website?: string > }, > acquisition_type?: { > code: string, > label: string > }, > announced_date?: { > year: number, > month?: number, > day?: number > }, > status?: string, > amount_usd?: number, > news?: { > publisher?: string, > title?: string, > url: string > }[] > }[], > investment?: { > id: number, > funding_round_id?: number, > investee: { > uuid?: string, > name: string, > website?: string > }, > lead_investor?: boolean, > announced_date?: { > year: number, > month?: number, > day?: number > }, > round?: { > code: string, > label: string > }, > news?: { > publisher?: string, > title?: string, > url: string > }[] > }[] > } > } > ``` *** ### productReviews `company.productReviews` Get a company's product catalog with ratings, pricing, and reviews **Risk:** `read` ```ts theme={null} await corsair.akta.api.company.productReviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company` | `string` | Yes | Company website ([https://canva.com](https://canva.com)) or Akta uuid from company.search | | `products` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `limit` | `number` | Yes | — | | `offset` | `number` | Yes | — | | `credits_consumed` | `number` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > product_reviews?: { > id: string, > product_name: string, > main_category?: string, > categories?: string[], > description?: string, > rating?: { > }, > star_distribution?: { > }, > pros_list?: ( > string | { > text: string, > count?: string | number > } > )[], > cons_list?: ( > string | { > text: string, > count?: string | number > } > )[], > pricing?: { > package?: string, > price?: string, > price_info?: string > }[], > reviews?: { > data: { > review_id: number, > review_title?: string, > review_content?: string, > review_question_answers?: { > question: string, > answer: string > }[], > review_rating?: number, > publish_date?: string, > reviewer_company_size?: string, > review_link?: string, > provider?: string > }[], > total?: number, > total_by_provider?: { > } > } > }[], > product?: { > id: string, > product_name: string, > main_category?: string, > categories?: string[], > description?: string, > rating?: { > }, > star_distribution?: { > }, > pros_list?: ( > string | { > text: string, > count?: string | number > } > )[], > cons_list?: ( > string | { > text: string, > count?: string | number > } > )[], > pricing?: { > package?: string, > price?: string, > price_info?: string > }[], > reviews?: { > data: { > review_id: number, > review_title?: string, > review_content?: string, > review_question_answers?: { > question: string, > answer: string > }[], > review_rating?: number, > publish_date?: string, > reviewer_company_size?: string, > review_link?: string, > provider?: string > }[], > total?: number, > total_by_provider?: { > } > } > }[] > } > ``` *** ### search `company.search` Resolve a company name or website to its Akta uuid (free, no credits) **Risk:** `read` ```ts theme={null} await corsair.akta.api.company.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | Company name or website | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `count` | `number` | No | — | | `credits_consumed` | `number` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > name: string, > website?: string, > product_category?: string, > company_status?: public | private | acquired | delisted | unknown, > parent_company?: { > uuid: string, > name: string > }, > akta_rank?: number > }[] > ``` *** ## Industry ### search `industry.search` Resolve a free-text industry to Akta industry codes (free, no credits) **Risk:** `read` ```ts theme={null} await corsair.akta.api.industry.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `level` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `count` | `number` | No | — | | `credits_consumed` | `number` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > industry_name: string, > similarity: number > }[] > ``` *** ## News ### list `news.list` List enriched news articles filtered by company, industry, topic, or date **Risk:** `read` ```ts theme={null} await corsair.akta.api.news.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company` | `string` | No | — | | `primary_company` | `string` | No | — | | `industry` | `string[]` | No | — | | `query` | `string` | No | — | | `title` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `group_articles` | `boolean` | No | — | | `news_score_list` | `High \| Medium \| Low \| all` | No | — | | `countries` | `string[]` | No | — | | `blacklisted` | `string[]` | No | — | | `type_list` | `string[]` | No | — | | `sentiment_list` | `positive \| negative \| neutral \| all[]` | No | — | | `entity_person_list` | `string[]` | No | — | | `entity_location_list` | `string[]` | No | — | | `entity_product_list` | `string[]` | No | — | | `entity_event_list` | `string[]` | No | — | | `naics_code_list` | `string[]` | No | — | | `sic_code_list` | `string[]` | No | — | | `iptc_code_list` | `string[]` | No | — | | `iab_code_list` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `count` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `offset` | `number` | Yes | — | | `credits_consumed` | `number` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > title: string, > url: string, > publisher?: string, > published_date?: string, > sentiment?: string, > sentiment_score?: number, > ai_summary?: string, > word_count?: number, > original_language?: string, > author?: string, > countries?: string[], > industries?: { > code: string, > name: string, > is_primary?: boolean > }[], > tags?: { > code: string, > name: string, > is_primary?: boolean > }[], > company_mentions?: { > uuid?: string, > name: string, > website?: string, > is_primary?: boolean > }[], > article_type?: { > code: string, > label: string > }, > is_press_release?: boolean, > is_opinion?: boolean, > is_breaking?: boolean, > iptc_codes?: { > code: string, > name: string > }[], > iab_categories?: { > code: string, > name: string > }[], > naics_codes?: { > code: string, > name: string > }[], > sic_codes?: { > code: string, > name: string > }[], > entities?: { > person?: string[], > location?: string[], > product?: string[], > event?: string[] > }, > newsworthiness_score?: number, > group_id?: number, > full_text?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/akta/database Akta local sync: searchable entities, `.search()` filters, and operators. The Akta plugin syncs data locally. Use `corsair.akta.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Companies Path: `akta.db.companies.search` ```ts theme={null} const rows = await corsair.akta.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `productCategory` | `string` | equals, contains, startsWith, endsWith, in | | `parentCompanyUuid` | `string` | equals, contains, startsWith, endsWith, in | | `foundedYear` | `number` | equals, gt, gte, lt, lte, in | | `headcountRange` | `string` | equals, contains, startsWith, endsWith, in | | `descriptionShort` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## News Articles Path: `akta.db.newsArticles.search` ```ts theme={null} const rows = await corsair.akta.db.newsArticles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `publisher` | `string` | equals, contains, startsWith, endsWith, in | | `publishedDate` | `string` | equals, contains, startsWith, endsWith, in | | `sentiment` | `string` | equals, contains, startsWith, endsWith, in | | `aiSummary` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/akta/overview Akta plugin for Corsair Use **Akta** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 6 typed API operations * 2 synced entities (`companies`, `newsArticles`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/akta ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/akta ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/akta ``` ```bash bun theme={null} bun add corsair @corsair-dev/akta ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { akta } from '@corsair-dev/akta'; export const corsair = createCorsair({ plugins: [ akta(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} akta() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'akta', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`company.employeeReviews`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.akta.api.company.employeeReviews({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/akta/api) reference.* See the full list on the [API](/plugins/akta/api) page. ## Query synced data Synced entities support `tenant.akta.db..search()` and `.list()`: `companies`, `newsArticles`. See [Database](/plugins/akta/database) for filters and operators. ## What's next > **[API reference](/plugins/akta/api)** > > Every `akta.api.*` operation with input and output types. > **[Database](/plugins/akta/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/alchemy/api API reference for Alchemy: every `alchemy.api.*` operation with input and output types. Every `alchemy.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Nft ### computeRarityV3 `nft.computeRarityV3` Compute rarity for each attribute of an NFT. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.computeRarityV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | | `tokenId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rarities` | `object[]` | No | — | > **rarities full type** > > ```ts theme={null} > { > traitType?: string, > value?: string | number, > prevalence?: number > }[] > ``` *** ### getCollectionMetadata `nft.getCollectionMetadata` Get collection metadata by marketplace slug. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getCollectionMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `collectionSlug` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCollectionsForOwner `nft.getCollectionsForOwner` Get NFT collections held by an owner. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getCollectionsForOwner({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `owner` | `string` | Yes | — | | `withMetadata` | `boolean` | No | — | | `includeFilters` | `string[]` | No | — | | `excludeFilters` | `string[]` | No | — | | `pageKey` | `string` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collections` | `object[]` | No | — | | `totalCount` | `number` | No | — | | `pageKey` | `string` | No | — | > **collections full type** > > ```ts theme={null} > { > }[] > ``` *** ### getContractMetadataBatchV3 `nft.getContractMetadataBatchV3` Batch-fetch NFT contract metadata. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getContractMetadataBatchV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddresses` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contracts` | `object[]` | No | — | > **contracts full type** > > ```ts theme={null} > { > address: string, > name?: string | null, > symbol?: string | null, > totalSupply?: string | null, > tokenType?: string | null, > contractDeployer?: string | null, > deployedBlockNumber?: number | null, > openSeaMetadata?: { > collectionName?: string | null, > collectionSlug?: string | null, > safelistRequestStatus?: string | null, > imageUrl?: string | null, > description?: string | null, > externalUrl?: string | null, > twitterUsername?: string | null, > discordUrl?: string | null, > bannerImageUrl?: string | null, > floorPrice?: number | null > }, > isSpam?: boolean | null, > spamClassifications?: string[] > }[] > ``` *** ### getContractMetadataV3 `nft.getContractMetadataV3` Get metadata for an NFT contract. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getContractMetadataV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | Yes | — | | `name` | `string` | No | — | | `symbol` | `string` | No | — | | `totalSupply` | `string` | No | — | | `tokenType` | `string` | No | — | | `contractDeployer` | `string` | No | — | | `deployedBlockNumber` | `number` | No | — | | `openSeaMetadata` | `object` | No | — | | `isSpam` | `boolean` | No | — | | `spamClassifications` | `string[]` | No | — | > **openSeaMetadata full type** > > ```ts theme={null} > { > collectionName?: string | null, > collectionSlug?: string | null, > safelistRequestStatus?: string | null, > imageUrl?: string | null, > description?: string | null, > externalUrl?: string | null, > twitterUsername?: string | null, > discordUrl?: string | null, > bannerImageUrl?: string | null, > floorPrice?: number | null > } > ``` *** ### getContractsForOwnerV3 `nft.getContractsForOwnerV3` Get NFT contracts owned by an address. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getContractsForOwnerV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `owner` | `string` | Yes | — | | `withMetadata` | `boolean` | No | — | | `includeFilters` | `string[]` | No | — | | `excludeFilters` | `string[]` | No | — | | `pageKey` | `string` | No | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contracts` | `object[]` | No | — | | `totalCount` | `number` | No | — | | `pageKey` | `string` | No | — | > **contracts full type** > > ```ts theme={null} > { > }[] > ``` *** ### getFloorPriceV3 `nft.getFloorPriceV3` Get floor price across marketplaces. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getFloorPriceV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | | `collectionSlug` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getNftMetadata `nft.getNftMetadata` Get metadata for a specific NFT. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getNftMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | | `tokenId` | `string` | Yes | — | | `tokenType` | `ERC721 \| ERC1155` | No | — | | `tokenUriTimeoutInMs` | `number` | No | — | | `refreshCache` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contract` | `object` | No | — | | `contractAddress` | `string` | No | — | | `tokenId` | `string` | Yes | — | | `tokenType` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `tokenUri` | `string` | No | — | | `image` | `object` | No | — | | `animation` | `object` | No | — | | `raw` | `object` | No | — | | `collection` | `object` | No | — | | `mint` | `object` | No | — | | `owners` | `string[]` | No | — | | `timeLastUpdated` | `string` | No | — | | `balance` | `string` | No | — | | `acquiredAt` | `object` | No | — | | `network` | `string` | No | — | | `address` | `string` | No | — | | `isSpam` | `boolean` | No | — | | `spamClassifications` | `string[]` | No | — | > **contract full type** > > ```ts theme={null} > { > address: string, > name?: string | null, > symbol?: string | null, > totalSupply?: string | null, > tokenType?: string | null, > contractDeployer?: string | null, > deployedBlockNumber?: number | null, > openSeaMetadata?: { > collectionName?: string | null, > collectionSlug?: string | null, > safelistRequestStatus?: string | null, > imageUrl?: string | null, > description?: string | null, > externalUrl?: string | null, > twitterUsername?: string | null, > discordUrl?: string | null, > bannerImageUrl?: string | null, > floorPrice?: number | null > }, > isSpam?: boolean | null, > spamClassifications?: string[] > } > ``` > **image full type** > > ```ts theme={null} > { > cachedUrl?: string | null, > thumbnailUrl?: string | null, > pngUrl?: string | null, > contentType?: string | null, > size?: number | null, > originalUrl?: string | null > } > ``` > **animation full type** > > ```ts theme={null} > { > } > ``` > **raw full type** > > ```ts theme={null} > { > } > ``` > **collection full type** > > ```ts theme={null} > { > } > ``` > **mint full type** > > ```ts theme={null} > { > } > ``` > **acquiredAt full type** > > ```ts theme={null} > { > } > ``` *** ### getNftMetadataBatch `nft.getNftMetadataBatch` Batch-fetch NFT metadata (up to 100). **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getNftMetadataBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `tokens` | `object[]` | Yes | — | | `tokenUriTimeoutInMs` | `number` | No | — | | `refreshCache` | `boolean` | No | — | > **tokens full type** > > ```ts theme={null} > { > contractAddress: string, > tokenId: string, > tokenType?: ERC721 | ERC1155 > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `nfts` | `object[]` | No | — | > **nfts full type** > > ```ts theme={null} > { > contract?: { > address: string, > name?: string | null, > symbol?: string | null, > totalSupply?: string | null, > tokenType?: string | null, > contractDeployer?: string | null, > deployedBlockNumber?: number | null, > openSeaMetadata?: { > collectionName?: string | null, > collectionSlug?: string | null, > safelistRequestStatus?: string | null, > imageUrl?: string | null, > description?: string | null, > externalUrl?: string | null, > twitterUsername?: string | null, > discordUrl?: string | null, > bannerImageUrl?: string | null, > floorPrice?: number | null > }, > isSpam?: boolean | null, > spamClassifications?: string[] > }, > contractAddress?: string, > tokenId: string, > tokenType?: string | null, > name?: string | null, > description?: string | null, > tokenUri?: string | null, > image?: { > cachedUrl?: string | null, > thumbnailUrl?: string | null, > pngUrl?: string | null, > contentType?: string | null, > size?: number | null, > originalUrl?: string | null > }, > animation?: { > } | null, > raw?: { > }, > collection?: { > } | null, > mint?: { > } | null, > owners?: string[] | null, > timeLastUpdated?: string | null, > balance?: string | null, > acquiredAt?: { > } | null, > network?: string, > address?: string, > isSpam?: boolean | null, > spamClassifications?: string[] > }[] > ``` *** ### getNftSalesV3 `nft.getNftSalesV3` Get NFT sales across marketplaces. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getNftSalesV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `fromBlock` | `string \| number` | No | — | | `toBlock` | `string \| number` | No | — | | `order` | `asc \| desc` | No | — | | `marketplace` | `string` | No | — | | `contractAddress` | `string` | No | — | | `tokenId` | `string` | No | — | | `buyerAddress` | `string` | No | — | | `sellerAddress` | `string` | No | — | | `taker` | `BUYER \| SELLER` | No | — | | `limit` | `number` | No | — | | `pageKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nftSales` | `object[]` | No | — | | `pageKey` | `string` | No | — | > **nftSales full type** > > ```ts theme={null} > { > }[] > ``` *** ### getNftsForCollectionV3 `nft.getNftsForCollectionV3` Get NFTs for a collection slug or contract. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getNftsForCollectionV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `collectionSlug` | `string` | No | — | | `contractAddress` | `string` | No | — | | `withMetadata` | `boolean` | No | — | | `startToken` | `string` | No | — | | `limit` | `number` | No | — | | `tokenUriTimeoutInMs` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nfts` | `object[]` | No | — | | `pageKey` | `string` | No | — | > **nfts full type** > > ```ts theme={null} > { > contract?: { > address: string, > name?: string | null, > symbol?: string | null, > totalSupply?: string | null, > tokenType?: string | null, > contractDeployer?: string | null, > deployedBlockNumber?: number | null, > openSeaMetadata?: { > collectionName?: string | null, > collectionSlug?: string | null, > safelistRequestStatus?: string | null, > imageUrl?: string | null, > description?: string | null, > externalUrl?: string | null, > twitterUsername?: string | null, > discordUrl?: string | null, > bannerImageUrl?: string | null, > floorPrice?: number | null > }, > isSpam?: boolean | null, > spamClassifications?: string[] > }, > contractAddress?: string, > tokenId: string, > tokenType?: string | null, > name?: string | null, > description?: string | null, > tokenUri?: string | null, > image?: { > cachedUrl?: string | null, > thumbnailUrl?: string | null, > pngUrl?: string | null, > contentType?: string | null, > size?: number | null, > originalUrl?: string | null > }, > animation?: { > } | null, > raw?: { > }, > collection?: { > } | null, > mint?: { > } | null, > owners?: string[] | null, > timeLastUpdated?: string | null, > balance?: string | null, > acquiredAt?: { > } | null, > network?: string, > address?: string, > isSpam?: boolean | null, > spamClassifications?: string[] > }[] > ``` *** ### getNftsForContract `nft.getNftsForContract` Get NFTs for a contract address. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getNftsForContract({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | | `withMetadata` | `boolean` | No | — | | `startToken` | `string` | No | — | | `limit` | `number` | No | — | | `tokenUriTimeoutInMs` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nfts` | `object[]` | No | — | | `pageKey` | `string` | No | — | > **nfts full type** > > ```ts theme={null} > { > contract?: { > address: string, > name?: string | null, > symbol?: string | null, > totalSupply?: string | null, > tokenType?: string | null, > contractDeployer?: string | null, > deployedBlockNumber?: number | null, > openSeaMetadata?: { > collectionName?: string | null, > collectionSlug?: string | null, > safelistRequestStatus?: string | null, > imageUrl?: string | null, > description?: string | null, > externalUrl?: string | null, > twitterUsername?: string | null, > discordUrl?: string | null, > bannerImageUrl?: string | null, > floorPrice?: number | null > }, > isSpam?: boolean | null, > spamClassifications?: string[] > }, > contractAddress?: string, > tokenId: string, > tokenType?: string | null, > name?: string | null, > description?: string | null, > tokenUri?: string | null, > image?: { > cachedUrl?: string | null, > thumbnailUrl?: string | null, > pngUrl?: string | null, > contentType?: string | null, > size?: number | null, > originalUrl?: string | null > }, > animation?: { > } | null, > raw?: { > }, > collection?: { > } | null, > mint?: { > } | null, > owners?: string[] | null, > timeLastUpdated?: string | null, > balance?: string | null, > acquiredAt?: { > } | null, > network?: string, > address?: string, > isSpam?: boolean | null, > spamClassifications?: string[] > }[] > ``` *** ### getNftsForOwner `nft.getNftsForOwner` Get NFTs owned by an address. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getNftsForOwner({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `owner` | `string` | Yes | — | | `contractAddresses` | `string[]` | No | — | | `withMetadata` | `boolean` | No | — | | `orderBy` | `string` | No | — | | `excludeFilters` | `string[]` | No | — | | `includeFilters` | `string[]` | No | — | | `spamConfidenceLevel` | `string` | No | — | | `tokenUriTimeoutInMs` | `number` | No | — | | `pageKey` | `string` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ownedNfts` | `object[]` | Yes | — | | `totalCount` | `number` | No | — | | `validAt` | `object` | No | — | | `pageKey` | `string` | No | — | > **ownedNfts full type** > > ```ts theme={null} > { > contract?: { > address: string, > name?: string | null, > symbol?: string | null, > totalSupply?: string | null, > tokenType?: string | null, > contractDeployer?: string | null, > deployedBlockNumber?: number | null, > openSeaMetadata?: { > collectionName?: string | null, > collectionSlug?: string | null, > safelistRequestStatus?: string | null, > imageUrl?: string | null, > description?: string | null, > externalUrl?: string | null, > twitterUsername?: string | null, > discordUrl?: string | null, > bannerImageUrl?: string | null, > floorPrice?: number | null > }, > isSpam?: boolean | null, > spamClassifications?: string[] > }, > contractAddress?: string, > tokenId: string, > tokenType?: string | null, > name?: string | null, > description?: string | null, > tokenUri?: string | null, > image?: { > cachedUrl?: string | null, > thumbnailUrl?: string | null, > pngUrl?: string | null, > contentType?: string | null, > size?: number | null, > originalUrl?: string | null > }, > animation?: { > } | null, > raw?: { > }, > collection?: { > } | null, > mint?: { > } | null, > owners?: string[] | null, > timeLastUpdated?: string | null, > balance?: string | null, > acquiredAt?: { > } | null, > network?: string, > address?: string, > isSpam?: boolean | null, > spamClassifications?: string[] > }[] > ``` > **validAt full type** > > ```ts theme={null} > { > } > ``` *** ### getOwnersForCollection `nft.getOwnersForCollection` Get owners for an NFT collection/contract. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getOwnersForCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | | `withTokenBalances` | `boolean` | No | — | | `block` | `string` | No | — | | `pageKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `owners` | `object[]` | Yes | — | | `pageKey` | `string` | No | — | > **owners full type** > > ```ts theme={null} > ( > string | { > } > )[] > ``` *** ### getOwnersForContract `nft.getOwnersForContract` Get owners for an NFT contract. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getOwnersForContract({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | | `withTokenBalances` | `boolean` | No | — | | `block` | `string` | No | — | | `pageKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `owners` | `object[]` | Yes | — | | `pageKey` | `string` | No | — | > **owners full type** > > ```ts theme={null} > ( > string | { > } > )[] > ``` *** ### getOwnersForNftV3 `nft.getOwnersForNftV3` Get owners for a specific NFT. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.getOwnersForNftV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | | `tokenId` | `string` | Yes | — | | `pageKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `owners` | `string[]` | Yes | — | | `pageKey` | `string` | No | — | *** ### invalidateContractV3 `nft.invalidateContractV3` Invalidate cached metadata for an NFT contract. **Risk:** `write` ```ts theme={null} await corsair.alchemy.api.nft.invalidateContractV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean \| string` | No | — | | `numTokensInvalidated` | `number` | No | — | | `message` | `string` | No | — | *** ### isAirdrop `nft.isAirdrop` Check if an NFT token is marked as an airdrop. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.isAirdrop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | | `tokenId` | `string` | Yes | — | **Output:** `boolean` *** ### isAirdropNft `nft.isAirdropNft` Check whether an NFT was airdropped to its owner. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.isAirdropNft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | | `tokenId` | `string` | Yes | — | **Output:** `boolean` *** ### isHolderOfCollection `nft.isHolderOfCollection` Check if a wallet owns any NFT from a collection/contract. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.isHolderOfCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `wallet` | `string` | Yes | — | | `contractAddress` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `isHolderOfContract` | `boolean` | Yes | — | *** ### isHolderOfContract `nft.isHolderOfContract` Check if a wallet holds any NFT from a contract. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.isHolderOfContract({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `wallet` | `string` | Yes | — | | `contractAddress` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `isHolderOfContract` | `boolean` | Yes | — | *** ### isSpamContract `nft.isSpamContract` Check if an NFT contract is marked as spam. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.isSpamContract({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | **Output:** `boolean` *** ### isSpamContractV3 `nft.isSpamContractV3` Check if an NFT contract is marked as spam (v3). **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.isSpamContractV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | **Output:** `boolean` *** ### searchContractMetadataV3 `nft.searchContractMetadataV3` Search NFT contract metadata by keywords. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.searchContractMetadataV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `query` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contracts` | `object[]` | No | — | > **contracts full type** > > ```ts theme={null} > { > address: string, > name?: string | null, > symbol?: string | null, > totalSupply?: string | null, > tokenType?: string | null, > contractDeployer?: string | null, > deployedBlockNumber?: number | null, > openSeaMetadata?: { > collectionName?: string | null, > collectionSlug?: string | null, > safelistRequestStatus?: string | null, > imageUrl?: string | null, > description?: string | null, > externalUrl?: string | null, > twitterUsername?: string | null, > discordUrl?: string | null, > bannerImageUrl?: string | null, > floorPrice?: number | null > }, > isSpam?: boolean | null, > spamClassifications?: string[] > }[] > ``` *** ### summarizeNftAttributes `nft.summarizeNftAttributes` Summarize attribute distribution for a collection. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.nft.summarizeNftAttributes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Portfolio ### getNftContractsByAddress `portfolio.getNftContractsByAddress` Get NFT contracts for wallets across networks. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.portfolio.getNftContractsByAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `addresses` | `object[]` | Yes | — | | `withMetadata` | `boolean` | No | — | | `pageKey` | `string` | No | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `sortOrder` | `asc \| desc` | No | — | > **addresses full type** > > ```ts theme={null} > { > address: string, > networks: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > contracts?: { > }[], > totalCount?: number, > pageKey?: string | null > } > ``` *** ### getPortfolioNftsByAddress `portfolio.getPortfolioNftsByAddress` Get portfolio NFTs for wallets across networks. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.portfolio.getPortfolioNftsByAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `addresses` | `object[]` | Yes | — | | `withMetadata` | `boolean` | No | — | | `pageKey` | `string` | No | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `sortOrder` | `asc \| desc` | No | — | | `excludeFilters` | `string[]` | No | — | | `includeFilters` | `string[]` | No | — | | `spamConfidenceLevel` | `string` | No | — | > **addresses full type** > > ```ts theme={null} > { > address: string, > networks: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ownedNfts?: { > contract?: { > address: string, > name?: string | null, > symbol?: string | null, > totalSupply?: string | null, > tokenType?: string | null, > contractDeployer?: string | null, > deployedBlockNumber?: number | null, > openSeaMetadata?: { > collectionName?: string | null, > collectionSlug?: string | null, > safelistRequestStatus?: string | null, > imageUrl?: string | null, > description?: string | null, > externalUrl?: string | null, > twitterUsername?: string | null, > discordUrl?: string | null, > bannerImageUrl?: string | null, > floorPrice?: number | null > }, > isSpam?: boolean | null, > spamClassifications?: string[] > }, > contractAddress?: string, > tokenId: string, > tokenType?: string | null, > name?: string | null, > description?: string | null, > tokenUri?: string | null, > image?: { > cachedUrl?: string | null, > thumbnailUrl?: string | null, > pngUrl?: string | null, > contentType?: string | null, > size?: number | null, > originalUrl?: string | null > }, > animation?: { > } | null, > raw?: { > }, > collection?: { > } | null, > mint?: { > } | null, > owners?: string[] | null, > timeLastUpdated?: string | null, > balance?: string | null, > acquiredAt?: { > } | null, > network?: string, > address?: string, > isSpam?: boolean | null, > spamClassifications?: string[] > }[], > totalCount?: number, > pageKey?: string | null > } > ``` *** ### getTokenBalancesByAddress `portfolio.getTokenBalancesByAddress` Get lightweight token balances across networks. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.portfolio.getTokenBalancesByAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `addresses` | `object[]` | Yes | — | | `includeNativeTokens` | `boolean` | No | — | | `includeErc20Tokens` | `boolean` | No | — | | `pageKey` | `string` | No | — | > **addresses full type** > > ```ts theme={null} > { > address: string, > networks: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > tokens?: { > network: string, > address: string, > tokenAddress?: string | null, > tokenBalance: string > }[], > pageKey?: string | null > } > ``` *** ### getTokensByAddress `portfolio.getTokensByAddress` Get fungible tokens with metadata and prices. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.portfolio.getTokensByAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `addresses` | `object[]` | Yes | — | | `withMetadata` | `boolean` | No | — | | `withPrices` | `boolean` | No | — | | `includeNativeTokens` | `boolean` | No | — | | `includeErc20Tokens` | `boolean` | No | — | | `pageKey` | `string` | No | — | > **addresses full type** > > ```ts theme={null} > { > address: string, > networks: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > tokens?: { > network: string, > address: string, > tokenAddress?: string | null, > tokenBalance: string, > tokenMetadata?: { > }, > tokenPrices?: { > }[], > error?: string | null > }[], > pageKey?: string | null > } > ``` *** ### getTransactionsHistoryByAddress `portfolio.getTransactionsHistoryByAddress` Get transaction history across networks. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.portfolio.getTransactionsHistoryByAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `addresses` | `object[]` | Yes | — | | `before` | `string` | No | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | > **addresses full type** > > ```ts theme={null} > { > address: string, > networks: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `transactions` | `object[]` | No | — | | `before` | `string` | No | — | | `after` | `string` | No | — | | `totalCount` | `number` | No | — | > **transactions full type** > > ```ts theme={null} > { > }[] > ``` *** ## Prices ### getHistoricalPrices `prices.getHistoricalPrices` Get historical token prices over a time range. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.prices.getHistoricalPrices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | No | — | | `network` | `string` | No | — | | `address` | `string` | No | — | | `startTime` | `string \| number` | Yes | — | | `endTime` | `string \| number` | Yes | — | | `interval` | `5m \| 1h \| 1d` | No | — | | `withMarketData` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | No | — | | `network` | `string` | No | — | | `address` | `string` | No | — | | `currency` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > value: string, > timestamp: string, > marketCap?: string, > totalVolume?: string > }[] > ``` *** ### getPricesBySymbol `prices.getPricesBySymbol` Get current token prices by symbol. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.prices.getPricesBySymbol({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbols` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > symbol: string, > prices?: { > currency: string, > value: string, > lastUpdatedAt: string > }[], > error?: { > } > }[] > ``` *** ### getTokenPricesByAddress `prices.getTokenPricesByAddress` Get current token prices by address/network. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.prices.getTokenPricesByAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `addresses` | `object[]` | Yes | — | > **addresses full type** > > ```ts theme={null} > { > network: string, > address: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > network?: string, > address?: string, > prices?: { > currency: string, > value: string, > lastUpdatedAt: string > }[], > error?: { > } > }[] > ``` *** ## Rpc ### getTransactionCount `rpc.getTransactionCount` Get transaction count (nonce) for an address. **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.rpc.getTransactionCount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `address` | `string` | Yes | — | | `blockTag` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `hex` | `string` | Yes | — | *** ## Token ### getTokenBalances `token.getTokenBalances` Get ERC-20 token balances for an address (JSON-RPC). **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.token.getTokenBalances({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `address` | `string` | Yes | — | | `tokenAddresses` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | Yes | — | | `tokenBalances` | `object[]` | Yes | — | > **tokenBalances full type** > > ```ts theme={null} > { > contractAddress: string, > tokenBalance?: string | null, > error?: string | null > }[] > ``` *** ### getTokenMetadata `token.getTokenMetadata` Get ERC-20 token metadata (JSON-RPC). **Risk:** `read` ```ts theme={null} await corsair.alchemy.api.token.getTokenMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `eth-mainnet \| eth-sepolia \| polygon-mainnet \| polygon-amoy \| arb-mainnet \| arb-sepolia \| opt-mainnet \| opt-sepolia \| base-mainnet \| base-sepolia \| bnb-mainnet \| avax-mainnet \| zksync-mainnet \| worldchain-mainnet \| solana-mainnet \| solana-devnet` | No | — | | `contractAddress` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `decimals` | `number` | No | — | | `logo` | `string` | No | — | | `name` | `string` | No | — | | `symbol` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/alchemy/database Alchemy local sync: searchable entities, `.search()` filters, and operators. The Alchemy plugin syncs data locally. Use `corsair.alchemy.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Alchemy Nft Path: `alchemy.db.AlchemyNft.search` ```ts theme={null} const rows = await corsair.alchemy.db.AlchemyNft.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `contractAddress` | `string` | equals, contains, startsWith, endsWith, in | | `tokenId` | `string` | equals, contains, startsWith, endsWith, in | | `tokenType` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `tokenUri` | `string` | equals, contains, startsWith, endsWith, in | | `imageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `collectionSlug` | `string` | equals, contains, startsWith, endsWith, in | | `ownerAddress` | `string` | equals, contains, startsWith, endsWith, in | | `balance` | `string` | equals, contains, startsWith, endsWith, in | | `isSpam` | `boolean` | equals | | `timeLastUpdated` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Alchemy Nft Contract Path: `alchemy.db.AlchemyNftContract.search` ```ts theme={null} const rows = await corsair.alchemy.db.AlchemyNftContract.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `totalSupply` | `string` | equals, contains, startsWith, endsWith, in | | `tokenType` | `string` | equals, contains, startsWith, endsWith, in | | `contractDeployer` | `string` | equals, contains, startsWith, endsWith, in | | `deployedBlockNumber` | `number` | equals, gt, gte, lt, lte, in | | `collectionName` | `string` | equals, contains, startsWith, endsWith, in | | `collectionSlug` | `string` | equals, contains, startsWith, endsWith, in | | `floorPrice` | `number` | equals, gt, gte, lt, lte, in | | `isSpam` | `boolean` | equals | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Alchemy Token Path: `alchemy.db.AlchemyToken.search` ```ts theme={null} const rows = await corsair.alchemy.db.AlchemyToken.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `contractAddress` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `decimals` | `number` | equals, gt, gte, lt, lte, in | | `logo` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Alchemy Token Balance Path: `alchemy.db.AlchemyTokenBalance.search` ```ts theme={null} const rows = await corsair.alchemy.db.AlchemyTokenBalance.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `walletAddress` | `string` | equals, contains, startsWith, endsWith, in | | `tokenAddress` | `string` | equals, contains, startsWith, endsWith, in | | `tokenBalance` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Alchemy Token Price Path: `alchemy.db.AlchemyTokenPrice.search` ```ts theme={null} const rows = await corsair.alchemy.db.AlchemyTokenPrice.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `string` | equals, contains, startsWith, endsWith, in | | `lastUpdatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/alchemy/overview Blockchain development platform for Ethereum and Web3 apps, nodes, and APIs. Use **Alchemy** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 36 typed API operations * 5 synced entities (`AlchemyNft`, `AlchemyNftContract`, `AlchemyToken`, `AlchemyTokenBalance`, `AlchemyTokenPrice`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/alchemy ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/alchemy ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/alchemy ``` ```bash bun theme={null} bun add corsair @corsair-dev/alchemy ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { alchemy } from '@corsair-dev/alchemy'; export const corsair = createCorsair({ plugins: [ alchemy(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} alchemy() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'alchemy', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`nft.computeRarityV3`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.alchemy.api.nft.computeRarityV3({}); ``` **`nft.invalidateContractV3`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.alchemy.api.nft.invalidateContractV3({}); ``` See the full list on the [API](/plugins/alchemy/api) page. ## Query synced data Synced entities support `tenant.alchemy.db..search()` and `.list()`: `AlchemyNft`, `AlchemyNftContract`, `AlchemyToken`, `AlchemyTokenBalance`, `AlchemyTokenPrice`. See [Database](/plugins/alchemy/database) for filters and operators. ## What's next > **[API reference](/plugins/alchemy/api)** > > Every `alchemy.api.*` operation with input and output types. > **[Database](/plugins/alchemy/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Database Source: https://docs.corsair.dev/plugins/algolia/database Algolia local sync: searchable entities, `.search()` filters, and operators. The Algolia plugin syncs data locally. Use `corsair.algolia.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Indices Path: `algolia.db.indices.search` ```ts theme={null} const rows = await corsair.algolia.db.indices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `entries` | `number` | equals, gt, gte, lt, lte, in | | `dataSize` | `number` | equals, gt, gte, lt, lte, in | | `fileSize` | `number` | equals, gt, gte, lt, lte, in | | `lastBuildTimeS` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `pendingTask` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Records Path: `algolia.db.records.search` ```ts theme={null} const rows = await corsair.algolia.db.records.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `algolia.db.tasks.search` ```ts theme={null} const rows = await corsair.algolia.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `index` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/algolia/overview Search and discovery API for fast, relevant site search and product recommendations. Use **Algolia** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 132 typed API operations * 3 synced entities (`indices`, `records`, `tasks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/algolia ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/algolia ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/algolia ``` ```bash bun theme={null} bun add corsair @corsair-dev/algolia ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { algolia } from '@corsair-dev/algolia'; export const corsair = createCorsair({ plugins: [ algolia(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} algolia() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'algolia', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`abTests.getAbTest`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.algolia.api.abTests.getAbTest({}); ``` **`abTests.addAbTest`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.algolia.api.abTests.addAbTest({}); ``` See the full list on the [API](/plugins/algolia/api) page. ## Query synced data Synced entities support `tenant.algolia.db..search()` and `.list()`: `indices`, `records`, `tasks`. See [Database](/plugins/algolia/database) for filters and operators. ## What's next > **[API reference](/plugins/algolia/api)** > > Every `algolia.api.*` operation with input and output types. > **[Database](/plugins/algolia/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/alibaba/api API reference for Alibaba: every `alibaba.api.*` operation with input and output types. Every `alibaba.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Image ### generate `image.generate` Generate or edit images with Qwen-Image 3.0 or Wan 2.7 Image; returns image URLs valid for 24 hours **Risk:** `write` ```ts theme={null} await corsair.alibaba.api.image.generate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `qwen-image-3.0-pro \| qwen-image-3.0 \| wan2.7-image-pro \| wan2.7-image` | Yes | — | | `prompt` | `string` | Yes | — | | `images` | `string[]` | No | — | | `parameters` | `object` | No | — | > **parameters full type** > > ```ts theme={null} > { > size?: string, > n?: number, > seed?: number, > watermark?: boolean, > negative_prompt?: string, > prompt_extend?: boolean, > prompt_extend_mode?: direct | agent, > enable_thinking?: boolean, > thinking_mode?: boolean, > enable_sequential?: boolean, > bbox_list?: tuple[][], > color_palette?: { > hex: string, > ratio: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `output` | `object` | Yes | — | | `usage` | `object` | No | — | | `request_id` | `string` | Yes | — | > **output full type** > > ```ts theme={null} > { > rewrite_status?: string | null, > choices: { > finish_reason?: string | null, > message: { > role: string, > content: { > image: string > }[] > } > }[] > } > ``` > **usage full type** > > ```ts theme={null} > { > output_width?: number | null, > output_height?: number | null, > input_image_count?: number | null, > output_image_count?: number | null, > input_image_type?: string | null, > output_image_type?: string | null, > width?: number | null, > height?: number | null, > image_count?: number | null > } > ``` *** ## Tasks ### get `tasks.get` Get a generation task status and, once it succeeds, the video URL (valid 24 hours) **Risk:** `read` ```ts theme={null} await corsair.alibaba.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `output` | `object` | Yes | — | | `usage` | `object` | No | — | | `request_id` | `string` | Yes | — | > **output full type** > > ```ts theme={null} > { > task_id: string, > task_status: PENDING | RUNNING | SUCCEEDED | FAILED | CANCELED | UNKNOWN, > submit_time?: string | null, > scheduled_time?: string | null, > end_time?: string | null, > video_url?: string | null, > orig_prompt?: string | null, > code?: string | null, > message?: string | null > } > ``` > **usage full type** > > ```ts theme={null} > { > duration?: number | null, > input_video_duration?: number | null, > output_video_duration?: number | null, > SR?: number | null, > ratio?: string | null, > video_count?: number | null > } > ``` *** ## Video ### edit `video.edit` Start a Wan 2.7 video editing task on an input video **Risk:** `write` ```ts theme={null} await corsair.alibaba.api.video.edit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `wan2.7-videoedit` | Yes | — | | `prompt` | `string` | No | — | | `negative_prompt` | `string` | No | — | | `media` | `object[]` | Yes | — | | `parameters` | `object` | No | — | > **media full type** > > ```ts theme={null} > { > type: video | reference_image, > url: string | string > }[] > ``` > **parameters full type** > > ```ts theme={null} > { > resolution?: 720P | 1080P, > ratio?: 16:9 | 9:16 | 1:1 | 4:3 | 3:4, > duration?: 0 | number, > audio_setting?: auto | origin, > prompt_extend?: boolean, > watermark?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `output` | `object` | Yes | — | | `request_id` | `string` | Yes | — | > **output full type** > > ```ts theme={null} > { > task_id: string, > task_status: PENDING | RUNNING | SUCCEEDED | FAILED | CANCELED | UNKNOWN > } > ``` *** ### imageToVideo `video.imageToVideo` Start a Wan 2.7 image-to-video task from a first frame, first and last frames, or a clip to continue **Risk:** `write` ```ts theme={null} await corsair.alibaba.api.video.imageToVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `wan2.7-i2v` | Yes | — | | `prompt` | `string` | No | — | | `negative_prompt` | `string` | No | — | | `media` | `object[]` | Yes | — | | `parameters` | `object` | No | — | > **media full type** > > ```ts theme={null} > { > type: first_frame | last_frame | driving_audio | first_clip, > url: string > }[] > ``` > **parameters full type** > > ```ts theme={null} > { > resolution?: 720P | 1080P, > duration?: number, > prompt_extend?: boolean, > watermark?: boolean, > seed?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `output` | `object` | Yes | — | | `request_id` | `string` | Yes | — | > **output full type** > > ```ts theme={null} > { > task_id: string, > task_status: PENDING | RUNNING | SUCCEEDED | FAILED | CANCELED | UNKNOWN > } > ``` *** ### referenceToVideo `video.referenceToVideo` Start a Wan 2.7 reference-to-video task from reference images, videos, and voices **Risk:** `write` ```ts theme={null} await corsair.alibaba.api.video.referenceToVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `wan2.7-r2v` | Yes | — | | `prompt` | `string` | Yes | — | | `negative_prompt` | `string` | No | — | | `media` | `object[]` | Yes | — | | `parameters` | `object` | No | — | > **media full type** > > ```ts theme={null} > { > type: reference_image | reference_video | first_frame, > url: string, > reference_voice?: string > }[] > ``` > **parameters full type** > > ```ts theme={null} > { > resolution?: 720P | 1080P, > ratio?: 16:9 | 9:16 | 1:1 | 4:3 | 3:4, > duration?: number, > prompt_extend?: boolean, > watermark?: boolean, > seed?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `output` | `object` | Yes | — | | `request_id` | `string` | Yes | — | > **output full type** > > ```ts theme={null} > { > task_id: string, > task_status: PENDING | RUNNING | SUCCEEDED | FAILED | CANCELED | UNKNOWN > } > ``` *** ### textToVideo `video.textToVideo` Start a Wan text-to-video task (Wan 3.0 also takes reference media, files, and links); returns a task id **Risk:** `write` ```ts theme={null} await corsair.alibaba.api.video.textToVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `wan2.7-t2v \| wan3.0-video \| wan3.0-video-prime` | Yes | — | | `prompt` | `string` | No | — | | `negative_prompt` | `string` | No | — | | `audio_url` | `string` | No | — | | `media` | `object[]` | No | — | | `parameters` | `object` | No | — | > **media full type** > > ```ts theme={null} > { > type: first_frame | last_frame | reference_image | reference_video | reference_audio | file | link, > url: string > }[] > ``` > **parameters full type** > > ```ts theme={null} > { > resolution?: 480P | 720P | 1080P, > ratio?: 16:9 | 9:16 | 1:1 | 4:3 | 3:4 | 21:9 | adaptive, > duration?: -1 | number, > audio?: boolean, > prompt_extend?: boolean, > watermark?: boolean, > seed?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `output` | `object` | Yes | — | | `request_id` | `string` | Yes | — | > **output full type** > > ```ts theme={null} > { > task_id: string, > task_status: PENDING | RUNNING | SUCCEEDED | FAILED | CANCELED | UNKNOWN > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/alibaba/database Alibaba local sync: searchable entities, `.search()` filters, and operators. The Alibaba plugin syncs data locally. Use `corsair.alibaba.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Images Path: `alibaba.db.images.search` ```ts theme={null} const rows = await corsair.alibaba.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `requestId` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `prompt` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `number` | equals, gt, gte, lt, lte, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Video Tasks Path: `alibaba.db.videoTasks.search` ```ts theme={null} const rows = await corsair.alibaba.db.videoTasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `taskId` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `videoUrl` | `string` | equals, contains, startsWith, endsWith, in | | `submitTime` | `string` | equals, contains, startsWith, endsWith, in | | `endTime` | `string` | equals, contains, startsWith, endsWith, in | | `durationSeconds` | `number` | equals, gt, gte, lt, lte, in | | `errorCode` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/alibaba/overview Alibaba plugin for Corsair Use **Alibaba** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 6 typed API operations * 2 synced entities (`images`, `videoTasks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/alibaba ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/alibaba ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/alibaba ``` ```bash bun theme={null} bun add corsair @corsair-dev/alibaba ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { alibaba } from '@corsair-dev/alibaba'; export const corsair = createCorsair({ plugins: [ alibaba(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} alibaba() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'alibaba', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`tasks.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.alibaba.api.tasks.get({}); ``` **`image.generate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.alibaba.api.image.generate({}); ``` See the full list on the [API](/plugins/alibaba/api) page. ## Query synced data Synced entities support `tenant.alibaba.db..search()` and `.list()`: `images`, `videoTasks`. See [Database](/plugins/alibaba/database) for filters and operators. ## What's next > **[API reference](/plugins/alibaba/api)** > > Every `alibaba.api.*` operation with input and output types. > **[Database](/plugins/alibaba/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/allimagesai/api API reference for All Images AI: every `allimagesai.api.*` operation with input and output types. Every `allimagesai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Api Keys ### check `apiKeys.check` Validate the configured API key and return the email address and optional name of the account it belongs to. **Risk:** `read` ```ts theme={null} await corsair.allimagesai.api.apiKeys.check({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `name` | `string` | No | — | *** ## Credits ### get `credits.get` Return the remaining and total credits for each quota bucket on the account. **Risk:** `read` ```ts theme={null} await corsair.allimagesai.api.credits.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `credits` | `object[]` | Yes | — | > **credits full type** > > ```ts theme={null} > { > type?: global | f_images | f_images_print | f_images_packImage | f_images_upscaleHD | f_images_upscaleUHD | f_websites | f_queues | null, > credit: number, > creditTotal?: number | null, > unlimited?: boolean | null > }[] > ``` *** ## Image Generations ### delete `imageGenerations.delete` Permanently delete one or more image generation batches by their print ids. **Risk:** `destructive` ```ts theme={null} await corsair.allimagesai.api.imageGenerations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `printIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | Yes | — | | `printIds` | `string[]` | Yes | — | *** ### list `imageGenerations.list` List image generation batches created for bulk use, filterable by name and tag. Paginated with limit and offset. **Risk:** `read` ```ts theme={null} await corsair.allimagesai.api.imageGenerations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `sort` | `string` | No | — | | `name` | `string` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `filteredResults` | `object` | No | — | | `prints` | `object[]` | Yes | — | > **filteredResults full type** > > ```ts theme={null} > number | { > } > ``` > **prints full type** > > ```ts theme={null} > { > id?: string, > name: string, > prompt: string, > status: number, > params: { > name: sujetMode | templatePrompt | angle | photographe | time | weather | format | camera | interdiction | version | chaos | stylize | fromImageUrl, > value: string > }[], > processMode?: relax | fast | null, > images?: { > id?: string, > url?: string > }[], > nbImages?: number | null, > tags?: string[], > metaData?: { > } | null, > createdAt?: string | null > }[] > ``` *** ## Images ### listDownloaded `images.listDownloaded` List images previously downloaded on this account, optionally filtered by download date. Paginated with limit and offset. **Risk:** `read` ```ts theme={null} await corsair.allimagesai.api.images.listDownloaded({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `sort` | `string` | No | — | | `afterCreatedAt` | `string \| Date` | No | — | | `beforeCreatedAt` | `string \| Date` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `filteredResults` | `object` | No | — | | `images` | `object[]` | Yes | — | > **filteredResults full type** > > ```ts theme={null} > number | { > } > ``` > **images full type** > > ```ts theme={null} > { > id: string, > url: string, > urlFull: string, > urlUpscale?: string | null, > urlUpscaleUHD: string, > downloadedAt: string > }[] > ``` *** ## Webhooks ### create `webhooks.create` Register a webhook endpoint on the API key to receive print lifecycle callbacks. Defaults to print.failed and print.completed. **Risk:** `write` ```ts theme={null} await corsair.allimagesai.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `events` | `test \| print.created \| print.active \| print.failed \| print.progress \| print.completed[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | *** ### get `webhooks.get` Retrieve a registered webhook by its id, returning its URL. The provider does not return the subscribed event list. **Risk:** `read` ```ts theme={null} await corsair.allimagesai.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiKeyWebhookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `apiKeyId` | `string` | No | — | | `url` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/allimagesai/database All Images AI local sync: searchable entities, `.search()` filters, and operators. The All Images AI plugin syncs data locally. Use `corsair.allimagesai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Downloaded Images Path: `allimagesai.db.downloadedImages.search` ```ts theme={null} const rows = await corsair.allimagesai.db.downloadedImages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `url_full` | `string` | equals, contains, startsWith, endsWith, in | | `url_upscale` | `string` | equals, contains, startsWith, endsWith, in | | `url_upscale_uhd` | `string` | equals, contains, startsWith, endsWith, in | | `downloaded_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Image Generations Path: `allimagesai.db.imageGenerations.search` ```ts theme={null} const rows = await corsair.allimagesai.db.imageGenerations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `prompt` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `number` | equals, gt, gte, lt, lte, in | | `process_mode` | `string` | equals, contains, startsWith, endsWith, in | | `nb_images` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `allimagesai.db.webhooks.search` ```ts theme={null} const rows = await corsair.allimagesai.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/allimagesai/overview AI image generation service for creating visuals from text prompts and styles. Use **All Images AI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 7 typed API operations * 3 synced entities (`downloadedImages`, `imageGenerations`, `webhooks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/allimagesai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/allimagesai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/allimagesai ``` ```bash bun theme={null} bun add corsair @corsair-dev/allimagesai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { allimagesai } from '@corsair-dev/allimagesai'; export const corsair = createCorsair({ plugins: [ allimagesai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} allimagesai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'allimagesai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`apiKeys.check`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.allimagesai.api.apiKeys.check({}); ``` **`imageGenerations.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.allimagesai.api.imageGenerations.delete({}); ``` See the full list on the [API](/plugins/allimagesai/api) page. ## Query synced data Synced entities support `tenant.allimagesai.db..search()` and `.list()`: `downloadedImages`, `imageGenerations`, `webhooks`. See [Database](/plugins/allimagesai/database) for filters and operators. ## What's next > **[API reference](/plugins/allimagesai/api)** > > Every `allimagesai.api.*` operation with input and output types. > **[Database](/plugins/allimagesai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/alphavantage/api API reference for Alpha Vantage: every `alphavantage.api.*` operation with input and output types. Every `alphavantage.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Commodities ### all `commodities.all` Get the global commodities price index **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.commodities.all({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `monthly \| quarterly \| annual` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### aluminum `commodities.aluminum` Get global aluminum prices **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.commodities.aluminum({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `monthly \| quarterly \| annual` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### brent `commodities.brent` Get Brent crude oil prices **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.commodities.brent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `daily \| weekly \| monthly` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### coffee `commodities.coffee` Get global coffee prices **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.commodities.coffee({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `monthly \| quarterly \| annual` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### copper `commodities.copper` Get global copper prices **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.commodities.copper({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `monthly \| quarterly \| annual` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### corn `commodities.corn` Get global corn prices **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.commodities.corn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `monthly \| quarterly \| annual` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### cotton `commodities.cotton` Get global cotton prices **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.commodities.cotton({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `monthly \| quarterly \| annual` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### sugar `commodities.sugar` Get global sugar prices **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.commodities.sugar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `monthly \| quarterly \| annual` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### wheat `commodities.wheat` Get global wheat prices **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.commodities.wheat({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `monthly \| quarterly \| annual` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ## Crypto ### daily `crypto.daily` Get daily bars for a digital currency **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.crypto.daily({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `market` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### intraday `crypto.intraday` Get intraday bars for a digital currency \[PREMIUM PLAN] **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.crypto.intraday({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | Crypto ticker, e.g. BTC. | | `market` | `string` | Yes | Quote currency, e.g. USD. | | `interval` | `1min \| 5min \| 15min \| 30min \| 60min` | Yes | — | | `outputsize` | `compact \| full` | No | compact returns the latest 100 points, full the full history. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### monthly `crypto.monthly` Get monthly bars for a digital currency **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.crypto.monthly({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `market` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### weekly `crypto.weekly` Get weekly bars for a digital currency **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.crypto.weekly({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `market` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ## Economic ### cpi `economic.cpi` Get the US consumer price index **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.cpi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `monthly \| semiannual` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### durables `economic.durables` Get US durable goods orders **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.durables({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### federalFundsRate `economic.federalFundsRate` Get the US federal funds rate **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.federalFundsRate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `daily \| weekly \| monthly` | No | Sampling interval. Defaults to monthly. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### inflation `economic.inflation` Get annual US inflation **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.inflation({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### nonfarmPayroll `economic.nonfarmPayroll` Get US nonfarm payroll totals **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.nonfarmPayroll({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### realGdp `economic.realGdp` Get US real gross domestic product **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.realGdp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `quarterly \| annual` | No | Sampling interval. Defaults to annual. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### realGdpPerCapita `economic.realGdpPerCapita` Get US real GDP per capita **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.realGdpPerCapita({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### retailSales `economic.retailSales` Get US advance retail sales **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.retailSales({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### treasuryYield `economic.treasuryYield` Get US treasury yield for a constant maturity **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.treasuryYield({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `daily \| weekly \| monthly` | No | — | | `maturity` | `3month \| 2year \| 5year \| 7year \| 10year \| 30year` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ### unemployment `economic.unemployment` Get the US unemployment rate **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.economic.unemployment({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > date: string, > value: string > }[] > ``` *** ## Forex ### daily `forex.daily` Get daily bars for a currency pair **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.forex.daily({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_symbol` | `string` | Yes | — | | `to_symbol` | `string` | Yes | — | | `outputsize` | `compact \| full` | No | compact returns the latest 100 points, full the full history. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### exchangeRate `forex.exchangeRate` Get the current rate for a currency pair **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.forex.exchangeRate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_currency` | `string` | Yes | — | | `to_currency` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Realtime Currency Exchange Rate` | `object` | Yes | — | > **Realtime Currency Exchange Rate full type** > > ```ts theme={null} > { > 1. From_Currency Code: string, > 2. From_Currency Name: string, > 3. To_Currency Code: string, > 4. To_Currency Name: string, > 5. Exchange Rate: string, > 6. Last Refreshed: string, > 7. Time Zone: string, > 8. Bid Price?: string, > 9. Ask Price?: string > } > ``` *** ### intraday `forex.intraday` Get intraday bars for a currency pair \[PREMIUM PLAN] **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.forex.intraday({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_symbol` | `string` | Yes | — | | `to_symbol` | `string` | Yes | — | | `interval` | `1min \| 5min \| 15min \| 30min \| 60min` | Yes | — | | `outputsize` | `compact \| full` | No | compact returns the latest 100 points, full the full history. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### monthly `forex.monthly` Get monthly bars for a currency pair **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.forex.monthly({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_symbol` | `string` | Yes | — | | `to_symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### weekly `forex.weekly` Get weekly bars for a currency pair **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.forex.weekly({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_symbol` | `string` | Yes | — | | `to_symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ## Fundamentals ### balanceSheet `fundamentals.balanceSheet` Get annual and quarterly balance sheets **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.balanceSheet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `annualReports` | `object[]` | Yes | — | | `quarterlyReports` | `object[]` | Yes | — | > **annualReports full type** > > ```ts theme={null} > { > fiscalDateEnding: string, > reportedCurrency: string > }[] > ``` > **quarterlyReports full type** > > ```ts theme={null} > { > fiscalDateEnding: string, > reportedCurrency: string > }[] > ``` *** ### cashFlow `fundamentals.cashFlow` Get annual and quarterly cash flow statements **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.cashFlow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `annualReports` | `object[]` | Yes | — | | `quarterlyReports` | `object[]` | Yes | — | > **annualReports full type** > > ```ts theme={null} > { > fiscalDateEnding: string, > reportedCurrency: string > }[] > ``` > **quarterlyReports full type** > > ```ts theme={null} > { > fiscalDateEnding: string, > reportedCurrency: string > }[] > ``` *** ### companyOverview `fundamentals.companyOverview` Get a company profile with sector and valuation figures **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.companyOverview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Symbol` | `string` | Yes | — | | `AssetType` | `string` | No | — | | `Name` | `string` | No | — | | `Description` | `string` | No | — | | `CIK` | `string` | No | — | | `Exchange` | `string` | No | — | | `Currency` | `string` | No | — | | `Country` | `string` | No | — | | `Sector` | `string` | No | — | | `Industry` | `string` | No | — | | `Address` | `string` | No | — | | `OfficialSite` | `string` | No | — | | `FiscalYearEnd` | `string` | No | — | | `LatestQuarter` | `string` | No | — | | `MarketCapitalization` | `string` | No | — | | `EBITDA` | `string` | No | — | | `PERatio` | `string` | No | — | | `PEGRatio` | `string` | No | — | | `BookValue` | `string` | No | — | | `DividendPerShare` | `string` | No | — | | `DividendYield` | `string` | No | — | | `EPS` | `string` | No | — | | `RevenuePerShareTTM` | `string` | No | — | | `ProfitMargin` | `string` | No | — | | `OperatingMarginTTM` | `string` | No | — | | `ReturnOnAssetsTTM` | `string` | No | — | | `ReturnOnEquityTTM` | `string` | No | — | | `RevenueTTM` | `string` | No | — | | `GrossProfitTTM` | `string` | No | — | | `DilutedEPSTTM` | `string` | No | — | | `QuarterlyEarningsGrowthYOY` | `string` | No | — | | `QuarterlyRevenueGrowthYOY` | `string` | No | — | | `AnalystTargetPrice` | `string` | No | — | | `AnalystRatingStrongBuy` | `string` | No | — | | `AnalystRatingBuy` | `string` | No | — | | `AnalystRatingHold` | `string` | No | — | | `AnalystRatingSell` | `string` | No | — | | `AnalystRatingStrongSell` | `string` | No | — | | `TrailingPE` | `string` | No | — | | `ForwardPE` | `string` | No | — | | `PriceToSalesRatioTTM` | `string` | No | — | | `PriceToBookRatio` | `string` | No | — | | `EVToRevenue` | `string` | No | — | | `EVToEBITDA` | `string` | No | — | | `Beta` | `string` | No | — | | `52WeekHigh` | `string` | No | — | | `52WeekLow` | `string` | No | — | | `50DayMovingAverage` | `string` | No | — | | `200DayMovingAverage` | `string` | No | — | | `SharesOutstanding` | `string` | No | — | | `SharesFloat` | `string` | No | — | | `PercentInsiders` | `string` | No | — | | `PercentInstitutions` | `string` | No | — | | `DividendDate` | `string` | No | — | | `ExDividendDate` | `string` | No | — | *** ### dividends `fundamentals.dividends` Get historical and declared dividends **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.dividends({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ex_dividend_date: string, > declaration_date?: string, > record_date?: string, > payment_date?: string, > amount: string > }[] > ``` *** ### earnings `fundamentals.earnings` Get reported and estimated earnings per share **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.earnings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `annualEarnings` | `object[]` | Yes | — | | `quarterlyEarnings` | `object[]` | Yes | — | > **annualEarnings full type** > > ```ts theme={null} > { > fiscalDateEnding: string, > reportedEPS: string > }[] > ``` > **quarterlyEarnings full type** > > ```ts theme={null} > { > fiscalDateEnding: string, > reportedDate: string, > reportedEPS: string > }[] > ``` *** ### earningsCalendar `fundamentals.earningsCalendar` List upcoming earnings dates (CSV upstream) **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.earningsCalendar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | No | — | | `horizon` | `3month \| 6month \| 12month` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### earningsCallTranscript `fundamentals.earningsCallTranscript` Get an earnings call transcript with per-speaker sentiment **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.earningsCallTranscript({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `quarter` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `quarter` | `string` | Yes | — | | `transcript` | `object[]` | Yes | — | > **transcript full type** > > ```ts theme={null} > { > speaker: string, > title?: string, > content: string, > sentiment?: string > }[] > ``` *** ### incomeStatement `fundamentals.incomeStatement` Get annual and quarterly income statements **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.incomeStatement({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `annualReports` | `object[]` | Yes | — | | `quarterlyReports` | `object[]` | Yes | — | > **annualReports full type** > > ```ts theme={null} > { > fiscalDateEnding: string, > reportedCurrency: string > }[] > ``` > **quarterlyReports full type** > > ```ts theme={null} > { > fiscalDateEnding: string, > reportedCurrency: string > }[] > ``` *** ### ipoCalendar `fundamentals.ipoCalendar` List IPOs expected in the next three months (CSV upstream) **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.ipoCalendar({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### splits `fundamentals.splits` Get historical stock splits **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.fundamentals.splits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > effective_date: string, > split_factor: string > }[] > ``` *** ## Intelligence ### historicalOptions `intelligence.historicalOptions` Get a full options chain for one date \[PREMIUM PLAN] **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.intelligence.historicalOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `endpoint` | `string` | No | — | | `message` | `string` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > contractID: string, > symbol: string, > expiration: string, > strike: string, > type: string > }[] > ``` *** ### newsSentiment `intelligence.newsSentiment` Get market news with article and ticker sentiment scores **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.intelligence.newsSentiment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tickers` | `string[]` | No | — | | `topics` | `string[]` | No | — | | `time_from` | `string` | No | — | | `time_to` | `string` | No | — | | `sort` | `LATEST \| EARLIEST \| RELEVANCE` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `string` | Yes | — | | `sentiment_score_definition` | `string` | Yes | — | | `relevance_score_definition` | `string` | Yes | — | | `feed` | `object[]` | Yes | — | > **feed full type** > > ```ts theme={null} > { > title: string, > url: string, > time_published: string, > summary: string, > source: string, > overall_sentiment_score: number, > overall_sentiment_label: string, > ticker_sentiment?: { > ticker: string, > relevance_score: string, > ticker_sentiment_score: string, > ticker_sentiment_label: string > }[] > }[] > ``` *** ### slidingWindowAnalytics `intelligence.slidingWindowAnalytics` Get rolling-window statistics across a set of tickers **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.intelligence.slidingWindowAnalytics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbols` | `string[]` | Yes | — | | `range` | `string` | Yes | Lookback window, e.g. 2month, 6month, full. | | `interval` | `DAILY \| WEEKLY \| MONTHLY` | Yes | — | | `window_size` | `number` | Yes | — | | `calculations` | `string[]` | Yes | e.g. MEAN, STDDEV, CORRELATION. | | `ohlc` | `open \| high \| low \| close` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta_data` | `object` | Yes | — | | `payload` | `object` | Yes | — | > **meta\_data full type** > > ```ts theme={null} > { > symbols: string, > window_size: number, > min_dt: string, > max_dt: string, > ohlc: string, > interval: string > } > ``` > **payload full type** > > ```ts theme={null} > { > } > ``` *** ## Market ### listingStatus `market.listingStatus` List every covered security, active or delisted (CSV upstream) **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.market.listingStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `state` | `active \| delisted` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### sector `market.sector` Get sector performance \[DEPRECATED UPSTREAM: returns an empty body] **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.market.sector({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### status `market.status` Get the open or closed state of global exchanges **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.market.status({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `endpoint` | `string` | Yes | — | | `markets` | `object[]` | Yes | — | > **markets full type** > > ```ts theme={null} > { > market_type: string, > region: string, > primary_exchanges: string, > local_open: string, > local_close: string, > current_status: string, > notes?: string > }[] > ``` *** ### symbolSearch `market.symbolSearch` Search securities by name or ticker fragment **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.market.symbolSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keywords` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bestMatches` | `object[]` | Yes | — | > **bestMatches full type** > > ```ts theme={null} > { > 1. symbol: string, > 2. name: string, > 3. type: string, > 4. region: string, > 5. marketOpen: string, > 6. marketClose: string, > 7. timezone: string, > 8. currency: string, > 9. matchScore: string > }[] > ``` *** ### topGainersLosers `market.topGainersLosers` Get the top gainers, losers and most actively traded US tickers **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.market.topGainersLosers({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `string` | Yes | — | | `last_updated` | `string` | Yes | — | | `top_gainers` | `object[]` | Yes | — | | `top_losers` | `object[]` | Yes | — | | `most_actively_traded` | `object[]` | Yes | — | > **top\_gainers full type** > > ```ts theme={null} > { > ticker: string, > price: string, > change_amount: string, > change_percentage: string, > volume: string > }[] > ``` > **top\_losers full type** > > ```ts theme={null} > { > ticker: string, > price: string, > change_amount: string, > change_percentage: string, > volume: string > }[] > ``` > **most\_actively\_traded full type** > > ```ts theme={null} > { > ticker: string, > price: string, > change_amount: string, > change_percentage: string, > volume: string > }[] > ``` *** ## Technical ### indicator `technical.indicator` Calculate any technical indicator (SMA, EMA, RSI, MACD, ...) **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.technical.indicator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `indicator` | `string` | Yes | — | | `symbol` | `string` | Yes | — | | `interval` | `1min \| 5min \| 15min \| 30min \| 60min \| daily \| weekly \| monthly` | Yes | — | | `time_period` | `number` | No | — | | `series_type` | `close \| open \| high \| low` | No | — | | `month` | `string` | No | — | | `extra_params` | `object` | No | — | > **extra\_params full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ## Time Series ### daily `timeSeries.daily` Get daily OHLCV bars **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.timeSeries.daily({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `outputsize` | `compact \| full` | No | compact returns the latest 100 points, full the full history. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### globalQuote `timeSeries.globalQuote` Get the latest price and volume for one ticker **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.timeSeries.globalQuote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Global Quote` | `object` | Yes | — | > **Global Quote full type** > > ```ts theme={null} > { > 01. symbol: string, > 02. open: string, > 03. high: string, > 04. low: string, > 05. price: string, > 06. volume: string, > 07. latest trading day: string, > 08. previous close: string, > 09. change: string, > 10. change percent: string > } | { > } > ``` *** ### intraday `timeSeries.intraday` Get intraday OHLCV bars at 1-60 minute resolution \[PREMIUM PLAN] **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.timeSeries.intraday({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `interval` | `1min \| 5min \| 15min \| 30min \| 60min` | Yes | — | | `adjusted` | `boolean` | No | — | | `extended_hours` | `boolean` | No | — | | `month` | `string` | No | — | | `outputsize` | `compact \| full` | No | compact returns the latest 100 points, full the full history. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### intradayExtended `timeSeries.intradayExtended` Get historical intraday bars beyond the default window \[PREMIUM PLAN] **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.timeSeries.intradayExtended({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `interval` | `1min \| 5min \| 15min \| 30min \| 60min` | Yes | — | | `slice` | `string` | No | — | | `month` | `string` | No | — | | `adjusted` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### monthly `timeSeries.monthly` Get monthly OHLCV bars **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.timeSeries.monthly({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### monthlyAdjusted `timeSeries.monthlyAdjusted` Get monthly bars adjusted for splits and dividends **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.timeSeries.monthlyAdjusted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### realtimeBulkQuotes `timeSeries.realtimeBulkQuotes` Get quotes for up to 100 tickers at once \[PREMIUM PLAN] **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.timeSeries.realtimeBulkQuotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbols` | `string[]` | Yes | Up to 100 tickers, sent to the API as a comma-separated list. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `endpoint` | `string` | No | — | | `message` | `string` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > symbol: string > }[] > ``` *** ### weekly `timeSeries.weekly` Get weekly OHLCV bars **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.timeSeries.weekly({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** ### weeklyAdjusted `timeSeries.weeklyAdjusted` Get weekly bars adjusted for splits and dividends **Risk:** `read` ```ts theme={null} await corsair.alphavantage.api.timeSeries.weeklyAdjusted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Meta Data` | `object` | No | — | > **Meta Data full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/alphavantage/database Alpha Vantage local sync: searchable entities, `.search()` filters, and operators. The Alpha Vantage plugin syncs data locally. Use `corsair.alphavantage.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Companies Path: `alphavantage.db.companies.search` ```ts theme={null} const rows = await corsair.alphavantage.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Symbol` | `string` | equals, contains, startsWith, endsWith, in | | `AssetType` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `CIK` | `string` | equals, contains, startsWith, endsWith, in | | `Exchange` | `string` | equals, contains, startsWith, endsWith, in | | `Currency` | `string` | equals, contains, startsWith, endsWith, in | | `Country` | `string` | equals, contains, startsWith, endsWith, in | | `Sector` | `string` | equals, contains, startsWith, endsWith, in | | `Industry` | `string` | equals, contains, startsWith, endsWith, in | | `Address` | `string` | equals, contains, startsWith, endsWith, in | | `OfficialSite` | `string` | equals, contains, startsWith, endsWith, in | | `FiscalYearEnd` | `string` | equals, contains, startsWith, endsWith, in | | `LatestQuarter` | `string` | equals, contains, startsWith, endsWith, in | | `MarketCapitalization` | `string` | equals, contains, startsWith, endsWith, in | | `EBITDA` | `string` | equals, contains, startsWith, endsWith, in | | `PERatio` | `string` | equals, contains, startsWith, endsWith, in | | `PEGRatio` | `string` | equals, contains, startsWith, endsWith, in | | `BookValue` | `string` | equals, contains, startsWith, endsWith, in | | `DividendPerShare` | `string` | equals, contains, startsWith, endsWith, in | | `DividendYield` | `string` | equals, contains, startsWith, endsWith, in | | `EPS` | `string` | equals, contains, startsWith, endsWith, in | | `RevenuePerShareTTM` | `string` | equals, contains, startsWith, endsWith, in | | `ProfitMargin` | `string` | equals, contains, startsWith, endsWith, in | | `OperatingMarginTTM` | `string` | equals, contains, startsWith, endsWith, in | | `ReturnOnAssetsTTM` | `string` | equals, contains, startsWith, endsWith, in | | `ReturnOnEquityTTM` | `string` | equals, contains, startsWith, endsWith, in | | `RevenueTTM` | `string` | equals, contains, startsWith, endsWith, in | | `GrossProfitTTM` | `string` | equals, contains, startsWith, endsWith, in | | `DilutedEPSTTM` | `string` | equals, contains, startsWith, endsWith, in | | `QuarterlyEarningsGrowthYOY` | `string` | equals, contains, startsWith, endsWith, in | | `QuarterlyRevenueGrowthYOY` | `string` | equals, contains, startsWith, endsWith, in | | `AnalystTargetPrice` | `string` | equals, contains, startsWith, endsWith, in | | `AnalystRatingStrongBuy` | `string` | equals, contains, startsWith, endsWith, in | | `AnalystRatingBuy` | `string` | equals, contains, startsWith, endsWith, in | | `AnalystRatingHold` | `string` | equals, contains, startsWith, endsWith, in | | `AnalystRatingSell` | `string` | equals, contains, startsWith, endsWith, in | | `AnalystRatingStrongSell` | `string` | equals, contains, startsWith, endsWith, in | | `TrailingPE` | `string` | equals, contains, startsWith, endsWith, in | | `ForwardPE` | `string` | equals, contains, startsWith, endsWith, in | | `PriceToSalesRatioTTM` | `string` | equals, contains, startsWith, endsWith, in | | `PriceToBookRatio` | `string` | equals, contains, startsWith, endsWith, in | | `EVToRevenue` | `string` | equals, contains, startsWith, endsWith, in | | `EVToEBITDA` | `string` | equals, contains, startsWith, endsWith, in | | `Beta` | `string` | equals, contains, startsWith, endsWith, in | | `52WeekHigh` | `string` | equals, contains, startsWith, endsWith, in | | `52WeekLow` | `string` | equals, contains, startsWith, endsWith, in | | `50DayMovingAverage` | `string` | equals, contains, startsWith, endsWith, in | | `200DayMovingAverage` | `string` | equals, contains, startsWith, endsWith, in | | `SharesOutstanding` | `string` | equals, contains, startsWith, endsWith, in | | `SharesFloat` | `string` | equals, contains, startsWith, endsWith, in | | `PercentInsiders` | `string` | equals, contains, startsWith, endsWith, in | | `PercentInstitutions` | `string` | equals, contains, startsWith, endsWith, in | | `DividendDate` | `string` | equals, contains, startsWith, endsWith, in | | `ExDividendDate` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Symbols Path: `alphavantage.db.symbols.search` ```ts theme={null} const rows = await corsair.alphavantage.db.symbols.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `exchange` | `string` | equals, contains, startsWith, endsWith, in | | `assetType` | `string` | equals, contains, startsWith, endsWith, in | | `ipoDate` | `string` | equals, contains, startsWith, endsWith, in | | `delistingDate` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `marketOpen` | `string` | equals, contains, startsWith, endsWith, in | | `marketClose` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/alphavantage/overview Financial market data API for stocks, forex, crypto, and economic indicators. Use **Alpha Vantage** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 56 typed API operations * 2 synced entities (`companies`, `symbols`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/alphavantage ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/alphavantage ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/alphavantage ``` ```bash bun theme={null} bun add corsair @corsair-dev/alphavantage ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { alphavantage } from '@corsair-dev/alphavantage'; export const corsair = createCorsair({ plugins: [ alphavantage(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} alphavantage() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'alphavantage', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`commodities.all`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.alphavantage.api.commodities.all({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/alphavantage/api) reference.* See the full list on the [API](/plugins/alphavantage/api) page. ## Query synced data Synced entities support `tenant.alphavantage.db..search()` and `.list()`: `companies`, `symbols`. See [Database](/plugins/alphavantage/database) for filters and operators. ## What's next > **[API reference](/plugins/alphavantage/api)** > > Every `alphavantage.api.*` operation with input and output types. > **[Database](/plugins/alphavantage/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/altoviz/api API reference for Altoviz: every `altoviz.api.*` operation with input and output types. Every `altoviz.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getClassifications `account.getClassifications` List accounting classifications, optionally filtered by type (Sale | Expense | Other) **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.account.getClassifications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `Sale \| Expense \| Other` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > label?: string | null, > description?: string | null, > type?: string | null, > accountNumber?: string | null, > isProduct?: boolean | null, > isService?: boolean | null, > defaultVat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > microBusinessDeclarationType?: string | null > }[] > ``` *** ### getCurrentUser `account.getCurrentUser` Get the authenticated user **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.account.getCurrentUser({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `displayName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `profile` | `string` | No | — | | `status` | `string` | No | — | *** ### getSettings `account.getSettings` Get accounting, company, emailing, sales, social and VAT settings **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.account.getSettings({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUnits `account.getUnits` List measurement units - reference data, mirrored **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.account.getUnits({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > code?: string | null, > name?: string | null, > type?: string | null, > conversion?: number | null, > decimals?: number | null > }[] > ``` *** ### getVats `account.getVats` List VAT rates - reference data, mirrored **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.account.getVats({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > default?: boolean | null, > id: number, > label?: string | null, > rate?: number | null, > region?: string | null > }[] > ``` *** ### testApiKey `account.testApiKey` Verify the API key and get the account identity - takes no parameters **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.account.testApiKey({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `apiKeyName` | `string` | No | — | | `companyName` | `string` | No | — | | `message` | `string` | No | — | | `serverTimestamp` | `string` | No | — | | `url` | `string` | No | — | *** ## Colleagues ### delete `colleagues.delete` Delete a colleague **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.colleagues.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `colleagueId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `colleagues.get` Get a colleague by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.colleagues.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `colleagueId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `isPartner` | `boolean` | No | — | | `initialPartnerBalance` | `number` | No | — | | `homecareServiceNumber` | `string` | No | — | | `userId` | `string` | No | — | | `metadatas` | `object` | No | — | > **metadatas full type** > > ```ts theme={null} > { > } > ``` *** ### list `colleagues.list` List colleagues, paged **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.colleagues.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > firstName?: string | null, > lastName?: string | null, > name?: string | null, > email?: string | null, > phone?: string | null, > cellPhone?: string | null, > title?: string | null, > number?: string | null, > internalId?: string | null, > isPartner?: boolean | null, > initialPartnerBalance?: number | null, > homecareServiceNumber?: string | null, > userId?: string | null, > metadatas?: { > } | null > }[] > ``` *** ### update `colleagues.update` Update a colleague. Read-modify-write internally - a partial body is a 500 on this route, not just a clearing PUT. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.colleagues.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `colleagueId` | `number` | Yes | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `isPartner` | `boolean` | No | — | | `initialPartnerBalance` | `number` | No | — | | `homecareServiceNumber` | `string` | No | — | | `userId` | `string` | No | — | | `metadatas` | `object` | No | — | > **metadatas full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `isPartner` | `boolean` | No | — | | `initialPartnerBalance` | `number` | No | — | | `homecareServiceNumber` | `string` | No | — | | `userId` | `string` | No | — | | `metadatas` | `object` | No | — | > **metadatas full type** > > ```ts theme={null} > { > } > ``` *** ## Contacts ### create `contacts.create` Create a standalone contact. There is no customerId field on this route - it cannot be attached to a customer here. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `companyName` | `string` | No | — | | `function` | `string` | No | — | | `service` | `string` | No | — | | `title` | `string` | No | — | | `displayName` | `string` | No | — | | `invertedDisplayName` | `string` | No | — | | `internalId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `displayName` | `string` | No | — | | `invertedDisplayName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `companyName` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `function` | `string` | No | — | | `service` | `string` | No | — | | `title` | `string` | No | — | | `internalId` | `string` | No | — | | `isMain` | `boolean` | No | — | *** ### find `contacts.find` Find contacts by email or internalId - returns an array, possibly empty **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.contacts.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `internalId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > displayName?: string | null, > invertedDisplayName?: string | null, > firstName?: string | null, > lastName?: string | null, > companyName?: string | null, > email?: string | null, > phone?: string | null, > cellPhone?: string | null, > function?: string | null, > service?: string | null, > title?: string | null, > internalId?: string | null, > isMain?: boolean | null > }[] > ``` *** ### get `contacts.get` Get a contact by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `displayName` | `string` | No | — | | `invertedDisplayName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `companyName` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `function` | `string` | No | — | | `service` | `string` | No | — | | `title` | `string` | No | — | | `internalId` | `string` | No | — | | `isMain` | `boolean` | No | — | *** ### list `contacts.list` List contacts, paged. Includes shadow contacts auto-created by customer/supplier/colleague writes. **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > displayName?: string | null, > invertedDisplayName?: string | null, > firstName?: string | null, > lastName?: string | null, > companyName?: string | null, > email?: string | null, > phone?: string | null, > cellPhone?: string | null, > function?: string | null, > service?: string | null, > title?: string | null, > internalId?: string | null, > isMain?: boolean | null > }[] > ``` *** ## Customer Families ### create `customerFamilies.create` Create a customer family (segment) **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.customerFamilies.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | Yes | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `label` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | *** ### delete `customerFamilies.delete` Delete a customer family. Refused with a conflict if it still has members - it does not cascade. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.customerFamilies.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `familyId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `customerFamilies.get` Get a customer family by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.customerFamilies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `familyId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `label` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | *** ### list `customerFamilies.list` List customer families, paged **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.customerFamilies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > label?: string | null, > number?: string | null, > internalId?: string | null > }[] > ``` *** ## Customers ### create `customers.create` Create a customer. type is Business | Consumer | Government - NOT the Company/Individual the catalog description documents. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.customers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `Business \| Consumer \| Government` | Yes | — | | `companyName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `active` | `boolean` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingOptions` | `object` | No | — | | `companyInformations` | `object` | No | — | | `familyId` | `number` | No | — | | `internalNotes` | `string` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > line1?: string, > line2?: string, > zipCode?: string, > city?: string, > countryCode?: string > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > line1?: string, > line2?: string, > zipCode?: string, > city?: string, > countryCode?: string > } > ``` > **billingOptions full type** > > ```ts theme={null} > { > } > ``` > **companyInformations full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `type` | `string` | No | — | | `companyName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `internalNotes` | `string` | No | — | | `active` | `boolean` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingOptions` | `object` | No | — | | `companyInformations` | `object` | No | — | | `family` | `object` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **billingOptions full type** > > ```ts theme={null} > { > } > ``` > **companyInformations full type** > > ```ts theme={null} > { > } > ``` > **family full type** > > ```ts theme={null} > { > id?: number | null, > label?: string | null, > number?: string | null > } > ``` *** ### delete `customers.delete` Delete a customer. Evicts the auto-created contact from the mirror if one is cached. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.customers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### find `customers.find` Find customers by email, internalId or number - returns an array, possibly empty **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.customers.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `internalId` | `string` | No | — | | `number` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > type?: string | null, > companyName?: string | null, > firstName?: string | null, > lastName?: string | null, > name?: string | null, > email?: string | null, > phone?: string | null, > cellPhone?: string | null, > title?: string | null, > number?: string | null, > internalId?: string | null, > internalNotes?: string | null, > active?: boolean | null, > billingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > shippingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > billingOptions?: { > } | null, > companyInformations?: { > } | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null > }[] > ``` *** ### get `customers.get` Get a customer by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.customers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `type` | `string` | No | — | | `companyName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `internalNotes` | `string` | No | — | | `active` | `boolean` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingOptions` | `object` | No | — | | `companyInformations` | `object` | No | — | | `family` | `object` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **billingOptions full type** > > ```ts theme={null} > { > } > ``` > **companyInformations full type** > > ```ts theme={null} > { > } > ``` > **family full type** > > ```ts theme={null} > { > id?: number | null, > label?: string | null, > number?: string | null > } > ``` *** ### getByInternalId `customers.getByInternalId` Get a customer by the caller-supplied internalId **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.customers.getByInternalId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `internalId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `type` | `string` | No | — | | `companyName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `internalNotes` | `string` | No | — | | `active` | `boolean` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingOptions` | `object` | No | — | | `companyInformations` | `object` | No | — | | `family` | `object` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **billingOptions full type** > > ```ts theme={null} > { > } > ``` > **companyInformations full type** > > ```ts theme={null} > { > } > ``` > **family full type** > > ```ts theme={null} > { > id?: number | null, > label?: string | null, > number?: string | null > } > ``` *** ### getContacts `customers.getContacts` List a customer's contacts, including the one auto-created when the customer was created **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.customers.getContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > displayName?: string | null, > invertedDisplayName?: string | null, > firstName?: string | null, > lastName?: string | null, > companyName?: string | null, > email?: string | null, > phone?: string | null, > cellPhone?: string | null, > function?: string | null, > service?: string | null, > title?: string | null, > internalId?: string | null, > isMain?: boolean | null > }[] > ``` *** ### list `customers.list` List customers, paged (PageIndex is 1-based) **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.customers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > type?: string | null, > companyName?: string | null, > firstName?: string | null, > lastName?: string | null, > name?: string | null, > email?: string | null, > phone?: string | null, > cellPhone?: string | null, > title?: string | null, > number?: string | null, > internalId?: string | null, > internalNotes?: string | null, > active?: boolean | null, > billingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > shippingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > billingOptions?: { > } | null, > companyInformations?: { > } | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null > }[] > ``` *** ### update `customers.update` Update a customer. Read-modify-write internally, because Altoviz PUT clears any field the caller omits. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.customers.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | | `type` | `Business \| Consumer \| Government` | No | — | | `companyName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `active` | `boolean` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingOptions` | `object` | No | — | | `companyInformations` | `object` | No | — | | `familyId` | `number` | No | — | | `internalNotes` | `string` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > line1?: string, > line2?: string, > zipCode?: string, > city?: string, > countryCode?: string > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > line1?: string, > line2?: string, > zipCode?: string, > city?: string, > countryCode?: string > } > ``` > **billingOptions full type** > > ```ts theme={null} > { > } > ``` > **companyInformations full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `type` | `string` | No | — | | `companyName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `internalNotes` | `string` | No | — | | `active` | `boolean` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingOptions` | `object` | No | — | | `companyInformations` | `object` | No | — | | `family` | `object` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **billingOptions full type** > > ```ts theme={null} > { > } > ``` > **companyInformations full type** > > ```ts theme={null} > { > } > ``` > **family full type** > > ```ts theme={null} > { > id?: number | null, > label?: string | null, > number?: string | null > } > ``` *** ## Product Families ### create `productFamilies.create` Create a product family **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.productFamilies.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | Yes | — | | `number` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `label` | `string` | No | — | | `number` | `string` | No | — | *** ### delete `productFamilies.delete` Delete a product family. Refused with a conflict if it still has members. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.productFamilies.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `familyId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `productFamilies.get` Get a product family by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.productFamilies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `familyId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `label` | `string` | No | — | | `number` | `string` | No | — | *** ### list `productFamilies.list` List product families, paged **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.productFamilies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > label?: string | null, > number?: string | null > }[] > ``` *** ## Products ### create `products.create` Create a product. unit/vat/family are resolved from an id to their value form before the request is sent. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.products.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `number` | `string` | No | — | | `description` | `string` | No | — | | `type` | `Product \| Service \| Text` | Yes | — | | `unitPrice` | `number` | No | — | | `purchasePrice` | `number` | No | — | | `isUnitPriceTaxIncluded` | `boolean` | No | — | | `defaultQuantity` | `number` | No | — | | `unitId` | `number` | No | — | | `vatId` | `number` | No | — | | `familyId` | `number` | No | — | | `internalId` | `string` | No | — | | `internalNotes` | `string` | No | — | | `active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `number` | `string` | No | — | | `description` | `string` | No | — | | `type` | `string` | No | — | | `unitPrice` | `number` | No | — | | `purchasePrice` | `number` | No | — | | `isUnitPriceTaxIncluded` | `boolean` | No | — | | `defaultQuantity` | `number` | No | — | | `unit` | `object` | No | — | | `vat` | `object` | No | — | | `family` | `object` | No | — | | `imageUrl` | `string` | No | — | | `internalId` | `string` | No | — | | `internalNotes` | `string` | No | — | | `active` | `boolean` | No | — | > **unit full type** > > ```ts theme={null} > { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } > ``` > **vat full type** > > ```ts theme={null} > { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } > ``` > **family full type** > > ```ts theme={null} > { > id?: number | null, > label?: string | null, > number?: string | null > } > ``` *** ### delete `products.delete` Delete a product **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.products.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `productId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### find `products.find` Find a product by number - returns an array **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.products.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `number` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > number?: string | null, > description?: string | null, > type?: string | null, > unitPrice?: number | null, > purchasePrice?: number | null, > isUnitPriceTaxIncluded?: boolean | null, > defaultQuantity?: number | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > active?: boolean | null > }[] > ``` *** ### findByNumberOrId `products.findByNumberOrId` Find a product by number or internalId - same route as products.find, superset of parameters **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.products.findByNumberOrId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `number` | `string` | No | — | | `internalId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > number?: string | null, > description?: string | null, > type?: string | null, > unitPrice?: number | null, > purchasePrice?: number | null, > isUnitPriceTaxIncluded?: boolean | null, > defaultQuantity?: number | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > active?: boolean | null > }[] > ``` *** ### get `products.get` Get a product by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.products.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `productId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `number` | `string` | No | — | | `description` | `string` | No | — | | `type` | `string` | No | — | | `unitPrice` | `number` | No | — | | `purchasePrice` | `number` | No | — | | `isUnitPriceTaxIncluded` | `boolean` | No | — | | `defaultQuantity` | `number` | No | — | | `unit` | `object` | No | — | | `vat` | `object` | No | — | | `family` | `object` | No | — | | `imageUrl` | `string` | No | — | | `internalId` | `string` | No | — | | `internalNotes` | `string` | No | — | | `active` | `boolean` | No | — | > **unit full type** > > ```ts theme={null} > { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } > ``` > **vat full type** > > ```ts theme={null} > { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } > ``` > **family full type** > > ```ts theme={null} > { > id?: number | null, > label?: string | null, > number?: string | null > } > ``` *** ## Purchase Invoices ### download `purchaseInvoices.download` Download a purchase invoice as PDF **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.purchaseInvoices.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `purchaseInvoiceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | No | — | | `body` | `string` | Yes | PDF bytes decoded through response.text() by the shared transport - may not be byte-exact. See the core-limitation note in client.ts. | *** ### upload `purchaseInvoices.upload` Upload a purchase invoice file (PDF or image). There is no delete for this anywhere in the API - only the Altoviz UI can remove it. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.purchaseInvoices.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileBase64` | `string` | Yes | — | | `fileName` | `string` | Yes | — | | `mimeType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `date` | `string` | No | — | | `reference` | `string` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `region` | `string` | No | — | | `status` | `string` | No | — | | `supplier` | `any` | No | — | | `taxIncludedAmount` | `number` | No | — | | `vatReverseCharge` | `boolean` | No | — | | `pdfUrl` | `string` | No | — | *** ## Receipts ### create `receipts.create` Create a receipt. links to a draft document are refused - the document must be finalized first, which is outside this plugin. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.receipts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | — | | `date` | `string` | Yes | — | | `paymentMethod` | `Transfer \| Order \| Check \| Cash \| Card \| Bill \| Usec \| Other` | Yes | — | | `status` | `Success \| Pending \| Failed` | No | — | | `reference` | `string` | No | — | | `notes` | `string` | No | — | | `customerId` | `number` | No | — | | `customerName` | `string` | No | — | | `customerNumber` | `string` | No | — | | `customerInternalId` | `string` | No | — | | `links` | `object[]` | No | — | | `internalId` | `string` | No | — | | `metadata` | `object` | No | — | > **links full type** > > ```ts theme={null} > { > type: Commitment | Invoice | Credit, > id: number > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `amount` | `number` | No | — | | `date` | `string` | No | — | | `paymentMethod` | `string` | No | — | | `status` | `string` | No | — | | `reference` | `string` | No | — | | `notes` | `string` | No | — | | `customerId` | `number` | No | — | | `customerName` | `string` | No | — | | `customerNumber` | `string` | No | — | | `customerInternalId` | `string` | No | — | | `internalId` | `string` | No | — | | `links` | `object[]` | No | — | | `metadata` | `object` | No | — | > **links full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `receipts.delete` Delete a receipt **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.receipts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receiptId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### find `receipts.find` Find receipts by the receipt's own internalId - returns an array **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.receipts.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `internalId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > amount?: number | null, > date?: string | null, > paymentMethod?: string | null, > status?: string | null, > reference?: string | null, > notes?: string | null, > customerId?: number | null, > customerName?: string | null, > customerNumber?: string | null, > customerInternalId?: string | null, > internalId?: string | null, > links?: { > }[] | null, > metadata?: { > } | null > }[] > ``` *** ### get `receipts.get` Get a receipt by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.receipts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receiptId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `amount` | `number` | No | — | | `date` | `string` | No | — | | `paymentMethod` | `string` | No | — | | `status` | `string` | No | — | | `reference` | `string` | No | — | | `notes` | `string` | No | — | | `customerId` | `number` | No | — | | `customerName` | `string` | No | — | | `customerNumber` | `string` | No | — | | `customerInternalId` | `string` | No | — | | `internalId` | `string` | No | — | | `links` | `object[]` | No | — | | `metadata` | `object` | No | — | > **links full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `receipts.list` List receipts, paged **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.receipts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > amount?: number | null, > date?: string | null, > paymentMethod?: string | null, > status?: string | null, > reference?: string | null, > notes?: string | null, > customerId?: number | null, > customerName?: string | null, > customerNumber?: string | null, > customerInternalId?: string | null, > internalId?: string | null, > links?: { > }[] | null, > metadata?: { > } | null > }[] > ``` *** ### update `receipts.update` Update a receipt. Read-modify-write internally; a customer reference is required even on update. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.receipts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receiptId` | `number` | Yes | — | | `amount` | `number` | No | — | | `date` | `string` | No | — | | `paymentMethod` | `Transfer \| Order \| Check \| Cash \| Card \| Bill \| Usec \| Other` | No | — | | `status` | `Success \| Pending \| Failed` | No | — | | `reference` | `string` | No | — | | `notes` | `string` | No | — | | `customerId` | `number` | No | — | | `links` | `object[]` | No | — | > **links full type** > > ```ts theme={null} > { > type: Commitment | Invoice | Credit, > id: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `amount` | `number` | No | — | | `date` | `string` | No | — | | `paymentMethod` | `string` | No | — | | `status` | `string` | No | — | | `reference` | `string` | No | — | | `notes` | `string` | No | — | | `customerId` | `number` | No | — | | `customerName` | `string` | No | — | | `customerNumber` | `string` | No | — | | `customerInternalId` | `string` | No | — | | `internalId` | `string` | No | — | | `links` | `object[]` | No | — | | `metadata` | `object` | No | — | > **links full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Sale Credits ### create `saleCredits.create` Create a draft credit note (avoir) **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.saleCredits.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | | `cancelledInvoicetId` | `number` | No | — | | `cancelledInvoicetNumber` | `string` | No | — | | `date` | `string` | Yes | — | | `subject` | `string` | No | — | | `headerNotes` | `string` | No | — | | `footerNotes` | `string` | No | — | | `lines` | `object[]` | Yes | — | | `globalDiscount` | `object` | No | — | | `vatMode` | `Auto \| Debit \| Collection` | No | — | | `region` | `FR \| EU \| IE \| DOM \| Corse \| Monaco` | No | — | | `isDraft` | `boolean` | No | — | | `internalId` | `string` | No | — | | `metadata` | `object` | No | — | > **lines full type** > > ```ts theme={null} > { > type: Empty | Product | Service | Subtotal | Text | NewPage, > productId?: number, > description?: string, > quantity?: number, > taxExcludedPrice?: number, > unitId?: number, > vatId?: number, > classificationId?: number > }[] > ``` > **globalDiscount full type** > > ```ts theme={null} > { > type: Percent | Fixed, > value: number > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `date` | `string` | No | — | | `subject` | `string` | No | — | | `customerId` | `number` | No | — | | `customerName` | `string` | No | — | | `customerNumber` | `string` | No | — | | `customerType` | `string` | No | — | | `customerElectronicAddress` | `string` | No | — | | `customerOrderReference` | `string` | No | — | | `customerSiret` | `string` | No | — | | `customerVatNumber` | `string` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingContact` | `object` | No | — | | `shippingContact` | `object` | No | — | | `headerNotes` | `string` | No | — | | `footerNotes` | `string` | No | — | | `internalNotes` | `string` | No | — | | `lines` | `object[]` | No | — | | `globalDiscount` | `object` | No | — | | `shippingAmount` | `number` | No | — | | `shippingVat` | `any` | No | — | | `balance` | `number` | No | — | | `grossTaxExcludedAmount` | `number` | No | — | | `taxAmount` | `number` | No | — | | `taxExcludedAmount` | `number` | No | — | | `taxIncludedAmount` | `number` | No | — | | `useTaxIncludedPrices` | `boolean` | No | — | | `liableToVat` | `boolean` | No | — | | `vatMode` | `string` | No | — | | `vatNote` | `string` | No | — | | `vatReverseCharge` | `boolean` | No | — | | `region` | `string` | No | — | | `vats` | `object[]` | No | — | | `metadata` | `object` | No | — | | `pdfUrl` | `string` | No | — | | `publicLink` | `string` | No | — | | `sentAt` | `string` | No | — | | `commitments` | `object[]` | No | — | | `overdue` | `number` | No | — | | `vendorReference` | `string` | No | — | | `isDraft` | `boolean` | No | — | | `isPaid` | `boolean` | No | — | | `isCancelled` | `boolean` | No | — | | `cancelledInvoicetId` | `number` | No | — | | `cancelledInvoicetNumber` | `string` | No | — | | `cancellationInvoiceId` | `number` | No | — | | `cancellationInvoiceNumber` | `string` | No | — | | `replacedBy` | `any` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **billingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **shippingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **lines full type** > > ```ts theme={null} > { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] > ``` > **globalDiscount full type** > > ```ts theme={null} > { > type?: string | null, > value?: number | null > } > ``` > **vats full type** > > ```ts theme={null} > { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **commitments full type** > > ```ts theme={null} > { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] > ``` *** ### delete `saleCredits.delete` Delete a draft sale credit. Drafts only. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.saleCredits.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `creditId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### download `saleCredits.download` Download a sale credit as PDF. May not be byte-exact - see the core text-decoding note. **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleCredits.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `creditId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | No | — | | `body` | `string` | Yes | PDF bytes decoded through response.text() by the shared transport - may not be byte-exact. See the core-limitation note in client.ts. | *** ### find `saleCredits.find` Find sale credits by internalId - returns an array **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleCredits.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `internalId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > internalId?: string | null, > date?: string | null, > subject?: string | null, > customerId?: number | null, > customerName?: string | null, > customerNumber?: string | null, > customerType?: string | null, > customerElectronicAddress?: string | null, > customerOrderReference?: string | null, > customerSiret?: string | null, > customerVatNumber?: string | null, > billingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > shippingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > billingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > shippingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > headerNotes?: string | null, > footerNotes?: string | null, > internalNotes?: string | null, > lines?: { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] | null, > globalDiscount?: { > type?: string | null, > value?: number | null > } | null, > shippingAmount?: number | null, > shippingVat?: any | null, > balance?: number | null, > grossTaxExcludedAmount?: number | null, > taxAmount?: number | null, > taxExcludedAmount?: number | null, > taxIncludedAmount?: number | null, > useTaxIncludedPrices?: boolean | null, > liableToVat?: boolean | null, > vatMode?: string | null, > vatNote?: string | null, > vatReverseCharge?: boolean | null, > region?: string | null, > vats?: { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] | null, > metadata?: { > } | null, > pdfUrl?: string | null, > publicLink?: string | null, > sentAt?: string | null, > commitments?: { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] | null, > overdue?: number | null, > vendorReference?: string | null, > isDraft?: boolean | null, > isPaid?: boolean | null, > isCancelled?: boolean | null, > cancelledInvoicetId?: number | null, > cancelledInvoicetNumber?: string | null, > cancellationInvoiceId?: number | null, > cancellationInvoiceNumber?: string | null, > replacedBy?: any | null > }[] > ``` *** ### get `saleCredits.get` Get a sale credit by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleCredits.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `creditId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `date` | `string` | No | — | | `subject` | `string` | No | — | | `customerId` | `number` | No | — | | `customerName` | `string` | No | — | | `customerNumber` | `string` | No | — | | `customerType` | `string` | No | — | | `customerElectronicAddress` | `string` | No | — | | `customerOrderReference` | `string` | No | — | | `customerSiret` | `string` | No | — | | `customerVatNumber` | `string` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingContact` | `object` | No | — | | `shippingContact` | `object` | No | — | | `headerNotes` | `string` | No | — | | `footerNotes` | `string` | No | — | | `internalNotes` | `string` | No | — | | `lines` | `object[]` | No | — | | `globalDiscount` | `object` | No | — | | `shippingAmount` | `number` | No | — | | `shippingVat` | `any` | No | — | | `balance` | `number` | No | — | | `grossTaxExcludedAmount` | `number` | No | — | | `taxAmount` | `number` | No | — | | `taxExcludedAmount` | `number` | No | — | | `taxIncludedAmount` | `number` | No | — | | `useTaxIncludedPrices` | `boolean` | No | — | | `liableToVat` | `boolean` | No | — | | `vatMode` | `string` | No | — | | `vatNote` | `string` | No | — | | `vatReverseCharge` | `boolean` | No | — | | `region` | `string` | No | — | | `vats` | `object[]` | No | — | | `metadata` | `object` | No | — | | `pdfUrl` | `string` | No | — | | `publicLink` | `string` | No | — | | `sentAt` | `string` | No | — | | `commitments` | `object[]` | No | — | | `overdue` | `number` | No | — | | `vendorReference` | `string` | No | — | | `isDraft` | `boolean` | No | — | | `isPaid` | `boolean` | No | — | | `isCancelled` | `boolean` | No | — | | `cancelledInvoicetId` | `number` | No | — | | `cancelledInvoicetNumber` | `string` | No | — | | `cancellationInvoiceId` | `number` | No | — | | `cancellationInvoiceNumber` | `string` | No | — | | `replacedBy` | `any` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **billingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **shippingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **lines full type** > > ```ts theme={null} > { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] > ``` > **globalDiscount full type** > > ```ts theme={null} > { > type?: string | null, > value?: number | null > } > ``` > **vats full type** > > ```ts theme={null} > { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **commitments full type** > > ```ts theme={null} > { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] > ``` *** ### list `saleCredits.list` List sale credits, paged, filterable by date range and customer **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleCredits.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `customerId` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > internalId?: string | null, > date?: string | null, > subject?: string | null, > customerId?: number | null, > customerName?: string | null, > customerNumber?: string | null, > customerType?: string | null, > customerElectronicAddress?: string | null, > customerOrderReference?: string | null, > customerSiret?: string | null, > customerVatNumber?: string | null, > billingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > shippingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > billingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > shippingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > headerNotes?: string | null, > footerNotes?: string | null, > internalNotes?: string | null, > lines?: { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] | null, > globalDiscount?: { > type?: string | null, > value?: number | null > } | null, > shippingAmount?: number | null, > shippingVat?: any | null, > balance?: number | null, > grossTaxExcludedAmount?: number | null, > taxAmount?: number | null, > taxExcludedAmount?: number | null, > taxIncludedAmount?: number | null, > useTaxIncludedPrices?: boolean | null, > liableToVat?: boolean | null, > vatMode?: string | null, > vatNote?: string | null, > vatReverseCharge?: boolean | null, > region?: string | null, > vats?: { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] | null, > metadata?: { > } | null, > pdfUrl?: string | null, > publicLink?: string | null, > sentAt?: string | null, > commitments?: { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] | null, > overdue?: number | null, > vendorReference?: string | null, > isDraft?: boolean | null, > isPaid?: boolean | null, > isCancelled?: boolean | null, > cancelledInvoicetId?: number | null, > cancelledInvoicetNumber?: string | null, > cancellationInvoiceId?: number | null, > cancellationInvoiceNumber?: string | null, > replacedBy?: any | null > }[] > ``` *** ### update `saleCredits.update` Update a draft credit note. Drafts only; lines must be resent in full or the credit is emptied. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.saleCredits.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `creditId` | `number` | Yes | — | | `customerId` | `number` | No | — | | `date` | `string` | No | — | | `subject` | `string` | No | — | | `headerNotes` | `string` | No | — | | `footerNotes` | `string` | No | — | | `lines` | `object[]` | Yes | — | | `isDraft` | `boolean` | No | — | > **lines full type** > > ```ts theme={null} > { > type: Empty | Product | Service | Subtotal | Text | NewPage, > productId?: number, > description?: string, > quantity?: number, > taxExcludedPrice?: number, > unitId?: number, > vatId?: number, > classificationId?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `date` | `string` | No | — | | `subject` | `string` | No | — | | `customerId` | `number` | No | — | | `customerName` | `string` | No | — | | `customerNumber` | `string` | No | — | | `customerType` | `string` | No | — | | `customerElectronicAddress` | `string` | No | — | | `customerOrderReference` | `string` | No | — | | `customerSiret` | `string` | No | — | | `customerVatNumber` | `string` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingContact` | `object` | No | — | | `shippingContact` | `object` | No | — | | `headerNotes` | `string` | No | — | | `footerNotes` | `string` | No | — | | `internalNotes` | `string` | No | — | | `lines` | `object[]` | No | — | | `globalDiscount` | `object` | No | — | | `shippingAmount` | `number` | No | — | | `shippingVat` | `any` | No | — | | `balance` | `number` | No | — | | `grossTaxExcludedAmount` | `number` | No | — | | `taxAmount` | `number` | No | — | | `taxExcludedAmount` | `number` | No | — | | `taxIncludedAmount` | `number` | No | — | | `useTaxIncludedPrices` | `boolean` | No | — | | `liableToVat` | `boolean` | No | — | | `vatMode` | `string` | No | — | | `vatNote` | `string` | No | — | | `vatReverseCharge` | `boolean` | No | — | | `region` | `string` | No | — | | `vats` | `object[]` | No | — | | `metadata` | `object` | No | — | | `pdfUrl` | `string` | No | — | | `publicLink` | `string` | No | — | | `sentAt` | `string` | No | — | | `commitments` | `object[]` | No | — | | `overdue` | `number` | No | — | | `vendorReference` | `string` | No | — | | `isDraft` | `boolean` | No | — | | `isPaid` | `boolean` | No | — | | `isCancelled` | `boolean` | No | — | | `cancelledInvoicetId` | `number` | No | — | | `cancelledInvoicetNumber` | `string` | No | — | | `cancellationInvoiceId` | `number` | No | — | | `cancellationInvoiceNumber` | `string` | No | — | | `replacedBy` | `any` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **billingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **shippingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **lines full type** > > ```ts theme={null} > { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] > ``` > **globalDiscount full type** > > ```ts theme={null} > { > type?: string | null, > value?: number | null > } > ``` > **vats full type** > > ```ts theme={null} > { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **commitments full type** > > ```ts theme={null} > { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] > ``` *** ## Sale Invoices ### create `saleInvoices.create` Create a draft sale invoice. Lines use taxExcludedPrice, never unitPrice - unitPrice is silently ignored and prices the line at zero. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.saleInvoices.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `number` | Yes | — | | `date` | `string` | Yes | — | | `subject` | `string` | No | — | | `headerNotes` | `string` | No | — | | `footerNotes` | `string` | No | — | | `lines` | `object[]` | Yes | — | | `globalDiscount` | `object` | No | — | | `shippingAmount` | `number` | No | — | | `vatMode` | `Auto \| Debit \| Collection` | No | — | | `region` | `FR \| EU \| IE \| DOM \| Corse \| Monaco` | No | — | | `liableToVat` | `boolean` | No | — | | `vatReverseCharge` | `boolean` | No | — | | `useTaxIncludedPrices` | `boolean` | No | — | | `isDraft` | `boolean` | No | — | | `internalId` | `string` | No | — | | `metadata` | `object` | No | — | > **lines full type** > > ```ts theme={null} > { > type: Empty | Product | Service | Subtotal | Text | NewPage, > productId?: number, > description?: string, > quantity?: number, > taxExcludedPrice?: number, > unitId?: number, > vatId?: number, > classificationId?: number > }[] > ``` > **globalDiscount full type** > > ```ts theme={null} > { > type: Percent | Fixed, > value: number > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `date` | `string` | No | — | | `subject` | `string` | No | — | | `customerId` | `number` | No | — | | `customerName` | `string` | No | — | | `customerNumber` | `string` | No | — | | `customerType` | `string` | No | — | | `customerElectronicAddress` | `string` | No | — | | `customerOrderReference` | `string` | No | — | | `customerSiret` | `string` | No | — | | `customerVatNumber` | `string` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingContact` | `object` | No | — | | `shippingContact` | `object` | No | — | | `headerNotes` | `string` | No | — | | `footerNotes` | `string` | No | — | | `internalNotes` | `string` | No | — | | `lines` | `object[]` | No | — | | `globalDiscount` | `object` | No | — | | `shippingAmount` | `number` | No | — | | `shippingVat` | `any` | No | — | | `balance` | `number` | No | — | | `grossTaxExcludedAmount` | `number` | No | — | | `taxAmount` | `number` | No | — | | `taxExcludedAmount` | `number` | No | — | | `taxIncludedAmount` | `number` | No | — | | `useTaxIncludedPrices` | `boolean` | No | — | | `liableToVat` | `boolean` | No | — | | `vatMode` | `string` | No | — | | `vatNote` | `string` | No | — | | `vatReverseCharge` | `boolean` | No | — | | `region` | `string` | No | — | | `vats` | `object[]` | No | — | | `metadata` | `object` | No | — | | `pdfUrl` | `string` | No | — | | `publicLink` | `string` | No | — | | `sentAt` | `string` | No | — | | `commitments` | `object[]` | No | — | | `overdue` | `number` | No | — | | `vendorReference` | `string` | No | — | | `isDraft` | `boolean` | No | — | | `isPaid` | `boolean` | No | — | | `isCancelled` | `boolean` | No | — | | `isProforma` | `boolean` | No | — | | `cancellationCreditId` | `number` | No | — | | `cancellationCreditNumber` | `string` | No | — | | `cancelledCreditId` | `any` | No | — | | `cancelledCreditNumber` | `any` | No | — | | `eInvoicingInvoiceId` | `any` | No | — | | `eInvoicingProviderId` | `any` | No | — | | `eInvoicingStatus` | `any` | No | — | | `replacedBy` | `number` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **billingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **shippingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **lines full type** > > ```ts theme={null} > { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] > ``` > **globalDiscount full type** > > ```ts theme={null} > { > type?: string | null, > value?: number | null > } > ``` > **vats full type** > > ```ts theme={null} > { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **commitments full type** > > ```ts theme={null} > { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] > ``` *** ### delete `saleInvoices.delete` Delete a draft sale invoice. Drafts only. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.saleInvoices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoiceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### download `saleInvoices.download` Download a sale invoice as PDF. May not be byte-exact - see the core text-decoding note. **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleInvoices.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoiceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | No | — | | `body` | `string` | Yes | PDF bytes decoded through response.text() by the shared transport - may not be byte-exact. See the core-limitation note in client.ts. | *** ### find `saleInvoices.find` Find sale invoices by internalId - returns an array **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleInvoices.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `internalId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > internalId?: string | null, > date?: string | null, > subject?: string | null, > customerId?: number | null, > customerName?: string | null, > customerNumber?: string | null, > customerType?: string | null, > customerElectronicAddress?: string | null, > customerOrderReference?: string | null, > customerSiret?: string | null, > customerVatNumber?: string | null, > billingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > shippingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > billingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > shippingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > headerNotes?: string | null, > footerNotes?: string | null, > internalNotes?: string | null, > lines?: { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] | null, > globalDiscount?: { > type?: string | null, > value?: number | null > } | null, > shippingAmount?: number | null, > shippingVat?: any | null, > balance?: number | null, > grossTaxExcludedAmount?: number | null, > taxAmount?: number | null, > taxExcludedAmount?: number | null, > taxIncludedAmount?: number | null, > useTaxIncludedPrices?: boolean | null, > liableToVat?: boolean | null, > vatMode?: string | null, > vatNote?: string | null, > vatReverseCharge?: boolean | null, > region?: string | null, > vats?: { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] | null, > metadata?: { > } | null, > pdfUrl?: string | null, > publicLink?: string | null, > sentAt?: string | null, > commitments?: { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] | null, > overdue?: number | null, > vendorReference?: string | null, > isDraft?: boolean | null, > isPaid?: boolean | null, > isCancelled?: boolean | null, > isProforma?: boolean | null, > cancellationCreditId?: number | null, > cancellationCreditNumber?: string | null, > cancelledCreditId?: any | null, > cancelledCreditNumber?: any | null, > eInvoicingInvoiceId?: any | null, > eInvoicingProviderId?: any | null, > eInvoicingStatus?: any | null, > replacedBy?: number | null > }[] > ``` *** ### get `saleInvoices.get` Get a sale invoice by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleInvoices.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoiceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `date` | `string` | No | — | | `subject` | `string` | No | — | | `customerId` | `number` | No | — | | `customerName` | `string` | No | — | | `customerNumber` | `string` | No | — | | `customerType` | `string` | No | — | | `customerElectronicAddress` | `string` | No | — | | `customerOrderReference` | `string` | No | — | | `customerSiret` | `string` | No | — | | `customerVatNumber` | `string` | No | — | | `billingAddress` | `object` | No | — | | `shippingAddress` | `object` | No | — | | `billingContact` | `object` | No | — | | `shippingContact` | `object` | No | — | | `headerNotes` | `string` | No | — | | `footerNotes` | `string` | No | — | | `internalNotes` | `string` | No | — | | `lines` | `object[]` | No | — | | `globalDiscount` | `object` | No | — | | `shippingAmount` | `number` | No | — | | `shippingVat` | `any` | No | — | | `balance` | `number` | No | — | | `grossTaxExcludedAmount` | `number` | No | — | | `taxAmount` | `number` | No | — | | `taxExcludedAmount` | `number` | No | — | | `taxIncludedAmount` | `number` | No | — | | `useTaxIncludedPrices` | `boolean` | No | — | | `liableToVat` | `boolean` | No | — | | `vatMode` | `string` | No | — | | `vatNote` | `string` | No | — | | `vatReverseCharge` | `boolean` | No | — | | `region` | `string` | No | — | | `vats` | `object[]` | No | — | | `metadata` | `object` | No | — | | `pdfUrl` | `string` | No | — | | `publicLink` | `string` | No | — | | `sentAt` | `string` | No | — | | `commitments` | `object[]` | No | — | | `overdue` | `number` | No | — | | `vendorReference` | `string` | No | — | | `isDraft` | `boolean` | No | — | | `isPaid` | `boolean` | No | — | | `isCancelled` | `boolean` | No | — | | `isProforma` | `boolean` | No | — | | `cancellationCreditId` | `number` | No | — | | `cancellationCreditNumber` | `string` | No | — | | `cancelledCreditId` | `any` | No | — | | `cancelledCreditNumber` | `any` | No | — | | `eInvoicingInvoiceId` | `any` | No | — | | `eInvoicingProviderId` | `any` | No | — | | `eInvoicingStatus` | `any` | No | — | | `replacedBy` | `number` | No | — | > **billingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **shippingAddress full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **billingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **shippingContact full type** > > ```ts theme={null} > { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } > ``` > **lines full type** > > ```ts theme={null} > { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] > ``` > **globalDiscount full type** > > ```ts theme={null} > { > type?: string | null, > value?: number | null > } > ``` > **vats full type** > > ```ts theme={null} > { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **commitments full type** > > ```ts theme={null} > { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] > ``` *** ### list `saleInvoices.list` List sale invoices, paged, filterable by date range, customer and status **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleInvoices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `customerId` | `number` | No | — | | `status` | `Draft \| Incoming \| Expired \| Paid \| ToSend` | No | — | | `includeCancelled` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > internalId?: string | null, > date?: string | null, > subject?: string | null, > customerId?: number | null, > customerName?: string | null, > customerNumber?: string | null, > customerType?: string | null, > customerElectronicAddress?: string | null, > customerOrderReference?: string | null, > customerSiret?: string | null, > customerVatNumber?: string | null, > billingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > shippingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > billingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > shippingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > headerNotes?: string | null, > footerNotes?: string | null, > internalNotes?: string | null, > lines?: { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] | null, > globalDiscount?: { > type?: string | null, > value?: number | null > } | null, > shippingAmount?: number | null, > shippingVat?: any | null, > balance?: number | null, > grossTaxExcludedAmount?: number | null, > taxAmount?: number | null, > taxExcludedAmount?: number | null, > taxIncludedAmount?: number | null, > useTaxIncludedPrices?: boolean | null, > liableToVat?: boolean | null, > vatMode?: string | null, > vatNote?: string | null, > vatReverseCharge?: boolean | null, > region?: string | null, > vats?: { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] | null, > metadata?: { > } | null, > pdfUrl?: string | null, > publicLink?: string | null, > sentAt?: string | null, > commitments?: { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] | null, > overdue?: number | null, > vendorReference?: string | null, > isDraft?: boolean | null, > isPaid?: boolean | null, > isCancelled?: boolean | null, > isProforma?: boolean | null, > cancellationCreditId?: number | null, > cancellationCreditNumber?: string | null, > cancelledCreditId?: any | null, > cancelledCreditNumber?: any | null, > eInvoicingInvoiceId?: any | null, > eInvoicingProviderId?: any | null, > eInvoicingStatus?: any | null, > replacedBy?: number | null > }[] > ``` *** ## Sale Quotes ### delete `saleQuotes.delete` Delete a sale quote. Deleting a quote that does not exist also returns 200. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.saleQuotes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `quoteId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### find `saleQuotes.find` Find sale quotes by internalId - returns an array **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleQuotes.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `internalId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > internalId?: string | null, > date?: string | null, > subject?: string | null, > customerId?: number | null, > customerName?: string | null, > customerNumber?: string | null, > customerType?: string | null, > customerElectronicAddress?: string | null, > customerOrderReference?: string | null, > customerSiret?: string | null, > customerVatNumber?: string | null, > billingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > shippingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > billingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > shippingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > headerNotes?: string | null, > footerNotes?: string | null, > internalNotes?: string | null, > lines?: { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] | null, > globalDiscount?: { > type?: string | null, > value?: number | null > } | null, > shippingAmount?: number | null, > shippingVat?: any | null, > balance?: number | null, > grossTaxExcludedAmount?: number | null, > taxAmount?: number | null, > taxExcludedAmount?: number | null, > taxIncludedAmount?: number | null, > useTaxIncludedPrices?: boolean | null, > liableToVat?: boolean | null, > vatMode?: string | null, > vatNote?: string | null, > vatReverseCharge?: boolean | null, > region?: string | null, > vats?: { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] | null, > metadata?: { > } | null, > pdfUrl?: string | null, > publicLink?: string | null, > sentAt?: string | null, > commitments?: { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] | null, > overdue?: number | null, > vendorReference?: string | null, > status?: string | null, > validityDate?: string | null, > deposit?: { > type?: string | null, > value?: number | null > } | null, > acceptedAt?: string | null, > refusedAt?: string | null > }[] > ``` *** ### list `saleQuotes.list` List sale quotes, paged, filterable by date range and customer. No working status filter - the spec one is a generator artefact. **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.saleQuotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `customerId` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > internalId?: string | null, > date?: string | null, > subject?: string | null, > customerId?: number | null, > customerName?: string | null, > customerNumber?: string | null, > customerType?: string | null, > customerElectronicAddress?: string | null, > customerOrderReference?: string | null, > customerSiret?: string | null, > customerVatNumber?: string | null, > billingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > shippingAddress?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > billingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > shippingContact?: { > cellPhone?: string | null, > companyName?: string | null, > displayName?: string | null, > email?: string | null, > firstName?: string | null, > function?: string | null, > invertedDisplayName?: string | null, > lastName?: string | null, > phone?: string | null, > service?: string | null, > title?: string | null > } | null, > headerNotes?: string | null, > footerNotes?: string | null, > internalNotes?: string | null, > lines?: { > classificationId?: number | null, > date?: string | null, > description?: string | null, > discount?: { > type?: string | null, > value?: number | null > } | null, > id?: number | null, > marginAmount?: number | null, > marginRate?: number | null, > product?: { > active?: boolean | null, > defaultQuantity?: number | null, > description?: string | null, > family?: { > id?: number | null, > label?: string | null, > number?: string | null > } | null, > id?: number | null, > imageUrl?: string | null, > internalId?: string | null, > internalNotes?: string | null, > isUnitPriceTaxIncluded?: boolean | null, > name?: string | null, > number?: string | null, > purchasePrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > unitPrice?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > } | null, > productId?: number | null, > productInternalId?: string | null, > productNumber?: string | null, > purchasePrice?: number | null, > quantity?: number | null, > taxExcludedAmount?: number | null, > taxExcludedPrice?: number | null, > taxIncludedAmount?: number | null, > taxIncludedPrice?: number | null, > type?: string | null, > unit?: { > code?: string | null, > conversion?: number | null, > decimals?: number | null, > id?: number | null, > name?: string | null, > type?: string | null > } | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null > }[] | null, > globalDiscount?: { > type?: string | null, > value?: number | null > } | null, > shippingAmount?: number | null, > shippingVat?: any | null, > balance?: number | null, > grossTaxExcludedAmount?: number | null, > taxAmount?: number | null, > taxExcludedAmount?: number | null, > taxIncludedAmount?: number | null, > useTaxIncludedPrices?: boolean | null, > liableToVat?: boolean | null, > vatMode?: string | null, > vatNote?: string | null, > vatReverseCharge?: boolean | null, > region?: string | null, > vats?: { > taxExcludedAmount?: number | null, > vat?: { > default?: boolean | null, > id?: number | null, > label?: string | null, > rate?: number | null, > region?: string | null > } | null, > vatAmount?: number | null > }[] | null, > metadata?: { > } | null, > pdfUrl?: string | null, > publicLink?: string | null, > sentAt?: string | null, > commitments?: { > amount?: number | null, > date?: string | null, > dueAmount?: number | null, > id?: number | null, > thirdId?: number | null > }[] | null, > overdue?: number | null, > vendorReference?: string | null, > status?: string | null, > validityDate?: string | null, > deposit?: { > type?: string | null, > value?: number | null > } | null, > acceptedAt?: string | null, > refusedAt?: string | null > }[] > ``` *** ## Suppliers ### delete `suppliers.delete` Delete a supplier. Evicts the auto-created contact from the mirror if one is cached. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.suppliers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `supplierId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `suppliers.get` Get a supplier by id **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.suppliers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `supplierId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `internalNotes` | `string` | No | — | | `active` | `boolean` | No | — | | `address` | `object` | No | — | | `defaultPaymentMethod` | `string` | No | — | | `companyInformations` | `object` | No | — | | `createdAt` | `string` | No | — | | `createdById` | `string` | No | — | | `updatedAt` | `string` | No | — | | `updatedById` | `string` | No | — | > **address full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **companyInformations full type** > > ```ts theme={null} > { > } > ``` *** ### getContacts `suppliers.getContacts` List a supplier's contacts **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.suppliers.getContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `supplierId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > displayName?: string | null, > invertedDisplayName?: string | null, > firstName?: string | null, > lastName?: string | null, > companyName?: string | null, > email?: string | null, > phone?: string | null, > cellPhone?: string | null, > function?: string | null, > service?: string | null, > title?: string | null, > internalId?: string | null, > isMain?: boolean | null > }[] > ``` *** ### list `suppliers.list` List suppliers, paged **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.suppliers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageIndex` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `orderBy` | `string` | No | — | | `query` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > firstName?: string | null, > lastName?: string | null, > email?: string | null, > phone?: string | null, > cellPhone?: string | null, > title?: string | null, > number?: string | null, > internalId?: string | null, > internalNotes?: string | null, > active?: boolean | null, > address?: { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } | null, > defaultPaymentMethod?: string | null, > companyInformations?: { > } | null, > createdAt?: string | null, > createdById?: string | null, > updatedAt?: string | null, > updatedById?: string | null > }[] > ``` *** ### update `suppliers.update` Update a supplier. Read-modify-write internally, same clearing-PUT behaviour as customers. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.suppliers.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `supplierId` | `number` | Yes | — | | `name` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `address` | `object` | No | — | | `defaultPaymentMethod` | `string` | No | — | | `internalNotes` | `string` | No | — | > **address full type** > > ```ts theme={null} > { > line1?: string, > line2?: string, > zipCode?: string, > city?: string, > countryCode?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `cellPhone` | `string` | No | — | | `title` | `string` | No | — | | `number` | `string` | No | — | | `internalId` | `string` | No | — | | `internalNotes` | `string` | No | — | | `active` | `boolean` | No | — | | `address` | `object` | No | — | | `defaultPaymentMethod` | `string` | No | — | | `companyInformations` | `object` | No | — | | `createdAt` | `string` | No | — | | `createdById` | `string` | No | — | | `updatedAt` | `string` | No | — | | `updatedById` | `string` | No | — | > **address full type** > > ```ts theme={null} > { > city?: string | null, > countryIso?: string | null, > countryName?: string | null, > formattedAddress?: string | null, > inlineAddress?: string | null, > street?: string | null, > zipcode?: string | null > } > ``` > **companyInformations full type** > > ```ts theme={null} > { > } > ``` *** ## Webhook Subscriptions ### list `webhookSubscriptions.list` List registered webhook subscriptions **Risk:** `read` ```ts theme={null} await corsair.altoviz.api.webhookSubscriptions.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > url?: string | null, > types?: string[] | null, > secretKey?: string | null > }[] > ``` *** ### register `webhookSubscriptions.register` Register a webhook subscription. The response id is 0 - list immediately after to get the real id. **Risk:** `write` ```ts theme={null} await corsair.altoviz.api.webhookSubscriptions.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | | `types` | `CustomerCreated \| CustomerUpdated \| CustomerDeleted \| ContactCreated \| ContactUpdated \| ContactDeleted \| ProductCreated \| ProductUpdated \| ProductDeleted \| InvoiceCreated \| InvoiceUpdated \| InvoiceDeleted \| QuoteCreated \| QuoteUpdated \| QuoteDeleted[]` | Yes | — | | `secretKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `types` | `string[]` | No | — | | `secretKey` | `string` | No | — | *** ### unregister `webhookSubscriptions.unregister` Unregister a webhook subscription by id or url. Exactly one of the two is required. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.altoviz.api.webhookSubscriptions.unregister({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `number` | No | — | | `url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | No | — | | `url` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/altoviz/database Altoviz local sync: searchable entities, `.search()` filters, and operators. The Altoviz plugin syncs data locally. Use `corsair.altoviz.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Classifications Path: `altoviz.db.classifications.search` ```ts theme={null} const rows = await corsair.altoviz.db.classifications.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `accountNumber` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `isProduct` | `boolean` | equals | | `isService` | `boolean` | equals | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `microBusinessDeclarationType` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `altoviz.db.contacts.search` ```ts theme={null} const rows = await corsair.altoviz.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `cellPhone` | `string` | equals, contains, startsWith, endsWith, in | | `companyName` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `function` | `string` | equals, contains, startsWith, endsWith, in | | `internalId` | `string` | equals, contains, startsWith, endsWith, in | | `invertedDisplayName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `service` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Customer Families Path: `altoviz.db.customerFamilies.search` ```ts theme={null} const rows = await corsair.altoviz.db.customerFamilies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `internalId` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Customers Path: `altoviz.db.customers.search` ```ts theme={null} const rows = await corsair.altoviz.db.customers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `active` | `boolean` | equals | | `cellPhone` | `string` | equals, contains, startsWith, endsWith, in | | `companyName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `internalId` | `string` | equals, contains, startsWith, endsWith, in | | `internalNotes` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Product Families Path: `altoviz.db.productFamilies.search` ```ts theme={null} const rows = await corsair.altoviz.db.productFamilies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Products Path: `altoviz.db.products.search` ```ts theme={null} const rows = await corsair.altoviz.db.products.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `active` | `boolean` | equals | | `defaultQuantity` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `imageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `internalId` | `string` | equals, contains, startsWith, endsWith, in | | `internalNotes` | `string` | equals, contains, startsWith, endsWith, in | | `isUnitPriceTaxIncluded` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `purchasePrice` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `unitPrice` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Units Path: `altoviz.db.units.search` ```ts theme={null} const rows = await corsair.altoviz.db.units.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `conversion` | `number` | equals, gt, gte, lt, lte, in | | `decimals` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Vats Path: `altoviz.db.vats.search` ```ts theme={null} const rows = await corsair.altoviz.db.vats.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `default` | `boolean` | equals | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `rate` | `number` | equals, gt, gte, lt, lte, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/altoviz/overview Online invoicing and billing software for small businesses and freelancers. Use **Altoviz** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 67 typed API operations * 8 synced entities (`classifications`, `contacts`, `customerFamilies`, `customers`, `productFamilies`, `products`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/altoviz ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/altoviz ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/altoviz ``` ```bash bun theme={null} bun add corsair @corsair-dev/altoviz ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { altoviz } from '@corsair-dev/altoviz'; export const corsair = createCorsair({ plugins: [ altoviz(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} altoviz() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'altoviz', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getClassifications`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.altoviz.api.account.getClassifications({}); ``` **`colleagues.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.altoviz.api.colleagues.delete({}); ``` See the full list on the [API](/plugins/altoviz/api) page. ## Query synced data Synced entities support `tenant.altoviz.db..search()` and `.list()`: `classifications`, `contacts`, `customerFamilies`, `customers`, `productFamilies`, `products`, `units`, `vats`. See [Database](/plugins/altoviz/database) for filters and operators. ## What's next > **[API reference](/plugins/altoviz/api)** > > Every `altoviz.api.*` operation with input and output types. > **[Database](/plugins/altoviz/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/alttextai/api API reference for AltText.ai: every `alttextai.api.*` operation with input and output types. Every `alttextai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get AltText.ai account settings and usage **Risk:** `read` ```ts theme={null} await corsair.alttextai.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `webhook_url` | `string` | No | — | | `notification_email` | `string` | No | — | | `usage` | `number` | No | — | | `usage_limit` | `number` | No | — | | `whitelabel` | `boolean` | No | — | | `default_lang` | `string` | No | — | | `ending_period` | `boolean` | No | — | | `no_quotes` | `boolean` | No | — | | `remove_symbols` | `string[]` | No | — | | `gpt_prompt` | `string` | No | — | | `max_chars` | `number` | No | — | | `subscription` | `object` | No | — | | `errors` | `object` | No | — | > **subscription full type** > > ```ts theme={null} > { > plan_name?: string, > usage_quota?: number, > status?: string, > expires_at?: string > } > ``` > **errors full type** > > ```ts theme={null} > { > } > ``` *** ### update `account.update` Update AltText.ai account settings **Risk:** `write` ```ts theme={null} await corsair.alttextai.api.account.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | Yes | — | > **account full type** > > ```ts theme={null} > { > name?: string, > webhook_url?: string, > notification_email?: string, > max_chars?: number, > gpt_prompt?: string | null, > remove_symbols?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `webhook_url` | `string` | No | — | | `notification_email` | `string` | No | — | | `usage` | `number` | No | — | | `usage_limit` | `number` | No | — | | `whitelabel` | `boolean` | No | — | | `default_lang` | `string` | No | — | | `ending_period` | `boolean` | No | — | | `no_quotes` | `boolean` | No | — | | `remove_symbols` | `string[]` | No | — | | `gpt_prompt` | `string` | No | — | | `max_chars` | `number` | No | — | | `subscription` | `object` | No | — | | `errors` | `object` | No | — | > **subscription full type** > > ```ts theme={null} > { > plan_name?: string, > usage_quota?: number, > status?: string, > expires_at?: string > } > ``` > **errors full type** > > ```ts theme={null} > { > } > ``` *** ## Images ### bulkCreate `images.bulkCreate` Upload a CSV of image URLs for batch alt text generation **Risk:** `write` ```ts theme={null} await corsair.alttextai.api.images.bulkCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom` | Yes | CSV file with image URLs to process | | `email` | `string` | No | Optional email for bulk upload results | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `rows` | `number` | No | — | | `row_errors` | `tuple[]` | No | — | | `error` | `string` | No | — | *** ### create `images.create` Add an image and generate AI alt text from URL or base64 data **Risk:** `write` ```ts theme={null} await corsair.alttextai.api.images.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image` | `object` | Yes | — | | `async` | `boolean` | No | — | | `lang` | `string` | No | — | | `max_chars` | `number` | No | — | | `model_name` | `describe-detailed \| describe-regular \| describe-factual \| succinct-describe-factual \| describe-terse` | No | — | | `keywords` | `string[]` | No | — | | `negative_keywords` | `string[]` | No | — | | `keyword_source` | `string` | No | — | | `gpt_prompt` | `string` | No | — | | `overwrite` | `boolean` | No | — | | `timeout_secs` | `number` | No | — | | `webhook_url` | `string` | No | — | | `ecomm` | `object` | No | — | > **image full type** > > ```ts theme={null} > { > url?: string, > raw?: string, > asset_id?: string, > metadata?: { > } > } > ``` > **ecomm full type** > > ```ts theme={null} > { > product?: string, > brand?: string, > color?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | No | — | | `url` | `string` | No | — | | `alt_text` | `string` | No | — | | `alt_texts` | `object` | No | — | | `tags` | `string[]` | No | — | | `metadata` | `object` | No | — | | `created_at` | `number` | No | — | | `credits_used` | `number` | No | — | | `errors` | `object` | No | — | | `error_code` | `string` | No | — | > **alt\_texts full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **errors full type** > > ```ts theme={null} > { > } > ``` *** ### delete `images.delete` Delete an image from the AltText.ai library **Risk:** `destructive` ```ts theme={null} await corsair.alttextai.api.images.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | Yes | Asset ID of the image to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | No | — | | `url` | `string` | No | — | | `alt_text` | `string` | No | — | | `alt_texts` | `object` | No | — | | `tags` | `string[]` | No | — | | `metadata` | `object` | No | — | | `created_at` | `number` | No | — | | `credits_used` | `number` | No | — | | `errors` | `object` | No | — | | `error_code` | `string` | No | — | > **alt\_texts full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **errors full type** > > ```ts theme={null} > { > } > ``` *** ### get `images.get` Retrieve image metadata and alt text by asset ID **Risk:** `read` ```ts theme={null} await corsair.alttextai.api.images.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | Yes | Asset ID of the image | **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | No | — | | `url` | `string` | No | — | | `alt_text` | `string` | No | — | | `alt_texts` | `object` | No | — | | `tags` | `string[]` | No | — | | `metadata` | `object` | No | — | | `created_at` | `number` | No | — | | `credits_used` | `number` | No | — | | `errors` | `object` | No | — | | `error_code` | `string` | No | — | > **alt\_texts full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **errors full type** > > ```ts theme={null} > { > } > ``` *** ### list `images.list` List images in the AltText.ai library with pagination **Risk:** `read` ```ts theme={null} await corsair.alttextai.api.images.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | | `limit` | `number` | No | Results per page (max 100) | | `url` | `string` | No | Exact image URL filter (no wildcards) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `images` | `object[]` | Yes | — | > **images full type** > > ```ts theme={null} > { > asset_id?: string, > url?: string, > alt_text?: string | null, > alt_texts?: { > }, > tags?: string[], > metadata?: { > }, > created_at?: number, > credits_used?: number, > errors?: { > }, > error_code?: string | null > }[] > ``` *** ### pageScrape `images.pageScrape` Scrape a web page and queue alt text for all images found **Risk:** `write` ```ts theme={null} await corsair.alttextai.api.images.pageScrape({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_scrape` | `object` | Yes | — | | `keywords` | `string[]` | No | — | | `negative_keywords` | `string[]` | No | — | | `lang` | `string` | No | — | | `include_existing` | `boolean` | No | — | > **page\_scrape full type** > > ```ts theme={null} > { > url?: string, > html?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `total_processed` | `number` | No | — | | `errors` | `any` | No | — | | `scraped_images` | `object[]` | No | — | > **scraped\_images full type** > > ```ts theme={null} > { > src?: string, > alt?: string | null, > width?: number | null, > height?: number | null, > skip_reason?: string | null > }[] > ``` *** ### search `images.search` Search images by alt text, asset ID, or URL substring **Risk:** `read` ```ts theme={null} await corsair.alttextai.api.images.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Search query (alt text, asset ID, or URL substring) | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `images` | `object[]` | Yes | — | > **images full type** > > ```ts theme={null} > { > asset_id?: string, > url?: string, > alt_text?: string | null, > alt_texts?: { > }, > tags?: string[], > metadata?: { > }, > created_at?: number, > credits_used?: number, > errors?: { > }, > error_code?: string | null > }[] > ``` *** ### update `images.update` Update alt text or metadata for an existing image **Risk:** `write` ```ts theme={null} await corsair.alttextai.api.images.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | Yes | Asset ID of the image to update | | `lang` | `string` | No | Language code(s), comma-separated | | `overwrite` | `boolean` | No | — | | `image` | `object` | Yes | — | > **image full type** > > ```ts theme={null} > { > alt_text?: string, > asset_id?: string, > metadata?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | No | — | | `url` | `string` | No | — | | `alt_text` | `string` | No | — | | `alt_texts` | `object` | No | — | | `tags` | `string[]` | No | — | | `metadata` | `object` | No | — | | `created_at` | `number` | No | — | | `credits_used` | `number` | No | — | | `errors` | `object` | No | — | | `error_code` | `string` | No | — | > **alt\_texts full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **errors full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/alttextai/database AltText.ai local sync: searchable entities, `.search()` filters, and operators. The AltText.ai plugin syncs data locally. Use `corsair.alttextai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Images Path: `alttextai.db.images.search` ```ts theme={null} const rows = await corsair.alttextai.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `assetId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `altText` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `creditsUsed` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/alttextai/overview AI service that generates accessible alt text descriptions for images automatically. Use **AltText.ai** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 10 typed API operations * 1 synced entity (`images`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/alttextai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/alttextai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/alttextai ``` ```bash bun theme={null} bun add corsair @corsair-dev/alttextai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { alttextai } from '@corsair-dev/alttextai'; export const corsair = createCorsair({ plugins: [ alttextai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} alttextai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'alttextai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.alttextai.api.account.get({}); ``` **`account.update`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.alttextai.api.account.update({}); ``` See the full list on the [API](/plugins/alttextai/api) page. ## Query synced data Synced entities support `tenant.alttextai.db..search()` and `.list()`: `images`. See [Database](/plugins/alttextai/database) for filters and operators. ## What's next > **[API reference](/plugins/alttextai/api)** > > Every `alttextai.api.*` operation with input and output types. > **[Database](/plugins/alttextai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/amara/api API reference for Amara: every `amara.api.*` operation with input and output types. Every `amara.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Activity ### get `activity.get` Get a single activity item by id **Risk:** `read` ```ts theme={null} await corsair.amara.api.activity.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `activity_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | No | — | | `type` | `number \| string` | No | — | | `type_name` | `string` | No | — | | `created` | `string` | No | — | | `video` | `string` | No | — | | `video_uri` | `string` | No | — | | `language` | `string` | No | — | | `language_url` | `string` | No | — | | `user` | `object` | No | — | | `comment` | `string` | No | — | | `new_video_title` | `string` | No | — | | `resource_uri` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > id?: string, > username?: string, > uri?: string > } | string > ``` *** ### list `activity.list` List platform activity with optional filters **Risk:** `read` ```ts theme={null} await corsair.amara.api.activity.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team` | `string` | No | — | | `type` | `string \| number` | No | — | | `after` | `string` | No | — | | `limit` | `number` | No | Page size | | `video` | `string` | No | — | | `before` | `string` | No | — | | `offset` | `number` | No | Result offset | | `language` | `string` | No | — | | `team_activity` | `string \| boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > id?: number | string, > type?: number | string, > type_name?: string, > created?: string | null, > video?: string | null, > video_uri?: string | null, > language?: string | null, > language_url?: string | null, > user?: { > id?: string, > username?: string, > uri?: string > } | string | null, > comment?: string | null, > new_video_title?: string | null, > resource_uri?: string > }[] > ``` *** ## Languages ### listAvailable `languages.listAvailable` List all supported Amara language codes **Risk:** `read` ```ts theme={null} await corsair.amara.api.languages.listAvailable({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `languages` | `object` | Yes | — | > **languages full type** > > ```ts theme={null} > { > } > ``` *** ## Messages ### send `messages.send` Send a message to a user or team **Risk:** `write` ```ts theme={null} await corsair.amara.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subject` | `string` | Yes | — | | `content` | `string` | Yes | — | | `user` | `string` | No | — | | `team` | `string` | No | — | **Output:** *empty object* *** ## Teams ### addMember `teams.addMember` Add a new member to a team **Risk:** `write` ```ts theme={null} await corsair.amara.api.teams.addMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `user` | `string` | Yes | — | | `role` | `owner \| admin \| manager \| contributor \| proj_lang_manager \| limited_contributor` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | | `role` | `string` | No | — | | `languages_managed` | `string[]` | No | — | | `resource_uri` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > username?: string | null, > id?: string, > full_name?: string | null, > first_name?: string | null, > last_name?: string | null, > biography?: string | null, > homepage?: string | null, > avatar?: string | null, > languages?: string[], > num_videos?: number, > resource_uri?: string, > created_by?: string | null, > is_partner?: boolean, > activity_uri?: string > } | string > ``` *** ### createProject `teams.createProject` Create a new project in a team **Risk:** `write` ```ts theme={null} await corsair.amara.api.teams.createProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `description` | `string` | No | — | | `guidelines` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `slug` | `string` | No | — | | `description` | `string` | No | — | | `guidelines` | `string` | No | — | | `created` | `string` | No | — | | `modified` | `string` | No | — | | `workflow_enabled` | `boolean` | No | — | | `resource_uri` | `string` | No | — | *** ### deleteProject `teams.deleteProject` Delete a project from a team **Risk:** `write` ```ts theme={null} await corsair.amara.api.teams.deleteProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `project_slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | No | — | *** ### getDetails `teams.getDetails` Get team details by slug **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `slug` | `string` | No | — | | `type` | `string` | No | — | | `description` | `string` | No | — | | `team_visibility` | `string` | No | — | | `video_visibility` | `string` | No | — | | `is_visible` | `boolean` | No | — | | `membership_policy` | `string` | No | — | | `video_policy` | `string` | No | — | | `activity_uri` | `string` | No | — | | `members_uri` | `string` | No | — | | `projects_uri` | `string` | No | — | | `applications_uri` | `string` | No | — | | `languages_uri` | `string` | No | — | | `tasks_uri` | `string` | No | — | | `resource_uri` | `string` | No | — | *** ### getLanguages `teams.getLanguages` Get preferred/blacklisted language URIs for a team **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.getLanguages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `preferred` | `string` | No | — | | `blacklisted` | `string` | No | — | *** ### getMember `teams.getMember` Get details for a specific team member **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.getMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `username` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | | `role` | `string` | No | — | | `languages_managed` | `string[]` | No | — | | `resource_uri` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > username?: string | null, > id?: string, > full_name?: string | null, > first_name?: string | null, > last_name?: string | null, > biography?: string | null, > homepage?: string | null, > avatar?: string | null, > languages?: string[], > num_videos?: number, > resource_uri?: string, > created_by?: string | null, > is_partner?: boolean, > activity_uri?: string > } | string > ``` *** ### getProject `teams.getProject` Get details for a specific team project **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.getProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `project_slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `slug` | `string` | No | — | | `description` | `string` | No | — | | `guidelines` | `string` | No | — | | `created` | `string` | No | — | | `modified` | `string` | No | — | | `workflow_enabled` | `boolean` | No | — | | `resource_uri` | `string` | No | — | *** ### getTask `teams.getTask` Get details for a specific team task **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.getTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `task_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | No | — | | `video_id` | `string` | No | — | | `language` | `string` | No | — | | `type` | `string` | No | — | | `priority` | `number` | No | — | | `assignee` | `object` | No | — | | `completed` | `string \| boolean` | No | — | | `created` | `string` | No | — | | `modified` | `string` | No | — | | `resource_uri` | `string` | No | — | > **assignee full type** > > ```ts theme={null} > { > username?: string | null, > id?: string, > full_name?: string | null, > first_name?: string | null, > last_name?: string | null, > biography?: string | null, > homepage?: string | null, > avatar?: string | null, > languages?: string[], > num_videos?: number, > resource_uri?: string, > created_by?: string | null, > is_partner?: boolean, > activity_uri?: string > } | string > ``` *** ### list `teams.list` List teams **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > name?: string, > slug?: string, > type?: string | null, > description?: string | null, > team_visibility?: string | null, > video_visibility?: string | null, > is_visible?: boolean, > membership_policy?: string | null, > video_policy?: string | null, > activity_uri?: string, > members_uri?: string, > projects_uri?: string, > applications_uri?: string | null, > languages_uri?: string | null, > tasks_uri?: string | null, > resource_uri?: string > }[] > ``` *** ### listApplications `teams.listApplications` List membership applications for a team **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.listApplications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `status` | `string` | No | — | | `user` | `string` | No | — | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > id?: number | string, > user?: { > username?: string | null, > id?: string, > full_name?: string | null, > first_name?: string | null, > last_name?: string | null, > biography?: string | null, > homepage?: string | null, > avatar?: string | null, > languages?: string[], > num_videos?: number, > resource_uri?: string, > created_by?: string | null, > is_partner?: boolean, > activity_uri?: string > } | string, > status?: string, > created?: string | null, > message?: string | null, > resource_uri?: string > }[] > ``` *** ### listMembers `teams.listMembers` List members of a team **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.listMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > user?: { > username?: string | null, > id?: string, > full_name?: string | null, > first_name?: string | null, > last_name?: string | null, > biography?: string | null, > homepage?: string | null, > avatar?: string | null, > languages?: string[], > num_videos?: number, > resource_uri?: string, > created_by?: string | null, > is_partner?: boolean, > activity_uri?: string > } | string, > role?: string, > languages_managed?: string[], > resource_uri?: string > }[] > ``` *** ### listProjects `teams.listProjects` List projects within a team **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.listProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > name?: string, > slug?: string, > description?: string | null, > guidelines?: string | null, > created?: string | null, > modified?: string | null, > workflow_enabled?: boolean, > resource_uri?: string > }[] > ``` *** ### listTasks `teams.listTasks` List tasks within a team with optional filters **Risk:** `read` ```ts theme={null} await corsair.amara.api.teams.listTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `assignee` | `string` | No | — | | `priority` | `number` | No | — | | `type` | `string` | No | — | | `video_id` | `string` | No | — | | `completed` | `string \| boolean` | No | — | | `open` | `string \| boolean` | No | — | | `order_by` | `string` | No | — | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > id?: number | string, > video_id?: string, > language?: string, > type?: string, > priority?: number, > assignee?: { > username?: string | null, > id?: string, > full_name?: string | null, > first_name?: string | null, > last_name?: string | null, > biography?: string | null, > homepage?: string | null, > avatar?: string | null, > languages?: string[], > num_videos?: number, > resource_uri?: string, > created_by?: string | null, > is_partner?: boolean, > activity_uri?: string > } | string | null, > completed?: string | boolean | null, > created?: string | null, > modified?: string | null, > resource_uri?: string > }[] > ``` *** ### removeMember `teams.removeMember` Remove a member from a team **Risk:** `write` ```ts theme={null} await corsair.amara.api.teams.removeMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `username` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | No | — | *** ### updateMember `teams.updateMember` Update member role in a team **Risk:** `write` ```ts theme={null} await corsair.amara.api.teams.updateMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `username` | `string` | Yes | — | | `role` | `owner \| admin \| manager \| contributor \| proj_lang_manager \| limited_contributor` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | | `role` | `string` | No | — | | `languages_managed` | `string[]` | No | — | | `resource_uri` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > username?: string | null, > id?: string, > full_name?: string | null, > first_name?: string | null, > last_name?: string | null, > biography?: string | null, > homepage?: string | null, > avatar?: string | null, > languages?: string[], > num_videos?: number, > resource_uri?: string, > created_by?: string | null, > is_partner?: boolean, > activity_uri?: string > } | string > ``` *** ### updateProject `teams.updateProject` Update a team project **Risk:** `write` ```ts theme={null} await corsair.amara.api.teams.updateProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_slug` | `string` | Yes | — | | `project_slug` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `guidelines` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `slug` | `string` | No | — | | `description` | `string` | No | — | | `guidelines` | `string` | No | — | | `created` | `string` | No | — | | `modified` | `string` | No | — | | `workflow_enabled` | `boolean` | No | — | | `resource_uri` | `string` | No | — | *** ## Users ### getActivity `users.getActivity` List activity for a user **Risk:** `read` ```ts theme={null} await corsair.amara.api.users.getActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > id?: number | string, > type?: number | string, > type_name?: string, > created?: string | null, > video?: string | null, > video_uri?: string | null, > language?: string | null, > language_url?: string | null, > user?: { > id?: string, > username?: string, > uri?: string > } | string | null, > comment?: string | null, > new_video_title?: string | null, > resource_uri?: string > }[] > ``` *** ### getData `users.getData` Get a user profile by identifier (or "me") **Risk:** `read` ```ts theme={null} await corsair.amara.api.users.getData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | Username, id\$…, or "me" | **Output** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | No | — | | `id` | `string` | No | — | | `full_name` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `biography` | `string` | No | — | | `homepage` | `string` | No | — | | `avatar` | `string` | No | — | | `languages` | `string[]` | No | — | | `num_videos` | `number` | No | — | | `resource_uri` | `string` | No | — | | `created_by` | `string` | No | — | | `is_partner` | `boolean` | No | — | | `activity_uri` | `string` | No | — | *** ## Videos ### addSubtitleNote `videos.addSubtitleNote` Add an editor note to a subtitle set **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.addSubtitleNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `language_code` | `string` | Yes | — | | `body` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `body` | `string` | No | — | | `created` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id?: string, > username?: string, > uri?: string > } > ``` *** ### addUrl `videos.addUrl` Add a URL to a video **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.addUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `primary` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | No | — | | `url` | `string` | No | — | | `primary` | `boolean` | No | — | | `original` | `boolean` | No | — | | `id` | `number` | No | — | | `resource_uri` | `string` | No | — | | `videoid` | `string` | No | — | | `type` | `string` | No | — | *** ### create `videos.create` Create a video from a public URL **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_url` | `string` | Yes | — | | `title` | `string` | Yes | — | | `team` | `string` | No | — | | `project` | `string` | No | — | | `duration` | `number` | No | — | | `metadata` | `object` | No | — | | `thumbnail` | `string` | No | — | | `description` | `string` | No | — | | `primary_audio_language_code` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `video_type` | `string` | No | — | | `primary_audio_language_code` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `duration` | `number` | No | — | | `thumbnail` | `string` | No | — | | `created` | `string` | No | — | | `team` | `string` | No | — | | `project` | `string` | No | — | | `all_urls` | `string[]` | No | — | | `metadata` | `object` | No | — | | `languages` | `object[]` | No | — | | `activity_uri` | `string` | No | — | | `urls_uri` | `string` | No | — | | `subtitle_languages_uri` | `string` | No | — | | `resource_uri` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **languages full type** > > ```ts theme={null} > { > code?: string, > name?: string, > published?: boolean, > dir?: string | null, > subtitles_uri?: string, > resource_uri?: string > }[] > ``` *** ### createSubtitleLanguage `videos.createSubtitleLanguage` Create a subtitle language on a video **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.createSubtitleLanguage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `language_code` | `string` | Yes | — | | `is_primary_audio_language` | `boolean` | No | — | | `soft_limit_cpl` | `number` | No | — | | `soft_limit_cps` | `number` | No | — | | `soft_limit_lines` | `number` | No | — | | `soft_limit_max_duration` | `number` | No | — | | `soft_limit_min_duration` | `number` | No | — | | `subtitles_complete` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | No | — | | `language_code` | `string` | No | — | | `is_primary_audio_language` | `boolean` | No | — | | `is_rtl` | `boolean` | No | — | | `soft_limit_cpl` | `number` | No | — | | `soft_limit_cps` | `number` | No | — | | `soft_limit_lines` | `number` | No | — | | `soft_limit_max_duration` | `number` | No | — | | `soft_limit_min_duration` | `number` | No | — | | `published` | `boolean` | No | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `metadata` | `object` | No | — | | `subtitle_count` | `number` | No | — | | `subtitles_complete` | `boolean` | No | — | | `versions` | `object[]` | No | — | | `subtitles_uri` | `string` | No | — | | `resource_uri` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **versions full type** > > ```ts theme={null} > { > author?: { > id?: string, > username?: string, > uri?: string > } | null, > published?: boolean, > version_number?: number, > created?: string | null > }[] > ``` *** ### createSubtitles `videos.createSubtitles` Create or update subtitles for a language **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.createSubtitles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `language_code` | `string` | Yes | — | | `title` | `string` | No | — | | `action` | `string` | No | — | | `metadata` | `object` | No | — | | `subtitles` | `string \| any[]` | No | — | | `sub_format` | `string` | No | — | | `description` | `string` | No | — | | `subtitles_url` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `version_number` | `number` | No | — | | `sub_format` | `string` | No | — | | `subtitles` | `object` | No | — | | `author` | `object` | No | — | | `created` | `string` | No | — | | `description` | `string` | No | — | | `language` | `object` | No | — | | `metadata` | `object` | No | — | | `notes_uri` | `string` | No | — | | `resource_uri` | `string` | No | — | | `site_uri` | `string` | No | — | | `title` | `string` | No | — | | `video_description` | `string` | No | — | | `video_title` | `string` | No | — | | `actions_uri` | `string` | No | — | > **subtitles full type** > > ```ts theme={null} > { > start?: number, > end?: number, > text?: string, > meta?: { > }, > position?: number > }[] | string > ``` > **author full type** > > ```ts theme={null} > { > id?: string, > username?: string, > uri?: string > } > ``` > **language full type** > > ```ts theme={null} > { > code?: string, > dir?: string | null, > name?: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### deleteUrl `videos.deleteUrl` Delete a video URL **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.deleteUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `url_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | No | — | *** ### fetchSubtitlesData `videos.fetchSubtitlesData` Fetch subtitles for a video language **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.fetchSubtitlesData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `language_code` | `string` | Yes | — | | `format` | `string` | No | Subtitle format (default json) | | `sub_format` | `string` | No | Alias for format | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version_number` | `number` | No | — | | `sub_format` | `string` | No | — | | `subtitles` | `object` | No | — | | `author` | `object` | No | — | | `created` | `string` | No | — | | `description` | `string` | No | — | | `language` | `object` | No | — | | `metadata` | `object` | No | — | | `notes_uri` | `string` | No | — | | `resource_uri` | `string` | No | — | | `site_uri` | `string` | No | — | | `title` | `string` | No | — | | `video_description` | `string` | No | — | | `video_title` | `string` | No | — | | `actions_uri` | `string` | No | — | > **subtitles full type** > > ```ts theme={null} > { > start?: number, > end?: number, > text?: string, > meta?: { > }, > position?: number > }[] | string > ``` > **author full type** > > ```ts theme={null} > { > id?: string, > username?: string, > uri?: string > } > ``` > **language full type** > > ```ts theme={null} > { > code?: string, > dir?: string | null, > name?: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### getSubtitleLanguageDetails `videos.getSubtitleLanguageDetails` Get details for a subtitle language **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.getSubtitleLanguageDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `language_code` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | No | — | | `language_code` | `string` | No | — | | `is_primary_audio_language` | `boolean` | No | — | | `is_rtl` | `boolean` | No | — | | `soft_limit_cpl` | `number` | No | — | | `soft_limit_cps` | `number` | No | — | | `soft_limit_lines` | `number` | No | — | | `soft_limit_max_duration` | `number` | No | — | | `soft_limit_min_duration` | `number` | No | — | | `published` | `boolean` | No | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `metadata` | `object` | No | — | | `subtitle_count` | `number` | No | — | | `subtitles_complete` | `boolean` | No | — | | `versions` | `object[]` | No | — | | `subtitles_uri` | `string` | No | — | | `resource_uri` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **versions full type** > > ```ts theme={null} > { > author?: { > id?: string, > username?: string, > uri?: string > } | null, > published?: boolean, > version_number?: number, > created?: string | null > }[] > ``` *** ### getUrl `videos.getUrl` Get a single video URL by id **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.getUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `url_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | No | — | | `url` | `string` | No | — | | `primary` | `boolean` | No | — | | `original` | `boolean` | No | — | | `id` | `number` | No | — | | `resource_uri` | `string` | No | — | | `videoid` | `string` | No | — | | `type` | `string` | No | — | *** ### getUrlDetails `videos.getUrlDetails` Look up a video by its public URL **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.getUrlDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public video URL to look up | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > id: string, > video_type?: string | null, > primary_audio_language_code?: string | null, > title?: string | null, > description?: string | null, > duration?: number | null, > thumbnail?: string | null, > created?: string | null, > team?: string | null, > project?: string | null, > all_urls?: string[], > metadata?: { > }, > languages?: { > code?: string, > name?: string, > published?: boolean, > dir?: string | null, > subtitles_uri?: string, > resource_uri?: string > }[], > activity_uri?: string, > urls_uri?: string, > subtitle_languages_uri?: string, > resource_uri?: string > }[] > ``` *** ### list `videos.list` List videos with optional filters and pagination **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | List ordering (mapped to order\_by) | | `team` | `string` | No | — | | `limit` | `number` | No | Page size | | `owner` | `string` | No | — | | `offset` | `number` | No | Result offset | | `archive` | `string \| boolean` | No | — | | `project` | `string` | No | — | | `language` | `string` | No | — | | `video_id` | `string` | No | — | | `video_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > id: string, > video_type?: string | null, > primary_audio_language_code?: string | null, > title?: string | null, > description?: string | null, > duration?: number | null, > thumbnail?: string | null, > created?: string | null, > team?: string | null, > project?: string | null, > all_urls?: string[], > metadata?: { > }, > languages?: { > code?: string, > name?: string, > published?: boolean, > dir?: string | null, > subtitles_uri?: string, > resource_uri?: string > }[], > activity_uri?: string, > urls_uri?: string, > subtitle_languages_uri?: string, > resource_uri?: string > }[] > ``` *** ### listActivity `videos.listActivity` List activity for a video **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.listActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > id?: number | string, > type?: number | string, > type_name?: string, > created?: string | null, > video?: string | null, > video_uri?: string | null, > language?: string | null, > language_url?: string | null, > user?: { > id?: string, > username?: string, > uri?: string > } | string | null, > comment?: string | null, > new_video_title?: string | null, > resource_uri?: string > }[] > ``` *** ### listSubtitleActions `videos.listSubtitleActions` List available subtitle actions **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.listSubtitleActions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `language_code` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > action: string, > label?: string, > complete?: boolean | null > }[] > ``` *** ### listSubtitleLanguages `videos.listSubtitleLanguages` List subtitle languages for a video **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.listSubtitleLanguages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > created?: string | null, > language_code?: string, > is_primary_audio_language?: boolean, > is_rtl?: boolean, > soft_limit_cpl?: number | null, > soft_limit_cps?: number | null, > soft_limit_lines?: number | null, > soft_limit_max_duration?: number | null, > soft_limit_min_duration?: number | null, > published?: boolean, > name?: string | null, > title?: string | null, > description?: string | null, > metadata?: { > }, > subtitle_count?: number, > subtitles_complete?: boolean, > versions?: { > author?: { > id?: string, > username?: string, > uri?: string > } | null, > published?: boolean, > version_number?: number, > created?: string | null > }[], > subtitles_uri?: string, > resource_uri?: string > }[] > ``` *** ### listSubtitleNotes `videos.listSubtitleNotes` List editor notes on a subtitle set **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.listSubtitleNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `language_code` | `string` | Yes | — | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > body?: string, > created?: string | null, > user?: { > id?: string, > username?: string, > uri?: string > } | null > }[] > ``` *** ### listUrls `videos.listUrls` List URLs associated with a video **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.listUrls({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `limit` | `number` | No | Page size | | `offset` | `number` | No | Result offset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `objects` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > previous?: string | null, > next?: string | null, > offset?: number, > limit?: number, > total_count?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > created?: string | null, > url?: string, > primary?: boolean, > original?: boolean, > id?: number, > resource_uri?: string, > videoid?: string | null, > type?: string | null > }[] > ``` *** ### makeUrlPrimary `videos.makeUrlPrimary` Set a video URL as primary **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.makeUrlPrimary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `url_id` | `string \| number` | Yes | — | | `primary` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | No | — | | `url` | `string` | No | — | | `primary` | `boolean` | No | — | | `original` | `boolean` | No | — | | `id` | `number` | No | — | | `resource_uri` | `string` | No | — | | `videoid` | `string` | No | — | | `type` | `string` | No | — | *** ### performSubtitleAction `videos.performSubtitleAction` Perform a subtitle action (publish, save-draft, …) **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.performSubtitleAction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `language_code` | `string` | Yes | — | | `action` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | No | — | *** ### update `videos.update` Update video metadata **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `duration` | `number` | No | — | | `team` | `string` | No | — | | `project` | `string` | No | — | | `thumbnail` | `string` | No | — | | `metadata` | `object` | No | — | | `primary_audio_language_code` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `video_type` | `string` | No | — | | `primary_audio_language_code` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `duration` | `number` | No | — | | `thumbnail` | `string` | No | — | | `created` | `string` | No | — | | `team` | `string` | No | — | | `project` | `string` | No | — | | `all_urls` | `string[]` | No | — | | `metadata` | `object` | No | — | | `languages` | `object[]` | No | — | | `activity_uri` | `string` | No | — | | `urls_uri` | `string` | No | — | | `subtitle_languages_uri` | `string` | No | — | | `resource_uri` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **languages full type** > > ```ts theme={null} > { > code?: string, > name?: string, > published?: boolean, > dir?: string | null, > subtitles_uri?: string, > resource_uri?: string > }[] > ``` *** ### updateSubtitleLanguage `videos.updateSubtitleLanguage` Update subtitle language settings **Risk:** `write` ```ts theme={null} await corsair.amara.api.videos.updateSubtitleLanguage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | | `language_code` | `string` | Yes | — | | `is_primary_audio_language` | `boolean` | No | — | | `soft_limit_cpl` | `number` | No | — | | `soft_limit_cps` | `number` | No | — | | `soft_limit_lines` | `number` | No | — | | `soft_limit_max_duration` | `number` | No | — | | `soft_limit_min_duration` | `number` | No | — | | `subtitles_complete` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | No | — | | `language_code` | `string` | No | — | | `is_primary_audio_language` | `boolean` | No | — | | `is_rtl` | `boolean` | No | — | | `soft_limit_cpl` | `number` | No | — | | `soft_limit_cps` | `number` | No | — | | `soft_limit_lines` | `number` | No | — | | `soft_limit_max_duration` | `number` | No | — | | `soft_limit_min_duration` | `number` | No | — | | `published` | `boolean` | No | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `metadata` | `object` | No | — | | `subtitle_count` | `number` | No | — | | `subtitles_complete` | `boolean` | No | — | | `versions` | `object[]` | No | — | | `subtitles_uri` | `string` | No | — | | `resource_uri` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **versions full type** > > ```ts theme={null} > { > author?: { > id?: string, > username?: string, > uri?: string > } | null, > published?: boolean, > version_number?: number, > created?: string | null > }[] > ``` *** ### viewDetails `videos.viewDetails` Get details for a single video by id **Risk:** `read` ```ts theme={null} await corsair.amara.api.videos.viewDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `video_type` | `string` | No | — | | `primary_audio_language_code` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `duration` | `number` | No | — | | `thumbnail` | `string` | No | — | | `created` | `string` | No | — | | `team` | `string` | No | — | | `project` | `string` | No | — | | `all_urls` | `string[]` | No | — | | `metadata` | `object` | No | — | | `languages` | `object[]` | No | — | | `activity_uri` | `string` | No | — | | `urls_uri` | `string` | No | — | | `subtitle_languages_uri` | `string` | No | — | | `resource_uri` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **languages full type** > > ```ts theme={null} > { > code?: string, > name?: string, > published?: boolean, > dir?: string | null, > subtitles_uri?: string, > resource_uri?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/amara/database Amara local sync: searchable entities, `.search()` filters, and operators. The Amara plugin syncs data locally. Use `corsair.amara.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Teams Path: `amara.db.teams.search` ```ts theme={null} const rows = await corsair.amara.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `membership_policy` | `string` | equals, contains, startsWith, endsWith, in | | `video_policy` | `string` | equals, contains, startsWith, endsWith, in | | `is_visible` | `boolean` | equals | | `resource_uri` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `amara.db.users.search` ```ts theme={null} const rows = await corsair.amara.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `biography` | `string` | equals, contains, startsWith, endsWith, in | | `homepage` | `string` | equals, contains, startsWith, endsWith, in | | `avatar` | `string` | equals, contains, startsWith, endsWith, in | | `num_videos` | `number` | equals, gt, gte, lt, lte, in | | `resource_uri` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Videos Path: `amara.db.videos.search` ```ts theme={null} const rows = await corsair.amara.db.videos.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `thumbnail` | `string` | equals, contains, startsWith, endsWith, in | | `team` | `string` | equals, contains, startsWith, endsWith, in | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `primary_audio_language_code` | `string` | equals, contains, startsWith, endsWith, in | | `video_type` | `string` | equals, contains, startsWith, endsWith, in | | `resource_uri` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/amara/overview Collaborative subtitling and captioning platform for video accessibility and translation. Use **Amara** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 43 typed API operations * 3 synced entities (`teams`, `users`, `videos`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/amara ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/amara ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/amara ``` ```bash bun theme={null} bun add corsair @corsair-dev/amara ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { amara } from '@corsair-dev/amara'; export const corsair = createCorsair({ plugins: [ amara(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} amara() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'amara', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`activity.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.amara.api.activity.get({}); ``` **`messages.send`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.amara.api.messages.send({}); ``` See the full list on the [API](/plugins/amara/api) page. ## Query synced data Synced entities support `tenant.amara.db..search()` and `.list()`: `teams`, `users`, `videos`. See [Database](/plugins/amara/database) for filters and operators. ## What's next > **[API reference](/plugins/amara/api)** > > Every `amara.api.*` operation with input and output types. > **[Database](/plugins/amara/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/ambee/api API reference for Ambee: every `ambee.api.*` operation with input and output types. Every `ambee.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Air Quality ### getForecastByLatLng `airQuality.getForecastByLatLng` Get the hourly air quality forecast for a latitude/longitude (next 48 hours) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.airQuality.getForecastByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `lat` | `number` | No | — | | `lng` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > CO?: number | null, > NO2?: number | null, > OZONE?: number | null, > PM10?: number | null, > PM25?: number | null, > SO2?: number | null, > NO?: number | null, > AQI?: number | null, > aqiInfo?: { > pollutant?: string | null, > concentration?: number | null, > category?: string | null > }, > time?: number | null, > updatedAt?: string | null > }[] > ``` *** ### getHistoryByLatLng `airQuality.getHistoryByLatLng` Get hourly historical air quality for a latitude/longitude over a time range **Risk:** `read` ```ts theme={null} await corsair.ambee.api.airQuality.getHistoryByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | | `from` | `string` | Yes | Start of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `to` | `string` | Yes | End of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `lat` | `number` | No | — | | `lng` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > CO?: number | null, > NO2?: number | null, > OZONE?: number | null, > PM10?: number | null, > PM25?: number | null, > SO2?: number | null, > NO?: number | null, > AQI?: number | null, > aqiInfo?: { > pollutant?: string | null, > concentration?: number | null, > category?: string | null > }, > time?: number | null, > updatedAt?: string | null > }[] > ``` *** ### getHistoryByPostalCode `airQuality.getHistoryByPostalCode` Get hourly historical air quality for a postal code over a time range **Risk:** `read` ```ts theme={null} await corsair.ambee.api.airQuality.getHistoryByPostalCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `postalCode` | `string` | Yes | Postal code, e.g. "560020" | | `countryCode` | `string` | Yes | Three-letter ISO country code, e.g. "IND" or "USA" | | `from` | `string` | Yes | Start of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `to` | `string` | Yes | End of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `lat` | `number` | No | — | | `lng` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > CO?: number | null, > NO2?: number | null, > OZONE?: number | null, > PM10?: number | null, > PM25?: number | null, > SO2?: number | null, > NO?: number | null, > AQI?: number | null, > aqiInfo?: { > pollutant?: string | null, > concentration?: number | null, > category?: string | null > }, > time?: number | null, > updatedAt?: string | null > }[] > ``` *** ### getLatestByCity `airQuality.getLatestByCity` Get the latest air quality for the stations in a city **Risk:** `read` ```ts theme={null} await corsair.ambee.api.airQuality.getLatestByCity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `city` | `string` | Yes | City name, e.g. "Bengaluru" | | `limit` | `number` | No | Maximum number of stations to return (Ambee defaults to 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `stations` | `object[]` | No | — | > **stations full type** > > ```ts theme={null} > { > CO?: number | null, > NO2?: number | null, > OZONE?: number | null, > PM10?: number | null, > PM25?: number | null, > SO2?: number | null, > NO?: number | null, > AQI?: number | null, > aqiInfo?: { > pollutant?: string | null, > concentration?: number | null, > category?: string | null > }, > city?: string | null, > countryCode?: string | null, > division?: string | null, > state?: string | null, > placeName?: string | null, > postalCode?: string | number | null, > lat?: number | null, > lng?: number | null, > updatedAt?: string | null > }[] > ``` *** ### getLatestByCountryCode `airQuality.getLatestByCountryCode` Get the latest air quality for the monitoring stations across a country **Risk:** `read` ```ts theme={null} await corsair.ambee.api.airQuality.getLatestByCountryCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `countryCode` | `string` | Yes | Three-letter ISO country code, e.g. "IND" or "USA" | | `limit` | `number` | No | Maximum number of stations to return (Ambee defaults to 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `stations` | `object[]` | No | — | > **stations full type** > > ```ts theme={null} > { > CO?: number | null, > NO2?: number | null, > OZONE?: number | null, > PM10?: number | null, > PM25?: number | null, > SO2?: number | null, > NO?: number | null, > AQI?: number | null, > aqiInfo?: { > pollutant?: string | null, > concentration?: number | null, > category?: string | null > }, > city?: string | null, > countryCode?: string | null, > division?: string | null, > state?: string | null, > placeName?: string | null, > postalCode?: string | number | null, > lat?: number | null, > lng?: number | null, > updatedAt?: string | null > }[] > ``` *** ### getLatestByLatLng `airQuality.getLatestByLatLng` Get the latest air quality (AQI and pollutant concentrations) for a latitude/longitude **Risk:** `read` ```ts theme={null} await corsair.ambee.api.airQuality.getLatestByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `stations` | `object[]` | No | — | > **stations full type** > > ```ts theme={null} > { > CO?: number | null, > NO2?: number | null, > OZONE?: number | null, > PM10?: number | null, > PM25?: number | null, > SO2?: number | null, > NO?: number | null, > AQI?: number | null, > aqiInfo?: { > pollutant?: string | null, > concentration?: number | null, > category?: string | null > }, > city?: string | null, > countryCode?: string | null, > division?: string | null, > state?: string | null, > placeName?: string | null, > postalCode?: string | number | null, > lat?: number | null, > lng?: number | null, > updatedAt?: string | null > }[] > ``` *** ### getLatestByPostalCode `airQuality.getLatestByPostalCode` Get the latest air quality for a postal code and country **Risk:** `read` ```ts theme={null} await corsair.ambee.api.airQuality.getLatestByPostalCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `postalCode` | `string` | Yes | Postal code, e.g. "560020" | | `countryCode` | `string` | Yes | Three-letter ISO country code, e.g. "IND" or "USA" | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `stations` | `object[]` | No | — | > **stations full type** > > ```ts theme={null} > { > CO?: number | null, > NO2?: number | null, > OZONE?: number | null, > PM10?: number | null, > PM25?: number | null, > SO2?: number | null, > NO?: number | null, > AQI?: number | null, > aqiInfo?: { > pollutant?: string | null, > concentration?: number | null, > category?: string | null > }, > city?: string | null, > countryCode?: string | null, > division?: string | null, > state?: string | null, > placeName?: string | null, > postalCode?: string | number | null, > lat?: number | null, > lng?: number | null, > updatedAt?: string | null > }[] > ``` *** ## Disasters ### getHistoryByContinent `disasters.getHistoryByContinent` Get historical natural disasters on a continent over a date range (paginated) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.disasters.getHistoryByContinent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `continent` | `AFR \| ANT \| ASIA \| AUS \| EUR \| NAR \| SAR \| Ocean` | Yes | Continent code | | `from` | `string` | Yes | Start of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `to` | `string` | Yes | End of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `eventType` | `TN \| EQ \| TC \| WF \| FL \| ET \| DR \| SW \| SI \| VO \| LS \| Misc` | No | Restrict results to a single Ambee event-type code | | `limit` | `number` | No | Records per page (Ambee defaults to 1) | | `page` | `number` | No | Page number, 1-based (Ambee defaults to 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `result` | `object[]` | No | — | | `data` | `object[]` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` > **data full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` *** ### getHistoryByCountryCode `disasters.getHistoryByCountryCode` Get historical natural disasters in a country over a date range (paginated) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.disasters.getHistoryByCountryCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `countryCode` | `string` | Yes | Three-letter ISO country code, e.g. "IND" or "USA" | | `from` | `string` | Yes | Start of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `to` | `string` | Yes | End of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `eventType` | `TN \| EQ \| TC \| WF \| FL \| ET \| DR \| SW \| SI \| VO \| LS \| Misc` | No | Restrict results to a single Ambee event-type code | | `limit` | `number` | No | Records per page (Ambee defaults to 1) | | `page` | `number` | No | Page number, 1-based (Ambee defaults to 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `result` | `object[]` | No | — | | `data` | `object[]` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` > **data full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` *** ### getHistoryByDateRange `disasters.getHistoryByDateRange` Get historical natural disasters worldwide over a date range (paginated) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.disasters.getHistoryByDateRange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | Yes | Start of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `to` | `string` | No | End of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `eventType` | `TN \| EQ \| TC \| WF \| FL \| ET \| DR \| SW \| SI \| VO \| LS \| Misc` | No | Restrict results to a single Ambee event-type code | | `limit` | `number` | No | Records per page (Ambee defaults to 1) | | `page` | `number` | No | Page number, 1-based (Ambee defaults to 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `result` | `object[]` | No | — | | `data` | `object[]` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` > **data full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` *** ### getHistoryByLatLng `disasters.getHistoryByLatLng` Get historical natural disasters near a latitude/longitude over a date range (paginated) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.disasters.getHistoryByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | | `from` | `string` | Yes | Start of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `to` | `string` | Yes | End of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `eventType` | `TN \| EQ \| TC \| WF \| FL \| ET \| DR \| SW \| SI \| VO \| LS \| Misc` | No | Restrict results to a single Ambee event-type code | | `limit` | `number` | No | Records per page (Ambee defaults to 1) | | `page` | `number` | No | Page number, 1-based (Ambee defaults to 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `result` | `object[]` | No | — | | `data` | `object[]` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` > **data full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` *** ### getLatestByContinent `disasters.getLatestByContinent` Get the latest natural disasters on a continent (paginated) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.disasters.getLatestByContinent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `continent` | `AFR \| ANT \| ASIA \| AUS \| EUR \| NAR \| SAR \| Ocean` | Yes | Continent code | | `eventType` | `TN \| EQ \| TC \| WF \| FL \| ET \| DR \| SW \| SI \| VO \| LS \| Misc` | No | Restrict results to a single Ambee event-type code | | `limit` | `number` | No | Records per page (Ambee defaults to 1) | | `page` | `number` | No | Page number, 1-based (Ambee defaults to 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `result` | `object[]` | No | — | | `data` | `object[]` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` > **data full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` *** ### getLatestByCountryCode `disasters.getLatestByCountryCode` Get the latest natural disasters in a country (paginated) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.disasters.getLatestByCountryCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `countryCode` | `string` | Yes | Three-letter ISO country code, e.g. "IND" or "USA" | | `eventType` | `TN \| EQ \| TC \| WF \| FL \| ET \| DR \| SW \| SI \| VO \| LS \| Misc` | No | Restrict results to a single Ambee event-type code | | `limit` | `number` | No | Records per page (Ambee defaults to 1) | | `page` | `number` | No | Page number, 1-based (Ambee defaults to 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `result` | `object[]` | No | — | | `data` | `object[]` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` > **data full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` *** ### getLatestByLatLng `disasters.getLatestByLatLng` Get the latest natural disasters near a latitude/longitude (paginated) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.disasters.getLatestByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | | `eventType` | `TN \| EQ \| TC \| WF \| FL \| ET \| DR \| SW \| SI \| VO \| LS \| Misc` | No | Restrict results to a single Ambee event-type code | | `limit` | `number` | No | Records per page (Ambee defaults to 1) | | `page` | `number` | No | Page number, 1-based (Ambee defaults to 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `result` | `object[]` | No | — | | `data` | `object[]` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` > **data full type** > > ```ts theme={null} > { > event_id?: string | number | null, > event_type?: string | null, > event_name?: string | null, > lat?: number | null, > lng?: number | null, > country_code?: string | null, > continent?: string | null, > date?: string | number | null, > updated_at?: string | number | null, > severity?: string | number | null, > source?: string | null, > details?: { > } > }[] > ``` *** ## Elevation ### getByLatLng `elevation.getByLatLng` Get the ground elevation at a latitude/longitude **Risk:** `read` ```ts theme={null} await corsair.ambee.api.elevation.getByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > lat?: number | null, > lng?: number | null, > elevation?: number | null, > minElevation?: number | null, > maxElevation?: number | null, > meanElevation?: number | null, > placeName?: string | null, > unit?: string | null > }[] > ``` *** ### getByPlace `elevation.getByPlace` Get the ground elevation for a named place **Risk:** `read` ```ts theme={null} await corsair.ambee.api.elevation.getByPlace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place` | `string` | Yes | Place name, e.g. "San Francisco, USA" | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > lat?: number | null, > lng?: number | null, > elevation?: number | null, > minElevation?: number | null, > maxElevation?: number | null, > meanElevation?: number | null, > placeName?: string | null, > unit?: string | null > }[] > ``` *** ## Fire ### getLatestByLatLng `fire.getLatestByLatLng` Get wildfires detected or reported near a latitude/longitude in the last 7 days **Risk:** `read` ```ts theme={null} await corsair.ambee.api.fire.getLatestByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | | `type` | `reported \| detected` | No | Restrict results to reported or satellite-detected fires | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > fireId?: string | number | null, > lat?: number | null, > lng?: number | null, > detectedAt?: string | number | null, > detectedAtLocalTime?: string | null, > confidence?: string | number | null, > frp?: number | null, > satellite?: string | null, > instrument?: string | null, > fireType?: string | null, > fireName?: string | null, > locationName?: string | null, > area?: number | null > }[] > ``` *** ### getLatestByPlace `fire.getLatestByPlace` Get wildfires detected or reported near a named place in the last 7 days **Risk:** `read` ```ts theme={null} await corsair.ambee.api.fire.getLatestByPlace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place` | `string` | Yes | Place name, e.g. "Virgin, UT" | | `type` | `reported \| detected` | No | Restrict results to reported or satellite-detected fires | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > fireId?: string | number | null, > lat?: number | null, > lng?: number | null, > detectedAt?: string | number | null, > detectedAtLocalTime?: string | null, > confidence?: string | number | null, > frp?: number | null, > satellite?: string | null, > instrument?: string | null, > fireType?: string | null, > fireName?: string | null, > locationName?: string | null, > area?: number | null > }[] > ``` *** ### getRiskByLatLng `fire.getRiskByLatLng` Get the wildfire risk forecast for a latitude/longitude (up to 4 weeks ahead) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.fire.getRiskByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > date?: string | null, > time?: number | null, > risk?: string | number | null, > riskCategory?: string | null, > lat?: number | null, > lng?: number | null > }[] > ``` *** ### getRiskByPlace `fire.getRiskByPlace` Get the wildfire risk forecast for a named place (up to 4 weeks ahead) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.fire.getRiskByPlace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place` | `string` | Yes | Place name, e.g. "Leon, Mexico" | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > date?: string | null, > time?: number | null, > risk?: string | number | null, > riskCategory?: string | null, > lat?: number | null, > lng?: number | null > }[] > ``` *** ## Geocode ### byPlace `geocode.byPlace` Geocode a place name or address into coordinates **Risk:** `read` ```ts theme={null} await corsair.ambee.api.geocode.byPlace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place` | `string` | Yes | Address or place name to geocode | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > lat?: string | number | null, > lng?: string | number | null, > city?: string | null, > state?: string | null, > countryCode?: string | null, > countryName?: string | null, > postalCode?: string | number | null, > placeName?: string | null, > formattedAddress?: string | null > }[] > ``` *** ### reverseByLatLng `geocode.reverseByLatLng` Reverse-geocode a latitude/longitude into a human-readable address **Risk:** `read` ```ts theme={null} await corsair.ambee.api.geocode.reverseByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > lat?: string | number | null, > lng?: string | number | null, > city?: string | null, > state?: string | null, > countryCode?: string | null, > countryName?: string | null, > postalCode?: string | number | null, > placeName?: string | null, > formattedAddress?: string | null > }[] > ``` *** ## Ili ### getForecastByLatLng `ili.getForecastByLatLng` Get the daily influenza-like-illness risk forecast for a latitude/longitude **Risk:** `read` ```ts theme={null} await corsair.ambee.api.ili.getForecastByLatLng({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | | `details` | `boolean` | No | Include the supporting 28-day weather and pollen forecast (defaults to false) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `lat` | `number` | No | — | | `lng` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > date?: string | null, > time?: number | null, > risk?: string | number | null, > riskCategory?: string | null, > details?: { > } > }[] > ``` *** ## Pollen ### getForecast `pollen.getForecast` Get the pollen forecast for a location (48 hours hourly or 120 hours 3-hourly) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.pollen.getForecast({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > lat: number, > lng: number, > hours?: 48 | 120, > speciesRisk?: boolean > } | { > place: string, > hours?: 48 | 120, > speciesRisk?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `lat` | `number` | No | — | | `lng` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > time?: number | null, > updatedAt?: string | null, > Count?: { > grass_pollen?: number | null, > tree_pollen?: number | null, > weed_pollen?: number | null > }, > Risk?: { > grass_pollen?: string | null, > tree_pollen?: string | null, > weed_pollen?: string | null > }, > Species?: { > }, > Risks?: { > } > }[] > ``` *** ### getHistory `pollen.getHistory` Get historical pollen counts for a location over a time range **Risk:** `read` ```ts theme={null} await corsair.ambee.api.pollen.getHistory({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > lat: number, > lng: number, > from: string, > to: string, > speciesRisk?: boolean > } | { > place: string, > from: string, > to: string, > speciesRisk?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `lat` | `number` | No | — | | `lng` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > time?: number | null, > updatedAt?: string | null, > Count?: { > grass_pollen?: number | null, > tree_pollen?: number | null, > weed_pollen?: number | null > }, > Risk?: { > grass_pollen?: string | null, > tree_pollen?: string | null, > weed_pollen?: string | null > }, > Species?: { > }, > Risks?: { > } > }[] > ``` *** ### getLatest `pollen.getLatest` Get the latest grass, tree and weed pollen counts and risk levels for a location **Risk:** `read` ```ts theme={null} await corsair.ambee.api.pollen.getLatest({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > lat: number, > lng: number, > speciesRisk?: boolean > } | { > place: string, > speciesRisk?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `lat` | `number` | No | — | | `lng` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > time?: number | null, > updatedAt?: string | null, > Count?: { > grass_pollen?: number | null, > tree_pollen?: number | null, > weed_pollen?: number | null > }, > Risk?: { > grass_pollen?: string | null, > tree_pollen?: string | null, > weed_pollen?: string | null > }, > Species?: { > }, > Risks?: { > } > }[] > ``` *** ## Weather ### getForecast `weather.getForecast` Get the hourly weather forecast for a latitude/longitude (next 72 hours) **Risk:** `read` ```ts theme={null} await corsair.ambee.api.weather.getForecast({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | | `units` | `si` | No | Pass "si" to receive SI units instead of the imperial default | **Output:** `unknown` *** ### getHistory `weather.getHistory` Get hourly historical weather for a latitude/longitude over a time range **Risk:** `read` ```ts theme={null} await corsair.ambee.api.weather.getHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | | `from` | `string` | Yes | Start of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `to` | `string` | Yes | End of the time range, as "YYYY-MM-DD hh:mm:ss" (UTC) or an ISO 8601 date | | `units` | `si` | No | Pass "si" to receive SI units instead of the imperial default | **Output:** `unknown` *** ### getLatest `weather.getLatest` Get current weather conditions (temperature, humidity, wind, UV) for a latitude/longitude **Risk:** `read` ```ts theme={null} await corsair.ambee.api.weather.getLatest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude, between -90 and 90 | | `lng` | `number` | Yes | Longitude, between -180 and 180 | | `units` | `si` | No | Pass "si" to receive SI units instead of the imperial default | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | Ambee status message, "success" on a successful call | | `lat` | `number` | No | — | | `lng` | `number` | No | — | | `timezone` | `string` | No | — | | `units` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > time?: number | null, > summary?: string | null, > icon?: string | null, > temperature?: number | null, > apparentTemperature?: number | null, > dewPoint?: number | null, > humidity?: number | null, > pressure?: number | null, > surfacePressure?: number | null, > windSpeed?: number | null, > windGust?: number | null, > windBearing?: number | null, > cloudCover?: number | null, > visibility?: number | null, > ozone?: number | null, > uvIndex?: number | null, > precipIntensity?: number | null, > precipProbability?: number | null, > precipType?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/ambee/database Ambee local sync: searchable entities, `.search()` filters, and operators. The Ambee plugin syncs data locally. Use `corsair.ambee.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Air Quality Readings Path: `ambee.db.airQualityReadings.search` ```ts theme={null} const rows = await corsair.ambee.db.airQualityReadings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `locationKey` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `postalCode` | `string` | equals, contains, startsWith, endsWith, in | | `placeName` | `string` | equals, contains, startsWith, endsWith, in | | `lat` | `number` | equals, gt, gte, lt, lte, in | | `lng` | `number` | equals, gt, gte, lt, lte, in | | `aqi` | `number` | equals, gt, gte, lt, lte, in | | `aqiCategory` | `string` | equals, contains, startsWith, endsWith, in | | `dominantPollutant` | `string` | equals, contains, startsWith, endsWith, in | | `pm25` | `number` | equals, gt, gte, lt, lte, in | | `pm10` | `number` | equals, gt, gte, lt, lte, in | | `no2` | `number` | equals, gt, gte, lt, lte, in | | `so2` | `number` | equals, gt, gte, lt, lte, in | | `co` | `number` | equals, gt, gte, lt, lte, in | | `ozone` | `number` | equals, gt, gte, lt, lte, in | | `observedAt` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Geocoded Places Path: `ambee.db.geocodedPlaces.search` ```ts theme={null} const rows = await corsair.ambee.db.geocodedPlaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `lat` | `number` | equals, gt, gte, lt, lte, in | | `lng` | `number` | equals, gt, gte, lt, lte, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `postalCode` | `string` | equals, contains, startsWith, endsWith, in | | `placeName` | `string` | equals, contains, startsWith, endsWith, in | | `formattedAddress` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Weather Observations Path: `ambee.db.weatherObservations.search` ```ts theme={null} const rows = await corsair.ambee.db.weatherObservations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `locationKey` | `string` | equals, contains, startsWith, endsWith, in | | `lat` | `number` | equals, gt, gte, lt, lte, in | | `lng` | `number` | equals, gt, gte, lt, lte, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | | `temperature` | `number` | equals, gt, gte, lt, lte, in | | `apparentTemperature` | `number` | equals, gt, gte, lt, lte, in | | `humidity` | `number` | equals, gt, gte, lt, lte, in | | `pressure` | `number` | equals, gt, gte, lt, lte, in | | `windSpeed` | `number` | equals, gt, gte, lt, lte, in | | `windGust` | `number` | equals, gt, gte, lt, lte, in | | `cloudCover` | `number` | equals, gt, gte, lt, lte, in | | `uvIndex` | `number` | equals, gt, gte, lt, lte, in | | `observedAt` | `number` | equals, gt, gte, lt, lte, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/ambee/overview Environmental data API for air quality, pollen, weather, and wildfire information. Use **Ambee** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 29 typed API operations * 3 synced entities (`airQualityReadings`, `geocodedPlaces`, `weatherObservations`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ambee ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ambee ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ambee ``` ```bash bun theme={null} bun add corsair @corsair-dev/ambee ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ambee } from '@corsair-dev/ambee'; export const corsair = createCorsair({ plugins: [ ambee(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ambee() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ambee', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`airQuality.getForecastByLatLng`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ambee.api.airQuality.getForecastByLatLng({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/ambee/api) reference.* See the full list on the [API](/plugins/ambee/api) page. ## Query synced data Synced entities support `tenant.ambee.db..search()` and `.list()`: `airQualityReadings`, `geocodedPlaces`, `weatherObservations`. See [Database](/plugins/ambee/database) for filters and operators. ## What's next > **[API reference](/plugins/ambee/api)** > > Every `ambee.api.*` operation with input and output types. > **[Database](/plugins/ambee/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/ambientweather/api API reference for Ambient Weather: every `ambientweather.api.*` operation with input and output types. Every `ambientweather.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Devices ### getData `devices.getData` Fetch historical weather data for a specific Ambient Weather device **Risk:** `read` ```ts theme={null} await corsair.ambientweather.api.devices.getData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `macAddress` | `string` | Yes | — | | `limit` | `number` | No | — | | `endDate` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > dateutc: number, > date?: string, > tz?: string, > winddir?: number, > windspeedmph?: number, > windgustmph?: number, > maxdailygust?: number, > windgustdir?: number, > winddir_avg2m?: number, > windspdmph_avg2m?: number, > winddir_avg10m?: number, > windspdmph_avg10m?: number, > tempf?: number, > humidity?: number, > baromrelin?: number, > baromabsin?: number, > tempinf?: number, > humidityin?: number, > hourlyrainin?: number, > dailyrainin?: number, > weeklyrainin?: number, > monthlyrainin?: number, > yearlyrainin?: number, > eventrainin?: number, > totalrainin?: number, > uv?: number, > solarradiation?: number, > feelsLike?: number, > dewPoint?: number, > lastRain?: string > }[] > ``` *** ### list `devices.list` List all Ambient Weather devices for the connected account with their latest readings **Risk:** `read` ```ts theme={null} await corsair.ambientweather.api.devices.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > macAddress: string, > info: { > name: string, > location?: string > }, > lastData: { > dateutc: number, > date?: string, > tz?: string, > winddir?: number, > windspeedmph?: number, > windgustmph?: number, > maxdailygust?: number, > windgustdir?: number, > winddir_avg2m?: number, > windspdmph_avg2m?: number, > winddir_avg10m?: number, > windspdmph_avg10m?: number, > tempf?: number, > humidity?: number, > baromrelin?: number, > baromabsin?: number, > tempinf?: number, > humidityin?: number, > hourlyrainin?: number, > dailyrainin?: number, > weeklyrainin?: number, > monthlyrainin?: number, > yearlyrainin?: number, > eventrainin?: number, > totalrainin?: number, > uv?: number, > solarradiation?: number, > feelsLike?: number, > dewPoint?: number, > lastRain?: string > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/ambientweather/database Ambient Weather local sync: searchable entities, `.search()` filters, and operators. The Ambient Weather plugin syncs data locally. Use `corsair.ambientweather.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Devices Path: `ambientweather.db.devices.search` ```ts theme={null} const rows = await corsair.ambientweather.db.devices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `macAddress` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `dateutc` | `number` | equals, gt, gte, lt, lte, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `tz` | `string` | equals, contains, startsWith, endsWith, in | | `winddir` | `number` | equals, gt, gte, lt, lte, in | | `windspeedmph` | `number` | equals, gt, gte, lt, lte, in | | `windgustmph` | `number` | equals, gt, gte, lt, lte, in | | `maxdailygust` | `number` | equals, gt, gte, lt, lte, in | | `windgustdir` | `number` | equals, gt, gte, lt, lte, in | | `winddir_avg2m` | `number` | equals, gt, gte, lt, lte, in | | `windspdmph_avg2m` | `number` | equals, gt, gte, lt, lte, in | | `winddir_avg10m` | `number` | equals, gt, gte, lt, lte, in | | `windspdmph_avg10m` | `number` | equals, gt, gte, lt, lte, in | | `tempf` | `number` | equals, gt, gte, lt, lte, in | | `humidity` | `number` | equals, gt, gte, lt, lte, in | | `baromrelin` | `number` | equals, gt, gte, lt, lte, in | | `baromabsin` | `number` | equals, gt, gte, lt, lte, in | | `tempinf` | `number` | equals, gt, gte, lt, lte, in | | `humidityin` | `number` | equals, gt, gte, lt, lte, in | | `hourlyrainin` | `number` | equals, gt, gte, lt, lte, in | | `dailyrainin` | `number` | equals, gt, gte, lt, lte, in | | `weeklyrainin` | `number` | equals, gt, gte, lt, lte, in | | `monthlyrainin` | `number` | equals, gt, gte, lt, lte, in | | `yearlyrainin` | `number` | equals, gt, gte, lt, lte, in | | `eventrainin` | `number` | equals, gt, gte, lt, lte, in | | `totalrainin` | `number` | equals, gt, gte, lt, lte, in | | `uv` | `number` | equals, gt, gte, lt, lte, in | | `solarradiation` | `number` | equals, gt, gte, lt, lte, in | | `feelsLike` | `number` | equals, gt, gte, lt, lte, in | | `dewPoint` | `number` | equals, gt, gte, lt, lte, in | | `lastRain` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Readings Path: `ambientweather.db.readings.search` ```ts theme={null} const rows = await corsair.ambientweather.db.readings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `macAddress` | `string` | equals, contains, startsWith, endsWith, in | | `dateutc` | `number` | equals, gt, gte, lt, lte, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `tz` | `string` | equals, contains, startsWith, endsWith, in | | `winddir` | `number` | equals, gt, gte, lt, lte, in | | `windspeedmph` | `number` | equals, gt, gte, lt, lte, in | | `windgustmph` | `number` | equals, gt, gte, lt, lte, in | | `maxdailygust` | `number` | equals, gt, gte, lt, lte, in | | `windgustdir` | `number` | equals, gt, gte, lt, lte, in | | `winddir_avg2m` | `number` | equals, gt, gte, lt, lte, in | | `windspdmph_avg2m` | `number` | equals, gt, gte, lt, lte, in | | `winddir_avg10m` | `number` | equals, gt, gte, lt, lte, in | | `windspdmph_avg10m` | `number` | equals, gt, gte, lt, lte, in | | `tempf` | `number` | equals, gt, gte, lt, lte, in | | `humidity` | `number` | equals, gt, gte, lt, lte, in | | `baromrelin` | `number` | equals, gt, gte, lt, lte, in | | `baromabsin` | `number` | equals, gt, gte, lt, lte, in | | `tempinf` | `number` | equals, gt, gte, lt, lte, in | | `humidityin` | `number` | equals, gt, gte, lt, lte, in | | `hourlyrainin` | `number` | equals, gt, gte, lt, lte, in | | `dailyrainin` | `number` | equals, gt, gte, lt, lte, in | | `weeklyrainin` | `number` | equals, gt, gte, lt, lte, in | | `monthlyrainin` | `number` | equals, gt, gte, lt, lte, in | | `yearlyrainin` | `number` | equals, gt, gte, lt, lte, in | | `eventrainin` | `number` | equals, gt, gte, lt, lte, in | | `totalrainin` | `number` | equals, gt, gte, lt, lte, in | | `uv` | `number` | equals, gt, gte, lt, lte, in | | `solarradiation` | `number` | equals, gt, gte, lt, lte, in | | `feelsLike` | `number` | equals, gt, gte, lt, lte, in | | `dewPoint` | `number` | equals, gt, gte, lt, lte, in | | `lastRain` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/ambientweather/overview Personal weather station network API for local and hyperlocal weather readings. Use **Ambient Weather** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 2 typed API operations * 2 synced entities (`devices`, `readings`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ambientweather ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ambientweather ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ambientweather ``` ```bash bun theme={null} bun add corsair @corsair-dev/ambientweather ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ambientweather } from '@corsair-dev/ambientweather'; export const corsair = createCorsair({ plugins: [ ambientweather(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ambientweather() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ambientweather', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`devices.getData`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ambientweather.api.devices.getData({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/ambientweather/api) reference.* See the full list on the [API](/plugins/ambientweather/api) page. ## Query synced data Synced entities support `tenant.ambientweather.db..search()` and `.list()`: `devices`, `readings`. See [Database](/plugins/ambientweather/database) for filters and operators. ## What's next > **[API reference](/plugins/ambientweather/api)** > > Every `ambientweather.api.*` operation with input and output types. > **[Database](/plugins/ambientweather/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/amcards/api API reference for AMcards: every `amcards.api.*` operation with input and output types. Every `amcards.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Cards ### list `cards.list` List cards for the authenticated account **Risk:** `read` ```ts theme={null} await corsair.amcards.api.cards.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | Rows to skip (sent as Tastypie/DRF `offset`) | | `limit` | `number` | No | Page size | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: number | string > }[] | { > count?: number, > next?: string | null, > previous?: string | null, > results?: { > id: number | string > }[], > meta?: { > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total_count?: number > }, > objects?: { > id: number | string > }[] > } > ``` *** ## Categories ### get `categories.get` Get a card template category by id **Risk:** `read` ```ts theme={null} await corsair.amcards.api.categories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `title` | `string` | No | — | | `priority` | `number` | No | — | | `parent` | `any` | No | — | | `hierarchy` | `any` | No | — | *** ### list `categories.list` List card template categories ordered by priority **Risk:** `read` ```ts theme={null} await corsair.amcards.api.categories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent__id` | `number` | No | Filter sub-categories by parent id | | `title__icontains` | `string` | No | Case-insensitive title search | | `parent__title__icontains` | `string` | No | Case-insensitive parent title search | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: number | string, > title?: string | null, > priority?: number | null, > parent?: any, > hierarchy?: any > }[] | { > count?: number, > next?: string | null, > previous?: string | null, > results?: { > id: number | string, > title?: string | null, > priority?: number | null, > parent?: any, > hierarchy?: any > }[], > meta?: { > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total_count?: number > }, > objects?: { > id: number | string, > title?: string | null, > priority?: number | null, > parent?: any, > hierarchy?: any > }[] > } > ``` *** ## Contacts ### list `contacts.list` List contacts, optionally filtered by name or email **Risk:** `read` ```ts theme={null} await corsair.amcards.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | Rows to skip (sent as Tastypie/DRF `offset`) | | `limit` | `number` | No | Page size | | `email` | `string` | No | Filter by email | | `first_name` | `string` | No | Filter by first name | | `last_name` | `string` | No | Filter by last name | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: number | string, > first_name?: string | null, > last_name?: string | null, > email?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] | { > count?: number, > next?: string | null, > previous?: string | null, > results?: { > id: number | string, > first_name?: string | null, > last_name?: string | null, > email?: string | null, > created_at?: string | null, > updated_at?: string | null > }[], > meta?: { > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total_count?: number > }, > objects?: { > id: number | string, > first_name?: string | null, > last_name?: string | null, > email?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] > } > ``` *** ## Gifts ### get `gifts.get` Get a gift by id **Risk:** `read` ```ts theme={null} await corsair.amcards.api.gifts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `price` | `string \| number` | No | — | | `shipping_cost` | `string \| number` | No | — | | `available` | `boolean` | No | — | | `availability` | `string \| boolean` | No | — | *** ### list `gifts.list` List available gifts **Risk:** `read` ```ts theme={null} await corsair.amcards.api.gifts.list({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: number | string, > name?: string | null, > description?: string | null, > price?: string | number | null, > shipping_cost?: string | number | null, > available?: boolean, > availability?: string | boolean > }[] | { > count?: number, > next?: string | null, > previous?: string | null, > results?: { > id: number | string, > name?: string | null, > description?: string | null, > price?: string | number | null, > shipping_cost?: string | number | null, > available?: boolean, > availability?: string | boolean > }[], > meta?: { > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total_count?: number > }, > objects?: { > id: number | string, > name?: string | null, > description?: string | null, > price?: string | number | null, > shipping_cost?: string | number | null, > available?: boolean, > availability?: string | boolean > }[] > } > ``` *** ## Schema ### getApi `schema.getApi` Retrieve the AMcards API v1 schema (resource map) **Risk:** `read` ```ts theme={null} await corsair.amcards.api.schema.getApi({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getCategory `schema.getCategory` Retrieve the readonly Category resource schema **Risk:** `read` ```ts theme={null} await corsair.amcards.api.schema.getCategory({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Templates ### get `templates.get` Get a public card template by id **Risk:** `read` ```ts theme={null} await corsair.amcards.api.templates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `category` | `any` | No | — | | `configuration` | `any` | No | — | | `panels` | `any` | No | — | | `metadata` | `any` | No | — | *** ### list `templates.list` List public card templates **Risk:** `read` ```ts theme={null} await corsair.amcards.api.templates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category__id` | `number` | No | Filter templates by category id | | `name__icontains` | `string` | No | Case-insensitive template name search | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: number | string, > name?: string | null, > category?: any, > configuration?: any, > panels?: any, > metadata?: any > }[] | { > count?: number, > next?: string | null, > previous?: string | null, > results?: { > id: number | string, > name?: string | null, > category?: any, > configuration?: any, > panels?: any, > metadata?: any > }[], > meta?: { > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total_count?: number > }, > objects?: { > id: number | string, > name?: string | null, > category?: any, > configuration?: any, > panels?: any, > metadata?: any > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/amcards/database AMcards local sync: searchable entities, `.search()` filters, and operators. The AMcards plugin syncs data locally. Use `corsair.amcards.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Cards Path: `amcards.db.cards.search` ```ts theme={null} const rows = await corsair.amcards.db.cards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Categories Path: `amcards.db.categories.search` ```ts theme={null} const rows = await corsair.amcards.db.categories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `amcards.db.contacts.search` ```ts theme={null} const rows = await corsair.amcards.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Gifts Path: `amcards.db.gifts.search` ```ts theme={null} const rows = await corsair.amcards.db.gifts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `available` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `amcards.db.templates.search` ```ts theme={null} const rows = await corsair.amcards.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/amcards/overview Automated greeting card platform for sending personalized physical mail campaigns. Use **AMcards** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 10 typed API operations * 5 synced entities (`cards`, `categories`, `contacts`, `gifts`, `templates`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/amcards ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/amcards ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/amcards ``` ```bash bun theme={null} bun add corsair @corsair-dev/amcards ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { amcards } from '@corsair-dev/amcards'; export const corsair = createCorsair({ plugins: [ amcards(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} amcards() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'amcards', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`cards.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.amcards.api.cards.list({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/amcards/api) reference.* See the full list on the [API](/plugins/amcards/api) page. ## Query synced data Synced entities support `tenant.amcards.db..search()` and `.list()`: `cards`, `categories`, `contacts`, `gifts`, `templates`. See [Database](/plugins/amcards/database) for filters and operators. ## What's next > **[API reference](/plugins/amcards/api)** > > Every `amcards.api.*` operation with input and output types. > **[Database](/plugins/amcards/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/amplitude/api API reference for Amplitude: every `amplitude.api.*` operation with input and output types. Every `amplitude.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Annotations ### create `annotations.create` Create a new chart annotation on a specific date **Risk:** `write` ```ts theme={null} await corsair.amplitude.api.annotations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | Yes | — | | `label` | `string` | Yes | — | | `details` | `string` | No | — | | `app_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: number, > date: string, > label: string, > details?: string, > app_id?: number > } > ``` *** ### list `annotations.list` List all chart annotations for the project **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.annotations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id: number, > date: string, > label: string, > details?: string, > app_id?: number, > source?: string > }[] > ``` *** ## Charts ### get `charts.get` Get the data results for a specific chart by ID **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.charts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chart_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `seriesLabels` | `string[]` | No | — | | `title` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > series?: { > type?: string, > values?: any[] > }[], > xValues?: string[] > } > ``` *** ## Cohorts ### create `cohorts.create` Create a new static cohort from a list of user or device IDs **Risk:** `write` ```ts theme={null} await corsair.amplitude.api.cohorts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `app_id` | `number` | Yes | — | | `id_type` | `BY_AMP_ID \| BY_USER_ID \| BY_DEVICE_ID` | Yes | — | | `ids` | `string[]` | Yes | — | | `owners` | `string[]` | No | — | | `description` | `string` | No | — | | `published` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cohort` | `object` | No | — | > **cohort full type** > > ```ts theme={null} > { > id: string, > name: string, > size?: number, > last_computed?: number > } > ``` *** ### get `cohorts.get` Get details for a specific cohort by ID **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.cohorts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cohort_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cohort` | `object` | No | — | > **cohort full type** > > ```ts theme={null} > { > id: string, > name: string, > owners?: string[], > description?: string | null, > published?: boolean, > archived?: boolean, > app_id?: number, > size?: number, > last_computed?: number, > last_modified?: number, > is_predefined?: boolean, > type?: string > } > ``` *** ### getMembers `cohorts.getMembers` Retrieve the member download for a cohort export request **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.cohorts.getMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `zip_url` | `string` | No | — | *** ### list `cohorts.list` List all cohorts in the project **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.cohorts.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `cohorts` | `object[]` | No | — | > **cohorts full type** > > ```ts theme={null} > { > id: string, > name: string, > owners?: string[], > description?: string | null, > published?: boolean, > archived?: boolean, > app_id?: number, > size?: number | null, > last_computed?: number, > last_modified?: number, > is_predefined?: boolean, > type?: string > }[] > ``` *** ## Dashboards ### get `dashboards.get` Get details and chart list for a specific dashboard **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.dashboards.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dashboard_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dashboard` | `object` | No | — | > **dashboard full type** > > ```ts theme={null} > { > id: number, > name: string, > description?: string, > created?: string, > lastUpdated?: string, > createdBy?: string, > published?: boolean, > charts?: { > id: string, > name?: string > }[] > } > ``` *** ### list `dashboards.list` List all dashboards in the project **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.dashboards.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `dashboards` | `object[]` | No | — | > **dashboards full type** > > ```ts theme={null} > { > id: number, > name: string, > description?: string, > created?: string, > lastUpdated?: string, > createdBy?: string, > published?: boolean > }[] > ``` *** ## Events ### getList `events.getList` List all event types tracked in the project **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.events.getList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > event_type?: string, > display_name?: string, > totals?: number, > totals_delta?: number, > hidden?: boolean, > deleted?: boolean, > non_active?: boolean > }[] > ``` *** ### identifyUser `events.identifyUser` Set or update user properties via the Identify API **Risk:** `write` ```ts theme={null} await corsair.amplitude.api.events.identifyUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_key` | `string` | Yes | — | | `identification` | `object[]` | Yes | — | > **identification full type** > > ```ts theme={null} > { > user_id?: string, > device_id?: string, > user_properties: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `error` | `string` | No | — | *** ### upload `events.upload` Upload one or more events to Amplitude via HTTP API v2 **Risk:** `write` ```ts theme={null} await corsair.amplitude.api.events.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_key` | `string` | Yes | — | | `events` | `object[]` | Yes | — | | `options` | `object` | No | — | > **events full type** > > ```ts theme={null} > { > event_type: string, > user_id?: string, > device_id?: string, > time?: number, > event_properties?: { > }, > user_properties?: { > }, > app_version?: string, > platform?: string, > os_name?: string, > os_version?: string, > device_brand?: string, > device_manufacturer?: string, > device_model?: string, > carrier?: string, > country?: string, > region?: string, > city?: string, > language?: string, > ip?: string, > insert_id?: string, > session_id?: number > }[] > ``` > **options full type** > > ```ts theme={null} > { > min_id_length?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `events_ingested` | `number` | No | — | | `payload_size_bytes` | `number` | No | — | | `server_upload_time` | `number` | No | — | *** ### uploadBatch `events.uploadBatch` Batch upload events to Amplitude **Risk:** `write` ```ts theme={null} await corsair.amplitude.api.events.uploadBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_key` | `string` | Yes | — | | `events` | `object[]` | Yes | — | | `options` | `object` | No | — | > **events full type** > > ```ts theme={null} > { > event_type: string, > user_id?: string, > device_id?: string, > time?: number, > event_properties?: { > }, > user_properties?: { > }, > app_version?: string, > platform?: string, > os_name?: string, > os_version?: string, > device_brand?: string, > device_manufacturer?: string, > device_model?: string, > carrier?: string, > country?: string, > region?: string, > city?: string, > language?: string, > ip?: string, > insert_id?: string, > session_id?: number > }[] > ``` > **options full type** > > ```ts theme={null} > { > min_id_length?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `events_ingested` | `number` | No | — | | `payload_size_bytes` | `number` | No | — | | `server_upload_time` | `number` | No | — | *** ## Exports ### getData `exports.getData` Export raw event data for a given time range as a zip archive **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.exports.getData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start` | `string` | Yes | — | | `end` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `url` | `string` | No | — | *** ## Users ### getActivity `users.getActivity` Get recent event activity for a specific user **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.users.getActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `number` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `events` | `object[]` | No | — | | `userData` | `object` | No | — | > **events full type** > > ```ts theme={null} > { > event_type?: string, > event_time?: string, > event_properties?: { > }, > session_id?: number, > amplitude_id?: number > }[] > ``` > **userData full type** > > ```ts theme={null} > { > num_events?: number, > num_sessions?: number, > first_used?: string, > last_used?: string, > canonical_amplitude_id?: number > } > ``` *** ### getProfile `users.getProfile` Get the profile and properties for a specific user **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.users.getProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `amplitude_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `userData` | `object` | No | — | > **userData full type** > > ```ts theme={null} > { > user_id?: string, > amplitude_id?: number, > canonical_amplitude_id?: number, > merged_amplitude_ids?: number[], > is_identified?: boolean, > user_properties?: { > }, > country?: string, > region?: string, > city?: string, > language?: string, > platform?: string, > os?: string, > device?: string, > last_seen?: number > } > ``` *** ### search `users.search` Search for users by user ID or device ID **Risk:** `read` ```ts theme={null} await corsair.amplitude.api.users.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `matches` | `object[]` | No | — | | `next` | `string` | No | — | > **matches full type** > > ```ts theme={null} > { > amplitude_id: number, > user_id?: string, > last_seen?: number, > is_identified?: boolean, > country?: string, > city?: string, > platform?: string, > os?: string, > device?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/amplitude/database Amplitude local sync: searchable entities, `.search()` filters, and operators. The Amplitude plugin syncs data locally. Use `corsair.amplitude.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Cohorts Path: `amplitude.db.cohorts.search` ```ts theme={null} const rows = await corsair.amplitude.db.cohorts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `app_id` | `number` | equals, gt, gte, lt, lte, in | | `published` | `boolean` | equals | | `archived` | `boolean` | equals | | `size` | `number` | equals, gt, gte, lt, lte, in | | `last_computed` | `number` | equals, gt, gte, lt, lte, in | | `last_modified` | `number` | equals, gt, gte, lt, lte, in | | `is_predefined` | `boolean` | equals | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Events Path: `amplitude.db.events.search` ```ts theme={null} const rows = await corsair.amplitude.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `event_type` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `device_id` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `number` | equals, gt, gte, lt, lte, in | | `app_version` | `string` | equals, contains, startsWith, endsWith, in | | `platform` | `string` | equals, contains, startsWith, endsWith, in | | `os_name` | `string` | equals, contains, startsWith, endsWith, in | | `os_version` | `string` | equals, contains, startsWith, endsWith, in | | `device_brand` | `string` | equals, contains, startsWith, endsWith, in | | `device_manufacturer` | `string` | equals, contains, startsWith, endsWith, in | | `device_model` | `string` | equals, contains, startsWith, endsWith, in | | `carrier` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `dma` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `insert_id` | `string` | equals, contains, startsWith, endsWith, in | | `session_id` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `amplitude.db.users.search` ```ts theme={null} const rows = await corsair.amplitude.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `canonical_amplitude_id` | `number` | equals, gt, gte, lt, lte, in | | `last_seen` | `number` | equals, gt, gte, lt, lte, in | | `is_identified` | `boolean` | equals | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `platform` | `string` | equals, contains, startsWith, endsWith, in | | `os` | `string` | equals, contains, startsWith, endsWith, in | | `device` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/amplitude/get-credentials Step-by-step instructions for obtaining Amplitude API credentials and webhook verification secrets. This guide walks you through obtaining all required credentials for the Amplitude plugin. ## Authentication Method The Amplitude plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) — Credentials for Amplitude’s HTTP APIs (Dashboard API uses Basic auth) Corsair stores a **single** `api_key` string. For endpoints that call the **Dashboard API**, Amplitude expects HTTP Basic auth built from your **API key** and **secret key** joined with a colon. ### Step 1: Get API Key and Secret Key 1. Log in to [Amplitude](https://amplitude.com). 2. Open **Settings** → **Projects** and select your project (or use **Organization settings** as appropriate). 3. Open the **API Keys** section for that project. 4. Copy the **API Key** and **Secret Key** (sometimes labeled **Secret**). ### Step 2: Store as One Credential Combine them exactly as `API_KEY:SECRET_KEY` (a single colon between the two values, no spaces). This matches how Amplitude’s Dashboard API expects Basic authentication to be constructed. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=amplitude api_key='YOUR_API_KEY:YOUR_SECRET_KEY' ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=amplitude --credentials ``` Some Amplitude HTTP APIs pass an `api_key` field in JSON bodies for event payloads; those flows may use the project **API key** alone. Refer to the operation you are calling and Amplitude’s docs for that API if you need only the public API key. ## Webhook Secret Amplitude can send signed webhooks to your app. Configure the webhook in the Amplitude product UI and copy the **secret** used to verify the `X-Amplitude-Signature` (or equivalent) header for your destination. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=amplitude webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | `API_KEY:SECRET_KEY` string | [`api_key`](/concepts/api-key) (Dashboard API / Basic) | Project → API Keys | | Webhook secret | Webhook verification | Amplitude webhook destination settings | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/amplitude/overview Product analytics platform for tracking user behavior, funnels, and retention metrics. Use **Amplitude** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 17 typed API operations * 3 synced entities (`cohorts`, `events`, `users`) for fast `.search()` / `.list()` * 7 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/amplitude ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/amplitude ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/amplitude ``` ```bash bun theme={null} bun add corsair @corsair-dev/amplitude ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { amplitude } from '@corsair-dev/amplitude'; export const corsair = createCorsair({ plugins: [ amplitude(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/amplitude/get-credentials). ```ts theme={null} amplitude() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'amplitude', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`annotations.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.amplitude.api.annotations.list({}); ``` **`annotations.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.amplitude.api.annotations.create({}); ``` See the full list on the [API](/plugins/amplitude/api) page. ## Query synced data Synced entities support `tenant.amplitude.db..search()` and `.list()`: `cohorts`, `events`, `users`. See [Database](/plugins/amplitude/database) for filters and operators. ## Webhooks This plugin registers **7** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/amplitude/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/amplitude/api)** > > Every `amplitude.api.*` operation with input and output types. > **[Database](/plugins/amplitude/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/amplitude/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/amplitude/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/amplitude/webhooks Amplitude incoming webhooks: event paths, payloads, and response data. The Amplitude plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/amplitude/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `annotations` * `created` (`annotations.created`) * `updated` (`annotations.updated`) * `cohorts` * `computed` (`cohorts.computed`) * `events` * `identify` (`events.identify`) * `track` (`events.track`) * `experiments` * `exposure` (`experiments.exposure`) * `monitors` * `alert` (`monitors.alert`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Annotations ### Created `annotations.created` A new chart annotation was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `annotation.created` | Yes | — | | `annotation_id` | `number` | Yes | — | | `date` | `string` | Yes | — | | `label` | `string` | Yes | — | | `details` | `string` | No | — | | `app_id` | `number` | No | — | | `source` | `string` | No | — | | `created_at` | `string` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > type: annotation.created, > annotation_id: number, > date: string, > label: string, > details?: string, > app_id?: number, > source?: string, > created_at: string > } > ``` **`webhookHooks` example** ```ts theme={null} amplitude({ webhookHooks: { annotations: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `annotations.updated` A chart annotation was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `annotation.updated` | Yes | — | | `annotation_id` | `number` | Yes | — | | `date` | `string` | Yes | — | | `label` | `string` | Yes | — | | `details` | `string` | No | — | | `app_id` | `number` | No | — | | `source` | `string` | No | — | | `updated_at` | `string` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > type: annotation.updated, > annotation_id: number, > date: string, > label: string, > details?: string, > app_id?: number, > source?: string, > updated_at: string > } > ``` **`webhookHooks` example** ```ts theme={null} amplitude({ webhookHooks: { annotations: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Cohorts ### Computed `cohorts.computed` A cohort finished computing **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `cohort.computed` | Yes | — | | `cohort_id` | `string` | Yes | — | | `cohort_name` | `string` | Yes | — | | `app_id` | `number` | No | — | | `size` | `number` | Yes | — | | `computed_at` | `string` | Yes | — | | `published` | `boolean` | No | — | > **Response data full type** > > ```ts theme={null} > { > type: cohort.computed, > cohort_id: string, > cohort_name: string, > app_id?: number, > size: number, > computed_at: string, > published?: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} amplitude({ webhookHooks: { cohorts: { computed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Events ### Identify `events.identify` A user identify call was received by Amplitude **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `event.identify` | Yes | — | | `user_id` | `string` | No | — | | `device_id` | `string` | No | — | | `time` | `number` | Yes | — | | `user_properties` | `object` | No | — | | `app_version` | `string` | No | — | | `platform` | `string` | No | — | | `insert_id` | `string` | No | — | > **user\_properties full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: event.identify, > user_id?: string, > device_id?: string, > time: number, > user_properties?: { > }, > app_version?: string, > platform?: string, > insert_id?: string > } > ``` **`webhookHooks` example** ```ts theme={null} amplitude({ webhookHooks: { events: { identify: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Track `events.track` An event was tracked by Amplitude **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `event.track` | Yes | — | | `event_id` | `string` | Yes | — | | `event_type` | `string` | Yes | — | | `user_id` | `string` | No | — | | `device_id` | `string` | No | — | | `time` | `number` | Yes | — | | `event_properties` | `object` | No | — | | `user_properties` | `object` | No | — | | `app_version` | `string` | No | — | | `platform` | `string` | No | — | | `session_id` | `number` | No | — | | `insert_id` | `string` | No | — | > **event\_properties full type** > > ```ts theme={null} > { > } > ``` > **user\_properties full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: event.track, > event_id: string, > event_type: string, > user_id?: string, > device_id?: string, > time: number, > event_properties?: { > }, > user_properties?: { > }, > app_version?: string, > platform?: string, > session_id?: number, > insert_id?: string > } > ``` **`webhookHooks` example** ```ts theme={null} amplitude({ webhookHooks: { events: { track: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Experiments ### Exposure `experiments.exposure` An experiment exposure was tracked for a user **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `experiment.exposure` | Yes | — | | `flag_key` | `string` | Yes | — | | `variant` | `string` | Yes | — | | `user` | `object` | Yes | — | | `time` | `number` | Yes | — | | `experiment_key` | `string` | No | — | | `metadata` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > user_id?: string, > device_id?: string, > user_properties?: { > }, > country?: string, > city?: string, > region?: string, > language?: string, > platform?: string, > os?: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > deployment_name?: string, > flag_version?: number > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: experiment.exposure, > flag_key: string, > variant: string, > user: { > user_id?: string, > device_id?: string, > user_properties?: { > }, > country?: string, > city?: string, > region?: string, > language?: string, > platform?: string, > os?: string > }, > time: number, > experiment_key?: string, > metadata?: { > deployment_name?: string, > flag_version?: number > } > } > ``` **`webhookHooks` example** ```ts theme={null} amplitude({ webhookHooks: { experiments: { exposure: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Monitors ### Alert `monitors.alert` An alert monitor threshold was triggered **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `monitor.alert` | Yes | — | | `monitor_id` | `string` | Yes | — | | `monitor_name` | `string` | Yes | — | | `alert_type` | `string` | Yes | — | | `condition` | `string` | No | — | | `value` | `number` | No | — | | `threshold` | `number` | No | — | | `triggered_at` | `string` | Yes | — | | `chart_id` | `string` | No | — | | `dashboard_id` | `number` | No | — | | `recipients` | `string[]` | No | — | > **Response data full type** > > ```ts theme={null} > { > type: monitor.alert, > monitor_id: string, > monitor_name: string, > alert_type: string, > condition?: string, > value?: number, > threshold?: number, > triggered_at: string, > chart_id?: string, > dashboard_id?: number, > recipients?: string[] > } > ``` **`webhookHooks` example** ```ts theme={null} amplitude({ webhookHooks: { monitors: { alert: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/anchorbrowser/api API reference for Anchor Browser: every `anchorbrowser.api.*` operation with input and output types. Every `anchorbrowser.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agent ### listAgentResources `agent.listAgentResources` List all agent resources (files) uploaded to a browser session. Returns metadata for each file including name, size, file type, and last modified timestamp. Requires an active running session - use START\_BROWSER\_SESSION first. Files can be uploaded using UPLOAD\_FILE action. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.agent.listAgentResources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### pauseAgent `agent.pauseAgent` Tool to pause the AI agent for a specific browser session. Use when you need to temporarily halt autonomous agent execution while keeping the session active. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.agent.pauseAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### resumeAgent `agent.resumeAgent` Tool to resume the AI agent for a specific browser session. Use when you need to restart agent execution after it has been paused or stopped. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.agent.resumeAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### uploadFile `agent.uploadFile` Tool to upload a file to a browser session as an agent resource. Use after starting or referencing a session when you need to provide file inputs (single files or ZIP archives) for web forms or AI-driven tasks. Supports direct base64-encoded content or S3 key references from other actions. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.agent.uploadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | Yes | — | | `sessionId` | `string` | Yes | — | | `file_content_base64` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Batch Sessions ### getBatchSessionStatus `batchSessions.getBatchSessionStatus` Tool to retrieve detailed status information for a specific batch including progress and errors. Use when you need to check the status of a batch session creation request. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.batchSessions.getBatchSessionStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Downloads ### listSessionDownloads `downloads.listSessionDownloads` Tool to retrieve metadata of files downloaded during a browser session. Use after confirming the session ID. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.downloads.listSessionDownloads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Events ### signalEvent `events.signalEvent` Tool to signal a specific event to be received by other processes or sessions. Use when you need real-time coordination across browser sessions after verifying session is active. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.events.signalEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `eventName` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### waitForEvent `events.waitForEvent` Blocks execution until a specific named event is signaled or the timeout expires. Used for cross-session coordination, MFA handling, and workflow synchronization. The event must first be signaled using the Signal Event action. Returns the data payload that was sent with the signal. Events are user-scoped. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.events.waitForEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timeoutMs` | `number` | No | — | | `eventName` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Extensions ### deleteExtension `extensions.deleteExtension` Tool to delete a browser extension and remove it from storage. Use after confirming the extension exists. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anchorbrowser.api.extensions.deleteExtension({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listExtensions `extensions.listExtensions` Retrieves all browser extensions uploaded by the authenticated user. Use this to view available extensions that can be attached to browser sessions for automation tasks. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.extensions.listExtensions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### uploadExtension `extensions.uploadExtension` Tool to upload a new browser extension as a ZIP file for use in browser sessions. Use when you need to add custom extensions that can be attached to automation sessions. The ZIP file must contain a valid extension manifest (manifest.json). Extensions are scoped to the authenticated user and can be listed or attached to sessions later. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.extensions.uploadExtension({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | No | — | | `name` | `string` | Yes | — | | `file_name` | `string` | No | — | | `file_content_base64` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Integrations ### createIntegration `integrations.createIntegration` Tool to create a new integration with a third-party service like 1Password. Use when you need to set up an integration for managing credentials or accessing external services. The integration will be available immediately after creation for use in browser sessions and profiles. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.integrations.createIntegration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `string` | Yes | — | | `credentials` | `object` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **credentials full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteIntegration `integrations.deleteIntegration` Tool to delete an existing integration and remove its stored credentials. Use after confirming the integration ID exists. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anchorbrowser.api.integrations.deleteIntegration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `integrationId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listIntegrations `integrations.listIntegrations` Tool to retrieve all integrations for the authenticated team. Use when you need to view available integrations that can be used with browser sessions. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.integrations.listIntegrations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Os Level ### clickMouse `osLevel.clickMouse` Tool to perform a mouse click at specified coordinates within a browser session. Use when you need to interact with page elements by clicking at specific x/y positions. The click is executed in the context of the specified browser session. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.clickMouse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `x` | `number` | Yes | — | | `y` | `number` | Yes | — | | `button` | `string` | No | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### copySelectedText `osLevel.copySelectedText` Tool to copy currently selected text in a browser session to the clipboard. Use when you need to extract text that the user or automation has selected in the browser. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.copySelectedText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### doubleClickMouse `osLevel.doubleClickMouse` Tool to perform a double click at specified coordinates in a browser session. Use when you need to trigger double-click events on UI elements or specific page locations. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.doubleClickMouse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `x` | `number` | Yes | — | | `y` | `number` | Yes | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### dragAndDrop `osLevel.dragAndDrop` Tool to perform a drag and drop operation from start coordinates to end coordinates within a browser session. Use when you need to simulate dragging UI elements or files in automated workflows. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.dragAndDrop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `endX` | `number` | Yes | — | | `endY` | `number` | Yes | — | | `startX` | `number` | Yes | — | | `startY` | `number` | Yes | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getClipboardContent `osLevel.getClipboardContent` Tool to retrieve the current content of the clipboard from a browser session. Use when you need to read clipboard data from an active session. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.getClipboardContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### moveMouse `osLevel.moveMouse` Tool to move the mouse cursor to specified coordinates within a browser session. Use when you need to simulate mouse movement at the OS level. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.moveMouse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `x` | `number` | Yes | — | | `y` | `number` | Yes | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### navigateToUrl `osLevel.navigateToUrl` Tool to navigate a browser session to a specified URL. Use when you need to direct an existing session to a new webpage. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.navigateToUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### pasteText `osLevel.pasteText` Tool to paste text at the current cursor position in a browser session. Use when you need to insert text into an active form field or text area. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.pasteText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### performKeyboardShortcut `osLevel.performKeyboardShortcut` Tool to perform a keyboard shortcut using specified keys in a browser session. Use when you need to simulate keyboard input like copy (Control+C), paste (Control+V), or any other key combination. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.performKeyboardShortcut({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keys` | `any[]` | Yes | — | | `hold_time` | `number` | No | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### pressMouseButton `osLevel.pressMouseButton` Tool to perform a mouse button down action at specified coordinates within a browser session. Use when you need to simulate pressing and holding a mouse button at a specific screen position. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.pressMouseButton({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `x` | `number` | Yes | — | | `y` | `number` | Yes | — | | `button` | `string` | No | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### releaseMouseButton `osLevel.releaseMouseButton` Tool to release a mouse button at specified coordinates within a browser session. Use when automating mouse interactions that require button release events, such as completing drag operations or simulating natural mouse behavior. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.releaseMouseButton({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `x` | `number` | Yes | — | | `y` | `number` | Yes | — | | `button` | `string` | No | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### scrollSession `osLevel.scrollSession` Tool to perform a scroll action at specified coordinates within a browser session. Use when you need to scroll to specific positions or simulate user scrolling behavior. Example: "Scroll down 100 pixels from position (100, 100) in session sess\_123". **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.scrollSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `x` | `number` | Yes | — | | `y` | `number` | Yes | — | | `steps` | `number` | No | — | | `useOs` | `boolean` | No | — | | `deltaX` | `number` | No | — | | `deltaY` | `number` | Yes | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### setClipboardContent `osLevel.setClipboardContent` Tool to set the content of the clipboard in a browser session. Use when you need to programmatically copy text to the clipboard for automated workflows. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.setClipboardContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### typeText `osLevel.typeText` Tool to type specified text with optional delay between keystrokes. Use when you need to input text into a browser session, such as filling forms or entering search queries. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.osLevel.typeText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `delay` | `number` | No | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Pages ### getSessionPages `pages.getSessionPages` Tool to retrieve all pages associated with a specific browser session. Use when you need to list all open tabs or pages in an active or completed session. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.pages.getSessionPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Profiles ### createProfile `profiles.createProfile` Creates a new browser profile from an active session. A profile stores cookies, local storage, and cache data. The session must be running when this is called; profile data is persisted once the session terminates. Use profiles to maintain persistent browser state across multiple sessions. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.profiles.createProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `source` | `string` | No | — | | `session_id` | `string` | Yes | — | | `description` | `string` | No | — | | `dedicated_sticky_ip` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProfile `profiles.deleteProfile` Tool to delete a browser profile by ID. Use after confirming the profile exists. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anchorbrowser.api.profiles.deleteProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProfile `profiles.getProfile` Tool to retrieve details of a specific profile by its name. Use when you need to fetch information about a particular browser profile. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.profiles.getProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProfiles `profiles.listProfiles` Tool to fetch all stored browser profiles. Use when you need an overview of all profiles available to the authenticated user (e.g., after creating or deleting profiles). **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.profiles.listProfiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProfile `profiles.updateProfile` Updates an existing browser profile with data from an active session. The profile stores cookies, local storage, and cache from the session. Requires an active (running) browser session - the session\_id must reference a session that has not been terminated. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.profiles.updateProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `source` | `string` | No | — | | `session_id` | `string` | Yes | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Recordings ### listSessionRecordings `recordings.listSessionRecordings` Tool to list all recordings for a specific browser session. Use after confirming the session ID. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.recordings.listSessionRecordings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### pauseSessionRecording `recordings.pauseSessionRecording` Tool to pause the video recording for a specific browser session. Use when you need to temporarily stop recording without ending the session. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.recordings.pauseSessionRecording({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### resumeSessionRecording `recordings.resumeSessionRecording` Tool to resume video recording for a specific browser session. Use when recording was previously paused and needs to be restarted. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.recordings.resumeSessionRecording({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Screenshots ### takeScreenshot `screenshots.takeScreenshot` Tool to take a screenshot of the current browser session and return it as an image. Use when you need a visual snapshot of an active browser session. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.screenshots.takeScreenshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Sessions ### endAllSessions `sessions.endAllSessions` Tool to terminate all active browser sessions at once. Use when you need to immediately close every browser session for the authenticated user, such as during cleanup operations or security concerns. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anchorbrowser.api.sessions.endAllSessions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### endBrowserSession `sessions.endBrowserSession` Tool to end a specific browser session by ID. Use after confirming the session ID you want to terminate. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anchorbrowser.api.sessions.endBrowserSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getBrowserSession `sessions.getBrowserSession` Tool to retrieve detailed information about a specific browser session. Use when you need to check the status, configuration, or execution details of a browser session. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.sessions.getBrowserSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listSessions `sessions.listSessions` Tool to list all browser sessions. Use when you need to retrieve both active and inactive sessions. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.sessions.listSessions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `sort_by` | `string` | No | — | | `sort_order` | `string` | No | — | | `search` | `string` | No | — | | `status` | `string` | No | — | | `tags` | `string` | No | — | | `domains` | `string` | No | — | | `created_from` | `string` | No | — | | `created_to` | `string` | No | — | | `batch_id` | `string` | No | — | | `task_initiated` | `boolean` | No | — | | `playground` | `boolean` | No | — | | `proxy` | `boolean` | No | — | | `extra_stealth` | `boolean` | No | — | | `profile_name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### startBrowserSession `sessions.startBrowserSession` Tool to start a new browser session with optional customizations. Use when you need to programmatically allocate an isolated browser instance with recording, proxy, live view, and feature toggles. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.sessions.startBrowserSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `browser` | `object` | No | — | | `session` | `object` | No | — | | `identities` | `any[]` | No | — | | `integrations` | `any[]` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **browser full type** > > ```ts theme={null} > { > } > ``` > **session full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Tasks ### createOrUpdateTaskDraft `tasks.createOrUpdateTaskDraft` Tool to create or update the draft version of a task. Draft versions are used for development and testing before publishing. Use when you need to save task code changes without creating a published version. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tasks.createOrUpdateTaskDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `taskId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createTask `tasks.createTask` Tool to create a new task or update an existing task with the same name. Tasks are reusable TypeScript code snippets that execute in browser sessions. Use when you need to define repeatable automation workflows that can be invoked across multiple sessions. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tasks.createTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | No | — | | `name` | `string` | Yes | — | | `language` | `string` | Yes | — | | `description` | `string` | No | — | | `browserConfiguration` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **browserConfiguration full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteTask `tasks.deleteTask` Tool to soft delete a task and all its versions. Use after confirming the task exists. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anchorbrowser.api.tasks.deleteTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteTaskVersion `tasks.deleteTaskVersion` Tool to soft delete a specific version of a task. The version will no longer be accessible but data is preserved for recovery. Use when you need to remove a specific task version. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anchorbrowser.api.tasks.deleteTaskVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `taskVersion` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deployTask `tasks.deployTask` Tool to deploy a task by creating a new version with auto-incremented version number. Use when you need to publish task changes and make them available for execution. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tasks.deployTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `taskId` | `string` | Yes | — | | `language` | `string` | No | — | | `description` | `string` | No | — | | `browserConfiguration` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **browserConfiguration full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getLatestTaskVersion `tasks.getLatestTaskVersion` Tool to retrieve the latest version of a task including the full base64 encoded code content. Use when you need to access the most recent task implementation. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.tasks.getLatestTaskVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTaskDraft `tasks.getTaskDraft` Tool to retrieve the draft version of a task, including the full Base64 encoded code content. Use when you need to access the current draft of a task that hasn't been published yet. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.tasks.getTaskDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTaskExecutionResult `tasks.getTaskExecutionResult` Tool to retrieve a single task execution result by its ID. Use when you need to check the status, output, or error details of a specific task execution. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.tasks.getTaskExecutionResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `executionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTaskMetadata `tasks.getTaskMetadata` Tool to retrieve task metadata without downloading the full task code. Use when you need task information such as status, creation time, or language without the code content. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.tasks.getTaskMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTaskVersion `tasks.getTaskVersion` Tool to retrieve a specific version of a task, including the full code content. Use when you need to access the complete task code for a particular version (draft, latest, or specific version number). **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.tasks.getTaskVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `taskVersion` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listTaskExecutions `tasks.listTaskExecutions` Tool to retrieve execution history for a specific task with filtering and pagination support. Use when you need to view past execution results, monitor task success rates, or debug failed executions. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.tasks.listTaskExecutions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `string` | No | — | | `limit` | `string` | No | — | | `status` | `string` | No | — | | `taskId` | `string` | Yes | — | | `version` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listTasks `tasks.listTasks` Tool to retrieve a paginated list of all tasks for the authenticated team. Use when you need to view available tasks with their latest version information and metadata. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.tasks.listTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `string` | No | — | | `limit` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listTaskVersions `tasks.listTaskVersions` Tool to retrieve all versions of a specific task, including draft and published versions. Use when you need to view the version history of a task or select a specific version for deployment or execution. **Risk:** `read` ```ts theme={null} await corsair.anchorbrowser.api.tasks.listTaskVersions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### publishTaskVersion `tasks.publishTaskVersion` Tool to publish a specific version of a task. Creates a new version if it doesn't exist, or updates an existing version's metadata. Use when you need to make a specific task version available for execution. Cannot publish to 'draft' versions. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tasks.publishTaskVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `taskId` | `string` | Yes | — | | `language` | `string` | No | — | | `description` | `string` | No | — | | `taskVersion` | `string` | Yes | — | | `browserConfiguration` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **browserConfiguration full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runTask `tasks.runTask` Tool to execute a task in a browser session with a specific or latest version. Use when you need to run an existing task with optional session reuse and configuration overrides. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tasks.runTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `async` | `boolean` | No | — | | `inputs` | `object` | No | — | | `taskId` | `string` | Yes | — | | `version` | `string` | No | — | | `sessionId` | `string` | No | — | | `cleanupSessions` | `boolean` | No | — | | `overrideBrowserConfiguration` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **inputs full type** > > ```ts theme={null} > { > } > ``` > **overrideBrowserConfiguration full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runTaskByName `tasks.runTaskByName` Tool to execute a task by its name, always using the latest version. Use when you need to run a predefined browser automation task by referencing its name. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tasks.runTaskByName({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inputs` | `object` | No | — | | `taskName` | `string` | Yes | — | | `sessionId` | `string` | No | — | | `taskSessionId` | `string` | No | — | | `overrideBrowserConfiguration` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **inputs full type** > > ```ts theme={null} > { > } > ``` > **overrideBrowserConfiguration full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateTaskMetadata `tasks.updateTaskMetadata` Updates task metadata (name and description). This does not affect the task code or versions. Use when you need to update task information without modifying the implementation. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tasks.updateTaskMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `taskId` | `string` | Yes | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Tools ### getWebpageContent `tools.getWebpageContent` Tool to retrieve rendered content of a webpage in HTML or Markdown format. Use when you need to fetch a page’s full content, optionally within an existing browser session. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tools.getWebpageContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `wait` | `number` | No | — | | `format` | `string` | No | — | | `new_page` | `boolean` | No | — | | `sessionId` | `string` | No | — | | `page_index` | `number` | No | — | | `return_partial_on_timeout` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### performWebTask `tools.performWebTask` Tool to perform autonomous web tasks using AI agents. Use when you need to automate complex browser interactions like form filling, data extraction, or multi-step workflows. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tools.performWebTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `agent` | `string` | No | — | | `async` | `boolean` | No | — | | `model` | `string` | No | — | | `prompt` | `string` | Yes | — | | `provider` | `string` | No | — | | `max_steps` | `number` | No | — | | `sessionId` | `string` | No | — | | `output_schema` | `object` | No | — | | `secret_values` | `object` | No | — | | `detect_elements` | `boolean` | No | — | | `highlight_elements` | `boolean` | No | — | | `human_intervention` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **output\_schema full type** > > ```ts theme={null} > { > } > ``` > **secret\_values full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### screenshotWebpage `tools.screenshotWebpage` Tool to take a screenshot of a specified webpage within a session. Use when you need a visual PNG snapshot of a live page. Example: "Capture a 1280×720 screenshot of [https://example.com](https://example.com)". **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.tools.screenshotWebpage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `wait` | `number` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `sessionId` | `string` | No | — | | `image_quality` | `number` | No | — | | `s3_target_address` | `string` | No | — | | `scroll_all_content` | `boolean` | No | — | | `capture_full_height` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Uploads ### uploadFilesToSession `uploads.uploadFilesToSession` Tool to upload files directly to a browser session for use with web forms and file inputs. Use when you need to provide file inputs to web forms during automated browser sessions. **Risk:** `write` ```ts theme={null} await corsair.anchorbrowser.api.uploads.uploadFilesToSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | Yes | — | | `sessionId` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/anchorbrowser/database Anchor Browser local sync: searchable entities, `.search()` filters, and operators. The Anchor Browser plugin syncs data locally. Use `corsair.anchorbrowser.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Profiles Path: `anchorbrowser.db.profiles.search` ```ts theme={null} const rows = await corsair.anchorbrowser.db.profiles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `session_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sessions Path: `anchorbrowser.db.sessions.search` ```ts theme={null} const rows = await corsair.anchorbrowser.db.sessions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `session_id` | `string` | equals, contains, startsWith, endsWith, in | | `team_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `cdp_url` | `string` | equals, contains, startsWith, endsWith, in | | `live_view_url` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `credits_used` | `number` | equals, gt, gte, lt, lte, in | | `playground` | `boolean` | equals | | `proxy_bytes` | `number` | equals, gt, gte, lt, lte, in | | `steps` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `anchorbrowser.db.tasks.search` ```ts theme={null} const rows = await corsair.anchorbrowser.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | | `applicationId` | `string` | equals, contains, startsWith, endsWith, in | | `taskVersionId` | `string` | equals, contains, startsWith, endsWith, in | | `selectedTaskVersion` | `string` | equals, contains, startsWith, endsWith, in | | `latestVersion` | `string` | equals, contains, startsWith, endsWith, in | | `isDraft` | `boolean` | equals | | `outputFileOnly` | `boolean` | equals | | `humanIntervention` | `boolean` | equals | | `aiFallbackEnabled` | `boolean` | equals | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/anchorbrowser/overview Cloud browser automation API for running headless web sessions and scraping tasks. Use **Anchor Browser** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 64 typed API operations * 3 synced entities (`profiles`, `sessions`, `tasks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/anchorbrowser ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/anchorbrowser ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/anchorbrowser ``` ```bash bun theme={null} bun add corsair @corsair-dev/anchorbrowser ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { anchorbrowser } from '@corsair-dev/anchorbrowser'; export const corsair = createCorsair({ plugins: [ anchorbrowser(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} anchorbrowser() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'anchorbrowser', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`agent.listAgentResources`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.anchorbrowser.api.agent.listAgentResources({}); ``` **`agent.pauseAgent`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.anchorbrowser.api.agent.pauseAgent({}); ``` See the full list on the [API](/plugins/anchorbrowser/api) page. ## Query synced data Synced entities support `tenant.anchorbrowser.db..search()` and `.list()`: `profiles`, `sessions`, `tasks`. See [Database](/plugins/anchorbrowser/database) for filters and operators. ## What's next > **[API reference](/plugins/anchorbrowser/api)** > > Every `anchorbrowser.api.*` operation with input and output types. > **[Database](/plugins/anchorbrowser/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/anonyflow/api API reference for Anonyflow: every `anonyflow.api.*` operation with input and output types. Every `anonyflow.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Core ### anonymize `core.anonymize` Anonymize sensitive data in text **Risk:** `write` ```ts theme={null} await corsair.anonyflow.api.core.anonymize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | The raw text to anonymize | **Output** | Name | Type | Required | Description | | - | - | - | - | | `anonymizedText` | `string` | Yes | — | *** ### anonymizePacket `core.anonymizePacket` Encrypt field values within a data packet based on keys **Risk:** `write` ```ts theme={null} await corsair.anonyflow.api.core.anonymizePacket({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | The data packet to anonymize | | `keys` | `string[]` | Yes | The keys within the data packet to anonymize | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `true` | Yes | — | | `value` | `object` | Yes | — | > **value full type** > > ```ts theme={null} > { > } > ``` *** ### deanonymize `core.deanonymize` Restore original text from anonymized mapping **Risk:** `write` ```ts theme={null} await corsair.anonyflow.api.core.deanonymize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `anonymizedText` | `string` | Yes | The anonymized text to decode | **Output** | Name | Type | Required | Description | | - | - | - | - | | `originalText` | `string` | Yes | — | *** ### deanonymizePacket `core.deanonymizePacket` Decrypt field values within a data packet based on keys **Risk:** `write` ```ts theme={null} await corsair.anonyflow.api.core.deanonymizePacket({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | The data packet to deanonymize | | `keys` | `string[]` | Yes | The keys within the data packet to deanonymize | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `true` | Yes | — | | `value` | `object` | Yes | — | > **value full type** > > ```ts theme={null} > { > } > ``` *** ### testConnection `core.testConnection` Verify API key and connectivity **Risk:** `read` ```ts theme={null} await corsair.anonyflow.api.core.testConnection({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `true` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/anonyflow/database Anonyflow local sync: searchable entities, `.search()` filters, and operators. The Anonyflow plugin syncs data locally. Use `corsair.anonyflow.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/anonyflow/overview Privacy-focused data tokenization service for protecting sensitive customer information. Use **Anonyflow** through Corsair: one client, typed API calls. **What you get:** * 5 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/anonyflow ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/anonyflow ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/anonyflow ``` ```bash bun theme={null} bun add corsair @corsair-dev/anonyflow ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { anonyflow } from '@corsair-dev/anonyflow'; export const corsair = createCorsair({ plugins: [ anonyflow(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} anonyflow() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'anonyflow', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`core.testConnection`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.anonyflow.api.core.testConnection({}); ``` **`core.anonymize`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.anonyflow.api.core.anonymize({}); ``` See the full list on the [API](/plugins/anonyflow/api) page. ## What's next > **[API reference](/plugins/anonyflow/api)** > > Every `anonyflow.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/anthropicadministrator/api API reference for Anthropic Admin: every `anthropicadministrator.api.*` operation with input and output types. Every `anthropicadministrator.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Api Keys ### getApiKey `apiKeys.getApiKey` Get a single API key by ID **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.apiKeys.getApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_key_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `created_by` | `object` | No | — | | `expires_at` | `string` | No | — | | `name` | `string` | Yes | — | | `partial_key_hint` | `string` | No | — | | `principal` | `object` | No | — | | `status` | `active \| archived \| expired \| inactive` | Yes | — | | `type` | `api_key` | Yes | — | | `workspace_id` | `string` | No | — | > **created\_by full type** > > ```ts theme={null} > { > id: string, > type: string > } > ``` > **principal full type** > > ```ts theme={null} > { > id: string, > type: string > } > ``` *** ### listApiKeys `apiKeys.listApiKeys` List organization API keys, optionally filtered by status **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.apiKeys.listApiKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `after_id` | `string` | No | Cursor: return the page immediately after this object ID | | `before_id` | `string` | No | Cursor: return the page immediately before this object ID | | `limit` | `number` | No | Items per page (1-1000, default 20) | | `created_by_user_id` | `string` | No | — | | `status` | `active \| archived \| expired \| inactive` | No | — | | `workspace_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > created_at: string, > created_by?: { > id: string, > type: string > } | null, > expires_at?: string | null, > name: string, > partial_key_hint?: string | null, > principal?: { > id: string, > type: string > } | null, > status: active | archived | expired | inactive, > type: api_key, > workspace_id?: string | null > }[] > ``` *** ### updateApiKey `apiKeys.updateApiKey` Rename an API key or change its active status **Risk:** `write` ```ts theme={null} await corsair.anthropicadministrator.api.apiKeys.updateApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_key_id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `active \| archived \| inactive` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `created_by` | `object` | No | — | | `expires_at` | `string` | No | — | | `name` | `string` | Yes | — | | `partial_key_hint` | `string` | No | — | | `principal` | `object` | No | — | | `status` | `active \| archived \| expired \| inactive` | Yes | — | | `type` | `api_key` | Yes | — | | `workspace_id` | `string` | No | — | > **created\_by full type** > > ```ts theme={null} > { > id: string, > type: string > } > ``` > **principal full type** > > ```ts theme={null} > { > id: string, > type: string > } > ``` *** ## Invites ### createInvite `invites.createInvite` Invite someone to the organization with a given role **Risk:** `write` ```ts theme={null} await corsair.anthropicadministrator.api.invites.createInvite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | Email address to invite | | `role` | `billing \| claude_code_user \| developer \| user \| admin` | Yes | — | | `rbac_group_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `accepted_at` | `string` | No | — | | `email` | `string` | Yes | — | | `expires_at` | `string` | Yes | — | | `invited_at` | `string` | Yes | — | | `rbac_group_ids` | `string[]` | No | — | | `role` | `admin \| billing \| claude_code_user \| developer \| managed \| membership_admin \| owner \| primary_owner \| user` | Yes | — | | `status` | `accepted \| deleted \| expired \| pending` | Yes | — | | `type` | `invite` | Yes | — | *** ### deleteInvite `invites.deleteInvite` Delete a pending organization invite **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anthropicadministrator.api.invites.deleteInvite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invite_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `invite_deleted` | Yes | — | *** ### getInvite `invites.getInvite` Get a single invite by ID **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.invites.getInvite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invite_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `accepted_at` | `string` | No | — | | `email` | `string` | Yes | — | | `expires_at` | `string` | Yes | — | | `invited_at` | `string` | Yes | — | | `rbac_group_ids` | `string[]` | No | — | | `role` | `admin \| billing \| claude_code_user \| developer \| managed \| membership_admin \| owner \| primary_owner \| user` | Yes | — | | `status` | `accepted \| deleted \| expired \| pending` | Yes | — | | `type` | `invite` | Yes | — | *** ### listInvites `invites.listInvites` List organization invites **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.invites.listInvites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `after_id` | `string` | No | Cursor: return the page immediately after this object ID | | `before_id` | `string` | No | Cursor: return the page immediately before this object ID | | `limit` | `number` | No | Items per page (1-1000, default 20) | | `email` | `string` | No | — | | `roles` | `admin \| billing \| claude_code_user \| developer \| managed \| membership_admin \| owner \| primary_owner \| user[]` | No | — | | `statuses` | `accepted \| expired \| pending[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > accepted_at?: string | null, > email: string, > expires_at: string, > invited_at: string, > rbac_group_ids?: string[], > role: admin | billing | claude_code_user | developer | managed | membership_admin | owner | primary_owner | user, > status: accepted | deleted | expired | pending, > type: invite > }[] > ``` *** ## Organization ### getOrganization `organization.getOrganization` Get the organization associated with the Admin API key **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.organization.getOrganization({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `organization` | Yes | — | *** ## Users ### getUser `users.getUser` Get a single organization member by user ID **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.users.getUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `added_at` | `string` | Yes | — | | `email` | `string` | Yes | — | | `name` | `string` | Yes | — | | `role` | `admin \| billing \| claude_code_user \| developer \| managed \| membership_admin \| owner \| primary_owner \| user` | Yes | — | | `type` | `user` | Yes | — | *** ### listUsers `users.listUsers` List organization members, optionally filtered by email or role **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.users.listUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `after_id` | `string` | No | Cursor: return the page immediately after this object ID | | `before_id` | `string` | No | Cursor: return the page immediately before this object ID | | `limit` | `number` | No | Items per page (1-1000, default 20) | | `email` | `string` | No | Filter by user email | | `roles` | `admin \| billing \| claude_code_user \| developer \| managed \| membership_admin \| owner \| primary_owner \| user[]` | No | Filter to users whose role matches any supplied value | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > added_at: string, > email: string, > name: string, > role: admin | billing | claude_code_user | developer | managed | membership_admin | owner | primary_owner | user, > type: user > }[] > ``` *** ### removeUser `users.removeUser` Remove a member from the organization **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anthropicadministrator.api.users.removeUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `user_deleted` | Yes | — | *** ### updateUser `users.updateUser` Change an organization member's role **Risk:** `write` ```ts theme={null} await corsair.anthropicadministrator.api.users.updateUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | | `role` | `billing \| claude_code_user \| developer \| user \| admin` | Yes | New organization role | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `added_at` | `string` | Yes | — | | `email` | `string` | Yes | — | | `name` | `string` | Yes | — | | `role` | `admin \| billing \| claude_code_user \| developer \| managed \| membership_admin \| owner \| primary_owner \| user` | Yes | — | | `type` | `user` | Yes | — | *** ## Workspace Members ### createWorkspaceMember `workspaceMembers.createWorkspaceMember` Add an organization member to a workspace with a role **Risk:** `write` ```ts theme={null} await corsair.anthropicadministrator.api.workspaceMembers.createWorkspaceMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | | `workspace_role` | `workspace_admin \| workspace_developer \| workspace_restricted_developer \| workspace_user` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `workspace_member` | Yes | — | | `user_id` | `string` | Yes | — | | `workspace_id` | `string` | Yes | — | | `workspace_role` | `workspace_admin \| workspace_billing \| workspace_developer \| workspace_restricted_developer \| workspace_user` | Yes | — | *** ### deleteWorkspaceMember `workspaceMembers.deleteWorkspaceMember` Remove a member from a workspace **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anthropicadministrator.api.workspaceMembers.deleteWorkspaceMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `workspace_member_deleted` | Yes | — | | `user_id` | `string` | Yes | — | | `workspace_id` | `string` | Yes | — | *** ### getWorkspaceMember `workspaceMembers.getWorkspaceMember` Get a single workspace member **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.workspaceMembers.getWorkspaceMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `workspace_member` | Yes | — | | `user_id` | `string` | Yes | — | | `workspace_id` | `string` | Yes | — | | `workspace_role` | `workspace_admin \| workspace_billing \| workspace_developer \| workspace_restricted_developer \| workspace_user` | Yes | — | *** ### listWorkspaceMembers `workspaceMembers.listWorkspaceMembers` List members of a workspace **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.workspaceMembers.listWorkspaceMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `after_id` | `string` | No | Cursor: return the page immediately after this object ID | | `before_id` | `string` | No | Cursor: return the page immediately before this object ID | | `limit` | `number` | No | Items per page (1-1000, default 20) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > type: workspace_member, > user_id: string, > workspace_id: string, > workspace_role: workspace_admin | workspace_billing | workspace_developer | workspace_restricted_developer | workspace_user > }[] > ``` *** ### updateWorkspaceMember `workspaceMembers.updateWorkspaceMember` Change a workspace member's role **Risk:** `write` ```ts theme={null} await corsair.anthropicadministrator.api.workspaceMembers.updateWorkspaceMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | | `workspace_role` | `workspace_admin \| workspace_billing \| workspace_developer \| workspace_restricted_developer \| workspace_user` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `workspace_member` | Yes | — | | `user_id` | `string` | Yes | — | | `workspace_id` | `string` | Yes | — | | `workspace_role` | `workspace_admin \| workspace_billing \| workspace_developer \| workspace_restricted_developer \| workspace_user` | Yes | — | *** ## Workspaces ### archiveWorkspace `workspaces.archiveWorkspace` Archive a workspace **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.anthropicadministrator.api.workspaces.archiveWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `archived_at` | `string` | No | — | | `compartment_id` | `string` | No | — | | `created_at` | `string` | Yes | — | | `data_residency` | `object` | No | — | | `display_color` | `string` | No | — | | `external_key_id` | `string` | No | — | | `name` | `string` | Yes | — | | `tags` | `object` | No | — | | `type` | `workspace` | Yes | — | > **data\_residency full type** > > ```ts theme={null} > { > allowed_inference_geos: global | us[] | unrestricted, > default_inference_geo: global | us, > workspace_geo: us > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### createWorkspace `workspaces.createWorkspace` Create a workspace **Risk:** `write` ```ts theme={null} await corsair.anthropicadministrator.api.workspaces.createWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Workspace name | | `data_residency` | `object` | No | — | | `external_key_id` | `string` | No | — | | `tags` | `object` | No | — | > **data\_residency full type** > > ```ts theme={null} > { > allowed_inference_geos?: global | us[] | unrestricted | null, > default_inference_geo?: global | us | null, > workspace_geo?: us | null > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `archived_at` | `string` | No | — | | `compartment_id` | `string` | No | — | | `created_at` | `string` | Yes | — | | `data_residency` | `object` | No | — | | `display_color` | `string` | No | — | | `external_key_id` | `string` | No | — | | `name` | `string` | Yes | — | | `tags` | `object` | No | — | | `type` | `workspace` | Yes | — | > **data\_residency full type** > > ```ts theme={null} > { > allowed_inference_geos: global | us[] | unrestricted, > default_inference_geo: global | us, > workspace_geo: us > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### getWorkspace `workspaces.getWorkspace` Get a single workspace by ID **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.workspaces.getWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `archived_at` | `string` | No | — | | `compartment_id` | `string` | No | — | | `created_at` | `string` | Yes | — | | `data_residency` | `object` | No | — | | `display_color` | `string` | No | — | | `external_key_id` | `string` | No | — | | `name` | `string` | Yes | — | | `tags` | `object` | No | — | | `type` | `workspace` | Yes | — | > **data\_residency full type** > > ```ts theme={null} > { > allowed_inference_geos: global | us[] | unrestricted, > default_inference_geo: global | us, > workspace_geo: us > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### listWorkspaces `workspaces.listWorkspaces` List workspaces, optionally including archived ones **Risk:** `read` ```ts theme={null} await corsair.anthropicadministrator.api.workspaces.listWorkspaces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `after_id` | `string` | No | Cursor: return the page immediately after this object ID | | `before_id` | `string` | No | Cursor: return the page immediately before this object ID | | `limit` | `number` | No | Items per page (1-1000, default 20) | | `include_archived` | `boolean` | No | Include archived workspaces in the results | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > archived_at?: string | null, > compartment_id?: string, > created_at: string, > data_residency?: { > allowed_inference_geos: global | us[] | unrestricted, > default_inference_geo: global | us, > workspace_geo: us > } | null, > display_color?: string, > external_key_id?: string | null, > name: string, > tags?: { > } | null, > type: workspace > }[] > ``` *** ### updateWorkspace `workspaces.updateWorkspace` Update a workspace name, tags or data residency **Risk:** `write` ```ts theme={null} await corsair.anthropicadministrator.api.workspaces.updateWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `name` | `string` | No | — | | `data_residency` | `object` | No | — | | `external_key_id` | `string` | No | — | | `tags` | `object` | No | — | > **data\_residency full type** > > ```ts theme={null} > { > allowed_inference_geos?: global | us[] | unrestricted | null, > default_inference_geo?: global | us | null > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `archived_at` | `string` | No | — | | `compartment_id` | `string` | No | — | | `created_at` | `string` | Yes | — | | `data_residency` | `object` | No | — | | `display_color` | `string` | No | — | | `external_key_id` | `string` | No | — | | `name` | `string` | Yes | — | | `tags` | `object` | No | — | | `type` | `workspace` | Yes | — | > **data\_residency full type** > > ```ts theme={null} > { > allowed_inference_geos: global | us[] | unrestricted, > default_inference_geo: global | us, > workspace_geo: us > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/anthropicadministrator/database Anthropic Admin local sync: searchable entities, `.search()` filters, and operators. The Anthropic Admin plugin syncs data locally. Use `corsair.anthropicadministrator.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Api Keys Path: `anthropicadministrator.db.apiKeys.search` ```ts theme={null} const rows = await corsair.anthropicadministrator.db.apiKeys.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `expires_at` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `partial_key_hint` | `string` | equals, contains, startsWith, endsWith, in | | `workspace_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invites Path: `anthropicadministrator.db.invites.search` ```ts theme={null} const rows = await corsair.anthropicadministrator.db.invites.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `accepted_at` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `expires_at` | `string` | equals, contains, startsWith, endsWith, in | | `invited_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `anthropicadministrator.db.users.search` ```ts theme={null} const rows = await corsair.anthropicadministrator.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `added_at` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspace Members Path: `anthropicadministrator.db.workspaceMembers.search` ```ts theme={null} const rows = await corsair.anthropicadministrator.db.workspaceMembers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `workspace_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `anthropicadministrator.db.workspaces.search` ```ts theme={null} const rows = await corsair.anthropicadministrator.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `compartment_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `display_color` | `string` | equals, contains, startsWith, endsWith, in | | `external_key_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/anthropicadministrator/overview Admin API for managing Anthropic organization members, workspaces, and API keys. Use **Anthropic Admin** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 22 typed API operations * 5 synced entities (`apiKeys`, `invites`, `users`, `workspaceMembers`, `workspaces`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/anthropicadministrator ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/anthropicadministrator ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/anthropicadministrator ``` ```bash bun theme={null} bun add corsair @corsair-dev/anthropicadministrator ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { anthropicadministrator } from '@corsair-dev/anthropicadministrator'; export const corsair = createCorsair({ plugins: [ anthropicadministrator(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} anthropicadministrator() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Anthropic Admin OAuth app. ```ts theme={null} anthropicadministrator({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'anthropicadministrator', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`apiKeys.getApiKey`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.anthropicadministrator.api.apiKeys.getApiKey({}); ``` **`apiKeys.updateApiKey`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.anthropicadministrator.api.apiKeys.updateApiKey({}); ``` See the full list on the [API](/plugins/anthropicadministrator/api) page. ## Query synced data Synced entities support `tenant.anthropicadministrator.db..search()` and `.list()`: `apiKeys`, `invites`, `users`, `workspaceMembers`, `workspaces`. See [Database](/plugins/anthropicadministrator/database) for filters and operators. ## What's next > **[API reference](/plugins/anthropicadministrator/api)** > > Every `anthropicadministrator.api.*` operation with input and output types. > **[Database](/plugins/anthropicadministrator/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/apaleo/api API reference for Apaleo: every `apaleo.api.*` operation with input and output types. Every `apaleo.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Properties ### archive `properties.archive` Archive a live property (sets isArchived to true) **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.properties.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### clone `properties.clone` Clone a property, creating a new property with inventory and rate plans **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.properties.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `code` | `string` | Yes | — | | `name` | `object` | Yes | — | | `companyName` | `string` | Yes | — | | `managingDirectors` | `string` | No | — | | `commercialRegisterEntry` | `string` | Yes | — | | `taxId` | `string` | Yes | — | | `description` | `object` | No | — | | `location` | `object` | Yes | — | | `bankAccount` | `object` | No | — | | `paymentTerms` | `object` | Yes | — | | `timeZone` | `string` | Yes | — | | `defaultCheckInTime` | `string` | Yes | — | | `defaultCheckOutTime` | `string` | Yes | — | | `currencyCode` | `string` | Yes | — | > **name full type** > > ```ts theme={null} > { > } > ``` > **description full type** > > ```ts theme={null} > { > } > ``` > **location full type** > > ```ts theme={null} > { > addressLine1: string, > addressLine2?: string | null, > postalCode: string, > city: string, > regionCode?: string | null, > countryCode: string > } > ``` > **bankAccount full type** > > ```ts theme={null} > { > iban?: string, > bic?: string, > bank?: string > } > ``` > **paymentTerms full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### count `properties.count` Return total count of properties **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.properties.count({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `Test \| Live[]` | No | — | | `includeArchived` | `boolean` | No | — | | `countryCode` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | *** ### countries `properties.countries` List ISO country codes that can be used to create properties **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.properties.countries({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `countryCodes` | `string[]` | Yes | — | *** ### create `properties.create` Create a new property **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.properties.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `name` | `object` | Yes | — | | `companyName` | `string` | Yes | — | | `managingDirectors` | `string` | No | — | | `commercialRegisterEntry` | `string` | Yes | — | | `taxId` | `string` | Yes | — | | `description` | `object` | No | — | | `location` | `object` | Yes | — | | `bankAccount` | `object` | No | — | | `paymentTerms` | `object` | Yes | — | | `timeZone` | `string` | Yes | — | | `defaultCheckInTime` | `string` | Yes | — | | `defaultCheckOutTime` | `string` | Yes | — | | `currencyCode` | `string` | Yes | — | > **name full type** > > ```ts theme={null} > { > } > ``` > **description full type** > > ```ts theme={null} > { > } > ``` > **location full type** > > ```ts theme={null} > { > addressLine1: string, > addressLine2?: string | null, > postalCode: string, > city: string, > regionCode?: string | null, > countryCode: string > } > ``` > **bankAccount full type** > > ```ts theme={null} > { > iban?: string, > bic?: string, > bank?: string > } > ``` > **paymentTerms full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### exists `properties.exists` Check if a property exists by id **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.properties.exists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exists` | `boolean` | Yes | — | *** ### get `properties.get` Get a property by id **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.properties.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `code` | `string` | Yes | — | | `propertyTemplateId` | `string` | No | — | | `isTemplate` | `boolean` | Yes | — | | `name` | `object` | Yes | — | | `description` | `object` | No | — | | `companyName` | `string` | Yes | — | | `managingDirectors` | `string` | No | — | | `commercialRegisterEntry` | `string` | Yes | — | | `taxId` | `string` | Yes | — | | `location` | `object` | Yes | — | | `bankAccount` | `object` | No | — | | `paymentTerms` | `object` | Yes | — | | `timeZone` | `string` | Yes | — | | `currencyCode` | `string` | Yes | — | | `created` | `string` | Yes | — | | `status` | `string` | Yes | — | | `isArchived` | `boolean` | Yes | — | | `actions` | `object[]` | No | — | > **name full type** > > ```ts theme={null} > string | { > } > ``` > **description full type** > > ```ts theme={null} > string | { > } > ``` > **location full type** > > ```ts theme={null} > { > addressLine1?: string | null, > addressLine2?: string | null, > postalCode?: string | null, > city?: string | null, > regionCode?: string | null, > countryCode?: string | null > } > ``` > **bankAccount full type** > > ```ts theme={null} > { > iban?: string | null, > bic?: string | null, > bank?: string | null > } > ``` > **paymentTerms full type** > > ```ts theme={null} > { > } > ``` > **actions full type** > > ```ts theme={null} > { > action?: string | null, > isAllowed?: boolean | null, > reasons?: { > code?: string | null, > message?: string | null > }[] | null > }[] > ``` *** ### list `properties.list` Get the list of properties **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.properties.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `Test \| Live[]` | No | — | | `includeArchived` | `boolean` | No | — | | `countryCode` | `string[]` | No | — | | `expand` | `string[]` | No | — | | `pageNumber` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `properties` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **properties full type** > > ```ts theme={null} > { > id: string, > code: string, > propertyTemplateId?: string | null, > isTemplate: boolean, > name: string | { > }, > description?: string | { > } | null, > companyName: string, > managingDirectors?: string | null, > commercialRegisterEntry: string, > taxId: string, > location: { > addressLine1?: string | null, > addressLine2?: string | null, > postalCode?: string | null, > city?: string | null, > regionCode?: string | null, > countryCode?: string | null > }, > bankAccount?: { > iban?: string | null, > bic?: string | null, > bank?: string | null > } | null, > paymentTerms: { > }, > timeZone: string, > currencyCode: string, > created: string, > status: string, > isArchived: boolean, > actions?: { > action?: string | null, > isAllowed?: boolean | null, > reasons?: { > code?: string | null, > message?: string | null > }[] | null > }[] | null > }[] > ``` *** ### reset `properties.reset` Delete transactional data for a property in Test status **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.properties.reset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### setLive `properties.setLive` Move a test property to Live status **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.properties.setLive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ## Unit Attributes ### create `unitAttributes.create` Create a new unit attribute **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.unitAttributes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `unitAttributes.delete` Delete a unit attribute **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.unitAttributes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### exists `unitAttributes.exists` Check if a unit attribute exists **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.unitAttributes.exists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exists` | `boolean` | Yes | — | *** ### get `unitAttributes.get` Get a unit attribute by id **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.unitAttributes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | *** ### list `unitAttributes.list` Get the unit attribute list **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.unitAttributes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageNumber` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `unitAttributes` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **unitAttributes full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null > }[] > ``` *** ## Unit Groups ### count `unitGroups.count` Return number of unit groups matching the filter **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.unitGroups.count({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `propertyId` | `string` | No | — | | `unitGroupTypes` | `BedRoom \| MeetingRoom \| EventSpace \| ParkingLot \| Other[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | *** ### create `unitGroups.create` Create a new unit group **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.unitGroups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `propertyId` | `string` | Yes | — | | `name` | `object` | Yes | — | | `description` | `object` | Yes | — | | `maxPersons` | `number` | Yes | — | | `rank` | `number` | No | — | | `type` | `BedRoom \| MeetingRoom \| EventSpace \| ParkingLot` | No | — | | `connectedUnitGroups` | `object[]` | No | — | > **name full type** > > ```ts theme={null} > { > } > ``` > **description full type** > > ```ts theme={null} > { > } > ``` > **connectedUnitGroups full type** > > ```ts theme={null} > { > unitGroupId: string, > memberCount: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `unitGroups.delete` Delete a unit group **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.unitGroups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### exists `unitGroups.exists` Check if a unit group exists by id **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.unitGroups.exists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exists` | `boolean` | Yes | — | *** ### get `unitGroups.get` Get a unit group by id **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.unitGroups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `code` | `string` | Yes | — | | `property` | `object` | Yes | — | | `name` | `object` | Yes | — | | `memberCount` | `number` | Yes | — | | `description` | `object` | Yes | — | | `maxPersons` | `number` | Yes | — | | `rank` | `number` | No | — | | `type` | `string` | Yes | — | | `connectedUnitGroups` | `object[]` | No | — | > **property full type** > > ```ts theme={null} > { > id?: string | null, > code?: string | null, > name?: string | null, > description?: string | null > } > ``` > **name full type** > > ```ts theme={null} > string | { > } > ``` > **description full type** > > ```ts theme={null} > string | { > } > ``` > **connectedUnitGroups full type** > > ```ts theme={null} > { > id: string, > name: string, > description: string, > memberCount: number, > maxPersons?: number | null > }[] > ``` *** ### list `unitGroups.list` Get the list of unit groups **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.unitGroups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `propertyId` | `string` | No | — | | `unitGroupTypes` | `BedRoom \| MeetingRoom \| EventSpace \| ParkingLot \| Other[]` | No | — | | `expand` | `string[]` | No | — | | `pageNumber` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `unitGroups` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **unitGroups full type** > > ```ts theme={null} > { > id: string, > code: string, > property: { > id?: string | null, > code?: string | null, > name?: string | null, > description?: string | null > }, > name: string | { > }, > memberCount: number, > description: string | { > }, > maxPersons: number, > rank?: number | null, > type: string, > connectedUnitGroups?: { > id: string, > name: string, > description: string, > memberCount: number, > maxPersons?: number | null > }[] | null > }[] > ``` *** ### replace `unitGroups.replace` Replace a unit group **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.unitGroups.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `object` | Yes | — | | `description` | `object` | Yes | — | | `maxPersons` | `number` | No | — | | `rank` | `number` | No | — | | `connectedUnitGroups` | `object[]` | No | — | > **name full type** > > ```ts theme={null} > { > } > ``` > **description full type** > > ```ts theme={null} > { > } > ``` > **connectedUnitGroups full type** > > ```ts theme={null} > { > unitGroupId: string, > memberCount: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ## Units ### count `units.count` Return number of units matching the filter **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.units.count({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `propertyId` | `string` | No | — | | `unitGroupId` | `string` | No | — | | `unitGroupIds` | `string[]` | No | — | | `unitAttributeIds` | `string[]` | No | — | | `isOccupied` | `boolean` | No | — | | `maintenanceType` | `OutOfService \| OutOfOrder \| OutOfInventory` | No | — | | `condition` | `Clean \| CleanToBeInspected \| Dirty` | No | — | | `textSearch` | `string` | No | — | | `status` | `Active \| Archived \| All` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | *** ### create `units.create` Create a new unit **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.units.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `propertyId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `object` | Yes | — | | `unitGroupId` | `string` | No | — | | `maxPersons` | `number` | Yes | — | | `condition` | `Clean \| CleanToBeInspected \| Dirty` | No | — | | `attributes` | `object[]` | No | — | | `connectedUnits` | `object[]` | No | — | > **description full type** > > ```ts theme={null} > { > } > ``` > **attributes full type** > > ```ts theme={null} > { > id: string > }[] > ``` > **connectedUnits full type** > > ```ts theme={null} > { > unitId: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createBulk `units.createBulk` Create multiple units **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.units.createBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `units` | `object[]` | Yes | — | > **units full type** > > ```ts theme={null} > { > propertyId: string, > name: string, > description: { > }, > unitGroupId?: string | null, > maxPersons: number, > condition?: Clean | CleanToBeInspected | Dirty | null, > attributes?: { > id: string > }[] | null, > connectedUnits?: { > unitId: string > }[] | null > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | *** ### delete `units.delete` Delete a unit **Risk:** `write` ```ts theme={null} await corsair.apaleo.api.units.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### exists `units.exists` Check if a unit exists by id **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.units.exists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exists` | `boolean` | Yes | — | *** ### get `units.get` Get a unit by id **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.units.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `object` | Yes | — | | `property` | `object` | Yes | — | | `unitGroup` | `object` | No | — | | `connectingUnit` | `object` | No | — | | `status` | `object` | Yes | — | | `maxPersons` | `number` | Yes | — | | `created` | `string` | Yes | — | | `archived` | `string` | No | — | | `isArchived` | `boolean` | No | — | | `attributes` | `object[]` | No | — | | `connectedUnits` | `object[]` | No | — | | `actions` | `object[]` | No | — | > **description full type** > > ```ts theme={null} > string | { > } > ``` > **property full type** > > ```ts theme={null} > { > id?: string | null, > code?: string | null, > name?: string | null, > description?: string | null > } > ``` > **unitGroup full type** > > ```ts theme={null} > { > id?: string | null, > code?: string | null, > name?: string | null, > description?: string | null, > type?: string | null > } > ``` > **connectingUnit full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > description?: string | null, > unitGroupId?: string | null > } > ``` > **status full type** > > ```ts theme={null} > { > isOccupied?: boolean | null, > condition?: string | null, > maintenance?: { > id?: string | null, > from?: string | null, > to?: string | null, > type?: string | null, > description?: string | null > } | null > } > ``` > **attributes full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > description?: string | null > }[] > ``` > **connectedUnits full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > description?: string | null, > unitGroupId?: string | null, > condition?: string | null, > maxPersons?: number | null > }[] > ``` > **actions full type** > > ```ts theme={null} > { > action?: string | null, > isAllowed?: boolean | null, > reasons?: { > code?: string | null, > message?: string | null > }[] | null > }[] > ``` *** ### list `units.list` Get the list of units **Risk:** `read` ```ts theme={null} await corsair.apaleo.api.units.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `propertyId` | `string` | No | — | | `unitGroupId` | `string` | No | — | | `unitGroupIds` | `string[]` | No | — | | `unitAttributeIds` | `string[]` | No | — | | `isOccupied` | `boolean` | No | — | | `maintenanceType` | `OutOfService \| OutOfOrder \| OutOfInventory` | No | — | | `condition` | `Clean \| CleanToBeInspected \| Dirty` | No | — | | `textSearch` | `string` | No | — | | `status` | `Active \| Archived \| All` | No | — | | `expand` | `string[]` | No | — | | `pageNumber` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `units` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **units full type** > > ```ts theme={null} > { > id: string, > name: string, > description: string | { > }, > property: { > id?: string | null, > code?: string | null, > name?: string | null, > description?: string | null > }, > unitGroup?: { > id?: string | null, > code?: string | null, > name?: string | null, > description?: string | null, > type?: string | null > } | null, > connectingUnit?: { > id?: string | null, > name?: string | null, > description?: string | null, > unitGroupId?: string | null > } | null, > status: { > isOccupied?: boolean | null, > condition?: string | null, > maintenance?: { > id?: string | null, > from?: string | null, > to?: string | null, > type?: string | null, > description?: string | null > } | null > }, > maxPersons: number, > created: string, > archived?: string | null, > isArchived?: boolean | null, > attributes?: { > id?: string | null, > name?: string | null, > description?: string | null > }[] | null, > connectedUnits?: { > id?: string | null, > name?: string | null, > description?: string | null, > unitGroupId?: string | null, > condition?: string | null, > maxPersons?: number | null > }[] | null, > actions?: { > action?: string | null, > isAllowed?: boolean | null, > reasons?: { > code?: string | null, > message?: string | null > }[] | null > }[] | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/apaleo/database Apaleo local sync: searchable entities, `.search()` filters, and operators. The Apaleo plugin syncs data locally. Use `corsair.apaleo.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Properties Path: `apaleo.db.properties.search` ```ts theme={null} const rows = await corsair.apaleo.db.properties.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `propertyTemplateId` | `string` | equals, contains, startsWith, endsWith, in | | `isTemplate` | `boolean` | equals | | `companyName` | `string` | equals, contains, startsWith, endsWith, in | | `managingDirectors` | `string` | equals, contains, startsWith, endsWith, in | | `commercialRegisterEntry` | `string` | equals, contains, startsWith, endsWith, in | | `taxId` | `string` | equals, contains, startsWith, endsWith, in | | `timeZone` | `string` | equals, contains, startsWith, endsWith, in | | `currencyCode` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `isArchived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Unit Attributes Path: `apaleo.db.unitAttributes.search` ```ts theme={null} const rows = await corsair.apaleo.db.unitAttributes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Unit Groups Path: `apaleo.db.unitGroups.search` ```ts theme={null} const rows = await corsair.apaleo.db.unitGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `memberCount` | `number` | equals, gt, gte, lt, lte, in | | `maxPersons` | `number` | equals, gt, gte, lt, lte, in | | `rank` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Units Path: `apaleo.db.units.search` ```ts theme={null} const rows = await corsair.apaleo.db.units.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `maxPersons` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `archived` | `string` | equals, contains, startsWith, endsWith, in | | `isArchived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/apaleo/overview Open hospitality platform for property management, reservations, and hotel operations. Use **Apaleo** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 29 typed API operations * 4 synced entities (`properties`, `unitAttributes`, `unitGroups`, `units`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/apaleo ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/apaleo ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/apaleo ``` ```bash bun theme={null} bun add corsair @corsair-dev/apaleo ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { apaleo } from '@corsair-dev/apaleo'; export const corsair = createCorsair({ plugins: [ apaleo(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Apaleo OAuth app. ```ts theme={null} apaleo() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'apaleo', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`properties.count`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apaleo.api.properties.count({}); ``` **`properties.archive`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apaleo.api.properties.archive({}); ``` See the full list on the [API](/plugins/apaleo/api) page. ## Query synced data Synced entities support `tenant.apaleo.db..search()` and `.list()`: `properties`, `unitAttributes`, `unitGroups`, `units`. See [Database](/plugins/apaleo/database) for filters and operators. ## What's next > **[API reference](/plugins/apaleo/api)** > > Every `apaleo.api.*` operation with input and output types. > **[Database](/plugins/apaleo/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/api2pdf/api API reference for API2PDF: every `api2pdf.api.*` operation with input and output types. Every `api2pdf.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chrome ### addHeaderFooter `chrome.addHeaderFooter` Render HTML to PDF with custom headers and footers **Risk:** `write` ```ts theme={null} await corsair.api2pdf.api.chrome.addHeaderFooter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `html` | `string` | Yes | HTML content to render as PDF | | `headerTemplate` | `string` | No | HTML template for page header (Headless Chrome) | | `footerTemplate` | `string` | No | HTML template for page footer (Headless Chrome) | | `displayHeaderFooter` | `boolean` | No | Render the header/footer templates (default true) | | `inline` | `boolean` | No | Serve the file inline rather than as an attachment (default true) | | `fileName` | `string` | No | Name for the generated file | **Output** | Name | Type | Required | Description | | - | - | - | - | | `FileUrl` | `string` | No | — | | `MbOut` | `number` | No | — | | `Cost` | `number` | No | — | | `Seconds` | `number` | No | — | | `Success` | `boolean` | Yes | — | | `Error` | `string` | No | — | | `ResponseId` | `string` | No | — | *** ## Libreoffice ### libreOfficePdfToHtml `libreoffice.libreOfficePdfToHtml` Convert a PDF to HTML using LibreOffice **Risk:** `write` ```ts theme={null} await corsair.api2pdf.api.libreoffice.libreOfficePdfToHtml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the PDF to convert | | `inline` | `boolean` | No | Serve the file inline rather than as an attachment (default true) | | `fileName` | `string` | No | Name for the generated file | **Output** | Name | Type | Required | Description | | - | - | - | - | | `FileUrl` | `string` | No | — | | `MbOut` | `number` | No | — | | `Cost` | `number` | No | — | | `Seconds` | `number` | No | — | | `Success` | `boolean` | Yes | — | | `Error` | `string` | No | — | | `ResponseId` | `string` | No | — | *** ### libreOfficeThumbnail `libreoffice.libreOfficeThumbnail` Generate a thumbnail preview of a document **Risk:** `write` ```ts theme={null} await corsair.api2pdf.api.libreoffice.libreOfficeThumbnail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of PDF or Office document | | `inline` | `boolean` | No | Serve the file inline rather than as an attachment (default true) | | `fileName` | `string` | No | Name for the generated file | **Output** | Name | Type | Required | Description | | - | - | - | - | | `FileUrl` | `string` | No | — | | `MbOut` | `number` | No | — | | `Cost` | `number` | No | — | | `Seconds` | `number` | No | — | | `Success` | `boolean` | Yes | — | | `Error` | `string` | No | — | | `ResponseId` | `string` | No | — | *** ## Pdfsharp ### extractPages `pdfsharp.extractPages` Extract a page range from a PDF **Risk:** `write` ```ts theme={null} await corsair.api2pdf.api.pdfsharp.extractPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `start` | `number` | No | Zero-based index of the first page to extract; negative counts back from the end | | `end` | `number` | No | Zero-based index of the last page to extract, inclusive; negative counts back from the end | | `inline` | `boolean` | No | Serve the file inline rather than as an attachment (default true) | | `fileName` | `string` | No | Name for the generated file | **Output** | Name | Type | Required | Description | | - | - | - | - | | `FileUrl` | `string` | No | — | | `MbOut` | `number` | No | — | | `Cost` | `number` | No | — | | `Seconds` | `number` | No | — | | `Success` | `boolean` | Yes | — | | `Error` | `string` | No | — | | `ResponseId` | `string` | No | — | *** ### mergePdfs `pdfsharp.mergePdfs` Merge multiple PDF URLs into a single document **Risk:** `write` ```ts theme={null} await corsair.api2pdf.api.pdfsharp.mergePdfs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `urls` | `string[]` | Yes | Publicly accessible PDF URLs to merge in order | | `inline` | `boolean` | No | Serve the file inline rather than as an attachment (default true) | | `fileName` | `string` | No | Name for the generated file | **Output** | Name | Type | Required | Description | | - | - | - | - | | `FileUrl` | `string` | No | — | | `MbOut` | `number` | No | — | | `Cost` | `number` | No | — | | `Seconds` | `number` | No | — | | `Success` | `boolean` | Yes | — | | `Error` | `string` | No | — | | `ResponseId` | `string` | No | — | *** ### optimizePdf `pdfsharp.optimizePdf` Compress a PDF to reduce file size **Risk:** `write` ```ts theme={null} await corsair.api2pdf.api.pdfsharp.optimizePdf({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the PDF to compress | | `inline` | `boolean` | No | Serve the file inline rather than as an attachment (default true) | | `fileName` | `string` | No | Name for the generated file | **Output** | Name | Type | Required | Description | | - | - | - | - | | `FileUrl` | `string` | No | — | | `MbOut` | `number` | No | — | | `Cost` | `number` | No | — | | `Seconds` | `number` | No | — | | `Success` | `boolean` | Yes | — | | `Error` | `string` | No | — | | `ResponseId` | `string` | No | — | *** ### watermarkPdf `pdfsharp.watermarkPdf` Stamp a text watermark onto every page of a PDF **Risk:** `write` ```ts theme={null} await corsair.api2pdf.api.pdfsharp.watermarkPdf({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the PDF to watermark | | `text` | `string` | Yes | Watermark text to stamp on each page | | `fontSize` | `number` | No | Watermark font size in points | | `color` | `string` | No | Watermark colour, e.g. "#FF0000" | | `opacity` | `number` | No | Watermark opacity between 0 and 1 | | `rotation` | `number` | No | Watermark rotation in degrees | | `inline` | `boolean` | No | Serve the file inline rather than as an attachment (default true) | | `fileName` | `string` | No | Name for the generated file | **Output** | Name | Type | Required | Description | | - | - | - | - | | `FileUrl` | `string` | No | — | | `MbOut` | `number` | No | — | | `Cost` | `number` | No | — | | `Seconds` | `number` | No | — | | `Success` | `boolean` | Yes | — | | `Error` | `string` | No | — | | `ResponseId` | `string` | No | — | *** ## Utility ### checkStatus `utility.checkStatus` Check API2PDF service health status **Risk:** `read` ```ts theme={null} await corsair.api2pdf.api.utility.checkStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ### deletePdf `utility.deletePdf` Delete a previously generated PDF by response ID **Risk:** `write` ```ts theme={null} await corsair.api2pdf.api.utility.deletePdf({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | ResponseId from a prior API2PDF job | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Success` | `boolean` | No | — | | `Error` | `string` | No | — | *** ## Zebra ### generateBarcode `zebra.generateBarcode` Generate a barcode or QR code image **Risk:** `write` ```ts theme={null} await corsair.api2pdf.api.zebra.generateBarcode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `format` | `string` | Yes | ZXING barcode format, e.g. QR\_CODE, CODE\_128, EAN\_13 | | `value` | `string` | Yes | Value to encode | | `height` | `number` | No | — | | `width` | `number` | No | — | | `showLabel` | `boolean` | No | Render the encoded value beneath the barcode | **Output** | Name | Type | Required | Description | | - | - | - | - | | `FileUrl` | `string` | No | — | | `MbOut` | `number` | No | — | | `Cost` | `number` | No | — | | `Seconds` | `number` | No | — | | `Success` | `boolean` | Yes | — | | `Error` | `string` | No | — | | `ResponseId` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/api2pdf/database API2PDF local sync: searchable entities, `.search()` filters, and operators. The API2PDF plugin syncs data locally. Use `corsair.api2pdf.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Pdf Jobs Path: `api2pdf.db.pdfJobs.search` ```ts theme={null} const rows = await corsair.api2pdf.db.pdfJobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `operation` | `string` | equals, contains, startsWith, endsWith, in | | `responseId` | `string` | equals, contains, startsWith, endsWith, in | | `fileUrl` | `string` | equals, contains, startsWith, endsWith, in | | `success` | `boolean` | equals | | `cost` | `number` | equals, gt, gte, lt, lte, in | | `mbOut` | `number` | equals, gt, gte, lt, lte, in | | `seconds` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/api2pdf/overview HTML and URL to PDF conversion API for generating documents from web content. Use **API2PDF** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 10 typed API operations * 1 synced entity (`pdfJobs`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/api2pdf ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/api2pdf ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/api2pdf ``` ```bash bun theme={null} bun add corsair @corsair-dev/api2pdf ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { api2pdf } from '@corsair-dev/api2pdf'; export const corsair = createCorsair({ plugins: [ api2pdf(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} api2pdf() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'api2pdf', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`utility.checkStatus`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.api2pdf.api.utility.checkStatus({}); ``` **`chrome.addHeaderFooter`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.api2pdf.api.chrome.addHeaderFooter({}); ``` See the full list on the [API](/plugins/api2pdf/api) page. ## Query synced data Synced entities support `tenant.api2pdf.db..search()` and `.list()`: `pdfJobs`. See [Database](/plugins/api2pdf/database) for filters and operators. ## What's next > **[API reference](/plugins/api2pdf/api)** > > Every `api2pdf.api.*` operation with input and output types. > **[Database](/plugins/api2pdf/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/apibible/api API reference for API.Bible: every `apibible.api.*` operation with input and output types. Every `apibible.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Audio Bibles ### get `audioBibles.get` Get a specific audio Bible version **Risk:** `read` ```ts theme={null} await corsair.apibible.api.audioBibles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audioBibleId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > dblId?: string, > relatedDbl?: string | null, > name: string, > nameLocal: string, > abbreviation?: string | null, > abbreviationLocal?: string | null, > description?: string | null, > descriptionLocal?: string | null, > language: { > id: string, > name: string, > nameLocal: string, > script?: string | null, > scriptDirection?: string | null > }, > countries: { > id: string, > name: string, > nameLocal: string > }[], > type: string, > updatedAt: string, > copyright?: string > } > ``` *** ### list `audioBibles.list` List audio Bible versions **Risk:** `read` ```ts theme={null} await corsair.apibible.api.audioBibles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > dblId?: string, > relatedDbl?: string | null, > name: string, > nameLocal: string, > abbreviation?: string | null, > abbreviationLocal?: string | null, > description?: string | null, > descriptionLocal?: string | null, > language: { > id: string, > name: string, > nameLocal: string, > script?: string | null, > scriptDirection?: string | null > }, > countries: { > id: string, > name: string, > nameLocal: string > }[], > type: string, > updatedAt: string, > copyright?: string > }[] > ``` *** ## Audio Books ### get `audioBooks.get` Get a specific book of an audio Bible **Risk:** `read` ```ts theme={null} await corsair.apibible.api.audioBooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audioBibleId` | `string` | Yes | — | | `bookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > abbreviation: string, > name: string, > nameLong?: string > } > ``` *** ### list `audioBooks.list` List all books of an audio Bible **Risk:** `read` ```ts theme={null} await corsair.apibible.api.audioBooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audioBibleId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > abbreviation: string, > name: string, > nameLong?: string > }[] > ``` *** ## Audio Chapters ### get `audioChapters.get` Get an audio chapter (includes an mp3 resource URL) **Risk:** `read` ```ts theme={null} await corsair.apibible.api.audioChapters.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audioBibleId` | `string` | Yes | — | | `chapterId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > bookId: string, > number: string, > reference: string, > resourceUrl: string, > expiresAt: string, > copyright?: string, > next?: { > id: string, > number?: string, > bookId?: string, > title?: string > } | null, > previous?: { > id: string, > number?: string, > bookId?: string, > title?: string > } | null > } > ``` *** ### list `audioChapters.list` List all chapters of an audio book **Risk:** `read` ```ts theme={null} await corsair.apibible.api.audioChapters.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audioBibleId` | `string` | Yes | — | | `bookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > bookId: string, > number: string, > reference: string > }[] > ``` *** ## Bibles ### get `bibles.get` Get details for a specific Bible version **Risk:** `read` ```ts theme={null} await corsair.apibible.api.bibles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bibleId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > dblId: string, > relatedDbl?: string | null, > name: string, > nameLocal: string, > abbreviation?: string | null, > abbreviationLocal?: string | null, > description?: string | null, > descriptionLocal?: string | null, > language: { > id: string, > name: string, > nameLocal: string, > script?: string | null, > scriptDirection?: string | null > }, > countries: { > id: string, > name: string, > nameLocal: string > }[], > type: string, > updatedAt: string, > copyright?: string, > info?: string, > audioBibles?: any[] > } > ``` *** ### list `bibles.list` List supported Bible versions **Risk:** `read` ```ts theme={null} await corsair.apibible.api.bibles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > dblId: string, > relatedDbl?: string | null, > name: string, > nameLocal: string, > abbreviation?: string | null, > abbreviationLocal?: string | null, > description?: string | null, > descriptionLocal?: string | null, > language: { > id: string, > name: string, > nameLocal: string, > script?: string | null, > scriptDirection?: string | null > }, > countries: { > id: string, > name: string, > nameLocal: string > }[], > type: string, > updatedAt: string, > copyright?: string, > info?: string, > audioBibles?: any[] > }[] > ``` *** ## Books ### get `books.get` Get a specific book of a Bible version **Risk:** `read` ```ts theme={null} await corsair.apibible.api.books.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bibleId` | `string` | Yes | — | | `bookId` | `string` | Yes | — | | `includeChapters` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > abbreviation: string, > name: string, > nameLong?: string, > chapters?: { > id: string, > bibleId: string, > bookId: string, > number: string, > position?: number > }[] > } > ``` *** ### list `books.list` List all books of a Bible version **Risk:** `read` ```ts theme={null} await corsair.apibible.api.books.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bibleId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > abbreviation: string, > name: string, > nameLong?: string, > chapters?: { > id: string, > bibleId: string, > bookId: string, > number: string, > position?: number > }[] > }[] > ``` *** ## Chapters ### get `chapters.get` Get a chapter with its text content **Risk:** `read` ```ts theme={null} await corsair.apibible.api.chapters.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `includeNotes` | `boolean` | No | — | | `includeTitles` | `boolean` | No | — | | `includeChapterNumbers` | `boolean` | No | — | | `includeVerseNumbers` | `boolean` | No | — | | `includeVerseSpans` | `boolean` | No | — | | `bibleId` | `string` | Yes | — | | `chapterId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > bookId: string, > number: string, > reference: string, > content: string, > copyright?: string, > verseCount?: number, > next?: { > id: string, > number?: string, > bookId?: string, > title?: string > } | null, > previous?: { > id: string, > number?: string, > bookId?: string, > title?: string > } | null > } > ``` > **meta full type** > > ```ts theme={null} > { > fumsToken?: string > } > ``` *** ### list `chapters.list` List all chapters of a book **Risk:** `read` ```ts theme={null} await corsair.apibible.api.chapters.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bibleId` | `string` | Yes | — | | `bookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > bookId: string, > number: string, > reference: string > }[] > ``` *** ### listSections `chapters.listSections` List sections (usfm headings) within a chapter **Risk:** `read` ```ts theme={null} await corsair.apibible.api.chapters.listSections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bibleId` | `string` | Yes | — | | `chapterId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > bookId: string, > title: string, > firstVerseId?: string, > lastVerseId?: string, > firstVerseOrgId?: string, > lastVerseOrgId?: string > }[] > ``` *** ## Passages ### get `passages.get` Get one or more verses of scripture text by passage reference **Risk:** `read` ```ts theme={null} await corsair.apibible.api.passages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `includeNotes` | `boolean` | No | — | | `includeTitles` | `boolean` | No | — | | `includeChapterNumbers` | `boolean` | No | — | | `includeVerseNumbers` | `boolean` | No | — | | `includeVerseSpans` | `boolean` | No | — | | `bibleId` | `string` | Yes | — | | `passageId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > bibleId: string, > bookId?: string, > chapterIds?: string[], > content: string, > reference: string, > copyright?: string, > verseCount?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > fumsToken?: string > } > ``` *** ## Search ### query `search.query` Search for verses within a Bible version **Risk:** `read` ```ts theme={null} await corsair.apibible.api.search.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bibleId` | `string` | Yes | — | | `query` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `sort` | `relevance \| canonical \| usfm` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > query: string, > limit: number, > offset: number, > total: number, > verseCount: number, > verses: { > id: string, > orgId?: string, > bibleId: string, > bookId: string, > chapterId: string, > reference: string, > text: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > fumsToken?: string > } > ``` *** ## Sections ### get `sections.get` Get a section with its text content **Risk:** `read` ```ts theme={null} await corsair.apibible.api.sections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `includeNotes` | `boolean` | No | — | | `includeTitles` | `boolean` | No | — | | `includeChapterNumbers` | `boolean` | No | — | | `includeVerseNumbers` | `boolean` | No | — | | `includeVerseSpans` | `boolean` | No | — | | `bibleId` | `string` | Yes | — | | `sectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > bookId: string, > title: string, > firstVerseId?: string, > lastVerseId?: string, > firstVerseOrgId?: string, > lastVerseOrgId?: string, > chapterId?: string, > content: string, > copyright?: string, > verseCount?: number, > next?: { > id: string, > number?: string, > bookId?: string, > title?: string > } | null, > previous?: { > id: string, > number?: string, > bookId?: string, > title?: string > } | null > } > ``` > **meta full type** > > ```ts theme={null} > { > fumsToken?: string > } > ``` *** ### list `sections.list` List sections (usfm headings) of a book **Risk:** `read` ```ts theme={null} await corsair.apibible.api.sections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bibleId` | `string` | Yes | — | | `bookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bibleId: string, > bookId: string, > title: string, > firstVerseId?: string, > lastVerseId?: string, > firstVerseOrgId?: string, > lastVerseOrgId?: string > }[] > ``` *** ## Verses ### get `verses.get` Get a single verse with its text content **Risk:** `read` ```ts theme={null} await corsair.apibible.api.verses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `includeNotes` | `boolean` | No | — | | `includeTitles` | `boolean` | No | — | | `includeChapterNumbers` | `boolean` | No | — | | `includeVerseNumbers` | `boolean` | No | — | | `includeVerseSpans` | `boolean` | No | — | | `bibleId` | `string` | Yes | — | | `verseId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > bibleId: string, > bookId: string, > chapterId: string, > reference: string, > content: string, > copyright?: string, > verseCount?: number, > next?: { > id: string, > number?: string, > bookId?: string, > title?: string > } | null, > previous?: { > id: string, > number?: string, > bookId?: string, > title?: string > } | null > } > ``` > **meta full type** > > ```ts theme={null} > { > fumsToken?: string > } > ``` *** ### list `verses.list` List all verses of a chapter **Risk:** `read` ```ts theme={null} await corsair.apibible.api.verses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `includeNotes` | `boolean` | No | — | | `includeTitles` | `boolean` | No | — | | `includeChapterNumbers` | `boolean` | No | — | | `includeVerseNumbers` | `boolean` | No | — | | `includeVerseSpans` | `boolean` | No | — | | `bibleId` | `string` | Yes | — | | `chapterId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > bibleId: string, > bookId: string, > chapterId: string, > reference: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/apibible/database API.Bible local sync: searchable entities, `.search()` filters, and operators. The API.Bible plugin syncs data locally. Use `corsair.apibible.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Audio Bibles Path: `apibible.db.audioBibles.search` ```ts theme={null} const rows = await corsair.apibible.db.audioBibles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `dblId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `nameLocal` | `string` | equals, contains, startsWith, endsWith, in | | `abbreviation` | `string` | equals, contains, startsWith, endsWith, in | | `abbreviationLocal` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `copyright` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Audio Chapters Path: `apibible.db.audioChapters.search` ```ts theme={null} const rows = await corsair.apibible.db.audioChapters.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `bibleId` | `string` | equals, contains, startsWith, endsWith, in | | `bookId` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `reference` | `string` | equals, contains, startsWith, endsWith, in | | `resourceUrl` | `string` | equals, contains, startsWith, endsWith, in | | `expiresAt` | `string` | equals, contains, startsWith, endsWith, in | | `copyright` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Bibles Path: `apibible.db.bibles.search` ```ts theme={null} const rows = await corsair.apibible.db.bibles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `dblId` | `string` | equals, contains, startsWith, endsWith, in | | `relatedDbl` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `nameLocal` | `string` | equals, contains, startsWith, endsWith, in | | `abbreviation` | `string` | equals, contains, startsWith, endsWith, in | | `abbreviationLocal` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `descriptionLocal` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `copyright` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Books Path: `apibible.db.books.search` ```ts theme={null} const rows = await corsair.apibible.db.books.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `bibleId` | `string` | equals, contains, startsWith, endsWith, in | | `abbreviation` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `nameLong` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Chapters Path: `apibible.db.chapters.search` ```ts theme={null} const rows = await corsair.apibible.db.chapters.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `bibleId` | `string` | equals, contains, startsWith, endsWith, in | | `bookId` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `reference` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Passages Path: `apibible.db.passages.search` ```ts theme={null} const rows = await corsair.apibible.db.passages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `orgId` | `string` | equals, contains, startsWith, endsWith, in | | `bibleId` | `string` | equals, contains, startsWith, endsWith, in | | `bookId` | `string` | equals, contains, startsWith, endsWith, in | | `reference` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `copyright` | `string` | equals, contains, startsWith, endsWith, in | | `verseCount` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sections Path: `apibible.db.sections.search` ```ts theme={null} const rows = await corsair.apibible.db.sections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `bibleId` | `string` | equals, contains, startsWith, endsWith, in | | `bookId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `firstVerseId` | `string` | equals, contains, startsWith, endsWith, in | | `lastVerseId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Verses Path: `apibible.db.verses.search` ```ts theme={null} const rows = await corsair.apibible.db.verses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `orgId` | `string` | equals, contains, startsWith, endsWith, in | | `bibleId` | `string` | equals, contains, startsWith, endsWith, in | | `bookId` | `string` | equals, contains, startsWith, endsWith, in | | `chapterId` | `string` | equals, contains, startsWith, endsWith, in | | `reference` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `copyright` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/apibible/overview Bible content API for accessing scripture text, versions, and passage lookups. Use **API.Bible** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 19 typed API operations * 8 synced entities (`audioBibles`, `audioChapters`, `bibles`, `books`, `chapters`, `passages`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/apibible ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/apibible ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/apibible ``` ```bash bun theme={null} bun add corsair @corsair-dev/apibible ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { apibible } from '@corsair-dev/apibible'; export const corsair = createCorsair({ plugins: [ apibible(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} apibible() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'apibible', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`audioBibles.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apibible.api.audioBibles.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/apibible/api) reference.* See the full list on the [API](/plugins/apibible/api) page. ## Query synced data Synced entities support `tenant.apibible.db..search()` and `.list()`: `audioBibles`, `audioChapters`, `bibles`, `books`, `chapters`, `passages`, `sections`, `verses`. See [Database](/plugins/apibible/database) for filters and operators. ## What's next > **[API reference](/plugins/apibible/api)** > > Every `apibible.api.*` operation with input and output types. > **[Database](/plugins/apibible/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/apify/api API reference for Apify: every `apify.api.*` operation with input and output types. Every `apify.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Actor Builds ### abortActorBuild `actorBuilds.abortActorBuild` Tool to abort an Actor build that is starting or running. Use when you need to cancel a build in progress. Builds in terminal states (FINISHED, FAILED, ABORTING, TIMED-OUT) are not affected. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorBuilds.abortActorBuild({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `buildId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteActorBuild `actorBuilds.deleteActorBuild` Tool to delete an Actor build permanently. Use when you need to remove a specific build by its ID. The default build for an Actor cannot be deleted. Only users with build permissions can delete builds. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.actorBuilds.deleteActorBuild({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `buildId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActorBuild `actorBuilds.getActorBuild` Tool to get detailed information about a specific Actor build. Use when you need to retrieve complete build details by build ID. Optionally wait for the build to finish using the waitForFinish parameter to avoid polling. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorBuilds.getActorBuild({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `buildId` | `string \| number` | Yes | — | | `waitForFinish` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActorBuildLog `actorBuilds.getActorBuildLog` Tool to retrieve the log file for a specific Actor build. Use when you need to inspect logs generated during an Actor build process. Only the trailing 5 million characters of the log are stored. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorBuilds.getActorBuildLog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `buildId` | `string \| number` | Yes | — | | `stream` | `any` | No | — | | `download` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getUserBuildsList `actorBuilds.getUserBuildsList` Tool to get a paginated list of all builds for a user. Use when you need to retrieve build history across all actors. Supports pagination up to 1000 records. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorBuilds.getUserBuildsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Actor Runs ### abortActorRun `actorRuns.abortActorRun` Tool to abort a running or starting Actor run. Use when you need to stop an Actor run that is currently in STARTING or RUNNING status. For runs with status FINISHED, FAILED, ABORTING, and TIMED-OUT this call does nothing. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorRuns.abortActorRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `runId` | `string \| number` | Yes | — | | `gracefully` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteActorRun `actorRuns.deleteActorRun` Tool to delete a finished Actor run. Use when you need to permanently remove a completed run. Only finished runs can be deleted by the initiating user or organization. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.actorRuns.deleteActorRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `runId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActorRun `actorRuns.getActorRun` Tool to get details about a specific Actor run. Use when you need to retrieve comprehensive information about a run including its execution status, resource usage, storage IDs, and metadata. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorRuns.getActorRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `runId` | `string \| number` | Yes | — | | `waitForFinish` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getRunDatasetItems `actorRuns.getRunDatasetItems` Tool to get dataset items from a specific Actor run. Use when you need to retrieve the output data from a completed or running Actor run. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorRuns.getRunDatasetItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `runId` | `string \| number` | Yes | — | | `format` | `any` | No | — | | `clean` | `any` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `fields` | `any` | No | — | | `outputFields` | `any` | No | — | | `omit` | `any` | No | — | | `unwind` | `any` | No | — | | `flatten` | `any` | No | — | | `desc` | `any` | No | — | | `attachment` | `any` | No | — | | `delimiter` | `any` | No | — | | `bom` | `any` | No | — | | `xmlRoot` | `any` | No | — | | `xmlRow` | `any` | No | — | | `skipHeaderRow` | `any` | No | — | | `skipHidden` | `any` | No | — | | `skipEmpty` | `any` | No | — | | `simplified` | `any` | No | — | | `view` | `any` | No | — | | `skipFailedPages` | `any` | No | — | | `feedTitle` | `any` | No | — | | `feedDescription` | `any` | No | — | | `signature` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listUserActorRuns `actorRuns.listUserActorRuns` Tool to get a paginated list of all Actor runs for the authenticated user. Use when you need to browse all runs across all actors, optionally filtered by status or date range. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorRuns.listUserActorRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | | `status` | `any` | No | — | | `startedAfter` | `any` | No | — | | `startedBefore` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### resurrectRun `actorRuns.resurrectRun` Tool to resurrect a finished Actor run. Use when you need to restart a completed or failed run. Deprecated endpoint; may be removed in future. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorRuns.resurrectRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `runId` | `string \| number` | Yes | — | | `build` | `any` | No | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `maxTotalChargeUsd` | `any` | No | — | | `restartOnError` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateActorRunStatusMessage `actorRuns.updateActorRunStatusMessage` Tool to update the status message of an Actor run. Use when you need to set progress information or status updates that will be displayed in the Apify Console UI during Actor execution. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorRuns.updateActorRunStatusMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `runId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Actors ### callActor `actors.callActor` Run an Apify Actor and return run metadata **Risk:** `write` ```ts theme={null} await corsair.apify.api.actors.callActor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `actor` | `string` | Yes | Actor ID or full name (username/name) | | `input` | `object` | No | Actor input object matching the Actor input schema | | `build` | `string` | No | — | | `timeout` | `number` | No | — | | `memory` | `number` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### fetchActorDetails `actors.fetchActorDetails` Get detailed information about an Actor including schemas and pricing **Risk:** `read` ```ts theme={null} await corsair.apify.api.actors.fetchActorDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `actor` | `string` | Yes | Actor ID or full name (username/name) | | `output` | `object` | No | — | > **output full type** > > ```ts theme={null} > { > inputSchema?: boolean, > outputSchema?: boolean, > description?: boolean, > readme?: boolean, > pricing?: boolean, > mcpTools?: boolean > } > ``` **Output:** `any` *** ### ragWebBrowser `actors.ragWebBrowser` Search the web and scrape top results using the RAG Web Browser Actor **Risk:** `write` ```ts theme={null} await corsair.apify.api.actors.ragWebBrowser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | Search query for the RAG Web Browser Actor | | `maxResults` | `number` | No | — | **Output:** `any` *** ### searchActors `actors.searchActors` Search for Actors in the Apify Store **Risk:** `read` ```ts theme={null} await corsair.apify.api.actors.searchActors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | Yes | Search query for Apify Store Actors | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `any` *** ## Actor Tasks ### createActorTask `actorTasks.createActorTask` Tool to create a new Actor task with specified settings. Use when you need to configure or schedule recurring Actor runs programmatically. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorTasks.createActorTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteActorTask `actorTasks.deleteActorTask` Tool to delete an Actor task permanently. Use when you need to remove a task by its ID or username\~taskName. Confirm before calling. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.actorTasks.deleteActorTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActorTask `actorTasks.getActorTask` Tool to get complete details about an Actor task. Use when you need to retrieve task configuration, input settings, or metadata by task ID or username\~task-name. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorTasks.getActorTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getLastActorTaskRun `actorTasks.getLastActorTaskRun` Tool to get the most recent run of a specific Actor task. Use when you need to retrieve the last execution details. You can filter by status to get only successful runs using status='SUCCEEDED'. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorTasks.getLastActorTaskRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | | `status` | `any` | No | — | | `origin` | `any` | No | — | | `waitForFinish` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfTaskRuns `actorTasks.getListOfTaskRuns` Tool to get a list of runs for a specific Actor task. Use when you need to paginate through task runs and optionally filter by status. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorTasks.getListOfTaskRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | | `status` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfTasks `actorTasks.getListOfTasks` Tool to fetch a paginated list of tasks belonging to the authenticated user. Use when you need to browse or sort tasks created by the user. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorTasks.getListOfTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfTaskWebhooks `actorTasks.getListOfTaskWebhooks` Tool to get a list of webhooks for a specific Actor task. Use when you need to review or paginate webhooks after creating or updating a task. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorTasks.getListOfTaskWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTaskInput `actorTasks.getTaskInput` Tool to retrieve the input configuration of a specific task. Use when you need to inspect stored task input before execution or debugging. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorTasks.getTaskInput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTaskLastRunDatasetItems `actorTasks.getTaskLastRunDatasetItems` Tool to get dataset items from the last run of an Actor task. Use when you need to retrieve data from the most recent task execution. Filter by status (e.g., 'SUCCEEDED') to get items from the last successful run only. **Risk:** `read` ```ts theme={null} await corsair.apify.api.actorTasks.getTaskLastRunDatasetItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | | `status` | `any` | No | — | | `origin` | `any` | No | — | | `format` | `any` | No | — | | `clean` | `any` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `fields` | `any` | No | — | | `outputFields` | `any` | No | — | | `omit` | `any` | No | — | | `unwind` | `any` | No | — | | `flatten` | `any` | No | — | | `desc` | `any` | No | — | | `attachment` | `any` | No | — | | `delimiter` | `any` | No | — | | `bom` | `any` | No | — | | `xmlRoot` | `any` | No | — | | `xmlRow` | `any` | No | — | | `skipHeaderRow` | `any` | No | — | | `skipHidden` | `any` | No | — | | `skipEmpty` | `any` | No | — | | `simplified` | `any` | No | — | | `view` | `any` | No | — | | `skipFailedPages` | `any` | No | — | | `feedTitle` | `any` | No | — | | `feedDescription` | `any` | No | — | | `signature` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runTaskAsynchronously `actorTasks.runTaskAsynchronously` Tool to run a specific Actor task asynchronously. Use when you need to trigger a task run without waiting for completion and immediately retrieve its run details. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorTasks.runTaskAsynchronously({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `maxTotalChargeUsd` | `any` | No | — | | `restartOnError` | `any` | No | — | | `build` | `any` | No | — | | `waitForFinish` | `any` | No | — | | `webhooks` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runTaskSyncGet `actorTasks.runTaskSyncGet` Tool to run a specific task synchronously and return its output. Use when immediate task results are needed with pre-configured settings. The run must finish within 300 seconds otherwise the HTTP request fails with a timeout error. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorTasks.runTaskSyncGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `build` | `any` | No | — | | `outputRecordKey` | `any` | No | — | | `webhooks` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runTaskSyncGetDatasetItems `actorTasks.runTaskSyncGetDatasetItems` Tool to run an actor task synchronously and retrieve its dataset items. Use when immediate access to task run results is needed. The run must finish within 300 seconds otherwise the request times out. For large datasets exceeding the timeout, use `limit`/`offset` pagination to retrieve results in smaller batches or switch to an async run pattern with a separate dataset retrieval call. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorTasks.runTaskSyncGetDatasetItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `build` | `any` | No | — | | `webhooks` | `any` | No | — | | `format` | `any` | No | — | | `clean` | `any` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `fields` | `any` | No | — | | `outputFields` | `any` | No | — | | `omit` | `any` | No | — | | `unwind` | `any` | No | — | | `flatten` | `any` | No | — | | `desc` | `any` | No | — | | `attachment` | `any` | No | — | | `delimiter` | `any` | No | — | | `bom` | `any` | No | — | | `xmlRoot` | `any` | No | — | | `xmlRow` | `any` | No | — | | `skipHeaderRow` | `any` | No | — | | `skipHidden` | `any` | No | — | | `skipEmpty` | `any` | No | — | | `simplified` | `any` | No | — | | `view` | `any` | No | — | | `skipFailedPages` | `any` | No | — | | `feedTitle` | `any` | No | — | | `feedDescription` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runTaskSyncPost `actorTasks.runTaskSyncPost` Tool to run an Actor task synchronously with input override and return its output. Use when immediate task results are needed with custom input parameters. The run must finish within 300 seconds otherwise the HTTP request fails with a timeout error (though the run continues server-side). **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorTasks.runTaskSyncPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `maxTotalChargeUsd` | `any` | No | — | | `restartOnError` | `any` | No | — | | `build` | `any` | No | — | | `outputRecordKey` | `any` | No | — | | `webhooks` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runTaskSyncWithInputOverrideGetDatasetItems `actorTasks.runTaskSyncWithInputOverrideGetDatasetItems` Tool to run an actor task synchronously with input overrides and retrieve its dataset items. Use when you need to override task input configuration and get immediate results. The run must finish within 300 seconds otherwise the request times out. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorTasks.runTaskSyncWithInputOverrideGetDatasetItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `maxTotalChargeUsd` | `any` | No | — | | `restartOnError` | `any` | No | — | | `build` | `any` | No | — | | `webhooks` | `any` | No | — | | `format` | `any` | No | — | | `clean` | `any` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `fields` | `any` | No | — | | `outputFields` | `any` | No | — | | `omit` | `any` | No | — | | `unwind` | `any` | No | — | | `flatten` | `any` | No | — | | `desc` | `any` | No | — | | `attachment` | `any` | No | — | | `delimiter` | `any` | No | — | | `bom` | `any` | No | — | | `xmlRoot` | `any` | No | — | | `xmlRow` | `any` | No | — | | `skipHeaderRow` | `any` | No | — | | `skipHidden` | `any` | No | — | | `skipEmpty` | `any` | No | — | | `simplified` | `any` | No | — | | `view` | `any` | No | — | | `skipFailedPages` | `any` | No | — | | `feedTitle` | `any` | No | — | | `feedDescription` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateActorTask `actorTasks.updateActorTask` Tool to update Actor task settings using JSON payload. Only specified properties are updated; others remain unchanged. Use when you need to modify task configuration, input, or execution options. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorTasks.updateActorTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateTaskInput `actorTasks.updateTaskInput` Tool to update the input configuration of a specific Actor task. Use when you need to modify a scheduled task input before execution. **Risk:** `write` ```ts theme={null} await corsair.apify.api.actorTasks.updateTaskInput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorTaskId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Acts ### buildActor `acts.buildActor` Tool to build an Actor with specified configuration. Use when you need to create a new build of an Actor with a specific version. The build process compiles the Actor's source code into a Docker image. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.buildActor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `version` | `any` | No | — | | `useCache` | `any` | No | — | | `betaPackages` | `any` | No | — | | `tag` | `any` | No | — | | `waitForFinish` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createActor `acts.createActor` Tool to create a new Actor with specified configuration. Use when you need to initialize a fresh Actor programmatically before publishing or running it. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.createActor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createActorVersion `acts.createActorVersion` Tool to create a new version of an Actor. Use when you need to add a new version with specific source code location and configuration. Requires versionNumber and sourceType parameters, plus conditional parameters based on the sourceType. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.createActorVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createActorVersionEnvironmentVariable `acts.createActorVersionEnvironmentVariable` Tool to create an environment variable for a specific Actor version. Use when adding new environment variables to Actor versions. Requires name and value parameters. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.createActorVersionEnvironmentVariable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `versionNumber` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteActor `acts.deleteActor` Tool to delete an Actor permanently. Use when you need to remove an Actor by its ID or username\~actorName. Confirm before calling. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.acts.deleteActor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteActorVersion `acts.deleteActorVersion` Tool to delete a specific version of an Actor's source code. Use when you need to remove an Actor version by actor ID and version number. Confirm before calling. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.acts.deleteActorVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `versionNumber` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteActorVersionEnvironmentVariable `acts.deleteActorVersionEnvironmentVariable` Tool to delete an environment variable from a specific Actor version. Use when removing environment variables from Actor versions. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.acts.deleteActorVersionEnvironmentVariable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `versionNumber` | `string \| number` | Yes | — | | `envVarName` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActorDetails `acts.getActorDetails` Tool to get details of a specific Actor. Use when you need actor metadata by ID or username/actorName. Response includes `isDeprecated` and `notice` fields indicating deprecation status, and `pricingInfos` for per-unit cost details — review both before scheduling runs. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getActorDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActorLastRunDatasetItems `acts.getActorLastRunDatasetItems` Tool to get dataset items from the last run of an Actor. Use when you need to retrieve output data from the most recent Actor execution, optionally filtered by run status (e.g., status='SUCCEEDED' to get items only from the last successful run). **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getActorLastRunDatasetItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `status` | `any` | No | — | | `origin` | `any` | No | — | | `format` | `any` | No | — | | `clean` | `any` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `fields` | `any` | No | — | | `outputFields` | `any` | No | — | | `omit` | `any` | No | — | | `unwind` | `any` | No | — | | `flatten` | `any` | No | — | | `desc` | `any` | No | — | | `attachment` | `any` | No | — | | `delimiter` | `any` | No | — | | `bom` | `any` | No | — | | `xmlRoot` | `any` | No | — | | `xmlRow` | `any` | No | — | | `skipHeaderRow` | `any` | No | — | | `skipHidden` | `any` | No | — | | `skipEmpty` | `any` | No | — | | `simplified` | `any` | No | — | | `view` | `any` | No | — | | `skipFailedPages` | `any` | No | — | | `feedTitle` | `any` | No | — | | `feedDescription` | `any` | No | — | | `signature` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActorVersion `acts.getActorVersion` Tool to get details about a specific version of an Actor. Use when you need version metadata including source type, build tag, and configuration details. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getActorVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `versionNumber` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActorVersionEnvironmentVariable `acts.getActorVersionEnvironmentVariable` Tool to get environment variable details for a specific Actor version. Use when retrieving environment variable information from an Actor version. Returns name, value (if not secret), and secret status. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getActorVersionEnvironmentVariable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `versionNumber` | `string \| number` | Yes | — | | `envVarName` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDefaultBuild `acts.getDefaultBuild` Tool to get the default build for an Actor. Use after specifying the Actor ID; optionally wait for the build to finish before returning. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getDefaultBuild({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `waitForFinish` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getLastActorRun `acts.getLastActorRun` Tool to get the most recent run of a specific Actor. Use when you need to retrieve the last execution details of an Actor and optionally filter by status (e.g., status='SUCCEEDED' to get only the last successful run). **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getLastActorRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `status` | `any` | No | — | | `origin` | `any` | No | — | | `waitForFinish` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfActors `acts.getListOfActors` Tool to get the list of all Actors that the user created or used. Use when you need to enumerate or browse Actors. Add my=1 to get only user-created Actors. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getListOfActors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `my` | `any` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | | `sortBy` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfActorVersionEnvironmentVariables `acts.getListOfActorVersionEnvironmentVariables` Tool to get the list of environment variables for a specific Actor version. Use when you need to retrieve environment variable configurations for an Actor version. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getListOfActorVersionEnvironmentVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `versionNumber` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfActorVersions `acts.getListOfActorVersions` Tool to get the list of versions of a specific Actor. Use when you need to retrieve version metadata including source type, version number, and configuration details. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getListOfActorVersions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfActorWebhooks `acts.getListOfActorWebhooks` Tool to get a list of webhooks for a specific Actor. Use when you need to review or manage webhooks configured for an Actor. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getListOfActorWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfBuilds `acts.getListOfBuilds` Tool to get a list of builds for a specific Actor. Use when you need paginated access to an Actor’s build (version) history. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getListOfBuilds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfRuns `acts.getListOfRuns` Tool to get a list of runs for a specific Actor. Use when you need to paginate through runs and optionally filter by status before processing run data. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getListOfRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | | `status` | `any` | No | — | | `startedAfter` | `any` | No | — | | `startedBefore` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOpenapiDefinition `acts.getOpenapiDefinition` Tool to get the OpenAPI definition for a specific Actor build. Use when you need the API schema for code generation or analysis. **Risk:** `read` ```ts theme={null} await corsair.apify.api.acts.getOpenapiDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `buildId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runActorAsynchronously `acts.runActorAsynchronously` Tool to run a specific Actor asynchronously. Use when you need to trigger an Actor run without waiting for completion and retrieve its run details immediately. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.runActorAsynchronously({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `maxTotalChargeUsd` | `any` | No | — | | `restartOnError` | `any` | No | — | | `build` | `any` | No | — | | `waitForFinish` | `any` | No | — | | `webhooks` | `any` | No | — | | `forcePermissionLevel` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runActorSync `acts.runActorSync` Tool to run a specific Actor synchronously with input and return its output record. Use when immediate Actor results are needed; runs may timeout after 300 seconds. To avoid timeouts, scope inputs to specific URLs rather than broad crawls and request only necessary fields (e.g., text or markdown). **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.runActorSync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `outputRecordKey` | `any` | No | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `maxTotalChargeUsd` | `any` | No | — | | `restartOnError` | `any` | No | — | | `build` | `any` | No | — | | `webhooks` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runActorSyncGetDatasetItems `acts.runActorSyncGetDatasetItems` Tool to run Actor synchronously and get dataset items. Supports both actors that require input and those that don't. Use when immediate access to Actor results is needed. The run must finish within 300 seconds otherwise the request times out. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.runActorSyncGetDatasetItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `maxTotalChargeUsd` | `any` | No | — | | `restartOnError` | `any` | No | — | | `build` | `any` | No | — | | `webhooks` | `any` | No | — | | `format` | `any` | No | — | | `clean` | `any` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `fields` | `any` | No | — | | `outputFields` | `any` | No | — | | `omit` | `any` | No | — | | `unwind` | `any` | No | — | | `flatten` | `any` | No | — | | `desc` | `any` | No | — | | `attachment` | `any` | No | — | | `delimiter` | `any` | No | — | | `bom` | `any` | No | — | | `xmlRoot` | `any` | No | — | | `xmlRow` | `any` | No | — | | `skipHeaderRow` | `any` | No | — | | `skipHidden` | `any` | No | — | | `skipEmpty` | `any` | No | — | | `simplified` | `any` | No | — | | `view` | `any` | No | — | | `skipFailedPages` | `any` | No | — | | `feedTitle` | `any` | No | — | | `feedDescription` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runActorSyncGetDatasetItemsItems `acts.runActorSyncGetDatasetItemsItems` Tool to run an Actor synchronously and retrieve its dataset items. Use when immediate access to run results is needed. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.runActorSyncGetDatasetItemsItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `maxTotalChargeUsd` | `any` | No | — | | `restartOnError` | `any` | No | — | | `build` | `any` | No | — | | `webhooks` | `any` | No | — | | `format` | `any` | No | — | | `clean` | `any` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `fields` | `any` | No | — | | `outputFields` | `any` | No | — | | `omit` | `any` | No | — | | `unwind` | `any` | No | — | | `flatten` | `any` | No | — | | `desc` | `any` | No | — | | `attachment` | `any` | No | — | | `delimiter` | `any` | No | — | | `bom` | `any` | No | — | | `xmlRoot` | `any` | No | — | | `xmlRow` | `any` | No | — | | `skipHeaderRow` | `any` | No | — | | `skipHidden` | `any` | No | — | | `skipEmpty` | `any` | No | — | | `simplified` | `any` | No | — | | `view` | `any` | No | — | | `skipFailedPages` | `any` | No | — | | `feedTitle` | `any` | No | — | | `feedDescription` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runActorSyncWithoutInputGet `acts.runActorSyncWithoutInputGet` Tool to run a specific Actor synchronously without input and return its output. Use when immediate Actor results are needed without providing input data; the run must finish within 300 seconds otherwise the HTTP request fails with a timeout error. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.runActorSyncWithoutInputGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `outputRecordKey` | `any` | No | — | | `timeout` | `any` | No | — | | `memory` | `any` | No | — | | `maxItems` | `any` | No | — | | `maxTotalChargeUsd` | `any` | No | — | | `restartOnError` | `any` | No | — | | `build` | `any` | No | — | | `webhooks` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateActor `acts.updateActor` Tool to update Actor settings using JSON payload. Only specified fields will be updated. Use when you need to modify Actor configuration, make an Actor public, or update version settings. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.updateActor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateActorVersion `acts.updateActorVersion` Tool to update an Actor version's configuration and source code. Use when modifying version properties such as buildTag, sourceType, or environment variables. Only specified properties will be updated. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.updateActorVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `versionNumber` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateActorVersionEnvironmentVariable `acts.updateActorVersionEnvironmentVariable` Tool to update environment variable for a specific Actor version using JSON payload. Only specified fields will be updated. Use when modifying existing environment variables in Actor versions. **Risk:** `write` ```ts theme={null} await corsair.apify.api.acts.updateActorVersionEnvironmentVariable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `actorId` | `string \| number` | Yes | — | | `versionNumber` | `string \| number` | Yes | — | | `envVarName` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Datasets ### createDataset `datasets.createDataset` Tool to create a new dataset. Use when you need to initialize or retrieve a dataset by name. **Risk:** `write` ```ts theme={null} await corsair.apify.api.datasets.createDataset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `name` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDataset `datasets.deleteDataset` Tool to delete a dataset permanently. Use when you need to remove a dataset by its ID or username\~dataset-name. Confirm before calling. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.datasets.deleteDataset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `datasetId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDataset `datasets.getDataset` Tool to retrieve dataset metadata by dataset ID. Use when you need information about a dataset's structure, item counts, or access URLs. This does not return dataset items themselves. **Risk:** `read` ```ts theme={null} await corsair.apify.api.datasets.getDataset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `datasetId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDatasetItems `datasets.getDatasetItems` Tool to retrieve items from a dataset. Use when you need to fetch data from a specified dataset by pagination or filtering. Only JSON format is fully supported. For datasets larger than 1000 items, issue multiple calls incrementing `offset` by `limit` until the response returns fewer items than `limit`. **Risk:** `read` ```ts theme={null} await corsair.apify.api.datasets.getDatasetItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `datasetId` | `string \| number` | Yes | — | | `format` | `any` | No | — | | `clean` | `any` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `fields` | `any` | No | — | | `outputFields` | `any` | No | — | | `omit` | `any` | No | — | | `unwind` | `any` | No | — | | `flatten` | `any` | No | — | | `desc` | `any` | No | — | | `attachment` | `any` | No | — | | `delimiter` | `any` | No | — | | `bom` | `any` | No | — | | `xmlRoot` | `any` | No | — | | `xmlRow` | `any` | No | — | | `skipHeaderRow` | `any` | No | — | | `skipHidden` | `any` | No | — | | `skipEmpty` | `any` | No | — | | `simplified` | `any` | No | — | | `view` | `any` | No | — | | `skipFailedPages` | `any` | No | — | | `feedTitle` | `any` | No | — | | `feedDescription` | `any` | No | — | | `signature` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDatasetStatistics `datasets.getDatasetStatistics` Tool to get dataset field statistics by dataset ID. Use when you need statistical information about dataset fields including min, max, null count, and empty count. Only provides field statistics when dataset schema is configured. **Risk:** `read` ```ts theme={null} await corsair.apify.api.datasets.getDatasetStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `datasetId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfDatasets `datasets.getListOfDatasets` Tool to get list of datasets for a user. Use when you need to enumerate or browse user's datasets. Supports pagination with up to 1000 items per page. **Risk:** `read` ```ts theme={null} await corsair.apify.api.datasets.getListOfDatasets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | | `unnamed` | `any` | No | — | | `ownership` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### storeDataInDataset `datasets.storeDataInDataset` Tool to store data items in a dataset. Use after collecting data when you want to batch-append or update items in an existing dataset. **Risk:** `write` ```ts theme={null} await corsair.apify.api.datasets.storeDataInDataset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `datasetId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDataset `datasets.updateDataset` Tool to update a dataset's name via JSON payload. Use when you need to rename an existing dataset. **Risk:** `write` ```ts theme={null} await corsair.apify.api.datasets.updateDataset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `datasetId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Docs ### fetchApifyDocs `docs.fetchApifyDocs` Fetch the full content of an Apify documentation page **Risk:** `read` ```ts theme={null} await corsair.apify.api.docs.fetchApifyDocs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Full Apify or Crawlee documentation page URL | **Output:** `any` *** ### searchApifyDocs `docs.searchApifyDocs` Search Apify and Crawlee documentation **Risk:** `read` ```ts theme={null} await corsair.apify.api.docs.searchApifyDocs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | Documentation search query | | `docSource` | `apify \| crawlee-js \| crawlee-py` | No | Documentation source to search | **Output:** `any` *** ## Key Value Stores ### checkKeyValueStoreRecordExists `keyValueStores.checkKeyValueStoreRecordExists` Tool to check if a record exists in a key-value store. Use when you need to verify whether a specific key exists in an Apify Key-Value Store without retrieving its content. **Risk:** `read` ```ts theme={null} await corsair.apify.api.keyValueStores.checkKeyValueStoreRecordExists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `storeId` | `string \| number` | Yes | — | | `recordKey` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createKeyValueStore `keyValueStores.createKeyValueStore` Tool to create a new key-value store or retrieve an existing one by name. Use when you need to initialize a store for saving data records or files. If a store with the given name already exists, returns that store instead of creating a duplicate. **Risk:** `write` ```ts theme={null} await corsair.apify.api.keyValueStores.createKeyValueStore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `name` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteKeyValueStore `keyValueStores.deleteKeyValueStore` Tool to delete a key-value store permanently. Use when you need to remove a key-value store by its ID. Confirm before calling. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.keyValueStores.deleteKeyValueStore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `storeId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteKeyValueStoreRecord `keyValueStores.deleteKeyValueStoreRecord` Tool to delete a record from a key-value store. Use when you need to remove a specific record by its key from an Apify Key-Value Store. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.keyValueStores.deleteKeyValueStoreRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `storeId` | `string \| number` | Yes | — | | `recordKey` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getKeyValueRecord `keyValueStores.getKeyValueRecord` Tool to retrieve a record from a key-value store. Use when you need to fetch a specific value by key from an Apify Key-Value Store. **Risk:** `read` ```ts theme={null} await corsair.apify.api.keyValueStores.getKeyValueRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `storeId` | `string \| number` | Yes | — | | `recordKey` | `string \| number` | Yes | — | | `attachment` | `any` | No | — | | `signature` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getKeyValueStore `keyValueStores.getKeyValueStore` Tool to retrieve key-value store metadata by store ID. Use when you need detailed information about a specific key-value store including stats and access URLs. **Risk:** `read` ```ts theme={null} await corsair.apify.api.keyValueStores.getKeyValueStore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `storeId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getKeyValueStoreKeys `keyValueStores.getKeyValueStoreKeys` Tool to retrieve a list of keys from a key-value store. Use when you need to list keys in a store with optional filtering and pagination support. **Risk:** `read` ```ts theme={null} await corsair.apify.api.keyValueStores.getKeyValueStoreKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `storeId` | `string \| number` | Yes | — | | `exclusiveStartKey` | `any` | No | — | | `limit` | `any` | No | — | | `collection` | `any` | No | — | | `prefix` | `any` | No | — | | `signature` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfKeyValueStores `keyValueStores.getListOfKeyValueStores` Tool to get the list of key-value stores owned by the user. Use when you need to enumerate or browse available stores. Supports pagination up to 1000 records per request. **Risk:** `read` ```ts theme={null} await corsair.apify.api.keyValueStores.getListOfKeyValueStores({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | | `unnamed` | `any` | No | — | | `ownership` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### storeDataInKeyValueStore `keyValueStores.storeDataInKeyValueStore` Tool to create or update a record in a key-value store. Use after you have the store ID and record key to persist JSON data. **Risk:** `write` ```ts theme={null} await corsair.apify.api.keyValueStores.storeDataInKeyValueStore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `storeId` | `string \| number` | Yes | — | | `recordKey` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateKeyValueStore `keyValueStores.updateKeyValueStore` Tool to update a key-value store's properties. Use when renaming or changing access or schema version of the store after confirming the store ID. **Risk:** `write` ```ts theme={null} await corsair.apify.api.keyValueStores.updateKeyValueStore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `storeId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Logs ### getLog `logs.getLog` Tool to retrieve logs for a specific Actor run or build. Use after a run completes or fails — a run may report success status yet contain only informational messages, making log inspection the only way to confirm actual outcomes. For long runs, log responses can be very large; prioritize error-level entries and recent timestamps to diagnose issues efficiently. **Risk:** `read` ```ts theme={null} await corsair.apify.api.logs.getLog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `buildOrRunId` | `string \| number` | Yes | — | | `stream` | `any` | No | — | | `download` | `any` | No | — | | `raw` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Request Queues ### addRequestToQueue `requestQueues.addRequestToQueue` Tool to add a request to the queue. Use when you need to add a web page URL to a request queue for crawling. If a request with the same uniqueKey was already present in the queue, returns the ID of the existing request. **Risk:** `write` ```ts theme={null} await corsair.apify.api.requestQueues.addRequestToQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `clientKey` | `any` | No | — | | `forefront` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### batchAddRequestsToQueue `requestQueues.batchAddRequestsToQueue` Tool to batch-add up to 25 requests to a request queue. Use when you need to add multiple requests efficiently. Failed requests due to rate limits should be retried with exponential backoff. **Risk:** `write` ```ts theme={null} await corsair.apify.api.requestQueues.batchAddRequestsToQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `clientKey` | `any` | No | — | | `forefront` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### batchDeleteRequestsFromQueue `requestQueues.batchDeleteRequestsFromQueue` Tool to batch-delete up to 25 requests from a queue. Use when you need to remove multiple requests efficiently. Failed requests due to rate limits should be retried with exponential backoff. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.requestQueues.batchDeleteRequestsFromQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `clientKey` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createRequestQueue `requestQueues.createRequestQueue` Tool to create a new request queue or retrieve an existing one by name. Use when you need to initialize a queue for storing and managing web scraping requests. If a queue with the given name already exists, returns that queue instead of creating a duplicate. Unnamed queues follow data retention period policies. **Risk:** `write` ```ts theme={null} await corsair.apify.api.requestQueues.createRequestQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `name` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteRequestFromQueue `requestQueues.deleteRequestFromQueue` Tool to delete a specific request from a request queue. Use when you need to remove a request by its ID from an Apify request queue. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.requestQueues.deleteRequestFromQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `requestId` | `string \| number` | Yes | — | | `clientKey` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteRequestLock `requestQueues.deleteRequestLock` Tool to delete a request lock from a request queue. Use when you need to unlock a previously locked request. Only the client that locked the request can delete its lock. **Risk:** `write` ```ts theme={null} await corsair.apify.api.requestQueues.deleteRequestLock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `requestId` | `string \| number` | Yes | — | | `clientKey` | `any` | No | — | | `forefront` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteRequestQueue `requestQueues.deleteRequestQueue` Tool to delete a request queue permanently. Use when you need to remove a request queue by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.requestQueues.deleteRequestQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getHeadAndLockQueueRequests `requestQueues.getHeadAndLockQueueRequests` Tool to get and lock head requests from the queue. Returns the given number of first requests from the queue and locks them for the given time, preventing other clients from accessing them during the lock period. Use when you need to process requests exclusively without concurrent access by other clients. **Risk:** `write` ```ts theme={null} await corsair.apify.api.requestQueues.getHeadAndLockQueueRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `lockSecs` | `any` | No | — | | `limit` | `any` | No | — | | `clientKey` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfRequestQueues `requestQueues.getListOfRequestQueues` Tool to get list of request queues for a user. Use when you need to enumerate or browse user's request queues. Supports pagination with up to 1000 items per page. **Risk:** `read` ```ts theme={null} await corsair.apify.api.requestQueues.getListOfRequestQueues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | | `unnamed` | `any` | No | — | | `ownership` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getRequestFromQueue `requestQueues.getRequestFromQueue` Tool to retrieve a specific request from a request queue by its ID. Use when you need to get detailed information about a request in an Apify request queue. **Risk:** `read` ```ts theme={null} await corsair.apify.api.requestQueues.getRequestFromQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `requestId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getRequestQueue `requestQueues.getRequestQueue` Tool to retrieve request queue metadata by queue ID. Use when you need information about a specific request queue including its statistics and request counts. **Risk:** `read` ```ts theme={null} await corsair.apify.api.requestQueues.getRequestQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getRequestQueueHead `requestQueues.getRequestQueueHead` Tool to retrieve first requests from the queue for inspection. Use when you need to examine pending requests without locking them. **Risk:** `read` ```ts theme={null} await corsair.apify.api.requestQueues.getRequestQueueHead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `limit` | `any` | No | — | | `clientKey` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listRequestQueueRequests `requestQueues.listRequestQueueRequests` Tool to list requests in a request queue with pagination support. Use when you need to retrieve multiple requests from an Apify request queue. **Risk:** `read` ```ts theme={null} await corsair.apify.api.requestQueues.listRequestQueueRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `clientKey` | `any` | No | — | | `exclusiveStartId` | `any` | No | — | | `limit` | `any` | No | — | | `cursor` | `any` | No | — | | `filter` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### prolongRequestLock `requestQueues.prolongRequestLock` Tool to prolong request lock in a request queue. Use when you need to extend the lock duration on a previously locked request. Only the client that locked the request can prolong its lock. **Risk:** `write` ```ts theme={null} await corsair.apify.api.requestQueues.prolongRequestLock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `requestId` | `string \| number` | Yes | — | | `lockSecs` | `any` | No | — | | `clientKey` | `any` | No | — | | `forefront` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### unlockQueueRequests `requestQueues.unlockQueueRequests` Tool to unlock requests in a request queue that are currently locked by the client. If the client is within an Actor run, unlocks all requests locked by that specific run plus all requests locked by the same clientKey. If the client is outside of an Actor run, unlocks all requests locked using the same clientKey. **Risk:** `write` ```ts theme={null} await corsair.apify.api.requestQueues.unlockQueueRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `clientKey` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateRequestInQueue `requestQueues.updateRequestInQueue` Tool to update a request in a request queue. Use when you need to modify request properties or mark a request as handled by setting handledAt to the current date/time. If handledAt is set, the request will be removed from the head of the queue and unlocked if applicable. **Risk:** `write` ```ts theme={null} await corsair.apify.api.requestQueues.updateRequestInQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | | `requestId` | `string \| number` | Yes | — | | `forefront` | `any` | No | — | | `clientKey` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateRequestQueue `requestQueues.updateRequestQueue` Tool to update request queue name using JSON payload. Use when you need to rename an existing request queue. **Risk:** `write` ```ts theme={null} await corsair.apify.api.requestQueues.updateRequestQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `queueId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Runs ### getActorOutput `runs.getActorOutput` Retrieve dataset items from an Actor run (Apify MCP get-dataset-items) **Risk:** `read` ```ts theme={null} await corsair.apify.api.runs.getActorOutput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | Dataset ID from an Actor run (storages.datasets.default.id) | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string` | No | — | **Output:** `any` *** ### getActorRun `runs.getActorRun` Get detailed information about a specific Actor run **Risk:** `read` ```ts theme={null} await corsair.apify.api.runs.getActorRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `runId` | `string` | Yes | Actor run ID | **Output:** `any` *** ## Schedules ### createSchedule `schedules.createSchedule` Tool to create a new schedule with specified settings. Use when you need to automate Actor or Actor task execution at specific times using cron expressions. **Risk:** `write` ```ts theme={null} await corsair.apify.api.schedules.createSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteSchedule `schedules.deleteSchedule` Tool to delete a schedule by its ID. Use when you need to remove a schedule from the Apify system. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.schedules.deleteSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `scheduleId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getListOfSchedules `schedules.getListOfSchedules` Tool to get list of schedules created by the user. Use when you need to browse or enumerate user's schedules. Supports pagination with up to 1000 items per page. **Risk:** `read` ```ts theme={null} await corsair.apify.api.schedules.getListOfSchedules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSchedule `schedules.getSchedule` Tool to get schedule details by ID. Use when you need to retrieve comprehensive information about a schedule including cron expression, timezone, actions, and execution times. **Risk:** `read` ```ts theme={null} await corsair.apify.api.schedules.getSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `scheduleId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getScheduleLog `schedules.getScheduleLog` Tool to get schedule log by ID. Use when you need to retrieve execution history for a schedule, including invocation timestamps and status messages. Returns up to 1000 invocations. **Risk:** `read` ```ts theme={null} await corsair.apify.api.schedules.getScheduleLog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `scheduleId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSchedule `schedules.updateSchedule` Tool to update an existing schedule with new settings. Use when you need to modify schedule properties like cron expression, timezone, enabled status, or actions. Only specified fields are updated; others remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.apify.api.schedules.updateSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `scheduleId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Store ### getListOfActorsInStore `store.getListOfActorsInStore` Tool to get list of public Actors from Apify Store. Use when you need to browse or search public Actors available in the store. Supports searching by title, name, description, username, and readme. **Risk:** `read` ```ts theme={null} await corsair.apify.api.store.getListOfActorsInStore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `limit` | `any` | No | — | | `offset` | `any` | No | — | | `search` | `any` | No | — | | `sortBy` | `any` | No | — | | `category` | `any` | No | — | | `username` | `any` | No | — | | `pricingModel` | `any` | No | — | | `allowsAgenticUsers` | `any` | No | — | | `responseFormat` | `any` | No | — | | `includeUnrunnableActors` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Users ### getAccountLimits `users.getAccountLimits` Tool to get a complete summary of account limits and usage. Use when you need to retrieve information about usage cycles, spending caps, compute resources, data transfer quotas, and other account limits. This shows the same information as the Limits page in Apify console. **Risk:** `read` ```ts theme={null} await corsair.apify.api.users.getAccountLimits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCurrentUserAccountData `users.getCurrentUserAccountData` Tool to get private user account information. Use when you need to retrieve comprehensive data about the current user identified by the authentication token, including profile, subscription plan, and proxy settings. Note: 'plan', 'email', and 'profile' fields are omitted when accessed from Actor run. **Risk:** `read` ```ts theme={null} await corsair.apify.api.users.getCurrentUserAccountData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getMonthlyUsage `users.getMonthlyUsage` Tool to get monthly usage summary with daily breakdown. Use when you need detailed usage information including storage, data transfer, and request queue metrics for the current or a specific billing cycle. This shows the same information as the Billing page in Apify console. **Risk:** `read` ```ts theme={null} await corsair.apify.api.users.getMonthlyUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `date` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPublicUserData `users.getPublicUserData` Tool to get public user data. Use when you need to retrieve publicly accessible information about a specific Apify user account, similar to what can be seen on public profile pages. This operation requires no authentication token. **Risk:** `read` ```ts theme={null} await corsair.apify.api.users.getPublicUserData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `userId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateAccountLimits `users.updateAccountLimits` Tool to update account limits manageable on the Limits page. Use when you need to set or modify the monthly spending cap (maxMonthlyUsageUsd) or data retention period (dataRetentionDays). At least one limit parameter must be provided. **Risk:** `write` ```ts theme={null} await corsair.apify.api.users.updateAccountLimits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Webhook Dispatches ### getListOfWebhookDispatches `webhookDispatches.getListOfWebhookDispatches` Tool to get list of webhook dispatches for the user. Use when you need to retrieve webhook execution history with pagination support. **Risk:** `read` ```ts theme={null} await corsair.apify.api.webhookDispatches.getListOfWebhookDispatches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWebhookDispatch `webhookDispatches.getWebhookDispatch` Tool to get webhook dispatch object with all details. Use when you need to retrieve information about a specific webhook dispatch including its status, event data, and call history. **Risk:** `read` ```ts theme={null} await corsair.apify.api.webhookDispatches.getWebhookDispatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `dispatchId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Webhooks ### createTaskWebhook `webhooks.createTaskWebhook` Tool to create a webhook for an Actor task. Use when you need external notifications about task run events (e.g., completion or failure) in downstream systems. **Risk:** `write` ```ts theme={null} await corsair.apify.api.webhooks.createTaskWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteWebhook `webhooks.deleteWebhook` Tool to delete a webhook by its ID. Use when removing a webhook after confirming the webhook ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.apify.api.webhooks.deleteWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `webhookId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAllWebhooks `webhooks.getAllWebhooks` Tool to get a list of all webhooks created by the user. Use when you need to enumerate webhooks before filtering or maintenance. **Risk:** `read` ```ts theme={null} await corsair.apify.api.webhooks.getAllWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWebhook `webhooks.getWebhook` Tool to get webhook object with all details. Use when you need to retrieve complete information about a specific webhook by its ID. **Risk:** `read` ```ts theme={null} await corsair.apify.api.webhooks.getWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `webhookId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWebhookDispatches `webhooks.getWebhookDispatches` Tool to get list of webhook dispatches for a specific webhook. Use when you need to retrieve dispatch history for a particular webhook with pagination support. **Risk:** `read` ```ts theme={null} await corsair.apify.api.webhooks.getWebhookDispatches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `webhookId` | `string \| number` | Yes | — | | `offset` | `any` | No | — | | `limit` | `any` | No | — | | `desc` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### testWebhook `webhooks.testWebhook` Tool to test a webhook by creating a test dispatch with a dummy payload. Use when you need to verify webhook configuration before production use. **Risk:** `write` ```ts theme={null} await corsair.apify.api.webhooks.testWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `webhookId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateWebhook `webhooks.updateWebhook` Tool to update webhook using JSON payload. Only specified properties are updated; others remain unchanged. Use when you need to modify webhook settings like event types, target URL, or other configuration. **Risk:** `write` ```ts theme={null} await corsair.apify.api.webhooks.updateWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `contentType` | `string` | No | — | | `mediaType` | `string` | No | — | | `webhookId` | `string \| number` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/apify/database Apify local sync: searchable entities, `.search()` filters, and operators. The Apify plugin syncs data locally. Use `corsair.apify.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Actor Builds Path: `apify.db.actorBuilds.search` ```ts theme={null} const rows = await corsair.apify.db.actorBuilds.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `actId` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `buildNumber` | `string` | equals, contains, startsWith, endsWith, in | | `startedAt` | `date` | equals, before, after, between | | `finishedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Actor Outputs Path: `apify.db.actorOutputs.search` ```ts theme={null} const rows = await corsair.apify.db.actorOutputs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `datasetId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Actor Runs Path: `apify.db.actorRuns.search` ```ts theme={null} const rows = await corsair.apify.db.actorRuns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `runId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `actorId` | `string` | equals, contains, startsWith, endsWith, in | | `actorName` | `string` | equals, contains, startsWith, endsWith, in | | `datasetId` | `string` | equals, contains, startsWith, endsWith, in | | `startedAt` | `date` | equals, before, after, between | | `finishedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Actors Path: `apify.db.actors.search` ```ts theme={null} const rows = await corsair.apify.db.actors.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Actor Tasks Path: `apify.db.actorTasks.search` ```ts theme={null} const rows = await corsair.apify.db.actorTasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `actId` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Datasets Path: `apify.db.datasets.search` ```ts theme={null} const rows = await corsair.apify.db.datasets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `itemCount` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Key Value Stores Path: `apify.db.keyValueStores.search` ```ts theme={null} const rows = await corsair.apify.db.keyValueStores.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `recordCount` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Request Queues Path: `apify.db.requestQueues.search` ```ts theme={null} const rows = await corsair.apify.db.requestQueues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `totalRequestCount` | `number` | equals, gt, gte, lt, lte, in | | `handledRequestCount` | `number` | equals, gt, gte, lt, lte, in | | `pendingRequestCount` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Schedules Path: `apify.db.schedules.search` ```ts theme={null} const rows = await corsair.apify.db.schedules.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `isEnabled` | `boolean` | equals | | `cronExpression` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `apify.db.users.search` ```ts theme={null} const rows = await corsair.apify.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `apify.db.webhooks.search` ```ts theme={null} const rows = await corsair.apify.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `requestUrl` | `string` | equals, contains, startsWith, endsWith, in | | `isAdHoc` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/apify/overview Web scraping and automation platform for running actors and extracting structured data. Use **Apify** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 121 typed API operations * 11 synced entities (`actorBuilds`, `actorOutputs`, `actorRuns`, `actors`, `actorTasks`, `datasets`, and 5 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/apify ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/apify ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/apify ``` ```bash bun theme={null} bun add corsair @corsair-dev/apify ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { apify } from '@corsair-dev/apify'; export const corsair = createCorsair({ plugins: [ apify(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} apify() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'apify', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`actorBuilds.getActorBuild`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apify.api.actorBuilds.getActorBuild({}); ``` **`actorBuilds.abortActorBuild`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apify.api.actorBuilds.abortActorBuild({}); ``` See the full list on the [API](/plugins/apify/api) page. ## Query synced data Synced entities support `tenant.apify.db..search()` and `.list()`: `actorBuilds`, `actorOutputs`, `actorRuns`, `actors`, `actorTasks`, `datasets`, `keyValueStores`, `requestQueues`, `schedules`, `users`, `webhooks`. See [Database](/plugins/apify/database) for filters and operators. ## What's next > **[API reference](/plugins/apify/api)** > > Every `apify.api.*` operation with input and output types. > **[Database](/plugins/apify/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/apilabz/api API reference for ApiLabz: every `apilabz.api.*` operation with input and output types. Every `apilabz.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Airtable ### listTables `airtable.listTables` List Airtable tables for a base **Risk:** `read` ```ts theme={null} await corsair.apilabz.api.airtable.listTables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `base_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | | `response` | `any` | Yes | — | *** ## Deals ### integrate `deals.integrate` Integrate a deal into API Labz **Risk:** `write` ```ts theme={null} await corsair.apilabz.api.deals.integrate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `dealId` | `string` | Yes | — | | `status` | `string` | Yes | — | | `currency` | `string` | No | — | | `customFields` | `object` | No | — | > **customFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | | `response` | `any` | Yes | — | *** ## Iban ### validate `iban.validate` Validate an IBAN **Risk:** `read` ```ts theme={null} await corsair.apilabz.api.iban.validate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iban` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | | `response` | `object` | Yes | — | > **response full type** > > ```ts theme={null} > { > iban: string, > is_valid: boolean > } > ``` *** ## Trello ### aiSearchEngine `trello.aiSearchEngine` Run AI search across Trello data **Risk:** `read` ```ts theme={null} await corsair.apilabz.api.trello.aiSearchEngine({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `limit` | `number` | No | — | | `listId` | `string` | No | — | | `boardId` | `string` | No | — | | `includeArchived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | | `response` | `any` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/apilabz/database ApiLabz local sync: searchable entities, `.search()` filters, and operators. The ApiLabz plugin syncs data locally. Use `corsair.apilabz.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/apilabz/overview Collection of utility APIs for developers including conversion, validation, and lookup tools. Use **ApiLabz** through Corsair: one client, typed API calls. **What you get:** * 4 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/apilabz ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/apilabz ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/apilabz ``` ```bash bun theme={null} bun add corsair @corsair-dev/apilabz ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { apilabz } from '@corsair-dev/apilabz'; export const corsair = createCorsair({ plugins: [ apilabz(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} apilabz() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'apilabz', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`airtable.listTables`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apilabz.api.airtable.listTables({}); ``` **`deals.integrate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apilabz.api.deals.integrate({}); ``` See the full list on the [API](/plugins/apilabz/api) page. ## What's next > **[API reference](/plugins/apilabz/api)** > > Every `apilabz.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/apininjas/api API reference for API Ninjas: every `apininjas.api.*` operation with input and output types. Every `apininjas.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Calendar ### holidays `calendar.holidays` Returns a list of holiday entries for a given country and year \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.calendar.holidays({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `year` | `number` | No | — | | `type` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > country?: string | null, > iso?: string | null, > year?: number | null, > date?: string | null, > day?: string | null, > name?: string | null, > type?: string | null > }[] > ``` *** ### isPublicHoliday `calendar.isPublicHoliday` Returns whether a given date is a public holiday for a given country **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.calendar.isPublicHoliday({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `date` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `country` | `string` | No | — | | `is_public_holiday` | `boolean` | No | — | | `public_holiday_name` | `string` | No | — | *** ### isWorkingDay `calendar.isWorkingDay` Returns whether a given date is a working day for a given country **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.calendar.isWorkingDay({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `date` | `string` | Yes | — | | `weekend` | `string` | No | — | | `public_holidays` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `country` | `string` | No | — | | `day_of_week` | `string` | No | — | | `is_workday` | `boolean` | No | — | | `public_holiday_name` | `string` | No | — | | `non_working_reason` | `string[]` | No | — | *** ### publicHolidays `calendar.publicHolidays` Returns a list of public holidays for a given country and year \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.calendar.publicHolidays({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `year` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > local_name?: string | null, > date?: string | null, > country?: string | null, > year?: number | null, > regions?: string[] | null, > federal?: boolean | null > }[] > ``` *** ### timezone `calendar.timezone` Get timezone info by city/state/country or location coordinates (latitude/longitude) **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.calendar.timezone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timezone` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `timezone` | `string` | No | — | | `utc_offset` | `number` | No | — | | `local_time` | `string` | No | — | | `city` | `string` | No | — | *** ### workingDays `calendar.workingDays` Returns a list of working days and non-working days for a given country and year/month **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.calendar.workingDays({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `year` | `number` | No | — | | `month` | `number` | No | — | | `weekend` | `string` | No | — | | `public_holidays` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `num_working_days` | `number` | No | — | | `num_non_working_days` | `number` | No | — | | `working_days` | `string[]` | No | — | | `non_working_days` | `object[]` | No | — | | `year` | `number` | No | — | > **non\_working\_days full type** > > ```ts theme={null} > { > date?: string | null, > reasons?: string[] | null, > holiday_name?: string | null > }[] > ``` *** ### worldTime `calendar.worldTime` Get the current date and time by city/state/country, location coordinates (latitude/longitude), or timezone \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.calendar.worldTime({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timezone` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `timezone` | `string` | No | — | | `datetime` | `string` | No | — | | `date` | `string` | No | — | | `year` | `string` | No | — | | `month` | `string` | No | — | | `day` | `string` | No | — | | `hour` | `string` | No | — | | `minute` | `string` | No | — | | `second` | `string` | No | — | | `day_of_week` | `string` | No | — | *** ## Economics ### gdp `economics.gdp` Get GDP data from given parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.gdp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | | `year` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > country?: string | null, > year?: number | null, > gdp_growth?: number | null, > gdp_nominal?: number | null, > gdp_per_capita_nominal?: number | null, > gdp_ppp?: number | null, > gdp_per_capita_ppp?: number | null, > gdp_ppp_share?: number | null > }[] > ``` *** ### incomeTax `economics.incomeTax` Returns comprehensive income tax information including tax brackets and rates at both federal and state/provincial levels (where applicable) **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.incomeTax({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `year` | `number` | Yes | — | | `regions` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | | `year` | `number` | No | — | | `fica` | `string` | No | — | | `states` | `string` | No | — | | `federal` | `object` | No | — | | `provinces` | `string` | No | — | > **federal full type** > > ```ts theme={null} > { > married?: { > brackets?: { > rate?: number | null, > min?: number | null, > max?: number | string | null > }[] | null > } | null, > married_separate?: { > brackets?: { > rate?: number | null, > min?: number | null, > max?: number | string | null > }[] | null > } | null, > single?: { > brackets?: { > rate?: number | null, > min?: number | null, > max?: number | string | null > }[] | null > } | null, > head_of_household?: { > brackets?: { > rate?: number | null, > min?: number | null, > max?: number | string | null > }[] | null > } | null > } > ``` *** ### incomeTaxCalculator `economics.incomeTaxCalculator` Returns comprehensive annual tax calculations including federal, state/provincial, and FICA taxes where applicable **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.incomeTaxCalculator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `region` | `string` | Yes | — | | `income` | `number` | Yes | — | | `tax_year` | `string` | No | — | | `filing_status` | `string` | Yes | — | | `deductions` | `string` | No | — | | `credits` | `string` | No | — | | `self_employed` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | | `region` | `string` | No | — | | `income` | `number` | No | — | | `taxable_income` | `number` | No | — | | `deductions` | `number` | No | — | | `credits` | `number` | No | — | | `tax_year` | `string` | No | — | | `federal_effective_rate` | `number` | No | — | | `federal_taxes_owed` | `number` | No | — | | `fica_social_security` | `string` | No | — | | `fica_social_security_rate` | `number \| string` | No | — | | `fica_social_security_cap` | `number \| string` | No | — | | `fica_medicare` | `string` | No | — | | `fica_medicare_rate` | `number \| string` | No | — | | `fica_total` | `number \| string` | No | — | | `region_effective_rate` | `number \| string` | No | — | | `region_taxes_owed` | `string` | No | — | | `total_taxes_owed` | `string` | No | — | | `income_after_tax` | `string` | No | — | | `total_effective_tax_rate` | `number \| string` | No | — | *** ### inflation `economics.inflation` Returns current monthly and annual inflation percentages \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.inflation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > country?: string | null, > country_code?: string | null, > type?: string | null, > period?: number | string | null, > monthly_rate_pct?: number | string | null, > yearly_rate_pct?: number | string | null > }[] > ``` *** ### interestRate `economics.interestRate` Get a specific interest rate by name **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.interestRate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rate` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rate_name` | `string` | No | — | | `rate_pct` | `number \| string` | No | — | | `last_updated` | `string` | No | — | *** ### mortgageCalculator `economics.mortgageCalculator` Returns monthly payment, annual payment, and interest rate information based on given mortgage parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.mortgageCalculator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `loan_amount` | `number` | No | — | | `home_value` | `string` | No | — | | `downpayment` | `number` | No | — | | `interest_rate` | `number` | Yes | — | | `duration_years` | `number` | No | — | | `monthly_hoa` | `number` | No | — | | `annual_property_tax` | `number` | No | — | | `annual_home_insurance` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `monthly_payment` | `object` | No | — | | `annual_payment` | `object` | No | — | | `total_interest_paid` | `number` | No | — | > **monthly\_payment full type** > > ```ts theme={null} > { > total?: number | null, > mortgage?: number | null, > property_tax?: number | null, > hoa?: number | null, > annual_home_ins?: number | null > } > ``` > **annual\_payment full type** > > ```ts theme={null} > { > total?: number | null, > mortgage?: number | null, > property_tax?: number | null, > hoa?: number | null, > home_insurance?: number | null > } > ``` *** ### mortgageRate `economics.mortgageRate` Returns the daily 30-year and 15-year fixed-rate mortgage (FRM) data **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.mortgageRate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `min_date` | `number` | No | — | | `max_date` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > date?: string | null, > frm_30?: string | null, > frm_15?: string | null > }[] > ``` *** ### population `economics.population` Get population data from given parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.population({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | | `min_population` | `number` | No | — | | `max_population` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `historical_population` | `object[]` | No | — | | `population_forecast` | `object[]` | No | — | | `country_name` | `string` | No | — | | `population` | `number \| string` | No | — | | `yearly_change_percentage` | `number \| string` | No | — | | `yearly_change` | `string` | No | — | | `migrants` | `number \| string` | No | — | | `median_age` | `string` | No | — | | `fertility_rate` | `number \| string` | No | — | | `density` | `string` | No | — | | `urban_population_pct` | `number \| string` | No | — | | `urban_population` | `number \| string` | No | — | | `percentage_of_world_population` | `number \| string` | No | — | | `rank` | `number \| string` | No | — | > **historical\_population full type** > > ```ts theme={null} > { > year?: number | null, > population?: number | null, > yearly_change_percentage?: number | null, > yearly_change?: number | null, > migrants?: number | null, > median_age?: number | null, > fertility_rate?: number | null, > density?: number | null, > urban_population_pct?: number | null, > urban_population?: number | null, > percentage_of_world_population?: number | null, > rank?: number | null > }[] > ``` > **population\_forecast full type** > > ```ts theme={null} > { > year?: number | null, > population?: number | null, > yearly_change_percentage?: number | null, > yearly_change?: number | null, > migrants?: number | string | null, > median_age?: number | null, > fertility_rate?: number | null, > density?: number | null, > urban_population_pct?: number | null, > urban_population?: number | null, > percentage_of_world_population?: number | null, > rank?: number | null > }[] > ``` *** ### propertyTax `economics.propertyTax` Returns a list of regions and corresponding 25th, 50th (median), and 75th percentile effective property tax rates **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.propertyTax({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `state` | `string` | No | — | | `county` | `string` | No | — | | `city` | `string` | No | — | | `zip` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > state?: string | null, > county?: string | null, > city?: string | null, > zip?: string | null, > property_tax_25th_percentile?: number | null, > property_tax_50th_percentile?: number | null, > property_tax_75th_percentile?: number | null > }[] > ``` *** ### salesTax `economics.salesTax` Returns one or more sales tax breakdowns by ZIP code according to the specified parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.salesTax({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zip_code` | `string` | No | — | | `street_address` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > zip_code?: string | null, > state_rate?: string | null, > city_rate?: number | string | null, > county_rate?: number | string | null, > additional_rate?: number | string | null, > total_rate?: number | string | null, > street_address?: string | null > }[] > ``` *** ### salesTaxCalculator `economics.salesTaxCalculator` Calculates sales tax for a given amount and location **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.salesTaxCalculator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | — | | `zip_code` | `string` | No | — | | `street_address` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > zip_code?: string | null, > pre_tax_amount?: string | null, > state_rate?: number | null, > total_rate?: number | string | null, > city_rate?: number | string | null, > county_rate?: number | string | null, > additional_rate?: number | string | null, > state_tax?: number | null, > city_tax?: string | null, > county_tax?: string | null, > additional_tax?: string | null, > total_tax?: string | null, > total_price?: number | string | null, > street_address?: string | null > }[] > ``` *** ### unemployment `economics.unemployment` Get unemployment data for a given country **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.unemployment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | | `year` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > country?: string | null, > year?: number | null, > unemployment_rate?: number | null > }[] > ``` *** ### vatRates `economics.vatRates` Returns VAT rates for a specified EU country **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.economics.vatRates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `type` | `number` | No | — | | `min_date` | `number` | No | — | | `max_date` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > country?: string | null, > type?: string | null, > rate?: number | string | null, > date?: string | null, > category?: string | null > }[] > ``` *** ## Entertainment ### advice `entertainment.advice` Returns a random piece of life advice **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.advice({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `advice` | `string` | No | — | *** ### bucketList `entertainment.bucketList` Returns a random bucket list idea **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.bucketList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `item` | `string` | No | — | *** ### chuckNorris `entertainment.chuckNorris` Returns a Chuck Norris joke **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.chuckNorris({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `joke` | `string` | No | — | *** ### dadJokes `entertainment.dadJokes` Returns one (or more) random dad jokes **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.dadJokes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > joke?: string | null > }[] > ``` *** ### factOfTheDay `entertainment.factOfTheDay` Returns a single fact for the current day **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.factOfTheDay({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > fact?: string | null > }[] > ``` *** ### facts `entertainment.facts` Returns one (or more) random facts **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.facts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > fact?: string | null > }[] > ``` *** ### generateSudoku `entertainment.generateSudoku` Generate a new Sudoku puzzle with specified parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.generateSudoku({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `width` | `number` | No | — | | `height` | `number` | No | — | | `difficulty` | `string` | No | — | | `seed` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `puzzle` | `number \| null[][]` | No | — | | `solution` | `number \| null[][]` | No | — | *** ### hobbies `entertainment.hobbies` Returns a random hobby and a Wikipedia link detailing the hobby **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.hobbies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hobby` | `string` | No | — | | `link` | `string` | No | — | | `category` | `string` | No | — | *** ### horoscope `entertainment.horoscope` Returns the daily horoscope for a specific zodiac sign **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.horoscope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zodiac` | `string` | Yes | — | | `date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `sign` | `string` | No | — | | `horoscope` | `string` | No | — | *** ### jokeOfTheDay `entertainment.jokeOfTheDay` Returns a single joke for the current day **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.jokeOfTheDay({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > joke?: string | null > }[] > ``` *** ### jokes `entertainment.jokes` Returns one (or more) random funny jokes **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.jokes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > joke?: string | null > }[] > ``` *** ### quoteOfTheDay `entertainment.quoteOfTheDay` Returns a single aphoristic quote for the current day **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.quoteOfTheDay({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > quote?: string | null, > author?: string | null, > work?: string | null, > categories?: string[] | null > }[] > ``` *** ### quotes `entertainment.quotes` Returns high-quality quotes with advanced filtering by categories (include/exclude), author, work, and pagination support \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.quotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `categories` | `string` | No | — | | `exclude_categories` | `string` | No | — | | `author` | `string` | No | — | | `work` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > quote?: string | null, > author?: string | null, > work?: string | null, > categories?: string[] | null > }[] > ``` *** ### randomQuotes `entertainment.randomQuotes` Returns random high-quality quotes with advanced filtering by categories (include/exclude), author, and work \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.randomQuotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `categories` | `string` | No | — | | `exclude_categories` | `string` | No | — | | `author` | `string` | No | — | | `work` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > quote?: string | null, > author?: string | null, > work?: string | null, > categories?: string[] | null > }[] > ``` *** ### riddles `entertainment.riddles` Returns one or more random riddles **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.riddles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > title?: string | null, > question?: string | null, > answer?: string | null > }[] > ``` *** ### solveSudoku `entertainment.solveSudoku` Solve an existing Sudoku puzzle **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.solveSudoku({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `puzzle` | `number[][]` | Yes | — | | `width` | `number` | Yes | — | | `height` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `solution` | `number \| null[][]` | No | — | *** ### trivia `entertainment.trivia` Returns a random trivia question and answer **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.trivia({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > category?: string | null, > question?: string | null, > answer?: string | null > }[] > ``` *** ### triviaOfTheDay `entertainment.triviaOfTheDay` Returns a single trivia question and answer for the current day **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.entertainment.triviaOfTheDay({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > category?: string | null, > question?: string | null, > answer?: string | null > }[] > ``` *** ## Health ### caloriesBurned `health.caloriesBurned` Returns the calories burned per hour and total calories burned according to given parameters for given activities (up to 10) **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.health.caloriesBurned({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `activity` | `string` | Yes | — | | `weight` | `number` | No | — | | `duration` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > calories_per_hour?: number | null, > duration_minutes?: number | null, > total_calories?: number | null > }[] > ``` *** ### cocktails `health.cocktails` Returns up to 10 cocktail recipes matching the search parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.health.cocktails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `ingredients` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > ingredients?: string[] | null, > instructions?: string | null, > name?: string | null > }[] > ``` *** ### exercises `health.exercises` Returns up to 5 exercises that satisfy the given parameters \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.health.exercises({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `type` | `string` | No | — | | `muscle` | `string` | No | — | | `difficulty` | `string` | No | — | | `equipments` | `string` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > type?: string | null, > muscle?: string | null, > difficulty?: string | null, > instructions?: string | null, > equipments?: string[] | null, > safety_info?: string | null > }[] > ``` *** ### nutrition `health.nutrition` This endpoint uses AI to automatically read any text and extract every food item it contains, along with the right portion for each **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.health.nutrition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > calories?: number | string | null, > serving_size_g?: number | string | null, > fat_total_g?: number | string | null, > fat_saturated_g?: number | string | null, > fat_trans_g?: number | string | null, > protein_g?: number | string | null, > sodium_mg?: number | string | null, > potassium_mg?: number | string | null, > cholesterol_mg?: number | string | null, > carbohydrates_total_g?: number | string | null, > fiber_g?: number | string | null, > sugar_g?: number | string | null, > added_sugars_g?: number | string | null, > net_carbs_g?: number | string | null, > iron_mg?: number | string | null, > calcium_mg?: number | string | null, > magnesium_mg?: number | string | null, > zinc_mg?: number | string | null, > vitamin_a_mcg?: string | null, > vitamin_c_mg?: number | string | null, > vitamin_d_mcg?: string | null > }[] > ``` *** ### recipes `health.recipes` Get a list of recipes for a given recipe name or ingredient(s) **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.health.recipes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `ingredients` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > title?: string | null, > ingredients?: { > name?: string | null, > quantity?: number | null, > unit?: string | null > }[] | null, > servings?: string | null, > instructions?: string[] | null, > nutrition?: string | null > }[] > ``` *** ## Internet ### dnsRecords `internet.dnsRecords` Returns a list of DNS records associated with a particular domain **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.internet.dnsRecords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > record_type?: string | null, > value?: string | null, > mname?: string | null, > rname?: string | null, > serial?: number | null, > refresh?: number | null, > retry?: number | null, > expire?: number | null, > ttl?: number | null, > AAAA?: string | null, > CNAME?: string | null, > MX?: string | null, > NS?: string | null, > PTR?: string | null, > SRV?: string | null, > SOA?: string | null, > TXT?: string | null, > CAA?: string | null, > priority?: string | null, > mname, > rname, > serial, > refresh, > retry, > expire, > ttl?: string | null > }[] > ``` *** ### domain `internet.domain` Returns availability, registration lifecycle, and email/hosting intelligence for a given domain name **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.internet.domain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `available` | `boolean` | No | — | | `creation_date` | `number` | No | — | | `expiration_date` | `number` | No | — | | `registrar` | `string` | No | — | | `age_days` | `number` | No | — | | `updated_date` | `number \| string` | No | — | | `domain_status` | `string[] \| string` | No | — | | `has_mx` | `boolean \| string` | No | — | | `is_free_email_provider` | `boolean \| string` | No | — | | `risky_tld` | `boolean \| string` | No | — | | `is_disposable_email_domain` | `boolean \| string` | No | — | | `is_custom_domain` | `boolean \| string` | No | — | | `mx_provider` | `string` | No | — | | `is_parked` | `boolean \| string` | No | — | | `ip` | `string` | No | — | | `hosting_provider` | `string` | No | — | | `country` | `string` | No | — | *** ### ipLookup `internet.ipLookup` Returns the location of the IP address specified **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.internet.ipLookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `is_valid` | `boolean` | No | — | | `country` | `string` | No | — | | `country_code` | `string` | No | — | | `region_code` | `string` | No | — | | `region` | `string` | No | — | | `city` | `string` | No | — | | `zip` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `timezone` | `string` | No | — | | `isp` | `string` | No | — | | `address` | `string` | No | — | | `is_datacenter` | `boolean \| string` | No | — | | `is_hosting` | `boolean \| string` | No | — | | `is_tor` | `boolean \| string` | No | — | | `is_vpn` | `boolean \| string` | No | — | | `is_icloud_relay` | `boolean \| string` | No | — | | `is_bogon` | `boolean \| string` | No | — | | `is_abuser` | `boolean \| string` | No | — | | `threat_level` | `string` | No | — | | `asn` | `string` | No | — | | `asn_name` | `string` | No | — | | `route` | `string` | No | — | | `abuse_email` | `string` | No | — | *** ### mxRecords `internet.mxRecords` Returns a list of MX records associated with a particular domain **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.internet.mxRecords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > priority?: number | null, > value?: string | null > }[] > ``` *** ### scrape `internet.scrape` Returns the HTML or plaintext data scraped from a given URL **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.internet.scrape({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `text_only` | `boolean` | No | — | | `user_agent` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `string` | No | — | *** ### urlLookup `internet.urlLookup` Returns the location of the IP address hosting the URL domain **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.internet.urlLookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `is_valid` | `boolean` | No | — | | `country` | `string` | No | — | | `country_code` | `string` | No | — | | `region_code` | `string` | No | — | | `region` | `string` | No | — | | `city` | `string` | No | — | | `zip` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `timezone` | `string` | No | — | | `isp` | `string` | No | — | | `url` | `string` | No | — | *** ### userAgent `internet.userAgent` Generates a realistic user agent string based on optional parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.internet.userAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brand` | `string` | No | — | | `model` | `string` | No | — | | `os` | `string` | No | — | | `browser` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user_agent` | `string` | No | — | *** ### webpage `internet.webpage` Returns the URL information and web page metadata from a given URL **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.internet.webpage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `domain` | `string` | No | — | | `url_path` | `string` | No | — | | `url_parameters` | `object` | No | — | | `page_title` | `string` | No | — | | `page_description` | `string` | No | — | | `meta_tags` | `object` | No | — | | `favicon` | `string` | No | — | > **url\_parameters full type** > > ```ts theme={null} > { > } > ``` > **meta\_tags full type** > > ```ts theme={null} > { > viewport?: string | null > } > ``` *** ### whois `internet.whois` Returns domain registration details (e.g. registrar, contact information, expiration date, name servers) for a given domain name \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.internet.whois({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain_name` | `string` | No | — | | `registrar` | `string` | No | — | | `registrar_url` | `string` | No | — | | `whois_server` | `string` | No | — | | `updated_date` | `number \| string` | No | — | | `creation_date` | `number \| string` | No | — | | `expiration_date` | `number \| string` | No | — | | `name_servers` | `string[] \| string` | No | — | | `dnssec` | `string` | No | — | | `emails` | `string` | No | — | *** ## Location ### airQuality `location.airQuality` Get air quality by city or location coordinates (latitude/longitude) **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.airQuality({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `CO` | `object` | No | — | | `NO2` | `object` | No | — | | `O3` | `object` | No | — | | `SO2` | `object` | No | — | | `PM2.5` | `object` | No | — | | `PM10` | `object` | No | — | | `overall_aqi` | `number` | No | — | > **CO full type** > > ```ts theme={null} > { > concentration?: number | null, > aqi?: number | null > } > ``` > **NO2 full type** > > ```ts theme={null} > { > concentration?: number | null, > aqi?: number | null > } > ``` > **O3 full type** > > ```ts theme={null} > { > concentration?: number | null, > aqi?: number | null > } > ``` > **SO2 full type** > > ```ts theme={null} > { > concentration?: number | null, > aqi?: number | null > } > ``` > **PM2.5 full type** > > ```ts theme={null} > { > concentration?: number | null, > aqi?: number | null > } > ``` > **PM10 full type** > > ```ts theme={null} > { > concentration?: number | null, > aqi?: number | null > } > ``` *** ### cities `location.cities` Get city data from either a name or population range **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.cities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `country` | `string` | No | — | | `min_lat` | `number` | No | — | | `max_lat` | `number` | No | — | | `min_lon` | `number` | No | — | | `max_lon` | `number` | No | — | | `min_population` | `number` | No | — | | `max_population` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > latitude?: number | null, > longitude?: number | null, > country?: string | null, > population?: number | null, > is_capital?: boolean | null > }[] > ``` *** ### country `location.country` Get country data from given parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.country({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `currency` | `string` | No | — | | `min_gdp` | `number` | No | — | | `max_gdp` | `number` | No | — | | `min_population` | `number` | No | — | | `max_population` | `number` | No | — | | `min_area` | `number` | No | — | | `max_area` | `number` | No | — | | `min_unemployment` | `number` | No | — | | `max_unemployment` | `number` | No | — | | `min_gdp_growth` | `number` | No | — | | `max_gdp_growth` | `number` | No | — | | `min_infant_mortality` | `number` | No | — | | `max_infant_mortality` | `number` | No | — | | `min_fertility` | `number` | No | — | | `max_fertility` | `number` | No | — | | `min_urban_pop_rate` | `number` | No | — | | `max_urban_pop_rate` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > gdp?: number | null, > sex_ratio?: number | null, > surface_area?: number | null, > life_expectancy_male?: number | null, > unemployment?: number | null, > imports?: number | null, > homicide_rate?: number | null, > currency?: { > code?: string | null, > name?: string | null > } | null, > iso2?: string | null, > employment_services?: number | null, > employment_industry?: number | null, > urban_population_growth?: number | null, > secondary_school_enrollment_female?: number | null, > employment_agriculture?: number | null, > capital?: string | null, > co2_emissions?: number | null, > forested_area?: number | null, > tourists?: number | null, > exports?: number | null, > life_expectancy_female?: number | null, > post_secondary_enrollment_female?: number | null, > post_secondary_enrollment_male?: number | null, > primary_school_enrollment_female?: number | null, > infant_mortality?: number | null, > gdp_growth?: number | null, > threatened_species?: number | null, > population?: number | null, > urban_population?: number | null, > secondary_school_enrollment_male?: number | null, > name?: string | null, > pop_growth?: number | null, > region?: string | null, > pop_density?: number | null, > internet_users?: number | null, > gdp_per_capita?: number | null, > fertility?: number | null, > refugees?: number | null, > primary_school_enrollment_male?: number | null, > telephone_country_codes?: string[] | null > }[] > ``` *** ### county `location.county` Returns details for one or more counties matching the input parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.county({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `county` | `string` | No | — | | `zipcode` | `string` | No | — | | `state` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > county_name?: string | null, > county_fips?: string | null, > state_code?: string | null, > state_name?: string | null, > latitude?: number | string | null, > longitude?: number | string | null, > zip_codes?: string[] | string | null, > timezone?: string | null, > population?: number | null, > median_age?: number | null > }[] > ``` *** ### evChargers `location.evChargers` find ev charging stations **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.evChargers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | — | | `lon` | `number` | Yes | — | | `distance` | `number` | No | — | | `level` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > is_active?: boolean | null, > name?: string | null, > address?: string | null, > city?: string | null, > region?: string | null, > country?: string | null, > latitude?: number | null, > longitude?: number | null, > connections?: { > type_name?: string | null, > type_official?: string | null, > level?: number | null, > num_connectors?: number | null > }[] | null, > latitude, > longitude?: string | null, > type_official?: string | null, > level?: string | null, > num_connectors?: number | string | null > }[] > ``` *** ### geocode `location.geocode` Get current city coordinates by city and country name **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.geocode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `city` | `string` | Yes | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `zipcode` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > latitude?: number | null, > longitude?: number | null, > country?: string | null, > state?: string | null > }[] > ``` *** ### hospitals `location.hospitals` Get hospital data based on given parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.hospitals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `zipcode` | `string` | No | — | | `county` | `string` | No | — | | `min_latitude` | `number` | No | — | | `max_latitude` | `number` | No | — | | `min_longitude` | `number` | No | — | | `max_longitude` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > care_type?: string | null, > address?: string | null, > city?: string | null, > state?: string | null, > zipcode?: string | null, > county?: string | null, > location_area_code?: string | null, > fips_code?: string | null, > timezone?: string | null, > latitude?: string | null, > longitude?: string | null, > phone_number?: string | null, > website?: string | null, > ownership?: string | null, > bedcount?: number | null, > address, > city, > state, > zipcode?: string | null, > latitude, > longitude?: string | null > }[] > ``` *** ### postalCode `location.postalCode` Returns a list of postal code details matching the input parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.postalCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `postal_code` | `string` | No | — | | `city` | `string` | No | — | | `province` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > city?: string | null, > province?: string | null, > postal_code?: string | null, > area_code?: string | null, > timezone?: string | null, > lat?: string | null, > lon?: string | null > }[] > ``` *** ### reverseGeocode `location.reverseGeocode` Returns a list of cities that contain a given latitude and longitude **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.reverseGeocode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | — | | `lon` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > country?: string | null, > state?: string | null > }[] > ``` *** ### universities `location.universities` Returns information about universities matching the provided filters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.universities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `country` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `min_faculty_ratio` | `number` | No | — | | `max_faculty_ratio` | `number` | No | — | | `min_enrolled` | `number` | No | — | | `max_enrolled` | `number` | No | — | | `min_tuition` | `number` | No | — | | `max_tuition` | `number` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > degree_types?: string[] | null, > address?: string | null, > city?: string | null, > state?: string | null, > postal_code?: string | null, > country?: string | null, > county?: string | null, > timezone?: string | null, > latitude?: string | null, > longitude?: string | null, > phone?: string | null, > website?: string | null, > institution_type?: string | null, > years?: string | null, > enrollment?: string | null, > student_faculty_ratio?: string | null, > email?: string | null, > tuition?: number | string | null > }[] > ``` *** ### weather `location.weather` Get current weather, wind speed and direction, humidity, and temperature data by city, ZIP code, or geolocation coordinates (latitude/longitude) \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.weather({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `zip` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cloud_pct` | `number` | No | — | | `temp` | `number` | No | — | | `feels_like` | `number` | No | — | | `humidity` | `number` | No | — | | `min_temp` | `number` | No | — | | `max_temp` | `number` | No | — | | `wind_speed` | `number` | No | — | | `wind_degrees` | `number` | No | — | | `sunrise` | `number` | No | — | | `sunset` | `number` | No | — | *** ### weatherForecast `location.weatherForecast` Returns a 5-day weather forecast in 3-hour intervals for a given city \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.weatherForecast({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `zip` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > timestamp?: number | null, > temp?: number | null, > feels_like?: number | null, > humidity?: number | null, > min_temp?: number | null, > max_temp?: number | null, > weather?: string | null, > cloud_pct?: number | null, > wind_speed?: number | null, > wind_degrees?: number | null > }[] > ``` *** ### zipCode `location.zipCode` Returns a list of ZIP Code details matching the input parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.location.zipCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zip` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > zip_code?: string | null, > valid?: boolean | string | null, > city?: string | null, > state?: string | null, > county?: string | null, > timezone?: string | null, > area_codes?: string[] | string | null, > country?: string | null, > lat?: string | null, > lon?: string | null > }[] > ``` *** ## Markets ### bitcoin `markets.bitcoin` Returns the latest Bitcoin price in USD and 24-hour market data **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.bitcoin({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `price` | `string` | No | — | | `timestamp` | `number` | No | — | | `24h_price_change` | `string` | No | — | | `24h_price_change_percent` | `string` | No | — | | `24h_high` | `string` | No | — | | `24h_low` | `string` | No | — | | `24h_volume` | `string` | No | — | *** ### commodityPrice `markets.commodityPrice` Returns the current price information for one or more commodities **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.commodityPrice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `names` | `string` | No | — | | `currency` | `string` | No | — | | `unit` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exchange` | `string` | No | — | | `name` | `string` | No | — | | `value` | `string` | No | — | | `unit` | `string` | No | — | | `currency_unit` | `string` | No | — | | `price` | `number` | No | — | | `change_24h_percent` | `number` | No | — | | `change_24h` | `number` | No | — | | `low_24h` | `number` | No | — | | `high_24h` | `number` | No | — | | `previous_close` | `number` | No | — | | `updated` | `number` | No | — | | `high_52w` | `string` | No | — | *** ### convertCurrency `markets.convertCurrency` Converts an existing currency and amount into a new currency \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.convertCurrency({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `have` | `string` | Yes | — | | `want` | `string` | Yes | — | | `amount` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `old_amount` | `number \| string` | No | — | | `old_currency` | `string` | No | — | | `new_amount` | `number \| string` | No | — | | `new_currency` | `string` | No | — | | `timestamp` | `number \| string` | No | — | *** ### cryptoPrice `markets.cryptoPrice` Returns the current price and current time (in UNIX timestamp in seconds) for any cryptocurrency symbol **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.cryptoPrice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | No | — | | `price` | `string` | No | — | | `timestamp` | `number` | No | — | *** ### earnings `markets.earnings` Returns a JSON array of detailed earnings reports, each with comprehensive financial statements and key performance metrics **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.earnings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | No | — | | `cik` | `string` | No | — | | `period` | `string` | No | — | | `year` | `number` | No | — | | `quarter` | `number` | No | — | | `date` | `string` | No | — | | `date_start` | `string` | No | — | | `date_end` | `string` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > company_info?: { > ticker?: string | null, > cik?: string | null, > company_name?: string | null, > fiscal_year?: number | null, > fiscal_quarter?: number | null > } | null, > income_statement?: { > weighted_average_shares_basic?: number | null, > weighted_average_shares_diluted?: number | null, > earnings_per_share_basic?: number | null, > earnings_per_share_diluted?: number | null, > total_revenue?: number | null, > cost_of_revenue?: number | null, > gross_profit?: number | null, > research_and_development?: number | null, > general_and_administrative?: number | null, > sales_and_marketing?: number | null, > operating_income?: number | null, > interest_expense?: string | null, > tax_provision?: number | null, > net_income?: number | null, > net_income_available_to_common?: string | null, > depreciation_and_amortization?: number | null, > stock_based_compensation?: number | null > } | null, > balance_sheet?: { > cash_and_equivalents?: number | null, > accounts_receivable?: number | null, > inventory?: number | null, > current_assets?: number | null, > property_plant_equipment?: number | null, > goodwill?: string | null, > intangible_assets?: number | null, > total_assets?: number | null, > accounts_payable?: number | null, > current_liabilities?: number | null, > long_term_debt?: number | null, > total_debt?: number | null, > total_liabilities?: number | null, > stockholders_equity?: number | null, > retained_earnings?: number | null, > working_capital?: number | null, > temporary_equity?: string | null > } | null, > cash_flow?: { > operating_cash_flow?: number | null, > capital_expenditures?: number | null, > free_cash_flow?: number | null, > dividends_paid?: number | null, > share_repurchases?: number | null, > net_cash_investing?: number | null, > net_cash_financing?: number | null > } | null, > filing_info?: { > filing_type?: string | null, > filing_date?: string | null, > period_end_date?: string | null > } | null > }[] > ``` *** ### earningsCalendar `markets.earningsCalendar` Returns a list of past earnings results and upcoming earnings dates **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.earningsCalendar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | No | — | | `date` | `string` | No | — | | `date_start` | `string` | No | — | | `date_end` | `string` | No | — | | `show_upcoming` | `boolean` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > date?: string | null, > ticker?: string | null, > earnings_timing?: string | null, > earnings_call_timestamp?: number | string | null, > actual_revenue?: number | null, > estimated_revenue?: number | string | null, > revenue_difference?: number | string | null, > revenue_difference_pct?: number | string | null, > actual_eps?: number | null, > estimated_eps?: number | string | null, > eps_difference?: number | string | null, > eps_difference_pct?: number | string | null, > report_date_status?: string | null, > date_confirmed?: string | null, > report_datetime?: string | null, > sec_8k_url?: string | null, > eps_beat_miss?: string | null, > revenue_beat_miss?: string | null, > eps_surprise_streak?: string | null, > avg_eps_surprise_pct_4q?: string | null, > eps_sue?: string | null, > last_earnings_move_pct?: string | null, > avg_earnings_move_pct?: string | null, > days_to_next_earnings?: string | null, > next_earnings_date?: string | null, > has_transcript?: string | null, > surprise_history?: string | null, > fiscal_year?: number | null, > fiscal_quarter?: number | null > }[] > ``` *** ### earningsTranscript `markets.earningsTranscript` Returns the earnings transcript for a given company earning quarter \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.earningsTranscript({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | No | — | | `cik` | `string` | No | — | | `year` | `number` | No | — | | `quarter` | `number` | No | — | | `qa_only` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `timestamp` | `number \| string` | No | — | | `ticker` | `string` | No | — | | `cik` | `string` | No | — | | `year` | `number \| string` | No | — | | `quarter` | `string` | No | — | | `earnings_timing` | `string` | No | — | | `transcript` | `string` | No | — | | `participants` | `string[] \| string` | No | — | | `summary` | `string` | No | — | | `guidance` | `string` | No | — | | `risk_factors` | `string` | No | — | | `overall_sentiment` | `string` | No | — | | `overall_sentiment_rationale` | `string` | No | — | | `transcript_split` | `string` | No | — | *** ### etf `markets.etf` Returns comprehensive information about any ETF by its ticker **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.etf({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etf_ticker` | `string` | No | — | | `price` | `number \| string` | No | — | | `etf_name` | `string` | No | — | | `isin` | `string` | No | — | | `cusip` | `string` | No | — | | `country` | `string` | No | — | | `domicile` | `string` | No | — | | `expense_ratio` | `number \| string` | No | — | | `aum` | `string` | No | — | | `aum_currency` | `string` | No | — | | `aum_usd` | `number \| string` | No | — | | `holdings` | `string[] \| string` | No | — | | `num_holdings` | `number \| string` | No | — | *** ### exchangeRate `markets.exchangeRate` Returns the exchange rate for a given currency pair \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.exchangeRate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pair` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `currency_pair` | `string` | No | — | | `exchange_rate` | `number \| string` | No | — | | `timestamp` | `number \| string` | No | — | *** ### insiderTransactions `markets.insiderTransactions` Returns a list of insider trading transactions that match the specified filters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.insiderTransactions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | No | — | | `cik` | `string` | No | — | | `name` | `string` | No | — | | `form_type` | `string` | No | — | | `transaction_type` | `string` | No | — | | `transaction_code` | `string` | No | — | | `transaction_date` | `string` | No | — | | `min_transaction_date` | `number` | No | — | | `max_transaction_date` | `number` | No | — | | `insider_type` | `string` | No | — | | `min_transaction_value` | `number` | No | — | | `max_transaction_value` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > accession_number?: string | null, > form?: string | null, > filing_date?: string | null, > sec_filing_url?: string | null, > cik?: string | null, > ticker?: string | null, > company_name?: string | null, > insider_name?: string | null, > insider_position?: string | null, > transaction_code?: string | null, > transaction_name?: string | null, > transaction_type?: string | null, > transaction_price?: number | null, > shares?: number | null, > transaction_value?: number | null, > pre_transaction_shares?: number | null, > pre_transaction_shares_value?: number | null, > remaining_shares?: number | null, > remaining_shares_value?: number | null > }[] > ``` *** ### marketCap `markets.marketCap` Returns the current market cap data for any given company ticker **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.marketCap({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | No | — | | `name` | `string` | No | — | | `market_cap` | `number` | No | — | | `currency` | `string` | No | — | | `updated` | `number` | No | — | *** ### mutualFund `markets.mutualFund` Returns comprehensive information about any Mutual Fund by its ticker **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.mutualFund({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fund_ticker` | `string` | No | — | | `fund_name` | `string` | No | — | | `isin` | `string` | No | — | | `cusip` | `string` | No | — | | `country` | `string` | No | — | | `expense_ratio` | `string` | No | — | | `aum` | `number \| string` | No | — | | `price` | `number \| string` | No | — | | `holdings` | `string[] \| string` | No | — | | `num_holdings` | `number \| string` | No | — | *** ### secFilings `markets.secFilings` Returns a list of SEC filing information (including the submission URL) corresponding to the given search parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.secFilings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | Yes | — | | `filing` | `string` | Yes | — | | `start` | `string` | No | — | | `end` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > ticker?: string | null, > filing_date?: string | null, > filing_url?: string | null, > form_type?: string | null > }[] > ``` *** ### sp500 `markets.sp500` Returns S\&P 500 index constituents, filterable by ticker, company name, sector or the date the company joined the index **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.sp500({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | No | — | | `name` | `string` | No | — | | `sector` | `string` | No | — | | `date_added` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > ticker?: string | null, > company_name?: string | null, > sector?: string | null, > date_added?: string | null, > cik?: string | null, > sub_industry?: string | null, > headquarters?: string | null > }[] > ``` *** ### stockExchanges `markets.stockExchanges` Returns detailed information about stock exchanges matching the specified criteria **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.stockExchanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mic` | `string` | No | — | | `name` | `string` | No | — | | `city` | `string` | No | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > mic?: string | null, > name?: string | null, > city?: string | null, > country?: string | null, > iso2?: string | null, > description?: string | null, > address?: string | null, > website?: string | null, > founded?: string | null, > num_listings?: number | null, > market_cap_usd?: number | null, > market_cap?: number | string | null, > currency?: string | null, > timezone?: string | null, > market_open?: string | null, > market_close?: string | null, > is_market_open?: boolean | string | null, > closed_reason?: string | null > }[] > ``` *** ### stockPrice `markets.stockPrice` Returns price information for any given ticker symbol **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.stockPrice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | No | — | | `name` | `string` | No | — | | `price` | `number` | No | — | | `exchange` | `string` | No | — | | `updated` | `number` | No | — | | `currency` | `string` | No | — | | `volume` | `number` | No | — | *** ### ticker `markets.ticker` Returns comprehensive company profile information including company name, CEO, address, financial data, exchange information, identifiers... **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.ticker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticker` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `ticker` | `string` | No | — | | `chief_executive_officer` | `string` | No | — | | `address` | `object` | No | — | | `latest_price` | `number \| string` | No | — | | `latest_market_cap` | `number \| string` | No | — | | `latest_dividend` | `string` | No | — | | `cik` | `string` | No | — | | `cusip` | `string` | No | — | | `isin` | `string` | No | — | | `exchange` | `string` | No | — | | `website` | `string` | No | — | | `phone_number` | `string` | No | — | | `ipo_date` | `string` | No | — | | `latest_earnings` | `object` | No | — | | `sector` | `string` | No | — | | `industry` | `string` | No | — | | `sic_code` | `string` | No | — | | `sic_description` | `string` | No | — | > **address full type** > > ```ts theme={null} > { > address?: string | null, > city?: string | null, > state?: string | null, > zip?: string | null > } > ``` > **latest\_earnings full type** > > ```ts theme={null} > { > year?: number | null, > quarter?: number | null > } > ``` *** ### tickerList `markets.tickerList` Returns a list of all available companies and their ticker symbols **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.markets.tickerList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > ticker?: string | null, > name?: string | null > }[] > ``` *** ## Reference ### animals `reference.animals` Returns up to 10 results matching the input name parameter **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.animals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > taxonomy?: { > kingdom?: string | null, > phylum?: string | null, > class?: string | null, > order?: string | null, > family?: string | null, > genus?: string | null, > scientific_name?: string | null > } | null, > locations?: string[] | null, > characteristics?: { > prey?: string | null, > name_of_young?: string | null, > group_behavior?: string | null, > estimated_population_size?: string | null, > biggest_threat?: string | null, > most_distinctive_feature?: string | null, > gestation_period?: string | null, > habitat?: string | null, > diet?: string | null, > average_litter_size?: string | null, > lifestyle?: string | null, > common_name?: string | null, > number_of_species?: string | null, > location?: string | null, > slogan?: string | null, > group?: string | null, > color?: string | null, > skin_type?: string | null, > top_speed?: string | null, > lifespan?: string | null, > weight?: string | null, > height?: string | null, > age_of_sexual_maturity?: string | null, > age_of_weaning?: string | null > } | null > }[] > ``` *** ### babyNames `reference.babyNames` Returns 10 baby name results **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.babyNames({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gender` | `string` | No | — | | `popular_only` | `boolean` | No | — | **Output:** `string[]` *** ### cats `reference.cats` Get a list of cat breeds matching specified parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.cats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `min_weight` | `number` | No | — | | `max_weight` | `number` | No | — | | `min_life_expectancy` | `number` | No | — | | `max_life_expectancy` | `number` | No | — | | `shedding` | `string` | No | — | | `family_friendly` | `string` | No | — | | `playfulness` | `string` | No | — | | `grooming` | `string` | No | — | | `other_pets_friendly` | `string` | No | — | | `children_friendly` | `string` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > length?: string | null, > origin?: string | null, > image_link?: string | null, > family_friendly?: number | null, > shedding?: number | null, > general_health?: number | null, > playfulness?: number | null, > meowing?: number | null, > children_friendly?: number | null, > stranger_friendly?: number | null, > grooming?: number | null, > intelligence?: number | null, > other_pets_friendly?: number | null, > min_weight?: number | null, > max_weight?: number | null, > min_life_expectancy?: number | null, > max_life_expectancy?: number | null, > name?: string | null > }[] > ``` *** ### celebrities `reference.celebrities` Returns a list of up to 30 celebrities that match the search parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.celebrities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `min_net_worth` | `number` | No | — | | `max_net_worth` | `number` | No | — | | `nationality` | `string` | No | — | | `min_height` | `number` | No | — | | `max_height` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > net_worth?: number | null, > gender?: string | null, > nationality?: string | null, > occupation?: string[] | null, > height?: number | null, > birthday?: string | null, > age?: number | null, > is_alive?: boolean | null > }[] > ``` *** ### dayInHistory `reference.dayInHistory` Returns historical events that occurred on a specific date \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.dayInHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `month` | `number` | No | — | | `day` | `number` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > month?: number | null, > day?: number | null, > event?: string | null > }[] > ``` *** ### dogs `reference.dogs` Get a list of dog breeds matching specified parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.dogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `min_height` | `number` | No | — | | `max_height` | `number` | No | — | | `min_weight` | `number` | No | — | | `max_weight` | `number` | No | — | | `min_life_expectancy` | `number` | No | — | | `max_life_expectancy` | `number` | No | — | | `shedding` | `string` | No | — | | `barking` | `string` | No | — | | `energy` | `string` | No | — | | `protectiveness` | `string` | No | — | | `trainability` | `string` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > image_link?: string | null, > good_with_children?: number | null, > good_with_other_dogs?: number | null, > shedding?: number | null, > grooming?: number | null, > drooling?: number | null, > coat_length?: number | null, > good_with_strangers?: number | null, > playfulness?: number | null, > protectiveness?: number | null, > trainability?: number | null, > energy?: number | null, > barking?: number | null, > min_life_expectancy?: number | null, > max_life_expectancy?: number | null, > max_height_male?: number | null, > max_height_female?: number | null, > max_weight_male?: number | null, > max_weight_female?: number | null, > min_height_male?: number | null, > min_height_female?: number | null, > min_weight_male?: number | null, > min_weight_female?: number | null, > name?: string | null > }[] > ``` *** ### historicalEvents `reference.historicalEvents` Returns a list of up to 10 events that match the search parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.historicalEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | — | | `year` | `number` | No | — | | `month` | `number` | No | — | | `day` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: string | null, > month?: string | null, > day?: string | null, > event?: string | null > }[] > ``` *** ### historicalFigures `reference.historicalFigures` Returns a list of up to 10 people that match the search parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.historicalFigures({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > title?: string | null, > info?: { > born?: string | null, > died?: string | null, > rank?: any[] | string | null, > unit?: string[] | null, > house?: string | null, > issue?: string | null, > reign?: string | null, > burial?: string | null, > father?: string | null, > mother?: string | null, > spouse?: any[] | string | null, > religion?: string | null, > successor?: string | null, > allegiance?: string | null, > preceded_by?: string | null, > predecessor?: string | null, > battles/wars?: string[] | null, > succeeded_by?: string | null, > prime_minister?: string | null, > service/branch?: any[] | string | null, > vice_president?: string | null, > years_of_service?: string | null, > in_office?: string | null, > coronation?: string | null, > issuedetail?: string | null, > regent?: string | null, > genre?: string | null, > period?: string | null, > children?: string | null, > occupation?: string | null, > citizenship?: string | null, > notable_works?: string | null, > commands_held?: string | null, > genres?: string | null, > labels?: string | null, > birth_name?: string | null, > instruments?: string | null, > years_active?: string | null, > also_known_as?: string | null > } | null > }[] > ``` *** ### planets `reference.planets` Get a list of planets matching specified parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.planets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `min_mass` | `number` | No | — | | `max_mass` | `number` | No | — | | `min_radius` | `number` | No | — | | `max_radius` | `number` | No | — | | `min_period` | `number` | No | — | | `max_period` | `number` | No | — | | `min_temperature` | `number` | No | — | | `max_temperature` | `number` | No | — | | `min_distance_light_year` | `number` | No | — | | `max_distance_light_year` | `number` | No | — | | `min_semi_major_axis` | `number` | No | — | | `max_semi_major_axis` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > mass?: number | null, > radius?: number | null, > period?: number | null, > semi_major_axis?: number | null, > temperature?: number | null, > distance_light_year?: number | null, > host_star_mass?: number | null, > host_star_temperature?: number | null > }[] > ``` *** ### stars `reference.stars` Get a list of stars matching specified parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.reference.stars({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `constellation` | `string` | No | — | | `min_apparent_magnitude` | `number` | No | — | | `max_apparent_magnitude` | `number` | No | — | | `min_absolute_magnitude` | `number` | No | — | | `max_absolute_magnitude` | `number` | No | — | | `min_distance_light_year` | `number` | No | — | | `max_distance_light_year` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > constellation?: string | null, > right_ascension?: string | null, > declination?: string | null, > apparent_magnitude?: string | null, > absolute_magnitude?: string | null, > distance_light_year?: string | null, > spectral_class?: string | null > }[] > ``` *** ## Text ### dictionary `text.dictionary` Returns a string containing definitions for a given word **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.dictionary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `word` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `definition` | `string` | No | — | | `word` | `string` | No | — | | `valid` | `boolean` | No | — | *** ### embeddings `text.embeddings` Returns a 768-dimensional vector as an array that encodes the meaning of any given input text **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.embeddings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `embeddings` | `number[]` | No | — | *** ### language `text.language` Returns the language name and 2-letter ISO language code for a given block of text string **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.language({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `iso` | `string` | No | — | | `language` | `string` | No | — | *** ### loremIpsum `text.loremIpsum` Returns one or more paragraphs of lorem ipsum placeholder text **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.loremIpsum({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `max_length` | `number` | No | — | | `paragraphs` | `number` | No | — | | `start_with_lorem_ipsum` | `boolean` | No | — | | `random` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | — | *** ### profanityFilter `text.profanityFilter` Returns the censored version (bad words replaced with asterisks) of any given text and whether the text contains profanity **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.profanityFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `original` | `string` | No | — | | `censored` | `string` | No | — | | `has_profanity` | `boolean` | No | — | *** ### randomWord `text.randomWord` Returns a random word \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.randomWord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `string[]` *** ### rhymes `text.rhymes` Returns a list of rhyming words for any given word **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.rhymes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `word` | `string` | Yes | — | **Output:** `string[]` *** ### sentiment `text.sentiment` Returns sentiment analysis score and overall sentiment for a given block of text **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.sentiment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `score` | `number` | No | — | | `text` | `string` | No | — | | `sentiment` | `string` | No | — | *** ### similarity `text.similarity` Returns a similarity score between 0 and 1 (1 is similar and 0 is dissimilar) of two given texts **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.similarity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text_1` | `string` | Yes | — | | `text_2` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `similarity` | `number` | No | — | *** ### spellCheck `text.spellCheck` Returns spelling corrections and suggestions for any given text **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.spellCheck({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `original` | `string` | No | — | | `corrected` | `string` | No | — | | `corrections` | `object[]` | No | — | | `index` | `string` | No | — | | `correction` | `string` | No | — | | `candidates` | `string[] \| string` | No | — | > **corrections full type** > > ```ts theme={null} > { > word?: string | null, > index?: number | null, > correction?: string | null, > candidates?: string[] | null > }[] > ``` *** ### thesaurus `text.thesaurus` Returns a list of synonyms and a list of antonyms for a given word **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.text.thesaurus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `word` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `word` | `string` | No | — | | `synonyms` | `string[]` | No | — | | `antonyms` | `string[]` | No | — | *** ## Transport ### aircraft `transport.aircraft` Returns a list of aircrafts that match the given parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.transport.aircraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `manufacturer` | `string` | No | — | | `model` | `string` | No | — | | `engine_type` | `string` | No | — | | `min_speed` | `number` | No | — | | `max_speed` | `number` | No | — | | `min_range` | `number` | No | — | | `max_range` | `number` | No | — | | `min_length` | `number` | No | — | | `max_length` | `number` | No | — | | `min_height` | `number` | No | — | | `max_height` | `number` | No | — | | `min_wingspan` | `number` | No | — | | `max_wingspan` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > manufacturer?: string | null, > model?: string | null, > engine_type?: string | null, > max_speed_knots?: string | null, > ceiling_ft?: string | null, > gross_weight_lbs?: string | null, > length_ft?: string | null, > height_ft?: string | null, > wing_span_ft?: string | null, > range_nautical_miles?: string | null, > engine_thrust_lb_ft?: number | string | null, > cruise_speed_knots?: number | string | null, > takeoff_ground_run_ft?: number | string | null, > landing_ground_roll_ft?: number | string | null, > empty_weight_lbs?: number | string | null > }[] > ``` *** ### airlines `transport.airlines` Returns airline details including fleet composition, base airport and branding assets, by name, IATA code or ICAO code **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.transport.airlines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `iata` | `string` | No | — | | `icao` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > country?: string | null, > year_created?: string | null, > base?: string | null, > iata?: string | null, > icao?: string | null, > fleet?: { > A359?: number | null, > A388?: number | null, > B38M?: number | null, > B738?: number | null, > B744?: number | null, > B772?: number | null, > B773?: number | null, > B77W?: number | null, > B78X?: number | null, > total?: number | null > } | null, > logo_url?: string | null, > brandmark_url?: string | null, > tail_logo_url?: string | null > }[] > ``` *** ### airports `transport.airports` Returns a list of up to 10 airport results **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.transport.airports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iata` | `string` | No | — | | `icao` | `string` | No | — | | `name` | `string` | No | — | | `country` | `string` | No | — | | `region` | `string` | No | — | | `city` | `string` | No | — | | `timezone` | `string` | No | — | | `min_elevation` | `number` | No | — | | `max_elevation` | `number` | No | — | | `size` | `string` | No | — | | `has_iata` | `boolean` | No | — | | `min_runway_length` | `number` | No | — | | `type` | `string` | No | — | | `scheduled_service` | `boolean` | No | — | | `continent` | `string` | No | — | | `surface` | `string` | No | — | | `has_lights` | `boolean` | No | — | | `q` | `string` | No | — | | `include_closed` | `boolean` | No | — | | `limit` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `string` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > icao?: string | null, > ident?: string | null, > iata?: string | null, > name?: string | null, > city?: string | null, > region?: string | null, > region_code?: string | null, > country?: string | null, > country_name?: string | null, > continent?: string | null, > elevation_ft?: number | null, > elevation_m?: number | null, > latitude?: number | null, > longitude?: number | null, > timezone?: string | null, > type?: string | null, > size?: string | null, > scheduled_service?: boolean | null, > is_closed?: boolean | null, > gps_code?: string | null, > local_code?: string | null, > home_link?: string | null, > wikipedia_link?: string | null, > keywords?: string[] | null, > num_runways?: number | null, > longest_runway_ft?: number | null, > runways?: { > length?: number | null, > width?: number | null, > has_lights?: boolean | null, > surface?: string | null, > surface_category?: string | null, > closed?: boolean | null, > le_ident?: string | null, > he_ident?: string | null, > le_heading_deg?: number | null, > he_heading_deg?: number | null > }[] | null, > estimated_annual_passengers?: number | null > }[] > ``` *** ### cars `transport.cars` Get car data from given parameters \[deprecated by the provider] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.transport.cars({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `make` | `string` | No | — | | `model` | `string` | Yes | — | | `trim` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > city_mpg?: number | string | null, > class?: string | null, > combination_mpg?: number | string | null, > cylinders?: number | null, > displacement?: number | null, > drive?: string | null, > fuel_type?: string | null, > highway_mpg?: number | string | null, > make?: string | null, > model?: string | null, > transmission?: string | null, > year?: number | null > }[] > ``` *** ### electricVehicles `transport.electricVehicles` Get electric vehicle data from given parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.transport.electricVehicles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `make` | `string` | No | — | | `model` | `string` | No | — | | `min_year` | `number` | No | — | | `max_year` | `number` | No | — | | `min_range` | `number` | No | — | | `max_range` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > make?: string | null, > model?: string | null, > year_start?: string | null, > battery_capacity?: string | null, > battery_type?: string | null, > battery_number_of_cells?: string | null, > battery_architecture?: string | null, > battery_useable_capacity?: string | null, > battery_cathode_material?: string | null, > battery_pack_configuration?: string | null, > battery_voltage?: string | null, > battery_form_factor?: string | null, > battery_name?: string | null, > charge_port?: string | null, > charge_port_location?: string | null, > charge_power?: string | null, > charge_speed?: string | null, > charge_power_max?: string | null, > charge_power_10p_80p?: string | null, > autocharge_supported?: string | null, > plug_charge_supported?: string | null, > supported_charging_protocol?: string | null, > preconditioning_possible?: string | null, > acceleration_0_100_kmh?: string | null, > top_speed?: string | null, > electric_range?: number | string | null, > total_power?: string | null, > total_torque?: string | null, > drive?: string | null, > vehicle_consumption?: string | null, > co2_emissions?: string | null, > vehicle_fuel_equivalent?: string | null, > rated_consumption?: string | null, > rated_fuel_equivalent?: string | null, > length?: string | null, > width?: string | null, > width_with_mirrors?: string | null, > height?: string | null, > wheelbase?: string | null, > gross_vehicle_weight?: string | null, > max_payload?: string | null, > cargo_volume?: string | null, > cargo_volume_frunk?: string | null, > seats?: string | null, > turning_circle?: string | null, > platform?: string | null, > car_body?: string | null, > segment?: string | null, > length, > width, > height?: string | null > }[] > ``` *** ### helicopters `transport.helicopters` Get helicopter technical specifications that match the given parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.transport.helicopters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `manufacturer` | `string` | No | — | | `model` | `string` | No | — | | `min_speed` | `number` | No | — | | `max_speed` | `number` | No | — | | `min_range` | `number` | No | — | | `max_range` | `number` | No | — | | `min_length` | `number` | No | — | | `max_length` | `number` | No | — | | `min_height` | `number` | No | — | | `max_height` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > manufacturer?: string | null, > model?: string | null, > max_speed_sl_knots?: string | null, > cruise_speed_sl_knots?: string | null, > vne_speed_knots?: string | null, > range_nautical_miles?: string | null, > fuel_consumption_gallons_pr_hr?: string | null, > fuel_capacity_gallons?: string | null, > fuel_opt_gallons?: string | null, > gross_external_load_lbs?: string | null, > external_load_limit_lbs?: string | null, > main_rotor_diameter_ft?: string | null, > num_blades?: string | null, > blade_material?: string | null, > storage_width_ft?: string | null, > length_ft?: string | null, > height_ft?: string | null, > cruise_time_min?: number | string | null, > rotor_type?: string | null > }[] > ``` *** ### motorcycles `transport.motorcycles` Returns up to 30 motorcycle results matching the input name parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.transport.motorcycles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `make` | `string` | No | — | | `model` | `string` | No | — | | `year` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > make?: string | null, > model?: string | null, > year?: string | null, > type?: string | null, > displacement?: string | null, > engine?: string | null, > compression?: string | null, > bore_stroke?: string | null, > valves_per_cylinder?: string | null, > fuel_system?: string | null, > fuel_control?: string | null, > lubrication?: string | null, > cooling?: string | null, > gearbox?: string | null, > transmission?: string | null, > clutch?: string | null, > frame?: string | null, > front_suspension?: string | null, > front_wheel_travel?: string | null, > rear_suspension?: string | null, > rear_wheel_travel?: string | null, > front_tire?: string | null, > rear_tire?: string | null, > front_brakes?: string | null, > rear_brakes?: string | null, > seat_height?: string | null, > ground_clearance?: string | null, > wheelbase?: string | null, > fuel_capacity?: string | null, > starter?: string | null, > power?: string | null, > torque?: string | null, > top_speed?: string | null, > fuel_consumption?: string | null, > emission?: string | null, > total_weight?: string | null, > total_height?: string | null, > total_length?: string | null, > total_width?: string | null, > ignition?: string | null, > dry_weight?: string | null > }[] > ``` *** ### vin `transport.vin` Returns key vehicle information including manufacturer, country of origin, and model year for a given VIN **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.transport.vin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vin` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `vin` | `string` | No | — | | `country` | `string` | No | — | | `manufacturer` | `string` | No | — | | `model` | `string` | No | — | | `class` | `string` | No | — | | `region` | `string` | No | — | | `wmi` | `string` | No | — | | `vds` | `string` | No | — | | `vis` | `string` | No | — | | `year` | `number` | No | — | *** ## Utility ### barcode `utility.barcode` Returns a barcode image binary specified by input parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.utility.barcode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `include_text` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content_type` | `string` | Yes | — | | `encoding` | `text \| lossy-text` | Yes | — | | `data` | `string` | Yes | — | *** ### convertUnit `utility.convertUnit` Returns conversions between different units of the same measurement type **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.utility.convertUnit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | — | | `unit` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `unit` | `string` | No | — | | `amount` | `number` | No | — | | `conversions` | `object` | No | — | > **conversions full type** > > ```ts theme={null} > { > meter?: number | null, > kilometer?: number | null, > centimeter?: number | null, > millimeter?: number | null, > micrometer?: number | null, > nanometer?: number | null, > mile?: number | null, > yard?: number | null, > foot?: number | null, > inch?: number | null, > nautical_mile?: number | null, > furlong?: number | null, > light_year?: number | null, > astronomical_unit?: number | null > } > ``` *** ### counter `utility.counter` Fetch and possibly update a counter **Risk:** `write` ```ts theme={null} await corsair.apininjas.api.utility.counter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `hit` | `boolean` | No | — | | `value` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `value` | `number` | No | — | *** ### countryFlag `utility.countryFlag` Get a country's flag as SVG image URLs **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.utility.countryFlag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | | `square_image_url` | `string` | No | — | | `rectangle_image_url` | `string` | No | — | *** ### emoji `utility.emoji` Returns a list of emojis according to input parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.utility.emoji({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `code` | `string` | No | — | | `group` | `string` | No | — | | `subgroup` | `string` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > code?: string | null, > character?: string | null, > image?: string | null, > name?: string | null, > group?: string | null, > subgroup?: string | null > }[] > ``` *** ### logo `utility.logo` Get a list of company names, ticker symbols, and logo image URLs matching the input parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.utility.logo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `ticker` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > image?: string | null, > ticker?: string | null > }[] > ``` *** ### password `utility.password` Returns a random password string adhering to the specified parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.utility.password({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `length` | `number` | No | — | | `exclude_numbers` | `boolean` | No | — | | `exclude_special_chars` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `random_password` | `string` | No | — | *** ### qrCode `utility.qrCode` Returns a QRCode image binary specified by input parameters **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.utility.qrCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `string` | Yes | — | | `format` | `string` | No | — | | `size` | `number` | No | — | | `fg_color` | `string` | No | — | | `bg_color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content_type` | `string` | Yes | — | | `encoding` | `text \| lossy-text` | Yes | — | | `data` | `string` | Yes | — | *** ### randomImage `utility.randomImage` Returns a random image in JPEG format \[premium plan required] **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.utility.randomImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content_type` | `string` | Yes | — | | `encoding` | `text \| lossy-text` | Yes | — | | `data` | `string` | Yes | — | *** ### randomUser `utility.randomUser` Returns fake random user profiles **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.utility.randomUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `gender` | `string` | No | — | | `min_age` | `number` | No | — | | `max_age` | `number` | No | — | | `locale` | `string` | No | — | | `fields` | `string` | No | — | | `exclude` | `string` | No | — | | `seed` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > username?: string | null, > password?: string | null, > email?: string | null, > name?: string | null, > first_name?: string | null, > last_name?: string | null, > full_name?: string | null, > prefix?: string | null, > suffix?: string | null, > phone?: string | null, > cell?: string | null, > address?: string | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > postal_code?: string | null, > country?: string | null, > latitude?: number | null, > longitude?: number | null, > timezone?: string | null, > dob?: string | null, > age?: number | null, > gender?: string | null, > job?: string | null, > company?: string | null, > company_email?: string | null, > ssn?: string | null, > credit_card?: string | null, > credit_card_provider?: string | null, > iban?: string | null, > ipv4?: string | null, > ipv6?: string | null, > mac_address?: string | null, > user_agent?: string | null, > url?: string | null, > domain?: string | null, > picture?: string | null, > avatar?: string | null, > uuid?: string | null, > md5?: string | null, > sha1?: string | null, > sha256?: string | null, > locale?: string | null > }[] > ``` *** ## Validation ### bin `validation.bin` Returns detailed information about a bank based on the BIN number provided **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.validation.bin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bin` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > bin?: string | null, > country_iso2?: string | null, > country?: string | null, > brand?: string | null, > type?: string | null, > categories?: string[] | string | null, > issuer?: string | null, > is_valid?: boolean | string | null > }[] > ``` *** ### disposableEmail `validation.disposableEmail` Returns metadata for a given email address, including whether it is from a disposable email provider **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.validation.disposableEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `domain` | `string` | No | — | | `is_disposable` | `boolean` | No | — | *** ### email `validation.email` Returns metadata (including whether it is valid) for a given email address **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.validation.email({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `is_valid` | `boolean` | No | — | | `email` | `string` | No | — | | `is_disposable` | `boolean` | No | — | | `is_public` | `boolean` | No | — | | `main_category` | `string` | No | — | | `sub_category` | `string` | No | — | | `domain` | `string` | No | — | | `local_part` | `string` | No | — | *** ### iban `validation.iban` Returns detailed information on a given IBAN **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.validation.iban({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iban` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `iban` | `string` | No | — | | `bank_name` | `string` | No | — | | `bank_address` | `string` | No | — | | `account_number` | `string` | No | — | | `bank_code` | `string` | No | — | | `country` | `string` | No | — | | `checksum` | `string` | No | — | | `valid` | `boolean \| string` | No | — | | `invalid_reason` | `string` | No | — | | `bban` | `string` | No | — | | `swift_code` | `string` | No | — | *** ### phone `validation.phone` Returns metadata (including whether it is valid) for a given phone number **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.validation.phone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `number` | `string` | Yes | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `is_valid` | `boolean` | No | — | | `is_formatted_properly` | `boolean` | No | — | | `country` | `string` | No | — | | `location` | `string` | No | — | | `timezones` | `string[]` | No | — | | `format_national` | `string` | No | — | | `format_international` | `string` | No | — | | `format_e164` | `string` | No | — | | `country_code` | `number` | No | — | | `line_type` | `string` | No | — | | `is_mobile` | `boolean \| string` | No | — | | `format_rfc3966` | `string` | No | — | | `is_possible` | `boolean \| string` | No | — | *** ### routingNumber `validation.routingNumber` Returns detailed information about a bank based on its routing number **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.validation.routingNumber({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `routing_number` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > bank_name?: string | null, > routing_number?: string | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > zip_code?: string | null, > country?: string | null, > county?: string | null, > timezone?: string | null, > latitude?: string | null, > longitude?: string | null, > phone_number?: number | string | null, > ach_supported?: boolean | null, > fedwire_supported?: boolean | null, > checksum_valid?: boolean | null > }[] > ``` *** ### swiftCode `validation.swiftCode` Returns a list of bank information (including SWIFT/BIC Code) that match the input parameter **Risk:** `read` ```ts theme={null} await corsair.apininjas.api.validation.swiftCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `swift` | `string` | No | — | | `bank` | `string` | No | — | | `city` | `string` | No | — | | `country` | `string` | No | — | | `routing_number` | `string` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > swift_code?: string | null, > bank_name?: string | null, > address?: string | null, > city?: string | null, > region?: string | null, > postal_code?: string | null, > country?: string | null, > country_code?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/apininjas/database API Ninjas local sync: searchable entities, `.search()` filters, and operators. The API Ninjas plugin syncs data locally. Use `corsair.apininjas.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Aircraft Path: `apininjas.db.aircraft.search` ```ts theme={null} const rows = await corsair.apininjas.db.aircraft.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `manufacturer` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `engine_type` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Airlines Path: `apininjas.db.airlines.search` ```ts theme={null} const rows = await corsair.apininjas.db.airlines.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `iata` | `string` | equals, contains, startsWith, endsWith, in | | `icao` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `year_created` | `string` | equals, contains, startsWith, endsWith, in | | `base` | `string` | equals, contains, startsWith, endsWith, in | | `logo_url` | `string` | equals, contains, startsWith, endsWith, in | | `brandmark_url` | `string` | equals, contains, startsWith, endsWith, in | | `tail_logo_url` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Airports Path: `apininjas.db.airports.search` ```ts theme={null} const rows = await corsair.apininjas.db.airports.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `iata` | `string` | equals, contains, startsWith, endsWith, in | | `icao` | `string` | equals, contains, startsWith, endsWith, in | | `ident` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `region_code` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `country_name` | `string` | equals, contains, startsWith, endsWith, in | | `continent` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `string` | equals, contains, startsWith, endsWith, in | | `gps_code` | `string` | equals, contains, startsWith, endsWith, in | | `local_code` | `string` | equals, contains, startsWith, endsWith, in | | `home_link` | `string` | equals, contains, startsWith, endsWith, in | | `wikipedia_link` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Animals Path: `apininjas.db.animals.search` ```ts theme={null} const rows = await corsair.apininjas.db.animals.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Cities Path: `apininjas.db.cities.search` ```ts theme={null} const rows = await corsair.apininjas.db.cities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Countries Path: `apininjas.db.countries.search` ```ts theme={null} const rows = await corsair.apininjas.db.countries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `iso2` | `string` | equals, contains, startsWith, endsWith, in | | `capital` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Emoji Path: `apininjas.db.emoji.search` ```ts theme={null} const rows = await corsair.apininjas.db.emoji.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `character` | `string` | equals, contains, startsWith, endsWith, in | | `image` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `group` | `string` | equals, contains, startsWith, endsWith, in | | `subgroup` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Planets Path: `apininjas.db.planets.search` ```ts theme={null} const rows = await corsair.apininjas.db.planets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sp500 Path: `apininjas.db.sp500.search` ```ts theme={null} const rows = await corsair.apininjas.db.sp500.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `company_name` | `string` | equals, contains, startsWith, endsWith, in | | `sector` | `string` | equals, contains, startsWith, endsWith, in | | `sub_industry` | `string` | equals, contains, startsWith, endsWith, in | | `headquarters` | `string` | equals, contains, startsWith, endsWith, in | | `date_added` | `string` | equals, contains, startsWith, endsWith, in | | `cik` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Stars Path: `apininjas.db.stars.search` ```ts theme={null} const rows = await corsair.apininjas.db.stars.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `constellation` | `string` | equals, contains, startsWith, endsWith, in | | `right_ascension` | `string` | equals, contains, startsWith, endsWith, in | | `declination` | `string` | equals, contains, startsWith, endsWith, in | | `spectral_class` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Stock Exchanges Path: `apininjas.db.stockExchanges.search` ```ts theme={null} const rows = await corsair.apininjas.db.stockExchanges.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `mic` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `iso2` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `founded` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `market_open` | `string` | equals, contains, startsWith, endsWith, in | | `market_close` | `string` | equals, contains, startsWith, endsWith, in | | `closed_reason` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Universities Path: `apininjas.db.universities.search` ```ts theme={null} const rows = await corsair.apininjas.db.universities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `postal_code` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `county` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `latitude` | `string` | equals, contains, startsWith, endsWith, in | | `longitude` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `institution_type` | `string` | equals, contains, startsWith, endsWith, in | | `years` | `string` | equals, contains, startsWith, endsWith, in | | `enrollment` | `string` | equals, contains, startsWith, endsWith, in | | `student_faculty_ratio` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Vehicles Path: `apininjas.db.vehicles.search` ```ts theme={null} const rows = await corsair.apininjas.db.vehicles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `make` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `class` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `fuel_type` | `string` | equals, contains, startsWith, endsWith, in | | `drive` | `string` | equals, contains, startsWith, endsWith, in | | `transmission` | `string` | equals, contains, startsWith, endsWith, in | | `battery_capacity` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/apininjas/overview Developer API hub for facts, finance, nutrition, and dozens of data endpoints. Use **API Ninjas** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 129 typed API operations * 13 synced entities (`aircraft`, `airlines`, `airports`, `animals`, `cities`, `countries`, and 7 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/apininjas ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/apininjas ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/apininjas ``` ```bash bun theme={null} bun add corsair @corsair-dev/apininjas ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { apininjas } from '@corsair-dev/apininjas'; export const corsair = createCorsair({ plugins: [ apininjas(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} apininjas() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'apininjas', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`calendar.holidays`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apininjas.api.calendar.holidays({}); ``` **`utility.counter`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apininjas.api.utility.counter({}); ``` See the full list on the [API](/plugins/apininjas/api) page. ## Query synced data Synced entities support `tenant.apininjas.db..search()` and `.list()`: `aircraft`, `airlines`, `airports`, `animals`, `cities`, `countries`, `emoji`, `planets`, `sp500`, `stars`, `stockExchanges`, `universities`, `vehicles`. See [Database](/plugins/apininjas/database) for filters and operators. ## What's next > **[API reference](/plugins/apininjas/api)** > > Every `apininjas.api.*` operation with input and output types. > **[Database](/plugins/apininjas/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/apipie/api API reference for APIpie: every `apipie.api.*` operation with input and output types. Every `apipie.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chat ### createCompletion `chat.createCompletion` Generate a chat completion using an APIpie model, with optional provider routing and memory. **Risk:** `write` ```ts theme={null} await corsair.apipie.api.chat.createCompletion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `provider` | `string` | No | — | | `routing` | `price \| perf \| perf_avg` | No | — | | `maxTokens` | `number` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `topK` | `number` | No | — | | `frequencyPenalty` | `number` | No | — | | `presencePenalty` | `number` | No | — | | `stop` | `string \| string[]` | No | — | | `n` | `number` | No | — | | `memory` | `number` | No | — | | `memSession` | `string` | No | — | | `memExpire` | `number` | No | — | | `memClear` | `number` | No | — | | `integrity` | `number` | No | — | | `integrityModel` | `string` | No | — | > **messages full type** > > ```ts theme={null} > { > role: string, > content: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `model` | `string` | No | — | | `choices` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > index?: number, > message: { > role: string, > content: string > }, > finish_reason?: string, > finishReason?: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ## Embeddings ### create `embeddings.create` Create embeddings for the given input text(s). **Risk:** `write` ```ts theme={null} await corsair.apipie.api.embeddings.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `string \| string[]` | Yes | — | | `user` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `model` | `string` | No | — | | `data` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > object?: string, > index?: number, > embedding: number[] > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ## Images ### generate `images.generate` Generate image(s) from a text prompt. **Risk:** `write` ```ts theme={null} await corsair.apipie.api.images.generate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `prompt` | `string` | Yes | — | | `n` | `number` | No | — | | `size` | `string` | No | — | | `quality` | `string` | No | — | | `style` | `string` | No | — | | `responseFormat` | `string` | No | — | | `user` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `number` | No | — | | `data` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > url?: string, > b64_json?: string, > revised_prompt?: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ## Models ### list `models.list` List APIpie models available to the account, filterable by type, subtype, provider, and model. **Risk:** `read` ```ts theme={null} await corsair.apipie.api.models.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `subtype` | `string` | No | — | | `provider` | `string` | No | — | | `model` | `string` | No | — | | `enabled` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > model?: string | null, > provider?: string | null, > type?: string | null, > subtype?: string | null, > route?: string | null, > description?: string | null, > enabled?: boolean | number | null, > available?: boolean | number | null, > avg_cost?: string | null, > input_cost?: string | null, > output_cost?: string | null, > price_type?: string | null, > img_price?: any | null, > img_json?: { > } | null, > latency?: string | null, > query_count?: string | null, > max_tokens?: number | null, > max_response_tokens?: number | null > }[] | { > object?: string, > data: { > id: string, > model?: string | null, > provider?: string | null, > type?: string | null, > subtype?: string | null, > route?: string | null, > description?: string | null, > enabled?: boolean | number | null, > available?: boolean | number | null, > avg_cost?: string | null, > input_cost?: string | null, > output_cost?: string | null, > price_type?: string | null, > img_price?: any | null, > img_json?: { > } | null, > latency?: string | null, > query_count?: string | null, > max_tokens?: number | null, > max_response_tokens?: number | null > }[] > } > ``` *** ### listDetailed `models.listDetailed` List APIpie models with detailed metadata including capabilities, limits, and pricing. **Risk:** `read` ```ts theme={null} await corsair.apipie.api.models.listDetailed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `provider` | `string` | No | — | | `model` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > model?: string | null, > provider?: string | null, > type?: string | null, > subtype?: string | null, > route?: string | null, > description?: string | null, > enabled?: boolean | number | null, > available?: boolean | number | null, > abortable?: boolean | null, > moderationRequired?: boolean | null, > supports_multipart?: boolean | null, > input_modalities?: string[] | null, > output_modalities?: string[] | null, > instruct_type?: string | null, > quantization?: string | null, > pool?: string | null, > mmlu?: number | null, > output_vector_size?: number | null, > max_tokens?: number | null, > max_response_tokens?: number | null, > max_images_per_prompt?: number | null, > max_audio_per_prompt?: number | null, > max_audio_length_hours?: number | null, > max_videos_per_prompt?: number | null, > max_video_length?: number | null, > max_pdf_size_mb?: number | null, > latency?: string | null, > query_count?: string | null, > pricing?: { > } | null, > supported_input_parameters?: { > } | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/apipie/database APIpie local sync: searchable entities, `.search()` filters, and operators. The APIpie plugin syncs data locally. Use `corsair.apipie.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Images Path: `apipie.db.images.search` ```ts theme={null} const rows = await corsair.apipie.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `prompt` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `revised_prompt` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Model Details Path: `apipie.db.modelDetails.search` ```ts theme={null} const rows = await corsair.apipie.db.modelDetails.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `provider` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `subtype` | `string` | equals, contains, startsWith, endsWith, in | | `route` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `abortable` | `boolean` | equals | | `moderationRequired` | `boolean` | equals | | `supports_multipart` | `boolean` | equals | | `instruct_type` | `string` | equals, contains, startsWith, endsWith, in | | `quantization` | `string` | equals, contains, startsWith, endsWith, in | | `pool` | `string` | equals, contains, startsWith, endsWith, in | | `mmlu` | `number` | equals, gt, gte, lt, lte, in | | `output_vector_size` | `number` | equals, gt, gte, lt, lte, in | | `max_tokens` | `number` | equals, gt, gte, lt, lte, in | | `max_response_tokens` | `number` | equals, gt, gte, lt, lte, in | | `max_images_per_prompt` | `number` | equals, gt, gte, lt, lte, in | | `max_audio_per_prompt` | `number` | equals, gt, gte, lt, lte, in | | `max_audio_length_hours` | `number` | equals, gt, gte, lt, lte, in | | `max_videos_per_prompt` | `number` | equals, gt, gte, lt, lte, in | | `max_video_length` | `number` | equals, gt, gte, lt, lte, in | | `max_pdf_size_mb` | `number` | equals, gt, gte, lt, lte, in | | `latency` | `string` | equals, contains, startsWith, endsWith, in | | `query_count` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Models Path: `apipie.db.models.search` ```ts theme={null} const rows = await corsair.apipie.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `provider` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `subtype` | `string` | equals, contains, startsWith, endsWith, in | | `route` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `avg_cost` | `string` | equals, contains, startsWith, endsWith, in | | `input_cost` | `string` | equals, contains, startsWith, endsWith, in | | `output_cost` | `string` | equals, contains, startsWith, endsWith, in | | `price_type` | `string` | equals, contains, startsWith, endsWith, in | | `latency` | `string` | equals, contains, startsWith, endsWith, in | | `query_count` | `string` | equals, contains, startsWith, endsWith, in | | `max_tokens` | `number` | equals, gt, gte, lt, lte, in | | `max_response_tokens` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/apipie/overview AI model aggregation API for routing requests across multiple LLM providers. Use **APIpie** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 3 synced entities (`images`, `modelDetails`, `models`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/apipie ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/apipie ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/apipie ``` ```bash bun theme={null} bun add corsair @corsair-dev/apipie ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { apipie } from '@corsair-dev/apipie'; export const corsair = createCorsair({ plugins: [ apipie(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} apipie() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'apipie', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`models.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apipie.api.models.list({}); ``` **`chat.createCompletion`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apipie.api.chat.createCompletion({}); ``` See the full list on the [API](/plugins/apipie/api) page. ## Query synced data Synced entities support `tenant.apipie.db..search()` and `.list()`: `images`, `modelDetails`, `models`. See [Database](/plugins/apipie/database) for filters and operators. ## What's next > **[API reference](/plugins/apipie/api)** > > Every `apipie.api.*` operation with input and output types. > **[Database](/plugins/apipie/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/apisports/api API reference for API-Sports: every `apisports.api.*` operation with input and output types. Every `apisports.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Afl ### getAflGamePlayerStatistics `afl.getAflGamePlayerStatistics` Get AFL Game Player Statistics **Risk:** `read` ```ts theme={null} await corsair.apisports.api.afl.getAflGamePlayerStatistics({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getAflGames `afl.getAflGames` Get AFL Games **Risk:** `read` ```ts theme={null} await corsair.apisports.api.afl.getAflGames({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getAflGamesQuarters `afl.getAflGamesQuarters` Get AFL Games Quarters **Risk:** `read` ```ts theme={null} await corsair.apisports.api.afl.getAflGamesQuarters({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getAflSeasons `afl.getAflSeasons` Get AFL Seasons **Risk:** `read` ```ts theme={null} await corsair.apisports.api.afl.getAflSeasons({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getAflStandings `afl.getAflStandings` Get AFL Standings **Risk:** `read` ```ts theme={null} await corsair.apisports.api.afl.getAflStandings({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ## Baseball ### getBaseballGamesHeadToHead `baseball.getBaseballGamesHeadToHead` Get Baseball Games Head-to-Head **Risk:** `read` ```ts theme={null} await corsair.apisports.api.baseball.getBaseballGamesHeadToHead({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ## Basketball ### getBasketballBets `basketball.getBasketballBets` Get Basketball Bets **Risk:** `read` ```ts theme={null} await corsair.apisports.api.basketball.getBasketballBets({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getBasketballBookmakers `basketball.getBasketballBookmakers` Get Basketball Bookmakers **Risk:** `read` ```ts theme={null} await corsair.apisports.api.basketball.getBasketballBookmakers({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getBasketballStatistics `basketball.getBasketballStatistics` Get Basketball Statistics **Risk:** `read` ```ts theme={null} await corsair.apisports.api.basketball.getBasketballStatistics({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getGamesEvents `basketball.getGamesEvents` Get Games Events **Risk:** `read` ```ts theme={null} await corsair.apisports.api.basketball.getGamesEvents({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getGameStatisticsByTeams `basketball.getGameStatisticsByTeams` Get Game Statistics by Teams **Risk:** `read` ```ts theme={null} await corsair.apisports.api.basketball.getGameStatisticsByTeams({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getNbaGameStatistics `basketball.getNbaGameStatistics` Get NBA Game Statistics **Risk:** `read` ```ts theme={null} await corsair.apisports.api.basketball.getNbaGameStatistics({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPlayerStatistics `basketball.getPlayerStatistics` Get Player Statistics **Risk:** `read` ```ts theme={null} await corsair.apisports.api.basketball.getPlayerStatistics({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ## Core ### getCoaches `core.getCoaches` Get Coaches **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getCoaches({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getCountries `core.getCountries` Get Countries **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getCountries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getInjuries `core.getInjuries` Get Injuries **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getInjuries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getLeagues `core.getLeagues` Get Leagues **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getLeagues({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getLeagueSeasons `core.getLeagueSeasons` Get League Seasons **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getLeagueSeasons({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPredictions `core.getPredictions` Get Predictions **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getPredictions({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getSidelined `core.getSidelined` Get Sidelined **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getSidelined({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getTeams `core.getTeams` Get Teams **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getTeams({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getTeamSeasons `core.getTeamSeasons` Get Team Seasons **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getTeamSeasons({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getTeamStatistics `core.getTeamStatistics` Get Team Statistics **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getTeamStatistics({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getTimezone `core.getTimezone` Get Timezone **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getTimezone({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getTransfers `core.getTransfers` Get Transfers **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getTransfers({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getTrophies `core.getTrophies` Get Trophies **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getTrophies({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getVenues `core.getVenues` Get Venues **Risk:** `read` ```ts theme={null} await corsair.apisports.api.core.getVenues({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ## Fixtures ### getFixtureLineups `fixtures.getFixtureLineups` Get Fixture Lineups **Risk:** `read` ```ts theme={null} await corsair.apisports.api.fixtures.getFixtureLineups({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFixtures `fixtures.getFixtures` Get Fixtures **Risk:** `read` ```ts theme={null} await corsair.apisports.api.fixtures.getFixtures({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFixturesEvents `fixtures.getFixturesEvents` Get Fixtures Events **Risk:** `read` ```ts theme={null} await corsair.apisports.api.fixtures.getFixturesEvents({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFixturesPlayers `fixtures.getFixturesPlayers` Get Fixtures Players **Risk:** `read` ```ts theme={null} await corsair.apisports.api.fixtures.getFixturesPlayers({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFixturesRounds `fixtures.getFixturesRounds` Get Fixtures Rounds **Risk:** `read` ```ts theme={null} await corsair.apisports.api.fixtures.getFixturesRounds({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFixtureStatistics `fixtures.getFixtureStatistics` Get Fixture Statistics **Risk:** `read` ```ts theme={null} await corsair.apisports.api.fixtures.getFixtureStatistics({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getHeadToHeadFixtures `fixtures.getHeadToHeadFixtures` Get Head-to-Head Fixtures **Risk:** `read` ```ts theme={null} await corsair.apisports.api.fixtures.getHeadToHeadFixtures({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ## Formula1 ### getFastestLapsRankings `formula1.getFastestLapsRankings` Get Fastest Laps Rankings **Risk:** `read` ```ts theme={null} await corsair.apisports.api.formula1.getFastestLapsRankings({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFormula1Circuits `formula1.getFormula1Circuits` Get Formula 1 Circuits **Risk:** `read` ```ts theme={null} await corsair.apisports.api.formula1.getFormula1Circuits({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFormula1Competitions `formula1.getFormula1Competitions` Get Formula 1 Competitions **Risk:** `read` ```ts theme={null} await corsair.apisports.api.formula1.getFormula1Competitions({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFormula1DriverRankings `formula1.getFormula1DriverRankings` Get Formula 1 Driver Rankings **Risk:** `read` ```ts theme={null} await corsair.apisports.api.formula1.getFormula1DriverRankings({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFormula1Races `formula1.getFormula1Races` Get Formula 1 Races **Risk:** `read` ```ts theme={null} await corsair.apisports.api.formula1.getFormula1Races({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFormula1StartingGrid `formula1.getFormula1StartingGrid` Get Formula 1 Starting Grid **Risk:** `read` ```ts theme={null} await corsair.apisports.api.formula1.getFormula1StartingGrid({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getFormula1TeamRankings `formula1.getFormula1TeamRankings` Get Formula 1 Team Rankings **Risk:** `read` ```ts theme={null} await corsair.apisports.api.formula1.getFormula1TeamRankings({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getRaceRankings `formula1.getRaceRankings` Get Race Rankings **Risk:** `read` ```ts theme={null} await corsair.apisports.api.formula1.getRaceRankings({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ## Mma ### getFightersRecords `mma.getFightersRecords` Get Fighters Records **Risk:** `read` ```ts theme={null} await corsair.apisports.api.mma.getFightersRecords({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getMmaCategories `mma.getMmaCategories` Get MMA Categories **Risk:** `read` ```ts theme={null} await corsair.apisports.api.mma.getMmaCategories({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getMmaFighters `mma.getMmaFighters` Get MMA Fighters **Risk:** `read` ```ts theme={null} await corsair.apisports.api.mma.getMmaFighters({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getMmaFighterStatistics `mma.getMmaFighterStatistics` Get MMA Fighter Statistics **Risk:** `read` ```ts theme={null} await corsair.apisports.api.mma.getMmaFighterStatistics({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getMmaFightResults `mma.getMmaFightResults` Get MMA Fight Results **Risk:** `read` ```ts theme={null} await corsair.apisports.api.mma.getMmaFightResults({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getMmaFights `mma.getMmaFights` Get MMA Fights **Risk:** `read` ```ts theme={null} await corsair.apisports.api.mma.getMmaFights({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ## Odds ### getInPlayOdds `odds.getInPlayOdds` Get In-Play Odds **Risk:** `read` ```ts theme={null} await corsair.apisports.api.odds.getInPlayOdds({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getLiveOddsBets `odds.getLiveOddsBets` Get Live Odds Bets **Risk:** `read` ```ts theme={null} await corsair.apisports.api.odds.getLiveOddsBets({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getOdds `odds.getOdds` Get Odds **Risk:** `read` ```ts theme={null} await corsair.apisports.api.odds.getOdds({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getOddsBets `odds.getOddsBets` Get Odds Bets **Risk:** `read` ```ts theme={null} await corsair.apisports.api.odds.getOddsBets({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getOddsBookmakers `odds.getOddsBookmakers` Get Odds Bookmakers **Risk:** `read` ```ts theme={null} await corsair.apisports.api.odds.getOddsBookmakers({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getOddsMapping `odds.getOddsMapping` Get Odds Mapping **Risk:** `read` ```ts theme={null} await corsair.apisports.api.odds.getOddsMapping({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ## Players ### getPlayers `players.getPlayers` Get Players **Risk:** `read` ```ts theme={null} await corsair.apisports.api.players.getPlayers({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPlayersProfiles `players.getPlayersProfiles` Get Players Profiles **Risk:** `read` ```ts theme={null} await corsair.apisports.api.players.getPlayersProfiles({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPlayersSeasons `players.getPlayersSeasons` Get Players Seasons **Risk:** `read` ```ts theme={null} await corsair.apisports.api.players.getPlayersSeasons({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPlayersSquads `players.getPlayersSquads` Get Players Squads **Risk:** `read` ```ts theme={null} await corsair.apisports.api.players.getPlayersSquads({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPlayersTeams `players.getPlayersTeams` Get Players Teams **Risk:** `read` ```ts theme={null} await corsair.apisports.api.players.getPlayersTeams({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPlayersTopAssists `players.getPlayersTopAssists` Get Players Top Assists **Risk:** `read` ```ts theme={null} await corsair.apisports.api.players.getPlayersTopAssists({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPlayersTopRedCards `players.getPlayersTopRedCards` Get Players Top Red Cards **Risk:** `read` ```ts theme={null} await corsair.apisports.api.players.getPlayersTopRedCards({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPlayersTopScorers `players.getPlayersTopScorers` Get Players Top Scorers **Risk:** `read` ```ts theme={null} await corsair.apisports.api.players.getPlayersTopScorers({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getPlayersTopYellowCards `players.getPlayersTopYellowCards` Get Players Top Yellow Cards **Risk:** `read` ```ts theme={null} await corsair.apisports.api.players.getPlayersTopYellowCards({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ## Standings ### getNflStandingsConferences `standings.getNflStandingsConferences` Get NFL Standings Conferences **Risk:** `read` ```ts theme={null} await corsair.apisports.api.standings.getNflStandingsConferences({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getStandingsDivisions `standings.getStandingsDivisions` Get Standings Divisions **Risk:** `read` ```ts theme={null} await corsair.apisports.api.standings.getStandingsDivisions({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getStandingsGroups `standings.getStandingsGroups` Get Standings Groups **Risk:** `read` ```ts theme={null} await corsair.apisports.api.standings.getStandingsGroups({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** ### getStandingsStages `standings.getStandingsStages` Get Standings Stages **Risk:** `read` ```ts theme={null} await corsair.apisports.api.standings.getStandingsStages({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `get` | `string` | No | — | | `parameters` | `object[]` | No | — | | `errors` | `object` | No | — | | `results` | `number` | No | — | | `paging` | `object` | No | — | | `response` | `any` | Yes | — | > **parameters full type** > > ```ts theme={null} > { > } | any[] > ``` > **errors full type** > > ```ts theme={null} > any[] | { > } > ``` > **paging full type** > > ```ts theme={null} > { > current?: number, > total?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/apisports/database API-Sports local sync: searchable entities, `.search()` filters, and operators. The API-Sports plugin syncs data locally. Use `corsair.apisports.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Queries Path: `apisports.db.queries.search` ```ts theme={null} const rows = await corsair.apisports.db.queries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `sport` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `queriedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/apisports/overview Sports data API covering fixtures, standings, statistics, and live scores worldwide. Use **API-Sports** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 67 typed API operations * 1 synced entity (`queries`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/apisports ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/apisports ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/apisports ``` ```bash bun theme={null} bun add corsair @corsair-dev/apisports ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { apisports } from '@corsair-dev/apisports'; export const corsair = createCorsair({ plugins: [ apisports(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} apisports() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'apisports', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`afl.getAflGamePlayerStatistics`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apisports.api.afl.getAflGamePlayerStatistics({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/apisports/api) reference.* See the full list on the [API](/plugins/apisports/api) page. ## Query synced data Synced entities support `tenant.apisports.db..search()` and `.list()`: `queries`. See [Database](/plugins/apisports/database) for filters and operators. ## What's next > **[API reference](/plugins/apisports/api)** > > Every `apisports.api.*` operation with input and output types. > **[Database](/plugins/apisports/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/apollo/api API reference for Apollo: every `apollo.api.*` operation with input and output types. Every `apollo.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## News ### search `news.search` Search news articles about companies by Apollo organization id **Risk:** `read` ```ts theme={null} await corsair.apollo.api.news.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_ids` | `string[]` | Yes | — | | `categories` | `string[]` | No | — | | `published_at` | `object` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | > **published\_at full type** > > ```ts theme={null} > { > min?: string, > max?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | Yes | — | | `news_articles` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > page: number, > per_page: number, > total_entries: number, > total_pages: number > } > ``` > **news\_articles full type** > > ```ts theme={null} > { > id: string, > url?: string | null, > domain?: string | null, > title?: string | null, > snippet?: string | null, > organization_ids?: string[] | null, > published_at?: string | null, > event_categories?: string[] | null > }[] > ``` *** ## Organizations ### enrich `organizations.enrich` Enrich a company by domain, LinkedIn URL, or website **Risk:** `read` ```ts theme={null} await corsair.apollo.api.organizations.enrich({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `linkedin_url` | `string` | No | — | | `website` | `string` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `object` | Yes | — | > **organization full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > website_url?: string | null, > blog_url?: string | null, > angellist_url?: string | null, > linkedin_url?: string | null, > linkedin_uid?: string | null, > twitter_url?: string | null, > facebook_url?: string | null, > crunchbase_url?: string | null, > logo_url?: string | null, > primary_domain?: string | null, > phone?: string | null, > sanitized_phone?: string | null, > languages?: string[] | null, > alexa_ranking?: number | null, > founded_year?: number | null, > publicly_traded_symbol?: string | null, > publicly_traded_exchange?: string | null, > industry?: string | null, > industries?: string[] | null, > secondary_industries?: string[] | null, > industry_tag_id?: string | null, > keywords?: string[] | null, > sic_codes?: string[] | null, > naics_codes?: string[] | null, > estimated_num_employees?: number | null, > organization_headcount_six_month_growth?: number | null, > organization_headcount_twelve_month_growth?: number | null, > organization_headcount_twenty_four_month_growth?: number | null, > departmental_head_count?: { > } | null, > annual_revenue?: number | null, > annual_revenue_printed?: string | null, > organization_revenue?: number | null, > organization_revenue_printed?: string | null, > total_funding?: number | null, > total_funding_printed?: string | null, > latest_funding_stage?: string | null, > latest_funding_round_date?: string | null, > funding_events?: { > id: string, > date?: string | null, > detected_at?: string | null, > news_url?: string | null, > type?: string | null, > investors?: string | null, > amount?: string | null, > currency?: string | null > }[] | null, > technology_names?: string[] | null, > current_technologies?: { > uid: string, > name: string, > category?: string | null > }[] | null, > raw_address?: string | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > postal_code?: string | null, > country?: string | null, > short_description?: string | null, > seo_description?: string | null, > owned_by_organization_id?: string | null, > num_suborganizations?: number | null, > suborganizations?: { > id: string, > name?: string | null, > website_url?: string | null, > industries?: string[] | null, > estimated_num_employees?: number | null, > country?: string | null > }[] | null, > retail_location_count?: number | null, > num_retail_locations?: number | null, > num_languages?: number | null, > primary_phone?: { > number?: string | null, > sanitized_number?: string | null, > source?: string | null > } | null, > latest_funding_detected_at?: string | null, > account_id?: string | null > } > ``` *** ### get `organizations.get` Get complete organization info by Apollo id **Risk:** `read` ```ts theme={null} await corsair.apollo.api.organizations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `object` | Yes | — | > **organization full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > website_url?: string | null, > blog_url?: string | null, > angellist_url?: string | null, > linkedin_url?: string | null, > linkedin_uid?: string | null, > twitter_url?: string | null, > facebook_url?: string | null, > crunchbase_url?: string | null, > logo_url?: string | null, > primary_domain?: string | null, > phone?: string | null, > sanitized_phone?: string | null, > languages?: string[] | null, > alexa_ranking?: number | null, > founded_year?: number | null, > publicly_traded_symbol?: string | null, > publicly_traded_exchange?: string | null, > industry?: string | null, > industries?: string[] | null, > secondary_industries?: string[] | null, > industry_tag_id?: string | null, > keywords?: string[] | null, > sic_codes?: string[] | null, > naics_codes?: string[] | null, > estimated_num_employees?: number | null, > organization_headcount_six_month_growth?: number | null, > organization_headcount_twelve_month_growth?: number | null, > organization_headcount_twenty_four_month_growth?: number | null, > departmental_head_count?: { > } | null, > annual_revenue?: number | null, > annual_revenue_printed?: string | null, > organization_revenue?: number | null, > organization_revenue_printed?: string | null, > total_funding?: number | null, > total_funding_printed?: string | null, > latest_funding_stage?: string | null, > latest_funding_round_date?: string | null, > funding_events?: { > id: string, > date?: string | null, > detected_at?: string | null, > news_url?: string | null, > type?: string | null, > investors?: string | null, > amount?: string | null, > currency?: string | null > }[] | null, > technology_names?: string[] | null, > current_technologies?: { > uid: string, > name: string, > category?: string | null > }[] | null, > raw_address?: string | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > postal_code?: string | null, > country?: string | null, > short_description?: string | null, > seo_description?: string | null, > owned_by_organization_id?: string | null, > num_suborganizations?: number | null, > suborganizations?: { > id: string, > name?: string | null, > website_url?: string | null, > industries?: string[] | null, > estimated_num_employees?: number | null, > country?: string | null > }[] | null, > retail_location_count?: number | null, > num_retail_locations?: number | null, > num_languages?: number | null, > primary_phone?: { > number?: string | null, > sanitized_number?: string | null, > source?: string | null > } | null, > latest_funding_detected_at?: string | null, > account_id?: string | null > } > ``` *** ### jobPostings `organizations.jobPostings` List a company's current job postings **Risk:** `read` ```ts theme={null} await corsair.apollo.api.organizations.jobPostings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `organization_job_postings` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **organization\_job\_postings full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > url?: string | null, > city?: string | null, > state?: string | null, > country?: string | null, > posted_at?: string | null, > last_seen_at?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > page: number, > per_page: number, > total_entries: number, > total_pages: number > } > ``` *** ### search `organizations.search` Search companies by name, location, size, industry, funding, technology, and hiring filters **Risk:** `read` ```ts theme={null} await corsair.apollo.api.organizations.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q_organization_name` | `string` | No | — | | `q_organization_keyword_tags` | `string[]` | No | — | | `q_not_organization_keyword_tags` | `string[]` | No | — | | `latest_funding_amount_range` | `object` | No | — | | `total_funding_range` | `object` | No | — | | `latest_funding_date_range` | `object` | No | — | | `organization_locations` | `string[]` | No | — | | `organization_not_locations` | `string[]` | No | — | | `organization_industry_tag_ids` | `string[]` | No | — | | `organization_not_industry_tag_ids` | `string[]` | No | — | | `organization_industries` | `string[]` | No | — | | `organization_naics_codes` | `string[]` | No | — | | `not_organization_naics_codes` | `string[]` | No | — | | `organization_sic_codes` | `string[]` | No | — | | `not_organization_sic_codes` | `string[]` | No | — | | `organization_ids` | `string[]` | No | — | | `organization_num_employees_ranges` | `string[]` | No | — | | `revenue_range` | `object` | No | — | | `currently_using_any_of_technology_uids` | `string[]` | No | — | | `q_organization_job_titles` | `string[]` | No | — | | `organization_job_locations` | `string[]` | No | — | | `organization_num_jobs_range` | `object` | No | — | | `organization_job_posted_at_range` | `object` | No | — | | `organization_headcount_growth_past_n_months` | `6 \| 12 \| 24` | No | — | | `organization_headcount_growth_range` | `object` | No | — | | `lookalike_organization_ids` | `string[]` | No | — | | `not_organization_websites_list` | `string[]` | No | — | | `q_organization_domains_list` | `string[]` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | > **latest\_funding\_amount\_range full type** > > ```ts theme={null} > { > min?: number, > max?: number > } > ``` > **total\_funding\_range full type** > > ```ts theme={null} > { > min?: number, > max?: number > } > ``` > **latest\_funding\_date\_range full type** > > ```ts theme={null} > { > min?: string, > max?: string > } > ``` > **revenue\_range full type** > > ```ts theme={null} > { > min?: number, > max?: number > } > ``` > **organization\_num\_jobs\_range full type** > > ```ts theme={null} > { > min?: number, > max?: number > } > ``` > **organization\_job\_posted\_at\_range full type** > > ```ts theme={null} > { > min?: string, > max?: string > } > ``` > **organization\_headcount\_growth\_range full type** > > ```ts theme={null} > { > min?: number, > max?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | Yes | — | | `organizations` | `object[]` | Yes | — | | `accounts` | `object[]` | No | — | | `breadcrumbs` | `object[]` | No | — | | `partial_results_only` | `boolean` | No | — | | `partial_results_limit` | `number` | No | — | > **pagination full type** > > ```ts theme={null} > { > page: number, > per_page: number, > total_entries: number, > total_pages: number > } > ``` > **organizations full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > website_url?: string | null, > blog_url?: string | null, > angellist_url?: string | null, > linkedin_url?: string | null, > linkedin_uid?: string | null, > twitter_url?: string | null, > facebook_url?: string | null, > crunchbase_url?: string | null, > logo_url?: string | null, > primary_domain?: string | null, > phone?: string | null, > sanitized_phone?: string | null, > languages?: string[] | null, > alexa_ranking?: number | null, > founded_year?: number | null, > publicly_traded_symbol?: string | null, > publicly_traded_exchange?: string | null, > industry?: string | null, > industries?: string[] | null, > secondary_industries?: string[] | null, > industry_tag_id?: string | null, > keywords?: string[] | null, > sic_codes?: string[] | null, > naics_codes?: string[] | null, > estimated_num_employees?: number | null, > organization_headcount_six_month_growth?: number | null, > organization_headcount_twelve_month_growth?: number | null, > organization_headcount_twenty_four_month_growth?: number | null, > departmental_head_count?: { > } | null, > annual_revenue?: number | null, > annual_revenue_printed?: string | null, > organization_revenue?: number | null, > organization_revenue_printed?: string | null, > total_funding?: number | null, > total_funding_printed?: string | null, > latest_funding_stage?: string | null, > latest_funding_round_date?: string | null, > funding_events?: { > id: string, > date?: string | null, > detected_at?: string | null, > news_url?: string | null, > type?: string | null, > investors?: string | null, > amount?: string | null, > currency?: string | null > }[] | null, > technology_names?: string[] | null, > current_technologies?: { > uid: string, > name: string, > category?: string | null > }[] | null, > raw_address?: string | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > postal_code?: string | null, > country?: string | null, > short_description?: string | null, > seo_description?: string | null, > owned_by_organization_id?: string | null, > num_suborganizations?: number | null, > suborganizations?: { > id: string, > name?: string | null, > website_url?: string | null, > industries?: string[] | null, > estimated_num_employees?: number | null, > country?: string | null > }[] | null, > retail_location_count?: number | null, > num_retail_locations?: number | null, > num_languages?: number | null, > primary_phone?: { > number?: string | null, > sanitized_number?: string | null, > source?: string | null > } | null, > latest_funding_detected_at?: string | null, > account_id?: string | null > }[] > ``` > **accounts full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > website_url?: string | null, > blog_url?: string | null, > angellist_url?: string | null, > linkedin_url?: string | null, > linkedin_uid?: string | null, > twitter_url?: string | null, > facebook_url?: string | null, > crunchbase_url?: string | null, > logo_url?: string | null, > primary_domain?: string | null, > phone?: string | null, > sanitized_phone?: string | null, > languages?: string[] | null, > alexa_ranking?: number | null, > founded_year?: number | null, > publicly_traded_symbol?: string | null, > publicly_traded_exchange?: string | null, > industry?: string | null, > industries?: string[] | null, > secondary_industries?: string[] | null, > industry_tag_id?: string | null, > keywords?: string[] | null, > sic_codes?: string[] | null, > naics_codes?: string[] | null, > estimated_num_employees?: number | null, > organization_headcount_six_month_growth?: number | null, > organization_headcount_twelve_month_growth?: number | null, > organization_headcount_twenty_four_month_growth?: number | null, > departmental_head_count?: { > } | null, > annual_revenue?: number | null, > annual_revenue_printed?: string | null, > organization_revenue?: number | null, > organization_revenue_printed?: string | null, > total_funding?: number | null, > total_funding_printed?: string | null, > latest_funding_stage?: string | null, > latest_funding_round_date?: string | null, > funding_events?: { > id: string, > date?: string | null, > detected_at?: string | null, > news_url?: string | null, > type?: string | null, > investors?: string | null, > amount?: string | null, > currency?: string | null > }[] | null, > technology_names?: string[] | null, > current_technologies?: { > uid: string, > name: string, > category?: string | null > }[] | null, > raw_address?: string | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > postal_code?: string | null, > country?: string | null, > short_description?: string | null, > seo_description?: string | null, > owned_by_organization_id?: string | null, > num_suborganizations?: number | null, > suborganizations?: { > id: string, > name?: string | null, > website_url?: string | null, > industries?: string[] | null, > estimated_num_employees?: number | null, > country?: string | null > }[] | null, > retail_location_count?: number | null, > num_retail_locations?: number | null, > num_languages?: number | null, > primary_phone?: { > number?: string | null, > sanitized_number?: string | null, > source?: string | null > } | null, > latest_funding_detected_at?: string | null, > account_id?: string | null > }[] > ``` > **breadcrumbs full type** > > ```ts theme={null} > { > label: string, > signal_field_name: string, > value: string | number, > display_name: string > }[] > ``` *** ## People ### enrich `people.enrich` Enrich a person by name, email, LinkedIn URL, or Apollo id; optionally reveal personal emails and phones **Risk:** `read` ```ts theme={null} await corsair.apollo.api.people.enrich({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `hashed_email` | `string` | No | — | | `organization_name` | `string` | No | — | | `domain` | `string` | No | — | | `linkedin_url` | `string` | No | — | | `reveal_personal_emails` | `boolean` | No | — | | `reveal_phone_number` | `boolean` | No | — | | `run_waterfall_email` | `boolean` | No | — | | `run_waterfall_phone` | `boolean` | No | — | | `webhook_url` | `string` | No | — | | `poll_only` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `person` | `object` | No | — | | `request_id` | `number` | No | — | | `waterfall` | `object` | No | — | > **person full type** > > ```ts theme={null} > { > id: string, > first_name?: string | null, > last_name?: string | null, > name?: string | null, > title?: string | null, > headline?: string | null, > linkedin_url?: string | null, > twitter_url?: string | null, > github_url?: string | null, > facebook_url?: string | null, > photo_url?: string | null, > email?: string | null, > email_status?: string | null, > extrapolated_email_confidence?: number | null, > organization_id?: string | null, > organization?: { > id: string, > name?: string | null, > website_url?: string | null, > blog_url?: string | null, > angellist_url?: string | null, > linkedin_url?: string | null, > linkedin_uid?: string | null, > twitter_url?: string | null, > facebook_url?: string | null, > crunchbase_url?: string | null, > logo_url?: string | null, > primary_domain?: string | null, > phone?: string | null, > sanitized_phone?: string | null, > languages?: string[] | null, > alexa_ranking?: number | null, > founded_year?: number | null, > publicly_traded_symbol?: string | null, > publicly_traded_exchange?: string | null, > industry?: string | null, > industries?: string[] | null, > secondary_industries?: string[] | null, > industry_tag_id?: string | null, > keywords?: string[] | null, > sic_codes?: string[] | null, > naics_codes?: string[] | null, > estimated_num_employees?: number | null, > organization_headcount_six_month_growth?: number | null, > organization_headcount_twelve_month_growth?: number | null, > organization_headcount_twenty_four_month_growth?: number | null, > departmental_head_count?: { > } | null, > annual_revenue?: number | null, > annual_revenue_printed?: string | null, > organization_revenue?: number | null, > organization_revenue_printed?: string | null, > total_funding?: number | null, > total_funding_printed?: string | null, > latest_funding_stage?: string | null, > latest_funding_round_date?: string | null, > funding_events?: { > id: string, > date?: string | null, > detected_at?: string | null, > news_url?: string | null, > type?: string | null, > investors?: string | null, > amount?: string | null, > currency?: string | null > }[] | null, > technology_names?: string[] | null, > current_technologies?: { > uid: string, > name: string, > category?: string | null > }[] | null, > raw_address?: string | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > postal_code?: string | null, > country?: string | null, > short_description?: string | null, > seo_description?: string | null, > owned_by_organization_id?: string | null, > num_suborganizations?: number | null, > suborganizations?: { > id: string, > name?: string | null, > website_url?: string | null, > industries?: string[] | null, > estimated_num_employees?: number | null, > country?: string | null > }[] | null, > retail_location_count?: number | null, > num_retail_locations?: number | null, > num_languages?: number | null, > primary_phone?: { > number?: string | null, > sanitized_number?: string | null, > source?: string | null > } | null, > latest_funding_detected_at?: string | null, > account_id?: string | null > } | null, > employment_history?: { > id?: string | null, > organization_id?: string | null, > organization_name?: string | null, > title?: string | null, > current?: boolean | null, > start_date?: string | null, > end_date?: string | null, > description?: string | null > }[] | null, > match_confidence?: high | medium | low | none | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > country?: string | null, > postal_code?: string | null, > formatted_address?: string | null, > time_zone?: string | null, > seniority?: string | null, > departments?: string[] | null, > subdepartments?: string[] | null, > functions?: string[] | null, > contact_id?: string | null, > contact?: { > id: string, > email?: string | null, > email_status?: string | null, > sanitized_phone?: string | null, > direct_dial_status?: string | null, > phone_numbers?: { > raw_number?: string | null, > sanitized_number?: string | null, > type?: string | null, > position?: number | null, > status?: string | null, > dnc_status?: string | null > }[] | null > } | null, > revealed_for_current_team?: boolean | null, > is_likely_to_engage?: boolean | null > } > ``` > **waterfall full type** > > ```ts theme={null} > { > status: string, > message?: string | null > } > ``` *** ### get `people.get` Get complete person info by Apollo id **Risk:** `read` ```ts theme={null} await corsair.apollo.api.people.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `person` | `object` | Yes | — | > **person full type** > > ```ts theme={null} > { > id: string, > first_name?: string | null, > last_name?: string | null, > name?: string | null, > title?: string | null, > headline?: string | null, > linkedin_url?: string | null, > twitter_url?: string | null, > github_url?: string | null, > facebook_url?: string | null, > photo_url?: string | null, > email?: string | null, > email_status?: string | null, > extrapolated_email_confidence?: number | null, > organization_id?: string | null, > organization?: { > id: string, > name?: string | null, > website_url?: string | null, > blog_url?: string | null, > angellist_url?: string | null, > linkedin_url?: string | null, > linkedin_uid?: string | null, > twitter_url?: string | null, > facebook_url?: string | null, > crunchbase_url?: string | null, > logo_url?: string | null, > primary_domain?: string | null, > phone?: string | null, > sanitized_phone?: string | null, > languages?: string[] | null, > alexa_ranking?: number | null, > founded_year?: number | null, > publicly_traded_symbol?: string | null, > publicly_traded_exchange?: string | null, > industry?: string | null, > industries?: string[] | null, > secondary_industries?: string[] | null, > industry_tag_id?: string | null, > keywords?: string[] | null, > sic_codes?: string[] | null, > naics_codes?: string[] | null, > estimated_num_employees?: number | null, > organization_headcount_six_month_growth?: number | null, > organization_headcount_twelve_month_growth?: number | null, > organization_headcount_twenty_four_month_growth?: number | null, > departmental_head_count?: { > } | null, > annual_revenue?: number | null, > annual_revenue_printed?: string | null, > organization_revenue?: number | null, > organization_revenue_printed?: string | null, > total_funding?: number | null, > total_funding_printed?: string | null, > latest_funding_stage?: string | null, > latest_funding_round_date?: string | null, > funding_events?: { > id: string, > date?: string | null, > detected_at?: string | null, > news_url?: string | null, > type?: string | null, > investors?: string | null, > amount?: string | null, > currency?: string | null > }[] | null, > technology_names?: string[] | null, > current_technologies?: { > uid: string, > name: string, > category?: string | null > }[] | null, > raw_address?: string | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > postal_code?: string | null, > country?: string | null, > short_description?: string | null, > seo_description?: string | null, > owned_by_organization_id?: string | null, > num_suborganizations?: number | null, > suborganizations?: { > id: string, > name?: string | null, > website_url?: string | null, > industries?: string[] | null, > estimated_num_employees?: number | null, > country?: string | null > }[] | null, > retail_location_count?: number | null, > num_retail_locations?: number | null, > num_languages?: number | null, > primary_phone?: { > number?: string | null, > sanitized_number?: string | null, > source?: string | null > } | null, > latest_funding_detected_at?: string | null, > account_id?: string | null > } | null, > employment_history?: { > id?: string | null, > organization_id?: string | null, > organization_name?: string | null, > title?: string | null, > current?: boolean | null, > start_date?: string | null, > end_date?: string | null, > description?: string | null > }[] | null, > match_confidence?: high | medium | low | none | null, > street_address?: string | null, > city?: string | null, > state?: string | null, > country?: string | null, > postal_code?: string | null, > formatted_address?: string | null, > time_zone?: string | null, > seniority?: string | null, > departments?: string[] | null, > subdepartments?: string[] | null, > functions?: string[] | null, > contact_id?: string | null, > contact?: { > id: string, > email?: string | null, > email_status?: string | null, > sanitized_phone?: string | null, > direct_dial_status?: string | null, > phone_numbers?: { > raw_number?: string | null, > sanitized_number?: string | null, > type?: string | null, > position?: number | null, > status?: string | null, > dnc_status?: string | null > }[] | null > } | null, > revealed_for_current_team?: boolean | null, > is_likely_to_engage?: boolean | null > } > ``` *** ### search `people.search` Search net-new people by title, seniority, location, and employer filters (redacted profiles, no credits) **Risk:** `read` ```ts theme={null} await corsair.apollo.api.people.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `person_titles` | `string[]` | No | — | | `include_similar_titles` | `boolean` | No | — | | `person_not_titles` | `string[]` | No | — | | `person_not_past_titles` | `string[]` | No | — | | `q_keywords` | `string` | No | — | | `q_person_name` | `string` | No | — | | `person_locations` | `string[]` | No | — | | `person_not_locations` | `string[]` | No | — | | `person_seniorities` | `string[]` | No | — | | `contact_email_status` | `verified \| unverified \| likely to engage \| unavailable[]` | No | — | | `currently_using_all_of_technology_uids` | `string[]` | No | — | | `currently_not_using_any_of_technology_uids` | `string[]` | No | — | | `organization_locations` | `string[]` | No | — | | `organization_not_locations` | `string[]` | No | — | | `organization_industry_tag_ids` | `string[]` | No | — | | `organization_not_industry_tag_ids` | `string[]` | No | — | | `organization_industries` | `string[]` | No | — | | `organization_naics_codes` | `string[]` | No | — | | `not_organization_naics_codes` | `string[]` | No | — | | `organization_sic_codes` | `string[]` | No | — | | `not_organization_sic_codes` | `string[]` | No | — | | `organization_ids` | `string[]` | No | — | | `organization_num_employees_ranges` | `string[]` | No | — | | `revenue_range` | `object` | No | — | | `currently_using_any_of_technology_uids` | `string[]` | No | — | | `q_organization_job_titles` | `string[]` | No | — | | `organization_job_locations` | `string[]` | No | — | | `organization_num_jobs_range` | `object` | No | — | | `organization_job_posted_at_range` | `object` | No | — | | `organization_headcount_growth_past_n_months` | `6 \| 12 \| 24` | No | — | | `organization_headcount_growth_range` | `object` | No | — | | `lookalike_organization_ids` | `string[]` | No | — | | `not_organization_websites_list` | `string[]` | No | — | | `q_organization_domains_list` | `string[]` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | > **revenue\_range full type** > > ```ts theme={null} > { > min?: number, > max?: number > } > ``` > **organization\_num\_jobs\_range full type** > > ```ts theme={null} > { > min?: number, > max?: number > } > ``` > **organization\_job\_posted\_at\_range full type** > > ```ts theme={null} > { > min?: string, > max?: string > } > ``` > **organization\_headcount\_growth\_range full type** > > ```ts theme={null} > { > min?: number, > max?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_entries` | `number` | Yes | — | | `people` | `object[]` | Yes | — | > **people full type** > > ```ts theme={null} > { > id: string, > first_name?: string | null, > last_name_obfuscated?: string | null, > title?: string | null, > last_refreshed_at?: string | null, > has_email?: boolean | null, > has_city?: boolean | null, > has_state?: boolean | null, > has_country?: boolean | null, > has_direct_phone?: string | boolean | null, > organization?: { > name?: string | null, > has_industry?: boolean | null, > has_phone?: boolean | null, > has_city?: boolean | null, > has_state?: boolean | null, > has_country?: boolean | null, > has_zip_code?: boolean | null, > has_revenue?: boolean | null, > has_employee_count?: boolean | null > } | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/apollo/database Apollo local sync: searchable entities, `.search()` filters, and operators. The Apollo plugin syncs data locally. Use `corsair.apollo.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## News Articles Path: `apollo.db.newsArticles.search` ```ts theme={null} const rows = await corsair.apollo.db.newsArticles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `publishedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `apollo.db.organizations.search` ```ts theme={null} const rows = await corsair.apollo.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `primaryDomain` | `string` | equals, contains, startsWith, endsWith, in | | `websiteUrl` | `string` | equals, contains, startsWith, endsWith, in | | `linkedinUrl` | `string` | equals, contains, startsWith, endsWith, in | | `industry` | `string` | equals, contains, startsWith, endsWith, in | | `estimatedNumEmployees` | `number` | equals, gt, gte, lt, lte, in | | `foundedYear` | `number` | equals, gt, gte, lt, lte, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## People Path: `apollo.db.people.search` ```ts theme={null} const rows = await corsair.apollo.db.people.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `linkedinUrl` | `string` | equals, contains, startsWith, endsWith, in | | `organizationId` | `string` | equals, contains, startsWith, endsWith, in | | `seniority` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/apollo/overview Apollo plugin for Corsair Use **Apollo** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 8 typed API operations * 3 synced entities (`newsArticles`, `organizations`, `people`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/apollo ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/apollo ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/apollo ``` ```bash bun theme={null} bun add corsair @corsair-dev/apollo ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { apollo } from '@corsair-dev/apollo'; export const corsair = createCorsair({ plugins: [ apollo(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} apollo() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'apollo', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`news.search`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.apollo.api.news.search({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/apollo/api) reference.* See the full list on the [API](/plugins/apollo/api) page. ## Query synced data Synced entities support `tenant.apollo.db..search()` and `.list()`: `newsArticles`, `organizations`, `people`. See [Database](/plugins/apollo/database) for filters and operators. ## What's next > **[API reference](/plugins/apollo/api)** > > Every `apollo.api.*` operation with input and output types. > **[Database](/plugins/apollo/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/appointo/api API reference for Appointo: every `appointo.api.*` operation with input and output types. Every `appointo.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Appointments ### getAvailability `appointments.getAvailability` Get calendar availability for an appointment **Risk:** `read` ```ts theme={null} await corsair.appointo.api.appointments.getAvailability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `appointment_id` | `number` | Yes | — | | `start_date` | `string` | Yes | — | | `end_date` | `string` | No | — | | `impersonated_tms` | `number[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: number, > weekday?: string, > weekday_index?: number, > slots?: { > start_time: string, > end_time: string, > surge?: boolean, > price?: string, > max_capacity?: number > }[], > shop_id?: number, > appointment_id?: number, > day_available?: boolean, > max_capacity?: number | null > }[] > ``` *** ### list `appointments.list` List all appointments **Risk:** `read` ```ts theme={null} await corsair.appointo.api.appointments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `appointment_id` | `number` | No | — | | `product_id` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `search_term` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > activate?: boolean | null, > product_uuid?: string, > calendly_event_uuid?: string | null, > duration_uuid?: string, > shop_id?: number, > product_detail_id?: number, > name?: string, > is_combo_service?: boolean, > price?: string, > currency?: string, > description?: string | null, > archived?: boolean > }[] > ``` *** ### upsertConfig `appointments.upsertConfig` Update appointment configuration **Risk:** `write` ```ts theme={null} await corsair.appointo.api.appointments.upsertConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `appointment_id` | `number` | Yes | — | | `config` | `object` | No | — | | `availabilities` | `object[]` | No | — | | `override` | `object[]` | No | — | > **config full type** > > ```ts theme={null} > { > timezone?: string, > duration?: string, > minimum_notice?: string, > max_capacity?: string, > meeting_detail?: string, > note?: string, > interval?: string, > reminder_duration?: string, > send_reminder?: boolean, > whatsapp_duration?: string, > send_whatsapp_reminder?: boolean, > enable_max_events_per_day?: boolean, > max_events_per_day?: number, > start_buffer_time?: string, > end_buffer_time?: string, > location_type?: string, > location_value?: string, > allow_cancel?: boolean, > allow_reschedule?: boolean, > reschedule_duration?: number, > cancel_duration?: number, > date_range_type?: string, > tm_assign_rule?: string, > days_in_future?: string, > start_date_range?: string, > end_date_range?: string, > is_combo_service?: boolean, > send_text_reminder?: boolean, > text_duration?: string, > min_day_duration?: string, > max_day_duration?: string, > fixed_multi_day_price?: boolean, > rem_group_slot_after_booking?: boolean, > start_month?: string, > color?: string, > allow_waitlist?: boolean, > email_label?: string, > name_label?: string, > phone_label?: string, > show_phone?: boolean > } > ``` > **availabilities full type** > > ```ts theme={null} > { > id?: number, > weekday?: string, > weekday_index?: number, > slots?: { > start_time: string, > end_time: string, > surge?: boolean, > price?: string, > max_capacity?: number > }[], > shop_id?: number, > appointment_id?: number, > day_available?: boolean, > max_capacity?: number | null > }[] > ``` > **override full type** > > ```ts theme={null} > { > id?: number, > day: string, > slots?: { > start_time: string, > end_time: string, > surge?: boolean, > price?: string, > max_capacity?: number > }[], > shop_id?: number, > appointment_id?: number, > day_available?: boolean > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > activate?: boolean | null, > product_uuid?: string, > calendly_event_uuid?: string | null, > duration_uuid?: string, > shop_id?: number, > product_detail_id?: number, > name?: string, > is_combo_service?: boolean, > price?: string, > currency?: string, > description?: string | null, > archived?: boolean > }[] > ``` *** ## Bookings ### cancel `bookings.cancel` Cancel a booking **Risk:** `destructive` ```ts theme={null} await corsair.appointo.api.bookings.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `booking_id` | `number` | Yes | — | | `customer_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > status: string, > booking?: { > id: number, > selected_time?: string, > timestring?: string, > shop_id?: number, > appointment_id?: number, > created_at?: string, > updated_at?: string, > customers_count?: number, > duration?: number, > product_name?: string, > variant_name?: string, > order_uuid?: string, > price?: string, > order_name?: string, > currency?: string, > meeting_detail?: string, > note?: string, > google_meta?: { > }, > google_event_id?: string, > location_value?: string | null, > location_type?: string | null, > location_meta?: { > } | null, > quantity?: number, > team_member_id?: number | null, > scenario?: string, > day_duration?: number, > end_date?: string, > start_date?: string, > group_id?: number | null, > start_buffer_time?: number, > end_buffer_time?: number, > category?: string | null, > archived?: boolean, > notes_count?: number, > customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > archived_customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > appointment?: { > id: number, > activate?: boolean | null, > product_uuid?: string, > duration_uuid?: string, > shop_id?: number, > product_detail_id?: number, > name?: string, > is_combo_service?: boolean, > price?: string, > currency?: string, > description?: string | null, > archived?: boolean > } > } > } > ``` *** ### create `bookings.create` Create a new booking **Risk:** `write` ```ts theme={null} await corsair.appointo.api.bookings.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `appointment_id` | `number` | Yes | — | | `timestring` | `string` | Yes | — | | `email` | `string` | Yes | — | | `name` | `string` | Yes | — | | `quantity` | `number` | No | — | | `phone` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > selected_time?: string, > timestring?: string, > shop_id?: number, > appointment_id?: number, > created_at?: string, > updated_at?: string, > customers_count?: number, > duration?: number, > product_name?: string, > variant_name?: string, > order_uuid?: string, > price?: string, > order_name?: string, > currency?: string, > meeting_detail?: string, > note?: string, > google_meta?: { > }, > google_event_id?: string, > location_value?: string | null, > location_type?: string | null, > location_meta?: { > } | null, > quantity?: number, > team_member_id?: number | null, > scenario?: string, > day_duration?: number, > end_date?: string, > start_date?: string, > group_id?: number | null, > start_buffer_time?: number, > end_buffer_time?: number, > category?: string | null, > archived?: boolean, > notes_count?: number, > customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > archived_customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > appointment?: { > id: number, > activate?: boolean | null, > product_uuid?: string, > duration_uuid?: string, > shop_id?: number, > product_detail_id?: number, > name?: string, > is_combo_service?: boolean, > price?: string, > currency?: string, > description?: string | null, > archived?: boolean > } > }[] > ``` *** ### list `bookings.list` List all bookings **Risk:** `read` ```ts theme={null} await corsair.appointo.api.bookings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `status` | `past \| upcoming` | No | — | | `booking_id` | `number` | No | — | | `search_term` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > selected_time?: string, > timestring?: string, > shop_id?: number, > appointment_id?: number, > created_at?: string, > updated_at?: string, > customers_count?: number, > duration?: number, > product_name?: string, > variant_name?: string, > order_uuid?: string, > price?: string, > order_name?: string, > currency?: string, > meeting_detail?: string, > note?: string, > google_meta?: { > }, > google_event_id?: string, > location_value?: string | null, > location_type?: string | null, > location_meta?: { > } | null, > quantity?: number, > team_member_id?: number | null, > scenario?: string, > day_duration?: number, > end_date?: string, > start_date?: string, > group_id?: number | null, > start_buffer_time?: number, > end_buffer_time?: number, > category?: string | null, > archived?: boolean, > notes_count?: number, > customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > archived_customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > appointment?: { > id: number, > activate?: boolean | null, > product_uuid?: string, > duration_uuid?: string, > shop_id?: number, > product_detail_id?: number, > name?: string, > is_combo_service?: boolean, > price?: string, > currency?: string, > description?: string | null, > archived?: boolean > } > }[] > ``` *** ### reschedule `bookings.reschedule` Reschedule an existing booking **Risk:** `write` ```ts theme={null} await corsair.appointo.api.bookings.reschedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `booking_id` | `number` | Yes | — | | `timestring` | `string` | Yes | — | | `customer_ids` | `number[]` | No | — | | `override` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > status: string, > booking?: { > id: number, > selected_time?: string, > timestring?: string, > shop_id?: number, > appointment_id?: number, > created_at?: string, > updated_at?: string, > customers_count?: number, > duration?: number, > product_name?: string, > variant_name?: string, > order_uuid?: string, > price?: string, > order_name?: string, > currency?: string, > meeting_detail?: string, > note?: string, > google_meta?: { > }, > google_event_id?: string, > location_value?: string | null, > location_type?: string | null, > location_meta?: { > } | null, > quantity?: number, > team_member_id?: number | null, > scenario?: string, > day_duration?: number, > end_date?: string, > start_date?: string, > group_id?: number | null, > start_buffer_time?: number, > end_buffer_time?: number, > category?: string | null, > archived?: boolean, > notes_count?: number, > customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > archived_customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > appointment?: { > id: number, > activate?: boolean | null, > product_uuid?: string, > duration_uuid?: string, > shop_id?: number, > product_detail_id?: number, > name?: string, > is_combo_service?: boolean, > price?: string, > currency?: string, > description?: string | null, > archived?: boolean > } > } > } > ``` *** ### update `bookings.update` Update a booking (buffer updates) **Risk:** `write` ```ts theme={null} await corsair.appointo.api.bookings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `booking_id` | `number` | Yes | — | | `start_buffer_time` | `number` | No | — | | `end_buffer_time` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > status: string, > booking?: { > id: number, > selected_time?: string, > timestring?: string, > shop_id?: number, > appointment_id?: number, > created_at?: string, > updated_at?: string, > customers_count?: number, > duration?: number, > product_name?: string, > variant_name?: string, > order_uuid?: string, > price?: string, > order_name?: string, > currency?: string, > meeting_detail?: string, > note?: string, > google_meta?: { > }, > google_event_id?: string, > location_value?: string | null, > location_type?: string | null, > location_meta?: { > } | null, > quantity?: number, > team_member_id?: number | null, > scenario?: string, > day_duration?: number, > end_date?: string, > start_date?: string, > group_id?: number | null, > start_buffer_time?: number, > end_buffer_time?: number, > category?: string | null, > archived?: boolean, > notes_count?: number, > customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > archived_customers?: { > id: number, > email?: string, > payload?: { > phone?: string > }, > name?: string, > shop_id?: number, > appointment_id?: number, > booking_id?: number, > created_at?: string, > updated_at?: string, > customer_uuid?: string, > reschedule_uuid?: string | null, > cancel_uuid?: string | null, > order_name?: string, > order_uuid?: string | null, > shipping_address?: { > id?: number, > customer_id?: number, > first_name?: string | null, > last_name?: string | null, > company?: string | null, > address1?: string | null, > address2?: string | null, > city?: string | null, > province?: string | null, > country?: string | null, > zip?: string | null, > phone?: string | null, > name?: string | null, > province_code?: string | null, > country_code?: string | null, > country_name?: string | null, > default?: boolean > }, > override?: boolean, > signpanda_cust_uuid?: string | null, > parent_customer_id?: number | null, > is_active_sub?: boolean, > sub_interval?: string | null, > sub_booking_count?: number | null, > sub_booking_num?: number | null, > sub_recurring_type?: string | null, > customer_type?: string | null, > customer_timezone?: string | null, > archived?: boolean, > subscription_contract_id?: string | number | null, > selling_plan_id?: string | number | null, > checkin?: boolean, > checkin_qr_code?: string | null, > image_data?: string | null > }[], > appointment?: { > id: number, > activate?: boolean | null, > product_uuid?: string, > duration_uuid?: string, > shop_id?: number, > product_detail_id?: number, > name?: string, > is_combo_service?: boolean, > price?: string, > currency?: string, > description?: string | null, > archived?: boolean > } > } > } > ``` *** ## Products ### list `products.list` List all products **Risk:** `read` ```ts theme={null} await corsair.appointo.api.products.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `search_term` | `string` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > activate?: boolean, > product_uuid?: string, > shop_id?: number, > created_at?: string, > updated_at?: string, > product_name?: string, > show_widget?: boolean, > appointment_type?: string, > vendor_name?: string, > include_variant_booking?: boolean, > book_without_pay?: boolean, > image_url?: string | null, > variants_count?: number, > appointments?: { > id: number, > activate?: boolean | null, > product_uuid?: string, > calendly_event_uuid?: string | null, > duration_uuid?: string, > shop_id?: number, > product_detail_id?: number, > name?: string, > is_combo_service?: boolean, > price?: string, > currency?: string, > description?: string | null, > archived?: boolean > }[] > }[] > ``` *** ## Subscriptions ### list `subscriptions.list` List all appointment subscriptions **Risk:** `read` ```ts theme={null} await corsair.appointo.api.subscriptions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_term` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: number > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/appointo/database Appointo local sync: searchable entities, `.search()` filters, and operators. The Appointo plugin syncs data locally. Use `corsair.appointo.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/appointo/overview Appointo plugin for Corsair Use **Appointo** through Corsair: one client, typed API calls. **What you get:** * 10 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/appointo ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/appointo ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/appointo ``` ```bash bun theme={null} bun add corsair @corsair-dev/appointo ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { appointo } from '@corsair-dev/appointo'; export const corsair = createCorsair({ plugins: [ appointo(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} appointo() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'appointo', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`appointments.getAvailability`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.appointo.api.appointments.getAvailability({}); ``` **`appointments.upsertConfig`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.appointo.api.appointments.upsertConfig({}); ``` See the full list on the [API](/plugins/appointo/api) page. ## What's next > **[API reference](/plugins/appointo/api)** > > Every `appointo.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/aryn/api API reference for Aryn: every `aryn.api.*` operation with input and output types. Every `aryn.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Async Tasks ### list `asyncTasks.list` List async partitioning tasks **Risk:** `read` ```ts theme={null} await corsair.aryn.api.asyncTasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path_filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tasks` | `object` | Yes | — | > **tasks full type** > > ```ts theme={null} > { > } > ``` *** ## Docset ### create `docset.create` Create a new DocSet **Risk:** `write` ```ts theme={null} await corsair.aryn.api.docset.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `schema` | `any` | No | — | | `properties` | `object` | No | — | | `prompts` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **prompts full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `docset_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `readonly` | `boolean` | Yes | — | | `properties` | `object` | No | — | | `schema` | `any` | No | — | | `size` | `number` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### delete `docset.delete` Delete a DocSet **Risk:** `destructive` ```ts theme={null} await corsair.aryn.api.docset.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docset_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `docset_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `readonly` | `boolean` | Yes | — | | `properties` | `object` | No | — | | `schema` | `any` | No | — | | `size` | `number` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### get `docset.get` Get DocSet metadata **Risk:** `read` ```ts theme={null} await corsair.aryn.api.docset.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docset_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `docset_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `readonly` | `boolean` | Yes | — | | `properties` | `object` | No | — | | `schema` | `any` | No | — | | `size` | `number` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` *** ## Document ### get `document.get` Get a document by ID **Risk:** `read` ```ts theme={null} await corsair.aryn.api.document.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docset_id` | `string` | Yes | — | | `doc_id` | `string` | Yes | — | | `include_elements` | `boolean` | No | — | | `include_binary` | `boolean` | No | — | | `include_original_elements` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `elements` | `object[]` | No | — | | `properties` | `object` | No | — | | `binary_data` | `string` | No | — | > **elements full type** > > ```ts theme={null} > { > type?: string, > bbox?: number[], > properties?: { > score?: number, > page_number?: number > } | null, > text_representation?: string | null, > binary_representation?: any > }[] > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### getBinary `document.getBinary` Download document binary content **Risk:** `read` ```ts theme={null} await corsair.aryn.api.document.getBinary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docset_id` | `string` | Yes | — | | `doc_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `docset_id` | `string` | Yes | — | | `doc_id` | `string` | Yes | — | | `contentBase64` | `string` | Yes | — | *** ### partition `document.partition` Partition document using Aryn DocParse **Risk:** `write` ```ts theme={null} await corsair.aryn.api.document.partition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom` | No | — | | `file_url` | `string` | No | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > threshold?: number | auto, > text_mode?: string, > table_mode?: string, > extract_images?: boolean, > extract_image_format?: string, > selected_pages?: ( > number | number[] > )[], > strategy?: string, > max_tokens?: number, > tokenizer?: string, > merge_across_pages?: boolean, > promote_title?: boolean, > title_candidate_elements?: string[], > orientation_correction?: boolean, > include_pagenum?: boolean, > include_headers?: boolean, > include_footers?: boolean, > pipeline?: string, > add_to_docset_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string[]` | Yes | — | | `status_code` | `number` | No | — | | `error` | `string` | No | — | | `elements` | `object[]` | No | — | | `markdown` | `string` | No | — | > **elements full type** > > ```ts theme={null} > { > type?: string, > bbox?: number[], > properties?: { > score?: number, > page_number?: number > } | null, > text_representation?: string | null, > binary_representation?: any > }[] > ``` *** ### submitAsyncAdd `document.submitAsyncAdd` Submit document asynchronously to a DocSet **Risk:** `write` ```ts theme={null} await corsair.aryn.api.document.submitAsyncAdd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docset_id` | `string` | Yes | — | | `file` | `custom` | No | — | | `file_url` | `string` | No | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > threshold?: number | auto, > text_mode?: string, > table_mode?: string, > extract_images?: boolean, > extract_image_format?: string, > selected_pages?: ( > number | number[] > )[], > strategy?: string, > max_tokens?: number, > tokenizer?: string, > merge_across_pages?: boolean, > promote_title?: boolean, > title_candidate_elements?: string[], > orientation_correction?: boolean, > include_pagenum?: boolean, > include_headers?: boolean, > include_footers?: boolean, > pipeline?: string, > add_to_docset_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | *** ## Query ### generatePlan `query.generatePlan` Generate query plan **Risk:** `read` ```ts theme={null} await corsair.aryn.api.query.generatePlan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `docset_id` | `string` | No | — | | `summarize_result` | `boolean` | No | — | | `stream` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `nodes` | `object` | Yes | — | | `result_node` | `number` | Yes | — | | `llm_prompt` | `any` | No | — | | `llm_plan` | `string` | No | — | > **nodes full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/aryn/database Aryn local sync: searchable entities, `.search()` filters, and operators. The Aryn plugin syncs data locally. Use `corsair.aryn.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/aryn/overview Aryn plugin for Corsair Use **Aryn** through Corsair: one client, typed API calls. **What you get:** * 9 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/aryn ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/aryn ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/aryn ``` ```bash bun theme={null} bun add corsair @corsair-dev/aryn ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { aryn } from '@corsair-dev/aryn'; export const corsair = createCorsair({ plugins: [ aryn(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} aryn() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'aryn', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`asyncTasks.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.aryn.api.asyncTasks.list({}); ``` **`docset.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.aryn.api.docset.create({}); ``` See the full list on the [API](/plugins/aryn/api) page. ## What's next > **[API reference](/plugins/aryn/api)** > > Every `aryn.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/asana/api API reference for Asana: every `asana.api.*` operation with input and output types. Every `asana.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Projects ### addFollowers `projects.addFollowers` Add followers to a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.projects.addFollowers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `followers` | `string[]` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > followers?: { > gid: string, > name?: string, > resource_type?: string > }[] > } > ``` *** ### addMembers `projects.addMembers` Add members to a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.projects.addMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `members` | `string[]` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > members?: { > gid: string, > name?: string, > resource_type?: string > }[] > } > ``` *** ### create `projects.create` Create a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > team?: string, > workspace?: string, > notes?: string, > html_notes?: string, > color?: string, > due_on?: string, > start_on?: string, > archived?: boolean, > followers?: string[], > owner?: string, > public?: boolean, > default_view?: string, > privacy_setting?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > color?: string | null, > archived?: boolean, > completed?: boolean, > due_on?: string | null, > start_on?: string | null, > owner?: { > gid: string, > name?: string, > resource_type?: string > } | null, > team?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > members?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > public?: boolean, > resource_type?: string, > created_at?: string, > modified_at?: string, > permalink_url?: string, > default_view?: string, > privacy_setting?: string, > icon?: string | null, > custom_fields?: { > }[] > } > ``` *** ### createForTeam `projects.createForTeam` Create a project for a team **Risk:** `write` ```ts theme={null} await corsair.asana.api.projects.createForTeam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > notes?: string, > color?: string, > due_on?: string, > start_on?: string, > archived?: boolean, > followers?: string[], > owner?: string, > public?: boolean, > default_view?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > color?: string | null, > archived?: boolean, > completed?: boolean, > due_on?: string | null, > start_on?: string | null, > owner?: { > gid: string, > name?: string, > resource_type?: string > } | null, > team?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > members?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > public?: boolean, > resource_type?: string, > created_at?: string, > modified_at?: string, > permalink_url?: string, > default_view?: string, > privacy_setting?: string, > icon?: string | null, > custom_fields?: { > }[] > } > ``` *** ### createForWorkspace `projects.createForWorkspace` Create a project for a workspace **Risk:** `write` ```ts theme={null} await corsair.asana.api.projects.createForWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > team?: string, > notes?: string, > color?: string, > due_on?: string, > start_on?: string, > archived?: boolean, > followers?: string[], > owner?: string, > public?: boolean, > default_view?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > color?: string | null, > archived?: boolean, > completed?: boolean, > due_on?: string | null, > start_on?: string | null, > owner?: { > gid: string, > name?: string, > resource_type?: string > } | null, > team?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > members?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > public?: boolean, > resource_type?: string, > created_at?: string, > modified_at?: string, > permalink_url?: string, > default_view?: string, > privacy_setting?: string, > icon?: string | null, > custom_fields?: { > }[] > } > ``` *** ### delete `projects.delete` Delete a project **Risk:** `destructive` ```ts theme={null} await corsair.asana.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### duplicate `projects.duplicate` Duplicate a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.projects.duplicate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name: string, > team?: string, > include?: string, > schedule_dates?: { > should_skip_weekends: boolean, > due_on?: string, > start_on?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > status?: string, > new_project?: { > gid: string, > name?: string, > resource_type?: string > }, > new_task?: { > gid: string, > name?: string, > resource_type?: string > } > } > ``` *** ### get `projects.get` Get a project by GID **Risk:** `read` ```ts theme={null} await corsair.asana.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > color?: string | null, > archived?: boolean, > completed?: boolean, > due_on?: string | null, > start_on?: string | null, > owner?: { > gid: string, > name?: string, > resource_type?: string > } | null, > team?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > members?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > public?: boolean, > resource_type?: string, > created_at?: string, > modified_at?: string, > permalink_url?: string, > default_view?: string, > privacy_setting?: string, > icon?: string | null, > custom_fields?: { > }[] > } > ``` *** ### getTaskCounts `projects.getTaskCounts` Get task counts for a project **Risk:** `read` ```ts theme={null} await corsair.asana.api.projects.getTaskCounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > num_tasks?: number, > num_completed_tasks?: number, > num_incomplete_tasks?: number, > num_milestones?: number, > num_completed_milestones?: number, > num_incomplete_milestones?: number > } > ``` *** ### getTasks `projects.getTasks` Get tasks in a project **Risk:** `read` ```ts theme={null} await corsair.asana.api.projects.getTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `completed_since` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### list `projects.list` List projects **Risk:** `read` ```ts theme={null} await corsair.asana.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | No | — | | `team` | `string` | No | — | | `archived` | `boolean` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > color?: string | null, > archived?: boolean, > completed?: boolean, > due_on?: string | null, > start_on?: string | null, > owner?: { > gid: string, > name?: string, > resource_type?: string > } | null, > team?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > members?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > public?: boolean, > resource_type?: string, > created_at?: string, > modified_at?: string, > permalink_url?: string, > default_view?: string, > privacy_setting?: string, > icon?: string | null, > custom_fields?: { > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### listForWorkspace `projects.listForWorkspace` List projects in a workspace **Risk:** `read` ```ts theme={null} await corsair.asana.api.projects.listForWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `archived` | `boolean` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > color?: string | null, > archived?: boolean, > completed?: boolean, > due_on?: string | null, > start_on?: string | null, > owner?: { > gid: string, > name?: string, > resource_type?: string > } | null, > team?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > members?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > public?: boolean, > resource_type?: string, > created_at?: string, > modified_at?: string, > permalink_url?: string, > default_view?: string, > privacy_setting?: string, > icon?: string | null, > custom_fields?: { > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### removeFollowers `projects.removeFollowers` Remove followers from a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.projects.removeFollowers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `followers` | `string[]` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string > } > ``` *** ### removeMembers `projects.removeMembers` Remove members from a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.projects.removeMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `members` | `string[]` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string > } > ``` *** ### update `projects.update` Update a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > notes?: string, > html_notes?: string, > color?: string, > due_on?: string, > start_on?: string, > archived?: boolean, > owner?: string, > public?: boolean, > default_view?: string, > privacy_setting?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > color?: string | null, > archived?: boolean, > completed?: boolean, > due_on?: string | null, > start_on?: string | null, > owner?: { > gid: string, > name?: string, > resource_type?: string > } | null, > team?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > members?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > public?: boolean, > resource_type?: string, > created_at?: string, > modified_at?: string, > permalink_url?: string, > default_view?: string, > privacy_setting?: string, > icon?: string | null, > custom_fields?: { > }[] > } > ``` *** ## Sections ### create `sections.create` Create a section in a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.sections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name: string, > insert_before?: string, > insert_after?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string, > created_at?: string, > project?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[] > } > ``` *** ### delete `sections.delete` Delete a section **Risk:** `destructive` ```ts theme={null} await corsair.asana.api.sections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `section_gid` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### get `sections.get` Get a section by GID **Risk:** `read` ```ts theme={null} await corsair.asana.api.sections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `section_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string, > created_at?: string, > project?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[] > } > ``` *** ### insert `sections.insert` Insert a section at a specific position **Risk:** `write` ```ts theme={null} await corsair.asana.api.sections.insert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > section: string, > before_section?: string, > after_section?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### list `sections.list` List sections in a project **Risk:** `read` ```ts theme={null} await corsair.asana.api.sections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string, > created_at?: string, > project?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### update `sections.update` Update a section **Risk:** `write` ```ts theme={null} await corsair.asana.api.sections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `section_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string, > created_at?: string, > project?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[] > } > ``` *** ## Stories ### createComment `stories.createComment` Create a comment on a task **Risk:** `write` ```ts theme={null} await corsair.asana.api.stories.createComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > text?: string, > html_text?: string, > is_pinned?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > text?: string, > html_text?: string, > type?: string, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > created_by?: { > gid: string, > name?: string, > resource_type?: string > } | null, > liked?: boolean, > num_likes?: number, > is_edited?: boolean, > is_pinned?: boolean, > target?: { > gid: string, > name?: string > } | null > } > ``` *** ### delete `stories.delete` Delete a story **Risk:** `destructive` ```ts theme={null} await corsair.asana.api.stories.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `story_gid` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### get `stories.get` Get a story by GID **Risk:** `read` ```ts theme={null} await corsair.asana.api.stories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `story_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > text?: string, > html_text?: string, > type?: string, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > created_by?: { > gid: string, > name?: string, > resource_type?: string > } | null, > liked?: boolean, > num_likes?: number, > is_edited?: boolean, > is_pinned?: boolean, > target?: { > gid: string, > name?: string > } | null > } > ``` *** ### listForTask `stories.listForTask` List stories for a task **Risk:** `read` ```ts theme={null} await corsair.asana.api.stories.listForTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > text?: string, > html_text?: string, > type?: string, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > created_by?: { > gid: string, > name?: string, > resource_type?: string > } | null, > liked?: boolean, > num_likes?: number, > is_edited?: boolean, > is_pinned?: boolean, > target?: { > gid: string, > name?: string > } | null > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### update `stories.update` Update a story **Risk:** `write` ```ts theme={null} await corsair.asana.api.stories.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `story_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > text?: string, > html_text?: string, > is_pinned?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > text?: string, > html_text?: string, > type?: string, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > created_by?: { > gid: string, > name?: string, > resource_type?: string > } | null, > liked?: boolean, > num_likes?: number, > is_edited?: boolean, > is_pinned?: boolean, > target?: { > gid: string, > name?: string > } | null > } > ``` *** ## Tags ### create `tags.create` Create a tag **Risk:** `write` ```ts theme={null} await corsair.asana.api.tags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name: string, > color?: string, > notes?: string, > workspace?: string, > followers?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > color?: string | null, > notes?: string, > resource_type?: string, > created_at?: string, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > permalink_url?: string > } > ``` *** ### createInWorkspace `tags.createInWorkspace` Create a tag in a workspace **Risk:** `write` ```ts theme={null} await corsair.asana.api.tags.createInWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name: string, > color?: string, > notes?: string, > followers?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > color?: string | null, > notes?: string, > resource_type?: string, > created_at?: string, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > permalink_url?: string > } > ``` *** ### delete `tags.delete` Delete a tag **Risk:** `destructive` ```ts theme={null} await corsair.asana.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_gid` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### get `tags.get` Get a tag by GID **Risk:** `read` ```ts theme={null} await corsair.asana.api.tags.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > color?: string | null, > notes?: string, > resource_type?: string, > created_at?: string, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > permalink_url?: string > } > ``` *** ### getTasks `tags.getTasks` Get tasks with a specific tag **Risk:** `read` ```ts theme={null} await corsair.asana.api.tags.getTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### list `tags.list` List tags **Risk:** `read` ```ts theme={null} await corsair.asana.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > color?: string | null, > notes?: string, > resource_type?: string, > created_at?: string, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > permalink_url?: string > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### listForTask `tags.listForTask` List tags on a task **Risk:** `read` ```ts theme={null} await corsair.asana.api.tags.listForTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > color?: string | null, > notes?: string, > resource_type?: string, > created_at?: string, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > permalink_url?: string > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### listForWorkspace `tags.listForWorkspace` List tags in a workspace **Risk:** `read` ```ts theme={null} await corsair.asana.api.tags.listForWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > color?: string | null, > notes?: string, > resource_type?: string, > created_at?: string, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > permalink_url?: string > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### update `tags.update` Update a tag **Risk:** `write` ```ts theme={null} await corsair.asana.api.tags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > color?: string, > notes?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > color?: string | null, > notes?: string, > resource_type?: string, > created_at?: string, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > permalink_url?: string > } > ``` *** ## Tasks ### addDependencies `tasks.addDependencies` Add task dependencies **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.addDependencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `dependencies` | `string[]` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string > }[] > ``` *** ### addFollowers `tasks.addFollowers` Add followers to a task **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.addFollowers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `followers` | `string[]` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string > } > ``` *** ### addProject `tasks.addProject` Add a task to a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.addProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `project` | `string` | Yes | — | | `section` | `string` | No | — | | `insert_after` | `string` | No | — | | `insert_before` | `string` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### addTag `tasks.addTag` Add a tag to a task **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.addTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `tag` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### addToSection `tasks.addToSection` Add a task to a section **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.addToSection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `section_gid` | `string` | Yes | — | | `task` | `string` | Yes | — | | `insert_before` | `string` | No | — | | `insert_after` | `string` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### create `tasks.create` Create a new task **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > notes?: string, > html_notes?: string, > due_on?: string, > due_at?: string, > start_on?: string, > start_at?: string, > assignee?: string, > projects?: string[], > tags?: string[], > followers?: string[], > workspace?: string, > parent?: string, > completed?: boolean, > liked?: boolean, > resource_subtype?: string, > custom_fields?: { > }, > assignee_section?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > } > ``` *** ### createSubtask `tasks.createSubtask` Create a subtask **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.createSubtask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > notes?: string, > assignee?: string, > due_on?: string, > due_at?: string, > completed?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > } > ``` *** ### delete `tasks.delete` Delete a task **Risk:** `destructive` ```ts theme={null} await corsair.asana.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### duplicate `tasks.duplicate` Duplicate a task **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.duplicate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `data` | `object` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > include?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > status?: string, > new_project?: { > gid: string, > name?: string, > resource_type?: string > }, > new_task?: { > gid: string, > name?: string, > resource_type?: string > } > } > ``` *** ### get `tasks.get` Get a task by GID **Risk:** `read` ```ts theme={null} await corsair.asana.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > } > ``` *** ### getAttachments `tasks.getAttachments` Get attachments for a task **Risk:** `read` ```ts theme={null} await corsair.asana.api.tasks.getAttachments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### getStories `tasks.getStories` Get stories (activity) for a task **Risk:** `read` ```ts theme={null} await corsair.asana.api.tasks.getStories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > text?: string, > html_text?: string, > type?: string, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > created_by?: { > gid: string, > name?: string, > resource_type?: string > } | null, > liked?: boolean, > num_likes?: number, > is_edited?: boolean, > is_pinned?: boolean, > target?: { > gid: string, > name?: string > } | null > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### getSubtasks `tasks.getSubtasks` Get subtasks of a task **Risk:** `read` ```ts theme={null} await corsair.asana.api.tasks.getSubtasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### getTags `tasks.getTags` Get tags on a task **Risk:** `read` ```ts theme={null} await corsair.asana.api.tasks.getTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > color?: string | null, > notes?: string, > resource_type?: string, > created_at?: string, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > permalink_url?: string > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### list `tasks.list` List tasks **Risk:** `read` ```ts theme={null} await corsair.asana.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assignee` | `string` | No | — | | `project` | `string` | No | — | | `section` | `string` | No | — | | `workspace` | `string` | No | — | | `tag` | `string` | No | — | | `user_task_list` | `string` | No | — | | `completed_since` | `string` | No | — | | `modified_since` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### removeFollower `tasks.removeFollower` Remove a follower from a task **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.removeFollower({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `followers` | `string[]` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string > } > ``` *** ### removeProject `tasks.removeProject` Remove a task from a project **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.removeProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `project` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### removeTag `tasks.removeTag` Remove a tag from a task **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.removeTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `tag` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### search `tasks.search` Search tasks in a workspace **Risk:** `read` ```ts theme={null} await corsair.asana.api.tasks.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `text` | `string` | No | — | | `resource_subtype` | `string` | No | — | | `assignee` | `string` | No | — | | `project` | `string` | No | — | | `section` | `string` | No | — | | `tag` | `string` | No | — | | `team` | `string` | No | — | | `completed` | `boolean` | No | — | | `is_subtask` | `boolean` | No | — | | `has_attachment` | `boolean` | No | — | | `is_blocked` | `boolean` | No | — | | `is_blocking` | `boolean` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### setParent `tasks.setParent` Set the parent of a task **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.setParent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `parent` | `string` | No | — | | `insert_after` | `string` | No | — | | `insert_before` | `string` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > } > ``` *** ### update `tasks.update` Update a task **Risk:** `write` ```ts theme={null} await corsair.asana.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > notes?: string, > html_notes?: string, > due_on?: string, > due_at?: string, > start_on?: string, > start_at?: string, > assignee?: string, > completed?: boolean, > liked?: boolean, > resource_subtype?: string, > approval_status?: string, > assignee_status?: string, > assignee_section?: string, > workspace?: string, > custom_fields?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > notes?: string, > html_notes?: string, > completed?: boolean, > due_on?: string | null, > due_at?: string | null, > start_on?: string | null, > start_at?: string | null, > assignee?: { > gid: string, > name?: string, > resource_type?: string > } | null, > assignee_status?: string, > assignee_section?: { > gid: string, > name?: string, > resource_type?: string > } | null, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } | null, > projects?: { > gid: string, > name?: string, > resource_type?: string > }[], > tags?: { > gid: string, > name?: string, > resource_type?: string > }[], > followers?: { > gid: string, > name?: string, > resource_type?: string > }[], > parent?: { > gid: string, > name?: string, > resource_type?: string > } | null, > resource_type?: string, > resource_subtype?: string, > created_at?: string, > modified_at?: string, > completed_at?: string | null, > liked?: boolean, > num_likes?: number, > permalink_url?: string, > num_subtasks?: number, > approval_status?: string, > custom_fields?: { > }[] > } > ``` *** ## Teams ### addUser `teams.addUser` Add a user to a team **Risk:** `write` ```ts theme={null} await corsair.asana.api.teams.addUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_gid` | `string` | Yes | — | | `user` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > is_admin?: boolean, > is_guest?: boolean, > is_limited_access?: boolean, > team?: { > gid: string, > name?: string, > resource_type?: string > }, > user?: { > gid: string, > name?: string, > resource_type?: string > } > } > ``` *** ### create `teams.create` Create a team **Risk:** `write` ```ts theme={null} await corsair.asana.api.teams.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name: string, > description?: string, > html_description?: string, > visibility?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > description?: string, > html_description?: string, > visibility?: string, > permalink_url?: string, > resource_type?: string, > organization?: { > gid: string, > name?: string, > resource_type?: string > } | null > } > ``` *** ### get `teams.get` Get a team by GID **Risk:** `read` ```ts theme={null} await corsair.asana.api.teams.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > description?: string, > html_description?: string, > visibility?: string, > permalink_url?: string, > resource_type?: string, > organization?: { > gid: string, > name?: string, > resource_type?: string > } | null > } > ``` *** ### listForUser `teams.listForUser` List teams for a user **Risk:** `read` ```ts theme={null} await corsair.asana.api.teams.listForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_gid` | `string` | Yes | — | | `organization` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > description?: string, > html_description?: string, > visibility?: string, > permalink_url?: string, > resource_type?: string, > organization?: { > gid: string, > name?: string, > resource_type?: string > } | null > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### listForWorkspace `teams.listForWorkspace` List teams in a workspace **Risk:** `read` ```ts theme={null} await corsair.asana.api.teams.listForWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > description?: string, > html_description?: string, > visibility?: string, > permalink_url?: string, > resource_type?: string, > organization?: { > gid: string, > name?: string, > resource_type?: string > } | null > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### membershipsGet `teams.membershipsGet` Get a team membership **Risk:** `read` ```ts theme={null} await corsair.asana.api.teams.membershipsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_membership_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > is_admin?: boolean, > is_guest?: boolean, > is_limited_access?: boolean, > team?: { > gid: string, > name?: string, > resource_type?: string > }, > user?: { > gid: string, > name?: string, > resource_type?: string > } > } > ``` *** ### membershipsList `teams.membershipsList` List team memberships **Risk:** `read` ```ts theme={null} await corsair.asana.api.teams.membershipsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team` | `string` | No | — | | `user` | `string` | No | — | | `workspace` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > is_admin?: boolean, > is_guest?: boolean, > is_limited_access?: boolean, > team?: { > gid: string, > name?: string, > resource_type?: string > }, > user?: { > gid: string, > name?: string, > resource_type?: string > } > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### membershipsListForTeam `teams.membershipsListForTeam` List memberships for a team **Risk:** `read` ```ts theme={null} await corsair.asana.api.teams.membershipsListForTeam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > is_admin?: boolean, > is_guest?: boolean, > is_limited_access?: boolean, > team?: { > gid: string, > name?: string, > resource_type?: string > }, > user?: { > gid: string, > name?: string, > resource_type?: string > } > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### membershipsListForUser `teams.membershipsListForUser` List team memberships for a user **Risk:** `read` ```ts theme={null} await corsair.asana.api.teams.membershipsListForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_gid` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > is_admin?: boolean, > is_guest?: boolean, > is_limited_access?: boolean, > team?: { > gid: string, > name?: string, > resource_type?: string > }, > user?: { > gid: string, > name?: string, > resource_type?: string > } > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### removeUser `teams.removeUser` Remove a user from a team **Risk:** `write` ```ts theme={null} await corsair.asana.api.teams.removeUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_gid` | `string` | Yes | — | | `user` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### update `teams.update` Update a team **Risk:** `write` ```ts theme={null} await corsair.asana.api.teams.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string, > description?: string, > html_description?: string, > visibility?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > description?: string, > html_description?: string, > visibility?: string, > permalink_url?: string, > resource_type?: string, > organization?: { > gid: string, > name?: string, > resource_type?: string > } | null > } > ``` *** ## Users ### get `users.get` Get a user by GID **Risk:** `read` ```ts theme={null} await corsair.asana.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > email?: string, > resource_type?: string, > photo?: { > } | null, > workspaces?: { > gid: string, > name?: string, > resource_type?: string > }[] > } > ``` *** ### getCurrent `users.getCurrent` Get the currently authenticated user **Risk:** `read` ```ts theme={null} await corsair.asana.api.users.getCurrent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > email?: string, > resource_type?: string, > photo?: { > } | null, > workspaces?: { > gid: string, > name?: string, > resource_type?: string > }[] > } > ``` *** ### getFavorites `users.getFavorites` Get a user's favorites **Risk:** `read` ```ts theme={null} await corsair.asana.api.users.getFavorites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_gid` | `string` | Yes | — | | `resource_type` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string > }[] > ``` *** ### getTaskList `users.getTaskList` Get a user's task list **Risk:** `read` ```ts theme={null} await corsair.asana.api.users.getTaskList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_gid` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string, > owner?: { > gid: string, > name?: string, > resource_type?: string > }, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } > } > ``` *** ### getUserTaskList `users.getUserTaskList` Get a user task list by GID **Risk:** `read` ```ts theme={null} await corsair.asana.api.users.getUserTaskList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_task_list_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string, > owner?: { > gid: string, > name?: string, > resource_type?: string > }, > workspace?: { > gid: string, > name?: string, > resource_type?: string > } > } > ``` *** ### list `users.list` List users **Risk:** `read` ```ts theme={null} await corsair.asana.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | No | — | | `team` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > email?: string, > resource_type?: string, > photo?: { > } | null, > workspaces?: { > gid: string, > name?: string, > resource_type?: string > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### listForTeam `users.listForTeam` List users in a team **Risk:** `read` ```ts theme={null} await corsair.asana.api.users.listForTeam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_gid` | `string` | Yes | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > email?: string, > resource_type?: string, > photo?: { > } | null, > workspaces?: { > gid: string, > name?: string, > resource_type?: string > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### listForWorkspace `users.listForWorkspace` List users in a workspace **Risk:** `read` ```ts theme={null} await corsair.asana.api.users.listForWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > email?: string, > resource_type?: string, > photo?: { > } | null, > workspaces?: { > gid: string, > name?: string, > resource_type?: string > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ## Webhook Management ### create `webhookManagement.create` Register a new webhook **Risk:** `write` ```ts theme={null} await corsair.asana.api.webhookManagement.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > resource: string, > target: string, > filters?: { > resource_type?: string, > resource_subtype?: string, > action?: string, > fields?: string[] > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > active?: boolean, > created_at?: string, > target?: string, > resource?: { > gid: string, > name?: string > }, > filters?: { > resource_type?: string, > resource_subtype?: string, > action?: string, > fields?: string[] > }[] > } > ``` *** ### delete `webhookManagement.delete` Delete a webhook **Risk:** `destructive` ```ts theme={null} await corsair.asana.api.webhookManagement.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_gid` | `string` | Yes | — | | `opt_pretty` | `boolean` | No | — | **Output:** *empty object* *** ### getList `webhookManagement.getList` List webhooks **Risk:** `read` ```ts theme={null} await corsair.asana.api.webhookManagement.getList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `resource` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > active?: boolean, > created_at?: string, > target?: string, > resource?: { > gid: string, > name?: string > }, > filters?: { > resource_type?: string, > resource_subtype?: string, > action?: string, > fields?: string[] > }[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### update `webhookManagement.update` Update a webhook **Risk:** `write` ```ts theme={null} await corsair.asana.api.webhookManagement.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_gid` | `string` | Yes | — | | `data` | `object` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > filters?: { > resource_type?: string, > resource_subtype?: string, > action?: string, > fields?: string[] > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > active?: boolean, > created_at?: string, > target?: string, > resource?: { > gid: string, > name?: string > }, > filters?: { > resource_type?: string, > resource_subtype?: string, > action?: string, > fields?: string[] > }[] > } > ``` *** ## Workspaces ### get `workspaces.get` Get a workspace by GID **Risk:** `read` ```ts theme={null} await corsair.asana.api.workspaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string, > is_organization?: boolean, > email_domains?: string[] > } > ``` *** ### list `workspaces.list` List workspaces **Risk:** `read` ```ts theme={null} await corsair.asana.api.workspaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > name?: string, > resource_type?: string, > is_organization?: boolean, > email_domains?: string[] > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### membershipsGet `workspaces.membershipsGet` Get a workspace membership **Risk:** `read` ```ts theme={null} await corsair.asana.api.workspaces.membershipsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_membership_gid` | `string` | Yes | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > is_active?: boolean, > is_admin?: boolean, > is_guest?: boolean, > workspace?: { > gid: string, > name?: string, > resource_type?: string > }, > user?: { > gid: string, > name?: string, > resource_type?: string > }, > user_task_list?: { > gid: string, > name?: string > } > } > ``` *** ### membershipsList `workspaces.membershipsList` List workspace memberships **Risk:** `read` ```ts theme={null} await corsair.asana.api.workspaces.membershipsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_gid` | `string` | Yes | — | | `user` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > is_active?: boolean, > is_admin?: boolean, > is_guest?: boolean, > workspace?: { > gid: string, > name?: string, > resource_type?: string > }, > user?: { > gid: string, > name?: string, > resource_type?: string > }, > user_task_list?: { > gid: string, > name?: string > } > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** ### membershipsListForUser `workspaces.membershipsListForUser` List workspace memberships for a user **Risk:** `read` ```ts theme={null} await corsair.asana.api.workspaces.membershipsListForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_gid` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `string` | No | — | | `opt_fields` | `string[]` | No | — | | `opt_pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `next_page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > gid: string, > resource_type?: string, > is_active?: boolean, > is_admin?: boolean, > is_guest?: boolean, > workspace?: { > gid: string, > name?: string, > resource_type?: string > }, > user?: { > gid: string, > name?: string, > resource_type?: string > }, > user_task_list?: { > gid: string, > name?: string > } > }[] > ``` > **next\_page full type** > > ```ts theme={null} > { > offset?: string, > path?: string, > uri?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/asana/database Asana local sync: searchable entities, `.search()` filters, and operators. The Asana plugin syncs data locally. Use `corsair.asana.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Projects Path: `asana.db.projects.search` ```ts theme={null} const rows = await corsair.asana.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `gid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `html_notes` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `archived` | `boolean` | equals | | `completed` | `boolean` | equals | | `due_on` | `string` | equals, contains, startsWith, endsWith, in | | `start_on` | `string` | equals, contains, startsWith, endsWith, in | | `public` | `boolean` | equals | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `modified_at` | `string` | equals, contains, startsWith, endsWith, in | | `permalink_url` | `string` | equals, contains, startsWith, endsWith, in | | `default_view` | `string` | equals, contains, startsWith, endsWith, in | | `privacy_setting` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sections Path: `asana.db.sections.search` ```ts theme={null} const rows = await corsair.asana.db.sections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `gid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Stories Path: `asana.db.stories.search` ```ts theme={null} const rows = await corsair.asana.db.stories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `gid` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `html_text` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `resource_subtype` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `liked` | `boolean` | equals | | `num_likes` | `number` | equals, gt, gte, lt, lte, in | | `is_edited` | `boolean` | equals | | `is_pinned` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `asana.db.tags.search` ```ts theme={null} const rows = await corsair.asana.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `gid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `permalink_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `asana.db.tasks.search` ```ts theme={null} const rows = await corsair.asana.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `gid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `html_notes` | `string` | equals, contains, startsWith, endsWith, in | | `completed` | `boolean` | equals | | `due_on` | `string` | equals, contains, startsWith, endsWith, in | | `due_at` | `string` | equals, contains, startsWith, endsWith, in | | `start_on` | `string` | equals, contains, startsWith, endsWith, in | | `start_at` | `string` | equals, contains, startsWith, endsWith, in | | `assignee_status` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `resource_subtype` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `modified_at` | `string` | equals, contains, startsWith, endsWith, in | | `completed_at` | `string` | equals, contains, startsWith, endsWith, in | | `liked` | `boolean` | equals | | `num_likes` | `number` | equals, gt, gte, lt, lte, in | | `num_subtasks` | `number` | equals, gt, gte, lt, lte, in | | `permalink_url` | `string` | equals, contains, startsWith, endsWith, in | | `approval_status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `asana.db.teams.search` ```ts theme={null} const rows = await corsair.asana.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `gid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `html_description` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `permalink_url` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `asana.db.users.search` ```ts theme={null} const rows = await corsair.asana.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `gid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/asana/get-credentials Step-by-step instructions for obtaining Asana API credentials. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Personal access token ## Personal Access Token Setup ### Step 1: Create a Personal Access Token 1. Log in to [Asana](https://app.asana.com) 2. Click your profile photo → **My Settings** 3. Go to the **Apps** tab 4. Click **Manage Developer Apps** 5. Under **Personal access tokens**, click **+ New access token** 6. Give it a name and click **Create token** 7. Copy the token immediately — you won't be able to see it again 8. Store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=asana api_key=your-personal-access-token ``` ## Webhook Setup (Optional) Asana webhooks are managed through the API. Use Corsair to create a webhook subscription: ```ts theme={null} await corsair.asana.api.webhooks.create({ resource: "project-id", target: "https://yourapp.com/webhooks/asana", filters: [{ resource_type: "task", action: "added" }], }); ``` Store the webhook secret for signature verification: ```bash theme={null} pnpm corsair setup --plugin=asana webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Personal Access Token | All API calls | My Settings → Apps → Personal access tokens | | Webhook Secret | Webhook verification | Returned when creating webhook | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/asana/overview Work management platform for tasks, projects, teams, and cross-functional collaboration. Use **Asana** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 84 typed API operations * 7 synced entities (`projects`, `sections`, `stories`, `tags`, `tasks`, `teams`, and 1 more) for fast `.search()` / `.list()` * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/asana ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/asana ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/asana ``` ```bash bun theme={null} bun add corsair @corsair-dev/asana ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { asana } from '@corsair-dev/asana'; export const corsair = createCorsair({ plugins: [ asana({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Asana** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/asana/get-credentials). ```ts theme={null} asana({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. Provider walkthrough: [Get Credentials](/plugins/asana/get-credentials). ```ts theme={null} asana() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Asana OAuth app. Provider walkthrough: [Get Credentials](/plugins/asana/get-credentials). ```ts theme={null} asana({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'asana', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List tasks** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.asana.api.tasks.list({}); ``` **Create a task** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.asana.api.tasks.create({ data: { name: 'Follow up from Corsair' }, }); ``` See the full list on the [API](/plugins/asana/api) page. ## Query synced data Search synced tasks without hitting Asana. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.asana.db.tasks.search({ data: { completed: false }, limit: 50, }); ``` Synced entities: `projects`, `sections`, `stories`, `tags`, `tasks`, `teams`, `users`. See [Database](/plugins/asana/database) for filters and operators. ## Webhooks Fires on Asana task create/update events. Do not use challenge.challenge. ```ts theme={null} asana({ webhookHooks: { tasks: { taskEvent: { after: async (ctx, result) => { console.log('Asana task event:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/asana/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/asana/api)** > > Every `asana.api.*` operation with input and output types. > **[Database](/plugins/asana/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/asana/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/asana/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/asana/webhooks Asana incoming webhooks: event paths, payloads, and response data. The Asana plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/asana/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `challenge` * `challenge` (`challenge.challenge`) * `tasks` * `taskEvent` (`tasks.taskEvent`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Challenge ### Challenge `challenge.challenge` Asana initial webhook verification handshake via X-Hook-Secret header **Payload:** *empty object* > **Response data full type** > > ```ts theme={null} > { > hookSecret: string > } > ``` **`webhookHooks` example** ```ts theme={null} asana({ webhookHooks: { challenge: { challenge: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Tasks ### Task Event `tasks.taskEvent` A task event occurred — task was added, changed, or removed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `events` | `object[]` | Yes | — | > **events full type** > > ```ts theme={null} > { > action: string, > created_at?: string, > resource?: { > gid: string, > resource_type: task, > resource_subtype?: string, > name?: string > }, > parent?: { > gid: string, > resource_type?: string, > resource_subtype?: string, > name?: string > } | null, > user?: { > gid: string, > resource_type?: string, > name?: string > } | null, > change?: { > field?: string, > action?: string, > new_value?: any, > added_value?: any, > removed_value?: any > } > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > action: string, > created_at?: string, > resource?: { > gid: string, > resource_type?: string, > resource_subtype?: string, > name?: string > }, > parent?: { > gid: string, > resource_type?: string, > resource_subtype?: string, > name?: string > } | null, > user?: { > gid: string, > resource_type?: string, > name?: string > } | null, > change?: { > field?: string, > action?: string, > new_value?: any, > added_value?: any, > removed_value?: any > } > } > ``` **`webhookHooks` example** ```ts theme={null} asana({ webhookHooks: { tasks: { taskEvent: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/ascora/api API reference for Ascora: every `ascora.api.*` operation with input and output types. Every `ascora.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Attachments ### upload `attachments.upload` Upload a file attachment to an Ascora entity **Risk:** `write` ```ts theme={null} await corsair.ascora.api.attachments.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entityId` | `string` | Yes | Official entity GUID. | | `entityType` | `Enquiry \| Job \| Quotation \| Task \| SupplierInvoice \| Invoice \| Supply \| Customer` | Yes | Official `EntityType`. | | `fileName` | `string` | Yes | — | | `fileBase64` | `string` | Yes | File contents as base64. | | `contentType` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entityId` | `string` | No | — | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | *** ## Contacts ### get `contacts.get` Get a contact by GUID **Risk:** `read` ```ts theme={null} await corsair.ascora.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | Official contact GUID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `contact` | `object` | No | — | > **contact full type** > > ```ts theme={null} > { > contactId: string, > customerId?: string | null, > firstName?: string | null, > lastName?: string | null, > emailAddress?: string | null, > phoneNumber?: string | null, > mobileNumber?: string | null, > faxNumber?: string | null, > defaultContact?: boolean, > contactRole?: string | null > } > ``` *** ### upsert `contacts.upsert` Create or update a contact on a customer **Risk:** `write` ```ts theme={null} await corsair.ascora.api.contacts.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `string` | Yes | Official customer GUID. | | `contactId` | `string` | No | Set to update an existing contact. | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `emailAddress` | `string` | No | — | | `phoneNumber` | `string` | No | — | | `mobileNumber` | `string` | No | — | | `faxNumber` | `string` | No | — | | `defaultContact` | `boolean` | No | — | | `contactRole` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `contact` | `object` | No | — | > **contact full type** > > ```ts theme={null} > { > contactId: string, > customerId?: string | null, > firstName?: string | null, > lastName?: string | null, > emailAddress?: string | null, > phoneNumber?: string | null, > mobileNumber?: string | null, > faxNumber?: string | null, > defaultContact?: boolean, > contactRole?: string | null > } > ``` *** ## Customers ### get `customers.get` Get a customer by GUID **Risk:** `read` ```ts theme={null} await corsair.ascora.api.customers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `string` | Yes | Official customer GUID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `customer` | `object` | No | — | > **customer full type** > > ```ts theme={null} > { > customerId: string, > customerNumber?: string | null, > customerName?: string | null, > companyName?: string | null, > contactFirstName?: string | null, > contactLastName?: string | null, > emailAddress?: string | null, > phoneNumber?: string | null, > mobileNumber?: string | null, > onHold?: boolean, > billingCustomerOnHold?: boolean, > streetLine1?: string | null, > streetLine2?: string | null, > streetSuburb?: string | null, > streetPostcode?: string | null, > streetState?: string | null, > streetCountry?: string | null, > postalLine1?: string | null, > postalLine2?: string | null, > postalSuburb?: string | null, > postalState?: string | null, > postalPostcode?: string | null, > postalCountry?: string | null, > customerType?: { > id?: string | null, > name?: string | null > } | null, > leadSource?: { > id?: string | null, > name?: string | null > } | null, > billingCustomer?: { > id?: string | null, > name?: string | null > } | null, > assignedUser?: { > id?: string | null, > name?: string | null > } | null, > customFields?: { > fieldName?: string, > fieldValue?: string > }[] > } > ``` *** ### list `customers.list` List customers with optional filters (FilterText, type, assigned user, pagination) **Risk:** `read` ```ts theme={null} await corsair.ascora.api.customers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Official `Page`. Default 1. | | `pageSize` | `number` | No | Official `PageSize`. Default 250. | | `filterText` | `string` | No | Official `FilterText`. Customer number, email, phone, name. | | `customerType` | `string` | No | Official `CustomerType`. | | `leadSource` | `string` | No | Official `LeadSource`. | | `assignedUser` | `string` | No | Official `AssignedUser`. | | `siteBillingType` | `string` | No | Official `SiteBillingType`. Site / Billing / All. | | `phoneNumber` | `string` | No | Official `PhoneNumber`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `results` | `object[]` | Yes | — | | `totalPages` | `number` | No | — | | `totalRecords` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > customerId: string, > customerNumber?: string | null, > customerName?: string | null, > companyName?: string | null, > contactFirstName?: string | null, > contactLastName?: string | null, > emailAddress?: string | null, > phoneNumber?: string | null, > mobileNumber?: string | null, > onHold?: boolean, > billingCustomerOnHold?: boolean, > streetLine1?: string | null, > streetLine2?: string | null, > streetSuburb?: string | null, > streetPostcode?: string | null, > streetState?: string | null, > streetCountry?: string | null, > postalLine1?: string | null, > postalLine2?: string | null, > postalSuburb?: string | null, > postalState?: string | null, > postalPostcode?: string | null, > postalCountry?: string | null, > customerType?: { > id?: string | null, > name?: string | null > } | null, > leadSource?: { > id?: string | null, > name?: string | null > } | null, > billingCustomer?: { > id?: string | null, > name?: string | null > } | null, > assignedUser?: { > id?: string | null, > name?: string | null > } | null, > customFields?: { > fieldName?: string, > fieldValue?: string > }[] > }[] > ``` *** ### upsert `customers.upsert` Create a customer or update one when customerId is provided **Risk:** `write` ```ts theme={null} await corsair.ascora.api.customers.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `string` | No | Set to update an existing customer. | | `customerNumber` | `string` | No | — | | `companyName` | `string` | No | — | | `contactFirstName` | `string` | No | — | | `contactLastName` | `string` | No | — | | `emailAddress` | `string` | No | — | | `phoneNumber` | `string` | No | — | | `mobileNumber` | `string` | No | — | | `onHold` | `boolean` | No | — | | `billingCustomerOnHold` | `boolean` | No | — | | `streetLine1` | `string` | No | — | | `streetLine2` | `string` | No | — | | `streetSuburb` | `string` | No | — | | `streetPostcode` | `string` | No | — | | `streetState` | `string` | No | — | | `streetCountry` | `string` | No | — | | `postalLine1` | `string` | No | — | | `postalLine2` | `string` | No | — | | `postalSuburb` | `string` | No | — | | `postalState` | `string` | No | — | | `postalPostcode` | `string` | No | — | | `postalCountry` | `string` | No | — | | `customerType` | `object` | No | — | | `leadSource` | `object` | No | — | | `customFields` | `object[]` | No | — | > **customerType full type** > > ```ts theme={null} > { > id?: string, > name?: string > } > ``` > **leadSource full type** > > ```ts theme={null} > { > id?: string, > name?: string > } > ``` > **customFields full type** > > ```ts theme={null} > { > fieldName: string, > fieldValue: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `customer` | `object` | No | — | > **customer full type** > > ```ts theme={null} > { > customerId: string, > customerNumber?: string | null, > customerName?: string | null, > companyName?: string | null, > contactFirstName?: string | null, > contactLastName?: string | null, > emailAddress?: string | null, > phoneNumber?: string | null, > mobileNumber?: string | null, > onHold?: boolean, > billingCustomerOnHold?: boolean, > streetLine1?: string | null, > streetLine2?: string | null, > streetSuburb?: string | null, > streetPostcode?: string | null, > streetState?: string | null, > streetCountry?: string | null, > postalLine1?: string | null, > postalLine2?: string | null, > postalSuburb?: string | null, > postalState?: string | null, > postalPostcode?: string | null, > postalCountry?: string | null, > customerType?: { > id?: string | null, > name?: string | null > } | null, > leadSource?: { > id?: string | null, > name?: string | null > } | null, > billingCustomer?: { > id?: string | null, > name?: string | null > } | null, > assignedUser?: { > id?: string | null, > name?: string | null > } | null, > customFields?: { > fieldName?: string, > fieldValue?: string > }[] > } > ``` *** ## Enquiries ### create `enquiries.create` Create a quotation/enquiry (POST /Enquiry) **Risk:** `write` ```ts theme={null} await corsair.ascora.api.enquiries.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companyName` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `email` | `string` | No | — | | `mobile` | `string` | No | — | | `phone` | `string` | No | — | | `addressLine1` | `string` | No | — | | `addressLine2` | `string` | No | — | | `addressSuburb` | `string` | No | — | | `addressState` | `string` | No | — | | `addressPostcode` | `string` | No | — | | `addressCountry` | `string` | No | — | | `enquiryDescription` | `string` | No | — | | `leadSource` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > fieldName: string, > fieldValue: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `entityId` | `string` | No | — | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | *** ## Inventory ### categories `inventory.categories` List inventory categories **Risk:** `read` ```ts theme={null} await corsair.ascora.api.inventory.categories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Official `Page`. Default 1. | | `pageSize` | `number` | No | Official `PageSize`. Default 250. | | `filterText` | `string` | No | Official `FilterText`. | | `parentOnly` | `boolean` | No | Official `ParentOnly`. | | `categoryNumber` | `number` | No | Official `CategoryNumber`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `results` | `object[]` | Yes | — | | `totalPages` | `number` | No | — | | `totalRecords` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > categoryId: string, > name?: string | null, > categoryNumber?: number, > parentCategoryId?: string | null > }[] > ``` *** ### kits `inventory.kits` List inventory kits **Risk:** `read` ```ts theme={null} await corsair.ascora.api.inventory.kits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Official `Page`. Default 1. | | `pageSize` | `number` | No | Official `PageSize`. Default 250. | | `filterText` | `string` | No | Official `FilterText`. | | `favouriteOnly` | `boolean` | No | Official `FavouriteOnly`. | | `categoryOneId` | `string` | No | Official `CategoryOneId`. | | `categoryTwoId` | `string` | No | Official `CategoryTwoId`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `results` | `object[]` | Yes | — | | `totalPages` | `number` | No | — | | `totalRecords` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > kitId: string, > partNumber?: string | null, > description?: string | null, > annotation?: string | null, > markup?: number, > unitCostExTax?: number, > unitSellExTax?: number, > unitSellIncTax?: number, > isTaxable?: boolean, > isFavourite?: boolean, > pricingMethod?: string | null, > categoryOne?: { > id?: string | null, > name?: string | null > } | null, > unitOfMeasure?: string | null > }[] > ``` *** ### supplies `inventory.supplies` List inventory supplies with pricing **Risk:** `read` ```ts theme={null} await corsair.ascora.api.inventory.supplies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Official `Page`. Default 1. | | `pageSize` | `number` | No | Official `PageSize`. Default 250. | | `filterText` | `string` | No | Official `FilterText`. | | `favouriteOnly` | `boolean` | No | Official `FavouriteOnly`. | | `categoryOneId` | `string` | No | Official `CategoryOneId`. | | `categoryTwoId` | `string` | No | Official `CategoryTwoId`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `results` | `object[]` | Yes | — | | `totalPages` | `number` | No | — | | `totalRecords` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > supplyId: string, > partNumber?: string | null, > description?: string | null, > annotation?: string | null, > unitCostExTax?: number, > unitSellExTax?: number, > unitSellIncTax?: number, > averageCost?: number, > isTaxable?: boolean, > isFavourite?: boolean, > mustBeOrdered?: boolean, > packOrBoxQuantity?: number, > location?: string | null, > defaultSupplier?: { > id?: string | null, > name?: string | null > } | null, > categoryOne?: { > id?: string | null, > name?: string | null > } | null, > unitOfMeasure?: string | null > }[] > ``` *** ## Jobs ### get `jobs.get` Get a job by full job number (e.g. J1) **Risk:** `read` ```ts theme={null} await corsair.ascora.api.jobs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobNumber` | `string` | Yes | Official full job number, e.g. J1. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `job` | `object` | No | — | > **job full type** > > ```ts theme={null} > { > jobId: string, > topLevelJobNumber?: string | null, > jobNumber?: string | null, > jobName?: string | null, > jobDescription?: string | null, > workUndertaken?: string | null, > jobStatus?: number, > jobStatusText?: string | null, > dateCreated?: string | null, > pricingMethod?: string | null, > totalIncTax?: number, > totalExTax?: number, > purchaseOrderNumber?: string | null, > clientOrderNumber?: string | null, > addressLine1?: string | null, > addressLine2?: string | null, > suburb?: string | null, > state?: string | null, > postcode?: string | null, > country?: string | null, > jobType?: { > id?: string | null, > name?: string | null > } | null, > siteCustomer?: { > id?: string | null, > name?: string | null > } | null, > billingCustomer?: { > id?: string | null, > name?: string | null > } | null > } > ``` *** ### list `jobs.list` List jobs filtered by status, type, dates, and assignment **Risk:** `read` ```ts theme={null} await corsair.ascora.api.jobs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Official `Page`. Default 1. | | `pageSize` | `number` | No | Official `PageSize`. Default 250. | | `jobStatus` | `string` | No | Official `JobStatus`. NEW, IN-PROGRESS, COMPLETED, CANCELLED, BOOKED, ALL-OPEN, ALL, etc. | | `jobType` | `string` | No | Official `JobType`. | | `assignedUser` | `string` | No | Official `AssignedUser`. | | `startDate` | `string` | No | Official `StartDate`. | | `endDate` | `string` | No | Official `EndDate`. | | `includeChildJobs` | `boolean` | No | Official `IncludeChildJobs`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `results` | `object[]` | Yes | — | | `totalPages` | `number` | No | — | | `totalRecords` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > jobId: string, > topLevelJobNumber?: string | null, > jobNumber?: string | null, > jobName?: string | null, > jobDescription?: string | null, > workUndertaken?: string | null, > jobStatus?: number, > jobStatusText?: string | null, > dateCreated?: string | null, > pricingMethod?: string | null, > totalIncTax?: number, > totalExTax?: number, > purchaseOrderNumber?: string | null, > clientOrderNumber?: string | null, > addressLine1?: string | null, > addressLine2?: string | null, > suburb?: string | null, > state?: string | null, > postcode?: string | null, > country?: string | null, > jobType?: { > id?: string | null, > name?: string | null > } | null, > siteCustomer?: { > id?: string | null, > name?: string | null > } | null, > billingCustomer?: { > id?: string | null, > name?: string | null > } | null > }[] > ``` *** ### search `jobs.search` Search jobs by number, name, address, or customer name **Risk:** `read` ```ts theme={null} await corsair.ascora.api.jobs.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Official `Page`. Default 1. | | `pageSize` | `number` | No | Official `PageSize`. Default 250. | | `filterText` | `string` | No | Official `FilterText`. Job number, name, or address. | | `customerName` | `string` | No | Official `CustomerName`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `results` | `object[]` | Yes | — | | `totalPages` | `number` | No | — | | `totalRecords` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > jobId: string, > topLevelJobNumber?: string | null, > jobNumber?: string | null, > jobName?: string | null, > jobDescription?: string | null, > workUndertaken?: string | null, > jobStatus?: number, > jobStatusText?: string | null, > dateCreated?: string | null, > pricingMethod?: string | null, > totalIncTax?: number, > totalExTax?: number, > purchaseOrderNumber?: string | null, > clientOrderNumber?: string | null, > addressLine1?: string | null, > addressLine2?: string | null, > suburb?: string | null, > state?: string | null, > postcode?: string | null, > country?: string | null, > jobType?: { > id?: string | null, > name?: string | null > } | null, > siteCustomer?: { > id?: string | null, > name?: string | null > } | null, > billingCustomer?: { > id?: string | null, > name?: string | null > } | null > }[] > ``` *** ## Notes ### create `notes.create` Create a note on an enquiry, job, quotation, invoice, or customer **Risk:** `write` ```ts theme={null} await corsair.ascora.api.notes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entityId` | `string` | Yes | Official entity GUID. | | `entityType` | `Enquiry \| Job \| Quotation \| Invoice \| Customer` | Yes | Official `entityType`. | | `noteContent` | `string` | Yes | Official `noteContent`. | | `createdByName` | `string` | No | Official `createdByName`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entityId` | `string` | No | — | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | *** ## Quotes ### labourRoles `quotes.labourRoles` List labour roles and hourly rates for quotes **Risk:** `read` ```ts theme={null} await corsair.ascora.api.quotes.labourRoles({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > labourRoleId: string, > name?: string | null, > hourlyRateExTax?: number > }[] > ``` *** ### list `quotes.list` List quotes with optional status, date, and customer filters **Risk:** `read` ```ts theme={null} await corsair.ascora.api.quotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Official `Page`. Default 1. | | `pageSize` | `number` | No | Official `PageSize`. Default 250. | | `filterText` | `string` | No | Official `FilterText`. | | `quoteStatus` | `string` | No | Official `QuoteStatus`. IN-PROGRESS, SENT-TO-CUSTOMER, OPEN, WON, LAST-7-DAYS, ALL, ACCEPTED. | | `jobType` | `string` | No | Official `JobType`. | | `assignedUser` | `string` | No | Official `AssignedUser`. | | `customerName` | `string` | No | Official `CustomerName`. | | `startDate` | `string` | No | Official `StartDate`. | | `endDate` | `string` | No | Official `EndDate`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `results` | `object[]` | Yes | — | | `totalPages` | `number` | No | — | | `totalRecords` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > quoteId: string, > quoteNumber?: string | null, > quoteName?: string | null, > quoteDescription?: string | null, > quoteStatus?: number, > quotationDate?: string | null, > totalIncTax?: number, > totalExTax?: number, > pricingMethod?: string | null, > purchaseOrderNumber?: string | null, > clientOrderNumber?: string | null, > addressLine1?: string | null, > addressLine2?: string | null, > suburb?: string | null, > postcode?: string | null, > country?: string | null, > jobType?: { > id?: string | null, > name?: string | null > } | null, > siteCustomer?: { > id?: string | null, > name?: string | null > } | null, > billingCustomer?: { > id?: string | null, > name?: string | null > } | null > }[] > ``` *** ### standardSections `quotes.standardSections` List standard quote sections **Risk:** `read` ```ts theme={null} await corsair.ascora.api.quotes.standardSections({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string, > displayOrder?: number > }[] > ``` *** ### standardStages `quotes.standardStages` List standard quote stages **Risk:** `read` ```ts theme={null} await corsair.ascora.api.quotes.standardStages({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string, > displayOrder?: number > }[] > ``` *** ## Supplier Invoices ### list `supplierInvoices.list` List supplier invoices with optional pagination and filters **Risk:** `read` ```ts theme={null} await corsair.ascora.api.supplierInvoices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Official `Page`. Default 1. | | `pageSize` | `number` | No | Official `PageSize`. Default 250. | | `supplierName` | `string` | No | Official `SupplierName`. | | `trackingNumber` | `string` | No | Official `TrackingNumber`. | | `toBeSentToAccounting` | `boolean` | No | Official `ToBeSentToAccounting`. | | `invoiceDateStart` | `string` | No | Official `InvoiceDateStart`. | | `invoiceDateEnd` | `string` | No | Official `InvoiceDateEnd`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `results` | `object[]` | Yes | — | | `totalPages` | `number` | No | — | | `totalRecords` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > supplierInvoiceId: string, > supplier?: { > id?: string | null, > name?: string | null > } | null, > createdOn?: string | null, > invoiceDate?: string | null, > dueDate?: string | null, > trackingNumber?: string | null, > accepted?: boolean, > type?: string | null, > accountCode?: string | null, > isExpense?: boolean, > sentToAccounts?: boolean, > totalAmountExTax?: number, > totalAmountIncTax?: number, > lines?: any[] > }[] > ``` *** ## Suppliers ### get `suppliers.get` Get a supplier by GUID **Risk:** `read` ```ts theme={null} await corsair.ascora.api.suppliers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `supplierId` | `string` | Yes | Official supplier GUID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `supplier` | `object` | No | — | > **supplier full type** > > ```ts theme={null} > { > supplierId: string, > supplierNumber?: string | null, > name?: string | null, > businessNumber?: string | null, > contactFirstName?: string | null, > contactLastName?: string | null, > notes?: string | null, > phone?: string | null, > fax?: string | null, > mobile?: string | null, > emailAddress?: string | null, > expenseAccount?: string | null, > streetLine1?: string | null, > streetLine2?: string | null, > streetSuburb?: string | null, > streetState?: string | null, > streetPostcode?: string | null, > postalLine1?: string | null, > postalLine2?: string | null, > postalSuburb?: string | null, > postalState?: string | null, > postalPostcode?: string | null, > invoiceDueDaysType?: number > } > ``` *** ### list `suppliers.list` List suppliers by name, number, or ABN **Risk:** `read` ```ts theme={null} await corsair.ascora.api.suppliers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Official `Page`. Default 1. | | `pageSize` | `number` | No | Official `PageSize`. Default 250. | | `supplierName` | `string` | No | Official `SupplierName`. | | `supplierNumber` | `string` | No | Official `SupplierNumber`. | | `businessNumber` | `string` | No | Official `BusinessNumber`. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `results` | `object[]` | Yes | — | | `totalPages` | `number` | No | — | | `totalRecords` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > supplierId: string, > supplierNumber?: string | null, > name?: string | null, > businessNumber?: string | null, > contactFirstName?: string | null, > contactLastName?: string | null, > notes?: string | null, > phone?: string | null, > fax?: string | null, > mobile?: string | null, > emailAddress?: string | null, > expenseAccount?: string | null, > streetLine1?: string | null, > streetLine2?: string | null, > streetSuburb?: string | null, > streetState?: string | null, > streetPostcode?: string | null, > postalLine1?: string | null, > postalLine2?: string | null, > postalSuburb?: string | null, > postalState?: string | null, > postalPostcode?: string | null, > invoiceDueDaysType?: number > }[] > ``` *** ### upsert `suppliers.upsert` Create a supplier or update one when supplierId is provided **Risk:** `write` ```ts theme={null} await corsair.ascora.api.suppliers.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `supplierId` | `string` | No | Set to update an existing supplier. | | `supplierNumber` | `string` | No | — | | `name` | `string` | No | — | | `businessNumber` | `string` | No | — | | `notes` | `string` | No | — | | `phone` | `string` | No | — | | `fax` | `string` | No | — | | `mobile` | `string` | No | — | | `emailAddress` | `string` | No | — | | `streetLine1` | `string` | No | — | | `streetLine2` | `string` | No | — | | `streetSuburb` | `string` | No | — | | `streetState` | `string` | No | — | | `streetPostcode` | `string` | No | — | | `postalLine1` | `string` | No | — | | `postalLine2` | `string` | No | — | | `postalSuburb` | `string` | No | — | | `postalState` | `string` | No | — | | `postalPostcode` | `string` | No | — | | `contactFirstName` | `string` | No | — | | `contactLastName` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `supplier` | `object` | No | — | > **supplier full type** > > ```ts theme={null} > { > supplierId: string, > supplierNumber?: string | null, > name?: string | null, > businessNumber?: string | null, > contactFirstName?: string | null, > contactLastName?: string | null, > notes?: string | null, > phone?: string | null, > fax?: string | null, > mobile?: string | null, > emailAddress?: string | null, > expenseAccount?: string | null, > streetLine1?: string | null, > streetLine2?: string | null, > streetSuburb?: string | null, > streetState?: string | null, > streetPostcode?: string | null, > postalLine1?: string | null, > postalLine2?: string | null, > postalSuburb?: string | null, > postalState?: string | null, > postalPostcode?: string | null, > invoiceDueDaysType?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/ascora/database Ascora local sync: searchable entities, `.search()` filters, and operators. The Ascora plugin syncs data locally. Use `corsair.ascora.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Contacts Path: `ascora.db.contacts.search` ```ts theme={null} const rows = await corsair.ascora.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `contactId` | `string` | equals, contains, startsWith, endsWith, in | | `customerId` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `emailAddress` | `string` | equals, contains, startsWith, endsWith, in | | `phoneNumber` | `string` | equals, contains, startsWith, endsWith, in | | `mobileNumber` | `string` | equals, contains, startsWith, endsWith, in | | `defaultContact` | `boolean` | equals | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Customers Path: `ascora.db.customers.search` ```ts theme={null} const rows = await corsair.ascora.db.customers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `customerId` | `string` | equals, contains, startsWith, endsWith, in | | `customerNumber` | `string` | equals, contains, startsWith, endsWith, in | | `customerName` | `string` | equals, contains, startsWith, endsWith, in | | `companyName` | `string` | equals, contains, startsWith, endsWith, in | | `contactFirstName` | `string` | equals, contains, startsWith, endsWith, in | | `contactLastName` | `string` | equals, contains, startsWith, endsWith, in | | `emailAddress` | `string` | equals, contains, startsWith, endsWith, in | | `phoneNumber` | `string` | equals, contains, startsWith, endsWith, in | | `mobileNumber` | `string` | equals, contains, startsWith, endsWith, in | | `onHold` | `boolean` | equals | | `streetLine1` | `string` | equals, contains, startsWith, endsWith, in | | `streetSuburb` | `string` | equals, contains, startsWith, endsWith, in | | `streetPostcode` | `string` | equals, contains, startsWith, endsWith, in | | `streetState` | `string` | equals, contains, startsWith, endsWith, in | | `streetCountry` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Inventory Categories Path: `ascora.db.inventoryCategories.search` ```ts theme={null} const rows = await corsair.ascora.db.inventoryCategories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `categoryId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `categoryNumber` | `number` | equals, gt, gte, lt, lte, in | | `parentCategoryId` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `ascora.db.jobs.search` ```ts theme={null} const rows = await corsair.ascora.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `jobNumber` | `string` | equals, contains, startsWith, endsWith, in | | `jobName` | `string` | equals, contains, startsWith, endsWith, in | | `jobStatus` | `number` | equals, gt, gte, lt, lte, in | | `jobStatusText` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `string` | equals, contains, startsWith, endsWith, in | | `pricingMethod` | `string` | equals, contains, startsWith, endsWith, in | | `totalIncTax` | `number` | equals, gt, gte, lt, lte, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Kits Path: `ascora.db.kits.search` ```ts theme={null} const rows = await corsair.ascora.db.kits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `kitId` | `string` | equals, contains, startsWith, endsWith, in | | `partNumber` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `unitSellExTax` | `number` | equals, gt, gte, lt, lte, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Labour Roles Path: `ascora.db.labourRoles.search` ```ts theme={null} const rows = await corsair.ascora.db.labourRoles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `labourRoleId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `hourlyRateExTax` | `number` | equals, gt, gte, lt, lte, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Quotes Path: `ascora.db.quotes.search` ```ts theme={null} const rows = await corsair.ascora.db.quotes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `quoteId` | `string` | equals, contains, startsWith, endsWith, in | | `quoteNumber` | `string` | equals, contains, startsWith, endsWith, in | | `quoteName` | `string` | equals, contains, startsWith, endsWith, in | | `quoteStatus` | `number` | equals, gt, gte, lt, lte, in | | `quotationDate` | `string` | equals, contains, startsWith, endsWith, in | | `totalIncTax` | `number` | equals, gt, gte, lt, lte, in | | `pricingMethod` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Supplier Invoices Path: `ascora.db.supplierInvoices.search` ```ts theme={null} const rows = await corsair.ascora.db.supplierInvoices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `supplierInvoiceId` | `string` | equals, contains, startsWith, endsWith, in | | `trackingNumber` | `string` | equals, contains, startsWith, endsWith, in | | `invoiceDate` | `string` | equals, contains, startsWith, endsWith, in | | `dueDate` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `totalAmountIncTax` | `number` | equals, gt, gte, lt, lte, in | | `sentToAccounts` | `boolean` | equals | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Suppliers Path: `ascora.db.suppliers.search` ```ts theme={null} const rows = await corsair.ascora.db.suppliers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `supplierId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `businessNumber` | `string` | equals, contains, startsWith, endsWith, in | | `emailAddress` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `mobile` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Supplies Path: `ascora.db.supplies.search` ```ts theme={null} const rows = await corsair.ascora.db.supplies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `supplyId` | `string` | equals, contains, startsWith, endsWith, in | | `partNumber` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `unitCostExTax` | `number` | equals, gt, gte, lt, lte, in | | `unitSellExTax` | `number` | equals, gt, gte, lt, lte, in | | `unitSellIncTax` | `number` | equals, gt, gte, lt, lte, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/ascora/overview Field service management software for scheduling jobs, technicians, and service businesses. Use **Ascora** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 22 typed API operations * 10 synced entities (`contacts`, `customers`, `inventoryCategories`, `jobs`, `kits`, `labourRoles`, and 4 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ascora ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ascora ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ascora ``` ```bash bun theme={null} bun add corsair @corsair-dev/ascora ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ascora } from '@corsair-dev/ascora'; export const corsair = createCorsair({ plugins: [ ascora(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ascora() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ascora', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`contacts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ascora.api.contacts.get({}); ``` **`attachments.upload`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ascora.api.attachments.upload({}); ``` See the full list on the [API](/plugins/ascora/api) page. ## Query synced data Synced entities support `tenant.ascora.db..search()` and `.list()`: `contacts`, `customers`, `inventoryCategories`, `jobs`, `kits`, `labourRoles`, `quotes`, `supplierInvoices`, `suppliers`, `supplies`. See [Database](/plugins/ascora/database) for filters and operators. ## What's next > **[API reference](/plugins/ascora/api)** > > Every `ascora.api.*` operation with input and output types. > **[Database](/plugins/ascora/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/ashby/api API reference for Ashby: every `ashby.api.*` operation with input and output types. Every `ashby.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Api Key ### info `apiKey.info` Retrieve information and permission scopes for the current API key **Risk:** `read` ```ts theme={null} await corsair.ashby.api.apiKey.info({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id?: string, > name?: string, > scopes?: string[] > } > ``` *** ## Application ### changeStage `application.changeStage` Move an application to a different interview stage **Risk:** `write` ```ts theme={null} await corsair.ashby.api.application.changeStage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `applicationId` | `string` | Yes | — | | `interviewStageId` | `string` | Yes | — | | `archiveReasonId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > candidateId: string, > jobId: string, > status?: string, > currentInterviewStageId?: string | null, > archiveReasonId?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ### create `application.create` Create an application linking a candidate to a job **Risk:** `write` ```ts theme={null} await corsair.ashby.api.application.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `candidateId` | `string` | Yes | — | | `jobId` | `string` | Yes | — | | `interviewStageId` | `string` | No | — | | `sourceId` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > value: any, > customFieldDefinitionId: string, > title?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > candidateId: string, > jobId: string, > status?: string, > currentInterviewStageId?: string | null, > archiveReasonId?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ### info `application.info` Retrieve details for a specific application **Risk:** `read` ```ts theme={null} await corsair.ashby.api.application.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `applicationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > candidateId: string, > jobId: string, > status?: string, > currentInterviewStageId?: string | null, > archiveReasonId?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ### list `application.list` List applications filtered by candidate, job, or status **Risk:** `read` ```ts theme={null} await corsair.ashby.api.application.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `candidateId` | `string` | No | — | | `jobId` | `string` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > candidateId: string, > jobId: string, > status?: string, > currentInterviewStageId?: string | null, > archiveReasonId?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### transfer `application.transfer` Transfer an application to another job **Risk:** `write` ```ts theme={null} await corsair.ashby.api.application.transfer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `applicationId` | `string` | Yes | — | | `jobId` | `string` | Yes | — | | `interviewStageId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > candidateId: string, > jobId: string, > status?: string, > currentInterviewStageId?: string | null, > archiveReasonId?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ### update `application.update` Update application metadata or archive status **Risk:** `write` ```ts theme={null} await corsair.ashby.api.application.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `applicationId` | `string` | Yes | — | | `archiveReasonId` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > value: any, > customFieldDefinitionId: string, > title?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > candidateId: string, > jobId: string, > status?: string, > currentInterviewStageId?: string | null, > archiveReasonId?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ## Candidate ### addTag `candidate.addTag` Add a tag to a candidate **Risk:** `write` ```ts theme={null} await corsair.ashby.api.candidate.addTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `candidateId` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > primaryEmailAddress?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > emailAddresses?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > primaryPhoneNumber?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > phoneNumbers?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > socialLinks?: { > url: string, > type?: string > }[], > tags?: string[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > applicationIds?: string[], > fileIds?: string[], > createdAt?: string, > updatedAt?: string, > anonymizedAt?: string | null > } > ``` *** ### anonymize `candidate.anonymize` Anonymize candidate personally identifiable data for GDPR compliance **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.ashby.api.candidate.anonymize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `candidateId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > candidateId: string, > anonymizedAt?: string > } > ``` *** ### create `candidate.create` Create a new candidate in Ashby **Risk:** `write` ```ts theme={null} await corsair.ashby.api.candidate.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `email` | `string` | No | — | | `phoneNumber` | `string` | No | — | | `socialLinks` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `customFields` | `object[]` | No | — | | `notes` | `string` | No | — | > **socialLinks full type** > > ```ts theme={null} > { > url: string, > type?: string > }[] > ``` > **customFields full type** > > ```ts theme={null} > { > value: any, > customFieldDefinitionId: string, > title?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > primaryEmailAddress?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > emailAddresses?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > primaryPhoneNumber?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > phoneNumbers?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > socialLinks?: { > url: string, > type?: string > }[], > tags?: string[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > applicationIds?: string[], > fileIds?: string[], > createdAt?: string, > updatedAt?: string, > anonymizedAt?: string | null > } > ``` *** ### createNote `candidate.createNote` Create a note on a candidate record **Risk:** `write` ```ts theme={null} await corsair.ashby.api.candidate.createNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `candidateId` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > candidateId: string, > note: string, > authorUserId?: string, > createdAt?: string > } > ``` *** ### info `candidate.info` Retrieve detailed candidate information by ID **Risk:** `read` ```ts theme={null} await corsair.ashby.api.candidate.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `candidateId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > primaryEmailAddress?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > emailAddresses?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > primaryPhoneNumber?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > phoneNumbers?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > socialLinks?: { > url: string, > type?: string > }[], > tags?: string[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > applicationIds?: string[], > fileIds?: string[], > createdAt?: string, > updatedAt?: string, > anonymizedAt?: string | null > } > ``` *** ### list `candidate.list` List candidates with cursor-based pagination and time filters **Risk:** `read` ```ts theme={null} await corsair.ashby.api.candidate.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `createdAfter` | `string` | No | — | | `updatedAfter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > primaryEmailAddress?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > emailAddresses?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > primaryPhoneNumber?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > phoneNumbers?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > socialLinks?: { > url: string, > type?: string > }[], > tags?: string[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > applicationIds?: string[], > fileIds?: string[], > createdAt?: string, > updatedAt?: string, > anonymizedAt?: string | null > }[] > ``` *** ### listNotes `candidate.listNotes` List all notes for a specific candidate **Risk:** `read` ```ts theme={null} await corsair.ashby.api.candidate.listNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `candidateId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > candidateId: string, > note: string, > authorUserId?: string, > createdAt?: string > }[] > ``` *** ### removeTag `candidate.removeTag` Remove a tag from a candidate **Risk:** `write` ```ts theme={null} await corsair.ashby.api.candidate.removeTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `candidateId` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > primaryEmailAddress?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > emailAddresses?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > primaryPhoneNumber?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > phoneNumbers?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > socialLinks?: { > url: string, > type?: string > }[], > tags?: string[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > applicationIds?: string[], > fileIds?: string[], > createdAt?: string, > updatedAt?: string, > anonymizedAt?: string | null > } > ``` *** ### search `candidate.search` Search candidates by name, email address, or phone number **Risk:** `read` ```ts theme={null} await corsair.ashby.api.candidate.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `name` | `string` | No | — | | `phone` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > primaryEmailAddress?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > emailAddresses?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > primaryPhoneNumber?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > phoneNumbers?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > socialLinks?: { > url: string, > type?: string > }[], > tags?: string[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > applicationIds?: string[], > fileIds?: string[], > createdAt?: string, > updatedAt?: string, > anonymizedAt?: string | null > }[] > ``` *** ### update `candidate.update` Update candidate profile information and custom fields **Risk:** `write` ```ts theme={null} await corsair.ashby.api.candidate.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `candidateId` | `string` | Yes | — | | `name` | `string` | No | — | | `primaryEmailAddress` | `string` | No | — | | `primaryPhoneNumber` | `string` | No | — | | `tags` | `string[]` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > value: any, > customFieldDefinitionId: string, > title?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > primaryEmailAddress?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > emailAddresses?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > primaryPhoneNumber?: { > value: string, > type?: string, > isPrimary?: boolean > } | null, > phoneNumbers?: { > value: string, > type?: string, > isPrimary?: boolean > }[], > socialLinks?: { > url: string, > type?: string > }[], > tags?: string[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > applicationIds?: string[], > fileIds?: string[], > createdAt?: string, > updatedAt?: string, > anonymizedAt?: string | null > } > ``` *** ## Custom Field ### info `customField.info` Retrieve custom field definition details **Risk:** `read` ```ts theme={null} await corsair.ashby.api.customField.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customFieldDefinitionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > objectType: string, > fieldType: string, > isArchived?: boolean > } > ``` *** ### list `customField.list` List custom field definitions filtered by object type **Risk:** `read` ```ts theme={null} await corsair.ashby.api.customField.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `objectType` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > objectType: string, > fieldType: string, > isArchived?: boolean > }[] > ``` *** ### setValue `customField.setValue` Set a custom field value on a candidate, application, job, or offer **Risk:** `write` ```ts theme={null} await corsair.ashby.api.customField.setValue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `objectType` | `string` | Yes | — | | `objectId` | `string` | Yes | — | | `customFieldDefinitionId` | `string` | Yes | — | | `value` | `any` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > } > ``` *** ## Department ### archive `department.archive` Archive a department **Risk:** `destructive` ```ts theme={null} await corsair.ashby.api.department.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `departmentId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > } > ``` *** ### create `department.create` Create a new department **Risk:** `write` ```ts theme={null} await corsair.ashby.api.department.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `parentId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > } > ``` *** ### info `department.info` Retrieve department details by ID **Risk:** `read` ```ts theme={null} await corsair.ashby.api.department.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `departmentId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > } > ``` *** ### list `department.list` List all departments in the organization **Risk:** `read` ```ts theme={null} await corsair.ashby.api.department.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `includeArchived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > }[] > ``` *** ### update `department.update` Update department name or parent department **Risk:** `write` ```ts theme={null} await corsair.ashby.api.department.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `departmentId` | `string` | Yes | — | | `name` | `string` | No | — | | `parentId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > } > ``` *** ## Interview ### info `interview.info` Retrieve interview details by ID **Risk:** `read` ```ts theme={null} await corsair.ashby.api.interview.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interviewId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > interviewStageId?: string, > interviewPlanId?: string > } > ``` *** ### list `interview.list` List interviews for an interview plan **Risk:** `read` ```ts theme={null} await corsair.ashby.api.interview.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `interviewPlanId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > interviewStageId?: string, > interviewPlanId?: string > }[] > ``` *** ### scheduleInfo `interview.scheduleInfo` Retrieve details of an interview schedule **Risk:** `read` ```ts theme={null} await corsair.ashby.api.interview.scheduleInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interviewScheduleId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > applicationId: string, > interviewStageId?: string, > scheduledStartTime?: string | null, > scheduledEndTime?: string | null, > status?: string, > interviewers?: { > userId: string > }[] > } > ``` *** ### scheduleList `interview.scheduleList` List scheduled interviews for an application **Risk:** `read` ```ts theme={null} await corsair.ashby.api.interview.scheduleList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `applicationId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > applicationId: string, > interviewStageId?: string, > scheduledStartTime?: string | null, > scheduledEndTime?: string | null, > status?: string, > interviewers?: { > userId: string > }[] > }[] > ``` *** ### stageList `interview.stageList` List interview stages for a job or interview plan **Risk:** `read` ```ts theme={null} await corsair.ashby.api.interview.stageList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | No | — | | `interviewPlanId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > type?: string, > orderInJob?: number, > jobId?: string > }[] > ``` *** ## Job ### create `job.create` Create a new job in Ashby **Risk:** `write` ```ts theme={null} await corsair.ashby.api.job.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `departmentId` | `string` | No | — | | `locationId` | `string` | No | — | | `status` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > value: any, > customFieldDefinitionId: string, > title?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > status?: string, > departmentId?: string | null, > locationId?: string | null, > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > openings?: { > id: string, > identifier?: string, > isArchived?: boolean, > targetStartDate?: string | null > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ### info `job.info` Retrieve job details by job ID **Risk:** `read` ```ts theme={null} await corsair.ashby.api.job.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > status?: string, > departmentId?: string | null, > locationId?: string | null, > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > openings?: { > id: string, > identifier?: string, > isArchived?: boolean, > targetStartDate?: string | null > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ### list `job.list` List jobs with status, department, and location filters **Risk:** `read` ```ts theme={null} await corsair.ashby.api.job.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `status` | `string` | No | — | | `departmentId` | `string` | No | — | | `locationId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > status?: string, > departmentId?: string | null, > locationId?: string | null, > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > openings?: { > id: string, > identifier?: string, > isArchived?: boolean, > targetStartDate?: string | null > }[], > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### search `job.search` Search jobs by title or status **Risk:** `read` ```ts theme={null} await corsair.ashby.api.job.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > status?: string, > departmentId?: string | null, > locationId?: string | null, > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > openings?: { > id: string, > identifier?: string, > isArchived?: boolean, > targetStartDate?: string | null > }[], > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### update `job.update` Update job details, department, or status **Risk:** `write` ```ts theme={null} await corsair.ashby.api.job.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | | `title` | `string` | No | — | | `departmentId` | `string` | No | — | | `locationId` | `string` | No | — | | `status` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > value: any, > customFieldDefinitionId: string, > title?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > status?: string, > departmentId?: string | null, > locationId?: string | null, > hiringTeam?: { > userId: string, > role: string, > firstName?: string, > lastName?: string, > email?: string > }[], > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > openings?: { > id: string, > identifier?: string, > isArchived?: boolean, > targetStartDate?: string | null > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ## Job Posting ### info `jobPosting.info` Retrieve job posting information by ID **Risk:** `read` ```ts theme={null} await corsair.ashby.api.jobPosting.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobPostingId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > jobId: string, > departmentId?: string | null, > locationId?: string | null, > secondaryLocationIds?: string[], > isListed?: boolean, > publishedDate?: string | null, > teamNameHierarchy?: string[], > descriptionHtml?: string > } > ``` *** ### list `jobPosting.list` List published and unpublished job postings **Risk:** `read` ```ts theme={null} await corsair.ashby.api.jobPosting.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `jobId` | `string` | No | — | | `departmentId` | `string` | No | — | | `locationId` | `string` | No | — | | `listedOnly` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > title: string, > jobId: string, > departmentId?: string | null, > locationId?: string | null, > secondaryLocationIds?: string[], > isListed?: boolean, > publishedDate?: string | null, > teamNameHierarchy?: string[], > descriptionHtml?: string > }[] > ``` *** ## Location ### archive `location.archive` Archive a location **Risk:** `destructive` ```ts theme={null} await corsair.ashby.api.location.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `locationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > } > ``` *** ### create `location.create` Create a new location **Risk:** `write` ```ts theme={null} await corsair.ashby.api.location.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `parentId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > } > ``` *** ### info `location.info` Retrieve location details by ID **Risk:** `read` ```ts theme={null} await corsair.ashby.api.location.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `locationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > } > ``` *** ### list `location.list` List all locations in the organization **Risk:** `read` ```ts theme={null} await corsair.ashby.api.location.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `includeArchived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > }[] > ``` *** ### update `location.update` Update location name or hierarchy **Risk:** `write` ```ts theme={null} await corsair.ashby.api.location.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `locationId` | `string` | Yes | — | | `name` | `string` | No | — | | `parentId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > parentId?: string | null, > isArchived?: boolean > } > ``` *** ## Offer ### create `offer.create` Create a new job offer for an application **Risk:** `write` ```ts theme={null} await corsair.ashby.api.offer.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `applicationId` | `string` | Yes | — | | `salary` | `number` | No | — | | `currency` | `string` | No | — | | `startDate` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > value: any, > customFieldDefinitionId: string, > title?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > applicationId: string, > status?: string, > salary?: number | null, > currency?: string | null, > startDate?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ### info `offer.info` Retrieve details for a specific offer **Risk:** `read` ```ts theme={null} await corsair.ashby.api.offer.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offerId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > applicationId: string, > status?: string, > salary?: number | null, > currency?: string | null, > startDate?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ### list `offer.list` List offers filtered by application or status **Risk:** `read` ```ts theme={null} await corsair.ashby.api.offer.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `applicationId` | `string` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > applicationId: string, > status?: string, > salary?: number | null, > currency?: string | null, > startDate?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### update `offer.update` Update job offer details or status **Risk:** `write` ```ts theme={null} await corsair.ashby.api.offer.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offerId` | `string` | Yes | — | | `salary` | `number` | No | — | | `currency` | `string` | No | — | | `startDate` | `string` | No | — | | `status` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > value: any, > customFieldDefinitionId: string, > title?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > applicationId: string, > status?: string, > salary?: number | null, > currency?: string | null, > startDate?: string | null, > customFields?: { > value: any, > customFieldDefinitionId: string, > title?: string > }[], > createdAt?: string, > updatedAt?: string > } > ``` *** ## User ### info `user.info` Retrieve organization user details by ID **Risk:** `read` ```ts theme={null} await corsair.ashby.api.user.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > email: string, > globalRole?: string, > isEnabled?: boolean > } > ``` *** ### list `user.list` List users in the organization **Risk:** `read` ```ts theme={null} await corsair.ashby.api.user.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `syncToken` | `string` | No | — | | `isEnabled` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | | `moreDataAvailable` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `syncToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > email: string, > globalRole?: string, > isEnabled?: boolean > }[] > ``` *** ### search `user.search` Search users by name or email address **Risk:** `read` ```ts theme={null} await corsair.ashby.api.user.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > name: string, > email: string, > globalRole?: string, > isEnabled?: boolean > }[] > ``` *** ## Webhook ### create `webhook.create` Register a new webhook subscription in Ashby **Risk:** `write` ```ts theme={null} await corsair.ashby.api.webhook.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `requestActionNames` | `string[]` | Yes | — | | `description` | `string` | No | — | | `secretToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > url: string, > description?: string, > requestActionNames?: string[], > isEnabled?: boolean, > secretToken?: string > } > ``` *** ### delete `webhook.delete` Delete a webhook subscription **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.ashby.api.webhook.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > } > ``` *** ### info `webhook.info` Retrieve webhook configuration details by ID **Risk:** `read` ```ts theme={null} await corsair.ashby.api.webhook.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `results` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > url: string, > description?: string, > requestActionNames?: string[], > isEnabled?: boolean, > secretToken?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/ashby/database Ashby local sync: searchable entities, `.search()` filters, and operators. The Ashby plugin syncs data locally. Use `corsair.ashby.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Applications Path: `ashby.db.applications.search` ```ts theme={null} const rows = await corsair.ashby.db.applications.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `candidate_id` | `string` | equals, contains, startsWith, endsWith, in | | `job_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `current_interview_stage_id` | `string` | equals, contains, startsWith, endsWith, in | | `archive_reason_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Candidates Path: `ashby.db.candidates.search` ```ts theme={null} const rows = await corsair.ashby.db.candidates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `primary_email_address` | `string` | equals, contains, startsWith, endsWith, in | | `primary_phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Departments Path: `ashby.db.departments.search` ```ts theme={null} const rows = await corsair.ashby.db.departments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `is_archived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Job Postings Path: `ashby.db.jobPostings.search` ```ts theme={null} const rows = await corsair.ashby.db.jobPostings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `job_id` | `string` | equals, contains, startsWith, endsWith, in | | `department_id` | `string` | equals, contains, startsWith, endsWith, in | | `location_id` | `string` | equals, contains, startsWith, endsWith, in | | `is_listed` | `boolean` | equals | | `published_date` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `ashby.db.jobs.search` ```ts theme={null} const rows = await corsair.ashby.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `department_id` | `string` | equals, contains, startsWith, endsWith, in | | `location_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Locations Path: `ashby.db.locations.search` ```ts theme={null} const rows = await corsair.ashby.db.locations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `is_archived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Offers Path: `ashby.db.offers.search` ```ts theme={null} const rows = await corsair.ashby.db.offers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `application_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `salary` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `start_date` | `date` | equals, before, after, between | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `ashby.db.users.search` ```ts theme={null} const rows = await corsair.ashby.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `global_role` | `string` | equals, contains, startsWith, endsWith, in | | `is_enabled` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/ashby/overview Ashby plugin for Corsair Use **Ashby** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 52 typed API operations * 8 synced entities (`applications`, `candidates`, `departments`, `jobPostings`, `jobs`, `locations`, and 2 more) for fast `.search()` / `.list()` * 10 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ashby ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ashby ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ashby ``` ```bash bun theme={null} bun add corsair @corsair-dev/ashby ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ashby } from '@corsair-dev/ashby'; export const corsair = createCorsair({ plugins: [ ashby(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ashby() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ashby', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`apiKey.info`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ashby.api.apiKey.info({}); ``` **`application.changeStage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ashby.api.application.changeStage({}); ``` See the full list on the [API](/plugins/ashby/api) page. ## Query synced data Synced entities support `tenant.ashby.db..search()` and `.list()`: `applications`, `candidates`, `departments`, `jobPostings`, `jobs`, `locations`, `offers`, `users`. See [Database](/plugins/ashby/database) for filters and operators. ## Webhooks This plugin registers **10** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/ashby/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/ashby/api)** > > Every `ashby.api.*` operation with input and output types. > **[Database](/plugins/ashby/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/ashby/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/ashby/webhooks Ashby incoming webhooks: event paths, payloads, and response data. The Ashby plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/ashby/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `application` * `submit` (`application.submit`) * `update` (`application.update`) * `candidate` * `hire` (`candidate.hire`) * `stageChange` (`candidate.stageChange`) * `interview` * `planTransition` (`interview.planTransition`) * `scheduleCreate` (`interview.scheduleCreate`) * `scheduleUpdate` (`interview.scheduleUpdate`) * `offer` * `create` (`offer.create`) * `delete` (`offer.delete`) * `update` (`offer.update`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Application ### Submit `application.submit` Triggered when a candidate application is submitted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `applicationSubmit` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > applicationId?: string, > candidateId?: string, > jobId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: applicationSubmit, > data: { > applicationId?: string, > candidateId?: string, > jobId?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { application: { submit: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Update `application.update` Triggered when an application is updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `applicationUpdate` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > applicationId?: string, > candidateId?: string, > jobId?: string, > status?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: applicationUpdate, > data: { > applicationId?: string, > candidateId?: string, > jobId?: string, > status?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { application: { update: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Candidate ### Hire `candidate.hire` Triggered when a candidate is hired **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `candidateHire` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > candidateId?: string, > applicationId?: string, > offerId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: candidateHire, > data: { > candidateId?: string, > applicationId?: string, > offerId?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { candidate: { hire: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Stage Change `candidate.stageChange` Triggered when a candidate moves to a different interview stage **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `candidateStageChange` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > candidateId?: string, > applicationId?: string, > jobId?: string, > previousInterviewStageId?: string | null, > currentInterviewStageId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: candidateStageChange, > data: { > candidateId?: string, > applicationId?: string, > jobId?: string, > previousInterviewStageId?: string | null, > currentInterviewStageId?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { candidate: { stageChange: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Interview ### Plan Transition `interview.planTransition` Triggered during interview plan transitions **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `interviewPlanTransition` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > applicationId?: string, > interviewPlanId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: interviewPlanTransition, > data: { > applicationId?: string, > interviewPlanId?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { interview: { planTransition: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Schedule Create `interview.scheduleCreate` Triggered when an interview schedule is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `interviewScheduleCreate` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > interviewScheduleId?: string, > applicationId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: interviewScheduleCreate, > data: { > interviewScheduleId?: string, > applicationId?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { interview: { scheduleCreate: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Schedule Update `interview.scheduleUpdate` Triggered when an interview schedule is updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `interviewScheduleUpdate` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > interviewScheduleId?: string, > applicationId?: string, > status?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: interviewScheduleUpdate, > data: { > interviewScheduleId?: string, > applicationId?: string, > status?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { interview: { scheduleUpdate: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Offer ### Create `offer.create` Triggered when a job offer is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `offerCreate` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > offerId?: string, > applicationId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: offerCreate, > data: { > offerId?: string, > applicationId?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { offer: { create: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Delete `offer.delete` Triggered when a job offer is deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `offerDelete` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > offerId?: string, > applicationId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: offerDelete, > data: { > offerId?: string, > applicationId?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { offer: { delete: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Update `offer.update` Triggered when a job offer is updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookActionId` | `string` | Yes | — | | `action` | `offerUpdate` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > offerId?: string, > applicationId?: string, > status?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookActionId: string, > action: offerUpdate, > data: { > offerId?: string, > applicationId?: string, > status?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} ashby({ webhookHooks: { offer: { update: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/asindataapi/api API reference for AsinData API: every `asindataapi.api.*` operation with input and output types. Every `asindataapi.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Categories ### get `categories.get` Retrieve Amazon category data and products within a category **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.categories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amazon_domain` | `string` | No | — | | `category_id` | `string` | No | — | | `url` | `string` | No | — | | `refinements` | `string` | No | — | | `sort_by` | `most_recent \| price_low_to_high \| price_high_to_low \| featured \| average_review` | No | — | | `page` | `number` | No | — | | `max_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `request_parameters` | `object` | No | — | | `request_metadata` | `object` | No | — | | `category_results` | `object[]` | No | — | | `pagination` | `object` | No | — | | `refinements` | `object` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **request\_parameters full type** > > ```ts theme={null} > { > } > ``` > **request\_metadata full type** > > ```ts theme={null} > { > id?: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > amazon_url?: string > } > ``` > **category\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > asin?: string, > link?: string, > image?: string, > is_prime?: boolean, > rating?: number, > ratings_total?: number, > sponsored?: boolean, > price?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }, > prices?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }[] > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` > **refinements full type** > > ```ts theme={null} > { > } > ``` *** ## Collections ### create `collections.create` Create a new Collection for batch data collection **Risk:** `write` ```ts theme={null} await corsair.asindataapi.api.collections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `enabled` | `boolean` | No | — | | `schedule_type` | `monthly \| weekly \| daily \| minutes \| manual` | No | — | | `priority` | `highest \| high \| normal \| low \| lowest` | No | — | | `schedule_days_of_month` | `number[]` | No | — | | `schedule_days_of_week` | `number[]` | No | — | | `schedule_hours` | `number[]` | No | — | | `schedule_minutes` | `every_minute \| every_5_minutes \| every_10_minutes \| every_15_minutes \| every_20_minutes \| every_25_minutes \| every_30_minutes \| every_hour` | No | — | | `destination_ids` | `string[]` | No | — | | `notification_email` | `string` | No | — | | `notification_webhook` | `string` | No | — | | `notification_as_json` | `boolean` | No | — | | `notification_as_jsonlines` | `boolean` | No | — | | `notification_as_csv` | `boolean` | No | — | | `notification_csv_fields` | `string` | No | — | | `requests_type` | `mixed \| product \| offers \| search \| category` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `collection` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **collection full type** > > ```ts theme={null} > { > id: string, > created_at?: string | null, > last_run?: string | null, > name?: string | null, > schedule_type?: monthly | weekly | daily | minutes | manual | null, > priority?: highest | high | normal | low | lowest | null, > destination_ids?: string[] | null, > enabled?: boolean | null, > status?: idle | queued | running | null, > request_total_count?: number | null, > request_page_count?: number | null, > requests_total_count?: number | null, > requests_page_count?: number | null, > credits_required?: number | null, > next_result_set_id?: number | null, > results_count?: number | null, > schedule_hours?: number[] | null, > schedule_days_of_week?: number[] | null, > schedule_days_of_month?: number[] | null, > schedule_minutes?: string | null, > notification_email?: string | null, > notification_webhook?: string | null, > notification_as_json?: boolean | null, > notification_as_jsonlines?: boolean | null, > notification_as_csv?: boolean | null, > notification_csv_fields?: string | null, > request_type?: string | null, > request_type_locked?: boolean | null, > requests_type?: string | null > } > ``` *** ### delete `collections.delete` Delete a Collection **Risk:** `destructive` ```ts theme={null} await corsair.asindataapi.api.collections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` *** ### get `collections.get` Get details of a specific Collection including status and request counts **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.collections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `collection` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **collection full type** > > ```ts theme={null} > { > id: string, > created_at?: string | null, > last_run?: string | null, > name?: string | null, > schedule_type?: monthly | weekly | daily | minutes | manual | null, > priority?: highest | high | normal | low | lowest | null, > destination_ids?: string[] | null, > enabled?: boolean | null, > status?: idle | queued | running | null, > request_total_count?: number | null, > request_page_count?: number | null, > requests_total_count?: number | null, > requests_page_count?: number | null, > credits_required?: number | null, > next_result_set_id?: number | null, > results_count?: number | null, > schedule_hours?: number[] | null, > schedule_days_of_week?: number[] | null, > schedule_days_of_month?: number[] | null, > schedule_minutes?: string | null, > notification_email?: string | null, > notification_webhook?: string | null, > notification_as_json?: boolean | null, > notification_as_jsonlines?: boolean | null, > notification_as_csv?: boolean | null, > notification_csv_fields?: string | null, > request_type?: string | null, > request_type_locked?: boolean | null, > requests_type?: string | null > } > ``` *** ### list `collections.list` List all Collections on the account **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.collections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `only_with_results` | `boolean` | No | — | | `only_without_results` | `boolean` | No | — | | `search_term` | `string` | No | — | | `search_type` | `contains \| starts_with \| ends_with \| exact` | No | — | | `status` | `all \| idle \| queued \| running` | No | — | | `created_before` | `string` | No | — | | `created_after` | `string` | No | — | | `last_run_before` | `string` | No | — | | `last_run_after` | `string` | No | — | | `destination_id` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `sort_by` | `created_at \| last_run \| name \| priority \| status` | No | — | | `sort_direction` | `ascending \| descending` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `total_count` | `number` | No | — | | `total_pages` | `number` | No | — | | `current_page` | `number` | No | — | | `count_this_page` | `number` | No | — | | `collections` | `object[]` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **collections full type** > > ```ts theme={null} > { > id: string, > created_at?: string | null, > last_run?: string | null, > name?: string | null, > schedule_type?: monthly | weekly | daily | minutes | manual | null, > priority?: highest | high | normal | low | lowest | null, > destination_ids?: string[] | null, > enabled?: boolean | null, > status?: idle | queued | running | null, > request_total_count?: number | null, > request_page_count?: number | null, > requests_total_count?: number | null, > requests_page_count?: number | null, > credits_required?: number | null, > next_result_set_id?: number | null, > results_count?: number | null, > schedule_hours?: number[] | null, > schedule_days_of_week?: number[] | null, > schedule_days_of_month?: number[] | null, > schedule_minutes?: string | null, > notification_email?: string | null, > notification_webhook?: string | null, > notification_as_json?: boolean | null, > notification_as_jsonlines?: boolean | null, > notification_as_csv?: boolean | null, > notification_csv_fields?: string | null, > request_type?: string | null, > request_type_locked?: boolean | null, > requests_type?: string | null > }[] > ``` *** ### start `collections.start` Start a Collection to run all its requests immediately **Risk:** `write` ```ts theme={null} await corsair.asindataapi.api.collections.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` *** ### update `collections.update` Update an existing Collection's configuration (only when not running) **Risk:** `write` ```ts theme={null} await corsair.asindataapi.api.collections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `enabled` | `boolean` | No | — | | `schedule_type` | `monthly \| weekly \| daily \| minutes \| manual` | No | — | | `priority` | `highest \| high \| normal \| low \| lowest` | No | — | | `schedule_days_of_month` | `number[]` | No | — | | `schedule_days_of_week` | `number[]` | No | — | | `schedule_hours` | `number[]` | No | — | | `schedule_minutes` | `every_minute \| every_5_minutes \| every_10_minutes \| every_15_minutes \| every_20_minutes \| every_25_minutes \| every_30_minutes \| every_hour` | No | — | | `destination_ids` | `string[]` | No | — | | `notification_email` | `string` | No | — | | `notification_webhook` | `string` | No | — | | `notification_as_json` | `boolean` | No | — | | `notification_as_jsonlines` | `boolean` | No | — | | `notification_as_csv` | `boolean` | No | — | | `notification_csv_fields` | `string` | No | — | | `requests_type` | `mixed \| product \| offers \| search \| category` | No | — | | `collection_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `collection` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **collection full type** > > ```ts theme={null} > { > id: string, > created_at?: string | null, > last_run?: string | null, > name?: string | null, > schedule_type?: monthly | weekly | daily | minutes | manual | null, > priority?: highest | high | normal | low | lowest | null, > destination_ids?: string[] | null, > enabled?: boolean | null, > status?: idle | queued | running | null, > request_total_count?: number | null, > request_page_count?: number | null, > requests_total_count?: number | null, > requests_page_count?: number | null, > credits_required?: number | null, > next_result_set_id?: number | null, > results_count?: number | null, > schedule_hours?: number[] | null, > schedule_days_of_week?: number[] | null, > schedule_days_of_month?: number[] | null, > schedule_minutes?: string | null, > notification_email?: string | null, > notification_webhook?: string | null, > notification_as_json?: boolean | null, > notification_as_jsonlines?: boolean | null, > notification_as_csv?: boolean | null, > notification_csv_fields?: string | null, > request_type?: string | null, > request_type_locked?: boolean | null, > requests_type?: string | null > } > ``` *** ## Destinations ### create `destinations.create` Create a new Destination for exporting Collection Result Sets **Risk:** `write` ```ts theme={null} await corsair.asindataapi.api.destinations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `s3 \| gcs \| azure \| oss \| s3compatible` | Yes | — | | `enabled` | `boolean` | Yes | — | | `s3_access_key_id` | `string` | No | — | | `s3_secret_access_key` | `string` | No | — | | `s3_bucket_name` | `string` | No | — | | `s3_path_prefix` | `string` | No | — | | `s3_endpoint` | `string` | No | — | | `s3_region` | `string` | No | — | | `gcs_access_key` | `string` | No | — | | `gcs_secret_key` | `string` | No | — | | `gcs_bucket_name` | `string` | No | — | | `gcs_path_prefix` | `string` | No | — | | `azure_account_name` | `string` | No | — | | `azure_account_key` | `string` | No | — | | `azure_container_name` | `string` | No | — | | `azure_path_prefix` | `string` | No | — | | `oss_access_key` | `string` | No | — | | `oss_secret_key` | `string` | No | — | | `oss_bucket_name` | `string` | No | — | | `oss_region_id` | `string` | No | — | | `oss_path_prefix` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `usage` | `object` | No | — | | `destination` | `object` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **usage full type** > > ```ts theme={null} > { > used?: number, > limit?: number, > available?: number > } > ``` > **destination full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: s3 | gcs | azure | oss | s3compatible | null, > enabled?: boolean | null, > used_by?: number | null, > s3_bucket_name?: string | null, > s3_path_prefix?: string | null, > s3_endpoint?: string | null, > s3_region?: string | null, > gcs_bucket_name?: string | null, > gcs_path_prefix?: string | null, > azure_account_name?: string | null, > azure_container_name?: string | null, > azure_path_prefix?: string | null, > oss_bucket_name?: string | null, > oss_region_id?: string | null, > oss_path_prefix?: string | null > } > ``` *** ### delete `destinations.delete` Delete a Destination **Risk:** `destructive` ```ts theme={null} await corsair.asindataapi.api.destinations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `destination_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` *** ### list `destinations.list` List all configured Destinations (S3, GCS, Azure Blob, S3-compatible) **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.destinations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `search_term` | `string` | No | — | | `sort_by` | `type \| name` | No | — | | `sort_direction` | `ascending \| descending` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `usage` | `object` | No | — | | `destinations` | `object[]` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **usage full type** > > ```ts theme={null} > { > used?: number, > limit?: number, > available?: number > } > ``` > **destinations full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: s3 | gcs | azure | oss | s3compatible | null, > enabled?: boolean | null, > used_by?: number | null, > s3_bucket_name?: string | null, > s3_path_prefix?: string | null, > s3_endpoint?: string | null, > s3_region?: string | null, > gcs_bucket_name?: string | null, > gcs_path_prefix?: string | null, > azure_account_name?: string | null, > azure_container_name?: string | null, > azure_path_prefix?: string | null, > oss_bucket_name?: string | null, > oss_region_id?: string | null, > oss_path_prefix?: string | null > }[] > ``` *** ### update `destinations.update` Update an existing Destination's configuration **Risk:** `write` ```ts theme={null} await corsair.asindataapi.api.destinations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `destination_id` | `string` | Yes | — | | `name` | `string` | No | — | | `enabled` | `boolean` | No | — | | `s3_access_key_id` | `string` | No | — | | `s3_secret_access_key` | `string` | No | — | | `s3_bucket_name` | `string` | No | — | | `s3_path_prefix` | `string` | No | — | | `s3_endpoint` | `string` | No | — | | `s3_region` | `string` | No | — | | `gcs_access_key` | `string` | No | — | | `gcs_secret_key` | `string` | No | — | | `gcs_bucket_name` | `string` | No | — | | `gcs_path_prefix` | `string` | No | — | | `azure_account_name` | `string` | No | — | | `azure_account_key` | `string` | No | — | | `azure_container_name` | `string` | No | — | | `azure_path_prefix` | `string` | No | — | | `oss_access_key` | `string` | No | — | | `oss_secret_key` | `string` | No | — | | `oss_bucket_name` | `string` | No | — | | `oss_region_id` | `string` | No | — | | `oss_path_prefix` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `destination` | `object` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **destination full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: s3 | gcs | azure | oss | s3compatible | null, > enabled?: boolean | null, > used_by?: number | null, > s3_bucket_name?: string | null, > s3_path_prefix?: string | null, > s3_endpoint?: string | null, > s3_region?: string | null, > gcs_bucket_name?: string | null, > gcs_path_prefix?: string | null, > azure_account_name?: string | null, > azure_container_name?: string | null, > azure_path_prefix?: string | null, > oss_bucket_name?: string | null, > oss_region_id?: string | null, > oss_path_prefix?: string | null > } > ``` *** ## Identifiers ### resolve `identifiers.resolve` Resolve GTIN, ISBN, UPC, or EAN identifiers to ASINs automatically **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.identifiers.resolve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gtin` | `string` | Yes | — | | `amazon_domain` | `string` | No | — | | `skip_gtin_cache` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > request_info: { > success: true, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > }, > request_parameters?: { > }, > request_metadata?: { > id?: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > amazon_url?: string > }, > product: { > title?: string, > asin: string, > link?: string, > brand?: string, > description?: string, > rating?: number, > ratings_total?: number, > reviews_total?: number, > main_image?: { > link?: string > }, > images?: { > }[], > feature_bullets?: string[], > attributes?: { > name: string, > value: string > }[], > categories?: { > name?: string, > link?: string, > category_id?: string > }[], > price?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }, > buybox_winner?: { > } > } > } | { > request_info: { > success: false, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > }, > request_parameters?: { > }, > request_metadata?: { > id?: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > amazon_url?: string > }, > product?: { > title?: string, > asin?: string, > link?: string, > brand?: string, > description?: string, > rating?: number, > ratings_total?: number, > reviews_total?: number, > main_image?: { > link?: string > }, > images?: { > }[], > feature_bullets?: string[], > attributes?: { > name: string, > value: string > }[], > categories?: { > name?: string, > link?: string, > category_id?: string > }[], > price?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }, > buybox_winner?: { > } > } > } > ``` *** ## Offers ### get `offers.get` Retrieve product offers, pricing, availability, and seller information **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.offers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amazon_domain` | `string` | No | — | | `asin` | `string` | No | — | | `url` | `string` | No | — | | `offers_prime` | `boolean` | No | — | | `offers_free_shipping` | `boolean` | No | — | | `offers_condition_new` | `boolean` | No | — | | `show_different_asins` | `boolean` | No | — | | `page` | `number` | No | — | | `max_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `request_parameters` | `object` | No | — | | `request_metadata` | `object` | No | — | | `product` | `object` | No | — | | `offers` | `object[]` | No | — | | `pagination` | `object` | No | — | | `available_filters` | `object` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **request\_parameters full type** > > ```ts theme={null} > { > } > ``` > **request\_metadata full type** > > ```ts theme={null} > { > id?: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > amazon_url?: string > } > ``` > **product full type** > > ```ts theme={null} > { > } > ``` > **offers full type** > > ```ts theme={null} > { > position?: number, > is_prime?: boolean, > buybox_winner?: boolean, > offer_id?: string, > offer_asin?: string, > price?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }, > condition?: { > }, > seller?: { > }, > delivery?: { > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` > **available\_filters full type** > > ```ts theme={null} > { > } > ``` *** ## Products ### get `products.get` Retrieve Amazon product details by ASIN, URL, or GTIN/ISBN/UPC/EAN **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.products.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amazon_domain` | `string` | No | — | | `asin` | `string` | No | — | | `url` | `string` | No | — | | `gtin` | `string` | No | — | | `skip_gtin_cache` | `boolean` | No | — | | `include_summarization_attributes` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > request_info: { > success: true, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > }, > request_parameters?: { > }, > request_metadata?: { > id?: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > amazon_url?: string > }, > product: { > title?: string, > asin: string, > link?: string, > brand?: string, > description?: string, > rating?: number, > ratings_total?: number, > reviews_total?: number, > main_image?: { > link?: string > }, > images?: { > }[], > feature_bullets?: string[], > attributes?: { > name: string, > value: string > }[], > categories?: { > name?: string, > link?: string, > category_id?: string > }[], > price?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }, > buybox_winner?: { > } > } > } | { > request_info: { > success: false, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > }, > request_parameters?: { > }, > request_metadata?: { > id?: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > amazon_url?: string > }, > product?: { > title?: string, > asin?: string, > link?: string, > brand?: string, > description?: string, > rating?: number, > ratings_total?: number, > reviews_total?: number, > main_image?: { > link?: string > }, > images?: { > }[], > feature_bullets?: string[], > attributes?: { > name: string, > value: string > }[], > categories?: { > name?: string, > link?: string, > category_id?: string > }[], > price?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }, > buybox_winner?: { > } > } > } > ``` *** ## Requests ### add `requests.add` Add Requests to a Collection (up to 1000 per call) **Risk:** `write` ```ts theme={null} await corsair.asindataapi.api.requests.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | | `requests` | `object[]` | Yes | — | > **requests full type** > > ```ts theme={null} > { > type?: product | offers | category | search | reviews | seller_profile | autocomplete, > amazon_domain?: string, > asin?: string, > url?: string, > gtin?: string, > search_term?: string, > category_id?: string, > refinements?: string, > sort_by?: most_recent | price_low_to_high | price_high_to_low | featured | average_review, > exclude_sponsored?: boolean, > direct_search?: boolean, > page?: number, > max_page?: number, > include_html?: boolean, > skip_gtin_cache?: boolean, > show_different_asins?: boolean, > custom_id?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `collection` | `object` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **collection full type** > > ```ts theme={null} > { > id: string, > created_at?: string | null, > last_run?: string | null, > name?: string | null, > schedule_type?: monthly | weekly | daily | minutes | manual | null, > priority?: highest | high | normal | low | lowest | null, > destination_ids?: string[] | null, > enabled?: boolean | null, > status?: idle | queued | running | null, > request_total_count?: number | null, > request_page_count?: number | null, > requests_total_count?: number | null, > requests_page_count?: number | null, > credits_required?: number | null, > next_result_set_id?: number | null, > results_count?: number | null, > schedule_hours?: number[] | null, > schedule_days_of_week?: number[] | null, > schedule_days_of_month?: number[] | null, > schedule_minutes?: string | null, > notification_email?: string | null, > notification_webhook?: string | null, > notification_as_json?: boolean | null, > notification_as_jsonlines?: boolean | null, > notification_as_csv?: boolean | null, > notification_csv_fields?: string | null, > request_type?: string | null, > request_type_locked?: boolean | null, > requests_type?: string | null > } > ``` *** ### clear `requests.clear` Bulk-delete multiple Requests from a Collection by their IDs **Risk:** `destructive` ```ts theme={null} await corsair.asindataapi.api.requests.clear({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | | `request_ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` *** ### delete `requests.delete` Delete a single Request from a Collection **Risk:** `destructive` ```ts theme={null} await corsair.asindataapi.api.requests.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` *** ### list `requests.list` List all Requests in a Collection (paginated, 1000 per page) **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.requests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `collection_id` | `string` | No | — | | `requests_page_current` | `number` | No | — | | `requests_page_count` | `number` | No | — | | `requests_total_count` | `number` | No | — | | `requests` | `object[]` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **requests full type** > > ```ts theme={null} > { > id: string, > custom_id?: string | null, > type?: product | offers | category | search | reviews | seller_profile | autocomplete | null, > amazon_domain?: string | null, > asin?: string | null, > url?: string | null, > gtin?: string | null, > search_term?: string | null, > category_id?: string | null, > refinements?: string | null, > sort_by?: string | null, > exclude_sponsored?: boolean | null, > direct_search?: boolean | null, > page?: number | null, > max_page?: number | null, > include_html?: boolean | null, > skip_gtin_cache?: boolean | null, > show_different_asins?: boolean | null > }[] > ``` *** ### update `requests.update` Update a single Request within a Collection **Risk:** `write` ```ts theme={null} await corsair.asindataapi.api.requests.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | | `request_id` | `string` | Yes | — | | `type` | `product \| offers \| category \| search \| reviews \| seller_profile \| autocomplete` | No | — | | `amazon_domain` | `string` | No | — | | `asin` | `string` | No | — | | `url` | `string` | No | — | | `gtin` | `string` | No | — | | `search_term` | `string` | No | — | | `category_id` | `string` | No | — | | `refinements` | `string` | No | — | | `sort_by` | `most_recent \| price_low_to_high \| price_high_to_low \| featured \| average_review` | No | — | | `exclude_sponsored` | `boolean` | No | — | | `direct_search` | `boolean` | No | — | | `page` | `number` | No | — | | `max_page` | `number` | No | — | | `include_html` | `boolean` | No | — | | `skip_gtin_cache` | `boolean` | No | — | | `show_different_asins` | `boolean` | No | — | | `custom_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `request` | `object` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **request full type** > > ```ts theme={null} > { > type?: product | offers | category | search | reviews | seller_profile | autocomplete, > amazon_domain?: string, > asin?: string, > url?: string, > gtin?: string, > search_term?: string, > category_id?: string, > refinements?: string, > sort_by?: most_recent | price_low_to_high | price_high_to_low | featured | average_review, > exclude_sponsored?: boolean, > direct_search?: boolean, > page?: number, > max_page?: number, > include_html?: boolean, > skip_gtin_cache?: boolean, > show_different_asins?: boolean, > custom_id?: string > } > ``` *** ## Result Sets ### get `resultSets.get` Get a specific Result Set with download links **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.resultSets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | | `result_set_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `collection_id` | `string` | No | — | | `result` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **result full type** > > ```ts theme={null} > { > id: number, > collection_id?: string | null, > started_at?: string | null, > ended_at?: string | null, > expires_at?: string | null, > results_page_count?: number | null, > requests_completed?: number | null, > requests_failed?: number | null, > requests_total?: number | null, > download_links?: { > json?: { > pages?: string[] | null, > all_pages?: string | null > } | null, > jsonlines?: { > pages?: string[] | null, > all_pages?: string | null > } | null, > csv?: { > pages?: string[] | null, > all_pages?: string | null > } | null > } | null, > webhook_status?: { > } | null, > destination_status?: { > } | null > } > ``` *** ### list `resultSets.list` List all Result Sets for a Collection **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.resultSets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collection_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `collection_id` | `string` | No | — | | `collection` | `object` | No | — | | `results_count` | `number` | No | — | | `results` | `object[]` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **collection full type** > > ```ts theme={null} > { > id: string, > created_at?: string | null, > last_run?: string | null, > name?: string | null, > schedule_type?: monthly | weekly | daily | minutes | manual | null, > priority?: highest | high | normal | low | lowest | null, > destination_ids?: string[] | null, > enabled?: boolean | null, > status?: idle | queued | running | null, > request_total_count?: number | null, > request_page_count?: number | null, > requests_total_count?: number | null, > requests_page_count?: number | null, > credits_required?: number | null, > next_result_set_id?: number | null, > results_count?: number | null, > schedule_hours?: number[] | null, > schedule_days_of_week?: number[] | null, > schedule_days_of_month?: number[] | null, > schedule_minutes?: string | null, > notification_email?: string | null, > notification_webhook?: string | null, > notification_as_json?: boolean | null, > notification_as_jsonlines?: boolean | null, > notification_as_csv?: boolean | null, > notification_csv_fields?: string | null, > request_type?: string | null, > request_type_locked?: boolean | null, > requests_type?: string | null > } > ``` > **results full type** > > ```ts theme={null} > { > id: number, > collection_id?: string | null, > started_at?: string | null, > ended_at?: string | null, > expires_at?: string | null, > results_page_count?: number | null, > requests_completed?: number | null, > requests_failed?: number | null, > requests_total?: number | null, > download_links?: { > json?: { > pages?: string[] | null, > all_pages?: string | null > } | null, > jsonlines?: { > pages?: string[] | null, > all_pages?: string | null > } | null, > csv?: { > pages?: string[] | null, > all_pages?: string | null > } | null > } | null, > webhook_status?: { > } | null, > destination_status?: { > } | null > }[] > ``` *** ## Search ### get `search.get` Search Amazon products by keywords across supported Amazon domains **Risk:** `read` ```ts theme={null} await corsair.asindataapi.api.search.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amazon_domain` | `string` | No | — | | `search_term` | `string` | No | — | | `url` | `string` | No | — | | `category_id` | `string` | No | — | | `refinements` | `string` | No | — | | `sort_by` | `most_recent \| price_low_to_high \| price_high_to_low \| featured \| average_review` | No | — | | `exclude_sponsored` | `boolean` | No | — | | `direct_search` | `boolean` | No | — | | `page` | `number` | No | — | | `max_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `request_parameters` | `object` | No | — | | `request_metadata` | `object` | No | — | | `search_results` | `object[]` | No | — | | `pagination` | `object` | No | — | | `refinements` | `object` | No | — | > **request\_info full type** > > ```ts theme={null} > { > success: boolean, > credits_used?: number, > credits_remaining?: number, > credits_reset_at?: string, > message?: string, > type?: string > } > ``` > **request\_parameters full type** > > ```ts theme={null} > { > } > ``` > **request\_metadata full type** > > ```ts theme={null} > { > id?: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > amazon_url?: string > } > ``` > **search\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > asin?: string, > link?: string, > image?: string, > is_prime?: boolean, > rating?: number, > ratings_total?: number, > sponsored?: boolean, > price?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }, > prices?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }[] > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` > **refinements full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/asindataapi/database AsinData API local sync: searchable entities, `.search()` filters, and operators. The AsinData API plugin syncs data locally. Use `corsair.asindataapi.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Collections Path: `asindataapi.db.collections.search` ```ts theme={null} const rows = await corsair.asindataapi.db.collections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_run` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `enabled` | `boolean` | equals | | `request_total_count` | `number` | equals, gt, gte, lt, lte, in | | `request_page_count` | `number` | equals, gt, gte, lt, lte, in | | `requests_total_count` | `number` | equals, gt, gte, lt, lte, in | | `requests_page_count` | `number` | equals, gt, gte, lt, lte, in | | `credits_required` | `number` | equals, gt, gte, lt, lte, in | | `next_result_set_id` | `number` | equals, gt, gte, lt, lte, in | | `results_count` | `number` | equals, gt, gte, lt, lte, in | | `schedule_minutes` | `string` | equals, contains, startsWith, endsWith, in | | `notification_email` | `string` | equals, contains, startsWith, endsWith, in | | `notification_webhook` | `string` | equals, contains, startsWith, endsWith, in | | `notification_as_json` | `boolean` | equals | | `notification_as_jsonlines` | `boolean` | equals | | `notification_as_csv` | `boolean` | equals | | `notification_csv_fields` | `string` | equals, contains, startsWith, endsWith, in | | `request_type` | `string` | equals, contains, startsWith, endsWith, in | | `request_type_locked` | `boolean` | equals | | `requests_type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Destinations Path: `asindataapi.db.destinations.search` ```ts theme={null} const rows = await corsair.asindataapi.db.destinations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `enabled` | `boolean` | equals | | `used_by` | `number` | equals, gt, gte, lt, lte, in | | `s3_bucket_name` | `string` | equals, contains, startsWith, endsWith, in | | `s3_path_prefix` | `string` | equals, contains, startsWith, endsWith, in | | `s3_endpoint` | `string` | equals, contains, startsWith, endsWith, in | | `s3_region` | `string` | equals, contains, startsWith, endsWith, in | | `gcs_bucket_name` | `string` | equals, contains, startsWith, endsWith, in | | `gcs_path_prefix` | `string` | equals, contains, startsWith, endsWith, in | | `azure_account_name` | `string` | equals, contains, startsWith, endsWith, in | | `azure_container_name` | `string` | equals, contains, startsWith, endsWith, in | | `azure_path_prefix` | `string` | equals, contains, startsWith, endsWith, in | | `oss_bucket_name` | `string` | equals, contains, startsWith, endsWith, in | | `oss_region_id` | `string` | equals, contains, startsWith, endsWith, in | | `oss_path_prefix` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Requests Path: `asindataapi.db.requests.search` ```ts theme={null} const rows = await corsair.asindataapi.db.requests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `custom_id` | `string` | equals, contains, startsWith, endsWith, in | | `amazon_domain` | `string` | equals, contains, startsWith, endsWith, in | | `asin` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `gtin` | `string` | equals, contains, startsWith, endsWith, in | | `search_term` | `string` | equals, contains, startsWith, endsWith, in | | `category_id` | `string` | equals, contains, startsWith, endsWith, in | | `refinements` | `string` | equals, contains, startsWith, endsWith, in | | `sort_by` | `string` | equals, contains, startsWith, endsWith, in | | `exclude_sponsored` | `boolean` | equals | | `direct_search` | `boolean` | equals | | `page` | `number` | equals, gt, gte, lt, lte, in | | `max_page` | `number` | equals, gt, gte, lt, lte, in | | `include_html` | `boolean` | equals | | `skip_gtin_cache` | `boolean` | equals | | `show_different_asins` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Result Sets Path: `asindataapi.db.resultSets.search` ```ts theme={null} const rows = await corsair.asindataapi.db.resultSets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `collection_id` | `string` | equals, contains, startsWith, endsWith, in | | `started_at` | `string` | equals, contains, startsWith, endsWith, in | | `ended_at` | `string` | equals, contains, startsWith, endsWith, in | | `expires_at` | `string` | equals, contains, startsWith, endsWith, in | | `results_page_count` | `number` | equals, gt, gte, lt, lte, in | | `requests_completed` | `number` | equals, gt, gte, lt, lte, in | | `requests_failed` | `number` | equals, gt, gte, lt, lte, in | | `requests_total` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/asindataapi/overview Amazon product data API for ASIN lookups, pricing, and marketplace intelligence. Use **AsinData API** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 22 typed API operations * 4 synced entities (`collections`, `destinations`, `requests`, `resultSets`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/asindataapi ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/asindataapi ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/asindataapi ``` ```bash bun theme={null} bun add corsair @corsair-dev/asindataapi ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { asindataapi } from '@corsair-dev/asindataapi'; export const corsair = createCorsair({ plugins: [ asindataapi(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} asindataapi() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'asindataapi', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`categories.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.asindataapi.api.categories.get({}); ``` **`collections.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.asindataapi.api.collections.create({}); ``` See the full list on the [API](/plugins/asindataapi/api) page. ## Query synced data Synced entities support `tenant.asindataapi.db..search()` and `.list()`: `collections`, `destinations`, `requests`, `resultSets`. See [Database](/plugins/asindataapi/database) for filters and operators. ## Webhooks This plugin registers **1** webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/asindataapi/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/asindataapi/api)** > > Every `asindataapi.api.*` operation with input and output types. > **[Database](/plugins/asindataapi/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/asindataapi/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/asindataapi/webhooks AsinData API incoming webhooks: event paths, payloads, and response data. The AsinData API plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/asindataapi/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `collections` * `collectionCompleted` (`collections.collectionCompleted`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Collections ### Collection Completed `collections.collectionCompleted` Fires when a Collection completes and a new Result Set is available **Payload** | Name | Type | Required | Description | | - | - | - | - | | `request_info` | `object` | Yes | — | | `collection` | `object` | Yes | — | | `result_set` | `object` | Yes | — | > **request\_info full type** > > ```ts theme={null} > { > success?: boolean, > type?: collection_resultset_completed > } > ``` > **collection full type** > > ```ts theme={null} > { > id: string, > name?: string > } > ``` > **result\_set full type** > > ```ts theme={null} > { > id: number | string, > started_at?: string, > ended_at?: string, > requests_completed?: number, > requests_failed?: number, > download_links?: { > json?: { > pages?: string[], > all_pages?: string > }, > jsonlines?: { > pages?: string[], > all_pages?: string > }, > csv?: { > pages?: string[], > all_pages?: string > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > request_info: { > success?: boolean, > type?: collection_resultset_completed > }, > collection: { > id: string, > name?: string > }, > result_set: { > id: number | string, > started_at?: string, > ended_at?: string, > requests_completed?: number, > requests_failed?: number, > download_links?: { > json?: { > pages?: string[], > all_pages?: string > }, > jsonlines?: { > pages?: string[], > all_pages?: string > }, > csv?: { > pages?: string[], > all_pages?: string > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} asindataapi({ webhookHooks: { collections: { collectionCompleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/asticaai/api API reference for Astica AI: every `asticaai.api.*` operation with input and output types. Every `asticaai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Analyze Audio ### analyze `analyzeAudio.analyze` Transcribe audio using Astica speech-to-text. **Risk:** `read` ```ts theme={null} await corsair.asticaai.api.analyzeAudio.analyze({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string` | Yes | — | | `modelVersion` | `string` | Yes | — | | `doStream` | `0 \| 1` | Yes | — | | `low_priority` | `0 \| 1` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `error` | `string` | No | — | | `text` | `string` | No | — | | `resultURI` | `string` | No | — | *** ## Read Text ### read `readText.read` Extract text from an image using Astica OCR. **Risk:** `read` ```ts theme={null} await corsair.asticaai.api.readText.read({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string` | Yes | — | | `modelVersion` | `2.5_full \| 2.1_full \| 2.0_full \| 1.0_full` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `error` | `string` | No | — | | `readResult` | `object` | No | — | | `astica` | `object` | No | — | > **readResult full type** > > ```ts theme={null} > { > stringIndexType?: string, > content?: string, > pages?: { > pageNumber?: number, > height?: number, > width?: number, > angle?: number, > words?: { > text: string, > boundingBox?: number[], > confidence?: number, > span?: { > offset: number, > length: number > } > }[], > lines?: { > text: string, > boundingBox?: number[], > spans?: { > offset: number, > length: number > }[] > }[], > spans?: { > offset: number, > length: number > }[] > }[], > styles?: any[] > } > ``` > **astica full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/asticaai/database Astica AI local sync: searchable entities, `.search()` filters, and operators. The Astica AI plugin syncs data locally. Use `corsair.asticaai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Audio Transcripts Path: `asticaai.db.audioTranscripts.search` ```ts theme={null} const rows = await corsair.asticaai.db.audioTranscripts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `inputFingerprint` | `string` | equals, contains, startsWith, endsWith, in | | `inputLength` | `number` | equals, gt, gte, lt, lte, in | | `modelVersion` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `resultURI` | `string` | equals, contains, startsWith, endsWith, in | | `transcribedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Read Text Results Path: `asticaai.db.readTextResults.search` ```ts theme={null} const rows = await corsair.asticaai.db.readTextResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `inputFingerprint` | `string` | equals, contains, startsWith, endsWith, in | | `inputLength` | `number` | equals, gt, gte, lt, lte, in | | `modelVersion` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `pageCount` | `number` | equals, gt, gte, lt, lte, in | | `lineCount` | `number` | equals, gt, gte, lt, lte, in | | `readAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/asticaai/overview Computer vision API for image analysis, object detection, and visual understanding. Use **Astica AI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 2 typed API operations * 2 synced entities (`audioTranscripts`, `readTextResults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/asticaai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/asticaai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/asticaai ``` ```bash bun theme={null} bun add corsair @corsair-dev/asticaai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { asticaai } from '@corsair-dev/asticaai'; export const corsair = createCorsair({ plugins: [ asticaai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} asticaai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'asticaai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`analyzeAudio.analyze`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.asticaai.api.analyzeAudio.analyze({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/asticaai/api) reference.* See the full list on the [API](/plugins/asticaai/api) page. ## Query synced data Synced entities support `tenant.asticaai.db..search()` and `.list()`: `audioTranscripts`, `readTextResults`. See [Database](/plugins/asticaai/database) for filters and operators. ## What's next > **[API reference](/plugins/asticaai/api)** > > Every `asticaai.api.*` operation with input and output types. > **[Database](/plugins/asticaai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/asyncinterview/api API reference for AsyncInterview: every `asyncinterview.api.*` operation with input and output types. Every `asyncinterview.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Jobs ### delete `jobs.delete` Deletes an interview job permanently. **Risk:** `destructive` ```ts theme={null} await corsair.asyncinterview.api.jobs.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `number \| string` | Yes | Unique identifier (integer ID) of the interview job to delete. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `number` | Yes | — | *** ### list `jobs.list` Retrieves a list of all interview jobs. **Risk:** `read` ```ts theme={null} await corsair.asyncinterview.api.jobs.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > date?: string | null, > time?: string | null, > datetime?: string | null, > team_id?: number | null, > sub_title?: string | null, > description?: string | null, > is_public?: 0 | 1 | boolean | null, > created_at?: string | null, > updated_at?: string | null, > slug?: string | null, > public_job_url?: string | null > }[] > ``` *** ### listResponses `jobs.listResponses` Retrieves all interview responses with candidate details. **Risk:** `read` ```ts theme={null} await corsair.asyncinterview.api.jobs.listResponses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `number \| string` | No | Filter interviews by job ID (GET /interviews?job\_id=). | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > url?: string | null, > job_id?: number | null, > job?: string | null, > date?: string | null, > time?: string | null, > datetime?: string | null, > questions?: { > id: number, > stage_id?: number | null, > title?: string | null, > created_at?: string | null, > updated_at?: string | null, > order?: number | null > }[] | null, > contacts?: { > id?: number | null, > name?: string | null, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > phone?: string | null > }[] | null > }[] > ``` *** ### update `jobs.update` Updates an existing interview job's details after creation. **Risk:** `write` ```ts theme={null} await corsair.asyncinterview.api.jobs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `number \| string` | Yes | Unique identifier of the interview job to update (integer ID). | | `title` | `string` | No | New title for the job | | `is_public` | `boolean` | No | Whether the job is publicly visible (true to make public, false to make private) | | `sub_title` | `string` | No | Subtitle or tagline for the job | | `description` | `string` | No | Detailed description of the job role | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `title` | `string` | No | — | | `date` | `string` | No | — | | `time` | `string` | No | — | | `datetime` | `string` | No | — | | `team_id` | `number` | No | — | | `sub_title` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `0 \| 1 \| boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `slug` | `string` | No | — | | `public_job_url` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/asyncinterview/database AsyncInterview local sync: searchable entities, `.search()` filters, and operators. The AsyncInterview plugin syncs data locally. Use `corsair.asyncinterview.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Interviews Path: `asyncinterview.db.interviews.search` ```ts theme={null} const rows = await corsair.asyncinterview.db.interviews.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `job_id` | `number` | equals, gt, gte, lt, lte, in | | `job` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `string` | equals, contains, startsWith, endsWith, in | | `datetime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `asyncinterview.db.jobs.search` ```ts theme={null} const rows = await corsair.asyncinterview.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `string` | equals, contains, startsWith, endsWith, in | | `datetime` | `string` | equals, contains, startsWith, endsWith, in | | `team_id` | `number` | equals, gt, gte, lt, lte, in | | `sub_title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `public_job_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/asyncinterview/overview Asynchronous video interview platform for remote candidate screening and hiring workflows. Use **AsyncInterview** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 2 synced entities (`interviews`, `jobs`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/asyncinterview ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/asyncinterview ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/asyncinterview ``` ```bash bun theme={null} bun add corsair @corsair-dev/asyncinterview ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { asyncinterview } from '@corsair-dev/asyncinterview'; export const corsair = createCorsair({ plugins: [ asyncinterview(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} asyncinterview() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'asyncinterview', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`jobs.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.asyncinterview.api.jobs.list({}); ``` **`jobs.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.asyncinterview.api.jobs.delete({}); ``` See the full list on the [API](/plugins/asyncinterview/api) page. ## Query synced data Synced entities support `tenant.asyncinterview.db..search()` and `.list()`: `interviews`, `jobs`. See [Database](/plugins/asyncinterview/database) for filters and operators. ## What's next > **[API reference](/plugins/asyncinterview/api)** > > Every `asyncinterview.api.*` operation with input and output types. > **[Database](/plugins/asyncinterview/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/attio/api API reference for Attio: every `attio.api.*` operation with input and output types. Every `attio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Generated ### assertPerson `generated.assertPerson` Tool to create or update person records using a unique attribute to search for existing people. Use when you want to ensure a person exists with specific details without creating duplicates. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.assertPerson({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### assertUserRecord `generated.assertUserRecord` Creates or updates a user record in Attio using a unique attribute to search for existing users. If a user is found with the same value for the matching attribute, that user will be updated. If no user is found, a new one will be created. Use this to ensure user records exist without duplicates. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.assertUserRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### assertWorkspace `generated.assertWorkspace` Creates or updates a workspace record in Attio using a unique attribute to search for existing workspaces. If a workspace is found with the same value for the matching attribute, that workspace will be updated. If no workspace is found, a new one will be created. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.assertWorkspace({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAttribute `generated.createAttribute` Tool to create a new attribute on an object or list in Attio. Use when you need to add custom fields to track additional information. For record-reference types, you can establish bidirectional relationships by supplying a relationship object. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createAttribute({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createComment `generated.createComment` Tool to create a new comment on a thread, record, or list entry in Attio. Use when you need to add a comment to an existing conversation, a record (like a person, company, or deal), or a list entry. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createComment({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createCompany `generated.createCompany` Creates a new company record in Attio. This endpoint will throw an error on conflicts of unique attributes like domains. If you prefer to update company records on conflicts, use the Assert company record endpoint instead. Note: The logo\_url attribute cannot currently be set via the API. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createCompany({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createDealRecord `generated.createDealRecord` Tool to create a new deal record in Attio. Use when you need to track a new sales opportunity or deal. This endpoint will throw an error on conflicts of unique attributes. Minimal requirement is providing at least one attribute value. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createDealRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createEntry `generated.createEntry` DEPRECATED: Use ATTIO\_ATTIO\_POST\_V2\_LISTS\_LIST\_ENTRIES instead. Tool to add a record to a list as a new list entry in Attio. Use when you need to organize records into specific lists. Throws errors on unique attribute conflicts. Multiple list entries are allowed for the same parent record. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createEntry({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createList `generated.createList` Tool to create a new list in Attio. Use when you need to organize records into custom lists. Once created, add attributes using the Create Attribute API and add records using the Create Entry API. New lists must have either workspace\_access set to 'full-access' or one or more workspace\_member\_access with 'full-access' level. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createList({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createNote `generated.createNote` This tool creates a new note on a given record in Attio. The note can be attached to any record type (like person, company, or deal) and includes a title and content. It requires parameters such as parent\_object, parent\_record\_id, title, and content, with an optional created\_at timestamp. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createNote({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createObject `generated.createObject` Tool to create a new custom object in your Attio workspace. Use when you need to add a new object type beyond the standard objects (people, companies, deals, users, workspaces). Requires api\_slug (snake\_case identifier), singular\_noun, and plural\_noun. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createObject({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createPerson `generated.createPerson` Creates a new person record in Attio. This endpoint will throw an error on conflicts of unique attributes like email\_addresses. If you prefer to update person records on conflicts instead, use the Assert person record endpoint. Note: The avatar\_url attribute cannot currently be set via the API. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createPerson({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createRecord `generated.createRecord` This tool creates a new record in Attio for a specified object type (people, companies, deals, users, workspaces, etc.). It requires the object type and a values dictionary containing the attributes for the new record. IMPORTANT: Different object types have different attributes. For example: - 'people' object uses: name, email\_addresses, phone\_numbers, primary\_location, job\_title, etc. - 'users' object uses: primary\_email\_address, user\_id, person, workspace - 'companies' object uses: name, domains, description, etc. Always verify the correct attribute names for your target object type before creating records. Use the List Attributes API or check your workspace to see available attributes for each object type. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createSelectOption `generated.createSelectOption` Tool to add a new select option to a select or multiselect attribute in Attio. Use when you need to add a new choice to an existing select field. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createSelectOption({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createStatus `generated.createStatus` Tool to add a new status to a status attribute on either an object or a list. Use when you need to create a new status option for status attributes. Company and person objects do not support status attributes at this time. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createStatus({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createTask `generated.createTask` Tool to create a new task in Attio. Use when you need to add a task with content and optional deadline, assignees, or linked records. Note: Tasks can only be created from plaintext without record reference formatting. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createTask({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createUserRecord `generated.createUserRecord` Creates a new user record in Attio. User records represent workspace members or users in the system. Requires primary\_email\_address, user\_id, and workspace\_id. Optionally link to an existing person record. Note: Required attributes may vary based on workspace configuration - check the List Attributes action if you encounter missing\_value errors. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createUserRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createWebhook `generated.createWebhook` Tool to create a webhook and subscribe to events in Attio. Use when you need to set up a new webhook endpoint to receive real-time event notifications. Returns the webhook configuration including a one-time signing secret for verifying event authenticity. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createWebhook({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createWorkspaceRecord `generated.createWorkspaceRecord` Creates a new workspace record in Attio. The workspace\_id field is required and must be unique. This endpoint will throw an error on conflicts of unique attributes. Use when you need to create a new workspace entry in your Attio workspace. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.createWorkspaceRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteComment `generated.deleteComment` Tool to delete a comment by its comment\_id. Use when you need to remove a comment from Attio. If the comment is at the head of a thread, all messages in the thread are also deleted. The operation is permanent and cannot be undone. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteComment({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteCompany `generated.deleteCompany` Tool to delete a company record from Attio by its record\_id. Use when you need to permanently remove a company record. The deletion is irreversible and cannot be recovered. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteCompany({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteDeal `generated.deleteDeal` Tool to delete a deal record from Attio by its record\_id. Use when you need to permanently remove a deal record. The deletion is irreversible and cannot be recovered. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteDeal({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteEntry `generated.deleteEntry` Tool to delete a single list entry by its entry\_id in Attio. Use when you need to remove an entry from a specific list. The operation is permanent and cannot be undone. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteEntry({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteNote `generated.deleteNote` This tool allows users to delete a specific note in Attio by its ID. It is implemented via DELETE [https://api.attio.com/v2/notes/\{note\_id}](https://api.attio.com/v2/notes/\{note_id}) and handles note deletion by validating the provided note\_id. It complements ATTIO\_CREATE\_NOTE functionality, providing complete note management capabilities within the Attio platform. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteNote({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deletePerson `generated.deletePerson` Tool to delete a person record from Attio by its record\_id. Use when you need to permanently remove a person record. The deletion is irreversible and cannot be recovered. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deletePerson({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteRecord `generated.deleteRecord` This tool allows you to delete a record from Attio permanently. The deletion is irreversible, and the data will eventually be removed from the system. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteRecordById `generated.deleteRecordById` Tool to delete a single record (e.g. a company or person) by ID. Use when you need to permanently remove a record from Attio. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteRecordById({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteTask `generated.deleteTask` Tool to delete a task by its task\_id. Use when you need to remove a task from Attio. The operation is permanent and cannot be undone. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteTask({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteUser `generated.deleteUser` Tool to delete a user record from Attio by its record\_id. Use when you need to permanently remove a user record. The deletion is irreversible and cannot be recovered. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteUser({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteWebhook `generated.deleteWebhook` Tool to delete a webhook by its webhook\_id. Use when you need to remove a webhook subscription from Attio. The operation is permanent and cannot be undone. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteWebhook({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteWorkspaceRecord `generated.deleteWorkspaceRecord` Tool to delete a workspace record from Attio by its record\_id. Use when you need to permanently remove a workspace record. The deletion is irreversible and cannot be recovered. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.deleteWorkspaceRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### findRecord `generated.findRecord` This tool allows users to find a record in Attio by either its unique ID or by searching using unique attributes. It provides two methods: one for directly retrieving a record by its ID with the GET /v2/objects//records/ endpoint, and another for searching by attributes using the POST /v2/objects//records/query endpoint. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.findRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAttribute `generated.getAttribute` Tool to get information about a single attribute on either an object or a list. Use when you need detailed information about a specific attribute's configuration, type, or metadata. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getAttribute({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getComment `generated.getComment` Tool to get a single comment by its comment\_id in Attio. Use when you need to retrieve detailed information about a specific comment, including its content, author, thread, and resolution status. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getComment({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCompany `generated.getCompany` Tool to get a single company record by its record\_id in Attio. Use when you need to retrieve detailed information about a specific company. Returns all attribute values for the company with temporal and audit metadata. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getCompany({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getDealRecord `generated.getDealRecord` Tool to get a single deal record by its record\_id in Attio. Use when you need to retrieve detailed information about a specific deal. Returns all attribute values for the deal with temporal and audit metadata. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getDealRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getList `generated.getList` Tool to retrieve details of a single list in your Attio workspace. Use when you need to get information about a specific list by its UUID or slug. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getList({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListEntry `generated.getListEntry` Tool to get a single list entry by its entry\_id. Use when you need to retrieve detailed information about a specific entry in an Attio list. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getListEntry({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getNote `generated.getNote` Tool to get a single note by its note\_id in Attio. Use when you need to retrieve detailed information about a specific note, including its title, content (plaintext and markdown), tags, and creator information. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getNote({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getObject `generated.getObject` Tool to get a single object by its object\_id or slug. Use to retrieve detailed schema information about a specific object type in the Attio workspace. Also use as a prerequisite validation step before calling ATTIO\_FIND\_RECORD, ATTIO\_LIST\_RECORDS, or ATTIO\_CREATE\_RECORD — attribute slugs must exactly match what this tool returns. The returned schema defines required attributes for record creation; omitting them causes invalid\_request\_error with code missing\_value (HTTP 400). Custom attributes (e.g., industry, category) vary by object type — verify their presence and data type here before building filters or record values. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getObject({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRecord `generated.getRecord` Tool to get a single person, company, or other record by its record\_id in Attio. Use when you need to retrieve detailed information about a specific record. Returns all attribute values for the record with temporal and audit metadata. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRecordAttributeValues `generated.getRecordAttributeValues` Tool to get all values for a given attribute on a record in Attio. Use when you need to retrieve current or historic values for a specific attribute. Historic values can be queried using the show\_historic param but cannot be queried on COMINT or enriched attributes (returns 400 error). **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getRecordAttributeValues({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRecordEntries `generated.getRecordEntries` Tool to list all entries, across all lists, for which a record is the parent. Use when you need to find which lists a specific record belongs to. Returns list IDs, slugs, entry IDs, and creation timestamps. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getRecordEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSelf `generated.getSelf` Tool to identify the current access token, the workspace it is linked to, and any permissions it has. Use when you need to verify token validity or retrieve workspace information associated with the current authentication. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getSelf({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTask `generated.getTask` Tool to get a single task by its task\_id in Attio. Use when you need to retrieve detailed information about a specific task, including its content, deadline, assignees, and linked records. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getTask({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getV2ObjectsObjectRecordsRecordId `generated.getV2ObjectsObjectRecordsRecordId` Tool to get a single person, company or other record by its record\_id. Use when you need to retrieve detailed information about a specific record. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getV2ObjectsObjectRecordsRecordId({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getV2Tasks `generated.getV2Tasks` Tool to list all tasks in the workspace. Use when you need to retrieve tasks, optionally filtering by assignee, completion status, or linked records. Results are sorted by creation date from oldest to newest by default. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getV2Tasks({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getV2WorkspaceMembers `generated.getV2WorkspaceMembers` DEPRECATED: Use ATTIO\_LIST\_WORKSPACE\_MEMBERS instead. Tool to list all workspace members in the workspace. Use when you need to retrieve information about workspace members, their access levels, or their identities. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getV2WorkspaceMembers({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getWebhook `generated.getWebhook` Tool to get a single webhook by its webhook\_id in Attio. Use when you need to retrieve detailed information about a specific webhook configuration. Returns the webhook's target URL, event subscriptions, status, and metadata. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getWebhook({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getWorkspaceMember `generated.getWorkspaceMember` Tool to get a single workspace member by their workspace\_member\_id. Use when you need details about a specific workspace member, including their name, email, access level, and avatar. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getWorkspaceMember({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getWorkspaceRecord `generated.getWorkspaceRecord` Tool to get a single workspace record by its record\_id. Use when you need to retrieve detailed information about a specific workspace. Returns all attribute values for the workspace record with temporal and audit metadata. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.getWorkspaceRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAttributeOptions `generated.listAttributeOptions` Tool to list all select options for a particular attribute on either an object or a list. Use when you need to discover available options for select or status type attributes. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listAttributeOptions({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAttributes `generated.listAttributes` Tool to list the attribute schema for an Attio object or list (including slugs, types, select/status config) to enable correct filtering and writes. Use when you need to discover what attributes exist on an object or list, their types, and their configuration (e.g., available options for select/status attributes). Returns attributes in UI sort order. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listAttributes({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAttributeStatuses `generated.listAttributeStatuses` Tool to list all statuses for a particular status attribute on either an object or a list. Use when you need to discover available statuses for a status attribute, including their IDs, titles, and configuration. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listAttributeStatuses({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listCallRecordings `generated.listCallRecordings` Tool to list all call recordings for a meeting in Attio. Use when you need to retrieve call recordings associated with a specific meeting. This endpoint is in beta. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listCallRecordings({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listCompanies `generated.listCompanies` Tool to list company records in Attio with optional filtering and sorting. Use when you need to retrieve company records based on criteria like domain, name, or description. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listCompanies({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listCompanyAttributeValues `generated.listCompanyAttributeValues` Tool to get all values for a given attribute on a company record. Historic values can be queried using the show\_historic query param. Historic values cannot be queried on COMINT or enriched attributes. Some attributes are subject to billing status and may return an empty array. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listCompanyAttributeValues({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listCompanyRecordEntries `generated.listCompanyRecordEntries` Tool to list all entries across all lists for which a company record is the parent in Attio. Use when you need to see which lists a particular company record belongs to. Returns list information and entry IDs for each list the company appears in. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listCompanyRecordEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listDealEntries `generated.listDealEntries` Tool to list all entries across all lists for which a deal record is the parent in Attio. Use when you need to see which lists a particular deal record belongs to. Returns list information and entry IDs for each list the deal appears in. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listDealEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listDealRecordAttributeValues `generated.listDealRecordAttributeValues` Tool to retrieve all values for a specified attribute on a deal record in Attio. Use when you need to see current or historic values for a specific deal attribute. Historic values can be queried using show\_historic param but cannot be queried on COMINT or enriched attributes. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listDealRecordAttributeValues({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listDealRecords `generated.listDealRecords` Tool to list deal records in Attio with the option to filter and sort results. Use when you need to retrieve deal records based on filter criteria or sorting requirements. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listDealRecords({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listEntries `generated.listEntries` DEPRECATED: Use ATTIO\_ATTIO\_POST\_V2\_LISTS\_LIST\_ENTRIES\_QUERY instead. Tool to list entries in a given list with filtering and sorting options. Use when you need to retrieve records added to a specific list in Attio. Entries are returned based on the filters and sorts provided. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listListEntries `generated.listListEntries` DEPRECATED: Use ATTIO\_ATTIO\_POST\_V2\_LISTS\_LIST\_ENTRIES\_QUERY instead. Tool to retrieve entries (records) that belong to a specific Attio list. Use when you need to enumerate list membership or access list-specific attribute values. This is distinct from listing all records of an object type - it specifically returns records that are members of a particular list. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listListEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listListEntryAttributeValues `generated.listListEntryAttributeValues` Tool to retrieve all values for a specified attribute on a list entry in Attio. Use when you need to see the history of values for a specific attribute on a list entry. Can return only active values or include all historical values sorted chronologically. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listListEntryAttributeValues({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listLists `generated.listLists` This tool retrieves all lists available in the Attio workspace, sorted as they appear in the sidebar. Returns list metadata only (names, IDs, configuration) — not the records/entries within those lists. To fetch actual list entries, use ATTIO\_FIND\_RECORD with appropriate filters. This tool is a prerequisite for many list-related operations. Requires the list\_configuration:read permission scope. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listLists({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listMeetings `generated.listMeetings` Tool to list all meetings in the workspace using a deterministic sort order. Use when you need to retrieve meetings, optionally filtering by participants, linked records, or time ranges. This endpoint is in beta. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listMeetings({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listNotes `generated.listNotes` Lists notes in Attio. Can list all notes in the workspace, or filter by parent object type and/or specific record. Notes are returned in reverse chronological order (newest first). **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listNotes({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listObjects `generated.listObjects` This tool retrieves a list of all available objects (both system-defined and user-defined) in the Attio workspace via GET /v2/objects, returning key metadata including slugs and IDs for each object. Call this tool first before ATTIO\_LIST\_RECORDS, ATTIO\_FIND\_RECORD, or ATTIO\_CREATE\_RECORD to discover valid object slugs — hardcoded slugs may not exist across workspaces. Concepts like tasks may be modeled as deals or custom objects rather than dedicated types, so confirm the correct object type before proceeding. Attribute values in responses can be arrays of time-bounded entries rather than simple scalars; downstream code must handle nested structures. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listObjects({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listPeopleAttributeValues `generated.listPeopleAttributeValues` Tool to get all values for a given attribute on a person record. Use when you need to retrieve current or historic values for a specific person attribute. Historic values can be queried using the show\_historic param but cannot be queried on COMINT or enriched attributes (returns 400 error). **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listPeopleAttributeValues({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listPeopleRecordEntries `generated.listPeopleRecordEntries` Tool to list all entries across all lists for which a person record is the parent in Attio. Use when you need to see which lists a particular person record belongs to. Returns list information and entry IDs for each list the person appears in. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listPeopleRecordEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listRecordAttributeValues `generated.listRecordAttributeValues` Tool to retrieve all values for a specified attribute on a record in Attio. Use when you need to see the history of values for a specific attribute. Can return only active values or include historical values. Historic values cannot be queried on COMINT or enriched attributes. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listRecordAttributeValues({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listRecordEntries `generated.listRecordEntries` Tool to list all entries across all lists for which a record is the parent in Attio. Use when you need to see which lists a particular record belongs to. Returns list information and entry IDs for each list the record appears in. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listRecordEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listRecords `generated.listRecords` This tool lists records from a specific object type in Attio. It provides simple pagination support and returns records in creation order (oldest first). For complex filtering, use the FindRecord action instead. Standard object types include: people, companies, deals, users, workspaces. If you get a 404 error, verify the object type exists using the List Objects action first. Response attribute values are returned as arrays of time-bounded objects under a `values` map (e.g., `values['name']`), not simple scalars — handle arrays, nested objects, and empty arrays accordingly. Select attributes are accessed via `option.title`; currency, stage, and select fields may be null or empty arrays. Access records via `data.data` in the response. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listRecords({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listThreads `generated.listThreads` Tool to list threads of comments on a record or list entry in Attio. Use when you need to view all comment threads associated with a specific record or list entry. Threads contain one or more comments sorted chronologically. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listThreads({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listUserRecordEntries `generated.listUserRecordEntries` Tool to list all entries across all lists for which a user record is the parent in Attio. Use when you need to see which lists a particular user record belongs to. Returns list information and entry IDs for each list the user appears in. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listUserRecordEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listUserRecords `generated.listUserRecords` Tool to list user records in Attio with optional filtering and sorting. Use when you need to retrieve workspace members or user records based on specific criteria. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listUserRecords({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listWebhooks `generated.listWebhooks` Tool to get all webhooks in your Attio workspace. Use when you need to retrieve a list of configured webhooks, their subscriptions, and statuses. Supports pagination via limit and offset parameters. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listWebhooks({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listWorkspaceMembers `generated.listWorkspaceMembers` Tool to list workspace members (actors) so agents can reliably assign owners and resolve workspace-member IDs even when the optional Users standard object is disabled. Use when writing or assigning actor-reference attributes (e.g., record/list entry owners) that require referenced\_actor\_type=workspace-member and an actor id. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listWorkspaceMembers({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listWorkspaceRecordAttributeValues `generated.listWorkspaceRecordAttributeValues` Tool to retrieve all values for a specified attribute on a workspace record in Attio. Use when you need to see the history of values for a specific attribute on a workspace record. Can return only active values or include all historical values sorted chronologically. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listWorkspaceRecordAttributeValues({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listWorkspaceRecordEntries `generated.listWorkspaceRecordEntries` Tool to list all entries across all lists for which a workspace record is the parent in Attio. Use when you need to see which lists a particular workspace record belongs to. Returns list information and entry IDs for each list the workspace appears in. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listWorkspaceRecordEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listWorkspaceRecords `generated.listWorkspaceRecords` Tool to list workspace records with filtering and sorting options. Use when you need to retrieve workspace-level records from Attio. Records are returned based on the filters and sorts provided. Requires record\_permission:read and object\_configuration:read scopes. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.listWorkspaceRecords({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### patchRecord `generated.patchRecord` Tool to update people, companies, and other records by record\_id using PATCH method. For multiselect attributes, values supplied will be prepended to existing values. Use PUT endpoint to overwrite or remove multiselect values. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.patchRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### patchV2ListsListEntriesEntryId `generated.patchV2ListsListEntriesEntryId` Tool to update list entries by entry\_id in Attio. Use when you need to modify attribute values on existing list entries. For multiselect attributes, the values supplied will be created and prepended to existing values. Use the PUT endpoint to overwrite or remove multiselect attribute values. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.patchV2ListsListEntriesEntryId({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### peopleGetPerson `generated.peopleGetPerson` Tool to get a single person record by its record\_id in Attio. Use when you need to retrieve detailed information about a specific person. Returns all attribute values for the person with temporal and audit metadata. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.peopleGetPerson({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### peopleListPersons `generated.peopleListPersons` Tool to list person records from Attio with optional filtering and sorting. Use when you need to retrieve people based on specific criteria or get a paginated list of all people. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.peopleListPersons({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### postV2ListsListEntries `generated.postV2ListsListEntries` Tool to add a record to a list as a new list entry in Attio. Use when you need to organize records into specific lists. This endpoint will throw on conflicts of unique attributes. Multiple list entries are allowed for the same parent record. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.postV2ListsListEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### postV2ListsListEntriesQuery `generated.postV2ListsListEntriesQuery` Tool to list entries in a given list, with the option to filter and sort results. Use when you need to retrieve records that belong to a specific list with optional filtering and sorting. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.postV2ListsListEntriesQuery({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### postV2ObjectsObjectRecords `generated.postV2ObjectsObjectRecords` Creates a new person, company or other record. This endpoint will throw on conflicts of unique attributes. If you would prefer to update records on conflicts, please use the Assert record endpoint instead. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.postV2ObjectsObjectRecords({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### postV2ObjectsObjectRecordsQuery `generated.postV2ObjectsObjectRecordsQuery` Tool to list people, company or other records in Attio with the option to filter and sort results. Use when you need to retrieve records based on complex filter criteria or sorting requirements. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.postV2ObjectsObjectRecordsQuery({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### postV2ObjectsRecordsSearch `generated.postV2ObjectsRecordsSearch` Tool to fuzzy search for records across one or more objects in Attio. Use when you need to find records by name, domain, email, phone number, or social handle. This endpoint is in beta and returns eventually consistent results. For results guaranteed to be up to date, use the record query endpoint instead. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.postV2ObjectsRecordsSearch({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### putV2ListsListEntries `generated.putV2ListsListEntries` Tool to create or update a list entry for a given parent record in Attio. If an entry with the specified parent record is found, that entry will be updated. If no such entry is found, a new entry will be created instead. For multiselect attributes, all values will be either created or deleted as necessary to match the list of values supplied in the request. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.putV2ListsListEntries({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### putV2ListsListEntriesEntryId `generated.putV2ListsListEntriesEntryId` Tool to update list entries by entry\_id in Attio using PUT method. Use when you need to completely replace attribute values on existing list entries. For multiselect attributes, the values supplied will overwrite/remove the list of values that already exist (if any). Use the PATCH endpoint to add multiselect attribute values without removing those that already exist. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.putV2ListsListEntriesEntryId({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### putV2ObjectsObjectRecords `generated.putV2ObjectsObjectRecords` Tool to create or update people, companies and other records in Attio using a matching attribute. Use when you want to avoid duplicate records - if a record with the same value for the matching attribute is found, it will be updated; otherwise a new record is created. If you want to avoid matching and always create new records, use the Create Record endpoint instead. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.putV2ObjectsObjectRecords({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### putV2ObjectsObjectRecordsRecordId `generated.putV2ObjectsObjectRecordsRecordId` Tool to update people, companies, and other records by record\_id using PUT method. For multiselect attributes, values supplied will overwrite/remove existing values. Use PATCH endpoint to append without removing. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.putV2ObjectsObjectRecordsRecordId({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### queryRecords `generated.queryRecords` Tool to query records for a specific Attio object using server-side filtering operators and sorting. Use when you need to retrieve records based on complex filter criteria (e.g., 'get all agreements where product=X and status in Y') rather than simple listing or ID-based lookup. This avoids downloading large pages and filtering locally, which is slow and costly. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.queryRecords({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### searchRecords `generated.searchRecords` Tool to fuzzy search for records across multiple objects in Attio. Use when you need to find records by name, domain, email, phone number, or social handle. This endpoint is in beta and returns eventually consistent results. Matching strategy follows the in-product search approach. **Risk:** `read` ```ts theme={null} await corsair.attio.api.generated.searchRecords({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateAttribute `generated.updateAttribute` Tool to update an existing attribute by its attribute\_id or slug. Use when you need to modify attribute properties such as title, description, validation rules, or configuration settings. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateAttribute({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateCompany `generated.updateCompany` Tool to update a company record in Attio by its record\_id. Use when you need to modify company attributes like name, description, domains, or team. For multiselect attributes, values are prepended to existing values. Note: logo\_url cannot be updated via API. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateCompany({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateDealRecord `generated.updateDealRecord` Tool to update an existing deal record in Attio by record ID. Uses PATCH to partially update only the provided fields, leaving other fields unchanged. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateDealRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateEntry `generated.updateEntry` DEPRECATED: Use ATTIO\_ATTIO\_PATCH\_V2\_LISTS\_LIST\_ENTRIES\_ENTRY\_ID instead. Tool to update list entries by their ID in Attio. Use when you need to modify attribute values on existing list entries. When multiselect attributes are included, the values supplied will be prepended to existing values. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateEntry({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateList `generated.updateList` Tool to update an existing list in Attio. Use when you need to modify list properties like name, api\_slug, or permissions. Lists must have either workspace\_access set to 'full-access' or one or more workspace\_member\_access with 'full-access' level. Changing the parent object of a list is not possible through the API. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateList({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateObject `generated.updateObject` Tool to update a single object's configuration in Attio. Use when you need to modify an object's API slug, singular noun, or plural noun. Standard objects (people, companies, deals, users, workspaces) and custom objects can be updated. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateObject({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updatePerson `generated.updatePerson` Tool to update a person record in Attio by its record\_id. Use when you need to modify person attributes like name, email, job title, or phone numbers. For multiselect attributes, values are prepended to existing values. Note: avatar\_url cannot be updated via API. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updatePerson({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateRecord `generated.updateRecord` This tool updates an existing record in Attio for a specified object type (people, companies, deals, users, workspaces, etc.). It uses PATCH to partially update only the provided fields, leaving other fields unchanged. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateSelectOption `generated.updateSelectOption` Tool to update an existing select option for a select or multiselect attribute in Attio. Use when you need to rename an option or archive it. Archived options are hidden from selection but preserve historical data for records that used them. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateSelectOption({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateStatus `generated.updateStatus` Tool to update a status on a status attribute on either an object or a list in Attio. Use when you need to modify status properties like title, celebration settings, target time, or archive status. Company and person objects do not support status attributes at this time. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateStatus({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateTask `generated.updateTask` Tool to update an existing task in Attio by its task\_id. Use when you need to modify a task's deadline, completion status, linked records, or assignees. Only these four fields can be updated via this endpoint. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateTask({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateUserRecord `generated.updateUserRecord` Tool to update a user record in Attio by its record\_id. Use when you need to modify user attributes like user\_id, primary\_email\_address, person, or workspace references. Attributes not included in the request will remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateUserRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateWebhook `generated.updateWebhook` Tool to update a webhook's target URL and/or event subscriptions. Use when you need to modify an existing webhook configuration in Attio. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateWebhook({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateWorkspaceRecord `generated.updateWorkspaceRecord` Tool to update a workspace record by ID using PATCH method. Only the attributes provided in the request will be updated; other attributes remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.attio.api.generated.updateWorkspaceRecord({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/attio/database Attio local sync: searchable entities, `.search()` filters, and operators. The Attio plugin syncs data locally. Use `corsair.attio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Records Path: `attio.db.records.search` ```ts theme={null} const rows = await corsair.attio.db.records.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspace Members Path: `attio.db.workspaceMembers.search` ```ts theme={null} const rows = await corsair.attio.db.workspaceMembers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email_address` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/attio/overview Flexible CRM for managing relationships, deals, companies, and custom sales pipelines. Use **Attio** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 110 typed API operations * 2 synced entities (`records`, `workspaceMembers`) for fast `.search()` / `.list()` * 3 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/attio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/attio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/attio ``` ```bash bun theme={null} bun add corsair @corsair-dev/attio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { attio } from '@corsair-dev/attio'; export const corsair = createCorsair({ plugins: [ attio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Attio OAuth app. ```ts theme={null} attio() ``` More: [OAuth 2.0](/concepts/oauth) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. ```ts theme={null} attio({ authType: 'api_key', }) ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'attio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`generated.findRecord`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.attio.api.generated.findRecord({}); ``` **`generated.assertPerson`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.attio.api.generated.assertPerson({}); ``` See the full list on the [API](/plugins/attio/api) page. ## Query synced data Synced entities support `tenant.attio.db..search()` and `.list()`: `records`, `workspaceMembers`. See [Database](/plugins/attio/database) for filters and operators. ## Webhooks This plugin registers **3** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/attio/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/attio/api)** > > Every `attio.api.*` operation with input and output types. > **[Database](/plugins/attio/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/attio/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/attio/webhooks Attio incoming webhooks: event paths, payloads, and response data. The Attio plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/attio/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `record` * `created` (`record.created`) * `deleted` (`record.deleted`) * `updated` (`record.updated`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Record ### Created `record.created` Triggered when a record is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `record.created` | Yes | — | | `id` | `object` | Yes | — | | `actor` | `any` | No | — | > **id full type** > > ```ts theme={null} > { > workspace_id: string, > object_id?: string, > record_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event_type: record.created, > id: { > workspace_id: string, > object_id?: string, > record_id: string > }, > actor?: any > } > ``` **`webhookHooks` example** ```ts theme={null} attio({ webhookHooks: { record: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `record.deleted` Triggered when a record is deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `record.deleted` | Yes | — | | `id` | `object` | Yes | — | | `actor` | `any` | No | — | > **id full type** > > ```ts theme={null} > { > workspace_id: string, > object_id?: string, > record_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event_type: record.deleted, > id: { > workspace_id: string, > object_id?: string, > record_id: string > }, > actor?: any > } > ``` **`webhookHooks` example** ```ts theme={null} attio({ webhookHooks: { record: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `record.updated` Triggered when a record is updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `record.updated` | Yes | — | | `id` | `object` | Yes | — | | `actor` | `any` | No | — | > **id full type** > > ```ts theme={null} > { > workspace_id: string, > object_id?: string, > record_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event_type: record.updated, > id: { > workspace_id: string, > object_id?: string, > record_id: string > }, > actor?: any > } > ``` **`webhookHooks` example** ```ts theme={null} attio({ webhookHooks: { record: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/autom/api API reference for Autom: every `autom.api.*` operation with input and output types. Every `autom.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Google ### countries `google.countries` Retrieve Google-supported countries filtered by search term. **Risk:** `read` ```ts theme={null} await corsair.autom.api.google.countries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > country_code: string, > country_name: string > }[] > ``` *** ### images `google.images` Fetch image search results from Google Search. **Risk:** `read` ```ts theme={null} await corsair.autom.api.google.images({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `page` | `number` | No | — | | `gl` | `string` | No | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `images` | `object[]` | Yes | — | | `search_parameters` | `object` | Yes | — | > **images full type** > > ```ts theme={null} > { > url: string, > link: string, > title: string, > domain: string, > source: string, > position: number, > image_width: number, > image_height: number > }[] > ``` > **search\_parameters full type** > > ```ts theme={null} > { > q: string, > gl?: string, > hl?: string, > page: number, > engine: string > } > ``` *** ### languages `google.languages` Retrieve Google-supported languages filtered by search term. **Risk:** `read` ```ts theme={null} await corsair.autom.api.google.languages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > language_code: string, > language_name: string > }[] > ``` *** ### locations `google.locations` Retrieve Google-supported locations filtered by search term. **Risk:** `read` ```ts theme={null} await corsair.autom.api.google.locations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > gps: number[], > name: string, > reach: number, > google_id: number, > target_type: string, > country_code: string, > canonical_name: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/autom/database Autom local sync: searchable entities, `.search()` filters, and operators. The Autom plugin syncs data locally. Use `corsair.autom.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/autom/overview Workflow automation platform for connecting apps and automating repetitive business tasks. Use **Autom** through Corsair: one client, typed API calls. **What you get:** * 4 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/autom ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/autom ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/autom ``` ```bash bun theme={null} bun add corsair @corsair-dev/autom ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { autom } from '@corsair-dev/autom'; export const corsair = createCorsair({ plugins: [ autom(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} autom() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'autom', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`google.countries`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.autom.api.google.countries({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/autom/api) reference.* See the full list on the [API](/plugins/autom/api) page. ## What's next > **[API reference](/plugins/autom/api)** > > Every `autom.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/ayrshare/api API reference for Ayrshare: every `ayrshare.api.*` operation with input and output types. Every `ayrshare.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Auto Schedule ### list `autoSchedule.list` List active auto-post schedules, including titles, UTC times, weekday filters, and exclude dates. **Risk:** `read` ```ts theme={null} await corsair.ayrshare.api.autoSchedule.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `schedules` | `object` | Yes | — | > **schedules full type** > > ```ts theme={null} > { > } > ``` *** ### set `autoSchedule.set` Create or replace an auto-post schedule. Its case-sensitive title is the join key used by publish autoSchedule.title. **Risk:** `write` ```ts theme={null} await corsair.ayrshare.api.autoSchedule.set({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `schedule` | `string[]` | No | UTC times; required unless setStartDate is provided | | `title` | `string` | No | Case-sensitive schedule name and join key for publish autoSchedule.title | | `setStartDate` | `string` | No | ISO-8601 UTC date-time to begin the schedule | | `daysOfWeek` | `number[]` | No | Weekdays as 0-6, Sunday through Saturday | | `excludeDates` | `string[]` | No | UTC dates excluded from future auto-scheduling | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `title` | `string` | Yes | — | | `schedule` | `string[]` | No | — | | `daysOfWeek` | `number[]` | No | — | | `excludeDates` | `string[]` | No | — | *** ## Posts ### delete `posts.delete` Delete an Ayrshare post by id. Published Instagram and TikTok posts cannot be deleted via API; use markManualDeleted only after deleting them on the network. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.ayrshare.api.posts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Ayrshare top-level Post ID | | `markManualDeleted` | `boolean` | No | Mark deleted in Ayrshare without deleting on the network. Instagram and TikTok published posts cannot be deleted via API. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `id` | `string` | No | — | *** ### history `posts.history` Fetch Ayrshare post history, filterable by date, status, network, and record count. **Risk:** `read` ```ts theme={null} await corsair.ayrshare.api.posts.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Number of recent posts. Default 25, max 1000. | | `lastDays` | `number` | No | Last n days by publish date. Default 30. 0 returns the full history (up to limit). Ignored when startDate and endDate are set. | | `startDate` | `string` | No | ISO-8601 start date (inclusive) | | `endDate` | `string` | No | ISO-8601 end date (inclusive) | | `status` | `success \| error \| processing \| pending \| paused \| deleted \| awaiting approval` | No | Filter by post status. Deleted posts are only returned with status=deleted. | | `platforms` | `string[]` | No | Filter by network; OR logic. Example: facebook, instagram. | | `type` | `immediate \| scheduled` | No | immediate posts vs scheduled posts | **Output** | Name | Type | Required | Description | | - | - | - | - | | `history` | `object[]` | Yes | — | | `count` | `number` | No | — | | `refId` | `string` | No | — | | `lastUpdated` | `string` | No | — | | `nextUpdate` | `string` | No | — | > **history full type** > > ```ts theme={null} > { > id: string, > post?: string | null, > platforms?: string[], > postIds?: { > platform?: string | null, > id?: string | number | null, > status?: string | null, > postUrl?: string | null, > isVideo?: boolean | null > }[], > status?: string | null, > created?: string | null, > scheduleDate?: string | { > _seconds?: number | null, > _nanoseconds?: number | null, > utc?: string | null > }, > errors?: any[], > mediaUrls?: string[], > urls?: any[], > type?: string | null, > notes?: string | null, > profileTitle?: string | null, > refId?: string | null, > requiresApproval?: boolean | null, > approved?: boolean | null, > approvedBy?: string | null, > approvedDate?: string | null, > rejectedBy?: string | null, > rejectedDate?: string | null, > shortenLinks?: boolean | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/ayrshare/database Ayrshare local sync: searchable entities, `.search()` filters, and operators. The Ayrshare plugin syncs data locally. Use `corsair.ayrshare.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Auto Schedules Path: `ayrshare.db.autoSchedules.search` ```ts theme={null} const rows = await corsair.ayrshare.db.autoSchedules.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `lastScheduleDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Posts Path: `ayrshare.db.posts.search` ```ts theme={null} const rows = await corsair.ayrshare.db.posts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `post` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `profileTitle` | `string` | equals, contains, startsWith, endsWith, in | | `refId` | `string` | equals, contains, startsWith, endsWith, in | | `requiresApproval` | `boolean` | equals | | `approved` | `boolean` | equals | | `approvedBy` | `string` | equals, contains, startsWith, endsWith, in | | `approvedDate` | `string` | equals, contains, startsWith, endsWith, in | | `rejectedBy` | `string` | equals, contains, startsWith, endsWith, in | | `rejectedDate` | `string` | equals, contains, startsWith, endsWith, in | | `shortenLinks` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/ayrshare/overview Social media API for posting, scheduling, and analytics across multiple platforms. Use **Ayrshare** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 2 synced entities (`autoSchedules`, `posts`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ayrshare ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ayrshare ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ayrshare ``` ```bash bun theme={null} bun add corsair @corsair-dev/ayrshare ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ayrshare } from '@corsair-dev/ayrshare'; export const corsair = createCorsair({ plugins: [ ayrshare(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ayrshare() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ayrshare', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`autoSchedule.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ayrshare.api.autoSchedule.list({}); ``` **`autoSchedule.set`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ayrshare.api.autoSchedule.set({}); ``` See the full list on the [API](/plugins/ayrshare/api) page. ## Query synced data Synced entities support `tenant.ayrshare.db..search()` and `.list()`: `autoSchedules`, `posts`. See [Database](/plugins/ayrshare/database) for filters and operators. ## What's next > **[API reference](/plugins/ayrshare/api)** > > Every `ayrshare.api.*` operation with input and output types. > **[Database](/plugins/ayrshare/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/backendless/api API reference for Backendless: every `backendless.api.*` operation with input and output types. Every `backendless.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Counters ### get `counters.get` Read a Backendless atomic counter. **Risk:** `read` ```ts theme={null} await corsair.backendless.api.counters.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `counterName` | `string` | Yes | — | **Output:** `number` *** ### reset `counters.reset` Reset a Backendless atomic counter. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.backendless.api.counters.reset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `counterName` | `string` | Yes | — | **Output:** `null \| undefined \| ` *** ### set `counters.set` Conditionally update a Backendless atomic counter. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.counters.set({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `counterName` | `string` | Yes | — | | `expected` | `number` | Yes | — | | `updated` | `number` | Yes | — | **Output:** `boolean` *** ## Data ### retrieve `data.retrieve` Retrieve Backendless database objects. **Risk:** `read` ```ts theme={null} await corsair.backendless.api.data.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tableName` | `string` | Yes | — | | `objectId` | `string` | No | — | | `where` | `string` | No | — | | `sortBy` | `string` | No | — | | `pageSize` | `number` | No | — | | `offset` | `number` | No | — | | `properties` | `string[]` | No | — | | `excludeProperties` | `string[]` | No | — | | `loadRelations` | `string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > objectId?: string, > ___class?: string, > created?: number, > updated?: number | null, > ownerId?: string | null > } | { > objectId?: string, > ___class?: string, > created?: number, > updated?: number | null, > ownerId?: string | null > }[] > ``` *** ## Files ### copy `files.copy` Copy a Backendless file or directory. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.files.copy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sourcePath` | `string` | Yes | — | | `targetPath` | `string` | Yes | — | **Output:** `string` *** ### count `files.count` Count Backendless files and directories. **Risk:** `read` ```ts theme={null} await corsair.backendless.api.files.count({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `pattern` | `string` | No | — | | `recursive` | `boolean` | No | — | | `directoryCount` | `boolean` | No | — | **Output:** `number` *** ### createDirectory `files.createDirectory` Create a Backendless directory. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.files.createDirectory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | **Output:** `null \| undefined \| ` *** ### delete `files.delete` Delete a Backendless file. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.backendless.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `fileName` | `string` | Yes | — | **Output:** `null \| undefined \| ` *** ### deleteDirectory `files.deleteDirectory` Delete a Backendless directory. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.backendless.api.files.deleteDirectory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | **Output:** `null \| undefined \| ` *** ### list `files.list` List Backendless files and directories. **Risk:** `read` ```ts theme={null} await corsair.backendless.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `pattern` | `string` | No | — | | `sub` | `boolean` | No | — | | `pageSize` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name: string, > createdOn?: number, > publicUrl?: string, > size?: number, > url?: string > }[] > ``` *** ### move `files.move` Move a Backendless file or directory. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.files.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sourcePath` | `string` | Yes | — | | `targetPath` | `string` | Yes | — | **Output:** `string` *** ## Hive ### create `hive.create` Create a Backendless Hive. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.hive.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hiveName` | `string` | Yes | — | **Output:** `null \| undefined \| ` *** ### keyItems `hive.keyItems` Retrieve items from a Backendless Hive list. **Risk:** `read` ```ts theme={null} await corsair.backendless.api.hive.keyItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hiveName` | `string` | Yes | — | | `key` | `string` | Yes | — | | `index` | `number` | No | — | | `from` | `number` | No | — | | `to` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > any[] | string | number | boolean | null | { > } > ``` *** ### mapPut `hive.mapPut` Insert or update a Backendless Hive map value. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.hive.mapPut({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hiveName` | `string` | Yes | — | | `mapKey` | `string` | Yes | — | | `keyName` | `string` | Yes | — | | `value` | `any` | Yes | — | **Output:** `boolean` *** ### values `hive.values` Retrieve values from a Backendless Hive map. **Risk:** `read` ```ts theme={null} await corsair.backendless.api.hive.values({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hiveName` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Messaging ### publish `messaging.publish` Publish a message to a Backendless channel. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.messaging.publish({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `message` | `any` | Yes | — | | `headers` | `object` | No | — | | `subtopic` | `string` | No | — | | `publishAt` | `string \| number` | No | — | > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `errorMessage` | `string` | No | — | | `messageId` | `string` | Yes | — | | `status` | `string` | Yes | — | *** ## Permissions ### grant `permissions.grant` Grant a Backendless data permission; security-sensitive. **Risk:** `destructive` ```ts theme={null} await corsair.backendless.api.permissions.grant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tableName` | `string` | Yes | — | | `permission` | `ADD \| UPDATE \| FIND \| REMOVE \| DESCRIBE \| PERMISSION \| LOAD_RELATIONS \| ADD_RELATION \| DELETE_RELATION \| UPSERT \| *` | Yes | — | | `objectId` | `string` | No | — | | `userId` | `string` | No | — | | `role` | `string` | No | — | **Output:** `null \| undefined \| ` *** ### revoke `permissions.revoke` Revoke a Backendless data permission; security-sensitive. **Risk:** `destructive` ```ts theme={null} await corsair.backendless.api.permissions.revoke({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tableName` | `string` | Yes | — | | `permission` | `ADD \| UPDATE \| FIND \| REMOVE \| DESCRIBE \| PERMISSION \| LOAD_RELATIONS \| ADD_RELATION \| DELETE_RELATION \| UPSERT \| *` | Yes | — | | `objectId` | `string` | No | — | | `userId` | `string` | No | — | | `role` | `string` | No | — | **Output:** `null \| undefined \| ` *** ## Users ### delete `users.delete` Delete a Backendless user. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.backendless.api.users.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > number | { > deletionTime?: number > } | null | undefined | > ``` *** ### find `users.find` Find a Backendless user by object ID. **Risk:** `read` ```ts theme={null} await corsair.backendless.api.users.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `objectId` | `string` | Yes | — | | `email` | `string` | No | — | | `___class` | `string` | No | — | | `created` | `number` | No | — | | `updated` | `number` | No | — | | `ownerId` | `string` | No | — | | `user-token` | `string` | No | — | *** ### login `users.login` Log in to Backendless and return a user token. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.users.login({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `login` | `string` | Yes | — | | `password` | `string` | Yes | — | | `stayLoggedIn` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | | `userToken` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > objectId: string, > email?: string, > ___class?: string, > created?: number, > updated?: number | null, > ownerId?: string | null, > user-token?: string > } > ``` *** ### logout `users.logout` Log out the current Backendless user session. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.users.logout({}); ``` **Input:** *empty object* **Output:** `null \| undefined \| ` *** ### passwordRecovery `users.passwordRecovery` Request Backendless password recovery. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.users.passwordRecovery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identity` | `string` | Yes | — | **Output:** `null \| undefined \| ` *** ### register `users.register` Register a Backendless user. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.users.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identity` | `string` | Yes | — | | `password` | `string` | Yes | — | | `properties` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `objectId` | `string` | Yes | — | | `email` | `string` | No | — | | `___class` | `string` | No | — | | `created` | `number` | No | — | | `updated` | `number` | No | — | | `ownerId` | `string` | No | — | | `user-token` | `string` | No | — | *** ### update `users.update` Update a Backendless user. **Risk:** `write` ```ts theme={null} await corsair.backendless.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `properties` | `object` | Yes | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `objectId` | `string` | Yes | — | | `email` | `string` | No | — | | `___class` | `string` | No | — | | `created` | `number` | No | — | | `updated` | `number` | No | — | | `ownerId` | `string` | No | — | | `user-token` | `string` | No | — | *** ### validateToken `users.validateToken` Validate a Backendless user token. **Risk:** `read` ```ts theme={null} await corsair.backendless.api.users.validateToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userToken` | `string` | No | — | **Output:** `boolean` *** # Database Source: https://docs.corsair.dev/plugins/backendless/database Backendless local sync: searchable entities, `.search()` filters, and operators. The Backendless plugin syncs data locally. Use `corsair.backendless.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Data Objects Path: `backendless.db.dataObjects.search` ```ts theme={null} const rows = await corsair.backendless.db.dataObjects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `objectId` | `string` | equals, contains, startsWith, endsWith, in | | `___class` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | | `ownerId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `backendless.db.files.search` ```ts theme={null} const rows = await corsair.backendless.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdOn` | `number` | equals, gt, gte, lt, lte, in | | `publicUrl` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `backendless.db.messages.search` ```ts theme={null} const rows = await corsair.backendless.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `errorMessage` | `string` | equals, contains, startsWith, endsWith, in | | `messageId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `backendless.db.users.search` ```ts theme={null} const rows = await corsair.backendless.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `objectId` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `___class` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | | `ownerId` | `string` | equals, contains, startsWith, endsWith, in | | `user-token` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/backendless/overview Backend-as-a-service for databases, user auth, file storage, and serverless logic. Use **Backendless** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 26 typed API operations * 4 synced entities (`dataObjects`, `files`, `messages`, `users`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/backendless ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/backendless ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/backendless ``` ```bash bun theme={null} bun add corsair @corsair-dev/backendless ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { backendless } from '@corsair-dev/backendless'; export const corsair = createCorsair({ plugins: [ backendless(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** Auth methods depend on how you configure `backendless({ ... })` — check the plugin source `*PluginOptions` type. **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'backendless', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`counters.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.backendless.api.counters.get({}); ``` **`counters.reset`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.backendless.api.counters.reset({}); ``` See the full list on the [API](/plugins/backendless/api) page. ## Query synced data Synced entities support `tenant.backendless.db..search()` and `.list()`: `dataObjects`, `files`, `messages`, `users`. See [Database](/plugins/backendless/database) for filters and operators. ## What's next > **[API reference](/plugins/backendless/api)** > > Every `backendless.api.*` operation with input and output types. > **[Database](/plugins/backendless/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bannerbear/api API reference for Bannerbear: every `bannerbear.api.*` operation with input and output types. Every `bannerbear.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getAccountInfo `account.getAccountInfo` Get account info including plan and quota **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.account.getAccountInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `created_at` | `string` | No | — | | `uid` | `string` | Yes | — | | `plan` | `string` | No | — | | `quota` | `object` | No | — | | `workspace` | `string` | No | — | | `api_key` | `object` | No | — | > **quota full type** > > ```ts theme={null} > { > max: number, > current: number, > remaining: number > } > ``` > **api\_key full type** > > ```ts theme={null} > { > name?: string | null, > scopes?: string[], > allowed_origins?: string[] > } > ``` *** ### getAuth `account.getAuth` Verify API authentication against the current account **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.account.getAuth({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `created_at` | `string` | No | — | | `uid` | `string` | Yes | — | | `plan` | `string` | No | — | | `quota` | `object` | No | — | | `workspace` | `string` | No | — | | `api_key` | `object` | No | — | > **quota full type** > > ```ts theme={null} > { > max: number, > current: number, > remaining: number > } > ``` > **api\_key full type** > > ```ts theme={null} > { > name?: string | null, > scopes?: string[], > allowed_origins?: string[] > } > ``` *** ## Animations ### create `animations.create` Generate an animation from a template **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.animations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template` | `string` | Yes | — | | `modifications` | `object` | Yes | — | | `formats` | `mp4 \| mov[]` | No | — | | `metadata` | `string` | No | — | > **modifications full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `status` | `string` | Yes | — | | `template` | `string` | No | — | | `files` | `object` | No | — | | `progress` | `number` | No | — | | `metadata` | `string` | No | — | | `error` | `string` | No | — | | `self` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > } > ``` *** ### get `animations.get` Get an animation by UID **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.animations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `status` | `string` | Yes | — | | `template` | `string` | No | — | | `files` | `object` | No | — | | `progress` | `number` | No | — | | `metadata` | `string` | No | — | | `error` | `string` | No | — | | `self` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > } > ``` *** ### list `animations.list` List generated animations **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.animations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > uid: string, > status: string, > template?: string | null, > files?: { > } | null, > progress?: number | null, > metadata?: string | null, > error?: string | null, > self?: string | null, > created_at?: string | null, > completed_at?: string | null > }[] > ``` *** ## Animation Templates ### create `animationTemplates.create` Create an animation template **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.animationTemplates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `tags` | `string[]` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `frame_rate` | `24 \| 30 \| 60` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `frame_rate` | `number` | No | — | | `duration_seconds` | `number` | No | — | | `preview` | `string` | No | — | | `tags` | `string[]` | No | — | | `created_at` | `string` | No | — | | `self` | `string` | No | — | *** ### get `animationTemplates.get` Get an animation template by UID **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.animationTemplates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `frame_rate` | `number` | No | — | | `duration_seconds` | `number` | No | — | | `preview` | `string` | No | — | | `tags` | `string[]` | No | — | | `created_at` | `string` | No | — | | `self` | `string` | No | — | *** ### list `animationTemplates.list` List animation templates **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.animationTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > uid: string, > name: string, > description?: string | null, > width?: number | null, > height?: number | null, > frame_rate?: number | null, > duration_seconds?: number | null, > preview?: string | null, > tags?: string[], > created_at?: string | null, > self?: string | null > }[] > ``` *** ## Images ### create `images.create` Generate an image from a template **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.images.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template` | `string` | Yes | — | | `modifications` | `object` | Yes | — | | `metadata` | `string` | No | — | > **modifications full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `status` | `string` | Yes | — | | `template` | `string` | No | — | | `files` | `object` | No | — | | `metadata` | `string` | No | — | | `error` | `string` | No | — | | `self` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > } > ``` *** ### get `images.get` Get an image by UID **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.images.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `status` | `string` | Yes | — | | `template` | `string` | No | — | | `files` | `object` | No | — | | `metadata` | `string` | No | — | | `error` | `string` | No | — | | `self` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > } > ``` *** ### list `images.list` List generated images **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.images.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > uid: string, > status: string, > template?: string | null, > files?: { > } | null, > metadata?: string | null, > error?: string | null, > self?: string | null, > created_at?: string | null, > completed_at?: string | null > }[] > ``` *** ## Instant Urls ### create `instantUrls.create` Create an Instant URL for an image template **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.instantUrls.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `template` | `string` | Yes | — | | `mode` | `encoded \| named_params` | No | — | | `security` | `signed \| open` | No | — | | `status` | `active \| disabled` | No | — | | `scale` | `1 \| 2 \| 3 \| 4` | No | — | | `rate_limit` | `boolean` | No | — | | `template_version` | `number` | No | — | | `max_renders` | `number` | No | — | | `expires_at` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | No | — | | `template` | `string` | No | — | | `base_url` | `string` | No | — | | `sample_url` | `string` | No | — | | `mode` | `string` | No | — | | `security` | `string` | No | — | | `status` | `string` | No | — | | `signing_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ### list `instantUrls.list` List Instant URLs **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.instantUrls.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > uid: string, > name?: string, > template?: string | null, > base_url?: string, > sample_url?: string | null, > mode?: string | null, > security?: string | null, > status?: string | null, > signing_key?: string | null, > created_at?: string | null > }[] > ``` *** ## Misc ### joinPdfs `misc.joinPdfs` Merge image or PDF URLs into one PDF **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.misc.joinPdfs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `urls` | `string[]` | Yes | — | | `metadata` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `status` | `string` | Yes | — | | `joined_pdf_url` | `string` | No | — | | `self` | `string` | No | — | | `created_at` | `string` | No | — | | `metadata` | `string` | No | — | *** ## Templates ### create `templates.create` Create an image template **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.templates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `tags` | `string[]` | No | — | | `config` | `object` | No | — | > **config full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `preview` | `string` | No | — | | `preview_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `self` | `string` | No | — | *** ### delete `templates.delete` Delete an image template by UID **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.templates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `templates.get` Get an image template by UID **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.templates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `preview` | `string` | No | — | | `preview_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `self` | `string` | No | — | *** ### import `templates.import` Install a publication as an image template **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.templates.import({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `publication_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `preview` | `string` | No | — | | `preview_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `self` | `string` | No | — | *** ### list `templates.list` List image templates **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.templates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > uid: string, > name: string, > description?: string | null, > width?: number | null, > height?: number | null, > preview?: string | null, > preview_url?: string | null, > created_at?: string | null, > updated_at?: string | null, > tags?: string[], > self?: string | null > }[] > ``` *** ## Webhooks Api ### create `webhooksApi.create` Create a webhook **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.webhooksApi.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | | `resource` | `image \| batch \| tool_job \| workflow_run \| animation` | No | — | | `event` | `all_events \| completed \| failed` | No | — | | `status` | `active \| disabled` | No | — | | `scope` | `all_templates \| specific_templates` | No | — | | `templates` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | Yes | — | | `resource` | `string` | No | — | | `event` | `string` | No | — | | `status` | `string` | No | — | | `signing_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ### delete `webhooksApi.delete` Delete a webhook by UID **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.webhooksApi.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `webhooksApi.get` Get a webhook by UID **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.webhooksApi.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | Yes | — | | `resource` | `string` | No | — | | `event` | `string` | No | — | | `status` | `string` | No | — | | `signing_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Workflows ### createWorkflowRun `workflows.createWorkflowRun` Run a workflow with inputs **Risk:** `write` ```ts theme={null} await corsair.bannerbear.api.workflows.createWorkflowRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workflow` | `string` | Yes | — | | `inputs` | `object` | No | — | > **inputs full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `status` | `string` | Yes | — | | `workflow` | `string` | No | — | | `progress` | `number` | No | — | | `inputs` | `object` | No | — | | `outputs` | `object` | No | — | | `steps` | `object[]` | No | — | | `error` | `string` | No | — | | `self` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | > **inputs full type** > > ```ts theme={null} > { > } > ``` > **outputs full type** > > ```ts theme={null} > { > } > ``` > **steps full type** > > ```ts theme={null} > { > }[] > ``` *** ### getWorkflow `workflows.getWorkflow` Get a workflow by UID **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.workflows.getWorkflow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `tags` | `string[]` | No | — | | `inputs` | `object` | No | — | | `steps` | `object[]` | No | — | | `ui_write_access` | `string` | No | — | | `api_write_access` | `string` | No | — | | `created_at` | `string` | No | — | > **inputs full type** > > ```ts theme={null} > { > } > ``` > **steps full type** > > ```ts theme={null} > { > }[] > ``` *** ### getWorkflowRun `workflows.getWorkflowRun` Get a workflow run by UID **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.workflows.getWorkflowRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `status` | `string` | Yes | — | | `workflow` | `string` | No | — | | `progress` | `number` | No | — | | `inputs` | `object` | No | — | | `outputs` | `object` | No | — | | `steps` | `object[]` | No | — | | `error` | `string` | No | — | | `self` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | > **inputs full type** > > ```ts theme={null} > { > } > ``` > **outputs full type** > > ```ts theme={null} > { > } > ``` > **steps full type** > > ```ts theme={null} > { > }[] > ``` *** ### listWorkflowRuns `workflows.listWorkflowRuns` List workflow runs **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.workflows.listWorkflowRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > uid: string, > status: string, > workflow?: string | null, > progress?: number | null, > inputs?: { > } | null, > outputs?: { > } | null, > steps?: { > }[] | null, > error?: string | null, > self?: string | null, > created_at?: string | null, > completed_at?: string | null > }[] > ``` *** ### listWorkflows `workflows.listWorkflows` List workflows in the workspace **Risk:** `read` ```ts theme={null} await corsair.bannerbear.api.workflows.listWorkflows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > uid: string, > name: string, > description?: string | null, > tags?: string[], > inputs?: { > } | null, > steps?: { > }[] | null, > ui_write_access?: string | null, > api_write_access?: string | null, > created_at?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/bannerbear/database Bannerbear local sync: searchable entities, `.search()` filters, and operators. The Bannerbear plugin syncs data locally. Use `corsair.bannerbear.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/bannerbear/overview Automated image and video generation API for social posts and marketing templates. Use **Bannerbear** through Corsair: one client, typed API calls, and incoming webhooks. **What you get:** * 27 typed API operations * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bannerbear ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bannerbear ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bannerbear ``` ```bash bun theme={null} bun add corsair @corsair-dev/bannerbear ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bannerbear } from '@corsair-dev/bannerbear'; export const corsair = createCorsair({ plugins: [ bannerbear(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bannerbear() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bannerbear', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getAccountInfo`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bannerbear.api.account.getAccountInfo({}); ``` **`animations.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bannerbear.api.animations.create({}); ``` See the full list on the [API](/plugins/bannerbear/api) page. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/bannerbear/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/bannerbear/api)** > > Every `bannerbear.api.*` operation with input and output types. > **[Webhooks](/plugins/bannerbear/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/bannerbear/webhooks Bannerbear incoming webhooks: event paths, payloads, and response data. The Bannerbear plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/bannerbear/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `animation` * `animationCompleted` (`animation.animationCompleted`) * `image` * `imageCompleted` (`image.imageCompleted`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Animation ### Animation Completed `animation.animationCompleted` Fires when a Bannerbear animation finishes rendering **Payload** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `status` | `completed` | Yes | — | | `template` | `string` | No | — | | `files` | `object` | No | — | | `progress` | `number` | No | — | | `metadata` | `string` | No | — | | `self` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > uid: string, > status: completed, > template?: string, > files?: { > }, > progress?: number, > metadata?: string, > self?: string, > created_at?: string, > completed_at?: string > } > ``` **`webhookHooks` example** ```ts theme={null} bannerbear({ webhookHooks: { animation: { animationCompleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Image ### Image Completed `image.imageCompleted` Fires when a Bannerbear image finishes rendering **Payload** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `status` | `completed` | Yes | — | | `template` | `string` | No | — | | `files` | `object` | No | — | | `metadata` | `string` | No | — | | `self` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > uid: string, > status: completed, > template?: string, > files?: { > }, > metadata?: string, > self?: string, > created_at?: string, > completed_at?: string > } > ``` **`webhookHooks` example** ```ts theme={null} bannerbear({ webhookHooks: { image: { imageCompleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/bart/api API reference for BART: every `bart.api.*` operation with input and output types. Every `bart.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Advisories ### elevators `advisories.elevators` Get current elevator status and elevator outage advisories **Risk:** `read` ```ts theme={null} await corsair.bart.api.advisories.elevators({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orig` | `string` | No | — | | `date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `time` | `string` | No | — | | `bsa` | `object` | No | — | > **bsa full type** > > ```ts theme={null} > { > station?: string, > type?: string, > description?: string | { > #cdata-section: string > }, > sms_text?: string | { > #cdata-section: string > }, > posted?: string, > expires?: string > }[] | { > station?: string, > type?: string, > description?: string | { > #cdata-section: string > }, > sms_text?: string | { > #cdata-section: string > }, > posted?: string, > expires?: string > } > ``` *** ### list `advisories.list` Get current BART system advisories and service delays **Risk:** `read` ```ts theme={null} await corsair.bart.api.advisories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orig` | `string` | No | — | | `date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `time` | `string` | No | — | | `bsa` | `object` | No | — | | `message` | `object` | No | — | > **bsa full type** > > ```ts theme={null} > { > station?: string, > type?: string, > description?: string | { > #cdata-section: string > }, > sms_text?: string | { > #cdata-section: string > }, > posted?: string, > expires?: string > }[] | { > station?: string, > type?: string, > description?: string | { > #cdata-section: string > }, > sms_text?: string | { > #cdata-section: string > }, > posted?: string, > expires?: string > } > ``` > **message full type** > > ```ts theme={null} > string | { > } > ``` *** ### trainCount `advisories.trainCount` Get the number of trains currently active in the BART system **Risk:** `read` ```ts theme={null} await corsair.bart.api.advisories.trainCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `time` | `string` | No | — | | `traincount` | `string \| number` | Yes | — | *** ## Etd ### station `etd.station` Get real-time estimated departure times for a BART station **Risk:** `read` ```ts theme={null} await corsair.bart.api.etd.station({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orig` | `string` | Yes | — | | `plat` | `string \| number` | No | — | | `dir` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | | `time` | `string` | No | — | | `station` | `object` | Yes | — | | `message` | `object` | No | — | > **station full type** > > ```ts theme={null} > { > name: string, > abbr: string, > etd?: { > destination: string, > abbreviation: string, > limited?: string, > estimate: { > minutes: string, > platform?: string, > direction?: string, > length?: string, > color?: string, > hexcolor?: string, > bikeflag?: string, > delay?: string, > cancelflag?: string, > dynamicflag?: string > }[] | { > minutes: string, > platform?: string, > direction?: string, > length?: string, > color?: string, > hexcolor?: string, > bikeflag?: string, > delay?: string, > cancelflag?: string, > dynamicflag?: string > } > }[] | { > destination: string, > abbreviation: string, > limited?: string, > estimate: { > minutes: string, > platform?: string, > direction?: string, > length?: string, > color?: string, > hexcolor?: string, > bikeflag?: string, > delay?: string, > cancelflag?: string, > dynamicflag?: string > }[] | { > minutes: string, > platform?: string, > direction?: string, > length?: string, > color?: string, > hexcolor?: string, > bikeflag?: string, > delay?: string, > cancelflag?: string, > dynamicflag?: string > } > } > }[] | { > name: string, > abbr: string, > etd?: { > destination: string, > abbreviation: string, > limited?: string, > estimate: { > minutes: string, > platform?: string, > direction?: string, > length?: string, > color?: string, > hexcolor?: string, > bikeflag?: string, > delay?: string, > cancelflag?: string, > dynamicflag?: string > }[] | { > minutes: string, > platform?: string, > direction?: string, > length?: string, > color?: string, > hexcolor?: string, > bikeflag?: string, > delay?: string, > cancelflag?: string, > dynamicflag?: string > } > }[] | { > destination: string, > abbreviation: string, > limited?: string, > estimate: { > minutes: string, > platform?: string, > direction?: string, > length?: string, > color?: string, > hexcolor?: string, > bikeflag?: string, > delay?: string, > cancelflag?: string, > dynamicflag?: string > }[] | { > minutes: string, > platform?: string, > direction?: string, > length?: string, > color?: string, > hexcolor?: string, > bikeflag?: string, > delay?: string, > cancelflag?: string, > dynamicflag?: string > } > } > } > ``` > **message full type** > > ```ts theme={null} > string | { > } > ``` *** ## Fares ### calculate `fares.calculate` Calculate transit fares and ticket prices between two BART stations **Risk:** `read` ```ts theme={null} await corsair.bart.api.fares.calculate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orig` | `string` | Yes | — | | `dest` | `string` | Yes | — | | `date` | `string` | No | — | | `sched` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `origin` | `string` | No | — | | `destination` | `string` | No | — | | `sched` | `string` | No | — | | `sched_num` | `string` | No | — | | `trip` | `object` | No | — | | `fares` | `object` | No | — | > **trip full type** > > ```ts theme={null} > { > fare?: string, > discount?: { > } > } > ``` > **fares full type** > > ```ts theme={null} > { > fare?: { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > }[] | { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > } > } > ``` *** ## Routes ### info `routes.info` Get detailed information about a specific BART transit route **Risk:** `read` ```ts theme={null} await corsair.bart.api.routes.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `route` | `string \| number` | Yes | — | | `sched` | `string \| number` | No | — | | `date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sched` | `string` | No | — | | `routes` | `object` | Yes | — | > **routes full type** > > ```ts theme={null} > { > route: { > name: string, > abbr: string, > routeID: string, > number: string, > origin?: string, > destination?: string, > direction?: string, > color?: string, > hexcolor?: string, > holidays?: string, > numStns?: string, > config?: { > station?: string[] | string > } > }[] | { > name: string, > abbr: string, > routeID: string, > number: string, > origin?: string, > destination?: string, > direction?: string, > color?: string, > hexcolor?: string, > holidays?: string, > numStns?: string, > config?: { > station?: string[] | string > } > } > } > ``` *** ### list `routes.list` Get the list of all current BART transit routes **Risk:** `read` ```ts theme={null} await corsair.bart.api.routes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sched` | `string \| number` | No | — | | `date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sched` | `string` | No | — | | `routes` | `object` | Yes | — | > **routes full type** > > ```ts theme={null} > { > route: { > name: string, > abbr: string, > routeID: string, > number: string, > hexcolor?: string, > color?: string > }[] | { > name: string, > abbr: string, > routeID: string, > number: string, > hexcolor?: string, > color?: string > } > } > ``` *** ## Schedules ### arrivals `schedules.arrivals` Get scheduled arrivals and trip itinerary between two BART stations **Risk:** `read` ```ts theme={null} await corsair.bart.api.schedules.arrivals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orig` | `string` | Yes | — | | `dest` | `string` | Yes | — | | `time` | `string` | No | — | | `date` | `string` | No | — | | `b` | `string \| number` | No | — | | `a` | `string \| number` | No | — | | `l` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `origin` | `string` | No | — | | `destination` | `string` | No | — | | `schedule` | `object` | No | — | | `schedule_files` | `object` | No | — | > **schedule full type** > > ```ts theme={null} > { > date?: string, > time?: string, > before?: string, > after?: string, > request?: { > trip?: { > } > }, > trip?: { > @origin?: string, > @destination?: string, > @fare?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @tripTime?: string, > @clipper?: string, > leg?: { > @order?: string, > @transfercode?: string, > @origin?: string, > @destination?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @line?: string, > @bikeflag?: string, > @trainHeadStation?: string, > @trainIdx?: string > }[] | { > @order?: string, > @transfercode?: string, > @origin?: string, > @destination?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @line?: string, > @bikeflag?: string, > @trainHeadStation?: string, > @trainIdx?: string > }, > fares?: { > fare?: { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > }[] | { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > } > } > }[] | { > @origin?: string, > @destination?: string, > @fare?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @tripTime?: string, > @clipper?: string, > leg?: { > @order?: string, > @transfercode?: string, > @origin?: string, > @destination?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @line?: string, > @bikeflag?: string, > @trainHeadStation?: string, > @trainIdx?: string > }[] | { > @order?: string, > @transfercode?: string, > @origin?: string, > @destination?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @line?: string, > @bikeflag?: string, > @trainHeadStation?: string, > @trainIdx?: string > }, > fares?: { > fare?: { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > }[] | { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > } > } > } > } > ``` > **schedule\_files full type** > > ```ts theme={null} > { > file?: { > }[] | { > } > } > ``` *** ### departures `schedules.departures` Get scheduled departures and trip itinerary between two BART stations **Risk:** `read` ```ts theme={null} await corsair.bart.api.schedules.departures({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orig` | `string` | Yes | — | | `dest` | `string` | Yes | — | | `time` | `string` | No | — | | `date` | `string` | No | — | | `b` | `string \| number` | No | — | | `a` | `string \| number` | No | — | | `l` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `origin` | `string` | No | — | | `destination` | `string` | No | — | | `schedule` | `object` | No | — | | `schedule_files` | `object` | No | — | > **schedule full type** > > ```ts theme={null} > { > date?: string, > time?: string, > before?: string, > after?: string, > request?: { > trip?: { > } > }, > trip?: { > @origin?: string, > @destination?: string, > @fare?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @tripTime?: string, > @clipper?: string, > leg?: { > @order?: string, > @transfercode?: string, > @origin?: string, > @destination?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @line?: string, > @bikeflag?: string, > @trainHeadStation?: string, > @trainIdx?: string > }[] | { > @order?: string, > @transfercode?: string, > @origin?: string, > @destination?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @line?: string, > @bikeflag?: string, > @trainHeadStation?: string, > @trainIdx?: string > }, > fares?: { > fare?: { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > }[] | { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > } > } > }[] | { > @origin?: string, > @destination?: string, > @fare?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @tripTime?: string, > @clipper?: string, > leg?: { > @order?: string, > @transfercode?: string, > @origin?: string, > @destination?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @line?: string, > @bikeflag?: string, > @trainHeadStation?: string, > @trainIdx?: string > }[] | { > @order?: string, > @transfercode?: string, > @origin?: string, > @destination?: string, > @origTimeMin?: string, > @origTimeDate?: string, > @destTimeMin?: string, > @destTimeDate?: string, > @line?: string, > @bikeflag?: string, > @trainHeadStation?: string, > @trainIdx?: string > }, > fares?: { > fare?: { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > }[] | { > @amount?: string, > @class?: string, > @name?: string, > @type?: string > } > } > } > } > ``` > **schedule\_files full type** > > ```ts theme={null} > { > file?: { > }[] | { > } > } > ``` *** ### routes `schedules.routes` Get the full timetable and stop schedule for a specific BART route **Risk:** `read` ```ts theme={null} await corsair.bart.api.schedules.routes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `route` | `string \| number` | Yes | — | | `time` | `string` | No | — | | `date` | `string` | No | — | | `l` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `route` | `object` | No | — | > **route full type** > > ```ts theme={null} > { > train?: { > @trainIdx?: string, > @trainHeadStation?: string, > stop?: { > @station?: string, > @origTime?: string, > @bikeflag?: string, > @load?: string > }[] | { > @station?: string, > @origTime?: string, > @bikeflag?: string, > @load?: string > } > }[] | { > @trainIdx?: string, > @trainHeadStation?: string, > stop?: { > @station?: string, > @origTime?: string, > @bikeflag?: string, > @load?: string > }[] | { > @station?: string, > @origTime?: string, > @bikeflag?: string, > @load?: string > } > } > } > ``` *** ## Stations ### access `stations.access` Get station access details including parking, lockers, and transit connections **Risk:** `read` ```ts theme={null} await corsair.bart.api.stations.access({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orig` | `string` | Yes | — | | `l` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `stations` | `object` | No | — | | `station` | `object` | No | — | > **stations full type** > > ```ts theme={null} > { > station: { > name: string, > abbr: string, > entering?: string | { > #cdata-section: string > }, > exiting?: string | { > #cdata-section: string > }, > parking?: string | { > #cdata-section: string > }, > fill_time?: string | { > #cdata-section: string > }, > car_share?: string | { > #cdata-section: string > }, > lockers?: string | { > #cdata-section: string > }, > bike_station_text?: string | { > #cdata-section: string > }, > dest_stations?: string | { > #cdata-section: string > }, > transit_info?: string | { > #cdata-section: string > }, > link?: string | { > #cdata-section: string > } > }[] | { > name: string, > abbr: string, > entering?: string | { > #cdata-section: string > }, > exiting?: string | { > #cdata-section: string > }, > parking?: string | { > #cdata-section: string > }, > fill_time?: string | { > #cdata-section: string > }, > car_share?: string | { > #cdata-section: string > }, > lockers?: string | { > #cdata-section: string > }, > bike_station_text?: string | { > #cdata-section: string > }, > dest_stations?: string | { > #cdata-section: string > }, > transit_info?: string | { > #cdata-section: string > }, > link?: string | { > #cdata-section: string > } > } > } > ``` > **station full type** > > ```ts theme={null} > { > name: string, > abbr: string, > entering?: string | { > #cdata-section: string > }, > exiting?: string | { > #cdata-section: string > }, > parking?: string | { > #cdata-section: string > }, > fill_time?: string | { > #cdata-section: string > }, > car_share?: string | { > #cdata-section: string > }, > lockers?: string | { > #cdata-section: string > }, > bike_station_text?: string | { > #cdata-section: string > }, > dest_stations?: string | { > #cdata-section: string > }, > transit_info?: string | { > #cdata-section: string > }, > link?: string | { > #cdata-section: string > } > }[] | { > name: string, > abbr: string, > entering?: string | { > #cdata-section: string > }, > exiting?: string | { > #cdata-section: string > }, > parking?: string | { > #cdata-section: string > }, > fill_time?: string | { > #cdata-section: string > }, > car_share?: string | { > #cdata-section: string > }, > lockers?: string | { > #cdata-section: string > }, > bike_station_text?: string | { > #cdata-section: string > }, > dest_stations?: string | { > #cdata-section: string > }, > transit_info?: string | { > #cdata-section: string > }, > link?: string | { > #cdata-section: string > } > } > ``` *** ### info `stations.info` Get detailed station information, connections, and platforms **Risk:** `read` ```ts theme={null} await corsair.bart.api.stations.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orig` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `stations` | `object` | No | — | | `station` | `object` | No | — | > **stations full type** > > ```ts theme={null} > { > station: { > name: string, > abbr: string, > gtfs_latitude?: string, > gtfs_longitude?: string, > address?: string, > city?: string, > county?: string, > state?: string, > zipcode?: string, > north_routes?: { > route?: string[] | string > }, > south_routes?: { > route?: string[] | string > }, > north_platforms?: { > platform?: string[] | string > }, > south_platforms?: { > platform?: string[] | string > }, > platform_info?: string, > intro?: string | { > #cdata-section: string > }, > cross_street?: string | { > #cdata-section: string > }, > food?: string | { > #cdata-section: string > }, > shopping?: string | { > #cdata-section: string > }, > attraction?: string | { > #cdata-section: string > }, > link?: string | { > #cdata-section: string > } > }[] | { > name: string, > abbr: string, > gtfs_latitude?: string, > gtfs_longitude?: string, > address?: string, > city?: string, > county?: string, > state?: string, > zipcode?: string, > north_routes?: { > route?: string[] | string > }, > south_routes?: { > route?: string[] | string > }, > north_platforms?: { > platform?: string[] | string > }, > south_platforms?: { > platform?: string[] | string > }, > platform_info?: string, > intro?: string | { > #cdata-section: string > }, > cross_street?: string | { > #cdata-section: string > }, > food?: string | { > #cdata-section: string > }, > shopping?: string | { > #cdata-section: string > }, > attraction?: string | { > #cdata-section: string > }, > link?: string | { > #cdata-section: string > } > } > } > ``` > **station full type** > > ```ts theme={null} > { > name: string, > abbr: string, > gtfs_latitude?: string, > gtfs_longitude?: string, > address?: string, > city?: string, > county?: string, > state?: string, > zipcode?: string, > north_routes?: { > route?: string[] | string > }, > south_routes?: { > route?: string[] | string > }, > north_platforms?: { > platform?: string[] | string > }, > south_platforms?: { > platform?: string[] | string > }, > platform_info?: string, > intro?: string | { > #cdata-section: string > }, > cross_street?: string | { > #cdata-section: string > }, > food?: string | { > #cdata-section: string > }, > shopping?: string | { > #cdata-section: string > }, > attraction?: string | { > #cdata-section: string > }, > link?: string | { > #cdata-section: string > } > }[] | { > name: string, > abbr: string, > gtfs_latitude?: string, > gtfs_longitude?: string, > address?: string, > city?: string, > county?: string, > state?: string, > zipcode?: string, > north_routes?: { > route?: string[] | string > }, > south_routes?: { > route?: string[] | string > }, > north_platforms?: { > platform?: string[] | string > }, > south_platforms?: { > platform?: string[] | string > }, > platform_info?: string, > intro?: string | { > #cdata-section: string > }, > cross_street?: string | { > #cdata-section: string > }, > food?: string | { > #cdata-section: string > }, > shopping?: string | { > #cdata-section: string > }, > attraction?: string | { > #cdata-section: string > }, > link?: string | { > #cdata-section: string > } > } > ``` *** ### list `stations.list` Get list of all BART stations with geographic coordinates and addresses **Risk:** `read` ```ts theme={null} await corsair.bart.api.stations.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `stations` | `object` | Yes | — | > **stations full type** > > ```ts theme={null} > { > station: { > name: string, > abbr: string, > gtfs_latitude?: string, > gtfs_longitude?: string, > address?: string, > city?: string, > county?: string, > state?: string, > zipcode?: string > }[] | { > name: string, > abbr: string, > gtfs_latitude?: string, > gtfs_longitude?: string, > address?: string, > city?: string, > county?: string, > state?: string, > zipcode?: string > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/bart/database BART local sync: searchable entities, `.search()` filters, and operators. The BART plugin syncs data locally. Use `corsair.bart.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Advisories Path: `bart.db.advisories.search` ```ts theme={null} const rows = await corsair.bart.db.advisories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `station` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `sms_text` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Routes Path: `bart.db.routes.search` ```ts theme={null} const rows = await corsair.bart.db.routes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `routeID` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `abbr` | `string` | equals, contains, startsWith, endsWith, in | | `origin` | `string` | equals, contains, startsWith, endsWith, in | | `destination` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `hexcolor` | `string` | equals, contains, startsWith, endsWith, in | | `holidays` | `string` | equals, contains, startsWith, endsWith, in | | `numStns` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Stations Path: `bart.db.stations.search` ```ts theme={null} const rows = await corsair.bart.db.stations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `abbr` | `string` | equals, contains, startsWith, endsWith, in | | `gtfs_latitude` | `string` | equals, contains, startsWith, endsWith, in | | `gtfs_longitude` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `county` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `zipcode` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bart/overview Bay Area Rapid Transit API for schedules, arrivals, and public transit route data. Use **BART** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 13 typed API operations * 3 synced entities (`advisories`, `routes`, `stations`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bart ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bart ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bart ``` ```bash bun theme={null} bun add corsair @corsair-dev/bart ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bart } from '@corsair-dev/bart'; export const corsair = createCorsair({ plugins: [ bart(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bart() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bart', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`advisories.elevators`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bart.api.advisories.elevators({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/bart/api) reference.* See the full list on the [API](/plugins/bart/api) page. ## Query synced data Synced entities support `tenant.bart.db..search()` and `.list()`: `advisories`, `routes`, `stations`. See [Database](/plugins/bart/database) for filters and operators. ## What's next > **[API reference](/plugins/bart/api)** > > Every `bart.api.*` operation with input and output types. > **[Database](/plugins/bart/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/basecamp/api API reference for Basecamp: every `basecamp.api.*` operation with input and output types. Every `basecamp.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Automatic Check Ins ### getBucketsQuestionAnswers `automaticCheckIns.getBucketsQuestionAnswers` Tool to retrieve a specific question answer by ID from a Basecamp project. Use when you need to fetch details about an automatic check-in question answer including its content, creator, and associated comments. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.automaticCheckIns.getBucketsQuestionAnswers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `answerId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `group_on` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### getBucketsQuestionnaires `automaticCheckIns.getBucketsQuestionnaires` Tool to retrieve a specific questionnaire (automatic check-ins) from a Basecamp project. Use when you need to fetch details about a questionnaire including its questions count and metadata. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.automaticCheckIns.getBucketsQuestionnaires({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `questionnaireId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `questions_url` | `string` | No | — | | `questions_count` | `number` | No | — | | `name` | `string` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### getBucketsQuestionnairesQuestions `automaticCheckIns.getBucketsQuestionnairesQuestions` Tool to retrieve a paginated list of questions from a questionnaire in a Basecamp project. Use when you need to fetch questions from a specific questionnaire. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.automaticCheckIns.getBucketsQuestionnairesQuestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `questionnaireId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > paused?: boolean, > schedule?: { > frequency?: string, > days?: any[], > hour?: number, > minute?: number, > week_instance?: number | null, > week_interval?: number | null, > month_interval?: number | null, > start_date?: string, > end_date?: string | null > }, > answers_count?: number, > answers_url?: string > }[] > ``` *** ### getBucketsQuestions `automaticCheckIns.getBucketsQuestions` Tool to retrieve a specific check-in question by ID from a Basecamp project. Use when you already know the question ID and need its details without listing all questions from a questionnaire. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.automaticCheckIns.getBucketsQuestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `questionId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `paused` | `boolean` | No | — | | `schedule` | `object` | No | — | | `answers_count` | `number` | No | — | | `answers_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **schedule full type** > > ```ts theme={null} > { > frequency?: string, > days?: number[], > hour?: number, > minute?: number, > week_instance?: number | null, > week_interval?: number | null, > month_interval?: number | null, > start_date?: string, > end_date?: string | null > } > ``` *** ### listQuestions `automaticCheckIns.listQuestions` Tool to get all questions in a questionnaire from a Basecamp project. Use when you need to fetch questions from a specific questionnaire. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.automaticCheckIns.listQuestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `questionnaireId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > paused?: boolean, > schedule?: { > frequency?: string, > days?: any[], > hour?: number, > minute?: number, > week_instance?: number | null, > week_interval?: number | null, > month_interval?: number | null, > start_date?: string, > end_date?: string | null > }, > answers_count?: number, > answers_url?: string > }[] > ``` *** ## Campfire And Chatbots ### createChatbot `campfireAndChatbots.createChatbot` Tool to create a new chatbot in a Basecamp Campfire chat. Use when you need to add an automated bot to a chat room for posting messages and responding to commands. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.createChatbot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `campfireId` | `number` | Yes | — | | `service_name` | `string` | Yes | — | | `command_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `service_name` | `string` | Yes | — | | `command_url` | `string` | No | — | | `url` | `string` | No | — | | `app_url` | `string` | No | — | | `lines_url` | `string` | No | — | *** ### createChatbotLine `campfireAndChatbots.createChatbotLine` Tool to post a message as a chatbot to a Basecamp Campfire. Use when you need to post messages via a chatbot integration without OAuth authentication. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.createChatbotLine({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chatbotKey` | `string` | Yes | — | | `bucketId` | `number` | Yes | — | | `campfireId` | `number` | Yes | — | | `content_param` | `string` | No | — | | `content` | `string` | No | — | **Output:** `undefined` *** ### deleteCampfireLine `campfireAndChatbots.deleteCampfireLine` Tool to delete a Campfire line from a chat conversation. Use when removing a specific message from a Basecamp Campfire chat. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.deleteCampfireLine({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campfireId` | `number` | Yes | — | | `lineId` | `number` | Yes | — | **Output:** `undefined` *** ### deleteChatbot `campfireAndChatbots.deleteChatbot` Tool to delete a chatbot from a Campfire chat. Use when removing a chatbot from the account. Note: Deletion is account-wide and only account administrators can delete chatbots. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.deleteChatbot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `campfireId` | `number` | Yes | — | | `chatbotId` | `number` | Yes | — | **Output:** `undefined` *** ### getBucketsChatsIntegrations `campfireAndChatbots.getBucketsChatsIntegrations` Tool to retrieve all chatbot integrations from a Campfire chat. Use when you need to get the list of chatbots accessible to the account with chat-specific line URLs for posting messages. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.getBucketsChatsIntegrations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `campfireId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > created_at: string, > updated_at: string, > service_name: string, > command_url?: string | null, > url?: string, > app_url?: string, > lines_url?: string > }[] > ``` *** ### getBucketsChatsLines `campfireAndChatbots.getBucketsChatsLines` Tool to retrieve a paginated list of Campfire lines from a specific chat. Use when you need to fetch messages from a Campfire conversation in a Basecamp project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.getBucketsChatsLines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campfireId` | `number` | Yes | — | | `sort` | `string` | No | — | | `direction` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > content?: string | null, > attachments?: { > title?: string | null, > url?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null > }[], > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getCampfire `campfireAndChatbots.getCampfire` Tool to retrieve a specific Campfire (chat room) by ID from a Basecamp project. Use when you need to get complete Campfire details including metadata, URLs, topic, and creator information. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.getCampfire({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campfireId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `position` | `number` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `topic` | `string` | No | — | | `lines_url` | `string` | No | — | | `files_url` | `string` | No | — | > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### getCampfireLine `campfireAndChatbots.getCampfireLine` Tool to retrieve a specific Campfire line by ID from a Basecamp project. Use when you need to fetch a single message from a chat transcript. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.getCampfireLine({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campfireId` | `number` | Yes | — | | `lineId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `content` | `string` | No | — | | `attachments` | `object[]` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **attachments full type** > > ```ts theme={null} > { > title?: string | null, > url?: string, > filename?: string, > content_type?: string, > byte_size?: number, > download_url?: string > }[] > ``` > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### getChatbot `campfireAndChatbots.getChatbot` Tool to get a specific chatbot by ID from a Basecamp Campfire chat. Use when you need to retrieve details about a chatbot, including its service name, command URL, and lines URL. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.getChatbot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `campfireId` | `number` | Yes | — | | `chatbotId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `service_name` | `string` | Yes | — | | `command_url` | `string` | No | — | | `url` | `string` | No | — | | `app_url` | `string` | No | — | | `lines_url` | `string` | No | — | *** ### getChats `campfireAndChatbots.getChats` Tool to retrieve a paginated list of all active Campfires (chats) visible to the current user. Use when you need to list all available chat rooms in Basecamp. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.getChats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > position?: number | null, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > topic?: string, > lines_url?: string, > files_url?: string > }[] > ``` *** ### listCampfireLines `campfireAndChatbots.listCampfireLines` Tool to get all lines (messages) in a Campfire chat. Use when you need to fetch paginated messages from a Campfire conversation in a Basecamp project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.listCampfireLines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campfireId` | `number` | Yes | — | | `sort` | `string` | No | — | | `direction` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > content?: string | null, > attachments?: { > title?: string | null, > url?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null > }[], > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### listChatbots `campfireAndChatbots.listChatbots` Tool to get all chatbots for a chat/campfire. Use when you need to retrieve the list of chatbot integrations with their line URLs for posting messages. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.listChatbots({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `campfireId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > created_at: string, > updated_at: string, > service_name: string, > command_url?: string | null, > url?: string, > app_url?: string, > lines_url?: string > }[] > ``` *** ### postBucketsChatsLines `campfireAndChatbots.postBucketsChatsLines` Tool to create a line in a Basecamp Campfire chat. Use when you need to post a message to a specific Campfire chat within a project. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.postBucketsChatsLines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campfireId` | `number` | Yes | — | | `content` | `string` | No | — | | `content_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `content` | `string` | No | — | | `attachments` | `object[]` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **attachments full type** > > ```ts theme={null} > { > title?: string | null, > url?: string, > filename?: string, > content_type?: string, > byte_size?: number, > download_url?: string > }[] > ``` > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### postIntegrationsChatbotKeyBucketsChatsLines `campfireAndChatbots.postIntegrationsChatbotKeyBucketsChatsLines` Tool to create a line in a Basecamp Campfire chat using a chatbot key. Use when you need to post messages via a chatbot integration without OAuth authentication. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.postIntegrationsChatbotKeyBucketsChatsLines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chatbotKey` | `string` | Yes | — | | `bucketId` | `number` | Yes | — | | `campfireId` | `number` | Yes | — | | `content_param` | `string` | No | — | | `content` | `string` | No | — | **Output:** `undefined` *** ### putBucketsChatsIntegrations `campfireAndChatbots.putBucketsChatsIntegrations` Tool to update an existing chatbot integration in a Basecamp Campfire chat. Use when you need to change the service name or command URL of a chatbot. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.putBucketsChatsIntegrations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `campfireId` | `number` | Yes | — | | `chatbotId` | `number` | Yes | — | | `service_name` | `string` | Yes | — | | `command_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `service_name` | `string` | Yes | — | | `command_url` | `string` | No | — | | `url` | `string` | No | — | | `app_url` | `string` | No | — | | `lines_url` | `string` | No | — | *** ### updateChatbot `campfireAndChatbots.updateChatbot` Tool to update a chatbot's service name or command URL in a Basecamp Campfire chat. Use when you need to modify an existing chatbot integration. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.campfireAndChatbots.updateChatbot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `campfireId` | `number` | Yes | — | | `chatbotId` | `number` | Yes | — | | `service_name` | `string` | Yes | — | | `command_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `service_name` | `string` | Yes | — | | `command_url` | `string` | No | — | | `url` | `string` | No | — | | `app_url` | `string` | No | — | | `lines_url` | `string` | No | — | *** ## Card Tables ### createCard `cardTables.createCard` Tool to create a new card in a column of a Basecamp card table. Use when you need to add a card to a card table column with optional content and due date. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.createCard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `columnId` | `number` | Yes | — | | `title` | `string` | No | — | | `content` | `string` | No | — | | `due_on` | `string` | No | — | | `notify` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `position` | `number` | No | — | | `content` | `string` | No | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `due_on` | `string` | No | — | | `completed` | `boolean` | No | — | | `completed_at` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `completion_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `completer` | `object` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `steps` | `object[]` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **completer full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ### createCardStep `cardTables.createCardStep` Tool to create a step within a card in a Basecamp card table. Use when you need to add a subtask or checklist item to an existing card with optional due date and assignees. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.createCardStep({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `number` | Yes | — | | `title` | `string` | No | — | | `due_on` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `due_on` | `string` | No | — | | `completed` | `boolean` | No | — | | `completed_at` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `completer` | `object` | No | — | | `assignees` | `object[]` | No | — | | `completion_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **completer full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### deleteBucketsCardTablesColumnsOnHold `cardTables.deleteBucketsCardTablesColumnsOnHold` Tool to remove the on-hold section from a card table column. Use when you need to delete the on-hold section from a column in a Basecamp project's card table. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basecamp.api.cardTables.deleteBucketsCardTablesColumnsOnHold({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `columnId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `color` | `string` | No | — | | `description` | `string` | No | — | | `cards_count` | `number` | No | — | | `comments_count` | `number` | No | — | | `cards_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subscribers` | `object[]` | No | — | | `on_hold` | `object` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **on\_hold full type** > > ```ts theme={null} > { > id: number, > status: string, > inherits_status: boolean, > title?: string | null, > created_at: string, > updated_at: string, > cards_count: number, > cards_url: string > } > ``` *** ### getBucketsCardTablesListsCards `cardTables.getBucketsCardTablesListsCards` Tool to retrieve a paginated list of cards from a card table column. Use when you need to fetch cards from a specific list/column within a Basecamp project's card table. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.cardTables.getBucketsCardTablesListsCards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `columnId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > position?: number | null, > content?: string | null, > description?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > due_on?: string | null, > completed?: boolean, > completed_at?: string, > comments_count?: number, > comments_url?: string, > completion_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > completer?: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > assignees?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }[], > completion_subscribers?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }[], > steps?: { > id: string | number, > status?: string | null, > visible_to_clients?: boolean | null, > created_at?: string | null, > updated_at?: string | null, > title?: string | null, > inherits_status?: boolean | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bookmark_url?: string | null, > position?: number | null, > due_on?: string | null, > completed?: boolean | null, > completed_at?: any, > parent?: { > } | null, > bucket?: { > } | null, > creator?: { > } | null, > completer?: any, > assignees?: any, > completion_url?: string | null > }[], > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getCard `cardTables.getCard` Tool to get a specific card by ID from a card table. Use when you need to retrieve complete card details including title, description, status, assignees, steps, and metadata. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.cardTables.getCard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `position` | `number` | No | — | | `content` | `string` | No | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `due_on` | `string` | No | — | | `completed` | `boolean` | No | — | | `completed_at` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `completion_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `completer` | `object` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `steps` | `object[]` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **completer full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ### getCardTable `cardTables.getCardTable` Tool to retrieve a card table (Kanban board) for a project. Use when you need to fetch information about a specific card table including its columns, cards count, and subscribers. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.cardTables.getCardTable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardTableId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subscribers` | `object[]` | No | — | | `lists` | `object[]` | No | — | | `wormholes` | `object[]` | No | — | > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **lists full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > color?: string | null, > description?: string | null, > cards_count?: number, > comments_count?: number, > cards_url?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > subscribers?: any[], > on_hold?: { > id: string | number, > status?: string | null, > inherits_status?: boolean | null, > title?: string | null, > created_at?: string | null, > updated_at?: string | null, > cards_count?: number | null, > cards_url?: string | null > } > }[] > ``` > **wormholes full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > color?: string | null, > linked: boolean, > destination_url?: string | null > }[] > ``` *** ### getCardTableColumn `cardTables.getCardTableColumn` Tool to get a specific column from a card table within a Basecamp project. Use when you need to fetch details about a card table column by its ID. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.cardTables.getCardTableColumn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `columnId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `color` | `string` | No | — | | `description` | `string` | No | — | | `cards_count` | `number` | No | — | | `comments_count` | `number` | No | — | | `cards_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subscribers` | `object[]` | No | — | | `on_hold` | `object` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **on\_hold full type** > > ```ts theme={null} > { > id: number, > status: string, > inherits_status: boolean, > title?: string | null, > created_at: string, > updated_at: string, > cards_count: number, > cards_url: string > } > ``` *** ### listCards `cardTables.listCards` Tool to get all cards in a column from a Basecamp card table. Use when you need to retrieve cards from a specific column/list within a project's card table. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.cardTables.listCards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `columnId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > position?: number | null, > content?: string | null, > description?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > due_on?: string | null, > completed?: boolean, > completed_at?: string, > comments_count?: number, > comments_url?: string, > completion_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > completer?: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > assignees?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }[], > completion_subscribers?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }[], > steps?: { > id: string | number, > status?: string | null, > visible_to_clients?: boolean | null, > created_at?: string | null, > updated_at?: string | null, > title?: string | null, > inherits_status?: boolean | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bookmark_url?: string | null, > position?: number | null, > due_on?: string | null, > completed?: boolean | null, > completed_at?: any, > parent?: { > } | null, > bucket?: { > } | null, > creator?: { > } | null, > completer?: any, > assignees?: any, > completion_url?: string | null > }[], > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### moveCard `cardTables.moveCard` Tool to move a card to a different column within a Basecamp card table. Use when you need to relocate a card from one column to another in a project. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.moveCard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `number` | Yes | — | | `column_id` | `number` | Yes | — | | `position` | `number` | No | — | **Output:** `undefined` *** ### moveCardTableColumn `cardTables.moveCardTableColumn` Tool to reorder columns within a Basecamp card table. Use when you need to change the position of a column in a card table by specifying the column to move and its new position. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.moveCardTableColumn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardTableId` | `number` | Yes | — | | `source_id` | `number` | Yes | — | | `target_id` | `number` | Yes | — | | `position` | `number` | No | — | **Output:** `undefined` *** ### postBucketsCardTablesCardsMoves `cardTables.postBucketsCardTablesCardsMoves` Tool to move a card to a different column within a Basecamp card table. Use when you need to relocate a card from one column to another in a project. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.postBucketsCardTablesCardsMoves({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `number` | Yes | — | | `column_id` | `number` | Yes | — | | `position` | `number` | No | — | **Output:** `undefined` *** ### postBucketsCardTablesCardsPositions `cardTables.postBucketsCardTablesCardsPositions` Tool to reposition a step within a card in a Basecamp card table. Use when you need to change the order of steps/subtasks within a card by moving a step to a specific position. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.postBucketsCardTablesCardsPositions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `number` | Yes | — | | `source_id` | `number` | Yes | — | | `position` | `number` | No | — | **Output:** `undefined` *** ### postBucketsCardTablesColumns `cardTables.postBucketsCardTablesColumns` Tool to create a column within a Basecamp card table. Use when you need to add a new column to organize cards in a card table project. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.postBucketsCardTablesColumns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardTableId` | `number` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `color` | `string` | No | — | | `description` | `string` | No | — | | `cards_count` | `number` | No | — | | `comments_count` | `number` | No | — | | `cards_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subscribers` | `object[]` | No | — | | `on_hold` | `object` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **on\_hold full type** > > ```ts theme={null} > { > id: number, > status: string, > inherits_status: boolean, > title?: string | null, > created_at: string, > updated_at: string, > cards_count: number, > cards_url: string > } > ``` *** ### postBucketsCardTablesColumnsOnHold `cardTables.postBucketsCardTablesColumnsOnHold` Tool to create an on-hold section in a card table column. Use when you need to add an on-hold area to organize cards that are temporarily paused or waiting. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.postBucketsCardTablesColumnsOnHold({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `columnId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `color` | `string` | No | — | | `description` | `string` | No | — | | `cards_count` | `number` | No | — | | `comments_count` | `number` | No | — | | `cards_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subscribers` | `object[]` | No | — | | `on_hold` | `object` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **on\_hold full type** > > ```ts theme={null} > { > id: number, > status: string, > inherits_status: boolean, > title?: string | null, > created_at: string, > updated_at: string, > cards_count: number, > cards_url: string > } > ``` *** ### postBucketsCardTablesMoves `cardTables.postBucketsCardTablesMoves` Tool to reposition a column within a Basecamp card table. Use when you need to change the order of columns in a card table. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.postBucketsCardTablesMoves({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardTableId` | `number` | Yes | — | | `source_id` | `number` | Yes | — | | `target_id` | `number` | Yes | — | | `position` | `number` | No | — | **Output:** `undefined` *** ### putBucketsCardTablesCards `cardTables.putBucketsCardTablesCards` Tool to update an existing card in a Basecamp card table. Use when you need to modify a card's title, content, due date, or assignees. Omitted parameters remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.putBucketsCardTablesCards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `number` | Yes | — | | `title` | `string` | No | — | | `content` | `string` | No | — | | `due_on` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `position` | `number` | No | — | | `content` | `string` | No | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `due_on` | `string` | No | — | | `completed` | `boolean` | No | — | | `completed_at` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `completion_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `completer` | `object` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `steps` | `object[]` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **completer full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ### putBucketsCardTablesColumns `cardTables.putBucketsCardTablesColumns` Tool to update a card table column in a Basecamp project. Use when you need to modify a column's title or description. Omitted parameters remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.putBucketsCardTablesColumns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `columnId` | `number` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `color` | `string` | No | — | | `description` | `string` | No | — | | `cards_count` | `number` | No | — | | `comments_count` | `number` | No | — | | `cards_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subscribers` | `object[]` | No | — | | `on_hold` | `object` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **on\_hold full type** > > ```ts theme={null} > { > id: number, > status: string, > inherits_status: boolean, > title?: string | null, > created_at: string, > updated_at: string, > cards_count: number, > cards_url: string > } > ``` *** ### putBucketsCardTablesColumnsColor `cardTables.putBucketsCardTablesColumnsColor` Tool to update a card table column's visual color designation in a Basecamp project. Use when you need to change the color of a specific column for better visual organization. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.putBucketsCardTablesColumnsColor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `columnId` | `number` | Yes | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `color` | `string` | No | — | | `description` | `string` | No | — | | `cards_count` | `number` | No | — | | `comments_count` | `number` | No | — | | `cards_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subscribers` | `object[]` | No | — | | `on_hold` | `object` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **on\_hold full type** > > ```ts theme={null} > { > id: number, > status: string, > inherits_status: boolean, > title?: string | null, > created_at: string, > updated_at: string, > cards_count: number, > cards_url: string > } > ``` *** ### putBucketsCardTablesSteps `cardTables.putBucketsCardTablesSteps` Tool to update an existing card table step in Basecamp. Use when you need to modify a step's title, due date, or assignees. Omitted parameters remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.putBucketsCardTablesSteps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `stepId` | `number` | Yes | — | | `title` | `string` | No | — | | `due_on` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `due_on` | `string` | No | — | | `completed` | `boolean` | No | — | | `completed_at` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `completer` | `object` | No | — | | `assignees` | `object[]` | No | — | | `completion_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **completer full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### putBucketsCardTablesStepsCompletions `cardTables.putBucketsCardTablesStepsCompletions` Tool to mark a card table step as completed or uncompleted in Basecamp. Use when you need to toggle the completion status of a step by setting completion to "on" or "off". **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.putBucketsCardTablesStepsCompletions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `stepId` | `number` | Yes | — | | `completion` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `due_on` | `string` | No | — | | `completed` | `boolean` | No | — | | `completed_at` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `completer` | `object` | No | — | | `assignees` | `object[]` | No | — | | `completion_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **completer full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### repositionCardStep `cardTables.repositionCardStep` Tool to change the position of a step within a card. Use when you need to reorder steps in a card table card by moving a step to a specific position. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.repositionCardStep({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `number` | Yes | — | | `source_id` | `number` | Yes | — | | `position` | `number` | No | — | **Output:** `undefined` *** ### unwatchCardTableColumn `cardTables.unwatchCardTableColumn` Tool to stop watching a card table column. Use when you want to unsubscribe from a specific column and no longer receive notifications about changes to it. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.unwatchCardTableColumn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `columnId` | `number` | Yes | — | **Output:** `undefined` *** ### updateCard `cardTables.updateCard` Tool to update a card's details in a Basecamp card table. Use when you need to modify a card's title, content, due date, or assignees. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.updateCard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `number` | Yes | — | | `title` | `string` | No | — | | `content` | `string` | No | — | | `due_on` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `position` | `number` | No | — | | `content` | `string` | No | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `due_on` | `string` | No | — | | `completed` | `boolean` | No | — | | `completed_at` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `completion_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `completer` | `object` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `steps` | `object[]` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **completer full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ### updateCardTableColumn `cardTables.updateCardTableColumn` Tool to update a card table column's properties in a Basecamp project. Use when you need to modify a column's title or description. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.updateCardTableColumn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `columnId` | `number` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `color` | `string` | No | — | | `description` | `string` | No | — | | `cards_count` | `number` | No | — | | `comments_count` | `number` | No | — | | `cards_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subscribers` | `object[]` | No | — | | `on_hold` | `object` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **on\_hold full type** > > ```ts theme={null} > { > id: number, > status: string, > inherits_status: boolean, > title?: string | null, > created_at: string, > updated_at: string, > cards_count: number, > cards_url: string > } > ``` *** ### watchCardTableColumn `cardTables.watchCardTableColumn` Tool to start watching a card table column in a Basecamp project. Use when you need to subscribe to a specific column to receive notifications about changes. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.cardTables.watchCardTableColumn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `columnId` | `number` | Yes | — | **Output:** `undefined` *** ## Documents And Files ### createDocument `documentsAndFiles.createDocument` Tool to create a new document in a Basecamp vault. Use when you need to publish a document in a specific project vault with title, HTML content, and optional publication status. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.createDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `title` | `string` | No | — | | `content` | `string` | No | — | | `status` | `string` | No | — | | `subscriptions` | `number[]` | No | — | | `visible_to_clients` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### createUpload `documentsAndFiles.createUpload` Tool to create a new upload (file) in a Basecamp vault. Use when you need to create an upload entry for a previously uploaded attachment in a specific project vault. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.createUpload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `attachable_sgid` | `string` | Yes | — | | `description` | `string` | No | — | | `base_name` | `string` | No | — | | `subscriptions` | `number[]` | No | — | | `visible_to_clients` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `content_type` | `string` | No | — | | `byte_size` | `number` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `download_url` | `string` | No | — | | `filename` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### createVault `documentsAndFiles.createVault` Tool to create a new vault (folder) within an existing parent vault in a Basecamp project. Use when you need to organize documents and files hierarchically by creating nested vaults. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.createVault({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `title` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `documents_count` | `number` | No | — | | `documents_url` | `string` | No | — | | `uploads_count` | `number` | No | — | | `uploads_url` | `string` | No | — | | `vaults_count` | `number` | No | — | | `vaults_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### getBucketsUploads `documentsAndFiles.getBucketsUploads` Tool to retrieve a specific upload by ID from a Basecamp project vault. Use when you need to fetch details about an uploaded file including its metadata, download URL, and dimensions. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.getBucketsUploads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uploadId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `content_type` | `string` | No | — | | `byte_size` | `number` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `download_url` | `string` | No | — | | `filename` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### getBucketsVaults `documentsAndFiles.getBucketsVaults` Tool to retrieve a specific vault from a Basecamp project. Use when you need details about a vault including its documents, uploads, and nested vaults. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.getBucketsVaults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `documents_count` | `number` | No | — | | `documents_url` | `string` | No | — | | `uploads_count` | `number` | No | — | | `uploads_url` | `string` | No | — | | `vaults_count` | `number` | No | — | | `vaults_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### getBucketsVaultsDocuments `documentsAndFiles.getBucketsVaultsDocuments` Tool to retrieve a paginated list of active documents from a vault in a Basecamp project. Use when you need to fetch all documents stored in a specific vault. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.getBucketsVaultsDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > comments_count?: number, > comments_url?: string, > position?: number | null, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > content?: string | null, > content_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getBucketsVaultsUploads `documentsAndFiles.getBucketsVaultsUploads` Tool to retrieve a paginated list of active uploads from a vault in a Basecamp project. Use when you need to fetch all uploaded files stored in a specific vault. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.getBucketsVaultsUploads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > comments_count?: number, > comments_url?: string, > position?: number | null, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > description?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > content_type?: string, > byte_size?: number, > width?: number, > height?: number, > download_url?: string, > filename?: string, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getBucketsVaultsVaults `documentsAndFiles.getBucketsVaultsVaults` Tool to retrieve a paginated list of vaults nested within a parent vault in a Basecamp project. Use when you need to fetch child vaults from a specific vault. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.getBucketsVaultsVaults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > parent?: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > documents_count?: number, > documents_url?: string, > uploads_count?: number, > uploads_url?: string, > vaults_count?: number, > vaults_url?: string > }[] > ``` *** ### getDocument `documentsAndFiles.getDocument` Tool to get a specific document by ID from a Basecamp project bucket. Use when you need to retrieve complete document details including title, content, creator, metadata, and comments count. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.getDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### getUpload `documentsAndFiles.getUpload` Tool to get a specific upload by ID from a Basecamp project. Use when you need to retrieve details about an uploaded file including metadata, download URL, and dimensions. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.getUpload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uploadId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `content_type` | `string` | No | — | | `byte_size` | `number` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `download_url` | `string` | No | — | | `filename` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### getVault `documentsAndFiles.getVault` Tool to retrieve a specific vault by ID from a Basecamp project. Use when you need details about a vault including its documents, uploads, and nested vaults. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.getVault({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `documents_count` | `number` | No | — | | `documents_url` | `string` | No | — | | `uploads_count` | `number` | No | — | | `uploads_url` | `string` | No | — | | `vaults_count` | `number` | No | — | | `vaults_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### listUploads `documentsAndFiles.listUploads` Tool to retrieve all active uploads from a vault in a Basecamp project. Use when you need to list all uploaded files stored in a specific vault. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.listUploads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > comments_count?: number, > comments_url?: string, > position?: number | null, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > description?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > content_type?: string, > byte_size?: number, > width?: number, > height?: number, > download_url?: string, > filename?: string, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### listVaults `documentsAndFiles.listVaults` Tool to retrieve all vaults (folders) nested within a parent vault in a Basecamp project. Use when you need to list child vaults from a specific vault. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.listVaults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > parent?: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > documents_count?: number, > documents_url?: string, > uploads_count?: number, > uploads_url?: string, > vaults_count?: number, > vaults_url?: string > }[] > ``` *** ### postAttachments `documentsAndFiles.postAttachments` Tool to upload a file to Basecamp system. Use when you need to upload a file to get an attachable\_sgid reference for use in other operations like creating messages or todos with attachments. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.postAttachments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `contentBase64` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `attachable_sgid` | `string` | No | — | *** ### putBucketsDocuments `documentsAndFiles.putBucketsDocuments` Tool to update an existing document in a Basecamp project bucket. Use when you need to modify a document's title, content, or both. Omitted parameters remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.putBucketsDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `number` | Yes | — | | `title` | `string` | No | — | | `content` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### putBucketsUploads `documentsAndFiles.putBucketsUploads` Tool to update an existing upload in a Basecamp project bucket. Use when you need to modify an upload's description or filename. Omitted parameters remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.putBucketsUploads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uploadId` | `number` | Yes | — | | `description` | `string` | No | — | | `base_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `content_type` | `string` | No | — | | `byte_size` | `number` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `download_url` | `string` | No | — | | `filename` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### putBucketsVaults `documentsAndFiles.putBucketsVaults` Tool to update a vault's title in a Basecamp project. Use when you need to rename a vault within a specific project bucket. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.putBucketsVaults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `title` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `documents_count` | `number` | No | — | | `documents_url` | `string` | No | — | | `uploads_count` | `number` | No | — | | `uploads_url` | `string` | No | — | | `vaults_count` | `number` | No | — | | `vaults_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### updateDocument `documentsAndFiles.updateDocument` Tool to update an existing document's title or content in a Basecamp project. Use when you need to modify document title, content, or both. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.updateDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `number` | Yes | — | | `title` | `string` | No | — | | `content` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### updateUpload `documentsAndFiles.updateUpload` Tool to update an upload's description or filename in a Basecamp bucket. Use when you need to modify upload metadata without re-uploading the file. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.updateUpload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uploadId` | `number` | Yes | — | | `description` | `string` | No | — | | `base_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `content_type` | `string` | No | — | | `byte_size` | `number` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `download_url` | `string` | No | — | | `filename` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### updateVault `documentsAndFiles.updateVault` Tool to update a vault's title in a Basecamp project. Use when you need to rename a vault within a specific project bucket. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.documentsAndFiles.updateVault({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `number` | Yes | — | | `title` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `documents_count` | `number` | No | — | | `documents_url` | `string` | No | — | | `uploads_count` | `number` | No | — | | `uploads_url` | `string` | No | — | | `vaults_count` | `number` | No | — | | `vaults_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ## Inboxes And Forwards ### getBucketsInboxesForwards `inboxesAndForwards.getBucketsInboxesForwards` Tool to retrieve a paginated list of active email forwards from a project's inbox. Use when you need to fetch forwarded emails in a Basecamp inbox. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.inboxesAndForwards.getBucketsInboxesForwards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inboxId` | `number` | Yes | — | | `sort` | `string` | No | — | | `direction` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > content?: string | null, > content_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > subject: string, > from?: string | null, > replies_count?: number, > replies_url?: string > }[] > ``` *** ### getInbox `inboxesAndForwards.getInbox` Tool to get the inbox (email forwards) for a Basecamp project. Use when you need to retrieve details about a specific inbox including its forwards count and metadata. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.inboxesAndForwards.getInbox({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inboxId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `forwards_count` | `number` | No | — | | `forwards_url` | `string` | No | — | > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### listForwards `inboxesAndForwards.listForwards` Tool to get all email forwards in an inbox. Use when you need to retrieve forwarded emails from a Basecamp project inbox. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.inboxesAndForwards.listForwards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inboxId` | `number` | Yes | — | | `sort` | `string` | No | — | | `direction` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > content?: string | null, > content_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > subject: string, > from?: string | null, > replies_count?: number, > replies_url?: string > }[] > ``` *** ## Messages ### deleteMessageType `messages.deleteMessageType` Tool to delete a message type from a Basecamp project. Use when removing a custom message category. Permanently removes the specified message type. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basecamp.api.messages.deleteMessageType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `typeId` | `number` | Yes | — | **Output:** `undefined` *** ### getBucketsCategories `messages.getBucketsCategories` Tool to retrieve all message types (categories) from a Basecamp project. Use when you need to list all available message categories for organizing messages in a project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.messages.getBucketsCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > icon: string, > created_at: string, > updated_at: string > }[] > ``` *** ### getBucketsMessageBoardsMessages `messages.getBucketsMessageBoardsMessages` Tool to retrieve a paginated list of active messages from a message board in a Basecamp project. Use when you need to fetch messages from a specific message board. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.messages.getBucketsMessageBoardsMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardId` | `number` | Yes | — | | `sort` | `string` | No | — | | `direction` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > comments_count?: number, > comments_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > subject: string, > content?: string | null, > content_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > category?: { > id: number, > name: string, > icon: string, > created_at: string, > updated_at: string > }, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getMessage `messages.getMessage` Tool to retrieve a specific message by ID from a Basecamp project message board. Use when you need to fetch details of a single message including its content, author, and metadata. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.messages.getMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subject` | `string` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `category` | `object` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **category full type** > > ```ts theme={null} > { > id: number, > name: string, > icon: string, > created_at: string, > updated_at: string > } > ``` *** ### getMessageBoard `messages.getMessageBoard` Tool to get the message board for a project. Use when you need to retrieve details about a specific message board including its title, creator, message count, and URLs. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.messages.getMessageBoard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `messages_count` | `number` | No | — | | `messages_url` | `string` | No | — | | `app_messages_url` | `string` | No | — | > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### getMessageType `messages.getMessageType` Tool to retrieve a specific message type by ID from a Basecamp project. Use when you need details about a specific message type/category. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.messages.getMessageType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `typeId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `icon` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### listMessageTypes `messages.listMessageTypes` Tool to retrieve all message types in a Basecamp project. Use when you need to list all available message types for organizing messages in a project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.messages.listMessageTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > icon: string, > created_at: string, > updated_at: string > }[] > ``` *** ### pinMessage `messages.pinMessage` Tool to pin a message to the top of the message board. Use when you need to feature a message prominently at the top of a message board in a project. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.messages.pinMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `number` | Yes | — | **Output:** `undefined` *** ### postBucketsCategories `messages.postBucketsCategories` Tool to create a new message type (category) in a Basecamp project. Use when you need to create a custom message category for organizing different types of messages in a project. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.messages.postBucketsCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `name` | `string` | Yes | — | | `icon` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `icon` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### postBucketsMessageBoardsMessages `messages.postBucketsMessageBoardsMessages` Tool to publish a message to a Basecamp message board within a project. Use when you need to create a new message with optional rich HTML content and subscriptions. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.messages.postBucketsMessageBoardsMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardId` | `number` | Yes | — | | `subject` | `string` | Yes | — | | `content` | `string` | No | — | | `status` | `string` | No | — | | `category_id` | `number` | No | — | | `subscriptions` | `number[]` | No | — | | `visible_to_clients` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subject` | `string` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `category` | `object` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **category full type** > > ```ts theme={null} > { > id: number, > name: string, > icon: string, > created_at: string, > updated_at: string > } > ``` *** ### putBucketsCategories `messages.putBucketsCategories` Tool to update an existing message type (category) in a Basecamp project. Use when you need to modify the name or icon of a message category. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.messages.putBucketsCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `typeId` | `number` | Yes | — | | `name` | `string` | No | — | | `icon` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `icon` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### putBucketsMessages `messages.putBucketsMessages` Tool to update a message's subject, content, or category in a Basecamp project. Use when you need to modify an existing message's title, body text, or categorization. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.messages.putBucketsMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `number` | Yes | — | | `subject` | `string` | No | — | | `content` | `string` | No | — | | `status` | `string` | No | — | | `category_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `subject` | `string` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `category` | `object` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **category full type** > > ```ts theme={null} > { > id: number, > name: string, > icon: string, > created_at: string, > updated_at: string > } > ``` *** ### unpinMessage `messages.unpinMessage` Tool to unpin a message from the message board. Use when you need to remove the pinned status from a message that was previously pinned to the top of a message board. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.messages.unpinMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `number` | Yes | — | **Output:** `undefined` *** ### updateMessageType `messages.updateMessageType` Tool to update an existing message type in a Basecamp project. Use when you need to modify the name or icon of a message category. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.messages.updateMessageType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `typeId` | `number` | Yes | — | | `name` | `string` | No | — | | `icon` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `icon` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ## People And Access ### getCirclesPeople `peopleAndAccess.getCirclesPeople` Tool to retrieve all people on this Basecamp account who can be pinged. Use when you need to get a list of all pingable users in the account. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.peopleAndAccess.getCirclesPeople({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### getMyProfile `peopleAndAccess.getMyProfile` Tool to retrieve the current user's personal info including profile details, permissions, and settings. Use when you need to get information about the authenticated user. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.peopleAndAccess.getMyProfile({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `attachable_sgid` | `string` | No | — | | `name` | `string` | Yes | — | | `email_address` | `string` | No | — | | `personable_type` | `string` | No | — | | `title` | `string` | No | — | | `bio` | `string` | No | — | | `tagline` | `string` | No | — | | `location` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `admin` | `boolean` | No | — | | `owner` | `boolean` | No | — | | `client` | `boolean` | No | — | | `employee` | `boolean` | No | — | | `time_zone` | `string` | No | — | | `avatar_url` | `string` | No | — | | `company` | `object` | No | — | | `can_manage_projects` | `boolean` | No | — | | `can_manage_people` | `boolean` | No | — | | `can_ping` | `boolean` | No | — | | `can_access_timesheet` | `boolean` | No | — | | `can_access_hill_charts` | `boolean` | No | — | > **company full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` *** ### getPeople `peopleAndAccess.getPeople` Tool to retrieve all people visible to the current user in the Basecamp account. Use when you need to list users, check permissions, or get contact information for team members. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.peopleAndAccess.getPeople({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### getPeopleByPersonId `peopleAndAccess.getPeopleByPersonId` Tool to retrieve the profile for a specific user by their ID. Use when you need to get detailed information about a specific person in the Basecamp account. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.peopleAndAccess.getPeopleByPersonId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `personId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `attachable_sgid` | `string` | No | — | | `name` | `string` | Yes | — | | `email_address` | `string` | No | — | | `personable_type` | `string` | No | — | | `title` | `string` | No | — | | `bio` | `string` | No | — | | `tagline` | `string` | No | — | | `location` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `admin` | `boolean` | No | — | | `owner` | `boolean` | No | — | | `client` | `boolean` | No | — | | `employee` | `boolean` | No | — | | `time_zone` | `string` | No | — | | `avatar_url` | `string` | No | — | | `company` | `object` | No | — | | `can_manage_projects` | `boolean` | No | — | | `can_manage_people` | `boolean` | No | — | | `can_ping` | `boolean` | No | — | | `can_access_timesheet` | `boolean` | No | — | | `can_access_hill_charts` | `boolean` | No | — | > **company full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` *** ### getPerson `peopleAndAccess.getPerson` Tool to retrieve a specific person's profile by their ID. Use when you need detailed information about a specific person in the Basecamp account. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.peopleAndAccess.getPerson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `personId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `attachable_sgid` | `string` | No | — | | `name` | `string` | Yes | — | | `email_address` | `string` | No | — | | `personable_type` | `string` | No | — | | `title` | `string` | No | — | | `bio` | `string` | No | — | | `tagline` | `string` | No | — | | `location` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `admin` | `boolean` | No | — | | `owner` | `boolean` | No | — | | `client` | `boolean` | No | — | | `employee` | `boolean` | No | — | | `time_zone` | `string` | No | — | | `avatar_url` | `string` | No | — | | `company` | `object` | No | — | | `can_manage_projects` | `boolean` | No | — | | `can_manage_people` | `boolean` | No | — | | `can_ping` | `boolean` | No | — | | `can_access_timesheet` | `boolean` | No | — | | `can_access_hill_charts` | `boolean` | No | — | > **company full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` *** ### getProjectsPeople `peopleAndAccess.getProjectsPeople` Tool to retrieve all active people assigned to a Basecamp project. Use when you need to list all members who have access to a specific project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.peopleAndAccess.getProjectsPeople({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### listProjectPeople `peopleAndAccess.listProjectPeople` Tool to get all people on a specific Basecamp project. Use when you need to retrieve the list of active members who have access to a particular project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.peopleAndAccess.listProjectPeople({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### putProjectsPeopleUsers `peopleAndAccess.putProjectsPeopleUsers` Tool to grant or revoke project access for users in Basecamp. Use when you need to add existing users to a project, create new users with access, or remove users from a project. At least one of grant, revoke, or create must be provided. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.peopleAndAccess.putProjectsPeopleUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `grant` | `number[]` | No | — | | `revoke` | `number[]` | No | — | | `create` | `object[]` | No | — | > **create full type** > > ```ts theme={null} > { > name: string, > email_address?: string | null, > title?: string | null, > company_name?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `granted` | `object[]` | No | — | | `revoked` | `object[]` | No | — | > **granted full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **revoked full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ## Projects And Templates ### createProjectConstruction `projectsAndTemplates.createProjectConstruction` Tool to create a new project from a Basecamp template asynchronously. Use when you need to instantiate a project based on an existing template. Poll the returned URL to monitor construction progress until status becomes 'completed'. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.createProjectConstruction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `number` | Yes | — | | `project` | `object` | Yes | — | > **project full type** > > ```ts theme={null} > { > name: string, > description?: string | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `url` | `string` | No | — | | `project` | `object` | No | — | > **project full type** > > ```ts theme={null} > { > id: number, > status: string, > created_at: string, > updated_at: string, > name: string, > description?: string | null, > purpose?: string, > start_date?: string, > end_date?: string | null, > clients_enabled?: boolean, > bookmark_url?: string, > url: string, > app_url: string, > dock?: { > id: string | number, > title?: string | null, > name?: string | null, > enabled?: boolean | null, > position?: number | null, > url?: string | null, > app_url?: string | null > }[], > bookmarked?: boolean, > client_company?: { > id: number, > name: string > }, > clientside?: { > url?: string, > app_url?: string > } > } > ``` *** ### getProject `projectsAndTemplates.getProject` Tool to retrieve a specific project by its ID with complete details. Use when you need to get comprehensive information about a particular project including its status, metadata, and dock tools configuration. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.getProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `purpose` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `clients_enabled` | `boolean` | No | — | | `bookmark_url` | `string` | No | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `dock` | `object[]` | No | — | | `bookmarked` | `boolean` | No | — | | `client_company` | `object` | No | — | | `clientside` | `object` | No | — | > **dock full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > name: string, > enabled: boolean, > position?: number | null, > url: string, > app_url: string > }[] > ``` > **client\_company full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` > **clientside full type** > > ```ts theme={null} > { > url?: string, > app_url?: string > } > ``` *** ### getProjects `projectsAndTemplates.getProjects` Tool to retrieve a paginated list of projects visible to the current user, sorted by most recently created first. Use when you need to list all projects, filter by status (active/archived/trashed), or access project details. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.getProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > created_at: string, > updated_at: string, > name: string, > description?: string | null, > purpose?: string, > start_date?: string, > end_date?: string | null, > clients_enabled?: boolean, > bookmark_url?: string, > url: string, > app_url: string, > dock?: { > id: string | number, > title?: string | null, > name?: string | null, > enabled?: boolean | null, > position?: number | null, > url?: string | null, > app_url?: string | null > }[], > bookmarked?: boolean, > client_company?: { > id: number, > name: string > }, > clientside?: { > url?: string, > app_url?: string > } > }[] > ``` *** ### getProjectsByProjectId `projectsAndTemplates.getProjectsByProjectId` Tool to retrieve a single project by its ID with full details including dock tools. Use when you need to get information about a specific project that the user has access to. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.getProjectsByProjectId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `purpose` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `clients_enabled` | `boolean` | No | — | | `bookmark_url` | `string` | No | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `dock` | `object[]` | No | — | | `bookmarked` | `boolean` | No | — | | `client_company` | `object` | No | — | | `clientside` | `object` | No | — | > **dock full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > name: string, > enabled: boolean, > position?: number | null, > url: string, > app_url: string > }[] > ``` > **client\_company full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` > **clientside full type** > > ```ts theme={null} > { > url?: string, > app_url?: string > } > ``` *** ### getTemplates `projectsAndTemplates.getTemplates` Tool to retrieve a paginated list of active templates visible to the current user, sorted by most recently created first. Use when you need to list templates or filter by status (active/archived/trashed). **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.getTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status?: string, > created_at: string, > updated_at: string, > name: string, > description?: string | null, > url?: string, > app_url?: string, > dock?: { > id: string | number, > title?: string | null, > name?: string | null, > enabled?: boolean | null, > position?: number | null, > url?: string | null, > app_url?: string | null > }[] > }[] > ``` *** ### getTemplatesByTemplateId `projectsAndTemplates.getTemplatesByTemplateId` Tool to retrieve a single template by its ID with full details including dock tools. Use when you need to get information about a specific template that the user has access to. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.getTemplatesByTemplateId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `app_url` | `string` | No | — | | `dock` | `object[]` | No | — | > **dock full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > name: string, > enabled: boolean, > position?: number | null, > url: string, > app_url: string > }[] > ``` *** ### getTemplatesProjectConstructions `projectsAndTemplates.getTemplatesProjectConstructions` Tool to retrieve the status of a project construction from a template. Use when you need to monitor the progress of a project being created from a template. Can be polled at intervals (no more than once per second) to track construction status. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.getTemplatesProjectConstructions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `number` | Yes | — | | `constructionId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `url` | `string` | No | — | | `project` | `object` | No | — | > **project full type** > > ```ts theme={null} > { > id: number, > status: string, > created_at: string, > updated_at: string, > name: string, > description?: string | null, > purpose?: string, > start_date?: string, > end_date?: string | null, > clients_enabled?: boolean, > bookmark_url?: string, > url: string, > app_url: string, > dock?: { > id: string | number, > title?: string | null, > name?: string | null, > enabled?: boolean | null, > position?: number | null, > url?: string | null, > app_url?: string | null > }[], > bookmarked?: boolean, > client_company?: { > id: number, > name: string > }, > clientside?: { > url?: string, > app_url?: string > } > } > ``` *** ### postLineupMarkers `projectsAndTemplates.postLineupMarkers` Tool to create an account-wide marker that shows up in the Lineup. Use when you need to add a visual marker to highlight important dates or milestones across all projects. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.postLineupMarkers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `date` | `string` | Yes | — | **Output:** `undefined` *** ### postProjects `projectsAndTemplates.postProjects` Tool to create a new project in Basecamp with a name and optional description. Use when you need to set up a new project workspace for team collaboration. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.postProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `purpose` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `clients_enabled` | `boolean` | No | — | | `bookmark_url` | `string` | No | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `dock` | `object[]` | No | — | | `bookmarked` | `boolean` | No | — | | `client_company` | `object` | No | — | | `clientside` | `object` | No | — | > **dock full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > name: string, > enabled: boolean, > position?: number | null, > url: string, > app_url: string > }[] > ``` > **client\_company full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` > **clientside full type** > > ```ts theme={null} > { > url?: string, > app_url?: string > } > ``` *** ### postTemplates `projectsAndTemplates.postTemplates` Tool to create a new template in Basecamp with a name and optional description. Use when you need to set up a reusable project template for standardizing workflows. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.postTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `app_url` | `string` | No | — | | `dock` | `object[]` | No | — | > **dock full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > name: string, > enabled: boolean, > position?: number | null, > url: string, > app_url: string > }[] > ``` *** ### putProjects `projectsAndTemplates.putProjects` Tool to update an existing project's name, description, access policy, or schedule in Basecamp. Use when you need to modify project details or settings. Note: name parameter is required; schedule dates must be provided as pairs (both start\_date and end\_date). **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.putProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `admissions` | `string` | No | — | | `schedule_attributes` | `object` | No | — | > **schedule\_attributes full type** > > ```ts theme={null} > { > start_date?: string, > end_date?: string | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `purpose` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `clients_enabled` | `boolean` | No | — | | `bookmark_url` | `string` | No | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `dock` | `object[]` | No | — | | `bookmarked` | `boolean` | No | — | | `client_company` | `object` | No | — | | `clientside` | `object` | No | — | > **dock full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > name: string, > enabled: boolean, > position?: number | null, > url: string, > app_url: string > }[] > ``` > **client\_company full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` > **clientside full type** > > ```ts theme={null} > { > url?: string, > app_url?: string > } > ``` *** ### putTemplates `projectsAndTemplates.putTemplates` Tool to update a template's name and description in Basecamp. Use when you need to modify template metadata. Omitted parameters remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.putTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `app_url` | `string` | No | — | | `dock` | `object[]` | No | — | > **dock full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > name: string, > enabled: boolean, > position?: number | null, > url: string, > app_url: string > }[] > ``` *** ### trashProject `projectsAndTemplates.trashProject` Tool to mark a Basecamp project as trashed. Use when you need to trash a project. Trashed projects will be permanently deleted after 30 days. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.trashProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output:** `undefined` *** ### trashTemplate `projectsAndTemplates.trashTemplate` Tool to mark a template as trashed in Basecamp. Use when you need to soft-delete a template; it will be permanently removed after 30 days. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basecamp.api.projectsAndTemplates.trashTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `number` | Yes | — | **Output:** `undefined` *** ## Recordings And Subscriptions ### deleteBucketsRecordingsPin `recordingsAndSubscriptions.deleteBucketsRecordingsPin` Tool to unpin a recording (message) in a Basecamp project. Use when you need to remove the pinned status from a message on a message board or project. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.deleteBucketsRecordingsPin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `number` | Yes | — | **Output:** `undefined` *** ### getBucketsRecordingsComments `recordingsAndSubscriptions.getBucketsRecordingsComments` Tool to retrieve a paginated list of active comments on a recording. Use when you need to fetch comments from a specific recording in a Basecamp project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.getBucketsRecordingsComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > content?: string | null, > content_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getBucketsRecordingsEvents `recordingsAndSubscriptions.getBucketsRecordingsEvents` Tool to retrieve a paginated list of events for a recording. Use when you need to fetch change history from a specific recording in a Basecamp project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.getBucketsRecordingsEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > recording_id: number, > action: string, > details?: { > added_person_ids?: any[], > removed_person_ids?: any[], > notified_recipient_ids?: any[] > }, > created_at: string, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getComment `recordingsAndSubscriptions.getComment` Tool to retrieve a specific comment by ID from a Basecamp project. Use when you need to fetch details about a particular comment including its content, creator, and parent resource. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.getComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commentId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### getProjectsRecordings `recordingsAndSubscriptions.getProjectsRecordings` Tool to retrieve a paginated list of records for a given type of recording across projects. Use when you need to list recordings of a specific type (Message, Document, Todo, etc.) with optional filtering by project, status, and sorting. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.getProjectsRecordings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `bucket` | `string` | No | — | | `status` | `string` | No | — | | `sort` | `string` | No | — | | `direction` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > bubble_up_url?: string, > content?: string | null, > content_attachments?: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > description_attachments?: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > comments_count?: number, > comments_url?: string, > subscription_url?: string, > boosts_count?: number, > boosts_url?: string, > subject?: string, > category?: { > id: number, > name: string, > icon?: string > }, > group_on?: string, > from?: string | null, > replies_count?: number, > replies_url?: string, > position?: number | null, > description?: string | null, > service?: { > name?: string, > example_url?: string, > code?: string, > valid_patterns?: any[], > supporting_text?: string > }, > parent?: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > }[] > ``` *** ### getSubscription `recordingsAndSubscriptions.getSubscription` Tool to get subscription information for a recording. Use when you need to check subscription status, view subscriber count, or get detailed information about all subscribers for a specific recording. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.getSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subscribed` | `boolean` | Yes | — | | `count` | `number` | Yes | — | | `url` | `string` | Yes | — | | `subscribers` | `object[]` | No | — | > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### listComments `recordingsAndSubscriptions.listComments` Tool to get all comments on a recording in a Basecamp project. Use when you need to retrieve the list of active comments with their content, creators, and metadata. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.listComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > content?: string | null, > content_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### listEvents `recordingsAndSubscriptions.listEvents` Tool to get all events (history) for a recording. Use when you need to retrieve the complete modification history of a specific recording in a Basecamp project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.listEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > recording_id: number, > action: string, > details?: { > added_person_ids?: any[], > removed_person_ids?: any[], > notified_recipient_ids?: any[] > }, > created_at: string, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### postBucketsRecordingsComments `recordingsAndSubscriptions.postBucketsRecordingsComments` Tool to publish a comment on a recording within a Basecamp project. Use when you need to add a comment with rich text to any recording such as a todolist, message, or document. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.postBucketsRecordingsComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `content` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### postBucketsRecordingsPin `recordingsAndSubscriptions.postBucketsRecordingsPin` Tool to pin a recording (message) in a Basecamp project. Use when you need to feature a message prominently at the top of a message board or project. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.postBucketsRecordingsPin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `number` | Yes | — | **Output:** `undefined` *** ### postBucketsRecordingsSubscription `recordingsAndSubscriptions.postBucketsRecordingsSubscription` Tool to subscribe the current user to a recording for notifications. Use when you need to start watching/subscribing to a specific recording to receive notifications for new comments. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.postBucketsRecordingsSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subscribed` | `boolean` | Yes | — | | `count` | `number` | Yes | — | | `url` | `string` | Yes | — | | `subscribers` | `object[]` | No | — | > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### putBucketsComments `recordingsAndSubscriptions.putBucketsComments` Tool to update comment content in a Basecamp project. Use when you need to modify the content of an existing comment. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.putBucketsComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commentId` | `number` | Yes | — | | `content` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### putBucketsRecordingsClientVisibility `recordingsAndSubscriptions.putBucketsRecordingsClientVisibility` Tool to update client visibility for a recording in Basecamp. Use when you need to show or hide a recording from clients. Returns 403 if the recording inherits visibility from parent resource. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.putBucketsRecordingsClientVisibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `bubble_up_url` | `string` | No | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | No | — | | `description_attachments` | `object[]` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | | `subject` | `string` | No | — | | `category` | `object` | No | — | | `group_on` | `string` | No | — | | `from` | `string` | No | — | | `replies_count` | `number` | No | — | | `replies_url` | `string` | No | — | | `position` | `number` | No | — | | `description` | `string` | No | — | | `service` | `object` | No | — | | `parent` | `object` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **category full type** > > ```ts theme={null} > { > id: number, > name: string, > icon?: string > } > ``` > **service full type** > > ```ts theme={null} > { > name?: string, > example_url?: string, > code?: string, > valid_patterns?: string[], > supporting_text?: string > } > ``` > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### putBucketsRecordingsStatusActive `recordingsAndSubscriptions.putBucketsRecordingsStatusActive` Tool to unarchive a recording in a Basecamp project by marking it as active. Use when you need to restore an archived recording to make it visible again in the project. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.putBucketsRecordingsStatusActive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | **Output:** `undefined` *** ### putBucketsRecordingsStatusArchived `recordingsAndSubscriptions.putBucketsRecordingsStatusArchived` Tool to mark a recording as archived in a Basecamp project. Use when you need to archive a recording to remove it from active view while preserving it for reference. **Risk:** `destructive` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.putBucketsRecordingsStatusArchived({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | **Output:** `undefined` *** ### putBucketsRecordingsStatusTrashed `recordingsAndSubscriptions.putBucketsRecordingsStatusTrashed` Tool to mark a recording as trashed in a Basecamp project. Use when you need to move a recording to trash without permanently deleting it. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.putBucketsRecordingsStatusTrashed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | **Output:** `undefined` *** ### putBucketsRecordingsSubscription `recordingsAndSubscriptions.putBucketsRecordingsSubscription` Tool to update recording subscriptions by adding or removing subscribers. Use when you need to manage who receives notifications for a specific recording. At least one of subscriptions or unsubscriptions must be provided. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.putBucketsRecordingsSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `subscriptions` | `number[]` | No | — | | `unsubscriptions` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subscribed` | `boolean` | Yes | — | | `count` | `number` | Yes | — | | `url` | `string` | Yes | — | | `subscribers` | `object[]` | No | — | > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### subscribeCurrentUser `recordingsAndSubscriptions.subscribeCurrentUser` Tool to subscribe the current authenticated user to a recording for notifications. Use when you need to add the current user to the subscriber list to receive updates about the recording. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.subscribeCurrentUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subscribed` | `boolean` | Yes | — | | `count` | `number` | Yes | — | | `url` | `string` | Yes | — | | `subscribers` | `object[]` | No | — | > **subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### toggleClientVisibility `recordingsAndSubscriptions.toggleClientVisibility` Tool to change client visibility for a recording in Basecamp. Use when you need to show or hide a recording from clients. Returns 403 error if the recording doesn't control its own visibility. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.toggleClientVisibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `bubble_up_url` | `string` | No | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | No | — | | `description_attachments` | `object[]` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | | `subject` | `string` | No | — | | `category` | `object` | No | — | | `group_on` | `string` | No | — | | `from` | `string` | No | — | | `replies_count` | `number` | No | — | | `replies_url` | `string` | No | — | | `position` | `number` | No | — | | `description` | `string` | No | — | | `service` | `object` | No | — | | `parent` | `object` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **category full type** > > ```ts theme={null} > { > id: number, > name: string, > icon?: string > } > ``` > **service full type** > > ```ts theme={null} > { > name?: string, > example_url?: string, > code?: string, > valid_patterns?: string[], > supporting_text?: string > } > ``` > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### unsubscribeCurrentUser `recordingsAndSubscriptions.unsubscribeCurrentUser` Tool to unsubscribe the current user from a recording. Use when you need to stop receiving notifications for a specific recording. This is an idempotent operation that returns success even if the user wasn't previously subscribed. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.recordingsAndSubscriptions.unsubscribeCurrentUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | **Output:** `undefined` *** ## Schedules And Reports ### getBucketsSchedulesEntries `schedulesAndReports.getBucketsSchedulesEntries` Tool to retrieve a paginated list of schedule entries from a schedule. Use when you need to fetch entries from a specific schedule in a Basecamp project. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.schedulesAndReports.getBucketsSchedulesEntries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scheduleId` | `number` | Yes | — | | `status` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > comments_count?: number, > comments_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > summary: string, > description?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > all_day: boolean, > starts_at: string, > ends_at: string, > participants?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }[], > join_url?: string | null, > highlighted?: boolean, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getReportsTimesheet `schedulesAndReports.getReportsTimesheet` Tool to retrieve all timesheet entries across the Basecamp account within a given timeframe. Use when you need to generate time reports, track hours logged, or analyze time entries by person or project. Without date parameters, returns only the last month of entries. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.schedulesAndReports.getReportsTimesheet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | No | — | | `to` | `string` | No | — | | `person_id` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: string | number, > name?: string | null, > type?: string | null > } > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > date?: string, > description?: string | null, > hours?: string, > person?: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > }[] > ``` *** ### getSchedule `schedulesAndReports.getSchedule` Tool to retrieve schedule details for a specific project. Use when you need information about a schedule including entries count and configuration. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.schedulesAndReports.getSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scheduleId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `include_due_assignments` | `boolean` | No | — | | `entries_count` | `number` | No | — | | `entries_url` | `string` | No | — | > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### getScheduleEntry `schedulesAndReports.getScheduleEntry` Tool to get a specific schedule entry by ID from a Basecamp project. Use when you need to retrieve details about a scheduled event including its time, participants, and metadata. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.schedulesAndReports.getScheduleEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entryId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `summary` | `string` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `all_day` | `boolean` | Yes | — | | `starts_at` | `string` | Yes | — | | `ends_at` | `string` | Yes | — | | `participants` | `object[]` | No | — | | `join_url` | `string` | No | — | | `highlighted` | `boolean` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **participants full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### postBucketsSchedulesEntries `schedulesAndReports.postBucketsSchedulesEntries` Tool to create a schedule entry in a Basecamp schedule within a project. Use when you need to add a new event with start/end times and optional participants. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.schedulesAndReports.postBucketsSchedulesEntries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scheduleId` | `number` | Yes | — | | `summary` | `string` | Yes | — | | `starts_at` | `string` | Yes | — | | `ends_at` | `string` | Yes | — | | `description` | `string` | No | — | | `participant_ids` | `number[]` | No | — | | `all_day` | `boolean` | No | — | | `notify` | `boolean` | No | — | | `url` | `string` | No | — | | `highlighted` | `boolean` | No | — | | `status` | `string` | No | — | | `subscriptions` | `number[]` | No | — | | `visible_to_clients` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `summary` | `string` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `all_day` | `boolean` | Yes | — | | `starts_at` | `string` | Yes | — | | `ends_at` | `string` | Yes | — | | `participants` | `object[]` | No | — | | `join_url` | `string` | No | — | | `highlighted` | `boolean` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **participants full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### putBucketsScheduleEntries `schedulesAndReports.putBucketsScheduleEntries` Tool to update an existing schedule entry in a Basecamp schedule. Use when you need to modify an entry's title, times, description, or participants. Omitted parameters remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.schedulesAndReports.putBucketsScheduleEntries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entryId` | `number` | Yes | — | | `summary` | `string` | No | — | | `starts_at` | `string` | Yes | — | | `ends_at` | `string` | Yes | — | | `description` | `string` | No | — | | `participant_ids` | `number[]` | No | — | | `all_day` | `boolean` | No | — | | `notify` | `boolean` | No | — | | `url` | `string` | No | — | | `highlighted` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `summary` | `string` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `all_day` | `boolean` | Yes | — | | `starts_at` | `string` | Yes | — | | `ends_at` | `string` | Yes | — | | `participants` | `object[]` | No | — | | `join_url` | `string` | No | — | | `highlighted` | `boolean` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **participants full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ### putBucketsSchedules `schedulesAndReports.putBucketsSchedules` Tool to update a schedule configuration in a Basecamp project. Use when you need to change whether the schedule includes due assignments from to-dos, cards and steps. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.schedulesAndReports.putBucketsSchedules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scheduleId` | `number` | Yes | — | | `include_due_assignments` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `include_due_assignments` | `boolean` | No | — | | `entries_count` | `number` | No | — | | `entries_url` | `string` | No | — | > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### updateScheduleEntry `schedulesAndReports.updateScheduleEntry` Tool to update an existing schedule entry in a Basecamp project schedule. Use when you need to modify details like title, dates, description, or participants. Omitted parameters remain unchanged. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.schedulesAndReports.updateScheduleEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entryId` | `number` | Yes | — | | `summary` | `string` | No | — | | `starts_at` | `string` | Yes | — | | `ends_at` | `string` | Yes | — | | `description` | `string` | No | — | | `participant_ids` | `number[]` | No | — | | `all_day` | `boolean` | No | — | | `notify` | `boolean` | No | — | | `url` | `string` | No | — | | `highlighted` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `summary` | `string` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `all_day` | `boolean` | Yes | — | | `starts_at` | `string` | Yes | — | | `ends_at` | `string` | Yes | — | | `participants` | `object[]` | No | — | | `join_url` | `string` | No | — | | `highlighted` | `boolean` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **participants full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` *** ## Todos ### completeTodo `todos.completeTodo` Tool to mark a to-do as completed in Basecamp. Use when you need to complete a to-do item. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.completeTodo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todoId` | `number` | Yes | — | **Output:** `undefined` *** ### createTodo `todos.createTodo` DEPRECATED: Use BASECAMP\_POST\_BUCKETS\_TODOLISTS\_TODOS instead. Tool to create a new to-do in a Basecamp to-do list. Use when you need to add a task with optional description, assignees, and due date. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.createTodo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todolistId` | `number` | Yes | — | | `content` | `string` | No | — | | `description` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | | `completion_subscriber_ids` | `number[]` | No | — | | `notify` | `boolean` | No | — | | `due_on` | `string` | No | — | | `starts_on` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `completed` | `boolean` | No | — | | `content` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `starts_on` | `string` | No | — | | `due_on` | `string` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `completion_url` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | | `steps` | `object[]` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ### createTodolistGroup `todos.createTodolistGroup` Tool to create a new to-do group within a parent to-do list in Basecamp. Use when organizing todos into groups with optional color coding. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.createTodolistGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todolistId` | `number` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `bubble_up_url` | `string` | Yes | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `completed` | `boolean` | No | — | | `completed_ratio` | `string` | No | — | | `name` | `string` | Yes | — | | `todos_url` | `string` | No | — | | `groups_url` | `string` | No | — | | `group_position_url` | `string` | No | — | | `app_todos_url` | `string` | No | — | | `color` | `string` | No | — | | `comments_app_url` | `string` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### getBucketsTodolists `todos.getBucketsTodolists` Tool to retrieve a specific to-do list from a Basecamp project by its ID. Use when you need to get details about a to-do list including its title, description, completion status, and URLs for todos and groups. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getBucketsTodolists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `bubble_up_url` | `string` | Yes | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `completed` | `boolean` | No | — | | `completed_ratio` | `string` | No | — | | `name` | `string` | Yes | — | | `todos_url` | `string` | No | — | | `groups_url` | `string` | No | — | | `group_position_url` | `string` | No | — | | `app_todos_url` | `string` | No | — | | `color` | `string` | No | — | | `comments_app_url` | `string` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### getBucketsTodolistsGroups `todos.getBucketsTodolistsGroups` Tool to retrieve a paginated list of active groups from a to-do list in a Basecamp project. Use when you need to list all groups within a specific to-do list for organizing tasks. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getBucketsTodolistsGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todolistId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > bubble_up_url: string, > comments_count?: number, > comments_url?: string, > position?: number | null, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > description?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > completed?: boolean, > completed_ratio?: string, > name: string, > todos_url?: string, > groups_url?: string, > group_position_url?: string, > app_todos_url?: string, > color?: string | null, > comments_app_url: string, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getBucketsTodolistsTodos `todos.getBucketsTodolistsTodos` Tool to retrieve a paginated list of to-dos from a specific to-do list in a Basecamp project. Use when you need to fetch to-do items from a to-do list, optionally filtering by status or completion state. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getBucketsTodolistsTodos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todolistId` | `number` | Yes | — | | `status` | `string` | No | — | | `completed` | `boolean` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > comments_count?: number, > comments_url?: string, > position?: number | null, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > description?: string | null, > completed?: boolean, > content?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > starts_on?: string | null, > due_on?: string | null, > assignees?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }[], > completion_subscribers?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }[], > completion_url?: string, > boosts_count?: number, > boosts_url?: string, > steps?: { > id: string | number, > status?: string | null, > visible_to_clients?: boolean | null, > created_at?: string | null, > updated_at?: string | null, > title?: string | null, > inherits_status?: boolean | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bookmark_url?: string | null, > position?: number | null, > due_on?: string | null, > completed?: boolean | null, > completed_at?: any, > parent?: { > } | null, > bucket?: { > } | null, > creator?: { > } | null, > completer?: any, > assignees?: any, > completion_url?: string | null > }[] > }[] > ``` *** ### getBucketsTodos `todos.getBucketsTodos` Tool to retrieve a specific to-do by ID from a Basecamp project. Use when you need to fetch a single to-do item including its content, title, assignees, completion status, and dates. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getBucketsTodos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todoId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `completed` | `boolean` | No | — | | `content` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `starts_on` | `string` | No | — | | `due_on` | `string` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `completion_url` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | | `steps` | `object[]` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ### getBucketsTodosets `todos.getBucketsTodosets` Tool to retrieve a specific to-do set from a Basecamp project. Use when you need to get details about a to-do set, including its completion status, to-do lists count, and associated URLs. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getBucketsTodosets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todosetId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `name` | `string` | Yes | — | | `todolists_count` | `number` | No | — | | `todolists_url` | `string` | No | — | | `completed_ratio` | `string` | No | — | | `completed` | `boolean` | No | — | | `app_todolists_url` | `string` | No | — | | `todos_count` | `number` | No | — | | `completed_loose_todos_count` | `number` | No | — | | `todos_url` | `string` | No | — | | `app_todos_url` | `string` | No | — | > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### getBucketsTodosetsTodolists `todos.getBucketsTodosetsTodolists` Tool to retrieve a paginated list of to-do lists within a specific to-do set in a Basecamp project. Use when you need to fetch all to-do lists from a to-do set, optionally filtering by status. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getBucketsTodosetsTodolists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todosetId` | `number` | Yes | — | | `status` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > bubble_up_url: string, > comments_count?: number, > comments_url?: string, > position?: number | null, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > description?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > completed?: boolean, > completed_ratio?: string, > name: string, > todos_url?: string, > groups_url?: string, > group_position_url?: string, > app_todos_url?: string, > color?: string | null, > comments_app_url: string, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getTodo `todos.getTodo` Tool to retrieve a specific to-do by ID from a Basecamp project. Use when you need to fetch detailed information about a single to-do item including its content, title, assignees, completion status, dates, and parent relationships. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getTodo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todoId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `completed` | `boolean` | No | — | | `content` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `starts_on` | `string` | No | — | | `due_on` | `string` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `completion_url` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | | `steps` | `object[]` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ### getTodolist `todos.getTodolist` Tool to retrieve a specific to-do list from a Basecamp project by its ID. Use when you need to get details about a to-do list including its title, description, completion status, and URLs for todos and groups. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getTodolist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `bubble_up_url` | `string` | Yes | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `completed` | `boolean` | No | — | | `completed_ratio` | `string` | No | — | | `name` | `string` | Yes | — | | `todos_url` | `string` | No | — | | `groups_url` | `string` | No | — | | `group_position_url` | `string` | No | — | | `app_todos_url` | `string` | No | — | | `color` | `string` | No | — | | `comments_app_url` | `string` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### getTodolistGroups `todos.getTodolistGroups` Tool to retrieve a paginated list of groups from a to-do list in a Basecamp project. Use when you need to list groups (sub-sections) within a specific to-do list for organizing tasks. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getTodolistGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todolistId` | `number` | Yes | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > bubble_up_url: string, > comments_count?: number, > comments_url?: string, > position?: number | null, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > description?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > completed?: boolean, > completed_ratio?: string, > name: string, > todos_url?: string, > groups_url?: string, > group_position_url?: string, > app_todos_url?: string, > color?: string | null, > comments_app_url: string, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### getTodoset `todos.getTodoset` Tool to retrieve a specific to-do set from a Basecamp project. Use when you need to get details about a to-do set, including its completion status and to-do lists count. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.getTodoset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todosetId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `position` | `number` | No | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `name` | `string` | Yes | — | | `todolists_count` | `number` | No | — | | `todolists_url` | `string` | No | — | | `completed_ratio` | `string` | No | — | | `completed` | `boolean` | No | — | | `app_todolists_url` | `string` | No | — | | `todos_count` | `number` | No | — | | `completed_loose_todos_count` | `number` | No | — | | `todos_url` | `string` | No | — | | `app_todos_url` | `string` | No | — | > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` *** ### listTodolists `todos.listTodolists` Tool to get all to-do lists in a to-do set within a Basecamp project. Use when you need to retrieve all to-do lists from a specific to-do set, optionally filtering by status (archived or trashed). **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.todos.listTodolists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todosetId` | `number` | Yes | — | | `status` | `string` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > subscription_url?: string, > bubble_up_url: string, > comments_count?: number, > comments_url?: string, > position?: number | null, > parent: { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > }, > bucket: { > id: number, > name: string, > type: string > }, > creator: { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }, > description?: string | null, > description_attachments: { > id: string | number, > sgid?: string | null, > filename?: string | null, > content_type?: string | null, > byte_size?: number | null, > download_url?: string | null, > width?: number | null, > height?: number | null, > previewable?: boolean | null, > preview_url?: string | null, > thumbnail_url?: string | null > }[], > completed?: boolean, > completed_ratio?: string, > name: string, > todos_url?: string, > groups_url?: string, > group_position_url?: string, > app_todos_url?: string, > color?: string | null, > comments_app_url: string, > boosts_count?: number, > boosts_url?: string > }[] > ``` *** ### postBucketsTodolistsComments `todos.postBucketsTodolistsComments` Tool to add a comment to a to-do list in a Basecamp project. Use when you need to comment on a todolist with feedback, updates, or discussions. All subscribers to the to-do list will be notified. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.postBucketsTodolistsComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `content` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### postBucketsTodolistsTodos `todos.postBucketsTodolistsTodos` Tool to create a to-do in a Basecamp to-do list within a project. Use when you need to add a new to-do item with optional description, assignees, and due date. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.postBucketsTodolistsTodos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todolistId` | `number` | Yes | — | | `content` | `string` | No | — | | `description` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | | `completion_subscriber_ids` | `number[]` | No | — | | `notify` | `boolean` | No | — | | `due_on` | `string` | No | — | | `starts_on` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `completed` | `boolean` | No | — | | `content` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `starts_on` | `string` | No | — | | `due_on` | `string` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `completion_url` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | | `steps` | `object[]` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ### postBucketsTodosComments `todos.postBucketsTodosComments` Tool to add a comment to a to-do in a Basecamp project. Use when you need to add feedback, updates, or discussion to a specific to-do item. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.postBucketsTodosComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordingId` | `number` | Yes | — | | `content` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `content` | `string` | No | — | | `content_attachments` | `object[]` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string, > bucket?: { > id: number, > name: string, > type: string > } > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **content\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### postBucketsTodosetsTodolists `todos.postBucketsTodosetsTodolists` Tool to create a new to-do list in a Basecamp to-do set within a project. Use when you need to add a new to-do list with optional HTML description. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.postBucketsTodosetsTodolists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todosetId` | `number` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `visible_to_clients` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `bubble_up_url` | `string` | Yes | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `completed` | `boolean` | No | — | | `completed_ratio` | `string` | No | — | | `name` | `string` | Yes | — | | `todos_url` | `string` | No | — | | `groups_url` | `string` | No | — | | `group_position_url` | `string` | No | — | | `app_todos_url` | `string` | No | — | | `color` | `string` | No | — | | `comments_app_url` | `string` | Yes | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` *** ### putBucketsTodolistsGroupsPosition `todos.putBucketsTodolistsGroupsPosition` Tool to reposition a to-do list group within its parent to-do list in a Basecamp project. Use when you need to change the order of to-do list groups by moving a group to a specific position. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.putBucketsTodolistsGroupsPosition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `number` | Yes | — | | `position` | `number` | No | — | **Output:** `undefined` *** ### putBucketsTodos `todos.putBucketsTodos` Tool to update an existing to-do in a Basecamp project. Use when you need to modify a to-do's content, description, assignees, dates, or notification settings. Note: Pass all existing parameters along with those being updated to prevent clearing values. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.putBucketsTodos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todoId` | `number` | Yes | — | | `content` | `string` | No | — | | `description` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | | `completion_subscriber_ids` | `number[]` | No | — | | `notify` | `boolean` | No | — | | `due_on` | `string` | No | — | | `starts_on` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `completed` | `boolean` | No | — | | `content` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `starts_on` | `string` | No | — | | `due_on` | `string` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `completion_url` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | | `steps` | `object[]` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ### putBucketsTodosPosition `todos.putBucketsTodosPosition` Tool to change the position of a to-do within its list in a Basecamp project. Use when you need to reorder to-dos by moving a specific to-do to a new position. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.putBucketsTodosPosition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todoId` | `number` | Yes | — | | `position` | `number` | No | — | | `parent_id` | `number` | No | — | **Output:** `undefined` *** ### uncompleteTodo `todos.uncompleteTodo` Tool to mark a to-do as uncompleted in Basecamp. Use when you need to reverse the completion status of a completed to-do item. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.uncompleteTodo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todoId` | `number` | Yes | — | **Output:** `undefined` *** ### updateTodo `todos.updateTodo` Tool to update a to-do's content, assignees, or due date in a Basecamp project. Use when you need to modify an existing to-do item. Pass all existing parameters along with those being updated to prevent clearing values. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.todos.updateTodo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `todoId` | `number` | Yes | — | | `content` | `string` | No | — | | `description` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | | `completion_subscriber_ids` | `number[]` | No | — | | `notify` | `boolean` | No | — | | `due_on` | `string` | No | — | | `starts_on` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | Yes | — | | `visible_to_clients` | `boolean` | Yes | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `title` | `string` | No | — | | `inherits_status` | `boolean` | Yes | — | | `type` | `string` | Yes | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `bookmark_url` | `string` | No | — | | `subscription_url` | `string` | No | — | | `comments_count` | `number` | No | — | | `comments_url` | `string` | No | — | | `position` | `number` | No | — | | `parent` | `object` | Yes | — | | `bucket` | `object` | Yes | — | | `creator` | `object` | Yes | — | | `description` | `string` | No | — | | `completed` | `boolean` | No | — | | `content` | `string` | No | — | | `description_attachments` | `object[]` | Yes | — | | `starts_on` | `string` | No | — | | `due_on` | `string` | No | — | | `assignees` | `object[]` | No | — | | `completion_subscribers` | `object[]` | No | — | | `completion_url` | `string` | No | — | | `boosts_count` | `number` | No | — | | `boosts_url` | `string` | No | — | | `steps` | `object[]` | No | — | > **parent full type** > > ```ts theme={null} > { > id: number, > title?: string | null, > type: string, > url: string, > app_url: string > } > ``` > **bucket full type** > > ```ts theme={null} > { > id: number, > name: string, > type: string > } > ``` > **creator full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: number, > name: string > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > } > ``` > **description\_attachments full type** > > ```ts theme={null} > { > id: number, > sgid: string, > filename: string, > content_type: string, > byte_size: number, > download_url: string, > width?: number | null, > height?: number | null, > previewable: boolean, > preview_url: string, > thumbnail_url: string > }[] > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **completion\_subscribers full type** > > ```ts theme={null} > { > id: number, > attachable_sgid?: string, > name: string, > email_address?: string | null, > personable_type?: string, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string, > updated_at?: string, > admin?: boolean, > owner?: boolean, > client?: boolean, > employee?: boolean, > time_zone?: string, > avatar_url?: string, > company?: { > id: string | number, > name?: string | null > }, > can_manage_projects?: boolean, > can_manage_people?: boolean, > can_ping?: boolean, > can_access_timesheet?: boolean, > can_access_hill_charts?: boolean > }[] > ``` > **steps full type** > > ```ts theme={null} > { > id: number, > status: string, > visible_to_clients: boolean, > created_at: string, > updated_at: string, > title?: string | null, > inherits_status: boolean, > type: string, > url: string, > app_url: string, > bookmark_url?: string, > position?: number | null, > due_on?: string | null, > completed?: boolean, > completed_at?: string, > parent: { > id: string | number, > title?: string | null, > type?: string | null, > url?: string | null, > app_url?: string | null, > bucket?: { > } | null > }, > bucket: { > id: string | number, > name?: string | null, > type?: string | null > }, > creator: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > completer?: { > id: string | number, > attachable_sgid?: string | null, > name?: string | null, > email_address?: string | null, > personable_type?: string | null, > title?: string | null, > bio?: string | null, > tagline?: string | null, > location?: string | null, > created_at?: string | null, > updated_at?: string | null, > admin?: boolean | null, > owner?: boolean | null, > client?: boolean | null, > employee?: boolean | null, > time_zone?: string | null, > avatar_url?: string | null, > company?: { > } | null, > can_manage_projects?: boolean | null, > can_manage_people?: boolean | null, > can_ping?: boolean | null, > can_access_timesheet?: boolean | null, > can_access_hill_charts?: boolean | null > }, > assignees?: any[], > completion_url?: string > }[] > ``` *** ## Webhooks ### deleteWebhooks `webhooks.deleteWebhooks` Tool to delete a webhook from a Basecamp project. Use when you need to remove a webhook subscription from a project. Permanently deletes the specified webhook. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basecamp.api.webhooks.deleteWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `number` | Yes | — | **Output:** `undefined` *** ### getBucketsWebhooks `webhooks.getBucketsWebhooks` Tool to retrieve all webhooks configured for a Basecamp project. Use when you need to list all webhook configurations including their payload URLs, event types, and active status. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.webhooks.getBucketsWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > active?: boolean, > created_at: string, > updated_at: string, > payload_url: string, > types?: string[], > url: string, > app_url: string, > recent_deliveries?: { > id?: string | number, > created_at?: string | null, > request?: { > } | null, > response?: { > } | null > }[] > }[] > ``` *** ### getWebhook `webhooks.getWebhook` Tool to retrieve a specific webhook by ID from a Basecamp project. Use when you need details about a webhook including its delivery history. **Risk:** `read` ```ts theme={null} await corsair.basecamp.api.webhooks.getWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `active` | `boolean` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `payload_url` | `string` | Yes | — | | `types` | `string[]` | No | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `recent_deliveries` | `object[]` | No | — | > **recent\_deliveries full type** > > ```ts theme={null} > { > id?: number, > created_at?: string, > request?: { > headers?: { > } | null, > body?: any > }, > response?: { > headers?: { > } | null, > code?: any, > message?: string | null > } > }[] > ``` *** ### postBucketsWebhooks `webhooks.postBucketsWebhooks` Tool to create a new webhook subscription for a Basecamp project. Use when you need to receive event notifications at a specified HTTPS endpoint for project activities. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.webhooks.postBucketsWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketId` | `number` | Yes | — | | `payload_url` | `string` | Yes | — | | `types` | `string[]` | Yes | — | | `active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `active` | `boolean` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `payload_url` | `string` | Yes | — | | `types` | `string[]` | No | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `recent_deliveries` | `object[]` | No | — | > **recent\_deliveries full type** > > ```ts theme={null} > { > id?: number, > created_at?: string, > request?: { > headers?: { > } | null, > body?: any > }, > response?: { > headers?: { > } | null, > code?: any, > message?: string | null > } > }[] > ``` *** ### putBucketsWebhooks `webhooks.putBucketsWebhooks` Tool to update an existing webhook in a Basecamp project. Use when you need to modify the webhook's URL, event types, or active status. **Risk:** `write` ```ts theme={null} await corsair.basecamp.api.webhooks.putBucketsWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `number` | Yes | — | | `payload_url` | `string` | No | — | | `types` | `string[]` | No | — | | `active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `active` | `boolean` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `payload_url` | `string` | Yes | — | | `types` | `string[]` | No | — | | `url` | `string` | Yes | — | | `app_url` | `string` | Yes | — | | `recent_deliveries` | `object[]` | No | — | > **recent\_deliveries full type** > > ```ts theme={null} > { > id?: number, > created_at?: string, > request?: { > headers?: { > } | null, > body?: any > }, > response?: { > headers?: { > } | null, > code?: any, > message?: string | null > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/basecamp/database Basecamp local sync: searchable entities, `.search()` filters, and operators. The Basecamp plugin syncs data locally. Use `corsair.basecamp.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Campfires Path: `basecamp.db.campfires.search` ```ts theme={null} const rows = await corsair.basecamp.db.campfires.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `topic` | `string` | equals, contains, startsWith, endsWith, in | | `visible_to_clients` | `boolean` | equals | | `inherits_status` | `boolean` | equals | | `position` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `app_url` | `string` | equals, contains, startsWith, endsWith, in | | `bookmark_url` | `string` | equals, contains, startsWith, endsWith, in | | `subscription_url` | `string` | equals, contains, startsWith, endsWith, in | | `lines_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Chatbots Path: `basecamp.db.chatbots.search` ```ts theme={null} const rows = await corsair.basecamp.db.chatbots.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `service_name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `app_url` | `string` | equals, contains, startsWith, endsWith, in | | `command_url` | `string` | equals, contains, startsWith, endsWith, in | | `lines_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Message Types Path: `basecamp.db.messageTypes.search` ```ts theme={null} const rows = await corsair.basecamp.db.messageTypes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## People Path: `basecamp.db.people.search` ```ts theme={null} const rows = await corsair.basecamp.db.people.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `attachable_sgid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email_address` | `string` | equals, contains, startsWith, endsWith, in | | `personable_type` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `bio` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `admin` | `boolean` | equals | | `owner` | `boolean` | equals | | `client` | `boolean` | equals | | `employee` | `boolean` | equals | | `time_zone` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `can_ping` | `boolean` | equals | | `can_manage_projects` | `boolean` | equals | | `can_manage_people` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `basecamp.db.projects.search` ```ts theme={null} const rows = await corsair.basecamp.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `purpose` | `string` | equals, contains, startsWith, endsWith, in | | `clients_enabled` | `boolean` | equals | | `timesheet_enabled` | `boolean` | equals | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `last_needle_color` | `string` | equals, contains, startsWith, endsWith, in | | `last_needle_position` | `number` | equals, gt, gte, lt, lte, in | | `previous_needle_position` | `number` | equals, gt, gte, lt, lte, in | | `bookmark_url` | `string` | equals, contains, startsWith, endsWith, in | | `star_url` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `app_url` | `string` | equals, contains, startsWith, endsWith, in | | `all_access` | `boolean` | equals | | `bookmarked` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `basecamp.db.templates.search` ```ts theme={null} const rows = await corsair.basecamp.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `app_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/basecamp/overview Project management and team communication tool for to-dos, messages, and schedules. Use **Basecamp** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 161 typed API operations * 6 synced entities (`campfires`, `chatbots`, `messageTypes`, `people`, `projects`, `templates`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/basecamp ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/basecamp ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/basecamp ``` ```bash bun theme={null} bun add corsair @corsair-dev/basecamp ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { basecamp } from '@corsair-dev/basecamp'; export const corsair = createCorsair({ plugins: [ basecamp(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Basecamp OAuth app. ```ts theme={null} basecamp() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'basecamp', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`automaticCheckIns.getBucketsQuestionAnswers`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.basecamp.api.automaticCheckIns.getBucketsQuestionAnswers({}); ``` **`campfireAndChatbots.createChatbot`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.basecamp.api.campfireAndChatbots.createChatbot({}); ``` See the full list on the [API](/plugins/basecamp/api) page. ## Query synced data Synced entities support `tenant.basecamp.db..search()` and `.list()`: `campfires`, `chatbots`, `messageTypes`, `people`, `projects`, `templates`. See [Database](/plugins/basecamp/database) for filters and operators. ## What's next > **[API reference](/plugins/basecamp/api)** > > Every `basecamp.api.*` operation with input and output types. > **[Database](/plugins/basecamp/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/baselinker/api API reference for BaseLinker: every `baselinker.api.*` operation with input and output types. Every `baselinker.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Connect ### getConnectIntegrationContractors `connect.getConnectIntegrationContractors` Tool to retrieve a list of contractors connected to a selected Base Connect integration. Use when you need to discover available contractors for a specific integration before performing contractor-specific operations. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.connect.getConnectIntegrationContractors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connect_integration_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `contractors` | `object` | No | — | > **contractors full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getConnectIntegrations `connect.getConnectIntegrations` Tool to retrieve a list of all Base Connect integrations on this account. Returns both integrations created on the account and integrations to which the account has connected. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.connect.getConnectIntegrations({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `integrations` | `object` | No | — | > **integrations full type** > > ```ts theme={null} > any[] | { > } > ``` *** ## Couriers ### createPackageManual `couriers.createPackageManual` Tool to register shipping details for orders when shipments are created outside BaseLinker. Use when you need to add tracking numbers and courier information for manually created shipments. Supports marking packages as return shipments. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.couriers.createPackageManual({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `courier_code` | `string` | No | — | | `package_number` | `string` | No | — | | `pickup_date` | `number` | No | — | | `return_shipment` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `package_id` | `number` | No | — | | `package_number` | `string` | No | — | *** ### getCourierAccounts `couriers.getCourierAccounts` Tool to retrieve the list of accounts connected to a given courier. Use when you need to identify available courier accounts before performing shipping operations. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.couriers.getCourierAccounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `courier_code` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `accounts` | `object` | No | — | > **accounts full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getCourierFields `couriers.getCourierFields` Tool to retrieve the form fields required for creating shipments with a specific courier. Use when you need to discover which fields are required or optional for shipment creation. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.couriers.getCourierFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `courier_code` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `multi_packages` | `boolean` | No | — | | `fields` | `object` | No | — | | `package_fields` | `object` | No | — | > **fields full type** > > ```ts theme={null} > any[] | { > } > ``` > **package\_fields full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getCourierPackagesStatusHistory `couriers.getCourierPackagesStatusHistory` Tool to retrieve the history of status changes for courier packages. Use when you need to track the delivery progress of shipments through their complete status timeline. Returns chronological status updates for up to 100 packages per request. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.couriers.getCourierPackagesStatusHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `package_ids` | `object` | Yes | — | > **package\_ids full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `packages_history` | `object` | No | — | > **packages\_history full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getCouriersList `couriers.getCouriersList` Tool to retrieve a list of available couriers from BaseLinker. Use when you need to discover which shipping carriers are configured before creating packages or querying courier-specific fields. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.couriers.getCouriersList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `couriers` | `object` | No | — | > **couriers full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderPackages `couriers.getOrderPackages` Tool to download shipments previously created for a selected order. Use when you need to retrieve tracking numbers, courier information, and delivery status for order packages. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.couriers.getOrderPackages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `packages` | `object` | No | — | > **packages full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getPackageDetails `couriers.getPackageDetails` Tool to get detailed information about a package. If the package contains multiple subpackages, information about all of them is included in the response. Use when you need comprehensive package dimensions, weight, COD, insurance, and shipping cost details. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.couriers.getPackageDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `package_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `package_details` | `object` | No | — | > **package\_details full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getProtocol `couriers.getProtocol` Tool to download a parcel protocol for selected shipments. Use when you need to retrieve shipping protocol documents (PDF or HTML) for packages sent via a courier. The protocol is available only if supported by the chosen courier. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.couriers.getProtocol({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `courier_code` | `string` | Yes | — | | `package_ids` | `object` | No | — | | `package_numbers` | `object` | No | — | | `account_id` | `number` | No | — | > **package\_ids full type** > > ```ts theme={null} > any[] | { > } > ``` > **package\_numbers full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `extension` | `string` | No | — | | `protocol` | `string` | No | — | *** ### getRequestParcelPickupFields `couriers.getRequestParcelPickupFields` Tool to retrieve additional fields for a parcel pickup request from a specific courier. Use when preparing to request a parcel pickup and need to know which additional information the courier requires (e.g., pickup time, contact details, special instructions). **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.couriers.getRequestParcelPickupFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `courier_code` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `fields` | `object` | No | — | > **fields full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### runRequestParcelPickup `couriers.runRequestParcelPickup` Tool to request a parcel pickup for previously created shipments. Use when you need to schedule a courier pickup for packages that have been created. The method sends a pickup request to the courier API if the courier supports it. Use getRequestParcelPickupFields first to check if the courier requires additional fields. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.couriers.runRequestParcelPickup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `courier_code` | `string` | Yes | — | | `package_ids` | `object` | No | — | | `package_numbers` | `object` | No | — | | `account_id` | `number` | Yes | — | | `fields` | `object` | Yes | — | > **package\_ids full type** > > ```ts theme={null} > any[] | { > } > ``` > **package\_numbers full type** > > ```ts theme={null} > any[] | { > } > ``` > **fields full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `pickup_number` | `string` | No | — | *** ## Documents ### addInvoice `documents.addInvoice` Tool to issue an order invoice in BaseLinker. Use when you need to generate an invoice for an existing order using a specific numbering series. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.documents.addInvoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `series_id` | `number` | No | — | | `vat_rate` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `invoice_id` | `number` | No | — | *** ### addInvoiceCorrection `documents.addInvoiceCorrection` Tool to issue an order invoice correction. Use when correcting pricing errors, handling returns, or updating invoice data. Either original\_invoice\_id or return\_order\_id must be provided. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.documents.addInvoiceCorrection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `original_invoice_id` | `number` | Yes | — | | `return_order_id` | `number` | No | — | | `series_id` | `number` | No | — | | `date_sell` | `number` | No | — | | `correcting_reason` | `number` | No | — | | `correcting_items` | `boolean` | No | — | | `correcting_data` | `boolean` | No | — | | `invoice_fullname` | `string` | No | — | | `invoice_company` | `string` | No | — | | `invoice_address` | `string` | No | — | | `invoice_postcode` | `string` | No | — | | `invoice_city` | `string` | No | — | | `invoice_state` | `string` | No | — | | `invoice_country_code` | `string` | No | — | | `invoice_nip` | `string` | No | — | | `items` | `object` | No | — | | `fv_payment` | `string` | No | — | | `fv_person` | `string` | No | — | > **items full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `invoice_id` | `number` | No | — | *** ### getInvoiceFile `documents.getInvoiceFile` Tool to retrieve an invoice file from BaseLinker in base64-encoded format. Use when you need to download an invoice document generated by BaseLinker or from an external accounting system. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.documents.getInvoiceFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | | `get_external` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `invoice` | `string` | No | — | | `invoice_number` | `string` | No | — | *** ### getInvoices `documents.getInvoices` Download invoices from BaseLinker order manager with optional filtering. Use this tool to: - Fetch all invoices from a specific date onwards - Retrieve a single invoice by ID or order ID - Filter invoices by numbering series - Paginate through invoices using id\_from parameter Returns up to 100 invoices per request. Use getSeries to get available series IDs for filtering. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.documents.getInvoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | No | — | | `order_id` | `number` | No | — | | `date_from` | `number` | No | — | | `id_from` | `number` | No | — | | `series_id` | `number` | No | — | | `get_external_invoices` | `boolean` | No | — | | `get_government_data` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `invoices` | `object` | No | — | > **invoices full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getNewReceipts `documents.getNewReceipts` Tool to retrieve receipts waiting to be issued. Use after confirming fiscal printer availability; fetch pending receipts and mark them with setOrderReceipt. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.documents.getNewReceipts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `series_id` | `number` | No | — | | `id_from` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `orders` | `object` | No | — | | `receipt_id` | `number` | No | — | | `series_id` | `number` | No | — | | `receipt_full_nr` | `string` | No | — | | `order_id` | `number` | No | — | | `date_add` | `number` | No | — | | `payment_method` | `string` | No | — | | `nip` | `string` | No | — | | `products` | `object` | No | — | > **orders full type** > > ```ts theme={null} > any[] | { > } > ``` > **products full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getReceipts `documents.getReceipts` Tool to retrieve issued receipts from BaseLinker. Use when you need to fetch historical receipt data. Max 100 receipts returned per request. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.documents.getReceipts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `series_id` | `number` | No | — | | `id_from` | `number` | No | — | | `date_from` | `number` | No | — | | `date_to` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `receipts` | `object` | No | — | > **receipts full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getSeries `documents.getSeries` Tool to download invoice/receipt numbering series. Use when you need to retrieve all series configurations before issuing documents. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.documents.getSeries({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `series` | `object` | No | — | > **series full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### setOrderReceipt `documents.setOrderReceipt` Tool to mark orders with a receipt already issued. Use after printing receipts retrieved from getNewReceipts to confirm receipt issuance. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.documents.setOrderReceipt({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_id` | `number` | Yes | — | | `receipt_nr` | `string` | Yes | — | | `date` | `number` | Yes | — | | `printer_error` | `boolean` | Yes | — | | `printer_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ## External Storages ### addCategory `externalStorages.addCategory` Tool to add a new category to BaseLinker storage (shops, warehouses, or BaseLinker inventory). Use when you need to create a new category in a connected storage's category structure. Requires a storage\_id which can be obtained from GetExternalStoragesList or use 'bl\_1' for BaseLinker inventory. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.externalStorages.addCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `storage_id` | `string` | Yes | — | | `category_id` | `number` | No | — | | `name` | `string` | No | — | | `parent_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `storage_id` | `string` | No | — | | `category_id` | `number` | No | — | *** ### getExternalStorageProductsQuantity `externalStorages.getExternalStorageProductsQuantity` Retrieve stock quantities from an external storage (shop/wholesaler) connected to BaseLinker. Use this tool to check current inventory levels for products in external integrations. Returns product IDs with their quantities, including variant-level stock if applicable. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.externalStorages.getExternalStorageProductsQuantity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `storage_id` | `string` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `storage_id` | `string` | No | — | | `products` | `object` | No | — | > **products full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getExternalStoragesList `externalStorages.getExternalStoragesList` Retrieve a list of external storages (shops, warehouses, wholesalers) connected to BaseLinker that can be referenced via API. Returns storage IDs (e.g., 'shop\_2444', 'warehouse\_1334'), names, and supported API methods for each storage. Use this to discover available integrations before calling storage-specific methods like getExternalStorageProductsList. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.externalStorages.getExternalStoragesList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `storages` | `object` | No | — | > **storages full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getStoragesList `externalStorages.getStoragesList` Tool to download a list of available storages accessible via API. Use when you need to discover storage endpoints and capabilities before performing storage-specific operations. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.externalStorages.getStoragesList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `storages` | `object` | No | — | > **storages full type** > > ```ts theme={null} > any[] | { > } > ``` *** ## Inventory ### addInventory `inventory.addInventory` Tool to add or update a BaseLinker catalog (inventory). Use when you need to create a new catalog or update an existing one with the same identifier. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.addInventory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `languages` | `object` | No | — | | `default_language` | `string` | No | — | | `price_groups` | `object` | No | — | | `default_price_group` | `number` | No | — | | `warehouses` | `object` | No | — | | `default_warehouse` | `string` | No | — | | `reservations` | `boolean` | No | — | > **languages full type** > > ```ts theme={null} > any[] | { > } > ``` > **price\_groups full type** > > ```ts theme={null} > any[] | { > } > ``` > **warehouses full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `inventory_id` | `number` | No | — | *** ### addInventoryCategory `inventory.addInventoryCategory` Tool to add or update a category in the BaseLinker catalog. Use when you need to create a new category or update an existing one. Adding a category with the same identifier again updates the previously saved category. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.addInventoryCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | | `category_id` | `number` | No | — | | `name` | `string` | No | — | | `parent_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `category_id` | `number` | No | — | *** ### addInventoryManufacturer `inventory.addInventoryManufacturer` Tool to add or update a manufacturer in the BaseLinker catalog. Use when you need to create a new manufacturer or update an existing one. Adding a manufacturer with the same identifier again updates the previously saved manufacturer. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.addInventoryManufacturer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `manufacturer_id` | `number` | Yes | — | | `name` | `string` | No | — | | `manufacturer_name` | `string` | No | — | | `manufacturer_photo` | `string` | No | — | | `manufacturer_url` | `string` | No | — | | `manufacturer_street` | `string` | No | — | | `manufacturer_postcode` | `string` | No | — | | `manufacturer_city` | `string` | No | — | | `manufacturer_state` | `string` | No | — | | `manufacturer_country_code` | `string` | No | — | | `manufacturer_email` | `string` | No | — | | `manufacturer_phone` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `manufacturer_id` | `number` | No | — | *** ### addInventoryPayer `inventory.addInventoryPayer` Tool to add a new payer or update an existing one in BaseLinker storage. Use when you need to create a new payer with contact details or update an existing payer's information. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.addInventoryPayer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payer_id` | `number` | No | — | | `name` | `string` | Yes | — | | `address` | `string` | No | — | | `postcode` | `string` | No | — | | `city` | `string` | No | — | | `tax_no` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `payer_id` | `number` | No | — | *** ### addInventoryPriceGroup `inventory.addInventoryPriceGroup` Tool to create or update a price group in BaseLinker storage. Use when you need to define pricing tiers (e.g., wholesale, retail, VIP) that can be later assigned to inventory items via addInventory method. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.addInventoryPriceGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `price_group_id` | `number` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `currency` | `string` | No | — | | `price_group_type` | `string` | No | — | | `source_price_group_id` | `number` | No | — | | `price_multiplier` | `number` | No | — | | `price_addition` | `number` | No | — | | `is_bundle_price_calculated` | `boolean` | No | — | | `bundle_price_multiplier` | `number` | No | — | | `bundle_price_addition` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `price_group_id` | `number` | No | — | *** ### addInventoryProduct `inventory.addInventoryProduct` Add a new product to BaseLinker catalog or update an existing product. Use when creating inventory items or modifying product details like SKU, price, stock, dimensions, and text fields. Provide product\_id to update existing products, omit it to create new ones. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.addInventoryProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | | `product_id` | `number` | No | — | | `parent_id` | `number` | No | — | | `is_bundle` | `boolean` | No | — | | `sku` | `string` | No | — | | `ean` | `string` | No | — | | `ean_additional` | `object` | No | — | | `asin` | `string` | No | — | | `tags` | `object` | No | — | | `tax_rate` | `number` | No | — | | `weight` | `number` | No | — | | `height` | `number` | No | — | | `width` | `number` | No | — | | `length` | `number` | No | — | | `average_cost` | `number` | No | — | | `star` | `number` | No | — | | `manufacturer_id` | `number` | No | — | | `category_id` | `number` | No | — | | `prices` | `object` | No | — | | `stock` | `object` | No | — | | `locations` | `object` | No | — | | `text_fields` | `object` | No | — | | `images` | `object` | No | — | | `videos` | `object` | No | — | | `media_options` | `object` | No | — | | `links` | `object` | No | — | | `bundle_products` | `object` | No | — | | `suppliers` | `object` | No | — | > **ean\_additional full type** > > ```ts theme={null} > any[] | { > } > ``` > **tags full type** > > ```ts theme={null} > any[] | { > } > ``` > **prices full type** > > ```ts theme={null} > any[] | { > } > ``` > **stock full type** > > ```ts theme={null} > any[] | { > } > ``` > **locations full type** > > ```ts theme={null} > any[] | { > } > ``` > **text\_fields full type** > > ```ts theme={null} > any[] | { > } > ``` > **images full type** > > ```ts theme={null} > any[] | { > } > ``` > **videos full type** > > ```ts theme={null} > any[] | { > } > ``` > **media\_options full type** > > ```ts theme={null} > any[] | { > } > ``` > **links full type** > > ```ts theme={null} > any[] | { > } > ``` > **bundle\_products full type** > > ```ts theme={null} > any[] | { > } > ``` > **suppliers full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `product_id` | `number` | No | — | | `warnings` | `object` | No | — | > **warnings full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### addInventorySupplier `inventory.addInventorySupplier` Tool to add a new supplier or update an existing one in BaseLinker storage. Use when you need to manage supplier information for inventory management. If supplier\_id is provided, the existing supplier will be updated; otherwise, a new supplier will be created. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.addInventorySupplier({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `supplier_id` | `number` | No | — | | `name` | `string` | Yes | — | | `take_product_cost_from` | `string` | No | — | | `take_product_code_from` | `string` | No | — | | `address` | `string` | No | — | | `postcode` | `string` | No | — | | `city` | `string` | No | — | | `phone` | `string` | No | — | | `email` | `string` | No | — | | `email_copy_to` | `string` | No | — | | `currency` | `string` | No | — | | `tax_no` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `supplier_id` | `number` | No | — | *** ### addInventoryWarehouse `inventory.addInventoryWarehouse` Tool to add a new warehouse or update an existing warehouse in BaseLinker inventories. Use when you need to create new warehouse locations for inventory management or update warehouse details. Adding a warehouse with the same identifier again will update the previously saved warehouse. The method does not allow editing warehouses created automatically for external stocks. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.addInventoryWarehouse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `warehouse_id` | `number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `stock_edition` | `boolean` | No | — | | `country` | `string` | No | — | | `address` | `string` | No | — | | `postcode` | `string` | No | — | | `city` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `warehouse_id` | `number` | No | — | *** ### deleteInventory `inventory.deleteInventory` Tool to delete a catalog from BaseLinker storage. Use when you need to permanently remove an inventory/catalog. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.inventory.deleteInventory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### deleteInventoryCategory `inventory.deleteInventoryCategory` Tool to remove categories from BaseLinker warehouse. Along with the category, the products contained therein are removed (however, this does not apply to products in subcategories). The subcategories will be changed to the highest level categories. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.inventory.deleteInventoryCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### deleteInventoryManufacturer `inventory.deleteInventoryManufacturer` Tool to remove a manufacturer from the BaseLinker catalog. Use when you need to delete a manufacturer that is no longer needed or was added by mistake. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.inventory.deleteInventoryManufacturer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `manufacturer_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### deleteInventoryPayer `inventory.deleteInventoryPayer` Tool to remove a payer from BaseLinker storage. Use when you need to delete an existing payer entry by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.inventory.deleteInventoryPayer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payer_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### deleteInventoryPriceGroup `inventory.deleteInventoryPriceGroup` Tool to remove a price group from BaseLinker storage. Use when you need to delete an existing price group by its identifier. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.inventory.deleteInventoryPriceGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `price_group_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### deleteInventoryProduct `inventory.deleteInventoryProduct` Tool to remove a product from the BaseLinker catalog. Use when you need to permanently delete an inventory product by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.inventory.deleteInventoryProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### deleteInventoryWarehouse `inventory.deleteInventoryWarehouse` Tool to remove a warehouse from BaseLinker inventories. Use when you need to delete a warehouse that is no longer needed. Note: This method does not allow removal of warehouses created automatically for external stock management (shops, wholesalers, etc.). **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.inventory.deleteInventoryWarehouse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `warehouse_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### getInventories `inventory.getInventories` Tool to retrieve a list of catalogs (inventories) available in the BaseLinker storage. Use when you need to discover available catalogs and their configurations before performing inventory-specific operations. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventories({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `inventories` | `object` | No | — | > **inventories full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryAvailableTextFieldKeys `inventory.getInventoryAvailableTextFieldKeys` Tool to retrieve a list of product text fields that can be overwritten for a specific integration. Use when you need to discover which text fields are available for modification within a given inventory catalog. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryAvailableTextFieldKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `text_field_keys` | `object` | No | — | > **text\_field\_keys full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryCategories `inventory.getInventoryCategories` Tool to retrieve a list of categories for a BaseLinker catalog. Use when you need to fetch category hierarchies for inventory management or product organization. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `categories` | `object` | No | — | > **categories full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryExtraFields `inventory.getInventoryExtraFields` Tool to retrieve extra fields defined for BaseLinker catalog inventory items. Use before fetching or updating inventory products to list available custom fields. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryExtraFields({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `extra_fields` | `object` | No | — | > **extra\_fields full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryIntegrations `inventory.getInventoryIntegrations` Tool to retrieve a list of integrations where text values in the catalog can be overwritten. Use when you need to discover which sales channels support text customization and what languages are available for each integration. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryIntegrations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `integrations` | `object` | No | — | > **integrations full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryManufacturers `inventory.getInventoryManufacturers` Tool to retrieve a list of manufacturers from the BaseLinker catalog. Use when you need to view all manufacturers available in the system before adding or modifying manufacturer information. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryManufacturers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `manufacturers` | `object` | No | — | > **manufacturers full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryPayers `inventory.getInventoryPayers` Tool to retrieve a list of payers available in BaseLinker storage. Use when you need to list payers, optionally filtered by ID or name. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryPayers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter_id` | `number` | No | — | | `filter_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `payers` | `object` | No | — | > **payers full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryPriceGroups `inventory.getInventoryPriceGroups` Tool to retrieve price groups existing in BaseLinker storage. Use when you need to discover available pricing tiers before assigning them to inventory items or performing price-related operations. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryPriceGroups({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `price_groups` | `object` | No | — | > **price\_groups full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryPrintoutTemplates `inventory.getInventoryPrintoutTemplates` Tool to retrieve a list of all configured printout templates available for inventory (products). Use when you need to discover available printout templates before generating product documents. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryPrintoutTemplates({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `printouts` | `object` | No | — | > **printouts full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryProductLogs `inventory.getInventoryProductLogs` Tool to retrieve a list of events related to product changes in the BaseLinker catalog. Use when tracking product modification history, auditing changes, or monitoring inventory updates. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryProductLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `number` | Yes | — | | `date_from` | `number` | No | — | | `date_to` | `number` | No | — | | `log_type` | `number` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `logs` | `object` | No | — | > **logs full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryProductsData `inventory.getInventoryProductsData` Tool to retrieve detailed data for selected products from the BaseLinker inventory. Use when you need comprehensive product information including SKU, prices, stock, dimensions, descriptions, images, variants, and bundle details. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryProductsData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | | `products` | `object` | No | — | | `include_erp_units` | `boolean` | No | — | | `include_wms_units` | `boolean` | No | — | | `include_additional_eans` | `boolean` | No | — | | `include_suppliers` | `boolean` | No | — | | `include_relations` | `boolean` | No | — | | `include_marketplace_categories` | `boolean` | No | — | | `include_channels_media` | `boolean` | No | — | > **products full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `products` | `object` | No | — | > **products full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryProductsList `inventory.getInventoryProductsList` Tool to retrieve basic data of chosen products from BaseLinker catalogs. Use when you need to list products with optional filtering by ID, category, EAN, SKU, name, price range, or stock levels. Supports pagination for large catalogs (1000 products per page). **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryProductsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | | `filter_id` | `number` | No | — | | `filter_category_id` | `number` | No | — | | `filter_ean` | `string` | No | — | | `filter_sku` | `string` | No | — | | `filter_name` | `string` | No | — | | `filter_price_from` | `number` | No | — | | `filter_price_to` | `number` | No | — | | `filter_stock_from` | `number` | No | — | | `filter_stock_to` | `number` | No | — | | `page` | `number` | No | — | | `filter_sort` | `string` | No | — | | `filter_locations` | `string` | No | — | | `include_variants` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `products` | `object` | No | — | > **products full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryProductsPrices `inventory.getInventoryProductsPrices` Retrieve gross prices of products from BaseLinker inventories. Use when you need to get pricing information for products and their variants across different price groups. Supports pagination for large product catalogs. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryProductsPrices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `products` | `object` | No | — | > **products full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryProductsStock `inventory.getInventoryProductsStock` Tool to retrieve stock data of products from BaseLinker catalogs. Use when you need to check current inventory levels, reservations, or variant stock across warehouses. Results are paginated at 1000 products per page. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryProductsStock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | | `filter_id` | `number` | No | — | | `filter_category_id` | `number` | No | — | | `filter_ean` | `string` | No | — | | `filter_sku` | `string` | No | — | | `filter_name` | `string` | No | — | | `filter_asin` | `string` | No | — | | `filter_stock_from` | `number` | No | — | | `filter_stock_to` | `number` | No | — | | `page` | `number` | No | — | | `filter_sort` | `string` | No | — | | `filter_locations` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `products` | `object` | No | — | > **products full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventorySuppliers `inventory.getInventorySuppliers` Tool to retrieve a list of suppliers available in BaseLinker storage. Use when you need to list suppliers, optionally filtered by ID or name. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventorySuppliers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter_id` | `number` | No | — | | `filter_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `suppliers` | `object` | No | — | > **suppliers full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryTags `inventory.getInventoryTags` Tool to retrieve a list of tags for a BaseLinker catalog. Use when you need to view all tags available in the system before categorizing or filtering inventory items. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryTags({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryWarehouses `inventory.getInventoryWarehouses` Tool to retrieve a list of warehouses available in BaseLinker inventories. Use when you need to discover available warehouse locations before performing inventory or stock operations. Returns warehouses created manually as well as those created automatically for external stocks (shops, wholesalers). **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventory.getInventoryWarehouses({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `warehouses` | `object` | No | — | > **warehouses full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### runProductMacroTrigger `inventory.runProductMacroTrigger` Tool to execute a personal trigger for products automatic actions. Use when you need to manually run a custom event trigger for a specific product in BaseLinker inventory. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.runProductMacroTrigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `number` | Yes | — | | `trigger_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### updateInventoryProductsStock `inventory.updateInventoryProductsStock` Tool to update stocks of products and their variants in BaseLinker catalog. Use when you need to modify inventory levels for products across warehouses. Maximum 1000 products per request. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventory.updateInventoryProductsStock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_id` | `number` | Yes | — | | `products` | `object` | Yes | — | > **products full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `counter` | `number` | No | — | | `warnings` | `object` | No | — | > **warnings full type** > > ```ts theme={null} > any[] | { > } > ``` *** ## Inventory Documents ### addInventoryDocument `inventoryDocuments.addInventoryDocument` Tool to create a new inventory document in BaseLinker storage. Use when you need to create goods receipts, issues, or transfers. Documents are created as drafts and require confirmation via user action or setInventoryDocumentStatusConfirmed API method. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.inventoryDocuments.addInventoryDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `warehouse_id` | `number` | Yes | — | | `document_type` | `number` | No | — | | `target_warehouse_id` | `number` | No | — | | `date_add` | `number` | No | — | | `date_execute` | `number` | No | — | | `contractor` | `string` | No | — | | `invoice_no` | `string` | No | — | | `notes` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `document_id` | `number` | No | — | | `document_number` | `string` | No | — | *** ### getInventoryDocumentItems `inventoryDocuments.getInventoryDocumentItems` Tool to retrieve items from inventory documents in BaseLinker. Use when you need to fetch product details from a specific document with support for pagination (100 items per page). **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventoryDocuments.getInventoryDocumentItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `document_id` | `number` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `items` | `object` | No | — | > **items full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryDocuments `inventoryDocuments.getInventoryDocuments` Tool to retrieve a list of inventory documents. Use when you need to fetch inventory records with optional filters for ID, type, status, date range, warehouse, or pagination. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventoryDocuments.getInventoryDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter_source_object_type` | `number` | No | — | | `filter_source_object_id` | `number` | No | — | | `filter_document_id` | `number` | No | — | | `filter_document_type` | `number` | No | — | | `filter_document_status` | `number` | No | — | | `filter_date_from` | `number` | No | — | | `filter_date_to` | `number` | No | — | | `filter_warehouse_id` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `documents` | `object` | No | — | > **documents full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryDocumentSeries `inventoryDocuments.getInventoryDocumentSeries` Tool to retrieve available inventory document series. Use when you need to assign a numbering series to a new inventory document. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.inventoryDocuments.getInventoryDocumentSeries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `warehouse_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `document_series` | `object` | No | — | > **document\_series full type** > > ```ts theme={null} > any[] | { > } > ``` *** ## Orders ### addOrder `orders.addOrder` Tool to add a new order to the BaseLinker order manager. Use when you need to create a new order with customer details, products, and delivery information. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.orders.addOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_status_id` | `number` | Yes | — | | `custom_source_id` | `number` | No | — | | `date_add` | `number` | No | — | | `currency` | `string` | No | — | | `payment_method` | `string` | No | — | | `payment_method_cod` | `boolean` | No | — | | `paid` | `boolean` | No | — | | `user_comments` | `string` | No | — | | `admin_comments` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `user_login` | `string` | No | — | | `delivery_method` | `string` | No | — | | `delivery_price` | `number` | No | — | | `delivery_fullname` | `string` | No | — | | `delivery_company` | `string` | No | — | | `delivery_address` | `string` | No | — | | `delivery_postcode` | `string` | No | — | | `delivery_city` | `string` | No | — | | `delivery_state` | `string` | No | — | | `delivery_country_code` | `string` | No | — | | `delivery_point_id` | `string` | No | — | | `delivery_point_name` | `string` | No | — | | `delivery_point_address` | `string` | No | — | | `delivery_point_postcode` | `string` | No | — | | `delivery_point_city` | `string` | No | — | | `invoice_fullname` | `string` | No | — | | `invoice_company` | `string` | No | — | | `invoice_nip` | `string` | No | — | | `invoice_address` | `string` | No | — | | `invoice_postcode` | `string` | No | — | | `invoice_city` | `string` | No | — | | `invoice_state` | `string` | No | — | | `invoice_country_code` | `string` | No | — | | `want_invoice` | `boolean` | No | — | | `extra_field_1` | `string` | No | — | | `extra_field_2` | `string` | No | — | | `custom_extra_fields` | `object` | No | — | | `products` | `object` | No | — | > **custom\_extra\_fields full type** > > ```ts theme={null} > any[] | { > } > ``` > **products full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `order_id` | `number` | No | — | *** ### addOrderBySplit `orders.addOrderBySplit` Tool to create a new order by splitting selected products from an existing order. Use when you need to split an order into multiple shipments or separate deliveries. The new order inherits all customer details, addresses, and settings from the original order, with only the specified products and optional delivery costs moved to it. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.orders.addOrderBySplit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `items_to_split` | `object` | No | — | | `delivery_cost_to_split` | `number` | No | — | > **items\_to\_split full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `new_order_id` | `number` | No | — | *** ### addOrderDuplicate `orders.addOrderDuplicate` Tool to add a new order by duplicating an existing order in BaseLinker. The new order will have the same data as the original order but with a different ID. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.orders.addOrderDuplicate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `order_id` | `number` | No | — | *** ### deleteOrderProduct `orders.deleteOrderProduct` Tool to remove a specific product from an order in BaseLinker. Use when you need to delete an order item without canceling the entire order. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.orders.deleteOrderProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `order_product_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### deleteOrders `orders.deleteOrders` Tool to delete multiple orders from BaseLinker order manager. Use when you need to permanently remove orders from the system. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.orders.deleteOrders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_ids` | `object` | Yes | — | > **order\_ids full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `deleted_order_ids` | `object` | No | — | > **deleted\_order\_ids full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getJournalList `orders.getJournalList` Tool to download order event logs from the last 3 days. Use when you need to track order activities, changes, or events. IMPORTANT: This method must be activated by BaseLinker support on your account. If not activated, it returns an empty response. Events include order creation, status changes, payments, invoices, receipts, product modifications, and package operations. Use last\_log\_id to paginate through results incrementally. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getJournalList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `last_log_id` | `number` | Yes | — | | `logs_types` | `object` | No | — | | `order_id` | `number` | No | — | > **logs\_types full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `logs` | `object` | No | — | > **logs full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderExtraFields `orders.getOrderExtraFields` Tool to retrieve extra fields defined for orders. Use before fetching orders with include\_custom\_extra\_fields to list available custom order fields. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getOrderExtraFields({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `extra_fields` | `object` | No | — | > **extra\_fields full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderPaymentsHistory `orders.getOrderPaymentsHistory` Tool to retrieve payment history for a selected order, including external payment identifiers from payment gateways. Use when you need to track payment events for an order. One order can have multiple payment history entries due to surcharges, order value changes, or manual payment editing. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getOrderPaymentsHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `show_full_history` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `payments` | `object` | No | — | > **payments full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderPickPackHistory `orders.getOrderPickPackHistory` Tool to retrieve pick and pack history for a selected order. Use when you need to track the fulfillment timeline and events for an order (reservations, picking, packing, photography). Returns chronological list of pick/pack events with timestamps and responsible profiles. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getOrderPickPackHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `action_type` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `history` | `object` | No | — | > **history full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderPrintoutTemplates `orders.getOrderPrintoutTemplates` Tool to retrieve a list of all configured printout templates available for orders. Use when you need to discover available printout templates before generating order documents. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getOrderPrintoutTemplates({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `printouts` | `object` | No | — | > **printouts full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrders `orders.getOrders` Download orders from BaseLinker order manager with optional filtering. Use this tool to: - Fetch all orders from a specific date onwards - Retrieve a single order by ID - Filter orders by status, email, or marketplace source - Paginate through orders using id\_from parameter Returns up to 100 orders per request. For confirmed orders only, omit get\_unconfirmed\_orders. Tip: Use getOrderStatusList to get status IDs for filtering. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getOrders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | No | — | | `date_confirmed_from` | `number` | No | — | | `date_from` | `number` | No | — | | `id_from` | `number` | No | — | | `get_unconfirmed_orders` | `boolean` | No | — | | `status_id` | `number` | No | — | | `filter_email` | `string` | No | — | | `filter_order_source` | `string` | No | — | | `filter_order_source_id` | `number` | No | — | | `filter_shop_order_id` | `number` | No | — | | `filter_external_order_id` | `string` | No | — | | `include_custom_extra_fields` | `boolean` | No | — | | `include_commissions` | `boolean` | No | — | | `include_connect_data` | `boolean` | No | — | | `include_discounts_data` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `orders` | `object` | No | — | > **orders full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrdersByPhone `orders.getOrdersByPhone` Search for orders associated with a specific phone number in BaseLinker. Use when identifying callers in phone recognition systems or finding order history by phone. Returns basic order information including status, recipient names, and timestamps. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getOrdersByPhone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phone` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `orders` | `object` | No | — | > **orders full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderSources `orders.getOrderSources` Tool to retrieve types of order sources along with their IDs from BaseLinker. Use when you need to understand available order sources for filtering orders or mapping order\_source field values from getOrders method. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getOrderSources({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `sources` | `object` | No | — | > **sources full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderStatusList `orders.getOrderStatusList` Tool to retrieve a list of order statuses created in the BaseLinker order manager. Use when you need to map status IDs to human-readable names. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getOrderStatusList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `statuses` | `object` | No | — | > **statuses full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderTransactionData `orders.getOrderTransactionData` Tool to retrieve transaction details for a selected order. Use when you need marketplace transaction IDs, fulfillment data, or detailed tax breakdowns for an order. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getOrderTransactionData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `include_complex_taxes` | `boolean` | No | — | | `include_amazon_data` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `currency` | `string` | No | — | | `fulfillment_shipments` | `object` | No | — | | `fulfillment_center_id` | `string` | No | — | | `ship_date_from` | `number` | No | — | | `ship_date_to` | `number` | No | — | | `delivery_date_from` | `number` | No | — | | `delivery_date_to` | `number` | No | — | | `marketplace_transaction_id` | `string` | No | — | | `account_id` | `number` | No | — | | `transaction_date` | `number` | No | — | | `order_items` | `object` | No | — | > **fulfillment\_shipments full type** > > ```ts theme={null} > any[] | { > } > ``` > **order\_items full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getPickPackCarts `orders.getPickPackCarts` Tool to retrieve a list of all PickPack carts belonging to the authenticated user. Use when you need to discover available carts and their details (ID, name, color) before performing cart-specific operations. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.orders.getPickPackCarts({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `carts` | `object` | No | — | > **carts full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### runOrderMacroTrigger `orders.runOrderMacroTrigger` Tool to run personal trigger for orders automatic actions. Use when you need to execute a specific automation trigger on an order. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.orders.runOrderMacroTrigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `trigger_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### setOrderFields `orders.setOrderFields` Tool to edit selected fields of a specific order in BaseLinker. Use when you need to update order details such as address data, notes, payment method, delivery information, or invoice details. Only provide the fields you want to change; other fields can be omitted. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.orders.setOrderFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `admin_comments` | `string` | No | — | | `user_comments` | `string` | No | — | | `payment_method` | `string` | No | — | | `payment_method_cod` | `boolean` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `user_login` | `string` | No | — | | `delivery_method` | `string` | No | — | | `delivery_price` | `number` | No | — | | `delivery_fullname` | `string` | No | — | | `delivery_company` | `string` | No | — | | `delivery_address` | `string` | No | — | | `delivery_postcode` | `string` | No | — | | `delivery_city` | `string` | No | — | | `delivery_state` | `string` | No | — | | `delivery_country_code` | `string` | No | — | | `delivery_point_id` | `string` | No | — | | `delivery_point_name` | `string` | No | — | | `delivery_point_address` | `string` | No | — | | `delivery_point_postcode` | `string` | No | — | | `delivery_point_city` | `string` | No | — | | `invoice_fullname` | `string` | No | — | | `invoice_company` | `string` | No | — | | `invoice_nip` | `string` | No | — | | `invoice_address` | `string` | No | — | | `invoice_postcode` | `string` | No | — | | `invoice_city` | `string` | No | — | | `invoice_state` | `string` | No | — | | `invoice_country_code` | `string` | No | — | | `want_invoice` | `boolean` | No | — | | `extra_field_1` | `string` | No | — | | `extra_field_2` | `string` | No | — | | `custom_extra_fields` | `object` | No | — | | `pick_state` | `number` | No | — | | `pack_state` | `number` | No | — | | `star` | `number` | No | — | > **custom\_extra\_fields full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### setOrderPayment `orders.setOrderPayment` Tool to add a payment to an order in BaseLinker. Use when recording a payment for an order. The payment amount replaces (not adds to) the current payment value; if it matches the order total, the order is marked as paid. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.orders.setOrderPayment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `payment_done` | `number` | Yes | — | | `payment_date` | `number` | Yes | — | | `payment_comment` | `string` | Yes | — | | `external_payment_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### setOrderProductFields `orders.setOrderProductFields` Tool to edit data of selected items in a specific BaseLinker order. Use when you need to update product fields like prices, quantities, SKU, or other item details. Only provide the fields you want to edit; other fields can be omitted. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.orders.setOrderProductFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `order_product_id` | `number` | Yes | — | | `storage` | `string` | No | — | | `storage_id` | `string` | No | — | | `product_id` | `string` | No | — | | `variant_id` | `string` | No | — | | `auction_id` | `string` | No | — | | `name` | `string` | No | — | | `sku` | `string` | No | — | | `ean` | `string` | No | — | | `location` | `string` | No | — | | `warehouse_id` | `number` | No | — | | `attributes` | `string` | No | — | | `price_brutto` | `number` | No | — | | `tax_rate` | `number` | No | — | | `quantity` | `number` | No | — | | `weight` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### setOrdersMerge `orders.setOrdersMerge` Tool to merge multiple orders into one, based on the selected merge mode. Use when you need to combine orders together with either technical merge or into main order mode. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.orders.setOrdersMerge({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `main_order_id` | `number` | Yes | — | | `order_ids_to_merge` | `object` | Yes | — | | `merge_mode` | `string` | Yes | — | | `sum_delivery_costs` | `boolean` | Yes | — | > **order\_ids\_to\_merge full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `merged_order_id` | `number` | No | — | *** ### setOrderStatus `orders.setOrderStatus` Tool to change the status of an existing order in BaseLinker. Use when you need to update an order's status to a different value. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.orders.setOrderStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `status_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### setOrderStatuses `orders.setOrderStatuses` Tool to batch update order statuses in BaseLinker. Use when you need to set the same status for multiple orders at once. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.orders.setOrderStatuses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_ids` | `object` | Yes | — | | `status_id` | `number` | Yes | — | > **order\_ids full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ## Purchase Orders ### addInventoryPurchaseOrder `purchaseOrders.addInventoryPurchaseOrder` Tool to create a new purchase order in BaseLinker storage. Orders are created as drafts by default. Use when you need to create a new purchase order for inventory management. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.purchaseOrders.addInventoryPurchaseOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `warehouse_id` | `number` | Yes | — | | `supplier_id` | `number` | No | — | | `payer_id` | `number` | No | — | | `currency` | `string` | No | — | | `name` | `string` | No | — | | `notes` | `string` | No | — | | `invoice_no` | `string` | No | — | | `date_delivery_expected` | `number` | No | — | | `additional_costs` | `object` | No | — | | `packages` | `object` | No | — | > **additional\_costs full type** > > ```ts theme={null} > any[] | { > } > ``` > **packages full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `order_id` | `number` | No | — | | `document_number` | `string` | No | — | *** ### addInventoryPurchaseOrderItems `purchaseOrders.addInventoryPurchaseOrderItems` Tool to add items to an existing purchase order in BaseLinker. Use when you need to add products to a purchase order that has already been created. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.purchaseOrders.addInventoryPurchaseOrderItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `items` | `object` | No | — | > **items full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `items` | `object` | No | — | > **items full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryPurchaseOrderItems `purchaseOrders.getInventoryPurchaseOrderItems` Tool to retrieve items from a specific purchase order in BaseLinker. Use when you need to fetch product details from a purchase order with support for pagination (100 items per page). **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.purchaseOrders.getInventoryPurchaseOrderItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `items` | `object` | No | — | > **items full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryPurchaseOrders `purchaseOrders.getInventoryPurchaseOrders` Tool to retrieve a list of purchase orders from BaseLinker storage. Use when you need to fetch purchase orders with optional filters like date range, supplier or pagination. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.purchaseOrders.getInventoryPurchaseOrders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `warehouse_id` | `number` | No | — | | `supplier_id` | `number` | No | — | | `series_id` | `number` | No | — | | `date_from` | `number` | No | — | | `date_to` | `number` | No | — | | `filter_document_number` | `string` | No | — | | `filter_product_id` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `purchase_orders` | `object` | No | — | > **purchase\_orders full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getInventoryPurchaseOrderSeries `purchaseOrders.getInventoryPurchaseOrderSeries` Tool to retrieve a list of purchase order document series. Use when you need to select a numbering series for a new purchase order. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.purchaseOrders.getInventoryPurchaseOrderSeries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `warehouse_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `series` | `object` | No | — | > **series full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### setInventoryPurchaseOrderStatus `purchaseOrders.setInventoryPurchaseOrderStatus` Tool to change the status of a purchase order in BaseLinker inventory. Use when you need to update a purchase order's status (e.g., mark as sent, received, completed, or canceled). **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.purchaseOrders.setInventoryPurchaseOrderStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | Yes | — | | `status` | `number` | Yes | — | | `completed_items` | `object` | No | — | > **completed\_items full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ## Returns ### addOrderReturn `returns.addOrderReturn` Tool to add a new order return to BaseLinker. Use when creating a return for an order. Requires status\_id (get from getOrderReturnStatusList), date\_add (Unix timestamp), currency (3-letter code), and refunded status. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.returns.addOrderReturn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | No | — | | `status_id` | `number` | No | — | | `custom_source_id` | `number` | No | — | | `reference_number` | `string` | No | — | | `date_add` | `number` | No | — | | `currency` | `string` | No | — | | `refunded` | `boolean` | No | — | | `admin_comments` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `user_login` | `string` | No | — | | `delivery_price` | `number` | No | — | | `delivery_fullname` | `string` | No | — | | `delivery_company` | `string` | No | — | | `delivery_address` | `string` | No | — | | `delivery_postcode` | `string` | No | — | | `delivery_city` | `string` | No | — | | `delivery_state` | `string` | No | — | | `delivery_country_code` | `string` | No | — | | `extra_field_1` | `string` | No | — | | `extra_field_2` | `string` | No | — | | `custom_extra_fields` | `object` | No | — | | `products` | `object` | No | — | | `refund_account_number` | `string` | No | — | | `refund_iban` | `string` | No | — | | `refund_swift` | `string` | No | — | > **custom\_extra\_fields full type** > > ```ts theme={null} > any[] | { > } > ``` > **products full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `return_id` | `number` | No | — | *** ### addOrderReturnProduct `returns.addOrderReturnProduct` Tool to add a new product to an existing order return in BaseLinker. Use when a customer is returning items and you need to register the returned products. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.returns.addOrderReturnProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_id` | `number` | No | — | | `order_product_id` | `number` | No | — | | `storage` | `string` | No | — | | `storage_id` | `string` | No | — | | `product_id` | `string` | No | — | | `variant_id` | `string` | No | — | | `auction_id` | `string` | No | — | | `name` | `string` | No | — | | `sku` | `string` | No | — | | `ean` | `string` | No | — | | `location` | `string` | No | — | | `warehouse_id` | `number` | No | — | | `attributes` | `string` | No | — | | `price_brutto` | `number` | No | — | | `tax_rate` | `number` | No | — | | `quantity` | `number` | No | — | | `weight` | `number` | No | — | | `status_id` | `number` | No | — | | `return_reason_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `order_return_product_id` | `number` | No | — | *** ### deleteOrderReturnProduct `returns.deleteOrderReturnProduct` Tool to remove a specific product from an order return in BaseLinker. Use when you need to delete a product item from an existing return request. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.baselinker.api.returns.deleteOrderReturnProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_id` | `number` | Yes | — | | `order_return_product_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### getOrderReturnExtraFields `returns.getOrderReturnExtraFields` Tool to retrieve extra fields defined for order returns. Use before calling getOrderReturns with include\_custom\_extra\_fields to list available custom fields. Field values can be set via setOrderReturnFields. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.returns.getOrderReturnExtraFields({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `extra_fields` | `object` | No | — | > **extra\_fields full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderReturnJournalList `returns.getOrderReturnJournalList` Tool to download return event logs from the last 3 days in BaseLinker. Use when tracking return order history, monitoring return status changes, or auditing return-related activities. Returns events like return creation, status changes, product modifications, and refund creation. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.returns.getOrderReturnJournalList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `last_log_id` | `number` | Yes | — | | `logs_types` | `object` | No | — | | `return_id` | `number` | No | — | > **logs\_types full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `logs` | `object` | No | — | > **logs full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderReturnPaymentsHistory `returns.getOrderReturnPaymentsHistory` Tool to retrieve payment history for a selected order return, including external payment identifiers from the payment gateway. Use when you need to track payment events, surcharges, order value changes, or manual payment edits for a return. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.returns.getOrderReturnPaymentsHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_id` | `number` | Yes | — | | `show_full_history` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `payments` | `object` | No | — | > **payments full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderReturnProductStatuses `returns.getOrderReturnProductStatuses` Tool to retrieve a list of order return product statuses from BaseLinker. Use when you need to identify valid status IDs for return items, or to map status IDs to human-readable names. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.returns.getOrderReturnProductStatuses({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `order_return_product_statuses` | `object` | No | — | > **order\_return\_product\_statuses full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderReturnReasonsList `returns.getOrderReturnReasonsList` Tool to retrieve a list of order return reasons. Use when you need to discover available return reasons before setting return fields with setOrderReturnFields. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.returns.getOrderReturnReasonsList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `return_reasons` | `object` | No | — | > **return\_reasons full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderReturns `returns.getOrderReturns` Download order returns from BaseLinker return manager with optional filtering. Use this tool to: - Fetch returns from a specific date onwards using date\_from parameter - Retrieve a single return by return\_id - Filter returns by source order, status, or marketplace source - Paginate through returns using id\_from parameter Returns up to 100 order returns per request. For complete return data including custom fields, set include\_custom\_extra\_fields=true. Use include\_connect\_data=true for Base Connect integration info. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.returns.getOrderReturns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_id` | `number` | No | — | | `return_id` | `number` | No | — | | `date_from` | `number` | No | — | | `id_from` | `number` | No | — | | `status_id` | `number` | No | — | | `filter_order_return_source` | `string` | No | — | | `filter_order_return_source_id` | `number` | No | — | | `include_custom_extra_fields` | `boolean` | No | — | | `include_connect_data` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `returns` | `object` | No | — | > **returns full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### getOrderReturnStatusList `returns.getOrderReturnStatusList` Tool to retrieve order return statuses created in the BaseLinker order manager. Use when you need to map return status IDs to human-readable names. **Risk:** `read` ```ts theme={null} await corsair.baselinker.api.returns.getOrderReturnStatusList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | | `statuses` | `object` | No | — | > **statuses full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### setOrderReturnFields `returns.setOrderReturnFields` Tool to edit selected fields of a specific order return. Use when updating return information such as buyer contact details, delivery address, or custom fields. Only the fields that need to be changed should be provided; other fields can be omitted. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.returns.setOrderReturnFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_id` | `number` | No | — | | `admin_comments` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `user_login` | `string` | No | — | | `delivery_price` | `number` | No | — | | `delivery_fullname` | `string` | No | — | | `delivery_company` | `string` | No | — | | `delivery_address` | `string` | No | — | | `delivery_postcode` | `string` | No | — | | `delivery_city` | `string` | No | — | | `delivery_state` | `string` | No | — | | `delivery_country_code` | `string` | No | — | | `extra_field_1` | `string` | No | — | | `extra_field_2` | `string` | No | — | | `custom_extra_fields` | `object` | No | — | > **custom\_extra\_fields full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### setOrderReturnProductFields `returns.setOrderReturnProductFields` Tool to edit data of selected items (e.g., prices, quantities, attributes) of a specific order return product. Use when you need to update fields of a returned product in an order return. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.returns.setOrderReturnProductFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_id` | `number` | Yes | — | | `order_return_product_id` | `number` | Yes | — | | `storage` | `string` | No | — | | `storage_id` | `string` | No | — | | `product_id` | `string` | No | — | | `variant_id` | `string` | No | — | | `auction_id` | `string` | No | — | | `name` | `string` | No | — | | `sku` | `string` | No | — | | `ean` | `string` | No | — | | `location` | `string` | No | — | | `warehouse_id` | `number` | No | — | | `attributes` | `string` | No | — | | `price_brutto` | `number` | No | — | | `tax_rate` | `number` | No | — | | `quantity` | `number` | No | — | | `weight` | `number` | No | — | | `status_id` | `number` | No | — | | `return_reason_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### setOrderReturnRefund `returns.setOrderReturnRefund` Tool to mark an order return as refunded in BaseLinker. Use when recording that a refund has been issued for a return. Note: This method doesn't issue an actual money refund - it only updates the refund status in BaseLinker. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.returns.setOrderReturnRefund({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_id` | `number` | Yes | — | | `order_refund_done` | `number` | Yes | — | | `refund_date` | `number` | Yes | — | | `refund_comment` | `string` | Yes | — | | `external_refund_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### setOrderReturnStatus `returns.setOrderReturnStatus` Tool to change order return status in BaseLinker. Use when you need to update the status of a single order return. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.returns.setOrderReturnStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_id` | `number` | Yes | — | | `status_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** ### setOrderReturnStatuses `returns.setOrderReturnStatuses` Tool to batch set order return statuses in BaseLinker. Use when you need to update the status of multiple order returns at once. **Risk:** `write` ```ts theme={null} await corsair.baselinker.api.returns.setOrderReturnStatuses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_ids` | `object` | Yes | — | | `status_id` | `number` | Yes | — | > **return\_ids full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `SUCCESS` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/baselinker/database BaseLinker local sync: searchable entities, `.search()` filters, and operators. The BaseLinker plugin syncs data locally. Use `corsair.baselinker.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Categories Path: `baselinker.db.categories.search` ```ts theme={null} const rows = await corsair.baselinker.db.categories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Connect Integrations Path: `baselinker.db.connectIntegrations.search` ```ts theme={null} const rows = await corsair.baselinker.db.connectIntegrations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Couriers Path: `baselinker.db.couriers.search` ```ts theme={null} const rows = await corsair.baselinker.db.couriers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## External Storages Path: `baselinker.db.externalStorages.search` ```ts theme={null} const rows = await corsair.baselinker.db.externalStorages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Inventories Path: `baselinker.db.inventories.search` ```ts theme={null} const rows = await corsair.baselinker.db.inventories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Inventory Extra Fields Path: `baselinker.db.inventoryExtraFields.search` ```ts theme={null} const rows = await corsair.baselinker.db.inventoryExtraFields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Manufacturers Path: `baselinker.db.manufacturers.search` ```ts theme={null} const rows = await corsair.baselinker.db.manufacturers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Order Statuses Path: `baselinker.db.orderStatuses.search` ```ts theme={null} const rows = await corsair.baselinker.db.orderStatuses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payers Path: `baselinker.db.payers.search` ```ts theme={null} const rows = await corsair.baselinker.db.payers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Price Groups Path: `baselinker.db.priceGroups.search` ```ts theme={null} const rows = await corsair.baselinker.db.priceGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Return Product Statuses Path: `baselinker.db.returnProductStatuses.search` ```ts theme={null} const rows = await corsair.baselinker.db.returnProductStatuses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Return Reasons Path: `baselinker.db.returnReasons.search` ```ts theme={null} const rows = await corsair.baselinker.db.returnReasons.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Return Statuses Path: `baselinker.db.returnStatuses.search` ```ts theme={null} const rows = await corsair.baselinker.db.returnStatuses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Suppliers Path: `baselinker.db.suppliers.search` ```ts theme={null} const rows = await corsair.baselinker.db.suppliers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `baselinker.db.tags.search` ```ts theme={null} const rows = await corsair.baselinker.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Warehouses Path: `baselinker.db.warehouses.search` ```ts theme={null} const rows = await corsair.baselinker.db.warehouses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/baselinker/overview E-commerce integration hub for orders, inventory, and multichannel marketplace management. Use **BaseLinker** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 106 typed API operations * 16 synced entities (`categories`, `connectIntegrations`, `couriers`, `externalStorages`, `inventories`, `inventoryExtraFields`, and 10 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/baselinker ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/baselinker ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/baselinker ``` ```bash bun theme={null} bun add corsair @corsair-dev/baselinker ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { baselinker } from '@corsair-dev/baselinker'; export const corsair = createCorsair({ plugins: [ baselinker(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} baselinker() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'baselinker', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`connect.getConnectIntegrationContractors`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.baselinker.api.connect.getConnectIntegrationContractors({}); ``` **`couriers.createPackageManual`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.baselinker.api.couriers.createPackageManual({}); ``` See the full list on the [API](/plugins/baselinker/api) page. ## Query synced data Synced entities support `tenant.baselinker.db..search()` and `.list()`: `categories`, `connectIntegrations`, `couriers`, `externalStorages`, `inventories`, `inventoryExtraFields`, `manufacturers`, `orderStatuses`, `payers`, `priceGroups`, `returnProductStatuses`, `returnReasons`, `returnStatuses`, `suppliers`, `tags`, `warehouses`. See [Database](/plugins/baselinker/database) for filters and operators. ## What's next > **[API reference](/plugins/baselinker/api)** > > Every `baselinker.api.*` operation with input and output types. > **[Database](/plugins/baselinker/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/basin/api API reference for Basin: every `basin.api.*` operation with input and output types. Every `basin.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Domains ### list `domains.list` List custom domains configured in the account **Risk:** `read` ```ts theme={null} await corsair.basin.api.domains.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `string \| number` | No | — | | `query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domains` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **domains full type** > > ```ts theme={null} > { > id?: number | string, > name?: string, > created_at?: string, > updated_at?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count?: number, > page?: number, > per_page?: number > } > ``` *** ## Forms ### create `forms.create` Create a new form **Risk:** `write` ```ts theme={null} await corsair.basin.api.forms.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `project_id` | `number` | No | — | | `timezone` | `string` | No | — | | `redirect_url` | `string` | No | — | | `use_ajax` | `boolean` | No | — | | `notification_emails` | `string` | No | — | | `autoreply` | `boolean` | No | — | | `autoreply_body` | `string` | No | — | | `whitelist_source_domains` | `string` | No | — | | `force_recaptcha` | `boolean` | No | — | | `force_hcaptcha` | `boolean` | No | — | | `force_turnstile` | `boolean` | No | — | | `turnstile_site_key` | `string` | No | — | | `turnstile_secret` | `string` | No | — | | `notification_cc_emails` | `string` | No | — | | `notification_bcc_emails` | `string` | No | — | | `notification_subject` | `string` | No | — | | `notification_from_name` | `string` | No | — | | `autoreply_subject` | `string` | No | — | | `autoreply_from_name` | `string` | No | — | | `autoreply_greeting` | `string` | No | — | | `autoreply_name` | `string` | No | — | | `autoreply_title` | `string` | No | — | | `autoreply_email` | `string` | No | — | | `logo` | `string` | No | — | | `button_background_color` | `string` | No | — | | `button_text_color` | `string` | No | — | | `data_receipt_email` | `boolean` | No | — | | `retention_days` | `number` | No | — | | `hide_dashboard_button` | `boolean` | No | — | | `exclude_submitter_from_reply` | `boolean` | No | — | | `custom_template` | `string` | No | — | | `use_custom_template` | `boolean` | No | — | | `autoreply_custom_template` | `string` | No | — | | `autoreply_use_custom_template` | `boolean` | No | — | | `notification_mail_template_id` | `number` | No | — | | `auto_response_mail_template_id` | `number` | No | — | | `confirmation_mail_template_id` | `number` | No | — | | `honeypot_field` | `string` | No | — | | `recaptcha_failed_url` | `string` | No | — | | `domain_id` | `number` | No | — | | `domain_email` | `string` | No | — | | `duplicate_filter` | `boolean` | No | — | | `redirect_heading` | `string` | No | — | | `redirect_message` | `string` | No | — | | `redirect_button_background_color` | `string` | No | — | | `redirect_button_text` | `string` | No | — | | `redirect_button_text_color` | `string` | No | — | | `content_blacklist` | `string[]` | No | — | | `allowed_domains` | `string[]` | No | — | | `blocked_domains` | `string[]` | No | — | | `smtp_email_validation` | `boolean` | No | — | | `contribute_to_spam_training` | `boolean` | No | — | | `form` | `object` | No | — | > **form full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `uuid` | `string` | No | — | | `name` | `string` | No | — | | `timezone` | `string` | No | — | | `redirect_url` | `string` | No | — | | `use_ajax` | `boolean` | No | — | | `notification_emails` | `string` | No | — | | `autoreply` | `boolean` | No | — | | `autoreply_body` | `string` | No | — | | `whitelist_source_domains` | `string` | No | — | | `force_recaptcha` | `boolean` | No | — | | `force_hcaptcha` | `boolean` | No | — | | `force_turnstile` | `boolean` | No | — | | `turnstile_site_key` | `string` | No | — | | `turnstile_secret` | `string` | No | — | | `notification_cc_emails` | `string` | No | — | | `notification_bcc_emails` | `string` | No | — | | `notification_subject` | `string` | No | — | | `notification_from_name` | `string` | No | — | | `autoreply_subject` | `string` | No | — | | `autoreply_from_name` | `string` | No | — | | `autoreply_greeting` | `string` | No | — | | `autoreply_name` | `string` | No | — | | `autoreply_title` | `string` | No | — | | `autoreply_email` | `string` | No | — | | `logo` | `string` | No | — | | `button_background_color` | `string` | No | — | | `button_text_color` | `string` | No | — | | `data_receipt_email` | `boolean` | No | — | | `retention_days` | `number` | No | — | | `hide_dashboard_button` | `boolean` | No | — | | `exclude_submitter_from_reply` | `boolean` | No | — | | `custom_template` | `string` | No | — | | `use_custom_template` | `boolean` | No | — | | `autoreply_custom_template` | `string` | No | — | | `autoreply_use_custom_template` | `boolean` | No | — | | `notification_mail_template_id` | `number` | No | — | | `auto_response_mail_template_id` | `number` | No | — | | `confirmation_mail_template_id` | `number` | No | — | | `honeypot_field` | `string` | No | — | | `recaptcha_failed_url` | `string` | No | — | | `domain_id` | `number` | No | — | | `domain_email` | `string` | No | — | | `duplicate_filter` | `boolean` | No | — | | `project_id` | `number` | No | — | | `project_name` | `string` | No | — | | `redirect_heading` | `string` | No | — | | `redirect_message` | `string` | No | — | | `redirect_button_background_color` | `string` | No | — | | `redirect_button_text` | `string` | No | — | | `redirect_button_text_color` | `string` | No | — | | `content_blacklist` | `string[]` | No | — | | `allowed_domains` | `string[]` | No | — | | `blocked_domains` | `string[]` | No | — | | `smtp_email_validation` | `boolean` | No | — | | `contribute_to_spam_training` | `boolean` | No | — | | `form_webhooks` | `any[]` | No | — | | `inbox_count` | `number` | No | — | | `spam_count` | `number` | No | — | | `trash_count` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### delete `forms.delete` Permanently delete a form and its configuration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basin.api.forms.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > success?: boolean, > message?: string > } | { > id: number | string, > uuid?: string | null, > name?: string, > timezone?: string, > redirect_url?: string | null, > use_ajax?: boolean, > notification_emails?: string, > autoreply?: boolean, > autoreply_body?: string | null, > whitelist_source_domains?: string | null, > force_recaptcha?: boolean, > force_hcaptcha?: boolean, > force_turnstile?: boolean, > turnstile_site_key?: string | null, > turnstile_secret?: string | null, > notification_cc_emails?: string | null, > notification_bcc_emails?: string | null, > notification_subject?: string | null, > notification_from_name?: string | null, > autoreply_subject?: string | null, > autoreply_from_name?: string | null, > autoreply_greeting?: string | null, > autoreply_name?: string | null, > autoreply_title?: string | null, > autoreply_email?: string | null, > logo?: string | null, > button_background_color?: string | null, > button_text_color?: string | null, > data_receipt_email?: boolean, > retention_days?: number, > hide_dashboard_button?: boolean, > exclude_submitter_from_reply?: boolean, > custom_template?: string | null, > use_custom_template?: boolean, > autoreply_custom_template?: string | null, > autoreply_use_custom_template?: boolean, > notification_mail_template_id?: number | null, > auto_response_mail_template_id?: number | null, > confirmation_mail_template_id?: number | null, > honeypot_field?: string | null, > recaptcha_failed_url?: string | null, > domain_id?: number | null, > domain_email?: string | null, > duplicate_filter?: boolean, > project_id?: number, > project_name?: string, > redirect_heading?: string | null, > redirect_message?: string | null, > redirect_button_background_color?: string | null, > redirect_button_text?: string | null, > redirect_button_text_color?: string | null, > content_blacklist?: string[] | null, > allowed_domains?: string[] | null, > blocked_domains?: string[] | null, > smtp_email_validation?: boolean, > contribute_to_spam_training?: boolean, > form_webhooks?: any[], > inbox_count?: number, > spam_count?: number, > trash_count?: number, > created_at?: string, > updated_at?: string > } | { > id: number | string, > email?: string | null, > form_id?: number, > spam?: boolean, > read?: boolean, > trash?: boolean, > spam_reason?: string | null, > webhook_sent_at?: string | null, > ip?: string | null, > referrer?: string | null, > user_agent?: string | null, > payload_params?: { > }, > attachments?: any[] | null, > form?: { > name?: string, > uuid?: string > }, > created_at?: string, > updated_at?: string > } | { > id: number | string, > name?: string, > created_at?: string, > updated_at?: string > } | { > id: number | string, > form_id?: number, > name?: string, > url?: string, > format?: string, > trigger_when_spam?: boolean, > enabled?: boolean, > failure_count?: number, > last_failure_at?: string | null, > created_at?: string, > updated_at?: string > } | { > } > ``` *** ### get `forms.get` Retrieve a form by ID **Risk:** `read` ```ts theme={null} await corsair.basin.api.forms.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `uuid` | `string` | No | — | | `name` | `string` | No | — | | `timezone` | `string` | No | — | | `redirect_url` | `string` | No | — | | `use_ajax` | `boolean` | No | — | | `notification_emails` | `string` | No | — | | `autoreply` | `boolean` | No | — | | `autoreply_body` | `string` | No | — | | `whitelist_source_domains` | `string` | No | — | | `force_recaptcha` | `boolean` | No | — | | `force_hcaptcha` | `boolean` | No | — | | `force_turnstile` | `boolean` | No | — | | `turnstile_site_key` | `string` | No | — | | `turnstile_secret` | `string` | No | — | | `notification_cc_emails` | `string` | No | — | | `notification_bcc_emails` | `string` | No | — | | `notification_subject` | `string` | No | — | | `notification_from_name` | `string` | No | — | | `autoreply_subject` | `string` | No | — | | `autoreply_from_name` | `string` | No | — | | `autoreply_greeting` | `string` | No | — | | `autoreply_name` | `string` | No | — | | `autoreply_title` | `string` | No | — | | `autoreply_email` | `string` | No | — | | `logo` | `string` | No | — | | `button_background_color` | `string` | No | — | | `button_text_color` | `string` | No | — | | `data_receipt_email` | `boolean` | No | — | | `retention_days` | `number` | No | — | | `hide_dashboard_button` | `boolean` | No | — | | `exclude_submitter_from_reply` | `boolean` | No | — | | `custom_template` | `string` | No | — | | `use_custom_template` | `boolean` | No | — | | `autoreply_custom_template` | `string` | No | — | | `autoreply_use_custom_template` | `boolean` | No | — | | `notification_mail_template_id` | `number` | No | — | | `auto_response_mail_template_id` | `number` | No | — | | `confirmation_mail_template_id` | `number` | No | — | | `honeypot_field` | `string` | No | — | | `recaptcha_failed_url` | `string` | No | — | | `domain_id` | `number` | No | — | | `domain_email` | `string` | No | — | | `duplicate_filter` | `boolean` | No | — | | `project_id` | `number` | No | — | | `project_name` | `string` | No | — | | `redirect_heading` | `string` | No | — | | `redirect_message` | `string` | No | — | | `redirect_button_background_color` | `string` | No | — | | `redirect_button_text` | `string` | No | — | | `redirect_button_text_color` | `string` | No | — | | `content_blacklist` | `string[]` | No | — | | `allowed_domains` | `string[]` | No | — | | `blocked_domains` | `string[]` | No | — | | `smtp_email_validation` | `boolean` | No | — | | `contribute_to_spam_training` | `boolean` | No | — | | `form_webhooks` | `any[]` | No | — | | `inbox_count` | `number` | No | — | | `spam_count` | `number` | No | — | | `trash_count` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### list `forms.list` List all forms in the account **Risk:** `read` ```ts theme={null} await corsair.basin.api.forms.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `string \| number` | No | — | | `query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `forms` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **forms full type** > > ```ts theme={null} > { > id: number | string, > uuid?: string | null, > name?: string, > timezone?: string, > redirect_url?: string | null, > use_ajax?: boolean, > notification_emails?: string, > autoreply?: boolean, > autoreply_body?: string | null, > whitelist_source_domains?: string | null, > force_recaptcha?: boolean, > force_hcaptcha?: boolean, > force_turnstile?: boolean, > turnstile_site_key?: string | null, > turnstile_secret?: string | null, > notification_cc_emails?: string | null, > notification_bcc_emails?: string | null, > notification_subject?: string | null, > notification_from_name?: string | null, > autoreply_subject?: string | null, > autoreply_from_name?: string | null, > autoreply_greeting?: string | null, > autoreply_name?: string | null, > autoreply_title?: string | null, > autoreply_email?: string | null, > logo?: string | null, > button_background_color?: string | null, > button_text_color?: string | null, > data_receipt_email?: boolean, > retention_days?: number, > hide_dashboard_button?: boolean, > exclude_submitter_from_reply?: boolean, > custom_template?: string | null, > use_custom_template?: boolean, > autoreply_custom_template?: string | null, > autoreply_use_custom_template?: boolean, > notification_mail_template_id?: number | null, > auto_response_mail_template_id?: number | null, > confirmation_mail_template_id?: number | null, > honeypot_field?: string | null, > recaptcha_failed_url?: string | null, > domain_id?: number | null, > domain_email?: string | null, > duplicate_filter?: boolean, > project_id?: number, > project_name?: string, > redirect_heading?: string | null, > redirect_message?: string | null, > redirect_button_background_color?: string | null, > redirect_button_text?: string | null, > redirect_button_text_color?: string | null, > content_blacklist?: string[] | null, > allowed_domains?: string[] | null, > blocked_domains?: string[] | null, > smtp_email_validation?: boolean, > contribute_to_spam_training?: boolean, > form_webhooks?: any[], > inbox_count?: number, > spam_count?: number, > trash_count?: number, > created_at?: string, > updated_at?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count?: number, > page?: number, > per_page?: number > } > ``` *** ### update `forms.update` Update an existing form configuration **Risk:** `write` ```ts theme={null} await corsair.basin.api.forms.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `project_id` | `number` | No | — | | `timezone` | `string` | No | — | | `redirect_url` | `string` | No | — | | `use_ajax` | `boolean` | No | — | | `notification_emails` | `string` | No | — | | `autoreply` | `boolean` | No | — | | `autoreply_body` | `string` | No | — | | `whitelist_source_domains` | `string` | No | — | | `force_recaptcha` | `boolean` | No | — | | `force_hcaptcha` | `boolean` | No | — | | `force_turnstile` | `boolean` | No | — | | `turnstile_site_key` | `string` | No | — | | `turnstile_secret` | `string` | No | — | | `notification_cc_emails` | `string` | No | — | | `notification_bcc_emails` | `string` | No | — | | `notification_subject` | `string` | No | — | | `notification_from_name` | `string` | No | — | | `autoreply_subject` | `string` | No | — | | `autoreply_from_name` | `string` | No | — | | `autoreply_greeting` | `string` | No | — | | `autoreply_name` | `string` | No | — | | `autoreply_title` | `string` | No | — | | `autoreply_email` | `string` | No | — | | `logo` | `string` | No | — | | `button_background_color` | `string` | No | — | | `button_text_color` | `string` | No | — | | `data_receipt_email` | `boolean` | No | — | | `retention_days` | `number` | No | — | | `hide_dashboard_button` | `boolean` | No | — | | `exclude_submitter_from_reply` | `boolean` | No | — | | `custom_template` | `string` | No | — | | `use_custom_template` | `boolean` | No | — | | `autoreply_custom_template` | `string` | No | — | | `autoreply_use_custom_template` | `boolean` | No | — | | `notification_mail_template_id` | `number` | No | — | | `auto_response_mail_template_id` | `number` | No | — | | `confirmation_mail_template_id` | `number` | No | — | | `honeypot_field` | `string` | No | — | | `recaptcha_failed_url` | `string` | No | — | | `domain_id` | `number` | No | — | | `domain_email` | `string` | No | — | | `duplicate_filter` | `boolean` | No | — | | `redirect_heading` | `string` | No | — | | `redirect_message` | `string` | No | — | | `redirect_button_background_color` | `string` | No | — | | `redirect_button_text` | `string` | No | — | | `redirect_button_text_color` | `string` | No | — | | `content_blacklist` | `string[]` | No | — | | `allowed_domains` | `string[]` | No | — | | `blocked_domains` | `string[]` | No | — | | `smtp_email_validation` | `boolean` | No | — | | `contribute_to_spam_training` | `boolean` | No | — | | `form` | `object` | No | — | > **form full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `uuid` | `string` | No | — | | `name` | `string` | No | — | | `timezone` | `string` | No | — | | `redirect_url` | `string` | No | — | | `use_ajax` | `boolean` | No | — | | `notification_emails` | `string` | No | — | | `autoreply` | `boolean` | No | — | | `autoreply_body` | `string` | No | — | | `whitelist_source_domains` | `string` | No | — | | `force_recaptcha` | `boolean` | No | — | | `force_hcaptcha` | `boolean` | No | — | | `force_turnstile` | `boolean` | No | — | | `turnstile_site_key` | `string` | No | — | | `turnstile_secret` | `string` | No | — | | `notification_cc_emails` | `string` | No | — | | `notification_bcc_emails` | `string` | No | — | | `notification_subject` | `string` | No | — | | `notification_from_name` | `string` | No | — | | `autoreply_subject` | `string` | No | — | | `autoreply_from_name` | `string` | No | — | | `autoreply_greeting` | `string` | No | — | | `autoreply_name` | `string` | No | — | | `autoreply_title` | `string` | No | — | | `autoreply_email` | `string` | No | — | | `logo` | `string` | No | — | | `button_background_color` | `string` | No | — | | `button_text_color` | `string` | No | — | | `data_receipt_email` | `boolean` | No | — | | `retention_days` | `number` | No | — | | `hide_dashboard_button` | `boolean` | No | — | | `exclude_submitter_from_reply` | `boolean` | No | — | | `custom_template` | `string` | No | — | | `use_custom_template` | `boolean` | No | — | | `autoreply_custom_template` | `string` | No | — | | `autoreply_use_custom_template` | `boolean` | No | — | | `notification_mail_template_id` | `number` | No | — | | `auto_response_mail_template_id` | `number` | No | — | | `confirmation_mail_template_id` | `number` | No | — | | `honeypot_field` | `string` | No | — | | `recaptcha_failed_url` | `string` | No | — | | `domain_id` | `number` | No | — | | `domain_email` | `string` | No | — | | `duplicate_filter` | `boolean` | No | — | | `project_id` | `number` | No | — | | `project_name` | `string` | No | — | | `redirect_heading` | `string` | No | — | | `redirect_message` | `string` | No | — | | `redirect_button_background_color` | `string` | No | — | | `redirect_button_text` | `string` | No | — | | `redirect_button_text_color` | `string` | No | — | | `content_blacklist` | `string[]` | No | — | | `allowed_domains` | `string[]` | No | — | | `blocked_domains` | `string[]` | No | — | | `smtp_email_validation` | `boolean` | No | — | | `contribute_to_spam_training` | `boolean` | No | — | | `form_webhooks` | `any[]` | No | — | | `inbox_count` | `number` | No | — | | `spam_count` | `number` | No | — | | `trash_count` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ## Form Views ### get `formViews.get` Retrieve a specific form view by ID **Risk:** `read` ```ts theme={null} await corsair.basin.api.formViews.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `form_id` | `number` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `form_schema` | `string` | No | — | | `custom_css` | `string` | No | — | | `custom_head` | `string` | No | — | | `background_color` | `string` | No | — | | `text_color` | `string` | No | — | | `inherit_styles` | `boolean` | No | — | | `auto_resize` | `boolean` | No | — | | `transparent_background` | `boolean` | No | — | | `opens_at` | `string` | No | — | | `closes_at` | `string` | No | — | | `bootstrap_cdn_url` | `string` | No | — | | `uuid` | `string` | No | — | | `iframe_height` | `number` | No | — | | `iframe_width` | `number` | No | — | | `redirect_iframe_parent` | `boolean` | No | — | | `center_iframe` | `boolean` | No | — | | `embed_code` | `string` | No | — | | `form` | `object` | No | — | | `project` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **form full type** > > ```ts theme={null} > { > id?: number, > name?: string | null > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number, > name?: string | null > } > ``` *** ### list `formViews.list` List form views in the account **Risk:** `read` ```ts theme={null} await corsair.basin.api.formViews.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `string \| number` | No | — | | `query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `form_views` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **form\_views full type** > > ```ts theme={null} > { > id: number | string, > form_id?: number, > name?: string | null, > status?: string, > form_schema?: string | null, > custom_css?: string | null, > custom_head?: string | null, > background_color?: string | null, > text_color?: string | null, > inherit_styles?: boolean, > auto_resize?: boolean, > transparent_background?: boolean, > opens_at?: string | null, > closes_at?: string | null, > bootstrap_cdn_url?: string | null, > uuid?: string | null, > iframe_height?: number | null, > iframe_width?: number | null, > redirect_iframe_parent?: boolean, > center_iframe?: boolean, > embed_code?: string, > form?: { > id?: number, > name?: string | null > }, > project?: { > id?: number, > name?: string | null > }, > created_at?: string, > updated_at?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count?: number, > page?: number, > per_page?: number > } > ``` *** ## Projects ### create `projects.create` Create a new project **Risk:** `write` ```ts theme={null} await corsair.basin.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `project` | `object` | No | — | > **project full type** > > ```ts theme={null} > { > name: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### delete `projects.delete` Permanently delete a project **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basin.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > success?: boolean, > message?: string > } | { > id: number | string, > uuid?: string | null, > name?: string, > timezone?: string, > redirect_url?: string | null, > use_ajax?: boolean, > notification_emails?: string, > autoreply?: boolean, > autoreply_body?: string | null, > whitelist_source_domains?: string | null, > force_recaptcha?: boolean, > force_hcaptcha?: boolean, > force_turnstile?: boolean, > turnstile_site_key?: string | null, > turnstile_secret?: string | null, > notification_cc_emails?: string | null, > notification_bcc_emails?: string | null, > notification_subject?: string | null, > notification_from_name?: string | null, > autoreply_subject?: string | null, > autoreply_from_name?: string | null, > autoreply_greeting?: string | null, > autoreply_name?: string | null, > autoreply_title?: string | null, > autoreply_email?: string | null, > logo?: string | null, > button_background_color?: string | null, > button_text_color?: string | null, > data_receipt_email?: boolean, > retention_days?: number, > hide_dashboard_button?: boolean, > exclude_submitter_from_reply?: boolean, > custom_template?: string | null, > use_custom_template?: boolean, > autoreply_custom_template?: string | null, > autoreply_use_custom_template?: boolean, > notification_mail_template_id?: number | null, > auto_response_mail_template_id?: number | null, > confirmation_mail_template_id?: number | null, > honeypot_field?: string | null, > recaptcha_failed_url?: string | null, > domain_id?: number | null, > domain_email?: string | null, > duplicate_filter?: boolean, > project_id?: number, > project_name?: string, > redirect_heading?: string | null, > redirect_message?: string | null, > redirect_button_background_color?: string | null, > redirect_button_text?: string | null, > redirect_button_text_color?: string | null, > content_blacklist?: string[] | null, > allowed_domains?: string[] | null, > blocked_domains?: string[] | null, > smtp_email_validation?: boolean, > contribute_to_spam_training?: boolean, > form_webhooks?: any[], > inbox_count?: number, > spam_count?: number, > trash_count?: number, > created_at?: string, > updated_at?: string > } | { > id: number | string, > email?: string | null, > form_id?: number, > spam?: boolean, > read?: boolean, > trash?: boolean, > spam_reason?: string | null, > webhook_sent_at?: string | null, > ip?: string | null, > referrer?: string | null, > user_agent?: string | null, > payload_params?: { > }, > attachments?: any[] | null, > form?: { > name?: string, > uuid?: string > }, > created_at?: string, > updated_at?: string > } | { > id: number | string, > name?: string, > created_at?: string, > updated_at?: string > } | { > id: number | string, > form_id?: number, > name?: string, > url?: string, > format?: string, > trigger_when_spam?: boolean, > enabled?: boolean, > failure_count?: number, > last_failure_at?: string | null, > created_at?: string, > updated_at?: string > } | { > } > ``` *** ### get `projects.get` Retrieve a project by ID **Risk:** `read` ```ts theme={null} await corsair.basin.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### list `projects.list` List all projects in the account **Risk:** `read` ```ts theme={null} await corsair.basin.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `string \| number` | No | — | | `query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projects` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **projects full type** > > ```ts theme={null} > { > id: number | string, > name?: string, > created_at?: string, > updated_at?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count?: number, > page?: number, > per_page?: number > } > ``` *** ### update `projects.update` Update an existing project name **Risk:** `write` ```ts theme={null} await corsair.basin.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `project` | `object` | No | — | > **project full type** > > ```ts theme={null} > { > name: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ## Submissions ### delete `submissions.delete` Permanently delete a form submission **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basin.api.submissions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > success?: boolean, > message?: string > } | { > id: number | string, > uuid?: string | null, > name?: string, > timezone?: string, > redirect_url?: string | null, > use_ajax?: boolean, > notification_emails?: string, > autoreply?: boolean, > autoreply_body?: string | null, > whitelist_source_domains?: string | null, > force_recaptcha?: boolean, > force_hcaptcha?: boolean, > force_turnstile?: boolean, > turnstile_site_key?: string | null, > turnstile_secret?: string | null, > notification_cc_emails?: string | null, > notification_bcc_emails?: string | null, > notification_subject?: string | null, > notification_from_name?: string | null, > autoreply_subject?: string | null, > autoreply_from_name?: string | null, > autoreply_greeting?: string | null, > autoreply_name?: string | null, > autoreply_title?: string | null, > autoreply_email?: string | null, > logo?: string | null, > button_background_color?: string | null, > button_text_color?: string | null, > data_receipt_email?: boolean, > retention_days?: number, > hide_dashboard_button?: boolean, > exclude_submitter_from_reply?: boolean, > custom_template?: string | null, > use_custom_template?: boolean, > autoreply_custom_template?: string | null, > autoreply_use_custom_template?: boolean, > notification_mail_template_id?: number | null, > auto_response_mail_template_id?: number | null, > confirmation_mail_template_id?: number | null, > honeypot_field?: string | null, > recaptcha_failed_url?: string | null, > domain_id?: number | null, > domain_email?: string | null, > duplicate_filter?: boolean, > project_id?: number, > project_name?: string, > redirect_heading?: string | null, > redirect_message?: string | null, > redirect_button_background_color?: string | null, > redirect_button_text?: string | null, > redirect_button_text_color?: string | null, > content_blacklist?: string[] | null, > allowed_domains?: string[] | null, > blocked_domains?: string[] | null, > smtp_email_validation?: boolean, > contribute_to_spam_training?: boolean, > form_webhooks?: any[], > inbox_count?: number, > spam_count?: number, > trash_count?: number, > created_at?: string, > updated_at?: string > } | { > id: number | string, > email?: string | null, > form_id?: number, > spam?: boolean, > read?: boolean, > trash?: boolean, > spam_reason?: string | null, > webhook_sent_at?: string | null, > ip?: string | null, > referrer?: string | null, > user_agent?: string | null, > payload_params?: { > }, > attachments?: any[] | null, > form?: { > name?: string, > uuid?: string > }, > created_at?: string, > updated_at?: string > } | { > id: number | string, > name?: string, > created_at?: string, > updated_at?: string > } | { > id: number | string, > form_id?: number, > name?: string, > url?: string, > format?: string, > trigger_when_spam?: boolean, > enabled?: boolean, > failure_count?: number, > last_failure_at?: string | null, > created_at?: string, > updated_at?: string > } | { > } > ``` *** ### get `submissions.get` Retrieve a specific form submission by ID **Risk:** `read` ```ts theme={null} await corsair.basin.api.submissions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `email` | `string` | No | — | | `form_id` | `number` | No | — | | `spam` | `boolean` | No | — | | `read` | `boolean` | No | — | | `trash` | `boolean` | No | — | | `spam_reason` | `string` | No | — | | `webhook_sent_at` | `string` | No | — | | `ip` | `string` | No | — | | `referrer` | `string` | No | — | | `user_agent` | `string` | No | — | | `payload_params` | `object` | No | — | | `attachments` | `any[]` | No | — | | `form` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **payload\_params full type** > > ```ts theme={null} > { > } > ``` > **form full type** > > ```ts theme={null} > { > name?: string, > uuid?: string > } > ``` *** ### list `submissions.list` List submissions with filtering and pagination options **Risk:** `read` ```ts theme={null} await corsair.basin.api.submissions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string \| number` | No | — | | `filter_by` | `string` | No | — | | `query` | `string` | No | — | | `order_by` | `string` | No | — | | `date_range` | `string` | No | — | | `page` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `submissions` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **submissions full type** > > ```ts theme={null} > { > id: number | string, > email?: string | null, > form_id?: number, > spam?: boolean, > read?: boolean, > trash?: boolean, > spam_reason?: string | null, > webhook_sent_at?: string | null, > ip?: string | null, > referrer?: string | null, > user_agent?: string | null, > payload_params?: { > }, > attachments?: any[] | null, > form?: { > name?: string, > uuid?: string > }, > created_at?: string, > updated_at?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count?: number, > page?: number, > per_page?: number > } > ``` *** ### markHam `submissions.markHam` Mark a submission as legitimate (not spam) **Risk:** `write` ```ts theme={null} await corsair.basin.api.submissions.markHam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `email` | `string` | No | — | | `form_id` | `number` | No | — | | `spam` | `boolean` | No | — | | `read` | `boolean` | No | — | | `trash` | `boolean` | No | — | | `spam_reason` | `string` | No | — | | `webhook_sent_at` | `string` | No | — | | `ip` | `string` | No | — | | `referrer` | `string` | No | — | | `user_agent` | `string` | No | — | | `payload_params` | `object` | No | — | | `attachments` | `any[]` | No | — | | `form` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **payload\_params full type** > > ```ts theme={null} > { > } > ``` > **form full type** > > ```ts theme={null} > { > name?: string, > uuid?: string > } > ``` *** ### markSpam `submissions.markSpam` Mark a submission as spam **Risk:** `write` ```ts theme={null} await corsair.basin.api.submissions.markSpam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `email` | `string` | No | — | | `form_id` | `number` | No | — | | `spam` | `boolean` | No | — | | `read` | `boolean` | No | — | | `trash` | `boolean` | No | — | | `spam_reason` | `string` | No | — | | `webhook_sent_at` | `string` | No | — | | `ip` | `string` | No | — | | `referrer` | `string` | No | — | | `user_agent` | `string` | No | — | | `payload_params` | `object` | No | — | | `attachments` | `any[]` | No | — | | `form` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **payload\_params full type** > > ```ts theme={null} > { > } > ``` > **form full type** > > ```ts theme={null} > { > name?: string, > uuid?: string > } > ``` *** ### refireWebhooks `submissions.refireWebhooks` Re-trigger webhooks for a specific submission **Risk:** `write` ```ts theme={null} await corsair.basin.api.submissions.refireWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### refireWebhooksBulk `submissions.refireWebhooksBulk` Re-trigger webhooks in bulk for multiple submissions **Risk:** `write` ```ts theme={null} await corsair.basin.api.submissions.refireWebhooksBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `submission_ids` | `number[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### update `submissions.update` Update a submission state (read, spam, trash) **Risk:** `write` ```ts theme={null} await corsair.basin.api.submissions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `spam` | `boolean` | No | — | | `read` | `boolean` | No | — | | `trash` | `boolean` | No | — | | `submission` | `object` | No | — | > **submission full type** > > ```ts theme={null} > { > spam?: boolean, > read?: boolean, > trash?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `email` | `string` | No | — | | `form_id` | `number` | No | — | | `spam` | `boolean` | No | — | | `read` | `boolean` | No | — | | `trash` | `boolean` | No | — | | `spam_reason` | `string` | No | — | | `webhook_sent_at` | `string` | No | — | | `ip` | `string` | No | — | | `referrer` | `string` | No | — | | `user_agent` | `string` | No | — | | `payload_params` | `object` | No | — | | `attachments` | `any[]` | No | — | | `form` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **payload\_params full type** > > ```ts theme={null} > { > } > ``` > **form full type** > > ```ts theme={null} > { > name?: string, > uuid?: string > } > ``` *** ## Webhooks ### create `webhooks.create` Create a new form webhook integration **Risk:** `write` ```ts theme={null} await corsair.basin.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `number` | No | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `format` | `string` | No | — | | `trigger_when_spam` | `boolean` | No | — | | `enabled` | `boolean` | No | — | | `form_webhook` | `object` | No | — | > **form\_webhook full type** > > ```ts theme={null} > { > form_id: number, > name: string, > url: string, > format?: string, > trigger_when_spam?: boolean, > enabled?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `form_id` | `number` | No | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `format` | `string` | No | — | | `trigger_when_spam` | `boolean` | No | — | | `enabled` | `boolean` | No | — | | `failure_count` | `number` | No | — | | `last_failure_at` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### delete `webhooks.delete` Permanently delete a form webhook integration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.basin.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > success?: boolean, > message?: string > } | { > id: number | string, > uuid?: string | null, > name?: string, > timezone?: string, > redirect_url?: string | null, > use_ajax?: boolean, > notification_emails?: string, > autoreply?: boolean, > autoreply_body?: string | null, > whitelist_source_domains?: string | null, > force_recaptcha?: boolean, > force_hcaptcha?: boolean, > force_turnstile?: boolean, > turnstile_site_key?: string | null, > turnstile_secret?: string | null, > notification_cc_emails?: string | null, > notification_bcc_emails?: string | null, > notification_subject?: string | null, > notification_from_name?: string | null, > autoreply_subject?: string | null, > autoreply_from_name?: string | null, > autoreply_greeting?: string | null, > autoreply_name?: string | null, > autoreply_title?: string | null, > autoreply_email?: string | null, > logo?: string | null, > button_background_color?: string | null, > button_text_color?: string | null, > data_receipt_email?: boolean, > retention_days?: number, > hide_dashboard_button?: boolean, > exclude_submitter_from_reply?: boolean, > custom_template?: string | null, > use_custom_template?: boolean, > autoreply_custom_template?: string | null, > autoreply_use_custom_template?: boolean, > notification_mail_template_id?: number | null, > auto_response_mail_template_id?: number | null, > confirmation_mail_template_id?: number | null, > honeypot_field?: string | null, > recaptcha_failed_url?: string | null, > domain_id?: number | null, > domain_email?: string | null, > duplicate_filter?: boolean, > project_id?: number, > project_name?: string, > redirect_heading?: string | null, > redirect_message?: string | null, > redirect_button_background_color?: string | null, > redirect_button_text?: string | null, > redirect_button_text_color?: string | null, > content_blacklist?: string[] | null, > allowed_domains?: string[] | null, > blocked_domains?: string[] | null, > smtp_email_validation?: boolean, > contribute_to_spam_training?: boolean, > form_webhooks?: any[], > inbox_count?: number, > spam_count?: number, > trash_count?: number, > created_at?: string, > updated_at?: string > } | { > id: number | string, > email?: string | null, > form_id?: number, > spam?: boolean, > read?: boolean, > trash?: boolean, > spam_reason?: string | null, > webhook_sent_at?: string | null, > ip?: string | null, > referrer?: string | null, > user_agent?: string | null, > payload_params?: { > }, > attachments?: any[] | null, > form?: { > name?: string, > uuid?: string > }, > created_at?: string, > updated_at?: string > } | { > id: number | string, > name?: string, > created_at?: string, > updated_at?: string > } | { > id: number | string, > form_id?: number, > name?: string, > url?: string, > format?: string, > trigger_when_spam?: boolean, > enabled?: boolean, > failure_count?: number, > last_failure_at?: string | null, > created_at?: string, > updated_at?: string > } | { > } > ``` *** ### get `webhooks.get` Retrieve a form webhook configuration by ID **Risk:** `read` ```ts theme={null} await corsair.basin.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `form_id` | `number` | No | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `format` | `string` | No | — | | `trigger_when_spam` | `boolean` | No | — | | `enabled` | `boolean` | No | — | | `failure_count` | `number` | No | — | | `last_failure_at` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### list `webhooks.list` List all form webhooks **Risk:** `read` ```ts theme={null} await corsair.basin.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `string \| number` | No | — | | `query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `form_webhooks` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **form\_webhooks full type** > > ```ts theme={null} > { > id: number | string, > form_id?: number, > name?: string, > url?: string, > format?: string, > trigger_when_spam?: boolean, > enabled?: boolean, > failure_count?: number, > last_failure_at?: string | null, > created_at?: string, > updated_at?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count?: number, > page?: number, > per_page?: number > } > ``` *** ### update `webhooks.update` Update a form webhook configuration **Risk:** `write` ```ts theme={null} await corsair.basin.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `form_id` | `number` | No | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `format` | `string` | No | — | | `trigger_when_spam` | `boolean` | No | — | | `enabled` | `boolean` | No | — | | `form_webhook` | `object` | No | — | > **form\_webhook full type** > > ```ts theme={null} > { > form_id?: number, > name?: string, > url?: string, > format?: string, > trigger_when_spam?: boolean, > enabled?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `form_id` | `number` | No | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `format` | `string` | No | — | | `trigger_when_spam` | `boolean` | No | — | | `enabled` | `boolean` | No | — | | `failure_count` | `number` | No | — | | `last_failure_at` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/basin/database Basin local sync: searchable entities, `.search()` filters, and operators. The Basin plugin syncs data locally. Use `corsair.basin.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Domains Path: `basin.db.domains.search` ```ts theme={null} const rows = await corsair.basin.db.domains.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Forms Path: `basin.db.forms.search` ```ts theme={null} const rows = await corsair.basin.db.forms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `project_name` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `redirect_url` | `string` | equals, contains, startsWith, endsWith, in | | `use_ajax` | `boolean` | equals | | `notification_emails` | `string` | equals, contains, startsWith, endsWith, in | | `autoreply` | `boolean` | equals | | `inbox_count` | `number` | equals, gt, gte, lt, lte, in | | `spam_count` | `number` | equals, gt, gte, lt, lte, in | | `trash_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Form Views Path: `basin.db.formViews.search` ```ts theme={null} const rows = await corsair.basin.db.formViews.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `form_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `embed_code` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `basin.db.projects.search` ```ts theme={null} const rows = await corsair.basin.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Submissions Path: `basin.db.submissions.search` ```ts theme={null} const rows = await corsair.basin.db.submissions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `form_id` | `number` | equals, gt, gte, lt, lte, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `spam` | `boolean` | equals | | `read` | `boolean` | equals | | `trash` | `boolean` | equals | | `spam_reason` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `referrer` | `string` | equals, contains, startsWith, endsWith, in | | `user_agent` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `basin.db.webhooks.search` ```ts theme={null} const rows = await corsair.basin.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `form_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `format` | `string` | equals, contains, startsWith, endsWith, in | | `trigger_when_spam` | `boolean` | equals | | `enabled` | `boolean` | equals | | `failure_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/basin/overview Form backend service for collecting submissions without writing server-side code. Use **Basin** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 26 typed API operations * 6 synced entities (`domains`, `forms`, `formViews`, `projects`, `submissions`, `webhooks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/basin ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/basin ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/basin ``` ```bash bun theme={null} bun add corsair @corsair-dev/basin ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { basin } from '@corsair-dev/basin'; export const corsair = createCorsair({ plugins: [ basin(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} basin() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'basin', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`domains.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.basin.api.domains.list({}); ``` **`forms.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.basin.api.forms.create({}); ``` See the full list on the [API](/plugins/basin/api) page. ## Query synced data Synced entities support `tenant.basin.db..search()` and `.list()`: `domains`, `forms`, `formViews`, `projects`, `submissions`, `webhooks`. See [Database](/plugins/basin/database) for filters and operators. ## What's next > **[API reference](/plugins/basin/api)** > > Every `basin.api.*` operation with input and output types. > **[Database](/plugins/basin/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/beaconstac/api API reference for Beaconstac: every `beaconstac.api.*` operation with input and output types. Every `beaconstac.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Analytics ### periodOverview `analytics.periodOverview` Period overview analytics for a product type **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.analytics.periodOverview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `number` | Yes | — | | `product_type` | `beacon \| nfc \| qr \| geofence` | Yes | — | | `from_timestamp` | `number` | Yes | — | | `to_timestamp` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `points` | `any[]` | No | — | | `columns` | `any[]` | No | — | *** ### productOverview `analytics.productOverview` Product overview analytics for a time interval **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.analytics.productOverview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `number` | Yes | — | | `product_type` | `beacon \| nfc \| qr \| geofence` | Yes | — | | `from_timestamp` | `number` | Yes | — | | `to_timestamp` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `points` | `any[]` | No | — | | `columns` | `any[]` | No | — | *** ## Bulk Qrcodes ### list `bulkQrcodes.list` List bulk QR Code collections **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.bulkQrcodes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `search` | `string` | No | — | | `ordering` | `string` | No | — | | `qr_data_type` | `number` | No | — | | `name__icontains` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > id?: number, > name?: string, > attributes?: any, > qr_type?: number, > qr_data_type?: number, > organization?: number, > storage_url?: string, > media?: number | null, > media_data?: any, > maintainer?: number | null, > created?: string, > updated?: string > }[] > ``` *** ## Organizations ### list `organizations.list` List organizations accessible to the authenticated account **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.organizations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > id?: number, > name?: string, > parent?: number | null, > reseller_access?: boolean, > whitelabel_access?: boolean, > custom_domain?: string | null, > cname?: string | null, > feature_permissions?: any, > domains?: any, > ga_code?: string | null, > fb_pixel_id?: string | null, > google_conversion_id?: string | null, > created?: string, > updated?: string > }[] > ``` *** ## Places ### create `places.create` Create a new place for location-based assets **Risk:** `write` ```ts theme={null} await corsair.beaconstac.api.places.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `address` | `string` | Yes | — | | `latitude` | `number` | Yes | — | | `longitude` | `number` | Yes | — | | `organization` | `number` | Yes | — | | `place_id` | `string` | No | — | | `business_color` | `string` | No | — | | `business_icon_url` | `string` | No | — | | `business_cover_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `organization` | `number` | No | — | | `latitude` | `number` | No | — | | `longitude` | `number` | No | — | | `place_id` | `string` | No | — | | `address` | `string` | No | — | | `beacons` | `any` | No | — | | `beacon_count` | `number` | No | — | | `default_place` | `boolean` | No | — | | `business_icon_url` | `string` | No | — | | `business_cover_url` | `string` | No | — | | `business_color` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | *** ### list `places.list` List places with filtering, search, and pagination **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.places.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `name` | `string` | No | — | | `search` | `string` | No | — | | `ordering` | `string` | No | — | | `name__icontains` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > id?: number, > name?: string, > organization?: number, > latitude?: number, > longitude?: number, > place_id?: string, > address?: string, > beacons?: any, > beacon_count?: number, > default_place?: boolean, > business_icon_url?: string, > business_cover_url?: string, > business_color?: string, > created?: string, > updated?: string > }[] > ``` *** ### update `places.update` Update a place name, address, or coordinates **Risk:** `write` ```ts theme={null} await corsair.beaconstac.api.places.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `organization` | `number` | Yes | — | | `address` | `string` | No | — | | `latitude` | `number` | No | — | | `longitude` | `number` | No | — | | `business_color` | `string` | No | — | | `business_icon_url` | `string` | No | — | | `business_cover_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `organization` | `number` | No | — | | `latitude` | `number` | No | — | | `longitude` | `number` | No | — | | `place_id` | `string` | No | — | | `address` | `string` | No | — | | `beacons` | `any` | No | — | | `beacon_count` | `number` | No | — | | `default_place` | `boolean` | No | — | | `business_icon_url` | `string` | No | — | | `business_cover_url` | `string` | No | — | | `business_color` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | *** ## Qrcodes ### delete `qrcodes.delete` Delete a QR Code by ID **Risk:** `destructive` ```ts theme={null} await corsair.beaconstac.api.qrcodes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | *** ### get `qrcodes.get` Retrieve a QR Code by ID **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.qrcodes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `qr_type` | `number` | No | — | | `url` | `string` | No | — | | `state` | `string` | No | — | | `organization` | `number` | No | — | | `place` | `number` | No | — | | `maintainer` | `number` | No | — | | `tags` | `number[]` | No | — | | `template` | `number` | No | — | | `campaign` | `any` | No | — | | `attributes` | `any` | No | — | | `fields_data` | `any` | No | — | | `view_limit` | `number` | No | — | | `domain` | `number` | No | — | | `location_enabled` | `boolean` | No | — | | `password` | `boolean` | No | — | | `meta` | `any` | No | — | | `additional_params` | `any` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | | `heartbeat` | `string` | No | — | *** ### update `qrcodes.update` Update a QR Code name, design, tags, or content **Risk:** `write` ```ts theme={null} await corsair.beaconstac.api.qrcodes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `qrcode_id` | `number` | Yes | — | | `meta` | `object` | No | — | | `name` | `string` | No | — | | `tags` | `number[]` | No | — | | `place` | `number` | No | — | | `qr_type` | `number` | No | — | | `campaign` | `object` | No | — | | `attributes` | `object` | No | — | | `fields_data` | `object` | No | — | | `organization` | `number` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **campaign full type** > > ```ts theme={null} > { > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` > **fields\_data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `qr_type` | `number` | No | — | | `url` | `string` | No | — | | `state` | `string` | No | — | | `organization` | `number` | No | — | | `place` | `number` | No | — | | `maintainer` | `number` | No | — | | `tags` | `number[]` | No | — | | `template` | `number` | No | — | | `campaign` | `any` | No | — | | `attributes` | `any` | No | — | | `fields_data` | `any` | No | — | | `view_limit` | `number` | No | — | | `domain` | `number` | No | — | | `location_enabled` | `boolean` | No | — | | `password` | `boolean` | No | — | | `meta` | `any` | No | — | | `additional_params` | `any` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | | `heartbeat` | `string` | No | — | *** ## Qr Templates ### create `qrTemplates.create` Create a reusable QR Code design template **Risk:** `write` ```ts theme={null} await corsair.beaconstac.api.qrTemplates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `organization` | `number` | Yes | — | | `meta` | `object` | No | — | | `margin` | `number` | No | — | | `default` | `boolean` | No | — | | `dotScale` | `number` | No | — | | `colorDark` | `string` | No | — | | `frameText` | `string` | No | — | | `logoImage` | `string` | No | — | | `logoScale` | `number` | No | — | | `colorLight` | `string` | No | — | | `frameColor` | `string` | No | — | | `frameStyle` | `string` | No | — | | `dataPattern` | `string` | No | — | | `eyeBallColor` | `string` | No | — | | `eyeBallShape` | `string` | No | — | | `gradientType` | `string` | No | — | | `eyeFrameColor` | `string` | No | — | | `eyeFrameShape` | `string` | No | — | | `frameTextColor` | `string` | No | — | | `backgroundColor` | `string` | No | — | | `backgroundImage` | `string` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `default` | `boolean` | No | — | | `organization` | `number` | No | — | | `maintainer` | `number` | No | — | | `meta` | `any` | No | — | | `margin` | `number` | No | — | | `dotScale` | `number` | No | — | | `dataPattern` | `string` | No | — | | `colorDark` | `string` | No | — | | `colorLight` | `string` | No | — | | `gradientType` | `string` | No | — | | `eyeBallShape` | `string` | No | — | | `eyeFrameShape` | `string` | No | — | | `logoImage` | `string` | No | — | | `backgroundImage` | `string` | No | — | | `frameStyle` | `string` | No | — | | `frameText` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | *** ### delete `qrTemplates.delete` Delete a QR Code template by ID **Risk:** `destructive` ```ts theme={null} await corsair.beaconstac.api.qrTemplates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | *** ### list `qrTemplates.list` List QR Code templates for an organization **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.qrTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `number` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `name__icontains` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > id?: number, > name?: string, > default?: boolean, > organization?: number, > maintainer?: number | null, > meta?: any, > margin?: number, > dotScale?: number, > dataPattern?: string, > colorDark?: string, > colorLight?: string, > gradientType?: string, > eyeBallShape?: string, > eyeFrameShape?: string, > logoImage?: string, > backgroundImage?: string, > frameStyle?: string, > frameText?: string, > created?: string, > updated?: string > }[] > ``` *** ## Tags ### create `tags.create` Create a tag for organizing QR Codes **Risk:** `write` ```ts theme={null} await corsair.beaconstac.api.tags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `organization` | `number` | Yes | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `organization` | `number` | No | — | | `maintainer` | `number` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | *** ### delete `tags.delete` Delete a tag by ID **Risk:** `destructive` ```ts theme={null} await corsair.beaconstac.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | *** ### list `tags.list` List tags with optional filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `ordering` | `string` | No | — | | `name__icontains` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string, > organization?: number, > maintainer?: number | null, > created?: string, > updated?: string > }[] > ``` *** ### update `tags.update` Update a tag name or color **Risk:** `write` ```ts theme={null} await corsair.beaconstac.api.tags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_id` | `number` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `organization` | `number` | No | — | | `maintainer` | `number` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | *** ## Users ### create `users.create` Create a user under an organization (Reseller+) **Risk:** `write` ```ts theme={null} await corsair.beaconstac.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `organization` | `number` | Yes | — | | `email` | `string` | No | — | | `password` | `string` | No | — | | `last_name` | `string` | No | — | | `first_name` | `string` | No | — | | `billing_email` | `string` | No | — | | `customer_plan` | `string` | No | — | | `profile_picture` | `string` | No | — | | `user_group` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `username` | `string` | No | — | | `user_group` | `string` | No | — | | `customer_plan` | `string` | No | — | | `subscription_state` | `string` | No | — | | `is_active` | `boolean` | No | — | | `stripe_id` | `string` | No | — | | `timezone` | `string` | No | — | | `organization` | `number` | No | — | | `last_login` | `string` | No | — | | `date_joined` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | *** ### get `users.get` Retrieve a user by ID **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `username` | `string` | No | — | | `user_group` | `string` | No | — | | `customer_plan` | `string` | No | — | | `subscription_state` | `string` | No | — | | `is_active` | `boolean` | No | — | | `stripe_id` | `string` | No | — | | `timezone` | `string` | No | — | | `organization` | `number` | No | — | | `last_login` | `string` | No | — | | `date_joined` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | *** ### list `users.list` List users with filtering, search, and pagination **Risk:** `read` ```ts theme={null} await corsair.beaconstac.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `search` | `string` | No | — | | `ordering` | `string` | No | — | | `email__exact` | `string` | No | — | | `organization` | `number` | No | — | | `customer_plan` | `string` | No | — | | `date_joined__gt` | `string` | No | — | | `date_joined__lt` | `string` | No | — | | `username__exact` | `string` | No | — | | `date_joined__gte` | `string` | No | — | | `date_joined__lte` | `string` | No | — | | `email__icontains` | `string` | No | — | | `last_name__exact` | `string` | No | — | | `first_name__exact` | `string` | No | — | | `subscription_state` | `string` | No | — | | `username__icontains` | `string` | No | — | | `last_name__icontains` | `string` | No | — | | `first_name__icontains` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > id?: number, > first_name?: string, > last_name?: string, > username?: string, > user_group?: string, > customer_plan?: string, > subscription_state?: string, > is_active?: boolean, > stripe_id?: string | null, > timezone?: string, > organization?: number, > last_login?: string | null, > date_joined?: string, > created?: string, > updated?: string > }[] > ``` *** ### update `users.update` Update a user profile or organization **Risk:** `write` ```ts theme={null} await corsair.beaconstac.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | | `last_name` | `string` | No | — | | `first_name` | `string` | No | — | | `organization` | `number` | No | — | | `profile_picture` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `username` | `string` | No | — | | `user_group` | `string` | No | — | | `customer_plan` | `string` | No | — | | `subscription_state` | `string` | No | — | | `is_active` | `boolean` | No | — | | `stripe_id` | `string` | No | — | | `timezone` | `string` | No | — | | `organization` | `number` | No | — | | `last_login` | `string` | No | — | | `date_joined` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/beaconstac/database Beaconstac local sync: searchable entities, `.search()` filters, and operators. The Beaconstac plugin syncs data locally. Use `corsair.beaconstac.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Bulk Qrcodes Path: `beaconstac.db.bulkQrcodes.search` ```ts theme={null} const rows = await corsair.beaconstac.db.bulkQrcodes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `qr_type` | `number` | equals, gt, gte, lt, lte, in | | `qr_data_type` | `number` | equals, gt, gte, lt, lte, in | | `organization` | `number` | equals, gt, gte, lt, lte, in | | `storage_url` | `string` | equals, contains, startsWith, endsWith, in | | `media` | `number` | equals, gt, gte, lt, lte, in | | `maintainer` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `beaconstac.db.organizations.search` ```ts theme={null} const rows = await corsair.beaconstac.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `parent` | `number` | equals, gt, gte, lt, lte, in | | `reseller_access` | `boolean` | equals | | `whitelabel_access` | `boolean` | equals | | `custom_domain` | `string` | equals, contains, startsWith, endsWith, in | | `cname` | `string` | equals, contains, startsWith, endsWith, in | | `ga_code` | `string` | equals, contains, startsWith, endsWith, in | | `fb_pixel_id` | `string` | equals, contains, startsWith, endsWith, in | | `google_conversion_id` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Places Path: `beaconstac.db.places.search` ```ts theme={null} const rows = await corsair.beaconstac.db.places.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `number` | equals, gt, gte, lt, lte, in | | `latitude` | `number` | equals, gt, gte, lt, lte, in | | `longitude` | `number` | equals, gt, gte, lt, lte, in | | `place_id` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `beacon_count` | `number` | equals, gt, gte, lt, lte, in | | `default_place` | `boolean` | equals | | `business_icon_url` | `string` | equals, contains, startsWith, endsWith, in | | `business_cover_url` | `string` | equals, contains, startsWith, endsWith, in | | `business_color` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Qrcodes Path: `beaconstac.db.qrcodes.search` ```ts theme={null} const rows = await corsair.beaconstac.db.qrcodes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `qr_type` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `number` | equals, gt, gte, lt, lte, in | | `place` | `number` | equals, gt, gte, lt, lte, in | | `maintainer` | `number` | equals, gt, gte, lt, lte, in | | `template` | `number` | equals, gt, gte, lt, lte, in | | `view_limit` | `number` | equals, gt, gte, lt, lte, in | | `domain` | `number` | equals, gt, gte, lt, lte, in | | `location_enabled` | `boolean` | equals | | `password` | `boolean` | equals | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `heartbeat` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Qr Templates Path: `beaconstac.db.qrTemplates.search` ```ts theme={null} const rows = await corsair.beaconstac.db.qrTemplates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `default` | `boolean` | equals | | `organization` | `number` | equals, gt, gte, lt, lte, in | | `maintainer` | `number` | equals, gt, gte, lt, lte, in | | `margin` | `number` | equals, gt, gte, lt, lte, in | | `dotScale` | `number` | equals, gt, gte, lt, lte, in | | `dataPattern` | `string` | equals, contains, startsWith, endsWith, in | | `colorDark` | `string` | equals, contains, startsWith, endsWith, in | | `colorLight` | `string` | equals, contains, startsWith, endsWith, in | | `gradientType` | `string` | equals, contains, startsWith, endsWith, in | | `eyeBallShape` | `string` | equals, contains, startsWith, endsWith, in | | `eyeFrameShape` | `string` | equals, contains, startsWith, endsWith, in | | `logoImage` | `string` | equals, contains, startsWith, endsWith, in | | `backgroundImage` | `string` | equals, contains, startsWith, endsWith, in | | `frameStyle` | `string` | equals, contains, startsWith, endsWith, in | | `frameText` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `beaconstac.db.tags.search` ```ts theme={null} const rows = await corsair.beaconstac.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `number` | equals, gt, gte, lt, lte, in | | `maintainer` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `beaconstac.db.users.search` ```ts theme={null} const rows = await corsair.beaconstac.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `user_group` | `string` | equals, contains, startsWith, endsWith, in | | `customer_plan` | `string` | equals, contains, startsWith, endsWith, in | | `subscription_state` | `string` | equals, contains, startsWith, endsWith, in | | `is_active` | `boolean` | equals | | `stripe_id` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `number` | equals, gt, gte, lt, lte, in | | `last_login` | `string` | equals, contains, startsWith, endsWith, in | | `date_joined` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/beaconstac/overview QR code and digital signage platform for contactless marketing and asset tracking. Use **Beaconstac** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 21 typed API operations * 7 synced entities (`bulkQrcodes`, `organizations`, `places`, `qrcodes`, `qrTemplates`, `tags`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/beaconstac ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/beaconstac ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/beaconstac ``` ```bash bun theme={null} bun add corsair @corsair-dev/beaconstac ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { beaconstac } from '@corsair-dev/beaconstac'; export const corsair = createCorsair({ plugins: [ beaconstac(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} beaconstac() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'beaconstac', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`analytics.periodOverview`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.beaconstac.api.analytics.periodOverview({}); ``` **`places.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.beaconstac.api.places.create({}); ``` See the full list on the [API](/plugins/beaconstac/api) page. ## Query synced data Synced entities support `tenant.beaconstac.db..search()` and `.list()`: `bulkQrcodes`, `organizations`, `places`, `qrcodes`, `qrTemplates`, `tags`, `users`. See [Database](/plugins/beaconstac/database) for filters and operators. ## What's next > **[API reference](/plugins/beaconstac/api)** > > Every `beaconstac.api.*` operation with input and output types. > **[Database](/plugins/beaconstac/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/beamer/api API reference for Beamer: every `beamer.api.*` operation with input and output types. Every `beamer.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Posts ### get `posts.get` Get Beamer posts **Risk:** `read` ```ts theme={null} await corsair.beamer.api.posts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `maxResults` | `number \| string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number | string, > date?: string, > dueDate?: string, > published?: boolean | true | false, > pinned?: boolean | true | false, > showInWidget?: boolean | true | false, > showInStandalone?: boolean | true | false, > category?: string, > boostedAnnouncement?: string, > translations?: { > title?: string, > content?: string, > contentHtml?: string, > language?: string, > category?: string, > linkUrl?: string | string[], > linkText?: string | string[], > images?: string[] > }[], > filter?: string, > filterUrl?: string, > autoOpen?: boolean | true | false, > editionDate?: string, > feedbackEnabled?: boolean | true | false, > reactionsEnabled?: boolean | true | false, > views?: number | string, > uniqueViews?: number | string, > clicks?: number | string, > feedbacks?: number | string, > positiveReactions?: number | string, > neutralReactions?: number | string, > negativeReactions?: number | string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/beamer/database Beamer local sync: searchable entities, `.search()` filters, and operators. The Beamer plugin syncs data locally. Use `corsair.beamer.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/beamer/overview Beamer plugin for Corsair Use **Beamer** through Corsair: one client, typed API calls. **What you get:** * 1 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/beamer ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/beamer ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/beamer ``` ```bash bun theme={null} bun add corsair @corsair-dev/beamer ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { beamer } from '@corsair-dev/beamer'; export const corsair = createCorsair({ plugins: [ beamer(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} beamer() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'beamer', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`posts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.beamer.api.posts.get({}); ``` **`posts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.beamer.api.posts.get({}); ``` See the full list on the [API](/plugins/beamer/api) page. ## What's next > **[API reference](/plugins/beamer/api)** > > Every `beamer.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/beeminder/api API reference for Beeminder: every `beeminder.api.*` operation with input and output types. Every `beeminder.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Charges ### create `charges.create` Create a charge against a Beeminder user. Use dryrun to preview. **Risk:** `write` ```ts theme={null} await corsair.beeminder.api.charges.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `note` | `string` | No | — | | `dryrun` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `note` | `string` | No | — | | `username` | `string` | Yes | — | *** ## Goals ### list `goals.list` Get all active goals for the user **Risk:** `read` ```ts theme={null} await corsair.beeminder.api.goals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emaciated` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > slug: string, > title?: string | null, > fineprint?: string | null, > yaxis?: string | null, > goaldate?: number | null, > goalval?: number | null, > rate?: number | null, > runits?: string | null, > svg_url?: string | null, > graph_url?: string | null, > thumb_url?: string | null, > autodata?: string | null, > goal_type?: string | null, > losedate?: number | null, > urgencykey?: string | null, > queued?: boolean | null, > secret?: boolean | null, > datapublic?: boolean | null, > datapoints?: { > id?: string | null, > timestamp?: number | null, > daystamp?: string | null, > value?: number | null, > comment?: string | null, > updated_at?: number | null, > requestid?: string | null, > origin?: string | null, > creator?: string | null, > is_dummy?: boolean | null, > is_initial?: boolean | null, > created_at?: string | number | null > }[] | null, > numpts?: number | null, > pledge?: number | null, > initday?: number | null, > initval?: number | null, > curday?: number | null, > curval?: number | null, > currate?: number | null, > lastday?: number | null, > yaw?: number | null, > dir?: number | null, > lane?: number | null, > mathishard?: tuple | null, > headsum?: string | null, > limsum?: string | null, > kyoom?: boolean | null, > odom?: boolean | null, > aggday?: string | null, > steppy?: boolean | null, > rosy?: boolean | null, > movingav?: boolean | null, > aura?: boolean | null, > frozen?: boolean | null, > won?: boolean | null, > lost?: boolean | null, > maxflux?: number | null, > contract?: { > amount?: number | null, > stepdown_at?: number | null > } | null, > road?: ( > tuple | tuple | tuple > )[] | null, > roadall?: ( > tuple | tuple | tuple | tuple > )[] | null, > fullroad?: tuple[] | null, > rah?: number | null, > delta?: number | null, > delta_text?: string | null, > safebuf?: number | null, > colorkey?: string | null, > colorhex?: string | null, > safebump?: number | null, > autoratchet?: number | null, > callback_url?: string | null, > description?: string | null, > graphsum?: string | null, > lanewidth?: number | null, > deadline?: number | null, > leadtime?: number | null, > alertstart?: number | null, > plotall?: boolean | null, > last_datapoint?: { > id?: string | null, > timestamp?: number | null, > daystamp?: string | null, > value?: number | null, > comment?: string | null, > updated_at?: number | null, > requestid?: string | null, > origin?: string | null, > creator?: string | null, > is_dummy?: boolean | null, > is_initial?: boolean | null, > created_at?: string | number | null > } | null, > integery?: boolean | null, > gunits?: string | null, > timey?: boolean | null, > hhmmformat?: boolean | null, > todayta?: boolean | null, > weekends_off?: boolean | null, > tmin?: string | null, > tmax?: string | null, > tags?: string[] | null, > archivedate?: number | null, > burner?: string | null, > updated_at?: number | null > }[] > ``` *** ### listArchived `goals.listArchived` Get all archived goals for the user **Risk:** `read` ```ts theme={null} await corsair.beeminder.api.goals.listArchived({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emaciated` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > slug: string, > title?: string | null, > fineprint?: string | null, > yaxis?: string | null, > goaldate?: number | null, > goalval?: number | null, > rate?: number | null, > runits?: string | null, > svg_url?: string | null, > graph_url?: string | null, > thumb_url?: string | null, > autodata?: string | null, > goal_type?: string | null, > losedate?: number | null, > urgencykey?: string | null, > queued?: boolean | null, > secret?: boolean | null, > datapublic?: boolean | null, > datapoints?: { > id?: string | null, > timestamp?: number | null, > daystamp?: string | null, > value?: number | null, > comment?: string | null, > updated_at?: number | null, > requestid?: string | null, > origin?: string | null, > creator?: string | null, > is_dummy?: boolean | null, > is_initial?: boolean | null, > created_at?: string | number | null > }[] | null, > numpts?: number | null, > pledge?: number | null, > initday?: number | null, > initval?: number | null, > curday?: number | null, > curval?: number | null, > currate?: number | null, > lastday?: number | null, > yaw?: number | null, > dir?: number | null, > lane?: number | null, > mathishard?: tuple | null, > headsum?: string | null, > limsum?: string | null, > kyoom?: boolean | null, > odom?: boolean | null, > aggday?: string | null, > steppy?: boolean | null, > rosy?: boolean | null, > movingav?: boolean | null, > aura?: boolean | null, > frozen?: boolean | null, > won?: boolean | null, > lost?: boolean | null, > maxflux?: number | null, > contract?: { > amount?: number | null, > stepdown_at?: number | null > } | null, > road?: ( > tuple | tuple | tuple > )[] | null, > roadall?: ( > tuple | tuple | tuple | tuple > )[] | null, > fullroad?: tuple[] | null, > rah?: number | null, > delta?: number | null, > delta_text?: string | null, > safebuf?: number | null, > colorkey?: string | null, > colorhex?: string | null, > safebump?: number | null, > autoratchet?: number | null, > callback_url?: string | null, > description?: string | null, > graphsum?: string | null, > lanewidth?: number | null, > deadline?: number | null, > leadtime?: number | null, > alertstart?: number | null, > plotall?: boolean | null, > last_datapoint?: { > id?: string | null, > timestamp?: number | null, > daystamp?: string | null, > value?: number | null, > comment?: string | null, > updated_at?: number | null, > requestid?: string | null, > origin?: string | null, > creator?: string | null, > is_dummy?: boolean | null, > is_initial?: boolean | null, > created_at?: string | number | null > } | null, > integery?: boolean | null, > gunits?: string | null, > timey?: boolean | null, > hhmmformat?: boolean | null, > todayta?: boolean | null, > weekends_off?: boolean | null, > tmin?: string | null, > tmax?: string | null, > tags?: string[] | null, > archivedate?: number | null, > burner?: string | null, > updated_at?: number | null > }[] > ``` *** ## User ### get `user.get` Get information about the authenticated user **Risk:** `read` ```ts theme={null} await corsair.beeminder.api.user.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `associations` | `boolean` | No | — | | `diff_since` | `number` | No | — | | `skinny` | `boolean` | No | — | | `emaciated` | `boolean` | No | — | | `datapoints_count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `timezone` | `string` | No | — | | `updated_at` | `number` | No | — | | `goals` | `object[]` | No | — | | `deleted_goals` | `object[]` | No | — | | `deadbeat` | `boolean` | No | — | | `urgency_load` | `number` | No | — | > **goals full type** > > ```ts theme={null} > ( > string | { > id?: string | null, > slug: string, > title?: string | null, > fineprint?: string | null, > yaxis?: string | null, > goaldate?: number | null, > goalval?: number | null, > rate?: number | null, > runits?: string | null, > svg_url?: string | null, > graph_url?: string | null, > thumb_url?: string | null, > autodata?: string | null, > goal_type?: string | null, > losedate?: number | null, > urgencykey?: string | null, > queued?: boolean | null, > secret?: boolean | null, > datapublic?: boolean | null, > datapoints?: { > id?: string | null, > timestamp?: number | null, > daystamp?: string | null, > value?: number | null, > comment?: string | null, > updated_at?: number | null, > requestid?: string | null, > origin?: string | null, > creator?: string | null, > is_dummy?: boolean | null, > is_initial?: boolean | null, > created_at?: string | number | null > }[] | null, > numpts?: number | null, > pledge?: number | null, > initday?: number | null, > initval?: number | null, > curday?: number | null, > curval?: number | null, > currate?: number | null, > lastday?: number | null, > yaw?: number | null, > dir?: number | null, > lane?: number | null, > mathishard?: tuple | null, > headsum?: string | null, > limsum?: string | null, > kyoom?: boolean | null, > odom?: boolean | null, > aggday?: string | null, > steppy?: boolean | null, > rosy?: boolean | null, > movingav?: boolean | null, > aura?: boolean | null, > frozen?: boolean | null, > won?: boolean | null, > lost?: boolean | null, > maxflux?: number | null, > contract?: { > amount?: number | null, > stepdown_at?: number | null > } | null, > road?: ( > tuple | tuple | tuple > )[] | null, > roadall?: ( > tuple | tuple | tuple | tuple > )[] | null, > fullroad?: tuple[] | null, > rah?: number | null, > delta?: number | null, > delta_text?: string | null, > safebuf?: number | null, > colorkey?: string | null, > colorhex?: string | null, > safebump?: number | null, > autoratchet?: number | null, > callback_url?: string | null, > description?: string | null, > graphsum?: string | null, > lanewidth?: number | null, > deadline?: number | null, > leadtime?: number | null, > alertstart?: number | null, > plotall?: boolean | null, > last_datapoint?: { > id?: string | null, > timestamp?: number | null, > daystamp?: string | null, > value?: number | null, > comment?: string | null, > updated_at?: number | null, > requestid?: string | null, > origin?: string | null, > creator?: string | null, > is_dummy?: boolean | null, > is_initial?: boolean | null, > created_at?: string | number | null > } | null, > integery?: boolean | null, > gunits?: string | null, > timey?: boolean | null, > hhmmformat?: boolean | null, > todayta?: boolean | null, > weekends_off?: boolean | null, > tmin?: string | null, > tmax?: string | null, > tags?: string[] | null, > archivedate?: number | null, > burner?: string | null, > updated_at?: number | null > } > )[] > ``` > **deleted\_goals full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/beeminder/database Beeminder local sync: searchable entities, `.search()` filters, and operators. The Beeminder plugin syncs data locally. Use `corsair.beeminder.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Charges Path: `beeminder.db.charges.search` ```ts theme={null} const rows = await corsair.beeminder.db.charges.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `note` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Goals Path: `beeminder.db.goals.search` ```ts theme={null} const rows = await corsair.beeminder.db.goals.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `fineprint` | `string` | equals, contains, startsWith, endsWith, in | | `yaxis` | `string` | equals, contains, startsWith, endsWith, in | | `goaldate` | `number` | equals, gt, gte, lt, lte, in | | `goalval` | `number` | equals, gt, gte, lt, lte, in | | `rate` | `number` | equals, gt, gte, lt, lte, in | | `runits` | `string` | equals, contains, startsWith, endsWith, in | | `svg_url` | `string` | equals, contains, startsWith, endsWith, in | | `graph_url` | `string` | equals, contains, startsWith, endsWith, in | | `thumb_url` | `string` | equals, contains, startsWith, endsWith, in | | `autodata` | `string` | equals, contains, startsWith, endsWith, in | | `goal_type` | `string` | equals, contains, startsWith, endsWith, in | | `losedate` | `number` | equals, gt, gte, lt, lte, in | | `urgencykey` | `string` | equals, contains, startsWith, endsWith, in | | `queued` | `boolean` | equals | | `secret` | `boolean` | equals | | `datapublic` | `boolean` | equals | | `numpts` | `number` | equals, gt, gte, lt, lte, in | | `pledge` | `number` | equals, gt, gte, lt, lte, in | | `initday` | `number` | equals, gt, gte, lt, lte, in | | `initval` | `number` | equals, gt, gte, lt, lte, in | | `curday` | `number` | equals, gt, gte, lt, lte, in | | `curval` | `number` | equals, gt, gte, lt, lte, in | | `currate` | `number` | equals, gt, gte, lt, lte, in | | `lastday` | `number` | equals, gt, gte, lt, lte, in | | `yaw` | `number` | equals, gt, gte, lt, lte, in | | `dir` | `number` | equals, gt, gte, lt, lte, in | | `lane` | `number` | equals, gt, gte, lt, lte, in | | `headsum` | `string` | equals, contains, startsWith, endsWith, in | | `limsum` | `string` | equals, contains, startsWith, endsWith, in | | `kyoom` | `boolean` | equals | | `odom` | `boolean` | equals | | `aggday` | `string` | equals, contains, startsWith, endsWith, in | | `steppy` | `boolean` | equals | | `rosy` | `boolean` | equals | | `movingav` | `boolean` | equals | | `aura` | `boolean` | equals | | `frozen` | `boolean` | equals | | `won` | `boolean` | equals | | `lost` | `boolean` | equals | | `maxflux` | `number` | equals, gt, gte, lt, lte, in | | `rah` | `number` | equals, gt, gte, lt, lte, in | | `delta` | `number` | equals, gt, gte, lt, lte, in | | `delta_text` | `string` | equals, contains, startsWith, endsWith, in | | `safebuf` | `number` | equals, gt, gte, lt, lte, in | | `colorkey` | `string` | equals, contains, startsWith, endsWith, in | | `colorhex` | `string` | equals, contains, startsWith, endsWith, in | | `safebump` | `number` | equals, gt, gte, lt, lte, in | | `autoratchet` | `number` | equals, gt, gte, lt, lte, in | | `callback_url` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `graphsum` | `string` | equals, contains, startsWith, endsWith, in | | `lanewidth` | `number` | equals, gt, gte, lt, lte, in | | `deadline` | `number` | equals, gt, gte, lt, lte, in | | `leadtime` | `number` | equals, gt, gte, lt, lte, in | | `alertstart` | `number` | equals, gt, gte, lt, lte, in | | `plotall` | `boolean` | equals | | `integery` | `boolean` | equals | | `gunits` | `string` | equals, contains, startsWith, endsWith, in | | `timey` | `boolean` | equals | | `hhmmformat` | `boolean` | equals | | `todayta` | `boolean` | equals | | `weekends_off` | `boolean` | equals | | `tmin` | `string` | equals, contains, startsWith, endsWith, in | | `tmax` | `string` | equals, contains, startsWith, endsWith, in | | `archivedate` | `number` | equals, gt, gte, lt, lte, in | | `burner` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## User Path: `beeminder.db.user.search` ```ts theme={null} const rows = await corsair.beeminder.db.user.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `number` | equals, gt, gte, lt, lte, in | | `deadbeat` | `boolean` | equals | | `urgency_load` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/beeminder/overview Goal-tracking app that uses commitment contracts to help you stick to habits. Use **Beeminder** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 3 synced entities (`charges`, `goals`, `user`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/beeminder ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/beeminder ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/beeminder ``` ```bash bun theme={null} bun add corsair @corsair-dev/beeminder ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { beeminder } from '@corsair-dev/beeminder'; export const corsair = createCorsair({ plugins: [ beeminder(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} beeminder() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Beeminder OAuth app. ```ts theme={null} beeminder({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'beeminder', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`goals.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.beeminder.api.goals.list({}); ``` **`charges.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.beeminder.api.charges.create({}); ``` See the full list on the [API](/plugins/beeminder/api) page. ## Query synced data Synced entities support `tenant.beeminder.db..search()` and `.list()`: `charges`, `goals`, `user`. See [Database](/plugins/beeminder/database) for filters and operators. ## What's next > **[API reference](/plugins/beeminder/api)** > > Every `beeminder.api.*` operation with input and output types. > **[Database](/plugins/beeminder/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/benchmarkemail/api API reference for BenchmarkEmail: every `benchmarkemail.api.*` operation with input and output types. Every `benchmarkemail.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### addRemoveInboxTestsFromSubAccount `account.addRemoveInboxTestsFromSubAccount` Add or remove inbox tests from a sub-account **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.addRemoveInboxTestsFromSubAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### changePassword `account.changePassword` Change the password for the client account **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.changePassword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### changeSecurityPIN `account.changeSecurityPIN` Change the security PIN for the client account **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.changeSecurityPIN({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### checkIfResponsive `account.checkIfResponsive` Check whether the client is responsive **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.checkIfResponsive({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### copyImageToSubAccount `account.copyImageToSubAccount` Copy an image to sub-accounts **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.copyImageToSubAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteLinkedAgencyAccount `account.deleteLinkedAgencyAccount` Delete a linked agency account **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.account.deleteLinkedAgencyAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disableSecurityPIN `account.disableSecurityPIN` Disable the security PIN for the client account **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.disableSecurityPIN({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### generateSupportTicket `account.generateSupportTicket` Generate a support ticket **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.generateSupportTicket({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getAccountSummary `account.getAccountSummary` Get the account summary including image storage **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getAccountSummary({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getAllConfirmedEmails `account.getAllConfirmedEmails` Retrieve all confirmed email addresses **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getAllConfirmedEmails({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getClientAccountSettings `account.getClientAccountSettings` Get client account settings **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getClientAccountSettings({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getClientDetails `account.getClientDetails` Get client details **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getClientDetails({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getClientFilterDomain `account.getClientFilterDomain` Get client filter domains **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getClientFilterDomain({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getClientPlanInformation `account.getClientPlanInformation` Get client plan information **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getClientPlanInformation({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getClientProfileDetails `account.getClientProfileDetails` Get client profile details **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getClientProfileDetails({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getClientsRatingRange `account.getClientsRatingRange` Get the clients rating range **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getClientsRatingRange({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getCommissionList `account.getCommissionList` Get the partner commission list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getCommissionList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getCommunityDomain `account.getCommunityDomain` Get the community domain name for the client **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getCommunityDomain({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getCurrentEmailAtTimeOfReset `account.getCurrentEmailAtTimeOfReset` Get the current email at the time of a reset **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getCurrentEmailAtTimeOfReset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `guid` | `string` | No | GUID for the reset request | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getDMARCList `account.getDMARCList` Retrieve the DMARC list for the client account **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getDMARCList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getHelpTopics `account.getHelpTopics` Retrieve the list of help topics **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getHelpTopics({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getLinkedAgencyAccountDetails `account.getLinkedAgencyAccountDetails` Get the details of a linked agency account **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getLinkedAgencyAccountDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getLinkedAgencyAccounts `account.getLinkedAgencyAccounts` Get the list of linked agency accounts **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getLinkedAgencyAccounts({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getListOfConfirmedEmails `account.getListOfConfirmedEmails` Retrieve the list of confirmed email addresses **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getListOfConfirmedEmails({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getNotification `account.getNotification` Get client notifications **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getNotification({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getPartnerProfileDetails `account.getPartnerProfileDetails` Get partner profile details **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getPartnerProfileDetails({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getReferralsLevel1List `account.getReferralsLevel1List` Get the level 1 referrals list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getReferralsLevel1List({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getReferralsList `account.getReferralsList` Retrieve the list of partner referrals **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getReferralsList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSubAccountBalance `account.getSubAccountBalance` Get a sub-account balance **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getSubAccountBalance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSubAccountDetails `account.getSubAccountDetails` Get sub-account details **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getSubAccountDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSubAccountHistory `account.getSubAccountHistory` Get sub-account history **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getSubAccountHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSubAccountHistoryDetails `account.getSubAccountHistoryDetails` Get sub-account history details **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getSubAccountHistoryDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `historyID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSubAccounts `account.getSubAccounts` Retrieve all sub-accounts **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getSubAccounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSubAccountsPlanList `account.getSubAccountsPlanList` Retrieve available plans for a sub-account **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getSubAccountsPlanList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getWebPageAdsDetail `account.getWebPageAdsDetail` Get web page ads details **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.getWebPageAdsDetail({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### linkAgencyAccount `account.linkAgencyAccount` Link an agency account **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.linkAgencyAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### loginRedirectUsingToken `account.loginRedirectUsingToken` Generate a login redirect token **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.loginRedirectUsingToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### patchUpdateClientSettings `account.patchUpdateClientSettings` Update client account settings **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.patchUpdateClientSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### resendConfirmEmail `account.resendConfirmEmail` Resend a confirm email **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.account.resendConfirmEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### saveSecurityPIN `account.saveSecurityPIN` Save the security PIN **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.saveSecurityPIN({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### saveWebsiteDomain `account.saveWebsiteDomain` Save the website domain **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.saveWebsiteDomain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### sendPINViaEmail `account.sendPINViaEmail` Send the security PIN via email **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.sendPINViaEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### sendResetEmail `account.sendResetEmail` Send a reset email **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.sendResetEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### sendSupportFeedback `account.sendSupportFeedback` Send support feedback **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.sendSupportFeedback({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### setResponsive `account.setResponsive` Set the responsive flag **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.setResponsive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### shareListsWithSubAccounts `account.shareListsWithSubAccounts` Share contact lists with sub-accounts **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.shareListsWithSubAccounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `clientIDs` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### updateEditProfile `account.updateEditProfile` Update the client profile **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.updateEditProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updateLinkedAgencyAccount `account.updateLinkedAgencyAccount` Update a linked agency account **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.updateLinkedAgencyAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updatePartnerProfile `account.updatePartnerProfile` Update the partner profile **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.updatePartnerProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updateResetEmail `account.updateResetEmail` Update or reset the account email **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.account.updateResetEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Archive ### addEmailToArchive `archive.addEmailToArchive` Add an email campaign to the archive page **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.archive.addEmailToArchive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteEmailFromArchive `archive.deleteEmailFromArchive` Delete an email from the archive **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.archive.deleteEmailFromArchive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getArchiveDomainName `archive.getArchiveDomainName` Get the archive domain name for the client **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.archive.getArchiveDomainName({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getArchiveEmailDetails `archive.getArchiveEmailDetails` Get the details of an archived email **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.archive.getArchiveEmailDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `archiveID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getArchiveEmails `archive.getArchiveEmails` Retrieve a list of emails from the archive **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.archive.getArchiveEmails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getArchiveHomeData `archive.getArchiveHomeData` Get archive home data for a domain and type **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.archive.getArchiveHomeData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getArchiveHomePage `archive.getArchiveHomePage` Get the archive home page **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.archive.getArchiveHomePage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getArchivePages `archive.getArchivePages` Retrieve the list of archive pages **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.archive.getArchivePages({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getDetailsAboutArchivePage `archive.getDetailsAboutArchivePage` Get details about the archive page **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.archive.getDetailsAboutArchivePage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getHTMLForArchiveNewsletter `archive.getHTMLForArchiveNewsletter` Get HTML content for an archive newsletter **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.archive.getHTMLForArchiveNewsletter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getHTMLForButton `archive.getHTMLForButton` Get HTML content for an archive button **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.archive.getHTMLForButton({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mode` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getImageForButton `archive.getImageForButton` Get the image archive button HTML **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.archive.getImageForButton({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mode` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updateArchiveHomePage `archive.updateArchiveHomePage` Update the archive home page **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.archive.updateArchiveHomePage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updateArchiveHomePageData `archive.updateArchiveHomePageData` Update archive home page data **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.archive.updateArchiveHomePageData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Automations ### addEmailInAutomation `automations.addEmailInAutomation` Add an email to an automation workflow **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.automations.addEmailInAutomation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `automationID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### copyEmailInAutomation `automations.copyEmailInAutomation` Create a copy of an automation email **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.automations.copyEmailInAutomation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `automationID` | `string` | Yes | — | | `automationDetailID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### createAutomationCopy `automations.createAutomationCopy` Create a copy of an existing automation **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.automations.createAutomationCopy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `automationID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteAutomation `automations.deleteAutomation` Delete an automation **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.automations.deleteAutomation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `automationID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteAutomationEmail `automations.deleteAutomationEmail` Delete an automation email from a workflow **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.automations.deleteAutomationEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `automationID` | `string` | Yes | — | | `automationDetailID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getAutomationDetails `automations.getAutomationDetails` Get the details of an automation **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.automations.getAutomationDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `automationID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getAutomationEmailDetails `automations.getAutomationEmailDetails` Get details for an automation email **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.automations.getAutomationEmailDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `automationID` | `string` | Yes | — | | `automationDetailID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getAutomationSummaryReport `automations.getAutomationSummaryReport` Get the summary report of an automation **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.automations.getAutomationSummaryReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `automationID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### updateEmailContentForAutomation `automations.updateEmailContentForAutomation` Update email content for an automation **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.automations.updateEmailContentForAutomation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `automationID` | `string` | Yes | — | | `automationDetailID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Contacts ### addContactToList `contacts.addContactToList` Add a new contact to a specific contact list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.addContactToList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### cleanContactList `contacts.cleanContactList` Clean a contact list by removing invalid or bounced addresses **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.cleanContactList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### compareContacts `contacts.compareContacts` Compare contacts across multiple contact lists **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.compareContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### copyBulkContacts `contacts.copyBulkContacts` Copy multiple contacts in bulk to target lists **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.copyBulkContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### copyContact `contacts.copyContact` Copy a contact to a specific list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.copyContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `contactID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### createSegmentCriteria `contacts.createSegmentCriteria` Create criteria for a contact segment **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.createSegmentCriteria({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segmentID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### createSegmentFromContactIDs `contacts.createSegmentFromContactIDs` Create a segment from a list of contact IDs **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.createSegmentFromContactIDs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### deleteContactFromAllListsByID `contacts.deleteContactFromAllListsByID` Delete a specific contact from all lists **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.contacts.deleteContactFromAllListsByID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `contactID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteContactFromList `contacts.deleteContactFromList` Delete a contact from a specific list **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.contacts.deleteContactFromList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `contactID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteContactFromSearch `contacts.deleteContactFromSearch` Delete a contact from the search contact page **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.contacts.deleteContactFromSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteContactsFromAllLists `contacts.deleteContactsFromAllLists` Delete selected contacts from all lists **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.contacts.deleteContactsFromAllLists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Search string to filter results | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteContactsFromCurrentLists `contacts.deleteContactsFromCurrentLists` Delete selected contacts from current lists **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.contacts.deleteContactsFromCurrentLists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Search string to filter results | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteSegment `contacts.deleteSegment` Delete a contact segment **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.contacts.deleteSegment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segmentID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteSegmentCriteria `contacts.deleteSegmentCriteria` Delete criteria from a segment **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.contacts.deleteSegmentCriteria({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segmentID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteTrashList `contacts.deleteTrashList` Delete all trash contacts from a list **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.contacts.deleteTrashList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getActiveContactCount `contacts.getActiveContactCount` Get the total count of all active contacts **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getActiveContactCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getCleanCount `contacts.getCleanCount` Get the clean count for a contact list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getCleanCount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getContactAuditHistory `contacts.getContactAuditHistory` Retrieve audit history for contacts in a list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getContactAuditHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getContactAuditHistoryDetail `contacts.getContactAuditHistoryDetail` Get detailed audit history for a batch and group of contact changes **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getContactAuditHistoryDetail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `batchID` | `string` | Yes | — | | `groupID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getContactDetails `contacts.getContactDetails` Retrieve detailed information for a specific contact **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getContactDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `contactID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### getContactImportStatus `contacts.getContactImportStatus` Get the status of contact import operations **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getContactImportStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getContactMergeList `contacts.getContactMergeList` Retrieve contact lists that can be merged with a list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getContactMergeList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### getContactsCount `contacts.getContactsCount` Get the count of contacts in specified lists and segments **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getContactsCount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | | `segmentIDs` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getDownloadSegmentData `contacts.getDownloadSegmentData` Download segment data **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getDownloadSegmentData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getFilteredContacts `contacts.getFilteredContacts` Fetch filtered and paginated contacts from a list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getFilteredContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | | `search` | `string` | No | Search string to filter results | | `filter` | `string` | No | Filter expression | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### getFilteredContactsWithExtraFields `contacts.getFilteredContactsWithExtraFields` Fetch filtered contacts with custom and extra fields **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getFilteredContactsWithExtraFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | | `search` | `string` | No | Search string to filter results | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### getNonContactCount `contacts.getNonContactCount` Get the count of non-contacts for campaigns **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getNonContactCount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter` | `string` | No | Filter expression | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getSegmentAutoGenerateName `contacts.getSegmentAutoGenerateName` Get an auto-generated segment name for a list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getSegmentAutoGenerateName({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSegmentByID `contacts.getSegmentByID` Retrieve a contact segment by ID **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getSegmentByID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segmentID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSegmentDetails `contacts.getSegmentDetails` Retrieve contact details from a segment **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getSegmentDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segmentID` | `string` | Yes | — | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | | `search` | `string` | No | Search string to filter results | | `sort` | `string` | No | Sorting parameter | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### getSegmentList `contacts.getSegmentList` Retrieve segment lists for a contact list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getSegmentList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### getSegments `contacts.getSegments` Retrieve a paginated list of contact segments **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getSegments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | | `search` | `string` | No | Search string to filter results | | `sort` | `string` | No | Sorting parameter | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getTrashCount `contacts.getTrashCount` Get the count of contacts in the trash **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getTrashCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getUniqueContactCount `contacts.getUniqueContactCount` Get the unique contact count **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.getUniqueContactCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### mergeContactsIntoExistingList `contacts.mergeContactsIntoExistingList` Merge contacts into an existing list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.mergeContactsIntoExistingList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### mergeContactsIntoNewList `contacts.mergeContactsIntoNewList` Merge contacts into a new list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.mergeContactsIntoNewList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### moveBulkContacts `contacts.moveBulkContacts` Move multiple contacts in bulk **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.moveBulkContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### moveContacts `contacts.moveContacts` Move contacts to a target list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.moveContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `targetListID` | `string` | Yes | — | | `contactIDs` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### moveContactToDoNotContactList `contacts.moveContactToDoNotContactList` Move a contact to the do-not-contact list **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.contacts.moveContactToDoNotContactList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `contactID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### resendEmails `contacts.resendEmails` Resend emails to contacts in a list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.resendEmails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### saveEmailAddress `contacts.saveEmailAddress` Save an email address to a contact list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.saveEmailAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### saveVerifiedEmailAddresses `contacts.saveVerifiedEmailAddresses` Save verified email addresses to a contact list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.saveVerifiedEmailAddresses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### searchContactDetailsByEmail `contacts.searchContactDetailsByEmail` Search contact details by email **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.contacts.searchContactDetailsByEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Search string to filter results | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### sendConfirmEmailVerification `contacts.sendConfirmEmailVerification` Send a confirm-email verification message **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.sendConfirmEmailVerification({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updateContactDetails `contacts.updateContactDetails` Update the details of a contact **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.updateContactDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `contactID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `contactID` | `string \| number` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | *** ### updateSegment `contacts.updateSegment` Update a contact segment **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.contacts.updateSegment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segmentID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Emails ### addEmailToCommunity `emails.addEmailToCommunity` Add an email campaign to the public community **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.emails.addEmailToCommunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### addOrUpdateScheme `emails.addOrUpdateScheme` Add or update a color scheme **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.emails.addOrUpdateScheme({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### copyExistingEmail `emails.copyExistingEmail` Copy an existing email campaign **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.emails.copyExistingEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `status` | `string` | No | — | *** ### deleteABSplitCampaign `emails.deleteABSplitCampaign` Delete an ABSplit campaign configuration from an email **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.emails.deleteABSplitCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteABTestEmail `emails.deleteABTestEmail` Move an AB test email to trash **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.emails.deleteABTestEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteEmailCampaign `emails.deleteEmailCampaign` Delete an email campaign **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.emails.deleteEmailCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getABSplitDetails `emails.getABSplitDetails` Get AB split test details for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getABSplitDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getABSplitResults `emails.getABSplitResults` Get the results of an AB split test **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getABSplitResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getABTests `emails.getABTests` Retrieve a list of AB tests **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getABTests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getBadgesList `emails.getBadgesList` Retrieve all available email badges **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getBadgesList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getCommunityCategory `emails.getCommunityCategory` List available community categories **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getCommunityCategory({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getCommunityEmailByID `emails.getCommunityEmailByID` Get a community email by ID **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getCommunityEmailByID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `status` | `string` | No | — | *** ### getEmailDetails `emails.getEmailDetails` Get the details of an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getEmailDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `status` | `string` | No | — | *** ### getEmailPreview `emails.getEmailPreview` Get the preview of an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getEmailPreview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `status` | `string` | No | — | *** ### getEmailRecipientCount `emails.getEmailRecipientCount` Get the recipient count for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getEmailRecipientCount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getEmails `emails.getEmails` Retrieve all email campaigns **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getEmails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | | `criteria` | `string` | No | Filter string for search results | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `status` | `string` | No | — | *** ### getEmailSpamCheck `emails.getEmailSpamCheck` Check the spam score for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getEmailSpamCheck({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getEmailTemplates `emails.getEmailTemplates` Retrieve email templates **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getEmailTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | | `criteria` | `string` | No | Filter string for search results | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getLayoutList `emails.getLayoutList` Get the email layout list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getLayoutList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getRSSHistoryByEmailID `emails.getRSSHistoryByEmailID` Get RSS history for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getRSSHistoryByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getScheme `emails.getScheme` Retrieve color schemes for email templates **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getScheme({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getTemplateByID `emails.getTemplateByID` Get an email template by ID **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getTemplateByID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getTemplateCategoryByID `emails.getTemplateCategoryByID` Get a template category by ID **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getTemplateCategoryByID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `categoryID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getTemplateCategoryList `emails.getTemplateCategoryList` Retrieve the template category list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.emails.getTemplateCategoryList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### initiateEmailScreenCapture `emails.initiateEmailScreenCapture` Initiate an email screen capture process **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.emails.initiateEmailScreenCapture({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### permanentlyDeleteEmailFromTrash `emails.permanentlyDeleteEmailFromTrash` Permanently delete an email from trash **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.emails.permanentlyDeleteEmailFromTrash({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### restoreEmailFromTrash `emails.restoreEmailFromTrash` Restore an email from trash **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.emails.restoreEmailFromTrash({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### scheduleEmailCampaign `emails.scheduleEmailCampaign` Schedule an email campaign **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.emails.scheduleEmailCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### shareTemplateToSubAccounts `emails.shareTemplateToSubAccounts` Share an email template with sub-accounts **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.emails.shareTemplateToSubAccounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updateEmailCampaign `emails.updateEmailCampaign` Update an email campaign **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.emails.updateEmailCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `status` | `string` | No | — | *** ## Integrations ### assignProductToList `integrations.assignProductToList` Assign a Shopify product to a list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.integrations.assignProductToList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### configureShopifyPurchaseList `integrations.configureShopifyPurchaseList` Configure the Shopify purchase list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.integrations.configureShopifyPurchaseList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### connectService `integrations.connectService` Connect a third-party service via OAuth URL **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.integrations.connectService({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteProductAssociation `integrations.deleteProductAssociation` Delete a Shopify product association **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.deleteProductAssociation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `productCode` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectEbayIntegration `integrations.disconnectEbayIntegration` Disconnect the eBay integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectEbayIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectEtsyIntegration `integrations.disconnectEtsyIntegration` Disconnect the Etsy integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectEtsyIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectEventbriteIntegration `integrations.disconnectEventbriteIntegration` Disconnect the Eventbrite integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectEventbriteIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectFacebookEvents `integrations.disconnectFacebookEvents` Disconnect the Facebook Events integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectFacebookEvents({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectFacebookIntegration `integrations.disconnectFacebookIntegration` Disconnect the Facebook integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectFacebookIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectInstagramIntegration `integrations.disconnectInstagramIntegration` Disconnect the Instagram integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectInstagramIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectLinkedInIntegration `integrations.disconnectLinkedInIntegration` Disconnect the LinkedIn integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectLinkedInIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectPinterestConnection `integrations.disconnectPinterestConnection` Disconnect the Pinterest integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectPinterestConnection({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectSalesforceIntegration `integrations.disconnectSalesforceIntegration` Disconnect the Salesforce integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectSalesforceIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectShopify `integrations.disconnectShopify` Disconnect the Shopify integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectShopify({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### disconnectTwitterIntegration `integrations.disconnectTwitterIntegration` Disconnect the Twitter integration **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.disconnectTwitterIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getContactListsForShopify `integrations.getContactListsForShopify` Get Shopify integration contact lists **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getContactListsForShopify({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getDigiohUsername `integrations.getDigiohUsername` Get the Digioh username **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getDigiohUsername({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getEbaySellerID `integrations.getEbaySellerID` Get the eBay seller ID **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getEbaySellerID({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getEbaySiteList `integrations.getEbaySiteList` Get the eBay site list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getEbaySiteList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getEtsyStoreName `integrations.getEtsyStoreName` Get the connected Etsy store name **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getEtsyStoreName({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getEventbriteUsername `integrations.getEventbriteUsername` Get the Eventbrite username **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getEventbriteUsername({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getFacebookAccountHolder `integrations.getFacebookAccountHolder` Get the Facebook account holder **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getFacebookAccountHolder({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getFacebookAccountName `integrations.getFacebookAccountName` Get the Facebook account name **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getFacebookAccountName({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getIntegrationAuthURL `integrations.getIntegrationAuthURL` Get the OAuth authorization URL for a service **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getIntegrationAuthURL({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getIntegrationConnectionList `integrations.getIntegrationConnectionList` Get the editor integration connection list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getIntegrationConnectionList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getLinkedInToken `integrations.getLinkedInToken` Get LinkedIn integration token information **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getLinkedInToken({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getPaypalLink `integrations.getPaypalLink` Get the PayPal integration link for a list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getPaypalLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactMasterID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getPaypalLists `integrations.getPaypalLists` Get contact lists formatted for PayPal **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getPaypalLists({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getPinterestUsername `integrations.getPinterestUsername` Get the Pinterest username **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getPinterestUsername({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSalesforceStatus `integrations.getSalesforceStatus` Get the Salesforce integration status **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getSalesforceStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getShopifyProductGrid `integrations.getShopifyProductGrid` Get the Shopify product list in tabular format **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getShopifyProductGrid({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getShopifyProducts `integrations.getShopifyProducts` Get the list of Shopify products **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getShopifyProducts({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getTwitterLogin `integrations.getTwitterLogin` Get the Twitter login status **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getTwitterLogin({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getUnbounceLink `integrations.getUnbounceLink` Get the Unbounce integration URL for a list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getUnbounceLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactMasterID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getUnbounceLists `integrations.getUnbounceLists` Get Unbounce contact lists **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.getUnbounceLists({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### logOutTwitterTweets `integrations.logOutTwitterTweets` Log out of Twitter Tweets **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.integrations.logOutTwitterTweets({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testEbayIntegration `integrations.testEbayIntegration` Test the eBay integration **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testEbayIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testEtsyIntegration `integrations.testEtsyIntegration` Test the Etsy integration **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testEtsyIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testEventbriteIntegration `integrations.testEventbriteIntegration` Test the Eventbrite integration **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testEventbriteIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testFacebookEventsIntegration `integrations.testFacebookEventsIntegration` Test the Facebook Events integration **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testFacebookEventsIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testFacebookIntegration `integrations.testFacebookIntegration` Test the Facebook integration **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testFacebookIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testLinkedInConnection `integrations.testLinkedInConnection` Test the LinkedIn connection **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testLinkedInConnection({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testPinterestIntegration `integrations.testPinterestIntegration` Test the Pinterest integration **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testPinterestIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testSalesforceIntegration `integrations.testSalesforceIntegration` Test the Salesforce integration **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testSalesforceIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testTwitterIntegration `integrations.testTwitterIntegration` Test the Twitter integration **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testTwitterIntegration({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### testTwitterTweets `integrations.testTwitterTweets` Test Twitter Tweets **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.integrations.testTwitterTweets({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Lists ### createContactList `lists.createContactList` Create a new contact list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.lists.createContactList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### deleteContactList `lists.deleteContactList` Delete a contact list **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.lists.deleteContactList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteList `lists.deleteList` Delete one or more contact lists **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.lists.deleteList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getContactListDeepView `lists.getContactListDeepView` Fetch a deep view of contact lists **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.lists.getContactListDeepView({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### getContactListDetails `lists.getContactListDetails` Fetch detailed information for a contact list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.lists.getContactListDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### getContactListFieldNames `lists.getContactListFieldNames` Retrieve field names and attributes for a contact list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.lists.getContactListFieldNames({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getContactLists `lists.getContactLists` Retrieve all contact lists **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.lists.getContactLists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ### getContactListSummary `lists.getContactListSummary` Get the summary of a contact list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.lists.getContactListSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getDeleteListCheck `lists.getDeleteListCheck` Check whether contact lists can be deleted **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.lists.getDeleteListCheck({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getListUploadTerms `lists.getListUploadTerms` Get the terms for contact list uploads **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.lists.getListUploadTerms({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### restoreTrashList `lists.restoreTrashList` Restore a trash list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.lists.restoreTrashList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listIDs` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updateContactList `lists.updateContactList` Update a contact list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.lists.updateContactList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string \| number` | No | — | | `name` | `string` | No | — | | `totalContacts` | `number` | No | — | *** ## Media ### createInbox `media.createInbox` Create a new inbox for email testing **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.media.createInbox({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteImage `media.deleteImage` Delete an image **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.media.deleteImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteInbox `media.deleteInbox` Delete an inbox **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.media.deleteInbox({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteVideo `media.deleteVideo` Delete a video **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.media.deleteVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getGiphyImages `media.getGiphyImages` Get the list of Giphy images **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.media.getGiphyImages({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getImageDetails `media.getImageDetails` Get the details of an image **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.media.getImageDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getImages `media.getImages` Retrieve a list of images **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.media.getImages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getInboxDetailResult `media.getInboxDetailResult` Get inbox detail test statistics **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.media.getInboxDetailResult({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getInboxList `media.getInboxList` Retrieve the inbox list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.media.getInboxList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getInboxMasterResult `media.getInboxMasterResult` Get an inbox master result **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.media.getInboxMasterResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getVideoDetails `media.getVideoDetails` Get the details of a video **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.media.getVideoDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### shareVideo `media.shareVideo` Share a video **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.media.shareVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### uploadVideo `media.uploadVideo` Upload a video **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.media.uploadVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Polls ### copyPoll `polls.copyPoll` Copy an existing poll **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.polls.copyPoll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pollID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### createPoll `polls.createPoll` Create a new poll **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.polls.createPoll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deletePoll `polls.deletePoll` Delete a poll **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.polls.deletePoll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pollID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getPollDetails `polls.getPollDetails` Retrieve the details of a poll **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.polls.getPollDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pollID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getPollPreview `polls.getPollPreview` Get a preview of a poll **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.polls.getPollPreview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pollID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getPollResponseReport `polls.getPollResponseReport` Retrieve the response report of a poll **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.polls.getPollResponseReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pollID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getPolls `polls.getPolls` Retrieve a list of polls **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.polls.getPolls({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updatePoll `polls.updatePoll` Update a poll **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.polls.updatePoll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pollID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Reports ### downloadContactReport `reports.downloadContactReport` Download the contact list report **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.downloadContactReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getABTestReport `reports.getABTestReport` Retrieve AB split test reports **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getABTestReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getAbuseCampaignReportByEmailID `reports.getAbuseCampaignReportByEmailID` Get the abuse campaign report for an email **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getAbuseCampaignReportByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getAbuseReport `reports.getAbuseReport` Get the abuse report with complaint statistics **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getAbuseReport({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getBouncesReportByEmailID `reports.getBouncesReportByEmailID` Get the bounces report for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getBouncesReportByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getCampaignEngagementList `reports.getCampaignEngagementList` Retrieve campaign engagement statistics **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getCampaignEngagementList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getCampaignHistoryByEmailID `reports.getCampaignHistoryByEmailID` Get campaign history for an email **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getCampaignHistoryByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getClickContactCount `reports.getClickContactCount` Get the click contact count for campaigns **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getClickContactCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getClickHeatMapByEmailID `reports.getClickHeatMapByEmailID` Get the click heatmap report for an email **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getClickHeatMapByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getClickPerformanceByEmailID `reports.getClickPerformanceByEmailID` Get click performance for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getClickPerformanceByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getClickPerformanceDetailsByEmail `reports.getClickPerformanceDetailsByEmail` Get click performance details for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getClickPerformanceDetailsByEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getClicksReportByEmailID `reports.getClicksReportByEmailID` Get the clicks report for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getClicksReportByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getClickURLContactCount `reports.getClickURLContactCount` Get the click URL contact count of engagement metrics **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getClickURLContactCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getContactReportHistory `reports.getContactReportHistory` Get engagement history for a contact by email address **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getContactReportHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getDownloadReport `reports.getDownloadReport` Get the download report for a contact list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.reports.getDownloadReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getEmailOpensByCountryRegion `reports.getEmailOpensByCountryRegion` Get email opens by country and region **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getEmailOpensByCountryRegion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `country` | `string` | Yes | — | | `region` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getEmailReport `reports.getEmailReport` Get email campaign reports **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getEmailReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getEmailReportForwards `reports.getEmailReportForwards` Get the forwards report for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getEmailReportForwards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getForwardsReportByEmailID `reports.getForwardsReportByEmailID` Get the forwards report for an email campaign by ID **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getForwardsReportByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getLinkDetailByEmailID `reports.getLinkDetailByEmailID` Get the link detail report for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getLinkDetailByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getOpenContactCount `reports.getOpenContactCount` Get the count of contacts who opened campaigns **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getOpenContactCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getOpensHourlyReportByEmail `reports.getOpensHourlyReportByEmail` Get the hourly opens report for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getOpensHourlyReportByEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getOpensLocationReport `reports.getOpensLocationReport` Get the opens location report for a campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getOpensLocationReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getOpensLocationReportByEmail `reports.getOpensLocationReportByEmail` Get opens for an email from a specific country **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getOpensLocationReportByEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `countryCode` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getOpensReport `reports.getOpensReport` Get the opens report for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getOpensReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getReportDetailsByABTest `reports.getReportDetailsByABTest` Get report details for an AB split test **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getReportDetailsByABTest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `abID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getReportDetailsByEmailID `reports.getReportDetailsByEmailID` Get the detailed report summary for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getReportDetailsByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getReportDownload `reports.getReportDownload` Download an email campaign report by type **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getReportDownload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `reportType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getReportsForAutoresponders `reports.getReportsForAutoresponders` Get reports for autoresponders **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getReportsForAutoresponders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getSaveAsList `reports.getSaveAsList` Get the save-as-list data **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getSaveAsList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSocialPerformanceReport `reports.getSocialPerformanceReport` Get the social performance report for a campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getSocialPerformanceReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getUnopensReport `reports.getUnopensReport` Get the unopens report for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getUnopensReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getUnopensReportByEmailID `reports.getUnopensReportByEmailID` Get unopens for an email campaign by ID **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getUnopensReportByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getUnsubscribeReportByEmailID `reports.getUnsubscribeReportByEmailID` Get the unsubscribe report for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getUnsubscribeReportByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getURLEngagementList `reports.getURLEngagementList` Retrieve URL engagement statistics **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getURLEngagementList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### getURLListByEmailID `reports.getURLListByEmailID` Get the URL list for an email campaign **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.reports.getURLListByEmailID({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `opens` | `number` | No | — | | `clicks` | `number` | No | — | | `bounces` | `number` | No | — | *** ### updateListCompilationDetails `reports.updateListCompilationDetails` Update list compilation details **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.reports.updateListCompilationDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Signup Forms ### copySignupForm `signupForms.copySignupForm` Copy an existing signup form **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.copySignupForm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### createSignupForm `signupForms.createSignupForm` Create a new signup form **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.createSignupForm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getHTMLSignupForm `signupForms.getHTMLSignupForm` Get the HTML embed code for a signup form **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getHTMLSignupForm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listBuilderID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getMagentoHTMLDropdown `signupForms.getMagentoHTMLDropdown` Get the Magento signup form dropdown HTML **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getMagentoHTMLDropdown({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getMagentoHTMLSelected `signupForms.getMagentoHTMLSelected` Get Magento HTML for a selected signup form **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getMagentoHTMLSelected({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listBuilderID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSignupFormButtonCode `signupForms.getSignupFormButtonCode` Get the code for the signup form button **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getSignupFormButtonCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSignupFormContactFields `signupForms.getSignupFormContactFields` Get the contact fields of a signup form **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getSignupFormContactFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSignupFormDetails `signupForms.getSignupFormDetails` Get the details of a signup form **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getSignupFormDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSignupFormForMagento `signupForms.getSignupFormForMagento` Get signup form data for Magento **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getSignupFormForMagento({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSignupFormForUnbounce `signupForms.getSignupFormForUnbounce` Get signup form data for Unbounce **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getSignupFormForUnbounce({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSignupFormLink `signupForms.getSignupFormLink` Get the public link URL for a signup form **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getSignupFormLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSignupFormList `signupForms.getSignupFormList` Retrieve all signup forms **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getSignupFormList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSignupFormsForContactList `signupForms.getSignupFormsForContactList` Get signup forms for a contact list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getSignupFormsForContactList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSignupFormTumbler `signupForms.getSignupFormTumbler` Get signup form Tumbler parameters **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getSignupFormTumbler({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getTemplatesForSignupFormClassic `signupForms.getTemplatesForSignupFormClassic` Get templates for classic signup forms **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getTemplatesForSignupFormClassic({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getTumblerLists `signupForms.getTumblerLists` Get Tumbler signup form lists **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.getTumblerLists({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### sendTestEmailForSignupForm `signupForms.sendTestEmailForSignupForm` Send a test email for a signup form **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.signupForms.sendTestEmailForSignupForm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Surveys ### deleteSurvey `surveys.deleteSurvey` Delete a survey **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.surveys.deleteSurvey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyDetails `surveys.getSurveyDetails` Retrieve the details of a survey **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyFullReport `surveys.getSurveyFullReport` Retrieve the full report of a survey **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyFullReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `surveyID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyIndividualQuestionResult `surveys.getSurveyIndividualQuestionResult` Get individual question results for a survey respondent **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyIndividualQuestionResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `surveyID` | `string` | Yes | — | | `emailID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyIndividualResults `surveys.getSurveyIndividualResults` Retrieve paginated individual survey results **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyIndividualResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `surveyID` | `string` | Yes | — | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyReportAnswerComment `surveys.getSurveyReportAnswerComment` Retrieve comment answers from a survey report **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyReportAnswerComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `surveyID` | `string` | Yes | — | | `questionID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyReportAnswerOther `surveys.getSurveyReportAnswerOther` Retrieve other answers from a survey report **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyReportAnswerOther({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `surveyID` | `string` | Yes | — | | `questionID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyReportAnswerText `surveys.getSurveyReportAnswerText` Retrieve text answers from a survey report **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyReportAnswerText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `surveyID` | `string` | Yes | — | | `questionID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyReportDetail `surveys.getSurveyReportDetail` Get the report detail of a survey **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyReportDetail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `surveyID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyReportList `surveys.getSurveyReportList` Retrieve a paginated list of survey reports **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyReportList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number for paginated results | | `pageSize` | `number` | No | Number of results per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getSurveyTemplateList `surveys.getSurveyTemplateList` Retrieve the list of survey templates **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.surveys.getSurveyTemplateList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updateSurveyStatus `surveys.updateSurveyStatus` Update the status of a survey **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.surveys.updateSurveyStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ## Webhooks ### createWebhook `webhooks.createWebhook` Create a webhook for a contact list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.webhooks.createWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### deleteWebhook `webhooks.deleteWebhook` Delete a webhook from a contact list **Risk:** `destructive` ```ts theme={null} await corsair.benchmarkemail.api.webhooks.deleteWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### getWebhooks `webhooks.getWebhooks` Retrieve all webhooks for a contact list **Risk:** `read` ```ts theme={null} await corsair.benchmarkemail.api.webhooks.getWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** ### updateWebhook `webhooks.updateWebhook` Update a webhook for a contact list **Risk:** `write` ```ts theme={null} await corsair.benchmarkemail.api.webhooks.updateWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listID` | `string` | Yes | — | | `id` | `string` | Yes | — | | `data` | `object` | No | Request body fields for the target route | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number` | No | — | | `message` | `string` | No | — | | `total` | `number` | No | — | | `count` | `number` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/benchmarkemail/database BenchmarkEmail local sync: searchable entities, `.search()` filters, and operators. The BenchmarkEmail plugin syncs data locally. Use `corsair.benchmarkemail.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Campaigns Path: `benchmarkemail.db.campaigns.search` ```ts theme={null} const rows = await corsair.benchmarkemail.db.campaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contact Lists Path: `benchmarkemail.db.contactLists.search` ```ts theme={null} const rows = await corsair.benchmarkemail.db.contactLists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `totalContacts` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `benchmarkemail.db.contacts.search` ```ts theme={null} const rows = await corsair.benchmarkemail.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `listID` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/benchmarkemail/overview BenchmarkEmail plugin for Corsair Use **BenchmarkEmail** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 298 typed API operations * 3 synced entities (`campaigns`, `contactLists`, `contacts`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/benchmarkemail ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/benchmarkemail ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/benchmarkemail ``` ```bash bun theme={null} bun add corsair @corsair-dev/benchmarkemail ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { benchmarkemail } from '@corsair-dev/benchmarkemail'; export const corsair = createCorsair({ plugins: [ benchmarkemail(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} benchmarkemail() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'benchmarkemail', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.checkIfResponsive`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.benchmarkemail.api.account.checkIfResponsive({}); ``` **`account.addRemoveInboxTestsFromSubAccount`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.benchmarkemail.api.account.addRemoveInboxTestsFromSubAccount({}); ``` See the full list on the [API](/plugins/benchmarkemail/api) page. ## Query synced data Synced entities support `tenant.benchmarkemail.db..search()` and `.list()`: `campaigns`, `contactLists`, `contacts`. See [Database](/plugins/benchmarkemail/database) for filters and operators. ## What's next > **[API reference](/plugins/benchmarkemail/api)** > > Every `benchmarkemail.api.*` operation with input and output types. > **[Database](/plugins/benchmarkemail/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Database Source: https://docs.corsair.dev/plugins/benzinga/database Benzinga local sync: searchable entities, `.search()` filters, and operators. The Benzinga plugin syncs data locally. Use `corsair.benzinga.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Conference Calls Path: `benzinga.db.conferenceCalls.search` ```ts theme={null} const rows = await corsair.benzinga.db.conferenceCalls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `access_code` | `string` | equals, contains, startsWith, endsWith, in | | `confirmed` | `boolean` | equals | | `cusip` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `exchange` | `string` | equals, contains, startsWith, endsWith, in | | `importance` | `number` | equals, gt, gte, lt, lte, in | | `international_num` | `string` | equals, contains, startsWith, endsWith, in | | `isin` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `period` | `string` | equals, contains, startsWith, endsWith, in | | `period_year` | `number` | equals, gt, gte, lt, lte, in | | `phone_num` | `string` | equals, contains, startsWith, endsWith, in | | `reservation_num` | `string` | equals, contains, startsWith, endsWith, in | | `start_time` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | | `webcast_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Consensus Ratings Path: `benzinga.db.consensusRatings.search` ```ts theme={null} const rows = await corsair.benzinga.db.consensusRatings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `aggregate_type` | `string` | equals, contains, startsWith, endsWith, in | | `consensus_price_target` | `number` | equals, gt, gte, lt, lte, in | | `consensus_rating` | `string` | equals, contains, startsWith, endsWith, in | | `consensus_rating_val` | `number` | equals, gt, gte, lt, lte, in | | `high_price_target` | `number` | equals, gt, gte, lt, lte, in | | `low_price_target` | `number` | equals, gt, gte, lt, lte, in | | `total_analyst_count` | `number` | equals, gt, gte, lt, lte, in | | `unique_analyst_count` | `number` | equals, gt, gte, lt, lte, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Dividends Path: `benzinga.db.dividends.search` ```ts theme={null} const rows = await corsair.benzinga.db.dividends.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `confirmed` | `boolean` | equals | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `cusip` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `dividend` | `string` | equals, contains, startsWith, endsWith, in | | `dividend_prior` | `string` | equals, contains, startsWith, endsWith, in | | `dividend_type` | `string` | equals, contains, startsWith, endsWith, in | | `dividend_yield` | `string` | equals, contains, startsWith, endsWith, in | | `end_regular_dividend` | `boolean` | equals | | `ex_dividend_date` | `string` | equals, contains, startsWith, endsWith, in | | `exchange` | `string` | equals, contains, startsWith, endsWith, in | | `frequency` | `number` | equals, gt, gte, lt, lte, in | | `importance` | `number` | equals, gt, gte, lt, lte, in | | `isin` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `payable_date` | `string` | equals, contains, startsWith, endsWith, in | | `period` | `string` | equals, contains, startsWith, endsWith, in | | `record_date` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | | `year` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Earnings Path: `benzinga.db.earnings.search` ```ts theme={null} const rows = await corsair.benzinga.db.earnings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `cusip` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `date_confirmed` | `number` | equals, gt, gte, lt, lte, in | | `eps` | `string` | equals, contains, startsWith, endsWith, in | | `eps_est` | `string` | equals, contains, startsWith, endsWith, in | | `eps_prior` | `string` | equals, contains, startsWith, endsWith, in | | `eps_surprise` | `string` | equals, contains, startsWith, endsWith, in | | `eps_surprise_percent` | `string` | equals, contains, startsWith, endsWith, in | | `eps_type` | `string` | equals, contains, startsWith, endsWith, in | | `exchange` | `string` | equals, contains, startsWith, endsWith, in | | `importance` | `number` | equals, gt, gte, lt, lte, in | | `isin` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `period` | `string` | equals, contains, startsWith, endsWith, in | | `period_year` | `number` | equals, gt, gte, lt, lte, in | | `revenue` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_est` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_prior` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_surprise` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_surprise_percent` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_type` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Economics Path: `benzinga.db.economics.search` ```ts theme={null} const rows = await corsair.benzinga.db.economics.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `actual` | `string` | equals, contains, startsWith, endsWith, in | | `actual_t` | `string` | equals, contains, startsWith, endsWith, in | | `confirmed` | `boolean` | equals | | `consensus` | `string` | equals, contains, startsWith, endsWith, in | | `consensus_t` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `event_category` | `string` | equals, contains, startsWith, endsWith, in | | `event_name` | `string` | equals, contains, startsWith, endsWith, in | | `event_period` | `string` | equals, contains, startsWith, endsWith, in | | `importance` | `number` | equals, gt, gte, lt, lte, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `period_year` | `number` | equals, gt, gte, lt, lte, in | | `prior` | `string` | equals, contains, startsWith, endsWith, in | | `prior_t` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Guidance Path: `benzinga.db.guidance.search` ```ts theme={null} const rows = await corsair.benzinga.db.guidance.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `confirmed` | `boolean` | equals | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `cusip` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `eps_guidance_est` | `string` | equals, contains, startsWith, endsWith, in | | `eps_guidance_max` | `string` | equals, contains, startsWith, endsWith, in | | `eps_guidance_min` | `string` | equals, contains, startsWith, endsWith, in | | `eps_guidance_prior_max` | `string` | equals, contains, startsWith, endsWith, in | | `eps_guidance_prior_min` | `string` | equals, contains, startsWith, endsWith, in | | `eps_type` | `string` | equals, contains, startsWith, endsWith, in | | `exchange` | `string` | equals, contains, startsWith, endsWith, in | | `importance` | `number` | equals, gt, gte, lt, lte, in | | `is_primary` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `period` | `string` | equals, contains, startsWith, endsWith, in | | `period_year` | `number` | equals, gt, gte, lt, lte, in | | `prelim` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_guidance_est` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_guidance_max` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_guidance_min` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_guidance_prior_max` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_guidance_prior_min` | `string` | equals, contains, startsWith, endsWith, in | | `revenue_type` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Ipos Path: `benzinga.db.ipos.search` ```ts theme={null} const rows = await corsair.benzinga.db.ipos.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `cusip` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `deal_status` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `exchange` | `string` | equals, contains, startsWith, endsWith, in | | `initial_filing_date` | `string` | equals, contains, startsWith, endsWith, in | | `insider_lockup_date` | `string` | equals, contains, startsWith, endsWith, in | | `insider_lockup_days` | `number` | equals, gt, gte, lt, lte, in | | `ipo_type` | `string` | equals, contains, startsWith, endsWith, in | | `last_yr_income` | `number` | equals, gt, gte, lt, lte, in | | `last_yr_income_year` | `number` | equals, gt, gte, lt, lte, in | | `last_yr_revenue` | `number` | equals, gt, gte, lt, lte, in | | `last_yr_revenue_year` | `number` | equals, gt, gte, lt, lte, in | | `market_cap_at_offer` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `offering_shares` | `number` | equals, gt, gte, lt, lte, in | | `offering_shares_ord_adr` | `number` | equals, gt, gte, lt, lte, in | | `offering_value` | `number` | equals, gt, gte, lt, lte, in | | `open_date_verified` | `boolean` | equals | | `ord_shares_out_after_offer` | `number` | equals, gt, gte, lt, lte, in | | `price_max` | `string` | equals, contains, startsWith, endsWith, in | | `price_min` | `string` | equals, contains, startsWith, endsWith, in | | `price_open` | `string` | equals, contains, startsWith, endsWith, in | | `price_public_offering` | `string` | equals, contains, startsWith, endsWith, in | | `pricing_date` | `string` | equals, contains, startsWith, endsWith, in | | `pricing_date_verified` | `boolean` | equals | | `sec_accession_number` | `string` | equals, contains, startsWith, endsWith, in | | `sec_filing_url` | `string` | equals, contains, startsWith, endsWith, in | | `shares_outstanding` | `number` | equals, gt, gte, lt, lte, in | | `sic` | `number` | equals, gt, gte, lt, lte, in | | `spac_converted_to_target` | `boolean` | equals | | `state_location` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `string` | equals, contains, startsWith, endsWith, in | | `underwriter_quiet_expiration_date` | `string` | equals, contains, startsWith, endsWith, in | | `underwriter_quiet_expiration_days` | `number` | equals, gt, gte, lt, lte, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## News Articles Path: `benzinga.db.newsArticles.search` ```ts theme={null} const rows = await corsair.benzinga.db.newsArticles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `teaser` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `importance_rank` | `number` | equals, gt, gte, lt, lte, in | | `original_id` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## News Channels Path: `benzinga.db.newsChannels.search` ```ts theme={null} const rows = await corsair.benzinga.db.newsChannels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `parent` | `number` | equals, gt, gte, lt, lte, in | | `channel` | `string` | equals, contains, startsWith, endsWith, in | | `weight` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Ratings Path: `benzinga.db.ratings.search` ```ts theme={null} const rows = await corsair.benzinga.db.ratings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `action_company` | `string` | equals, contains, startsWith, endsWith, in | | `action_pt` | `string` | equals, contains, startsWith, endsWith, in | | `adjusted_pt_current` | `string` | equals, contains, startsWith, endsWith, in | | `adjusted_pt_prior` | `string` | equals, contains, startsWith, endsWith, in | | `analyst` | `string` | equals, contains, startsWith, endsWith, in | | `analyst_id` | `string` | equals, contains, startsWith, endsWith, in | | `analyst_name` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `cusip` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `exchange` | `string` | equals, contains, startsWith, endsWith, in | | `firm_id` | `string` | equals, contains, startsWith, endsWith, in | | `importance` | `number` | equals, gt, gte, lt, lte, in | | `isin` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `pt_current` | `string` | equals, contains, startsWith, endsWith, in | | `pt_prior` | `string` | equals, contains, startsWith, endsWith, in | | `rating_current` | `string` | equals, contains, startsWith, endsWith, in | | `rating_prior` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `url_calendar` | `string` | equals, contains, startsWith, endsWith, in | | `url_news` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Removed Calendar Events Path: `benzinga.db.removedCalendarEvents.search` ```ts theme={null} const rows = await corsair.benzinga.db.removedCalendarEvents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Removed News Items Path: `benzinga.db.removedNewsItems.search` ```ts theme={null} const rows = await corsair.benzinga.db.removedNewsItems.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Splits Path: `benzinga.db.splits.search` ```ts theme={null} const rows = await corsair.benzinga.db.splits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `cusip` | `string` | equals, contains, startsWith, endsWith, in | | `date_announced` | `string` | equals, contains, startsWith, endsWith, in | | `date_distribution` | `string` | equals, contains, startsWith, endsWith, in | | `date_ex` | `string` | equals, contains, startsWith, endsWith, in | | `date_recorded` | `string` | equals, contains, startsWith, endsWith, in | | `exchange` | `string` | equals, contains, startsWith, endsWith, in | | `importance` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `optionable` | `boolean` | equals | | `ratio` | `string` | equals, contains, startsWith, endsWith, in | | `split_type` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/benzinga/overview Benzinga plugin for Corsair Use **Benzinga** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 15 typed API operations * 13 synced entities (`conferenceCalls`, `consensusRatings`, `dividends`, `earnings`, `economics`, `guidance`, and 7 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/benzinga ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/benzinga ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/benzinga ``` ```bash bun theme={null} bun add corsair @corsair-dev/benzinga ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { benzinga } from '@corsair-dev/benzinga'; export const corsair = createCorsair({ plugins: [ benzinga(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} benzinga() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'benzinga', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`calendar.getConsensusRatings`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.benzinga.api.calendar.getConsensusRatings({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/benzinga/api) reference.* See the full list on the [API](/plugins/benzinga/api) page. ## Query synced data Synced entities support `tenant.benzinga.db..search()` and `.list()`: `conferenceCalls`, `consensusRatings`, `dividends`, `earnings`, `economics`, `guidance`, `ipos`, `newsArticles`, `newsChannels`, `ratings`, `removedCalendarEvents`, `removedNewsItems`, `splits`. See [Database](/plugins/benzinga/database) for filters and operators. ## What's next > **[API reference](/plugins/benzinga/api)** > > Every `benzinga.api.*` operation with input and output types. > **[Database](/plugins/benzinga/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bestbuy/api API reference for Best Buy Remix API: every `bestbuy.api.*` operation with input and output types. Every `bestbuy.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Categories ### get `categories.get` Retrieve detailed information about a category by ID **Risk:** `read` ```ts theme={null} await corsair.bestbuy.api.categories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the category to retrieve | | `show` | `string` | No | Comma-delimited list of fields to include | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `path` | `object[]` | No | — | | `subCategories` | `object[]` | No | — | > **path full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null > }[] > ``` > **subCategories full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null > }[] > ``` *** ### list `categories.list` List or filter Best Buy product categories **Risk:** `read` ```ts theme={null} await corsair.bestbuy.api.categories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | Filter by category ID(s), pipe- or comma-separated | | `name` | `string` | No | Filter by category name(s), pipe- or comma-separated | | `page` | `number` | No | Page number to retrieve (1-based) | | `pageSize` | `number` | No | Number of categories per page (1-100) | | `show` | `string` | No | Comma-separated fields to include in each category | | `sort` | `string` | No | Sort order, e.g. 'name.asc' or 'id.dsc' | **Output** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | | `total` | `number` | No | — | | `currentPage` | `number` | No | — | | `totalPages` | `number` | No | — | | `queryTime` | `string` | No | — | | `totalTime` | `string` | No | — | | `partial` | `boolean` | No | — | | `canonicalUrl` | `string` | No | — | | `categories` | `object[]` | Yes | — | > **categories full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > url?: string | null, > path?: { > id?: string | null, > name?: string | null > }[] | null, > subCategories?: { > id?: string | null, > name?: string | null > }[] | null > }[] > ``` *** ## Products ### get `products.get` Retrieve detailed information about a product by SKU **Risk:** `read` ```ts theme={null} await corsair.bestbuy.api.products.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sku` | `string \| number` | Yes | The SKU of the product to retrieve | | `show` | `string` | No | Comma-separated attributes to include, or all | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sku` | `string \| number` | No | — | | `name` | `string` | No | — | | `upc` | `string` | No | — | | `manufacturer` | `string` | No | — | | `modelNumber` | `string` | No | — | | `color` | `string` | No | — | | `condition` | `string` | No | — | | `description` | `string` | No | — | | `longDescription` | `string` | No | — | | `longDescriptionHtml` | `string` | No | — | | `shortDescription` | `string` | No | — | | `shortDescriptionHtml` | `string` | No | — | | `customerReviewAverage` | `number` | No | — | | `customerReviewCount` | `number` | No | — | | `customerTopRated` | `boolean` | No | — | | `depth` | `string` | No | — | | `height` | `string` | No | — | | `width` | `string` | No | — | | `weight` | `string` | No | — | | `digital` | `boolean` | No | — | | `format` | `string` | No | — | | `preowned` | `boolean` | No | — | | `quantityLimit` | `number` | No | — | | `releaseDate` | `string` | No | — | | `warrantyLabor` | `string` | No | — | | `warrantyParts` | `string` | No | — | | `accessories` | `object[]` | No | — | | `details` | `object[]` | No | — | | `features` | `object[]` | No | — | | `includedItemList` | `object[]` | No | — | | `productVariations` | `object[]` | No | — | | `proposition65WarningMessage` | `string` | No | — | | `proposition65WarningType` | `string` | No | — | | `dollarSavings` | `number` | No | — | | `lowPriceGuarantee` | `boolean` | No | — | | `onSale` | `boolean` | No | — | | `percentSavings` | `string` | No | — | | `priceRestriction` | `string` | No | — | | `priceUpdateDate` | `string` | No | — | | `regularPrice` | `number` | No | — | | `salePrice` | `number` | No | — | | `contracts` | `object[]` | No | — | | `priceWithPlan` | `object` | No | — | | `friendsAndFamilyPickup` | `boolean` | No | — | | `homeDelivery` | `boolean` | No | — | | `inStoreAvailability` | `boolean` | No | — | | `inStoreAvailabilityUpdateDate` | `string` | No | — | | `inStorePickup` | `boolean` | No | — | | `onlineAvailability` | `boolean` | No | — | | `onlineAvailabilityUpdateDate` | `string` | No | — | | `orderable` | `string` | No | — | | `specialOrder` | `boolean` | No | — | | `freeShipping` | `boolean` | No | — | | `freeShippingEligible` | `boolean` | No | — | | `shippingCost` | `number` | No | — | | `shippingWeight` | `number` | No | — | | `shippingLevelsOfService` | `object[]` | No | — | | `accessoriesImage` | `string` | No | — | | `alternateViewsImage` | `string` | No | — | | `angleImage` | `string` | No | — | | `backViewImage` | `string` | No | — | | `energyGuideImage` | `string` | No | — | | `image` | `string` | No | — | | `largeFrontImage` | `string` | No | — | | `largeImage` | `string` | No | — | | `leftViewImage` | `string` | No | — | | `mediumImage` | `string` | No | — | | `remoteControlImage` | `string` | No | — | | `rightViewImage` | `string` | No | — | | `spin360Url` | `string` | No | — | | `thumbnailImage` | `string` | No | — | | `topViewImage` | `string` | No | — | | `addToCartUrl` | `string` | No | — | | `url` | `string` | No | — | | `affiliateAddToCartUrl` | `string` | No | — | | `affiliateUrl` | `string` | No | — | | `class` | `string` | No | — | | `classId` | `number` | No | — | | `department` | `string` | No | — | | `departmentId` | `number` | No | — | | `subclass` | `string` | No | — | | `subclassId` | `number` | No | — | | `categoryPath` | `object[]` | No | — | | `lists` | `object[]` | No | — | | `offers` | `object[]` | No | — | | `active` | `boolean` | No | — | | `activeUpdateDate` | `string` | No | — | | `bundledIn` | `object[]` | No | — | | `itemUpdateDate` | `string` | No | — | | `members` | `object[]` | No | — | | `new` | `boolean` | No | — | | `secondaryMarket` | `boolean` | No | — | | `startDate` | `string` | No | — | | `type` | `string` | No | — | > **accessories full type** > > ```ts theme={null} > { > sku?: string | number | null > }[] > ``` > **details full type** > > ```ts theme={null} > { > name?: string | null, > value?: string | null > }[] > ``` > **features full type** > > ```ts theme={null} > { > feature?: string | null > }[] > ``` > **includedItemList full type** > > ```ts theme={null} > { > includedItem?: string | null > }[] > ``` > **productVariations full type** > > ```ts theme={null} > { > sku?: string | number | null > }[] > ``` > **contracts full type** > > ```ts theme={null} > { > }[] > ``` > **priceWithPlan full type** > > ```ts theme={null} > { > } > ``` > **shippingLevelsOfService full type** > > ```ts theme={null} > { > serviceLevelId?: number | null, > serviceLevelName?: string | null, > unitShippingPrice?: number | null > }[] > ``` > **categoryPath full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null > }[] > ``` > **lists full type** > > ```ts theme={null} > { > endDate?: string | null, > listId?: string | null, > startDate?: string | null > }[] > ``` > **offers full type** > > ```ts theme={null} > { > endDate?: string | null, > id?: string | null, > startDate?: string | null, > text?: string | null, > type?: string | null, > url?: string | null > }[] > ``` > **bundledIn full type** > > ```ts theme={null} > { > sku?: string | number | null > }[] > ``` > **members full type** > > ```ts theme={null} > { > sku?: string | number | null > }[] > ``` *** ### list `products.list` Retrieve products with optional SKU, UPC, name, salePrice, and categoryPath.id filters **Risk:** `read` ```ts theme={null} await corsair.bestbuy.api.products.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sku` | `string \| number` | No | Filter for a specific SKU | | `upc` | `string` | No | Filter for a specific UPC | | `name` | `string` | No | Filter by product name with wildcard, e.g. iPad\* | | `salePrice` | `string` | No | Filter by sale price, e.g. 'salePrice>100' or '>100' | | `categoryPathId` | `string` | No | Filter products by categoryPath.id | | `page` | `number` | No | Page number to retrieve (1-based) | | `pageSize` | `number` | No | Number of products per page (1-100) | | `show` | `string` | No | Comma-separated attributes to include, or all | | `sort` | `string` | No | Sort format, e.g. 'name.asc' or 'salePrice.dsc' | **Output** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | | `total` | `number` | No | — | | `currentPage` | `number` | No | — | | `totalPages` | `number` | No | — | | `queryTime` | `string` | No | — | | `totalTime` | `string` | No | — | | `partial` | `boolean` | No | — | | `canonicalUrl` | `string` | No | — | | `products` | `object[]` | Yes | — | > **products full type** > > ```ts theme={null} > { > sku?: string | number | null, > name?: string | null, > upc?: string | null, > manufacturer?: string | null, > modelNumber?: string | null, > color?: string | null, > condition?: string | null, > description?: string | null, > longDescription?: string | null, > longDescriptionHtml?: string | null, > shortDescription?: string | null, > shortDescriptionHtml?: string | null, > customerReviewAverage?: number | null, > customerReviewCount?: number | null, > customerTopRated?: boolean | null, > depth?: string | null, > height?: string | null, > width?: string | null, > weight?: string | null, > digital?: boolean | null, > format?: string | null, > preowned?: boolean | null, > quantityLimit?: number | null, > releaseDate?: string | null, > warrantyLabor?: string | null, > warrantyParts?: string | null, > accessories?: { > sku?: string | number | null > }[] | null, > details?: { > name?: string | null, > value?: string | null > }[] | null, > features?: { > feature?: string | null > }[] | null, > includedItemList?: { > includedItem?: string | null > }[] | null, > productVariations?: { > sku?: string | number | null > }[] | null, > proposition65WarningMessage?: string | null, > proposition65WarningType?: string | null, > dollarSavings?: number | null, > lowPriceGuarantee?: boolean | null, > onSale?: boolean | null, > percentSavings?: string | null, > priceRestriction?: string | null, > priceUpdateDate?: string | null, > regularPrice?: number | null, > salePrice?: number | null, > contracts?: { > }[] | null, > priceWithPlan?: { > } | null, > friendsAndFamilyPickup?: boolean | null, > homeDelivery?: boolean | null, > inStoreAvailability?: boolean | null, > inStoreAvailabilityUpdateDate?: string | null, > inStorePickup?: boolean | null, > onlineAvailability?: boolean | null, > onlineAvailabilityUpdateDate?: string | null, > orderable?: string | null, > specialOrder?: boolean | null, > freeShipping?: boolean | null, > freeShippingEligible?: boolean | null, > shippingCost?: number | null, > shippingWeight?: number | null, > shippingLevelsOfService?: { > serviceLevelId?: number | null, > serviceLevelName?: string | null, > unitShippingPrice?: number | null > }[] | null, > accessoriesImage?: string | null, > alternateViewsImage?: string | null, > angleImage?: string | null, > backViewImage?: string | null, > energyGuideImage?: string | null, > image?: string | null, > largeFrontImage?: string | null, > largeImage?: string | null, > leftViewImage?: string | null, > mediumImage?: string | null, > remoteControlImage?: string | null, > rightViewImage?: string | null, > spin360Url?: string | null, > thumbnailImage?: string | null, > topViewImage?: string | null, > addToCartUrl?: string | null, > url?: string | null, > affiliateAddToCartUrl?: string | null, > affiliateUrl?: string | null, > class?: string | null, > classId?: number | null, > department?: string | null, > departmentId?: number | null, > subclass?: string | null, > subclassId?: number | null, > categoryPath?: { > id?: string | null, > name?: string | null > }[] | null, > lists?: { > endDate?: string | null, > listId?: string | null, > startDate?: string | null > }[] | null, > offers?: { > endDate?: string | null, > id?: string | null, > startDate?: string | null, > text?: string | null, > type?: string | null, > url?: string | null > }[] | null, > active?: boolean | null, > activeUpdateDate?: string | null, > bundledIn?: { > sku?: string | number | null > }[] | null, > itemUpdateDate?: string | null, > members?: { > sku?: string | number | null > }[] | null, > new?: boolean | null, > secondaryMarket?: boolean | null, > startDate?: string | null, > type?: string | null > }[] > ``` *** ## Reviews ### get `reviews.get` Retrieve a single review by ID **Risk:** `read` ```ts theme={null} await corsair.bestbuy.api.reviews.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique identifier of the review to retrieve | | `show` | `string` | No | Comma-separated fields to include | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `sku` | `string \| number` | No | — | | `title` | `string` | No | — | | `comment` | `string` | No | — | | `rating` | `number` | No | — | | `submissionTime` | `string` | No | — | | `recommended` | `boolean` | No | — | | `qualityRating` | `number` | No | — | | `valueRating` | `number` | No | — | | `easeOfUseRating` | `number` | No | — | | `reviewer` | `object[]` | No | — | > **reviewer full type** > > ```ts theme={null} > { > name?: string | null > } | { > name?: string | null > }[] > ``` *** ### list `reviews.list` Retrieve product reviews with optional SKU, reviewer, and score filters **Risk:** `read` ```ts theme={null} await corsair.bestbuy.api.reviews.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sku` | `string \| number` | No | Filter reviews by product SKU | | `reviewer` | `string` | No | Filter reviews by reviewer name | | `minScore` | `number` | No | Minimum rating score (1-5) | | `maxScore` | `number` | No | Maximum rating score (1-5) | | `page` | `number` | No | Page number for pagination | | `pageSize` | `number` | No | Number of reviews per page (1-100) | | `show` | `string` | No | Comma-separated fields to include | | `sort` | `string` | No | Sort expression, e.g. 'submissionTime.dsc' | **Output** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | | `total` | `number` | No | — | | `currentPage` | `number` | No | — | | `totalPages` | `number` | No | — | | `queryTime` | `string` | No | — | | `totalTime` | `string` | No | — | | `partial` | `boolean` | No | — | | `canonicalUrl` | `string` | No | — | | `reviews` | `object[]` | Yes | — | > **reviews full type** > > ```ts theme={null} > { > id?: string | number | null, > sku?: string | number | null, > title?: string | null, > comment?: string | null, > rating?: number | null, > submissionTime?: string | null, > recommended?: boolean | null, > qualityRating?: number | null, > valueRating?: number | null, > easeOfUseRating?: number | null, > reviewer?: { > name?: string | null > } | { > name?: string | null > }[] | null > }[] > ``` *** ## Stores ### get `stores.get` Retrieve detailed information about a store by store ID **Risk:** `read` ```ts theme={null} await corsair.bestbuy.api.stores.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `storeId` | `string` | Yes | Unique identifier for the Best Buy store | | `show` | `string` | No | Comma-separated fields to include, or all for detailedHours | **Output** | Name | Type | Required | Description | | - | - | - | - | | `storeId` | `number` | No | — | | `name` | `string` | No | — | | `longName` | `string` | No | — | | `address` | `string` | No | — | | `address2` | `string` | No | — | | `city` | `string` | No | — | | `region` | `string` | No | — | | `postalCode` | `string` | No | — | | `fullPostalCode` | `string` | No | — | | `country` | `string` | No | — | | `lat` | `number` | No | — | | `lng` | `number` | No | — | | `distance` | `number` | No | — | | `location` | `string` | No | — | | `locationType` | `string` | No | — | | `storeType` | `string` | No | — | | `phone` | `string` | No | — | | `hours` | `string` | No | — | | `hoursAmPm` | `string` | No | — | | `gmtOffset` | `number` | No | — | | `detailedHours` | `object[]` | No | — | | `services` | `object[]` | No | — | > **detailedHours full type** > > ```ts theme={null} > { > day?: string | null, > date?: string | null, > open?: string | null, > close?: string | null > }[] > ``` > **services full type** > > ```ts theme={null} > { > service?: string | null > }[] > ``` *** ### list `stores.list` List Best Buy stores with optional city, region, postalCode, or area() geo search **Risk:** `read` ```ts theme={null} await corsair.bestbuy.api.stores.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `geo` | `object` | No | Remix area(location,distance): postalCode or lat+lng; distance defaults to 10 miles | | `city` | `string` | No | Filter stores by city name | | `state` | `string` | No | Two-letter state code (maps to region) | | `region` | `string` | No | Filter stores by region / state | | `storeId` | `number` | No | Specific store ID | | `postalCode` | `string` | No | Filter stores by postal code | | `storeType` | `string` | No | Filter stores by store type | | `services` | `string` | No | Filter by services.service, comma-separated | | `page` | `number` | No | Page number to retrieve (must be > 0) | | `pageSize` | `number` | No | Number of results per page (1-100) | | `show` | `string` | No | Comma-separated store fields to include | | `sort` | `string` | No | Sort directive, e.g. 'city.asc' or 'name.dsc' | > **geo full type** > > ```ts theme={null} > { > postalCode?: string, > lat?: number, > lng?: number, > distance?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | | `total` | `number` | No | — | | `currentPage` | `number` | No | — | | `totalPages` | `number` | No | — | | `queryTime` | `string` | No | — | | `totalTime` | `string` | No | — | | `partial` | `boolean` | No | — | | `canonicalUrl` | `string` | No | — | | `stores` | `object[]` | Yes | — | > **stores full type** > > ```ts theme={null} > { > storeId?: number | null, > name?: string | null, > longName?: string | null, > address?: string | null, > address2?: string | null, > city?: string | null, > region?: string | null, > postalCode?: string | null, > fullPostalCode?: string | null, > country?: string | null, > lat?: number | null, > lng?: number | null, > distance?: number | null, > location?: string | null, > locationType?: string | null, > storeType?: string | null, > phone?: string | null, > hours?: string | null, > hoursAmPm?: string | null, > gmtOffset?: number | null, > detailedHours?: { > day?: string | null, > date?: string | null, > open?: string | null, > close?: string | null > }[] | null, > services?: { > service?: string | null > }[] | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/bestbuy/database Best Buy Remix API local sync: searchable entities, `.search()` filters, and operators. The Best Buy Remix API plugin syncs data locally. Use `corsair.bestbuy.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Categories Path: `bestbuy.db.categories.search` ```ts theme={null} const rows = await corsair.bestbuy.db.categories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Products Path: `bestbuy.db.products.search` ```ts theme={null} const rows = await corsair.bestbuy.db.products.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `upc` | `string` | equals, contains, startsWith, endsWith, in | | `manufacturer` | `string` | equals, contains, startsWith, endsWith, in | | `modelNumber` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `condition` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `longDescription` | `string` | equals, contains, startsWith, endsWith, in | | `longDescriptionHtml` | `string` | equals, contains, startsWith, endsWith, in | | `shortDescription` | `string` | equals, contains, startsWith, endsWith, in | | `shortDescriptionHtml` | `string` | equals, contains, startsWith, endsWith, in | | `customerReviewAverage` | `number` | equals, gt, gte, lt, lte, in | | `customerReviewCount` | `number` | equals, gt, gte, lt, lte, in | | `customerTopRated` | `boolean` | equals | | `depth` | `string` | equals, contains, startsWith, endsWith, in | | `height` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `string` | equals, contains, startsWith, endsWith, in | | `weight` | `string` | equals, contains, startsWith, endsWith, in | | `digital` | `boolean` | equals | | `format` | `string` | equals, contains, startsWith, endsWith, in | | `preowned` | `boolean` | equals | | `quantityLimit` | `number` | equals, gt, gte, lt, lte, in | | `releaseDate` | `string` | equals, contains, startsWith, endsWith, in | | `warrantyLabor` | `string` | equals, contains, startsWith, endsWith, in | | `warrantyParts` | `string` | equals, contains, startsWith, endsWith, in | | `proposition65WarningMessage` | `string` | equals, contains, startsWith, endsWith, in | | `proposition65WarningType` | `string` | equals, contains, startsWith, endsWith, in | | `dollarSavings` | `number` | equals, gt, gte, lt, lte, in | | `lowPriceGuarantee` | `boolean` | equals | | `onSale` | `boolean` | equals | | `percentSavings` | `string` | equals, contains, startsWith, endsWith, in | | `priceRestriction` | `string` | equals, contains, startsWith, endsWith, in | | `priceUpdateDate` | `string` | equals, contains, startsWith, endsWith, in | | `regularPrice` | `number` | equals, gt, gte, lt, lte, in | | `salePrice` | `number` | equals, gt, gte, lt, lte, in | | `friendsAndFamilyPickup` | `boolean` | equals | | `homeDelivery` | `boolean` | equals | | `inStoreAvailability` | `boolean` | equals | | `inStoreAvailabilityUpdateDate` | `string` | equals, contains, startsWith, endsWith, in | | `inStorePickup` | `boolean` | equals | | `onlineAvailability` | `boolean` | equals | | `onlineAvailabilityUpdateDate` | `string` | equals, contains, startsWith, endsWith, in | | `orderable` | `string` | equals, contains, startsWith, endsWith, in | | `specialOrder` | `boolean` | equals | | `freeShipping` | `boolean` | equals | | `freeShippingEligible` | `boolean` | equals | | `shippingCost` | `number` | equals, gt, gte, lt, lte, in | | `shippingWeight` | `number` | equals, gt, gte, lt, lte, in | | `accessoriesImage` | `string` | equals, contains, startsWith, endsWith, in | | `alternateViewsImage` | `string` | equals, contains, startsWith, endsWith, in | | `angleImage` | `string` | equals, contains, startsWith, endsWith, in | | `backViewImage` | `string` | equals, contains, startsWith, endsWith, in | | `energyGuideImage` | `string` | equals, contains, startsWith, endsWith, in | | `image` | `string` | equals, contains, startsWith, endsWith, in | | `largeFrontImage` | `string` | equals, contains, startsWith, endsWith, in | | `largeImage` | `string` | equals, contains, startsWith, endsWith, in | | `leftViewImage` | `string` | equals, contains, startsWith, endsWith, in | | `mediumImage` | `string` | equals, contains, startsWith, endsWith, in | | `remoteControlImage` | `string` | equals, contains, startsWith, endsWith, in | | `rightViewImage` | `string` | equals, contains, startsWith, endsWith, in | | `spin360Url` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnailImage` | `string` | equals, contains, startsWith, endsWith, in | | `topViewImage` | `string` | equals, contains, startsWith, endsWith, in | | `addToCartUrl` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `affiliateAddToCartUrl` | `string` | equals, contains, startsWith, endsWith, in | | `affiliateUrl` | `string` | equals, contains, startsWith, endsWith, in | | `class` | `string` | equals, contains, startsWith, endsWith, in | | `classId` | `number` | equals, gt, gte, lt, lte, in | | `department` | `string` | equals, contains, startsWith, endsWith, in | | `departmentId` | `number` | equals, gt, gte, lt, lte, in | | `subclass` | `string` | equals, contains, startsWith, endsWith, in | | `subclassId` | `number` | equals, gt, gte, lt, lte, in | | `active` | `boolean` | equals | | `activeUpdateDate` | `string` | equals, contains, startsWith, endsWith, in | | `itemUpdateDate` | `string` | equals, contains, startsWith, endsWith, in | | `new` | `boolean` | equals | | `secondaryMarket` | `boolean` | equals | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Reviews Path: `bestbuy.db.reviews.search` ```ts theme={null} const rows = await corsair.bestbuy.db.reviews.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | | `rating` | `number` | equals, gt, gte, lt, lte, in | | `submissionTime` | `string` | equals, contains, startsWith, endsWith, in | | `recommended` | `boolean` | equals | | `qualityRating` | `number` | equals, gt, gte, lt, lte, in | | `valueRating` | `number` | equals, gt, gte, lt, lte, in | | `easeOfUseRating` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Stores Path: `bestbuy.db.stores.search` ```ts theme={null} const rows = await corsair.bestbuy.db.stores.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `storeId` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `longName` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `address2` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `postalCode` | `string` | equals, contains, startsWith, endsWith, in | | `fullPostalCode` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `lat` | `number` | equals, gt, gte, lt, lte, in | | `lng` | `number` | equals, gt, gte, lt, lte, in | | `distance` | `number` | equals, gt, gte, lt, lte, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `locationType` | `string` | equals, contains, startsWith, endsWith, in | | `storeType` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `hours` | `string` | equals, contains, startsWith, endsWith, in | | `hoursAmPm` | `string` | equals, contains, startsWith, endsWith, in | | `gmtOffset` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bestbuy/overview Best Buy Remix API plugin for Corsair Use **Best Buy Remix API** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 8 typed API operations * 4 synced entities (`categories`, `products`, `reviews`, `stores`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bestbuy ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bestbuy ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bestbuy ``` ```bash bun theme={null} bun add corsair @corsair-dev/bestbuy ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bestbuy } from '@corsair-dev/bestbuy'; export const corsair = createCorsair({ plugins: [ bestbuy(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bestbuy() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bestbuy', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`categories.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bestbuy.api.categories.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/bestbuy/api) reference.* See the full list on the [API](/plugins/bestbuy/api) page. ## Query synced data Synced entities support `tenant.bestbuy.db..search()` and `.list()`: `categories`, `products`, `reviews`, `stores`. See [Database](/plugins/bestbuy/database) for filters and operators. ## What's next > **[API reference](/plugins/bestbuy/api)** > > Every `bestbuy.api.*` operation with input and output types. > **[Database](/plugins/bestbuy/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bettercontact/api API reference for BetterContact: every `bettercontact.api.*` operation with input and output types. Every `bettercontact.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Credits ### get `credits.get` Check remaining API credits balance **Risk:** `read` ```ts theme={null} await corsair.bettercontact.api.credits.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `credits_left` | `number` | Yes | — | | `email` | `string` | No | — | *** ## Enrichment ### enrich `enrichment.enrich` Submit lead enrichment request for work emails and phone numbers **Risk:** `write` ```ts theme={null} await corsair.bettercontact.api.enrichment.enrich({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `enrich_email_address` | `boolean` | No | — | | `enrich_phone_number` | `boolean` | No | — | | `enrich_profile` | `boolean` | No | — | | `verify_catch_all` | `boolean` | No | — | | `webhook` | `string` | No | — | | `push_contact_individually` | `boolean` | No | — | | `contact_webhook` | `string` | No | — | | `process_flow` | `string` | No | — | | `timeout_seconds` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > first_name?: string, > last_name?: string, > company?: string, > company_domain?: string, > linkedin_url?: string, > custom_fields?: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `message` | `string` | No | — | *** ### getResults `enrichment.getResults` Retrieve results for a submitted enrichment request **Risk:** `read` ```ts theme={null} await corsair.bettercontact.api.enrichment.getResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `status` | `not_started \| processing \| on_hold \| terminated \| string` | Yes | — | | `message` | `string` | No | — | | `credits_consumed` | `number` | No | — | | `credits_left` | `number` | No | — | | `summary` | `object` | No | — | | `data` | `object[]` | No | — | > **summary full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ## Lead Finder ### create `leadFinder.create` Create a new Lead Finder search to discover leads based on criteria **Risk:** `write` ```ts theme={null} await corsair.bettercontact.api.leadFinder.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filters` | `object` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `max_leads` | `number` | No | — | | `webhook` | `string` | No | — | | `enrich_email_address` | `boolean` | No | — | | `enrich_phone_number` | `boolean` | No | — | > **filters full type** > > ```ts theme={null} > { > company?: { > include?: string[], > exclude?: string[] > }, > company_linkedin_url?: { > include?: string[], > exclude?: string[] > }, > company_industry?: { > include?: string[], > exclude?: string[] > }, > company_hq_location?: { > include?: string[], > exclude?: string[] > }, > company_technologies?: { > include?: string[], > exclude?: string[] > }, > company_keywords?: { > include?: string[], > exclude?: string[] > }, > company_description?: { > include?: string[], > exclude?: string[] > }, > company_headcount_min?: number, > company_headcount_max?: number, > revenue_ranges?: { > include?: string[], > exclude?: string[] > }, > last_funding_round_names?: { > include?: string[], > exclude?: string[] > }, > last_funding_date_range?: { > gte?: string, > lte?: string > }, > last_amount_raised_usd?: { > gte?: number, > lte?: number > }, > total_amount_raised_usd?: { > gte?: number, > lte?: number > }, > is_b2b?: boolean, > is_b2c?: boolean, > is_public?: boolean, > job_post_titles?: { > include?: string[] > }, > job_posting_countries?: { > include?: string[] > }, > job_posting_locations?: { > include?: string[] > }, > limit_per_company?: number, > lead_fullname?: { > include?: string[], > exclude?: string[] > }, > lead_linkedin_url?: { > include?: string[], > exclude?: string[] > }, > lead_job_title?: { > include?: string[], > exclude?: string[], > exact_match?: boolean > }, > lead_seniority?: { > include?: string[], > exclude?: string[] > }, > lead_department?: { > include?: string[], > exclude?: string[] > }, > lead_function?: { > include?: string[], > exclude?: string[] > }, > lead_skills?: { > include?: string[], > exclude?: string[] > }, > lead_location?: { > include?: string[], > exclude?: string[] > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | Yes | — | *** ### getResults `leadFinder.getResults` Retrieve results from a submitted Lead Finder search **Risk:** `read` ```ts theme={null} await corsair.bettercontact.api.leadFinder.getResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `status` | `not_started \| processing \| on_hold \| terminated \| string` | Yes | — | | `message` | `string` | No | — | | `credits_consumed` | `number` | No | — | | `credits_left` | `number` | No | — | | `summary` | `object` | No | — | | `leads` | `object[]` | No | — | > **summary full type** > > ```ts theme={null} > { > } > ``` > **leads full type** > > ```ts theme={null} > { > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/bettercontact/database BetterContact local sync: searchable entities, `.search()` filters, and operators. The BetterContact plugin syncs data locally. Use `corsair.bettercontact.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/bettercontact/overview Waterfall enrichment API for finding verified B2B emails and mobile phone numbers. Use **BetterContact** through Corsair: one client, typed API calls. BetterContact integrates waterfall enrichment across multiple data providers for verified work emails and direct phone numbers. Pass `key` to the plugin factory or set `BETTERCONTACT_API_KEY` in environment variables: ```ts theme={null} bettercontact({ key: process.env.BETTERCONTACT_API_KEY }) ``` **What you get:** * 5 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bettercontact ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bettercontact ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bettercontact ``` ```bash bun theme={null} bun add corsair @corsair-dev/bettercontact ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bettercontact } from '@corsair-dev/bettercontact'; export const corsair = createCorsair({ plugins: [ bettercontact(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bettercontact() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bettercontact', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`credits.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bettercontact.api.credits.get({}); ``` **`enrichment.enrich`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bettercontact.api.enrichment.enrich({}); ``` See the full list on the [API](/plugins/bettercontact/api) page. ## What's next > **[API reference](/plugins/bettercontact/api)** > > Every `bettercontact.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/betterproposals/api API reference for Better Proposals: every `betterproposals.api.*` operation with input and output types. Every `betterproposals.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Companies ### create `companies.create` Create a new company record **Risk:** `write` ```ts theme={null} await corsair.betterproposals.api.companies.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `CompanyName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > DemoCompany?: string | number | null, > CompanyName: string, > CompanyCRMID?: string | null, > DateCreated?: string | null, > CreatedBy?: string | number | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > Deleted?: string | number | null, > DeletedBy?: string | number | null > } | { > } > ``` *** ### get `companies.get` Get details for a specific company by ID **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.companies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > DemoCompany?: string | number | null, > CompanyName: string, > CompanyCRMID?: string | null, > DateCreated?: string | null, > CreatedBy?: string | number | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > Deleted?: string | number | null, > DeletedBy?: string | number | null > } > ``` *** ### list `companies.list` Get all companies in the account with optional pagination **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.companies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > DemoCompany?: string | number | null, > CompanyName: string, > CompanyCRMID?: string | null, > DateCreated?: string | null, > CreatedBy?: string | number | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > Deleted?: string | number | null, > DeletedBy?: string | number | null > }[] > ``` *** ## Currencies ### get `currencies.get` Get details for a specific currency by ID **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.currencies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `currency_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > CurrencyName?: string | null, > CurrencySymbol?: string | null, > CurrencyCode?: string | null, > ZeroDecimal?: string | number | null, > StripeSupport?: string | number | null, > PaypalSupport?: string | number | null > } > ``` *** ### list `currencies.list` Get all currencies supported in Better Proposals **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.currencies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > CurrencyName?: string | null, > CurrencySymbol?: string | null, > CurrencyCode?: string | null, > ZeroDecimal?: string | number | null, > StripeSupport?: string | number | null, > PaypalSupport?: string | number | null > }[] > ``` *** ## Document Types ### create `documentTypes.create` Create a new document type with name and colour **Risk:** `write` ```ts theme={null} await corsair.betterproposals.api.documentTypes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `TypeName` | `string` | Yes | — | | `TypeColour` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > TypeName: string, > TypeIcon?: string | null, > TypeColour?: string | null, > TypeNameSingular?: string | null, > CategoryIcon?: string | null, > DisplayOrder?: string | number | null, > NumberOfOutstandingDocuments?: number | null, > NumberOfTemplates?: number | null, > DateCreated?: string | null, > CreatedBy?: string | number | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > Deleted?: string | number | null, > DateDeleted?: string | null, > DeletedBy?: string | number | null > } > ``` *** ### list `documentTypes.list` Get all document types available in the account **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.documentTypes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > TypeName: string, > TypeIcon?: string | null, > TypeColour?: string | null, > TypeNameSingular?: string | null, > CategoryIcon?: string | null, > DisplayOrder?: string | number | null, > NumberOfOutstandingDocuments?: number | null, > NumberOfTemplates?: number | null, > DateCreated?: string | null, > CreatedBy?: string | number | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > Deleted?: string | number | null, > DateDeleted?: string | null, > DeletedBy?: string | number | null > }[] > ``` *** ## Proposals ### createCover `proposals.createCover` Create a proposal cover design with custom colours, headline, and button **Risk:** `write` ```ts theme={null} await corsair.betterproposals.api.proposals.createCover({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `BrandID` | `string \| number` | No | — | | `CoverName` | `string` | No | — | | `BGColour` | `string \| number` | No | — | | `Headline` | `string` | No | — | | `Subheader` | `string` | No | — | | `TextColour` | `string` | No | — | | `TextAlign` | `left \| center \| right \| string` | No | — | | `ButtonStyle` | `string` | No | — | | `ButtonText` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > ID?: string | number, > Name?: string | null, > BrandID?: string | number | null, > Headline?: string | null, > Subheader?: string | null, > BGColour?: string | null, > TextColour?: string | null, > TextAlign?: string | null, > ButtonStyle?: string | null, > ButtonText?: string | null > } > ``` *** ### get `proposals.get` Get detailed information for a specific proposal by ID **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.proposals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `proposal_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AssignedTo?: string | number | null, > BrandID?: string | number | null, > ViewType?: string | null, > CurrencyCode?: string | null, > Tax?: string | number | null, > TaxLabel?: string | null, > TaxAmount?: string | null, > TaxPercentage?: string | null, > TaxName?: string | null, > Amount?: string | null, > AmountDesc?: string | null, > Paid?: string | number | null, > DatePaid?: string | null, > CoverID?: string | number | null, > TypeID?: string | number | null, > Description?: string | null, > SubjectLine?: string | null, > PersonalMessage?: string | null, > CustomerJourneyID?: string | number | null, > DateCreated?: string | null, > SignOrder?: string | number | null, > OriginalDateSent?: string | null, > DateSent?: string | null, > QuoteID?: string | number | null, > Signed?: string | number | null, > SignedName?: string | null, > SignedDate?: string | null, > SignedTime?: string | null, > EditLock?: string | number | null, > ProposalPassword?: string | null, > CompanyName?: string | null, > CompanyCRMID?: string | null, > OneOffTotal?: string | null, > MonthlyTotal?: string | null, > QuarterlyTotal?: string | null, > AnnualTotal?: string | null, > SignedFirstName?: string | null, > SignedSurname?: string | null, > SignedEmail?: string | null, > CurrencyName?: string | null, > CurrencySymbol?: string | null, > CRMOpportunityID?: string | number | null, > Preview?: string | null, > ProposalView?: string | null, > Contacts?: { > Email?: string | null, > FirstName?: string | null, > Surname?: string | null, > Link?: string | null, > Signature?: boolean | string | number | null > }[] | null, > PriceTables?: { > ID?: string | number | null, > Title?: string | null, > Show?: boolean | null, > ForceClientChoice?: boolean | null, > DateCreated?: string | null, > DisplayOrder?: string | number | null, > Items?: { > ID?: string | number | null, > Label?: string | null, > Description?: string | null, > Date?: string | null, > PriceType?: string | null, > UnitCost?: string | null, > Cost?: string | null, > RecurringType?: string | null, > MonthlyCost?: string | null, > ShowQuantity?: boolean | null, > CanClientSetQuantity?: boolean | null, > Quantity?: string | number | null, > isQuantityLimited?: boolean | null, > QuantityMin?: string | number | null, > QuantityMax?: string | number | null, > Optional?: boolean | null, > Selected?: boolean | null, > Selectable?: boolean | null, > Discount?: boolean | string | number | null, > DiscountType?: boolean | string | number | null, > DiscountAmount?: string | null, > TableDiscount?: boolean | string | number | null, > TableDiscountType?: boolean | string | number | null, > TableDiscountAmount?: string | null, > TaxExemptionStatus?: boolean | null, > DisplayOrder?: string | number | null > }[] | null > }[] | null > } > ``` *** ### getCount `proposals.getCount` Get total proposal count across account **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.proposals.getCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `count` | `number` | Yes | — | *** ### getNew `proposals.getNew` Get new proposals that have not yet been sent **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.proposals.getNew({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | | `type` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AssignedTo?: string | number | null, > BrandID?: string | number | null, > ViewType?: string | null, > CurrencyCode?: string | null, > Tax?: string | number | null, > TaxLabel?: string | null, > TaxAmount?: string | null, > TaxPercentage?: string | null, > TaxName?: string | null, > Amount?: string | null, > AmountDesc?: string | null, > Paid?: string | number | null, > DatePaid?: string | null, > CoverID?: string | number | null, > TypeID?: string | number | null, > Description?: string | null, > SubjectLine?: string | null, > PersonalMessage?: string | null, > CustomerJourneyID?: string | number | null, > DateCreated?: string | null, > SignOrder?: string | number | null, > OriginalDateSent?: string | null, > DateSent?: string | null, > QuoteID?: string | number | null, > Signed?: string | number | null, > SignedName?: string | null, > SignedDate?: string | null, > SignedTime?: string | null, > EditLock?: string | number | null, > ProposalPassword?: string | null, > CompanyName?: string | null, > CompanyCRMID?: string | null, > OneOffTotal?: string | null, > MonthlyTotal?: string | null, > QuarterlyTotal?: string | null, > AnnualTotal?: string | null, > SignedFirstName?: string | null, > SignedSurname?: string | null, > SignedEmail?: string | null, > CurrencyName?: string | null, > CurrencySymbol?: string | null, > CRMOpportunityID?: string | number | null, > Preview?: string | null, > ProposalView?: string | null, > Contacts?: { > Email?: string | null, > FirstName?: string | null, > Surname?: string | null, > Link?: string | null, > Signature?: boolean | string | number | null > }[] | null, > PriceTables?: { > ID?: string | number | null, > Title?: string | null, > Show?: boolean | null, > ForceClientChoice?: boolean | null, > DateCreated?: string | null, > DisplayOrder?: string | number | null, > Items?: { > ID?: string | number | null, > Label?: string | null, > Description?: string | null, > Date?: string | null, > PriceType?: string | null, > UnitCost?: string | null, > Cost?: string | null, > RecurringType?: string | null, > MonthlyCost?: string | null, > ShowQuantity?: boolean | null, > CanClientSetQuantity?: boolean | null, > Quantity?: string | number | null, > isQuantityLimited?: boolean | null, > QuantityMin?: string | number | null, > QuantityMax?: string | number | null, > Optional?: boolean | null, > Selected?: boolean | null, > Selectable?: boolean | null, > Discount?: boolean | string | number | null, > DiscountType?: boolean | string | number | null, > DiscountAmount?: string | null, > TableDiscount?: boolean | string | number | null, > TableDiscountType?: boolean | string | number | null, > TableDiscountAmount?: string | null, > TaxExemptionStatus?: boolean | null, > DisplayOrder?: string | number | null > }[] | null > }[] | null > }[] > ``` *** ### getOpened `proposals.getOpened` Get proposals that have been opened by recipients **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.proposals.getOpened({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | | `type` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AssignedTo?: string | number | null, > BrandID?: string | number | null, > ViewType?: string | null, > CurrencyCode?: string | null, > Tax?: string | number | null, > TaxLabel?: string | null, > TaxAmount?: string | null, > TaxPercentage?: string | null, > TaxName?: string | null, > Amount?: string | null, > AmountDesc?: string | null, > Paid?: string | number | null, > DatePaid?: string | null, > CoverID?: string | number | null, > TypeID?: string | number | null, > Description?: string | null, > SubjectLine?: string | null, > PersonalMessage?: string | null, > CustomerJourneyID?: string | number | null, > DateCreated?: string | null, > SignOrder?: string | number | null, > OriginalDateSent?: string | null, > DateSent?: string | null, > QuoteID?: string | number | null, > Signed?: string | number | null, > SignedName?: string | null, > SignedDate?: string | null, > SignedTime?: string | null, > EditLock?: string | number | null, > ProposalPassword?: string | null, > CompanyName?: string | null, > CompanyCRMID?: string | null, > OneOffTotal?: string | null, > MonthlyTotal?: string | null, > QuarterlyTotal?: string | null, > AnnualTotal?: string | null, > SignedFirstName?: string | null, > SignedSurname?: string | null, > SignedEmail?: string | null, > CurrencyName?: string | null, > CurrencySymbol?: string | null, > CRMOpportunityID?: string | number | null, > Preview?: string | null, > ProposalView?: string | null, > Contacts?: { > Email?: string | null, > FirstName?: string | null, > Surname?: string | null, > Link?: string | null, > Signature?: boolean | string | number | null > }[] | null, > PriceTables?: { > ID?: string | number | null, > Title?: string | null, > Show?: boolean | null, > ForceClientChoice?: boolean | null, > DateCreated?: string | null, > DisplayOrder?: string | number | null, > Items?: { > ID?: string | number | null, > Label?: string | null, > Description?: string | null, > Date?: string | null, > PriceType?: string | null, > UnitCost?: string | null, > Cost?: string | null, > RecurringType?: string | null, > MonthlyCost?: string | null, > ShowQuantity?: boolean | null, > CanClientSetQuantity?: boolean | null, > Quantity?: string | number | null, > isQuantityLimited?: boolean | null, > QuantityMin?: string | number | null, > QuantityMax?: string | number | null, > Optional?: boolean | null, > Selected?: boolean | null, > Selectable?: boolean | null, > Discount?: boolean | string | number | null, > DiscountType?: boolean | string | number | null, > DiscountAmount?: string | null, > TableDiscount?: boolean | string | number | null, > TableDiscountType?: boolean | string | number | null, > TableDiscountAmount?: string | null, > TaxExemptionStatus?: boolean | null, > DisplayOrder?: string | number | null > }[] | null > }[] | null > }[] > ``` *** ### getPaid `proposals.getPaid` Get proposals that have been paid **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.proposals.getPaid({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | | `type` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AssignedTo?: string | number | null, > BrandID?: string | number | null, > ViewType?: string | null, > CurrencyCode?: string | null, > Tax?: string | number | null, > TaxLabel?: string | null, > TaxAmount?: string | null, > TaxPercentage?: string | null, > TaxName?: string | null, > Amount?: string | null, > AmountDesc?: string | null, > Paid?: string | number | null, > DatePaid?: string | null, > CoverID?: string | number | null, > TypeID?: string | number | null, > Description?: string | null, > SubjectLine?: string | null, > PersonalMessage?: string | null, > CustomerJourneyID?: string | number | null, > DateCreated?: string | null, > SignOrder?: string | number | null, > OriginalDateSent?: string | null, > DateSent?: string | null, > QuoteID?: string | number | null, > Signed?: string | number | null, > SignedName?: string | null, > SignedDate?: string | null, > SignedTime?: string | null, > EditLock?: string | number | null, > ProposalPassword?: string | null, > CompanyName?: string | null, > CompanyCRMID?: string | null, > OneOffTotal?: string | null, > MonthlyTotal?: string | null, > QuarterlyTotal?: string | null, > AnnualTotal?: string | null, > SignedFirstName?: string | null, > SignedSurname?: string | null, > SignedEmail?: string | null, > CurrencyName?: string | null, > CurrencySymbol?: string | null, > CRMOpportunityID?: string | number | null, > Preview?: string | null, > ProposalView?: string | null, > Contacts?: { > Email?: string | null, > FirstName?: string | null, > Surname?: string | null, > Link?: string | null, > Signature?: boolean | string | number | null > }[] | null, > PriceTables?: { > ID?: string | number | null, > Title?: string | null, > Show?: boolean | null, > ForceClientChoice?: boolean | null, > DateCreated?: string | null, > DisplayOrder?: string | number | null, > Items?: { > ID?: string | number | null, > Label?: string | null, > Description?: string | null, > Date?: string | null, > PriceType?: string | null, > UnitCost?: string | null, > Cost?: string | null, > RecurringType?: string | null, > MonthlyCost?: string | null, > ShowQuantity?: boolean | null, > CanClientSetQuantity?: boolean | null, > Quantity?: string | number | null, > isQuantityLimited?: boolean | null, > QuantityMin?: string | number | null, > QuantityMax?: string | number | null, > Optional?: boolean | null, > Selected?: boolean | null, > Selectable?: boolean | null, > Discount?: boolean | string | number | null, > DiscountType?: boolean | string | number | null, > DiscountAmount?: string | null, > TableDiscount?: boolean | string | number | null, > TableDiscountType?: boolean | string | number | null, > TableDiscountAmount?: string | null, > TaxExemptionStatus?: boolean | null, > DisplayOrder?: string | number | null > }[] | null > }[] | null > }[] > ``` *** ### getSent `proposals.getSent` Get sent proposals **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.proposals.getSent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | | `type` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AssignedTo?: string | number | null, > BrandID?: string | number | null, > ViewType?: string | null, > CurrencyCode?: string | null, > Tax?: string | number | null, > TaxLabel?: string | null, > TaxAmount?: string | null, > TaxPercentage?: string | null, > TaxName?: string | null, > Amount?: string | null, > AmountDesc?: string | null, > Paid?: string | number | null, > DatePaid?: string | null, > CoverID?: string | number | null, > TypeID?: string | number | null, > Description?: string | null, > SubjectLine?: string | null, > PersonalMessage?: string | null, > CustomerJourneyID?: string | number | null, > DateCreated?: string | null, > SignOrder?: string | number | null, > OriginalDateSent?: string | null, > DateSent?: string | null, > QuoteID?: string | number | null, > Signed?: string | number | null, > SignedName?: string | null, > SignedDate?: string | null, > SignedTime?: string | null, > EditLock?: string | number | null, > ProposalPassword?: string | null, > CompanyName?: string | null, > CompanyCRMID?: string | null, > OneOffTotal?: string | null, > MonthlyTotal?: string | null, > QuarterlyTotal?: string | null, > AnnualTotal?: string | null, > SignedFirstName?: string | null, > SignedSurname?: string | null, > SignedEmail?: string | null, > CurrencyName?: string | null, > CurrencySymbol?: string | null, > CRMOpportunityID?: string | number | null, > Preview?: string | null, > ProposalView?: string | null, > Contacts?: { > Email?: string | null, > FirstName?: string | null, > Surname?: string | null, > Link?: string | null, > Signature?: boolean | string | number | null > }[] | null, > PriceTables?: { > ID?: string | number | null, > Title?: string | null, > Show?: boolean | null, > ForceClientChoice?: boolean | null, > DateCreated?: string | null, > DisplayOrder?: string | number | null, > Items?: { > ID?: string | number | null, > Label?: string | null, > Description?: string | null, > Date?: string | null, > PriceType?: string | null, > UnitCost?: string | null, > Cost?: string | null, > RecurringType?: string | null, > MonthlyCost?: string | null, > ShowQuantity?: boolean | null, > CanClientSetQuantity?: boolean | null, > Quantity?: string | number | null, > isQuantityLimited?: boolean | null, > QuantityMin?: string | number | null, > QuantityMax?: string | number | null, > Optional?: boolean | null, > Selected?: boolean | null, > Selectable?: boolean | null, > Discount?: boolean | string | number | null, > DiscountType?: boolean | string | number | null, > DiscountAmount?: string | null, > TableDiscount?: boolean | string | number | null, > TableDiscountType?: boolean | string | number | null, > TableDiscountAmount?: string | null, > TaxExemptionStatus?: boolean | null, > DisplayOrder?: string | number | null > }[] | null > }[] | null > }[] > ``` *** ### getSigned `proposals.getSigned` Get signed proposals **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.proposals.getSigned({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | | `type` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AssignedTo?: string | number | null, > BrandID?: string | number | null, > ViewType?: string | null, > CurrencyCode?: string | null, > Tax?: string | number | null, > TaxLabel?: string | null, > TaxAmount?: string | null, > TaxPercentage?: string | null, > TaxName?: string | null, > Amount?: string | null, > AmountDesc?: string | null, > Paid?: string | number | null, > DatePaid?: string | null, > CoverID?: string | number | null, > TypeID?: string | number | null, > Description?: string | null, > SubjectLine?: string | null, > PersonalMessage?: string | null, > CustomerJourneyID?: string | number | null, > DateCreated?: string | null, > SignOrder?: string | number | null, > OriginalDateSent?: string | null, > DateSent?: string | null, > QuoteID?: string | number | null, > Signed?: string | number | null, > SignedName?: string | null, > SignedDate?: string | null, > SignedTime?: string | null, > EditLock?: string | number | null, > ProposalPassword?: string | null, > CompanyName?: string | null, > CompanyCRMID?: string | null, > OneOffTotal?: string | null, > MonthlyTotal?: string | null, > QuarterlyTotal?: string | null, > AnnualTotal?: string | null, > SignedFirstName?: string | null, > SignedSurname?: string | null, > SignedEmail?: string | null, > CurrencyName?: string | null, > CurrencySymbol?: string | null, > CRMOpportunityID?: string | number | null, > Preview?: string | null, > ProposalView?: string | null, > Contacts?: { > Email?: string | null, > FirstName?: string | null, > Surname?: string | null, > Link?: string | null, > Signature?: boolean | string | number | null > }[] | null, > PriceTables?: { > ID?: string | number | null, > Title?: string | null, > Show?: boolean | null, > ForceClientChoice?: boolean | null, > DateCreated?: string | null, > DisplayOrder?: string | number | null, > Items?: { > ID?: string | number | null, > Label?: string | null, > Description?: string | null, > Date?: string | null, > PriceType?: string | null, > UnitCost?: string | null, > Cost?: string | null, > RecurringType?: string | null, > MonthlyCost?: string | null, > ShowQuantity?: boolean | null, > CanClientSetQuantity?: boolean | null, > Quantity?: string | number | null, > isQuantityLimited?: boolean | null, > QuantityMin?: string | number | null, > QuantityMax?: string | number | null, > Optional?: boolean | null, > Selected?: boolean | null, > Selectable?: boolean | null, > Discount?: boolean | string | number | null, > DiscountType?: boolean | string | number | null, > DiscountAmount?: string | null, > TableDiscount?: boolean | string | number | null, > TableDiscountType?: boolean | string | number | null, > TableDiscountAmount?: string | null, > TaxExemptionStatus?: boolean | null, > DisplayOrder?: string | number | null > }[] | null > }[] | null > }[] > ``` *** ### list `proposals.list` Get all proposals with optional pagination and document type filtering **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.proposals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | | `type` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AssignedTo?: string | number | null, > BrandID?: string | number | null, > ViewType?: string | null, > CurrencyCode?: string | null, > Tax?: string | number | null, > TaxLabel?: string | null, > TaxAmount?: string | null, > TaxPercentage?: string | null, > TaxName?: string | null, > Amount?: string | null, > AmountDesc?: string | null, > Paid?: string | number | null, > DatePaid?: string | null, > CoverID?: string | number | null, > TypeID?: string | number | null, > Description?: string | null, > SubjectLine?: string | null, > PersonalMessage?: string | null, > CustomerJourneyID?: string | number | null, > DateCreated?: string | null, > SignOrder?: string | number | null, > OriginalDateSent?: string | null, > DateSent?: string | null, > QuoteID?: string | number | null, > Signed?: string | number | null, > SignedName?: string | null, > SignedDate?: string | null, > SignedTime?: string | null, > EditLock?: string | number | null, > ProposalPassword?: string | null, > CompanyName?: string | null, > CompanyCRMID?: string | null, > OneOffTotal?: string | null, > MonthlyTotal?: string | null, > QuarterlyTotal?: string | null, > AnnualTotal?: string | null, > SignedFirstName?: string | null, > SignedSurname?: string | null, > SignedEmail?: string | null, > CurrencyName?: string | null, > CurrencySymbol?: string | null, > CRMOpportunityID?: string | number | null, > Preview?: string | null, > ProposalView?: string | null, > Contacts?: { > Email?: string | null, > FirstName?: string | null, > Surname?: string | null, > Link?: string | null, > Signature?: boolean | string | number | null > }[] | null, > PriceTables?: { > ID?: string | number | null, > Title?: string | null, > Show?: boolean | null, > ForceClientChoice?: boolean | null, > DateCreated?: string | null, > DisplayOrder?: string | number | null, > Items?: { > ID?: string | number | null, > Label?: string | null, > Description?: string | null, > Date?: string | null, > PriceType?: string | null, > UnitCost?: string | null, > Cost?: string | null, > RecurringType?: string | null, > MonthlyCost?: string | null, > ShowQuantity?: boolean | null, > CanClientSetQuantity?: boolean | null, > Quantity?: string | number | null, > isQuantityLimited?: boolean | null, > QuantityMin?: string | number | null, > QuantityMax?: string | number | null, > Optional?: boolean | null, > Selected?: boolean | null, > Selectable?: boolean | null, > Discount?: boolean | string | number | null, > DiscountType?: boolean | string | number | null, > DiscountAmount?: string | null, > TableDiscount?: boolean | string | number | null, > TableDiscountType?: boolean | string | number | null, > TableDiscountAmount?: string | null, > TaxExemptionStatus?: boolean | null, > DisplayOrder?: string | number | null > }[] | null > }[] | null > }[] > ``` *** ## Quotes ### get `quotes.get` Get details for a specific quote by ID **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.quotes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `quote_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > Status?: string | number | null, > MarkDead?: string | number | null, > MarkedDeadBy?: string | number | null, > DateMarkedDead?: string | null, > CompanyID?: string | number | null, > QuoteAmount?: string | null, > MonthlyAmount?: string | null, > QuarterlyAmount?: string | null, > AnnualAmount?: string | null, > VatAmount?: string | null, > QuoteTotal?: string | null, > CreatedBy?: string | number | null, > DateCreated?: string | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > DateAccepted?: string | null, > DateCompleted?: string | null, > Archived?: string | number | null, > ArchivedBy?: string | number | null, > DateArchived?: string | null, > Deleted?: string | number | null, > DeletedBy?: string | number | null, > DateDeleted?: string | null > } | any[] > ``` *** ### list `quotes.list` Get all quotes with optional pagination **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.quotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > Status?: string | number | null, > MarkDead?: string | number | null, > MarkedDeadBy?: string | number | null, > DateMarkedDead?: string | null, > CompanyID?: string | number | null, > QuoteAmount?: string | null, > MonthlyAmount?: string | null, > QuarterlyAmount?: string | null, > AnnualAmount?: string | null, > VatAmount?: string | null, > QuoteTotal?: string | null, > CreatedBy?: string | number | null, > DateCreated?: string | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > DateAccepted?: string | null, > DateCompleted?: string | null, > Archived?: string | number | null, > ArchivedBy?: string | number | null, > DateArchived?: string | null, > Deleted?: string | number | null, > DeletedBy?: string | number | null, > DateDeleted?: string | null > }[] > ``` *** ## Settings ### get `settings.get` Get account settings including tax and timezone information **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.settings.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID?: string | number | null, > AccountID?: string | number | null, > CurrencyID?: string | number | null, > Tax?: string | number | null, > TaxLabel?: string | null, > TaxAmount?: string | null, > TimeZone?: string | null, > CustomerJourneysActive?: string | number | null, > CustomerJourneysDefault?: string | number | null, > EditedBy?: string | number | null, > DateEdited?: string | null > } > ``` *** ### getBrand `settings.getBrand` Get brand settings including default currency, tax, and company styling **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.settings.getBrand({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID?: string | number | null, > AccountID?: string | number | null, > Default?: string | number | null, > PageTitle?: string | null, > Name?: string | null, > CurrencyID?: string | number | null, > Tax?: string | number | null, > TaxLabel?: string | null, > TaxAmount?: string | null, > ShowBadge?: string | number | null, > CompanyName?: string | null, > DateCreated?: string | null, > CreatedBy?: string | number | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > Deleted?: string | number | null > } > ``` *** ### listMergeTags `settings.listMergeTags` List custom merge tags configured in the account **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.settings.listMergeTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > Name?: string | null, > Tag?: string | null, > Fallback?: string | null, > DateCreated?: string | null, > CreatedBy?: string | number | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > Archived?: string | number | null, > DateArchived?: string | null, > ArchivedBy?: string | number | null, > CRMSync?: string | number | null, > CRMTagName?: string | null, > CRMTagId?: string | number | null > }[] > ``` *** ## Templates ### get `templates.get` Get details for a specific proposal template by ID **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.templates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > CoverID?: string | number | null, > BrandID?: string | number | null, > TemplateName?: string | null, > Description?: string | null, > QuoteAmount?: string | null, > MonthlyAmount?: string | null, > QuarterlyAmount?: string | null, > AnnualAmount?: string | null, > DateCreated?: string | null, > CreatedBy?: string | number | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > Default?: string | number | null, > Deleted?: string | number | null, > IndustryID?: string | number | null, > SampleTemplate?: string | number | null, > FromMarketplace?: string | number | null, > CategoryID?: string | number | null > } | any[] > ``` *** ### list `templates.list` Get all proposal templates with optional pagination **Risk:** `read` ```ts theme={null} await corsair.betterproposals.api.templates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number \| string` | No | — | | `per_page` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > ID: string | number, > AccountID?: string | number | null, > CoverID?: string | number | null, > BrandID?: string | number | null, > TemplateName?: string | null, > Description?: string | null, > QuoteAmount?: string | null, > MonthlyAmount?: string | null, > QuarterlyAmount?: string | null, > AnnualAmount?: string | null, > DateCreated?: string | null, > CreatedBy?: string | number | null, > DateEdited?: string | null, > EditedBy?: string | number | null, > Default?: string | number | null, > Deleted?: string | number | null, > IndustryID?: string | number | null, > SampleTemplate?: string | number | null, > FromMarketplace?: string | number | null, > CategoryID?: string | number | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/betterproposals/database Better Proposals local sync: searchable entities, `.search()` filters, and operators. The Better Proposals plugin syncs data locally. Use `corsair.betterproposals.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Brands Path: `betterproposals.db.brands.search` ```ts theme={null} const rows = await corsair.betterproposals.db.brands.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `CompanyName` | `string` | equals, contains, startsWith, endsWith, in | | `TaxLabel` | `string` | equals, contains, startsWith, endsWith, in | | `TaxAmount` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Companies Path: `betterproposals.db.companies.search` ```ts theme={null} const rows = await corsair.betterproposals.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `CompanyName` | `string` | equals, contains, startsWith, endsWith, in | | `CompanyCRMID` | `string` | equals, contains, startsWith, endsWith, in | | `DateCreated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Covers Path: `betterproposals.db.covers.search` ```ts theme={null} const rows = await corsair.betterproposals.db.covers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `Headline` | `string` | equals, contains, startsWith, endsWith, in | | `Subheader` | `string` | equals, contains, startsWith, endsWith, in | | `BGColour` | `string` | equals, contains, startsWith, endsWith, in | | `TextColour` | `string` | equals, contains, startsWith, endsWith, in | | `TextAlign` | `string` | equals, contains, startsWith, endsWith, in | | `ButtonStyle` | `string` | equals, contains, startsWith, endsWith, in | | `ButtonText` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Currencies Path: `betterproposals.db.currencies.search` ```ts theme={null} const rows = await corsair.betterproposals.db.currencies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencyName` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencySymbol` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencyCode` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Document Types Path: `betterproposals.db.documentTypes.search` ```ts theme={null} const rows = await corsair.betterproposals.db.documentTypes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `TypeName` | `string` | equals, contains, startsWith, endsWith, in | | `TypeColour` | `string` | equals, contains, startsWith, endsWith, in | | `TypeNameSingular` | `string` | equals, contains, startsWith, endsWith, in | | `TypeIcon` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Merge Tags Path: `betterproposals.db.mergeTags.search` ```ts theme={null} const rows = await corsair.betterproposals.db.mergeTags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `Tag` | `string` | equals, contains, startsWith, endsWith, in | | `Fallback` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Proposals Path: `betterproposals.db.proposals.search` ```ts theme={null} const rows = await corsair.betterproposals.db.proposals.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `CompanyName` | `string` | equals, contains, startsWith, endsWith, in | | `CompanyCRMID` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencyCode` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencyName` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencySymbol` | `string` | equals, contains, startsWith, endsWith, in | | `DateCreated` | `string` | equals, contains, startsWith, endsWith, in | | `Preview` | `string` | equals, contains, startsWith, endsWith, in | | `ProposalView` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Quotes Path: `betterproposals.db.quotes.search` ```ts theme={null} const rows = await corsair.betterproposals.db.quotes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `QuoteAmount` | `string` | equals, contains, startsWith, endsWith, in | | `QuoteTotal` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Settings Path: `betterproposals.db.settings.search` ```ts theme={null} const rows = await corsair.betterproposals.db.settings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `TaxLabel` | `string` | equals, contains, startsWith, endsWith, in | | `TaxAmount` | `string` | equals, contains, startsWith, endsWith, in | | `TimeZone` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `betterproposals.db.templates.search` ```ts theme={null} const rows = await corsair.betterproposals.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `TemplateName` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/betterproposals/overview Proposal software for creating, sending, and tracking client sales documents online. Use **Better Proposals** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 23 typed API operations * 10 synced entities (`brands`, `companies`, `covers`, `currencies`, `documentTypes`, `mergeTags`, and 4 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/betterproposals ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/betterproposals ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/betterproposals ``` ```bash bun theme={null} bun add corsair @corsair-dev/betterproposals ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { betterproposals } from '@corsair-dev/betterproposals'; export const corsair = createCorsair({ plugins: [ betterproposals(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} betterproposals() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'betterproposals', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`companies.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.betterproposals.api.companies.get({}); ``` **`companies.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.betterproposals.api.companies.create({}); ``` See the full list on the [API](/plugins/betterproposals/api) page. ## Query synced data Synced entities support `tenant.betterproposals.db..search()` and `.list()`: `brands`, `companies`, `covers`, `currencies`, `documentTypes`, `mergeTags`, `proposals`, `quotes`, `settings`, `templates`. See [Database](/plugins/betterproposals/database) for filters and operators. ## What's next > **[API reference](/plugins/betterproposals/api)** > > Every `betterproposals.api.*` operation with input and output types. > **[Database](/plugins/betterproposals/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Database Source: https://docs.corsair.dev/plugins/betterstack/database Better Stack local sync: searchable entities, `.search()` filters, and operators. The Better Stack plugin syncs data locally. Use `corsair.betterstack.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Heartbeat Groups Path: `betterstack.db.heartbeatGroups.search` ```ts theme={null} const rows = await corsair.betterstack.db.heartbeatGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `paused` | `boolean` | equals | | `sort_index` | `number` | equals, gt, gte, lt, lte, in | | `team_name` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Heartbeats Path: `betterstack.db.heartbeats.search` ```ts theme={null} const rows = await corsair.betterstack.db.heartbeats.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `call` | `boolean` | equals | | `created_at` | `date` | equals, before, after, between | | `critical_alert` | `boolean` | equals | | `email` | `boolean` | equals | | `grace` | `number` | equals, gt, gte, lt, lte, in | | `heartbeat_group_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `paused` | `boolean` | equals | | `paused_at` | `string` | equals, contains, startsWith, endsWith, in | | `period` | `number` | equals, gt, gte, lt, lte, in | | `push` | `boolean` | equals | | `sms` | `boolean` | equals | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `team_name` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `date` | equals, before, after, between | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Monitor Groups Path: `betterstack.db.monitorGroups.search` ```ts theme={null} const rows = await corsair.betterstack.db.monitorGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `paused` | `boolean` | equals | | `sort_index` | `number` | equals, gt, gte, lt, lte, in | | `team_name` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Monitors Path: `betterstack.db.monitors.search` ```ts theme={null} const rows = await corsair.betterstack.db.monitors.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `call` | `boolean` | equals | | `check_frequency` | `number` | equals, gt, gte, lt, lte, in | | `checks_version` | `string` | equals, contains, startsWith, endsWith, in | | `confirmation_period` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `date` | equals, before, after, between | | `critical_alert` | `boolean` | equals | | `effective_check_frequency` | `number` | equals, gt, gte, lt, lte, in | | `email` | `boolean` | equals | | `follow_redirects` | `boolean` | equals | | `http_method` | `string` | equals, contains, startsWith, endsWith, in | | `last_checked_at` | `string` | equals, contains, startsWith, endsWith, in | | `monitor_group_id` | `number` | equals, gt, gte, lt, lte, in | | `monitor_type` | `string` | equals, contains, startsWith, endsWith, in | | `paused` | `boolean` | equals | | `paused_at` | `string` | equals, contains, startsWith, endsWith, in | | `pronounceable_name` | `string` | equals, contains, startsWith, endsWith, in | | `push` | `boolean` | equals | | `recovery_period` | `number` | equals, gt, gte, lt, lte, in | | `remember_cookies` | `boolean` | equals | | `request_timeout` | `number` | equals, gt, gte, lt, lte, in | | `sms` | `boolean` | equals | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `team_name` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `date` | equals, before, after, between | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `verify_ssl` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## On Call Schedules Path: `betterstack.db.onCallSchedules.search` ```ts theme={null} const rows = await corsair.betterstack.db.onCallSchedules.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `default_calendar` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `team_name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Policies Path: `betterstack.db.policies.search` ```ts theme={null} const rows = await corsair.betterstack.db.policies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `incident_token` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `repeat_count` | `number` | equals, gt, gte, lt, lte, in | | `repeat_delay` | `number` | equals, gt, gte, lt, lte, in | | `team_name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Status Pages Path: `betterstack.db.statusPages.search` ```ts theme={null} const rows = await corsair.betterstack.db.statusPages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `aggregate_state` | `string` | equals, contains, startsWith, endsWith, in | | `announcement_embed_visible` | `boolean` | equals | | `automatic_reports` | `boolean` | equals | | `company_name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `design` | `string` | equals, contains, startsWith, endsWith, in | | `hide_from_search_engines` | `boolean` | equals | | `history` | `number` | equals, gt, gte, lt, lte, in | | `include_all_incidents_in_rss_feed` | `boolean` | equals | | `layout` | `string` | equals, contains, startsWith, endsWith, in | | `min_incident_length` | `number` | equals, gt, gte, lt, lte, in | | `organization_id` | `number` | equals, gt, gte, lt, lte, in | | `password_enabled` | `boolean` | equals | | `published` | `boolean` | equals | | `require_sso` | `boolean` | equals | | `subdomain` | `string` | equals, contains, startsWith, endsWith, in | | `subscribable` | `boolean` | equals | | `theme` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `date` | equals, before, after, between | | `whitelabeled` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Urgencies Path: `betterstack.db.urgencies.search` ```ts theme={null} const rows = await corsair.betterstack.db.urgencies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `call` | `boolean` | equals | | `critical_alert` | `boolean` | equals | | `email` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `push` | `boolean` | equals | | `sms` | `boolean` | equals | | `team_name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/betterstack/overview Observability platform combining uptime monitoring, logging, and incident management. Use **Better Stack** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 117 typed API operations * 8 synced entities (`heartbeatGroups`, `heartbeats`, `monitorGroups`, `monitors`, `onCallSchedules`, `policies`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/betterstack ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/betterstack ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/betterstack ``` ```bash bun theme={null} bun add corsair @corsair-dev/betterstack ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { betterstack } from '@corsair-dev/betterstack'; export const corsair = createCorsair({ plugins: [ betterstack(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} betterstack() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'betterstack', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`catalog.relations`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.betterstack.api.catalog.relations({}); ``` **`heartbeatGroups.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.betterstack.api.heartbeatGroups.create({}); ``` See the full list on the [API](/plugins/betterstack/api) page. ## Query synced data Synced entities support `tenant.betterstack.db..search()` and `.list()`: `heartbeatGroups`, `heartbeats`, `monitorGroups`, `monitors`, `onCallSchedules`, `policies`, `statusPages`, `urgencies`. See [Database](/plugins/betterstack/database) for filters and operators. ## What's next > **[API reference](/plugins/betterstack/api)** > > Every `betterstack.api.*` operation with input and output types. > **[Database](/plugins/betterstack/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bigdatacloud/api API reference for BigDataCloud: every `bigdatacloud.api.*` operation with input and output types. Every `bigdatacloud.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Asn ### asnExtendedReceivingFromInfo `asn.asnExtendedReceivingFromInfo` Tool to return upstream providers (receivingFrom) for a given ASN. Use when you need a paginated list of ASes feeding traffic for the specified ASN. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.asn.asnExtendedReceivingFromInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `asn` | `string` | Yes | — | | `batchSize` | `number` | No | — | | `offset` | `number` | No | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `asn` | `string` | Yes | — | | `asnNumeric` | `number` | Yes | — | | `organisation` | `string` | No | — | | `name` | `string` | No | — | | `totalReceivingFrom` | `number` | No | — | | `receivingFrom` | `object[]` | No | — | > **receivingFrom full type** > > ```ts theme={null} > { > asn?: string, > asnNumeric?: number, > organisation?: string, > name?: string, > registry?: string, > registeredCountry?: string, > registeredCountryName?: string, > registrationDate?: string, > registrationLastChange?: string, > totalIpv4Addresses?: number, > totalIpv4Prefixes?: number, > totalIpv4BogonPrefixes?: number, > totalIpv6Prefixes?: number, > totalIpv6BogonPrefixes?: number, > rank?: number, > rankText?: string > }[] > ``` *** ### asnExtendedTransitToInfo `asn.asnExtendedTransitToInfo` Tool to return downstream customers (transitTo) for a given ASN. Use when you need a paginated list of ASes receiving traffic from a specific ASN. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.asn.asnExtendedTransitToInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `asn` | `string` | Yes | — | | `batchSize` | `number` | No | — | | `offset` | `number` | No | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `asn` | `string` | Yes | — | | `asnNumeric` | `number` | Yes | — | | `organisation` | `string` | No | — | | `name` | `string` | No | — | | `totalTransitTo` | `number` | No | — | | `transitTo` | `object[]` | No | — | > **transitTo full type** > > ```ts theme={null} > { > asn?: string, > asnNumeric?: number, > organisation?: string, > name?: string, > registry?: string, > registeredCountry?: string, > registeredCountryName?: string, > registrationDate?: string, > registrationLastChange?: string, > totalIpv4Addresses?: number, > totalIpv4Prefixes?: number, > totalIpv4BogonPrefixes?: number, > totalIpv6Prefixes?: number, > totalIpv6BogonPrefixes?: number, > rank?: number, > rankText?: string > }[] > ``` *** ### asnRankList `asn.asnRankList` Retrieves a ranked list of Autonomous Systems (ASNs) sorted by IPv4 address announcement volumes. Use cases: - Find the largest ASNs by IP address count (DoD, Amazon, Microsoft, etc.) - Look up ASN rankings for network analysis - Paginate through the global ASN database (79,000+ entries) - Sort ASNs by various criteria (rank, name, organisation, country) Returns paginated results with total count for navigation. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.asn.asnRankList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchSize` | `number` | No | — | | `offset` | `number` | No | — | | `sort` | `rank \| asn \| asnNumeric \| organisation \| countryCode` | No | — | | `order` | `asc \| desc` | No | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | Yes | — | | `offset` | `number` | Yes | — | | `batch` | `number` | Yes | — | | `asns` | `object[]` | Yes | — | > **asns full type** > > ```ts theme={null} > { > asn?: string, > asnNumeric?: number, > organisation?: string, > name?: string, > registry?: string, > registeredCountry?: string, > registeredCountryName?: string, > registrationDate?: string, > registrationLastChange?: string, > totalIpv4Addresses?: number, > totalIpv4Prefixes?: number, > totalIpv4BogonPrefixes?: number, > totalIpv6Prefixes?: number, > totalIpv6BogonPrefixes?: number, > rank?: number, > rankText?: string > }[] > ``` *** ### bgpActivePrefixes `asn.bgpActivePrefixes` Tool to retrieve IPv4 or IPv6 prefixes currently announced on BGP. Use when inspecting BGP routing announcements for a given ASN. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.asn.bgpActivePrefixes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `asn` | `string` | Yes | — | | `isv4` | `boolean` | No | — | | `bogonsOnly` | `boolean` | No | — | | `batchSize` | `number` | No | — | | `offset` | `number` | No | — | | `sort` | `bgpPrefix \| bgpPrefixNetworkAddress \| bgpPrefixLastAddress \| registryStatus \| isBogon \| isAnnounced \| carriers` | No | — | | `order` | `asc \| desc` | No | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | Yes | — | | `offset` | `number` | Yes | — | | `batch` | `number` | Yes | — | | `prefixes` | `object[]` | Yes | — | > **prefixes full type** > > ```ts theme={null} > { > bgpPrefix: string, > bgpPrefixNetworkAddress?: string, > bgpPrefixLastAddress?: string, > registryStatus?: string, > isBogon?: boolean, > isAnnounced?: boolean, > carriers?: { > asn?: string, > asnNumeric?: number, > organisation?: string, > name?: string, > registry?: string, > registeredCountry?: string, > registeredCountryName?: string, > registrationDate?: string, > registrationLastChange?: string, > totalIpv4Addresses?: number, > totalIpv4Prefixes?: number, > totalIpv4BogonPrefixes?: number, > totalIpv6Prefixes?: number, > totalIpv6BogonPrefixes?: number, > rank?: number, > rankText?: string > }[] > }[] > ``` *** ## Location ### amIRoaming `location.amIRoaming` Tool to determine if the user is roaming based on their IP address and GPS coordinates. Use after obtaining device location to verify roaming status before mobile actions. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.location.amIRoaming({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `latitude` | `number` | Yes | — | | `longitude` | `number` | Yes | — | | `ip` | `string` | Yes | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `isRoaming` | `boolean` | Yes | — | *** ### countryByIpAddress `location.countryByIpAddress` Tool to geolocate an IP address and retrieve country details and demographics. Use when you need country-level data after obtaining the target IP address. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.location.countryByIpAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | | `localityLanguageRequested` | `string` | No | — | | `isReachableGlobally` | `boolean` | No | — | | `country` | `object` | No | — | | `lastUpdated` | `string` | No | — | > **country full type** > > ```ts theme={null} > { > isoAlpha2: string, > isoAlpha3?: string, > m49Code?: number, > name: string, > isoName?: string, > isoNameFull?: string, > isoAdminLanguages?: { > isoAlpha3?: string, > isoAlpha2?: string, > isoName?: string, > nativeName?: string > }[], > unRegion?: string, > currency?: { > numericCode?: number, > code?: string, > name?: string, > minorUnits?: number > }, > wbRegion?: { > id?: string, > iso2Code?: string, > value?: string > }, > wbIncomeLevel?: { > id?: string, > iso2Code?: string, > value?: string > }, > callingCode?: string, > countryFlagEmoji?: string, > wikidataId?: string, > geonameId?: number, > isIndependent?: boolean > } > ``` *** ### countryInfo `location.countryInfo` Tool to fetch detailed country information by ISO code. Use when you need localized names, currencies, regions, and other metadata for a country. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.location.countryInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `isoAlpha2` | `string` | Yes | — | | `isoAlpha3` | `string` | No | — | | `m49Code` | `number` | No | — | | `name` | `string` | Yes | — | | `isoName` | `string` | No | — | | `isoNameFull` | `string` | No | — | | `isoAdminLanguages` | `object[]` | No | — | | `unRegion` | `string` | No | — | | `currency` | `object` | No | — | | `wbRegion` | `object` | No | — | | `wbIncomeLevel` | `object` | No | — | | `callingCode` | `string` | No | — | | `countryFlagEmoji` | `string` | No | — | | `wikidataId` | `string` | No | — | | `geonameId` | `number` | No | — | | `isIndependent` | `boolean` | No | — | > **isoAdminLanguages full type** > > ```ts theme={null} > { > isoAlpha3?: string, > isoAlpha2?: string, > isoName?: string, > nativeName?: string > }[] > ``` > **currency full type** > > ```ts theme={null} > { > numericCode?: number, > code?: string, > name?: string, > minorUnits?: number > } > ``` > **wbRegion full type** > > ```ts theme={null} > { > id?: string, > iso2Code?: string, > value?: string > } > ``` > **wbIncomeLevel full type** > > ```ts theme={null} > { > id?: string, > iso2Code?: string, > value?: string > } > ``` *** ### reverseGeocodingWithTimezone `location.reverseGeocodingWithTimezone` Tool to return reverse geocoding and time zone info for given coordinates. Use when you need both locality details and timezone data in one call. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.location.reverseGeocodingWithTimezone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `latitude` | `number` | Yes | — | | `longitude` | `number` | Yes | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `latitude` | `number` | Yes | — | | `longitude` | `number` | Yes | — | | `localityLanguageRequested` | `string` | No | — | | `continent` | `string` | No | — | | `continentCode` | `string` | No | — | | `countryName` | `string` | No | — | | `countryCode` | `string` | No | — | | `principalSubdivision` | `string` | No | — | | `principalSubdivisionCode` | `string` | No | — | | `city` | `string` | No | — | | `locality` | `string` | No | — | | `postcode` | `string` | No | — | | `plusCode` | `string` | No | — | | `localityInfo` | `object` | No | — | | `timeZone` | `object` | No | — | > **localityInfo full type** > > ```ts theme={null} > { > administrative?: { > name?: string, > description?: string, > isoName?: string, > order?: number, > adminLevel?: number, > isoCode?: string, > wikidataId?: string, > geonameId?: number > }[], > informative?: { > name?: string, > description?: string, > isoName?: string, > order?: number, > isoCode?: string, > wikidataId?: string, > geonameId?: number > }[] > } > ``` > **timeZone full type** > > ```ts theme={null} > { > ianaTimeId: string, > displayName?: string, > effectiveTimeZoneFull?: string, > effectiveTimeZoneShort?: string, > utcOffsetSeconds?: number, > utcOffset?: string, > isDaylightSavingTime?: boolean, > localTime?: string > } > ``` *** ### timeZoneByIpAddress `location.timeZoneByIpAddress` Tool to retrieve time zone information for a given IP address. Use when you need DST status, UTC offsets, and local/UTC time for a specific IP. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.location.timeZoneByIpAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | | `utcReference` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ianaTimeId` | `string` | Yes | — | | `displayName` | `string` | No | — | | `effectiveTimeZoneFull` | `string` | No | — | | `effectiveTimeZoneShort` | `string` | No | — | | `utcOffsetSeconds` | `number` | No | — | | `utcOffset` | `string` | No | — | | `isDaylightSavingTime` | `boolean` | No | — | | `localTime` | `string` | No | — | *** ## Network ### networkByIpAddress `network.networkByIpAddress` Tool to retrieve registry, ASN, and BGP details for a given IP address’s network. Use when you need detailed network information (e.g., ASNs, prefixes) after confirming the target IP. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.network.networkByIpAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | | `registry` | `string` | No | — | | `registryStatus` | `string` | No | — | | `registeredCountry` | `string` | No | — | | `registeredCountryName` | `string` | No | — | | `organisation` | `string` | No | — | | `isReachableGlobally` | `boolean` | No | — | | `isBogon` | `boolean` | No | — | | `bgpPrefix` | `string` | No | — | | `bgpPrefixNetworkAddress` | `string` | No | — | | `bgpPrefixLastAddress` | `string` | No | — | | `totalAddresses` | `number` | No | — | | `carriers` | `object[]` | No | — | | `viaCarriers` | `object[]` | No | — | > **carriers full type** > > ```ts theme={null} > { > asn?: string, > asnNumeric?: number, > organisation?: string, > name?: string, > registry?: string, > registeredCountry?: string, > registeredCountryName?: string, > registrationDate?: string, > registrationLastChange?: string, > totalIpv4Addresses?: number, > totalIpv4Prefixes?: number, > totalIpv4BogonPrefixes?: number, > totalIpv6Prefixes?: number, > totalIpv6BogonPrefixes?: number, > rank?: number, > rankText?: string > }[] > ``` > **viaCarriers full type** > > ```ts theme={null} > { > asn?: string, > asnNumeric?: number, > organisation?: string, > name?: string, > registry?: string, > registeredCountry?: string, > registeredCountryName?: string, > registrationDate?: string, > registrationLastChange?: string, > totalIpv4Addresses?: number, > totalIpv4Prefixes?: number, > totalIpv4BogonPrefixes?: number, > totalIpv6Prefixes?: number, > totalIpv6BogonPrefixes?: number, > rank?: number, > rankText?: string > }[] > ``` *** ### networksByCidr `network.networksByCidr` Tool to retrieve BGP-announced networks within a specified CIDR range. Use when you need to analyze network announcements within a particular CIDR after confirming the range format. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.network.networksByCidr({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cidr` | `string` | Yes | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cidr` | `string` | Yes | — | | `parent` | `string` | No | — | | `network` | `object` | No | — | > **network full type** > > ```ts theme={null} > { > cidr?: string, > type?: string, > carriers?: { > asn?: string, > asnNumeric?: number, > organisation?: string, > name?: string, > registry?: string, > registeredCountry?: string, > registeredCountryName?: string, > registrationDate?: string, > registrationLastChange?: string, > totalIpv4Addresses?: number, > totalIpv4Prefixes?: number, > totalIpv4BogonPrefixes?: number, > totalIpv6Prefixes?: number, > totalIpv6BogonPrefixes?: number, > rank?: number, > rankText?: string > }[], > viaCarriers?: { > asn?: string, > asnNumeric?: number, > organisation?: string, > name?: string, > registry?: string, > registeredCountry?: string, > registeredCountryName?: string, > registrationDate?: string, > registrationLastChange?: string, > totalIpv4Addresses?: number, > totalIpv4Prefixes?: number, > totalIpv4BogonPrefixes?: number, > totalIpv6Prefixes?: number, > totalIpv6BogonPrefixes?: number, > rank?: number, > rankText?: string > }[], > totalSubnets?: number, > subnets?: { > startAddress?: string, > endAddress?: string, > organisation?: string, > registeredCountry?: string, > registeredCountryName?: string > }[] > } > ``` *** ## Security ### hazardReport `security.hazardReport` Tool to fetch a cybersecurity hazard report for a specified IP address. Use when assessing an IP's threat profile (VPN, proxy, blacklists, hosting risk). **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.security.hazardReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `isKnownAsTorServer` | `boolean` | No | — | | `isKnownAsVpn` | `boolean` | No | — | | `isKnownAsProxy` | `boolean` | No | — | | `isSpamhausDrop` | `boolean` | No | — | | `isSpamhausEdrop` | `boolean` | No | — | | `isSpamhausAsnDrop` | `boolean` | No | — | | `isBlacklistedUceprotect` | `boolean` | No | — | | `isBlacklistedBlocklistDe` | `boolean` | No | — | | `isKnownAsMailServer` | `boolean` | No | — | | `isKnownAsPublicRouter` | `boolean` | No | — | | `isBogon` | `boolean` | No | — | | `isUnreachable` | `boolean` | No | — | | `hostingLikelihood` | `number` | No | — | | `isHostingAsn` | `boolean` | No | — | | `isCellular` | `boolean` | No | — | | `iCloudPrivateRelay` | `boolean` | No | — | *** ### torExitNodesGeolocated `security.torExitNodesGeolocated` Retrieve a paginated list of active TOR exit node IP addresses with geolocation and carrier (ASN) details. Use this tool to: - Get a list of known TOR exit node IPs to detect/block anonymous traffic - Analyze geographic distribution of TOR exit nodes by country - Look up carrier/ASN information for TOR nodes - Build IP blocklists or allowlists for TOR traffic Returns nodes with IP address, country info (when available), and detailed carrier/ASN data including BGP prefix counts and global ranking. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.security.torExitNodesGeolocated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchSize` | `number` | No | — | | `offset` | `number` | No | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | Yes | — | | `offset` | `number` | Yes | — | | `batch` | `number` | Yes | — | | `nodes` | `object[]` | Yes | — | > **nodes full type** > > ```ts theme={null} > { > ip: string, > countryName?: string, > countryCode?: string, > carriers?: { > asn?: string, > asnNumeric?: number, > organisation?: string, > name?: string, > registry?: string, > registeredCountry?: string, > registeredCountryName?: string, > registrationDate?: string, > registrationLastChange?: string, > totalIpv4Addresses?: number, > totalIpv4Prefixes?: number, > totalIpv4BogonPrefixes?: number, > totalIpv6Prefixes?: number, > totalIpv6BogonPrefixes?: number, > rank?: number, > rankText?: string > }[] > }[] > ``` *** ### userRisk `security.userRisk` Tool to return a risk assessment for a user based on IP signals for fraud prevention. Use after initial IP checks to decide whether to bypass or require captcha challenges. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.security.userRisk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `risk` | `string` | Yes | — | | `description` | `string` | No | — | *** ## Validation ### emailAddressVerification `validation.emailAddressVerification` Tool to verify email addresses for syntax, domain validity, and disposability. Use after obtaining the email input. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.validation.emailAddressVerification({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emailAddress` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `inputData` | `string` | Yes | — | | `isValid` | `boolean` | Yes | — | | `isSyntaxValid` | `boolean` | No | — | | `isMailServerDefined` | `boolean` | No | — | | `isKnownSpammerDomain` | `boolean` | No | — | | `isDisposable` | `boolean` | No | — | *** ### phoneNumberValidationByIp `validation.phoneNumberValidationByIp` Tool to validate phone numbers by inferring country from client IP. Use when you want to validate a number without specifying country. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.validation.phoneNumberValidationByIp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `number` | `string` | No | — | | `phoneNumber` | `string` | No | — | | `ip` | `string` | No | — | | `localityLanguage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `isValid` | `boolean` | Yes | — | | `e164Format` | `string` | No | — | | `internationalFormat` | `string` | No | — | | `nationalFormat` | `string` | No | — | | `location` | `string` | No | — | | `lineType` | `string` | No | — | | `country` | `object` | No | — | > **country full type** > > ```ts theme={null} > { > isoAlpha2: string, > isoAlpha3?: string, > m49Code?: number, > name: string, > isoName?: string, > isoNameFull?: string, > isoAdminLanguages?: { > isoAlpha3?: string, > isoAlpha2?: string, > isoName?: string, > nativeName?: string > }[], > unRegion?: string, > currency?: { > numericCode?: number, > code?: string, > name?: string, > minorUnits?: number > }, > wbRegion?: { > id?: string, > iso2Code?: string, > value?: string > }, > wbIncomeLevel?: { > id?: string, > iso2Code?: string, > value?: string > }, > callingCode?: string, > countryFlagEmoji?: string, > wikidataId?: string, > geonameId?: number, > isIndependent?: boolean > } > ``` *** ### userAgentParser `validation.userAgentParser` Tool to parse a User-Agent string into device, OS, browser, and bot details. Use when you have a raw User-Agent header and need structured client info. **Risk:** `read` ```ts theme={null} await corsair.bigdatacloud.api.validation.userAgentParser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userAgentRaw` | `string` | No | — | | `userAgent` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `device` | `string` | No | — | | `os` | `string` | No | — | | `userAgent` | `string` | No | — | | `family` | `string` | No | — | | `versionMajor` | `string` | No | — | | `versionMinor` | `string` | No | — | | `versionPatch` | `string` | No | — | | `isSpider` | `boolean` | No | — | | `isMobile` | `boolean` | No | — | | `userAgentDisplay` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/bigdatacloud/database BigDataCloud local sync: searchable entities, `.search()` filters, and operators. The BigDataCloud plugin syncs data locally. Use `corsair.bigdatacloud.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Asns Path: `bigdatacloud.db.asns.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.asns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `asn` | `string` | equals, contains, startsWith, endsWith, in | | `asnNumeric` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `organisation` | `string` | equals, contains, startsWith, endsWith, in | | `registry` | `string` | equals, contains, startsWith, endsWith, in | | `registeredCountry` | `string` | equals, contains, startsWith, endsWith, in | | `registeredCountryName` | `string` | equals, contains, startsWith, endsWith, in | | `registrationDate` | `string` | equals, contains, startsWith, endsWith, in | | `registrationLastChange` | `string` | equals, contains, startsWith, endsWith, in | | `totalIpv4Addresses` | `number` | equals, gt, gte, lt, lte, in | | `totalIpv4Prefixes` | `number` | equals, gt, gte, lt, lte, in | | `totalIpv4BogonPrefixes` | `number` | equals, gt, gte, lt, lte, in | | `totalIpv6Prefixes` | `number` | equals, gt, gte, lt, lte, in | | `totalIpv6BogonPrefixes` | `number` | equals, gt, gte, lt, lte, in | | `rank` | `number` | equals, gt, gte, lt, lte, in | | `rankText` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Bgp Prefixes Path: `bigdatacloud.db.bgpPrefixes.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.bgpPrefixes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `bgpPrefix` | `string` | equals, contains, startsWith, endsWith, in | | `bgpPrefixNetworkAddress` | `string` | equals, contains, startsWith, endsWith, in | | `bgpPrefixLastAddress` | `string` | equals, contains, startsWith, endsWith, in | | `registryStatus` | `string` | equals, contains, startsWith, endsWith, in | | `isBogon` | `boolean` | equals | | `isAnnounced` | `boolean` | equals | | `asn` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Countries Path: `bigdatacloud.db.countries.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.countries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `isoAlpha2` | `string` | equals, contains, startsWith, endsWith, in | | `isoAlpha3` | `string` | equals, contains, startsWith, endsWith, in | | `m49Code` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `isoName` | `string` | equals, contains, startsWith, endsWith, in | | `isoNameFull` | `string` | equals, contains, startsWith, endsWith, in | | `unRegion` | `string` | equals, contains, startsWith, endsWith, in | | `callingCode` | `string` | equals, contains, startsWith, endsWith, in | | `countryFlagEmoji` | `string` | equals, contains, startsWith, endsWith, in | | `wikidataId` | `string` | equals, contains, startsWith, endsWith, in | | `geonameId` | `number` | equals, gt, gte, lt, lte, in | | `isIndependent` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Email Validations Path: `bigdatacloud.db.emailValidations.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.emailValidations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `emailAddress` | `string` | equals, contains, startsWith, endsWith, in | | `isValid` | `boolean` | equals | | `isSyntaxValid` | `boolean` | equals | | `isMailServerDefined` | `boolean` | equals | | `isKnownSpammerDomain` | `boolean` | equals | | `isDisposable` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Hazard Reports Path: `bigdatacloud.db.hazardReports.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.hazardReports.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `isKnownAsTorServer` | `boolean` | equals | | `isKnownAsVpn` | `boolean` | equals | | `isKnownAsProxy` | `boolean` | equals | | `isSpamhausDrop` | `boolean` | equals | | `isSpamhausEdrop` | `boolean` | equals | | `isSpamhausAsnDrop` | `boolean` | equals | | `isBlacklistedUceprotect` | `boolean` | equals | | `isBlacklistedBlocklistDe` | `boolean` | equals | | `isKnownAsMailServer` | `boolean` | equals | | `isKnownAsPublicRouter` | `boolean` | equals | | `isBogon` | `boolean` | equals | | `isUnreachable` | `boolean` | equals | | `hostingLikelihood` | `number` | equals, gt, gte, lt, lte, in | | `isHostingAsn` | `boolean` | equals | | `isCellular` | `boolean` | equals | | `iCloudPrivateRelay` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Networks Path: `bigdatacloud.db.networks.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.networks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `cidr` | `string` | equals, contains, startsWith, endsWith, in | | `registry` | `string` | equals, contains, startsWith, endsWith, in | | `registryStatus` | `string` | equals, contains, startsWith, endsWith, in | | `registeredCountry` | `string` | equals, contains, startsWith, endsWith, in | | `registeredCountryName` | `string` | equals, contains, startsWith, endsWith, in | | `organisation` | `string` | equals, contains, startsWith, endsWith, in | | `isReachableGlobally` | `boolean` | equals | | `isBogon` | `boolean` | equals | | `bgpPrefix` | `string` | equals, contains, startsWith, endsWith, in | | `bgpPrefixNetworkAddress` | `string` | equals, contains, startsWith, endsWith, in | | `bgpPrefixLastAddress` | `string` | equals, contains, startsWith, endsWith, in | | `totalAddresses` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Phone Validations Path: `bigdatacloud.db.phoneValidations.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.phoneValidations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `isValid` | `boolean` | equals | | `e164Format` | `string` | equals, contains, startsWith, endsWith, in | | `internationalFormat` | `string` | equals, contains, startsWith, endsWith, in | | `nationalFormat` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `lineType` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Reverse Geocodes Path: `bigdatacloud.db.reverseGeocodes.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.reverseGeocodes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `latitude` | `number` | equals, gt, gte, lt, lte, in | | `longitude` | `number` | equals, gt, gte, lt, lte, in | | `continent` | `string` | equals, contains, startsWith, endsWith, in | | `continentCode` | `string` | equals, contains, startsWith, endsWith, in | | `countryName` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `principalSubdivision` | `string` | equals, contains, startsWith, endsWith, in | | `principalSubdivisionCode` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `locality` | `string` | equals, contains, startsWith, endsWith, in | | `postcode` | `string` | equals, contains, startsWith, endsWith, in | | `plusCode` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Roaming Statuses Path: `bigdatacloud.db.roamingStatuses.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.roamingStatuses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `latitude` | `number` | equals, gt, gte, lt, lte, in | | `longitude` | `number` | equals, gt, gte, lt, lte, in | | `isRoaming` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Timezones Path: `bigdatacloud.db.timezones.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.timezones.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ianaTimeId` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `effectiveTimeZoneFull` | `string` | equals, contains, startsWith, endsWith, in | | `effectiveTimeZoneShort` | `string` | equals, contains, startsWith, endsWith, in | | `utcOffsetSeconds` | `number` | equals, gt, gte, lt, lte, in | | `utcOffset` | `string` | equals, contains, startsWith, endsWith, in | | `isDaylightSavingTime` | `boolean` | equals | | `localTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tor Exit Nodes Path: `bigdatacloud.db.torExitNodes.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.torExitNodes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `countryName` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `asn` | `string` | equals, contains, startsWith, endsWith, in | | `organisation` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## User Agents Path: `bigdatacloud.db.userAgents.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.userAgents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `userAgentRaw` | `string` | equals, contains, startsWith, endsWith, in | | `device` | `string` | equals, contains, startsWith, endsWith, in | | `os` | `string` | equals, contains, startsWith, endsWith, in | | `userAgent` | `string` | equals, contains, startsWith, endsWith, in | | `family` | `string` | equals, contains, startsWith, endsWith, in | | `versionMajor` | `string` | equals, contains, startsWith, endsWith, in | | `versionMinor` | `string` | equals, contains, startsWith, endsWith, in | | `versionPatch` | `string` | equals, contains, startsWith, endsWith, in | | `isSpider` | `boolean` | equals | | `isMobile` | `boolean` | equals | | `userAgentDisplay` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## User Risks Path: `bigdatacloud.db.userRisks.search` ```ts theme={null} const rows = await corsair.bigdatacloud.db.userRisks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `risk` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bigdatacloud/overview Geolocation and reverse geocoding APIs for IP lookup and address intelligence. Use **BigDataCloud** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 17 typed API operations * 13 synced entities (`asns`, `bgpPrefixes`, `countries`, `emailValidations`, `hazardReports`, `networks`, and 7 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bigdatacloud ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bigdatacloud ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bigdatacloud ``` ```bash bun theme={null} bun add corsair @corsair-dev/bigdatacloud ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bigdatacloud } from '@corsair-dev/bigdatacloud'; export const corsair = createCorsair({ plugins: [ bigdatacloud(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bigdatacloud() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bigdatacloud', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`asn.asnExtendedReceivingFromInfo`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bigdatacloud.api.asn.asnExtendedReceivingFromInfo({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/bigdatacloud/api) reference.* See the full list on the [API](/plugins/bigdatacloud/api) page. ## Query synced data Synced entities support `tenant.bigdatacloud.db..search()` and `.list()`: `asns`, `bgpPrefixes`, `countries`, `emailValidations`, `hazardReports`, `networks`, `phoneValidations`, `reverseGeocodes`, `roamingStatuses`, `timezones`, `torExitNodes`, `userAgents`, `userRisks`. See [Database](/plugins/bigdatacloud/database) for filters and operators. ## What's next > **[API reference](/plugins/bigdatacloud/api)** > > Every `bigdatacloud.api.*` operation with input and output types. > **[Database](/plugins/bigdatacloud/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bigmailer/api API reference for BigMailer: every `bigmailer.api.*` operation with input and output types. Every `bigmailer.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Auth ### me `auth.me` Check the authenticated API key and account configuration **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.auth.me({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Brand Properties ### create `brandProperties.create` Create a brand property **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.brandProperties.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `mergeTagName` | `string` | No | — | | `isHtml` | `boolean` | No | — | | `stringValue` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `merge_tag_name` | `string` | No | — | | `is_html` | `boolean` | No | — | | `string_value` | `string` | No | — | | `created` | `number` | No | — | *** ### delete `brandProperties.delete` Permanently delete a brand property **Risk:** `destructive` ```ts theme={null} await corsair.bigmailer.api.brandProperties.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `brandPropertyId` | `string` | Yes | — | **Output:** `void` *** ### get `brandProperties.get` Retrieve a brand property **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.brandProperties.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `brandPropertyId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `merge_tag_name` | `string` | No | — | | `is_html` | `boolean` | No | — | | `string_value` | `string` | No | — | | `created` | `number` | No | — | *** ### list `brandProperties.list` List a brand's custom merge-tag properties **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.brandProperties.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > merge_tag_name?: string | null, > is_html?: boolean | null, > string_value?: string | null, > created?: number | null > }[] > ``` *** ### update `brandProperties.update` Update a brand property **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.brandProperties.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `brandPropertyId` | `string` | Yes | — | | `name` | `string` | No | — | | `mergeTagName` | `string` | No | — | | `isHtml` | `boolean` | No | — | | `stringValue` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `merge_tag_name` | `string` | No | — | | `is_html` | `boolean` | No | — | | `string_value` | `string` | No | — | | `created` | `number` | No | — | *** ## Brands ### create `brands.create` Create a brand **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.brands.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `fromName` | `string` | No | — | | `fromEmail` | `string` | No | — | | `bounceDangerPercent` | `number` | No | — | | `maxSoftBounces` | `number` | No | — | | `url` | `string` | No | — | | `unsubscribeText` | `string` | No | — | | `contactLimit` | `number` | No | — | | `logo` | `string` | No | — | | `connectionId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `from_name` | `string` | No | — | | `from_email` | `string` | No | — | | `filter_soft_bounces` | `boolean` | No | — | | `max_soft_bounces` | `number` | No | — | | `bounce_danger_percent` | `number` | No | — | | `unsubscribe_text` | `string` | No | — | | `connection_id` | `string` | No | — | | `contact_limit` | `number` | No | — | | `num_contacts` | `number` | No | — | | `engagement` | `object` | No | — | | `url` | `string` | No | — | | `created` | `number` | No | — | > **engagement full type** > > ```ts theme={null} > { > num_opened?: number | null, > percent_opened?: number | null, > num_clicked?: number | null, > percent_clicked?: number | null > } > ``` *** ### get `brands.get` Retrieve a brand **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.brands.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `from_name` | `string` | No | — | | `from_email` | `string` | No | — | | `filter_soft_bounces` | `boolean` | No | — | | `max_soft_bounces` | `number` | No | — | | `bounce_danger_percent` | `number` | No | — | | `unsubscribe_text` | `string` | No | — | | `connection_id` | `string` | No | — | | `contact_limit` | `number` | No | — | | `num_contacts` | `number` | No | — | | `engagement` | `object` | No | — | | `url` | `string` | No | — | | `created` | `number` | No | — | > **engagement full type** > > ```ts theme={null} > { > num_opened?: number | null, > percent_opened?: number | null, > num_clicked?: number | null, > percent_clicked?: number | null > } > ``` *** ### list `brands.list` List brands in the account **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.brands.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > from_name?: string | null, > from_email?: string | null, > filter_soft_bounces?: boolean | null, > max_soft_bounces?: number | null, > bounce_danger_percent?: number | null, > unsubscribe_text?: string | null, > connection_id?: string | null, > contact_limit?: number | null, > num_contacts?: number | null, > engagement?: { > num_opened?: number | null, > percent_opened?: number | null, > num_clicked?: number | null, > percent_clicked?: number | null > } | null, > url?: string | null, > created?: number | null > }[] > ``` *** ### update `brands.update` Update a brand's settings **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.brands.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `name` | `string` | No | — | | `fromName` | `string` | No | — | | `fromEmail` | `string` | No | — | | `bounceDangerPercent` | `number` | No | — | | `maxSoftBounces` | `number` | No | — | | `url` | `string` | No | — | | `unsubscribeText` | `string` | No | — | | `contactLimit` | `number` | No | — | | `logo` | `string` | No | — | | `connectionId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `from_name` | `string` | No | — | | `from_email` | `string` | No | — | | `filter_soft_bounces` | `boolean` | No | — | | `max_soft_bounces` | `number` | No | — | | `bounce_danger_percent` | `number` | No | — | | `unsubscribe_text` | `string` | No | — | | `connection_id` | `string` | No | — | | `contact_limit` | `number` | No | — | | `num_contacts` | `number` | No | — | | `engagement` | `object` | No | — | | `url` | `string` | No | — | | `created` | `number` | No | — | > **engagement full type** > > ```ts theme={null} > { > num_opened?: number | null, > percent_opened?: number | null, > num_clicked?: number | null, > percent_clicked?: number | null > } > ``` *** ## Bulk Campaigns ### create `bulkCampaigns.create` Create a bulk campaign **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.bulkCampaigns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipientName` | `string` | No | — | | `replyTo` | `object` | No | — | | `linkParams` | `string` | No | — | | `preview` | `string` | No | — | | `autoText` | `boolean` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `templateId` | `string` | No | — | | `trackOpens` | `boolean` | No | — | | `trackClicks` | `boolean` | No | — | | `trackTextClicks` | `boolean` | No | — | | `segmentId` | `string` | No | — | | `messageTypeId` | `string` | No | — | | `listIds` | `string[]` | No | — | | `excludedListIds` | `string[]` | No | — | | `scheduledFor` | `number` | No | — | | `throttlingType` | `none \| burst` | No | — | | `throttlingAmount` | `number` | No | — | | `throttlingPeriod` | `900 \| 1800 \| 3600 \| 7200` | No | — | | `suppressionListId` | `string` | No | — | | `ready` | `boolean` | No | — | > **from full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` > **replyTo full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipient_name` | `string` | No | — | | `reply_to` | `object` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `preview` | `string` | No | — | | `auto_text` | `boolean` | No | — | | `link_params` | `string` | No | — | | `track_opens` | `boolean` | No | — | | `track_clicks` | `boolean` | No | — | | `track_text_clicks` | `boolean` | No | — | | `segment_id` | `string` | No | — | | `message_type_id` | `string` | No | — | | `suppression_list_id` | `string` | No | — | | `list_ids` | `string[]` | No | — | | `excluded_list_ids` | `string[]` | No | — | | `scheduled_for` | `number` | No | — | | `throttling_type` | `string` | No | — | | `throttling_amount` | `number` | No | — | | `throttling_period` | `number` | No | — | | `num_sent` | `number` | No | — | | `num_rejected` | `number` | No | — | | `num_clicks` | `number` | No | — | | `num_total_clicks` | `number` | No | — | | `num_opens` | `number` | No | — | | `num_total_opens` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `num_unsubscribes` | `number` | No | — | | `started` | `number` | No | — | | `sent` | `number` | No | — | | `delayed_until` | `number` | No | — | | `created` | `number` | No | — | > **from full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` > **reply\_to full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` *** ### get `bulkCampaigns.get` Retrieve a bulk campaign, including its send metrics **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.bulkCampaigns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `campaignId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipient_name` | `string` | No | — | | `reply_to` | `object` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `preview` | `string` | No | — | | `auto_text` | `boolean` | No | — | | `link_params` | `string` | No | — | | `track_opens` | `boolean` | No | — | | `track_clicks` | `boolean` | No | — | | `track_text_clicks` | `boolean` | No | — | | `segment_id` | `string` | No | — | | `message_type_id` | `string` | No | — | | `suppression_list_id` | `string` | No | — | | `list_ids` | `string[]` | No | — | | `excluded_list_ids` | `string[]` | No | — | | `scheduled_for` | `number` | No | — | | `throttling_type` | `string` | No | — | | `throttling_amount` | `number` | No | — | | `throttling_period` | `number` | No | — | | `num_sent` | `number` | No | — | | `num_rejected` | `number` | No | — | | `num_clicks` | `number` | No | — | | `num_total_clicks` | `number` | No | — | | `num_opens` | `number` | No | — | | `num_total_opens` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `num_unsubscribes` | `number` | No | — | | `started` | `number` | No | — | | `sent` | `number` | No | — | | `delayed_until` | `number` | No | — | | `created` | `number` | No | — | > **from full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` > **reply\_to full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` *** ### list `bulkCampaigns.list` List a brand's bulk (marketing) campaigns **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.bulkCampaigns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > status?: string | null, > subject?: string | null, > from?: { > email?: string | null, > name?: string | null > } | null, > recipient_name?: string | null, > reply_to?: { > email?: string | null, > name?: string | null > } | null, > html?: string | null, > text?: string | null, > preview?: string | null, > auto_text?: boolean | null, > link_params?: string | null, > track_opens?: boolean | null, > track_clicks?: boolean | null, > track_text_clicks?: boolean | null, > segment_id?: string | null, > message_type_id?: string | null, > suppression_list_id?: string | null, > list_ids?: string[] | null, > excluded_list_ids?: string[] | null, > scheduled_for?: number | null, > throttling_type?: string | null, > throttling_amount?: number | null, > throttling_period?: number | null, > num_sent?: number | null, > num_rejected?: number | null, > num_clicks?: number | null, > num_total_clicks?: number | null, > num_opens?: number | null, > num_total_opens?: number | null, > num_hard_bounces?: number | null, > num_soft_bounces?: number | null, > num_complaints?: number | null, > num_unsubscribes?: number | null, > started?: number | null, > sent?: number | null, > delayed_until?: number | null, > created?: number | null > }[] > ``` *** ### update `bulkCampaigns.update` Update a bulk campaign - set ready:true to activate sending or scheduling **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.bulkCampaigns.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `campaignId` | `string` | Yes | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipientName` | `string` | No | — | | `replyTo` | `object` | No | — | | `linkParams` | `string` | No | — | | `preview` | `string` | No | — | | `autoText` | `boolean` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `templateId` | `string` | No | — | | `trackOpens` | `boolean` | No | — | | `trackClicks` | `boolean` | No | — | | `trackTextClicks` | `boolean` | No | — | | `segmentId` | `string` | No | — | | `messageTypeId` | `string` | No | — | | `listIds` | `string[]` | No | — | | `excludedListIds` | `string[]` | No | — | | `scheduledFor` | `number` | No | — | | `throttlingType` | `none \| burst` | No | — | | `throttlingAmount` | `number` | No | — | | `throttlingPeriod` | `900 \| 1800 \| 3600 \| 7200` | No | — | | `suppressionListId` | `string` | No | — | | `ready` | `boolean` | No | — | > **from full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` > **replyTo full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipient_name` | `string` | No | — | | `reply_to` | `object` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `preview` | `string` | No | — | | `auto_text` | `boolean` | No | — | | `link_params` | `string` | No | — | | `track_opens` | `boolean` | No | — | | `track_clicks` | `boolean` | No | — | | `track_text_clicks` | `boolean` | No | — | | `segment_id` | `string` | No | — | | `message_type_id` | `string` | No | — | | `suppression_list_id` | `string` | No | — | | `list_ids` | `string[]` | No | — | | `excluded_list_ids` | `string[]` | No | — | | `scheduled_for` | `number` | No | — | | `throttling_type` | `string` | No | — | | `throttling_amount` | `number` | No | — | | `throttling_period` | `number` | No | — | | `num_sent` | `number` | No | — | | `num_rejected` | `number` | No | — | | `num_clicks` | `number` | No | — | | `num_total_clicks` | `number` | No | — | | `num_opens` | `number` | No | — | | `num_total_opens` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `num_unsubscribes` | `number` | No | — | | `started` | `number` | No | — | | `sent` | `number` | No | — | | `delayed_until` | `number` | No | — | | `created` | `number` | No | — | > **from full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` > **reply\_to full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` *** ## Connections ### list `connections.list` List a brand's email-delivery connections **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.connections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type?: string | null, > name?: string | null, > created?: number | null > }[] > ``` *** ## Contacts ### create `contacts.create` Create a contact **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `email` | `string` | Yes | — | | `fieldValues` | `object[]` | No | — | | `listIds` | `string[]` | No | — | | `unsubscribeAll` | `boolean` | No | — | | `unsubscribeIds` | `string[]` | No | — | | `validate` | `boolean` | No | — | > **fieldValues full type** > > ```ts theme={null} > { > name: string, > string?: string, > date?: string, > integer?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `brand_id` | `string` | No | — | | `email` | `string` | No | — | | `field_values` | `object[]` | No | — | | `list_ids` | `string[]` | No | — | | `unsubscribe_all` | `boolean` | No | — | | `unsubscribe_ids` | `string[]` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `created` | `number` | No | — | > **field\_values full type** > > ```ts theme={null} > { > name?: string | null, > string?: string | null, > date?: string | null, > integer?: number | null > }[] > ``` *** ### createBatch `contacts.createBatch` Upload up to 1,000 contacts for asynchronous processing **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.contacts.createBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `contacts` | `object[]` | Yes | — | | `validate` | `boolean` | No | — | > **contacts full type** > > ```ts theme={null} > { > email: string, > fieldValues?: { > name: string, > string?: string, > date?: string, > integer?: number > }[], > listIds?: string[], > unsubscribeAll?: boolean, > unsubscribeIds?: string[], > customId?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `num_created` | `number` | No | — | | `num_new_not_created` | `number` | No | — | | `num_updated` | `number` | No | — | | `num_validation_credits_used` | `number` | No | — | | `created` | `number` | No | — | | `completed` | `number` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > email?: string | null, > id?: string | null, > custom_id?: string | null, > success?: boolean | null, > code?: string | null, > message?: string | null > }[] > ``` *** ### delete `contacts.delete` Permanently delete a contact **Risk:** `destructive` ```ts theme={null} await corsair.bigmailer.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `contactId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ### get `contacts.get` Retrieve a contact by id or email address **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `contactId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `brand_id` | `string` | No | — | | `email` | `string` | No | — | | `field_values` | `object[]` | No | — | | `list_ids` | `string[]` | No | — | | `unsubscribe_all` | `boolean` | No | — | | `unsubscribe_ids` | `string[]` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `created` | `number` | No | — | > **field\_values full type** > > ```ts theme={null} > { > name?: string | null, > string?: string | null, > date?: string | null, > integer?: number | null > }[] > ``` *** ### getBatch `contacts.getBatch` Check a contact batch's processing status **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.contacts.getBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `batchId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `num_created` | `number` | No | — | | `num_new_not_created` | `number` | No | — | | `num_updated` | `number` | No | — | | `num_validation_credits_used` | `number` | No | — | | `created` | `number` | No | — | | `completed` | `number` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > email?: string | null, > id?: string | null, > custom_id?: string | null, > success?: boolean | null, > code?: string | null, > message?: string | null > }[] > ``` *** ### list `contacts.list` List a brand's contacts **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `listId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > brand_id?: string | null, > email?: string | null, > field_values?: { > name?: string | null, > string?: string | null, > date?: string | null, > integer?: number | null > }[] | null, > list_ids?: string[] | null, > unsubscribe_all?: boolean | null, > unsubscribe_ids?: string[] | null, > num_soft_bounces?: number | null, > num_hard_bounces?: number | null, > num_complaints?: number | null, > created?: number | null > }[] > ``` *** ### update `contacts.update` Update a contact **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `contactId` | `string` | Yes | — | | `email` | `string` | No | — | | `fieldValues` | `object[]` | No | — | | `listIds` | `string[]` | No | — | | `unsubscribeAll` | `boolean` | No | — | | `unsubscribeIds` | `string[]` | No | — | | `fieldValuesOp` | `add \| remove \| replace` | No | — | | `listIdsOp` | `add \| remove \| replace` | No | — | | `unsubscribeIdsOp` | `add \| remove \| replace` | No | — | > **fieldValues full type** > > ```ts theme={null} > { > name: string, > string?: string, > date?: string, > integer?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `brand_id` | `string` | No | — | | `email` | `string` | No | — | | `field_values` | `object[]` | No | — | | `list_ids` | `string[]` | No | — | | `unsubscribe_all` | `boolean` | No | — | | `unsubscribe_ids` | `string[]` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `created` | `number` | No | — | > **field\_values full type** > > ```ts theme={null} > { > name?: string | null, > string?: string | null, > date?: string | null, > integer?: number | null > }[] > ``` *** ### upsert `contacts.upsert` Create or update a contact by id or email address **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.contacts.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `email` | `string` | Yes | — | | `fieldValues` | `object[]` | No | — | | `listIds` | `string[]` | No | — | | `unsubscribeAll` | `boolean` | No | — | | `unsubscribeIds` | `string[]` | No | — | | `validate` | `boolean` | No | — | > **fieldValues full type** > > ```ts theme={null} > { > name: string, > string?: string, > date?: string, > integer?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `brand_id` | `string` | No | — | | `email` | `string` | No | — | | `field_values` | `object[]` | No | — | | `list_ids` | `string[]` | No | — | | `unsubscribe_all` | `boolean` | No | — | | `unsubscribe_ids` | `string[]` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `created` | `number` | No | — | > **field\_values full type** > > ```ts theme={null} > { > name?: string | null, > string?: string | null, > date?: string | null, > integer?: number | null > }[] > ``` *** ## Fields ### create `fields.create` Create a custom contact field **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.fields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `text \| date \| integer` | Yes | — | | `mergeTagName` | `string` | No | — | | `sampleValue` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `merge_tag_name` | `string` | No | — | | `sample_value` | `string` | No | — | | `created` | `number` | No | — | *** ### delete `fields.delete` Permanently delete a custom contact field **Risk:** `destructive` ```ts theme={null} await corsair.bigmailer.api.fields.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `fieldId` | `string` | Yes | — | **Output:** `void` *** ### get `fields.get` Retrieve a custom contact field **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.fields.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `fieldId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `merge_tag_name` | `string` | No | — | | `sample_value` | `string` | No | — | | `created` | `number` | No | — | *** ### list `fields.list` List a brand's custom contact fields **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.fields.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > merge_tag_name?: string | null, > sample_value?: string | null, > created?: number | null > }[] > ``` *** ### update `fields.update` Update a custom contact field's name or sample value **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.fields.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `fieldId` | `string` | Yes | — | | `name` | `string` | No | — | | `mergeTagName` | `string` | No | — | | `sampleValue` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `merge_tag_name` | `string` | No | — | | `sample_value` | `string` | No | — | | `created` | `number` | No | — | *** ## Lists ### create `lists.create` Create a contact list **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.lists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `all` | `boolean` | No | — | | `num_contacts` | `number` | No | — | | `engagement` | `object` | No | — | | `created` | `number` | No | — | > **engagement full type** > > ```ts theme={null} > { > num_opened?: number | null, > percent_opened?: number | null, > num_clicked?: number | null, > percent_clicked?: number | null > } > ``` *** ### delete `lists.delete` Delete a contact list (its contacts are not deleted) **Risk:** `destructive` ```ts theme={null} await corsair.bigmailer.api.lists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `listId` | `string` | Yes | — | **Output:** `void` *** ### get `lists.get` Retrieve a contact list **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.lists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `listId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `all` | `boolean` | No | — | | `num_contacts` | `number` | No | — | | `engagement` | `object` | No | — | | `created` | `number` | No | — | > **engagement full type** > > ```ts theme={null} > { > num_opened?: number | null, > percent_opened?: number | null, > num_clicked?: number | null, > percent_clicked?: number | null > } > ``` *** ### list `lists.list` List a brand's contact lists **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.lists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > all?: boolean | null, > num_contacts?: number | null, > engagement?: { > num_opened?: number | null, > percent_opened?: number | null, > num_clicked?: number | null, > percent_clicked?: number | null > } | null, > created?: number | null > }[] > ``` *** ### update `lists.update` Rename a contact list **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.lists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `listId` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `all` | `boolean` | No | — | | `num_contacts` | `number` | No | — | | `engagement` | `object` | No | — | | `created` | `number` | No | — | > **engagement full type** > > ```ts theme={null} > { > num_opened?: number | null, > percent_opened?: number | null, > num_clicked?: number | null, > percent_clicked?: number | null > } > ``` *** ## Message Types ### list `messageTypes.list` List a brand's message-type categories **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.messageTypes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `type` | `all \| account \| user` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type?: string | null, > name?: string | null, > created?: number | null > }[] > ``` *** ## Segments ### create `segments.create` Create a segment **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.segments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `operator` | `all \| any` | Yes | — | | `conditions` | `object[]` | Yes | — | > **conditions full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `operator` | `string` | No | — | | `conditions` | `any[]` | No | — | | `created` | `number` | No | — | *** ### delete `segments.delete` Permanently delete a segment **Risk:** `destructive` ```ts theme={null} await corsair.bigmailer.api.segments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `segmentId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ### get `segments.get` Retrieve a segment **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.segments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `segmentId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `operator` | `string` | No | — | | `conditions` | `any[]` | No | — | | `created` | `number` | No | — | *** ### list `segments.list` List a brand's segments **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.segments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > operator?: string | null, > conditions?: any[] | null, > created?: number | null > }[] > ``` *** ### update `segments.update` Update a segment **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.segments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `segmentId` | `string` | Yes | — | | `name` | `string` | No | — | | `operator` | `all \| any` | No | — | | `conditions` | `object[]` | No | — | > **conditions full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `operator` | `string` | No | — | | `conditions` | `any[]` | No | — | | `created` | `number` | No | — | *** ## Senders ### list `senders.list` List a brand's verified sender identities **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.senders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > identity_type?: string | null, > Identity?: string | null, > BounceDomain?: string | null, > DnsRecords?: any | null, > BounceDnsRecords?: any | null, > share_type?: string | null, > verified?: boolean | null, > bounce_verified?: boolean | null, > created?: number | null > }[] > ``` *** ## Suppression Lists ### create `suppressionLists.create` Upload a campaign suppression list **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.suppressionLists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `file` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `file_name` | `string` | No | — | | `file_size` | `number` | No | — | | `created` | `number` | No | — | *** ### get `suppressionLists.get` Retrieve a campaign suppression list **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.suppressionLists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `suppressionListId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `file_name` | `string` | No | — | | `file_size` | `number` | No | — | | `created` | `number` | No | — | *** ### list `suppressionLists.list` List a brand's campaign suppression lists **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.suppressionLists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > file_name?: string | null, > file_size?: number | null, > created?: number | null > }[] > ``` *** ## Templates ### create `templates.create` Create a template **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.templates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `email \| page` | Yes | — | | `sharedWithAccount` | `boolean` | No | — | | `html` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `shared_with_account` | `boolean` | No | — | | `html` | `string` | No | — | | `created` | `number` | No | — | *** ### delete `templates.delete` Permanently delete a template **Risk:** `destructive` ```ts theme={null} await corsair.bigmailer.api.templates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `templateId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ### get `templates.get` Retrieve a template **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.templates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `templateId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `shared_with_account` | `boolean` | No | — | | `html` | `string` | No | — | | `created` | `number` | No | — | *** ### list `templates.list` List a brand's templates **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.templates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > shared_with_account?: boolean | null, > html?: string | null, > created?: number | null > }[] > ``` *** ### update `templates.update` Update a template **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.templates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `templateId` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `email \| page` | No | — | | `sharedWithAccount` | `boolean` | No | — | | `html` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `shared_with_account` | `boolean` | No | — | | `html` | `string` | No | — | | `created` | `number` | No | — | *** ## Transactional Campaigns ### create `transactionalCampaigns.create` Create a transactional campaign **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.transactionalCampaigns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipientName` | `string` | No | — | | `replyTo` | `object` | No | — | | `linkParams` | `string` | No | — | | `preview` | `string` | No | — | | `autoText` | `boolean` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `templateId` | `string` | No | — | | `trackOpens` | `boolean` | No | — | | `trackClicks` | `boolean` | No | — | | `trackTextClicks` | `boolean` | No | — | | `messageTypeId` | `string` | No | — | | `listId` | `string` | No | — | | `ready` | `boolean` | No | — | > **from full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` > **replyTo full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipient_name` | `string` | No | — | | `reply_to` | `object` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `preview` | `string` | No | — | | `auto_text` | `boolean` | No | — | | `link_params` | `string` | No | — | | `track_opens` | `boolean` | No | — | | `track_clicks` | `boolean` | No | — | | `track_text_clicks` | `boolean` | No | — | | `message_type_id` | `string` | No | — | | `list_id` | `string` | No | — | | `num_sent` | `number` | No | — | | `num_rejected` | `number` | No | — | | `num_clicks` | `number` | No | — | | `num_opens` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `num_unsubscribes` | `number` | No | — | | `started` | `number` | No | — | | `sent` | `number` | No | — | | `created` | `number` | No | — | > **from full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` > **reply\_to full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` *** ### get `transactionalCampaigns.get` Retrieve a transactional campaign, including its send metrics **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.transactionalCampaigns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `campaignId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipient_name` | `string` | No | — | | `reply_to` | `object` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `preview` | `string` | No | — | | `auto_text` | `boolean` | No | — | | `link_params` | `string` | No | — | | `track_opens` | `boolean` | No | — | | `track_clicks` | `boolean` | No | — | | `track_text_clicks` | `boolean` | No | — | | `message_type_id` | `string` | No | — | | `list_id` | `string` | No | — | | `num_sent` | `number` | No | — | | `num_rejected` | `number` | No | — | | `num_clicks` | `number` | No | — | | `num_opens` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `num_unsubscribes` | `number` | No | — | | `started` | `number` | No | — | | `sent` | `number` | No | — | | `created` | `number` | No | — | > **from full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` > **reply\_to full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` *** ### list `transactionalCampaigns.list` List a brand's transactional campaigns **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.transactionalCampaigns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > status?: string | null, > subject?: string | null, > from?: { > email?: string | null, > name?: string | null > } | null, > recipient_name?: string | null, > reply_to?: { > email?: string | null, > name?: string | null > } | null, > html?: string | null, > text?: string | null, > preview?: string | null, > auto_text?: boolean | null, > link_params?: string | null, > track_opens?: boolean | null, > track_clicks?: boolean | null, > track_text_clicks?: boolean | null, > message_type_id?: string | null, > list_id?: string | null, > num_sent?: number | null, > num_rejected?: number | null, > num_clicks?: number | null, > num_opens?: number | null, > num_hard_bounces?: number | null, > num_soft_bounces?: number | null, > num_complaints?: number | null, > num_unsubscribes?: number | null, > started?: number | null, > sent?: number | null, > created?: number | null > }[] > ``` *** ### update `transactionalCampaigns.update` Update a transactional campaign - set ready:true to activate it **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.transactionalCampaigns.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `campaignId` | `string` | Yes | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipientName` | `string` | No | — | | `replyTo` | `object` | No | — | | `linkParams` | `string` | No | — | | `preview` | `string` | No | — | | `autoText` | `boolean` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `templateId` | `string` | No | — | | `trackOpens` | `boolean` | No | — | | `trackClicks` | `boolean` | No | — | | `trackTextClicks` | `boolean` | No | — | | `messageTypeId` | `string` | No | — | | `listId` | `string` | No | — | | `ready` | `boolean` | No | — | > **from full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` > **replyTo full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `subject` | `string` | No | — | | `from` | `object` | No | — | | `recipient_name` | `string` | No | — | | `reply_to` | `object` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `preview` | `string` | No | — | | `auto_text` | `boolean` | No | — | | `link_params` | `string` | No | — | | `track_opens` | `boolean` | No | — | | `track_clicks` | `boolean` | No | — | | `track_text_clicks` | `boolean` | No | — | | `message_type_id` | `string` | No | — | | `list_id` | `string` | No | — | | `num_sent` | `number` | No | — | | `num_rejected` | `number` | No | — | | `num_clicks` | `number` | No | — | | `num_opens` | `number` | No | — | | `num_hard_bounces` | `number` | No | — | | `num_soft_bounces` | `number` | No | — | | `num_complaints` | `number` | No | — | | `num_unsubscribes` | `number` | No | — | | `started` | `number` | No | — | | `sent` | `number` | No | — | | `created` | `number` | No | — | > **from full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` > **reply\_to full type** > > ```ts theme={null} > { > email?: string | null, > name?: string | null > } > ``` *** ## Users ### create `users.create` Invite a new user to the account **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `role` | `admin \| account_manager \| brand_manager \| campaign_manager \| campaign_viewer \| template_manager` | Yes | — | | `allowedBrands` | `string[]` | No | — | | `invitationMessage` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | No | — | | `role` | `string` | No | — | | `allowed_brands` | `string[]` | No | — | | `is_activated` | `boolean` | No | — | | `is_owner` | `boolean` | No | — | | `created` | `number` | No | — | *** ### delete `users.delete` Remove a user from the account **Risk:** `destructive` ```ts theme={null} await corsair.bigmailer.api.users.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output:** `void` *** ### get `users.get` Retrieve an account user **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | No | — | | `role` | `string` | No | — | | `allowed_brands` | `string[]` | No | — | | `is_activated` | `boolean` | No | — | | `is_owner` | `boolean` | No | — | | `created` | `number` | No | — | *** ### list `users.list` List account users **Risk:** `read` ```ts theme={null} await corsair.bigmailer.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `cursor` | `string` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > email?: string | null, > role?: string | null, > allowed_brands?: string[] | null, > is_activated?: boolean | null, > is_owner?: boolean | null, > created?: number | null > }[] > ``` *** ### update `users.update` Update a user's email, role, or allowed brands **Risk:** `write` ```ts theme={null} await corsair.bigmailer.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `email` | `string` | No | — | | `role` | `admin \| account_manager \| brand_manager \| campaign_manager \| campaign_viewer \| template_manager` | No | — | | `allowedBrands` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | No | — | | `role` | `string` | No | — | | `allowed_brands` | `string[]` | No | — | | `is_activated` | `boolean` | No | — | | `is_owner` | `boolean` | No | — | | `created` | `number` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/bigmailer/database BigMailer local sync: searchable entities, `.search()` filters, and operators. The BigMailer plugin syncs data locally. Use `corsair.bigmailer.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Brand Properties Path: `bigmailer.db.brandProperties.search` ```ts theme={null} const rows = await corsair.bigmailer.db.brandProperties.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `merge_tag_name` | `string` | equals, contains, startsWith, endsWith, in | | `is_html` | `boolean` | equals | | `string_value` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Brands Path: `bigmailer.db.brands.search` ```ts theme={null} const rows = await corsair.bigmailer.db.brands.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `from_name` | `string` | equals, contains, startsWith, endsWith, in | | `from_email` | `string` | equals, contains, startsWith, endsWith, in | | `filter_soft_bounces` | `boolean` | equals | | `max_soft_bounces` | `number` | equals, gt, gte, lt, lte, in | | `bounce_danger_percent` | `number` | equals, gt, gte, lt, lte, in | | `unsubscribe_text` | `string` | equals, contains, startsWith, endsWith, in | | `connection_id` | `string` | equals, contains, startsWith, endsWith, in | | `contact_limit` | `number` | equals, gt, gte, lt, lte, in | | `num_contacts` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Bulk Campaigns Path: `bigmailer.db.bulkCampaigns.search` ```ts theme={null} const rows = await corsair.bigmailer.db.bulkCampaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `recipient_name` | `string` | equals, contains, startsWith, endsWith, in | | `html` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `preview` | `string` | equals, contains, startsWith, endsWith, in | | `auto_text` | `boolean` | equals | | `link_params` | `string` | equals, contains, startsWith, endsWith, in | | `track_opens` | `boolean` | equals | | `track_clicks` | `boolean` | equals | | `track_text_clicks` | `boolean` | equals | | `segment_id` | `string` | equals, contains, startsWith, endsWith, in | | `message_type_id` | `string` | equals, contains, startsWith, endsWith, in | | `suppression_list_id` | `string` | equals, contains, startsWith, endsWith, in | | `scheduled_for` | `number` | equals, gt, gte, lt, lte, in | | `throttling_type` | `string` | equals, contains, startsWith, endsWith, in | | `throttling_amount` | `number` | equals, gt, gte, lt, lte, in | | `throttling_period` | `number` | equals, gt, gte, lt, lte, in | | `num_sent` | `number` | equals, gt, gte, lt, lte, in | | `num_rejected` | `number` | equals, gt, gte, lt, lte, in | | `num_clicks` | `number` | equals, gt, gte, lt, lte, in | | `num_total_clicks` | `number` | equals, gt, gte, lt, lte, in | | `num_opens` | `number` | equals, gt, gte, lt, lte, in | | `num_total_opens` | `number` | equals, gt, gte, lt, lte, in | | `num_hard_bounces` | `number` | equals, gt, gte, lt, lte, in | | `num_soft_bounces` | `number` | equals, gt, gte, lt, lte, in | | `num_complaints` | `number` | equals, gt, gte, lt, lte, in | | `num_unsubscribes` | `number` | equals, gt, gte, lt, lte, in | | `started` | `number` | equals, gt, gte, lt, lte, in | | `sent` | `number` | equals, gt, gte, lt, lte, in | | `delayed_until` | `number` | equals, gt, gte, lt, lte, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Connections Path: `bigmailer.db.connections.search` ```ts theme={null} const rows = await corsair.bigmailer.db.connections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `bigmailer.db.contacts.search` ```ts theme={null} const rows = await corsair.bigmailer.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `brand_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `unsubscribe_all` | `boolean` | equals | | `num_soft_bounces` | `number` | equals, gt, gte, lt, lte, in | | `num_hard_bounces` | `number` | equals, gt, gte, lt, lte, in | | `num_complaints` | `number` | equals, gt, gte, lt, lte, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Fields Path: `bigmailer.db.fields.search` ```ts theme={null} const rows = await corsair.bigmailer.db.fields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `merge_tag_name` | `string` | equals, contains, startsWith, endsWith, in | | `sample_value` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `bigmailer.db.lists.search` ```ts theme={null} const rows = await corsair.bigmailer.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `all` | `boolean` | equals | | `num_contacts` | `number` | equals, gt, gte, lt, lte, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Message Types Path: `bigmailer.db.messageTypes.search` ```ts theme={null} const rows = await corsair.bigmailer.db.messageTypes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Segments Path: `bigmailer.db.segments.search` ```ts theme={null} const rows = await corsair.bigmailer.db.segments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `operator` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Senders Path: `bigmailer.db.senders.search` ```ts theme={null} const rows = await corsair.bigmailer.db.senders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `identity_type` | `string` | equals, contains, startsWith, endsWith, in | | `Identity` | `string` | equals, contains, startsWith, endsWith, in | | `BounceDomain` | `string` | equals, contains, startsWith, endsWith, in | | `share_type` | `string` | equals, contains, startsWith, endsWith, in | | `verified` | `boolean` | equals | | `bounce_verified` | `boolean` | equals | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Suppression Lists Path: `bigmailer.db.suppressionLists.search` ```ts theme={null} const rows = await corsair.bigmailer.db.suppressionLists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `file_name` | `string` | equals, contains, startsWith, endsWith, in | | `file_size` | `number` | equals, gt, gte, lt, lte, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `bigmailer.db.templates.search` ```ts theme={null} const rows = await corsair.bigmailer.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `shared_with_account` | `boolean` | equals | | `html` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transactional Campaigns Path: `bigmailer.db.transactionalCampaigns.search` ```ts theme={null} const rows = await corsair.bigmailer.db.transactionalCampaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `recipient_name` | `string` | equals, contains, startsWith, endsWith, in | | `html` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `preview` | `string` | equals, contains, startsWith, endsWith, in | | `auto_text` | `boolean` | equals | | `link_params` | `string` | equals, contains, startsWith, endsWith, in | | `track_opens` | `boolean` | equals | | `track_clicks` | `boolean` | equals | | `track_text_clicks` | `boolean` | equals | | `message_type_id` | `string` | equals, contains, startsWith, endsWith, in | | `list_id` | `string` | equals, contains, startsWith, endsWith, in | | `num_sent` | `number` | equals, gt, gte, lt, lte, in | | `num_rejected` | `number` | equals, gt, gte, lt, lte, in | | `num_clicks` | `number` | equals, gt, gte, lt, lte, in | | `num_opens` | `number` | equals, gt, gte, lt, lte, in | | `num_hard_bounces` | `number` | equals, gt, gte, lt, lte, in | | `num_soft_bounces` | `number` | equals, gt, gte, lt, lte, in | | `num_complaints` | `number` | equals, gt, gte, lt, lte, in | | `num_unsubscribes` | `number` | equals, gt, gte, lt, lte, in | | `started` | `number` | equals, gt, gte, lt, lte, in | | `sent` | `number` | equals, gt, gte, lt, lte, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bigmailer/overview Email marketing platform built for Amazon SES with lists, campaigns, and automations. Use **BigMailer** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 57 typed API operations * 13 synced entities (`brandProperties`, `brands`, `bulkCampaigns`, `connections`, `contacts`, `fields`, and 7 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bigmailer ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bigmailer ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bigmailer ``` ```bash bun theme={null} bun add corsair @corsair-dev/bigmailer ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bigmailer } from '@corsair-dev/bigmailer'; export const corsair = createCorsair({ plugins: [ bigmailer(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bigmailer() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bigmailer', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`auth.me`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bigmailer.api.auth.me({}); ``` **`brandProperties.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bigmailer.api.brandProperties.create({}); ``` See the full list on the [API](/plugins/bigmailer/api) page. ## Query synced data Synced entities support `tenant.bigmailer.db..search()` and `.list()`: `brandProperties`, `brands`, `bulkCampaigns`, `connections`, `contacts`, `fields`, `lists`, `messageTypes`, `segments`, `senders`, `suppressionLists`, `templates`, `transactionalCampaigns`. See [Database](/plugins/bigmailer/database) for filters and operators. ## What's next > **[API reference](/plugins/bigmailer/api)** > > Every `bigmailer.api.*` operation with input and output types. > **[Database](/plugins/bigmailer/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bigml/api API reference for BigML: every `bigml.api.*` operation with input and output types. Every `bigml.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Anomalies ### list `anomalies.list` List anomaly resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.anomalies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Anomaly Scores ### list `anomalyScores.list` List anomaly score resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.anomalyScores.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Associations ### list `associations.list` List association resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.associations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Association Sets ### list `associationSets.list` List association set resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.associationSets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Batch Anomaly Scores ### list `batchAnomalyScores.list` List batch anomaly score resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.batchAnomalyScores.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Batch Centroids ### list `batchCentroids.list` List batch centroid resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.batchCentroids.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Batch Predictions ### list `batchPredictions.list` List batch prediction resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.batchPredictions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Batch Projections ### list `batchProjections.list` List batch projection resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.batchProjections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Batch Topic Distributions ### list `batchTopicDistributions.list` List batch topic distribution resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.batchTopicDistributions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Centroids ### list `centroids.list` List centroid resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.centroids.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Clusters ### list `clusters.list` List cluster resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.clusters.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Composites ### list `composites.list` List composite resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.composites.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Configurations ### get `configurations.get` Retrieve a saved configuration **Risk:** `read` ```ts theme={null} await corsair.bigml.api.configurations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `configurationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `category` | `number` | No | — | | `code` | `number` | No | — | | `created` | `string` | No | — | | `creator` | `string` | No | — | | `description` | `string` | No | — | | `execution_id` | `string` | No | — | | `execution_status` | `boolean` | No | — | | `name` | `string` | No | — | | `name_options` | `string` | No | — | | `private` | `boolean` | No | — | | `project` | `string` | No | — | | `resource` | `string` | Yes | — | | `shared` | `boolean` | No | — | | `status` | `object` | No | — | | `subscription` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `updated` | `string` | No | — | | `webhook` | `object` | No | — | | `configurations` | `object` | No | — | | `type` | `number` | No | — | > **status full type** > > ```ts theme={null} > { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } > ``` > **webhook full type** > > ```ts theme={null} > { > url?: string | null > } > ``` > **configurations full type** > > ```ts theme={null} > { > } > ``` *** ### list `configurations.list` List saved configurations **Risk:** `read` ```ts theme={null} await corsair.bigml.api.configurations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > configurations?: { > } | null, > type?: number | null > }[] > ``` *** ## Correlations ### list `correlations.list` List correlation resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.correlations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Datasets ### list `datasets.list` List dataset resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.datasets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Deepnets ### list `deepnets.list` List deepnet resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.deepnets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Ensembles ### list `ensembles.list` List ensemble resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.ensembles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Evaluations ### list `evaluations.list` List evaluation resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.evaluations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Executions ### list `executions.list` List execution resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.executions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## External Connectors ### create `externalConnectors.create` Create an external data connector **Risk:** `write` ```ts theme={null} await corsair.bigml.api.externalConnectors.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `source` | `string` | No | — | | `engine` | `string` | No | — | | `connection` | `object` | Yes | — | | `name` | `string` | No | — | | `category` | `number` | No | — | | `description` | `string` | No | — | | `tags` | `string[]` | No | — | | `project` | `string` | No | — | > **connection full type** > > ```ts theme={null} > { > host?: string, > hosts?: string[], > port?: number, > database?: string, > use_ssl?: boolean, > verify_certs?: boolean, > user?: string, > password?: string, > http_auth?: string, > sslmode?: string, > master?: string, > timeout?: number, > indice?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `category` | `number` | No | — | | `code` | `number` | No | — | | `created` | `string` | No | — | | `creator` | `string` | No | — | | `description` | `string` | No | — | | `execution_id` | `string` | No | — | | `execution_status` | `boolean` | No | — | | `name` | `string` | No | — | | `name_options` | `string` | No | — | | `private` | `boolean` | No | — | | `project` | `string` | No | — | | `resource` | `string` | Yes | — | | `shared` | `boolean` | No | — | | `status` | `object` | No | — | | `subscription` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `updated` | `string` | No | — | | `webhook` | `object` | No | — | | `connection` | `object` | No | — | | `engine` | `string` | No | — | | `public_in_organization` | `boolean` | No | — | | `source` | `string` | No | — | | `type` | `number` | No | — | > **status full type** > > ```ts theme={null} > { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } > ``` > **webhook full type** > > ```ts theme={null} > { > url?: string | null > } > ``` > **connection full type** > > ```ts theme={null} > { > } > ``` *** ### get `externalConnectors.get` Retrieve an external data connector **Risk:** `read` ```ts theme={null} await corsair.bigml.api.externalConnectors.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `externalConnectorId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `category` | `number` | No | — | | `code` | `number` | No | — | | `created` | `string` | No | — | | `creator` | `string` | No | — | | `description` | `string` | No | — | | `execution_id` | `string` | No | — | | `execution_status` | `boolean` | No | — | | `name` | `string` | No | — | | `name_options` | `string` | No | — | | `private` | `boolean` | No | — | | `project` | `string` | No | — | | `resource` | `string` | Yes | — | | `shared` | `boolean` | No | — | | `status` | `object` | No | — | | `subscription` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `updated` | `string` | No | — | | `webhook` | `object` | No | — | | `connection` | `object` | No | — | | `engine` | `string` | No | — | | `public_in_organization` | `boolean` | No | — | | `source` | `string` | No | — | | `type` | `number` | No | — | > **status full type** > > ```ts theme={null} > { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } > ``` > **webhook full type** > > ```ts theme={null} > { > url?: string | null > } > ``` > **connection full type** > > ```ts theme={null} > { > } > ``` *** ## Forecasts ### list `forecasts.list` List forecast resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.forecasts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Fusions ### list `fusions.list` List fusion resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.fusions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Libraries ### list `libraries.list` List library resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.libraries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Linear Regressions ### list `linearRegressions.list` List linear regression resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.linearRegressions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Logistic Regressions ### list `logisticRegressions.list` List logistic regression resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.logisticRegressions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Models ### list `models.list` List model resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.models.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Optimls ### list `optimls.list` List optiml resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.optimls.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Pcas ### list `pcas.list` List pca resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.pcas.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Predictions ### list `predictions.list` List prediction resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.predictions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Projections ### list `projections.list` List projection resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.projections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Projects ### create `projects.create` Create a project **Risk:** `write` ```ts theme={null} await corsair.bigml.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `tags` | `string[]` | No | — | | `category` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `category` | `number` | No | — | | `code` | `number` | No | — | | `created` | `string` | No | — | | `creator` | `string` | No | — | | `description` | `string` | No | — | | `execution_id` | `string` | No | — | | `execution_status` | `boolean` | No | — | | `name` | `string` | No | — | | `name_options` | `string` | No | — | | `private` | `boolean` | No | — | | `project` | `string` | No | — | | `resource` | `string` | Yes | — | | `shared` | `boolean` | No | — | | `status` | `object` | No | — | | `subscription` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `updated` | `string` | No | — | | `webhook` | `object` | No | — | | `configuration` | `string` | No | — | | `configuration_status` | `boolean` | No | — | | `manage_permission` | `any[]` | No | — | | `stats` | `object` | No | — | | `type` | `number` | No | — | | `user_metadata` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } > ``` > **webhook full type** > > ```ts theme={null} > { > url?: string | null > } > ``` > **stats full type** > > ```ts theme={null} > { > } > ``` > **user\_metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `projects.delete` Permanently delete a project **Risk:** `destructive` ```ts theme={null} await corsair.bigml.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** `void` *** ### get `projects.get` Retrieve a project **Risk:** `read` ```ts theme={null} await corsair.bigml.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `category` | `number` | No | — | | `code` | `number` | No | — | | `created` | `string` | No | — | | `creator` | `string` | No | — | | `description` | `string` | No | — | | `execution_id` | `string` | No | — | | `execution_status` | `boolean` | No | — | | `name` | `string` | No | — | | `name_options` | `string` | No | — | | `private` | `boolean` | No | — | | `project` | `string` | No | — | | `resource` | `string` | Yes | — | | `shared` | `boolean` | No | — | | `status` | `object` | No | — | | `subscription` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `updated` | `string` | No | — | | `webhook` | `object` | No | — | | `configuration` | `string` | No | — | | `configuration_status` | `boolean` | No | — | | `manage_permission` | `any[]` | No | — | | `stats` | `object` | No | — | | `type` | `number` | No | — | | `user_metadata` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } > ``` > **webhook full type** > > ```ts theme={null} > { > url?: string | null > } > ``` > **stats full type** > > ```ts theme={null} > { > } > ``` > **user\_metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `projects.list` List projects **Risk:** `read` ```ts theme={null} await corsair.bigml.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > configuration?: string | null, > configuration_status?: boolean | null, > manage_permission?: any[] | null, > stats?: { > } | null, > type?: number | null, > user_metadata?: { > } | null > }[] > ``` *** ## Samples ### list `samples.list` List sample resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.samples.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Scripts ### list `scripts.list` List script resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.scripts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Sources ### get `sources.get` Retrieve a data source **Risk:** `read` ```ts theme={null} await corsair.bigml.api.sources.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sourceId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `category` | `number` | No | — | | `code` | `number` | No | — | | `created` | `string` | No | — | | `creator` | `string` | No | — | | `description` | `string` | No | — | | `execution_id` | `string` | No | — | | `execution_status` | `boolean` | No | — | | `name` | `string` | No | — | | `name_options` | `string` | No | — | | `private` | `boolean` | No | — | | `project` | `string` | No | — | | `resource` | `string` | Yes | — | | `shared` | `boolean` | No | — | | `status` | `object` | No | — | | `subscription` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `updated` | `string` | No | — | | `webhook` | `object` | No | — | | `charset` | `string` | No | — | | `closed` | `boolean` | No | — | | `configuration` | `string` | No | — | | `configuration_status` | `boolean` | No | — | | `content_type` | `string` | No | — | | `disable_autolabel` | `boolean` | No | — | | `disable_datetime` | `boolean` | No | — | | `field_types` | `object` | No | — | | `fields` | `object` | No | — | | `fields_meta` | `object` | No | — | | `fields_preview` | `object` | No | — | | `file_name` | `string` | No | — | | `format` | `string` | No | — | | `formats` | `object` | No | — | | `height` | `number` | No | — | | `image_analysis` | `object` | No | — | | `image_id` | `string` | No | — | | `item_analysis` | `object` | No | — | | `md5` | `string` | No | — | | `new_fields` | `any[]` | No | — | | `number_of_anomalies` | `number` | No | — | | `number_of_anomalyscores` | `number` | No | — | | `number_of_associations` | `number` | No | — | | `number_of_associationsets` | `number` | No | — | | `number_of_centroids` | `number` | No | — | | `number_of_clusters` | `number` | No | — | | `number_of_correlations` | `number` | No | — | | `number_of_datasets` | `number` | No | — | | `number_of_deepnets` | `number` | No | — | | `number_of_ensembles` | `number` | No | — | | `number_of_forecasts` | `number` | No | — | | `number_of_linearregressions` | `number` | No | — | | `number_of_logisticregressions` | `number` | No | — | | `number_of_models` | `number` | No | — | | `number_of_optimls` | `number` | No | — | | `number_of_pca` | `number` | No | — | | `number_of_predictions` | `number` | No | — | | `number_of_projections` | `number` | No | — | | `number_of_statisticaltests` | `number` | No | — | | `number_of_timeseries` | `number` | No | — | | `number_of_topicdistributions` | `number` | No | — | | `number_of_topicmodels` | `number` | No | — | | `origin` | `string` | No | — | | `original_height` | `number` | No | — | | `original_format` | `string` | No | — | | `original_size` | `number` | No | — | | `original_width` | `number` | No | — | | `parent_sources` | `string[]` | No | — | | `remote` | `string` | No | — | | `shared_clonable` | `boolean` | No | — | | `shared_hash` | `string` | No | — | | `sharing_key` | `string` | No | — | | `size` | `number` | No | — | | `source_csv` | `string` | No | — | | `source_parser` | `object` | No | — | | `sources` | `string[]` | No | — | | `sources_count` | `number` | No | — | | `synthetic` | `object` | No | — | | `term_analysis` | `object` | No | — | | `type` | `number` | No | — | | `types` | `string[]` | No | — | | `width` | `number` | No | — | > **status full type** > > ```ts theme={null} > { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } > ``` > **webhook full type** > > ```ts theme={null} > { > url?: string | null > } > ``` > **field\_types full type** > > ```ts theme={null} > { > auto_generated?: { > } | null, > categorical?: number | null, > datetime?: number | null, > image?: number | null, > items?: number | null, > numeric?: number | null, > path?: number | null, > regions?: number | null, > text?: number | null, > total?: number | null > } > ``` > **fields full type** > > ```ts theme={null} > { > } > ``` > **fields\_meta full type** > > ```ts theme={null} > { > count?: number | null, > limit?: number | null, > offset?: number | null, > query_total?: number | null, > total?: number | null > } > ``` > **fields\_preview full type** > > ```ts theme={null} > { > } > ``` > **formats full type** > > ```ts theme={null} > { > } > ``` > **image\_analysis full type** > > ```ts theme={null} > { > } > ``` > **item\_analysis full type** > > ```ts theme={null} > { > } > ``` > **source\_parser full type** > > ```ts theme={null} > { > header?: boolean | null, > json_fields?: string[] | null, > json_key?: string | null, > locale?: string | null, > missing_tokens?: string[] | null, > quote?: string | null, > separator?: string | null, > trim?: boolean | null > } > ``` > **synthetic full type** > > ```ts theme={null} > { > } > ``` > **term\_analysis full type** > > ```ts theme={null} > { > } > ``` *** ### list `sources.list` List data sources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.sources.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > charset?: string | null, > closed?: boolean | null, > configuration?: string | null, > configuration_status?: boolean | null, > content_type?: string | null, > disable_autolabel?: boolean | null, > disable_datetime?: boolean | null, > field_types?: { > auto_generated?: { > } | null, > categorical?: number | null, > datetime?: number | null, > image?: number | null, > items?: number | null, > numeric?: number | null, > path?: number | null, > regions?: number | null, > text?: number | null, > total?: number | null > } | null, > fields?: { > } | null, > fields_meta?: { > count?: number | null, > limit?: number | null, > offset?: number | null, > query_total?: number | null, > total?: number | null > } | null, > fields_preview?: { > } | null, > file_name?: string | null, > format?: string | null, > formats?: { > } | null, > height?: number | null, > image_analysis?: { > } | null, > image_id?: string | null, > item_analysis?: { > } | null, > md5?: string | null, > new_fields?: any[] | null, > number_of_anomalies?: number | null, > number_of_anomalyscores?: number | null, > number_of_associations?: number | null, > number_of_associationsets?: number | null, > number_of_centroids?: number | null, > number_of_clusters?: number | null, > number_of_correlations?: number | null, > number_of_datasets?: number | null, > number_of_deepnets?: number | null, > number_of_ensembles?: number | null, > number_of_forecasts?: number | null, > number_of_linearregressions?: number | null, > number_of_logisticregressions?: number | null, > number_of_models?: number | null, > number_of_optimls?: number | null, > number_of_pca?: number | null, > number_of_predictions?: number | null, > number_of_projections?: number | null, > number_of_statisticaltests?: number | null, > number_of_timeseries?: number | null, > number_of_topicdistributions?: number | null, > number_of_topicmodels?: number | null, > origin?: string | null, > original_height?: number | null, > original_format?: string | null, > original_size?: number | null, > original_width?: number | null, > parent_sources?: string[] | null, > remote?: string | null, > shared_clonable?: boolean | null, > shared_hash?: string | null, > sharing_key?: string | null, > size?: number | null, > source_csv?: string | null, > source_parser?: { > header?: boolean | null, > json_fields?: string[] | null, > json_key?: string | null, > locale?: string | null, > missing_tokens?: string[] | null, > quote?: string | null, > separator?: string | null, > trim?: boolean | null > } | null, > sources?: string[] | null, > sources_count?: number | null, > synthetic?: { > } | null, > term_analysis?: { > } | null, > type?: number | null, > types?: string[] | null, > width?: number | null > }[] > ``` *** ### update `sources.update` Update a data source's name, description, tags, parsing configuration, or per-field properties **Risk:** `write` ```ts theme={null} await corsair.bigml.api.sources.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sourceId` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `tags` | `string[]` | No | — | | `sourceParser` | `object` | No | — | | `fields` | `object` | No | — | > **sourceParser full type** > > ```ts theme={null} > { > header?: boolean, > jsonFields?: string[], > jsonKey?: string, > locale?: string, > missingTokens?: string[], > quote?: string, > separator?: string, > trim?: boolean > } > ``` > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `category` | `number` | No | — | | `code` | `number` | No | — | | `created` | `string` | No | — | | `creator` | `string` | No | — | | `description` | `string` | No | — | | `execution_id` | `string` | No | — | | `execution_status` | `boolean` | No | — | | `name` | `string` | No | — | | `name_options` | `string` | No | — | | `private` | `boolean` | No | — | | `project` | `string` | No | — | | `resource` | `string` | Yes | — | | `shared` | `boolean` | No | — | | `status` | `object` | No | — | | `subscription` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `updated` | `string` | No | — | | `webhook` | `object` | No | — | | `charset` | `string` | No | — | | `closed` | `boolean` | No | — | | `configuration` | `string` | No | — | | `configuration_status` | `boolean` | No | — | | `content_type` | `string` | No | — | | `disable_autolabel` | `boolean` | No | — | | `disable_datetime` | `boolean` | No | — | | `field_types` | `object` | No | — | | `fields` | `object` | No | — | | `fields_meta` | `object` | No | — | | `fields_preview` | `object` | No | — | | `file_name` | `string` | No | — | | `format` | `string` | No | — | | `formats` | `object` | No | — | | `height` | `number` | No | — | | `image_analysis` | `object` | No | — | | `image_id` | `string` | No | — | | `item_analysis` | `object` | No | — | | `md5` | `string` | No | — | | `new_fields` | `any[]` | No | — | | `number_of_anomalies` | `number` | No | — | | `number_of_anomalyscores` | `number` | No | — | | `number_of_associations` | `number` | No | — | | `number_of_associationsets` | `number` | No | — | | `number_of_centroids` | `number` | No | — | | `number_of_clusters` | `number` | No | — | | `number_of_correlations` | `number` | No | — | | `number_of_datasets` | `number` | No | — | | `number_of_deepnets` | `number` | No | — | | `number_of_ensembles` | `number` | No | — | | `number_of_forecasts` | `number` | No | — | | `number_of_linearregressions` | `number` | No | — | | `number_of_logisticregressions` | `number` | No | — | | `number_of_models` | `number` | No | — | | `number_of_optimls` | `number` | No | — | | `number_of_pca` | `number` | No | — | | `number_of_predictions` | `number` | No | — | | `number_of_projections` | `number` | No | — | | `number_of_statisticaltests` | `number` | No | — | | `number_of_timeseries` | `number` | No | — | | `number_of_topicdistributions` | `number` | No | — | | `number_of_topicmodels` | `number` | No | — | | `origin` | `string` | No | — | | `original_height` | `number` | No | — | | `original_format` | `string` | No | — | | `original_size` | `number` | No | — | | `original_width` | `number` | No | — | | `parent_sources` | `string[]` | No | — | | `remote` | `string` | No | — | | `shared_clonable` | `boolean` | No | — | | `shared_hash` | `string` | No | — | | `sharing_key` | `string` | No | — | | `size` | `number` | No | — | | `source_csv` | `string` | No | — | | `source_parser` | `object` | No | — | | `sources` | `string[]` | No | — | | `sources_count` | `number` | No | — | | `synthetic` | `object` | No | — | | `term_analysis` | `object` | No | — | | `type` | `number` | No | — | | `types` | `string[]` | No | — | | `width` | `number` | No | — | > **status full type** > > ```ts theme={null} > { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } > ``` > **webhook full type** > > ```ts theme={null} > { > url?: string | null > } > ``` > **field\_types full type** > > ```ts theme={null} > { > auto_generated?: { > } | null, > categorical?: number | null, > datetime?: number | null, > image?: number | null, > items?: number | null, > numeric?: number | null, > path?: number | null, > regions?: number | null, > text?: number | null, > total?: number | null > } > ``` > **fields full type** > > ```ts theme={null} > { > } > ``` > **fields\_meta full type** > > ```ts theme={null} > { > count?: number | null, > limit?: number | null, > offset?: number | null, > query_total?: number | null, > total?: number | null > } > ``` > **fields\_preview full type** > > ```ts theme={null} > { > } > ``` > **formats full type** > > ```ts theme={null} > { > } > ``` > **image\_analysis full type** > > ```ts theme={null} > { > } > ``` > **item\_analysis full type** > > ```ts theme={null} > { > } > ``` > **source\_parser full type** > > ```ts theme={null} > { > header?: boolean | null, > json_fields?: string[] | null, > json_key?: string | null, > locale?: string | null, > missing_tokens?: string[] | null, > quote?: string | null, > separator?: string | null, > trim?: boolean | null > } > ``` > **synthetic full type** > > ```ts theme={null} > { > } > ``` > **term\_analysis full type** > > ```ts theme={null} > { > } > ``` *** ## Statistical Tests ### list `statisticalTests.list` List statistical test resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.statisticalTests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Time Series ### list `timeSeries.list` List time series resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.timeSeries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Topic Distributions ### list `topicDistributions.list` List topic distribution resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.topicDistributions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** ## Topic Models ### list `topicModels.list` List topic model resources **Risk:** `read` ```ts theme={null} await corsair.bigml.api.topicModels.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | Yes | — | | `objects` | `object[]` | Yes | — | > **meta full type** > > ```ts theme={null} > { > limit?: number | null, > offset?: number | null, > total_count?: number | null, > next?: string | null, > previous?: string | null > } > ``` > **objects full type** > > ```ts theme={null} > { > category?: number | null, > code?: number | null, > created?: string | null, > creator?: string | null, > description?: string | null, > execution_id?: string | null, > execution_status?: boolean | null, > name?: string | null, > name_options?: string | null, > private?: boolean | null, > project?: string | null, > resource: string, > shared?: boolean | null, > status?: { > code?: number | null, > elapsed?: number | null, > message?: string | null, > progress?: number | null > } | null, > subscription?: boolean | null, > tags?: string[] | null, > updated?: string | null, > webhook?: { > url?: string | null > } | null, > type?: number | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/bigml/database BigML local sync: searchable entities, `.search()` filters, and operators. The BigML plugin syncs data locally. Use `corsair.bigml.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Anomalies Path: `bigml.db.anomalies.search` ```ts theme={null} const rows = await corsair.bigml.db.anomalies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Anomaly Scores Path: `bigml.db.anomalyScores.search` ```ts theme={null} const rows = await corsair.bigml.db.anomalyScores.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Associations Path: `bigml.db.associations.search` ```ts theme={null} const rows = await corsair.bigml.db.associations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Association Sets Path: `bigml.db.associationSets.search` ```ts theme={null} const rows = await corsair.bigml.db.associationSets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Batch Anomaly Scores Path: `bigml.db.batchAnomalyScores.search` ```ts theme={null} const rows = await corsair.bigml.db.batchAnomalyScores.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Batch Centroids Path: `bigml.db.batchCentroids.search` ```ts theme={null} const rows = await corsair.bigml.db.batchCentroids.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Batch Predictions Path: `bigml.db.batchPredictions.search` ```ts theme={null} const rows = await corsair.bigml.db.batchPredictions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Batch Projections Path: `bigml.db.batchProjections.search` ```ts theme={null} const rows = await corsair.bigml.db.batchProjections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Batch Topic Distributions Path: `bigml.db.batchTopicDistributions.search` ```ts theme={null} const rows = await corsair.bigml.db.batchTopicDistributions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Centroids Path: `bigml.db.centroids.search` ```ts theme={null} const rows = await corsair.bigml.db.centroids.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Clusters Path: `bigml.db.clusters.search` ```ts theme={null} const rows = await corsair.bigml.db.clusters.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Composites Path: `bigml.db.composites.search` ```ts theme={null} const rows = await corsair.bigml.db.composites.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Configurations Path: `bigml.db.configurations.search` ```ts theme={null} const rows = await corsair.bigml.db.configurations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Correlations Path: `bigml.db.correlations.search` ```ts theme={null} const rows = await corsair.bigml.db.correlations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Datasets Path: `bigml.db.datasets.search` ```ts theme={null} const rows = await corsair.bigml.db.datasets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deepnets Path: `bigml.db.deepnets.search` ```ts theme={null} const rows = await corsair.bigml.db.deepnets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Ensembles Path: `bigml.db.ensembles.search` ```ts theme={null} const rows = await corsair.bigml.db.ensembles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Evaluations Path: `bigml.db.evaluations.search` ```ts theme={null} const rows = await corsair.bigml.db.evaluations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Executions Path: `bigml.db.executions.search` ```ts theme={null} const rows = await corsair.bigml.db.executions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Forecasts Path: `bigml.db.forecasts.search` ```ts theme={null} const rows = await corsair.bigml.db.forecasts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Fusions Path: `bigml.db.fusions.search` ```ts theme={null} const rows = await corsair.bigml.db.fusions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Libraries Path: `bigml.db.libraries.search` ```ts theme={null} const rows = await corsair.bigml.db.libraries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Linear Regressions Path: `bigml.db.linearRegressions.search` ```ts theme={null} const rows = await corsair.bigml.db.linearRegressions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Logistic Regressions Path: `bigml.db.logisticRegressions.search` ```ts theme={null} const rows = await corsair.bigml.db.logisticRegressions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Models Path: `bigml.db.models.search` ```ts theme={null} const rows = await corsair.bigml.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Optimls Path: `bigml.db.optimls.search` ```ts theme={null} const rows = await corsair.bigml.db.optimls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pcas Path: `bigml.db.pcas.search` ```ts theme={null} const rows = await corsair.bigml.db.pcas.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Predictions Path: `bigml.db.predictions.search` ```ts theme={null} const rows = await corsair.bigml.db.predictions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projections Path: `bigml.db.projections.search` ```ts theme={null} const rows = await corsair.bigml.db.projections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `bigml.db.projects.search` ```ts theme={null} const rows = await corsair.bigml.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `configuration` | `string` | equals, contains, startsWith, endsWith, in | | `configuration_status` | `boolean` | equals | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Samples Path: `bigml.db.samples.search` ```ts theme={null} const rows = await corsair.bigml.db.samples.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scripts Path: `bigml.db.scripts.search` ```ts theme={null} const rows = await corsair.bigml.db.scripts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sources Path: `bigml.db.sources.search` ```ts theme={null} const rows = await corsair.bigml.db.sources.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `charset` | `string` | equals, contains, startsWith, endsWith, in | | `closed` | `boolean` | equals | | `configuration` | `string` | equals, contains, startsWith, endsWith, in | | `configuration_status` | `boolean` | equals | | `content_type` | `string` | equals, contains, startsWith, endsWith, in | | `disable_autolabel` | `boolean` | equals | | `disable_datetime` | `boolean` | equals | | `file_name` | `string` | equals, contains, startsWith, endsWith, in | | `format` | `string` | equals, contains, startsWith, endsWith, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `image_id` | `string` | equals, contains, startsWith, endsWith, in | | `md5` | `string` | equals, contains, startsWith, endsWith, in | | `number_of_anomalies` | `number` | equals, gt, gte, lt, lte, in | | `number_of_anomalyscores` | `number` | equals, gt, gte, lt, lte, in | | `number_of_associations` | `number` | equals, gt, gte, lt, lte, in | | `number_of_associationsets` | `number` | equals, gt, gte, lt, lte, in | | `number_of_centroids` | `number` | equals, gt, gte, lt, lte, in | | `number_of_clusters` | `number` | equals, gt, gte, lt, lte, in | | `number_of_correlations` | `number` | equals, gt, gte, lt, lte, in | | `number_of_datasets` | `number` | equals, gt, gte, lt, lte, in | | `number_of_deepnets` | `number` | equals, gt, gte, lt, lte, in | | `number_of_ensembles` | `number` | equals, gt, gte, lt, lte, in | | `number_of_forecasts` | `number` | equals, gt, gte, lt, lte, in | | `number_of_linearregressions` | `number` | equals, gt, gte, lt, lte, in | | `number_of_logisticregressions` | `number` | equals, gt, gte, lt, lte, in | | `number_of_models` | `number` | equals, gt, gte, lt, lte, in | | `number_of_optimls` | `number` | equals, gt, gte, lt, lte, in | | `number_of_pca` | `number` | equals, gt, gte, lt, lte, in | | `number_of_predictions` | `number` | equals, gt, gte, lt, lte, in | | `number_of_projections` | `number` | equals, gt, gte, lt, lte, in | | `number_of_statisticaltests` | `number` | equals, gt, gte, lt, lte, in | | `number_of_timeseries` | `number` | equals, gt, gte, lt, lte, in | | `number_of_topicdistributions` | `number` | equals, gt, gte, lt, lte, in | | `number_of_topicmodels` | `number` | equals, gt, gte, lt, lte, in | | `origin` | `string` | equals, contains, startsWith, endsWith, in | | `original_height` | `number` | equals, gt, gte, lt, lte, in | | `original_format` | `string` | equals, contains, startsWith, endsWith, in | | `original_size` | `number` | equals, gt, gte, lt, lte, in | | `original_width` | `number` | equals, gt, gte, lt, lte, in | | `remote` | `string` | equals, contains, startsWith, endsWith, in | | `shared_clonable` | `boolean` | equals | | `shared_hash` | `string` | equals, contains, startsWith, endsWith, in | | `sharing_key` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `source_csv` | `string` | equals, contains, startsWith, endsWith, in | | `sources_count` | `number` | equals, gt, gte, lt, lte, in | | `type` | `number` | equals, gt, gte, lt, lte, in | | `width` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Statistical Tests Path: `bigml.db.statisticalTests.search` ```ts theme={null} const rows = await corsair.bigml.db.statisticalTests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Time Series Path: `bigml.db.timeSeries.search` ```ts theme={null} const rows = await corsair.bigml.db.timeSeries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Topic Distributions Path: `bigml.db.topicDistributions.search` ```ts theme={null} const rows = await corsair.bigml.db.topicDistributions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Topic Models Path: `bigml.db.topicModels.search` ```ts theme={null} const rows = await corsair.bigml.db.topicModels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `number` | equals, gt, gte, lt, lte, in | | `code` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `execution_id` | `string` | equals, contains, startsWith, endsWith, in | | `execution_status` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_options` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `subscription` | `boolean` | equals | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bigml/overview Machine learning platform for building, training, and deploying predictive models. Use **BigML** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 45 typed API operations * 37 synced entities (`anomalies`, `anomalyScores`, `associations`, `associationSets`, `batchAnomalyScores`, `batchCentroids`, and 31 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bigml ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bigml ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bigml ``` ```bash bun theme={null} bun add corsair @corsair-dev/bigml ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bigml } from '@corsair-dev/bigml'; export const corsair = createCorsair({ plugins: [ bigml(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bigml() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bigml', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`anomalies.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bigml.api.anomalies.list({}); ``` **`externalConnectors.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bigml.api.externalConnectors.create({}); ``` See the full list on the [API](/plugins/bigml/api) page. ## Query synced data Synced entities support `tenant.bigml.db..search()` and `.list()`: `anomalies`, `anomalyScores`, `associations`, `associationSets`, `batchAnomalyScores`, `batchCentroids`, `batchPredictions`, `batchProjections`, `batchTopicDistributions`, `centroids`, `clusters`, `composites`, `configurations`, `correlations`, `datasets`, `deepnets`, `ensembles`, `evaluations`, `executions`, `forecasts`, `fusions`, `libraries`, `linearRegressions`, `logisticRegressions`, `models`, `optimls`, `pcas`, `predictions`, `projections`, `projects`, `samples`, `scripts`, `sources`, `statisticalTests`, `timeSeries`, `topicDistributions`, `topicModels`. See [Database](/plugins/bigml/database) for filters and operators. ## What's next > **[API reference](/plugins/bigml/api)** > > Every `bigml.api.*` operation with input and output types. > **[Database](/plugins/bigml/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bigpictureio/api API reference for BigPicture.io: every `bigpictureio.api.*` operation with input and output types. Every `bigpictureio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Company ### find `company.find` Find detailed company information by domain **Risk:** `read` ```ts theme={null} await corsair.bigpictureio.api.company.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `webhookUrl` | `string` | No | — | | `webhookId` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > legalName?: string, > domain?: string, > url?: string, > logo?: string, > type?: string, > phone?: string, > ticker?: string, > description?: string, > foundedYear?: number, > tags?: string[], > tech?: string[], > aliases?: string[], > domainAliases?: string[], > category?: { > sector?: string, > industryGroup?: string, > industry?: string, > subIndustry?: string, > naicsCode?: string > }, > metrics?: { > raised?: number, > employees?: number, > marketCap?: number, > trancoRank?: number, > alexaUsRank?: number, > annualRevenue?: number, > employeesRange?: string, > alexaGlobalRank?: number, > estimatedAnnualRevenue?: string > }, > location?: string, > geo?: { > streetNumber?: string | null, > streetName?: string | null, > subPremise?: string | null, > city?: string | null, > state?: string | null, > postalCode?: string | null, > stateCode?: string | null, > country?: string | null, > countryCode?: string | null > }, > facebook?: { > handle?: string > }, > linkedin?: { > handle?: string, > industry?: string > }, > twitter?: { > id?: string, > bio?: string, > site?: string, > avatar?: string, > handle?: string, > location?: string, > followers?: number, > following?: number > }, > crunchbase?: { > handle?: string > }, > emailProvider?: boolean, > indexedAt?: string > } | { > pending: true, > webhookUrl: string, > webhookId?: string > } > ``` *** ### stream `company.stream` Hold the company lookup open until BigPicture finishes **Risk:** `read` ```ts theme={null} await corsair.bigpictureio.api.company.stream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `legalName` | `string` | No | — | | `domain` | `string` | No | — | | `url` | `string` | No | — | | `logo` | `string` | No | — | | `type` | `string` | No | — | | `phone` | `string` | No | — | | `ticker` | `string` | No | — | | `description` | `string` | No | — | | `foundedYear` | `number` | No | — | | `tags` | `string[]` | No | — | | `tech` | `string[]` | No | — | | `aliases` | `string[]` | No | — | | `domainAliases` | `string[]` | No | — | | `category` | `object` | No | — | | `metrics` | `object` | No | — | | `location` | `string` | No | — | | `geo` | `object` | No | — | | `facebook` | `object` | No | — | | `linkedin` | `object` | No | — | | `twitter` | `object` | No | — | | `crunchbase` | `object` | No | — | | `emailProvider` | `boolean` | No | — | | `indexedAt` | `string` | No | — | > **category full type** > > ```ts theme={null} > { > sector?: string, > industryGroup?: string, > industry?: string, > subIndustry?: string, > naicsCode?: string > } > ``` > **metrics full type** > > ```ts theme={null} > { > raised?: number, > employees?: number, > marketCap?: number, > trancoRank?: number, > alexaUsRank?: number, > annualRevenue?: number, > employeesRange?: string, > alexaGlobalRank?: number, > estimatedAnnualRevenue?: string > } > ``` > **geo full type** > > ```ts theme={null} > { > streetNumber?: string | null, > streetName?: string | null, > subPremise?: string | null, > city?: string | null, > state?: string | null, > postalCode?: string | null, > stateCode?: string | null, > country?: string | null, > countryCode?: string | null > } > ``` > **facebook full type** > > ```ts theme={null} > { > handle?: string > } > ``` > **linkedin full type** > > ```ts theme={null} > { > handle?: string, > industry?: string > } > ``` > **twitter full type** > > ```ts theme={null} > { > id?: string, > bio?: string, > site?: string, > avatar?: string, > handle?: string, > location?: string, > followers?: number, > following?: number > } > ``` > **crunchbase full type** > > ```ts theme={null} > { > handle?: string > } > ``` *** ## Ip ### find `ip.find` Find the company associated with an IP address **Risk:** `read` ```ts theme={null} await corsair.bigpictureio.api.ip.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | | `type` | `string` | No | — | | `fuzzy` | `boolean` | No | — | | `confidence` | `number` | No | — | | `geo` | `object` | No | — | | `company` | `object` | No | — | | `whois` | `object` | No | — | | `asn` | `object` | No | — | > **geo full type** > > ```ts theme={null} > { > city?: string, > state?: string, > stateCode?: string, > country?: string, > countryCode?: string, > continent?: string, > continentCode?: string, > isEU?: boolean > } > ``` > **company full type** > > ```ts theme={null} > { > id?: string, > name?: string, > legalName?: string, > domain?: string, > url?: string, > logo?: string, > type?: string, > phone?: string, > ticker?: string, > description?: string, > foundedYear?: number, > tags?: string[], > tech?: string[], > aliases?: string[], > domainAliases?: string[], > category?: { > sector?: string, > industryGroup?: string, > industry?: string, > subIndustry?: string, > naicsCode?: string > }, > metrics?: { > raised?: number, > employees?: number, > marketCap?: number, > trancoRank?: number, > alexaUsRank?: number, > annualRevenue?: number, > employeesRange?: string, > alexaGlobalRank?: number, > estimatedAnnualRevenue?: string > }, > location?: string, > geo?: { > streetNumber?: string | null, > streetName?: string | null, > subPremise?: string | null, > city?: string | null, > state?: string | null, > postalCode?: string | null, > stateCode?: string | null, > country?: string | null, > countryCode?: string | null > }, > facebook?: { > handle?: string > }, > linkedin?: { > handle?: string, > industry?: string > }, > twitter?: { > id?: string, > bio?: string, > site?: string, > avatar?: string, > handle?: string, > location?: string, > followers?: number, > following?: number > }, > crunchbase?: { > handle?: string > }, > emailProvider?: boolean, > indexedAt?: string > } > ``` > **whois full type** > > ```ts theme={null} > { > domain?: string, > name?: string > } > ``` > **asn full type** > > ```ts theme={null} > { > asn?: string, > name?: string, > route?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/bigpictureio/database BigPicture.io local sync: searchable entities, `.search()` filters, and operators. The BigPicture.io plugin syncs data locally. Use `corsair.bigpictureio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/bigpictureio/overview BigPicture.io plugin for Corsair Use **BigPicture.io** through Corsair: one client, typed API calls. **What you get:** * 3 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bigpictureio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bigpictureio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bigpictureio ``` ```bash bun theme={null} bun add corsair @corsair-dev/bigpictureio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bigpictureio } from '@corsair-dev/bigpictureio'; export const corsair = createCorsair({ plugins: [ bigpictureio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bigpictureio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bigpictureio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`company.find`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bigpictureio.api.company.find({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/bigpictureio/api) reference.* See the full list on the [API](/plugins/bigpictureio/api) page. ## What's next > **[API reference](/plugins/bigpictureio/api)** > > Every `bigpictureio.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bitbucket/api API reference for Bitbucket: every `bitbucket.api.*` operation with input and output types. Every `bitbucket.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Commits And Insights ### createRepositoriesCommitReportsAnnotations `commitsAndInsights.createRepositoriesCommitReportsAnnotations` Adds multiple annotations to a commit report in bulk. Use when you need to add code analysis findings (vulnerabilities, code smells, bugs) to a report attached to a specific commit. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.createRepositoriesCommitReportsAnnotations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `commit` | `string` | Yes | — | | `reportId` | `string` | Yes | — | | `body` | `object[]` | Yes | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### createRepositoriesCommits2 `commitsAndInsights.createRepositoriesCommits2` Tool to list commits from a revision using POST method. Identical to GET endpoint but allows sending include/exclude parameters in request body to avoid URL length limits. Use when include/exclude parameters are too long for query strings. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.createRepositoriesCommits2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object[]` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### deleteCommitComment `commitsAndInsights.deleteCommitComment` Permanently deletes a specific comment on a commit. Use when removing outdated, incorrect, or unwanted feedback on a commit. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.deleteCommitComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string \| number` | Yes | — | | `commit` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `null` *** ### deleteRepositoriesCommitReportsAnnotations `commitsAndInsights.deleteRepositoriesCommitReportsAnnotations` Deletes a single annotation matching the provided ID from a commit report. Use when you need to remove a specific annotation from a code analysis report. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.deleteRepositoriesCommitReportsAnnotations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `commit` | `string` | Yes | — | | `reportId` | `string` | Yes | — | | `annotationId` | `string` | Yes | — | **Output:** `null` *** ### getCommitBuildStatus `commitsAndInsights.getCommitBuildStatus` Get a specific build status for a commit in Bitbucket. Use when you need to check the status of a particular build/CI run for a commit. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getCommitBuildStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `string` | Yes | — | | `key` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getCommitChanges `commitsAndInsights.getCommitChanges` Tool to retrieve a page of changes made in a specified commit, showing all changed files with their change statistics (lines added/removed, status). Use when you need to enumerate files modified in a specific commit or commit range. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getCommitChanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `spec` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `ignore_whitespace` | `boolean` | No | — | | `merge` | `boolean` | No | — | | `path` | `string` | No | — | | `renames` | `boolean` | No | — | | `topic` | `boolean` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getCommitComment `commitsAndInsights.getCommitComment` Retrieves a specific comment from a commit by its ID. Use when you need to fetch details of a particular commit comment including content, author, timestamps, and inline location. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getCommitComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string \| number` | Yes | — | | `commit` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getCommitDiff `commitsAndInsights.getCommitDiff` Tool to retrieve the unified diff between two provided revisions or for a single commit in a Bitbucket repository. Use when you need to see the actual code changes in a commit or between two commits. Supports filtering by file path and various diff options. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getCommitDiff({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `spec` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `context` | `number` | No | — | | `path` | `string` | No | — | | `ignore_whitespace` | `boolean` | No | — | | `binary` | `boolean` | No | — | | `renames` | `boolean` | No | — | | `merge` | `boolean` | No | — | | `topic` | `boolean` | No | — | **Output:** `string` *** ### getRepositoriesCommit `commitsAndInsights.getRepositoriesCommit` Tool to retrieve detailed information about a specific commit in a Bitbucket repository. Use when you need to get complete commit details including author, message, date, parents, and related links. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getRepositoriesCommit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesCommitComments `commitsAndInsights.getRepositoriesCommitComments` Retrieves all comments on a specific commit in a Bitbucket repository. Returns both global and inline code comments. Use when you need to view feedback, discussions, or notes left on a specific commit. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getRepositoriesCommitComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesCommitReport `commitsAndInsights.getRepositoriesCommitReport` Returns a single report matching the provided ID from a commit. Use when you need to retrieve details of a specific analysis report (e.g., security scan, code coverage, test results, or bug report) for a commit. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getRepositoriesCommitReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `commit` | `string` | Yes | — | | `reportId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesCommitReports `commitsAndInsights.getRepositoriesCommitReports` Tool to get reports linked to a specific commit. Use when you need to retrieve analysis results, test reports, security scans, or code coverage data associated with a commit. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getRepositoriesCommitReports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `commit` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesCommitReportsAnnotations `commitsAndInsights.getRepositoriesCommitReportsAnnotations` Returns a single annotation matching the provided ID from a commit report. Use when you need to retrieve details of a specific code analysis finding (e.g., vulnerability, code smell, or bug) identified in a commit. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getRepositoriesCommitReportsAnnotations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `commit` | `string` | Yes | — | | `reportId` | `string` | Yes | — | | `annotationId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesCommitStatuses `commitsAndInsights.getRepositoriesCommitStatuses` Returns all build statuses (e.g., CI/CD pipeline results) for a specific commit. Use when you need to check build status, verify test results, or monitor deployment pipelines for a particular commit. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getRepositoriesCommitStatuses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `refname` | `string` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesMergeBase `commitsAndInsights.getRepositoriesMergeBase` Get the merge base (best common ancestor) between two commits in a Bitbucket repository. Use when you need to find the common ancestor commit between two branches or commits for comparison or merge operations. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getRepositoriesMergeBase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `revspec` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoryPatch `commitsAndInsights.getRepositoryPatch` Tool to retrieve the git patch content for a Bitbucket repository at a specified revision or commit range. Use when you need to review code changes, generate diffs, or analyze modifications between commits. Returns raw patch in unified diff format. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.getRepositoryPatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `spec` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `string` *** ### listCommits `commitsAndInsights.listCommits` Tool to retrieve a page of commits from a Bitbucket repository. Returns commits in reverse chronological order (newest first), similar to git log. Use when you need to browse commit history, filter commits by branch/tag, or restrict to commits affecting a specific path. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.listCommits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listCommitsFromRevision `commitsAndInsights.listCommitsFromRevision` Tool to list commits starting from a specific revision in a Bitbucket repository. Commits are paginated and returned in reverse chronological order. Use when you need to retrieve commit history from a specific commit, branch, or tag. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.listCommitsFromRevision({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listCommitsOnMaster `commitsAndInsights.listCommitsOnMaster` Lists commits on the master branch of a Bitbucket repository. Use when you need to retrieve the commit history for the master branch, including commit messages, authors, dates, and parent relationships. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.listCommitsOnMaster({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### updateInsightsProjectsReposCommitsReports `commitsAndInsights.updateInsightsProjectsReposCommitsReports` Create or update an insight report for a commit. Creates a new report if it doesn't exist, or replaces the existing one if a report already exists for the given repository, commit, and report key. Note: replacing an existing report will be rejected if the authenticated user was not the creator of the specified report. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.updateInsightsProjectsReposCommitsReports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `commit` | `string` | Yes | — | | `reportId` | `string` | Yes | — | | `body` | `object[]` | Yes | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### updateRepositoriesCommitComments `commitsAndInsights.updateRepositoriesCommitComments` Updates the contents of a comment on a commit. Use when you need to modify an existing comment's text on a commit. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.updateRepositoriesCommitComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string \| number` | Yes | — | | `commit` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object[]` | Yes | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### updateRepositoriesCommitReportsAnnotations `commitsAndInsights.updateRepositoriesCommitReportsAnnotations` Creates or updates an individual annotation for a commit report. Use when you need to add or modify code analysis findings (vulnerabilities, code smells, or bugs) identified in a commit. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.commitsAndInsights.updateRepositoriesCommitReportsAnnotations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `commit` | `string` | Yes | — | | `reportId` | `string` | Yes | — | | `annotationId` | `string` | Yes | — | | `body` | `object[]` | Yes | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Issues ### createIssue `issues.createIssue` Creates a new issue in a Bitbucket repository, setting the authenticated user as reporter; ensures assignee (if provided) has repository access, and that any specified milestone, version, or component IDs exist. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.issues.createIssue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > title: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### createIssueComment `issues.createIssueComment` Adds a new comment with markdown support to an existing Bitbucket issue. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.issues.createIssueComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object[]` | Yes | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### deleteIssue `issues.deleteIssue` Permanently deletes a specific issue, identified by its `issue_id`, from the repository specified by `repo_slug` within the given `workspace`. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.bitbucket.api.issues.deleteIssue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `null` *** ### getRepositoriesIssuesVote `issues.getRepositoriesIssuesVote` Tool to check whether the authenticated user has voted for a specific issue in a Bitbucket repository. Use when you need to verify if the current user has already voted on an issue before attempting to vote or unvote. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.issues.getRepositoriesIssuesVote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listIssues `issues.listIssues` Lists issues in a Bitbucket repository with optional filtering by state, priority, kind, or assignee. Use when you need to discover issue IDs or get an overview of repository issues. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.issues.listIssues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listVersions `issues.listVersions` Lists versions (milestones) in a Bitbucket repository's issue tracker. Use when you need to discover available versions for associating with issues, or to retrieve version IDs for use with create\_issue. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.issues.listVersions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### updateIssue `issues.updateIssue` Updates an existing issue in a Bitbucket repository by modifying specified attributes; requires `workspace`, `repo_slug`, `issue_id`, and at least one attribute to update. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.issues.updateIssue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > title?: string, > content?: { > raw: string > }, > state?: new | open | resolved | on hold | invalid | duplicate | wontfix | closed, > kind?: bug | enhancement | proposal | task, > priority?: trivial | minor | major | critical | blocker, > assignee?: { > } | null, > milestone?: { > } | null, > component?: { > } | null, > version?: { > } | null > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Pipelines And Deployments ### createTeamsPipelinesConfigVariables `pipelinesAndDeployments.createTeamsPipelinesConfigVariables` Creates a team-level pipeline configuration variable in Bitbucket. Use when you need to add environment variables or configuration values that should be available to all pipelines within a team. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.createTeamsPipelinesConfigVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `body` | `object[]` | No | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### createUsersPipelinesConfigVariables `pipelinesAndDeployments.createUsersPipelinesConfigVariables` Creates a user-level pipeline variable for Bitbucket pipelines. Use when you need to create account-level configuration variables that can be used across all repositories owned by the user. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.createUsersPipelinesConfigVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `selected_user` | `string` | Yes | — | | `body` | `object[]` | No | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### deleteUserPipelineVariable `pipelinesAndDeployments.deleteUserPipelineVariable` Permanently deletes a user-level pipeline configuration variable identified by its UUID. Use this to remove pipeline variables that are no longer needed at the account level. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.deleteUserPipelineVariable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `selected_user` | `string` | Yes | — | | `variable_uuid` | `string` | Yes | — | **Output:** `null` *** ### getDeploymentEnvironmentVariables `pipelinesAndDeployments.getDeploymentEnvironmentVariables` Retrieves deployment environment level variables for a specific Bitbucket repository environment. Use when you need to view or audit environment-specific configuration variables for deployments. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getDeploymentEnvironmentVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `environment_uuid` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getOpenidConfiguration `pipelinesAndDeployments.getOpenidConfiguration` Retrieves the OpenID Connect discovery configuration for Bitbucket Pipelines OIDC. Use when integrating Bitbucket Pipelines with resource servers (AWS, GCP, Vault) using OpenID Connect authentication. Returns issuer URL, JWKS URI, and supported capabilities. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getOpenidConfiguration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesEnvironments2 `pipelinesAndDeployments.getRepositoriesEnvironments2` Retrieve detailed information about a specific deployment environment in a Bitbucket repository. Use when you need to get environment configuration, deployment settings, or check environment properties like locks and restrictions. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getRepositoriesEnvironments2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `environment_uuid` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPipelines2 `pipelinesAndDeployments.getRepositoriesPipelines2` Retrieve a specified pipeline from a Bitbucket repository. Use when you need to get detailed information about a specific pipeline execution including its status, build number, and results. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getRepositoriesPipelines2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `pipeline_uuid` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPipelinesConfigCaches `pipelinesAndDeployments.getRepositoriesPipelinesConfigCaches` Retrieves the repository pipelines caches. Use when you need to list all caches configured for Bitbucket Pipelines in a specific repository. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getRepositoriesPipelinesConfigCaches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPipelinesConfigRunners `pipelinesAndDeployments.getRepositoriesPipelinesConfigRunners` Retrieves the list of self-hosted runners configured for a repository's pipelines. Use when you need to view available runners for pipeline execution. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getRepositoriesPipelinesConfigRunners({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPipelinesConfigSchedules `pipelinesAndDeployments.getRepositoriesPipelinesConfigSchedules` Retrieves configured pipeline schedules for a Bitbucket repository. Use when you need to view scheduled pipeline runs and their cron patterns. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getRepositoriesPipelinesConfigSchedules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPipelinesConfigSshKnownHosts `pipelinesAndDeployments.getRepositoriesPipelinesConfigSshKnownHosts` Retrieves repository-level SSH known hosts configured for Bitbucket Pipelines. Use when you need to list or verify SSH known hosts that Pipelines can connect to during builds. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getRepositoriesPipelinesConfigSshKnownHosts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPipelinesConfigVariables `pipelinesAndDeployments.getRepositoriesPipelinesConfigVariables` Retrieves repository-level pipeline variables for a specific Bitbucket repository. Use when you need to view or audit pipeline configuration variables that are scoped to a repository. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getRepositoriesPipelinesConfigVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPipelinesSteps `pipelinesAndDeployments.getRepositoriesPipelinesSteps` Retrieves all steps for a given pipeline. Use when you need to inspect the individual steps of a pipeline execution, including their state, duration, and commands. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.getRepositoriesPipelinesSteps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `pipeline_uuid` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listDeployments `pipelinesAndDeployments.listDeployments` Lists deployments for a specified Bitbucket repository. Use when you need to view deployment history and status across environments. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.listDeployments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listPipelines `pipelinesAndDeployments.listPipelines` Tool to find pipelines in a Bitbucket repository. Returns pipeline metadata including state, trigger, and duration. Use when you need to browse pipeline history or check pipeline status. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.listPipelines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `creator.uuid` | `string` | No | — | | `target.ref_type` | `BRANCH \| TAG \| ANNOTATED_TAG` | No | — | | `target.ref_name` | `string` | No | — | | `target.branch` | `string` | No | — | | `target.commit.hash` | `string` | No | — | | `target.selector.pattern` | `string` | No | — | | `target.selector.type` | `BRANCH \| TAG \| CUSTOM \| PULLREQUESTS \| DEFAULT` | No | — | | `created_on` | `string` | No | — | | `trigger_type` | `PUSH \| MANUAL \| SCHEDULED \| PARENT_STEP` | No | — | | `status` | `PARSING \| PENDING \| PAUSED \| HALTED \| BUILDING \| ERROR \| PASSED \| FAILED \| STOPPED \| UNKNOWN` | No | — | | `sort` | `creator.uuid \| created_on \| run_creation_date` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listRepositoriesEnvironments `pipelinesAndDeployments.listRepositoriesEnvironments` List all deployment environments configured for a Bitbucket repository. Use when you need to view available environments for deployments, check environment configurations, or select an environment for deployment operations. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.listRepositoriesEnvironments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### updateTeamsPipelinesConfigVariables `pipelinesAndDeployments.updateTeamsPipelinesConfigVariables` Updates a team-level pipeline configuration variable in Bitbucket. Use when you need to modify existing environment variables or configuration values that are available to all pipelines within a team. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.updateTeamsPipelinesConfigVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `variable_uuid` | `string` | Yes | — | | `body` | `object[]` | Yes | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### updateUsersPipelinesConfigVariables `pipelinesAndDeployments.updateUsersPipelinesConfigVariables` Updates a user-level pipeline variable for Bitbucket pipelines. Use when you need to modify account-level configuration variables such as changing the value, key name, or security status. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.pipelinesAndDeployments.updateUsersPipelinesConfigVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `selected_user` | `string` | Yes | — | | `variable_uuid` | `string` | Yes | — | | `body` | `object[]` | Yes | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Pull Requests ### approvePullRequest `pullRequests.approvePullRequest` Tool to approve a pull request as the authenticated user. Use when you need to formally approve changes in a pull request review process. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.pullRequests.approvePullRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### createPullRequest `pullRequests.createPullRequest` Creates a new pull request in a specified Bitbucket repository, ensuring the source branch exists and is distinct from the (optional) destination branch. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.pullRequests.createPullRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > title: string, > source: { > branch: { > name: string > } > } > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### createPullRequestComment `pullRequests.createPullRequestComment` Creates a new comment on a Bitbucket pull request. Supports top-level comments, threaded replies, and inline code comments. Use when providing feedback on a PR, replying to existing comments, or commenting on specific code lines. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.pullRequests.createPullRequestComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object[]` | Yes | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getPullRequest `pullRequests.getPullRequest` Get a single pull request by ID with complete details. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.getPullRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getPullRequestComment `pullRequests.getPullRequestComment` Tool to retrieve a specific comment from a pull request by its ID. Use when you need to fetch details of a particular pull request comment including content, author, timestamps, and inline location. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.getPullRequestComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string \| number` | Yes | — | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getPullRequestCommits `pullRequests.getPullRequestCommits` Tool to retrieve commits for a specified pull request. Use when reviewing the commit history of a PR or analyzing changes included in a pull request. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.getPullRequestCommits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getPullRequestDiff `pullRequests.getPullRequestDiff` Tool to fetch the unified diff for a Bitbucket pull request (follows 302 redirect to repository diff). Use when reviewing code changes in a PR. Supports optional truncation for large diffs via max\_chars parameter. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.getPullRequestDiff({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `string` *** ### getPullRequestDiffstat `pullRequests.getPullRequestDiffstat` Tool to get the diffstat for a Bitbucket pull request, showing all changed files with their change statistics (lines added/removed, status). Use when you need to enumerate files modified in a PR. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.getPullRequestDiffstat({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPullrequestsActivity `pullRequests.getRepositoriesPullrequestsActivity` Get paginated activity log for all pull requests in a repository. Returns comments, updates, approvals, and request changes. Use when you need to track pull request activity history. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.getRepositoriesPullrequestsActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPullrequestsComments `pullRequests.getRepositoriesPullrequestsComments` Retrieves a paginated list of comments on a specific pull request in a Bitbucket repository. Returns global, inline, and threaded comments. Use when you need to view feedback, discussions, or reviews left on a pull request. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.getRepositoriesPullrequestsComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesPullrequestsStatuses `pullRequests.getRepositoriesPullrequestsStatuses` Returns all build statuses (e.g., CI/CD pipeline results) for a specific pull request. Use when you need to check build status, verify test results, or monitor deployment pipelines for a pull request. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.getRepositoriesPullrequestsStatuses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listPullRequests `pullRequests.listPullRequests` Lists pull requests in a specified, accessible Bitbucket repository, optionally filtering by state (OPEN, MERGED, DECLINED). **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.listPullRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `state` | `OPEN \| MERGED \| DECLINED \| SUPERSEDED` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listPullRequestTasks `pullRequests.listPullRequestTasks` Lists all tasks associated with a pull request in a Bitbucket repository. Use when you need to view or track tasks on a PR. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.pullRequests.listPullRequestTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `pagelen` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### requestPullRequestChanges `pullRequests.requestPullRequestChanges` Tool to request changes on a pull request as the authenticated user. Use when you need to formally request changes in a pull request review process, indicating the PR needs modifications before approval. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.pullRequests.requestPullRequestChanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pull_request_id` | `string \| number` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Repositories ### createRepository `repositories.createRepository` Creates a new Bitbucket 'git' repository in a specified workspace, defaulting to the workspace's oldest project if `project_key` is not provided. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.repositories.createRepository({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object[]` | No | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### deleteRepository `repositories.deleteRepository` Permanently deletes a specified Bitbucket repository; this action is irreversible and does not affect forks. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.bitbucket.api.repositories.deleteRepository({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `redirect_to` | `string` | No | — | **Output:** `null` *** ### getRepositoriesWatchers `repositories.getRepositoriesWatchers` Retrieves a paginated list of all the watchers on the specified repository. Use when you need to see who is watching a particular repository. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.repositories.getRepositoriesWatchers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepository `repositories.getRepository` Retrieves detailed information about a specific repository in a Bitbucket workspace. Use when you need to get repository metadata, settings, or details. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.repositories.getRepository({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listRepositories `repositories.listRepositories` Retrieves a paginated list of all public repositories on Bitbucket. Use when you need to discover or search across public repositories, optionally filtered by role, query string, creation date, or sorted by various fields. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.repositories.listRepositories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `after` | `string` | No | — | | `role` | `admin \| contributor \| member \| owner` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listRepositoriesInWorkspace `repositories.listRepositoriesInWorkspace` Lists repositories in a specified Bitbucket workspace, accessible to the authenticated user, with options to filter by role or query string, and sort results. Responses are paginated; iterate using the `next` field in each response until it is absent to retrieve all repositories. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.repositories.listRepositoriesInWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `role` | `admin \| contributor \| member \| owner` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Search And Discovery ### getHookEvents `searchAndDiscovery.getHookEvents` Retrieves a paginated list of all valid webhook events for a specified entity type (repository or workspace). Use when you need to discover available webhook event types for subscription or webhook configuration. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.searchAndDiscovery.getHookEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subject_type` | `repository \| workspace` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getWorkspacesSearchCode `searchAndDiscovery.getWorkspacesSearchCode` Tool to search for code in the repositories of the specified workspace. Use when you need to find specific code patterns, function definitions, or text across all repositories in a workspace. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.searchAndDiscovery.getWorkspacesSearchCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `search_query` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### searchTeamCode `searchAndDiscovery.searchTeamCode` Search for code in repositories of a specified team. Matches can occur in file content or paths. Note: Teams endpoints were deprecated in Oct 2020; use workspace search endpoints for new integrations. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.searchAndDiscovery.searchTeamCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `search_query` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### searchUserRepositoriesCode `searchAndDiscovery.searchUserRepositoriesCode` Tool to search for code in the repositories of a specified user. Use when you need to find specific code patterns, functions, or text across all repositories owned by a user. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.searchAndDiscovery.searchUserRepositoriesCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `selected_user` | `string` | Yes | — | | `search_query` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Snippets ### createSnippetComment `snippets.createSnippetComment` Posts a new top-level comment or a threaded reply to an existing comment on a specified Bitbucket snippet. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.snippets.createSnippetComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `encoded_id` | `string \| number` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object[]` | Yes | — | > **body full type** > > ```ts theme={null} > { > } | { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### deleteSnippetsWatch `snippets.deleteSnippetsWatch` Stops watching a specific snippet. Use when you want to unsubscribe from notifications for a snippet. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.snippets.deleteSnippetsWatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `encoded_id` | `string \| number` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `null` *** ### getSnippet `snippets.getSnippet` Retrieves a specific Bitbucket snippet by its encoded ID from an existing workspace, returning its metadata and file structure. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.snippets.getSnippet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `encoded_id` | `string \| number` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getSnippetsWatch `snippets.getSnippetsWatch` Checks if the current user is watching a specific snippet. Use when you need to verify watch status for a snippet. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.snippets.getSnippetsWatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `encoded_id` | `string \| number` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listSnippets `snippets.listSnippets` Returns all snippets accessible to the authenticated user. Use when you need to discover or list snippets, optionally filtered by role (owner, contributor, or member). **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.snippets.listSnippets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `owner \| contributor \| member` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Source And Refs ### browseRepositoryPath `sourceAndRefs.browseRepositoryPath` Tool to retrieve content for a file path or browse directory contents at a specified revision in a Bitbucket repository. Use when you need flexible access to repository content - returns raw file data for files or paginated directory listings for directories. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.browseRepositoryPath({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `string` | Yes | — | | `path` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `format` | `meta \| rendered` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `max_depth` | `number` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### createBranch `sourceAndRefs.createBranch` Creates a new branch in a Bitbucket repository from a target commit hash; the branch name must be unique, adhere to Bitbucket's naming conventions, and not include the 'refs/heads/' prefix. **Risk:** `write` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.createBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > name: string, > target: { > hash: string > } > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getBranch `sourceAndRefs.getBranch` Retrieves detailed information about a specific branch in a Bitbucket repository. Use when you need to get branch metadata, the commit it points to, or verify a branch exists. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.getBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getFileFromRepository `sourceAndRefs.getFileFromRepository` Retrieves a specific file's content from a Bitbucket repository at a given commit (hash, branch, or tag), failing if the file path is invalid for that commit. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.getFileFromRepository({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `string` | Yes | — | | `path` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `format` | `meta \| rendered` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `max_depth` | `number` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRawFileContent `sourceAndRefs.getRawFileContent` Tool to retrieve the raw content of a file from a Bitbucket repository at a specified commit, branch, or tag. Use when you need to read file contents from a specific revision. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.getRawFileContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `string` | Yes | — | | `path` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `format` | `meta \| rendered` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `max_depth` | `number` | No | — | **Output:** `string` *** ### getRepositoriesBranchingModel `sourceAndRefs.getRepositoriesBranchingModel` Return the branching model as applied to the repository. Use when you need to understand the repository's branch workflow configuration, including development/production branches and branch type prefixes. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.getRepositoriesBranchingModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesEffectiveBranchingModel `sourceAndRefs.getRepositoriesEffectiveBranchingModel` Retrieves the effective branching model for a Bitbucket repository, showing which branching model is currently applied (including any inheritance from project-level settings). Use when you need to understand the repository's branch workflow configuration, including development and production branches and branch type prefixes. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.getRepositoriesEffectiveBranchingModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesFilehistory `sourceAndRefs.getRepositoriesFilehistory` Returns a paginated list of commits that modified the specified file. Use when you need to track file changes over time, find who modified a file, or determine when a file was created or last changed. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.getRepositoriesFilehistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `string` | Yes | — | | `path` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `renames` | `string` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesRefs `sourceAndRefs.getRepositoriesRefs` Returns the branches and tags in the repository. Use when you need to list all refs (both branches and tags) in a single API call with optional filtering by type, name pattern, or commit hash. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.getRepositoriesRefs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesRefsTags `sourceAndRefs.getRepositoriesRefsTags` Retrieves detailed information about a specific tag in a Bitbucket repository. Use when you need to get tag metadata, target commit details, or verify a tag exists. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.getRepositoriesRefsTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getRepositoriesSrc `sourceAndRefs.getRepositoriesSrc` Lists the contents of the root directory on the repository's main branch without needing to specify a commit or branch. This endpoint redirects to the main branch automatically. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.getRepositoriesSrc({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `format` | `meta` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listBranches `sourceAndRefs.listBranches` Lists branches in a Bitbucket repository with optional server-side filtering by name pattern (BBQL) and sorting. Use when you need to discover available branches, search for specific branch patterns, or navigate repository branch structure. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.listBranches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listRepositoryPaths `sourceAndRefs.listRepositoryPaths` Lists file and directory entries under a repository path at a given revision, with optional breadth-first recursion via max\_depth for repository traversal and scanning. Fails if the path points to a file rather than a directory. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.listRepositoryPaths({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `string` | Yes | — | | `path` | `string` | Yes | — | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `format` | `meta \| rendered` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `max_depth` | `number` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listTags `sourceAndRefs.listTags` Lists tags in a Bitbucket repository with optional server-side filtering by name pattern or commit hash (BBQL) and sorting. Use when you need to discover available tags, search for specific tag patterns, or find tags pointing to specific commits. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.sourceAndRefs.listTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_slug` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Users And Permissions ### getCurrentUser2 `usersAndPermissions.getCurrentUser2` Tool to retrieve complete profile information for the currently authenticated Bitbucket user. Use when you need comprehensive user details including account\_id, username, nickname, and other profile fields. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.usersAndPermissions.getCurrentUser2({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getSshLatestKeys `usersAndPermissions.getSshLatestKeys` Retrieves a paginated list of SSH keys for a specified Bitbucket user. Use when you need to view or audit SSH keys configured for a user account. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.usersAndPermissions.getSshLatestKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `selected_user` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getUser `usersAndPermissions.getUser` Retrieves public profile information for a specific Bitbucket user by username or UUID. Use when you need to get user details like display name, avatar, creation date, and links to related resources. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.usersAndPermissions.getUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `selected_user` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getUserEmails `usersAndPermissions.getUserEmails` Returns all the authenticated user's email addresses, both confirmed and unconfirmed. Use when you need to retrieve all email addresses associated with the current user's account. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.usersAndPermissions.getUserEmails({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getUserEmails2 `usersAndPermissions.getUserEmails2` Retrieves details about a specific email address for the authenticated user. Use when you need to check if an email is primary, confirmed, or verify email ownership. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.usersAndPermissions.getUserEmails2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getUserPermissionsRepositories `usersAndPermissions.getUserPermissionsRepositories` Returns an object for each repository the caller has explicit access to, including their permission level. Use when you need to discover which repositories the authenticated user can access and their specific permissions. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.usersAndPermissions.getUserPermissionsRepositories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getUserPermissionsWorkspaces `usersAndPermissions.getUserPermissionsWorkspaces` Retrieves workspace memberships and permission levels for the authenticated user. Returns an object for each workspace the caller is a member of, along with their effective role (highest privilege level). Use when you need to determine which workspaces a user can access and their permission level in each. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.usersAndPermissions.getUserPermissionsWorkspaces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getUserWorkspaces `usersAndPermissions.getUserWorkspaces` Tool to retrieve all workspaces accessible to the authenticated user. Use when you need to list workspaces the current user can access, optionally filtered by workspace slug or permission level. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.usersAndPermissions.getUserWorkspaces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `string` | No | — | | `administrator` | `boolean` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Workspaces And Projects ### getProjectsRepos `workspacesAndProjects.getProjectsRepos` Retrieves repositories from a project in a Bitbucket workspace. Use when you need to list all repositories belonging to a specific project key within a workspace. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.workspacesAndProjects.getProjectsRepos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `role` | `admin \| contributor \| member \| owner` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `project_key` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getWorkspace `workspacesAndProjects.getWorkspace` Retrieves detailed information about a specific Bitbucket workspace. Use when you need to get workspace metadata, settings, or details. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.workspacesAndProjects.getWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getWorkspacesPullrequests `workspacesAndProjects.getWorkspacesPullrequests` Tool to get all workspace pull requests authored by a specified user. Use when you need to retrieve pull requests created by a specific user across all repositories in a workspace. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.workspacesAndProjects.getWorkspacesPullrequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `selected_user` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `state` | `OPEN \| MERGED \| DECLINED \| SUPERSEDED` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listWorkspaceMembers `workspacesAndProjects.listWorkspaceMembers` Lists all members of a specified Bitbucket workspace; the workspace must exist. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.workspacesAndProjects.listWorkspaceMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listWorkspaceProjects `workspacesAndProjects.listWorkspaceProjects` Lists projects in a specified Bitbucket workspace. Use when you need to retrieve all projects belonging to a workspace. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.workspacesAndProjects.listWorkspaceProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listWorkspaces `workspacesAndProjects.listWorkspaces` Lists Bitbucket workspaces accessible to the authenticated user, optionally filtered and sorted. Results are paginated; follow the `next` field in each response to retrieve subsequent pages until `next` is absent. When multiple workspaces are returned, verify the correct `slug` or UUID before passing to downstream tools. **Risk:** `read` ```ts theme={null} await corsair.bitbucket.api.workspacesAndProjects.listWorkspaces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `owner \| collaborator \| member` | No | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `page` | `number` | No | — | | `pagelen` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** # Database Source: https://docs.corsair.dev/plugins/bitbucket/database Bitbucket local sync: searchable entities, `.search()` filters, and operators. The Bitbucket plugin syncs data locally. Use `corsair.bitbucket.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Branches Path: `bitbucket.db.branches.search` ```ts theme={null} const rows = await corsair.bitbucket.db.branches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `default_merge_strategy` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Commits Path: `bitbucket.db.commits.search` ```ts theme={null} const rows = await corsair.bitbucket.db.commits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `hash` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Issues Path: `bitbucket.db.issues.search` ```ts theme={null} const rows = await corsair.bitbucket.db.issues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `kind` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `string` | equals, contains, startsWith, endsWith, in | | `votes` | `number` | equals, gt, gte, lt, lte, in | | `created_on` | `string` | equals, contains, startsWith, endsWith, in | | `updated_on` | `string` | equals, contains, startsWith, endsWith, in | | `edited_on` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pipelines Path: `bitbucket.db.pipelines.search` ```ts theme={null} const rows = await corsair.bitbucket.db.pipelines.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `build_number` | `number` | equals, gt, gte, lt, lte, in | | `created_on` | `string` | equals, contains, startsWith, endsWith, in | | `completed_on` | `string` | equals, contains, startsWith, endsWith, in | | `build_seconds_used` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `bitbucket.db.projects.search` ```ts theme={null} const rows = await corsair.bitbucket.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `is_private` | `boolean` | equals | | `created_on` | `string` | equals, contains, startsWith, endsWith, in | | `updated_on` | `string` | equals, contains, startsWith, endsWith, in | | `has_publicly_visible_repos` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pull Requests Path: `bitbucket.db.pullRequests.search` ```ts theme={null} const rows = await corsair.bitbucket.db.pullRequests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `draft` | `boolean` | equals | | `queued` | `boolean` | equals | | `reason` | `string` | equals, contains, startsWith, endsWith, in | | `comment_count` | `number` | equals, gt, gte, lt, lte, in | | `task_count` | `number` | equals, gt, gte, lt, lte, in | | `close_source_branch` | `boolean` | equals | | `created_on` | `string` | equals, contains, startsWith, endsWith, in | | `updated_on` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Repositories Path: `bitbucket.db.repositories.search` ```ts theme={null} const rows = await corsair.bitbucket.db.repositories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `scm` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `is_private` | `boolean` | equals | | `has_issues` | `boolean` | equals | | `has_wiki` | `boolean` | equals | | `fork_policy` | `string` | equals, contains, startsWith, endsWith, in | | `enforced_signed_commits` | `boolean` | equals | | `created_on` | `string` | equals, contains, startsWith, endsWith, in | | `updated_on` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Snippets Path: `bitbucket.db.snippets.search` ```ts theme={null} const rows = await corsair.bitbucket.db.snippets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `scm` | `string` | equals, contains, startsWith, endsWith, in | | `is_private` | `boolean` | equals | | `created_on` | `string` | equals, contains, startsWith, endsWith, in | | `updated_on` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `bitbucket.db.tags.search` ```ts theme={null} const rows = await corsair.bitbucket.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `bitbucket.db.users.search` ```ts theme={null} const rows = await corsair.bitbucket.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `display_name` | `string` | equals, contains, startsWith, endsWith, in | | `nickname` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `account_id` | `string` | equals, contains, startsWith, endsWith, in | | `account_status` | `string` | equals, contains, startsWith, endsWith, in | | `created_on` | `string` | equals, contains, startsWith, endsWith, in | | `has_2fa_enabled` | `boolean` | equals | | `is_staff` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `bitbucket.db.workspaces.search` ```ts theme={null} const rows = await corsair.bitbucket.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `is_private` | `boolean` | equals | | `is_personal` | `boolean` | equals | | `is_privacy_enforced` | `boolean` | equals | | `forking_mode` | `string` | equals, contains, startsWith, endsWith, in | | `sign_system_commits` | `boolean` | equals | | `created_on` | `string` | equals, contains, startsWith, endsWith, in | | `updated_on` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bitbucket/overview Git repository hosting for source code, pull requests, and CI/CD pipelines. Use **Bitbucket** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 104 typed API operations * 11 synced entities (`branches`, `commits`, `issues`, `pipelines`, `projects`, `pullRequests`, and 5 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bitbucket ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bitbucket ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bitbucket ``` ```bash bun theme={null} bun add corsair @corsair-dev/bitbucket ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bitbucket } from '@corsair-dev/bitbucket'; export const corsair = createCorsair({ plugins: [ bitbucket(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Bitbucket OAuth app. ```ts theme={null} bitbucket() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bitbucket', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`commitsAndInsights.getCommitBuildStatus`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bitbucket.api.commitsAndInsights.getCommitBuildStatus({}); ``` **`commitsAndInsights.createRepositoriesCommitReportsAnnotations`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bitbucket.api.commitsAndInsights.createRepositoriesCommitReportsAnnotations({}); ``` See the full list on the [API](/plugins/bitbucket/api) page. ## Query synced data Synced entities support `tenant.bitbucket.db..search()` and `.list()`: `branches`, `commits`, `issues`, `pipelines`, `projects`, `pullRequests`, `repositories`, `snippets`, `tags`, `users`, `workspaces`. See [Database](/plugins/bitbucket/database) for filters and operators. ## What's next > **[API reference](/plugins/bitbucket/api)** > > Every `bitbucket.api.*` operation with input and output types. > **[Database](/plugins/bitbucket/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bitwarden/api API reference for Bitwarden: every `bitwarden.api.*` operation with input and output types. Every `bitwarden.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Collections ### get `collections.get` Get details for a specific collection **Risk:** `read` ```ts theme={null} await corsair.bitwarden.api.collections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `externalId` | `string` | No | — | *** ### list `collections.list` List all collections in an organization **Risk:** `read` ```ts theme={null} await corsair.bitwarden.api.collections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > organizationId: string, > name: string, > externalId?: string | null > }[] > ``` *** ## Members ### get `members.get` Get details for a specific organization member **Risk:** `read` ```ts theme={null} await corsair.bitwarden.api.members.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `email` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `number` | Yes | — | | `type` | `number` | Yes | — | | `twoFactorEnabled` | `boolean` | Yes | — | | `accessAll` | `boolean` | Yes | — | *** ### list `members.list` List all members in an organization **Risk:** `read` ```ts theme={null} await corsair.bitwarden.api.members.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > organizationId: string, > email: string, > name: string, > status: number, > type: number, > twoFactorEnabled: boolean, > accessAll: boolean > }[] > ``` *** ## Organizations ### get `organizations.get` Get details for a specific organization **Risk:** `read` ```ts theme={null} await corsair.bitwarden.api.organizations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `billingEmail` | `string` | Yes | — | | `businessName` | `string` | No | — | | `businessAddress1` | `string` | No | — | | `businessAddress2` | `string` | No | — | | `businessAddress3` | `string` | No | — | | `businessCountry` | `string` | No | — | | `businessTaxNumber` | `string` | No | — | *** ### list `organizations.list` List all organizations the authenticated account can access **Risk:** `read` ```ts theme={null} await corsair.bitwarden.api.organizations.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > billingEmail: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/bitwarden/database Bitwarden local sync: searchable entities, `.search()` filters, and operators. The Bitwarden plugin syncs data locally. Use `corsair.bitwarden.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Ciphers Path: `bitwarden.db.ciphers.search` ```ts theme={null} const rows = await corsair.bitwarden.db.ciphers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organizationId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | | `favorite` | `boolean` | equals | | `edit` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Collections Path: `bitwarden.db.collections.search` ```ts theme={null} const rows = await corsair.bitwarden.db.collections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organizationId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Members Path: `bitwarden.db.members.search` ```ts theme={null} const rows = await corsair.bitwarden.db.members.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organizationId` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `number` | equals, gt, gte, lt, lte, in | | `type` | `number` | equals, gt, gte, lt, lte, in | | `twoFactorEnabled` | `boolean` | equals | | `accessAll` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `bitwarden.db.organizations.search` ```ts theme={null} const rows = await corsair.bitwarden.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `billingEmail` | `string` | equals, contains, startsWith, endsWith, in | | `businessName` | `string` | equals, contains, startsWith, endsWith, in | | `businessCountry` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bitwarden/overview Open-source password manager for secure credential storage and team secret sharing. Use **Bitwarden** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 6 typed API operations * 4 synced entities (`ciphers`, `collections`, `members`, `organizations`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bitwarden ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bitwarden ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bitwarden ``` ```bash bun theme={null} bun add corsair @corsair-dev/bitwarden ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bitwarden } from '@corsair-dev/bitwarden'; export const corsair = createCorsair({ plugins: [ bitwarden(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Bitwarden OAuth app. ```ts theme={null} bitwarden() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bitwarden', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`collections.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bitwarden.api.collections.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/bitwarden/api) reference.* See the full list on the [API](/plugins/bitwarden/api) page. ## Query synced data Synced entities support `tenant.bitwarden.db..search()` and `.list()`: `ciphers`, `collections`, `members`, `organizations`. See [Database](/plugins/bitwarden/database) for filters and operators. ## What's next > **[API reference](/plugins/bitwarden/api)** > > Every `bitwarden.api.*` operation with input and output types. > **[Database](/plugins/bitwarden/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/blackbaud/api API reference for Blackbaud: every `blackbaud.api.*` operation with input and output types. Every `blackbaud.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Batch ### addGiftsToBatch `batch.addGiftsToBatch` Add one or more gifts (donations) to an existing open gift batch in Blackbaud Raiser's Edge NXT. Returns the added gifts and any per-gift errors. **Risk:** `write` ```ts theme={null} await corsair.blackbaud.api.batch.addGiftsToBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch_id` | `string` | Yes | — | | `gifts` | `object[]` | Yes | — | > **gifts full type** > > ```ts theme={null} > { > amount: { > value: number > }, > constituent_id: string, > gift_splits: { > amount: { > value: number > }, > fund_id: string, > appeal_id?: string, > campaign_id?: string, > package_id?: string > }[], > type: string, > payments: { > payment_method?: string, > account_token?: string, > bbps_configuration_id?: string, > bbps_transaction_id?: string, > check_date?: { > d?: number, > m?: number, > y?: number > }, > check_number?: string, > checkout_transaction_id?: string, > charge_transaction?: boolean, > reason?: string, > reference?: string, > reference_date?: { > d?: number, > m?: number, > y?: number > }, > rejection_details?: string > }[], > date?: string, > post_date?: string, > post_status?: string, > gift_status?: string, > subtype?: string, > constituency?: string, > gift_code?: string, > is_anonymous?: boolean, > lookup_id?: string, > origin?: string, > reference?: string, > batch_number?: string, > batch_prefix?: string, > linked_gifts?: string[], > fundraisers?: { > amount: { > value: number > }, > constituent_id: string > }[], > soft_credits?: { > amount: { > value: number > }, > constituent_id: string > }[], > default_fundraiser_credits?: boolean, > default_soft_credits?: boolean, > custom_fields?: { > category: string, > value?: string | number | boolean, > comment?: string, > date?: string, > parent_id?: string > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `gifts` | `object[]` | No | — | | `errors` | `object[]` | No | — | > **gifts full type** > > ```ts theme={null} > { > id?: string, > constituent_id?: string, > amount?: { > value: number > }, > balance?: { > value: number > }, > batch_number?: string, > constituency?: string, > date?: string, > date_added?: string, > date_modified?: string, > gift_code?: string, > gift_status?: string, > is_anonymous?: boolean, > lookup_id?: string, > origin?: string, > post_date?: string, > post_status?: string, > reference?: string, > subtype?: string, > type?: string, > linked_gifts?: string[], > gift_splits?: { > id?: string, > amount?: { > value: number > }, > appeal_id?: string, > campaign_id?: string, > fund_id?: string, > package_id?: string > }[], > payments?: { > payment_method?: string, > account_token?: string, > bbps_configuration_id?: string, > bbps_transaction_id?: string, > check_date?: { > d?: number, > m?: number, > y?: number > }, > check_number?: string, > checkout_transaction_id?: string, > reference?: string, > reference_date?: { > d?: number, > m?: number, > y?: number > } > }[], > fundraisers?: { > amount?: { > value: number > }, > constituent_id?: string > }[], > soft_credits?: { > id?: string, > amount?: { > value: number > }, > constituent_id?: string, > gift_id?: string > }[], > receipts?: { > amount?: { > value: number > }, > date?: string, > number?: number, > status?: string > }[], > acknowledgements?: { > date?: string, > letter?: string, > status?: string > }[], > batch_id?: string, > approved_gift_id?: string, > errors?: { > affected_field?: string, > batch_id?: string, > exception_error_code?: number, > exception_error_message?: string, > exception_error_name?: string, > gift_id?: string, > lookup_id?: string > }[] > }[] > ``` > **errors full type** > > ```ts theme={null} > { > affected_field?: string, > batch_id?: string, > exception_error_code?: number, > exception_error_message?: string, > exception_error_name?: string, > gift_id?: string, > lookup_id?: string > }[] > ``` *** ## Gifts ### getGiftById `gifts.getGiftById` Retrieves comprehensive gift details from Blackbaud Raiser's Edge NXT by gift ID. **Risk:** `read` ```ts theme={null} await corsair.blackbaud.api.gifts.getGiftById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gift_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `constituent_id` | `string` | No | — | | `amount` | `object` | No | — | | `balance` | `object` | No | — | | `batch_number` | `string` | No | — | | `constituency` | `string` | No | — | | `date` | `string` | No | — | | `date_added` | `string` | No | — | | `date_modified` | `string` | No | — | | `gift_code` | `string` | No | — | | `gift_status` | `string` | No | — | | `is_anonymous` | `boolean` | No | — | | `lookup_id` | `string` | No | — | | `origin` | `string` | No | — | | `post_date` | `string` | No | — | | `post_status` | `string` | No | — | | `reference` | `string` | No | — | | `subtype` | `string` | No | — | | `type` | `string` | No | — | | `linked_gifts` | `string[]` | No | — | | `gift_splits` | `object[]` | No | — | | `payments` | `object[]` | No | — | | `fundraisers` | `object[]` | No | — | | `soft_credits` | `object[]` | No | — | | `receipts` | `object[]` | No | — | | `acknowledgements` | `object[]` | No | — | > **amount full type** > > ```ts theme={null} > { > value: number > } > ``` > **balance full type** > > ```ts theme={null} > { > value: number > } > ``` > **gift\_splits full type** > > ```ts theme={null} > { > id?: string, > amount?: { > value: number > }, > appeal_id?: string, > campaign_id?: string, > fund_id?: string, > package_id?: string > }[] > ``` > **payments full type** > > ```ts theme={null} > { > payment_method?: string, > account_token?: string, > bbps_configuration_id?: string, > bbps_transaction_id?: string, > check_date?: { > d?: number, > m?: number, > y?: number > }, > check_number?: string, > checkout_transaction_id?: string, > reference?: string, > reference_date?: { > d?: number, > m?: number, > y?: number > } > }[] > ``` > **fundraisers full type** > > ```ts theme={null} > { > amount?: { > value: number > }, > constituent_id?: string > }[] > ``` > **soft\_credits full type** > > ```ts theme={null} > { > id?: string, > amount?: { > value: number > }, > constituent_id?: string, > gift_id?: string > }[] > ``` > **receipts full type** > > ```ts theme={null} > { > amount?: { > value: number > }, > date?: string, > number?: number, > status?: string > }[] > ``` > **acknowledgements full type** > > ```ts theme={null} > { > date?: string, > letter?: string, > status?: string > }[] > ``` *** ## Membership ### getMembershipDetails `membership.getMembershipDetails` Retrieves membership details (program, category, dues, renewal dates) from Blackbaud Raiser's Edge NXT by member junction ID. **Risk:** `read` ```ts theme={null} await corsair.blackbaud.api.membership.getMembershipDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `member_junction_id` | `string` | Yes | Membership record ID for the constituent (the "id" returned by the constituent memberships list). | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dues` | `number` | No | — | | `category_name` | `string` | No | — | | `program_name` | `string` | No | — | | `sub_category_name` | `string` | No | — | | `last_renewed_date` | `string` | No | — | | `last_dropped_date` | `string` | No | — | | `next_renewal_date` | `string` | No | — | | `joined_date` | `string` | No | — | | `total_years` | `number` | No | — | | `times_renewed` | `number` | No | — | | `consec_years` | `number` | No | — | | `constituent_id` | `string` | No | — | | `notes` | `string` | No | — | | `type` | `Joined \| Renewal \| Rejoined \| Upgrade \| Downgrade \| Dropped` | No | — | *** ## One Roster ### oneRosterOAuth2BaseApi `oneRoster.oneRosterOAuth2BaseApi` Reads Blackbaud OneRoster OAuth2 discovery metadata (openid-configuration, public keys). **Risk:** `read` ```ts theme={null} await corsair.blackbaud.api.oneRoster.oneRosterOAuth2BaseApi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `operation` | `openid-configuration \| publickeys` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `issuer` | `string` | No | — | | `authorization_endpoint` | `string` | No | — | | `token_endpoint` | `string` | No | — | | `jwks_uri` | `string` | No | — | | `response_types_supported` | `string[]` | No | — | | `subject_types_supported` | `string[]` | No | — | | `id_token_signing_alg_values_supported` | `string[]` | No | — | | `code_challenge_methods_supported` | `string[]` | No | — | | `keys` | `object[]` | No | — | > **keys full type** > > ```ts theme={null} > { > kty: string, > alg?: string, > use?: string, > kid?: string, > x5t?: string, > x5c?: string[], > e?: string, > n?: string > }[] > ``` *** ## Payments ### getPaymentTransaction `payments.getPaymentTransaction` Retrieves payment transaction details from Blackbaud SKY Payments API. **Risk:** `read` ```ts theme={null} await corsair.blackbaud.api.payments.getPaymentTransaction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transaction_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `amount` | `number` | No | — | | `net_amount` | `number` | No | — | | `additional_fee` | `number` | No | — | | `application_fee` | `number` | No | — | | `total_fees` | `number` | No | — | | `currency` | `string` | No | — | | `state` | `Unknown \| Processed \| Failed \| Refunded \| Pending \| Authorized \| Voided \| Created` | No | — | | `transaction_date` | `string` | No | — | | `pending_date` | `string` | No | — | | `transaction_type` | `string` | No | — | | `transaction_category` | `string` | No | — | | `account_type` | `string` | No | — | | `application` | `string` | No | — | | `authorization_code` | `string` | No | — | | `check_number` | `string` | No | — | | `comment` | `string` | No | — | | `disbursement_status` | `string` | No | — | | `donor_ip_address` | `string` | No | — | | `email_address` | `string` | No | — | | `phone_number` | `string` | No | — | | `is_live` | `boolean` | No | — | | `token` | `string` | No | — | | `reference_transaction_id` | `string` | No | — | | `billing_info` | `object` | No | — | | `credit_card` | `object` | No | — | | `related_transactions` | `object[]` | No | — | > **billing\_info full type** > > ```ts theme={null} > { > city?: string | null, > country?: string | null, > post_code?: string | null, > state?: string | null, > street?: string | null > } > ``` > **credit\_card full type** > > ```ts theme={null} > { > card_type?: string | null, > exp_month?: number, > exp_year?: number, > last_four?: string | null, > name?: string | null > } > ``` > **related\_transactions full type** > > ```ts theme={null} > { > id?: string | null, > transaction_type?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/blackbaud/database Blackbaud local sync: searchable entities, `.search()` filters, and operators. The Blackbaud plugin syncs data locally. Use `corsair.blackbaud.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Batch Gifts Path: `blackbaud.db.batchGifts.search` ```ts theme={null} const rows = await corsair.blackbaud.db.batchGifts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `constituent_id` | `string` | equals, contains, startsWith, endsWith, in | | `batch_number` | `string` | equals, contains, startsWith, endsWith, in | | `constituency` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `date_added` | `string` | equals, contains, startsWith, endsWith, in | | `date_modified` | `string` | equals, contains, startsWith, endsWith, in | | `gift_code` | `string` | equals, contains, startsWith, endsWith, in | | `gift_status` | `string` | equals, contains, startsWith, endsWith, in | | `is_anonymous` | `boolean` | equals | | `lookup_id` | `string` | equals, contains, startsWith, endsWith, in | | `origin` | `string` | equals, contains, startsWith, endsWith, in | | `post_date` | `string` | equals, contains, startsWith, endsWith, in | | `post_status` | `string` | equals, contains, startsWith, endsWith, in | | `reference` | `string` | equals, contains, startsWith, endsWith, in | | `subtype` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `batch_id` | `string` | equals, contains, startsWith, endsWith, in | | `approved_gift_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Gifts Path: `blackbaud.db.gifts.search` ```ts theme={null} const rows = await corsair.blackbaud.db.gifts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `constituent_id` | `string` | equals, contains, startsWith, endsWith, in | | `batch_number` | `string` | equals, contains, startsWith, endsWith, in | | `constituency` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `date_added` | `string` | equals, contains, startsWith, endsWith, in | | `date_modified` | `string` | equals, contains, startsWith, endsWith, in | | `gift_code` | `string` | equals, contains, startsWith, endsWith, in | | `gift_status` | `string` | equals, contains, startsWith, endsWith, in | | `is_anonymous` | `boolean` | equals | | `lookup_id` | `string` | equals, contains, startsWith, endsWith, in | | `origin` | `string` | equals, contains, startsWith, endsWith, in | | `post_date` | `string` | equals, contains, startsWith, endsWith, in | | `post_status` | `string` | equals, contains, startsWith, endsWith, in | | `reference` | `string` | equals, contains, startsWith, endsWith, in | | `subtype` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Memberships Path: `blackbaud.db.memberships.search` ```ts theme={null} const rows = await corsair.blackbaud.db.memberships.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `dues` | `number` | equals, gt, gte, lt, lte, in | | `category_name` | `string` | equals, contains, startsWith, endsWith, in | | `program_name` | `string` | equals, contains, startsWith, endsWith, in | | `sub_category_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_renewed_date` | `string` | equals, contains, startsWith, endsWith, in | | `last_dropped_date` | `string` | equals, contains, startsWith, endsWith, in | | `next_renewal_date` | `string` | equals, contains, startsWith, endsWith, in | | `joined_date` | `string` | equals, contains, startsWith, endsWith, in | | `total_years` | `number` | equals, gt, gte, lt, lte, in | | `times_renewed` | `number` | equals, gt, gte, lt, lte, in | | `consec_years` | `number` | equals, gt, gte, lt, lte, in | | `constituent_id` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## One Roster Keys Path: `blackbaud.db.oneRosterKeys.search` ```ts theme={null} const rows = await corsair.blackbaud.db.oneRosterKeys.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `kty` | `string` | equals, contains, startsWith, endsWith, in | | `alg` | `string` | equals, contains, startsWith, endsWith, in | | `use` | `string` | equals, contains, startsWith, endsWith, in | | `kid` | `string` | equals, contains, startsWith, endsWith, in | | `x5t` | `string` | equals, contains, startsWith, endsWith, in | | `e` | `string` | equals, contains, startsWith, endsWith, in | | `n` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payment Transactions Path: `blackbaud.db.paymentTransactions.search` ```ts theme={null} const rows = await corsair.blackbaud.db.paymentTransactions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `net_amount` | `number` | equals, gt, gte, lt, lte, in | | `additional_fee` | `number` | equals, gt, gte, lt, lte, in | | `application_fee` | `number` | equals, gt, gte, lt, lte, in | | `total_fees` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `transaction_date` | `string` | equals, contains, startsWith, endsWith, in | | `pending_date` | `string` | equals, contains, startsWith, endsWith, in | | `transaction_type` | `string` | equals, contains, startsWith, endsWith, in | | `transaction_category` | `string` | equals, contains, startsWith, endsWith, in | | `account_type` | `string` | equals, contains, startsWith, endsWith, in | | `application` | `string` | equals, contains, startsWith, endsWith, in | | `authorization_code` | `string` | equals, contains, startsWith, endsWith, in | | `check_number` | `string` | equals, contains, startsWith, endsWith, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | | `disbursement_status` | `string` | equals, contains, startsWith, endsWith, in | | `donor_ip_address` | `string` | equals, contains, startsWith, endsWith, in | | `email_address` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `is_live` | `boolean` | equals | | `token` | `string` | equals, contains, startsWith, endsWith, in | | `reference_transaction_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/blackbaud/overview Blackbaud plugin for Corsair Use **Blackbaud** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 5 synced entities (`batchGifts`, `gifts`, `memberships`, `oneRosterKeys`, `paymentTransactions`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/blackbaud ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/blackbaud ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/blackbaud ``` ```bash bun theme={null} bun add corsair @corsair-dev/blackbaud ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { blackbaud } from '@corsair-dev/blackbaud'; export const corsair = createCorsair({ plugins: [ blackbaud(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Blackbaud OAuth app. ```ts theme={null} blackbaud() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'blackbaud', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`gifts.getGiftById`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.blackbaud.api.gifts.getGiftById({}); ``` **`batch.addGiftsToBatch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.blackbaud.api.batch.addGiftsToBatch({}); ``` See the full list on the [API](/plugins/blackbaud/api) page. ## Query synced data Synced entities support `tenant.blackbaud.db..search()` and `.list()`: `batchGifts`, `gifts`, `memberships`, `oneRosterKeys`, `paymentTransactions`. See [Database](/plugins/blackbaud/database) for filters and operators. ## What's next > **[API reference](/plugins/blackbaud/api)** > > Every `blackbaud.api.*` operation with input and output types. > **[Database](/plugins/blackbaud/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/blazemeter/api API reference for BlazeMeter: every `blazemeter.api.*` operation with input and output types. Every `blazemeter.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### list `accounts.list` List accounts available to the authenticated user **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.accounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `sort` | `any[]` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > owner?: { > id?: number | null, > email?: string | null, > displayName?: string | null > } | null > }[] > ``` *** ## Asset Dependencies ### create `assetDependencies.create` Create a dependency from one workspace asset to another **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.assetDependencies.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `aId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `targetDepId` | `string` | Yes | — | | `dependencyType` | `string` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > type?: string | null, > sourceId?: string | null, > targetId?: string | null > } > ``` *** ### forAsset `assetDependencies.forAsset` List dependencies belonging to an asset **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.assetDependencies.forAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `aId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > type?: string | null, > sourceId?: string | null, > targetId?: string | null > }[] > ``` *** ### get `assetDependencies.get` Get one asset dependency by ID **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.assetDependencies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > type?: string | null, > sourceId?: string | null, > targetId?: string | null > } > ``` *** ### list `assetDependencies.list` List workspace asset dependencies **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.assetDependencies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `wsId` | `number` | Yes | — | | `limit` | `number` | No | — | | `sourceDepId` | `string` | No | — | | `targetDepId` | `string` | No | — | | `sourceDepType` | `string` | No | — | | `targetDepType` | `string` | No | — | | `dependencyType` | `string` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > type?: string | null, > sourceId?: string | null, > targetId?: string | null > }[] > ``` *** ### remove `assetDependencies.remove` Delete an asset dependency by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.assetDependencies.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `boolean` | Yes | — | *** ### removeMatching `assetDependencies.removeMatching` Delete asset dependencies matching source, target, and type filters **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.assetDependencies.removeMatching({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `wsId` | `number` | Yes | — | | `sourceDepId` | `string` | No | — | | `targetDepId` | `string` | No | — | | `sourceDepType` | `string` | No | — | | `targetDepType` | `string` | No | — | | `dependencyType` | `string` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `boolean` | Yes | — | *** ### updateForAsset `assetDependencies.updateForAsset` Replace dependencies for an asset **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.assetDependencies.updateForAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `aId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `dependencies` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > type?: string | null, > sourceId?: string | null, > targetId?: string | null > }[] > ``` *** ## Assets ### create `assets.create` Create an Asset Repository asset **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.assets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `name` | `string` | Yes | — | | `type` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `metadata` | `object` | No | — | | `packageId` | `string` | No | — | | `displayName` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > type?: string | null, > accountId?: number | null, > workspaceId?: number | null, > packageId?: string | null, > metadata?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null, > createdBy?: number | null, > updatedBy?: number | null, > dependencies?: { > } | null > } > ``` *** ### data `assets.data` Get stored data for an asset **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.assets.data({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `aId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > fileName?: string | null, > contentType?: string | null, > content?: string | null > } > ``` *** ### get `assets.get` Get a workspace asset by ID **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.assets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | Yes | — | | `withData` | `boolean` | No | — | | `workspaceId` | `number` | Yes | — | | `withDependencies` | `boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > type?: string | null, > accountId?: number | null, > workspaceId?: number | null, > packageId?: string | null, > metadata?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null, > createdBy?: number | null, > updatedBy?: number | null, > dependencies?: { > } | null > } > ``` *** ### list `assets.list` List Asset Repository assets in a workspace **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.assets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `any[]` | No | — | | `skip` | `number` | No | — | | `limit` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortDir` | `string` | No | — | | `withData` | `boolean` | No | — | | `withSystem` | `boolean` | No | — | | `workspaceId` | `number` | Yes | — | | `withAccShared` | `boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > type?: string | null, > accountId?: number | null, > workspaceId?: number | null, > packageId?: string | null, > metadata?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null, > createdBy?: number | null, > updatedBy?: number | null, > dependencies?: { > } | null > }[] > ``` *** ### remove `assets.remove` Delete a workspace asset **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.assets.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `aId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `boolean` | Yes | — | *** ### update `assets.update` Update a workspace asset **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.assets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `assetId` | `string` | Yes | — | | `metadata` | `object` | No | — | | `packageId` | `string` | No | — | | `displayName` | `string` | No | — | | `workspaceId` | `number` | Yes | — | | `dependencies` | `object` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **dependencies full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > type?: string | null, > accountId?: number | null, > workspaceId?: number | null, > packageId?: string | null, > metadata?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null, > createdBy?: number | null, > updatedBy?: number | null, > dependencies?: { > } | null > } > ``` *** ### uploadData `assets.uploadData` Upload data content to an asset **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.assets.uploadData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | No | — | | `wsId` | `number` | Yes | — | | `assetId` | `string` | Yes | — | | `fileContent` | `object` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **fileContent full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > type?: string | null, > accountId?: number | null, > workspaceId?: number | null, > packageId?: string | null, > metadata?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null, > createdBy?: number | null, > updatedBy?: number | null, > dependencies?: { > } | null > } > ``` *** ## Generator ### cardIssuers `generator.cardIssuers` List available credit-card issuer generators **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.generator.cardIssuers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > name?: string | null, > lengths?: any[] | null > }[] > ``` *** ### functions `generator.functions` List available synthetic-data generator functions **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.generator.functions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > name?: string | null, > category?: string | null, > description?: string | null, > signature?: string | null > }[] > ``` *** ### seedLists `generator.seedLists` List available generator seed lists **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.generator.seedLists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > name?: string | null, > fileName?: string | null > }[] > ``` *** ## Info ### health `info.health` Get Asset Repository service health **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.info.health({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > status?: string | null, > healthy?: boolean | null > } > ``` *** ### version `info.version` Get Asset Repository build information **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.info.version({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > version?: string | null, > branch?: string | null, > commit?: string | null, > build?: string | null > } > ``` *** ## Masters ### stop `masters.stop` Gracefully stop a running master execution **Risk:** `destructive` ```ts theme={null} await corsair.blazemeter.api.masters.stop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `master_id` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ### summary `masters.summary` Get request statistics for a master test run **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.masters.summary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `master_id` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > summary?: { > avg?: number | null, > bytes?: number | null, > concurrency?: number | null, > duration?: number | null, > durationIsNotConfigured?: boolean | null, > failed?: number | null, > first?: number | null, > hits?: number | null, > id?: string | null, > last?: number | null, > lb?: string | null, > tp90?: number | null, > min?: number | null, > max?: number | null, > histogram?: { > } | null > }[] | null, > jmeterLogSummary?: any[] | null, > jmeterLogTypeSummary?: any[] | null, > maxUsers?: number | null > } > ``` *** ## Multi Tests ### create `multiTests.create` Create a multi-test in a project **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.multiTests.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `projectId` | `number` | Yes | — | | `collectionType` | `string` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > collectionType?: string | null, > userId?: number | null, > created?: number | null, > updated?: number | null, > creatorClientId?: string | null, > shouldSendReportEmail?: boolean | null, > projectId?: number | null, > filesToSplit?: any[] | null, > dataFiles?: any[] | null > } > ``` *** ### get `multiTests.get` Get a multi-test by ID **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.multiTests.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `number` | Yes | — | | `populateTests` | `boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > collectionType?: string | null, > userId?: number | null, > created?: number | null, > updated?: number | null, > creatorClientId?: string | null, > shouldSendReportEmail?: boolean | null, > projectId?: number | null, > filesToSplit?: any[] | null, > dataFiles?: any[] | null > } > ``` *** ### list `multiTests.list` List multi-tests in a workspace **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.multiTests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `sort` | `any[]` | No | — | | `limit` | `number` | No | — | | `projectId` | `number` | No | — | | `workspaceId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > collectionType?: string | null, > userId?: number | null, > created?: number | null, > updated?: number | null, > creatorClientId?: string | null, > shouldSendReportEmail?: boolean | null, > projectId?: number | null, > filesToSplit?: any[] | null, > dataFiles?: any[] | null > }[] > ``` *** ## Packages ### create `packages.create` Create an Asset Repository package **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.packages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `wsId` | `number` | Yes | — | | `version` | `string` | No | — | | `displayName` | `string` | No | — | | `dependencies` | `object` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **dependencies full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > version?: string | null, > accountId?: number | null, > workspaceId?: number | null, > dependencies?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null > } > ``` *** ### dependencies `packages.dependencies` List package dependencies **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.packages.dependencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > type?: string | null, > sourceId?: string | null, > targetId?: string | null > }[] > ``` *** ### export `packages.export` Export one package as a zip archive **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.packages.export({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > url?: string | null, > fileName?: string | null, > contentType?: string | null > } > ``` *** ### exportMany `packages.exportMany` Export multiple workspace packages as a zip archive **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.packages.exportMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `wsId` | `number` | Yes | — | | `packageIds` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > url?: string | null, > fileName?: string | null, > contentType?: string | null > } > ``` *** ### get `packages.get` Get a workspace package **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.packages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `withDependencies` | `boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > version?: string | null, > accountId?: number | null, > workspaceId?: number | null, > dependencies?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null > } > ``` *** ### import `packages.import` Import a package zip into a workspace **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.packages.import({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | Yes | — | | `wsId` | `number` | Yes | — | | `force` | `boolean` | No | — | | `overrides` | `string` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > version?: string | null, > accountId?: number | null, > workspaceId?: number | null, > dependencies?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null > } > ``` *** ### list `packages.list` List packages in a workspace **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.packages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `any[]` | No | — | | `skip` | `number` | No | — | | `wsId` | `number` | Yes | — | | `limit` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortDir` | `string` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > version?: string | null, > accountId?: number | null, > workspaceId?: number | null, > dependencies?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### remove `packages.remove` Delete a workspace package **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.packages.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `boolean` | Yes | — | *** ### update `packages.update` Update a workspace package **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.packages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `version` | `string` | No | — | | `displayName` | `string` | No | — | | `dependencies` | `object` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **dependencies full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > displayName?: string | null, > version?: string | null, > accountId?: number | null, > workspaceId?: number | null, > dependencies?: { > } | null, > createdAt?: string | null, > updatedAt?: string | null > } > ``` *** ### updateDependencies `packages.updateDependencies` Replace package dependencies **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.packages.updateDependencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pId` | `string` | Yes | — | | `wsId` | `number` | Yes | — | | `dependencies` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `request_id` | `string` | No | — | | `result` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > type?: string | null, > sourceId?: string | null, > targetId?: string | null > }[] > ``` *** ## Private Locations ### create `privateLocations.create` Create a private execution location **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.privateLocations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `string` | Yes | — | | `slots` | `number` | No | — | | `funcIds` | `any[]` | Yes | — | | `accountId` | `number` | Yes | — | | `engineXms` | `number` | No | — | | `engineXmx` | `number` | No | — | | `consoleXms` | `number` | No | — | | `consoleXmx` | `number` | No | — | | `overrideCPU` | `number` | No | — | | `workspacesId` | `any[]` | Yes | — | | `overrideMemory` | `number` | No | — | | `threadsPerEngine` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > userId?: number | null, > consoleXms?: number | null, > consoleXmx?: number | null, > engineXms?: number | null, > engineXmx?: number | null, > threadsPerEngine?: number | null, > slots?: number | null, > type?: string | null, > funcIds?: string[] | null, > hidden?: boolean | null, > disabled?: boolean | null, > created?: number | null, > updated?: number | null, > accountId?: number | null, > shipsId?: any[] | null, > workspacesId?: any[] | null, > ships?: any[] | null > } > ``` *** ### createAgent `privateLocations.createAgent` Create an agent in a private location **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.privateLocations.createAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `address` | `string` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > address?: string | null, > publicIpAddress?: string | null, > state?: string | null, > lastHeartBeat?: number | null > } > ``` *** ### list `privateLocations.list` List private execution locations **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.privateLocations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `limit` | `number` | No | — | | `types` | `any[]` | No | — | | `accountId` | `number` | No | — | | `workspaceId` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > userId?: number | null, > consoleXms?: number | null, > consoleXmx?: number | null, > engineXms?: number | null, > engineXmx?: number | null, > threadsPerEngine?: number | null, > slots?: number | null, > type?: string | null, > funcIds?: string[] | null, > hidden?: boolean | null, > disabled?: boolean | null, > created?: number | null, > updated?: number | null, > accountId?: number | null, > shipsId?: any[] | null, > workspacesId?: any[] | null, > ships?: any[] | null > }[] > ``` *** ### removeWorkspace `privateLocations.removeWorkspace` Remove a workspace from a private location **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.privateLocations.removeWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `harborId` | `string` | Yes | — | | `workspaceId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ## Projects ### create `projects.create` Create a project in a workspace **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `workspaceId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > userId?: number | null, > description?: string | null, > created?: number | null, > updated?: number | null, > workspaceId?: number | null, > testsCount?: number | null > } > ``` *** ### get `projects.get` Get project details **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > userId?: number | null, > description?: string | null, > created?: number | null, > updated?: number | null, > workspaceId?: number | null, > testsCount?: number | null > } > ``` *** ### list `projects.list` List projects in a workspace **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `sort` | `any[]` | No | — | | `name` | `string` | No | — | | `limit` | `number` | No | — | | `accountId` | `number` | No | — | | `workspaceId` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > userId?: number | null, > description?: string | null, > created?: number | null, > updated?: number | null, > workspaceId?: number | null, > testsCount?: number | null > }[] > ``` *** ### remove `projects.remove` Delete a project, optionally forcing removal of contained data **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.projects.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `force` | `boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ### update `projects.update` Update a project **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `projectId` | `number` | Yes | — | | `description` | `string` | No | — | | `workspaceId` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > userId?: number | null, > description?: string | null, > created?: number | null, > updated?: number | null, > workspaceId?: number | null, > testsCount?: number | null > } > ``` *** ## Regions ### list `regions.list` List execution regions and locations **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.regions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > title?: string | null, > provider?: string | null > }[] > ``` *** ## Schedules ### create `schedules.create` Create a cron schedule for a test or multi-test **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.schedules.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cron` | `string` | Yes | — | | `testId` | `number` | No | — | | `testCollectionId` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > cron?: string | null, > nextRun?: number | null, > enabled?: boolean | null, > type?: string | null, > created?: number | null, > updated?: number | null, > testId?: number | null, > testCollectionId?: number | null, > createdById?: number | null, > lastUpdatedById?: number | null, > nextExecutions?: any[] | null > } > ``` *** ### get `schedules.get` Get a schedule by ID **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.schedules.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `schedule_id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > cron?: string | null, > nextRun?: number | null, > enabled?: boolean | null, > type?: string | null, > created?: number | null, > updated?: number | null, > testId?: number | null, > testCollectionId?: number | null, > createdById?: number | null, > lastUpdatedById?: number | null, > nextExecutions?: any[] | null > } > ``` *** ### list `schedules.list` List schedules with scope and pagination filters **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.schedules.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `limit` | `number` | No | — | | `testId` | `number` | No | — | | `enabled` | `boolean` | No | — | | `accountId` | `number` | No | — | | `projectId` | `number` | No | — | | `workspaceId` | `number` | No | — | | `collectionId` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > cron?: string | null, > nextRun?: number | null, > enabled?: boolean | null, > type?: string | null, > created?: number | null, > updated?: number | null, > testId?: number | null, > testCollectionId?: number | null, > createdById?: number | null, > lastUpdatedById?: number | null, > nextExecutions?: any[] | null > }[] > ``` *** ### remove `schedules.remove` Delete a test schedule **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.schedules.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `schedule_id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ### update `schedules.update` Enable or disable a schedule **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.schedules.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | Yes | — | | `schedule_id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > cron?: string | null, > nextRun?: number | null, > enabled?: boolean | null, > type?: string | null, > created?: number | null, > updated?: number | null, > testId?: number | null, > testCollectionId?: number | null, > createdById?: number | null, > lastUpdatedById?: number | null, > nextExecutions?: any[] | null > } > ``` *** ## Search ### execute `search.execute` Search BlazeMeter entities using filters, selected fields, and ordering **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.search.execute({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `limit` | `number` | No | — | | `entity` | `string` | Yes | — | | `fields` | `any[]` | No | — | | `filters` | `object` | No | — | | `ordering` | `any[]` | No | — | | `accountId` | `any` | No | — | | `workspaceId` | `any` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | number, > name?: string | null, > type?: string | null, > projectId?: number | null, > userId?: number | null > }[] > ``` *** ### metadata `search.metadata` Get searchable entities, fields, relations, and operators **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.search.metadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > entities?: any[] | null, > fields?: { > } | null, > relationships?: { > } | null, > operators?: any[] | null > } > ``` *** ## Service Mock Templates ### get `serviceMockTemplates.get` Get a virtual-service template by ID **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.serviceMockTemplates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `number` | Yes | — | | `serviceMockTemplateId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `apiVersion` | `number` | No | — | | `error` | `any` | No | — | | `limit` | `number` | No | — | | `link` | `string` | No | — | | `requestId` | `string` | No | — | | `result` | `object` | Yes | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > description?: string | null, > created?: string | null, > createdBy?: string | null, > updated?: string | null, > updatedBy?: string | null, > liveSystemHost?: string | null, > liveSystemPort?: number | null, > noMatchingRequestPreference?: string | null, > noMatchingRequestTxnId?: number | null, > thinkTime?: number | null, > serviceId?: number | null, > serviceName?: string | null, > mockServiceTransactions?: any[] | null > } > ``` *** ### list `serviceMockTemplates.list` List virtual-service templates in a workspace **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.serviceMockTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `apiVersion` | `number` | No | — | | `error` | `any` | No | — | | `limit` | `number` | No | — | | `link` | `string` | No | — | | `requestId` | `string` | No | — | | `result` | `object[]` | Yes | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > description?: string | null, > created?: string | null, > createdBy?: string | null, > updated?: string | null, > updatedBy?: string | null, > liveSystemHost?: string | null, > liveSystemPort?: number | null, > noMatchingRequestPreference?: string | null, > noMatchingRequestTxnId?: number | null, > thinkTime?: number | null, > serviceId?: number | null, > serviceName?: string | null, > mockServiceTransactions?: any[] | null > }[] > ``` *** ### update `serviceMockTemplates.update` Update a virtual-service template **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.serviceMockTemplates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `thinkTime` | `number` | No | — | | `templateId` | `number` | Yes | — | | `description` | `string` | No | — | | `workspaceId` | `number` | Yes | — | | `liveSystemHost` | `string` | No | — | | `liveSystemPort` | `number` | No | — | | `endpointPreference` | `string` | No | — | | `noMatchingRequestPreference` | `string` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `apiVersion` | `number` | No | — | | `error` | `any` | No | — | | `limit` | `number` | No | — | | `link` | `string` | No | — | | `requestId` | `string` | No | — | | `result` | `object` | Yes | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > description?: string | null, > created?: string | null, > createdBy?: string | null, > updated?: string | null, > updatedBy?: string | null, > liveSystemHost?: string | null, > liveSystemPort?: number | null, > noMatchingRequestPreference?: string | null, > noMatchingRequestTxnId?: number | null, > thinkTime?: number | null, > serviceId?: number | null, > serviceName?: string | null, > mockServiceTransactions?: any[] | null > } > ``` *** ## Shared Folders ### list `sharedFolders.list` List shared folders in a workspace **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.sharedFolders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | number, > name?: string | null, > workspaceId?: number | null > }[] > ``` *** ## Tags ### create `tags.create` Create a workspace tag **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.tags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | Yes | — | | `workspaceId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | number, > label?: string | null, > name?: string | null > } > ``` *** ### list `tags.list` List Mock Services tags **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `apiVersion` | `number` | No | — | | `error` | `any` | No | — | | `limit` | `number` | No | — | | `link` | `string` | No | — | | `requestId` | `string` | No | — | | `result` | `object[]` | Yes | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | number, > label?: string | null, > name?: string | null > }[] > ``` *** ## Test Data ### generate `testData.generate` Generate test data from an inline model **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.testData.generate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `entityName` | `string` | Yes | — | | `workspaceId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > }[] > ``` *** ### generateFromModel `testData.generateFromModel` Generate synthetic records from a stored data model **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.testData.generateFromModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `modelId` | `string` | Yes | — | | `numRecords` | `number` | No | — | | `workspaceId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > }[] > ``` *** ### getModel `testData.getModel` Get a data model by ID **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.testData.getModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataModelId` | `string` | Yes | — | | `workspaceId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > title?: string | null, > description?: string | null, > type?: string | null, > kind?: string | null, > repeat?: number | null, > properties?: { > } | null, > requirements?: { > } | null > } > ``` *** ### publish `testData.publish` Publish generated data through a Test Data orchestration target **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.testData.publish({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `attributes` | `object` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > type?: string | null, > data?: { > } | null, > attributes?: { > } | null > } > ``` *** ### validateModel `testData.validateModel` Validate a workspace data model **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.testData.validateModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `data_model_id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > isValid?: boolean | null, > entities?: { > } | null > } > ``` *** ## Tests ### create `tests.create` Create a performance or functional test **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.tests.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `projectId` | `number` | Yes | — | | `configuration` | `object` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **configuration full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > description?: string | null, > isNewTest?: boolean | null, > lastRunTime?: number | null, > userId?: number | null, > creatorClientId?: string | null, > overrideExecutions?: any[] | null, > executions?: any[] | null, > hasThreadGroupsToOverride?: boolean | null, > hasNonRegularThreadGroup?: boolean | null, > shouldSendReportEmail?: boolean | null, > dependencies?: any, > tags?: { > id?: number | null, > label?: string | null > }[] | null, > created?: number | null, > updated?: number | null, > projectId?: number | null, > lastUpdatedById?: number | null, > configuration?: { > } | null > } > ``` *** ### duplicate `tests.duplicate` Duplicate a test and its configuration **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.tests.duplicate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `test_id` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > description?: string | null, > isNewTest?: boolean | null, > lastRunTime?: number | null, > userId?: number | null, > creatorClientId?: string | null, > overrideExecutions?: any[] | null, > executions?: any[] | null, > hasThreadGroupsToOverride?: boolean | null, > hasNonRegularThreadGroup?: boolean | null, > shouldSendReportEmail?: boolean | null, > dependencies?: any, > tags?: { > id?: number | null, > label?: string | null > }[] | null, > created?: number | null, > updated?: number | null, > projectId?: number | null, > lastUpdatedById?: number | null, > configuration?: { > } | null > } > ``` *** ### files `tests.files` List files attached to a test **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.tests.files({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `testId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > lastModified?: number | null, > name?: string | null, > size?: number | null, > link?: string | null, > linkExpire?: number | null > }[] > ``` *** ### get `tests.get` Get test details **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.tests.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `test_id` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > description?: string | null, > isNewTest?: boolean | null, > lastRunTime?: number | null, > userId?: number | null, > creatorClientId?: string | null, > overrideExecutions?: any[] | null, > executions?: any[] | null, > hasThreadGroupsToOverride?: boolean | null, > hasNonRegularThreadGroup?: boolean | null, > shouldSendReportEmail?: boolean | null, > dependencies?: any, > tags?: { > id?: number | null, > label?: string | null > }[] | null, > created?: number | null, > updated?: number | null, > projectId?: number | null, > lastUpdatedById?: number | null, > configuration?: { > } | null > } | { > id: number, > name?: string | null, > description?: string | null, > isNewTest?: boolean | null, > lastRunTime?: number | null, > userId?: number | null, > creatorClientId?: string | null, > overrideExecutions?: any[] | null, > executions?: any[] | null, > hasThreadGroupsToOverride?: boolean | null, > hasNonRegularThreadGroup?: boolean | null, > shouldSendReportEmail?: boolean | null, > dependencies?: any, > tags?: { > id?: number | null, > label?: string | null > }[] | null, > created?: number | null, > updated?: number | null, > projectId?: number | null, > lastUpdatedById?: number | null, > configuration?: { > } | null > }[] > ``` *** ### list `tests.list` List tests by workspace or project **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.tests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `sort` | `any[]` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `limit` | `number` | No | — | | `platform` | `string` | No | — | | `projectId` | `number` | No | — | | `workspaceId` | `number` | No | — | | `hasExecutions` | `boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > description?: string | null, > isNewTest?: boolean | null, > lastRunTime?: number | null, > userId?: number | null, > creatorClientId?: string | null, > overrideExecutions?: any[] | null, > executions?: any[] | null, > hasThreadGroupsToOverride?: boolean | null, > hasNonRegularThreadGroup?: boolean | null, > shouldSendReportEmail?: boolean | null, > dependencies?: any, > tags?: { > id?: number | null, > label?: string | null > }[] | null, > created?: number | null, > updated?: number | null, > projectId?: number | null, > lastUpdatedById?: number | null, > configuration?: { > } | null > }[] > ``` *** ### remove `tests.remove` Delete a test **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.tests.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `testId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ### removeFile `tests.removeFile` Delete an uploaded test asset file **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.tests.removeFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `testId` | `number` | Yes | — | | `fileName` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ### start `tests.start` Start a configured test **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.tests.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `testId` | `number` | Yes | — | | `isDebugRun` | `boolean` | No | — | | `delayedStart` | `boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > userId?: number | null, > created?: number | null, > updated?: number | null, > testId?: number | null, > projectId?: number | null, > sessionsId?: string[] | null, > locations?: string[] | null, > executions?: any[] | null, > isDebugRun?: boolean | null > } > ``` *** ### stop `tests.stop` Stop every active execution for a test **Risk:** `destructive` ```ts theme={null} await corsair.blazemeter.api.tests.stop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `test_id` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ### update `tests.update` Update a test configuration **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.tests.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `test_id` | `number` | Yes | — | | `configuration` | `object` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **configuration full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > description?: string | null, > isNewTest?: boolean | null, > lastRunTime?: number | null, > userId?: number | null, > creatorClientId?: string | null, > overrideExecutions?: any[] | null, > executions?: any[] | null, > hasThreadGroupsToOverride?: boolean | null, > hasNonRegularThreadGroup?: boolean | null, > shouldSendReportEmail?: boolean | null, > dependencies?: any, > tags?: { > id?: number | null, > label?: string | null > }[] | null, > created?: number | null, > updated?: number | null, > projectId?: number | null, > lastUpdatedById?: number | null, > configuration?: { > } | null > } > ``` *** ### uploadFile `tests.uploadFile` Upload a script, data file, or configuration to a test **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.tests.uploadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | No | — | | `testId` | `number` | Yes | — | | `fileContent` | `object` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **fileContent full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > lastModified?: number | null, > name?: string | null, > size?: number | null, > link?: string | null, > linkExpire?: number | null > } | { > lastModified?: number | null, > name?: string | null, > size?: number | null, > link?: string | null, > linkExpire?: number | null > }[] > ``` *** ### validate `tests.validate` Start validation for a test configuration **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.tests.validate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `testId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > success?: boolean | null, > files?: { > } | null > } > ``` *** ### validations `tests.validations` Get test-file validation results **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.tests.validations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `testId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | number, > status?: string | null, > fileName?: string | null > }[] > ``` *** ## Transactions ### convert `transactions.convert` Convert Swagger, HAR, YAML, or other transaction input to BlazeMeter DSL **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.transactions.convert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | No | — | | `verbose` | `boolean` | No | — | | `fileContent` | `object` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **fileContent full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `apiVersion` | `number` | No | — | | `error` | `any` | No | — | | `limit` | `number` | No | — | | `link` | `string` | No | — | | `requestId` | `string` | No | — | | `result` | `object[]` | Yes | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > nativeId?: string | null, > priority?: number | null, > requestDsl?: { > body?: { > key?: string | null, > matcherName?: string | null, > matchingValue?: string | null > }[] | null, > cookies?: { > key?: string | null, > matcherName?: string | null, > matchingValue?: string | null > }[] | null, > credentials?: { > username?: string | null, > password?: string | null > } | null, > headers?: { > key?: string | null, > matcherName?: string | null, > matchingValue?: string | null > }[] | null, > host?: string | null, > method?: string | null, > path?: string | null, > queryParams?: { > key?: string | null, > matcherName?: string | null, > matchingValue?: string | null > }[] | null, > url?: { > key?: string | null, > matcherName?: string | null, > matchingValue?: string | null > } | null > } | null, > responseDsl?: { > binary?: boolean | null, > charset?: string | null, > content?: string | null, > contentType?: string | null, > headers?: { > name?: string | null, > value?: string | null > }[] | null, > proxyUrl?: string | null, > status?: number | null, > statusMessage?: string | null > } | null > }[] > ``` *** ### create `transactions.create` Create service-virtualization transactions in a workspace **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.transactions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `serviceId` | `number` | Yes | — | | `workspaceId` | `number` | Yes | — | | `transactions` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `apiVersion` | `number` | No | — | | `error` | `any` | No | — | | `limit` | `number` | No | — | | `link` | `string` | No | — | | `requestId` | `string` | No | — | | `result` | `object[]` | Yes | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > description?: string | null, > link?: string | null, > serviceId?: number | null, > serviceName?: string | null, > tags?: string[] | null, > dsl?: { > } | null > } | { > id?: number | null, > name?: string | null, > description?: string | null, > link?: string | null, > serviceId?: number | null, > serviceName?: string | null, > tags?: string[] | null, > dsl?: { > } | null > }[] > ``` *** ### list `transactions.list` List service-virtualization transactions in a workspace **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.transactions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `apiVersion` | `number` | No | — | | `error` | `any` | No | — | | `limit` | `number` | No | — | | `link` | `string` | No | — | | `requestId` | `string` | No | — | | `result` | `object[]` | Yes | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | > **result full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > description?: string | null, > link?: string | null, > serviceId?: number | null, > serviceName?: string | null, > tags?: string[] | null, > dsl?: { > } | null > }[] > ``` *** ## User ### activeSessions `user.activeSessions` List active test sessions for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.user.activeSessions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > status?: string | null, > testId?: number | null, > projectId?: number | null > }[] > ``` *** ### get `user.get` Get the authenticated user profile **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.user.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > email?: string | null, > access?: number | null, > login?: number | null, > firstName?: string | null, > lastName?: string | null, > timezone?: number | null, > enabled?: boolean | null, > roles?: string[] | null > } > ``` *** ### invites `user.invites` List pending user invitations **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.user.invites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | number, > email?: string | null, > status?: string | null > }[] > ``` *** ### projects `user.projects` List projects available to the authenticated user **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.user.projects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > userId?: number | null, > description?: string | null, > created?: number | null, > updated?: number | null, > workspaceId?: number | null, > testsCount?: number | null > }[] > ``` *** ### register `user.register` Register a BlazeMeter user account **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.user.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `lastName` | `string` | Yes | — | | `password` | `string` | Yes | — | | `firstName` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > email?: string | null, > access?: number | null, > login?: number | null, > firstName?: string | null, > lastName?: string | null, > timezone?: number | null, > enabled?: boolean | null, > roles?: string[] | null > } > ``` *** ### terminateSessions `user.terminateSessions` Immediately terminate selected active sessions **Risk:** `destructive` ```ts theme={null} await corsair.blazemeter.api.user.terminateSessions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_ids` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ## Workspaces ### get `workspaces.get` Get workspace details **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.workspaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > userId?: number | null, > created?: number | null, > updated?: number | null, > enabled?: boolean | null, > dedicatedIpsEnabled?: boolean | null, > privateLocationsEnabled?: boolean | null, > owner?: { > id?: number | null, > email?: string | null, > displayName?: string | null > } | null, > membersCount?: number | null, > allowance?: { > amount?: number | null, > type?: string | null > } | null, > accountId?: number | null, > locations?: { > id?: string | null, > title?: string | null, > name?: string | null, > provider?: string | null, > limits?: { > threadsPerEngine?: number | null, > concurrency?: number | null, > engines?: number | null, > duration?: number | null > } | null, > capabilities?: { > dedicatedIps?: boolean | null > } | null, > sandbox?: boolean | null, > purposes?: { > load?: boolean | null, > functional?: boolean | null, > grid?: boolean | null, > serviceMock?: boolean | null > } | null > }[] | null, > activeMember?: { > id?: number | null, > email?: string | null, > displayName?: string | null, > roles?: string[] | null, > enabled?: boolean | null, > access?: number | null > } | null, > features?: { > } | null > } > ``` *** ### list `workspaces.list` List workspaces for an account **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.workspaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skip` | `number` | No | — | | `limit` | `number` | No | — | | `enabled` | `boolean` | No | — | | `accountId` | `number` | Yes | — | | `textFilter` | `string` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > userId?: number | null, > created?: number | null, > updated?: number | null, > enabled?: boolean | null, > dedicatedIpsEnabled?: boolean | null, > privateLocationsEnabled?: boolean | null, > owner?: { > id?: number | null, > email?: string | null, > displayName?: string | null > } | null, > membersCount?: number | null, > allowance?: { > amount?: number | null, > type?: string | null > } | null, > accountId?: number | null, > locations?: { > id?: string | null, > title?: string | null, > name?: string | null, > provider?: string | null, > limits?: { > threadsPerEngine?: number | null, > concurrency?: number | null, > engines?: number | null, > duration?: number | null > } | null, > capabilities?: { > dedicatedIps?: boolean | null > } | null, > sandbox?: boolean | null, > purposes?: { > load?: boolean | null, > functional?: boolean | null, > grid?: boolean | null, > serviceMock?: boolean | null > } | null > }[] | null, > activeMember?: { > id?: number | null, > email?: string | null, > displayName?: string | null, > roles?: string[] | null, > enabled?: boolean | null, > access?: number | null > } | null, > features?: { > } | null > }[] > ``` *** ### removeLogs `workspaces.removeLogs` Delete master execution logs from a workspace **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.workspaces.removeLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `masterIds` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ### removeManagers `workspaces.removeManagers` Remove managers from a workspace **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.blazemeter.api.workspaces.removeManagers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `managersIds` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `boolean` | Yes | — | | `request_id` | `string` | No | — | *** ### terminateMasters `workspaces.terminateMasters` Terminate active master executions in a workspace **Risk:** `destructive` ```ts theme={null} await corsair.blazemeter.api.workspaces.terminateMasters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `dryRun` | `boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `number[]` | Yes | — | | `request_id` | `string` | No | — | *** ### updateUser `workspaces.updateUser` Update a workspace user role and enabled status **Risk:** `write` ```ts theme={null} await corsair.blazemeter.api.workspaces.updateUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roles` | `any[]` | Yes | — | | `userId` | `number` | Yes | — | | `enabled` | `boolean` | Yes | — | | `workspaceId` | `number` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > email?: string | null, > displayName?: string | null, > firstName?: string | null, > lastName?: string | null, > login?: number | null, > access?: number | null, > roles?: string[] | null, > enabled?: boolean | null, > lastAccess?: number | null, > type?: string | null > } > ``` *** ### users `workspaces.users` List users in a workspace **Risk:** `read` ```ts theme={null} await corsair.blazemeter.api.workspaces.users({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roles` | `any[]` | No | — | | `enabled` | `boolean` | No | — | | `textFilter` | `string` | No | — | | `workspaceId` | `number` | Yes | — | | `excludeRoles` | `any[]` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `total` | `number` | No | — | | `hidden` | `number` | No | — | | `api_version` | `number` | No | — | | `error` | `any` | No | — | | `result` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > id: number, > email?: string | null, > displayName?: string | null, > firstName?: string | null, > lastName?: string | null, > login?: number | null, > access?: number | null, > roles?: string[] | null, > enabled?: boolean | null, > lastAccess?: number | null, > type?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/blazemeter/database BlazeMeter local sync: searchable entities, `.search()` filters, and operators. The BlazeMeter plugin syncs data locally. Use `corsair.blazemeter.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `blazemeter.db.accounts.search` ```ts theme={null} const rows = await corsair.blazemeter.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Assets Path: `blazemeter.db.assets.search` ```ts theme={null} const rows = await corsair.blazemeter.db.assets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `accountId` | `number` | equals, gt, gte, lt, lte, in | | `workspaceId` | `number` | equals, gt, gte, lt, lte, in | | `packageId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `createdBy` | `number` | equals, gt, gte, lt, lte, in | | `updatedBy` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Packages Path: `blazemeter.db.packages.search` ```ts theme={null} const rows = await corsair.blazemeter.db.packages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `accountId` | `number` | equals, gt, gte, lt, lte, in | | `workspaceId` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `blazemeter.db.projects.search` ```ts theme={null} const rows = await corsair.blazemeter.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | | `workspaceId` | `number` | equals, gt, gte, lt, lte, in | | `testsCount` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tests Path: `blazemeter.db.tests.search` ```ts theme={null} const rows = await corsair.blazemeter.db.tests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `isNewTest` | `boolean` | equals | | `lastRunTime` | `number` | equals, gt, gte, lt, lte, in | | `userId` | `number` | equals, gt, gte, lt, lte, in | | `creatorClientId` | `string` | equals, contains, startsWith, endsWith, in | | `hasThreadGroupsToOverride` | `boolean` | equals | | `hasNonRegularThreadGroup` | `boolean` | equals | | `shouldSendReportEmail` | `boolean` | equals | | `created` | `number` | equals, gt, gte, lt, lte, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | | `projectId` | `number` | equals, gt, gte, lt, lte, in | | `lastUpdatedById` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `blazemeter.db.users.search` ```ts theme={null} const rows = await corsair.blazemeter.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `access` | `number` | equals, gt, gte, lt, lte, in | | `login` | `number` | equals, gt, gte, lt, lte, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `number` | equals, gt, gte, lt, lte, in | | `enabled` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `blazemeter.db.workspaces.search` ```ts theme={null} const rows = await corsair.blazemeter.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `number` | equals, gt, gte, lt, lte, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `updated` | `number` | equals, gt, gte, lt, lte, in | | `enabled` | `boolean` | equals | | `dedicatedIpsEnabled` | `boolean` | equals | | `privateLocationsEnabled` | `boolean` | equals | | `membersCount` | `number` | equals, gt, gte, lt, lte, in | | `accountId` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspace Users Path: `blazemeter.db.workspaceUsers.search` ```ts theme={null} const rows = await corsair.blazemeter.db.workspaceUsers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `login` | `number` | equals, gt, gte, lt, lte, in | | `access` | `number` | equals, gt, gte, lt, lte, in | | `enabled` | `boolean` | equals | | `lastAccess` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/blazemeter/overview Performance testing platform for load, stress, and API scalability benchmarking. Use **BlazeMeter** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 92 typed API operations * 8 synced entities (`accounts`, `assets`, `packages`, `projects`, `tests`, `users`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/blazemeter ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/blazemeter ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/blazemeter ``` ```bash bun theme={null} bun add corsair @corsair-dev/blazemeter ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { blazemeter } from '@corsair-dev/blazemeter'; export const corsair = createCorsair({ plugins: [ blazemeter(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} blazemeter() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'blazemeter', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.blazemeter.api.accounts.list({}); ``` **`assetDependencies.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.blazemeter.api.assetDependencies.create({}); ``` See the full list on the [API](/plugins/blazemeter/api) page. ## Query synced data Synced entities support `tenant.blazemeter.db..search()` and `.list()`: `accounts`, `assets`, `packages`, `projects`, `tests`, `users`, `workspaces`, `workspaceUsers`. See [Database](/plugins/blazemeter/database) for filters and operators. ## What's next > **[API reference](/plugins/blazemeter/api)** > > Every `blazemeter.api.*` operation with input and output types. > **[Database](/plugins/blazemeter/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/blocknative/api API reference for Blocknative: every `blocknative.api.*` operation with input and output types. Every `blocknative.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Gas ### getBaseFeeEstimates `gas.getBaseFeeEstimates` Get real-time base fee, blob base fee, and priority fee predictions for the next 5 Ethereum blocks **Risk:** `read` ```ts theme={null} await corsair.blocknative.api.gas.getBaseFeeEstimates({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `system` | `string` | Yes | — | | `network` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `currentBlockNumber` | `number` | No | — | | `msSinceLastBlock` | `number` | No | — | | `baseFeePerGas` | `number` | No | — | | `blobBaseFeePerGas` | `number` | No | — | | `estimatedBaseFees` | `object[]` | Yes | — | > **estimatedBaseFees full type** > > ```ts theme={null} > { > }[] > ``` *** ### getDistribution `gas.getDistribution` Retrieve the current mempool gas price distribution breakdown **Risk:** `read` ```ts theme={null} await corsair.blocknative.api.gas.getDistribution({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chainid` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `system` | `string` | Yes | — | | `network` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `maxPrice` | `number` | No | — | | `currentBlockNumber` | `number` | No | — | | `msSinceLastBlock` | `number` | No | — | | `topNDistribution` | `object` | Yes | — | > **topNDistribution full type** > > ```ts theme={null} > { > distribution: number[][], > n: number > } > ``` *** ### getOracles `gas.getOracles` Retrieve metadata on supported gas oracles per chain **Risk:** `read` ```ts theme={null} await corsair.blocknative.api.gas.getOracles({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `oracles` | `object[]` | Yes | — | > **oracles full type** > > ```ts theme={null} > { > arch?: string, > chainId: number, > label: string, > icon?: string, > system?: string, > network?: string, > addressByVersion?: { > }, > rpcUrl?: string, > blockExplorerUrl?: string > }[] > ``` *** ### getPrices `gas.getPrices` Fetch gas price estimates for specific inclusion probabilities (next block or \~10 seconds) **Risk:** `read` ```ts theme={null} await corsair.blocknative.api.gas.getPrices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chainid` | `number` | No | — | | `system` | `string` | No | — | | `network` | `string` | No | — | | `confidenceLevels` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `system` | `string` | Yes | — | | `network` | `string` | Yes | — | | `unit` | `string` | Yes | — | | `maxPrice` | `number` | No | — | | `currentBlockNumber` | `number` | No | — | | `msSinceLastBlock` | `number` | No | — | | `blockPrices` | `object[]` | Yes | — | > **blockPrices full type** > > ```ts theme={null} > { > blockNumber: number, > estimatedTransactionCount?: number, > baseFeePerGas?: number | null, > blobBaseFeePerGas?: number | null, > estimatedPrices: { > confidence: number, > price: number, > maxPriorityFeePerGas?: number | null, > maxFeePerGas?: number | null > }[] > }[] > ``` *** ### getSupportedChains `gas.getSupportedChains` Retrieve supported chains metadata for Blocknative gas services **Risk:** `read` ```ts theme={null} await corsair.blocknative.api.gas.getSupportedChains({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `chains` | `object[]` | Yes | — | > **chains full type** > > ```ts theme={null} > { > arch?: string, > chainId: number, > label: string, > icon?: string, > system?: string, > network?: string, > features?: string[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/blocknative/database Blocknative local sync: searchable entities, `.search()` filters, and operators. The Blocknative plugin syncs data locally. Use `corsair.blocknative.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Base Fee Estimates Path: `blocknative.db.baseFeeEstimates.search` ```ts theme={null} const rows = await corsair.blocknative.db.baseFeeEstimates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `system` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `unit` | `string` | equals, contains, startsWith, endsWith, in | | `currentBlockNumber` | `number` | equals, gt, gte, lt, lte, in | | `msSinceLastBlock` | `number` | equals, gt, gte, lt, lte, in | | `baseFeePerGas` | `number` | equals, gt, gte, lt, lte, in | | `blobBaseFeePerGas` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Block Prices Path: `blocknative.db.blockPrices.search` ```ts theme={null} const rows = await corsair.blocknative.db.blockPrices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `system` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `unit` | `string` | equals, contains, startsWith, endsWith, in | | `maxPrice` | `number` | equals, gt, gte, lt, lte, in | | `currentBlockNumber` | `number` | equals, gt, gte, lt, lte, in | | `msSinceLastBlock` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Chains Path: `blocknative.db.chains.search` ```ts theme={null} const rows = await corsair.blocknative.db.chains.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `arch` | `string` | equals, contains, startsWith, endsWith, in | | `chainId` | `number` | equals, gt, gte, lt, lte, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | | `system` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Gas Distributions Path: `blocknative.db.gasDistributions.search` ```ts theme={null} const rows = await corsair.blocknative.db.gasDistributions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `system` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `unit` | `string` | equals, contains, startsWith, endsWith, in | | `maxPrice` | `number` | equals, gt, gte, lt, lte, in | | `currentBlockNumber` | `number` | equals, gt, gte, lt, lte, in | | `msSinceLastBlock` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Oracles Path: `blocknative.db.oracles.search` ```ts theme={null} const rows = await corsair.blocknative.db.oracles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `arch` | `string` | equals, contains, startsWith, endsWith, in | | `chainId` | `number` | equals, gt, gte, lt, lte, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | | `system` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `rpcUrl` | `string` | equals, contains, startsWith, endsWith, in | | `blockExplorerUrl` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/blocknative/overview Mempool monitoring API for real-time Ethereum and blockchain transaction tracking. Use **Blocknative** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 5 synced entities (`baseFeeEstimates`, `blockPrices`, `chains`, `gasDistributions`, `oracles`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/blocknative ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/blocknative ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/blocknative ``` ```bash bun theme={null} bun add corsair @corsair-dev/blocknative ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { blocknative } from '@corsair-dev/blocknative'; export const corsair = createCorsair({ plugins: [ blocknative(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} blocknative() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'blocknative', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`gas.getBaseFeeEstimates`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.blocknative.api.gas.getBaseFeeEstimates({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/blocknative/api) reference.* See the full list on the [API](/plugins/blocknative/api) page. ## Query synced data Synced entities support `tenant.blocknative.db..search()` and `.list()`: `baseFeeEstimates`, `blockPrices`, `chains`, `gasDistributions`, `oracles`. See [Database](/plugins/blocknative/database) for filters and operators. ## What's next > **[API reference](/plugins/blocknative/api)** > > Every `blocknative.api.*` operation with input and output types. > **[Database](/plugins/blocknative/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bluesky/api API reference for Bluesky: every `bluesky.api.*` operation with input and output types. Every `bluesky.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Feeds ### getTimeline `feeds.getTimeline` Get the home timeline feed of the authenticated user **Risk:** `read` ```ts theme={null} await corsair.bluesky.api.feeds.getTimeline({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `algorithm` | `string` | No | Algorithm to use for the feed | | `limit` | `number` | No | Maximum number of items to return (1-100) | | `cursor` | `string` | No | Pagination cursor | **Output** | Name | Type | Required | Description | | - | - | - | - | | `feed` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **feed full type** > > ```ts theme={null} > { > post: { > uri: string, > cid: string, > author: { > did: string, > handle: string, > displayName?: string, > avatar?: string > }, > record: { > text: string, > createdAt: string > }, > replyCount?: number, > repostCount?: number, > likeCount?: number > } > }[] > ``` *** ## Posts ### create `posts.create` Create/publish a new post (skeet) on Bluesky **Risk:** `write` ```ts theme={null} await corsair.bluesky.api.posts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | The text content of the post (max 300 characters) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uri` | `string` | Yes | — | | `cid` | `string` | Yes | — | *** ### deleteRecord `posts.deleteRecord` Delete a post on Bluesky **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.bluesky.api.posts.deleteRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uri` | `string` | Yes | The AT Protocol URI (at://did:plc:...) of the post to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Profiles ### get `profiles.get` Get profile information for a Bluesky actor/user **Risk:** `read` ```ts theme={null} await corsair.bluesky.api.profiles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `actor` | `string` | Yes | The handle or DID of the user profile to fetch | **Output** | Name | Type | Required | Description | | - | - | - | - | | `did` | `string` | Yes | — | | `handle` | `string` | Yes | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `avatar` | `string` | No | — | | `banner` | `string` | No | — | | `followersCount` | `number` | No | — | | `followsCount` | `number` | No | — | | `postsCount` | `number` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/bluesky/database Bluesky local sync: searchable entities, `.search()` filters, and operators. The Bluesky plugin syncs data locally. Use `corsair.bluesky.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Posts Path: `bluesky.db.posts.search` ```ts theme={null} const rows = await corsair.bluesky.db.posts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `cid` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `authorDid` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bluesky/overview Decentralized social network for posting feeds, follows, and public conversations. Use **Bluesky** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 1 synced entity (`posts`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bluesky ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bluesky ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bluesky ``` ```bash bun theme={null} bun add corsair @corsair-dev/bluesky ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bluesky } from '@corsair-dev/bluesky'; export const corsair = createCorsair({ plugins: [ bluesky(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bluesky() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bluesky', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`feeds.getTimeline`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bluesky.api.feeds.getTimeline({}); ``` **`posts.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bluesky.api.posts.create({}); ``` See the full list on the [API](/plugins/bluesky/api) page. ## Query synced data Synced entities support `tenant.bluesky.db..search()` and `.list()`: `posts`. See [Database](/plugins/bluesky/database) for filters and operators. ## What's next > **[API reference](/plugins/bluesky/api)** > > Every `bluesky.api.*` operation with input and output types. > **[Database](/plugins/bluesky/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/boldsign/api API reference for Boldsign: every `boldsign.api.*` operation with input and output types. Every `boldsign.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Brands ### get `brands.get` Get details of one brand by brandId. **Risk:** `read` ```ts theme={null} await corsair.boldsign.api.brands.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `brandName` | `string` | No | — | *** ### list `brands.list` List all brands available to the account. **Risk:** `read` ```ts theme={null} await corsair.boldsign.api.brands.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > brandId: string, > brandName?: string > }[] > ``` *** ## Custom Fields ### create `customFields.create` Create a reusable custom field under a BoldSign brand. **Risk:** `write` ```ts theme={null} await corsair.boldsign.api.customFields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fieldName` | `string` | Yes | — | | `formField` | `object` | Yes | — | | `fieldDescription` | `string` | No | — | | `fieldOrder` | `number` | No | — | | `brandId` | `string` | No | — | | `sharedField` | `boolean` | No | — | > **formField full type** > > ```ts theme={null} > { > id?: string, > name?: string, > fieldType?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `customFieldId` | `string` | Yes | — | | `message` | `string` | Yes | — | *** ### edit `customFields.edit` Update a brand custom field by customFieldId. **Risk:** `write` ```ts theme={null} await corsair.boldsign.api.customFields.edit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fieldName` | `string` | Yes | — | | `formField` | `object` | Yes | — | | `fieldDescription` | `string` | No | — | | `fieldOrder` | `number` | No | — | | `brandId` | `string` | No | — | | `sharedField` | `boolean` | No | — | | `customFieldId` | `string` | Yes | — | > **formField full type** > > ```ts theme={null} > { > id?: string, > name?: string, > fieldType?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `customFieldId` | `string` | Yes | — | | `message` | `string` | Yes | — | *** ## Documents ### createEmbeddedRequestLink `documents.createEmbeddedRequestLink` Create an embedded document request URL for draft/send flows. **Risk:** `write` ```ts theme={null} await corsair.boldsign.api.documents.createEmbeddedRequestLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `message` | `string` | No | — | | `signers` | `object[]` | No | — | | `files` | `object[]` | No | — | | `fileUrls` | `string[]` | No | — | | `redirectUrl` | `string` | No | — | | `showToolbar` | `boolean` | No | — | | `showSendButton` | `boolean` | No | — | | `showSaveButton` | `boolean` | No | — | | `showPreviewButton` | `boolean` | No | — | | `showNavigationButtons` | `boolean` | No | — | | `sendViewOption` | `PreparePage \| FillingPage` | No | — | | `locale` | `string` | No | — | | `sendLinkValidTill` | `string` | No | — | | `embeddedSendLinkValidTill` | `string` | No | — | | `enableSigningOrder` | `boolean` | No | — | | `onBehalfOf` | `string` | No | — | > **signers full type** > > ```ts theme={null} > { > name?: string, > emailAddress?: string, > signerType?: string, > formFields?: { > id?: string, > name?: string, > fieldType?: string > }[] > }[] > ``` > **files full type** > > ```ts theme={null} > ( > string | { > base64: string, > fileName: string > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `sendUrl` | `string` | Yes | — | *** ### editBeta `documents.editBeta` Edit an existing document request (beta endpoint). **Risk:** `write` ```ts theme={null} await corsair.boldsign.api.documents.editBeta({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `title` | `string` | No | — | | `message` | `string` | No | — | | `signers` | `object[]` | No | — | | `cc` | `object[]` | No | — | | `files` | `object[]` | No | — | | `enableSigningOrder` | `boolean` | No | — | | `disableEmails` | `boolean` | No | — | | `disableSMS` | `boolean` | No | — | | `onBehalfOf` | `string` | No | — | > **signers full type** > > ```ts theme={null} > { > name?: string, > emailAddress?: string, > signerType?: string, > formFields?: { > id?: string, > name?: string, > fieldType?: string > }[] > }[] > ``` > **cc full type** > > ```ts theme={null} > { > }[] > ``` > **files full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ### extendExpiry `documents.extendExpiry` Extend document expiry window for pending signers. **Risk:** `write` ```ts theme={null} await corsair.boldsign.api.documents.extendExpiry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `newExpiryValue` | `string` | Yes | — | | `warnPrior` | `boolean` | No | — | | `onBehalfOf` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### list `documents.list` List documents with filters and pagination. **Risk:** `read` ```ts theme={null} await corsair.boldsign.api.documents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `status` | `string[]` | No | — | | `sentBy` | `string[]` | No | — | | `recipients` | `string[]` | No | — | | `transmitType` | `string` | No | — | | `dateFilterType` | `string` | No | — | | `searchKey` | `string` | No | — | | `labels` | `string[]` | No | — | | `nextCursor` | `number` | No | — | | `brandIds` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pageDetails` | `object` | Yes | — | | `result` | `object[]` | Yes | — | > **pageDetails full type** > > ```ts theme={null} > { > page?: number, > pageSize?: number, > totalRecordsCount?: number, > totalPages?: number > } > ``` > **result full type** > > ```ts theme={null} > { > documentId?: string, > status?: string, > title?: string, > nextCursor?: number > }[] > ``` *** ### listBehalf `documents.listBehalf` List documents sent on behalf of users. **Risk:** `read` ```ts theme={null} await corsair.boldsign.api.documents.listBehalf({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | Yes | — | | `pageType` | `string` | No | — | | `pageSize` | `number` | No | — | | `emailAddress` | `string[]` | No | — | | `signers` | `string[]` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `status` | `string[]` | No | — | | `searchKey` | `string` | No | — | | `labels` | `string[]` | No | — | | `nextCursor` | `number` | No | — | | `brandIds` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pageDetails` | `object` | Yes | — | | `result` | `object[]` | Yes | — | > **pageDetails full type** > > ```ts theme={null} > { > page?: number, > pageSize?: number, > totalRecordsCount?: number, > totalPages?: number > } > ``` > **result full type** > > ```ts theme={null} > { > documentId?: string, > status?: string, > title?: string, > nextCursor?: number > }[] > ``` *** ### listTeam `documents.listTeam` List documents across teams/users with filters. **Risk:** `read` ```ts theme={null} await corsair.boldsign.api.documents.listTeam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `userId` | `string[]` | No | — | | `teamId` | `string[]` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `status` | `string[]` | No | — | | `searchKey` | `string` | No | — | | `labels` | `string[]` | No | — | | `transmitType` | `string` | No | — | | `dateFilterType` | `string` | No | — | | `nextCursor` | `number` | No | — | | `brandIds` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pageDetails` | `object` | Yes | — | | `result` | `object[]` | Yes | — | > **pageDetails full type** > > ```ts theme={null} > { > page?: number, > pageSize?: number, > totalRecordsCount?: number, > totalPages?: number > } > ``` > **result full type** > > ```ts theme={null} > { > documentId?: string, > status?: string, > title?: string, > nextCursor?: number > }[] > ``` *** ### removeAuthentication `documents.removeAuthentication` Remove signer authentication from a document recipient. **Risk:** `write` ```ts theme={null} await corsair.boldsign.api.documents.removeAuthentication({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `emailId` | `string` | Yes | — | | `zOrder` | `number` | No | — | | `onBehalfOf` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### send `documents.send` Send a document for signature. **Risk:** `write` ```ts theme={null} await corsair.boldsign.api.documents.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `message` | `string` | No | — | | `signers` | `object[]` | No | — | | `files` | `object[]` | No | — | | `fileUrls` | `string[]` | No | — | | `enableSigningOrder` | `boolean` | No | — | | `expiryValue` | `number` | No | — | | `expiryDateType` | `Days \| DateTime` | No | — | | `reminderSettings` | `object` | No | — | | `disableEmails` | `boolean` | No | — | | `disableSMS` | `boolean` | No | — | | `brandId` | `string` | No | — | | `labels` | `string[]` | No | — | | `sendLinkValidTill` | `string` | No | — | | `useTextTags` | `boolean` | No | — | | `onBehalfOf` | `string` | No | — | > **signers full type** > > ```ts theme={null} > { > name?: string, > emailAddress?: string, > signerType?: string, > formFields?: { > id?: string, > name?: string, > fieldType?: string > }[] > }[] > ``` > **files full type** > > ```ts theme={null} > ( > string | { > base64: string, > fileName: string > } > )[] > ``` > **reminderSettings full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | *** ## Helpers ### uploadFile `helpers.uploadFile` Prepare a file payload for BoldSign multipart/json send APIs using base64 data URI. **Risk:** `read` ```ts theme={null} await corsair.boldsign.api.helpers.uploadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileName` | `string` | Yes | — | | `mimeType` | `string` | Yes | — | | `base64Content` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | Yes | — | > **file full type** > > ```ts theme={null} > { > base64: string, > fileName: string > } > ``` *** ## Plan ### getApiCreditsCount `plan.getApiCreditsCount` Get remaining API credits count. **Risk:** `read` ```ts theme={null} await corsair.boldsign.api.plan.getApiCreditsCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `BalanceCredits` | `number` | No | — | | `balanceCredits` | `number` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/boldsign/database Boldsign local sync: searchable entities, `.search()` filters, and operators. The Boldsign plugin syncs data locally. Use `corsair.boldsign.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Brands Path: `boldsign.db.brands.search` ```ts theme={null} const rows = await corsair.boldsign.db.brands.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Custom Fields Path: `boldsign.db.custom_fields.search` ```ts theme={null} const rows = await corsair.boldsign.db.custom_fields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `brand_id` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Documents Path: `boldsign.db.documents.search` ```ts theme={null} const rows = await corsair.boldsign.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `next_cursor` | `number` | equals, gt, gte, lt, lte, in | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/boldsign/overview Boldsign plugin for Corsair Use **Boldsign** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 14 typed API operations * 3 synced entities (`brands`, `custom_fields`, `documents`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/boldsign ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/boldsign ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/boldsign ``` ```bash bun theme={null} bun add corsair @corsair-dev/boldsign ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { boldsign } from '@corsair-dev/boldsign'; export const corsair = createCorsair({ plugins: [ boldsign(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Boldsign OAuth app. ```ts theme={null} boldsign() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'boldsign', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`brands.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.boldsign.api.brands.get({}); ``` **`customFields.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.boldsign.api.customFields.create({}); ``` See the full list on the [API](/plugins/boldsign/api) page. ## Query synced data Synced entities support `tenant.boldsign.db..search()` and `.list()`: `brands`, `custom_fields`, `documents`. See [Database](/plugins/boldsign/database) for filters and operators. ## What's next > **[API reference](/plugins/boldsign/api)** > > Every `boldsign.api.*` operation with input and output types. > **[Database](/plugins/boldsign/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/boloforms/api API reference for BoloForms: every `boloforms.api.*` operation with input and output types. Every `boloforms.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Documents ### list `documents.list` Retrieve a list of documents from a Boloforms workspace, with optional filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.boloforms.api.documents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `query` | `string` | No | — | | `sortOrder` | `string` | No | — | | `limit` | `string` | No | — | | `documentId` | `string` | No | — | | `dateTo` | `string` | No | — | | `dateFrom` | `string` | No | — | | `page` | `string` | No | — | | `sortBy` | `string` | No | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documents` | `object[]` | Yes | — | | `message` | `string` | No | — | | `formCount` | `number` | No | — | | `documentsCount` | `number` | No | — | | `pagination` | `object` | No | — | > **documents full type** > > ```ts theme={null} > { > documentId: string, > name?: string, > documentName?: string, > status?: string, > signingType?: string, > createdAt?: string, > updatedAt?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > currentPage?: number, > totalPages?: number, > totalDocuments?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/boloforms/database BoloForms local sync: searchable entities, `.search()` filters, and operators. The BoloForms plugin syncs data locally. Use `corsair.boloforms.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Documents Path: `boloforms.db.documents.search` ```ts theme={null} const rows = await corsair.boloforms.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `documentId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `documentName` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `signingType` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/boloforms/overview Online form builder for surveys, applications, and lead capture with workflows. Use **BoloForms** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 1 typed API operations * 1 synced entity (`documents`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/boloforms ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/boloforms ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/boloforms ``` ```bash bun theme={null} bun add corsair @corsair-dev/boloforms ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { boloforms } from '@corsair-dev/boloforms'; export const corsair = createCorsair({ plugins: [ boloforms(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} boloforms() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'boloforms', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`documents.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.boloforms.api.documents.list({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/boloforms/api) reference.* See the full list on the [API](/plugins/boloforms/api) page. ## Query synced data Synced entities support `tenant.boloforms.db..search()` and `.list()`: `documents`. See [Database](/plugins/boloforms/database) for filters and operators. ## What's next > **[API reference](/plugins/boloforms/api)** > > Every `boloforms.api.*` operation with input and output types. > **[Database](/plugins/boloforms/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/boltiot/api API reference for Bolt IoT: every `boltiot.api.*` operation with input and output types. Every `boltiot.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Device ### analogRead `device.analogRead` Read the analog value (0-1023) from a specified pin on a Bolt device **Risk:** `read` ```ts theme={null} await corsair.boltiot.api.device.analogRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceName` | `string` | Yes | The ID/Name of the Bolt IoT device | | `pin` | `string` | Yes | Analog pin to read from (e.g. A0) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `value` | `number` | Yes | Analog value reading (0-1023) | | `rawValue` | `string` | Yes | — | | `pin` | `string` | Yes | — | | `deviceName` | `string` | Yes | — | *** ### checkStatus `device.checkStatus` Check whether a specified Bolt device is online **Risk:** `read` ```ts theme={null} await corsair.boltiot.api.device.checkStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceName` | `string` | Yes | The ID/Name of the Bolt IoT device (e.g. BOLT1234567) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `value` | `string` | Yes | Device status from isOnline: "online" or "offline" | | `time` | `string` | No | Official isOnline timestamp when that status last changed | | `deviceName` | `string` | Yes | — | *** ### digitalRead `device.digitalRead` Read the status of a digital pin on a specified Bolt device **Risk:** `read` ```ts theme={null} await corsair.boltiot.api.device.digitalRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceName` | `string` | Yes | The ID/Name of the Bolt IoT device | | `pin` | `string` | Yes | Digital pin to read from (e.g. "0", "1", "2", "3", "4") | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `value` | `string` | Yes | Digital pin state ("1" for HIGH, "0" for LOW) | | `pin` | `string` | Yes | — | | `deviceName` | `string` | Yes | — | *** ### digitalWrite `device.digitalWrite` Set a digital pin HIGH or LOW on a specified Bolt device **Risk:** `write` ```ts theme={null} await corsair.boltiot.api.device.digitalWrite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceName` | `string` | Yes | The ID/Name of the Bolt IoT device | | `pin` | `string` | Yes | Digital pin to write to (e.g. "0", "1", "2", "3", "4") | | `state` | `0 \| 1 \| HIGH \| LOW` | Yes | State to set pin to | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `value` | `string` | Yes | Response value from device | | `pin` | `string` | Yes | — | | `state` | `string` | Yes | — | | `deviceName` | `string` | Yes | — | *** ## Serial ### read `serial.read` Read incoming serial data from a Bolt device UART **Risk:** `read` ```ts theme={null} await corsair.boltiot.api.serial.read({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceName` | `string` | Yes | The ID/Name of the Bolt IoT device | | `till` | `string` | No | ASCII character code to read until (e.g. "10" for newline) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `value` | `string` | Yes | Serial data read from device | | `deviceName` | `string` | Yes | — | *** ### write `serial.write` Send ASCII serial data to a Bolt device over UART **Risk:** `write` ```ts theme={null} await corsair.boltiot.api.serial.write({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceName` | `string` | Yes | The ID/Name of the Bolt IoT device | | `data` | `string` | Yes | ASCII data string to send over UART | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `value` | `string` | Yes | Response status from serial write | | `deviceName` | `string` | Yes | — | *** ### writeRead `serial.writeRead` Send serial data and read reply immediately on a Bolt device **Risk:** `write` ```ts theme={null} await corsair.boltiot.api.serial.writeRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deviceName` | `string` | Yes | The ID/Name of the Bolt IoT device | | `data` | `string` | Yes | ASCII data string to send over UART | | `till` | `string` | No | ASCII character code to read reply until | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `value` | `string` | Yes | Reply received from serial write & read command | | `deviceName` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/boltiot/database Bolt IoT local sync: searchable entities, `.search()` filters, and operators. The Bolt IoT plugin syncs data locally. Use `corsair.boltiot.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Commands Path: `boltiot.db.commands.search` ```ts theme={null} const rows = await corsair.boltiot.db.commands.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Devices Path: `boltiot.db.devices.search` ```ts theme={null} const rows = await corsair.boltiot.db.devices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `deviceName` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/boltiot/overview IoT platform for connecting devices, sensors, and hardware to cloud dashboards. Use **Bolt IoT** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 7 typed API operations * 2 synced entities (`commands`, `devices`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/boltiot ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/boltiot ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/boltiot ``` ```bash bun theme={null} bun add corsair @corsair-dev/boltiot ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { boltiot } from '@corsair-dev/boltiot'; export const corsair = createCorsair({ plugins: [ boltiot(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} boltiot() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'boltiot', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`device.analogRead`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.boltiot.api.device.analogRead({}); ``` **`device.digitalWrite`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.boltiot.api.device.digitalWrite({}); ``` See the full list on the [API](/plugins/boltiot/api) page. ## Query synced data Synced entities support `tenant.boltiot.db..search()` and `.list()`: `commands`, `devices`. See [Database](/plugins/boltiot/database) for filters and operators. ## What's next > **[API reference](/plugins/boltiot/api)** > > Every `boltiot.api.*` operation with input and output types. > **[Database](/plugins/boltiot/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bonsai/api API reference for Bonsai: every `bonsai.api.*` operation with input and output types. Every `bonsai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Clusters ### get `clusters.get` Get Bonsai cluster details by slug **Risk:** `read` ```ts theme={null} await corsair.bonsai.api.clusters.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cluster` | `object` | Yes | — | > **cluster full type** > > ```ts theme={null} > { > slug: string, > name: string, > uri: string, > plan: { > slug: string, > uri: string > }, > release: { > version: string, > slug: string, > package_name: string, > service_type: string, > uri: string > }, > space: { > path: string, > region: string, > uri: string > }, > stats: { > docs: number, > shards_used: number, > data_bytes_used: number > }, > access: { > host: string, > port: number, > scheme: string > }, > state: string > } > ``` *** ## Spaces ### get `spaces.get` Retrieve space details by path **Risk:** `read` ```ts theme={null} await corsair.bonsai.api.spaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `private_network` | `boolean` | Yes | — | | `cloud` | `object` | Yes | — | > **cloud full type** > > ```ts theme={null} > { > provider: string, > region: string > } > ``` *** ### list `spaces.list` List all spaces **Risk:** `read` ```ts theme={null} await corsair.bonsai.api.spaces.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `spaces` | `object[]` | Yes | — | > **spaces full type** > > ```ts theme={null} > { > path: string, > private_network: boolean, > cloud: { > provider: string, > region: string > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/bonsai/database Bonsai local sync: searchable entities, `.search()` filters, and operators. The Bonsai plugin syncs data locally. Use `corsair.bonsai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/bonsai/overview Freelance business management for contracts, invoices, proposals, and client billing. Use **Bonsai** through Corsair: one client, typed API calls. **What you get:** * 3 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bonsai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bonsai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bonsai ``` ```bash bun theme={null} bun add corsair @corsair-dev/bonsai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bonsai } from '@corsair-dev/bonsai'; export const corsair = createCorsair({ plugins: [ bonsai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bonsai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bonsai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`clusters.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bonsai.api.clusters.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/bonsai/api) reference.* See the full list on the [API](/plugins/bonsai/api) page. ## What's next > **[API reference](/plugins/bonsai/api)** > > Every `bonsai.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bookingmood/api API reference for Bookingmood: every `bookingmood.api.*` operation with input and output types. Every `bookingmood.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Attribute Options ### list `attributeOptions.list` Bookingmood attributeOptions list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.attributeOptions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `attributeOptions.update` Bookingmood attributeOptions update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.attributeOptions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Attributes ### delete `attributes.delete` Bookingmood attributes delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.attributes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `attributes.list` Bookingmood attributes list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.attributes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `attributes.update` Bookingmood attributes update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.attributes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Availability ### query `availability.query` Bookingmood availability query **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.availability.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | No | — | | `product_ids` | `string[]` | No | — | | `perform_sync` | `boolean` | No | — | | `show_booked_as` | `booked \| unavailable` | No | — | | `show_closed_as` | `closed \| unavailable` | No | — | | `show_pending_as` | `CANCELLED \| TENTATIVE \| CONFIRMED` | No | — | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > product_id: string, > intervals: { > start: string, > end: string, > status: string > }[] > }[] > ``` *** ## Booking Details ### delete `bookingDetails.delete` Bookingmood bookingDetails delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.bookingDetails.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `bookingDetails.list` Bookingmood bookingDetails list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.bookingDetails.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `bookingDetails.update` Bookingmood bookingDetails update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.bookingDetails.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Bookings ### delete `bookings.delete` Bookingmood bookings delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.bookings.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `bookings.list` Bookingmood bookings list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.bookings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `bookings.update` Bookingmood bookings update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.bookings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Booking Updates ### list `bookingUpdates.list` Bookingmood bookingUpdates list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.bookingUpdates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Calendar Event Notes ### delete `calendarEventNotes.delete` Bookingmood calendarEventNotes delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.calendarEventNotes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `calendarEventNotes.list` Bookingmood calendarEventNotes list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.calendarEventNotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `calendarEventNotes.update` Bookingmood calendarEventNotes update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.calendarEventNotes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Calendar Events ### delete `calendarEvents.delete` Bookingmood calendarEvents delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.calendarEvents.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `calendarEvents.list` Bookingmood calendarEvents list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.calendarEvents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `calendarEvents.update` Bookingmood calendarEvents update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.calendarEvents.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Calendar Event Updates ### list `calendarEventUpdates.list` Bookingmood calendarEventUpdates list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.calendarEventUpdates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Capacities ### delete `capacities.delete` Bookingmood capacities delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.capacities.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `capacities.list` Bookingmood capacities list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.capacities.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `capacities.update` Bookingmood capacities update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.capacities.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Capacity Group Deps ### delete `capacityGroupDeps.delete` Bookingmood capacityGroupDeps delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.capacityGroupDeps.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `capacityGroupDeps.list` Bookingmood capacityGroupDeps list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.capacityGroupDeps.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `capacityGroupDeps.update` Bookingmood capacityGroupDeps update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.capacityGroupDeps.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Capacity Groups ### delete `capacityGroups.delete` Bookingmood capacityGroups delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.capacityGroups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `capacityGroups.list` Bookingmood capacityGroups list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.capacityGroups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `capacityGroups.update` Bookingmood capacityGroups update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.capacityGroups.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Contact Bookings ### delete `contactBookings.delete` Bookingmood contactBookings delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.contactBookings.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `contactBookings.list` Bookingmood contactBookings list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.contactBookings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `contactBookings.update` Bookingmood contactBookings update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.contactBookings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Contacts ### create `contacts.create` Bookingmood contacts create **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### delete `contacts.delete` Bookingmood contacts delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `contacts.list` Bookingmood contacts list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `contacts.update` Bookingmood contacts update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Coupon Products ### delete `couponProducts.delete` Bookingmood couponProducts delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.couponProducts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `couponProducts.list` Bookingmood couponProducts list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.couponProducts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `couponProducts.update` Bookingmood couponProducts update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.couponProducts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Coupons ### delete `coupons.delete` Bookingmood coupons delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.coupons.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `coupons.list` Bookingmood coupons list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.coupons.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `coupons.update` Bookingmood coupons update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.coupons.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Coupon Services ### delete `couponServices.delete` Bookingmood couponServices delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.couponServices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `couponServices.list` Bookingmood couponServices list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.couponServices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `couponServices.update` Bookingmood couponServices update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.couponServices.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Coupon Uses ### delete `couponUses.delete` Bookingmood couponUses delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.couponUses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `couponUses.list` Bookingmood couponUses list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.couponUses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `couponUses.update` Bookingmood couponUses update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.couponUses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## External Calendars ### delete `externalCalendars.delete` Bookingmood externalCalendars delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.externalCalendars.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `externalCalendars.list` Bookingmood externalCalendars list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.externalCalendars.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `externalCalendars.update` Bookingmood externalCalendars update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.externalCalendars.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Invoices ### delete `invoices.delete` Bookingmood invoices delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.invoices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `invoices.list` Bookingmood invoices list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.invoices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Line Items ### delete `lineItems.delete` Bookingmood lineItems delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.lineItems.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `lineItems.list` Bookingmood lineItems list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.lineItems.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `lineItems.update` Bookingmood lineItems update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.lineItems.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Line Item Taxes ### delete `lineItemTaxes.delete` Bookingmood lineItemTaxes delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.lineItemTaxes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `lineItemTaxes.list` Bookingmood lineItemTaxes list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.lineItemTaxes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `lineItemTaxes.update` Bookingmood lineItemTaxes update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.lineItemTaxes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Members ### delete `members.delete` Bookingmood members delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.members.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### invite `members.invite` Bookingmood members invite **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.members.invite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `name` | `string` | No | — | | `language` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### list `members.list` Bookingmood members list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.members.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Organizations ### list `organizations.list` Bookingmood organizations list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.organizations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Paddle Subscriptions ### list `paddleSubscriptions.list` Bookingmood paddleSubscriptions list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.paddleSubscriptions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Payments ### delete `payments.delete` Bookingmood payments delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.payments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `payments.list` Bookingmood payments list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.payments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `payments.update` Bookingmood payments update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.payments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Permissions ### delete `permissions.delete` Bookingmood permissions delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.permissions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `permissions.list` Bookingmood permissions list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.permissions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `permissions.update` Bookingmood permissions update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.permissions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Pricing Widgets ### delete `pricingWidgets.delete` Bookingmood pricingWidgets delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.pricingWidgets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `pricingWidgets.list` Bookingmood pricingWidgets list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.pricingWidgets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `pricingWidgets.update` Bookingmood pricingWidgets update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.pricingWidgets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Product Attr Options ### delete `productAttrOptions.delete` Bookingmood productAttrOptions delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.productAttrOptions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `productAttrOptions.list` Bookingmood productAttrOptions list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.productAttrOptions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `productAttrOptions.update` Bookingmood productAttrOptions update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.productAttrOptions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Product Calendar Logs ### list `productCalendarLogs.list` Bookingmood productCalendarLogs list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.productCalendarLogs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Product Reply Addrs ### delete `productReplyAddrs.delete` Bookingmood productReplyAddrs delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.productReplyAddrs.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `productReplyAddrs.list` Bookingmood productReplyAddrs list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.productReplyAddrs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `productReplyAddrs.update` Bookingmood productReplyAddrs update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.productReplyAddrs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Products ### create `products.create` Bookingmood products create **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.products.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `object` | Yes | — | | `rent_period` | `daily \| nightly` | Yes | — | | `timezone` | `string` | Yes | — | > **name full type** > > ```ts theme={null} > { > default?: string > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### delete `products.delete` Bookingmood products delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.products.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `products.list` Bookingmood products list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.products.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `products.update` Bookingmood products update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.products.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Product Services ### delete `productServices.delete` Bookingmood productServices delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.productServices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `productServices.list` Bookingmood productServices list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.productServices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `productServices.update` Bookingmood productServices update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.productServices.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Reply To Addresses ### delete `replyToAddresses.delete` Bookingmood replyToAddresses delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.replyToAddresses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `replyToAddresses.list` Bookingmood replyToAddresses list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.replyToAddresses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `replyToAddresses.update` Bookingmood replyToAddresses update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.replyToAddresses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Review Products ### delete `reviewProducts.delete` Bookingmood reviewProducts delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.reviewProducts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `reviewProducts.list` Bookingmood reviewProducts list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.reviewProducts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `reviewProducts.update` Bookingmood reviewProducts update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.reviewProducts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Reviews ### delete `reviews.delete` Bookingmood reviews delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.reviews.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `reviews.list` Bookingmood reviews list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.reviews.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `reviews.update` Bookingmood reviews update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.reviews.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Review Widget Listings ### delete `reviewWidgetListings.delete` Bookingmood reviewWidgetListings delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.reviewWidgetListings.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `reviewWidgetListings.list` Bookingmood reviewWidgetListings list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.reviewWidgetListings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `reviewWidgetListings.update` Bookingmood reviewWidgetListings update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.reviewWidgetListings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Review Widgets ### list `reviewWidgets.list` Bookingmood reviewWidgets list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.reviewWidgets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `reviewWidgets.update` Bookingmood reviewWidgets update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.reviewWidgets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Search ### availability `search.availability` Bookingmood search availability **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.search.availability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interval` | `object` | No | — | | `occupancy` | `object` | No | — | | `option_ids` | `string[]` | No | — | | `show_booked_as` | `booked \| unavailable` | No | — | | `show_closed_as` | `closed \| unavailable` | No | — | | `show_pending_as` | `CONFIRMED \| TENTATIVE \| CANCELLED` | No | — | > **interval full type** > > ```ts theme={null} > { > start: string, > end: string > } > ``` > **occupancy full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > productId?: string, > product_id?: string, > match?: boolean, > availability?: string > }[] > ``` *** ## Seasons ### list `seasons.list` Bookingmood seasons list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.seasons.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Services ### delete `services.delete` Bookingmood services delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.services.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `services.list` Bookingmood services list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.services.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `services.update` Bookingmood services update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.services.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Site Listings ### list `siteListings.list` Bookingmood siteListings list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.siteListings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `siteListings.update` Bookingmood siteListings update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.siteListings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Site Pages ### create `sitePages.create` Bookingmood sitePages create **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.sitePages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### delete `sitePages.delete` Bookingmood sitePages delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.sitePages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `sitePages.list` Bookingmood sitePages list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.sitePages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `sitePages.update` Bookingmood sitePages update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.sitePages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Sites ### list `sites.list` Bookingmood sites list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.sites.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `sites.update` Bookingmood sites update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.sites.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Site Views ### list `siteViews.list` Bookingmood siteViews list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.siteViews.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Taxes ### delete `taxes.delete` Bookingmood taxes delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.taxes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `taxes.list` Bookingmood taxes list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.taxes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `taxes.update` Bookingmood taxes update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.taxes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## User Profiles ### list `userProfiles.list` Bookingmood userProfiles list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.userProfiles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `userProfiles.update` Bookingmood userProfiles update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.userProfiles.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Webhook Notifications ### list `webhookNotifications.list` Bookingmood webhookNotifications list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.webhookNotifications.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Webhooks ### delete `webhooks.delete` Bookingmood webhooks delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `webhooks.list` Bookingmood webhooks list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `webhooks.update` Bookingmood webhooks update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Widget Analytics ### list `widgetAnalytics.list` Bookingmood widgetAnalytics list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.widgetAnalytics.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Widget Listings ### delete `widgetListings.delete` Bookingmood widgetListings delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.widgetListings.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `widgetListings.list` Bookingmood widgetListings list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.widgetListings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `widgetListings.update` Bookingmood widgetListings update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.widgetListings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Widgets ### create `widgets.create` Bookingmood widgets create **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.widgets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### delete `widgets.delete` Bookingmood widgets delete **Risk:** `destructive` ```ts theme={null} await corsair.bookingmood.api.widgets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### list `widgets.list` Bookingmood widgets list **Risk:** `read` ```ts theme={null} await corsair.bookingmood.api.widgets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `order` | `string` | No | — | | `id` | `string` | No | — | | `organization_id` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `widgets.update` Bookingmood widgets update **Risk:** `write` ```ts theme={null} await corsair.bookingmood.api.widgets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `select` | `string` | No | — | | `filters` | `object` | No | — | | `body` | `object` | No | — | | `data` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/bookingmood/database Bookingmood local sync: searchable entities, `.search()` filters, and operators. The Bookingmood plugin syncs data locally. Use `corsair.bookingmood.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Bookings Path: `bookingmood.db.bookings.search` ```ts theme={null} const rows = await corsair.bookingmood.db.bookings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `creator_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `site_id` | `string` | equals, contains, startsWith, endsWith, in | | `widget_id` | `string` | equals, contains, startsWith, endsWith, in | | `confirmed_at` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `display_currency` | `string` | equals, contains, startsWith, endsWith, in | | `exchange_rate` | `number` | equals, gt, gte, lt, lte, in | | `method` | `string` | equals, contains, startsWith, endsWith, in | | `reference` | `string` | equals, contains, startsWith, endsWith, in | | `secret` | `string` | equals, contains, startsWith, endsWith, in | | `silent` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Calendar Events Path: `bookingmood.db.calendar_events.search` ```ts theme={null} const rows = await corsair.bookingmood.db.calendar_events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `product_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `bookingmood.db.contacts.search` ```ts theme={null} const rows = await corsair.bookingmood.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `creator_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `company_name` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invoices Path: `bookingmood.db.invoices.search` ```ts theme={null} const rows = await corsair.bookingmood.db.invoices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Members Path: `bookingmood.db.members.search` ```ts theme={null} const rows = await corsair.bookingmood.db.members.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `bookingmood.db.organizations.search` ```ts theme={null} const rows = await corsair.bookingmood.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `company_name` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `country_code` | `string` | equals, contains, startsWith, endsWith, in | | `subscription_type` | `string` | equals, contains, startsWith, endsWith, in | | `tier` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payments Path: `bookingmood.db.payments.search` ```ts theme={null} const rows = await corsair.bookingmood.db.payments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `invoice_id` | `string` | equals, contains, startsWith, endsWith, in | | `booking_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Products Path: `bookingmood.db.products.search` ```ts theme={null} const rows = await corsair.bookingmood.db.products.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `approximate_address` | `string` | equals, contains, startsWith, endsWith, in | | `exact_address` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Widgets Path: `bookingmood.db.widgets.search` ```ts theme={null} const rows = await corsair.bookingmood.db.widgets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bookingmood/overview Booking and scheduling software for appointments, reservations, and calendar management. Use **Bookingmood** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 132 typed API operations * 9 synced entities (`bookings`, `calendar_events`, `contacts`, `invoices`, `members`, `organizations`, and 3 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bookingmood ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bookingmood ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bookingmood ``` ```bash bun theme={null} bun add corsair @corsair-dev/bookingmood ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bookingmood } from '@corsair-dev/bookingmood'; export const corsair = createCorsair({ plugins: [ bookingmood(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bookingmood() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bookingmood', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`attributeOptions.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bookingmood.api.attributeOptions.list({}); ``` **`attributeOptions.update`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bookingmood.api.attributeOptions.update({}); ``` See the full list on the [API](/plugins/bookingmood/api) page. ## Query synced data Synced entities support `tenant.bookingmood.db..search()` and `.list()`: `bookings`, `calendar_events`, `contacts`, `invoices`, `members`, `organizations`, `payments`, `products`, `widgets`. See [Database](/plugins/bookingmood/database) for filters and operators. ## What's next > **[API reference](/plugins/bookingmood/api)** > > Every `bookingmood.api.*` operation with input and output types. > **[Database](/plugins/bookingmood/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/booqable/api API reference for Booqable: every `booqable.api.*` operation with input and output types. Every `booqable.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Barcodes ### listBarcodes `barcodes.listBarcodes` Retrieve a list of barcodes. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.barcodes.listBarcodes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: barcodes, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Bundle Items ### listBundleItems `bundleItems.listBundleItems` Retrieve a list of bundle items. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.bundleItems.listBundleItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: bundle_items, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Bundles ### searchBundles `bundles.searchBundles` Search bundles with advanced filtering. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.bundles.searchBundles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: bundles, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Clusters ### listClusters `clusters.listClusters` Retrieve a list of clusters. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.clusters.listClusters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: clusters, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Companies ### updateCompany `companies.updateCompany` Update the current company information. **Risk:** `write` ```ts theme={null} await corsair.booqable.api.companies.updateCompany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: companies, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Coupons ### listCoupons `coupons.listCoupons` Retrieve a list of coupons. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.coupons.listCoupons({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: coupons, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Customers ### createCustomer `customers.createCustomer` Create a new customer in Booqable. **Risk:** `write` ```ts theme={null} await corsair.booqable.api.customers.createCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: customers, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### deleteCustomer `customers.deleteCustomer` Delete (archive) a customer by ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.booqable.api.customers.deleteCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: { > id: string, > type: customers, > attributes?: { > }, > relationships?: { > } > }, > included?: { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[], > links?: { > }, > meta?: { > } > } | { > data: null, > links?: { > }, > meta?: { > } > } > ``` *** ### getCustomer `customers.getCustomer` Fetch a specific customer by ID. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.customers.getCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: customers, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### getCustomers `customers.getCustomers` Retrieve a paginated list of customers. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.customers.getCustomers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: customers, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### searchCustomers `customers.searchCustomers` Search customers with advanced filtering. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.customers.searchCustomers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: customers, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Default Properties ### listDefaultProperties `defaultProperties.listDefaultProperties` Retrieve default property definitions. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.defaultProperties.listDefaultProperties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: default_properties, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Documents ### listDocuments `documents.listDocuments` Retrieve a list of documents. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.documents.listDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: documents, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### searchDocuments `documents.searchDocuments` Search documents with advanced filtering. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.documents.searchDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: documents, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Email Templates ### listEmailTemplates `emailTemplates.listEmailTemplates` List email templates. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.emailTemplates.listEmailTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: email_templates, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Employees ### listEmployees `employees.listEmployees` Retrieve a list of employees. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.employees.listEmployees({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: employees, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Inventory Breakdowns ### listInventoryBreakdowns `inventoryBreakdowns.listInventoryBreakdowns` Retrieve inventory breakdowns by status and product. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.inventoryBreakdowns.listInventoryBreakdowns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: inventory_breakdowns, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Inventory Levels ### getInventoryLevels `inventoryLevels.getInventoryLevels` Fetch inventory levels for products across locations. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.inventoryLevels.getInventoryLevels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: inventory_levels, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Items ### listItems `items.listItems` Retrieve a list of items (products and product groups). **Risk:** `read` ```ts theme={null} await corsair.booqable.api.items.listItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: items, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### searchItems `items.searchItems` Search items with advanced filtering. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.items.searchItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: items, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Lines ### listLines `lines.listLines` Retrieve a paginated list of order lines. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.lines.listLines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: lines, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Locations ### listLocations `locations.listLocations` Retrieve a list of locations. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.locations.listLocations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: locations, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Notes ### listNotes `notes.listNotes` Retrieve a list of notes. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.notes.listNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: notes, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Orders ### createOrder `orders.createOrder` Create a new order. **Risk:** `write` ```ts theme={null} await corsair.booqable.api.orders.createOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: orders, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### deleteOrder `orders.deleteOrder` Delete (archive) an order by ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.booqable.api.orders.deleteOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: { > id: string, > type: orders, > attributes?: { > }, > relationships?: { > } > }, > included?: { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[], > links?: { > }, > meta?: { > } > } | { > data: null, > links?: { > }, > meta?: { > } > } > ``` *** ### getNewOrder `orders.getNewOrder` Retrieve a new order template with default values. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.orders.getNewOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: orders, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### getOrder `orders.getOrder` Retrieve a specific order by ID. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.orders.getOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: orders, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### listOrders `orders.listOrders` Retrieve a paginated list of orders. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.orders.listOrders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: orders, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### searchOrders `orders.searchOrders` Search orders with advanced filtering. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.orders.searchOrders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: orders, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Payment Methods ### listPaymentMethods `paymentMethods.listPaymentMethods` Retrieve a list of payment methods. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.paymentMethods.listPaymentMethods({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: payment_methods, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Payments ### listPayments `payments.listPayments` List all payments. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.payments.listPayments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: payments, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Photos ### listPhotos `photos.listPhotos` Retrieve a paginated list of photos. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.photos.listPhotos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: photos, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Plannings ### listPlannings `plannings.listPlannings` Retrieve planning records for reservations. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.plannings.listPlannings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: plannings, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### searchPlannings `plannings.searchPlannings` Search plannings with advanced filtering. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.plannings.searchPlannings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: plannings, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Price Rulesets ### listPriceRulesets `priceRulesets.listPriceRulesets` List price rulesets. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.priceRulesets.listPriceRulesets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: price_rulesets, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Price Structures ### listPriceStructures `priceStructures.listPriceStructures` List price structures. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.priceStructures.listPriceStructures({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: price_structures, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Product Groups ### createProductGroup `productGroups.createProductGroup` Create a new product group. **Risk:** `write` ```ts theme={null} await corsair.booqable.api.productGroups.createProductGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: product_groups, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### deleteProductGroup `productGroups.deleteProductGroup` Delete a product group by ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.booqable.api.productGroups.deleteProductGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: { > id: string, > type: product_groups, > attributes?: { > }, > relationships?: { > } > }, > included?: { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[], > links?: { > }, > meta?: { > } > } | { > data: null, > links?: { > }, > meta?: { > } > } > ``` *** ### getProductGroup `productGroups.getProductGroup` Fetch a specific product group by ID. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.productGroups.getProductGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: product_groups, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### listProductGroups `productGroups.listProductGroups` List product groups with filtering and pagination. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.productGroups.listProductGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: product_groups, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Products ### getProduct `products.getProduct` Fetch a specific product by ID. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.products.getProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: products, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### listProducts `products.listProducts` Retrieve a paginated list of products. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.products.listProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: products, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Properties ### listProperties `properties.listProperties` Retrieve a list of custom properties. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.properties.listProperties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: properties, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Provinces ### listProvinces `provinces.listProvinces` Retrieve a list of provinces. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.provinces.listProvinces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: provinces, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Stock Item Plannings ### listStockItemPlannings `stockItemPlannings.listStockItemPlannings` Retrieve stock item plannings. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.stockItemPlannings.listStockItemPlannings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: stock_item_plannings, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Stock Items ### listStockItems `stockItems.listStockItems` Retrieve a list of stock items. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.stockItems.listStockItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: stock_items, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Tax Rates ### listTaxRates `taxRates.listTaxRates` Retrieve a list of tax rates. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.taxRates.listTaxRates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: tax_rates, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Tax Values ### listTaxValues `taxValues.listTaxValues` Retrieve a list of tax values. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.taxValues.listTaxValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: tax_values, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Users ### listUsers `users.listUsers` Retrieve a list of users. **Risk:** `read` ```ts theme={null} await corsair.booqable.api.users.listUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `included` | `object[]` | No | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type: users, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/booqable/database Booqable local sync: searchable entities, `.search()` filters, and operators. The Booqable plugin syncs data locally. Use `corsair.booqable.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/booqable/overview Booqable plugin for Corsair Use **Booqable** through Corsair: one client, typed API calls. **What you get:** * 49 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/booqable ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/booqable ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/booqable ``` ```bash bun theme={null} bun add corsair @corsair-dev/booqable ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { booqable } from '@corsair-dev/booqable'; export const corsair = createCorsair({ plugins: [ booqable(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} booqable() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'booqable', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`barcodes.listBarcodes`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.booqable.api.barcodes.listBarcodes({}); ``` **`companies.updateCompany`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.booqable.api.companies.updateCompany({}); ``` See the full list on the [API](/plugins/booqable/api) page. ## What's next > **[API reference](/plugins/booqable/api)** > > Every `booqable.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/borneo/api API reference for Borneo: every `borneo.api.*` operation with input and output types. Every `borneo.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### getCloudAccountById `accounts.getCloudAccountById` Get cloud account by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.accounts.getCloudAccountById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cloudAccountId` | `string` | Yes | The cloud-provider specific account ID, e.g. a 12-digit AWS account ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > cloudAccountId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postAccountsWithFilterAndSortOptions `accounts.postAccountsWithFilterAndSortOptions` Post accounts with filter and sort options **Risk:** `read` ```ts theme={null} await corsair.borneo.api.accounts.postAccountsWithFilterAndSortOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | Optional "nextToken" value from the last API response. | | `sort__order` | `ASC \| DESC` | No | Order | | `filter__type` | `string` | No | Filter accounts by account type. | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Search for accounts by name. | | `filter__status` | `string[]` | No | Filter accounts by status. | | `filter__accountId` | `string[]` | No | Filter accounts by the Borneo account ID. | | `filter__activeStates` | `boolean` | No | Filters out accounts which are not in deleting or deleted states | | `filter__cloudAccountId` | `string[]` | No | Filter accounts by the cloud-provider specific account ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > filter__type?: string, > sort__column?: string, > filter__search?: string, > filter__status?: string, > filter__accountId?: string, > filter__activeStates?: boolean, > filter__cloudAccountId?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveAccountDetailsById `accounts.retrieveAccountDetailsById` Retrieve account details by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.accounts.retrieveAccountDetailsById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | Yes | The unique Borneo account ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Assets ### createNewAsset `assets.createNewAsset` Create new asset **Risk:** `write` ```ts theme={null} await corsair.borneo.api.assets.createNewAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the asset to create | | `type` | `applications \| cloudServices \| communications \| dataInformation \| externalStorage \| filingRoom \| furniture \| hardware \| hosting \| other \| paperDocumentation \| printer \| server \| shredder \| videoSurveillance` | Yes | Indicates the type of the asset. An asset can be one of the several options. | | `tomIds` | `string[]` | No | Tomids | | `createdAt` | `number` | No | Createdat | | `locationId` | `string` | No | Locationid | | `locationType` | `external \| office \| remote` | No | Locationtype | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > type?: string, > locationType?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteAssetById `assets.deleteAssetById` Delete asset by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.assets.deleteAssetById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | Yes | Identifier of the asset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### filterAndSortAssetsList `assets.filterAndSortAssetsList` Filter and sort assets list **Risk:** `read` ```ts theme={null} await corsair.borneo.api.assets.filterAndSortAssetsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `maxResults` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `sort__order` | `ASC \| DESC` | No | Order | | `filter__type` | `applications \| cloudServices \| communications \| dataInformation \| externalStorage \| filingRoom \| furniture \| hardware \| hosting \| other \| paperDocumentation \| printer \| server \| shredder \| videoSurveillance[]` | No | Type | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the asset name. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > nextToken?: string, > maxResults?: number, > filter__type?: string, > sort__column?: string, > filter__search?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveAssetById `assets.retrieveAssetById` Retrieve asset by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.assets.retrieveAssetById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | Yes | Identifier of the asset | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateAssetInformationById `assets.updateAssetInformationById` Update asset information by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.assets.updateAssetInformationById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the asset | | `type` | `applications \| cloudServices \| communications \| dataInformation \| externalStorage \| filingRoom \| furniture \| hardware \| hosting \| other \| paperDocumentation \| printer \| server \| shredder \| videoSurveillance` | Yes | Indicates the type of the asset. An asset can be one of the several options. | | `tomIds` | `string[]` | No | Tomids | | `assetId` | `string` | Yes | Identifier of the asset | | `locationId` | `string` | No | Locationid | | `locationType` | `external \| office \| remote` | No | Locationtype | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > type?: string, > locationType?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Audit ### listEventsWithFilters `audit.listEventsWithFilters` List events with filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.audit.listEventsWithFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string[]` | No | Select | | `pageSize` | `number` | No | Pagesize | | `nextToken` | `string` | No | Nexttoken | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__scanId` | `string[]` | No | Scanid | | `filter__search` | `string` | No | Search | | `filter__userId` | `string[]` | No | Userid | | `filter__eventId` | `string[]` | No | Eventid | | `filter__issueId` | `string[]` | No | Issueid | | `filter__issueType` | `string[]` | No | Issuetype | | `filter__resourceId` | `string[]` | No | Resourceid | | `filter__newInfotypeFound` | `boolean` | No | Newinfotypefound | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > sort__column?: string, > filter__newInfotypeFound?: boolean, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postFilteredAccessLogs `audit.postFilteredAccessLogs` Post filtered access logs **Risk:** `read` ```ts theme={null} await corsair.borneo.api.audit.postFilteredAccessLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of logs to return per API call. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `filter__end` | `string` | No | List logs ending in between a specific timestamps with nonoseconds eg. 1715076399359944184. | | `filter__email` | `string` | No | Filters all logs with user email eg. "[user@example.com](mailto:user@example.com)". | | `filter__start` | `string` | No | List logs starting in between a specific timestamps with nonoseconds eg. 1715076388657800827. | | `filter__search` | `string` | No | Free-text search on the logs. | | `filter__requestId` | `string` | No | List logs from a specific requestId eg. "clvuywyoq009407rj61sxcrpc" | | `filter__operationName` | `string` | No | List logs based on operation type eg. "ListConnectors", "CreateOktaConnection". | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > filter__end?: string, > filter__email?: string, > filter__start?: string, > filter__search?: string, > filter__requestId?: string, > filter__operationName?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postLogAuditRecordsWithFilterCriteria `audit.postLogAuditRecordsWithFilterCriteria` Post log audit records with filter criteria **Risk:** `read` ```ts theme={null} await corsair.borneo.api.audit.postLogAuditRecordsWithFilterCriteria({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of logs to return per API call. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `filter__end` | `string` | No | List logs ending in between a specific timestamps with nonoseconds eg. 1715076399359944184. | | `filter__start` | `string` | No | List logs starting in between a specific timestamps with nonoseconds eg. 1715076388657800827. | | `filter__scanId` | `string` | No | List logs for a specific scan | | `filter__search` | `string` | No | Free-text search on the logs. | | `filter__category` | `cloudAWS \| cloudAzure \| cloudGCP \| connector \| dataPlane \| notification \| scan` | No | Category | | `filter__accountId` | `string` | No | List logs for a specific AWS account | | `filter__connectorId` | `string` | No | List logs for a specific connector | | `filter__dataPlaneId` | `string` | No | List logs for a specific dataPlane | | `filter__gcpProjectId` | `string` | No | List logs for a specific GCP project | | `filter__gcpConnectionId` | `string` | No | List logs for a specific GCP connection | | `filter__azureConnectionId` | `string` | No | List logs for a specific Azure connection | | `filter__azureSubscriptionId` | `string` | No | List logs for a specific Azure project | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > filter__end?: string, > filter__start?: string, > filter__scanId?: string, > filter__search?: string, > filter__category?: string, > filter__accountId?: string, > filter__connectorId?: string, > filter__dataPlaneId?: string, > filter__gcpProjectId?: string, > filter__gcpConnectionId?: string, > filter__azureConnectionId?: string, > filter__azureSubscriptionId?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Breaches ### deleteDataBreachById `breaches.deleteDataBreachById` Delete data breach by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.breaches.deleteDataBreachById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataBreachId` | `string` | Yes | Databreachid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### evaluateDataBreachImpact `breaches.evaluateDataBreachImpact` Evaluate data breach impact **Risk:** `write` ```ts theme={null} await corsair.borneo.api.breaches.evaluateDataBreachImpact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `controller \| independent_controller \| joint_controller \| processor \| sub_processor` | No | Role of the recipient. | | `evaluation` | `string` | No | Evaluation | | `saveAsDraft` | `boolean` | Yes | Saveasdraft | | `dataBreachId` | `string` | Yes | Identifier of the DataBreach | | `reportLanguage` | `ar \| de \| en \| es \| es-EC \| es-MX \| fr \| hi \| it \| ja \| pt \| zh` | No | Reportlanguage | | `companiesAffected` | `string` | No | Companiesaffected | | `processorNotified` | `boolean` | No | Processornotified | | `dataBreachLocation` | `ourOrganisation \| thirdPartyProcessor` | No | Databreachlocation | | `processorsInvolved` | `string` | No | Processorsinvolved | | `authoritiesNotified` | `boolean` | No | Authoritiesnotified | | `dataBreachController` | `string` | No | Databreachcontroller | | `dataSubjectsNotified` | `boolean` | No | Datasubjectsnotified | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > role?: string, > reportLanguage?: string, > dataBreachLocation?: string, > authoritiesNotified?: boolean, > dataBreachController?: string, > dataSubjectsNotified?: boolean > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### fetchDataBreachEvaluation `breaches.fetchDataBreachEvaluation` Fetch data breach evaluation **Risk:** `read` ```ts theme={null} await corsair.borneo.api.breaches.fetchDataBreachEvaluation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataBreachId` | `string` | Yes | Identifier of the DataBreach | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listDataBreachesWithFilters `breaches.listDataBreachesWithFilters` List data breaches with filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.breaches.listDataBreachesWithFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__owner` | `string[]` | No | Owner | | `filter__search` | `string` | No | Free-form text search to apply to data breaches short description. | | `filter__status` | `string[]` | No | Status | | `filter__authoritiesNotified` | `boolean[]` | No | Authoritiesnotified | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__authoritiesNotified?: boolean, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listDataBreachFilters `breaches.listDataBreachFilters` List data breach filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.breaches.listDataBreachFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filterType` | `owner \| status` | Yes | Filtertype | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postDataBreachInformation `breaches.postDataBreachInformation` Post data breach information **Risk:** `write` ```ts theme={null} await corsair.borneo.api.breaches.postDataBreachInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `ar \| de \| en \| es \| es-EC \| es-MX \| fr \| hi \| it \| ja \| pt \| zh` | No | Language | | `createdAt` | `number` | No | Createdat | | `createdBy` | `string` | No | Createdby | | `kindOfData` | `string` | No | Kindofdata | | `occurredAt` | `number` | No | Occurredat | | `description` | `string` | No | Description | | `saveAsDraft` | `boolean` | Yes | Saveasdraft | | `consequences` | `string` | No | Consequences | | `discoveredAt` | `number` | No | Discoveredat | | `howDiscovered` | `string` | No | Howdiscovered | | `peopleInformed` | `string` | No | Peopleinformed | | `wasIntentional` | `string` | No | Wasintentional | | `shortDescription` | `string` | Yes | Shortdescription | | `measuresToPrevent` | `string` | No | Measurestoprevent | | `affectedPeopleFrom` | `string` | No | Affectedpeoplefrom | | `authoritiesInformed` | `string` | No | Authoritiesinformed | | `numberAffectedPeople` | `number` | No | Numberaffectedpeople | | `additionalInformation` | `string[]` | No | Additionalinformation | | `profilePeopleAffected` | `string` | No | Profilepeopleaffected | | `compromisedSensitiveData` | `string` | No | Compromisedsensitivedata | | `problemOfSecurityMeasures` | `string` | No | Problemofsecuritymeasures | | `securityMeasuresOrProtocols` | `string` | No | Securitymeasuresorprotocols | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > language?: string, > authoritiesInformed?: string, > numberAffectedPeople?: number, > additionalInformation?: string, > profilePeopleAffected?: string, > compromisedSensitiveData?: string, > problemOfSecurityMeasures?: string, > securityMeasuresOrProtocols?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveDataBreachById `breaches.retrieveDataBreachById` Retrieve data breach by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.breaches.retrieveDataBreachById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataBreachId` | `string` | Yes | Identifier of the DataBreach | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateDataBreachEntry `breaches.updateDataBreachEntry` Update data breach entry **Risk:** `write` ```ts theme={null} await corsair.borneo.api.breaches.updateDataBreachEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `createdBy` | `string` | No | Createdby | | `kindOfData` | `string` | No | Kindofdata | | `occurredAt` | `number` | No | Occurredat | | `description` | `string` | No | Description | | `saveAsDraft` | `boolean` | Yes | Saveasdraft | | `consequences` | `string` | No | Consequences | | `dataBreachId` | `string` | Yes | Identifier of the DataBreach | | `discoveredAt` | `number` | No | Discoveredat | | `howDiscovered` | `string` | No | Howdiscovered | | `peopleInformed` | `string` | No | Peopleinformed | | `wasIntentional` | `string` | No | Wasintentional | | `shortDescription` | `string` | Yes | Shortdescription | | `measuresToPrevent` | `string` | No | Measurestoprevent | | `affectedPeopleFrom` | `string` | No | Affectedpeoplefrom | | `authoritiesInformed` | `string` | No | Authoritiesinformed | | `numberAffectedPeople` | `number` | No | Numberaffectedpeople | | `additionalInformation` | `string[]` | No | Additionalinformation | | `profilePeopleAffected` | `string` | No | Profilepeopleaffected | | `compromisedSensitiveData` | `string` | No | Compromisedsensitivedata | | `problemOfSecurityMeasures` | `string` | No | Problemofsecuritymeasures | | `securityMeasuresOrProtocols` | `string` | No | Securitymeasuresorprotocols | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > authoritiesInformed?: string, > numberAffectedPeople?: number, > additionalInformation?: string, > profilePeopleAffected?: string, > compromisedSensitiveData?: string, > problemOfSecurityMeasures?: string, > securityMeasuresOrProtocols?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Categories ### createNewInfotypeCategory `categories.createNewInfotypeCategory` Create new infotype category **Risk:** `write` ```ts theme={null} await corsair.borneo.api.categories.createNewInfotypeCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `infotypes` | `string[]` | Yes | The list of infotypes that belong to this category. | | `description` | `string` | No | Description of the infotype category. | | `categoryLabel` | `string` | Yes | The name of the infotype category. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > infotypes?: string, > description?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteCategoryByLabel `categories.deleteCategoryByLabel` Delete category by label **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.categories.deleteCategoryByLabel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `categoryLabel` | `string` | Yes | The name of the infotype category. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### getCategoryByLabel `categories.getCategoryByLabel` Get category by label **Risk:** `read` ```ts theme={null} await corsair.borneo.api.categories.getCategoryByLabel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `categoryLabel` | `string` | Yes | The name of the infotype category. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateCategoryInfotypes `categories.updateCategoryInfotypes` Update category infotypes **Risk:** `write` ```ts theme={null} await corsair.borneo.api.categories.updateCategoryInfotypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `infotypes` | `string[]` | Yes | The list of infotypes that belong to this category. | | `description` | `string` | No | The description of the infotype category. | | `categoryLabel` | `string` | Yes | The name of the infotype category. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > infotypes?: string, > description?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Connectors ### postConnectorWithFilteringOptions `connectors.postConnectorWithFilteringOptions` Post connector with filtering options **Risk:** `read` ```ts theme={null} await corsair.borneo.api.connectors.postConnectorWithFilteringOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | Optional "nextToken" value from the last API response. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__names` | `string[]` | No | Filter based on connector name. | | `filter__search` | `string` | No | Search for connectors by name. | | `filter__states` | `string[]` | No | Filter based on connector state. | | `filter__resourceIds` | `string[]` | No | Filter based on the resource ID of the data source instance associated with the connector. | | `filter__activeStates` | `boolean` | No | Filters out connectors which are not in destroying or destroyed states | | `filter__connectorIds` | `string[]` | No | Filter based on the connector IDs. | | `filter__dataPlaneIds` | `string[]` | No | Filter based on the data plane in which the connector is deployed. | | `filter__resourceTypes` | `string[]` | No | Filter based on the resource type that the connector supports. | | `filter__connectorTypes` | `string[]` | No | Filter based on the connector type. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__names?: string, > filter__search?: string, > filter__states?: string, > filter__resourceIds?: string, > filter__activeStates?: boolean, > filter__connectorIds?: string, > filter__dataPlaneIds?: string, > filter__resourceTypes?: string, > filter__connectorTypes?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveConnectorById `connectors.retrieveConnectorById` Retrieve connector by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.connectors.retrieveConnectorById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectorId` | `string` | Yes | The unique Borneo connector ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Dashboard ### createDashboardUser `dashboard.createDashboardUser` Create dashboard user **Risk:** `write` ```ts theme={null} await corsair.borneo.api.dashboard.createDashboardUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | Name | | `email` | `string` | Yes | Email | | `roles` | `borneo_admin \| borneo_analyst \| borneo_engineer \| compliance_engineer \| data_engineer \| department_coordinator \| no_access_role \| privacy_supervisor[]` | No | Roles | | `filter__id` | `string` | No | Id | | `filter__type` | `GCP \| OKTA` | No | Type | | `organisations` | `object[]` | No | Organisations | > **organisations full type** > > ```ts theme={null} > { > roles: borneo_admin | borneo_analyst | borneo_engineer | compliance_engineer | data_engineer | department_coordinator | no_access_role | privacy_supervisor[], > departments?: string[], > organisationId?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > roles?: string, > organisations?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteDashboardReportById `dashboard.deleteDashboardReportById` Delete dashboard report by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.dashboard.deleteDashboardReportById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dashboardReportId` | `string` | Yes | Dashboardreportid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### disableDashboardUserByUsername `dashboard.disableDashboardUserByUsername` Disable dashboard user by username **Risk:** `write` ```ts theme={null} await corsair.borneo.api.dashboard.disableDashboardUserByUsername({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | Username | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### downloadDashboardReport `dashboard.downloadDashboardReport` Download dashboard report **Risk:** `read` ```ts theme={null} await corsair.borneo.api.dashboard.downloadDashboardReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reportType` | `DATA_DISCOVERY_DASHBOARD \| PRIVACY_OPS_DASHBOARD \| PRIVACY_OPS_DATA_FLOW` | Yes | Reporttype | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > reportType?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### downloadDashboardReportEdition `dashboard.downloadDashboardReportEdition` Download dashboard report edition **Risk:** `read` ```ts theme={null} await corsair.borneo.api.dashboard.downloadDashboardReportEdition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reportEditionId` | `string` | Yes | Reporteditionid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### enableDashboardUser `dashboard.enableDashboardUser` Enable dashboard user **Risk:** `write` ```ts theme={null} await corsair.borneo.api.dashboard.enableDashboardUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | Username | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### fetchDashboardReportById `dashboard.fetchDashboardReportById` Fetch dashboard report by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.dashboard.fetchDashboardReportById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dashboardReportId` | `string` | Yes | Dashboardreportid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### getDashboardReportEditionById `dashboard.getDashboardReportEditionById` Get dashboard report edition by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.dashboard.getDashboardReportEditionById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reportEditionId` | `string` | Yes | Reporteditionid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listDashboardReportEditions `dashboard.listDashboardReportEditions` List dashboard report editions **Risk:** `read` ```ts theme={null} await corsair.borneo.api.dashboard.listDashboardReportEditions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | Nexttoken | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `dashboardReportId` | `string` | Yes | The `nextToken` from the last page of results to retrieve the next page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > sort__column?: string, > dashboardReportId?: string, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listDashboardReportsWithFilters `dashboard.listDashboardReportsWithFilters` List dashboard reports with filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.dashboard.listDashboardReportsWithFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `filter__type` | `DATA_DISCOVERY_DASHBOARD \| PRIVACY_OPS_DASHBOARD \| PRIVACY_OPS_DATA_FLOW[]` | No | Type | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the scan name. | | `filter__frequency` | `*/30 * * * * \| 0 */1 * * * \| 0 */12 * * * \| 0 */4 * * * \| 0 */6 * * * \| 0 */8 * * * \| 0 0 * * * \| 0 0 * * 0 \| 0 0 1 * * \| 0 0 1 1,4,7,10 * \| 0 0 1 1,7 *[]` | No | Frequency | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > filter__type?: string, > sort__column?: string, > filter__search?: string, > filter__frequency?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listDashboardUsersWithFilters `dashboard.listDashboardUsersWithFilters` List dashboard users with filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.dashboard.listDashboardUsersWithFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter__roles` | `borneo_admin \| borneo_analyst \| borneo_engineer \| compliance_engineer \| data_engineer \| department_coordinator \| no_access_role \| privacy_supervisor[]` | No | Roles | | `filter__tenantId` | `string` | No | Tenantid | | `filter__departments` | `string[]` | No | Departments | | `filter__organisationId` | `number` | No | Organisationid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > filter__roles?: string, > filter__departments?: string, > filter__organisationId?: number, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postCurrentDashboardUser `dashboard.postCurrentDashboardUser` Post current dashboard user **Risk:** `read` ```ts theme={null} await corsair.borneo.api.dashboard.postCurrentDashboardUser({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postDashboardReport `dashboard.postDashboardReport` Post dashboard report **Risk:** `write` ```ts theme={null} await corsair.borneo.api.dashboard.postDashboardReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name | | `roles` | `borneo_admin \| borneo_analyst \| borneo_engineer \| compliance_engineer \| data_engineer \| department_coordinator \| no_access_role \| privacy_supervisor[]` | No | Roles | | `status` | `DELETED \| ONCE \| SCHEDULED` | Yes | Status | | `createdBy` | `string` | No | Createdby | | `frequency` | `*/30 * * * * \| 0 */1 * * * \| 0 */12 * * * \| 0 */4 * * * \| 0 */6 * * * \| 0 */8 * * * \| 0 0 * * * \| 0 0 * * 0 \| 0 0 1 * * \| 0 0 1 1,4,7,10 * \| 0 0 1 1,7 *` | No | The cron schedule expression to use for a recurring scan. Only a fixed set of cron expressions can be used to run scans at 30 minute, 1 hour, 1 day, or 1 week intervals. | | `reportTypes` | `DATA_DISCOVERY_DASHBOARD \| PRIVACY_OPS_DASHBOARD \| PRIVACY_OPS_DATA_FLOW[]` | Yes | Reporttypes | | `externalEmail` | `string[]` | No | Externalemail | | `recipientsEmail` | `string[]` | No | Recipientsemail | | `triggerImmediately` | `boolean` | Yes | Triggerimmediately | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > roles?: string, > frequency?: string, > reportTypes?: string, > recipientsEmail?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### removeDashboardUserByUsername `dashboard.removeDashboardUserByUsername` Remove dashboard user by username **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.dashboard.removeDashboardUserByUsername({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | Username | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### resetDashboardUserPassword `dashboard.resetDashboardUserPassword` Reset dashboard user password **Risk:** `write` ```ts theme={null} await corsair.borneo.api.dashboard.resetDashboardUserPassword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | Username | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### triggerDashboardReportByReportId `dashboard.triggerDashboardReportByReportId` Trigger dashboard report by report id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.dashboard.triggerDashboardReportByReportId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dashboardReportId` | `string` | Yes | Dashboardreportid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateDashboardUserDetails `dashboard.updateDashboardUserDetails` Update dashboard user details **Risk:** `write` ```ts theme={null} await corsair.borneo.api.dashboard.updateDashboardUserDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name | | `username` | `string` | Yes | Username | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateDashboardUserRoles `dashboard.updateDashboardUserRoles` Update dashboard user roles **Risk:** `write` ```ts theme={null} await corsair.borneo.api.dashboard.updateDashboardUserRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | Username | | `organisations` | `object[]` | Yes | Organisations | > **organisations full type** > > ```ts theme={null} > { > roles: borneo_admin | borneo_analyst | borneo_engineer | compliance_engineer | data_engineer | department_coordinator | no_access_role | privacy_supervisor[], > departments?: string[], > organisationId?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > organisations?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Departments ### createDepartmentWithTranslations `departments.createDepartmentWithTranslations` Create department with translations **Risk:** `write` ```ts theme={null} await corsair.borneo.api.departments.createDepartmentWithTranslations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | Name | | `translations` | `object` | No | Translations | > **translations full type** > > ```ts theme={null} > { > additionalProperties?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > translations?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteDepartmentById `departments.deleteDepartmentById` Delete department by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.departments.deleteDepartmentById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `departmentId` | `string` | Yes | Identifier of the department. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### getDepartmentFilterList `departments.getDepartmentFilterList` Get department filter list **Risk:** `read` ```ts theme={null} await corsair.borneo.api.departments.getDepartmentFilterList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listDepartmentsWithSortAndPagination `departments.listDepartmentsWithSortAndPagination` List departments with sort and pagination **Risk:** `read` ```ts theme={null} await corsair.borneo.api.departments.listDepartmentsWithSortAndPagination({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the department name. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveDepartmentInformation `departments.retrieveDepartmentInformation` Retrieve department information **Risk:** `read` ```ts theme={null} await corsair.borneo.api.departments.retrieveDepartmentInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `departmentId` | `string` | Yes | Identifier of the department. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateDepartmentName `departments.updateDepartmentName` Update department name **Risk:** `write` ```ts theme={null} await corsair.borneo.api.departments.updateDepartmentName({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | Name | | `departmentId` | `string` | Yes | Identifier of the department. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Documents ### createLegalDocumentEntry `documents.createLegalDocumentEntry` Create legal document entry **Risk:** `write` ```ts theme={null} await corsair.borneo.api.documents.createLegalDocumentEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name | | `type` | `DATA_PROCESSING \| PRIVACY_POLICY` | No | Type | | `region` | `string` | Yes | Region | | `source` | `string` | No | Source | | `documentLink` | `string` | Yes | Documentlink | | `isDiscoverInfotype` | `boolean` | Yes | Isdiscoverinfotype | | `fromDiscoveredDocumentId` | `string` | No | Fromdiscovereddocumentid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > type?: string, > fromDiscoveredDocumentId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteLegalDocumentById `documents.deleteLegalDocumentById` Delete legal document by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.documents.deleteLegalDocumentById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | Documentid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listDiscoveredDocument `documents.listDiscoveredDocument` List discovered document **Risk:** `read` ```ts theme={null} await corsair.borneo.api.documents.listDiscoveredDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the scan name. | | `filter__status` | `ADDED \| DELETED \| DOMAIN_DELETED \| IGNORED \| NEW` | No | Status | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__status?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listLegalDocumentsWithPagination `documents.listLegalDocumentsWithPagination` List legal documents with pagination **Risk:** `read` ```ts theme={null} await corsair.borneo.api.documents.listLegalDocumentsWithPagination({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the scan name. | | `filter__status` | `CREATED \| DELETED \| SCANNING` | No | Status | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__status?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveDiscoveredDocumentById `documents.retrieveDiscoveredDocumentById` Retrieve discovered document by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.documents.retrieveDiscoveredDocumentById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `discoveredDocumentId` | `string` | Yes | Discovereddocumentid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveLegalDocumentById `documents.retrieveLegalDocumentById` Retrieve legal document by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.documents.retrieveLegalDocumentById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | Documentid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateDiscoveredDocumentStatus `documents.updateDiscoveredDocumentStatus` Update discovered document status **Risk:** `write` ```ts theme={null} await corsair.borneo.api.documents.updateDiscoveredDocumentStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ADDED \| DELETED \| DOMAIN_DELETED \| IGNORED \| NEW` | Yes | Status | | `discoveredDocumentId` | `string` | Yes | Discovereddocumentid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Domains ### createDomainWithPollingFrequency `domains.createDomainWithPollingFrequency` Create domain with polling frequency **Risk:** `write` ```ts theme={null} await corsair.borneo.api.domains.createDomainWithPollingFrequency({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the domain. | | `frequency` | `12h \| 1d \| 1w \| 30d \| 6h \| manual` | Yes | Frequency of polling for a domain. Manual polling means that this domain will not be polled automatically. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > frequency?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteDomainById `domains.deleteDomainById` Delete domain by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.domains.deleteDomainById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainId` | `string` | Yes | Identifier of the domain. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### getDomainById `domains.getDomainById` Get domain by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.domains.getDomainById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainId` | `string` | Yes | Identifier of the domain. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listDomainsWithPaginationAndSorting `domains.listDomainsWithPaginationAndSorting` List domains with pagination and sorting **Risk:** `read` ```ts theme={null} await corsair.borneo.api.domains.listDomainsWithPaginationAndSorting({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### pollDomainById `domains.pollDomainById` Poll domain by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.domains.pollDomainById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainId` | `string` | Yes | Identifier of the domain. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateDomainDetails `domains.updateDomainDetails` Update domain details **Risk:** `write` ```ts theme={null} await corsair.borneo.api.domains.updateDomainDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the domain. | | `domainId` | `string` | Yes | Identifier of the domain. | | `frequency` | `12h \| 1d \| 1w \| 30d \| 6h \| manual` | Yes | Frequency of polling for a domain. Manual polling means that this domain will not be polled automatically. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > frequency?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Employees ### createEmployeeWithJsonPayload `employees.createEmployeeWithJsonPayload` Create employee with json payload **Risk:** `write` ```ts theme={null} await corsair.borneo.api.employees.createEmployeeWithJsonPayload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nif` | `string` | No | The NIF of the employee | | `name` | `string` | Yes | The name of the employee | | `email` | `string` | No | the email of the employee | | `endDate` | `string` | No | Date when the employee end to work in your company | | `manager` | `string` | No | employeeId of the employee who is manager of the employee | | `surname` | `string` | Yes | The surname of the employee | | `position` | `string` | No | The position of the employee in the company. | | `createdBy` | `string` | Yes | Createdby | | `startDate` | `string` | No | Date when the employee began to work in your company | | `department` | `string` | No | the department of the employee | | `referenceId` | `string` | No | Internal identifier to synchronize with external APIS | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > endDate?: string, > manager?: string, > position?: string, > startDate?: string, > department?: string, > referenceId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteEmployeeById `employees.deleteEmployeeById` Delete employee by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.employees.deleteEmployeeById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `employeeId` | `string` | Yes | Identifier of the employee | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### filterEmployeeList `employees.filterEmployeeList` Filter employee list **Risk:** `read` ```ts theme={null} await corsair.borneo.api.employees.filterEmployeeList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the employee name. | | `filter__department` | `string[]` | No | Department | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listEmployeesWithFilters `employees.listEmployeesWithFilters` List employees with filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.employees.listEmployeesWithFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the employee name. | | `filter__department` | `string[]` | No | Department | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveEmployeeDetailsById `employees.retrieveEmployeeDetailsById` Retrieve employee details by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.employees.retrieveEmployeeDetailsById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `employeeId` | `string` | Yes | Identifier of the employee | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateEmployeeById `employees.updateEmployeeById` Update employee by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.employees.updateEmployeeById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nif` | `string` | No | The NIF (Spanish Tax Identification Number) of the employee | | `name` | `string` | No | The name of the employee | | `email` | `string` | No | The email of the employee. Has to be unique within the company. | | `endDate` | `string` | No | Date when the employee end to work in your company | | `manager` | `string` | No | The employee"s direct manager. | | `surname` | `string` | No | The surname of the employee | | `position` | `string` | No | The position in the company of the employee | | `startDate` | `string` | No | Date when the employee began to work in your company | | `department` | `string` | No | The department of the employee | | `employeeId` | `string` | Yes | Identifier of the employee | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > nif?: string, > email?: string, > endDate?: string, > position?: string, > startDate?: string, > department?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Headquarters ### createHeadquarterEntry `headquarters.createHeadquarterEntry` Create headquarter entry **Risk:** `write` ```ts theme={null} await corsair.borneo.api.headquarters.createHeadquarterEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `city` | `string` | Yes | The locality of the headquarter | | `name` | `string` | Yes | The name of the headquarter | | `tomIds` | `string[]` | No | Tomids | | `address` | `string` | Yes | The address of the headquarter | | `country` | `string` | Yes | 2 letter code that identifies a country. | | `zipcode` | `string` | No | The zipcode of the headquarter | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteHeadquartersById `headquarters.deleteHeadquartersById` Delete headquarters by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.headquarters.deleteHeadquartersById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `headquarterId` | `string` | Yes | The identifier of the headquarter | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### getHeadquartersById `headquarters.getHeadquartersById` Get headquarters by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.headquarters.getHeadquartersById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `headquarterId` | `string` | Yes | The identifier of the headquarter | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listHeadquartersWithSorting `headquarters.listHeadquartersWithSorting` List headquarters with sorting **Risk:** `read` ```ts theme={null} await corsair.borneo.api.headquarters.listHeadquartersWithSorting({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateHeadquarterDetailsById `headquarters.updateHeadquarterDetailsById` Update headquarter details by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.headquarters.updateHeadquarterDetailsById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `city` | `string` | Yes | The locality of the headquarter | | `name` | `string` | Yes | The name of the headquarter | | `tomIds` | `string[]` | No | Tomids | | `address` | `string` | Yes | The address of the headquarter | | `country` | `string` | Yes | 2 letter code that identifies a country. | | `zipcode` | `string` | No | The zipcode of the headquarter | | `headquarterId` | `string` | Yes | The identifier of the headquarter | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Infotypes ### listDiscoveredInfotypes `infotypes.listDiscoveredInfotypes` List discovered infotypes **Risk:** `read` ```ts theme={null} await corsair.borneo.api.infotypes.listDiscoveredInfotypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the scan name. | | `filter__status` | `APPROVED \| APPROVED_AUTOMATICALLY \| DELETED \| IGNORED \| NEW \| NOT_PRESENT \| REQUESTED` | No | Status | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__status?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveDiscoveredInfotypeById `infotypes.retrieveDiscoveredInfotypeById` Retrieve discovered infotype by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.infotypes.retrieveDiscoveredInfotypeById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `discoveredInfotypeId` | `string` | Yes | Discoveredinfotypeid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateDiscoveredInfotypeStatus `infotypes.updateDiscoveredInfotypeStatus` Update discovered infotype status **Risk:** `write` ```ts theme={null} await corsair.borneo.api.infotypes.updateDiscoveredInfotypeStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `APPROVED \| APPROVED_AUTOMATICALLY \| DELETED \| IGNORED \| NEW \| NOT_PRESENT \| REQUESTED` | Yes | Status | | `discoveredInfotypeId` | `string` | Yes | Discoveredinfotypeid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Misc ### listFilteredSortedCategories `misc.listFilteredSortedCategories` List filtered sorted categories **Risk:** `read` ```ts theme={null} await corsair.borneo.api.misc.listFilteredSortedCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__categories` | `string[]` | No | Categories | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > sort__column?: string, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listIssuesWithFilters `misc.listIssuesWithFilters` List issues with filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.misc.listIssuesWithFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string[]` | No | List of column names to include in the response. | | `include` | `object` | No | The set of related resources that should be included in the response using a join-query. | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-text search on the resource name. | | `filter__states` | `string[]` | No | List of isssue states to filter by. | | `filter__resources` | `string[]` | No | List of resource IDs to filter by. | | `filter__severities` | `string[]` | No | List of issue severities to filter by. | | `filter__resourceTypes` | `string[]` | No | List of resource types to filter by. | | `filter__failedControls` | `string[]` | No | List of failed controls to filter by. | | `filter__cloudAccountIds` | `string[]` | No | List of cloud provider account IDs to filter by. | | `filter__cloudAccountTypes` | `string[]` | No | List of cloud provider account types to filter by. | > **include full type** > > ```ts theme={null} > { > additionalProperties?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > select?: string, > include?: boolean, > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__states?: string, > filter__resources?: string, > filter__severities?: string, > filter__resourceTypes?: string, > filter__failedControls?: string, > filter__cloudAccountIds?: string, > filter__cloudAccountTypes?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveErrorDetailsById `misc.retrieveErrorDetailsById` Retrieve error details by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.misc.retrieveErrorDetailsById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `errorId` | `string` | Yes | The unique resource ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveIssueById `misc.retrieveIssueById` Retrieve issue by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.misc.retrieveIssueById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issueId` | `string` | Yes | The unique issue ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### submitChatFeedback `misc.submitChatFeedback` Submit chat feedback **Risk:** `write` ```ts theme={null} await corsair.borneo.api.misc.submitChatFeedback({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `postId` | `string` | No | Postid | | `rating` | `number` | No | Rating | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Processing ### createDpiaForProcessingActivity `processing.createDpiaForProcessingActivity` Create dpia for processing activity **Risk:** `write` ```ts theme={null} await corsair.borneo.api.processing.createDpiaForProcessingActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `activated \| draft` | Yes | The status of the DPIA. If a DPIA is saved as activated, several fields are required | | `createdAt` | `number` | No | Createdat | | `updatedAt` | `number` | No | Updatedat | | `translations` | `object` | No | Translations | | `integrity__impacts` | `object[]` | No | List of impacts that integrity risk can have. At least one element is necessary DPIA is saved as activated | | `integrity__threats` | `object[]` | No | List of threats that integrity risk can have. At least one element is necessary DPIA is saved as activated | | `processingActivityId` | `string` | Yes | Identifier of the processing activity for which we are creating a DPIA | | `additionalInformation` | `string` | No | Additionalinformation | | `availability__impacts` | `object[]` | No | List of impacts that availability risk can have. At least one element is necessary DPIA is saved as activated | | `availability__threats` | `object[]` | No | List of threats that availability risk can have. At least one element is necessary DPIA is saved as activated | | `integrity__plannedToms` | `string[]` | No | List of TOMs that are planned to be implemented to prevent integrity risk. At least one element is necessary DPIA is saved as activated | | `integrity__riskSources` | `object[]` | No | List of risk sources that integrity risk can have. At least one element is necessary DPIA is saved as activated | | `confidentiality__impacts` | `object[]` | No | List of impacts that confidentiality risk can have. At least one element is necessary DPIA is saved as activated | | `confidentiality__threats` | `object[]` | No | List of threats that confidentiality risk can have. At least one element is necessary DPIA is saved as activated | | `availability__plannedToms` | `string[]` | No | List of TOMs planned to be implemented and that applies to the availability risk. At least one element is necessary DPIA is saved as activated | | `availability__riskSources` | `object[]` | No | List of risk sources that availability risk can have. At least one element is necessary DPIA is saved as activated | | `integrity__impactsComment` | `string` | No | Comment to add additional information about the integrity impacts | | `integrity__threatsComment` | `string` | No | Comment to add additional information about the integrity threats | | `privacyFramework__consent` | `string` | No | Field to describe the measures to ensure that the consent of the data subjects has been obtained and how the given consent can be revoked Mandatory if DPIA is saved as activated and the lawfulness "consent\_person\_concerned" selected | | `additionalInformationFiles` | `string[]` | No | Additionalinformationfiles | | `integrity__baselineComment` | `string` | No | Comment to add additional information about the baseline risk of the integrity | | `integrity__implementedToms` | `string[]` | No | List of TOMs that are implemented to prevent integrity risk. At least one element is necessary DPIA is saved as activated | | `privacyFramework__accuracy` | `string` | No | Field to explain if the data processed is accurate, high quality and up-to-date Mandatory if DPIA is saved as activated | | `integrity__baselineSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `privacyFramework__retention` | `boolean` | No | Is the retention period lawful and clearly defined? Mandatory if DPIA is saved as activated | | `availability__impactsComment` | `string` | No | Comment to add additional information about the impact | | `availability__threatsComment` | `string` | No | Comment to add additional information about the threat | | `confidentiality__plannedToms` | `string[]` | No | List of TOMs that are planned to be implemented to prevent confidentiality risk. At least one element is necessary DPIA is saved as activated | | `confidentiality__riskSources` | `object[]` | No | List of risk sources that confidentiality risk can have. At least one element is necessary DPIA is saved as activated | | `availability__baselineComment` | `string` | No | Comment to add additional information about the baseline risk of the availablity | | `availability__implementedToms` | `string[]` | No | List of implemented TOMs that applies to the availability risk. At least one element is necessary DPIA is saved as activated | | `integrity__baselineLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Baselinelikelihood | | `integrity__plannedTomsComment` | `string` | No | Comment to add additional information about planned TOMs to prevent integrity risk | | `integrity__riskSourcesComment` | `string` | No | Comment to add additional information about the integrity risk sources | | `availability__baselineSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `integrity__residualRiskComment` | `string` | No | Comment to add additional information about the residual risk of the integrity | | `privacyFramework__transparency` | `string` | No | Field to describe what kind of notice information is given to data subjects about this processing, and how is it provided to the data subjects? Mandatory if DPIA is saved as activated | | `confidentiality__impactsComment` | `string` | No | Comment to add additional information about the confidentiality risk impacts | | `confidentiality__threatsComment` | `string` | No | Comment to add additional information about the confidentiality risk threats | | `integrity__residualRiskSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `availability__baselineLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Baselinelikelihood | | `availability__plannedTomsComment` | `string` | No | Comment to add additional information about the planned TOMs | | `availability__riskSourcesComment` | `string` | No | Comment to add additional information about the availability risk sources | | `confidentiality__baselineComment` | `string` | No | Comment to add additional information about the baseline risk of the confidentiality | | `confidentiality__implementedToms` | `string[]` | No | List of TOMs that are implemented to prevent confidentiality risk. At least one element is necessary DPIA is saved as activated | | `availability__residualRiskComment` | `string` | No | Comment to add additional information about the residual risk of the availability | | `confidentiality__baselineSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `integrity__implementedTomsComment` | `string` | No | Comment to add additional information about implemented TOMs to prevent integrity risk | | `integrity__residualRiskLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Residualrisklikelihood | | `availability__residualRiskSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `privacyFramework__dataMinimisation` | `string` | No | Field to explain if the data collected adequate, relevant, and limited to what is necessary concerning the purposes for which it is processed Mandatory if DPIA is saved as activated | | `privacyFramework__retentionComment` | `string` | No | Field to add comment on the retention period | | `confidentiality__baselineLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Baselinelikelihood | | `confidentiality__plannedTomsComment` | `string` | No | Comment to add additional information about planned TOMs to prevent confidentiality risk | | `confidentiality__riskSourcesComment` | `string` | No | Comment to add additional information about the confidentiality risk sources | | `privacyFramework__additionalComment` | `string` | No | Field to add more information related to the privacy framework of the DPIA | | `privacyFramework__purposeLimitation` | `string` | No | Field to explain the clear, specific and legitimate purpose of conducting the processing activity. Mandatory if DPIA is saved as activated | | `availability__implementedTomsComment` | `string` | No | Comment to add additional information about the implemented TOMs | | `availability__residualRiskLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Residualrisklikelihood | | `confidentiality__residualRiskComment` | `string` | No | Comment to add additional information about the residual risk of the confidentiality | | `confidentiality__residualRiskSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `privacyFramework__dataRightsExercised` | `string` | No | Field to describe how do data subjects exercise their data subject rights? Mandatory if DPIA is saved as activated | | `confidentiality__implementedTomsComment` | `string` | No | Comment to add additional information about implemented TOMs to prevent confidentiality risk | | `confidentiality__residualRiskLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Residualrisklikelihood | > **translations full type** > > ```ts theme={null} > { > additionalProperties?: { > } > } > ``` > **integrity\_\_impacts full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **integrity\_\_threats full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **availability\_\_impacts full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **availability\_\_threats full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **integrity\_\_riskSources full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **confidentiality\_\_impacts full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **confidentiality\_\_threats full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **availability\_\_riskSources full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **confidentiality\_\_riskSources full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string, > translations?: string, > integrity__impacts?: string, > integrity__threats?: string, > processingActivityId?: string, > additionalInformation?: string, > availability__impacts?: string, > availability__threats?: string, > integrity__plannedToms?: string, > integrity__riskSources?: string, > confidentiality__impacts?: string, > confidentiality__threats?: string, > availability__plannedToms?: string, > availability__riskSources?: string, > integrity__impactsComment?: string, > integrity__threatsComment?: string, > privacyFramework__consent?: string, > additionalInformationFiles?: string, > integrity__baselineComment?: string, > integrity__implementedToms?: string, > privacyFramework__accuracy?: string, > integrity__baselineSeverity?: string, > privacyFramework__retention?: boolean, > availability__impactsComment?: string, > availability__threatsComment?: string, > confidentiality__plannedToms?: string, > confidentiality__riskSources?: string, > availability__baselineComment?: string, > availability__implementedToms?: string, > integrity__baselineLikelihood?: string, > integrity__plannedTomsComment?: string, > integrity__riskSourcesComment?: string, > availability__baselineSeverity?: string, > integrity__residualRiskComment?: string, > privacyFramework__transparency?: string, > confidentiality__impactsComment?: string, > confidentiality__threatsComment?: string, > integrity__residualRiskSeverity?: string, > availability__baselineLikelihood?: string, > availability__plannedTomsComment?: string, > availability__riskSourcesComment?: string, > confidentiality__baselineComment?: string, > confidentiality__implementedToms?: string, > availability__residualRiskComment?: string, > confidentiality__baselineSeverity?: string, > integrity__implementedTomsComment?: string, > integrity__residualRiskLikelihood?: string, > availability__residualRiskSeverity?: string, > privacyFramework__dataMinimisation?: string, > privacyFramework__retentionComment?: string, > confidentiality__baselineLikelihood?: string, > confidentiality__plannedTomsComment?: string, > confidentiality__riskSourcesComment?: string, > privacyFramework__additionalComment?: string, > privacyFramework__purposeLimitation?: string, > availability__implementedTomsComment?: string, > availability__residualRiskLikelihood?: string, > confidentiality__residualRiskComment?: string, > confidentiality__residualRiskSeverity?: string, > privacyFramework__dataRightsExercised?: string, > confidentiality__implementedTomsComment?: string, > confidentiality__residualRiskLikelihood?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### createProcessingActivity `processing.createProcessingActivity` Create processing activity **Risk:** `write` ```ts theme={null} await corsair.borneo.api.processing.createProcessingActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the processing activity | | `owner` | `string` | No | Owner | | `active` | `boolean` | Yes | Flag to create the processing activity as activated or draft | | `assets` | `string[]` | No | List assets ids related to the processing activity. | | `modelId` | `string` | No | Modelid | | `purpose` | `string` | No | Purpose | | `language` | `ar \| de \| en \| es \| es-EC \| es-MX \| fr \| hi \| it \| ja \| pt \| zh` | No | Language | | `createdAt` | `number` | No | Createdat | | `dataTypes` | `string[]` | No | Datatypes | | `infotypes` | `string[]` | No | List of info types related with the processing activity. | | `updatedAt` | `number` | No | Updatedat | | `recipients` | `object[]` | No | List of recipients related with the processing activity. | | `companyRole` | `controller \| independent_controller \| joint_controller \| processor \| sub_processor[]` | No | Companyrole | | `dataSources` | `string[]` | No | Datasources | | `departments` | `string[]` | No | List departments related with the processing activity. | | `lawfulBasis` | `object[]` | No | List of Lawfulness types affected by a processing activity | | `dataSubjects` | `string[]` | No | List of Data Subjects affected by the processing activity | | `isDataStored` | `boolean` | No | Indicates if you store the data. | | `translations` | `object` | No | Translations | | `contactPerson` | `string` | No | Contact person for the processing activity. | | `additionalInfo` | `string` | No | Text to add more information about the processing activity | | `infotypeVolume` | `0-1000 \| 1000-10000 \| 10000-100000 \| 100000+` | No | Ranges of the processed infotype volume. | | `managementMethods` | `object[]` | No | Managementmethods | | `infotypeCategories` | `string[]` | No | List of info types categories related with the processing activity. | | `showOnRopaDocument` | `boolean` | No | Showonropadocument | | `additionalInfoFiles` | `string[]` | No | List of uploaded file ids. | | `processingFrequency` | `is_systematic \| not_systematic` | No | Data processing frequency. | | `dataFlowRelationships` | `object[]` | No | Dataflowrelationships | | `retentionPeriod__unit` | `day \| month \| week \| year` | No | Unit of time that is used for retention period | | `retentionPeriodComment` | `string` | No | Retentionperiodcomment | | `retentionPeriod__value` | `number` | No | Value | | `areAccessRequestsManaged` | `boolean` | No | Indicates if the data subject access requests are managed. | | `processingFrequencyComment` | `string` | No | Processingfrequencycomment | | `processingActivitiesAsDataSources` | `string[]` | No | Processingactivitiesasdatasources | > **recipients full type** > > ```ts theme={null} > { > role: controller | independent_controller | joint_controller | processor | sub_processor[], > comment?: string, > recipientId: string > }[] > ``` > **lawfulBasis full type** > > ```ts theme={null} > { > comment?: string, > lawfulnessType: consent_person_concerned | contract | legal_obligation | legitimate_interest | public_interest | stakeholder_vital_interest > }[] > ``` > **translations full type** > > ```ts theme={null} > { > additionalProperties?: { > } > } > ``` > **managementMethods full type** > > ```ts theme={null} > { > email?: string, > methodType: email | postal, > postalAddress__city?: string, > postalAddress__street?: string, > postalAddress__country?: string, > postalAddress__zipcode?: string > }[] > ``` > **dataFlowRelationships full type** > > ```ts theme={null} > { > to__type?: MyOrganisation | dataSource | recipient | specificProcessingActivity, > to__value?: string, > from__type?: MyOrganisation | dataSource | recipient | specificProcessingActivity, > from__value?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > active?: boolean, > assets?: string, > language?: string, > infotypes?: string, > recipients?: string, > companyRole?: string, > departments?: string, > lawfulBasis?: string, > dataSubjects?: string, > isDataStored?: boolean, > translations?: string, > contactPerson?: string, > additionalInfo?: string, > infotypeVolume?: string, > managementMethods?: string, > infotypeCategories?: string, > additionalInfoFiles?: string, > processingFrequency?: string, > dataFlowRelationships?: string, > retentionPeriod__unit?: string, > retentionPeriodComment?: string, > areAccessRequestsManaged?: boolean, > processingFrequencyComment?: string, > processingActivitiesAsDataSources?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### createProcessingActivityThreshold `processing.createProcessingActivityThreshold` Create processing activity threshold **Risk:** `write` ```ts theme={null} await corsair.borneo.api.processing.createProcessingActivityThreshold({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `activated \| draft` | No | Status of the threshold. Can be draft or activated. | | `comment` | `string` | No | Additional information related to the Threshold | | `additionalComment` | `boolean` | No | Additionalcomment | | `processingActivityId` | `string` | Yes | Identifier of the processing activity for which the threshold will be created | | `largeScaleObservation` | `boolean` | No | Largescaleobservation | | `sensitiveOrSpecialData` | `boolean` | No | Sensitiveorspecialdata | | `rightsRiskProcessingData` | `boolean` | No | Rightsriskprocessingdata | | `freedomRiskProcessingData` | `boolean` | No | Freedomriskprocessingdata | | `innovativeTechnologiesUsed` | `boolean` | No | Innovativetechnologiesused | | `processingPersonalDataRisk` | `boolean` | No | Processingpersonaldatarisk | | `specialCategoryDataProcessed` | `boolean` | No | Specialcategorydataprocessed | | `systematicPersonalAssessment` | `boolean` | No | Systematicpersonalassessment | | `processingVulnerableDataSubject` | `boolean` | No | Processingvulnerabledatasubject | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string, > comment?: string, > processingActivityId?: string, > largeScaleObservation?: boolean, > sensitiveOrSpecialData?: boolean, > rightsRiskProcessingData?: boolean, > freedomRiskProcessingData?: boolean, > innovativeTechnologiesUsed?: boolean, > processingPersonalDataRisk?: boolean, > specialCategoryDataProcessed?: boolean, > systematicPersonalAssessment?: boolean, > processingVulnerableDataSubject?: boolean > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### createThresholdForProcessingActivity `processing.createThresholdForProcessingActivity` Create threshold for processing activity **Risk:** `write` ```ts theme={null} await corsair.borneo.api.processing.createThresholdForProcessingActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `activated \| draft` | No | Status of the threshold. Can be draft or activated. | | `comment` | `string` | No | Additional information related to the Threshold | | `blacklist` | `boolean` | No | Indicates if the data processing is included in a black list | | `createdAt` | `number` | No | Createdat | | `updatedAt` | `number` | No | Updatedat | | `translations` | `object` | No | Translations | | `processingActivityId` | `string` | Yes | Identifier of the processing activity for which the threshold will be created | | `classifyingDataSubject` | `boolean` | No | Indicates if this data processing is assessing or classifying data subjects | | `automatedDecisionMaking` | `boolean` | No | Indicates if there is automated decision-making with legal effect, or similarly significant effect involved | | `largeScaleDataProcessing` | `boolean` | No | Indicates if is a large scale data processing | | `innovativeTechnologiesUsed` | `boolean` | No | Indicates if there are innovative technologies used | | `matchingMergingRecordsInvolved` | `boolean` | No | Indicates if there is matching or merging of the records involved | | `processingVulnerableDataSubject` | `boolean` | No | Indicates if there is processing of data of vulnerable data subjects | | `systematicMonitoringDataSubject` | `boolean` | No | Indicates if there is systematic monitoring of data subjects involved | | `largeScaleProcessingSensitiveData` | `boolean` | No | Indicates if the data processing is large scale processing of sensitive data. | | `monitoringPubliclyAccessibleAreas` | `boolean` | No | Indicates if the data processing is systematic and large scale monitoring of publicly accessible areas involved. | | `processingConfidentialSensitiveData` | `boolean` | No | Indicates if there is processing of confidential or sensitive data | | `preventDataSubjectsExercisingTheirRights` | `boolean` | No | Indicates if the data processing prevents the data subjects from exercising their rights, using a service or performing a contract | | `extensiveAutomatedEvaluationCharacteristics` | `boolean` | No | Indicates if the data processing involve any systematic, extensive and automated evaluation of personal characteristics with effect for the data subjects. | > **translations full type** > > ```ts theme={null} > { > additionalProperties?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string, > comment?: string, > blacklist?: boolean, > translations?: string, > processingActivityId?: string, > classifyingDataSubject?: boolean, > automatedDecisionMaking?: boolean, > largeScaleDataProcessing?: boolean, > innovativeTechnologiesUsed?: boolean, > matchingMergingRecordsInvolved?: boolean, > processingVulnerableDataSubject?: boolean, > systematicMonitoringDataSubject?: boolean, > largeScaleProcessingSensitiveData?: boolean, > monitoringPubliclyAccessibleAreas?: boolean, > processingConfidentialSensitiveData?: boolean, > preventDataSubjectsExercisingTheirRights?: boolean, > extensiveAutomatedEvaluationCharacteristics?: boolean > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteDpiaById `processing.deleteDpiaById` Delete dpia by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.processing.deleteDpiaById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dpiaId` | `string` | Yes | Identifier of the DPIA | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteLopdpThresholdById `processing.deleteLopdpThresholdById` Delete lopdp threshold by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.processing.deleteLopdpThresholdById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lopdpThresholdId` | `string` | Yes | Identifier of the Threshold | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteProcessingActivityById `processing.deleteProcessingActivityById` Delete processing activity by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.processing.deleteProcessingActivityById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `processingActivityId` | `string` | Yes | Identifier of the Processing Activity | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > processingActivityId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteThresholdById `processing.deleteThresholdById` Delete threshold by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.processing.deleteThresholdById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `thresholdId` | `string` | Yes | Identifier of the Threshold | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### exportProcessingActivitiesList `processing.exportProcessingActivitiesList` Export processing activities list **Risk:** `read` ```ts theme={null} await corsair.borneo.api.processing.exportProcessingActivitiesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `ar \| de \| en \| es \| es-EC \| es-MX \| fr \| hi \| it \| ja \| pt \| zh` | Yes | Language | | `exportTypes` | `csv \| doc \| pdf[]` | Yes | Exporttypes | | `filter__owners` | `string[]` | No | Owners | | `filter__search` | `string` | No | Search | | `filter__status` | `string[]` | No | Status | | `filter__employees` | `string[]` | No | Employees | | `filter__infotypes` | `string[]` | No | Infotypes | | `filter__recipients` | `string[]` | No | Recipients | | `filter__departments` | `string[]` | No | Departments | | `filter__dataSubjects` | `string[]` | No | Datasubjects | | `filter__processingActivityId` | `string` | No | Processingactivityid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > language?: string, > exportTypes?: string, > filter__departments?: string, > filter__dataSubjects?: string, > filter__processingActivityId?: string, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### getThresholdById `processing.getThresholdById` Get threshold by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.processing.getThresholdById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `thresholdId` | `string` | Yes | Identifier of the Threshold | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listProcessingActivities `processing.listProcessingActivities` List processing activities **Risk:** `read` ```ts theme={null} await corsair.borneo.api.processing.listProcessingActivities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__assets` | `string[]` | No | Assets | | `filter__owners` | `string[]` | No | Owners | | `filter__search` | `string` | No | Free-form text search to apply to processing activity name. | | `filter__status` | `string[]` | No | Status | | `filter__dataTypes` | `string[]` | No | Datatypes | | `filter__employees` | `string[]` | No | Employees | | `filter__infotypes` | `string[]` | No | Infotypes | | `filter__languages` | `string[]` | No | Languages | | `filter__recipients` | `string[]` | No | Recipients | | `filter__dataSources` | `string[]` | No | Datasources | | `filter__departments` | `string[]` | No | Departments | | `filter__companyRoles` | `string[]` | No | Companyroles | | `filter__dataSubjects` | `string[]` | No | Datasubjects | | `filter__paAsDataSource` | `string[]` | No | Paasdatasource | | `filter__infotypeCategories` | `string[]` | No | Infotypecategories | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__dataSources?: string, > filter__departments?: string, > filter__companyRoles?: string, > filter__dataSubjects?: string, > filter__paAsDataSource?: string, > filter__infotypeCategories?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listProcessingActivitiesFilters `processing.listProcessingActivitiesFilters` List processing activities filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.processing.listProcessingActivitiesFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filterType` | `asset \| companyRole \| dataSubject \| department \| employee \| owner \| recipient \| status` | Yes | Type of filter to retrieve options for | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > filterType?: string, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listTomsWithFilterAndPaginationOptions `processing.listTomsWithFilterAndPaginationOptions` List toms with filter and pagination options **Risk:** `read` ```ts theme={null} await corsair.borneo.api.processing.listTomsWithFilterAndPaginationOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `filter__list` | `string[]` | No | List | | `filter__type` | `string[]` | No | Type | | `sort__column` | `string` | No | The column name to sort on. | | `filter__tomId` | `string[]` | No | Tomid | | `filter__search` | `string` | No | Free-form text search to apply to the toms name. | | `filter__status` | `string[]` | No | Status | | `filter__category` | `string[]` | No | Category | | `filter__objectCategory` | `string[]` | No | Objectcategory | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__objectCategory?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### putTomStatusAndNote `processing.putTomStatusAndNote` Put tom status and note **Risk:** `write` ```ts theme={null} await corsair.borneo.api.processing.putTomStatusAndNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `note` | `string` | No | Note | | `tomId` | `string` | Yes | Tomid | | `status` | `available \| implemented \| pendingToImplement` | Yes | Status of the TOM, i.e. whether the TOM is already implemented, implementation is pending, or the TOM is not implemented. | | `documentFiles` | `string[]` | No | Uploaded file id list. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string, > documentFiles?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveDpiaById `processing.retrieveDpiaById` Retrieve dpia by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.processing.retrieveDpiaById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dpiaId` | `string` | Yes | Identifier of the DPIA | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveLopdpThresholdById `processing.retrieveLopdpThresholdById` Retrieve lopdp threshold by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.processing.retrieveLopdpThresholdById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lopdpThresholdId` | `string` | Yes | Identifier of the Threshold | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveProcessingActivityById `processing.retrieveProcessingActivityById` Retrieve processing activity by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.processing.retrieveProcessingActivityById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `processingActivityId` | `string` | Yes | Identifier of the Processing Activity | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > processingActivityId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveTomById `processing.retrieveTomById` Retrieve tom by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.processing.retrieveTomById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tomId` | `string` | Yes | Identifier of the TOM | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateDpiaById `processing.updateDpiaById` Update dpia by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.processing.updateDpiaById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dpiaId` | `string` | Yes | Identifier of the DPIA | | `status` | `activated \| draft` | Yes | The status of the DPIA. If a DPIA is saved as activated, several fields are required | | `translations` | `object` | No | Translations | | `integrity__impacts` | `object[]` | No | List of impacts that integrity risk can have. At least one element is necessary DPIA is saved as activated | | `integrity__threats` | `object[]` | No | List of threats that integrity risk can have. At least one element is necessary DPIA is saved as activated | | `additionalInformation` | `string` | No | Additionalinformation | | `availability__impacts` | `object[]` | No | List of impacts that availability risk can have. At least one element is necessary DPIA is saved as activated | | `availability__threats` | `object[]` | No | List of threats that availability risk can have. At least one element is necessary DPIA is saved as activated | | `integrity__plannedToms` | `string[]` | No | List of TOMs that are planned to be implemented to prevent integrity risk. At least one element is necessary DPIA is saved as activated | | `integrity__riskSources` | `object[]` | No | List of risk sources that integrity risk can have. At least one element is necessary DPIA is saved as activated | | `confidentiality__impacts` | `object[]` | No | List of impacts that confidentiality risk can have. At least one element is necessary DPIA is saved as activated | | `confidentiality__threats` | `object[]` | No | List of threats that confidentiality risk can have. At least one element is necessary DPIA is saved as activated | | `availability__plannedToms` | `string[]` | No | List of TOMs planned to be implemented and that applies to the availability risk. At least one element is necessary DPIA is saved as activated | | `availability__riskSources` | `object[]` | No | List of risk sources that availability risk can have. At least one element is necessary DPIA is saved as activated | | `integrity__impactsComment` | `string` | No | Comment to add additional information about the integrity impacts | | `integrity__threatsComment` | `string` | No | Comment to add additional information about the integrity threats | | `privacyFramework__consent` | `string` | No | Field to describe the measures to ensure that the consent of the data subjects has been obtained and how the given consent can be revoked Mandatory if DPIA is saved as activated and the lawfulness "consent\_person\_concerned" selected | | `additionalInformationFiles` | `string[]` | No | Additionalinformationfiles | | `integrity__baselineComment` | `string` | No | Comment to add additional information about the baseline risk of the integrity | | `integrity__implementedToms` | `string[]` | No | List of TOMs that are implemented to prevent integrity risk. At least one element is necessary DPIA is saved as activated | | `privacyFramework__accuracy` | `string` | No | Field to explain if the data processed is accurate, high quality and up-to-date Mandatory if DPIA is saved as activated | | `integrity__baselineSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `privacyFramework__retention` | `boolean` | No | Is the retention period lawful and clearly defined? Mandatory if DPIA is saved as activated | | `availability__impactsComment` | `string` | No | Comment to add additional information about the impact | | `availability__threatsComment` | `string` | No | Comment to add additional information about the threat | | `confidentiality__plannedToms` | `string[]` | No | List of TOMs that are planned to be implemented to prevent confidentiality risk. At least one element is necessary DPIA is saved as activated | | `confidentiality__riskSources` | `object[]` | No | List of risk sources that confidentiality risk can have. At least one element is necessary DPIA is saved as activated | | `availability__baselineComment` | `string` | No | Comment to add additional information about the baseline risk of the availablity | | `availability__implementedToms` | `string[]` | No | List of implemented TOMs that applies to the availability risk. At least one element is necessary DPIA is saved as activated | | `integrity__baselineLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Baselinelikelihood | | `integrity__plannedTomsComment` | `string` | No | Comment to add additional information about planned TOMs to prevent integrity risk | | `integrity__riskSourcesComment` | `string` | No | Comment to add additional information about the integrity risk sources | | `availability__baselineSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `integrity__residualRiskComment` | `string` | No | Comment to add additional information about the residual risk of the integrity | | `privacyFramework__transparency` | `string` | No | Field to describe what kind of notice information is given to data subjects about this processing, and how is it provided to the data subjects? Mandatory if DPIA is saved as activated | | `confidentiality__impactsComment` | `string` | No | Comment to add additional information about the confidentiality risk impacts | | `confidentiality__threatsComment` | `string` | No | Comment to add additional information about the confidentiality risk threats | | `integrity__residualRiskSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `availability__baselineLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Baselinelikelihood | | `availability__plannedTomsComment` | `string` | No | Comment to add additional information about the planned TOMs | | `availability__riskSourcesComment` | `string` | No | Comment to add additional information about the availability risk sources | | `confidentiality__baselineComment` | `string` | No | Comment to add additional information about the baseline risk of the confidentiality | | `confidentiality__implementedToms` | `string[]` | No | List of TOMs that are implemented to prevent confidentiality risk. At least one element is necessary DPIA is saved as activated | | `availability__residualRiskComment` | `string` | No | Comment to add additional information about the residual risk of the availability | | `confidentiality__baselineSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `integrity__implementedTomsComment` | `string` | No | Comment to add additional information about implemented TOMs to prevent integrity risk | | `integrity__residualRiskLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Residualrisklikelihood | | `availability__residualRiskSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `privacyFramework__dataMinimisation` | `string` | No | Field to explain if the data collected adequate, relevant, and limited to what is necessary concerning the purposes for which it is processed Mandatory if DPIA is saved as activated | | `privacyFramework__retentionComment` | `string` | No | Field to add comment on the retention period | | `confidentiality__baselineLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Baselinelikelihood | | `confidentiality__plannedTomsComment` | `string` | No | Comment to add additional information about planned TOMs to prevent confidentiality risk | | `confidentiality__riskSourcesComment` | `string` | No | Comment to add additional information about the confidentiality risk sources | | `privacyFramework__additionalComment` | `string` | No | Field to add more information related to the privacy framework of the DPIA | | `privacyFramework__purposeLimitation` | `string` | No | Field to explain the clear, specific and legitimate purpose of conducting the processing activity. Mandatory if DPIA is saved as activated | | `availability__implementedTomsComment` | `string` | No | Comment to add additional information about the implemented TOMs | | `availability__residualRiskLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Residualrisklikelihood | | `confidentiality__residualRiskComment` | `string` | No | Comment to add additional information about the residual risk of the confidentiality | | `confidentiality__residualRiskSeverity` | `high \| low \| medium \| very_high \| very_low` | No | Represents the severity of a risk | | `privacyFramework__dataRightsExercised` | `string` | No | Field to describe how do data subjects exercise their data subject rights? Mandatory if DPIA is saved as activated | | `confidentiality__implementedTomsComment` | `string` | No | Comment to add additional information about implemented TOMs to prevent confidentiality risk | | `confidentiality__residualRiskLikelihood` | `likely \| limited \| maximum \| negligible \| unlikely` | No | Residualrisklikelihood | > **translations full type** > > ```ts theme={null} > { > additionalProperties?: { > } > } > ``` > **integrity\_\_impacts full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **integrity\_\_threats full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **availability\_\_impacts full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **availability\_\_threats full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **integrity\_\_riskSources full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **confidentiality\_\_impacts full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **confidentiality\_\_threats full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **availability\_\_riskSources full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` > **confidentiality\_\_riskSources full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string, > translations?: string, > integrity__impacts?: string, > integrity__threats?: string, > additionalInformation?: string, > availability__impacts?: string, > availability__threats?: string, > integrity__plannedToms?: string, > integrity__riskSources?: string, > confidentiality__impacts?: string, > confidentiality__threats?: string, > availability__plannedToms?: string, > availability__riskSources?: string, > integrity__impactsComment?: string, > integrity__threatsComment?: string, > privacyFramework__consent?: string, > additionalInformationFiles?: string, > integrity__baselineComment?: string, > integrity__implementedToms?: string, > privacyFramework__accuracy?: string, > integrity__baselineSeverity?: string, > privacyFramework__retention?: boolean, > availability__impactsComment?: string, > availability__threatsComment?: string, > confidentiality__plannedToms?: string, > confidentiality__riskSources?: string, > availability__baselineComment?: string, > availability__implementedToms?: string, > integrity__baselineLikelihood?: string, > integrity__plannedTomsComment?: string, > integrity__riskSourcesComment?: string, > availability__baselineSeverity?: string, > integrity__residualRiskComment?: string, > privacyFramework__transparency?: string, > confidentiality__impactsComment?: string, > confidentiality__threatsComment?: string, > integrity__residualRiskSeverity?: string, > availability__baselineLikelihood?: string, > availability__plannedTomsComment?: string, > availability__riskSourcesComment?: string, > confidentiality__baselineComment?: string, > confidentiality__implementedToms?: string, > availability__residualRiskComment?: string, > confidentiality__baselineSeverity?: string, > integrity__implementedTomsComment?: string, > integrity__residualRiskLikelihood?: string, > availability__residualRiskSeverity?: string, > privacyFramework__dataMinimisation?: string, > privacyFramework__retentionComment?: string, > confidentiality__baselineLikelihood?: string, > confidentiality__plannedTomsComment?: string, > confidentiality__riskSourcesComment?: string, > privacyFramework__additionalComment?: string, > privacyFramework__purposeLimitation?: string, > availability__implementedTomsComment?: string, > availability__residualRiskLikelihood?: string, > confidentiality__residualRiskComment?: string, > confidentiality__residualRiskSeverity?: string, > privacyFramework__dataRightsExercised?: string, > confidentiality__implementedTomsComment?: string, > confidentiality__residualRiskLikelihood?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateLopdpThresholdById `processing.updateLopdpThresholdById` Update lopdp threshold by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.processing.updateLopdpThresholdById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `activated \| draft` | No | Status of the threshold. Can be draft or activated. | | `comment` | `string` | No | Additional information related to the Threshold | | `lopdpThresholdId` | `string` | Yes | Identifier of the Threshold | | `additionalComment` | `boolean` | No | Additionalcomment | | `largeScaleObservation` | `boolean` | No | Largescaleobservation | | `sensitiveOrSpecialData` | `boolean` | No | Sensitiveorspecialdata | | `rightsRiskProcessingData` | `boolean` | No | Rightsriskprocessingdata | | `freedomRiskProcessingData` | `boolean` | No | Freedomriskprocessingdata | | `innovativeTechnologiesUsed` | `boolean` | No | Innovativetechnologiesused | | `processingPersonalDataRisk` | `boolean` | No | Processingpersonaldatarisk | | `specialCategoryDataProcessed` | `boolean` | No | Specialcategorydataprocessed | | `systematicPersonalAssessment` | `boolean` | No | Systematicpersonalassessment | | `processingVulnerableDataSubject` | `boolean` | No | Processingvulnerabledatasubject | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string, > comment?: string, > largeScaleObservation?: boolean, > sensitiveOrSpecialData?: boolean, > rightsRiskProcessingData?: boolean, > freedomRiskProcessingData?: boolean, > innovativeTechnologiesUsed?: boolean, > processingPersonalDataRisk?: boolean, > specialCategoryDataProcessed?: boolean, > systematicPersonalAssessment?: boolean, > processingVulnerableDataSubject?: boolean > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateProcessingActivityDetails `processing.updateProcessingActivityDetails` Update processing activity details **Risk:** `write` ```ts theme={null} await corsair.borneo.api.processing.updateProcessingActivityDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the processing activity | | `owner` | `string` | No | Owner | | `active` | `boolean` | Yes | Flag to create the processing activity as activated or draft | | `assets` | `string[]` | No | List assets ids related to the processing activity. | | `modelId` | `string` | No | Modelid | | `purpose` | `string` | No | Purpose of the processing activity | | `dataTypes` | `string[]` | No | Datatypes | | `infotypes` | `string[]` | No | List of info types related with the processing activity. | | `recipients` | `object[]` | No | List of recipients related with the processing activity. | | `companyRole` | `controller \| independent_controller \| joint_controller \| processor \| sub_processor[]` | No | Companyrole | | `dataSources` | `string[]` | No | Datasources | | `departments` | `string[]` | No | List departments related with the processing activity. | | `lawfulBasis` | `object[]` | No | List of Lawfulness types affected by a processing activity | | `dataSubjects` | `string[]` | No | List of Data Subjects affected by the processing activity | | `isDataStored` | `boolean` | No | Indicates if you store the data. | | `translations` | `object` | No | Translations | | `contactPerson` | `string` | No | Contact person for the processing activity. | | `additionalInfo` | `string` | No | Text to add more information about the processing activity | | `infotypeVolume` | `0-1000 \| 1000-10000 \| 10000-100000 \| 100000+` | No | Ranges of the processed infotype volume. | | `managementMethods` | `object[]` | No | Managementmethods | | `infotypeCategories` | `string[]` | No | List of info types categories related with the processing activity. | | `showOnRopaDocument` | `boolean` | No | Showonropadocument | | `additionalInfoFiles` | `string[]` | No | List of uploaded file ids. | | `processingFrequency` | `is_systematic \| not_systematic` | No | Data processing frequency. | | `processingActivityId` | `string` | Yes | Identifier of the Processing Activity | | `dataFlowRelationships` | `object[]` | No | Dataflowrelationships | | `retentionPeriod__unit` | `day \| month \| week \| year` | No | Unit of time that is used for retention period | | `retentionPeriodComment` | `string` | No | Additional information related to the retention period | | `retentionPeriod__value` | `number` | No | Value | | `areAccessRequestsManaged` | `boolean` | No | Indicates if the data subject access requests are managed. | | `processingFrequencyComment` | `string` | No | Processingfrequencycomment | | `processingActivitiesAsDataSources` | `string[]` | No | Processingactivitiesasdatasources | > **recipients full type** > > ```ts theme={null} > { > role: controller | independent_controller | joint_controller | processor | sub_processor[], > comment?: string, > recipientId: string > }[] > ``` > **lawfulBasis full type** > > ```ts theme={null} > { > comment?: string, > lawfulnessType: consent_person_concerned | contract | legal_obligation | legitimate_interest | public_interest | stakeholder_vital_interest > }[] > ``` > **translations full type** > > ```ts theme={null} > { > additionalProperties?: { > } > } > ``` > **managementMethods full type** > > ```ts theme={null} > { > email?: string, > methodType: email | postal, > postalAddress__city?: string, > postalAddress__street?: string, > postalAddress__country?: string, > postalAddress__zipcode?: string > }[] > ``` > **dataFlowRelationships full type** > > ```ts theme={null} > { > to__type?: MyOrganisation | dataSource | recipient | specificProcessingActivity, > to__value?: string, > from__type?: MyOrganisation | dataSource | recipient | specificProcessingActivity, > from__value?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > active?: boolean, > assets?: string, > purpose?: string, > infotypes?: string, > recipients?: string, > companyRole?: string, > departments?: string, > lawfulBasis?: string, > dataSubjects?: string, > isDataStored?: boolean, > translations?: string, > contactPerson?: string, > additionalInfo?: string, > infotypeVolume?: string, > managementMethods?: string, > infotypeCategories?: string, > additionalInfoFiles?: string, > processingFrequency?: string, > processingActivityId?: string, > dataFlowRelationships?: string, > retentionPeriod__unit?: string, > retentionPeriodComment?: string, > areAccessRequestsManaged?: boolean, > processingFrequencyComment?: string, > processingActivitiesAsDataSources?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateThresholdById `processing.updateThresholdById` Update threshold by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.processing.updateThresholdById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `activated \| draft` | No | Status of the threshold. Can be draft or activated. | | `comment` | `string` | No | Additional information related to the Threshold | | `blacklist` | `boolean` | No | Indicates if the data processing is included in a black list | | `thresholdId` | `string` | Yes | Identifier of the Threshold | | `translations` | `object` | No | Translations | | `classifyingDataSubject` | `boolean` | No | Indicates if this data processing is assessing or classifying data subjects | | `automatedDecisionMaking` | `boolean` | No | Indicates if there is automated decision-making with legal effect, or similarly significant effect involved | | `largeScaleDataProcessing` | `boolean` | No | Indicates if is a large scale data processing | | `innovativeTechnologiesUsed` | `boolean` | No | Indicates if there are innovative technologies used | | `matchingMergingRecordsInvolved` | `boolean` | No | Indicates if there is matching or merging of the records involved | | `processingVulnerableDataSubject` | `boolean` | No | Indicates if there is processing of data of vulnerable data subjects | | `systematicMonitoringDataSubject` | `boolean` | No | Indicates if there is systematic monitoring of data subjects involved | | `largeScaleProcessingSensitiveData` | `boolean` | No | Indicates if the data processing is large scale processing of sensitive data. | | `monitoringPubliclyAccessibleAreas` | `boolean` | No | Indicates if the data processing is systematic and large scale monitoring of publicly accessible areas involved. | | `processingConfidentialSensitiveData` | `boolean` | No | Indicates if there is processing of confidential or sensitive data | | `preventDataSubjectsExercisingTheirRights` | `boolean` | No | Indicates if the data processing prevents the data subjects from exercising their rights, using a service or performing a contract | | `extensiveAutomatedEvaluationCharacteristics` | `boolean` | No | Indicates if the data processing involve any systematic, extensive and automated evaluation of personal characteristics with effect for the data subjects. | > **translations full type** > > ```ts theme={null} > { > additionalProperties?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string, > comment?: string, > blacklist?: boolean, > translations?: string, > classifyingDataSubject?: boolean, > automatedDecisionMaking?: boolean, > largeScaleDataProcessing?: boolean, > innovativeTechnologiesUsed?: boolean, > matchingMergingRecordsInvolved?: boolean, > processingVulnerableDataSubject?: boolean, > systematicMonitoringDataSubject?: boolean, > largeScaleProcessingSensitiveData?: boolean, > monitoringPubliclyAccessibleAreas?: boolean, > processingConfidentialSensitiveData?: boolean, > preventDataSubjectsExercisingTheirRights?: boolean, > extensiveAutomatedEvaluationCharacteristics?: boolean > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Recipients ### addDiscoveredRecipients `recipients.addDiscoveredRecipients` Add discovered recipients **Risk:** `write` ```ts theme={null} await corsair.borneo.api.recipients.addDiscoveredRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `discoveredRecipientIds` | `string[]` | Yes | Identifiers of the discovered recipients to add as recipients. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > discoveredRecipientIds?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### archiveDiscoveredRecipient `recipients.archiveDiscoveredRecipient` Archive discovered recipient **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.recipients.archiveDiscoveredRecipient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `discoveredRecipientId` | `string` | Yes | Identifier of the discovered recipient. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > discoveredRecipientId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### createRecipientWithDetails `recipients.createRecipientWithDetails` Create recipient with details **Risk:** `write` ```ts theme={null} await corsair.borneo.api.recipients.createRecipientWithDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dpa` | `string` | No | The url to the DPA of the recipient | | `name` | `string` | Yes | Name of the recipient. Has to be unique, 2 different recipients can"t have the same name. | | `role` | `controller \| independent_controller \| joint_controller \| processor \| sub_processor[]` | No | Role | | `state` | `AK \| AL \| AR \| AZ \| CA \| CO \| CT \| DC \| DE \| FL \| GA \| HI \| IA \| ID \| IL \| IN \| KS \| KY \| LA \| MA \| MD \| ME \| MI \| MN \| MO \| MS \| MT \| NC \| ND \| NE \| NH \| NJ \| NM \| NV \| NY \| OH \| OK \| OR \| PA \| RI \| SC \| SD \| TN \| TX \| UT \| VA \| VT \| WA \| WI \| WV \| WY` | No | 2 letter code that identifies the state of the recipient. It only applies when the recipient country is US | | `status` | `archived \| validated` | Yes | The status of the recipient. Can be archived or validated. | | `country` | `string` | No | 2 letter code that identifies a country. | | `dpaFiles` | `string[]` | No | List of uploaded file ids. | | `createdAt` | `number` | No | Createdat | | `dpaStatus` | `attached \| notRequired \| requested` | No | The status of the DPA of the recipient. Attached if the DPA is provided. Not required when it"s not necessary to provide the information. Requested when we ask for the DPA and we are waiting for it. | | `updatedAt` | `number` | No | Updatedat | | `categories` | `ITInfrastructure \| accountingSoftware \| adminDepartment \| advertising \| airlines \| analytics \| apps \| artificialIntelligenceAi \| assetManagement \| audit \| automotive \| b2b \| bankCards \| bigData \| businessDevelopment \| businessIntelligence \| businessManagement \| chat \| cloudComputing \| cloudDataServices \| cloudManagement \| cloudSecurity \| cloudStorage \| communities \| compliance \| construction \| consulting \| consumerElectronics \| content \| coreBankingSystem \| crmSoftware \| cryptoCurrency \| customerServiceProvider \| customerSupport \| cyberSecurity \| dataIntegration \| dataManagement \| dataStorage \| dataVisualization \| database \| developerTools \| devops \| digitalMedia \| documentManagement \| e-learning \| eCommerce \| edtech \| education \| electronics \| emailMarketing \| emailServices \| energy \| enterprise \| enterpriseSoftware \| erpSoftware \| events \| eventsSoftware \| fileSharing \| financialCrime \| financialServices \| fintech \| fitness \| foodAndBeverage \| government \| healthCare \| hospitality \| hosting \| identityManagement \| informationTechnology \| insurance \| insurtech \| internalDepartment \| internetOfThings \| itDepartment \| lawEnforcement \| lawServices \| legalDepartment \| logistics \| machineLearning \| management \| marketResearch \| marketingAutomation \| marketingDepartment \| marketingSoftware \| marketingTools \| marketplace \| medical \| messagingServices \| mobileApps \| mobilityEquipment \| networkSecurity \| news \| nonProfit \| officeApplications \| officesApps \| onlinePortals \| orderingSoftware \| other \| outsourcing \| passwordManagement \| paymentPlatform \| payrollServices \| pharmaceuticals \| physicalSecurity \| physicalStorage \| prDepartment \| preventionRisks \| productionDepartment \| productivityTools \| professionalServices \| projectManagement \| propertyAdministration \| publicAdministration \| publishing \| realEstate \| regulatoryReporting \| retail \| riskManagement \| rrhhDepartment \| rrhhManagement \| rrhhSoftware \| saas \| searchEngine \| security \| securityServices \| sellDepartment \| servicesPlatform \| smallAndMediumBusinesses \| socialMedia \| supplyChainManagement \| taxManagement \| telecommunications \| ticServices \| tourism \| tracking \| trading \| training \| transportation \| travel \| ventureCapital \| video \| videoStreaming \| voip \| webDesign \| wellness[]` | No | list of recipient category | | `businessName` | `string` | No | Business name of the recipient | | `recipientState` | `active \| assessment` | No | Recipientstate | | `subProcessorIds` | `string[]` | No | Subprocessorids | | `recipientModelId` | `string` | No | Identifier of the Recipient Model in case that the Recipient is created bases in a Recipient Model | | `dataStorageLocation` | `string[]` | Yes | List of countries where the data related to this recipient are stored | | `recipientWarranties` | `string[]` | Yes | List of lawful basis types that applies to the recipient. | | `fromDiscoveredRecipientId` | `string` | No | Fromdiscoveredrecipientid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > dpa?: string, > name?: string, > role?: string, > state?: string, > status?: string, > country?: string, > dpaFiles?: string, > dpaStatus?: string, > categories?: string, > businessName?: string, > recipientState?: string, > subProcessorIds?: string, > recipientModelId?: string, > dataStorageLocation?: string, > recipientWarranties?: string, > fromDiscoveredRecipientId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### deleteRecipientById `recipients.deleteRecipientById` Delete recipient by id **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.recipients.deleteRecipientById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recipientId` | `string` | Yes | Identifier of the Recipient | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### exportRecipientsListWithFilter `recipients.exportRecipientsListWithFilter` Export recipients list with filter **Risk:** `read` ```ts theme={null} await corsair.borneo.api.recipients.exportRecipientsListWithFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `exportTypes` | `csv \| doc \| pdf[]` | Yes | Exporttypes | | `filter__role` | `string[]` | No | Role | | `filter__search` | `string` | No | Free-form text search to apply to the Recipient name. | | `filter__status` | `archived \| validated` | No | The status of the recipient. Can be archived or validated. | | `filter__usedIn` | `object` | No | Usedin | | `filter__categories` | `ITInfrastructure \| accountingSoftware \| adminDepartment \| advertising \| airlines \| analytics \| apps \| artificialIntelligenceAi \| assetManagement \| audit \| automotive \| b2b \| bankCards \| bigData \| businessDevelopment \| businessIntelligence \| businessManagement \| chat \| cloudComputing \| cloudDataServices \| cloudManagement \| cloudSecurity \| cloudStorage \| communities \| compliance \| construction \| consulting \| consumerElectronics \| content \| coreBankingSystem \| crmSoftware \| cryptoCurrency \| customerServiceProvider \| customerSupport \| cyberSecurity \| dataIntegration \| dataManagement \| dataStorage \| dataVisualization \| database \| developerTools \| devops \| digitalMedia \| documentManagement \| e-learning \| eCommerce \| edtech \| education \| electronics \| emailMarketing \| emailServices \| energy \| enterprise \| enterpriseSoftware \| erpSoftware \| events \| eventsSoftware \| fileSharing \| financialCrime \| financialServices \| fintech \| fitness \| foodAndBeverage \| government \| healthCare \| hospitality \| hosting \| identityManagement \| informationTechnology \| insurance \| insurtech \| internalDepartment \| internetOfThings \| itDepartment \| lawEnforcement \| lawServices \| legalDepartment \| logistics \| machineLearning \| management \| marketResearch \| marketingAutomation \| marketingDepartment \| marketingSoftware \| marketingTools \| marketplace \| medical \| messagingServices \| mobileApps \| mobilityEquipment \| networkSecurity \| news \| nonProfit \| officeApplications \| officesApps \| onlinePortals \| orderingSoftware \| other \| outsourcing \| passwordManagement \| paymentPlatform \| payrollServices \| pharmaceuticals \| physicalSecurity \| physicalStorage \| prDepartment \| preventionRisks \| productionDepartment \| productivityTools \| professionalServices \| projectManagement \| propertyAdministration \| publicAdministration \| publishing \| realEstate \| regulatoryReporting \| retail \| riskManagement \| rrhhDepartment \| rrhhManagement \| rrhhSoftware \| saas \| searchEngine \| security \| securityServices \| sellDepartment \| servicesPlatform \| smallAndMediumBusinesses \| socialMedia \| supplyChainManagement \| taxManagement \| telecommunications \| ticServices \| tourism \| tracking \| trading \| training \| transportation \| travel \| ventureCapital \| video \| videoStreaming \| voip \| webDesign \| wellness[]` | No | list of recipient category | | `filter__departments` | `string[]` | No | Departments | | `filter__recipientIds` | `string[]` | No | Recipientids | | `filter__recipientState` | `string[]` | No | Recipientstate | | `filter__discoverySource` | `string[]` | No | Discoverysource | | `filter__subProcessorIds` | `string[]` | No | Subprocessorids | | `filter__automationStatus` | `string[]` | No | Automationstatus | | `filter__recipientWarranties` | `string[]` | No | Recipientwarranties | | `filter__withNoProcessingActivity` | `boolean` | No | Withnoprocessingactivity | > **filter\_\_usedIn full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > exportTypes?: string, > filter__search?: string, > filter__status?: string, > filter__categories?: string, > filter__departments?: string, > filter__recipientIds?: string, > filter__recipientState?: string, > filter__discoverySource?: string, > filter__subProcessorIds?: string, > filter__automationStatus?: string, > filter__recipientWarranties?: string, > filter__withNoProcessingActivity?: boolean, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### filterRecipientsList `recipients.filterRecipientsList` Filter recipients list **Risk:** `read` ```ts theme={null} await corsair.borneo.api.recipients.filterRecipientsList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listDiscoveredRecipients `recipients.listDiscoveredRecipients` List discovered recipients **Risk:** `read` ```ts theme={null} await corsair.borneo.api.recipients.listDiscoveredRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the DiscoveredRecipient name. | | `filter__status` | `ignored \| new` | No | Status of the discovered recipient. Can be new or ignored if it"s marked as ignored. | | `filter__discoverySource` | `string[]` | No | Discoverysource | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__status?: string, > filter__discoverySource?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listFilterOptionsForRecipients `recipients.listFilterOptionsForRecipients` List filter options for recipients **Risk:** `read` ```ts theme={null} await corsair.borneo.api.recipients.listFilterOptionsForRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filterType` | `categories \| role` | Yes | Filtertype | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listOrFilterRecipients `recipients.listOrFilterRecipients` List or filter recipients **Risk:** `read` ```ts theme={null} await corsair.borneo.api.recipients.listOrFilterRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `filter__role` | `string[]` | No | Role | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the Recipient name. | | `filter__status` | `archived \| validated` | No | The status of the recipient. Can be archived or validated. | | `filter__usedIn` | `object` | No | Usedin | | `filter__categories` | `ITInfrastructure \| accountingSoftware \| adminDepartment \| advertising \| airlines \| analytics \| apps \| artificialIntelligenceAi \| assetManagement \| audit \| automotive \| b2b \| bankCards \| bigData \| businessDevelopment \| businessIntelligence \| businessManagement \| chat \| cloudComputing \| cloudDataServices \| cloudManagement \| cloudSecurity \| cloudStorage \| communities \| compliance \| construction \| consulting \| consumerElectronics \| content \| coreBankingSystem \| crmSoftware \| cryptoCurrency \| customerServiceProvider \| customerSupport \| cyberSecurity \| dataIntegration \| dataManagement \| dataStorage \| dataVisualization \| database \| developerTools \| devops \| digitalMedia \| documentManagement \| e-learning \| eCommerce \| edtech \| education \| electronics \| emailMarketing \| emailServices \| energy \| enterprise \| enterpriseSoftware \| erpSoftware \| events \| eventsSoftware \| fileSharing \| financialCrime \| financialServices \| fintech \| fitness \| foodAndBeverage \| government \| healthCare \| hospitality \| hosting \| identityManagement \| informationTechnology \| insurance \| insurtech \| internalDepartment \| internetOfThings \| itDepartment \| lawEnforcement \| lawServices \| legalDepartment \| logistics \| machineLearning \| management \| marketResearch \| marketingAutomation \| marketingDepartment \| marketingSoftware \| marketingTools \| marketplace \| medical \| messagingServices \| mobileApps \| mobilityEquipment \| networkSecurity \| news \| nonProfit \| officeApplications \| officesApps \| onlinePortals \| orderingSoftware \| other \| outsourcing \| passwordManagement \| paymentPlatform \| payrollServices \| pharmaceuticals \| physicalSecurity \| physicalStorage \| prDepartment \| preventionRisks \| productionDepartment \| productivityTools \| professionalServices \| projectManagement \| propertyAdministration \| publicAdministration \| publishing \| realEstate \| regulatoryReporting \| retail \| riskManagement \| rrhhDepartment \| rrhhManagement \| rrhhSoftware \| saas \| searchEngine \| security \| securityServices \| sellDepartment \| servicesPlatform \| smallAndMediumBusinesses \| socialMedia \| supplyChainManagement \| taxManagement \| telecommunications \| ticServices \| tourism \| tracking \| trading \| training \| transportation \| travel \| ventureCapital \| video \| videoStreaming \| voip \| webDesign \| wellness[]` | No | list of recipient category | | `filter__departments` | `string[]` | No | Departments | | `filter__recipientIds` | `string[]` | No | Recipientids | | `filter__recipientState` | `string[]` | No | Recipientstate | | `filter__discoverySource` | `string[]` | No | Discoverysource | | `filter__subProcessorIds` | `string[]` | No | Subprocessorids | | `filter__automationStatus` | `string[]` | No | Automationstatus | | `filter__recipientWarranties` | `string[]` | No | Recipientwarranties | | `filter__withNoProcessingActivity` | `boolean` | No | Withnoprocessingactivity | > **filter\_\_usedIn full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__status?: string, > filter__categories?: string, > filter__departments?: string, > filter__recipientIds?: string, > filter__recipientState?: string, > filter__discoverySource?: string, > filter__subProcessorIds?: string, > filter__automationStatus?: string, > filter__recipientWarranties?: string, > filter__withNoProcessingActivity?: boolean, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postDiscoveredRecipientById `recipients.postDiscoveredRecipientById` Post discovered recipient by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.recipients.postDiscoveredRecipientById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `discoveredRecipientId` | `string` | Yes | Discoveredrecipientid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveDiscoveredRecipientById `recipients.retrieveDiscoveredRecipientById` Retrieve discovered recipient by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.recipients.retrieveDiscoveredRecipientById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `discoveredRecipientId` | `string` | Yes | Identifier of the discovered recipient. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > discoveredRecipientId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveRecipientDetails `recipients.retrieveRecipientDetails` Retrieve recipient details **Risk:** `read` ```ts theme={null} await corsair.borneo.api.recipients.retrieveRecipientDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recipientId` | `string` | Yes | Identifier of the Recipient | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveRecipientProcessingActivities `recipients.retrieveRecipientProcessingActivities` Retrieve recipient processing activities **Risk:** `read` ```ts theme={null} await corsair.borneo.api.recipients.retrieveRecipientProcessingActivities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `recipientId` | `string` | Yes | Identifier of the Recipient | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sort__column?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateDashboardReportFrequencyAndRecipients `recipients.updateDashboardReportFrequencyAndRecipients` Update dashboard report frequency and recipients **Risk:** `write` ```ts theme={null} await corsair.borneo.api.recipients.updateDashboardReportFrequencyAndRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roles` | `borneo_admin \| borneo_analyst \| borneo_engineer \| compliance_engineer \| data_engineer \| department_coordinator \| no_access_role \| privacy_supervisor[]` | No | Roles | | `frequency` | `*/30 * * * * \| 0 */1 * * * \| 0 */12 * * * \| 0 */4 * * * \| 0 */6 * * * \| 0 */8 * * * \| 0 0 * * * \| 0 0 * * 0 \| 0 0 1 * * \| 0 0 1 1,4,7,10 * \| 0 0 1 1,7 *` | No | The cron schedule expression to use for a recurring scan. Only a fixed set of cron expressions can be used to run scans at 30 minute, 1 hour, 1 day, or 1 week intervals. | | `externalEmail` | `string[]` | No | Externalemail | | `recipientsEmail` | `string[]` | No | Recipientsemail | | `dashboardReportId` | `string` | Yes | Dashboardreportid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > roles?: string, > frequency?: string, > recipientsEmail?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateRecipientDetailsById `recipients.updateRecipientDetailsById` Update recipient details by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.recipients.updateRecipientDetailsById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dpa` | `string` | No | The url to the DPA of the recipient | | `name` | `string` | Yes | Name of the recipient. Has to be unique, 2 different recipients can"t have the same name. | | `role` | `controller \| independent_controller \| joint_controller \| processor \| sub_processor[]` | No | Role | | `state` | `AK \| AL \| AR \| AZ \| CA \| CO \| CT \| DC \| DE \| FL \| GA \| HI \| IA \| ID \| IL \| IN \| KS \| KY \| LA \| MA \| MD \| ME \| MI \| MN \| MO \| MS \| MT \| NC \| ND \| NE \| NH \| NJ \| NM \| NV \| NY \| OH \| OK \| OR \| PA \| RI \| SC \| SD \| TN \| TX \| UT \| VA \| VT \| WA \| WI \| WV \| WY` | No | 2 letter code that identifies the state of the recipient. It only applies when the recipient country is US | | `status` | `archived \| validated` | Yes | The status of the recipient. Can be archived or validated. | | `country` | `string` | No | 2 letter code that identifies a country. | | `dpaFiles` | `string[]` | No | List of uploaded file ids. | | `dpaStatus` | `attached \| notRequired \| requested` | No | The status of the DPA of the recipient. Attached if the DPA is provided. Not required when it"s not necessary to provide the information. Requested when we ask for the DPA and we are waiting for it. | | `categories` | `ITInfrastructure \| accountingSoftware \| adminDepartment \| advertising \| airlines \| analytics \| apps \| artificialIntelligenceAi \| assetManagement \| audit \| automotive \| b2b \| bankCards \| bigData \| businessDevelopment \| businessIntelligence \| businessManagement \| chat \| cloudComputing \| cloudDataServices \| cloudManagement \| cloudSecurity \| cloudStorage \| communities \| compliance \| construction \| consulting \| consumerElectronics \| content \| coreBankingSystem \| crmSoftware \| cryptoCurrency \| customerServiceProvider \| customerSupport \| cyberSecurity \| dataIntegration \| dataManagement \| dataStorage \| dataVisualization \| database \| developerTools \| devops \| digitalMedia \| documentManagement \| e-learning \| eCommerce \| edtech \| education \| electronics \| emailMarketing \| emailServices \| energy \| enterprise \| enterpriseSoftware \| erpSoftware \| events \| eventsSoftware \| fileSharing \| financialCrime \| financialServices \| fintech \| fitness \| foodAndBeverage \| government \| healthCare \| hospitality \| hosting \| identityManagement \| informationTechnology \| insurance \| insurtech \| internalDepartment \| internetOfThings \| itDepartment \| lawEnforcement \| lawServices \| legalDepartment \| logistics \| machineLearning \| management \| marketResearch \| marketingAutomation \| marketingDepartment \| marketingSoftware \| marketingTools \| marketplace \| medical \| messagingServices \| mobileApps \| mobilityEquipment \| networkSecurity \| news \| nonProfit \| officeApplications \| officesApps \| onlinePortals \| orderingSoftware \| other \| outsourcing \| passwordManagement \| paymentPlatform \| payrollServices \| pharmaceuticals \| physicalSecurity \| physicalStorage \| prDepartment \| preventionRisks \| productionDepartment \| productivityTools \| professionalServices \| projectManagement \| propertyAdministration \| publicAdministration \| publishing \| realEstate \| regulatoryReporting \| retail \| riskManagement \| rrhhDepartment \| rrhhManagement \| rrhhSoftware \| saas \| searchEngine \| security \| securityServices \| sellDepartment \| servicesPlatform \| smallAndMediumBusinesses \| socialMedia \| supplyChainManagement \| taxManagement \| telecommunications \| ticServices \| tourism \| tracking \| trading \| training \| transportation \| travel \| ventureCapital \| video \| videoStreaming \| voip \| webDesign \| wellness[]` | No | list of recipient category | | `recipientId` | `string` | Yes | Identifier of the Recipient | | `businessName` | `string` | No | Business name of the recipient | | `recipientState` | `active \| assessment` | No | Recipientstate | | `subProcessorIds` | `string[]` | No | Subprocessorids | | `automationStatus` | `created \| ignored \| new` | No | Automationstatus | | `dataStorageLocation` | `string[]` | Yes | List of countries where the data related to this recipient are stored | | `recipientWarranties` | `string[]` | Yes | List of lawful basis types that applies to the recipient. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > dpa?: string, > name?: string, > role?: string, > state?: string, > status?: string, > country?: string, > dpaFiles?: string, > dpaStatus?: string, > categories?: string, > businessName?: string, > recipientState?: string, > subProcessorIds?: string, > automationStatus?: string, > dataStorageLocation?: string, > recipientWarranties?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### updateRecipientStatusViaId `recipients.updateRecipientStatusViaId` Update recipient status via id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.recipients.updateRecipientStatusViaId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `archived \| validated` | No | The status of the recipient. Can be archived or validated. | | `recipientId` | `string` | Yes | Identifier of the Recipient | | `automationStatus` | `created \| ignored \| new` | No | Automationstatus | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > status?: string, > automationStatus?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Resources ### deleteTagFromResource `resources.deleteTagFromResource` Delete tag from resource **Risk:** `destructive` ```ts theme={null} await corsair.borneo.api.resources.deleteTagFromResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tagKey` | `string` | Yes | Tagkey | | `tagValue` | `string` | No | Tagvalue | | `tagResources` | `object` | Yes | Tagresources | > **tagResources full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### exportFilteredLeafResources `resources.exportFilteredLeafResources` Export filtered leaf resources **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.exportFilteredLeafResources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `detailed` | `boolean` | No | Set to `true` if the results exported to have detailed column level information of the detected infotypes. | | `sourceType` | `string` | No | Filter resource based on the source type. eg: "MYSQL", "RDS\_MYSQL", "S3", "PRESTO", etc. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__region` | `string[]` | No | One or more cloud provider regions. | | `filter__schema` | `string[]` | No | List tables from a specific schema. Supported for the following resource types: Presto. | | `filter__search` | `string` | No | Free-text search on the resource name. | | `filter__status` | `string[]` | No | Filter the resources based on list of status. | | `filter__account` | `string[]` | No | One or more cloud provider account IDs. | | `filter__dataset` | `string[]` | No | List tables from a specific dataset. Supported for on the following resource types: BigQuery. | | `filter__driveId` | `string[]` | No | List drives from a specific driveId. Supported for the following resource types: Gdrive. | | `filter__noOwner` | `boolean` | No | Include only resources that have not been assigned an owner. | | `filter__scanned` | `boolean` | No | Include only resources that have been scanned. | | `filter__database` | `string[]` | No | List tables from a specific database. Supported for the following resource types: (RDS) PostgreSQL, (RDS) MySQL, MongoDB. | | `filter__hasOwner` | `boolean` | No | Include only resources that have been assigned an owner. | | `filter__instance` | `string[]` | No | One or more resource IDs of the instances to which the resources belong, i.e. the parent resource ID. | | `filter__parentId` | `string` | No | Filter the resources which has the specified parent ID. | | `filter__driveType` | `string[]` | No | List drives from a specific drive type. Supported for the following resource types: Gdrive. | | `filter__firstSeen` | `object` | No | Set of conditions for comparing two timestamps. | | `filter__orgUnitId` | `string[]` | No | List orgUnits from a specific orgUnitIds. Supported for the following resource types: Gdrive. | | `filter__spaceType` | `string[]` | No | Filter conlfluences based on type | | `filter__categories` | `string[]` | No | Filter the resources matching with the list of categories. | | `filter__resourceId` | `string[]` | No | Filter the resources with the specified resource IDs. | | `filter__spaceStatus` | `string[]` | No | Filter conlfluences based on status | | `filter__resourceTags` | `object[]` | No | Filter the resources based on tags | | `filter__resourceType` | `string[]` | No | Filter the resources which can be scanned by Borneo. | | `filter__severityScore` | `CRITICAL \| HIGH \| INFORMATIONAL \| LOW \| MEDIUM[]` | No | Filter the resources based on the assigned risk severity score; "critical" = 4, "high" = 3, "medium" = 2, "low" = 1. | | `filter__classification` | `string[]` | No | Filter the resources matching with the list of classifications. | | `filter__infoTypes__ops` | `AND \| OR` | No | Ops | | `filter__infoTypes__infoTypes` | `string[]` | No | The list of infotypes to filter on. | > **filter\_\_firstSeen full type** > > ```ts theme={null} > { > additionalProperties?: number > } > ``` > **filter\_\_resourceTags full type** > > ```ts theme={null} > { > source: string, > tagKey: string, > tagValue: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > detailed?: boolean, > sourceType?: string, > sort__column?: string, > filter__region?: string, > filter__schema?: string, > filter__search?: string, > filter__status?: string, > filter__account?: string, > filter__dataset?: string, > filter__driveId?: string, > filter__noOwner?: boolean, > filter__scanned?: boolean, > filter__database?: string, > filter__hasOwner?: boolean, > filter__instance?: string, > filter__parentId?: string, > filter__driveType?: string, > filter__firstSeen?: number, > filter__orgUnitId?: string, > filter__spaceType?: string, > filter__categories?: string, > filter__resourceId?: string, > filter__spaceStatus?: string, > filter__resourceTags?: string, > filter__resourceType?: string, > filter__severityScore?: string, > filter__classification?: string, > filter__infoTypes__infoTypes?: string, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### exportInventoryResourceList `resources.exportInventoryResourceList` Export inventory resource list **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.exportInventoryResourceList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string[]` | No | A list of property names to return in the response. If not specified, all resource properties will be returned. | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | Optional "nextToken" value from the last API response. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__hasPii` | `boolean` | No | Include only resources that have a high likelihood of containing PII based on the resource metadata. | | `filter__region` | `string` | No | The region of the cloud account to which the resoure belongs. | | `filter__search` | `string` | No | Free-text search on the resource name. | | `filter__noOwner` | `boolean` | No | Include only resources that have not been assigned an owner. | | `filter__regions` | `string[]` | No | List of regions to which the resoure belongs to in that cloud account. | | `filter__hasOwner` | `boolean` | No | Include only resources that have been assigned an owner. | | `filter__parentId` | `string` | No | The parent Id of the resource. E.g. Borneo-specific GCP subscription ID for GCP resources | | `filter__accountId` | `string` | No | The account ID of the cloud account to which the resoure belongs. E.g. a 12-digit AWS account ID. | | `filter__dataRisks` | `string[]` | No | Filter the resources that has data risks. | | `filter__firstSeen` | `object` | No | Set of conditions for comparing two timestamps. | | `filter__resourceIds` | `string[]` | No | One or more resource IDs to return. | | `filter__resourceTags` | `object[]` | No | Filter the resources based on tags | | `filter__resourceType` | `string` | No | Filter the resources based on the resource type. | | `filter__severityScore` | `number[]` | No | Filter the resources based on the assigned risk severity score; "critical" = 4, "high" = 3, "medium" = 2, "low" = 1. | | `filter__classification` | `string[]` | No | Filter the resources based on classification and are non-compliant. eg "PII\_L1", "PII\_L2", "PII\_L3". Custom added classifications is also supported. | | `include__violationMetrics` | `boolean` | No | Include violation count by severity for resource and child resources. | | `filter__hideBorneoResources` | `boolean` | No | Whether to hide resources that are part of the Borneo data plane. | | `filter__dataSourceCategories` | `AWSDataStores \| AzureDataStores \| CloudApplications \| DiscoveredApplications \| GCPDataStores \| StandaloneDataStores[]` | No | Filter the resources based on the data source category Current supported values: AWS\_DATA\_STORES, GCP\_DATA\_STORES, STANDALONE\_DATA\_STORES, CLOUD\_APPLICATIONS, DISCOVERED\_APPLICATIONS | | `filter__scannableResourceTypes` | `boolean` | No | Filter the resources that are scannable | | `include__frameworkExceptionsCount` | `boolean` | No | Include framework exceptions count for the resource and its children | | `include__childResourceStats__scans` | `boolean` | No | Include aggregate scan stats from child resources. | | `include__childResourceStats__dataSize` | `boolean` | No | Include aggregate data size stats from child resources. | > **filter\_\_firstSeen full type** > > ```ts theme={null} > { > additionalProperties?: number > } > ``` > **filter\_\_resourceTags full type** > > ```ts theme={null} > { > source: string, > tagKey: string, > tagValue: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > select?: string, > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__hasPii?: boolean, > filter__region?: string, > filter__search?: string, > filter__noOwner?: boolean, > filter__regions?: string, > filter__hasOwner?: boolean, > filter__parentId?: string, > filter__accountId?: string, > filter__dataRisks?: string, > filter__firstSeen?: number, > filter__resourceIds?: string, > filter__resourceTags?: string, > filter__resourceType?: string, > filter__severityScore?: number, > filter__classification?: string, > include__violationMetrics?: boolean, > filter__hideBorneoResources?: boolean, > filter__dataSourceCategories?: string, > filter__scannableResourceTypes?: boolean, > include__frameworkExceptionsCount?: boolean, > include__childResourceStats__scans?: boolean, > include__childResourceStats__dataSize?: boolean, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### getResourceInventoryById `resources.getResourceInventoryById` Get resource inventory by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.getResourceInventoryById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `resourceId` | `string` | Yes | The unique resource ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listInventoryResourcesWithFilters `resources.listInventoryResourcesWithFilters` List inventory resources with filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.listInventoryResourcesWithFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string[]` | No | A list of property names to return in the response. If not specified, all resource properties will be returned. | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | Optional "nextToken" value from the last API response. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__hasPii` | `boolean` | No | Include only resources that have a high likelihood of containing PII based on the resource metadata. | | `filter__region` | `string` | No | The region of the cloud account to which the resoure belongs. | | `filter__search` | `string` | No | Free-text search on the resource name. | | `filter__noOwner` | `boolean` | No | Include only resources that have not been assigned an owner. | | `filter__regions` | `string[]` | No | List of regions to which the resoure belongs to in that cloud account. | | `filter__hasOwner` | `boolean` | No | Include only resources that have been assigned an owner. | | `filter__parentId` | `string` | No | The parent Id of the resource. E.g. Borneo-specific GCP subscription ID for GCP resources | | `filter__accountId` | `string` | No | The account ID of the cloud account to which the resoure belongs. E.g. a 12-digit AWS account ID. | | `filter__dataRisks` | `string[]` | No | Filter the resources that has data risks. | | `filter__firstSeen` | `object` | No | Set of conditions for comparing two timestamps. | | `filter__resourceIds` | `string[]` | No | One or more resource IDs to return. | | `filter__resourceTags` | `object[]` | No | Filter the resources based on tags | | `filter__resourceType` | `string` | No | Filter the resources based on the resource type. | | `filter__severityScore` | `number[]` | No | Filter the resources based on the assigned risk severity score; "critical" = 4, "high" = 3, "medium" = 2, "low" = 1. | | `filter__classification` | `string[]` | No | Filter the resources based on classification and are non-compliant. eg "PII\_L1", "PII\_L2", "PII\_L3". Custom added classifications is also supported. | | `include__violationMetrics` | `boolean` | No | Include violation count by severity for resource and child resources. | | `filter__hideBorneoResources` | `boolean` | No | Whether to hide resources that are part of the Borneo data plane. | | `filter__dataSourceCategories` | `AWSDataStores \| AzureDataStores \| CloudApplications \| DiscoveredApplications \| GCPDataStores \| StandaloneDataStores[]` | No | Filter the resources based on the data source category Current supported values: AWS\_DATA\_STORES, GCP\_DATA\_STORES, STANDALONE\_DATA\_STORES, CLOUD\_APPLICATIONS, DISCOVERED\_APPLICATIONS | | `filter__scannableResourceTypes` | `boolean` | No | Filter the resources that are scannable | | `include__frameworkExceptionsCount` | `boolean` | No | Include framework exceptions count for the resource and its children | | `include__childResourceStats__scans` | `boolean` | No | Include aggregate scan stats from child resources. | | `include__childResourceStats__dataSize` | `boolean` | No | Include aggregate data size stats from child resources. | > **filter\_\_firstSeen full type** > > ```ts theme={null} > { > additionalProperties?: number > } > ``` > **filter\_\_resourceTags full type** > > ```ts theme={null} > { > source: string, > tagKey: string, > tagValue: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > select?: string, > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__hasPii?: boolean, > filter__region?: string, > filter__search?: string, > filter__noOwner?: boolean, > filter__regions?: string, > filter__hasOwner?: boolean, > filter__parentId?: string, > filter__accountId?: string, > filter__dataRisks?: string, > filter__firstSeen?: number, > filter__resourceIds?: string, > filter__resourceTags?: string, > filter__resourceType?: string, > filter__severityScore?: number, > filter__classification?: string, > include__violationMetrics?: boolean, > filter__hideBorneoResources?: boolean, > filter__dataSourceCategories?: string, > filter__scannableResourceTypes?: boolean, > include__frameworkExceptionsCount?: boolean, > include__childResourceStats__scans?: boolean, > include__childResourceStats__dataSize?: boolean, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listLeafResourcesWithFilters `resources.listLeafResourcesWithFilters` List leaf resources with filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.listLeafResourcesWithFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | Optional "nextToken" value from the last API response. | | `sourceType` | `string` | No | Filter resource based on the resource type. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__region` | `string[]` | No | One or more cloud provider regions. | | `filter__schema` | `string[]` | No | List tables from a specific schema. Supported for the following resource types: Presto. | | `filter__search` | `string` | No | Free-text search on the resource name. | | `filter__status` | `string[]` | No | Filter the resources based on list of status. | | `filter__account` | `string[]` | No | One or more cloud provider account IDs. | | `filter__dataset` | `string[]` | No | List tables from a specific dataset. Supported for on the following resource types: BigQuery. | | `filter__driveId` | `string[]` | No | List drives from a specific driveId. Supported for the following resource types: Gdrive. | | `filter__noOwner` | `boolean` | No | Include only resources that have not been assigned an owner. | | `filter__scanned` | `boolean` | No | Include only resources that have been scanned. | | `filter__database` | `string[]` | No | List tables from a specific database. Supported for the following resource types: (RDS) PostgreSQL, (RDS) MySQL, MongoDB. | | `filter__hasOwner` | `boolean` | No | Include only resources that have been assigned an owner. | | `filter__instance` | `string[]` | No | One or more resource IDs of the instances to which the resources belong, i.e. the parent resource ID. | | `filter__parentId` | `string` | No | Filter the resources which has the specified parent ID. | | `filter__driveType` | `string[]` | No | List drives from a specific drive type. Supported for the following resource types: Gdrive. | | `filter__firstSeen` | `object` | No | Set of conditions for comparing two timestamps. | | `filter__orgUnitId` | `string[]` | No | List orgUnits from a specific orgUnitIds. Supported for the following resource types: Gdrive. | | `filter__spaceType` | `string[]` | No | Filter conlfluences based on type | | `filter__categories` | `string[]` | No | Filter the resources matching with the list of categories. | | `filter__resourceId` | `string[]` | No | Filter the resources with the specified resource IDs. | | `filter__spaceStatus` | `string[]` | No | Filter conlfluences based on status | | `filter__resourceTags` | `object[]` | No | Filter the resources based on tags | | `filter__resourceType` | `string[]` | No | Filter the resources which can be scanned by Borneo. | | `filter__severityScore` | `CRITICAL \| HIGH \| INFORMATIONAL \| LOW \| MEDIUM[]` | No | Filter the resources based on the assigned risk severity score; "critical" = 4, "high" = 3, "medium" = 2, "low" = 1. | | `filter__classification` | `string[]` | No | Filter the resources matching with the list of classifications. | | `filter__infoTypes__ops` | `AND \| OR` | No | Ops | | `include__violationSummary` | `boolean` | No | Violationsummary | | `filter__infoTypes__infoTypes` | `string[]` | No | The list of infotypes to filter on. | | `include__frameworkExceptionsCount` | `boolean` | No | Frameworkexceptionscount | > **filter\_\_firstSeen full type** > > ```ts theme={null} > { > additionalProperties?: number > } > ``` > **filter\_\_resourceTags full type** > > ```ts theme={null} > { > source: string, > tagKey: string, > tagValue: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string, > sourceType?: string, > sort__column?: string, > filter__region?: string, > filter__schema?: string, > filter__search?: string, > filter__status?: string, > filter__account?: string, > filter__dataset?: string, > filter__driveId?: string, > filter__noOwner?: boolean, > filter__scanned?: boolean, > filter__database?: string, > filter__hasOwner?: boolean, > filter__instance?: string, > filter__parentId?: string, > filter__driveType?: string, > filter__firstSeen?: number, > filter__orgUnitId?: string, > filter__spaceType?: string, > filter__categories?: string, > filter__resourceId?: string, > filter__spaceStatus?: string, > filter__resourceTags?: string, > filter__resourceType?: string, > filter__severityScore?: string, > filter__classification?: string, > include__violationSummary?: boolean, > filter__infoTypes__infoTypes?: string, > include__frameworkExceptionsCount?: boolean, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postClassificationStats `resources.postClassificationStats` Post classification stats **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.postClassificationStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter__classification` | `string` | No | Classification | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postResourceLineageFilter `resources.postResourceLineageFilter` Post resource lineage filter **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.postResourceLineageFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter__resourceId` | `string` | No | Resourceid | | `filter__upstreamDepth` | `number` | No | Upstreamdepth | | `filter__downstreamDepth` | `number` | No | Downstreamdepth | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > filter__upstreamDepth?: number, > filter__downstreamDepth?: number, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postResourceStatsWithDeletedResources `resources.postResourceStatsWithDeletedResources` Post resource stats with deleted resources **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.postResourceStatsWithDeletedResources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `includeDeletedResources` | `boolean` | No | Includedeletedresources | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > includeDeletedResources?: boolean > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveDataResourceStatistics `resources.retrieveDataResourceStatistics` Retrieve data resource statistics **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.retrieveDataResourceStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sourceType` | `string` | No | Sourcetype | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveResourceCatalogById `resources.retrieveResourceCatalogById` Retrieve resource catalog by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.retrieveResourceCatalogById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `resourceId` | `string` | Yes | The unique resource ID. | | `includeParentDetails` | `boolean` | No | Includeparentdetails | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > includeParentDetails?: boolean > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### retrieveResourceColumns `resources.retrieveResourceColumns` Retrieve resource columns **Risk:** `read` ```ts theme={null} await corsair.borneo.api.resources.retrieveResourceColumns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataspace` | `string[]` | No | Dataspace | | `searchKey` | `string` | No | Searchkey | | `resourceId` | `string[]` | No | Resourceid | | `sourceType` | `string` | No | Sourcetype | | `parentResourceId` | `string` | Yes | Parentresourceid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Scans ### accessScanIterationById `scans.accessScanIterationById` Access scan iteration by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.accessScanIterationById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scanIterationId` | `string` | Yes | The unique resource ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### createAndScheduleCloudResourceScan `scans.createAndScheduleCloudResourceScan` Create and schedule cloud resource scan **Risk:** `write` ```ts theme={null} await corsair.borneo.api.scans.createAndScheduleCloudResourceScan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cron` | `*/30 * * * * \| 0 */1 * * * \| 0 */12 * * * \| 0 */4 * * * \| 0 */6 * * * \| 0 */8 * * * \| 0 0 * * * \| 0 0 * * 0 \| 0 0 1 * * \| 0 0 1 1,4,7,10 * \| 0 0 1 1,7 *` | No | The cron schedule expression to use for a recurring scan. Only a fixed set of cron expressions can be used to run scans at 30 minute, 1 hour, 1 day, or 1 week intervals. | | `name` | `string` | No | The name of the scan. | | `scanType` | `full \| sample` | No | The type of scan to perform, i.e. either full scan or sample scan. | | `scanFilter` | `object[]` | No | Filter conditions to apply to the scan. | | `connectorId` | `string` | No | The ID of the connector to use for the scan. The connector type must match the resource type. | | `resourceType` | `string` | No | The type of resource to scan. | | `scheduleType` | `cron \| once` | Yes | A schedule type of "once" indicates that the scan will be executed once immediately at the time it is created or once as per the scheduled calendar time. A schedule type of "cron" creates a recurring scan that will be executed at the specified cron schedule. | | `resources__all` | `boolean` | No | Set this to `true` to determine the set of resources to scan based on the filter conditions in the `resources` property. If set to `false`, a static set of `resourceIds` must be specified. | | `resources__name` | `string[]` | No | Name | | `resources__tags` | `object[]` | No | Filter the resources which have teh tags | | `resources__region` | `string` | No | The region of the cloud account to which the resoure belongs. | | `resources__schema` | `string[]` | No | Filter the resources with the list of schemas for selected connector types | | `resources__search` | `string` | No | Free-text search on the resource name. | | `resources__teamId` | `string` | No | Slack Workspace id in Slack Enterprise Connector | | `resources__dataset` | `string[]` | No | Filter the resources with the list of datasetss for selected connector types | | `resources__driveId` | `string[]` | No | Filter the resources with the list of driveIds for gdrive connector types | | `resources__regions` | `string[]` | No | List of regions to which the resoure belongs to in that cloud account. | | `resources__teamUrl` | `string` | No | Slack Workspace URL in Slack Enterprise Connector | | `schedule__timezone` | `string` | No | time zone to be considered for the schedule | | `resources__database` | `string[]` | No | Filter the resources with the list of databaseses for selected connector types | | `resources__isPublic` | `boolean` | No | Filter the resources which are public. | | `resources__parentId` | `string` | No | Filter the resources which has the specified parent id. | | `resources__teamName` | `string` | No | Slack Workspace name in Slack Enterprise Connector | | `schedule__calendars` | `object[]` | No | List of schedules | | `resources__accountId` | `string` | No | The account ID of the cloud account to which the resoure belongs. E.g. a 12-digit AWS account ID. | | `resources__driveType` | `string[]` | No | Filter the resources with the list of driveTypes for gdrive connector types | | `resources__isPrivate` | `boolean` | No | Private channels, for Slack Enterprise Connector | | `resources__orgUnitId` | `string[]` | No | Filter the resources with the list of orgUnits for gdrive connector types | | `resources__spaceType` | `string[]` | No | Filter conlfluences based on type | | `resources__isArchived` | `boolean` | No | Filter the channels marked as archived for Slack connector types | | `resources__isExternal` | `boolean` | No | Filter the channels marked as external for Slack connector types | | `resources__resourceIds` | `string[]` | No | One or more resource IDs to return. | | `resources__spaceStatus` | `string[]` | No | Filter conlfluences based on status | | `resources__googleGroups` | `string[]` | No | Googlegroups | | `resources__resourceType` | `string` | No | Filter the resources based on the resource type. | | `resources__isUnencrypted` | `boolean` | No | Filter the resources which are un-unencrypted. | | `resources__infoTypes__ops` | `AND \| OR` | No | Ops | | `resources__zendeskGroupId` | `number[]` | No | Zendeskgroupid | | `scanLimits__itemsPerBatch` | `number` | No | Maximum number of item (records, objects, etc.) to scan per resource. Supported for sample scans on the following resource types: S3, DynamoDB, PostgreSQL, MySQL, Presto, MongoDB, BigQuery, Cassandra. | | `inspectionPolicy__infotypes` | `string[]` | No | List of infotypes to scan for. If empty, all enabled infotypes will be included. | | `inspectionPolicy__compliance` | `string[]` | No | List of infotype categories to scan for. All enabled infotypes included in the specified categories will be used in the scan. If `infotypes` is also specified, this list of infotype categories will be ignored. | | `scanLimits__samplePercentage` | `number` | No | Percentage of data to scan per resource. Supported for full scans on the following resource types: S3, BigQuery. | | `inspectionPolicy__maskDetails` | `boolean` | No | If true, the matched tokens captured as part of the detailed scan results will be masked. If false, the raw, unmasked tokens will be captured. Use with caution. Only applicable if `detailed` scan results are enabled. | | `inspectionPolicy__collectTokens` | `boolean` | No | If true, the scan will capture details about every infotype match, including the matched token, and exact location of the token. If false, the scan will capture only aggregate results (a.k.a. "snapshot" results). | | `resources__infoTypes__infoTypes` | `string[]` | No | The list of infotypes to filter on. | | `resources__isSlackDirectMessages` | `boolean` | No | Fetch DMs, for Slack Enterprise Connector | | `scanLimits__sampleDurationMinutes` | `number` | No | Sampledurationminutes | | `scanLimits__maxCumulativeDataSizeMb` | `number` | No | Maximum data size to scan per resource in MB. Supported for full scans on the following resource types: PostgreSQL, MySQL. | > **scanFilter full type** > > ```ts theme={null} > { > type?: fileExtensions | internalDomains | jiraProjects | lastModifiedGreaterThan | lastModifiedLessThan | onlyIncludeKeys | prefix | scanAttachments | visibilityFilter | zendeskGroups, > filters?: string[] > }[] > ``` > **resources\_\_tags full type** > > ```ts theme={null} > { > action: exclude | include, > tagKey: string, > tagValue?: string > }[] > ``` > **schedule\_\_calendars full type** > > ```ts theme={null} > { > hour?: number, > year?: number, > month?: APRIL | AUGUST | DECEMBER | FEBRUARY | JANUARY | JULY | JUNE | MARCH | MAY | NOVEMBER | OCTOBER | SEPTEMBER, > minute?: number, > second?: number, > dayOfMonth?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > cron?: string, > scanType?: string, > scanFilter?: string, > connectorId?: string, > resourceType?: string, > scheduleType?: string, > resources__all?: boolean, > resources__tags?: string, > resources__region?: string, > resources__schema?: string, > resources__search?: string, > resources__teamId?: string, > resources__dataset?: string, > resources__driveId?: string, > resources__regions?: string, > resources__teamUrl?: string, > schedule__timezone?: string, > resources__database?: string, > resources__isPublic?: boolean, > resources__parentId?: string, > resources__teamName?: string, > schedule__calendars?: number, > resources__accountId?: string, > resources__driveType?: string, > resources__isPrivate?: boolean, > resources__orgUnitId?: string, > resources__spaceType?: string, > resources__isArchived?: boolean, > resources__isExternal?: boolean, > resources__resourceIds?: string, > resources__spaceStatus?: string, > resources__googleGroups?: string, > resources__resourceType?: string, > resources__isUnencrypted?: boolean, > resources__infoTypes__ops?: string, > resources__zendeskGroupId?: number, > scanLimits__itemsPerBatch?: number, > inspectionPolicy__infotypes?: string, > inspectionPolicy__compliance?: string, > scanLimits__samplePercentage?: number, > inspectionPolicy__maskDetails?: boolean, > inspectionPolicy__collectTokens?: boolean, > resources__infoTypes__infoTypes?: string, > resources__isSlackDirectMessages?: boolean, > scanLimits__sampleDurationMinutes?: number, > scanLimits__maxCumulativeDataSizeMb?: number > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### exportInsightPageUsingScanId `scans.exportInsightPageUsingScanId` Export insight page using scanid **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.exportInsightPageUsingScanId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scanId` | `string` | Yes | The unique scan ID. | | `detailed` | `boolean` | No | Set to `true` if the results exported to have detailed column level information of the detected infotypes with masked tokens if captured. | | `filter__pageId` | `string` | No | Unique page ID. Only applicable to page-level results. | | `filter__scanId` | `string` | No | Unique scan ID. | | `filter__search` | `string` | No | Free-text search on the resource name. | | `filter__status` | `deleted \| failed \| paused \| scanning \| success \| terminated[]` | No | Status | | `filter__categories` | `string[]` | No | infotype categories | | `filter__userEmails` | `string[]` | No | Useremails | | `filter__resourceIds` | `string[]` | No | One or more resource IDs for which to retrieve results. Only applicable to page-level results. | | `filter__resourceType` | `string` | No | Resource type to filter results by. | | `filter__fileExtension` | `string[]` | No | Fileextension | | `filter__infoTypes__ops` | `AND \| OR` | No | Ops | | `filter__scanIterationId` | `string` | No | Unique scan iteration ID to fetch results for a specific run of | | `filter__infotypeConfidence` | `certain \| likely \| potential[]` | No | Infotypeconfidence | | `filter__infoTypes__infoTypes` | `string[]` | No | The list of infotypes to filter on. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > detailed?: boolean, > filter__pageId?: string, > filter__search?: string, > filter__status?: string, > filter__categories?: string, > filter__resourceIds?: string, > filter__resourceType?: string, > filter__fileExtension?: string, > filter__scanIterationId?: string, > filter__infotypeConfidence?: string, > filter__infoTypes__infoTypes?: string, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### filterAndListInspectionResults `scans.filterAndListInspectionResults` Filter and list inspection results **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.filterAndListInspectionResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `page \| scan` | Yes | Type of inspection result, i.e. scan-level or page-level results. | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__pageId` | `string` | No | Unique page ID. Only applicable to page-level results. | | `filter__scanId` | `string` | No | Unique scan ID. | | `filter__search` | `string` | No | Free-text search on the resource name. | | `filter__status` | `deleted \| failed \| paused \| scanning \| success \| terminated[]` | No | Status | | `filter__categories` | `string[]` | No | infotype categories | | `filter__userEmails` | `string[]` | No | Useremails | | `filter__resourceIds` | `string[]` | No | One or more resource IDs for which to retrieve results. Only applicable to page-level results. | | `filter__resourceType` | `string` | No | Resource type to filter results by. | | `filter__fileExtension` | `string[]` | No | Fileextension | | `filter__infoTypes__ops` | `AND \| OR` | No | Ops | | `filter__scanIterationId` | `string` | No | Unique scan iteration ID to fetch results for a specific run of | | `filter__infotypeConfidence` | `certain \| likely \| potential[]` | No | Infotypeconfidence | | `filter__infoTypes__infoTypes` | `string[]` | No | The list of infotypes to filter on. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > type?: string, > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__pageId?: string, > filter__search?: string, > filter__status?: string, > filter__categories?: string, > filter__resourceIds?: string, > filter__resourceType?: string, > filter__fileExtension?: string, > filter__scanIterationId?: string, > filter__infotypeConfidence?: string, > filter__infoTypes__infoTypes?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### getInsightByTypeAndId `scans.getInsightByTypeAndId` Get insight by type and id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.getInsightByTypeAndId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique ID of the inspection result to fetch. | | `type` | `page \| scan` | Yes | The type of inspection result to fetch. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string, > type?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### getScanByScanId `scans.getScanByScanId` Get scan by scanid **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.getScanByScanId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scanId` | `string` | Yes | Scanid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > scanId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listErrorDetailsFromFilteredScanIterations `scans.listErrorDetailsFromFilteredScanIterations` List error details from filtered scan iterations **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.listErrorDetailsFromFilteredScanIterations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string[]` | No | List of column names to include in the response. | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__scanId` | `string` | No | Scanid | | `filter__accountId` | `string` | No | Accountid | | `filter__resourceId` | `string` | No | Resourceid | | `filter__scanExecutionId` | `string` | No | Scanexecutionid | | `filter__scanIterationId` | `string` | No | Scaniterationid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > select?: string, > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__scanExecutionId?: string, > filter__scanIterationId?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listInsightFilters `scans.listInsightFilters` List insight filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.listInsightFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scanId` | `string` | No | Scanid | | `filterType` | `fileExtension` | No | Filtertype | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listScanExecutionResults `scans.listScanExecutionResults` List scan execution results **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.listScanExecutionResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | Nexttoken | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__scanId` | `string` | No | Unique scan ID. | | `filter__search` | `string` | No | Free-text search on the resource name. | | `filter__statuses` | `deleted \| failed \| paused \| scanning \| success \| terminated[]` | No | Statuses | | `filter__resourceIds` | `string[]` | No | One or more resource IDs for which to retrieve results. Only applicable to page-level results. | | `filter__infoTypes__ops` | `AND \| OR` | No | Ops | | `filter__scanIterationId` | `string` | No | Scaniterationid | | `filter__infotypeConfidence` | `certain \| likely \| potential[]` | No | One or more confidence matches for the scan. | | `filter__infoTypes__infoTypes` | `string[]` | No | The list of infotypes to filter on. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > sort__column?: string, > filter__search?: string, > filter__statuses?: string, > filter__resourceIds?: string, > filter__scanIterationId?: string, > filter__infotypeConfidence?: string, > filter__infoTypes__infoTypes?: string, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listScanIterationsWithFilter `scans.listScanIterationsWithFilter` List scan iterations with filter **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.listScanIterationsWithFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string[]` | No | List of column names to include in the response. | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__scanId` | `string` | No | Scanid | | `filter__resourceId` | `string` | No | Resourceid | | `filter__scanIterationId` | `string` | No | Scaniterationid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > select?: string, > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__scanIterationId?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listScansWithFilters `scans.listScansWithFilters` List scans with filters **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.listScansWithFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string[]` | No | List of column names to include in the response. | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Free-form text search to apply to the scan name. | | `filter__status` | `string[]` | No | One or more scan statuses (e.g. `inprogress`, `completed`, etc.) to filter results by. | | `filter__scanType` | `string[]` | No | One or more scan types (i.e. "full" or "sample") to filter results by. | | `getNextExecution` | `boolean` | No | IF true, nextExecution will be populated for postponed and repeated scans | | `filter__accountId` | `string[]` | No | One or more AWS accounts to filter results by. | | `filter__resources` | `string[]` | No | One or more resource IDs to filter results by. | | `filter__connectorId` | `string[]` | No | One or more connector IDs to filter results by. | | `filter__dataPlaneId` | `string[]` | No | One or more data plane IDs to filter results by. | | `filter__gcpProjectId` | `string[]` | No | One or more GCP projects to filter results by. | | `filter__resourceType` | `string[]` | No | One or moreresource types to filter results by. | | `filter__dataPlaneName` | `string[]` | No | One or more data plane names to filter results by. | | `filter__infoTypes__ops` | `AND \| OR` | No | Ops | | `filter__infoTypes__infoTypes` | `string[]` | No | The list of infotypes to filter on. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > select?: string, > pageSize?: number, > nextToken?: string, > sort__column?: string, > filter__search?: string, > filter__status?: string, > filter__scanType?: string, > getNextExecution?: boolean, > filter__accountId?: string, > filter__resources?: string, > filter__connectorId?: string, > filter__dataPlaneId?: string, > filter__gcpProjectId?: string, > filter__resourceType?: string, > filter__dataPlaneName?: string, > filter__infoTypes__infoTypes?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### markScanFalsePositivesById `scans.markScanFalsePositivesById` Mark scan false positives by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.scans.markScanFalsePositivesById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scanId` | `string` | Yes | The unique scan ID. | | `reports` | `string[]` | No | Reports | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### pauseScanById `scans.pauseScanById` Pause scan by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.scans.pauseScanById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scanId` | `string` | Yes | The unique scan ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### postScanResourceStatus `scans.postScanResourceStatus` Post scan resource status **Risk:** `read` ```ts theme={null} await corsair.borneo.api.scans.postScanResourceStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scanId` | `string` | Yes | The unique scan ID. | | `pageSize` | `number` | No | The maximum number of records to return per API call. If more records are available, the response will be truncated and will contain a "nextToken" value, which can be used to return additional records. | | `nextToken` | `string` | No | The `nextToken` from the last page of results to retrieve the next page of results. | | `filter__name` | `string` | No | Name | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageSize?: number, > nextToken?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### resumeScanById `scans.resumeScanById` Resume scan by id **Risk:** `write` ```ts theme={null} await corsair.borneo.api.scans.resumeScanById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scanId` | `string` | Yes | The unique scan ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### scanLegalDocumentById `scans.scanLegalDocumentById` Scan legal document byid **Risk:** `write` ```ts theme={null} await corsair.borneo.api.scans.scanLegalDocumentById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | Documentid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### stopScanViaScanId `scans.stopScanViaScanId` Stop scan via scanid **Risk:** `write` ```ts theme={null} await corsair.borneo.api.scans.stopScanViaScanId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scanId` | `string` | Yes | The unique scan ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### submitDetailedScanResults `scans.submitDetailedScanResults` Submit detailed scan results **Risk:** `write` ```ts theme={null} await corsair.borneo.api.scans.submitDetailedScanResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageId` | `string` | No | Page ID for one of the pages produced by the scan. | | `scanId` | `string` | Yes | Scan ID of the scan that produced the inspection result. | | `resourceId` | `string` | Yes | Resource ID for the resource for which the page was produced. | | `scanIterationId` | `string` | Yes | ScanIteration ID of the scan that produced the inspection result. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > pageId?: string, > scanId?: string, > resourceId?: string, > scanIterationId?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Support ### postSupportChatQuery `support.postSupportChatQuery` Post support chat query **Risk:** `write` ```ts theme={null} await corsair.borneo.api.support.postSupportChatQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | Query | | `sessionId` | `string` | No | Sessionid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ## Users ### getUserProfileById `users.getUserProfileById` Get user profile by id **Risk:** `read` ```ts theme={null} await corsair.borneo.api.users.getUserProfileById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | Userid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### listUserProfileWithFiltersAndSorting `users.listUserProfileWithFiltersAndSorting` List user profile with filters and sorting **Risk:** `read` ```ts theme={null} await corsair.borneo.api.users.listUserProfileWithFiltersAndSorting({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select` | `string[]` | No | Select | | `pageSize` | `number` | No | Pagesize | | `nextToken` | `string` | No | Nexttoken | | `sort__order` | `ASC \| DESC` | No | Order | | `sort__column` | `string` | No | The column name to sort on. | | `filter__search` | `string` | No | Search | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > sort__column?: string, > nextToken?: string, > items?: string[] > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** ### verifyEmailWithIdAndToken `users.verifyEmailWithIdAndToken` Verify email with id and token **Risk:** `write` ```ts theme={null} await corsair.borneo.api.users.verifyEmailWithIdAndToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | Yes | Token | | `verificationId` | `string` | Yes | Verificationid | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `error` | `object` | No | — | | `successful` | `true` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > id?: string > }, > error?: string, > successful?: boolean > } > ``` > **error full type** > > ```ts theme={null} > string | { > message: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/borneo/database Borneo local sync: searchable entities, `.search()` filters, and operators. The Borneo plugin syncs data locally. Use `corsair.borneo.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/borneo/overview Borneo plugin for Corsair Use **Borneo** through Corsair: one client, typed API calls. **What you get:** * 153 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/borneo ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/borneo ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/borneo ``` ```bash bun theme={null} bun add corsair @corsair-dev/borneo ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { borneo } from '@corsair-dev/borneo'; export const corsair = createCorsair({ plugins: [ borneo(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} borneo() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Borneo OAuth app. ```ts theme={null} borneo({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'borneo', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.getCloudAccountById`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.borneo.api.accounts.getCloudAccountById({}); ``` **`assets.createNewAsset`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.borneo.api.assets.createNewAsset({}); ``` See the full list on the [API](/plugins/borneo/api) page. ## What's next > **[API reference](/plugins/borneo/api)** > > Every `borneo.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/botbaba/api API reference for Botbaba: every `botbaba.api.*` operation with input and output types. Every `botbaba.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Actions ### execute `actions.execute` Execute a bot action for a conversation **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.actions.execute({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `action` | `string` | No | — | | `conv_id` | `string` | No | — | | `tag_ids` | `string` | No | — | | `action_id` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### executeByUser `actions.executeByUser` Execute a bot action for users **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.actions.executeByUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `action` | `string` | No | — | | `bot_id` | `number` | No | — | | `action_id` | `number` | No | — | | `bot_user_id` | `any[]` | No | — | | `json_payload` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getWidgetSettings `actions.getWidgetSettings` Get bot widget settings **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.actions.getWidgetSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bot_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Broadcasts ### delete `broadcasts.delete` Delete a broadcast **Risk:** `destructive` ```ts theme={null} await corsair.botbaba.api.broadcasts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `broadcast_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### get `broadcasts.get` Get a broadcast **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.broadcasts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `broadcast_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### list `broadcasts.list` List broadcasts **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.broadcasts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Contacts ### delete `contacts.delete` Delete a Botbaba contact **Risk:** `destructive` ```ts theme={null} await corsair.botbaba.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### get `contacts.get` Fetch a Botbaba contact by ID **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getAnalytics `contacts.getAnalytics` Retrieve contact analytics over a date range **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.contacts.getAnalytics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `end_date` | `string` | No | — | | `start_date` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### update `contacts.update` Update an existing Botbaba contact **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `tags` | `string[]` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `last_name` | `string` | No | — | | `first_name` | `string` | No | — | | `custom_fields` | `object` | No | — | > **custom\_fields full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Flows ### delete `flows.delete` Delete a conversation flow **Risk:** `destructive` ```ts theme={null} await corsair.botbaba.api.flows.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `flow_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### get `flows.get` Get a conversation flow **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.flows.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `flow_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### list `flows.list` List conversation flows **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.flows.list({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Gupshup ### forwardMessage `gupshup.forwardMessage` Forward a Gupshup WhatsApp webhook to Botbaba **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.gupshup.forwardMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Messages ### get `messages.get` Get a message **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### getAnalytics `messages.getAnalytics` Get message analytics **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.messages.getAnalytics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### list `messages.list` List messages **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### sendWhatsappTemplate `messages.sendWhatsappTemplate` Send a WhatsApp template via Botbaba **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.messages.sendWhatsappTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Shopify ### cartCreation `shopify.cartCreation` Forward Shopify cart creation to Botbaba **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.shopify.cartCreation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | | `X-Shopify-Topic` | `string` | No | — | | `X-Shopify-Webhook-Id` | `string` | No | — | | `X-Shopify-API-Version` | `string` | No | — | | `X-Shopify-Hmac-SHA256` | `string` | No | — | | `X-Shopify-Shop-Domain` | `string` | No | — | | `X-Shopify-Triggered-At` | `string` | No | — | | `x_shopify_topic` | `string` | No | — | | `x_shopify_webhook_id` | `string` | No | — | | `x_shopify_api_version` | `string` | No | — | | `x_shopify_hmac_sha256` | `string` | No | — | | `x_shopify_shop_domain` | `string` | No | — | | `x_shopify_triggered_at` | `string` | No | — | > **payload full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### cartUpdate `shopify.cartUpdate` Forward Shopify cart update to Botbaba **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.shopify.cartUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | | `X-Shopify-Topic` | `string` | No | — | | `X-Shopify-Webhook-Id` | `string` | No | — | | `X-Shopify-API-Version` | `string` | No | — | | `X-Shopify-Hmac-SHA256` | `string` | No | — | | `X-Shopify-Shop-Domain` | `string` | No | — | | `X-Shopify-Triggered-At` | `string` | No | — | | `x_shopify_topic` | `string` | No | — | | `x_shopify_webhook_id` | `string` | No | — | | `x_shopify_api_version` | `string` | No | — | | `x_shopify_hmac_sha256` | `string` | No | — | | `x_shopify_shop_domain` | `string` | No | — | | `x_shopify_triggered_at` | `string` | No | — | > **payload full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### checkoutCreation `shopify.checkoutCreation` Forward Shopify checkout creation to Botbaba **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.shopify.checkoutCreation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | | `X-Shopify-Topic` | `string` | No | — | | `X-Shopify-Webhook-Id` | `string` | No | — | | `X-Shopify-API-Version` | `string` | No | — | | `X-Shopify-Hmac-SHA256` | `string` | No | — | | `X-Shopify-Shop-Domain` | `string` | No | — | | `X-Shopify-Triggered-At` | `string` | No | — | | `x_shopify_topic` | `string` | No | — | | `x_shopify_webhook_id` | `string` | No | — | | `x_shopify_api_version` | `string` | No | — | | `x_shopify_hmac_sha256` | `string` | No | — | | `x_shopify_shop_domain` | `string` | No | — | | `x_shopify_triggered_at` | `string` | No | — | > **payload full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### checkoutUpdate `shopify.checkoutUpdate` Forward Shopify checkout update to Botbaba **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.shopify.checkoutUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_payload` | `object` | Yes | — | | `X-Shopify-Topic` | `string` | No | — | | `X-Shopify-Webhook-Id` | `string` | No | — | | `X-Shopify-API-Version` | `string` | No | — | | `X-Shopify-Hmac-SHA256` | `string` | No | — | | `X-Shopify-Shop-Domain` | `string` | No | — | | `X-Shopify-Triggered-At` | `string` | No | — | | `x_shopify_topic` | `string` | No | — | | `x_shopify_webhook_id` | `string` | No | — | | `x_shopify_api_version` | `string` | No | — | | `x_shopify_hmac_sha256` | `string` | No | — | | `x_shopify_shop_domain` | `string` | No | — | | `x_shopify_triggered_at` | `string` | No | — | > **webhook\_payload full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### orderCancellation `shopify.orderCancellation` Forward Shopify order cancellation to Botbaba **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.shopify.orderCancellation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | | `X-Shopify-Topic` | `string` | Yes | — | | `X-Shopify-Webhook-Id` | `string` | Yes | — | | `X-Shopify-API-Version` | `string` | No | — | | `X-Shopify-Hmac-SHA256` | `string` | Yes | — | | `X-Shopify-Shop-Domain` | `string` | Yes | — | | `X-Shopify-Triggered-At` | `string` | Yes | — | > **payload full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### orderFulfillment `shopify.orderFulfillment` Forward Shopify order fulfillment to Botbaba **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.shopify.orderFulfillment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | | `X-Shopify-Topic` | `string` | No | — | | `X-Shopify-Webhook-Id` | `string` | No | — | | `X-Shopify-API-Version` | `string` | No | — | | `X-Shopify-Hmac-SHA256` | `string` | No | — | | `X-Shopify-Shop-Domain` | `string` | No | — | | `X-Shopify-Triggered-At` | `string` | No | — | | `x_shopify_topic` | `string` | No | — | | `x_shopify_webhook_id` | `string` | No | — | | `x_shopify_api_version` | `string` | No | — | | `x_shopify_hmac_sha256` | `string` | No | — | | `x_shopify_shop_domain` | `string` | No | — | | `x_shopify_triggered_at` | `string` | No | — | > **payload full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### orderPayment `shopify.orderPayment` Forward Shopify order payment to Botbaba **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.shopify.orderPayment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | | `X-Shopify-Event-Id` | `string` | No | — | | `X-Shopify-Topic` | `string` | No | — | | `X-Shopify-Webhook-Id` | `string` | No | — | | `X-Shopify-API-Version` | `string` | No | — | | `X-Shopify-Hmac-SHA256` | `string` | No | — | | `X-Shopify-Shop-Domain` | `string` | No | — | | `X-Shopify-Triggered-At` | `string` | No | — | | `x_shopify_topic` | `string` | No | — | | `x_shopify_webhook_id` | `string` | No | — | | `x_shopify_api_version` | `string` | No | — | | `x_shopify_hmac_sha256` | `string` | No | — | | `x_shopify_shop_domain` | `string` | No | — | | `x_shopify_triggered_at` | `string` | No | — | > **payload full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Simulators ### cartCreation `simulators.cartCreation` Simulate a Shopify cart creation payload **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.simulators.cartCreation({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > } > ``` *** ### checkoutCreation `simulators.checkoutCreation` Simulate a Shopify checkout creation payload **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.simulators.checkoutCreation({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > } > ``` *** ### checkoutUpdate `simulators.checkoutUpdate` Simulate a Shopify checkout update payload **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.simulators.checkoutUpdate({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > } > ``` *** ### gupshup `simulators.gupshup` Simulate a Gupshup WhatsApp webhook payload **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.simulators.gupshup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sender` | `string` | Yes | — | | `recipient` | `string` | Yes | — | | `text` | `string` | No | — | | `timestamp` | `number` | No | — | | `event_type` | `message \| delivery \| read \| interactive` | No | — | | `message_id` | `string` | No | — | | `interactive` | `object` | No | — | > **interactive full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > } > ``` *** ### orderFulfillment `simulators.orderFulfillment` Simulate a Shopify order fulfillment payload **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.simulators.orderFulfillment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `variant` | `standard \| with_tracking \| partial` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > } > ``` *** ## Tags ### delete `tags.delete` Delete a tag **Risk:** `destructive` ```ts theme={null} await corsair.botbaba.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### list `tags.list` List all tags **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.tags.list({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### update `tags.update` Rename a tag **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.tags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `tag_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Templates ### delete `templates.delete` Delete a message template **Risk:** `destructive` ```ts theme={null} await corsair.botbaba.api.templates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### get `templates.get` Get a message template **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.templates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### list `templates.list` List message templates **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.templates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `search` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### update `templates.update` Update a message template **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.templates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `content` | `string` | No | — | | `parameters` | `any[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ## Utils ### getFilename `utils.getFilename` Extract a filename from a path **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.utils.getFilename({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | Yes | — | *** ## Webhooks ### delete `webhooks.delete` Delete a webhook **Risk:** `destructive` ```ts theme={null} await corsair.botbaba.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### get `webhooks.get` Get a webhook **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### list `webhooks.list` List webhooks **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### listEventTypes `webhooks.listEventTypes` List webhook event types **Risk:** `read` ```ts theme={null} await corsair.botbaba.api.webhooks.listEventTypes({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** ### update `webhooks.update` Update a webhook **Risk:** `write` ```ts theme={null} await corsair.botbaba.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | | `url` | `string` | No | — | | `active` | `boolean` | No | — | | `events` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | any[] | string | number | boolean | null > ``` *** # Database Source: https://docs.corsair.dev/plugins/botbaba/database Botbaba local sync: searchable entities, `.search()` filters, and operators. The Botbaba plugin syncs data locally. Use `corsair.botbaba.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Broadcasts Path: `botbaba.db.broadcasts.search` ```ts theme={null} const rows = await corsair.botbaba.db.broadcasts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `broadcast_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `botbaba.db.contacts.search` ```ts theme={null} const rows = await corsair.botbaba.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `contact_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Flows Path: `botbaba.db.flows.search` ```ts theme={null} const rows = await corsair.botbaba.db.flows.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `flow_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `botbaba.db.messages.search` ```ts theme={null} const rows = await corsair.botbaba.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `message_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `botbaba.db.tags.search` ```ts theme={null} const rows = await corsair.botbaba.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `tag_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `botbaba.db.templates.search` ```ts theme={null} const rows = await corsair.botbaba.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `template_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `botbaba.db.webhooks.search` ```ts theme={null} const rows = await corsair.botbaba.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `webhook_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/botbaba/overview Chatbot builder platform for creating conversational bots across messaging channels. Use **Botbaba** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 43 typed API operations * 7 synced entities (`broadcasts`, `contacts`, `flows`, `messages`, `tags`, `templates`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/botbaba ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/botbaba ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/botbaba ``` ```bash bun theme={null} bun add corsair @corsair-dev/botbaba ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { botbaba } from '@corsair-dev/botbaba'; export const corsair = createCorsair({ plugins: [ botbaba(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} botbaba() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'botbaba', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`actions.getWidgetSettings`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.botbaba.api.actions.getWidgetSettings({}); ``` **`actions.execute`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.botbaba.api.actions.execute({}); ``` See the full list on the [API](/plugins/botbaba/api) page. ## Query synced data Synced entities support `tenant.botbaba.db..search()` and `.list()`: `broadcasts`, `contacts`, `flows`, `messages`, `tags`, `templates`, `webhooks`. See [Database](/plugins/botbaba/database) for filters and operators. ## What's next > **[API reference](/plugins/botbaba/api)** > > Every `botbaba.api.*` operation with input and output types. > **[Database](/plugins/botbaba/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/botpress/api API reference for Botpress: every `botpress.api.*` operation with input and output types. Every `botpress.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get the authenticated account **Risk:** `read` ```ts theme={null} await corsair.botpress.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | No | — | | `displayName` | `string` | No | — | | `createdAt` | `string` | No | — | | `emailVerified` | `boolean` | No | — | *** ### getPreference `account.getPreference` Get an account preference by key **Risk:** `read` ```ts theme={null} await corsair.botpress.api.account.getPreference({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `any` | No | — | *** ### setPreference `account.setPreference` Set an account preference by key **Risk:** `write` ```ts theme={null} await corsair.botpress.api.account.setPreference({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | | `value` | `any` | Yes | — | **Output:** *empty object* *** ### update `account.update` Update the authenticated account profile **Risk:** `write` ```ts theme={null} await corsair.botpress.api.account.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `displayName` | `string` | No | — | | `profilePicture` | `string` | No | — | | `refresh` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | No | — | | `displayName` | `string` | No | — | | `createdAt` | `string` | No | — | | `emailVerified` | `boolean` | No | — | *** ## Billing ### chargeUnpaidInvoices `billing.chargeUnpaidInvoices` Charge outstanding invoices for a workspace \[DESTRUCTIVE - real financial action] **Risk:** `destructive` ```ts theme={null} await corsair.botpress.api.billing.chargeUnpaidInvoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `invoiceIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `chargedInvoices` | `object[]` | No | — | | `failedInvoices` | `object[]` | No | — | > **chargedInvoices full type** > > ```ts theme={null} > { > id: string, > amount: number > }[] > ``` > **failedInvoices full type** > > ```ts theme={null} > { > id: string, > amount: number, > failedReason: string > }[] > ``` *** ### getUpcomingInvoice `billing.getUpcomingInvoice` Preview the upcoming invoice for a workspace **Risk:** `read` ```ts theme={null} await corsair.botpress.api.billing.getUpcomingInvoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `lineItems` | `object[]` | No | — | > **lineItems full type** > > ```ts theme={null} > { > id: string, > description?: string | null, > totalInCents?: number | null, > currency?: string | null, > pricePerUnitInCents?: number | null, > quantity?: number | null, > type?: invoiceitem | subscription | null, > periodStart?: string | null, > periodEnd?: string | null > }[] > ``` *** ### listInvoices `billing.listInvoices` List invoices billed to a workspace **Risk:** `read` ```ts theme={null} await corsair.botpress.api.billing.listInvoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > period: { > month: number, > year: number > }, > date?: string | null, > amount?: number | null, > currency?: string | null, > paymentStatus?: deleted | draft | open | paid | uncollectible | void | null, > dueDate?: string | null, > paymentAttemptCount?: number | null, > nextPaymentAttemptDate?: string | null, > pdfUrl?: string | null > }[] > ``` *** ### listUsageHistory `billing.listUsageHistory` List usage history for a workspace or bot **Risk:** `read` ```ts theme={null} await corsair.botpress.api.billing.listUsageHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `invocation_timeout \| invocation_calls \| storage_count \| bot_count \| knowledgebase_vector_storage \| workspace_ratelimit \| table_row_count \| workspace_member_count \| integrations_owned_count \| ai_spend \| openai_spend \| bing_search_spend \| always_alive \| indexed_file_count \| file_max_size_bytes` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > period?: string | null, > value?: number | null, > quota?: number | null, > type?: invocation_timeout | invocation_calls | storage_count | bot_count | knowledgebase_vector_storage | workspace_ratelimit | table_row_count | workspace_member_count | integrations_owned_count | ai_spend | openai_spend | bing_search_spend | always_alive | indexed_file_count | file_max_size_bytes | null > }[] > ``` *** ## Bots ### create `bots.create` Create a bot in a workspace **Risk:** `write` ```ts theme={null} await corsair.botpress.api.bots.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `description` | `string` | No | — | | `tags` | `object` | No | — | | `dev` | `boolean` | No | — | | `code` | `string` | No | — | | `url` | `string` | No | — | | `states` | `object` | No | — | | `events` | `object` | No | — | | `recurringEvents` | `object` | No | — | | `actions` | `object` | No | — | | `configuration` | `object` | No | — | | `user` | `object` | No | — | | `conversation` | `object` | No | — | | `message` | `object` | No | — | | `subscriptions` | `object` | No | — | | `maxExecutionTime` | `number` | No | — | | `medias` | `object` | No | — | | `secrets` | `object` | No | — | | `type` | `studio \| adk` | No | — | | `moduleFormat` | `cjs \| esm` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` > **states full type** > > ```ts theme={null} > { > } > ``` > **events full type** > > ```ts theme={null} > { > } > ``` > **recurringEvents full type** > > ```ts theme={null} > { > } > ``` > **actions full type** > > ```ts theme={null} > { > } > ``` > **configuration full type** > > ```ts theme={null} > { > } > ``` > **user full type** > > ```ts theme={null} > { > } > ``` > **conversation full type** > > ```ts theme={null} > { > } > ``` > **message full type** > > ```ts theme={null} > { > } > ``` > **subscriptions full type** > > ```ts theme={null} > { > } > ``` > **medias full type** > > ```ts theme={null} > { > } > ``` > **secrets full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `createdBy` | `string` | No | — | | `dev` | `boolean` | No | — | | `alwaysAlive` | `boolean` | No | — | | `status` | `string` | No | — | | `type` | `string` | No | — | | `signingSecret` | `string` | No | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### listActionRuns `bots.listActionRuns` List a bot's action-run history **Risk:** `read` ```ts theme={null} await corsair.botpress.api.bots.listActionRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `id` | `string` | Yes | — | | `integrationName` | `string` | No | — | | `timestampFrom` | `string` | No | — | | `timestampUntil` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > timestamp?: string | null, > integrationName?: string | null, > actionType?: string | null, > input?: { > } | null, > inputTruncated?: boolean | null, > output?: { > } | null, > outputTruncated?: boolean | null, > status?: SUCCESS | FAILURE | null, > durationMs?: number | null, > cached?: boolean | null, > errorMessage?: string | null > }[] > ``` *** ### listIssues `bots.listIssues` List configuration and runtime issues for a bot **Risk:** `read` ```ts theme={null} await corsair.botpress.api.bots.listIssues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `issues` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **issues full type** > > ```ts theme={null} > { > id: string, > code?: string | null, > createdAt?: string | null, > lastSeenAt?: string | null, > title?: string | null, > description?: string | null, > eventsCount?: number | null, > category?: user_code | limits | configuration | other | null, > resolutionLink?: string | null > }[] > ``` *** ### update `bots.update` Update a bot **Risk:** `write` ```ts theme={null} await corsair.botpress.api.bots.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `tags` | `object` | No | — | | `blocked` | `boolean` | No | — | | `alwaysAlive` | `boolean` | No | — | | `maxExecutionTime` | `number` | No | — | | `url` | `string` | No | — | | `authentication` | `iam \| hmac-sha256` | No | — | | `configuration` | `object` | No | — | | `user` | `object` | No | — | | `message` | `object` | No | — | | `conversation` | `object` | No | — | | `events` | `object` | No | — | | `actions` | `object` | No | — | | `states` | `object` | No | — | | `recurringEvents` | `object` | No | — | | `integrations` | `object` | No | — | | `plugins` | `object` | No | — | | `subscriptions` | `object` | No | — | | `code` | `string` | No | — | | `medias` | `object` | No | — | | `secrets` | `object` | No | — | | `layers` | `string[]` | No | — | | `type` | `studio \| adk` | No | — | | `moduleFormat` | `cjs \| esm` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` > **configuration full type** > > ```ts theme={null} > { > } > ``` > **user full type** > > ```ts theme={null} > { > } > ``` > **message full type** > > ```ts theme={null} > { > } > ``` > **conversation full type** > > ```ts theme={null} > { > } > ``` > **events full type** > > ```ts theme={null} > { > } > ``` > **actions full type** > > ```ts theme={null} > { > } > ``` > **states full type** > > ```ts theme={null} > { > } > ``` > **recurringEvents full type** > > ```ts theme={null} > { > } > ``` > **integrations full type** > > ```ts theme={null} > { > } > ``` > **plugins full type** > > ```ts theme={null} > { > } > ``` > **subscriptions full type** > > ```ts theme={null} > { > } > ``` > **medias full type** > > ```ts theme={null} > { > } > ``` > **secrets full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `createdBy` | `string` | No | — | | `dev` | `boolean` | No | — | | `alwaysAlive` | `boolean` | No | — | | `status` | `string` | No | — | | `type` | `string` | No | — | | `signingSecret` | `string` | No | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` *** ## Chat ### createConversation `chat.createConversation` Create a conversation on a channel **Risk:** `write` ```ts theme={null} await corsair.botpress.api.chat.createConversation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `botId` | `string` | Yes | — | | `channel` | `string` | Yes | — | | `tags` | `object` | Yes | — | | `properties` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `channel` | `string` | No | — | | `integration` | `string` | No | — | | `tags` | `object` | No | — | | `messageCount` | `number` | No | — | | `properties` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### listConversations `chat.listConversations` List a bot's conversations **Risk:** `read` ```ts theme={null} await corsair.botpress.api.chat.listConversations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `botId` | `string` | Yes | — | | `tags` | `object` | No | — | | `sortField` | `createdAt \| updatedAt` | No | — | | `sortDirection` | `asc \| desc` | No | — | | `participantIds` | `string[]` | No | — | | `integrationName` | `string` | No | — | | `channel` | `string` | No | — | | `afterDate` | `string` | No | — | | `beforeDate` | `string` | No | — | | `minMessageCount` | `number` | No | — | | `maxMessageCount` | `number` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `conversations` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **conversations full type** > > ```ts theme={null} > { > id: string, > createdAt?: string | null, > updatedAt?: string | null, > channel?: string | null, > integration?: string | null, > tags?: { > } | null, > messageCount?: number | null, > properties?: { > } | null > }[] > ``` *** ### sendMessage `chat.sendMessage` Send a message into a conversation **Risk:** `write` ```ts theme={null} await corsair.botpress.api.chat.sendMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `botId` | `string` | Yes | — | | `conversationId` | `string` | Yes | — | | `userId` | `string` | Yes | — | | `type` | `string` | Yes | — | | `payload` | `object` | Yes | — | | `tags` | `object` | Yes | — | | `schedule` | `object` | No | — | | `origin` | `synthetic` | No | — | > **payload full type** > > ```ts theme={null} > { > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` > **schedule full type** > > ```ts theme={null} > { > dateTime?: string, > delay?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `type` | `string` | No | — | | `payload` | `object` | No | — | | `direction` | `incoming \| outgoing` | No | — | | `userId` | `string` | No | — | | `conversationId` | `string` | No | — | | `tags` | `object` | No | — | | `origin` | `synthetic` | No | — | > **payload full type** > > ```ts theme={null} > { > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### updateWorkflow `chat.updateWorkflow` Update a workflow's status, output or failure reason **Risk:** `write` ```ts theme={null} await corsair.botpress.api.chat.updateWorkflow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `botId` | `string` | Yes | — | | `id` | `string` | Yes | — | | `status` | `completed \| cancelled \| listening \| paused \| failed \| in_progress` | No | — | | `output` | `object` | No | — | | `timeoutAt` | `string` | No | — | | `failureReason` | `string` | No | — | | `tags` | `object` | No | — | | `userId` | `string` | No | — | | `eventId` | `string` | No | — | > **output full type** > > ```ts theme={null} > { > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `pending \| in_progress \| failed \| completed \| listening \| paused \| timedout \| cancelled` | No | — | | `input` | `object` | No | — | | `output` | `object` | No | — | | `parentWorkflowId` | `string` | No | — | | `conversationId` | `string` | No | — | | `userId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `completedAt` | `string` | No | — | | `failureReason` | `string` | No | — | | `timeoutAt` | `string` | No | — | | `tags` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` > **output full type** > > ```ts theme={null} > { > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** ## Files ### delete `files.delete` Delete a file from a bot's storage **Risk:** `destructive` ```ts theme={null} await corsair.botpress.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `botId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### listTags `files.listTags` List tags used across a bot's files **Risk:** `read` ```ts theme={null} await corsair.botpress.api.files.listTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `botId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `string[]` | Yes | — | | `nextToken` | `string` | No | — | *** ### listTagValues `files.listTagValues` List all values seen for a given file tag **Risk:** `read` ```ts theme={null} await corsair.botpress.api.files.listTagValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `botId` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `values` | `string[]` | Yes | — | | `nextToken` | `string` | No | — | *** ## Hub ### getDereferencedPluginById `hub.getDereferencedPluginById` Get a public plugin with interface entity references resolved **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.getDereferencedPluginById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `interfaces` | `object` | Yes | — | > **interfaces full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getIntegration `hub.getIntegration` Get a public integration by name and version **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.getIntegration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `iconUrl` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `public` | `boolean` | No | — | | `visibility` | `string` | No | — | | `verificationStatus` | `string` | No | — | | `lifecycleStatus` | `string` | No | — | | `ownerWorkspace` | `object` | No | — | > **ownerWorkspace full type** > > ```ts theme={null} > { > id?: string | null, > handle?: string | null, > name?: string | null > } > ``` *** ### getIntegrationById `hub.getIntegrationById` Get a public integration by id **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.getIntegrationById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `iconUrl` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `public` | `boolean` | No | — | | `visibility` | `string` | No | — | | `verificationStatus` | `string` | No | — | | `lifecycleStatus` | `string` | No | — | | `ownerWorkspace` | `object` | No | — | > **ownerWorkspace full type** > > ```ts theme={null} > { > id?: string | null, > handle?: string | null, > name?: string | null > } > ``` *** ### getInterface `hub.getInterface` Get a public interface by name and version **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.getInterface({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `iconUrl` | `string` | No | — | | `readmeUrl` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `public` | `boolean` | No | — | *** ### getInterfaceById `hub.getInterfaceById` Get a public interface by id **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.getInterfaceById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `iconUrl` | `string` | No | — | | `readmeUrl` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `public` | `boolean` | No | — | *** ### getPlugin `hub.getPlugin` Get a public plugin by name and version **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.getPlugin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `iconUrl` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `public` | `boolean` | No | — | | `visibility` | `string` | No | — | | `lifecycleStatus` | `string` | No | — | *** ### getPluginById `hub.getPluginById` Get a public plugin by id **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.getPluginById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `iconUrl` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `public` | `boolean` | No | — | | `visibility` | `string` | No | — | | `lifecycleStatus` | `string` | No | — | *** ### getPluginCode `hub.getPluginCode` Get a public plugin's source code for a platform **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.getPluginCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `platform` | `node \| browser` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | *** ### listIntegrations `hub.listIntegrations` List public integrations in the hub **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.listIntegrations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `limit` | `number` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `interfaceId` | `string` | No | — | | `interfaceName` | `string` | No | — | | `installedByBotId` | `string` | No | — | | `verificationStatus` | `unapproved \| pending \| approved \| rejected` | No | — | | `search` | `string` | No | — | | `sortBy` | `popularity \| name \| createdAt \| updatedAt \| installCount` | No | — | | `direction` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `integrations` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **integrations full type** > > ```ts theme={null} > { > id: string, > name: string, > version: string, > title?: string | null, > description?: string | null, > iconUrl?: string | null, > createdAt?: string | null, > updatedAt?: string | null, > public?: boolean | null, > visibility?: string | null, > verificationStatus?: string | null, > lifecycleStatus?: string | null, > ownerWorkspace?: { > id?: string | null, > handle?: string | null, > name?: string | null > } | null > }[] > ``` *** ### listInterfaces `hub.listInterfaces` List public interfaces in the hub **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.listInterfaces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `interfaces` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **interfaces full type** > > ```ts theme={null} > { > id: string, > name: string, > version: string, > title?: string | null, > description?: string | null, > iconUrl?: string | null, > readmeUrl?: string | null, > createdAt?: string | null, > updatedAt?: string | null, > public?: boolean | null > }[] > ``` *** ### listPlugins `hub.listPlugins` List public plugins in the hub **Risk:** `read` ```ts theme={null} await corsair.botpress.api.hub.listPlugins({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `plugins` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **plugins full type** > > ```ts theme={null} > { > id: string, > name: string, > version: string, > title?: string | null, > description?: string | null, > iconUrl?: string | null, > createdAt?: string | null, > updatedAt?: string | null, > public?: boolean | null, > visibility?: string | null, > lifecycleStatus?: string | null > }[] > ``` *** ## Integrations ### create `integrations.create` Create an integration in a workspace **Risk:** `write` ```ts theme={null} await corsair.botpress.api.integrations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `code` | `string` | No | — | | `configuration` | `object` | No | — | | `configurations` | `object` | No | — | | `states` | `object` | No | — | | `events` | `object` | No | — | | `actions` | `object` | No | — | | `entities` | `object` | No | — | | `channels` | `object` | No | — | | `user` | `object` | No | — | | `interfaces` | `object` | No | — | | `identifier` | `object` | No | — | | `extraOperations` | `object` | No | — | | `sdkVersion` | `string` | No | — | | `secrets` | `object` | No | — | | `icon` | `string` | No | — | | `readme` | `string` | No | — | | `public` | `boolean` | No | — | | `visibility` | `public \| private \| unlisted` | No | — | | `layers` | `string[]` | No | — | | `attributes` | `object` | No | — | > **configuration full type** > > ```ts theme={null} > { > } > ``` > **configurations full type** > > ```ts theme={null} > { > } > ``` > **states full type** > > ```ts theme={null} > { > } > ``` > **events full type** > > ```ts theme={null} > { > } > ``` > **actions full type** > > ```ts theme={null} > { > } > ``` > **entities full type** > > ```ts theme={null} > { > } > ``` > **channels full type** > > ```ts theme={null} > { > } > ``` > **user full type** > > ```ts theme={null} > { > } > ``` > **interfaces full type** > > ```ts theme={null} > { > } > ``` > **identifier full type** > > ```ts theme={null} > { > fallbackHandlerScript?: string, > extractScript?: string > } > ``` > **extraOperations full type** > > ```ts theme={null} > { > } > ``` > **secrets full type** > > ```ts theme={null} > { > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `visibility` | `public \| private \| unlisted` | No | — | | `verificationStatus` | `string` | No | — | | `dev` | `boolean` | No | — | | `url` | `string` | No | — | | `iconUrl` | `string` | No | — | | `readmeUrl` | `string` | No | — | | `signingSecret` | `string` | No | — | *** ### deleteShareableId `integrations.deleteShareableId` Delete the shareable id for a bot-integration pair **Risk:** `destructive` ```ts theme={null} await corsair.botpress.api.integrations.deleteShareableId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `botId` | `string` | Yes | — | | `integrationId` | `string` | Yes | — | | `integrationInstanceAlias` | `string` | No | — | **Output:** *empty object* *** ### get `integrations.get` Get an integration by id **Risk:** `read` ```ts theme={null} await corsair.botpress.api.integrations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `version` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `visibility` | `public \| private \| unlisted` | No | — | | `verificationStatus` | `string` | No | — | | `dev` | `boolean` | No | — | | `url` | `string` | No | — | | `iconUrl` | `string` | No | — | | `readmeUrl` | `string` | No | — | | `signingSecret` | `string` | No | — | *** ### list `integrations.list` List integrations owned by the workspace **Risk:** `read` ```ts theme={null} await corsair.botpress.api.integrations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `limit` | `number` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `interfaceId` | `string` | No | — | | `interfaceName` | `string` | No | — | | `installedByBotId` | `string` | No | — | | `verificationStatus` | `unapproved \| pending \| approved \| rejected` | No | — | | `search` | `string` | No | — | | `sortBy` | `popularity \| name \| createdAt \| updatedAt \| installCount` | No | — | | `direction` | `asc \| desc` | No | — | | `visibility` | `public \| private` | No | — | | `dev` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `integrations` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **integrations full type** > > ```ts theme={null} > { > id: string, > name: string, > version: string, > title?: string | null, > description?: string | null, > createdAt?: string | null, > updatedAt?: string | null, > visibility?: public | private | unlisted | null, > verificationStatus?: string | null, > dev?: boolean | null, > url?: string | null, > iconUrl?: string | null, > readmeUrl?: string | null, > signingSecret?: string | null > }[] > ``` *** ### listApiKeys `integrations.listApiKeys` List Integration API Keys (IAKs) for an integration **Risk:** `read` ```ts theme={null} await corsair.botpress.api.integrations.listApiKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `integrationId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > createdAt?: string | null, > note?: string | null > }[] > ``` *** ### requestVerification `integrations.requestVerification` Submit an integration for verification **Risk:** `write` ```ts theme={null} await corsair.botpress.api.integrations.requestVerification({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `integrationId` | `string` | Yes | — | **Output:** *empty object* *** ### validateUpdate `integrations.validateUpdate` Validate that an integration update would succeed **Risk:** `read` ```ts theme={null} await corsair.botpress.api.integrations.validateUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `configuration` | `object` | No | — | | `configurations` | `object` | No | — | | `states` | `object` | No | — | | `events` | `object` | No | — | | `actions` | `object` | No | — | | `entities` | `object` | No | — | | `channels` | `object` | No | — | | `user` | `object` | No | — | | `interfaces` | `object` | No | — | | `identifier` | `object` | No | — | | `extraOperations` | `object` | No | — | | `sdkVersion` | `string` | No | — | | `maxExecutionTime` | `number` | No | — | | `secrets` | `object` | No | — | | `icon` | `string` | No | — | | `readme` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `public` | `boolean` | No | — | | `visibility` | `public \| private \| unlisted` | No | — | | `layers` | `string[]` | No | — | > **configuration full type** > > ```ts theme={null} > { > } > ``` > **configurations full type** > > ```ts theme={null} > { > } > ``` > **states full type** > > ```ts theme={null} > { > } > ``` > **events full type** > > ```ts theme={null} > { > } > ``` > **actions full type** > > ```ts theme={null} > { > } > ``` > **entities full type** > > ```ts theme={null} > { > } > ``` > **channels full type** > > ```ts theme={null} > { > } > ``` > **user full type** > > ```ts theme={null} > { > } > ``` > **interfaces full type** > > ```ts theme={null} > { > } > ``` > **identifier full type** > > ```ts theme={null} > { > fallbackHandlerScript?: string, > extractScript?: string > } > ``` > **extraOperations full type** > > ```ts theme={null} > { > } > ``` > **secrets full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Knowledge Bases ### delete `knowledgeBases.delete` Permanently delete a knowledge base **Risk:** `destructive` ```ts theme={null} await corsair.botpress.api.knowledgeBases.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `botId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### list `knowledgeBases.list` List a bot's knowledge bases **Risk:** `read` ```ts theme={null} await corsair.botpress.api.knowledgeBases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `botId` | `string` | Yes | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `knowledgeBases` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **knowledgeBases full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > createdAt?: string | null, > tags?: { > } | null > }[] > ``` *** ## Plugins ### list `plugins.list` List plugins installed in the workspace **Risk:** `read` ```ts theme={null} await corsair.botpress.api.plugins.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `plugins` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **plugins full type** > > ```ts theme={null} > { > id: string, > name: string, > version: string, > title?: string | null, > description?: string | null, > iconUrl?: string | null, > createdAt?: string | null, > updatedAt?: string | null, > public?: boolean | null, > visibility?: string | null, > lifecycleStatus?: string | null > }[] > ``` *** ## Tools ### getTableRow `tools.getTableRow` Fetch a single row from a table by id **Risk:** `read` ```ts theme={null} await corsair.botpress.api.tools.getTableRow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `botId` | `string` | Yes | — | | `table` | `string` | Yes | — | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### runVrl `tools.runVrl` Execute a VRL script against input data **Risk:** `write` ```ts theme={null} await corsair.botpress.api.tools.runVrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `script` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | | `result` | `any` | Yes | — | *** ## Workspaces ### breakDownUsageByBot `workspaces.breakDownUsageByBot` Break down a workspace's usage of a quota type by bot **Risk:** `read` ```ts theme={null} await corsair.botpress.api.workspaces.breakDownUsageByBot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `invocation_timeout \| invocation_calls \| storage_count \| bot_count \| knowledgebase_vector_storage \| workspace_ratelimit \| table_row_count \| workspace_member_count \| integrations_owned_count \| ai_spend \| openai_spend \| bing_search_spend \| always_alive \| indexed_file_count \| file_max_size_bytes` | Yes | — | | `period` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > botId?: string | null, > value?: number | null > }[] > ``` *** ### checkHandleAvailability `workspaces.checkHandleAvailability` Check whether a workspace handle is available **Risk:** `read` ```ts theme={null} await corsair.botpress.api.workspaces.checkHandleAvailability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `handle` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `available` | `boolean` | Yes | — | | `suggestions` | `string[]` | No | — | | `usedBy` | `string` | No | — | *** ### create `workspaces.create` Create a workspace **Risk:** `write` ```ts theme={null} await corsair.botpress.api.workspaces.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `billingVersion` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `ownerId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `blocked` | `boolean` | No | — | | `plan` | `string` | No | — | | `billingVersion` | `string` | No | — | | `spendingLimit` | `number` | No | — | | `botCount` | `number` | No | — | | `about` | `string` | No | — | | `profilePicture` | `string` | No | — | | `contactEmail` | `string` | No | — | | `website` | `string` | No | — | | `socialAccounts` | `any[]` | No | — | | `isPublic` | `boolean` | No | — | | `handle` | `string` | No | — | | `activeTrialId` | `string` | No | — | *** ### delete `workspaces.delete` Permanently delete a workspace **Risk:** `destructive` ```ts theme={null} await corsair.botpress.api.workspaces.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### get `workspaces.get` Get a workspace by id **Risk:** `read` ```ts theme={null} await corsair.botpress.api.workspaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `ownerId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `blocked` | `boolean` | No | — | | `plan` | `string` | No | — | | `billingVersion` | `string` | No | — | | `spendingLimit` | `number` | No | — | | `botCount` | `number` | No | — | | `about` | `string` | No | — | | `profilePicture` | `string` | No | — | | `contactEmail` | `string` | No | — | | `website` | `string` | No | — | | `socialAccounts` | `any[]` | No | — | | `isPublic` | `boolean` | No | — | | `handle` | `string` | No | — | | `activeTrialId` | `string` | No | — | *** ### getAllQuotaCompletion `workspaces.getAllQuotaCompletion` Get the highest quota completion rate for every workspace **Risk:** `read` ```ts theme={null} await corsair.botpress.api.workspaces.getAllQuotaCompletion({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getQuota `workspaces.getQuota` Get a workspace's usage against a quota type **Risk:** `read` ```ts theme={null} await corsair.botpress.api.workspaces.getQuota({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `invocation_timeout \| invocation_calls \| storage_count \| bot_count \| knowledgebase_vector_storage \| workspace_ratelimit \| table_row_count \| workspace_member_count \| integrations_owned_count \| ai_spend \| openai_spend \| bing_search_spend \| always_alive \| indexed_file_count \| file_max_size_bytes` | Yes | — | | `period` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `period` | `string` | No | — | | `value` | `number` | No | — | | `type` | `invocation_timeout \| invocation_calls \| storage_count \| bot_count \| knowledgebase_vector_storage \| workspace_ratelimit \| table_row_count \| workspace_member_count \| integrations_owned_count \| ai_spend \| openai_spend \| bing_search_spend \| always_alive \| indexed_file_count \| file_max_size_bytes` | No | — | *** ### list `workspaces.list` List workspaces owned by the account **Risk:** `read` ```ts theme={null} await corsair.botpress.api.workspaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `handle` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `workspaces` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **workspaces full type** > > ```ts theme={null} > { > id: string, > name: string, > ownerId?: string | null, > createdAt?: string | null, > updatedAt?: string | null, > blocked?: boolean | null, > plan?: string | null, > billingVersion?: string | null, > spendingLimit?: number | null, > botCount?: number | null, > about?: string | null, > profilePicture?: string | null, > contactEmail?: string | null, > website?: string | null, > socialAccounts?: any[] | null, > isPublic?: boolean | null, > handle?: string | null, > activeTrialId?: string | null > }[] > ``` *** ### listPublic `workspaces.listPublic` List public workspaces **Risk:** `read` ```ts theme={null} await corsair.botpress.api.workspaces.listPublic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `workspaceIds` | `string[]` | No | — | | `search` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `workspaces` | `object[]` | Yes | — | | `nextToken` | `string` | No | — | > **workspaces full type** > > ```ts theme={null} > { > id: string, > name: string, > ownerId?: string | null, > createdAt?: string | null, > updatedAt?: string | null, > blocked?: boolean | null, > plan?: string | null, > billingVersion?: string | null, > spendingLimit?: number | null, > botCount?: number | null, > about?: string | null, > profilePicture?: string | null, > contactEmail?: string | null, > website?: string | null, > socialAccounts?: any[] | null, > isPublic?: boolean | null, > handle?: string | null, > activeTrialId?: string | null > }[] > ``` *** ### setPreference `workspaces.setPreference` Set a workspace preference by key **Risk:** `write` ```ts theme={null} await corsair.botpress.api.workspaces.setPreference({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | | `value` | `any` | Yes | — | **Output:** *empty object* *** ### update `workspaces.update` Update workspace settings **Risk:** `write` ```ts theme={null} await corsair.botpress.api.workspaces.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `spendingLimit` | `number` | No | — | | `about` | `string` | No | — | | `profilePicture` | `string` | No | — | | `contactEmail` | `string` | No | — | | `website` | `string` | No | — | | `socialAccounts` | `any[]` | No | — | | `isPublic` | `boolean` | No | — | | `handle` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `ownerId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `blocked` | `boolean` | No | — | | `plan` | `string` | No | — | | `billingVersion` | `string` | No | — | | `spendingLimit` | `number` | No | — | | `botCount` | `number` | No | — | | `about` | `string` | No | — | | `profilePicture` | `string` | No | — | | `contactEmail` | `string` | No | — | | `website` | `string` | No | — | | `socialAccounts` | `any[]` | No | — | | `isPublic` | `boolean` | No | — | | `handle` | `string` | No | — | | `activeTrialId` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/botpress/database Botpress local sync: searchable entities, `.search()` filters, and operators. The Botpress plugin syncs data locally. Use `corsair.botpress.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Bots Path: `botpress.db.bots.search` ```ts theme={null} const rows = await corsair.botpress.db.bots.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `createdBy` | `string` | equals, contains, startsWith, endsWith, in | | `dev` | `boolean` | equals | | `alwaysAlive` | `boolean` | equals | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Integrations Path: `botpress.db.integrations.search` ```ts theme={null} const rows = await corsair.botpress.db.integrations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `dev` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `iconUrl` | `string` | equals, contains, startsWith, endsWith, in | | `readmeUrl` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `botpress.db.workspaces.search` ```ts theme={null} const rows = await corsair.botpress.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `ownerId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `blocked` | `boolean` | equals | | `plan` | `string` | equals, contains, startsWith, endsWith, in | | `billingVersion` | `string` | equals, contains, startsWith, endsWith, in | | `spendingLimit` | `number` | equals, gt, gte, lt, lte, in | | `botCount` | `number` | equals, gt, gte, lt, lte, in | | `about` | `string` | equals, contains, startsWith, endsWith, in | | `profilePicture` | `string` | equals, contains, startsWith, endsWith, in | | `contactEmail` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `isPublic` | `boolean` | equals | | `handle` | `string` | equals, contains, startsWith, endsWith, in | | `activeTrialId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/botpress/overview Conversational AI platform for building, deploying, and managing chatbots and agents. Use **Botpress** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 53 typed API operations * 3 synced entities (`bots`, `integrations`, `workspaces`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/botpress ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/botpress ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/botpress ``` ```bash bun theme={null} bun add corsair @corsair-dev/botpress ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { botpress } from '@corsair-dev/botpress'; export const corsair = createCorsair({ plugins: [ botpress(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} botpress() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'botpress', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.botpress.api.account.get({}); ``` **`account.setPreference`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.botpress.api.account.setPreference({}); ``` See the full list on the [API](/plugins/botpress/api) page. ## Query synced data Synced entities support `tenant.botpress.db..search()` and `.list()`: `bots`, `integrations`, `workspaces`. See [Database](/plugins/botpress/database) for filters and operators. ## What's next > **[API reference](/plugins/botpress/api)** > > Every `botpress.api.*` operation with input and output types. > **[Database](/plugins/botpress/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/botsonic/api API reference for Botsonic: every `botsonic.api.*` operation with input and output types. Every `botsonic.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Generate Response ### post `generateResponse.post` Generate a response from a Botsonic chatbot **Risk:** `write` ```ts theme={null} await corsair.botsonic.api.generateResponse.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input_text` | `string` | Yes | — | | `chat_id` | `string` | Yes | — | | `source` | `string` | No | — | | `starter_question_id` | `string` | No | — | | `is_business_api_request` | `boolean` | No | — | | `is_integration_request` | `boolean` | No | — | | `integration_user_identifier` | `string` | No | — | | `user_unique_identifier` | `string` | No | — | | `response_type` | `text \| html \| markdown \| mrkdwn` | No | — | | `chat_user_id` | `string` | No | — | | `extra_metadata` | `object` | No | — | | `full_history` | `boolean` | No | — | | `message_id` | `string` | No | — | | `timeout` | `number` | No | — | | `chat_history` | `object[]` | No | — | > **extra\_metadata full type** > > ```ts theme={null} > { > } > ``` > **chat\_history full type** > > ```ts theme={null} > { > message?: string, > sent?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `answer` | `string` | Yes | — | | `message_id` | `string` | No | — | | `sources` | `any[]` | No | — | | `chat_history` | `any[]` | No | — | | `generated_images` | `string[]` | No | — | | `follow_up_questions` | `string[]` | No | — | | `human_handoff_status` | `boolean` | No | — | | `user_options` | `any[]` | No | — | | `chat_ended` | `boolean` | No | — | | `end_chat_feedback` | `string` | No | — | *** ## Get All Faqs ### get `getAllFaqs.get` Retrieve all FAQs for a Botsonic bot **Risk:** `read` ```ts theme={null} await corsair.botsonic.api.getAllFaqs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_query` | `string` | No | — | | `sort_by` | `id \| bot_id \| question \| answer \| error_reason \| status \| characters \| migration_status \| created_at \| updated_at` | No | — | | `sort_order` | `asc \| desc` | No | — | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `total` | `number` | No | — | | `page` | `number` | No | — | | `size` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string | number, > question?: string, > answer?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/botsonic/database Botsonic local sync: searchable entities, `.search()` filters, and operators. The Botsonic plugin syncs data locally. Use `corsair.botsonic.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/botsonic/overview No-code AI chatbot builder trained on your content for customer support automation. Use **Botsonic** through Corsair: one client, typed API calls. **What you get:** * 2 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/botsonic ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/botsonic ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/botsonic ``` ```bash bun theme={null} bun add corsair @corsair-dev/botsonic ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { botsonic } from '@corsair-dev/botsonic'; export const corsair = createCorsair({ plugins: [ botsonic(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} botsonic() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'botsonic', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`getAllFaqs.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.botsonic.api.getAllFaqs.get({}); ``` **`generateResponse.post`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.botsonic.api.generateResponse.post({}); ``` See the full list on the [API](/plugins/botsonic/api) page. ## What's next > **[API reference](/plugins/botsonic/api)** > > Every `botsonic.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bouncer/api API reference for Bouncer: every `bouncer.api.*` operation with input and output types. Every `bouncer.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getCredits `account.getCredits` Retrieve current credit balance for the Bouncer account **Risk:** `read` ```ts theme={null} await corsair.bouncer.api.account.getCredits({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `credits` | `number` | Yes | — | *** ## Email ### createBatchRequest `email.createBatchRequest` Initiate an asynchronous batch email verification request **Risk:** `write` ```ts theme={null} await corsair.bouncer.api.email.createBatchRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recipients` | `object[]` | Yes | — | | `callback` | `string` | No | — | > **recipients full type** > > ```ts theme={null} > ( > { > email: string > } | string > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | | `created` | `string` | No | — | | `status` | `string` | No | — | | `quantity` | `number` | No | — | | `duplicates` | `number` | No | — | *** ### deleteBatchRequest `email.deleteBatchRequest` Permanently delete a batch email verification request and its data **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.bouncer.api.email.deleteBatchRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | **Output:** *empty object* *** ### finishBatch `email.finishBatch` Mark a batch verification process as finished early **Risk:** `write` ```ts theme={null} await corsair.bouncer.api.email.finishBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | **Output:** *empty object* *** ### getBatchResults `email.getBatchResults` Retrieve the results of a batch email verification process **Risk:** `read` ```ts theme={null} await corsair.bouncer.api.email.getBatchResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | | `download` | `all \| deliverable \| risky \| undeliverable \| unknown` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > email: string, > status: deliverable | risky | undeliverable | unknown, > reason: accepted_email | low_deliverability | low_quality | invalid_email | invalid_domain | rejected_email | dns_error | unavailable_smtp | unsupported | timeout | unknown, > domain?: { > name: string, > acceptAll: yes | no | unknown, > disposable: yes | no | unknown, > free: yes | no | unknown > }, > account?: { > role: yes | no | unknown, > disabled: yes | no | unknown, > fullMailbox: yes | no | unknown > }, > dns?: { > type: string, > record?: string > }, > provider?: string, > score?: number, > toxic?: string, > toxicity?: number, > retryAfter?: string, > didYouMean?: string > }[] > ``` *** ### getBatchStatus `email.getBatchStatus` Check the processing status of a batch, optionally with per-status stats **Risk:** `read` ```ts theme={null} await corsair.bouncer.api.email.getBatchStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | | `withStats` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | | `created` | `string` | No | — | | `started` | `string` | No | — | | `completed` | `string` | No | — | | `status` | `string` | Yes | — | | `quantity` | `number` | No | — | | `duplicates` | `number` | No | — | | `credits` | `number` | No | — | | `processed` | `number` | No | — | | `stats` | `object` | No | — | > **stats full type** > > ```ts theme={null} > { > deliverable: number, > risky: number, > undeliverable: number, > unknown: number > } > ``` *** ### verifyDomain `email.verifyDomain` Verify domain MX records and catch-all setup **Risk:** `read` ```ts theme={null} await corsair.bouncer.api.email.verifyDomain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `object` | No | — | | `dns` | `object` | No | — | | `provider` | `string` | No | — | | `toxic` | `string` | No | — | > **domain full type** > > ```ts theme={null} > { > name: string, > acceptAll: yes | no | unknown, > disposable: yes | no | unknown, > free: yes | no | unknown > } > ``` > **dns full type** > > ```ts theme={null} > { > type: string, > record?: string > } > ``` *** ### verifyEmail `email.verifyEmail` Verify a single email address in real-time **Risk:** `read` ```ts theme={null} await corsair.bouncer.api.email.verifyEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `timeout` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `status` | `deliverable \| risky \| undeliverable \| unknown` | Yes | — | | `reason` | `accepted_email \| low_deliverability \| low_quality \| invalid_email \| invalid_domain \| rejected_email \| dns_error \| unavailable_smtp \| unsupported \| timeout \| unknown` | Yes | — | | `domain` | `object` | No | — | | `account` | `object` | No | — | | `dns` | `object` | No | — | | `provider` | `string` | No | — | | `score` | `number` | No | — | | `toxic` | `string` | No | — | | `toxicity` | `number` | No | — | | `retryAfter` | `string` | No | — | | `didYouMean` | `string` | No | — | > **domain full type** > > ```ts theme={null} > { > name: string, > acceptAll: yes | no | unknown, > disposable: yes | no | unknown, > free: yes | no | unknown > } > ``` > **account full type** > > ```ts theme={null} > { > role: yes | no | unknown, > disabled: yes | no | unknown, > fullMailbox: yes | no | unknown > } > ``` > **dns full type** > > ```ts theme={null} > { > type: string, > record?: string > } > ``` *** ## Toxicity ### checkToxicityListJobStatus `toxicity.checkToxicityListJobStatus` Check the status and results of a toxicity list job **Risk:** `read` ```ts theme={null} await corsair.bouncer.api.toxicity.checkToxicityListJobStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `createdAt` | `string` | No | — | | `status` | `string` | Yes | — | *** ### createToxicityListJob `toxicity.createToxicityListJob` Create a toxicity analysis job for a list of email addresses **Risk:** `write` ```ts theme={null} await corsair.bouncer.api.toxicity.createToxicityListJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `createdAt` | `string` | No | — | | `status` | `string` | Yes | — | *** ### deleteToxicityListJob `toxicity.deleteToxicityListJob` Delete a specific toxicity list job by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.bouncer.api.toxicity.deleteToxicityListJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output:** *empty object* *** ### getToxicityListResults `toxicity.getToxicityListResults` Download the per-address toxicity scores of a completed job **Risk:** `read` ```ts theme={null} await corsair.bouncer.api.toxicity.getToxicityListResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > email: string, > toxicity: number > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/bouncer/database Bouncer local sync: searchable entities, `.search()` filters, and operators. The Bouncer plugin syncs data locally. Use `corsair.bouncer.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Batch Verifications Path: `bouncer.db.batchVerifications.search` ```ts theme={null} const rows = await corsair.bouncer.db.batchVerifications.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `batchId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `quantity` | `number` | equals, gt, gte, lt, lte, in | | `duplicates` | `number` | equals, gt, gte, lt, lte, in | | `processed` | `number` | equals, gt, gte, lt, lte, in | | `credits` | `number` | equals, gt, gte, lt, lte, in | | `statsDeliverable` | `number` | equals, gt, gte, lt, lte, in | | `statsRisky` | `number` | equals, gt, gte, lt, lte, in | | `statsUndeliverable` | `number` | equals, gt, gte, lt, lte, in | | `statsUnknown` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `startedAt` | `date` | equals, before, after, between | | `completedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Domain Verifications Path: `bouncer.db.domainVerifications.search` ```ts theme={null} const rows = await corsair.bouncer.db.domainVerifications.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `dnsType` | `string` | equals, contains, startsWith, endsWith, in | | `dnsRecord` | `string` | equals, contains, startsWith, endsWith, in | | `provider` | `string` | equals, contains, startsWith, endsWith, in | | `toxic` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Email Verifications Path: `bouncer.db.emailVerifications.search` ```ts theme={null} const rows = await corsair.bouncer.db.emailVerifications.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `domainName` | `string` | equals, contains, startsWith, endsWith, in | | `dnsType` | `string` | equals, contains, startsWith, endsWith, in | | `dnsRecord` | `string` | equals, contains, startsWith, endsWith, in | | `provider` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `toxic` | `string` | equals, contains, startsWith, endsWith, in | | `toxicity` | `number` | equals, gt, gte, lt, lte, in | | `didYouMean` | `string` | equals, contains, startsWith, endsWith, in | | `retryAfter` | `date` | equals, before, after, between | | `batchId` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Toxicity Jobs Path: `bouncer.db.toxicityJobs.search` ```ts theme={null} const rows = await corsair.bouncer.db.toxicityJobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Toxicity Results Path: `bouncer.db.toxicityResults.search` ```ts theme={null} const rows = await corsair.bouncer.db.toxicityResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `toxicity` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bouncer/overview Email verification API for validating addresses, reducing bounces, and improving deliverability. Use **Bouncer** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 12 typed API operations * 5 synced entities (`batchVerifications`, `domainVerifications`, `emailVerifications`, `toxicityJobs`, `toxicityResults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bouncer ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bouncer ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bouncer ``` ```bash bun theme={null} bun add corsair @corsair-dev/bouncer ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bouncer } from '@corsair-dev/bouncer'; export const corsair = createCorsair({ plugins: [ bouncer(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bouncer() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bouncer', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getCredits`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bouncer.api.account.getCredits({}); ``` **`email.createBatchRequest`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bouncer.api.email.createBatchRequest({}); ``` See the full list on the [API](/plugins/bouncer/api) page. ## Query synced data Synced entities support `tenant.bouncer.db..search()` and `.list()`: `batchVerifications`, `domainVerifications`, `emailVerifications`, `toxicityJobs`, `toxicityResults`. See [Database](/plugins/bouncer/database) for filters and operators. ## What's next > **[API reference](/plugins/bouncer/api)** > > Every `bouncer.api.*` operation with input and output types. > **[Database](/plugins/bouncer/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/box/api API reference for Box: every `box.api.*` operation with input and output types. Every `box.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Files ### copy `files.copy` Copy a Box file to a destination folder **Risk:** `write` ```ts theme={null} await corsair.box.api.files.copy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `parent` | `object` | Yes | — | | `name` | `string` | No | — | | `version` | `string` | No | — | > **parent full type** > > ```ts theme={null} > { > id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `file` | No | — | | `id` | `string` | Yes | — | | `sequence_id` | `string` | No | — | | `etag` | `string` | No | — | | `sha1` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `size` | `number` | No | — | | `path_collection` | `object` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `trashed_at` | `string` | No | — | | `purged_at` | `string` | No | — | | `content_created_at` | `string` | No | — | | `content_modified_at` | `string` | No | — | | `created_by` | `object` | No | — | | `modified_by` | `object` | No | — | | `owned_by` | `object` | No | — | | `shared_link` | `object` | No | — | | `parent` | `object` | No | — | | `item_status` | `string` | No | — | | `extension` | `string` | No | — | | `is_package` | `boolean` | No | — | > **path\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > }[] > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **modified\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **owned\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **shared\_link full type** > > ```ts theme={null} > { > url?: string, > download_url?: string | null, > vanity_url?: string | null, > access?: string, > effective_access?: string, > effective_permission?: string, > unshared_at?: string | null, > is_password_enabled?: boolean, > permissions?: { > can_download?: boolean, > can_preview?: boolean, > can_edit?: boolean > }, > download_count?: number, > preview_count?: number > } > ``` > **parent full type** > > ```ts theme={null} > { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > } > ``` *** ### delete `files.delete` Delete a Box file **Risk:** `destructive` ```ts theme={null} await corsair.box.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `if_match` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### download `files.download` Download the content of a Box file **Risk:** `read` ```ts theme={null} await corsair.box.api.files.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `version` | `string` | No | — | **Output:** `string` *** ### get `files.get` Get metadata for a Box file by ID **Risk:** `read` ```ts theme={null} await corsair.box.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `file` | No | — | | `id` | `string` | Yes | — | | `sequence_id` | `string` | No | — | | `etag` | `string` | No | — | | `sha1` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `size` | `number` | No | — | | `path_collection` | `object` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `trashed_at` | `string` | No | — | | `purged_at` | `string` | No | — | | `content_created_at` | `string` | No | — | | `content_modified_at` | `string` | No | — | | `created_by` | `object` | No | — | | `modified_by` | `object` | No | — | | `owned_by` | `object` | No | — | | `shared_link` | `object` | No | — | | `parent` | `object` | No | — | | `item_status` | `string` | No | — | | `extension` | `string` | No | — | | `is_package` | `boolean` | No | — | > **path\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > }[] > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **modified\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **owned\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **shared\_link full type** > > ```ts theme={null} > { > url?: string, > download_url?: string | null, > vanity_url?: string | null, > access?: string, > effective_access?: string, > effective_permission?: string, > unshared_at?: string | null, > is_password_enabled?: boolean, > permissions?: { > can_download?: boolean, > can_preview?: boolean, > can_edit?: boolean > }, > download_count?: number, > preview_count?: number > } > ``` > **parent full type** > > ```ts theme={null} > { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > } > ``` *** ### search `files.search` Search for files in Box **Risk:** `read` ```ts theme={null} await corsair.box.api.files.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `ancestor_folder_ids` | `string` | No | — | | `content_types` | `string` | No | — | | `created_at_range` | `string` | No | — | | `file_extensions` | `string` | No | — | | `owner_user_ids` | `string` | No | — | | `size_range` | `string` | No | — | | `sort` | `modified_at \| name` | No | — | | `direction` | `ASC \| DESC` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_count` | `number` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `entries` | `object[]` | No | — | > **entries full type** > > ```ts theme={null} > { > type?: string, > id: string, > name?: string > }[] > ``` *** ### share `files.share` Create or update a shared link for a Box file **Risk:** `write` ```ts theme={null} await corsair.box.api.files.share({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `shared_link` | `object` | Yes | — | > **shared\_link full type** > > ```ts theme={null} > { > access?: open | company | collaborators, > password?: string, > unshared_at?: string, > permissions?: { > can_download?: boolean, > can_preview?: boolean, > can_edit?: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `file` | No | — | | `id` | `string` | Yes | — | | `sequence_id` | `string` | No | — | | `etag` | `string` | No | — | | `sha1` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `size` | `number` | No | — | | `path_collection` | `object` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `trashed_at` | `string` | No | — | | `purged_at` | `string` | No | — | | `content_created_at` | `string` | No | — | | `content_modified_at` | `string` | No | — | | `created_by` | `object` | No | — | | `modified_by` | `object` | No | — | | `owned_by` | `object` | No | — | | `shared_link` | `object` | No | — | | `parent` | `object` | No | — | | `item_status` | `string` | No | — | | `extension` | `string` | No | — | | `is_package` | `boolean` | No | — | > **path\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > }[] > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **modified\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **owned\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **shared\_link full type** > > ```ts theme={null} > { > url?: string, > download_url?: string | null, > vanity_url?: string | null, > access?: string, > effective_access?: string, > effective_permission?: string, > unshared_at?: string | null, > is_password_enabled?: boolean, > permissions?: { > can_download?: boolean, > can_preview?: boolean, > can_edit?: boolean > }, > download_count?: number, > preview_count?: number > } > ``` > **parent full type** > > ```ts theme={null} > { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > } > ``` *** ### upload `files.upload` Upload a new file to Box **Risk:** `write` ```ts theme={null} await corsair.box.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `parent_id` | `string` | Yes | — | | `content` | `string` | Yes | — | | `content_created_at` | `string` | No | — | | `content_modified_at` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_count` | `number` | No | — | | `entries` | `object[]` | No | — | > **entries full type** > > ```ts theme={null} > { > type?: file, > id: string, > sequence_id?: string, > etag?: string, > sha1?: string, > name?: string, > description?: string, > size?: number, > path_collection?: { > total_count?: number, > entries?: { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > }[] > }, > created_at?: string, > modified_at?: string, > trashed_at?: string | null, > purged_at?: string | null, > content_created_at?: string, > content_modified_at?: string, > created_by?: { > type?: string, > id?: string, > name?: string, > login?: string > }, > modified_by?: { > type?: string, > id?: string, > name?: string, > login?: string > }, > owned_by?: { > type?: string, > id?: string, > name?: string, > login?: string > }, > shared_link?: { > url?: string, > download_url?: string | null, > vanity_url?: string | null, > access?: string, > effective_access?: string, > effective_permission?: string, > unshared_at?: string | null, > is_password_enabled?: boolean, > permissions?: { > can_download?: boolean, > can_preview?: boolean, > can_edit?: boolean > }, > download_count?: number, > preview_count?: number > } | null, > parent?: { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > } | null, > item_status?: string, > extension?: string, > is_package?: boolean > }[] > ``` *** ## Folders ### create `folders.create` Create a new folder in Box **Risk:** `write` ```ts theme={null} await corsair.box.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `parent_id` | `string` | Yes | — | | `folder_upload_email_access` | `string` | No | — | | `sync_state` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `folder` | No | — | | `id` | `string` | Yes | — | | `sequence_id` | `string` | No | — | | `etag` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `path_collection` | `object` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `trashed_at` | `string` | No | — | | `purged_at` | `string` | No | — | | `content_created_at` | `string` | No | — | | `content_modified_at` | `string` | No | — | | `created_by` | `object` | No | — | | `modified_by` | `object` | No | — | | `owned_by` | `object` | No | — | | `shared_link` | `object` | No | — | | `parent` | `object` | No | — | | `item_status` | `string` | No | — | | `is_externally_owned` | `boolean` | No | — | | `has_collaborations` | `boolean` | No | — | | `item_collection` | `object` | No | — | > **path\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > }[] > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **modified\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **owned\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **shared\_link full type** > > ```ts theme={null} > { > url?: string, > download_url?: string | null, > vanity_url?: string | null, > access?: string, > effective_access?: string, > effective_permission?: string, > unshared_at?: string | null, > is_password_enabled?: boolean, > permissions?: { > can_download?: boolean, > can_preview?: boolean, > can_edit?: boolean > }, > download_count?: number, > preview_count?: number > } > ``` > **parent full type** > > ```ts theme={null} > { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > } > ``` > **item\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > }[] > } > ``` *** ### delete `folders.delete` Delete a Box folder **Risk:** `destructive` ```ts theme={null} await corsair.box.api.folders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `recursive` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `folders.get` Get metadata for a Box folder by ID **Risk:** `read` ```ts theme={null} await corsair.box.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `folder` | No | — | | `id` | `string` | Yes | — | | `sequence_id` | `string` | No | — | | `etag` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `path_collection` | `object` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `trashed_at` | `string` | No | — | | `purged_at` | `string` | No | — | | `content_created_at` | `string` | No | — | | `content_modified_at` | `string` | No | — | | `created_by` | `object` | No | — | | `modified_by` | `object` | No | — | | `owned_by` | `object` | No | — | | `shared_link` | `object` | No | — | | `parent` | `object` | No | — | | `item_status` | `string` | No | — | | `is_externally_owned` | `boolean` | No | — | | `has_collaborations` | `boolean` | No | — | | `item_collection` | `object` | No | — | > **path\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > }[] > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **modified\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **owned\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **shared\_link full type** > > ```ts theme={null} > { > url?: string, > download_url?: string | null, > vanity_url?: string | null, > access?: string, > effective_access?: string, > effective_permission?: string, > unshared_at?: string | null, > is_password_enabled?: boolean, > permissions?: { > can_download?: boolean, > can_preview?: boolean, > can_edit?: boolean > }, > download_count?: number, > preview_count?: number > } > ``` > **parent full type** > > ```ts theme={null} > { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > } > ``` > **item\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > }[] > } > ``` *** ### search `folders.search` Search for folders in Box **Risk:** `read` ```ts theme={null} await corsair.box.api.folders.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `ancestor_folder_ids` | `string` | No | — | | `owner_user_ids` | `string` | No | — | | `sort` | `modified_at \| name` | No | — | | `direction` | `ASC \| DESC` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_count` | `number` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `entries` | `object[]` | No | — | > **entries full type** > > ```ts theme={null} > { > type?: string, > id: string, > name?: string > }[] > ``` *** ### share `folders.share` Create or update a shared link for a Box folder **Risk:** `write` ```ts theme={null} await corsair.box.api.folders.share({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `shared_link` | `object` | Yes | — | > **shared\_link full type** > > ```ts theme={null} > { > access?: open | company | collaborators, > password?: string, > unshared_at?: string, > permissions?: { > can_download?: boolean, > can_preview?: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `folder` | No | — | | `id` | `string` | Yes | — | | `sequence_id` | `string` | No | — | | `etag` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `path_collection` | `object` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `trashed_at` | `string` | No | — | | `purged_at` | `string` | No | — | | `content_created_at` | `string` | No | — | | `content_modified_at` | `string` | No | — | | `created_by` | `object` | No | — | | `modified_by` | `object` | No | — | | `owned_by` | `object` | No | — | | `shared_link` | `object` | No | — | | `parent` | `object` | No | — | | `item_status` | `string` | No | — | | `is_externally_owned` | `boolean` | No | — | | `has_collaborations` | `boolean` | No | — | | `item_collection` | `object` | No | — | > **path\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > }[] > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **modified\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **owned\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **shared\_link full type** > > ```ts theme={null} > { > url?: string, > download_url?: string | null, > vanity_url?: string | null, > access?: string, > effective_access?: string, > effective_permission?: string, > unshared_at?: string | null, > is_password_enabled?: boolean, > permissions?: { > can_download?: boolean, > can_preview?: boolean, > can_edit?: boolean > }, > download_count?: number, > preview_count?: number > } > ``` > **parent full type** > > ```ts theme={null} > { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > } > ``` > **item\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > }[] > } > ``` *** ### update `folders.update` Update properties of a Box folder **Risk:** `write` ```ts theme={null} await corsair.box.api.folders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `parent_id` | `string` | No | — | | `tags` | `string[]` | No | — | | `is_collaboration_restricted_to_enterprise` | `boolean` | No | — | | `can_non_owners_invite` | `boolean` | No | — | | `can_non_owners_view_collaborators` | `boolean` | No | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `folder` | No | — | | `id` | `string` | Yes | — | | `sequence_id` | `string` | No | — | | `etag` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `path_collection` | `object` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `trashed_at` | `string` | No | — | | `purged_at` | `string` | No | — | | `content_created_at` | `string` | No | — | | `content_modified_at` | `string` | No | — | | `created_by` | `object` | No | — | | `modified_by` | `object` | No | — | | `owned_by` | `object` | No | — | | `shared_link` | `object` | No | — | | `parent` | `object` | No | — | | `item_status` | `string` | No | — | | `is_externally_owned` | `boolean` | No | — | | `has_collaborations` | `boolean` | No | — | | `item_collection` | `object` | No | — | > **path\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > }[] > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **modified\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **owned\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **shared\_link full type** > > ```ts theme={null} > { > url?: string, > download_url?: string | null, > vanity_url?: string | null, > access?: string, > effective_access?: string, > effective_permission?: string, > unshared_at?: string | null, > is_password_enabled?: boolean, > permissions?: { > can_download?: boolean, > can_preview?: boolean, > can_edit?: boolean > }, > download_count?: number, > preview_count?: number > } > ``` > **parent full type** > > ```ts theme={null} > { > type?: string, > id?: string, > sequence_id?: string | null, > etag?: string | null, > name?: string | null > } > ``` > **item\_collection full type** > > ```ts theme={null} > { > total_count?: number, > entries?: { > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/box/database Box local sync: searchable entities, `.search()` filters, and operators. The Box plugin syncs data locally. Use `corsair.box.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Files Path: `box.db.files.search` ```ts theme={null} const rows = await corsair.box.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `etag` | `string` | equals, contains, startsWith, endsWith, in | | `sha1` | `string` | equals, contains, startsWith, endsWith, in | | `sequence_id` | `string` | equals, contains, startsWith, endsWith, in | | `extension` | `string` | equals, contains, startsWith, endsWith, in | | `is_package` | `boolean` | equals | | `content_created_at` | `string` | equals, contains, startsWith, endsWith, in | | `content_modified_at` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `modified_at` | `string` | equals, contains, startsWith, endsWith, in | | `trashed_at` | `string` | equals, contains, startsWith, endsWith, in | | `purged_at` | `string` | equals, contains, startsWith, endsWith, in | | `item_status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Folders Path: `box.db.folders.search` ```ts theme={null} const rows = await corsair.box.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `etag` | `string` | equals, contains, startsWith, endsWith, in | | `sequence_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `modified_at` | `string` | equals, contains, startsWith, endsWith, in | | `trashed_at` | `string` | equals, contains, startsWith, endsWith, in | | `purged_at` | `string` | equals, contains, startsWith, endsWith, in | | `content_created_at` | `string` | equals, contains, startsWith, endsWith, in | | `content_modified_at` | `string` | equals, contains, startsWith, endsWith, in | | `is_externally_owned` | `boolean` | equals | | `has_collaborations` | `boolean` | equals | | `item_status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/box/get-credentials Step-by-step instructions for obtaining Box OAuth 2.0 credentials. This guide walks you through obtaining OAuth 2.0 credentials for the Box plugin. ## Authentication Method * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 user authentication ## OAuth 2.0 Setup ### Step 1: Create a Box App 1. Go to [Box Developer Console](https://app.box.com/developers/console) 2. Click **Create New App** 3. Select **Custom App** 4. Choose **Standard OAuth 2.0** as the authentication method 5. Enter your app name and click **Create App** ### Step 2: Configure OAuth Settings 1. In your app settings, go to the **Configuration** tab 2. Under **OAuth 2.0 Redirect URI**, add your callback URL * For CLI flow: `http://localhost:` 3. Under **Application Scopes**, select the required permissions: * `Read all files and folders stored in Box` * `Write all files and folders stored in Box` 4. Click **Save Changes** ### Step 3: Get Client Credentials 1. In the **Configuration** tab, copy the **Client ID** and **Client Secret** 2. Store these securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=box client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=box ``` The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically. ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth 2.0 | Developer Console → App Configuration | | Client Secret | OAuth 2.0 | Developer Console → App Configuration | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/box/overview Cloud content management for secure file storage, sharing, and enterprise collaboration. Use **Box** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 13 typed API operations * 2 synced entities (`files`, `folders`) for fast `.search()` / `.list()` * 33 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/box ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/box ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/box ``` ```bash bun theme={null} bun add corsair @corsair-dev/box ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { box } from '@corsair-dev/box'; export const corsair = createCorsair({ plugins: [ box(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Box OAuth app. Provider walkthrough: [Get Credentials](/plugins/box/get-credentials). ```ts theme={null} box() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'box', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`files.download`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.box.api.files.download({}); ``` **`files.copy`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.box.api.files.copy({}); ``` See the full list on the [API](/plugins/box/api) page. ## Query synced data Synced entities support `tenant.box.db..search()` and `.list()`: `files`, `folders`. See [Database](/plugins/box/database) for filters and operators. ## Webhooks This plugin registers **33** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/box/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/box/api)** > > Every `box.api.*` operation with input and output types. > **[Database](/plugins/box/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/box/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/box/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/box/webhooks Box incoming webhooks: event paths, payloads, and response data. The Box plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/box/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `collaborations` * `accepted` (`collaborations.accepted`) * `created` (`collaborations.created`) * `rejected` (`collaborations.rejected`) * `removed` (`collaborations.removed`) * `updated` (`collaborations.updated`) * `comments` * `created` (`comments.created`) * `deleted` (`comments.deleted`) * `updated` (`comments.updated`) * `files` * `copied` (`files.copied`) * `deleted` (`files.deleted`) * `downloaded` (`files.downloaded`) * `locked` (`files.locked`) * `moved` (`files.moved`) * `previewed` (`files.previewed`) * `renamed` (`files.renamed`) * `restored` (`files.restored`) * `trashed` (`files.trashed`) * `unlocked` (`files.unlocked`) * `uploaded` (`files.uploaded`) * `folders` * `copied` (`folders.copied`) * `created` (`folders.created`) * `deleted` (`folders.deleted`) * `downloaded` (`folders.downloaded`) * `moved` (`folders.moved`) * `renamed` (`folders.renamed`) * `restored` (`folders.restored`) * `trashed` (`folders.trashed`) * `metadata` * `instanceCreated` (`metadata.instanceCreated`) * `instanceDeleted` (`metadata.instanceDeleted`) * `instanceUpdated` (`metadata.instanceUpdated`) * `sharedLinks` * `created` (`sharedLinks.created`) * `deleted` (`sharedLinks.deleted`) * `updated` (`sharedLinks.updated`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Collaborations ### Accepted `collaborations.accepted` A collaboration invitation was accepted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `COLLABORATION.ACCEPTED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: COLLABORATION.ACCEPTED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { collaborations: { accepted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `collaborations.created` A new collaboration was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `COLLABORATION.CREATED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: COLLABORATION.CREATED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { collaborations: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Rejected `collaborations.rejected` A collaboration invitation was rejected **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `COLLABORATION.REJECTED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: COLLABORATION.REJECTED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { collaborations: { rejected: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Removed `collaborations.removed` A collaboration was removed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `COLLABORATION.REMOVED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: COLLABORATION.REMOVED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { collaborations: { removed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `collaborations.updated` A collaboration was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `COLLABORATION.UPDATED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: COLLABORATION.UPDATED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { collaborations: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Comments ### Created `comments.created` A comment was created on a file **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `COMMENT.CREATED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: COMMENT.CREATED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { comments: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `comments.deleted` A comment was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `COMMENT.DELETED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: COMMENT.DELETED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { comments: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `comments.updated` A comment was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `COMMENT.UPDATED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: COMMENT.UPDATED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { comments: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Files ### Copied `files.copied` A file was copied to another location **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.COPIED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.COPIED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { copied: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `files.deleted` A file was permanently deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.DELETED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.DELETED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Downloaded `files.downloaded` A file was downloaded **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.DOWNLOADED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.DOWNLOADED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { downloaded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Locked `files.locked` A file was locked **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.LOCKED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.LOCKED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { locked: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Moved `files.moved` A file was moved to another folder **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.MOVED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.MOVED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { moved: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Previewed `files.previewed` A file was previewed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.PREVIEWED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.PREVIEWED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { previewed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Renamed `files.renamed` A file was renamed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.RENAMED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.RENAMED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { renamed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Restored `files.restored` A file was restored from trash **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.RESTORED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.RESTORED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { restored: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Trashed `files.trashed` A file was moved to trash **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.TRASHED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.TRASHED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { trashed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unlocked `files.unlocked` A file lock was removed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.UNLOCKED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.UNLOCKED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { unlocked: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Uploaded `files.uploaded` A new file was uploaded **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FILE.UPLOADED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FILE.UPLOADED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { files: { uploaded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Folders ### Copied `folders.copied` A folder was copied to another location **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FOLDER.COPIED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FOLDER.COPIED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { folders: { copied: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `folders.created` A new folder was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FOLDER.CREATED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FOLDER.CREATED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { folders: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `folders.deleted` A folder was permanently deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FOLDER.DELETED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FOLDER.DELETED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { folders: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Downloaded `folders.downloaded` A folder was downloaded **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FOLDER.DOWNLOADED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FOLDER.DOWNLOADED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { folders: { downloaded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Moved `folders.moved` A folder was moved to another location **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FOLDER.MOVED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FOLDER.MOVED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { folders: { moved: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Renamed `folders.renamed` A folder was renamed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FOLDER.RENAMED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FOLDER.RENAMED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { folders: { renamed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Restored `folders.restored` A folder was restored from trash **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FOLDER.RESTORED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FOLDER.RESTORED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { folders: { restored: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Trashed `folders.trashed` A folder was moved to trash **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `FOLDER.TRASHED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: FOLDER.TRASHED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { folders: { trashed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Metadata ### Instance Created `metadata.instanceCreated` A metadata instance was created on a file or folder **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `METADATA_INSTANCE.CREATED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: METADATA_INSTANCE.CREATED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { metadata: { instanceCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Instance Deleted `metadata.instanceDeleted` A metadata instance was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `METADATA_INSTANCE.DELETED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: METADATA_INSTANCE.DELETED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { metadata: { instanceDeleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Instance Updated `metadata.instanceUpdated` A metadata instance was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `METADATA_INSTANCE.UPDATED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: METADATA_INSTANCE.UPDATED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { metadata: { instanceUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Shared Links ### Created `sharedLinks.created` A shared link was created for a file or folder **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `SHARED_LINK.CREATED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: SHARED_LINK.CREATED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { sharedLinks: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `sharedLinks.deleted` A shared link was removed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `SHARED_LINK.DELETED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: SHARED_LINK.DELETED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { sharedLinks: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `sharedLinks.updated` A shared link settings were updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webhook_event` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `trigger` | `SHARED_LINK.UPDATED` | Yes | — | | `webhook` | `object` | Yes | — | | `created_by` | `object` | Yes | — | | `source` | `object` | Yes | — | | `additional_info` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > type: webhook, > id: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string, > login?: string > } > ``` > **source full type** > > ```ts theme={null} > { > } > ``` > **additional\_info full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: webhook_event, > id: string, > created_at: string, > trigger: SHARED_LINK.UPDATED, > webhook: { > type: webhook, > id: string > }, > created_by: { > type?: string, > id?: string, > name?: string, > login?: string > }, > source: { > }, > additional_info?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} box({ webhookHooks: { sharedLinks: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/boxhero/api API reference for BoxHero: every `boxhero.api.*` operation with input and output types. Every `boxhero.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Item Attributes ### get `itemAttributes.get` Get an item attribute spec **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.itemAttributes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `attr_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `item` | `object` | Yes | — | > **item full type** > > ```ts theme={null} > { > id: number, > attr_type: text | date | number | barcode, > attr_name: string, > rank: number > } > ``` *** ### list `itemAttributes.list` List item attribute specs **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.itemAttributes.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > attr_type: text | date | number | barcode, > attr_name: string, > rank: number > }[] > ``` *** ## Items ### delete `items.delete` Delete an inventory item **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.boxhero.api.items.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `number` | Yes | — | **Output:** *empty object* *** ### get `items.get` Get an inventory item **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.items.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `number` | Yes | — | | `location_ids` | `number \| number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `item` | `object` | Yes | — | > **item full type** > > ```ts theme={null} > { > id: number, > name: string, > sku: string, > barcode: string, > photo_url?: string | null, > attrs: { > id: number, > type: text | date | number | barcode, > name: string, > value: string | number > }[], > cost: string, > price: string, > quantity: number, > quantities: { > location_id: number, > quantity: number > }[] > } > ``` *** ### list `items.list` List inventory items **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.items.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `number` | No | — | | `limit` | `number` | No | — | | `item_ids` | `number \| number[]` | No | — | | `location_ids` | `number \| number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `count` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `cursor` | `number` | No | — | | `has_more` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > name: string, > sku: string, > barcode: string, > photo_url?: string | null, > attrs: { > id: number, > type: text | date | number | barcode, > name: string, > value: string | number > }[], > cost: string, > price: string, > quantity: number, > quantities: { > location_id: number, > quantity: number > }[] > }[] > ``` *** ## Locations ### delete `locations.delete` Delete a warehouse location **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.boxhero.api.locations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `location_id` | `number` | Yes | — | **Output:** *empty object* *** ### get `locations.get` Get a warehouse location **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.locations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `location_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `item` | `object` | Yes | — | > **item full type** > > ```ts theme={null} > { > id: number, > name: string, > quantity: number, > memo: string > } > ``` *** ### list `locations.list` List active warehouse locations **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.locations.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > name: string, > quantity: number, > memo: string > }[] > ``` *** ## Members ### get `members.get` Get a team member **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.members.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `member_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `item` | `object` | Yes | — | > **item full type** > > ```ts theme={null} > { > id: number, > name: string, > role: admin | member | viewer > } > ``` *** ### list `members.list` List team members **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.members.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > name: string, > role: admin | member | viewer > }[] > ``` *** ## Partners ### list `partners.list` List partners (suppliers and customers) **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.partners.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `0 \| 1` | No | — | | `cursor` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `count` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `cursor` | `number` | No | — | | `has_more` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > type: 0 | 1, > name: string, > phone: string, > email: string, > address: string, > memo: string > }[] > ``` *** ## Teams ### getInfo `teams.getInfo` Get the team linked to the API token **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.teams.getInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `mode` | `0 \| 1 \| 2` | Yes | — | | `currency_symbol` | `string` | No | — | | `currency_code` | `string` | No | — | | `price_decimal_places` | `number` | Yes | — | | `memo` | `string` | No | — | *** ## Transactions ### listBasic `transactions.listBasic` List inventory transactions without line items **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.transactions.listBasic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `number` | No | — | | `limit` | `number` | No | — | | `type` | `in \| out \| move \| adjust` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `count` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `cursor` | `number` | No | — | | `has_more` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > ( > { > id: number, > transaction_time: string, > created_at: string, > created_by: { > id: number, > name: string, > deleted: boolean > }, > count_of_items: number, > total_quantity: number, > url: string, > memo: string, > revision: number, > type: in, > to_location: { > id: number, > name: string, > deleted: boolean > }, > partner?: { > id: number, > name: string, > deleted: boolean > } | null > } | { > id: number, > transaction_time: string, > created_at: string, > created_by: { > id: number, > name: string, > deleted: boolean > }, > count_of_items: number, > total_quantity: number, > url: string, > memo: string, > revision: number, > type: out, > to_location: { > id: number, > name: string, > deleted: boolean > }, > partner?: { > id: number, > name: string, > deleted: boolean > } | null > } | { > id: number, > transaction_time: string, > created_at: string, > created_by: { > id: number, > name: string, > deleted: boolean > }, > count_of_items: number, > total_quantity: number, > url: string, > memo: string, > revision: number, > type: move, > from_location: { > id: number, > name: string, > deleted: boolean > }, > to_location: { > id: number, > name: string, > deleted: boolean > } > } | { > id: number, > transaction_time: string, > created_at: string, > created_by: { > id: number, > name: string, > deleted: boolean > }, > count_of_items: number, > total_quantity: number, > url: string, > memo: string, > revision: number, > type: adjust, > to_location: { > id: number, > name: string, > deleted: boolean > } > } > )[] > ``` *** ### listLocation `transactions.listLocation` List location-mode inventory transactions **Risk:** `read` ```ts theme={null} await corsair.boxhero.api.transactions.listLocation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `number` | No | — | | `limit` | `number` | No | — | | `type` | `in \| out \| move \| adjust` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `count` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `cursor` | `number` | No | — | | `has_more` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > ( > { > id: number, > transaction_time: string, > created_at: string, > created_by: { > id: number, > name: string, > deleted: boolean > }, > count_of_items: number, > total_quantity: number, > url: string, > memo: string, > revision: number, > type: in, > to_location: { > id: number, > name: string, > deleted: boolean > }, > partner?: { > id: number, > name: string, > deleted: boolean > } | null > } | { > id: number, > transaction_time: string, > created_at: string, > created_by: { > id: number, > name: string, > deleted: boolean > }, > count_of_items: number, > total_quantity: number, > url: string, > memo: string, > revision: number, > type: out, > to_location: { > id: number, > name: string, > deleted: boolean > }, > partner?: { > id: number, > name: string, > deleted: boolean > } | null > } | { > id: number, > transaction_time: string, > created_at: string, > created_by: { > id: number, > name: string, > deleted: boolean > }, > count_of_items: number, > total_quantity: number, > url: string, > memo: string, > revision: number, > type: move, > from_location: { > id: number, > name: string, > deleted: boolean > }, > to_location: { > id: number, > name: string, > deleted: boolean > } > } | { > id: number, > transaction_time: string, > created_at: string, > created_by: { > id: number, > name: string, > deleted: boolean > }, > count_of_items: number, > total_quantity: number, > url: string, > memo: string, > revision: number, > type: adjust, > to_location: { > id: number, > name: string, > deleted: boolean > } > } > )[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/boxhero/database BoxHero local sync: searchable entities, `.search()` filters, and operators. The BoxHero plugin syncs data locally. Use `corsair.boxhero.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Attr Path: `boxhero.db.attr.search` ```ts theme={null} const rows = await corsair.boxhero.db.attr.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `attr_name` | `string` | equals, contains, startsWith, endsWith, in | | `rank` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Item Path: `boxhero.db.item.search` ```ts theme={null} const rows = await corsair.boxhero.db.item.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `sku` | `string` | equals, contains, startsWith, endsWith, in | | `barcode` | `string` | equals, contains, startsWith, endsWith, in | | `photo_url` | `string` | equals, contains, startsWith, endsWith, in | | `cost` | `string` | equals, contains, startsWith, endsWith, in | | `price` | `string` | equals, contains, startsWith, endsWith, in | | `quantity` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Location Path: `boxhero.db.location.search` ```ts theme={null} const rows = await corsair.boxhero.db.location.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `quantity` | `number` | equals, gt, gte, lt, lte, in | | `memo` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Member Path: `boxhero.db.member.search` ```ts theme={null} const rows = await corsair.boxhero.db.member.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Partner Path: `boxhero.db.partner.search` ```ts theme={null} const rows = await corsair.boxhero.db.partner.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `memo` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Team Path: `boxhero.db.team.search` ```ts theme={null} const rows = await corsair.boxhero.db.team.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `currency_symbol` | `string` | equals, contains, startsWith, endsWith, in | | `currency_code` | `string` | equals, contains, startsWith, endsWith, in | | `price_decimal_places` | `number` | equals, gt, gte, lt, lte, in | | `memo` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transaction Path: `boxhero.db.transaction.search` ```ts theme={null} const rows = await corsair.boxhero.db.transaction.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/boxhero/overview Inventory management app for tracking stock, barcodes, and warehouse item movements. Use **BoxHero** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 14 typed API operations * 7 synced entities (`attr`, `item`, `location`, `member`, `partner`, `team`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/boxhero ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/boxhero ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/boxhero ``` ```bash bun theme={null} bun add corsair @corsair-dev/boxhero ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { boxhero } from '@corsair-dev/boxhero'; export const corsair = createCorsair({ plugins: [ boxhero(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} boxhero() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'boxhero', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`itemAttributes.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.boxhero.api.itemAttributes.get({}); ``` **`items.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.boxhero.api.items.delete({}); ``` See the full list on the [API](/plugins/boxhero/api) page. ## Query synced data Synced entities support `tenant.boxhero.db..search()` and `.list()`: `attr`, `item`, `location`, `member`, `partner`, `team`, `transaction`. See [Database](/plugins/boxhero/database) for filters and operators. ## What's next > **[API reference](/plugins/boxhero/api)** > > Every `boxhero.api.*` operation with input and output types. > **[Database](/plugins/boxhero/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/brandfetch/api API reference for Brandfetch: every `brandfetch.api.*` operation with input and output types. Every `brandfetch.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Brands ### get `brands.get` Get brand logos, colors, fonts, and company details by domain, ticker, ISIN, crypto symbol, or Brand ID **Risk:** `read` ```ts theme={null} await corsair.brandfetch.api.brands.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | Domain (nike.com), Brand ID (id\_0dwKPKT), ISIN, ticker (NKE), or crypto symbol (BTC) | | `identifierType` | `domain \| ticker \| isin \| crypto` | No | Explicit identifier type. Omit to use auto-detect (domain → ticker → ISIN → crypto). | | `allowNsfw` | `boolean` | No | When true, return NSFW brands. When false, NSFW brands 404. Unset uses Brandfetch default. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `domain` | `string` | Yes | — | | `claimed` | `boolean` | Yes | — | | `description` | `string` | No | — | | `longDescription` | `string` | No | — | | `links` | `object[]` | Yes | — | | `logos` | `object[]` | Yes | — | | `colors` | `object[]` | Yes | — | | `fonts` | `object[]` | Yes | — | | `images` | `object[]` | Yes | — | | `qualityScore` | `number` | Yes | — | | `company` | `object` | No | — | | `isNsfw` | `boolean` | Yes | — | | `urn` | `string` | Yes | — | > **links full type** > > ```ts theme={null} > { > name: string, > url: string > }[] > ``` > **logos full type** > > ```ts theme={null} > { > theme?: dark | light | null, > formats: { > src?: string, > format?: svg | webp | png | jpeg, > height?: number | null, > width?: number | null, > size?: number, > background?: transparent | null > }[], > tags: any[], > type: icon | logo | symbol | other > }[] > ``` > **colors full type** > > ```ts theme={null} > { > hex: string, > type: accent | dark | light | brand, > brightness: number > }[] > ``` > **fonts full type** > > ```ts theme={null} > { > name?: string | null, > type: title | body, > origin?: google | custom | system, > originId?: string | null, > weights?: any[] > }[] > ``` > **images full type** > > ```ts theme={null} > { > formats: { > src?: string, > format?: svg | webp | png | jpeg, > height?: number | null, > width?: number | null, > size?: number, > background?: transparent | null > }[], > tags: any[], > type: banner | other | picture, > pictureMetadata?: { > score: number, > rank: number, > naturalWidth: number, > naturalHeight: number, > alt: string, > sourceUrl: string, > imageCategory?: string | null, > categoryConfidence?: number | null > } | null > }[] > ``` > **company full type** > > ```ts theme={null} > { > employees?: number | null, > financialIdentifiers?: { > isin?: string[], > ticker?: string[] > } | null, > foundedYear?: number | null, > industries?: { > id: string, > score?: number, > slug: string, > name: string, > emoji?: string, > parent?: { > id: string, > slug: string, > name: string, > emoji?: string > } | { > id: string, > slug: string, > name: string, > emoji?: string > }[] | null > }[], > kind?: string | null, > location?: { > city?: string | null, > country?: string | null, > countryCode?: string | null, > region?: string | null, > state?: string | null, > subregion?: string | null > } > } > ``` *** ### getCompany `brands.getCompany` Get firmographic company data for a brand identifier **Risk:** `read` ```ts theme={null} await corsair.brandfetch.api.brands.getCompany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | Domain (nike.com), Brand ID (id\_0dwKPKT), ISIN, ticker (NKE), or crypto symbol (BTC) | | `identifierType` | `domain \| ticker \| isin \| crypto` | No | Explicit identifier type. Omit to use auto-detect (domain → ticker → ISIN → crypto). | | `allowNsfw` | `boolean` | No | When true, return NSFW brands. When false, NSFW brands 404. Unset uses Brandfetch default. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `employees` | `number` | No | — | | `financialIdentifiers` | `object` | No | — | | `foundedYear` | `number` | No | — | | `industries` | `object[]` | No | — | | `kind` | `string` | No | — | | `location` | `object` | No | — | > **financialIdentifiers full type** > > ```ts theme={null} > { > isin?: string[], > ticker?: string[] > } > ``` > **industries full type** > > ```ts theme={null} > { > id: string, > score?: number, > slug: string, > name: string, > emoji?: string, > parent?: { > id: string, > slug: string, > name: string, > emoji?: string > } | { > id: string, > slug: string, > name: string, > emoji?: string > }[] | null > }[] > ``` > **location full type** > > ```ts theme={null} > { > city?: string | null, > country?: string | null, > countryCode?: string | null, > region?: string | null, > state?: string | null, > subregion?: string | null > } > ``` *** ### search `brands.search` Search brands by name for autocomplete (requires client ID) **Risk:** `read` ```ts theme={null} await corsair.brandfetch.api.brands.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Brand name to search for | | `clientId` | `string` | No | Brandfetch client ID. Falls back to plugin options / stored key. | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > icon?: string | null, > name?: string | null, > domain: string, > claimed: boolean, > brandId: string > }[] > ``` *** ## Graphql ### getVersion `graphql.getVersion` Get the Brandfetch GraphQL API version **Risk:** `read` ```ts theme={null} await corsair.brandfetch.api.graphql.getVersion({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | Yes | — | *** ## Logos ### get `logos.get` Build a Brandfetch Logo CDN URL (requires client ID) **Risk:** `read` ```ts theme={null} await corsair.brandfetch.api.logos.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | Domain (nike.com), Brand ID (id\_0dwKPKT), ISIN, ticker (NKE), or crypto symbol (BTC) | | `identifierType` | `domain \| ticker \| isin \| crypto` | No | Explicit identifier type. Omit to use auto-detect (domain → ticker → ISIN → crypto). | | `clientId` | `string` | No | — | | `logoType` | `icon \| logo \| symbol` | No | CDN asset type. Defaults to icon. | | `theme` | `light \| dark` | No | — | | `fallback` | `404 \| brandfetch \| transparent \| lettermark` | No | — | | `w` | `number` | No | Width in pixels | | `h` | `number` | No | Height in pixels | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | *** ## Taxonomy ### get `taxonomy.get` Get Brandfetch industries, countries, and geographic regions **Risk:** `read` ```ts theme={null} await corsair.brandfetch.api.taxonomy.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `industries` | `object[]` | Yes | — | | `countries` | `object[]` | Yes | — | | `geographicRegions` | `object[]` | Yes | — | > **industries full type** > > ```ts theme={null} > { > id: string, > urn?: string, > name: string, > slug: string, > emoji?: string, > depth?: number, > banner?: string | null, > parent?: { > id: string, > urn?: string, > name: string, > slug: string, > emoji?: string, > depth?: number, > banner?: string | null > } | null, > children?: { > id: string, > urn?: string, > name: string, > slug: string, > emoji?: string, > depth?: number, > banner?: string | null > }[] > }[] > ``` > **countries full type** > > ```ts theme={null} > { > code: string, > name: string, > slug: string, > emoji?: string, > latitude?: number, > longitude?: number > }[] > ``` > **geographicRegions full type** > > ```ts theme={null} > { > name: string, > slug: string, > emoji?: string, > depth?: number, > parent?: { > name: string, > slug: string > } | null > }[] > ``` *** ## Transactions ### get `transactions.get` Match a payment descriptor to merchant brand data **Risk:** `read` ```ts theme={null} await corsair.brandfetch.api.transactions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transactionLabel` | `string` | Yes | Raw transaction text from a credit-card statement | | `countryCode` | `string` | Yes | ISO 3166-1 alpha-2 country code where the transaction took place | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `domain` | `string` | Yes | — | | `claimed` | `boolean` | Yes | — | | `description` | `string` | No | — | | `longDescription` | `string` | No | — | | `links` | `object[]` | Yes | — | | `logos` | `object[]` | Yes | — | | `colors` | `object[]` | Yes | — | | `fonts` | `object[]` | Yes | — | | `images` | `object[]` | Yes | — | | `qualityScore` | `number` | Yes | — | | `company` | `object` | No | — | | `isNsfw` | `boolean` | Yes | — | | `urn` | `string` | Yes | — | > **links full type** > > ```ts theme={null} > { > name: string, > url: string > }[] > ``` > **logos full type** > > ```ts theme={null} > { > theme?: dark | light | null, > formats: { > src?: string, > format?: svg | webp | png | jpeg, > height?: number | null, > width?: number | null, > size?: number, > background?: transparent | null > }[], > tags: any[], > type: icon | logo | symbol | other > }[] > ``` > **colors full type** > > ```ts theme={null} > { > hex: string, > type: accent | dark | light | brand, > brightness: number > }[] > ``` > **fonts full type** > > ```ts theme={null} > { > name?: string | null, > type: title | body, > origin?: google | custom | system, > originId?: string | null, > weights?: any[] > }[] > ``` > **images full type** > > ```ts theme={null} > { > formats: { > src?: string, > format?: svg | webp | png | jpeg, > height?: number | null, > width?: number | null, > size?: number, > background?: transparent | null > }[], > tags: any[], > type: banner | other | picture, > pictureMetadata?: { > score: number, > rank: number, > naturalWidth: number, > naturalHeight: number, > alt: string, > sourceUrl: string, > imageCategory?: string | null, > categoryConfidence?: number | null > } | null > }[] > ``` > **company full type** > > ```ts theme={null} > { > employees?: number | null, > financialIdentifiers?: { > isin?: string[], > ticker?: string[] > } | null, > foundedYear?: number | null, > industries?: { > id: string, > score?: number, > slug: string, > name: string, > emoji?: string, > parent?: { > id: string, > slug: string, > name: string, > emoji?: string > } | { > id: string, > slug: string, > name: string, > emoji?: string > }[] | null > }[], > kind?: string | null, > location?: { > city?: string | null, > country?: string | null, > countryCode?: string | null, > region?: string | null, > state?: string | null, > subregion?: string | null > } > } > ``` *** ## Webhooks ### list `webhooks.list` List registered Brandfetch webhooks **Risk:** `read` ```ts theme={null} await corsair.brandfetch.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | No | Page size. GraphQL default is 10. | | `after` | `string` | No | Cursor from the previous pageInfo.endCursor | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nodes` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | > **nodes full type** > > ```ts theme={null} > { > urn: string, > url: string, > description?: string | null, > enabled: boolean, > events: string[], > createdAt?: string, > updatedAt?: string > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > endCursor?: string | null > } > ``` *** ### listEvents `webhooks.listEvents` List webhook event types that can be subscribed to **Risk:** `read` ```ts theme={null} await corsair.brandfetch.api.webhooks.listEvents({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `subscribableEvents` | `object[]` | Yes | — | > **subscribableEvents full type** > > ```ts theme={null} > { > namespace: string, > name: string, > description: string, > subscriptionScope: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/brandfetch/database Brandfetch local sync: searchable entities, `.search()` filters, and operators. The Brandfetch plugin syncs data locally. Use `corsair.brandfetch.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Brands Path: `brandfetch.db.brands.search` ```ts theme={null} const rows = await corsair.brandfetch.db.brands.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `claimed` | `boolean` | equals | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `longDescription` | `string` | equals, contains, startsWith, endsWith, in | | `qualityScore` | `number` | equals, gt, gte, lt, lte, in | | `isNsfw` | `boolean` | equals | | `urn` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Companies Path: `brandfetch.db.companies.search` ```ts theme={null} const rows = await corsair.brandfetch.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `brandId` | `string` | equals, contains, startsWith, endsWith, in | | `employees` | `number` | equals, gt, gte, lt, lte, in | | `foundedYear` | `number` | equals, gt, gte, lt, lte, in | | `kind` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `subregion` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `brandfetch.db.webhooks.search` ```ts theme={null} const rows = await corsair.brandfetch.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `urn` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `enabled` | `boolean` | equals | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/brandfetch/overview Brand asset API for logos, colors, fonts, and company visual identity data. Use **Brandfetch** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 9 typed API operations * 3 synced entities (`brands`, `companies`, `webhooks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/brandfetch ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/brandfetch ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/brandfetch ``` ```bash bun theme={null} bun add corsair @corsair-dev/brandfetch ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { brandfetch } from '@corsair-dev/brandfetch'; export const corsair = createCorsair({ plugins: [ brandfetch(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} brandfetch() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'brandfetch', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`brands.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.brandfetch.api.brands.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/brandfetch/api) reference.* See the full list on the [API](/plugins/brandfetch/api) page. ## Query synced data Synced entities support `tenant.brandfetch.db..search()` and `.list()`: `brands`, `companies`, `webhooks`. See [Database](/plugins/brandfetch/database) for filters and operators. ## What's next > **[API reference](/plugins/brandfetch/api)** > > Every `brandfetch.api.*` operation with input and output types. > **[Database](/plugins/brandfetch/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/breathehr/api API reference for Breathe HR: every `breathehr.api.*` operation with input and output types. Every `breathehr.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Absences ### list `absences.list` List absences **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.absences.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `type` | `Holiday \| OtherLeave` | No | — | | `end_date` | `string` | No | — | | `start_date` | `string` | No | — | | `rotacloud` | `boolean` | No | — | | `employee_id` | `number` | No | — | | `department_id` | `number` | No | — | | `other_leave_reason_id` | `number` | No | — | | `exclude_cancelled_absences` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `absences` | `object[]` | No | — | > **absences full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string > }[] > ``` *** ## Account ### get `account.get` Retrieve Breathe HR account details **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | No | — | > **account full type** > > ```ts theme={null} > { > id?: number, > name?: string, > domain?: string, > uuid?: string, > using_rta?: boolean, > health_and_safety_enabled?: boolean > } > ``` *** ## Benefits ### list `benefits.list` List employee benefits **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.benefits.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Bonuses ### list `bonuses.list` List employee bonuses **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.bonuses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Change Requests ### list `changeRequests.list` List change requests **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.changeRequests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Company Documents ### list `companyDocuments.list` List company documents **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.companyDocuments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Company Projects ### list `companyProjects.list` List company projects **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.companyProjects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Company Training Types ### list `companyTrainingTypes.list` List company training types **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.companyTrainingTypes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Departments ### list `departments.list` List departments **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.departments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ### listAbsences `departments.listAbsences` List absences for a department **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.departments.listAbsences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `exclude_cancelled_absences` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `absences` | `object[]` | No | — | > **absences full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string > }[] > ``` *** ### listBenefits `departments.listBenefits` List benefits for a department **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.departments.listBenefits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ### listBonuses `departments.listBonuses` List bonuses for a department **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.departments.listBonuses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ### listLeaveRequests `departments.listLeaveRequests` List leave requests for a department **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.departments.listLeaveRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `exclude_cancelled_requests` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `leave_requests` | `object[]` | No | — | > **leave\_requests full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string, > status?: string, > notes?: string | null > }[] > ``` *** ### listSalaries `departments.listSalaries` List salaries for a department **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.departments.listSalaries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Divisions ### list `divisions.list` List divisions **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.divisions.list({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Employee Expense Claims ### list `employeeExpenseClaims.list` List employee expense claims **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employeeExpenseClaims.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `employee_id` | `number` | No | — | | `state_filter` | `submitted \| approved \| completed` | No | — | **Output:** *empty object* *** ### update `employeeExpenseClaims.update` Approve or reject an expense claim **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.employeeExpenseClaims.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `approve` | `boolean` | Yes | — | | `approver_rejector_id` | `number` | Yes | — | | `rejection_reason` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Employee Expenses ### delete `employeeExpenses.delete` Delete an employee expense **Risk:** `destructive` ```ts theme={null} await corsair.breathehr.api.employeeExpenses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | *** ### get `employeeExpenses.get` Get an employee expense by ID **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employeeExpenses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `employee_expenses` | `object[]` | No | — | > **employee\_expenses full type** > > ```ts theme={null} > { > id?: number, > amount?: number | string, > description?: string, > expense_date?: string > }[] > ``` *** ### list `employeeExpenses.list` List employee expenses **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employeeExpenses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `employee_id` | `number` | No | — | | `show_claimed` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `employee_expenses` | `object[]` | No | — | > **employee\_expenses full type** > > ```ts theme={null} > { > id?: number, > amount?: number | string, > description?: string, > expense_date?: string > }[] > ``` *** ## Employee Jobs ### list `employeeJobs.list` List employee jobs **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employeeJobs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `employee_id` | `number` | No | — | **Output:** *empty object* *** ## Employees ### create `employees.create` Create an employee **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.employees.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `email` | `string` | Yes | — | | `company_join_date` | `string` | No | — | | `join_date` | `string` | No | — | | `job_title` | `string` | No | — | | `job_start_date` | `string` | No | — | | `hr` | `boolean` | No | — | | `dob` | `string` | No | — | | `gender` | `string` | No | — | | `status` | `string` | No | — | | `person_type` | `string` | No | — | | `department` | `number` | No | — | | `division` | `number` | No | — | | `location` | `number` | No | — | | `working_pattern` | `number` | No | — | | `working_pattern_id` | `number` | No | — | | `holiday_allowance` | `number` | No | — | | `holiday_allowance_id` | `number` | No | — | | `middle_name` | `string` | No | — | | `work_mobile` | `string` | No | — | | `home_telephone` | `string` | No | — | | `personal_mobile` | `string` | No | — | | `employee_ref` | `string` | No | — | | `full_or_part_time` | `string` | No | — | | `receives_statutory_holidays` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `employees` | `object[]` | No | — | > **employees full type** > > ```ts theme={null} > { > id?: number, > account_id?: number, > first_name?: string, > last_name?: string, > email?: string | null, > job_title?: string | null, > status?: string, > join_date?: string, > company_join_date?: string, > job_start_date?: string | null, > department?: { > id?: number | string, > name?: string > } | null, > division?: { > id?: number | string, > name?: string > } | null, > location?: { > id?: number | string, > name?: string > } | null, > working_pattern?: { > id?: number | string, > name?: string > } | null, > holiday_allowance?: { > id?: number | string, > name?: string > } | null, > line_manager?: { > id?: number | string, > name?: string > } | null, > hr?: boolean, > created_at?: string, > updated_at?: string > }[] > ``` *** ### createChangeRequest `employees.createChangeRequest` Create an employee change request **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.employees.createChangeRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `field` | `string` | Yes | — | | `value` | `string` | Yes | — | | `approved` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createExpense `employees.createExpense` Create an employee expense **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.employees.createExpense({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `employee_id` | `number` | Yes | — | | `amount` | `number` | Yes | — | | `description` | `string` | Yes | — | | `expense_date` | `string` | Yes | — | | `payable_to_employee` | `boolean` | Yes | — | | `company_expense_type_id` | `number` | Yes | — | | `vat` | `number` | No | — | | `miles` | `number` | No | — | | `client_name` | `string` | No | — | | `has_receipt` | `boolean` | No | — | | `company_project_id` | `number` | No | — | | `chargeable_to_client` | `boolean` | No | — | | `company_mileage_rate_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `employee_expenses` | `object[]` | No | — | > **employee\_expenses full type** > > ```ts theme={null} > { > id?: number, > amount?: number | string, > description?: string, > expense_date?: string > }[] > ``` *** ### createExpenseClaim `employees.createExpenseClaim` Create an employee expense claim **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.employees.createExpenseClaim({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `employee_id` | `number` | Yes | — | | `employee_expense_ids` | `number[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createSickness `employees.createSickness` Create an employee sickness record **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.employees.createSickness({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `start_date` | `string` | Yes | — | | `company_sicknesstype_id` | `number` | Yes | — | | `reason` | `string` | No | — | | `status` | `string` | No | — | | `end_date` | `string` | No | — | | `half_day` | `boolean` | No | — | | `half_end` | `boolean` | No | — | | `half_start` | `boolean` | No | — | | `review_notes` | `string` | No | — | | `half_end_am_pm` | `am \| pm` | No | — | | `half_start_am_pm` | `am \| pm` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sicknesses` | `object[]` | No | — | > **sicknesses full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string | null, > status?: string, > reason?: string > }[] > ``` *** ### get `employees.get` Get an employee by ID **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employees.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `employees` | `object[]` | No | — | > **employees full type** > > ```ts theme={null} > { > id?: number, > account_id?: number, > first_name?: string, > last_name?: string, > email?: string | null, > job_title?: string | null, > status?: string, > join_date?: string, > company_join_date?: string, > job_start_date?: string | null, > department?: { > id?: number | string, > name?: string > } | null, > division?: { > id?: number | string, > name?: string > } | null, > location?: { > id?: number | string, > name?: string > } | null, > working_pattern?: { > id?: number | string, > name?: string > } | null, > holiday_allowance?: { > id?: number | string, > name?: string > } | null, > line_manager?: { > id?: number | string, > name?: string > } | null, > hr?: boolean, > created_at?: string, > updated_at?: string > }[] > ``` *** ### list `employees.list` List employees with pagination **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employees.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `filter` | `hr \| line_manager \| either` | No | — | | `rotacloud` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `employees` | `object[]` | No | — | > **employees full type** > > ```ts theme={null} > { > id?: number, > account_id?: number, > first_name?: string, > last_name?: string, > email?: string | null, > job_title?: string | null, > status?: string, > join_date?: string, > company_join_date?: string, > job_start_date?: string | null, > department?: { > id?: number | string, > name?: string > } | null, > division?: { > id?: number | string, > name?: string > } | null, > location?: { > id?: number | string, > name?: string > } | null, > working_pattern?: { > id?: number | string, > name?: string > } | null, > holiday_allowance?: { > id?: number | string, > name?: string > } | null, > line_manager?: { > id?: number | string, > name?: string > } | null, > hr?: boolean, > created_at?: string, > updated_at?: string > }[] > ``` *** ### listAbsences `employees.listAbsences` List absences for an employee **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employees.listAbsences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `exclude_cancelled_absences` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `absences` | `object[]` | No | — | > **absences full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string > }[] > ``` *** ### listBenefits `employees.listBenefits` List benefits for an employee **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employees.listBenefits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ### listBonuses `employees.listBonuses` List bonuses for an employee **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employees.listBonuses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ### listChangeRequests `employees.listChangeRequests` List change requests for an employee **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employees.listChangeRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ### listHolidayYears `employees.listHolidayYears` List holiday years for an employee **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employees.listHolidayYears({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `for_date` | `string` | No | — | **Output:** *empty object* *** ### listLeaveRequests `employees.listLeaveRequests` List leave requests for an employee **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employees.listLeaveRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `exclude_cancelled_requests` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `leave_requests` | `object[]` | No | — | > **leave\_requests full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string, > status?: string, > notes?: string | null > }[] > ``` *** ### listSalaries `employees.listSalaries` List salaries for an employee **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employees.listSalaries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Employee Training Courses ### delete `employeeTrainingCourses.delete` Delete an employee training course **Risk:** `destructive` ```ts theme={null} await corsair.breathehr.api.employeeTrainingCourses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | *** ### list `employeeTrainingCourses.list` List employee training courses **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.employeeTrainingCourses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `employee_id` | `number` | No | — | **Output:** *empty object* *** ### update `employeeTrainingCourses.update` Update an employee training course **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.employeeTrainingCourses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `cost` | `string` | No | — | | `name` | `string` | No | — | | `notes` | `string` | No | — | | `end_on` | `string` | No | — | | `status` | `string` | No | — | | `outcome` | `string` | No | — | | `half_day` | `boolean` | No | — | | `start_on` | `string` | No | — | | `followup_date` | `string` | No | — | | `half_day_am_pm` | `am \| pm` | No | — | | `company_training_type_id` | `number` | No | — | | `remuneration_currency_id` | `number` | No | — | | `company_training_category_id` | `number` | No | — | | `company_training_provider_id` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Holiday Allowances ### list `holidayAllowances.list` List holiday allowances **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.holidayAllowances.list({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Leave Requests ### approve `leaveRequests.approve` Approve a leave request **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.leaveRequests.approve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `leave_requests` | `object[]` | No | — | > **leave\_requests full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string, > status?: string, > notes?: string | null > }[] > ``` *** ### get `leaveRequests.get` Get a leave request by ID **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.leaveRequests.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `leave_requests` | `object[]` | No | — | > **leave\_requests full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string, > status?: string, > notes?: string | null > }[] > ``` *** ### getCancelling `leaveRequests.getCancelling` Get the leave request being cancelled **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.leaveRequests.getCancelling({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `leave_requests` | `object[]` | No | — | > **leave\_requests full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string, > status?: string, > notes?: string | null > }[] > ``` *** ### list `leaveRequests.list` List leave requests **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.leaveRequests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `end_date` | `string` | No | — | | `start_date` | `string` | No | — | | `rotacloud` | `boolean` | No | — | | `employee_id` | `number` | No | — | | `department_id` | `number` | No | — | | `exclude_cancelled_requests` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `leave_requests` | `object[]` | No | — | > **leave\_requests full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string, > status?: string, > notes?: string | null > }[] > ``` *** ### reject `leaveRequests.reject` Reject a leave request **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.leaveRequests.reject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `rejection_reason` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `leave_requests` | `object[]` | No | — | > **leave\_requests full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string, > type?: string, > status?: string, > notes?: string | null > }[] > ``` *** ## Locations ### list `locations.list` List locations **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.locations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Other Leave Reasons ### list `otherLeaveReasons.list` List other leave reasons **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.otherLeaveReasons.list({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Salaries ### list `salaries.list` List salaries **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.salaries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** ## Sicknesses ### list `sicknesses.list` List sickness records **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.sicknesses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `end_date` | `string` | No | — | | `start_date` | `string` | No | — | | `rotacloud` | `boolean` | No | — | | `employee_id` | `number` | No | — | | `department_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sicknesses` | `object[]` | No | — | > **sicknesses full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string | null, > status?: string, > reason?: string > }[] > ``` *** ### update `sicknesses.update` Update a sickness record **Risk:** `write` ```ts theme={null} await corsair.breathehr.api.sicknesses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `reason` | `string` | No | — | | `status` | `string` | No | — | | `end_date` | `string` | No | — | | `half_day` | `boolean` | No | — | | `half_end` | `boolean` | No | — | | `half_start` | `boolean` | No | — | | `start_date` | `string` | No | — | | `review_notes` | `string` | No | — | | `half_end_am_pm` | `am \| pm` | No | — | | `half_start_am_pm` | `am \| pm` | No | — | | `company_sicknesstype_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sicknesses` | `object[]` | No | — | > **sicknesses full type** > > ```ts theme={null} > { > id?: number, > start_date?: string, > end_date?: string | null, > status?: string, > reason?: string > }[] > ``` *** ## Working Patterns ### list `workingPatterns.list` List working patterns **Risk:** `read` ```ts theme={null} await corsair.breathehr.api.workingPatterns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** *empty object* *** # Database Source: https://docs.corsair.dev/plugins/breathehr/database Breathe HR local sync: searchable entities, `.search()` filters, and operators. The Breathe HR plugin syncs data locally. Use `corsair.breathehr.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Absences Path: `breathehr.db.absences.search` ```ts theme={null} const rows = await corsair.breathehr.db.absences.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `start_date` | `string` | equals, contains, startsWith, endsWith, in | | `end_date` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Accounts Path: `breathehr.db.accounts.search` ```ts theme={null} const rows = await corsair.breathehr.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `using_rta` | `boolean` | equals | | `health_and_safety_enabled` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Departments Path: `breathehr.db.departments.search` ```ts theme={null} const rows = await corsair.breathehr.db.departments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Employee Expenses Path: `breathehr.db.employeeExpenses.search` ```ts theme={null} const rows = await corsair.breathehr.db.employeeExpenses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `expense_date` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Employees Path: `breathehr.db.employees.search` ```ts theme={null} const rows = await corsair.breathehr.db.employees.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `account_id` | `number` | equals, gt, gte, lt, lte, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `job_title` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `join_date` | `string` | equals, contains, startsWith, endsWith, in | | `company_join_date` | `string` | equals, contains, startsWith, endsWith, in | | `job_start_date` | `string` | equals, contains, startsWith, endsWith, in | | `hr` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Leave Requests Path: `breathehr.db.leaveRequests.search` ```ts theme={null} const rows = await corsair.breathehr.db.leaveRequests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `start_date` | `string` | equals, contains, startsWith, endsWith, in | | `end_date` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sicknesses Path: `breathehr.db.sicknesses.search` ```ts theme={null} const rows = await corsair.breathehr.db.sicknesses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `start_date` | `string` | equals, contains, startsWith, endsWith, in | | `end_date` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `reason` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/breathehr/overview HR software for employee records, leave management, and small business people ops. Use **Breathe HR** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 50 typed API operations * 7 synced entities (`absences`, `accounts`, `departments`, `employeeExpenses`, `employees`, `leaveRequests`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/breathehr ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/breathehr ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/breathehr ``` ```bash bun theme={null} bun add corsair @corsair-dev/breathehr ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { breathehr } from '@corsair-dev/breathehr'; export const corsair = createCorsair({ plugins: [ breathehr(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} breathehr() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'breathehr', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`absences.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.breathehr.api.absences.list({}); ``` **`employeeExpenseClaims.update`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.breathehr.api.employeeExpenseClaims.update({}); ``` See the full list on the [API](/plugins/breathehr/api) page. ## Query synced data Synced entities support `tenant.breathehr.db..search()` and `.list()`: `absences`, `accounts`, `departments`, `employeeExpenses`, `employees`, `leaveRequests`, `sicknesses`. See [Database](/plugins/breathehr/database) for filters and operators. ## What's next > **[API reference](/plugins/breathehr/api)** > > Every `breathehr.api.*` operation with input and output types. > **[Database](/plugins/breathehr/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/brevo/api API reference for Brevo: every `brevo.api.*` operation with input and output types. Every `brevo.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get Brevo account details, plans, and relay settings **Risk:** `read` ```ts theme={null} await corsair.brevo.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `companyName` | `string` | No | — | | `address` | `object` | No | — | | `plan` | `object[]` | No | — | | `relay` | `object` | No | — | > **address full type** > > ```ts theme={null} > { > street?: string, > city?: string, > zipCode?: string, > country?: string > } > ``` > **plan full type** > > ```ts theme={null} > { > type: string, > credits: number, > creditsType?: string, > startDate?: string, > endDate?: string > }[] > ``` > **relay full type** > > ```ts theme={null} > { > enabled: boolean, > data?: { > userName?: string, > relay?: string, > port?: number > } > } > ``` *** ## Contacts ### create `contacts.create` Create a new Brevo contact **Risk:** `write` ```ts theme={null} await corsair.brevo.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `ext_id` | `string` | No | — | | `attributes` | `object` | No | — | | `emailBlacklisted` | `boolean` | No | — | | `smsBlacklisted` | `boolean` | No | — | | `listIds` | `number[]` | No | — | | `updateEnabled` | `boolean` | No | — | | `smtpBlacklistSender` | `string[]` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### delete `contacts.delete` Delete a Brevo contact \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.brevo.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `contacts.get` Get a Brevo contact by ID or email identifier **Risk:** `read` ```ts theme={null} await corsair.brevo.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `email` | `string` | No | — | | `emailBlacklisted` | `boolean` | No | — | | `smsBlacklisted` | `boolean` | No | — | | `createdAt` | `string` | No | — | | `modifiedAt` | `string` | No | — | | `listIds` | `number[]` | No | — | | `listUnsubscribed` | `number[]` | No | — | | `attributes` | `object` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` *** ### list `contacts.list` List Brevo contacts with filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.brevo.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `modifiedSince` | `string` | No | — | | `sort` | `asc \| desc` | No | — | | `segmentId` | `number` | No | — | | `listId` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **contacts full type** > > ```ts theme={null} > { > id: number, > email?: string | null, > emailBlacklisted?: boolean, > smsBlacklisted?: boolean, > createdAt?: string, > modifiedAt?: string, > listIds?: number[], > listUnsubscribed?: number[], > attributes?: { > } > }[] > ``` *** ### update `contacts.update` Update an existing Brevo contact by ID or email identifier **Risk:** `write` ```ts theme={null} await corsair.brevo.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string \| number` | Yes | — | | `attributes` | `object` | No | — | | `emailBlacklisted` | `boolean` | No | — | | `smsBlacklisted` | `boolean` | No | — | | `listIds` | `number[]` | No | — | | `unlinkListIds` | `number[]` | No | — | | `smtpBlacklistSender` | `string[]` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ## Email Campaigns ### create `emailCampaigns.create` Create a new Brevo email campaign **Risk:** `write` ```ts theme={null} await corsair.brevo.api.emailCampaigns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `subject` | `string` | Yes | — | | `sender` | `object` | Yes | — | | `htmlContent` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `templateId` | `number` | No | — | | `scheduledAt` | `string` | No | — | | `recipients` | `object` | No | — | | `replyTo` | `string` | No | — | | `toField` | `string` | No | — | | `tag` | `string` | No | — | | `header` | `string` | No | — | | `footer` | `string` | No | — | | `utmCampaign` | `string` | No | — | | `params` | `object` | No | — | > **sender full type** > > ```ts theme={null} > { > name?: string, > email?: string, > id?: number > } > ``` > **recipients full type** > > ```ts theme={null} > { > lists?: number[], > exclusionLists?: number[] > } > ``` > **params full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### delete `emailCampaigns.delete` Delete a Brevo email campaign \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.brevo.api.emailCampaigns.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `emailCampaigns.get` Get a Brevo email campaign by campaign ID **Risk:** `read` ```ts theme={null} await corsair.brevo.api.emailCampaigns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `subject` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `htmlContent` | `string` | No | — | | `scheduledAt` | `string` | No | — | | `sentDate` | `string` | No | — | | `createdAt` | `string` | No | — | | `modifiedAt` | `string` | No | — | | `sender` | `object` | No | — | | `replyTo` | `string` | No | — | | `toField` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `tag` | `string` | No | — | | `recipients` | `object` | No | — | | `statistics` | `object` | No | — | > **sender full type** > > ```ts theme={null} > { > name?: string, > email?: string, > id?: number > } > ``` > **recipients full type** > > ```ts theme={null} > { > lists?: number[], > exclusionLists?: number[] > } > ``` > **statistics full type** > > ```ts theme={null} > { > } > ``` *** ### list `emailCampaigns.list` List Brevo email campaigns with filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.brevo.api.emailCampaigns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `classic \| trigger` | No | — | | `status` | `suspended \| archive \| sent \| queued \| draft \| in_process` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `sort` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaigns` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **campaigns full type** > > ```ts theme={null} > { > id: number, > name: string, > subject?: string, > type?: string, > status?: string, > scheduledAt?: string, > sentDate?: string, > createdAt?: string, > modifiedAt?: string, > recipients?: { > lists?: number[], > exclusionLists?: number[] > } > }[] > ``` *** ### sendNow `emailCampaigns.sendNow` Send a Brevo email campaign immediately **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.brevo.api.emailCampaigns.sendNow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### sendTest `emailCampaigns.sendTest` Send a test email for a Brevo email campaign **Risk:** `write` ```ts theme={null} await corsair.brevo.api.emailCampaigns.sendTest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `number` | Yes | — | | `emailTo` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### update `emailCampaigns.update` Update an existing Brevo email campaign **Risk:** `write` ```ts theme={null} await corsair.brevo.api.emailCampaigns.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `number` | Yes | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `sender` | `object` | No | — | | `htmlContent` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `templateId` | `number` | No | — | | `scheduledAt` | `string` | No | — | | `recipients` | `object` | No | — | | `replyTo` | `string` | No | — | | `toField` | `string` | No | — | | `tag` | `string` | No | — | | `header` | `string` | No | — | | `footer` | `string` | No | — | | `utmCampaign` | `string` | No | — | | `params` | `object` | No | — | > **sender full type** > > ```ts theme={null} > { > name?: string, > email?: string, > id?: number > } > ``` > **recipients full type** > > ```ts theme={null} > { > lists?: number[], > exclusionLists?: number[] > } > ``` > **params full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/brevo/database Brevo local sync: searchable entities, `.search()` filters, and operators. The Brevo plugin syncs data locally. Use `corsair.brevo.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Campaigns Path: `brevo.db.campaigns.search` ```ts theme={null} const rows = await corsair.brevo.db.campaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `scheduledAt` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `brevo.db.contacts.search` ```ts theme={null} const rows = await corsair.brevo.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `emailBlacklisted` | `boolean` | equals | | `smsBlacklisted` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/brevo/overview Brevo plugin for Corsair Use **Brevo** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 13 typed API operations * 2 synced entities (`campaigns`, `contacts`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/brevo ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/brevo ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/brevo ``` ```bash bun theme={null} bun add corsair @corsair-dev/brevo ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { brevo } from '@corsair-dev/brevo'; export const corsair = createCorsair({ plugins: [ brevo(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} brevo() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'brevo', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.brevo.api.account.get({}); ``` **`contacts.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.brevo.api.contacts.create({}); ``` See the full list on the [API](/plugins/brevo/api) page. ## Query synced data Synced entities support `tenant.brevo.db..search()` and `.list()`: `campaigns`, `contacts`. See [Database](/plugins/brevo/database) for filters and operators. ## What's next > **[API reference](/plugins/brevo/api)** > > Every `brevo.api.*` operation with input and output types. > **[Database](/plugins/brevo/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/brex/api API reference for Brex: every `brex.api.*` operation with input and output types. Every `brex.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### getCash `accounts.getCash` Get a cash account by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.accounts.getCash({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### getCashPrimary `accounts.getCashPrimary` Get the primary cash account **Risk:** `read` ```ts theme={null} await corsair.brex.api.accounts.getCashPrimary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### listCard `accounts.listCard` List card accounts **Risk:** `read` ```ts theme={null} await corsair.brex.api.accounts.listCard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### listCardStatements `accounts.listCardStatements` List finalized primary card statements **Risk:** `read` ```ts theme={null} await corsair.brex.api.accounts.listCardStatements({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### listCash `accounts.listCash` List cash deposit accounts **Risk:** `read` ```ts theme={null} await corsair.brex.api.accounts.listCash({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### listCashStatements `accounts.listCashStatements` List finalized cash account statements **Risk:** `read` ```ts theme={null} await corsair.brex.api.accounts.listCashStatements({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Budget Programs ### list `budgetPrograms.list` List budget programs **Risk:** `read` ```ts theme={null} await corsair.brex.api.budgetPrograms.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Budgets ### archive `budgets.archive` Archive a budget **Risk:** `destructive` ```ts theme={null} await corsair.brex.api.budgets.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### create `budgets.create` Create a budget **Risk:** `write` ```ts theme={null} await corsair.brex.api.budgets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `budgets.get` Get a budget by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.budgets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `budgets.list` List budgets **Risk:** `read` ```ts theme={null} await corsair.brex.api.budgets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `budgets.update` Update a budget **Risk:** `write` ```ts theme={null} await corsair.brex.api.budgets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Cards ### create `cards.create` Create a card and assign it to a user **Risk:** `write` ```ts theme={null} await corsair.brex.api.cards.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `object` | Yes | — | | `card_name` | `string` | Yes | — | | `card_type` | `string` | Yes | — | | `limit_type` | `string` | Yes | — | | `idempotency_key` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **owner full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `cards.get` Get a card by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.cards.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### getPan `cards.getPan` Get card number, CVV, and expiration **Risk:** `read` ```ts theme={null} await corsair.brex.api.cards.getPan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `cards.list` List cards, optionally by user\_id **Risk:** `read` ```ts theme={null} await corsair.brex.api.cards.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `user_id` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `cards.update` Update card spend\_controls for limit\_type=CARD **Risk:** `write` ```ts theme={null} await corsair.brex.api.cards.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### updateStatus `cards.updateStatus` Lock, unlock, or terminate a card **Risk:** `destructive` ```ts theme={null} await corsair.brex.api.cards.updateStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `action` | `lock \| unlock \| terminate \| LOCK \| UNLOCK \| TERMINATE` | Yes | — | | `lock_reason` | `string \| number \| boolean` | No | — | | `reason` | `string \| number \| boolean` | No | — | | `description` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Company ### get `company.get` Get the company for the current token **Risk:** `read` ```ts theme={null} await corsair.brex.api.company.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Departments ### create `departments.create` Create a department **Risk:** `write` ```ts theme={null} await corsair.brex.api.departments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `departments.get` Get a department by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.departments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `departments.list` List departments **Risk:** `read` ```ts theme={null} await corsair.brex.api.departments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Expenses ### get `expenses.get` Get an expense by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.expenses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `expand[]` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### getCard `expenses.getCard` Get a card expense (deprecated official path) **Risk:** `read` ```ts theme={null} await corsair.brex.api.expenses.getCard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `expense_id` | `string` | Yes | — | | `expand[]` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `expenses.list` List expenses **Risk:** `read` ```ts theme={null} await corsair.brex.api.expenses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `user_id` | `string \| number \| boolean` | No | — | | `budget_id` | `string \| number \| boolean` | No | — | | `status` | `string \| number \| boolean` | No | — | | `purchased_at_start` | `string \| number \| boolean` | No | — | | `purchased_at_end` | `string \| number \| boolean` | No | — | | `payment_posted_at_start` | `string \| number \| boolean` | No | — | | `payment_posted_at_end` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### listByBudget `expenses.listByBudget` List expenses for a budget\_id **Risk:** `read` ```ts theme={null} await corsair.brex.api.expenses.listByBudget({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `payment_posted_at_start` | `string \| number \| boolean` | No | — | | `payment_posted_at_end` | `string \| number \| boolean` | No | — | | `budget_id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `expenses.update` Update a card expense **Risk:** `write` ```ts theme={null} await corsair.brex.api.expenses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `expense_id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Fields ### create `fields.create` Create a custom field **Risk:** `write` ```ts theme={null} await corsair.brex.api.fields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `fields.delete` Delete a custom field **Risk:** `destructive` ```ts theme={null} await corsair.brex.api.fields.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `fields.get` Get a custom field by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.fields.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `fields.list` List custom fields **Risk:** `read` ```ts theme={null} await corsair.brex.api.fields.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `fields.update` Update a custom field **Risk:** `write` ```ts theme={null} await corsair.brex.api.fields.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Field Values ### create `fieldValues.create` Create custom field values (up to 1000) **Risk:** `write` ```ts theme={null} await corsair.brex.api.fieldValues.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field_id` | `string` | Yes | — | | `values` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `fieldValues.delete` Delete custom field values (up to 1000) **Risk:** `destructive` ```ts theme={null} await corsair.brex.api.fieldValues.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field_id` | `string` | Yes | — | | `values` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `fieldValues.get` Get a field value by field ID and value ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.fieldValues.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field_id` | `string` | Yes | — | | `brex_id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `fieldValues.list` List values for a custom field **Risk:** `read` ```ts theme={null} await corsair.brex.api.fieldValues.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field_id` | `string` | Yes | — | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `brex_id` | `string \| number \| boolean` | No | — | | `value_id` | `string \| number \| boolean` | No | — | | `remote_id` | `string \| number \| boolean` | No | — | | `value` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `fieldValues.update` Update custom field values (up to 1000) **Risk:** `write` ```ts theme={null} await corsair.brex.api.fieldValues.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field_id` | `string` | Yes | — | | `values` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Legal Entities ### get `legalEntities.get` Get a legal entity by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.legalEntities.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `legalEntities.list` List legal entities **Risk:** `read` ```ts theme={null} await corsair.brex.api.legalEntities.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Locations ### create `locations.create` Create a location **Risk:** `write` ```ts theme={null} await corsair.brex.api.locations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `locations.get` Get a location by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.locations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `locations.list` List locations **Risk:** `read` ```ts theme={null} await corsair.brex.api.locations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Receipts ### match `receipts.match` Create a receipt-match upload URI **Risk:** `write` ```ts theme={null} await corsair.brex.api.receipts.match({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### upload `receipts.upload` Create a receipt upload URI for a card expense **Risk:** `write` ```ts theme={null} await corsair.brex.api.receipts.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `expense_id` | `string` | Yes | — | | `receipt_name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Referrals ### create `referrals.create` Create a referral and application link **Risk:** `write` ```ts theme={null} await corsair.brex.api.referrals.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### createDocument `referrals.createDocument` Create a referral document upload URI **Risk:** `write` ```ts theme={null} await corsair.brex.api.referrals.createDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `referrals.get` Get a referral by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.referrals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `referrals.list` List active referrals **Risk:** `read` ```ts theme={null} await corsair.brex.api.referrals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Spend Limits ### archive `spendLimits.archive` Archive a spend limit **Risk:** `destructive` ```ts theme={null} await corsair.brex.api.spendLimits.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### create `spendLimits.create` Create a spend limit **Risk:** `write` ```ts theme={null} await corsair.brex.api.spendLimits.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `expense_policy_id` | `string` | Yes | — | | `authorization_settings` | `object` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **authorization\_settings full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `spendLimits.get` Get a spend limit by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.spendLimits.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `spendLimits.list` List spend limits **Risk:** `read` ```ts theme={null} await corsair.brex.api.spendLimits.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `spendLimits.update` Update a spend limit **Risk:** `write` ```ts theme={null} await corsair.brex.api.spendLimits.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Spend Limits V1 ### create `spendLimitsV1.create` Create a v1 spend limit (legacy /v1/budgets) **Risk:** `write` ```ts theme={null} await corsair.brex.api.spendLimitsV1.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `spendLimitsV1.update` Update a v1 spend limit (legacy /v1/budgets) **Risk:** `write` ```ts theme={null} await corsair.brex.api.spendLimitsV1.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Titles ### create `titles.create` Create a job title **Risk:** `write` ```ts theme={null} await corsair.brex.api.titles.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `titles.get` Get a job title by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.titles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `titles.list` List job titles **Risk:** `read` ```ts theme={null} await corsair.brex.api.titles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Transactions ### byAmountRange `transactions.byAmountRange` Filter settled card transactions by USD amount after official paging **Risk:** `read` ```ts theme={null} await corsair.brex.api.transactions.byAmountRange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `min_amount` | `number` | Yes | — | | `max_amount` | `number` | Yes | — | | `posted_at_start` | `string \| number \| boolean` | No | — | | `posted_at_end` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### byDescription `transactions.byDescription` Filter settled card transactions by description after official paging **Risk:** `read` ```ts theme={null} await corsair.brex.api.transactions.byDescription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `description` | `string` | Yes | — | | `posted_at_start` | `string \| number \| boolean` | No | — | | `posted_at_end` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### getById `transactions.getById` Find a settled card transaction by ID by paging official list results **Risk:** `read` ```ts theme={null} await corsair.brex.api.transactions.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `transactions.list` List settled card transactions. Date filters are client-side after paging. **Risk:** `read` ```ts theme={null} await corsair.brex.api.transactions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Transfers ### list `transfers.list` List transfers **Risk:** `read` ```ts theme={null} await corsair.brex.api.transfers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Trips ### list `trips.list` List trips **Risk:** `read` ```ts theme={null} await corsair.brex.api.trips.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `user_id` | `string \| number \| boolean` | No | — | | `starts_at_start` | `string \| number \| boolean` | No | — | | `starts_at_end` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Users ### create `users.create` Invite a user as an employee **Risk:** `write` ```ts theme={null} await corsair.brex.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `email` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `users.get` Get a user by ID, or /me when id is "me" **Risk:** `read` ```ts theme={null} await corsair.brex.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### getLimit `users.getLimit` Get the monthly spend limit for a user **Risk:** `read` ```ts theme={null} await corsair.brex.api.users.getLimit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### getMe `users.getMe` Get the user for the current access token **Risk:** `read` ```ts theme={null} await corsair.brex.api.users.getMe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `users.list` List users in the Brex account **Risk:** `read` ```ts theme={null} await corsair.brex.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `email` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### setLimit `users.setLimit` Set monthly\_limit in cents, or null to remove it **Risk:** `write` ```ts theme={null} await corsair.brex.api.users.setLimit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `monthly_limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `users.update` Update a user; omitted fields stay unchanged **Risk:** `write` ```ts theme={null} await corsair.brex.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Vendors ### create `vendors.create` Create a vendor **Risk:** `write` ```ts theme={null} await corsair.brex.api.vendors.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `vendors.delete` Delete a vendor **Risk:** `destructive` ```ts theme={null} await corsair.brex.api.vendors.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `vendors.get` Get a vendor by ID **Risk:** `read` ```ts theme={null} await corsair.brex.api.vendors.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `vendors.list` List vendors **Risk:** `read` ```ts theme={null} await corsair.brex.api.vendors.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `name` | `string \| number \| boolean` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `vendors.update` Update a vendor **Risk:** `write` ```ts theme={null} await corsair.brex.api.vendors.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Webhook Groups ### addMembers `webhookGroups.addMembers` Add webhook subscriptions to a group **Risk:** `write` ```ts theme={null} await corsair.brex.api.webhookGroups.addMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `webhook_ids` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### create `webhookGroups.create` Create a webhook group (partners) **Risk:** `write` ```ts theme={null} await corsair.brex.api.webhookGroups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `webhookGroups.get` Get a webhook group (partners) **Risk:** `read` ```ts theme={null} await corsair.brex.api.webhookGroups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `webhookGroups.list` List webhook groups (partners) **Risk:** `read` ```ts theme={null} await corsair.brex.api.webhookGroups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### listMembers `webhookGroups.listMembers` List webhook group members **Risk:** `read` ```ts theme={null} await corsair.brex.api.webhookGroups.listMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Webhooks ### create `webhooks.create` Register a webhook subscription **Risk:** `write` ```ts theme={null} await corsair.brex.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `event_types` | `any[]` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `webhooks.get` Get a webhook subscription **Risk:** `read` ```ts theme={null} await corsair.brex.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `webhooks.list` List webhook subscriptions **Risk:** `read` ```ts theme={null} await corsair.brex.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string \| number \| boolean` | No | — | | `limit` | `number` | No | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### listSecrets `webhooks.listSecrets` List webhook signing secrets **Risk:** `read` ```ts theme={null} await corsair.brex.api.webhooks.listSecrets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### update `webhooks.update` Update a webhook subscription **Risk:** `write` ```ts theme={null} await corsair.brex.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | No | — | | `query` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** # Database Source: https://docs.corsair.dev/plugins/brex/database Brex local sync: searchable entities, `.search()` filters, and operators. The Brex plugin syncs data locally. Use `corsair.brex.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Budgets Path: `brex.db.budgets.search` ```ts theme={null} const rows = await corsair.brex.db.budgets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Cards Path: `brex.db.cards.search` ```ts theme={null} const rows = await corsair.brex.db.cards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `card_name` | `string` | equals, contains, startsWith, endsWith, in | | `card_type` | `string` | equals, contains, startsWith, endsWith, in | | `limit_type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Cash Accounts Path: `brex.db.cashAccounts.search` ```ts theme={null} const rows = await corsair.brex.db.cashAccounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Company Path: `brex.db.company.search` ```ts theme={null} const rows = await corsair.brex.db.company.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `legal_name` | `string` | equals, contains, startsWith, endsWith, in | | `account_type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Departments Path: `brex.db.departments.search` ```ts theme={null} const rows = await corsair.brex.db.departments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Expenses Path: `brex.db.expenses.search` ```ts theme={null} const rows = await corsair.brex.db.expenses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `memo` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `budget_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Fields Path: `brex.db.fields.search` ```ts theme={null} const rows = await corsair.brex.db.fields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `group` | `string` | equals, contains, startsWith, endsWith, in | | `disabled` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Legal Entities Path: `brex.db.legalEntities.search` ```ts theme={null} const rows = await corsair.brex.db.legalEntities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Locations Path: `brex.db.locations.search` ```ts theme={null} const rows = await corsair.brex.db.locations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Referrals Path: `brex.db.referrals.search` ```ts theme={null} const rows = await corsair.brex.db.referrals.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `referral_signup_url` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Spend Limits Path: `brex.db.spendLimits.search` ```ts theme={null} const rows = await corsair.brex.db.spendLimits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `parent_budget_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Titles Path: `brex.db.titles.search` ```ts theme={null} const rows = await corsair.brex.db.titles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transactions Path: `brex.db.transactions.search` ```ts theme={null} const rows = await corsair.brex.db.transactions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `posted_at_date` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transfers Path: `brex.db.transfers.search` ```ts theme={null} const rows = await corsair.brex.db.transfers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Trips Path: `brex.db.trips.search` ```ts theme={null} const rows = await corsair.brex.db.trips.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `brex.db.users.search` ```ts theme={null} const rows = await corsair.brex.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Vendors Path: `brex.db.vendors.search` ```ts theme={null} const rows = await corsair.brex.db.vendors.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `company_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `brex.db.webhooks.search` ```ts theme={null} const rows = await corsair.brex.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/brex/overview Corporate card and spend management platform for startups and growing businesses. Use **Brex** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 86 typed API operations * 18 synced entities (`budgets`, `cards`, `cashAccounts`, `company`, `departments`, `expenses`, and 12 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/brex ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/brex ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/brex ``` ```bash bun theme={null} bun add corsair @corsair-dev/brex ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { brex } from '@corsair-dev/brex'; export const corsair = createCorsair({ plugins: [ brex(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} brex() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Brex OAuth app. ```ts theme={null} brex({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'brex', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.getCash`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.brex.api.accounts.getCash({}); ``` **`budgets.archive`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.brex.api.budgets.archive({}); ``` See the full list on the [API](/plugins/brex/api) page. ## Query synced data Synced entities support `tenant.brex.db..search()` and `.list()`: `budgets`, `cards`, `cashAccounts`, `company`, `departments`, `expenses`, `fields`, `legalEntities`, `locations`, `referrals`, `spendLimits`, `titles`, `transactions`, `transfers`, `trips`, `users`, `vendors`, `webhooks`. See [Database](/plugins/brex/database) for filters and operators. ## What's next > **[API reference](/plugins/brex/api)** > > Every `brex.api.*` operation with input and output types. > **[Database](/plugins/brex/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/brightdata/api API reference for Bright Data: every `brightdata.api.*` operation with input and output types. Every `brightdata.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Crawl Api ### crawlApi `crawlApi` Tool to trigger an asynchronous site crawl for a dataset and list of URLs. Returns snapshot\_id required by getSnapshotStatus and getSnapshotResults. **Risk:** `write` ```ts theme={null} await corsair.brightdata.api.crawlApi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset_id` | `string` | Yes | Official query: ?dataset\_id= | | `items` | `object[]` | Yes | — | | `include_errors` | `boolean` | No | — | | `custom_output_fields` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `snapshot_id` | `string` | Yes | — | *** ## Filter Dataset ### filterDataset `filterDataset` Tool to apply custom filter criteria to a marketplace dataset (BETA). Use after selecting a dataset to generate a filtered snapshot. **Risk:** `write` ```ts theme={null} await corsair.brightdata.api.filterDataset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset_id` | `string` | Yes | — | | `filter` | `object` | Yes | — | | `records_limit` | `number` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `snapshot_id` | `string` | Yes | — | *** ## Get Available Cities ### getAvailableCities `getAvailableCities` Tool to get available static network cities for a given country. Use when you need to configure static proxy endpoints after selecting a country. **Risk:** `read` ```ts theme={null} await corsair.brightdata.api.getAvailableCities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | Official query: ?country= | | `pool_ip_type` | `dc \| static_res` | No | — | **Output:** `string[]` *** ## Get Available Countries ### getAvailableCountries `getAvailableCountries` Tool to list available countries and their ISO 3166-1 alpha-2 codes. Use when you need to configure zones with valid country codes before provisioning proxies. **Risk:** `read` ```ts theme={null} await corsair.brightdata.api.getAvailableCountries({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `zone_types` | `object` | No | — | > **zone\_types full type** > > ```ts theme={null} > { > } > ``` *** ## Get Snapshot Results ### getSnapshotResults `getSnapshotResults` Tool to retrieve the scraped data from a completed crawl job by snapshot ID. Only call after confirming the job is complete via getSnapshotStatus. **Risk:** `read` ```ts theme={null} await corsair.brightdata.api.getSnapshotResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `snapshot_id` | `string` | Yes | Official path on GET /datasets/v3/snapshot/ | | `format` | `json \| ndjson \| jsonl \| csv` | No | — | | `compress` | `boolean` | No | — | | `batch_size` | `number` | No | — | | `part` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | string > ``` *** ## Get Snapshot Status ### getSnapshotStatus `getSnapshotStatus` Tool to check the processing status of a crawl job using snapshot ID. Call before attempting to download results to ensure data collection is complete. **Risk:** `read` ```ts theme={null} await corsair.brightdata.api.getSnapshotStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `snapshot_id` | `string` | Yes | Official path on GET /datasets/v3/progress/ | **Output** | Name | Type | Required | Description | | - | - | - | - | | `snapshot_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `status` | `starting \| running \| ready \| failed \| canceled` | Yes | — | *** ## List Datasets ### listDatasets `listDatasets` Tool to list all available pre-made scrapers (datasets) from Bright Data marketplace. Use when you need to browse available data sources for structured scraping. **Risk:** `read` ```ts theme={null} await corsair.brightdata.api.listDatasets({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > size?: number > }[] > ``` *** ## List Web Unlocker Zones ### listWebUnlockerZones `listWebUnlockerZones` Tool to list your configured Web Unlocker zones and proxy endpoints. Use to view available zones for web scraping and bot protection bypass. **Risk:** `read` ```ts theme={null} await corsair.brightdata.api.listWebUnlockerZones({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name: string, > type?: string > }[] > ``` *** ## Serp Search ### serpSearch `serpSearch` Tool to perform SERP searches across search engines using Bright Data SERP API. Use when you need search results, trending topics, or competitive analysis data. **Risk:** `read` ```ts theme={null} await corsair.brightdata.api.serpSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone` | `string` | Yes | — | | `q_keywords` | `string` | Yes | — | | `search_engine` | `google \| bing \| yahoo \| yandex \| duckduckgo` | No | — | | `format` | `json \| raw` | No | — | | `method` | `string` | No | — | | `country` | `string` | No | — | | `data_format` | `markdown \| screenshot` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > string | { > general?: { > }, > input?: { > }, > organic?: { > }[] > } > ``` *** ## Web Unlocker ### webUnlocker `webUnlocker` Tool to bypass bot detection, captcha, and other anti-scraping measures to extract content from websites. Use when sites block automated access or require JavaScript rendering. **Risk:** `read` ```ts theme={null} await corsair.brightdata.api.webUnlocker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `zone` | `string` | Yes | — | | `format` | `json \| raw` | No | — | | `country` | `string` | No | — | | `data_format` | `markdown \| screenshot` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > string | { > status_code?: number, > headers?: { > }, > body?: any > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/brightdata/database Bright Data local sync: searchable entities, `.search()` filters, and operators. The Bright Data plugin syncs data locally. Use `corsair.brightdata.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Cities Path: `brightdata.db.cities.search` ```ts theme={null} const rows = await corsair.brightdata.db.cities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Countries Path: `brightdata.db.countries.search` ```ts theme={null} const rows = await corsair.brightdata.db.countries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Datasets Path: `brightdata.db.datasets.search` ```ts theme={null} const rows = await corsair.brightdata.db.datasets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Serp Results Path: `brightdata.db.serpResults.search` ```ts theme={null} const rows = await corsair.brightdata.db.serpResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Snapshot Progress Path: `brightdata.db.snapshotProgress.search` ```ts theme={null} const rows = await corsair.brightdata.db.snapshotProgress.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `snapshot_id` | `string` | equals, contains, startsWith, endsWith, in | | `dataset_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Snapshot Refs Path: `brightdata.db.snapshotRefs.search` ```ts theme={null} const rows = await corsair.brightdata.db.snapshotRefs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `snapshot_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Snapshot Results Path: `brightdata.db.snapshotResults.search` ```ts theme={null} const rows = await corsair.brightdata.db.snapshotResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Unlocker Results Path: `brightdata.db.unlockerResults.search` ```ts theme={null} const rows = await corsair.brightdata.db.unlockerResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Zones Path: `brightdata.db.zones.search` ```ts theme={null} const rows = await corsair.brightdata.db.zones.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/brightdata/overview Web data platform for proxies, scraping, and collecting public internet datasets. Use **Bright Data** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 10 typed API operations * 9 synced entities (`cities`, `countries`, `datasets`, `serpResults`, `snapshotProgress`, `snapshotRefs`, and 3 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/brightdata ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/brightdata ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/brightdata ``` ```bash bun theme={null} bun add corsair @corsair-dev/brightdata ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { brightdata } from '@corsair-dev/brightdata'; export const corsair = createCorsair({ plugins: [ brightdata(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} brightdata() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'brightdata', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`getAvailableCities`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.brightdata.api.getAvailableCities({}); ``` **`crawlApi`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.brightdata.api.crawlApi({}); ``` See the full list on the [API](/plugins/brightdata/api) page. ## Query synced data Synced entities support `tenant.brightdata.db..search()` and `.list()`: `cities`, `countries`, `datasets`, `serpResults`, `snapshotProgress`, `snapshotRefs`, `snapshotResults`, `unlockerResults`, `zones`. See [Database](/plugins/brightdata/database) for filters and operators. ## What's next > **[API reference](/plugins/brightdata/api)** > > Every `brightdata.api.*` operation with input and output types. > **[Database](/plugins/brightdata/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/browseai/api API reference for Browse AI: every `browseai.api.*` operation with input and output types. Every `browseai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Monitors ### create `monitors.create` Create a robot monitor **Risk:** `write` ```ts theme={null} await corsair.browseai.api.monitors.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `robotId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `inputParameters` | `object` | Yes | — | | `notifyOnCapturedScreenshotChange` | `boolean` | Yes | — | | `notifyOnCapturedTextChange` | `boolean` | Yes | — | | `capturedScreenshotNotificationThreshold` | `number` | Yes | — | | `schedule` | `string` | No | — | | `schedules` | `object[]` | No | — | > **inputParameters full type** > > ```ts theme={null} > { > } > ``` > **schedules full type** > > ```ts theme={null} > { > type: FIXED_INTERVAL, > everyMinutes: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | | `monitor` | `object` | No | — | > **monitor full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > status?: string | null, > pausedReason?: string | null, > inputParameters?: { > } | null, > schedules?: { > type?: string | null, > everyMinutes?: number | null > }[] | null, > schedule?: string | null, > notifyOnCapturedScreenshotChange?: boolean | null, > notifyOnCapturedTextChange?: boolean | null, > capturedScreenshotNotificationThreshold?: number | null, > createdAt?: number | null, > pausedAt?: number | null, > updatedAt?: number | null > } > ``` *** ### delete `monitors.delete` Delete a robot monitor **Risk:** `write` ```ts theme={null} await corsair.browseai.api.monitors.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `robotId` | `string` | Yes | — | | `monitorId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | *** ## Robots ### bulkRun `robots.bulkRun` Start a bulk run of robot tasks **Risk:** `write` ```ts theme={null} await corsair.browseai.api.robots.bulkRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `robotId` | `string` | Yes | — | | `title` | `string` | No | — | | `inputParameters` | `object[]` | Yes | — | > **inputParameters full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | | `result` | `object` | No | — | > **result full type** > > ```ts theme={null} > { > bulkRun?: { > id?: string | null, > title?: string | null, > status?: string | null, > tasksCount?: number | null, > successfulTasks?: number | null, > failedTasks?: number | null, > robotId?: string | null, > createdAt?: number | null > } | null > } > ``` *** ### list `robots.list` List robots on the account **Risk:** `read` ```ts theme={null} await corsair.browseai.api.robots.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | | `robots` | `object` | No | — | > **robots full type** > > ```ts theme={null} > { > totalCount?: number | null, > items?: { > id?: string | null, > name?: string | null, > createdAt?: number | null, > inputParameters?: { > type?: string | null, > name?: string | null, > label?: string | null, > required?: boolean | null, > encrypted?: boolean | null, > defaultValue?: string | number | string[] | null, > value?: string | number | string[] | null, > min?: number | null, > max?: number | null, > pattern?: string | null, > options?: { > label?: string | null, > value?: string | null > }[] | null > }[] | null > }[] | null > } > ``` *** ### run `robots.run` Start a robot task **Risk:** `write` ```ts theme={null} await corsair.browseai.api.robots.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `robotId` | `string` | Yes | — | | `recordVideo` | `boolean` | No | — | | `inputParameters` | `object` | No | — | > **inputParameters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | | `result` | `object` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > inputParameters?: { > } | null, > robotId?: string | null, > status?: string | null, > runByUserId?: string | null, > robotBulkRunId?: string | null, > runByTaskMonitorId?: string | null, > runByAPI?: boolean | null, > createdAt?: number | null, > startedAt?: number | null, > finishedAt?: number | null, > userFriendlyError?: string | null, > triedRecordingVideo?: boolean | null, > videoUrl?: string | null, > videoRemovedAt?: number | null, > retriedOriginalTaskId?: string | null, > retriedTaskId?: string | null, > retriedByTaskId?: string | null, > capturedDataTemporaryUrl?: string | null, > capturedTexts?: { > } | null, > capturedScreenshots?: { > } | null, > capturedLists?: { > } | null > } > ``` *** ## System ### getStatus `system.getStatus` Check Browse AI task-queue status **Risk:** `read` ```ts theme={null} await corsair.browseai.api.system.getStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | | `tasksQueueStatus` | `string` | No | — | *** ## Tasks ### get `tasks.get` Get a robot task by id **Risk:** `read` ```ts theme={null} await corsair.browseai.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `robotId` | `string` | Yes | — | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | | `result` | `object` | No | — | > **result full type** > > ```ts theme={null} > { > id?: string | null, > inputParameters?: { > } | null, > robotId?: string | null, > status?: string | null, > runByUserId?: string | null, > robotBulkRunId?: string | null, > runByTaskMonitorId?: string | null, > runByAPI?: boolean | null, > createdAt?: number | null, > startedAt?: number | null, > finishedAt?: number | null, > userFriendlyError?: string | null, > triedRecordingVideo?: boolean | null, > videoUrl?: string | null, > videoRemovedAt?: number | null, > retriedOriginalTaskId?: string | null, > retriedTaskId?: string | null, > retriedByTaskId?: string | null, > capturedDataTemporaryUrl?: string | null, > capturedTexts?: { > } | null, > capturedScreenshots?: { > } | null, > capturedLists?: { > } | null > } > ``` *** ### list `tasks.list` List tasks for a robot **Risk:** `read` ```ts theme={null} await corsair.browseai.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `robotId` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `status` | `failed \| successful \| in-progress` | No | — | | `robotBulkRunId` | `string` | No | — | | `sort` | `string` | No | — | | `includeRetried` | `boolean` | No | — | | `fromDate` | `number` | No | — | | `toDate` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | | `result` | `object` | No | — | > **result full type** > > ```ts theme={null} > { > robotTasks?: { > totalCount?: number | null, > pageNumber?: number | null, > hasMore?: boolean | null, > items?: { > id?: string | null, > inputParameters?: { > } | null, > robotId?: string | null, > status?: string | null, > runByUserId?: string | null, > robotBulkRunId?: string | null, > runByTaskMonitorId?: string | null, > runByAPI?: boolean | null, > createdAt?: number | null, > startedAt?: number | null, > finishedAt?: number | null, > userFriendlyError?: string | null, > triedRecordingVideo?: boolean | null, > videoUrl?: string | null, > videoRemovedAt?: number | null, > retriedOriginalTaskId?: string | null, > retriedTaskId?: string | null, > retriedByTaskId?: string | null, > capturedDataTemporaryUrl?: string | null, > capturedTexts?: { > } | null, > capturedScreenshots?: { > } | null, > capturedLists?: { > } | null > }[] | null > } | null > } > ``` *** ## Webhooks ### create `webhooks.create` Create a robot webhook **Risk:** `write` ```ts theme={null} await corsair.browseai.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `robotId` | `string` | Yes | — | | `hookUrl` | `string` | Yes | — | | `eventType` | `taskCapturedDataChanged \| taskFinished \| taskFinishedSuccessfully \| taskFinishedWithError \| tableExportFinishedSuccessfully` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | | `webhook` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > id?: string | null, > url?: string | null, > webhookEvent?: string | null, > createdAt?: number | null > } > ``` *** ### list `webhooks.list` List webhooks for a robot **Risk:** `read` ```ts theme={null} await corsair.browseai.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `robotId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `statusCode` | `number` | No | — | | `messageCode` | `string` | No | — | | `webhooks` | `object` | No | — | > **webhooks full type** > > ```ts theme={null} > { > totalCount?: number | null, > items?: { > id?: string | null, > url?: string | null, > webhookEvent?: string | null, > createdAt?: number | null > }[] | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/browseai/database Browse AI local sync: searchable entities, `.search()` filters, and operators. The Browse AI plugin syncs data locally. Use `corsair.browseai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Bulk Run Path: `browseai.db.bulkRun.search` ```ts theme={null} const rows = await corsair.browseai.db.bulkRun.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `tasksCount` | `number` | equals, gt, gte, lt, lte, in | | `successfulTasks` | `number` | equals, gt, gte, lt, lte, in | | `failedTasks` | `number` | equals, gt, gte, lt, lte, in | | `robotId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Monitor Path: `browseai.db.monitor.search` ```ts theme={null} const rows = await corsair.browseai.db.monitor.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `pausedReason` | `string` | equals, contains, startsWith, endsWith, in | | `schedule` | `string` | equals, contains, startsWith, endsWith, in | | `notifyOnCapturedScreenshotChange` | `boolean` | equals | | `notifyOnCapturedTextChange` | `boolean` | equals | | `capturedScreenshotNotificationThreshold` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `pausedAt` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Robot Path: `browseai.db.robot.search` ```ts theme={null} const rows = await corsair.browseai.db.robot.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Robot Task Path: `browseai.db.robotTask.search` ```ts theme={null} const rows = await corsair.browseai.db.robotTask.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `robotId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `runByUserId` | `string` | equals, contains, startsWith, endsWith, in | | `robotBulkRunId` | `string` | equals, contains, startsWith, endsWith, in | | `runByTaskMonitorId` | `string` | equals, contains, startsWith, endsWith, in | | `runByAPI` | `boolean` | equals | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `startedAt` | `number` | equals, gt, gte, lt, lte, in | | `finishedAt` | `number` | equals, gt, gte, lt, lte, in | | `userFriendlyError` | `string` | equals, contains, startsWith, endsWith, in | | `triedRecordingVideo` | `boolean` | equals | | `videoUrl` | `string` | equals, contains, startsWith, endsWith, in | | `videoRemovedAt` | `number` | equals, gt, gte, lt, lte, in | | `retriedOriginalTaskId` | `string` | equals, contains, startsWith, endsWith, in | | `retriedTaskId` | `string` | equals, contains, startsWith, endsWith, in | | `retriedByTaskId` | `string` | equals, contains, startsWith, endsWith, in | | `capturedDataTemporaryUrl` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## System Status Path: `browseai.db.systemStatus.search` ```ts theme={null} const rows = await corsair.browseai.db.systemStatus.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `statusCode` | `number` | equals, gt, gte, lt, lte, in | | `messageCode` | `string` | equals, contains, startsWith, endsWith, in | | `tasksQueueStatus` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhook Path: `browseai.db.webhook.search` ```ts theme={null} const rows = await corsair.browseai.db.webhook.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `webhookEvent` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/browseai/overview No-code web scraping robots for monitoring sites and extracting structured data. Use **Browse AI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 10 typed API operations * 6 synced entities (`bulkRun`, `monitor`, `robot`, `robotTask`, `systemStatus`, `webhook`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/browseai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/browseai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/browseai ``` ```bash bun theme={null} bun add corsair @corsair-dev/browseai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { browseai } from '@corsair-dev/browseai'; export const corsair = createCorsair({ plugins: [ browseai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} browseai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'browseai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`robots.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.browseai.api.robots.list({}); ``` **`monitors.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.browseai.api.monitors.create({}); ``` See the full list on the [API](/plugins/browseai/api) page. ## Query synced data Synced entities support `tenant.browseai.db..search()` and `.list()`: `bulkRun`, `monitor`, `robot`, `robotTask`, `systemStatus`, `webhook`. See [Database](/plugins/browseai/database) for filters and operators. ## What's next > **[API reference](/plugins/browseai/api)** > > Every `browseai.api.*` operation with input and output types. > **[Database](/plugins/browseai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/browserless/api API reference for Browserless: every `browserless.api.*` operation with input and output types. Every `browserless.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Content ### get `content.get` POST /content — fully rendered HTML after JavaScript execution **Risk:** `read` ```ts theme={null} await corsair.browserless.api.content.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `html` | `string` | No | — | | `gotoOptions` | `object` | No | — | | `waitForTimeout` | `number` | No | — | | `waitForSelector` | `object` | No | — | | `bestAttempt` | `boolean` | No | — | | `stealth` | `boolean` | No | — | | `timeout` | `number` | No | — | | `proxy` | `string` | No | — | | `blockAds` | `boolean` | No | — | > **gotoOptions full type** > > ```ts theme={null} > { > waitUntil?: load | domcontentloaded | networkidle0 | networkidle2, > timeout?: number > } > ``` > **waitForSelector full type** > > ```ts theme={null} > { > selector: string, > timeout?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `html` | `string` | Yes | — | | `contentType` | `string` | Yes | — | *** ## Download ### create `download.create` POST /download — return files Chrome downloaded during Puppeteer code **Risk:** `write` ```ts theme={null} await corsair.browserless.api.download.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `context` | `object` | No | — | | `stealth` | `boolean` | No | — | | `timeout` | `number` | No | — | | `proxy` | `string` | No | — | | `blockAds` | `boolean` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `base64` | `string` | Yes | — | | `contentType` | `string` | Yes | — | | `filename` | `string` | No | — | *** ## Function ### run `function.run` POST /function — run custom Puppeteer code in one session **Risk:** `write` ```ts theme={null} await corsair.browserless.api.function.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `context` | `object` | No | — | | `stealth` | `boolean` | No | — | | `timeout` | `number` | No | — | | `proxy` | `string` | No | — | | `blockAds` | `boolean` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `data` | `any` | No | — | | `base64` | `string` | No | — | | `filename` | `string` | No | — | *** ## Pdf ### create `pdf.create` POST /pdf — Chrome print-engine PDF of a page **Risk:** `read` ```ts theme={null} await corsair.browserless.api.pdf.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `html` | `string` | No | — | | `gotoOptions` | `object` | No | — | | `waitForTimeout` | `number` | No | — | | `waitForSelector` | `object` | No | — | | `bestAttempt` | `boolean` | No | — | | `stealth` | `boolean` | No | — | | `timeout` | `number` | No | — | | `proxy` | `string` | No | — | | `blockAds` | `boolean` | No | — | | `options` | `object` | No | — | > **gotoOptions full type** > > ```ts theme={null} > { > waitUntil?: load | domcontentloaded | networkidle0 | networkidle2, > timeout?: number > } > ``` > **waitForSelector full type** > > ```ts theme={null} > { > selector: string, > timeout?: number > } > ``` > **options full type** > > ```ts theme={null} > { > format?: Letter | Legal | Tabloid | Ledger | A0 | A1 | A2 | A3 | A4 | A5 | A6, > printBackground?: boolean, > displayHeaderFooter?: boolean, > tagged?: boolean, > pageRanges?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `base64` | `string` | Yes | — | | `contentType` | `string` | Yes | — | | `filename` | `string` | No | — | *** ## Scrape ### create `scrape.create` POST /scrape — structured JSON via CSS selectors **Risk:** `read` ```ts theme={null} await corsair.browserless.api.scrape.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `elements` | `object[]` | Yes | — | | `gotoOptions` | `object` | No | — | | `waitForTimeout` | `number` | No | — | | `waitForSelector` | `object` | No | — | | `bestAttempt` | `boolean` | No | — | | `stealth` | `boolean` | No | — | | `timeout` | `number` | No | — | | `proxy` | `string` | No | — | | `blockAds` | `boolean` | No | — | > **elements full type** > > ```ts theme={null} > { > selector: string > }[] > ``` > **gotoOptions full type** > > ```ts theme={null} > { > waitUntil?: load | domcontentloaded | networkidle0 | networkidle2, > timeout?: number > } > ``` > **waitForSelector full type** > > ```ts theme={null} > { > selector: string, > timeout?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > selector: string, > results: { > attributes?: { > name: string, > value: string > }[], > height?: number, > html?: string, > left?: number, > text?: string, > top?: number, > width?: number > }[] > }[] > ``` *** ## Screenshot ### create `screenshot.create` POST /screenshot — PNG, JPEG, or WebP of a page **Risk:** `read` ```ts theme={null} await corsair.browserless.api.screenshot.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `html` | `string` | No | — | | `gotoOptions` | `object` | No | — | | `waitForTimeout` | `number` | No | — | | `waitForSelector` | `object` | No | — | | `bestAttempt` | `boolean` | No | — | | `stealth` | `boolean` | No | — | | `timeout` | `number` | No | — | | `proxy` | `string` | No | — | | `blockAds` | `boolean` | No | — | | `options` | `object` | No | — | > **gotoOptions full type** > > ```ts theme={null} > { > waitUntil?: load | domcontentloaded | networkidle0 | networkidle2, > timeout?: number > } > ``` > **waitForSelector full type** > > ```ts theme={null} > { > selector: string, > timeout?: number > } > ``` > **options full type** > > ```ts theme={null} > { > fullPage?: boolean, > type?: png | jpeg | webp, > quality?: number, > clip?: { > x: number, > y: number, > width: number, > height: number > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `base64` | `string` | Yes | — | | `contentType` | `string` | Yes | — | | `filename` | `string` | No | — | *** ## Unblock ### create `unblock.create` POST /unblock — bypass bot detection and return content/cookies/screenshot **Risk:** `read` ```ts theme={null} await corsair.browserless.api.unblock.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `content` | `boolean` | No | — | | `cookies` | `boolean` | No | — | | `screenshot` | `boolean` | No | — | | `browserWSEndpoint` | `boolean` | No | — | | `ttl` | `number` | No | — | | `gotoOptions` | `object` | No | — | | `waitForTimeout` | `number` | No | — | | `waitForSelector` | `object` | No | — | | `bestAttempt` | `boolean` | No | — | | `stealth` | `boolean` | No | — | | `timeout` | `number` | No | — | | `proxy` | `string` | No | — | | `blockAds` | `boolean` | No | — | > **gotoOptions full type** > > ```ts theme={null} > { > waitUntil?: load | domcontentloaded | networkidle0 | networkidle2, > timeout?: number > } > ``` > **waitForSelector full type** > > ```ts theme={null} > { > selector: string, > timeout?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | No | — | | `cookies` | `object[]` | No | — | | `screenshot` | `string` | No | — | | `browserWSEndpoint` | `string` | No | — | > **cookies full type** > > ```ts theme={null} > { > name: string, > value: string, > domain?: string, > path?: string, > secure?: boolean, > httpOnly?: boolean, > expires?: number, > sameSite?: Strict | Lax | None, > url?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/browserless/database Browserless local sync: searchable entities, `.search()` filters, and operators. The Browserless plugin syncs data locally. Use `corsair.browserless.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Cookies Path: `browserless.db.cookies.search` ```ts theme={null} const rows = await corsair.browserless.db.cookies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `secure` | `boolean` | equals | | `httpOnly` | `boolean` | equals | | `expires` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `browserless.db.files.search` ```ts theme={null} const rows = await corsair.browserless.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `base64` | `string` | equals, contains, startsWith, endsWith, in | | `contentType` | `string` | equals, contains, startsWith, endsWith, in | | `filename` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Html Path: `browserless.db.html.search` ```ts theme={null} const rows = await corsair.browserless.db.html.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `html` | `string` | equals, contains, startsWith, endsWith, in | | `contentType` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scrape Groups Path: `browserless.db.scrapeGroups.search` ```ts theme={null} const rows = await corsair.browserless.db.scrapeGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `selector` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scrape Matches Path: `browserless.db.scrapeMatches.search` ```ts theme={null} const rows = await corsair.browserless.db.scrapeMatches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `html` | `string` | equals, contains, startsWith, endsWith, in | | `left` | `number` | equals, gt, gte, lt, lte, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `top` | `number` | equals, gt, gte, lt, lte, in | | `width` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scrape Results Path: `browserless.db.scrapeResults.search` ```ts theme={null} const rows = await corsair.browserless.db.scrapeResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Unblock Results Path: `browserless.db.unblockResults.search` ```ts theme={null} const rows = await corsair.browserless.db.unblockResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `screenshot` | `string` | equals, contains, startsWith, endsWith, in | | `browserWSEndpoint` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/browserless/overview Headless browser API for running Puppeteer and Playwright automation in the cloud. Use **Browserless** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 7 typed API operations * 7 synced entities (`cookies`, `files`, `html`, `scrapeGroups`, `scrapeMatches`, `scrapeResults`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/browserless ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/browserless ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/browserless ``` ```bash bun theme={null} bun add corsair @corsair-dev/browserless ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { browserless } from '@corsair-dev/browserless'; export const corsair = createCorsair({ plugins: [ browserless(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} browserless() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'browserless', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`content.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.browserless.api.content.get({}); ``` **`download.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.browserless.api.download.create({}); ``` See the full list on the [API](/plugins/browserless/api) page. ## Query synced data Synced entities support `tenant.browserless.db..search()` and `.list()`: `cookies`, `files`, `html`, `scrapeGroups`, `scrapeMatches`, `scrapeResults`, `unblockResults`. See [Database](/plugins/browserless/database) for filters and operators. ## What's next > **[API reference](/plugins/browserless/api)** > > Every `browserless.api.*` operation with input and output types. > **[Database](/plugins/browserless/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/browsertool/api API reference for BrowserTool: every `browsertool.api.*` operation with input and output types. Every `browsertool.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Files ### get `files.get` Get a download URL for a task output file **Risk:** `read` ```ts theme={null} await corsair.browsertool.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `session_info` | `any` | No | — | | `log_id` | `string` | No | — | *** ## Sessions ### get `sessions.get` Get the live URL for a browser session **Risk:** `read` ```ts theme={null} await corsair.browsertool.api.sessions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `session_info` | `any` | No | — | | `log_id` | `string` | No | — | *** ## Tasks ### create `tasks.create` Run an AI-powered browser automation task **Risk:** `write` ```ts theme={null} await corsair.browsertool.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task` | `string` | Yes | — | | `secrets` | `object` | No | — | | `startUrl` | `string` | No | — | | `sessionId` | `string` | No | — | > **secrets full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `session_info` | `any` | No | — | | `log_id` | `string` | No | — | *** ### stop `tasks.stop` Stop a running browser task and its session **Risk:** `write` ```ts theme={null} await corsair.browsertool.api.tasks.stop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `session_info` | `any` | No | — | | `log_id` | `string` | No | — | *** ### watch `tasks.watch` Poll a browser task for progress and results **Risk:** `read` ```ts theme={null} await corsair.browsertool.api.tasks.watch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `lastStepSeen` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `session_info` | `any` | No | — | | `log_id` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/browsertool/database BrowserTool local sync: searchable entities, `.search()` filters, and operators. The BrowserTool plugin syncs data locally. Use `corsair.browsertool.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Executions Path: `browsertool.db.executions.search` ```ts theme={null} const rows = await corsair.browsertool.db.executions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `error` | `string` | equals, contains, startsWith, endsWith, in | | `successful` | `boolean` | equals | | `log_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `browsertool.db.tasks.search` ```ts theme={null} const rows = await corsair.browsertool.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `taskId` | `string` | equals, contains, startsWith, endsWith, in | | `sessionId` | `string` | equals, contains, startsWith, endsWith, in | | `watch_task_id` | `string` | equals, contains, startsWith, endsWith, in | | `browser_session_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `is_success` | `boolean` | equals | | `current_goal` | `string` | equals, contains, startsWith, endsWith, in | | `current_url` | `string` | equals, contains, startsWith, endsWith, in | | `liveUrl` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/browsertool/overview BrowserTool plugin for Corsair Use **BrowserTool** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 2 synced entities (`executions`, `tasks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/browsertool ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/browsertool ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/browsertool ``` ```bash bun theme={null} bun add corsair @corsair-dev/browsertool ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { browsertool } from '@corsair-dev/browsertool'; export const corsair = createCorsair({ plugins: [ browsertool(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} browsertool() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'browsertool', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`files.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.browsertool.api.files.get({}); ``` **`tasks.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.browsertool.api.tasks.create({}); ``` See the full list on the [API](/plugins/browsertool/api) page. ## Query synced data Synced entities support `tenant.browsertool.db..search()` and `.list()`: `executions`, `tasks`. See [Database](/plugins/browsertool/database) for filters and operators. ## What's next > **[API reference](/plugins/browsertool/api)** > > Every `browsertool.api.*` operation with input and output types. > **[Database](/plugins/browsertool/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bubble/api API reference for Bubble: every `bubble.api.*` operation with input and output types. Every `bubble.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Meta ### getSwagger `meta.getSwagger` Retrieve the auto-generated Swagger 2.0 JSON for enabled Bubble APIs **Risk:** `read` ```ts theme={null} await corsair.bubble.api.meta.getSwagger({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Things ### bulkCreate `things.bulkCreate` Create up to 1,000 things in one request, returning per-record results **Risk:** `write` ```ts theme={null} await corsair.bubble.api.things.bulkCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `typeName` | `string` | Yes | — | | `records` | `any[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > status: string, > id?: string, > message?: string > }[] > ``` *** ### create `things.create` Create a single thing with the supplied field values **Risk:** `write` ```ts theme={null} await corsair.bubble.api.things.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `typeName` | `string` | Yes | — | | `fields` | `any` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `success` | Yes | — | | `id` | `string` | Yes | — | *** ### delete `things.delete` Permanently delete a thing by its unique ID **Risk:** `destructive` ```ts theme={null} await corsair.bubble.api.things.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `typeName` | `string` | Yes | — | | `thingId` | `string` | Yes | — | **Output:** `void` *** ### get `things.get` Retrieve a single thing by its unique ID **Risk:** `read` ```ts theme={null} await corsair.bubble.api.things.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `typeName` | `string` | Yes | — | | `thingId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `Created By` | `string` | No | — | | `Created Date` | `string` | No | — | | `Modified Date` | `string` | No | — | *** ### list `things.list` Search and paginate things of a data type, with optional constraints and sorting **Risk:** `read` ```ts theme={null} await corsair.bubble.api.things.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `typeName` | `string` | Yes | — | | `cursor` | `number` | No | — | | `limit` | `number` | No | — | | `constraints` | `object[]` | No | — | | `sortField` | `string` | No | — | | `descending` | `boolean` | No | — | | `excludeRemaining` | `boolean` | No | — | | `additionalSortFields` | `object[]` | No | — | > **constraints full type** > > ```ts theme={null} > { > key: string, > constraint_type: string, > value?: string | number | boolean | lazy > }[] > ``` > **additionalSortFields full type** > > ```ts theme={null} > { > sortField: string, > descending?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object` | Yes | — | > **response full type** > > ```ts theme={null} > { > cursor: number, > count: number, > remaining?: number, > results: { > _id: string, > Created By?: string, > Created Date?: string, > Modified Date?: string > }[] > } > ``` *** ### replace `things.replace` Overwrite all editable fields of an existing thing (omitted fields reset to default) **Risk:** `write` ```ts theme={null} await corsair.bubble.api.things.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `typeName` | `string` | Yes | — | | `thingId` | `string` | Yes | — | | `fields` | `any` | Yes | — | **Output:** `void` *** ### update `things.update` Change selected fields of an existing thing **Risk:** `write` ```ts theme={null} await corsair.bubble.api.things.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `typeName` | `string` | Yes | — | | `thingId` | `string` | Yes | — | | `fields` | `any` | Yes | — | **Output:** `void` *** ## Workflows ### run `workflows.run` Run an API workflow with the supplied parameters (Workflow API POST) **Risk:** `write` ```ts theme={null} await corsair.bubble.api.workflows.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workflowName` | `string` | Yes | — | | `params` | `object` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ### runGet `workflows.runGet` Run an API workflow with query-string parameters (Workflow API GET) **Risk:** `write` ```ts theme={null} await corsair.bubble.api.workflows.runGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workflowName` | `string` | Yes | — | | `params` | `object` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/bubble/database Bubble local sync: searchable entities, `.search()` filters, and operators. The Bubble plugin syncs data locally. Use `corsair.bubble.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Things Path: `bubble.db.things.search` ```ts theme={null} const rows = await corsair.bubble.db.things.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `Created By` | `string` | equals, contains, startsWith, endsWith, in | | `Created Date` | `string` | equals, contains, startsWith, endsWith, in | | `Modified Date` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bubble/overview No-code app builder with data and workflow APIs for custom web applications. Use **Bubble** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 10 typed API operations * 1 synced entity (`things`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bubble ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bubble ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bubble ``` ```bash bun theme={null} bun add corsair @corsair-dev/bubble ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bubble } from '@corsair-dev/bubble'; export const corsair = createCorsair({ plugins: [ bubble(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bubble() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bubble', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`meta.getSwagger`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bubble.api.meta.getSwagger({}); ``` **`things.bulkCreate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bubble.api.things.bulkCreate({}); ``` See the full list on the [API](/plugins/bubble/api) page. ## Query synced data Synced entities support `tenant.bubble.db..search()` and `.list()`: `things`. See [Database](/plugins/bubble/database) for filters and operators. ## What's next > **[API reference](/plugins/bubble/api)** > > Every `bubble.api.*` operation with input and output types. > **[Database](/plugins/bubble/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bugsnag/api API reference for Bugsnag: every `bugsnag.api.*` operation with input and output types. Every `bugsnag.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Collaborators ### delete `collaborators.delete` Remove a collaborator, revoking access to every project in the organization **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.collaborators.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `collaborator_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### get `collaborators.get` Get a single collaborator **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.collaborators.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `collaborator_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `two_factor_enabled` | `boolean` | No | — | | `two_factor_enabled_on` | `string` | No | — | | `password_updated_on` | `string` | No | — | | `show_time_in_utc` | `boolean` | No | — | | `heroku` | `boolean` | No | — | | `recovery_codes_remaining` | `number` | No | — | | `is_admin` | `boolean` | No | — | | `pending_invitation` | `boolean` | No | — | | `last_request_at` | `string` | No | — | | `paid_for` | `boolean` | No | — | | `project_ids` | `string[]` | No | — | | `team_ids` | `string[]` | No | — | | `project_roles` | `object` | No | — | | `managed_by_smartbear_id` | `boolean` | No | — | | `created_at` | `string` | No | — | > **project\_roles full type** > > ```ts theme={null} > { > } > ``` *** ### getOnProject `collaborators.getOnProject` Get a collaborator in the context of a project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.collaborators.getOnProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `collaborator_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `two_factor_enabled` | `boolean` | No | — | | `two_factor_enabled_on` | `string` | No | — | | `password_updated_on` | `string` | No | — | | `show_time_in_utc` | `boolean` | No | — | | `heroku` | `boolean` | No | — | | `recovery_codes_remaining` | `number` | No | — | | `is_admin` | `boolean` | No | — | | `pending_invitation` | `boolean` | No | — | | `last_request_at` | `string` | No | — | | `paid_for` | `boolean` | No | — | | `project_ids` | `string[]` | No | — | | `team_ids` | `string[]` | No | — | | `project_roles` | `object` | No | — | | `managed_by_smartbear_id` | `boolean` | No | — | | `created_at` | `string` | No | — | > **project\_roles full type** > > ```ts theme={null} > { > } > ``` *** ### getProjectAccess `collaborators.getProjectAccess` Get how one collaborator reaches one project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.collaborators.getProjectAccess({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `collaborator_id` | `string` | Yes | — | | `project_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `project_summary` | `object` | No | — | | `team_count` | `number` | No | — | | `is_admin` | `boolean` | No | — | | `project_role` | `string` | No | — | | `individual_project_role` | `string` | No | — | | `team_project_role` | `string` | No | — | > **project\_summary full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > type?: string | null, > slug?: string | null > } > ``` *** ### invite `collaborators.invite` Invite a collaborator to an organization by email address **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.collaborators.invite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `email` | `string` | Yes | — | | `admin` | `boolean` | No | — | | `project_ids` | `string[]` | No | — | | `team_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `two_factor_enabled` | `boolean` | No | — | | `two_factor_enabled_on` | `string` | No | — | | `password_updated_on` | `string` | No | — | | `show_time_in_utc` | `boolean` | No | — | | `heroku` | `boolean` | No | — | | `recovery_codes_remaining` | `number` | No | — | | `is_admin` | `boolean` | No | — | | `pending_invitation` | `boolean` | No | — | | `last_request_at` | `string` | No | — | | `paid_for` | `boolean` | No | — | | `project_ids` | `string[]` | No | — | | `team_ids` | `string[]` | No | — | | `project_roles` | `object` | No | — | | `managed_by_smartbear_id` | `boolean` | No | — | | `created_at` | `string` | No | — | > **project\_roles full type** > > ```ts theme={null} > { > } > ``` *** ### list `collaborators.list` List the collaborators on an organization **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.collaborators.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `organization_id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > email?: string | null, > two_factor_enabled?: boolean | null, > two_factor_enabled_on?: string | null, > password_updated_on?: string | null, > show_time_in_utc?: boolean | null, > heroku?: boolean | null, > recovery_codes_remaining?: number | null, > is_admin?: boolean | null, > pending_invitation?: boolean | null, > last_request_at?: string | null, > paid_for?: boolean | null, > project_ids?: string[] | null, > team_ids?: string[] | null, > project_roles?: { > } | null, > managed_by_smartbear_id?: boolean | null, > created_at?: string | null > }[] > ``` *** ### listOnProject `collaborators.listOnProject` List the collaborators who can reach a project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.collaborators.listOnProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > email?: string | null, > two_factor_enabled?: boolean | null, > two_factor_enabled_on?: string | null, > password_updated_on?: string | null, > show_time_in_utc?: boolean | null, > heroku?: boolean | null, > recovery_codes_remaining?: number | null, > is_admin?: boolean | null, > pending_invitation?: boolean | null, > last_request_at?: string | null, > paid_for?: boolean | null, > project_ids?: string[] | null, > team_ids?: string[] | null, > project_roles?: { > } | null, > managed_by_smartbear_id?: boolean | null, > created_at?: string | null > }[] > ``` *** ### listProjectAccesses `collaborators.listProjectAccesses` List how a collaborator reaches each project, with the granting role **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.collaborators.listProjectAccesses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `organization_id` | `string` | Yes | — | | `collaborator_id` | `string` | Yes | — | | `q` | `string` | No | — | | `inaccessible` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > project_summary?: { > id?: string | null, > name?: string | null, > type?: string | null, > slug?: string | null > } | null, > team_count?: number | null, > is_admin?: boolean | null, > project_role?: string | null, > individual_project_role?: string | null, > team_project_role?: string | null > }[] > ``` *** ### listProjects `collaborators.listProjects` List the projects a collaborator can reach **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.collaborators.listProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `organization_id` | `string` | Yes | — | | `collaborator_id` | `string` | Yes | — | | `sort` | `string` | No | — | | `direction` | `asc \| desc` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > organization_id?: string | null, > slug?: string | null, > name?: string | null, > api_key?: string | null, > upload_api_key?: string | null, > must_use_upload_api_key?: boolean | null, > type?: string | null, > is_full_view?: boolean | null, > release_stages?: string[] | null, > language?: string | null, > errors_url?: string | null, > events_url?: string | null, > url?: string | null, > html_url?: string | null, > open_error_count?: number | null, > for_review_error_count?: number | null, > collaborators_count?: number | null, > teams_count?: number | null, > global_grouping?: string[] | null, > location_grouping?: string[] | null, > discarded_app_versions?: string[] | null, > discarded_errors?: string[] | null, > custom_event_fields_used?: number | null, > resolve_on_deploy?: boolean | null, > performance_display_type?: string | null, > default_performance_percentile?: string | null, > target_stability?: { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } | null, > critical_stability?: { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } | null, > stability_target_type?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` *** ### projectAccessCounts `collaborators.projectAccessCounts` Count how many projects each named collaborator can reach **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.collaborators.projectAccessCounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `collaborator_ids` | `string[]` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > collaborator_id: string, > project_count?: number | null, > is_admin?: boolean | null > }[] > ``` *** ### updatePermissions `collaborators.updatePermissions` Change a collaborator's project access or admin status **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.collaborators.updatePermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `collaborator_id` | `string` | Yes | — | | `admin` | `boolean` | No | — | | `project_ids` | `string[]` | No | — | | `project_roles` | `object` | No | — | > **project\_roles full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `two_factor_enabled` | `boolean` | No | — | | `two_factor_enabled_on` | `string` | No | — | | `password_updated_on` | `string` | No | — | | `show_time_in_utc` | `boolean` | No | — | | `heroku` | `boolean` | No | — | | `recovery_codes_remaining` | `number` | No | — | | `is_admin` | `boolean` | No | — | | `pending_invitation` | `boolean` | No | — | | `last_request_at` | `string` | No | — | | `paid_for` | `boolean` | No | — | | `project_ids` | `string[]` | No | — | | `team_ids` | `string[]` | No | — | | `project_roles` | `object` | No | — | | `managed_by_smartbear_id` | `boolean` | No | — | | `created_at` | `string` | No | — | > **project\_roles full type** > > ```ts theme={null} > { > } > ``` *** ## Data Deletions ### confirmForProject `dataDeletions.confirmForProject` Confirm a project event data deletion, irreversibly erasing the matched data **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.dataDeletions.confirmForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `deletion_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `filters` | `any` | No | — | | `events_count` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `confirmed_at` | `string` | No | — | | `expires_at` | `string` | No | — | *** ### createForOrganization `dataDeletions.createForOrganization` Create a request to erase matching event data across an organization **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.dataDeletions.createForOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `filters` | `object` | Yes | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `filters` | `any` | No | — | | `events_count` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `confirmed_at` | `string` | No | — | | `expires_at` | `string` | No | — | *** ### createForProject `dataDeletions.createForProject` Create a request to erase matching event data in a project **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.dataDeletions.createForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `filters` | `object` | Yes | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `filters` | `any` | No | — | | `events_count` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `confirmed_at` | `string` | No | — | | `expires_at` | `string` | No | — | *** ### getForOrganization `dataDeletions.getForOrganization` Check the status of an organization event data deletion **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.dataDeletions.getForOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `deletion_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `filters` | `any` | No | — | | `events_count` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `confirmed_at` | `string` | No | — | | `expires_at` | `string` | No | — | *** ### getForProject `dataDeletions.getForProject` Check the status of a project event data deletion **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.dataDeletions.getForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `deletion_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `filters` | `any` | No | — | | `events_count` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `confirmed_at` | `string` | No | — | | `expires_at` | `string` | No | — | *** ## Data Requests ### createForOrganization `dataRequests.createForOrganization` Request an export of an organization's event data for a subject access request **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.dataRequests.createForOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `filters` | `object` | Yes | — | | `report_type` | `string` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `filters` | `any` | No | — | | `url` | `string` | No | — | | `report_type` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `expires_at` | `string` | No | — | *** ### createForProject `dataRequests.createForProject` Request an export of a project's event data for a subject access request **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.dataRequests.createForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `filters` | `object` | Yes | — | | `report_type` | `string` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `filters` | `any` | No | — | | `url` | `string` | No | — | | `report_type` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `expires_at` | `string` | No | — | *** ### getForOrganization `dataRequests.getForOrganization` Check the status of an organization event data export **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.dataRequests.getForOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `filters` | `any` | No | — | | `url` | `string` | No | — | | `report_type` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `expires_at` | `string` | No | — | *** ### getForProject `dataRequests.getForProject` Check the status of a project event data export **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.dataRequests.getForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `filters` | `any` | No | — | | `url` | `string` | No | — | | `report_type` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `expires_at` | `string` | No | — | *** ## Errors ### bulkUpdate `errors.bulkUpdate` Apply one operation to many errors at once, including delete and discard **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.errors.bulkUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `error_ids` | `string[]` | Yes | — | | `operation` | `fix \| open \| ignore \| snooze \| discard \| undiscard \| delete \| override_severity \| assign \| create_issue \| link_issue \| unlink_issue` | Yes | — | | `severity` | `string` | No | — | | `assigned_collaborator_id` | `string` | No | — | | `assigned_team_id` | `string` | No | — | | `issue_url` | `string` | No | — | | `issue_title` | `string` | No | — | | `reopen_rules` | `object` | No | — | > **reopen\_rules full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `operation` | `string` | No | — | *** ### deleteAll `errors.deleteAll` Permanently delete every error and event in a project **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.errors.deleteAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### list `errors.list` List the error groups on a project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.errors.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `filters` | `object` | No | — | | `sort` | `string` | No | — | | `direction` | `asc \| desc` | No | — | | `base` | `string` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > project_id?: string | null, > error_class?: string | null, > message?: string | null, > context?: string | null, > severity?: string | null, > original_severity?: string | null, > overridden_severity?: string | null, > events?: number | null, > events_url?: string | null, > unthrottled_occurrence_count?: number | null, > users?: number | null, > first_seen?: string | null, > last_seen?: string | null, > first_seen_unfiltered?: string | null, > last_seen_unfiltered?: string | null, > status?: string | null, > created_issue?: any, > linked_issues?: any[] | null, > reopen_rules?: any, > assigned_collaborator_id?: string | null, > assigned_team_id?: string | null, > comment_count?: number | null, > missing_dsyms?: string[] | null, > release_stages?: string[] | null, > grouping_reason?: string | null, > grouping_fields?: any, > url?: string | null, > project_url?: string | null, > discarded?: boolean | null, > trend?: any, > introduced_in_releases?: any[] | null > }[] > ``` *** ## Event Fields ### create `eventFields.create` Create a custom event field from a path inside event metadata **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.eventFields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `path` | `string` | Yes | — | | `filter_options` | `object` | Yes | — | > **filter\_options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `display_id` | `string` | Yes | — | | `custom` | `boolean` | No | — | | `pivot_options` | `any` | No | — | | `path` | `string` | No | — | | `filter_options` | `any` | No | — | | `reindex_in_progress` | `boolean` | No | — | | `reindex_percentage` | `number` | No | — | *** ### delete `eventFields.delete` Delete a custom event field **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.eventFields.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `display_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### list `eventFields.list` List the fields a project can filter and pivot on **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.eventFields.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > display_id: string, > custom?: boolean | null, > pivot_options?: any, > path?: string | null, > filter_options?: any, > reindex_in_progress?: boolean | null, > reindex_percentage?: number | null > }[] > ``` *** ## Events ### list `events.list` List the individual event occurrences on a project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.events.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `filters` | `object` | No | — | | `sort` | `string` | No | — | | `direction` | `asc \| desc` | No | — | | `base` | `string` | No | — | | `full_reports` | `boolean` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > url?: string | null, > project_url?: string | null, > is_full_report?: boolean | null, > error_id?: string | null, > received_at?: string | null, > exceptions?: any[] | null, > severity?: string | null, > context?: string | null, > unhandled?: boolean | null, > app?: any, > threads?: any[] | null, > metaData?: any, > request?: any, > device?: any, > user?: any, > breadcrumbs?: any[] | null, > feature_flags?: any[] | null, > correlation?: any, > session?: any > }[] > ``` *** ### listForError `events.listForError` List the individual events belonging to one error **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.events.listForError({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `error_id` | `string` | Yes | — | | `filters` | `object` | No | — | | `sort` | `string` | No | — | | `direction` | `asc \| desc` | No | — | | `base` | `string` | No | — | | `full_reports` | `boolean` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > url?: string | null, > project_url?: string | null, > is_full_report?: boolean | null, > error_id?: string | null, > received_at?: string | null, > exceptions?: any[] | null, > severity?: string | null, > context?: string | null, > unhandled?: boolean | null, > app?: any, > threads?: any[] | null, > metaData?: any, > request?: any, > device?: any, > user?: any, > breadcrumbs?: any[] | null, > feature_flags?: any[] | null, > correlation?: any, > session?: any > }[] > ``` *** ## Feature Flags ### list `featureFlags.list` List the feature flags seen on a project in a release stage **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.featureFlags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `release_stage_name` | `string` | Yes | — | | `q` | `string` | No | — | | `include_inactive` | `boolean` | No | — | | `include_variant_summary` | `boolean` | No | — | | `sort` | `string` | No | — | | `direction` | `asc \| desc` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name: string, > active?: boolean | null, > first_seen?: string | null, > last_seen?: string | null, > variants?: any[] | null, > variant_summary?: any > }[] > ``` *** ### listSummaries `featureFlags.listSummaries` List feature flag summaries for a project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.featureFlags.listSummaries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `q` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name: string, > variant_count?: number | null, > error_count?: number | null > }[] > ``` *** ## Integrations ### configure `integrations.configure` Configure an integration on a project **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.integrations.configure({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `integration_key` | `string` | Yes | — | | `configuration` | `object` | Yes | — | > **configuration full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `integration_key` | `string` | No | — | | `project_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `config` | `any` | No | — | | `trigger_configs` | `any` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### deleteConfigured `integrations.deleteConfigured` Delete a configured integration **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.integrations.deleteConfigured({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `integration_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### getConfigured `integrations.getConfigured` Get a single configured integration **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.integrations.getConfigured({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `integration_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `integration_key` | `string` | No | — | | `project_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `config` | `any` | No | — | | `trigger_configs` | `any` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### listConfigured `integrations.listConfigured` List the integrations configured on a project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.integrations.listConfigured({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > integration_key?: string | null, > project_id?: string | null, > name?: string | null, > type?: string | null, > config?: any, > trigger_configs?: any, > created_at?: string | null, > updated_at?: string | null > }[] > ``` *** ### listSupported `integrations.listSupported` List every integration BugSnag supports **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.integrations.listSupported({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > key: string, > name?: string | null, > url?: string | null, > type?: string | null, > description?: string | null, > actions?: any, > fields?: any, > icon_url?: string | null, > created_entity_name?: string | null, > two_way_sync?: boolean | null, > issue_automation_options?: any > }[] > ``` *** ### test `integrations.test` Test an integration configuration before creating it **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.integrations.test({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | | `configuration` | `object` | Yes | — | > **configuration full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | | `errors` | `any[]` | No | — | *** ## Organizations ### delete `organizations.delete` Delete an organization with all of its projects, errors and collaborator access **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.organizations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### get `organizations.get` Get a single organization **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.organizations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `slug` | `string` | No | — | | `api_key` | `string` | No | — | | `creator` | `object` | No | — | | `collaborators_url` | `string` | No | — | | `projects_url` | `string` | No | — | | `auto_upgrade` | `boolean` | No | — | | `upgrade_url` | `string` | No | — | | `can_start_pro_trial` | `boolean` | No | — | | `pro_trial_ends_at` | `string` | No | — | | `pro_trial_feature` | `boolean` | No | — | | `managed_by_platform_services` | `boolean` | No | — | | `billing_emails` | `string[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **creator full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > email?: string | null > } > ``` *** ### list `organizations.list` List the organizations the token's owner belongs to **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.organizations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > slug?: string | null, > api_key?: string | null, > creator?: { > id?: string | null, > name?: string | null, > email?: string | null > } | null, > collaborators_url?: string | null, > projects_url?: string | null, > auto_upgrade?: boolean | null, > upgrade_url?: string | null, > can_start_pro_trial?: boolean | null, > pro_trial_ends_at?: string | null, > pro_trial_feature?: boolean | null, > managed_by_platform_services?: boolean | null, > billing_emails?: string[] | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` *** ## Pivots ### list `pivots.list` List the pivot definitions available on a project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.pivots.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `filters` | `object` | No | — | | `pivots` | `string[]` | No | — | | `summary_size` | `number` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > event_field_display_id: string, > name?: string | null, > cardinality?: number | null > }[] > ``` *** ### values `pivots.values` List one pivot's values with each value's share of events **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.pivots.values({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `event_field_display_id` | `string` | Yes | — | | `filters` | `object` | No | — | | `base` | `string` | No | — | | `sort` | `string` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > event_field_value?: string | null, > events?: number | null, > proportion?: number | null, > first_seen?: string | null, > last_seen?: string | null, > fields?: any, > aggregates?: any > }[] > ``` *** ## Projects ### create `projects.create` Create a project in an organization **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `organization_id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `api_key` | `string` | No | — | | `upload_api_key` | `string` | No | — | | `must_use_upload_api_key` | `boolean` | No | — | | `type` | `string` | No | — | | `is_full_view` | `boolean` | No | — | | `release_stages` | `string[]` | No | — | | `language` | `string` | No | — | | `errors_url` | `string` | No | — | | `events_url` | `string` | No | — | | `url` | `string` | No | — | | `html_url` | `string` | No | — | | `open_error_count` | `number` | No | — | | `for_review_error_count` | `number` | No | — | | `collaborators_count` | `number` | No | — | | `teams_count` | `number` | No | — | | `global_grouping` | `string[]` | No | — | | `location_grouping` | `string[]` | No | — | | `discarded_app_versions` | `string[]` | No | — | | `discarded_errors` | `string[]` | No | — | | `custom_event_fields_used` | `number` | No | — | | `resolve_on_deploy` | `boolean` | No | — | | `performance_display_type` | `string` | No | — | | `default_performance_percentile` | `string` | No | — | | `target_stability` | `object` | No | — | | `critical_stability` | `object` | No | — | | `stability_target_type` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **target\_stability full type** > > ```ts theme={null} > { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } > ``` > **critical\_stability full type** > > ```ts theme={null} > { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } > ``` *** ### delete `projects.delete` Delete a project and its entire error history **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### get `projects.get` Get a single project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `organization_id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `api_key` | `string` | No | — | | `upload_api_key` | `string` | No | — | | `must_use_upload_api_key` | `boolean` | No | — | | `type` | `string` | No | — | | `is_full_view` | `boolean` | No | — | | `release_stages` | `string[]` | No | — | | `language` | `string` | No | — | | `errors_url` | `string` | No | — | | `events_url` | `string` | No | — | | `url` | `string` | No | — | | `html_url` | `string` | No | — | | `open_error_count` | `number` | No | — | | `for_review_error_count` | `number` | No | — | | `collaborators_count` | `number` | No | — | | `teams_count` | `number` | No | — | | `global_grouping` | `string[]` | No | — | | `location_grouping` | `string[]` | No | — | | `discarded_app_versions` | `string[]` | No | — | | `discarded_errors` | `string[]` | No | — | | `custom_event_fields_used` | `number` | No | — | | `resolve_on_deploy` | `boolean` | No | — | | `performance_display_type` | `string` | No | — | | `default_performance_percentile` | `string` | No | — | | `target_stability` | `object` | No | — | | `critical_stability` | `object` | No | — | | `stability_target_type` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **target\_stability full type** > > ```ts theme={null} > { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } > ``` > **critical\_stability full type** > > ```ts theme={null} > { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } > ``` *** ### list `projects.list` List the projects in an organization **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `organization_id` | `string` | Yes | — | | `q` | `string` | No | — | | `sort` | `string` | No | — | | `direction` | `asc \| desc` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > organization_id?: string | null, > slug?: string | null, > name?: string | null, > api_key?: string | null, > upload_api_key?: string | null, > must_use_upload_api_key?: boolean | null, > type?: string | null, > is_full_view?: boolean | null, > release_stages?: string[] | null, > language?: string | null, > errors_url?: string | null, > events_url?: string | null, > url?: string | null, > html_url?: string | null, > open_error_count?: number | null, > for_review_error_count?: number | null, > collaborators_count?: number | null, > teams_count?: number | null, > global_grouping?: string[] | null, > location_grouping?: string[] | null, > discarded_app_versions?: string[] | null, > discarded_errors?: string[] | null, > custom_event_fields_used?: number | null, > resolve_on_deploy?: boolean | null, > performance_display_type?: string | null, > default_performance_percentile?: string | null, > target_stability?: { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } | null, > critical_stability?: { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } | null, > stability_target_type?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` *** ### networkGroupingRuleset `projects.networkGroupingRuleset` Get a project's network span grouping ruleset **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.projects.networkGroupingRuleset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `endpoints` | `any[]` | No | — | *** ### regenerateApiKey `projects.regenerateApiKey` Rotate a project's notifier API key, stopping every deployed notifier until redeployed **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.projects.regenerateApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `organization_id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `api_key` | `string` | No | — | | `upload_api_key` | `string` | No | — | | `must_use_upload_api_key` | `boolean` | No | — | | `type` | `string` | No | — | | `is_full_view` | `boolean` | No | — | | `release_stages` | `string[]` | No | — | | `language` | `string` | No | — | | `errors_url` | `string` | No | — | | `events_url` | `string` | No | — | | `url` | `string` | No | — | | `html_url` | `string` | No | — | | `open_error_count` | `number` | No | — | | `for_review_error_count` | `number` | No | — | | `collaborators_count` | `number` | No | — | | `teams_count` | `number` | No | — | | `global_grouping` | `string[]` | No | — | | `location_grouping` | `string[]` | No | — | | `discarded_app_versions` | `string[]` | No | — | | `discarded_errors` | `string[]` | No | — | | `custom_event_fields_used` | `number` | No | — | | `resolve_on_deploy` | `boolean` | No | — | | `performance_display_type` | `string` | No | — | | `default_performance_percentile` | `string` | No | — | | `target_stability` | `object` | No | — | | `critical_stability` | `object` | No | — | | `stability_target_type` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **target\_stability full type** > > ```ts theme={null} > { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } > ``` > **critical\_stability full type** > > ```ts theme={null} > { > value?: number | null, > updated_at?: string | null, > updated_by_id?: string | null > } > ``` *** ## Releases ### list `releases.list` List the releases of a project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.releases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `release_stage` | `string` | No | — | | `base` | `string` | No | — | | `sort` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > project_id?: string | null, > release_group_id?: string | null, > release_time?: string | null, > release_source?: string | null, > app_version?: string | null, > app_version_code?: string | null, > app_bundle_version?: string | null, > build_label?: string | null, > builder_name?: string | null, > build_tool?: string | null, > errors_introduced_count?: number | null, > errors_seen_count?: number | null, > sessions_count_in_last_24h?: number | null, > total_sessions_count?: number | null, > unhandled_sessions_count?: number | null, > accumulative_daily_users_seen?: number | null, > accumulative_daily_users_with_unhandled?: number | null, > metadata?: any, > release_stage?: any > }[] > ``` *** ### listGroups `releases.listGroups` List the release groups of a project within a release stage **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.releases.listGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `release_stage_name` | `string` | Yes | — | | `sort` | `string` | No | — | | `top_only` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > project_id?: string | null, > release_stage_name?: string | null, > app_version?: string | null, > first_released_at?: string | null, > first_release_id?: string | null, > releases_count?: number | null, > has_secondary_versions?: boolean | null, > build_tool?: string | null, > builder_name?: string | null, > source_control?: any, > top_release_group?: boolean | null, > visible?: boolean | null, > total_sessions_count?: number | null, > unhandled_sessions_count?: number | null, > sessions_count_in_last_24h?: number | null, > accumulative_daily_users_seen?: number | null, > accumulative_daily_users_with_unhandled?: number | null > }[] > ``` *** ## Saved Searches ### create `savedSearches.create` Create a saved search from a filter configuration **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.savedSearches.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `filters` | `object` | Yes | — | | `shared` | `boolean` | No | — | | `project_default` | `boolean` | No | — | | `sort` | `string` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `user_id` | `string` | No | — | | `project_id` | `string` | No | — | | `name` | `string` | No | — | | `filters` | `any` | No | — | | `sort` | `string` | No | — | | `type` | `string` | No | — | | `shared` | `boolean` | No | — | | `updated_by_id` | `string` | No | — | | `project_default` | `boolean` | No | — | | `has_assigned_to_me` | `boolean` | No | — | | `has_assigned_to` | `boolean` | No | — | | `has_created_issue_filter` | `boolean` | No | — | | `has_status_filter` | `boolean` | No | — | | `new_error_inclusion` | `boolean` | No | — | | `open_error_inclusion` | `boolean` | No | — | | `for_review_error_inclusion` | `boolean` | No | — | | `snoozed_error_inclusion` | `boolean` | No | — | | `fixed_error_inclusion` | `boolean` | No | — | | `ignored_error_inclusion` | `boolean` | No | — | | `additional_filtersets` | `any` | No | — | | `advanced_filters` | `any` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### delete `savedSearches.delete` Delete a saved search **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.savedSearches.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `saved_search_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### get `savedSearches.get` Get a single saved search **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.savedSearches.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `saved_search_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `user_id` | `string` | No | — | | `project_id` | `string` | No | — | | `name` | `string` | No | — | | `filters` | `any` | No | — | | `sort` | `string` | No | — | | `type` | `string` | No | — | | `shared` | `boolean` | No | — | | `updated_by_id` | `string` | No | — | | `project_default` | `boolean` | No | — | | `has_assigned_to_me` | `boolean` | No | — | | `has_assigned_to` | `boolean` | No | — | | `has_created_issue_filter` | `boolean` | No | — | | `has_status_filter` | `boolean` | No | — | | `new_error_inclusion` | `boolean` | No | — | | `open_error_inclusion` | `boolean` | No | — | | `for_review_error_inclusion` | `boolean` | No | — | | `snoozed_error_inclusion` | `boolean` | No | — | | `fixed_error_inclusion` | `boolean` | No | — | | `ignored_error_inclusion` | `boolean` | No | — | | `additional_filtersets` | `any` | No | — | | `advanced_filters` | `any` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### list `savedSearches.list` List the saved searches on a project **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.savedSearches.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `project_id` | `string` | Yes | — | | `shared` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > user_id?: string | null, > project_id?: string | null, > name?: string | null, > filters?: any, > sort?: string | null, > type?: string | null, > shared?: boolean | null, > updated_by_id?: string | null, > project_default?: boolean | null, > has_assigned_to_me?: boolean | null, > has_assigned_to?: boolean | null, > has_created_issue_filter?: boolean | null, > has_status_filter?: boolean | null, > new_error_inclusion?: boolean | null, > open_error_inclusion?: boolean | null, > for_review_error_inclusion?: boolean | null, > snoozed_error_inclusion?: boolean | null, > fixed_error_inclusion?: boolean | null, > ignored_error_inclusion?: boolean | null, > additional_filtersets?: any, > advanced_filters?: any, > created_at?: string | null, > updated_at?: string | null > }[] > ``` *** ### usageSummary `savedSearches.usageSummary` Report what depends on a saved search, to check before deleting it **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.savedSearches.usageSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `saved_search_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `project_notifications_count` | `number` | No | — | | `current_user_using_for_email_notification` | `boolean` | No | — | | `collaborator_email_notifications_count` | `number` | No | — | | `performance_monitor_count` | `number` | No | — | *** ## Teams ### addCollaboratorMemberships `teams.addCollaboratorMemberships` Add a collaborator to teams, or to all of them **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.teams.addCollaboratorMemberships({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `collaborator_id` | `string` | Yes | — | | `team_ids` | `string[]` | No | — | | `add_all_teams` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `two_factor_enabled` | `boolean` | No | — | | `two_factor_enabled_on` | `string` | No | — | | `password_updated_on` | `string` | No | — | | `show_time_in_utc` | `boolean` | No | — | | `heroku` | `boolean` | No | — | | `recovery_codes_remaining` | `number` | No | — | | `is_admin` | `boolean` | No | — | | `pending_invitation` | `boolean` | No | — | | `last_request_at` | `string` | No | — | | `paid_for` | `boolean` | No | — | | `project_ids` | `string[]` | No | — | | `team_ids` | `string[]` | No | — | | `project_roles` | `object` | No | — | | `managed_by_smartbear_id` | `boolean` | No | — | | `created_at` | `string` | No | — | > **project\_roles full type** > > ```ts theme={null} > { > } > ``` *** ### addMembers `teams.addMembers` Add collaborators to a team, or add all of them **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.teams.addMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `team_id` | `string` | Yes | — | | `collaborator_ids` | `string[]` | No | — | | `add_all_collaborators` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `collaborator_count` | `number` | No | — | | `project_count` | `number` | No | — | *** ### create `teams.create` Create a team in an organization **Risk:** `write` ```ts theme={null} await corsair.bugsnag.api.teams.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `collaborator_count` | `number` | No | — | | `project_count` | `number` | No | — | *** ### delete `teams.delete` Delete a team, removing the grouping but not its members **Risk:** `destructive` ```ts theme={null} await corsair.bugsnag.api.teams.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### get `teams.get` Get a single team **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.teams.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `collaborator_count` | `number` | No | — | | `project_count` | `number` | No | — | *** ### list `teams.list` List the teams in an organization **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `per_page` | `number` | No | — | | `offset` | `number` | No | — | | `organization_id` | `string` | Yes | — | | `q` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > collaborator_count?: number | null, > project_count?: number | null > }[] > ``` *** ## Trends ### projectBuckets `trends.projectBuckets` Get a project's event counts split into time buckets **Risk:** `read` ```ts theme={null} await corsair.bugsnag.api.trends.projectBuckets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `buckets_count` | `number` | Yes | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > from?: string | null, > to?: string | null, > events_count?: number | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/bugsnag/database Bugsnag local sync: searchable entities, `.search()` filters, and operators. The Bugsnag plugin syncs data locally. Use `corsair.bugsnag.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Collaborators Path: `bugsnag.db.collaborators.search` ```ts theme={null} const rows = await corsair.bugsnag.db.collaborators.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `two_factor_enabled` | `boolean` | equals | | `two_factor_enabled_on` | `string` | equals, contains, startsWith, endsWith, in | | `password_updated_on` | `string` | equals, contains, startsWith, endsWith, in | | `show_time_in_utc` | `boolean` | equals | | `heroku` | `boolean` | equals | | `recovery_codes_remaining` | `number` | equals, gt, gte, lt, lte, in | | `is_admin` | `boolean` | equals | | `pending_invitation` | `boolean` | equals | | `last_request_at` | `string` | equals, contains, startsWith, endsWith, in | | `paid_for` | `boolean` | equals | | `managed_by_smartbear_id` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `bugsnag.db.organizations.search` ```ts theme={null} const rows = await corsair.bugsnag.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `api_key` | `string` | equals, contains, startsWith, endsWith, in | | `collaborators_url` | `string` | equals, contains, startsWith, endsWith, in | | `projects_url` | `string` | equals, contains, startsWith, endsWith, in | | `auto_upgrade` | `boolean` | equals | | `upgrade_url` | `string` | equals, contains, startsWith, endsWith, in | | `can_start_pro_trial` | `boolean` | equals | | `pro_trial_ends_at` | `string` | equals, contains, startsWith, endsWith, in | | `pro_trial_feature` | `boolean` | equals | | `managed_by_platform_services` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `bugsnag.db.projects.search` ```ts theme={null} const rows = await corsair.bugsnag.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `api_key` | `string` | equals, contains, startsWith, endsWith, in | | `upload_api_key` | `string` | equals, contains, startsWith, endsWith, in | | `must_use_upload_api_key` | `boolean` | equals | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `is_full_view` | `boolean` | equals | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `errors_url` | `string` | equals, contains, startsWith, endsWith, in | | `events_url` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `html_url` | `string` | equals, contains, startsWith, endsWith, in | | `open_error_count` | `number` | equals, gt, gte, lt, lte, in | | `for_review_error_count` | `number` | equals, gt, gte, lt, lte, in | | `collaborators_count` | `number` | equals, gt, gte, lt, lte, in | | `teams_count` | `number` | equals, gt, gte, lt, lte, in | | `custom_event_fields_used` | `number` | equals, gt, gte, lt, lte, in | | `resolve_on_deploy` | `boolean` | equals | | `performance_display_type` | `string` | equals, contains, startsWith, endsWith, in | | `default_performance_percentile` | `string` | equals, contains, startsWith, endsWith, in | | `stability_target_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `bugsnag.db.teams.search` ```ts theme={null} const rows = await corsair.bugsnag.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `collaborator_count` | `number` | equals, gt, gte, lt, lte, in | | `project_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bugsnag/overview Error monitoring platform for tracking application crashes and stability across releases. Use **Bugsnag** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 61 typed API operations * 4 synced entities (`collaborators`, `organizations`, `projects`, `teams`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bugsnag ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bugsnag ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bugsnag ``` ```bash bun theme={null} bun add corsair @corsair-dev/bugsnag ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bugsnag } from '@corsair-dev/bugsnag'; export const corsair = createCorsair({ plugins: [ bugsnag(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bugsnag() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bugsnag', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`collaborators.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bugsnag.api.collaborators.get({}); ``` **`collaborators.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bugsnag.api.collaborators.delete({}); ``` See the full list on the [API](/plugins/bugsnag/api) page. ## Query synced data Synced entities support `tenant.bugsnag.db..search()` and `.list()`: `collaborators`, `organizations`, `projects`, `teams`. See [Database](/plugins/bugsnag/database) for filters and operators. ## What's next > **[API reference](/plugins/bugsnag/api)** > > Every `bugsnag.api.*` operation with input and output types. > **[Database](/plugins/bugsnag/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/buildkite/api API reference for Buildkite: every `buildkite.api.*` operation with input and output types. Every `buildkite.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Get Current Access Token ### getCurrentAccessToken `getCurrentAccessToken` Retrieve the authenticated API access token details. Use when you need to confirm the validity and scopes of the current API token. **Risk:** `read` ```ts theme={null} await corsair.buildkite.api.getCurrentAccessToken({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `scopes` | `string[]` | Yes | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `expires_at` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > email?: string, > name?: string > } > ``` *** ## Get Meta ### getMeta `getMeta` Retrieve metadata about the Buildkite API. Use when you need to fetch webhook IP addresses for firewall or security configurations. **Risk:** `read` ```ts theme={null} await corsair.buildkite.api.getMeta({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhook_ips` | `string[]` | Yes | — | *** ## Get User ### getUser `getUser` Retrieve details about the current authenticated user. Use when you need to get information about the user account that owns the API token. **Risk:** `read` ```ts theme={null} await corsair.buildkite.api.getUser({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `graphql_id` | `string` | No | — | | `name` | `string` | Yes | — | | `email` | `string` | Yes | — | | `avatar_url` | `string` | No | — | | `created_at` | `string` | No | — | *** ## List Organizations ### listOrganizations `listOrganizations` List all organizations the current user is a member of. Use when you need to discover available organizations or get organization slugs for other operations. **Risk:** `read` ```ts theme={null} await corsair.buildkite.api.listOrganizations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > graphql_id?: string, > url?: string, > web_url?: string, > name: string, > slug: string, > pipelines_url?: string, > agents_url?: string, > emojis_url?: string, > created_at?: string > }[] > ``` *** ## List Pipeline Agents ### listPipelineAgents `listPipelineAgents` List connected agents for an organization. Use after confirming the organization slug. Supports optional filtering and pagination. **Risk:** `read` ```ts theme={null} await corsair.buildkite.api.listPipelineAgents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgSlug` | `string` | Yes | Official path param on GET /v2/organizations//agents | | `name` | `string` | No | Official query: ?name= | | `hostname` | `string` | No | Official query: ?hostname= | | `version` | `string` | No | Official query: ?version= | | `cluster_queue_id` | `string` | No | Official query: ?cluster\_queue\_id= | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > graphql_id?: string, > url?: string, > web_url?: string, > name: string, > connection_state: never_connected | connected | disconnected | stopping | stopped | lost, > hostname?: string, > ip_address?: string, > user_agent?: string, > version?: string, > os_id?: string, > arch?: string, > queue?: string, > creator?: { > id?: string, > graphql_id?: string, > name?: string, > email?: string, > avatar_url?: string, > created_at?: string > } | null, > created_at?: string, > connected_at?: string | null, > disconnected_at?: string | null, > lost_at?: string | null, > stopped_at?: string | null, > job?: { > id?: string, > graphql_id?: string, > type?: string, > name?: string, > state?: string, > command?: string > } | null, > last_job_finished_at?: string | null, > priority?: number | null, > meta_data?: string[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/buildkite/database Buildkite local sync: searchable entities, `.search()` filters, and operators. The Buildkite plugin syncs data locally. Use `corsair.buildkite.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Access Tokens Path: `buildkite.db.accessTokens.search` ```ts theme={null} const rows = await corsair.buildkite.db.accessTokens.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `expires_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Agents Path: `buildkite.db.agents.search` ```ts theme={null} const rows = await corsair.buildkite.db.agents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `graphql_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `hostname` | `string` | equals, contains, startsWith, endsWith, in | | `ip_address` | `string` | equals, contains, startsWith, endsWith, in | | `user_agent` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `os_id` | `string` | equals, contains, startsWith, endsWith, in | | `arch` | `string` | equals, contains, startsWith, endsWith, in | | `queue` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `connected_at` | `string` | equals, contains, startsWith, endsWith, in | | `disconnected_at` | `string` | equals, contains, startsWith, endsWith, in | | `lost_at` | `string` | equals, contains, startsWith, endsWith, in | | `stopped_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_job_finished_at` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Meta Path: `buildkite.db.meta.search` ```ts theme={null} const rows = await corsair.buildkite.db.meta.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `buildkite.db.organizations.search` ```ts theme={null} const rows = await corsair.buildkite.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `graphql_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `pipelines_url` | `string` | equals, contains, startsWith, endsWith, in | | `agents_url` | `string` | equals, contains, startsWith, endsWith, in | | `emojis_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `buildkite.db.users.search` ```ts theme={null} const rows = await corsair.buildkite.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `graphql_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/buildkite/overview Continuous integration platform for running scalable pipelines and software build automation. Use **Buildkite** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 5 synced entities (`accessTokens`, `agents`, `meta`, `organizations`, `users`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/buildkite ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/buildkite ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/buildkite ``` ```bash bun theme={null} bun add corsair @corsair-dev/buildkite ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { buildkite } from '@corsair-dev/buildkite'; export const corsair = createCorsair({ plugins: [ buildkite(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} buildkite() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'buildkite', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`getCurrentAccessToken`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.buildkite.api.getCurrentAccessToken({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/buildkite/api) reference.* See the full list on the [API](/plugins/buildkite/api) page. ## Query synced data Synced entities support `tenant.buildkite.db..search()` and `.list()`: `accessTokens`, `agents`, `meta`, `organizations`, `users`. See [Database](/plugins/buildkite/database) for filters and operators. ## What's next > **[API reference](/plugins/buildkite/api)** > > Every `buildkite.api.*` operation with input and output types. > **[Database](/plugins/buildkite/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/builtwith/api API reference for BuiltWith: every `builtwith.api.*` operation with input and output types. Every `builtwith.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Create Domain List File ### createDomainListFile `createDomainListFile` Build a deduplicated TXT or ZIP domain list file locally for bulk lookups **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.createDomainListFile({ domains: ['builtwith.com', 'shopify.com'], }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domains` | `string[]` | Yes | — | | `fileName` | `string` | No | — | | `format` | `txt \| zip` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fileName` | `string` | Yes | — | | `format` | `txt \| zip` | Yes | — | | `content` | `string` | Yes | — | | `encoding` | `utf8 \| base64` | Yes | — | | `domainCount` | `number` | Yes | — | | `domains` | `string[]` | Yes | — | *** ## Datasets ### lookup `datasets.lookup` Look up technology usage totals from the Trends API, optionally at a historical date **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.datasets.lookup({ tech: 'Shopify', date: '2024-01-01' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tech` | `string` | Yes | — | | `date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Tech` | `object` | No | — | | `Errors` | `object[]` | No | — | > **Tech full type** > > ```ts theme={null} > { > name: string, > description?: string, > link?: string, > icon?: string, > is_premium?: string, > tag?: string, > categories?: string[], > trends_link?: string, > coverage?: { > ten_k?: number, > hundred_k?: number, > milly?: number, > live?: number, > expired?: number > } > } > ``` > **Errors full type** > > ```ts theme={null} > { > Message: string, > Code: number > }[] > ``` *** ## Domain ### lookup `domain.lookup` Look up current and historical technologies for up to 16 root domains **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.domain.lookup({ lookup: 'builtwith.com', liveonly: true }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lookup` | `string` | Yes | — | | `hidedl` | `boolean` | No | — | | `hidetext` | `boolean` | No | — | | `liveonly` | `boolean` | No | — | | `nometa` | `boolean` | No | — | | `nopii` | `boolean` | No | — | | `noattr` | `boolean` | No | — | | `trust` | `boolean` | No | — | | `fdrange` | `string` | No | — | | `ldrange` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Results` | `object[]` | No | — | | `Errors` | `object[]` | No | — | > **Results full type** > > ```ts theme={null} > { > Lookup?: string, > Result?: { > IsDB?: string, > Spend?: number, > SalesRevenue?: number, > Paths?: { > Domain?: string, > Url?: string, > SubDomain?: string, > FirstIndexed?: string | number, > LastIndexed?: string | number, > Technologies?: { > Name: string, > Id?: number, > Parent?: string, > Description?: string, > Link?: string, > confidence?: number, > IsPremium?: string, > Tag?: string, > Categories?: string[], > FirstDetected?: string | number, > LastDetected?: string | number > }[] > }[] > }, > Meta?: { > ARank?: number | null, > QRank?: number | null, > Majestic?: number | null, > Umbrella?: number | null, > CompanyName?: string | null, > City?: string | null, > Postcode?: string | null, > State?: string | null, > Country?: string | null, > Vertical?: string | null, > PrimaryBusiness?: string | null, > Telephones?: string[] | null, > Emails?: string[] | null, > Social?: string[] | null, > company_reg?: { > type: string, > number: string > }[] | null > }, > Attributes?: { > }, > FirstIndexed?: string | number, > LastIndexed?: string | number > }[] > ``` > **Errors full type** > > ```ts theme={null} > { > Message: string, > Code: number > }[] > ``` *** ## Financial ### lookup `financial.lookup` Look up financial information for a domain **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.financial.lookup({ lookup: 'shopify.com' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lookup` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `companyName` | `string` | No | — | | `employees` | `number` | No | — | | `followers` | `number` | No | — | | `products` | `number` | No | — | | `spend` | `number` | No | — | | `edgar` | `object` | No | — | | `companyhouse` | `object` | No | — | | `Errors` | `object[]` | No | — | > **edgar full type** > > ```ts theme={null} > { > companyName?: string, > cik?: string | number, > sic?: string | number, > exchanges?: string[], > tickers?: string[], > financials?: { > periodStartDate?: string, > periodEndDate?: string, > revenue?: number, > operatingIncome?: number, > netIncome?: number, > assets?: number, > liabilities?: number, > cash?: number, > equity?: number > }[] > } > ``` > **companyhouse full type** > > ```ts theme={null} > { > companyName?: string, > regNo?: string | number, > accountingType?: string, > sic?: string | number, > financials?: { > balanceSheetDate?: string, > debtors?: number, > fixedAssets?: number, > currentAssets?: number, > creditors?: number > }[] > } > ``` > **Errors full type** > > ```ts theme={null} > { > Message: string, > Code: number > }[] > ``` *** ## Free ### lookup `free.lookup` Get technology group and category counts with last-updated dates for a domain **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.free.lookup({ lookup: 'builtwith.com' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lookup` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `first` | `number` | No | — | | `last` | `number` | No | — | | `groups` | `object[]` | No | — | > **groups full type** > > ```ts theme={null} > { > name: string, > live?: number | null, > dead?: number | null, > latest?: number | null, > oldest?: number | null, > categories?: { > name: string, > live?: number | null, > dead?: number | null, > latest?: number | null, > oldest?: number | null > }[] | null > }[] > ``` *** ## Lists ### getList `lists.getList` List websites using a technology, paginated with the NextOffset token **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.lists.getList({ tech: 'Shopify', country: 'US' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tech` | `string` | Yes | — | | `otherTechs` | `string[]` | No | — | | `all` | `boolean` | No | — | | `country` | `string` | No | — | | `meta` | `boolean` | No | — | | `offset` | `string` | No | — | | `since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `NextOffset` | `string` | No | — | | `Results` | `object[]` | No | — | | `Errors` | `object[]` | No | — | > **Results full type** > > ```ts theme={null} > { > D: string, > LOS?: string[], > FD?: number, > LD?: number, > S?: number, > SKU?: number, > R?: number, > F?: number, > E?: number, > A?: number, > Q?: number, > M?: number, > U?: number, > META?: { > CompanyName?: string | null, > City?: string | null, > Postcode?: string | null, > State?: string | null, > Country?: string | null, > Vertical?: string | null, > PrimaryBusiness?: string | null, > Telephones?: string[] | null, > Emails?: string[] | null, > Social?: string[] | null, > Titles?: string[] | null > } > }[] > ``` > **Errors full type** > > ```ts theme={null} > { > Message: string, > Code: number > }[] > ``` *** ## Mcp ### lookup `mcp.lookup` Search the BuiltWith registry of remote MCP servers by keyword or category **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.mcp.lookup({ search: 'payments' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `category` | `string` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > Domain?: string, > Category?: string, > Description?: string, > Endpoints?: { > Endpoint: string, > AuthRequired?: boolean, > Tools?: { > Name: string, > Description?: string > }[] > }[] > }[] > ``` *** ## Product ### lookup `product.lookup` Find eCommerce shops selling a product, or list a shop's products **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.product.lookup({ query: 'running shoes', limit: 10 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `is_more` | `boolean` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `results` | `number` | No | — | | `shop_count` | `number` | No | — | | `credits` | `number` | No | — | | `used` | `number` | No | — | | `remaining` | `number` | No | — | | `used_this_query` | `number` | No | — | | `next_page` | `string` | No | — | | `shops` | `object[]` | No | — | > **shops full type** > > ```ts theme={null} > { > Domain: string, > Products?: { > Title: string, > Url?: string, > Indexed?: string, > FirstIndexed?: string, > Price?: number > }[] > }[] > ``` *** ## Recommendations ### lookup `recommendations.lookup` Get technology recommendations for up to 16 domains **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.recommendations.lookup({ lookup: 'builtwith.com' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lookup` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Recommendations` | `object[]` | No | — | | `Errors` | `object[]` | No | — | > **Recommendations full type** > > ```ts theme={null} > { > Domain: string, > Compiled?: string, > Recommendations?: { > name: string, > link?: string, > tag?: string, > categories?: string[], > stars?: number, > match?: number > }[] > }[] > ``` > **Errors full type** > > ```ts theme={null} > { > Message: string, > Code: number > }[] > ``` *** ## Redirects ### lookup `redirects.lookup` Get live and historical inbound and outbound redirects for a domain **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.redirects.lookup({ lookup: 'builtwith.com' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lookup` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Lookup` | `string` | No | — | | `Inbound` | `object[]` | No | — | | `Outbound` | `object[]` | No | — | | `Errors` | `object[]` | No | — | > **Inbound full type** > > ```ts theme={null} > { > Domain: string, > FirstDetected?: string, > LastDetected?: string > }[] > ``` > **Outbound full type** > > ```ts theme={null} > { > Domain: string, > FirstDetected?: string, > LastDetected?: string > }[] > ``` > **Errors full type** > > ```ts theme={null} > { > Message: string, > Code: number > }[] > ``` *** ## Social ### lookup `social.lookup` Find root domains linked to social media profile URLs **Risk:** `read` ```ts theme={null} await corsair.builtwith.api.social.lookup({ lookup: 'twitter.com/builtwith' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lookup` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Socials` | `object[]` | No | — | | `Errors` | `object[]` | No | — | > **Socials full type** > > ```ts theme={null} > { > Name?: string, > Results?: { > SocialUrl: string, > Domains?: { > Root: string, > BuiltWithRank?: number > }[] > }[] > }[] > ``` > **Errors full type** > > ```ts theme={null} > { > Message: string, > Code: number > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/builtwith/database BuiltWith local sync: searchable entities, `.search()` filters, and operators. The BuiltWith plugin syncs data locally. Use `corsair.builtwith.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Company Financials Path: `builtwith.db.companyFinancials.search` ```ts theme={null} const rows = await corsair.builtwith.db.companyFinancials.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `companyName` | `string` | equals, contains, startsWith, endsWith, in | | `employees` | `number` | equals, gt, gte, lt, lte, in | | `followers` | `number` | equals, gt, gte, lt, lte, in | | `products` | `number` | equals, gt, gte, lt, lte, in | | `spend` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Domain Coverage Path: `builtwith.db.domainCoverage.search` ```ts theme={null} const rows = await corsair.builtwith.db.domainCoverage.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `first` | `number` | equals, gt, gte, lt, lte, in | | `last` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Domains Path: `builtwith.db.domains.search` ```ts theme={null} const rows = await corsair.builtwith.db.domains.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lookup` | `string` | equals, contains, startsWith, endsWith, in | | `isDb` | `string` | equals, contains, startsWith, endsWith, in | | `spend` | `number` | equals, gt, gte, lt, lte, in | | `salesRevenue` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Domain Technologies Path: `builtwith.db.domainTechnologies.search` ```ts theme={null} const rows = await corsair.builtwith.db.domainTechnologies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `subDomain` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `technologyId` | `number` | equals, gt, gte, lt, lte, in | | `parent` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `link` | `string` | equals, contains, startsWith, endsWith, in | | `confidence` | `number` | equals, gt, gte, lt, lte, in | | `isPremium` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## List Sites Path: `builtwith.db.listSites.search` ```ts theme={null} const rows = await corsair.builtwith.db.listSites.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `tech` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `firstDetected` | `number` | equals, gt, gte, lt, lte, in | | `lastDetected` | `number` | equals, gt, gte, lt, lte, in | | `monthlySpend` | `number` | equals, gt, gte, lt, lte, in | | `skuCount` | `number` | equals, gt, gte, lt, lte, in | | `salesRevenue` | `number` | equals, gt, gte, lt, lte, in | | `socialFollowers` | `number` | equals, gt, gte, lt, lte, in | | `employees` | `number` | equals, gt, gte, lt, lte, in | | `pageRank` | `number` | equals, gt, gte, lt, lte, in | | `trancoRank` | `number` | equals, gt, gte, lt, lte, in | | `majesticRank` | `number` | equals, gt, gte, lt, lte, in | | `umbrellaRank` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Mcp Servers Path: `builtwith.db.mcpServers.search` ```ts theme={null} const rows = await corsair.builtwith.db.mcpServers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Products Path: `builtwith.db.products.search` ```ts theme={null} const rows = await corsair.builtwith.db.products.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `shop` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `indexed` | `string` | equals, contains, startsWith, endsWith, in | | `firstIndexed` | `string` | equals, contains, startsWith, endsWith, in | | `price` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Recommendations Path: `builtwith.db.recommendations.search` ```ts theme={null} const rows = await corsair.builtwith.db.recommendations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `compiled` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `link` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `stars` | `number` | equals, gt, gte, lt, lte, in | | `match` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Redirects Path: `builtwith.db.redirects.search` ```ts theme={null} const rows = await corsair.builtwith.db.redirects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lookup` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `firstDetected` | `string` | equals, contains, startsWith, endsWith, in | | `lastDetected` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Social Links Path: `builtwith.db.socialLinks.search` ```ts theme={null} const rows = await corsair.builtwith.db.socialLinks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `socialUrl` | `string` | equals, contains, startsWith, endsWith, in | | `root` | `string` | equals, contains, startsWith, endsWith, in | | `builtWithRank` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Technologies Path: `builtwith.db.technologies.search` ```ts theme={null} const rows = await corsair.builtwith.db.technologies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `link` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | | `isPremium` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `trendsLink` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/builtwith/overview Web technology profiling for domains, technology adoption lists, trends, redirects, and company financials. Use **BuiltWith** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 11 typed API operations * 11 synced entities (`companyFinancials`, `domainCoverage`, `domains`, `domainTechnologies`, `listSites`, `mcpServers`, and 5 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/builtwith ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/builtwith ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/builtwith ``` ```bash bun theme={null} bun add corsair @corsair-dev/builtwith ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { builtwith } from '@corsair-dev/builtwith'; export const corsair = createCorsair({ plugins: [ builtwith(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} builtwith() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'builtwith', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Look up a domain's technology stack** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.builtwith.api.domain.lookup({ lookup: 'builtwith.com' }); ``` **`createDomainListFile`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.builtwith.api.createDomainListFile({}); ``` See the full list on the [API](/plugins/builtwith/api) page. ## Query synced data Synced entities support `tenant.builtwith.db..search()` and `.list()`: `companyFinancials`, `domainCoverage`, `domains`, `domainTechnologies`, `listSites`, `mcpServers`, `products`, `recommendations`, `redirects`, `socialLinks`, `technologies`. See [Database](/plugins/builtwith/database) for filters and operators. ## What's next > **[API reference](/plugins/builtwith/api)** > > Every `builtwith.api.*` operation with input and output types. > **[Database](/plugins/builtwith/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bunnycdn/api API reference for Bunnycdn: every `bunnycdn.api.*` operation with input and output types. Every `bunnycdn.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Api Keys ### list `apiKeys.list` List API keys on the account **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.apiKeys.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > Id?: string, > Key?: string, > DateCreated?: string > }[] | { > } > ``` *** ## Billing ### summary `billing.summary` Retrieve the billing summary for the account **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.billing.summary({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > PullZoneId?: number, > MonthlyUsage?: number, > MonthlyBandwidthUsed?: number > }[] > ``` *** ## Containers ### applicationsList `containers.applicationsList` List Magic Container applications **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.applicationsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextCursor` | `string` | No | — | | `limit` | `number` | No | — | **Output:** *empty object* *** ### configSuggestions `containers.configSuggestions` Get deployment configuration suggestions for a container image **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.configSuggestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `registryId` | `string \| number` | Yes | — | | `imageName` | `string` | Yes | — | | `imageNamespace` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output:** *empty object* *** ### imageDigest `containers.imageDigest` Get the digest of a container image **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.imageDigest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `registryId` | `string \| number` | Yes | — | | `imageName` | `string` | Yes | — | | `imageNamespace` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output:** *empty object* *** ### imageTags `containers.imageTags` List tags for a container image **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.imageTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `registryId` | `string \| number` | Yes | — | | `imageName` | `string` | Yes | — | | `imageNamespace` | `string` | Yes | — | **Output:** *empty object* *** ### nodesList `containers.nodesList` List Magic Container nodes **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.nodesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextCursor` | `string` | No | — | | `limit` | `number` | No | — | **Output:** *empty object* *** ### optimalBaseRegion `containers.optimalBaseRegion` Get the optimal base region for Magic Containers **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.optimalBaseRegion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cdnServerToken` | `string` | No | — | **Output:** *empty object* *** ### publicImagesSearch `containers.publicImagesSearch` Search public container images by prefix **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.publicImagesSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `registryId` | `string \| number` | Yes | — | | `prefix` | `string` | Yes | — | | `size` | `number` | No | — | | `page` | `number` | No | — | **Output:** *empty object* *** ### regionsList `containers.regionsList` List Magic Container regions **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.regionsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nextCursor` | `string` | No | — | | `limit` | `number` | No | — | **Output:** *empty object* *** ### registriesList `containers.registriesList` List container registries **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.registriesList({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### registryDelete `containers.registryDelete` Delete a container registry **Risk:** `destructive` ```ts theme={null} await corsair.bunnycdn.api.containers.registryDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `registryId` | `string \| number` | Yes | — | **Output:** *empty object* *** ### userLimits `containers.userLimits` Get Magic Container limits for the account **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.userLimits({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### volumesList `containers.volumesList` List volumes for a Magic Container application **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.containers.volumesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `appId` | `string` | Yes | — | **Output:** *empty object* *** ## Dns Zone ### checkAvailability `dnsZone.checkAvailability` Check whether a DNS zone name is available **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.dnsZone.checkAvailability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Available` | `boolean` | Yes | — | *** ### createRecord `dnsZone.createRecord` Create a new DNS record in a DNS zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.dnsZone.createRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zoneId` | `number` | Yes | — | | `record` | `object` | Yes | — | > **record full type** > > ```ts theme={null} > { > Type?: number, > Ttl?: number, > Value?: string, > Name?: string, > Weight?: number, > Priority?: number, > Flags?: number, > Tag?: string, > Port?: number, > PullZoneId?: number, > ScriptId?: number, > Accelerated?: boolean, > MonitorType?: number, > GeolocationLatitude?: number, > GeolocationLongitude?: number, > LatencyZone?: string, > SmartRoutingType?: number, > Disabled?: boolean, > EnviromentalVariables?: any[], > Comment?: string, > AutoSslIssuance?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `number` | No | — | | `Type` | `number` | No | — | | `Value` | `string` | No | — | | `Name` | `string` | No | — | | `Ttl` | `number` | No | — | *** ### deleteRecord `dnsZone.deleteRecord` Delete a DNS record **Risk:** `destructive` ```ts theme={null} await corsair.bunnycdn.api.dnsZone.deleteRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zoneId` | `number` | Yes | — | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `dnsZone.get` Get details of a specific DNS zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.dnsZone.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `number` | Yes | — | | `Domain` | `string` | No | — | *** ### list `dnsZone.list` List all DNS zones **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.dnsZone.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `search` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > Id: number, > Domain?: string > }[] | { > } > ``` *** ### updateRecord `dnsZone.updateRecord` Update an existing DNS record **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.dnsZone.updateRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zoneId` | `number` | Yes | — | | `id` | `number` | Yes | — | | `record` | `object` | Yes | — | > **record full type** > > ```ts theme={null} > { > Type?: number, > Ttl?: number, > Value?: string, > Name?: string, > Weight?: number, > Priority?: number, > Flags?: number, > Tag?: string, > Port?: number, > PullZoneId?: number, > ScriptId?: number, > Accelerated?: boolean, > MonitorType?: number, > GeolocationLatitude?: number, > GeolocationLongitude?: number, > LatencyZone?: string, > SmartRoutingType?: number, > Disabled?: boolean, > EnviromentalVariables?: any[], > Comment?: string, > AutoSslIssuance?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ## Edge Scripts ### list `edgeScripts.list` List all edge scripts **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.edgeScripts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `search` | `string` | No | — | | `includeLinkedPullzones` | `boolean` | No | — | | `integrationId` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ## Pull Zone ### addAllowedReferrer `pullZone.addAllowedReferrer` Add a hostname to the allowed referer list **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.addAllowedReferrer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `hostname` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### addBlockedIp `pullZone.addBlockedIp` Add an IP address to the blocked list **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.addBlockedIp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `blockedIp` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### addBlockedReferrer `pullZone.addBlockedReferrer` Add a blocked referer to a pull zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.addBlockedReferrer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `hostname` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### checkAvailability `pullZone.checkAvailability` Check whether a pull zone name is available **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.pullZone.checkAvailability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Available` | `boolean` | Yes | — | *** ### create `pullZone.create` Create a new pull zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `originUrl` | `string` | No | — | | `type` | `number` | No | — | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > OriginUrl?: string, > AllowedReferrers?: any[], > BlockedReferrers?: any[], > BlockNoneReferrer?: boolean, > BlockedIps?: any[], > EnableGeoZoneUS?: boolean, > EnableGeoZoneEU?: boolean, > EnableGeoZoneASIA?: boolean, > EnableGeoZoneSA?: boolean, > EnableGeoZoneAF?: boolean, > IpFamilyPolicy?: number, > BlockRootPathAccess?: boolean, > BlockPostRequests?: boolean, > EnableQueryStringOrdering?: boolean, > EnableWebpVary?: boolean, > EnableAvifVary?: boolean, > EnableMobileVary?: boolean, > EnableCountryCodeVary?: boolean, > EnableCountryStateCodeVary?: boolean, > EnableHostnameVary?: boolean, > EnableCacheSlice?: boolean, > ZoneSecurityEnabled?: boolean, > ZoneSecurityIncludeHashRemoteIP?: boolean, > IgnoreQueryStrings?: boolean, > MonthlyBandwidthLimit?: number, > AccessControlOriginHeaderExtensions?: any[], > EnableAccessControlOriginHeader?: boolean, > DisableCookies?: boolean, > BudgetRedirectedCountries?: any[], > BlockedCountries?: any[], > CacheControlMaxAgeOverride?: number, > CacheControlPublicMaxAgeOverride?: number, > CacheControlBrowserMaxAgeOverride?: number, > AddHostHeader?: boolean, > AddCanonicalHeader?: boolean, > EnableLogging?: boolean, > LoggingIPAnonymizationEnabled?: boolean, > PermaCacheStorageZoneId?: number, > PermaCacheType?: number, > AWSSigningEnabled?: boolean, > AWSSigningKey?: string, > AWSSigningRegionName?: string, > AWSSigningSecret?: string, > EnableOriginShield?: boolean, > OriginShieldZoneCode?: string, > EnableTLS1?: boolean, > EnableTLS1_1?: boolean, > TlsSecurityLevel?: number, > CacheErrorResponses?: boolean, > VerifyOriginSSL?: boolean, > LogForwardingEnabled?: boolean, > LogForwardingHostname?: string, > LogForwardingPort?: number, > LogForwardingToken?: string, > LogForwardingProtocol?: number, > LoggingSaveToStorage?: boolean, > LoggingStorageZoneId?: number, > FollowRedirects?: boolean, > ConnectionLimitPerIPCount?: number, > RequestLimit?: number, > LimitRateAfter?: number, > LimitRatePerSecond?: number, > BurstSize?: number, > ErrorPageEnableCustomCode?: boolean, > ErrorPageCustomCode?: string, > ErrorPageEnableStatuspageWidget?: boolean, > ErrorPageStatuspageCode?: string, > ErrorPageWhitelabel?: boolean, > OptimizerEnabled?: boolean, > OptimizerTunnelEnabled?: boolean, > OptimizerDesktopMaxWidth?: number, > OptimizerMobileMaxWidth?: number, > OptimizerImageQuality?: number, > OptimizerMobileImageQuality?: number, > OptimizerEnableWebP?: boolean, > OptimizerPrerenderHtml?: boolean, > OptimizerHtmlToMarkdown?: number, > OptimizerLlmsTxt?: boolean, > OptimizerEnableManipulationEngine?: boolean, > OptimizerMinifyCSS?: boolean, > OptimizerMinifyJavaScript?: boolean, > OptimizerWatermarkEnabled?: boolean, > OptimizerWatermarkUrl?: string, > OptimizerWatermarkPosition?: number, > OptimizerWatermarkOffset?: number, > OptimizerWatermarkMinImageSize?: number, > OptimizerAutomaticOptimizationEnabled?: boolean, > OptimizerClasses?: any[], > OptimizerForceClasses?: boolean, > OptimizerStaticHtmlEnabled?: boolean, > OptimizerStaticHtmlWordPressPath?: string, > OptimizerStaticHtmlWordPressBypassCookie?: string, > Type?: number, > OriginRetries?: number, > OriginConnectTimeout?: number, > OriginResponseTimeout?: number, > UseStaleWhileUpdating?: boolean, > UseStaleWhileOffline?: boolean, > OriginRetry5XXResponses?: boolean, > OriginRetryConnectionTimeout?: boolean, > OriginRetryResponseTimeout?: boolean, > OriginRetryDelay?: number, > DnsOriginPort?: number, > DnsOriginScheme?: string, > QueryStringVaryParameters?: any[], > OriginShieldEnableConcurrencyLimit?: boolean, > OriginShieldMaxConcurrentRequests?: number, > EnableCookieVary?: boolean, > CookieVaryParameters?: any[], > EnableSafeHop?: boolean, > OriginShieldQueueMaxWaitTime?: number, > OriginShieldMaxQueuedRequests?: number, > UseBackgroundUpdate?: boolean, > EnableAutoSSL?: boolean, > LogAnonymizationType?: number, > StorageZoneId?: number, > EdgeScriptId?: number, > MiddlewareScriptId?: number, > EdgeScriptExecutionPhase?: number, > OriginType?: number, > MagicContainersAppId?: string, > MagicContainersEndpointId?: string, > LogFormat?: number, > LogForwardingFormat?: number, > ShieldDDosProtectionType?: number, > ShieldDDosProtectionEnabled?: boolean, > OriginHostHeader?: string, > EnableSmartCache?: boolean, > EnableRequestCoalescing?: boolean, > RequestCoalescingTimeout?: number, > DisableLetsEncrypt?: boolean, > EnableBunnyImageAi?: boolean, > BunnyAiImageBlueprints?: any[], > PreloadingScreenEnabled?: boolean, > PreloadingScreenCode?: string, > PreloadingScreenLogoUrl?: string, > PreloadingScreenShowOnFirstVisit?: boolean, > PreloadingScreenTheme?: number, > PreloadingScreenCodeEnabled?: boolean, > PreloadingScreenDelay?: number, > RoutingFilters?: any[], > StickySessionType?: number, > StickySessionCookieName?: string, > StickySessionClientHeaders?: string, > OptimizerEnableUpscaling?: boolean, > EnableWebSockets?: boolean, > MaxWebSocketConnections?: number, > CacheKeyHeaders?: string, > LoadBalancerId?: number, > Name: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `number` | Yes | — | | `Name` | `string` | No | — | | `OriginUrl` | `string` | No | — | | `Enabled` | `boolean` | No | — | | `Suspended` | `boolean` | No | — | | `Hostnames` | `object[]` | No | — | | `StorageZoneId` | `number` | No | — | | `MonthlyBandwidthUsed` | `number` | No | — | | `MonthlyCharges` | `number` | No | — | > **Hostnames full type** > > ```ts theme={null} > { > Id?: number, > Value?: string | null, > ForceSSL?: boolean, > HasCertificate?: boolean > }[] > ``` *** ### edgeRuleDelete `pullZone.edgeRuleDelete` Delete an edge rule from a pull zone **Risk:** `destructive` ```ts theme={null} await corsair.bunnycdn.api.pullZone.edgeRuleDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pullZoneId` | `number` | Yes | — | | `edgeRuleId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### edgeRuleSetEnabled `pullZone.edgeRuleSetEnabled` Enable or disable an edge rule without deleting it **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.edgeRuleSetEnabled({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pullZoneId` | `number` | Yes | — | | `edgeRuleId` | `string \| number` | Yes | — | | `value` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### edgeRuleUpsert `pullZone.edgeRuleUpsert` Add or update an edge rule on a pull zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.edgeRuleUpsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pullZoneId` | `number` | Yes | — | | `rule` | `object` | Yes | — | > **rule full type** > > ```ts theme={null} > { > Guid?: string, > ActionType?: number, > ActionParameter1?: string, > ActionParameter2?: string, > Description?: string, > Enabled?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Guid` | `string` | No | — | | `ActionType` | `number` | No | — | | `ActionParameter1` | `string` | No | — | | `ActionParameter2` | `string` | No | — | | `Description` | `string` | No | — | | `Enabled` | `boolean` | No | — | *** ### get `pullZone.get` Get details of a specific pull zone by ID **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.pullZone.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `includeCertificate` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `number` | Yes | — | | `Name` | `string` | No | — | | `OriginUrl` | `string` | No | — | | `Enabled` | `boolean` | No | — | | `Suspended` | `boolean` | No | — | | `Hostnames` | `object[]` | No | — | | `StorageZoneId` | `number` | No | — | | `MonthlyBandwidthUsed` | `number` | No | — | | `MonthlyCharges` | `number` | No | — | > **Hostnames full type** > > ```ts theme={null} > { > Id?: number, > Value?: string | null, > ForceSSL?: boolean, > HasCertificate?: boolean > }[] > ``` *** ### list `pullZone.list` List pull zones with pagination and search **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.pullZone.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `search` | `string` | No | — | | `includeCertificate` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > Id: number, > Name?: string | null, > OriginUrl?: string | null, > Enabled?: boolean, > Suspended?: boolean, > Hostnames?: { > Id?: number, > Value?: string | null, > ForceSSL?: boolean, > HasCertificate?: boolean > }[] | null, > StorageZoneId?: number, > MonthlyBandwidthUsed?: number, > MonthlyCharges?: number > }[] | { > Items: { > Id: number, > Name?: string | null, > OriginUrl?: string | null, > Enabled?: boolean, > Suspended?: boolean, > Hostnames?: { > Id?: number, > Value?: string | null, > ForceSSL?: boolean, > HasCertificate?: boolean > }[] | null, > StorageZoneId?: number, > MonthlyBandwidthUsed?: number, > MonthlyCharges?: number > }[], > CurrentPage?: number, > TotalItems?: number, > HasMoreItems?: boolean > } > ``` *** ### optimizerStatistics `pullZone.optimizerStatistics` Retrieve optimizer statistics for a pull zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.pullZone.optimizerStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pullZoneId` | `number` | Yes | — | | `dateFrom` | `string` | No | — | | `dateTo` | `string` | No | — | | `hourly` | `boolean` | No | — | **Output:** *empty object* *** ### originShieldQueueStatistics `pullZone.originShieldQueueStatistics` Retrieve origin shield queue statistics for a pull zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.pullZone.originShieldQueueStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pullZoneId` | `number` | Yes | — | | `dateFrom` | `string` | No | — | | `dateTo` | `string` | No | — | | `hourly` | `boolean` | No | — | **Output:** *empty object* *** ### purgeCache `pullZone.purgeCache` Purge cached content for a pull zone, optionally by cache tag **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.purgeCache({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `cacheTag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### remove `pullZone.remove` Delete a specific pull zone by ID **Risk:** `destructive` ```ts theme={null} await corsair.bunnycdn.api.pullZone.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### removeAllowedReferrer `pullZone.removeAllowedReferrer` Remove a hostname from the allowed referer list **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.removeAllowedReferrer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `hostname` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### removeBlockedIp `pullZone.removeBlockedIp` Remove an IP address from the blocked list **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.removeBlockedIp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `blockedIp` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### removeBlockedReferrer `pullZone.removeBlockedReferrer` Remove a blocked referer from a pull zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.removeBlockedReferrer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `hostname` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### resetSecurityKey `pullZone.resetSecurityKey` Reset the URL token security key for a pull zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.resetSecurityKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `securityKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### safeHopStatistics `pullZone.safeHopStatistics` Retrieve SafeHop statistics for a pull zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.pullZone.safeHopStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pullZoneId` | `number` | Yes | — | | `dateFrom` | `string` | No | — | | `dateTo` | `string` | No | — | | `hourly` | `boolean` | No | — | **Output:** *empty object* *** ### setForceSSL `pullZone.setForceSSL` Enable or disable Force SSL on a pull zone hostname **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.setForceSSL({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `hostname` | `string` | Yes | — | | `forceSSL` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `pullZone.update` Update settings for a specific pull zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.pullZone.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `settings` | `object` | Yes | — | > **settings full type** > > ```ts theme={null} > { > OriginUrl?: string, > AllowedReferrers?: any[], > BlockedReferrers?: any[], > BlockNoneReferrer?: boolean, > BlockedIps?: any[], > EnableGeoZoneUS?: boolean, > EnableGeoZoneEU?: boolean, > EnableGeoZoneASIA?: boolean, > EnableGeoZoneSA?: boolean, > EnableGeoZoneAF?: boolean, > IpFamilyPolicy?: number, > BlockRootPathAccess?: boolean, > BlockPostRequests?: boolean, > EnableQueryStringOrdering?: boolean, > EnableWebpVary?: boolean, > EnableAvifVary?: boolean, > EnableMobileVary?: boolean, > EnableCountryCodeVary?: boolean, > EnableCountryStateCodeVary?: boolean, > EnableHostnameVary?: boolean, > EnableCacheSlice?: boolean, > ZoneSecurityEnabled?: boolean, > ZoneSecurityIncludeHashRemoteIP?: boolean, > IgnoreQueryStrings?: boolean, > MonthlyBandwidthLimit?: number, > AccessControlOriginHeaderExtensions?: any[], > EnableAccessControlOriginHeader?: boolean, > DisableCookies?: boolean, > BudgetRedirectedCountries?: any[], > BlockedCountries?: any[], > CacheControlMaxAgeOverride?: number, > CacheControlPublicMaxAgeOverride?: number, > CacheControlBrowserMaxAgeOverride?: number, > AddHostHeader?: boolean, > AddCanonicalHeader?: boolean, > EnableLogging?: boolean, > LoggingIPAnonymizationEnabled?: boolean, > PermaCacheStorageZoneId?: number, > PermaCacheType?: number, > AWSSigningEnabled?: boolean, > AWSSigningKey?: string, > AWSSigningRegionName?: string, > AWSSigningSecret?: string, > EnableOriginShield?: boolean, > OriginShieldZoneCode?: string, > EnableTLS1?: boolean, > EnableTLS1_1?: boolean, > TlsSecurityLevel?: number, > CacheErrorResponses?: boolean, > VerifyOriginSSL?: boolean, > LogForwardingEnabled?: boolean, > LogForwardingHostname?: string, > LogForwardingPort?: number, > LogForwardingToken?: string, > LogForwardingProtocol?: number, > LoggingSaveToStorage?: boolean, > LoggingStorageZoneId?: number, > FollowRedirects?: boolean, > ConnectionLimitPerIPCount?: number, > RequestLimit?: number, > LimitRateAfter?: number, > LimitRatePerSecond?: number, > BurstSize?: number, > ErrorPageEnableCustomCode?: boolean, > ErrorPageCustomCode?: string, > ErrorPageEnableStatuspageWidget?: boolean, > ErrorPageStatuspageCode?: string, > ErrorPageWhitelabel?: boolean, > OptimizerEnabled?: boolean, > OptimizerTunnelEnabled?: boolean, > OptimizerDesktopMaxWidth?: number, > OptimizerMobileMaxWidth?: number, > OptimizerImageQuality?: number, > OptimizerMobileImageQuality?: number, > OptimizerEnableWebP?: boolean, > OptimizerPrerenderHtml?: boolean, > OptimizerHtmlToMarkdown?: number, > OptimizerLlmsTxt?: boolean, > OptimizerEnableManipulationEngine?: boolean, > OptimizerMinifyCSS?: boolean, > OptimizerMinifyJavaScript?: boolean, > OptimizerWatermarkEnabled?: boolean, > OptimizerWatermarkUrl?: string, > OptimizerWatermarkPosition?: number, > OptimizerWatermarkOffset?: number, > OptimizerWatermarkMinImageSize?: number, > OptimizerAutomaticOptimizationEnabled?: boolean, > OptimizerClasses?: any[], > OptimizerForceClasses?: boolean, > OptimizerStaticHtmlEnabled?: boolean, > OptimizerStaticHtmlWordPressPath?: string, > OptimizerStaticHtmlWordPressBypassCookie?: string, > Type?: number, > OriginRetries?: number, > OriginConnectTimeout?: number, > OriginResponseTimeout?: number, > UseStaleWhileUpdating?: boolean, > UseStaleWhileOffline?: boolean, > OriginRetry5XXResponses?: boolean, > OriginRetryConnectionTimeout?: boolean, > OriginRetryResponseTimeout?: boolean, > OriginRetryDelay?: number, > DnsOriginPort?: number, > DnsOriginScheme?: string, > QueryStringVaryParameters?: any[], > OriginShieldEnableConcurrencyLimit?: boolean, > OriginShieldMaxConcurrentRequests?: number, > EnableCookieVary?: boolean, > CookieVaryParameters?: any[], > EnableSafeHop?: boolean, > OriginShieldQueueMaxWaitTime?: number, > OriginShieldMaxQueuedRequests?: number, > UseBackgroundUpdate?: boolean, > EnableAutoSSL?: boolean, > LogAnonymizationType?: number, > StorageZoneId?: number, > EdgeScriptId?: number, > MiddlewareScriptId?: number, > EdgeScriptExecutionPhase?: number, > OriginType?: number, > MagicContainersAppId?: string, > MagicContainersEndpointId?: string, > LogFormat?: number, > LogForwardingFormat?: number, > ShieldDDosProtectionType?: number, > ShieldDDosProtectionEnabled?: boolean, > OriginHostHeader?: string, > EnableSmartCache?: boolean, > EnableRequestCoalescing?: boolean, > RequestCoalescingTimeout?: number, > DisableLetsEncrypt?: boolean, > EnableBunnyImageAi?: boolean, > BunnyAiImageBlueprints?: any[], > PreloadingScreenEnabled?: boolean, > PreloadingScreenCode?: string, > PreloadingScreenLogoUrl?: string, > PreloadingScreenShowOnFirstVisit?: boolean, > PreloadingScreenTheme?: number, > PreloadingScreenCodeEnabled?: boolean, > PreloadingScreenDelay?: number, > RoutingFilters?: any[], > StickySessionType?: number, > StickySessionCookieName?: string, > StickySessionClientHeaders?: string, > OptimizerEnableUpscaling?: boolean, > EnableWebSockets?: boolean, > MaxWebSocketConnections?: number, > CacheKeyHeaders?: string, > LoadBalancerId?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `number` | Yes | — | | `Name` | `string` | No | — | | `OriginUrl` | `string` | No | — | | `Enabled` | `boolean` | No | — | | `Suspended` | `boolean` | No | — | | `Hostnames` | `object[]` | No | — | | `StorageZoneId` | `number` | No | — | | `MonthlyBandwidthUsed` | `number` | No | — | | `MonthlyCharges` | `number` | No | — | > **Hostnames full type** > > ```ts theme={null} > { > Id?: number, > Value?: string | null, > ForceSSL?: boolean, > HasCertificate?: boolean > }[] > ``` *** ## Purge ### url `purge.url` Purge a single URL from cache across pull zones **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.purge.url({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `async` | `boolean` | No | — | | `exactPath` | `boolean` | No | — | **Output:** `any` *** ## Search ### global `search.global` Global search across pull zones, storage zones, DNS zones and more **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.search.global({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `from` | `number` | No | — | | `size` | `number` | No | — | **Output:** *empty object* *** ## Shield ### accessListConfigUpdate `shield.accessListConfigUpdate` Update an access list configuration action or enabled state **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.shield.accessListConfigUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `id` | `number` | Yes | — | | `isEnabled` | `boolean` | No | — | | `action` | `number` | No | — | **Output:** *empty object* *** ### accessListCreate `shield.accessListCreate` Create a custom access list in a shield zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.shield.accessListCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `name` | `string` | Yes | — | | `type` | `string \| number` | Yes | — | | `content` | `string` | Yes | — | | `description` | `string` | No | — | | `checksum` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `type` | `any` | No | — | *** ### accessListEnums `shield.accessListEnums` List available access list configuration values **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.accessListEnums({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### accessListGet `shield.accessListGet` Get a custom access list by ID **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.accessListGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `type` | `any` | No | — | *** ### accessListsList `shield.accessListsList` List access lists for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.accessListsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### accessListUpdate `shield.accessListUpdate` Update a custom access list in a shield zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.shield.accessListUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `content` | `string` | No | — | | `checksum` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `type` | `any` | No | — | *** ### botDetectionGet `shield.botDetectionGet` Get the bot detection configuration for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.botDetectionGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### botDetectionUpdate `shield.botDetectionUpdate` Update the bot detection configuration for a shield zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.shield.botDetectionUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `executionMode` | `number` | No | — | **Output:** *empty object* *** ### ddosEnums `shield.ddosEnums` List available Shield DDoS configuration values **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.ddosEnums({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### eventLogs `shield.eventLogs` Get shield event logs for a zone and date with continuation token **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.eventLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `date` | `string` | Yes | — | | `continuationToken` | `string` | Yes | — | **Output:** *empty object* *** ### metricsBotDetection `shield.metricsBotDetection` Get bot detection metrics for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.metricsBotDetection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### metricsOverview `shield.metricsOverview` Get the security metrics overview for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.metricsOverview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### metricsOverviewDetailed `shield.metricsOverviewDetailed` Get detailed security metrics for a shield zone over a time range **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.metricsOverviewDetailed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `resolution` | `string \| number` | No | — | **Output:** *empty object* *** ### metricsRateLimit `shield.metricsRateLimit` Get metrics for a specific shield rate limit **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.metricsRateLimit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### metricsRateLimits `shield.metricsRateLimits` Get aggregated rate limit metrics for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.metricsRateLimits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### metricsUploadScanning `shield.metricsUploadScanning` Get upload scanning metrics for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.metricsUploadScanning({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### metricsWafRule `shield.metricsWafRule` Get metrics for a specific WAF rule **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.metricsWafRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `ruleId` | `string \| number` | Yes | — | **Output:** *empty object* *** ### promoState `shield.promoState` Get the shield promotional state for the account **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.promoState({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### rateLimitCreate `shield.rateLimitCreate` Create a shield rate limit rule **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.shield.rateLimitCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `ruleName` | `string` | No | — | | `ruleDescription` | `string` | No | — | | `ruleConfiguration` | `object` | No | — | > **ruleConfiguration full type** > > ```ts theme={null} > { > actionType?: number, > variableTypes?: { > }, > operatorType?: number, > severityType?: number, > transformationTypes?: any[], > value?: string, > isNegated?: boolean, > isRegexVariable?: boolean, > requestCount?: number, > counterKeyType?: number, > timeframe?: number, > blockTime?: number, > chainedRuleConditions?: any[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `shieldZoneId` | `number` | No | — | | `ruleName` | `string` | No | — | | `ruleDescription` | `string` | No | — | *** ### rateLimitDelete `shield.rateLimitDelete` Delete a shield rate limit rule **Risk:** `destructive` ```ts theme={null} await corsair.bunnycdn.api.shield.rateLimitDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### rateLimitGet `shield.rateLimitGet` Get a shield rate limit rule by ID **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.rateLimitGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `shieldZoneId` | `number` | No | — | | `ruleName` | `string` | No | — | | `ruleDescription` | `string` | No | — | *** ### rateLimitsList `shield.rateLimitsList` List rate limit rules for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.rateLimitsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output:** *empty object* *** ### rateLimitUpdate `shield.rateLimitUpdate` Update a shield rate limit rule **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.shield.rateLimitUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `ruleName` | `string` | No | — | | `ruleDescription` | `string` | No | — | | `ruleConfiguration` | `object` | No | — | > **ruleConfiguration full type** > > ```ts theme={null} > { > actionType?: number, > variableTypes?: { > }, > operatorType?: number, > severityType?: number, > transformationTypes?: any[], > value?: string, > isNegated?: boolean, > isRegexVariable?: boolean, > requestCount?: number, > counterKeyType?: number, > timeframe?: number, > blockTime?: number, > chainedRuleConditions?: any[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `shieldZoneId` | `number` | No | — | | `ruleName` | `string` | No | — | | `ruleDescription` | `string` | No | — | *** ### uploadScanningGet `shield.uploadScanningGet` Get the upload scanning configuration for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.uploadScanningGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### uploadScanningUpdate `shield.uploadScanningUpdate` Update the upload scanning configuration for a shield zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.shield.uploadScanningUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `isEnabled` | `boolean` | No | — | | `csamScanningMode` | `number` | No | — | | `antivirusScanningMode` | `number` | No | — | **Output:** *empty object* *** ### wafCustomRuleGet `shield.wafCustomRuleGet` Get a custom WAF rule by ID **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.wafCustomRuleGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** *empty object* *** ### wafCustomRulesList `shield.wafCustomRulesList` List custom WAF rules for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.wafCustomRulesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output:** *empty object* *** ### wafEngineConfig `shield.wafEngineConfig` Get the Shield WAF engine configuration **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.wafEngineConfig({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### wafEnums `shield.wafEnums` List available Shield WAF configuration values **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.wafEnums({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### wafProfiles `shield.wafProfiles` List available WAF security profiles **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.wafProfiles({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### wafRulesByZone `shield.wafRulesByZone` List WAF rules for a shield zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.wafRulesByZone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### wafRulesPlanSegmentation `shield.wafRulesPlanSegmentation` List WAF rules segmented by subscription plan **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.wafRulesPlanSegmentation({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### wafRulesReviewTriggered `shield.wafRulesReviewTriggered` List triggered WAF rules awaiting review **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.wafRulesReviewTriggered({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output:** *empty object* *** ### wafRulesReviewTriggeredPost `shield.wafRulesReviewTriggeredPost` Apply an action to a triggered WAF rule **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.shield.wafRulesReviewTriggeredPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `ruleId` | `string \| number` | No | — | | `action` | `string \| number` | No | — | **Output:** *empty object* *** ### zoneGet `shield.zoneGet` Get a shield zone configuration by ID **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.zoneGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `pullZoneId` | `number` | No | — | | `learningMode` | `boolean` | No | — | | `wafEnabled` | `boolean` | No | — | | `planType` | `number` | No | — | *** ### zoneGetByPullZone `shield.zoneGetByPullZone` Get the shield zone configuration for a pull zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.zoneGetByPullZone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pullZoneId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `pullZoneId` | `number` | No | — | | `learningMode` | `boolean` | No | — | | `wafEnabled` | `boolean` | No | — | | `planType` | `number` | No | — | *** ### zonesList `shield.zonesList` List all shield zones **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.zonesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output:** *empty object* *** ### zonesPullZoneMapping `shield.zonesPullZoneMapping` Get the mapping between shield zones and pull zones **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.shield.zonesPullZoneMapping({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### zoneUpdate `shield.zoneUpdate` Update a shield zone configuration **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.shield.zoneUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shieldZoneId` | `number` | Yes | — | | `shieldZone` | `object` | No | — | > **shieldZone full type** > > ```ts theme={null} > { > shieldZoneId?: number, > premiumPlan?: boolean, > planType?: number, > learningMode?: boolean, > learningModeUntil?: string, > wafEnabled?: boolean, > wafExecutionMode?: number, > wafDisabledRules?: any[], > wafLogOnlyRules?: any[], > wafCustomRuleOrder?: any[], > wafRequestHeaderLoggingEnabled?: boolean, > requestBodyLoggingEnabled?: boolean, > wafRequestIgnoredHeaders?: any[], > wafRealtimeThreatIntelligenceEnabled?: boolean, > wafProfileId?: number, > wafEngineConfig?: any[], > wafRequestBodyLimitAction?: number, > wafResponseBodyLimitAction?: number, > dDoSShieldSensitivity?: number, > dDoSChallengeWindow?: number, > whitelabelResponsePages?: boolean > } > ``` **Output:** *empty object* *** ## Statistics ### countries `statistics.countries` List countries supported by BunnyCDN **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.statistics.countries({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > Id?: number, > Name?: string, > IsoCode?: string > }[] > ``` *** ### get `statistics.get` Retrieve CDN bandwidth and request statistics **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.statistics.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dateFrom` | `string` | No | — | | `dateTo` | `string` | No | — | | `pullZone` | `number` | No | — | | `serverZoneId` | `number` | No | — | | `hourly` | `boolean` | No | — | | `exactRange` | `boolean` | No | — | | `loadErrors` | `boolean` | No | — | | `loadOriginResponseTimes` | `boolean` | No | — | | `loadOriginTraffic` | `boolean` | No | — | | `loadRequestsServed` | `boolean` | No | — | | `loadBandwidthUsed` | `boolean` | No | — | | `loadOriginShieldBandwidth` | `boolean` | No | — | | `loadGeographicTrafficDistribution` | `boolean` | No | — | | `loadUserBalanceHistory` | `boolean` | No | — | **Output:** *empty object* *** ### regions `statistics.regions` List BunnyCDN regions with pricing info **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.statistics.regions({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > Id?: number, > Name?: string, > RegionCode?: string > }[] > ``` *** ## Storage Zone ### checkAvailability `storageZone.checkAvailability` Check whether a storage zone name is available **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.storageZone.checkAvailability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Available` | `boolean` | Yes | — | *** ### create `storageZone.create` Create a new storage zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.storageZone.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `region` | `string` | Yes | — | | `details` | `object` | No | — | > **details full type** > > ```ts theme={null} > { > Name: string, > Region: string, > ReplicationRegions?: any[], > ZoneTier?: number, > StorageZoneType?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `number` | Yes | — | | `Name` | `string` | No | — | | `Region` | `string` | No | — | | `ZoneTier` | `number` | No | — | | `StorageZoneType` | `number` | No | — | | `Deleted` | `boolean` | No | — | *** ### get `storageZone.get` Get details of a specific storage zone **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.storageZone.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `number` | Yes | — | | `Name` | `string` | No | — | | `Region` | `string` | No | — | | `ZoneTier` | `number` | No | — | | `StorageZoneType` | `number` | No | — | | `Deleted` | `boolean` | No | — | *** ### list `storageZone.list` List all storage zones **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.storageZone.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `includeDeleted` | `boolean` | No | — | | `search` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > Id: number, > Name?: string, > Region?: string, > ZoneTier?: number, > StorageZoneType?: number, > Deleted?: boolean > }[] | { > } > ``` *** ### remove `storageZone.remove` Delete a storage zone and all of its data **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.bunnycdn.api.storageZone.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `deleteLinkedPullZones` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `storageZone.update` Update settings for a specific storage zone **Risk:** `write` ```ts theme={null} await corsair.bunnycdn.api.storageZone.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `settings` | `object` | Yes | — | > **settings full type** > > ```ts theme={null} > { > ReplicationZones?: any[], > OriginUrl?: string, > Custom404FilePath?: string, > Rewrite404To200?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ## Stream ### oembed `stream.oembed` Retrieve oEmbed metadata for a video embed **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.stream.oembed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `maxWidth` | `number` | No | — | | `maxHeight` | `number` | No | — | | `token` | `string` | No | — | | `expires` | `number` | No | — | **Output:** *empty object* *** ## User ### auditLog `user.auditLog` Retrieve user audit log entries for a date **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.user.auditLog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | Yes | — | | `product` | `string[]` | No | — | | `resourceType` | `string[]` | No | — | | `resourceId` | `string[]` | No | — | | `actorId` | `string[]` | No | — | | `order` | `string` | No | — | | `continuationToken` | `string` | No | — | | `limit` | `number` | No | — | **Output:** *empty object* *** ## Video Library ### languages `videoLibrary.languages` List languages supported by video libraries **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.videoLibrary.languages({}); ``` **Input:** *empty object* **Output:** `any[]` *** ### list `videoLibrary.list` List all video libraries **Risk:** `read` ```ts theme={null} await corsair.bunnycdn.api.videoLibrary.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `search` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > Id: number, > Name?: string > }[] | { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/bunnycdn/database Bunnycdn local sync: searchable entities, `.search()` filters, and operators. The Bunnycdn plugin syncs data locally. Use `corsair.bunnycdn.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/bunnycdn/overview Bunnycdn plugin for Corsair Use **Bunnycdn** through Corsair: one client, typed API calls. **What you get:** * 96 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bunnycdn ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bunnycdn ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bunnycdn ``` ```bash bun theme={null} bun add corsair @corsair-dev/bunnycdn ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bunnycdn } from '@corsair-dev/bunnycdn'; export const corsair = createCorsair({ plugins: [ bunnycdn(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bunnycdn() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bunnycdn', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`apiKeys.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bunnycdn.api.apiKeys.list({}); ``` **`containers.registryDelete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bunnycdn.api.containers.registryDelete({}); ``` See the full list on the [API](/plugins/bunnycdn/api) page. ## What's next > **[API reference](/plugins/bunnycdn/api)** > > Every `bunnycdn.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/bytedance/api API reference for Bytedance: every `bytedance.api.*` operation with input and output types. Every `bytedance.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Tasks ### delete `tasks.delete` Cancel a queued video task, or delete a finished task record **Risk:** `destructive` ```ts theme={null} await corsair.bytedance.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### get `tasks.get` Get a video generation task: status, video URL (valid 24h), and token usage **Risk:** `read` ```ts theme={null} await corsair.bytedance.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `model` | `string` | No | — | | `status` | `queued \| running \| cancelled \| succeeded \| failed \| expired` | Yes | — | | `content` | `object` | No | — | | `error` | `object` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `duration` | `number` | No | — | | `frames` | `number` | No | — | | `framespersecond` | `number` | No | — | | `generate_audio` | `boolean` | No | — | | `output_format` | `string` | No | — | | `priority` | `number` | No | — | | `ratio` | `string` | No | — | | `resolution` | `string` | No | — | | `seed` | `number` | No | — | | `service_tier` | `string` | No | — | | `execution_expires_after` | `number` | No | — | | `draft` | `boolean` | No | — | | `draft_task_id` | `string` | No | — | | `safety_identifier` | `string` | No | — | | `usage` | `object` | No | — | > **content full type** > > ```ts theme={null} > { > video_url?: string | null, > last_frame_url?: string | null > } > ``` > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **usage full type** > > ```ts theme={null} > { > completion_tokens?: number | null, > total_tokens?: number | null > } > ``` *** ### list `tasks.list` List video generation tasks from the past 7 days, filtered by status, model, or ids **Risk:** `read` ```ts theme={null} await corsair.bytedance.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_num` | `number` | No | — | | `page_size` | `number` | No | — | | `status` | `queued \| running \| cancelled \| succeeded \| failed` | No | — | | `task_ids` | `string[]` | No | — | | `model` | `string` | No | — | | `service_tier` | `default \| flex` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `total` | `number` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > model?: string | null, > status: queued | running | cancelled | succeeded | failed | expired, > content?: { > video_url?: string | null, > last_frame_url?: string | null > } | null, > error?: { > code: string, > message: string > } | null, > created_at?: number | null, > updated_at?: number | null, > duration?: number | null, > frames?: number | null, > framespersecond?: number | null, > generate_audio?: boolean | null, > output_format?: string | null, > priority?: number | null, > ratio?: string | null, > resolution?: string | null, > seed?: number | null, > service_tier?: string | null, > execution_expires_after?: number | null, > draft?: boolean | null, > draft_task_id?: string | null, > safety_identifier?: string | null, > usage?: { > completion_tokens?: number | null, > total_tokens?: number | null > } | null > }[] > ``` *** ## Video ### create `video.create` Start a Seedance video generation task from text, frames, or reference media; returns a task id **Risk:** `write` ```ts theme={null} await corsair.bytedance.api.video.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | Model ID (dreamina-seedance-2-5-260628, dreamina-seedance-2-0-260128, dreamina-seedance-2-0-fast-260128, dreamina-seedance-2-0-mini-260615, seedance-1-5-pro-251215, seedance-1-0-pro-250528, seedance-1-0-pro-fast-251015) or an inference endpoint ID | | `content` | `object[]` | Yes | — | | `omni_reference_task_type` | `auto \| reference \| edit \| extend` | No | — | | `resolution` | `480p \| 720p \| 1080p \| 4k` | No | — | | `ratio` | `16:9 \| 4:3 \| 1:1 \| 3:4 \| 9:16 \| 21:9 \| adaptive` | No | — | | `duration` | `-1 \| number` | No | — | | `frames` | `number` | No | — | | `generate_audio` | `boolean` | No | — | | `watermark` | `boolean` | No | — | | `output_format` | `mp4 \| mov` | No | — | | `seed` | `number` | No | — | | `camera_fixed` | `boolean` | No | — | | `return_last_frame` | `boolean` | No | — | | `draft` | `boolean` | No | — | | `service_tier` | `default \| flex` | No | — | | `callback_url` | `string` | No | — | | `execution_expires_after` | `number` | No | — | | `priority` | `number` | No | — | | `safety_identifier` | `string` | No | — | > **content full type** > > ```ts theme={null} > ( > { > type: text, > text: string > } | { > type: image_url, > image_url: { > url: string > }, > role?: first_frame | last_frame | reference_image > } | { > type: video_url, > video_url: { > url: string > }, > role: reference_video > } | { > type: audio_url, > audio_url: { > url: string > }, > role: reference_audio > } | { > type: draft_task, > draft_task: { > id: string > } > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/bytedance/database Bytedance local sync: searchable entities, `.search()` filters, and operators. The Bytedance plugin syncs data locally. Use `corsair.bytedance.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Video Tasks Path: `bytedance.db.videoTasks.search` ```ts theme={null} const rows = await corsair.bytedance.db.videoTasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `videoUrl` | `string` | equals, contains, startsWith, endsWith, in | | `lastFrameUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resolution` | `string` | equals, contains, startsWith, endsWith, in | | `ratio` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `totalTokens` | `number` | equals, gt, gte, lt, lte, in | | `errorCode` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/bytedance/overview Bytedance plugin for Corsair Use **Bytedance** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 1 synced entity (`videoTasks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/bytedance ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/bytedance ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/bytedance ``` ```bash bun theme={null} bun add corsair @corsair-dev/bytedance ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { bytedance } from '@corsair-dev/bytedance'; export const corsair = createCorsair({ plugins: [ bytedance(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} bytedance() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'bytedance', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`tasks.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bytedance.api.tasks.get({}); ``` **`tasks.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.bytedance.api.tasks.delete({}); ``` See the full list on the [API](/plugins/bytedance/api) page. ## Query synced data Synced entities support `tenant.bytedance.db..search()` and `.list()`: `videoTasks`. See [Database](/plugins/bytedance/database) for filters and operators. ## What's next > **[API reference](/plugins/bytedance/api)** > > Every `bytedance.api.*` operation with input and output types. > **[Database](/plugins/bytedance/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/byteforms/api API reference for ByteForms: every `byteforms.api.*` operation with input and output types. Every `byteforms.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Forms ### create `forms.create` Create a new ByteForms form with custom fields and options **Risk:** `write` ```ts theme={null} await corsair.byteforms.api.forms.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `object[]` | No | — | | `options` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > component: string, > type?: string, > label?: string, > id?: string, > required?: boolean, > placeholder?: string > }[] > ``` > **options full type** > > ```ts theme={null} > { > one_submission_per_email?: boolean, > thank_you_message?: string, > max_submissions?: number, > stop_submissions_after?: string | null, > submit_button_text?: string, > form_width?: string, > redirect_url?: string, > password?: string, > theme?: string, > visibility?: string, > page_behaviour?: string, > custom_code?: string, > draft_submissions?: boolean, > remove_branding?: boolean, > email_notifications?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `status` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > public_id: string, > name: string, > body: { > component: string, > type?: string, > label?: string, > id?: string, > required?: boolean, > placeholder?: string > }[], > pages?: any | null, > is_custom: boolean, > options: { > one_submission_per_email?: boolean, > thank_you_message?: string, > max_submissions?: number, > stop_submissions_after?: string | null, > submit_button_text?: string, > form_width?: string, > redirect_url?: string, > password?: string, > theme?: string, > visibility?: string, > page_behaviour?: string, > custom_code?: string, > draft_submissions?: boolean, > remove_branding?: boolean, > email_notifications?: boolean > }, > user_id: number, > created_at: string, > updated_at: string, > deleted_at?: string | null > } > ``` *** ### delete `forms.delete` Delete a ByteForms form by its numeric or public ID **Risk:** `destructive` ```ts theme={null} await corsair.byteforms.api.forms.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `boolean` | No | — | | `status` | `string` | Yes | — | *** ### get `forms.get` Retrieve a single ByteForms form definition by ID **Risk:** `read` ```ts theme={null} await corsair.byteforms.api.forms.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `status` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > public_id: string, > name: string, > body: { > component: string, > type?: string, > label?: string, > id?: string, > required?: boolean, > placeholder?: string > }[], > pages?: any | null, > is_custom: boolean, > options: { > one_submission_per_email?: boolean, > thank_you_message?: string, > max_submissions?: number, > stop_submissions_after?: string | null, > submit_button_text?: string, > form_width?: string, > redirect_url?: string, > password?: string, > theme?: string, > visibility?: string, > page_behaviour?: string, > custom_code?: string, > draft_submissions?: boolean, > remove_branding?: boolean, > email_notifications?: boolean > }, > user_id: number, > created_at: string, > updated_at: string, > deleted_at?: string | null > } > ``` *** ### list `forms.list` List all ByteForms forms created by the authenticated user **Risk:** `read` ```ts theme={null} await corsair.byteforms.api.forms.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `status` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > public_id: string, > name: string, > body: { > component: string, > type?: string, > label?: string, > id?: string, > required?: boolean, > placeholder?: string > }[], > pages?: any | null, > is_custom: boolean, > options: { > one_submission_per_email?: boolean, > thank_you_message?: string, > max_submissions?: number, > stop_submissions_after?: string | null, > submit_button_text?: string, > form_width?: string, > redirect_url?: string, > password?: string, > theme?: string, > visibility?: string, > page_behaviour?: string, > custom_code?: string, > draft_submissions?: boolean, > remove_branding?: boolean, > email_notifications?: boolean > }, > user_id: number, > created_at: string, > updated_at: string, > deleted_at?: string | null > }[] > ``` *** ### responses `forms.responses` Retrieve paginated responses submitted to a ByteForms form **Risk:** `read` ```ts theme={null} await corsair.byteforms.api.forms.responses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `query` | `string` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `cursor` | `object` | Yes | — | | `data` | `object` | Yes | — | | `status` | `string` | Yes | — | > **cursor full type** > > ```ts theme={null} > { > after?: string | null, > before?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > id: number, > form_id: number, > response: { > }, > options?: { > ip?: string > }, > created_at: string, > updated_at: string, > deleted_at?: string | null > }[] | null > ``` *** # Database Source: https://docs.corsair.dev/plugins/byteforms/database ByteForms local sync: searchable entities, `.search()` filters, and operators. The ByteForms plugin syncs data locally. Use `corsair.byteforms.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/byteforms/overview ByteForms plugin for Corsair Use **ByteForms** through Corsair: one client, typed API calls. **What you get:** * 5 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/byteforms ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/byteforms ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/byteforms ``` ```bash bun theme={null} bun add corsair @corsair-dev/byteforms ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { byteforms } from '@corsair-dev/byteforms'; export const corsair = createCorsair({ plugins: [ byteforms(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} byteforms() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'byteforms', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`forms.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.byteforms.api.forms.get({}); ``` **`forms.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.byteforms.api.forms.create({}); ``` See the full list on the [API](/plugins/byteforms/api) page. ## What's next > **[API reference](/plugins/byteforms/api)** > > Every `byteforms.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/cal/api API reference for Cal.com: every `cal.api.*` operation with input and output types. Every `cal.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Bookings ### cancel `bookings.cancel` Cancel a booking **Risk:** `destructive` ```ts theme={null} await corsair.cal.api.bookings.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `cancellationReason` | `string` | No | — | | `allRemainingBookings` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: number, > uid: string, > title?: string, > description?: string | null, > status: string, > start?: string, > end?: string, > duration?: number, > eventTypeId?: number, > eventType?: { > id: number, > slug?: string > }, > meetingUrl?: string | null, > location?: string | null, > absentHost?: boolean, > createdAt?: string, > updatedAt?: string, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone: string, > language?: string, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > guests?: string[], > metadata?: { > } | null, > bookingFieldsResponses?: { > } | null > } > ``` *** ### confirm `bookings.confirm` Confirm a pending booking **Risk:** `write` ```ts theme={null} await corsair.cal.api.bookings.confirm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: number, > uid: string, > title?: string, > description?: string | null, > status: string, > start?: string, > end?: string, > duration?: number, > eventTypeId?: number, > eventType?: { > id: number, > slug?: string > }, > meetingUrl?: string | null, > location?: string | null, > absentHost?: boolean, > createdAt?: string, > updatedAt?: string, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone: string, > language?: string, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > guests?: string[], > metadata?: { > } | null, > bookingFieldsResponses?: { > } | null > } > ``` *** ### create `bookings.create` Create a new booking **Risk:** `write` ```ts theme={null} await corsair.cal.api.bookings.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start` | `string` | Yes | — | | `eventTypeId` | `number` | Yes | — | | `attendee` | `object` | Yes | — | | `meetingUrl` | `string` | No | — | | `lengthInMinutes` | `number` | No | — | | `bookingFieldsResponses` | `object` | No | — | | `metadata` | `object` | No | — | > **attendee full type** > > ```ts theme={null} > { > name: string, > email: string, > timeZone: string > } > ``` > **bookingFieldsResponses full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: number, > uid: string, > title?: string, > description?: string | null, > status: string, > start?: string, > end?: string, > duration?: number, > eventTypeId?: number, > eventType?: { > id: number, > slug?: string > }, > meetingUrl?: string | null, > location?: string | null, > absentHost?: boolean, > createdAt?: string, > updatedAt?: string, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone: string, > language?: string, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > guests?: string[], > metadata?: { > } | null, > bookingFieldsResponses?: { > } | null > } > ``` *** ### decline `bookings.decline` Decline a pending booking **Risk:** `write` ```ts theme={null} await corsair.cal.api.bookings.decline({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `reason` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: number, > uid: string, > title?: string, > description?: string | null, > status: string, > start?: string, > end?: string, > duration?: number, > eventTypeId?: number, > eventType?: { > id: number, > slug?: string > }, > meetingUrl?: string | null, > location?: string | null, > absentHost?: boolean, > createdAt?: string, > updatedAt?: string, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone: string, > language?: string, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > guests?: string[], > metadata?: { > } | null, > bookingFieldsResponses?: { > } | null > } > ``` *** ### get `bookings.get` Get a booking by UID **Risk:** `read` ```ts theme={null} await corsair.cal.api.bookings.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: number, > uid: string, > title?: string, > description?: string | null, > status: string, > start?: string, > end?: string, > duration?: number, > eventTypeId?: number, > eventType?: { > id: number, > slug?: string > }, > meetingUrl?: string | null, > location?: string | null, > absentHost?: boolean, > createdAt?: string, > updatedAt?: string, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone: string, > language?: string, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > guests?: string[], > metadata?: { > } | null, > bookingFieldsResponses?: { > } | null > } > ``` *** ### list `bookings.list` List all bookings **Risk:** `read` ```ts theme={null} await corsair.cal.api.bookings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `upcoming \| recurring \| past \| cancelled \| unconfirmed` | No | — | | `attendeeEmail` | `string` | No | — | | `attendeeName` | `string` | No | — | | `eventTypeIds` | `string` | No | — | | `eventTypeId` | `number` | No | — | | `teamsIds` | `string` | No | — | | `teamId` | `number` | No | — | | `afterStart` | `string` | No | — | | `beforeEnd` | `string` | No | — | | `sortStart` | `asc \| desc` | No | — | | `sortEnd` | `asc \| desc` | No | — | | `sortCreated` | `asc \| desc` | No | — | | `take` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id: number, > uid: string, > title?: string, > description?: string | null, > status: string, > start?: string, > end?: string, > duration?: number, > eventTypeId?: number, > eventType?: { > id: number, > slug?: string > }, > meetingUrl?: string | null, > location?: string | null, > absentHost?: boolean, > createdAt?: string, > updatedAt?: string, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone: string, > language?: string, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > guests?: string[], > metadata?: { > } | null, > bookingFieldsResponses?: { > } | null > }[] > ``` *** ### reschedule `bookings.reschedule` Reschedule a booking to a new time **Risk:** `write` ```ts theme={null} await corsair.cal.api.bookings.reschedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `start` | `string` | Yes | — | | `rescheduledBy` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: number, > uid: string, > title?: string, > description?: string | null, > status: string, > start?: string, > end?: string, > duration?: number, > eventTypeId?: number, > eventType?: { > id: number, > slug?: string > }, > meetingUrl?: string | null, > location?: string | null, > absentHost?: boolean, > createdAt?: string, > updatedAt?: string, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone: string, > language?: string, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > guests?: string[], > metadata?: { > } | null, > bookingFieldsResponses?: { > } | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/cal/database Cal.com local sync: searchable entities, `.search()` filters, and operators. The Cal.com plugin syncs data locally. Use `corsair.cal.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Bookings Path: `cal.db.bookings.search` ```ts theme={null} const rows = await corsair.cal.db.bookings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `bookingId` | `number` | equals, gt, gte, lt, lte, in | | `uid` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `start` | `string` | equals, contains, startsWith, endsWith, in | | `startTime` | `string` | equals, contains, startsWith, endsWith, in | | `end` | `string` | equals, contains, startsWith, endsWith, in | | `endTime` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `length` | `number` | equals, gt, gte, lt, lte, in | | `eventTypeId` | `number` | equals, gt, gte, lt, lte, in | | `meetingUrl` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `cancellationReason` | `string` | equals, contains, startsWith, endsWith, in | | `reschedulingReason` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/cal/get-credentials Step-by-step instructions for obtaining a Cal.com API key for the Corsair Cal plugin. This guide walks you through obtaining all required credentials for the Cal.com (`cal`) plugin. ## Authentication Method The Cal plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) — Cal.com API key for server-to-server access ## API Key ### Step 1: Create an API Key in Cal.com 1. Log in to [Cal.com](https://cal.com). 2. Open **Settings** → **Developer** → **API keys** (wording may appear as **Developer** or **API** depending on your Cal.com version). 3. Click to create a new API key. 4. Give it a label (for example, `Corsair`) and confirm any scope or permission prompts. 5. Copy the key when it is shown — you typically cannot view it again after creation. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=cal api_key=your-cal-api-key ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=cal --credentials ``` ## Webhooks (Optional) If you use Cal.com webhooks, configure the signing or verification secret Cal provides for your webhook endpoint and store it as `webhook_signature` if your deployment verifies incoming requests with the value Corsair reads from the key store. ```bash theme={null} pnpm corsair setup --plugin=cal webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | API key | [`api_key`](/concepts/api-key) auth | Cal.com → Settings → Developer → API keys | | Webhook secret | Webhooks (if used) | Cal.com webhook / app settings | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/cal/overview Open scheduling platform for booking meetings, availability, and calendar integrations. Use **Cal.com** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 7 typed API operations * 1 synced entity (`bookings`) for fast `.search()` / `.list()` * 5 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cal ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cal ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cal ``` ```bash bun theme={null} bun add corsair @corsair-dev/cal ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cal } from '@corsair-dev/cal'; export const corsair = createCorsair({ plugins: [ cal(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/cal/get-credentials). ```ts theme={null} cal() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cal', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`bookings.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cal.api.bookings.get({}); ``` **`bookings.cancel`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cal.api.bookings.cancel({}); ``` See the full list on the [API](/plugins/cal/api) page. ## Query synced data Synced entities support `tenant.cal.db..search()` and `.list()`: `bookings`. See [Database](/plugins/cal/database) for filters and operators. ## Webhooks This plugin registers **5** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/cal/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/cal/api)** > > Every `cal.api.*` operation with input and output types. > **[Database](/plugins/cal/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/cal/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/cal/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/cal/webhooks Cal.com incoming webhooks: event paths, payloads, and response data. The Cal.com plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/cal/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `bookings` * `bookingCancelled` (`bookings.bookingCancelled`) * `bookingCreated` (`bookings.bookingCreated`) * `bookingRescheduled` (`bookings.bookingRescheduled`) * `meetingEnded` (`bookings.meetingEnded`) * `system` * `ping` (`system.ping`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Bookings ### Booking Cancelled `bookings.bookingCancelled` A booking was cancelled **Payload** | Name | Type | Required | Description | | - | - | - | - | | `triggerEvent` | `BOOKING_CANCELLED` | Yes | — | | `createdAt` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > bookingId?: number, > uid: string, > title?: string, > description?: string | null, > status?: string, > startTime?: string, > endTime?: string, > length?: number, > eventTypeId?: number, > meetingUrl?: string | null, > location?: string | null, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone?: string, > language?: { > }, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > metadata?: { > } | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > triggerEvent: BOOKING_CANCELLED, > createdAt: string, > payload: { > bookingId?: number, > uid: string, > title?: string, > description?: string | null, > status?: string, > startTime?: string, > endTime?: string, > length?: number, > eventTypeId?: number, > meetingUrl?: string | null, > location?: string | null, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone?: string, > language?: { > }, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > metadata?: { > } | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} cal({ webhookHooks: { bookings: { bookingCancelled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Booking Created `bookings.bookingCreated` A new booking was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `triggerEvent` | `BOOKING_CREATED` | Yes | — | | `createdAt` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > bookingId?: number, > uid: string, > title?: string, > description?: string | null, > status?: string, > startTime?: string, > endTime?: string, > length?: number, > eventTypeId?: number, > meetingUrl?: string | null, > location?: string | null, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone?: string, > language?: { > }, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > metadata?: { > } | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > triggerEvent: BOOKING_CREATED, > createdAt: string, > payload: { > bookingId?: number, > uid: string, > title?: string, > description?: string | null, > status?: string, > startTime?: string, > endTime?: string, > length?: number, > eventTypeId?: number, > meetingUrl?: string | null, > location?: string | null, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone?: string, > language?: { > }, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > metadata?: { > } | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} cal({ webhookHooks: { bookings: { bookingCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Booking Rescheduled `bookings.bookingRescheduled` A booking was rescheduled **Payload** | Name | Type | Required | Description | | - | - | - | - | | `triggerEvent` | `BOOKING_RESCHEDULED` | Yes | — | | `createdAt` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > bookingId?: number, > uid: string, > title?: string, > description?: string | null, > status?: string, > startTime?: string, > endTime?: string, > length?: number, > eventTypeId?: number, > meetingUrl?: string | null, > location?: string | null, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone?: string, > language?: { > }, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > metadata?: { > } | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > triggerEvent: BOOKING_RESCHEDULED, > createdAt: string, > payload: { > bookingId?: number, > uid: string, > title?: string, > description?: string | null, > status?: string, > startTime?: string, > endTime?: string, > length?: number, > eventTypeId?: number, > meetingUrl?: string | null, > location?: string | null, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone?: string, > language?: { > }, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > metadata?: { > } | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} cal({ webhookHooks: { bookings: { bookingRescheduled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Meeting Ended `bookings.meetingEnded` A meeting ended **Payload** | Name | Type | Required | Description | | - | - | - | - | | `triggerEvent` | `MEETING_ENDED` | Yes | — | | `createdAt` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > bookingId?: number, > uid: string, > title?: string, > description?: string | null, > status?: string, > startTime?: string, > endTime?: string, > length?: number, > eventTypeId?: number, > meetingUrl?: string | null, > location?: string | null, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone?: string, > language?: { > }, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > metadata?: { > } | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > triggerEvent: MEETING_ENDED, > createdAt: string, > payload: { > bookingId?: number, > uid: string, > title?: string, > description?: string | null, > status?: string, > startTime?: string, > endTime?: string, > length?: number, > eventTypeId?: number, > meetingUrl?: string | null, > location?: string | null, > cancellationReason?: string | null, > reschedulingReason?: string | null, > rescheduledFromUid?: string | null, > attendees?: { > name: string, > email: string, > timeZone?: string, > language?: { > }, > absent?: boolean > }[], > hosts?: { > id: number, > name: string, > email?: string, > username?: string, > timeZone?: string > }[], > metadata?: { > } | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} cal({ webhookHooks: { bookings: { meetingEnded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## System ### Ping `system.ping` Ping test to verify webhook endpoint **Payload** | Name | Type | Required | Description | | - | - | - | - | | `triggerEvent` | `PING` | Yes | — | | `createdAt` | `string` | No | — | | `payload` | `object` | No | — | > **payload full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > triggerEvent: PING, > createdAt?: string, > payload?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} cal({ webhookHooks: { system: { ping: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/calendly/api API reference for Calendly: every `calendly.api.*` operation with input and output types. Every `calendly.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Activity Log ### list `activityLog.list` List activity log entries for an organization **Risk:** `read` ```ts theme={null} await corsair.calendly.api.activityLog.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `string` | Yes | — | | `sort` | `string` | No | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | | `min_occurred_at` | `string` | No | — | | `max_occurred_at` | `string` | No | — | | `search_term` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri?: string, > action: string, > actor: { > }, > details: { > }, > organization: string, > occurred_at: string, > namespace?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ### listOutgoingCommunications `activityLog.listOutgoingCommunications` List outgoing communications for an organization **Risk:** `read` ```ts theme={null} await corsair.calendly.api.activityLog.listOutgoingCommunications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `string` | Yes | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri?: string, > channel?: string, > sent_at?: string, > status?: string, > to?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ## Event Types ### create `eventTypes.create` Create a new event type **Risk:** `write` ```ts theme={null} await corsair.calendly.api.eventTypes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `host` | `string` | Yes | — | | `co_hosts` | `string[]` | No | — | | `duration` | `number` | No | — | | `timezone` | `string` | No | — | | `date_setting` | `object` | No | — | | `location_configurations` | `object[]` | No | — | | `description_plain` | `string` | No | — | | `color` | `string` | No | — | | `slug` | `string` | No | — | > **date\_setting full type** > > ```ts theme={null} > { > type: string, > num_days?: number > } > ``` > **location\_configurations full type** > > ```ts theme={null} > { > kind: string, > location?: string, > additional_info?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > name: string, > active: boolean, > slug?: string, > scheduling_url: string, > duration: number, > duration_options?: number[] | null, > kind?: string, > pooling_type?: string | null, > type?: string, > color?: string, > created_at: string, > updated_at: string, > internal_note?: string | null, > description_plain?: string | null, > description_html?: string | null, > profile?: { > type: string, > name: string, > owner: string > }, > secret?: boolean, > booking_method?: string, > custom_questions?: { > name: string, > type: string, > position: number, > enabled: boolean, > required: boolean, > answer_choices?: string[], > include_other?: boolean > }[], > deleted_at?: string | null > } > ``` *** ### createOneOff `eventTypes.createOneOff` Create a one-off event type **Risk:** `write` ```ts theme={null} await corsair.calendly.api.eventTypes.createOneOff({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `host` | `string` | Yes | — | | `duration` | `number` | Yes | — | | `timezone` | `string` | Yes | — | | `date_setting` | `object` | Yes | — | | `location_configuration` | `object` | No | — | > **date\_setting full type** > > ```ts theme={null} > { > type: string, > start_date?: string, > end_date?: string > } > ``` > **location\_configuration full type** > > ```ts theme={null} > { > kind: string, > location?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > scheduling_url: string > } > ``` *** ### get `eventTypes.get` Get an event type by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.eventTypes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > name: string, > active: boolean, > slug?: string, > scheduling_url: string, > duration: number, > duration_options?: number[] | null, > kind?: string, > pooling_type?: string | null, > type?: string, > color?: string, > created_at: string, > updated_at: string, > internal_note?: string | null, > description_plain?: string | null, > description_html?: string | null, > profile?: { > type: string, > name: string, > owner: string > }, > secret?: boolean, > booking_method?: string, > custom_questions?: { > name: string, > type: string, > position: number, > enabled: boolean, > required: boolean, > answer_choices?: string[], > include_other?: boolean > }[], > deleted_at?: string | null > } > ``` *** ### list `eventTypes.list` List all event types **Risk:** `read` ```ts theme={null} await corsair.calendly.api.eventTypes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | | `organization` | `string` | No | — | | `active` | `boolean` | No | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | | `sort` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > name: string, > active: boolean, > slug?: string, > scheduling_url: string, > duration: number, > duration_options?: number[] | null, > kind?: string, > pooling_type?: string | null, > type?: string, > color?: string, > created_at: string, > updated_at: string, > internal_note?: string | null, > description_plain?: string | null, > description_html?: string | null, > profile?: { > type: string, > name: string, > owner: string > }, > secret?: boolean, > booking_method?: string, > custom_questions?: { > name: string, > type: string, > position: number, > enabled: boolean, > required: boolean, > answer_choices?: string[], > include_other?: boolean > }[], > deleted_at?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ### listAvailableTimes `eventTypes.listAvailableTimes` List available times for an event type **Risk:** `read` ```ts theme={null} await corsair.calendly.api.eventTypes.listAvailableTimes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `string` | Yes | — | | `start_time` | `string` | Yes | — | | `end_time` | `string` | Yes | — | | `timezone` | `string` | No | — | | `diagnostics` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | > **collection full type** > > ```ts theme={null} > { > status: string, > invitees_remaining: number, > start_time: string, > scheduling_url: string > }[] > ``` *** ### listHosts `eventTypes.listHosts` List hosts for an event type **Risk:** `read` ```ts theme={null} await corsair.calendly.api.eventTypes.listHosts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `string` | Yes | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > user?: string, > user_membership_uri?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ### update `eventTypes.update` Update an event type **Risk:** `write` ```ts theme={null} await corsair.calendly.api.eventTypes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `name` | `string` | No | — | | `description_plain` | `string` | No | — | | `color` | `string` | No | — | | `duration` | `number` | No | — | | `slug` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > name: string, > active: boolean, > slug?: string, > scheduling_url: string, > duration: number, > duration_options?: number[] | null, > kind?: string, > pooling_type?: string | null, > type?: string, > color?: string, > created_at: string, > updated_at: string, > internal_note?: string | null, > description_plain?: string | null, > description_html?: string | null, > profile?: { > type: string, > name: string, > owner: string > }, > secret?: boolean, > booking_method?: string, > custom_questions?: { > name: string, > type: string, > position: number, > enabled: boolean, > required: boolean, > answer_choices?: string[], > include_other?: boolean > }[], > deleted_at?: string | null > } > ``` *** ### updateAvailability `eventTypes.updateAvailability` Update availability for an event type **Risk:** `write` ```ts theme={null} await corsair.calendly.api.eventTypes.updateAvailability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `rules` | `object[]` | No | — | | `timezone` | `string` | No | — | > **rules full type** > > ```ts theme={null} > { > type: string, > wday?: string, > date?: string, > intervals: { > from: string, > to: string > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > user: string, > timezone: string, > rules?: { > }[] > } > ``` *** ## Groups ### get `groups.get` Get a group by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.groups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > name: string, > slug?: string, > organization: string, > user_count?: number, > scheduling_url?: string, > created_at?: string, > updated_at?: string > } > ``` *** ### getRelationship `groups.getRelationship` Get a group relationship by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.groups.getRelationship({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > type: string, > group: string, > user_or_event_type?: string, > managed_event_types?: string[] > } > ``` *** ### list `groups.list` List groups in an organization **Risk:** `read` ```ts theme={null} await corsair.calendly.api.groups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `string` | Yes | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | | `sort` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > name: string, > slug?: string, > organization: string, > user_count?: number, > scheduling_url?: string, > created_at?: string, > updated_at?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ### listRelationships `groups.listRelationships` List relationships for a group **Risk:** `read` ```ts theme={null} await corsair.calendly.api.groups.listRelationships({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group` | `string` | Yes | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > type: string, > group: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ## Invitees ### create `invitees.create` Create an invitee for a one-off event type **Risk:** `write` ```ts theme={null} await corsair.calendly.api.invitees.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_type_uuid` | `string` | Yes | — | | `email` | `string` | Yes | — | | `name` | `string` | No | — | | `timezone` | `string` | No | — | | `additional_guests` | `object[]` | No | — | | `questions_and_answers` | `object[]` | No | — | > **additional\_guests full type** > > ```ts theme={null} > { > email: string > }[] > ``` > **questions\_and\_answers full type** > > ```ts theme={null} > { > question: string, > answer: string, > position: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > email: string, > name: string, > status?: active | canceled, > questions_and_answers?: { > question: string, > answer: string, > position: number > }[], > timezone?: string, > event: string, > created_at: string, > updated_at: string, > tracking?: { > utm_campaign?: string | null, > utm_source?: string | null, > utm_medium?: string | null, > utm_content?: string | null, > utm_term?: string | null, > salesforce_uuid?: string | null > }, > text_reminder_number?: string | null, > rescheduled?: boolean, > old_invitee?: string | null, > new_invitee?: string | null, > cancel_url?: string, > reschedule_url?: string, > routing_form_submission?: string | null, > payment?: { > external_id: string, > provider: string, > amount: number, > currency: string, > terms: string, > successful: boolean > } | null, > no_show?: { > uri: string > } | null, > scheduling_method?: string | null, > invitee_scheduled_by?: string | null > } > ``` *** ### deleteData `invitees.deleteData` Delete all data for specified invitee emails **Risk:** `destructive` ```ts theme={null} await corsair.calendly.api.invitees.deleteData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `string[]` | Yes | — | **Output:** `any` *** ### deleteNoShow `invitees.deleteNoShow` Delete an invitee no-show record **Risk:** `destructive` ```ts theme={null} await corsair.calendly.api.invitees.deleteNoShow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output:** `any` *** ### get `invitees.get` Get an event invitee by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.invitees.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_uuid` | `string` | Yes | — | | `invitee_uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > email: string, > name: string, > status?: active | canceled, > questions_and_answers?: { > question: string, > answer: string, > position: number > }[], > timezone?: string, > event: string, > created_at: string, > updated_at: string, > tracking?: { > utm_campaign?: string | null, > utm_source?: string | null, > utm_medium?: string | null, > utm_content?: string | null, > utm_term?: string | null, > salesforce_uuid?: string | null > }, > text_reminder_number?: string | null, > rescheduled?: boolean, > old_invitee?: string | null, > new_invitee?: string | null, > cancel_url?: string, > reschedule_url?: string, > routing_form_submission?: string | null, > payment?: { > external_id: string, > provider: string, > amount: number, > currency: string, > terms: string, > successful: boolean > } | null, > no_show?: { > uri: string > } | null, > scheduling_method?: string | null, > invitee_scheduled_by?: string | null > } > ``` *** ### getNoShow `invitees.getNoShow` Get an invitee no-show record **Risk:** `read` ```ts theme={null} await corsair.calendly.api.invitees.getNoShow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > invitee: string, > created_at: string, > updated_at: string > } > ``` *** ### list `invitees.list` List invitees for a scheduled event **Risk:** `read` ```ts theme={null} await corsair.calendly.api.invitees.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_uuid` | `string` | Yes | — | | `status` | `active \| canceled` | No | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | | `sort` | `string` | No | — | | `email` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > email: string, > name: string, > status?: active | canceled, > questions_and_answers?: { > question: string, > answer: string, > position: number > }[], > timezone?: string, > event: string, > created_at: string, > updated_at: string, > tracking?: { > utm_campaign?: string | null, > utm_source?: string | null, > utm_medium?: string | null, > utm_content?: string | null, > utm_term?: string | null, > salesforce_uuid?: string | null > }, > text_reminder_number?: string | null, > rescheduled?: boolean, > old_invitee?: string | null, > new_invitee?: string | null, > cancel_url?: string, > reschedule_url?: string, > routing_form_submission?: string | null, > payment?: { > external_id: string, > provider: string, > amount: number, > currency: string, > terms: string, > successful: boolean > } | null, > no_show?: { > uri: string > } | null, > scheduling_method?: string | null, > invitee_scheduled_by?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ### markNoShow `invitees.markNoShow` Mark an invitee as a no-show **Risk:** `write` ```ts theme={null} await corsair.calendly.api.invitees.markNoShow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invitee` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > invitee: string, > created_at: string, > updated_at: string > } > ``` *** ## Organizations ### deleteMembership `organizations.deleteMembership` Delete an organization membership **Risk:** `destructive` ```ts theme={null} await corsair.calendly.api.organizations.deleteMembership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output:** `any` *** ### get `organizations.get` Get an organization by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.organizations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > stage?: string, > billing_email?: string, > plan?: string, > created_at?: string, > updated_at?: string > } > ``` *** ### getInvitation `organizations.getInvitation` Get an organization invitation **Risk:** `read` ```ts theme={null} await corsair.calendly.api.organizations.getInvitation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_uuid` | `string` | Yes | — | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > organization: string, > email: string, > status: string, > created_at: string, > updated_at: string, > last_sent_at?: string, > user?: string | null > } > ``` *** ### getMembership `organizations.getMembership` Get an organization membership **Risk:** `read` ```ts theme={null} await corsair.calendly.api.organizations.getMembership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > role: string, > user: { > uri: string, > name: string, > slug: string, > email: string, > scheduling_url: string, > timezone: string, > avatar_url?: string | null, > created_at: string, > updated_at: string, > current_organization?: string > }, > organization: string, > updated_at: string, > created_at: string > } > ``` *** ### invite `organizations.invite` Invite a user to an organization **Risk:** `write` ```ts theme={null} await corsair.calendly.api.organizations.invite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_uuid` | `string` | Yes | — | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > organization: string, > email: string, > status: string, > created_at: string, > updated_at: string, > last_sent_at?: string, > user?: string | null > } > ``` *** ### listInvitations `organizations.listInvitations` List organization invitations **Risk:** `read` ```ts theme={null} await corsair.calendly.api.organizations.listInvitations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_uuid` | `string` | Yes | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | | `email` | `string` | No | — | | `status` | `string` | No | — | | `sort` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > organization: string, > email: string, > status: string, > created_at: string, > updated_at: string, > last_sent_at?: string, > user?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ### listMemberships `organizations.listMemberships` List organization memberships **Risk:** `read` ```ts theme={null} await corsair.calendly.api.organizations.listMemberships({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `string` | No | — | | `user` | `string` | No | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | | `email` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > role: string, > user: { > uri: string, > name: string, > slug: string, > email: string, > scheduling_url: string, > timezone: string, > avatar_url?: string | null, > created_at: string, > updated_at: string, > current_organization?: string > }, > organization: string, > updated_at: string, > created_at: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ### removeMember `organizations.removeMember` Remove a user from the organization **Risk:** `destructive` ```ts theme={null} await corsair.calendly.api.organizations.removeMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output:** `any` *** ### revokeInvitation `organizations.revokeInvitation` Revoke a user's organization invitation **Risk:** `destructive` ```ts theme={null} await corsair.calendly.api.organizations.revokeInvitation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_uuid` | `string` | Yes | — | | `uuid` | `string` | Yes | — | **Output:** `any` *** ## Routing Forms ### get `routingForms.get` Get a routing form by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.routingForms.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > name: string, > organization: string, > status?: string, > created_at?: string, > updated_at?: string > } > ``` *** ### getSampleWebhookData `routingForms.getSampleWebhookData` Get sample webhook data for an event type **Risk:** `read` ```ts theme={null} await corsair.calendly.api.routingForms.getSampleWebhookData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `string` | Yes | — | | `scope` | `string` | Yes | — | | `event` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` *** ### getSubmission `routingForms.getSubmission` Get a routing form submission by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.routingForms.getSubmission({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > routing_form: string, > questions_and_answers?: { > }[], > tracking?: { > }, > created_at?: string, > updated_at?: string, > result?: { > } > } > ``` *** ### list `routingForms.list` List routing forms in an organization **Risk:** `read` ```ts theme={null} await corsair.calendly.api.routingForms.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `string` | Yes | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | | `sort` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > name: string, > organization: string, > status?: string, > created_at?: string, > updated_at?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ## Scheduled Events ### cancel `scheduledEvents.cancel` Cancel a scheduled event **Risk:** `destructive` ```ts theme={null} await corsair.calendly.api.scheduledEvents.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `reason` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > canceled_by?: string, > canceler_type?: string, > reason?: string > } > ``` *** ### deleteData `scheduledEvents.deleteData` Delete all scheduled event data in a time range **Risk:** `destructive` ```ts theme={null} await corsair.calendly.api.scheduledEvents.deleteData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `string` | Yes | — | | `end_time` | `string` | Yes | — | **Output:** `any` *** ### get `scheduledEvents.get` Get a scheduled event by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.scheduledEvents.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > name?: string, > status?: active | canceled, > start_time: string, > end_time: string, > event_type: string, > location?: { > type: string, > location?: string, > join_url?: string, > status?: string, > additional_info?: string > }, > invitees_counter?: { > total: number, > active: number, > limit: number > }, > created_at?: string, > updated_at?: string, > event_memberships?: { > user: string, > user_email?: string, > user_name?: string > }[], > event_guests?: { > email: string, > created_at: string, > updated_at: string > }[] > } > ``` *** ### list `scheduledEvents.list` List all scheduled events **Risk:** `read` ```ts theme={null} await corsair.calendly.api.scheduledEvents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | | `organization` | `string` | No | — | | `status` | `active \| canceled` | No | — | | `min_start_time` | `string` | No | — | | `max_start_time` | `string` | No | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | | `sort` | `string` | No | — | | `invitee_email` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > name?: string, > status?: active | canceled, > start_time: string, > end_time: string, > event_type: string, > location?: { > type: string, > location?: string, > join_url?: string, > status?: string, > additional_info?: string > }, > invitees_counter?: { > total: number, > active: number, > limit: number > }, > created_at?: string, > updated_at?: string, > event_memberships?: { > user: string, > user_email?: string, > user_name?: string > }[], > event_guests?: { > email: string, > created_at: string, > updated_at: string > }[] > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ## Scheduling Links ### create `schedulingLinks.create` Create a scheduling link **Risk:** `write` ```ts theme={null} await corsair.calendly.api.schedulingLinks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `max_event_count` | `number` | Yes | — | | `owner` | `string` | Yes | — | | `owner_type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > booking_url: string, > owner: string, > owner_type: string > } > ``` *** ### createShare `schedulingLinks.createShare` Create a share link for an event type **Risk:** `write` ```ts theme={null} await corsair.calendly.api.schedulingLinks.createShare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > booking_url?: string, > created_at?: string, > last_booking_at?: string | null, > event_type?: string > } > ``` *** ### createSingleUse `schedulingLinks.createSingleUse` Create a single-use scheduling link **Risk:** `write` ```ts theme={null} await corsair.calendly.api.schedulingLinks.createSingleUse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `max_event_count` | `number` | Yes | — | | `owner` | `string` | Yes | — | | `owner_type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > booking_url: string, > owner: string, > owner_type: string > } > ``` *** ## Users ### get `users.get` Get a user by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > name: string, > slug: string, > email: string, > scheduling_url: string, > timezone: string, > avatar_url?: string | null, > created_at: string, > updated_at: string, > current_organization?: string > } > ``` *** ### getAvailabilitySchedule `users.getAvailabilitySchedule` Get a user availability schedule **Risk:** `read` ```ts theme={null} await corsair.calendly.api.users.getAvailabilitySchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > default?: boolean, > name: string, > user: string, > timezone: string, > rules?: { > }[], > created_at?: string, > updated_at?: string > } > ``` *** ### getCurrent `users.getCurrent` Get the currently authenticated user (deprecated) **Risk:** `read` ```ts theme={null} await corsair.calendly.api.users.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > name: string, > slug: string, > email: string, > scheduling_url: string, > timezone: string, > avatar_url?: string | null, > created_at: string, > updated_at: string, > current_organization?: string > } > ``` *** ### listAvailabilitySchedules `users.listAvailabilitySchedules` List all availability schedules for a user **Risk:** `read` ```ts theme={null} await corsair.calendly.api.users.listAvailabilitySchedules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > default?: boolean, > name: string, > user: string, > timezone: string, > rules?: { > }[], > created_at?: string, > updated_at?: string > }[] > ``` *** ### listBusyTimes `users.listBusyTimes` List busy times for a user **Risk:** `read` ```ts theme={null} await corsair.calendly.api.users.listBusyTimes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | Yes | — | | `start_time` | `string` | Yes | — | | `end_time` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | > **collection full type** > > ```ts theme={null} > { > type: string, > start_time: string, > end_time: string, > buffered_start_time?: string, > buffered_end_time?: string, > event?: string | { > } | null > }[] > ``` *** ### listEventTypes `users.listEventTypes` List event types for a user (deprecated) **Risk:** `read` ```ts theme={null} await corsair.calendly.api.users.listEventTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | Yes | — | | `organization` | `string` | No | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | | `active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > name: string, > active: boolean, > slug?: string, > scheduling_url: string, > duration: number, > duration_options?: number[] | null, > kind?: string, > pooling_type?: string | null, > type?: string, > color?: string, > created_at: string, > updated_at: string, > internal_note?: string | null, > description_plain?: string | null, > description_html?: string | null, > profile?: { > type: string, > name: string, > owner: string > }, > secret?: boolean, > booking_method?: string, > custom_questions?: { > name: string, > type: string, > position: number, > enabled: boolean, > required: boolean, > answer_choices?: string[], > include_other?: boolean > }[], > deleted_at?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** ### listMeetingLocations `users.listMeetingLocations` List meeting locations for a user **Risk:** `read` ```ts theme={null} await corsair.calendly.api.users.listMeetingLocations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | > **collection full type** > > ```ts theme={null} > { > kind: string, > additional_info?: string, > location?: string > }[] > ``` *** ## Webhook Subscriptions ### create `webhookSubscriptions.create` Create a webhook subscription **Risk:** `write` ```ts theme={null} await corsair.calendly.api.webhookSubscriptions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `events` | `string[]` | Yes | — | | `organization` | `string` | Yes | — | | `scope` | `string` | Yes | — | | `user` | `string` | No | — | | `signature_secret` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > callback_url: string, > created_at: string, > updated_at: string, > retry_started_at?: string | null, > state: active | disabled, > events: string[], > scope: string, > organization: string, > user?: string | null, > creator: string > } > ``` *** ### delete `webhookSubscriptions.delete` Delete a webhook subscription **Risk:** `destructive` ```ts theme={null} await corsair.calendly.api.webhookSubscriptions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output:** `any` *** ### get `webhookSubscriptions.get` Get a webhook subscription by UUID **Risk:** `read` ```ts theme={null} await corsair.calendly.api.webhookSubscriptions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > uri: string, > callback_url: string, > created_at: string, > updated_at: string, > retry_started_at?: string | null, > state: active | disabled, > events: string[], > scope: string, > organization: string, > user?: string | null, > creator: string > } > ``` *** ### list `webhookSubscriptions.list` List webhook subscriptions **Risk:** `read` ```ts theme={null} await corsair.calendly.api.webhookSubscriptions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization` | `string` | Yes | — | | `scope` | `string` | Yes | — | | `user` | `string` | No | — | | `count` | `number` | No | — | | `page_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **collection full type** > > ```ts theme={null} > { > uri: string, > callback_url: string, > created_at: string, > updated_at: string, > retry_started_at?: string | null, > state: active | disabled, > events: string[], > scope: string, > organization: string, > user?: string | null, > creator: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count?: number, > next_page?: string | null, > previous_page?: string | null, > next_page_token?: string | null, > previous_page_token?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/calendly/database Calendly local sync: searchable entities, `.search()` filters, and operators. The Calendly plugin syncs data locally. Use `corsair.calendly.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Activity Log Entries Path: `calendly.db.activityLogEntries.search` ```ts theme={null} const rows = await corsair.calendly.db.activityLogEntries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `action` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `occurred_at` | `string` | equals, contains, startsWith, endsWith, in | | `namespace` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Event Types Path: `calendly.db.eventTypes.search` ```ts theme={null} const rows = await corsair.calendly.db.eventTypes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `scheduling_url` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `kind` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `description_plain` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Groups Path: `calendly.db.groups.search` ```ts theme={null} const rows = await corsair.calendly.db.groups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `user_count` | `number` | equals, gt, gte, lt, lte, in | | `scheduling_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invitees Path: `calendly.db.invitees.search` ```ts theme={null} const rows = await corsair.calendly.db.invitees.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `event` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Org Invitations Path: `calendly.db.orgInvitations.search` ```ts theme={null} const rows = await corsair.calendly.db.orgInvitations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `last_sent_at` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Org Memberships Path: `calendly.db.orgMemberships.search` ```ts theme={null} const rows = await corsair.calendly.db.orgMemberships.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `user_uri` | `string` | equals, contains, startsWith, endsWith, in | | `user_email` | `string` | equals, contains, startsWith, endsWith, in | | `user_name` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Outgoing Communications Path: `calendly.db.outgoingCommunications.search` ```ts theme={null} const rows = await corsair.calendly.db.outgoingCommunications.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `channel` | `string` | equals, contains, startsWith, endsWith, in | | `sent_at` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Routing Forms Path: `calendly.db.routingForms.search` ```ts theme={null} const rows = await corsair.calendly.db.routingForms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scheduled Events Path: `calendly.db.scheduledEvents.search` ```ts theme={null} const rows = await corsair.calendly.db.scheduledEvents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `start_time` | `string` | equals, contains, startsWith, endsWith, in | | `end_time` | `string` | equals, contains, startsWith, endsWith, in | | `event_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `calendly.db.users.search` ```ts theme={null} const rows = await corsair.calendly.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `scheduling_url` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhook Subscriptions Path: `calendly.db.webhookSubscriptions.search` ```ts theme={null} const rows = await corsair.calendly.db.webhookSubscriptions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `callback_url` | `string` | equals, contains, startsWith, endsWith, in | | `scope` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/calendly/get-credentials Step-by-step instructions for obtaining Calendly API credentials. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Personal access token ## Personal Access Token Setup ### Step 1: Get Your Personal Access Token 1. Log in to [Calendly](https://calendly.com) 2. Go to **Integrations** → **API & Webhooks** 3. Under **Personal Access Tokens**, click **Generate New Token** 4. Give it a name (e.g., "Corsair Integration") 5. Copy the token immediately — you won't be able to see it again 6. Store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=calendly api_key=your-personal-access-token ``` ## Webhook Setup (Optional) 1. In Calendly, go to **Integrations** → **API & Webhooks** → **Webhooks** 2. Create a new webhook subscription 3. Note the signing key provided ```bash theme={null} pnpm corsair setup --plugin=calendly webhook_signature=your-signing-key ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Personal Access Token | All API calls | Integrations → API & Webhooks → Personal Access Tokens | | Signing Key | Webhook verification | Integrations → API & Webhooks → Webhooks | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/calendly/overview Scheduling software for sharing booking links and automating meeting coordination. Use **Calendly** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 52 typed API operations * 11 synced entities (`activityLogEntries`, `eventTypes`, `groups`, `invitees`, `orgInvitations`, `orgMemberships`, and 5 more) for fast `.search()` / `.list()` * 6 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/calendly ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/calendly ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/calendly ``` ```bash bun theme={null} bun add corsair @corsair-dev/calendly ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { calendly } from '@corsair-dev/calendly'; export const corsair = createCorsair({ plugins: [ calendly(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/calendly/get-credentials). ```ts theme={null} calendly() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'calendly', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`activityLog.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.calendly.api.activityLog.list({}); ``` **`eventTypes.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.calendly.api.eventTypes.create({}); ``` See the full list on the [API](/plugins/calendly/api) page. ## Query synced data Synced entities support `tenant.calendly.db..search()` and `.list()`: `activityLogEntries`, `eventTypes`, `groups`, `invitees`, `orgInvitations`, `orgMemberships`, `outgoingCommunications`, `routingForms`, `scheduledEvents`, `users`, `webhookSubscriptions`. See [Database](/plugins/calendly/database) for filters and operators. ## Webhooks This plugin registers **6** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/calendly/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/calendly/api)** > > Every `calendly.api.*` operation with input and output types. > **[Database](/plugins/calendly/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/calendly/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/calendly/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/calendly/webhooks Calendly incoming webhooks: event paths, payloads, and response data. The Calendly plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/calendly/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `eventTypes` * `updated` (`eventTypes.updated`) * `invitees` * `canceled` (`invitees.canceled`) * `created` (`invitees.created`) * `noShow` (`invitees.noShow`) * `routingForms` * `submission` (`routingForms.submission`) * `users` * `updated` (`users.updated`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Event Types ### Updated `eventTypes.updated` An event type was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `event_type.updated` | Yes | — | | `time` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > uri: string, > name?: string, > active?: boolean, > slug?: string, > scheduling_url?: string, > duration?: number, > kind?: string, > color?: string, > updated_at?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: event_type.updated, > time: string, > payload: { > uri: string, > name?: string, > active?: boolean, > slug?: string, > scheduling_url?: string, > duration?: number, > kind?: string, > color?: string, > updated_at?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} calendly({ webhookHooks: { eventTypes: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Invitees ### Canceled `invitees.canceled` An invitee canceled a meeting **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `invitee.canceled` | Yes | — | | `time` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > uri: string, > email: string, > name: string, > status?: active | canceled, > event: string, > timezone?: string, > created_at: string, > updated_at: string, > cancel_url?: string, > reschedule_url?: string, > tracking?: { > }, > questions_and_answers?: { > }[], > payment?: { > } | null, > no_show?: { > uri: string > } | null, > rescheduled?: boolean, > old_invitee?: string | null, > new_invitee?: string | null, > routing_form_submission?: string | null, > scheduled_event?: { > uri: string, > name?: string, > status?: active | canceled, > start_time: string, > end_time: string, > event_type: string, > location?: { > type: string, > location?: string, > join_url?: string > }, > invitees_counter?: { > total: number, > active: number, > limit: number > }, > created_at?: string, > updated_at?: string, > event_memberships?: { > }[], > event_guests?: { > }[] > }, > invitee_scheduled_by?: string | null, > first_name?: string | null, > last_name?: string | null, > reconfirmation?: { > } | null, > scheduling_method?: string | null, > text_reminder_number?: string | null, > cancellation?: { > canceled_by: string, > reason?: string, > canceler_type: string > } | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: invitee.canceled, > time: string, > payload: { > uri: string, > email: string, > name: string, > status?: active | canceled, > event: string, > timezone?: string, > created_at: string, > updated_at: string, > cancel_url?: string, > reschedule_url?: string, > tracking?: { > }, > questions_and_answers?: { > }[], > payment?: { > } | null, > no_show?: { > uri: string > } | null, > rescheduled?: boolean, > old_invitee?: string | null, > new_invitee?: string | null, > routing_form_submission?: string | null, > scheduled_event?: { > uri: string, > name?: string, > status?: active | canceled, > start_time: string, > end_time: string, > event_type: string, > location?: { > type: string, > location?: string, > join_url?: string > }, > invitees_counter?: { > total: number, > active: number, > limit: number > }, > created_at?: string, > updated_at?: string, > event_memberships?: { > }[], > event_guests?: { > }[] > }, > invitee_scheduled_by?: string | null, > first_name?: string | null, > last_name?: string | null, > reconfirmation?: { > } | null, > scheduling_method?: string | null, > text_reminder_number?: string | null, > cancellation?: { > canceled_by: string, > reason?: string, > canceler_type: string > } | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} calendly({ webhookHooks: { invitees: { canceled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `invitees.created` An invitee booked a meeting **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `invitee.created` | Yes | — | | `time` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > uri: string, > email: string, > name: string, > status?: active | canceled, > event: string, > timezone?: string, > created_at: string, > updated_at: string, > cancel_url?: string, > reschedule_url?: string, > tracking?: { > }, > questions_and_answers?: { > }[], > payment?: { > } | null, > no_show?: { > uri: string > } | null, > rescheduled?: boolean, > old_invitee?: string | null, > new_invitee?: string | null, > routing_form_submission?: string | null, > scheduled_event?: { > uri: string, > name?: string, > status?: active | canceled, > start_time: string, > end_time: string, > event_type: string, > location?: { > type: string, > location?: string, > join_url?: string > }, > invitees_counter?: { > total: number, > active: number, > limit: number > }, > created_at?: string, > updated_at?: string, > event_memberships?: { > }[], > event_guests?: { > }[] > }, > invitee_scheduled_by?: string | null, > first_name?: string | null, > last_name?: string | null, > reconfirmation?: { > } | null, > scheduling_method?: string | null, > text_reminder_number?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: invitee.created, > time: string, > payload: { > uri: string, > email: string, > name: string, > status?: active | canceled, > event: string, > timezone?: string, > created_at: string, > updated_at: string, > cancel_url?: string, > reschedule_url?: string, > tracking?: { > }, > questions_and_answers?: { > }[], > payment?: { > } | null, > no_show?: { > uri: string > } | null, > rescheduled?: boolean, > old_invitee?: string | null, > new_invitee?: string | null, > routing_form_submission?: string | null, > scheduled_event?: { > uri: string, > name?: string, > status?: active | canceled, > start_time: string, > end_time: string, > event_type: string, > location?: { > type: string, > location?: string, > join_url?: string > }, > invitees_counter?: { > total: number, > active: number, > limit: number > }, > created_at?: string, > updated_at?: string, > event_memberships?: { > }[], > event_guests?: { > }[] > }, > invitee_scheduled_by?: string | null, > first_name?: string | null, > last_name?: string | null, > reconfirmation?: { > } | null, > scheduling_method?: string | null, > text_reminder_number?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} calendly({ webhookHooks: { invitees: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### No Show `invitees.noShow` An invitee was marked as a no-show **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `invitee_no_show.created` | Yes | — | | `time` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > uri: string, > invitee: string, > created_at: string, > updated_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: invitee_no_show.created, > time: string, > payload: { > uri: string, > invitee: string, > created_at: string, > updated_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} calendly({ webhookHooks: { invitees: { noShow: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Routing Forms ### Submission `routingForms.submission` A routing form submission was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `routing_form_submission.created` | Yes | — | | `time` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > uri: string, > routing_form: string, > questions_and_answers?: { > }[], > tracking?: { > }, > result?: { > }, > created_at?: string, > updated_at?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: routing_form_submission.created, > time: string, > payload: { > uri: string, > routing_form: string, > questions_and_answers?: { > }[], > tracking?: { > }, > result?: { > }, > created_at?: string, > updated_at?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} calendly({ webhookHooks: { routingForms: { submission: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Users ### Updated `users.updated` A user was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `user.updated` | Yes | — | | `time` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > uri: string, > name?: string, > email?: string, > slug?: string, > timezone?: string, > scheduling_url?: string, > updated_at?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: user.updated, > time: string, > payload: { > uri: string, > name?: string, > email?: string, > slug?: string, > timezone?: string, > scheduling_url?: string, > updated_at?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} calendly({ webhookHooks: { users: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/callingly/api API reference for Callingly: every `callingly.api.*` operation with input and output types. Every `callingly.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agents ### create `agents.create` Register a new agent in Callingly **Risk:** `write` ```ts theme={null} await corsair.callingly.api.agents.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fname` | `string` | Yes | — | | `lname` | `string` | Yes | — | | `phone_number` | `string` | Yes | — | | `ext` | `string` | No | — | | `timezone` | `string` | No | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | | `name` | `string` | No | — | | `fname` | `string` | No | — | | `lname` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `ext` | `string` | No | — | | `on_call_id` | `string \| number` | No | — | | `custom_id` | `string \| number` | No | — | | `fub_id` | `string \| number` | No | — | | `hubspot_id` | `string \| number` | No | — | | `donotdisturb` | `boolean \| number` | No | — | | `donotdisturb_until` | `string` | No | — | | `priority` | `number` | No | — | | `timezone` | `string` | No | — | | `is_available` | `boolean` | No | — | *** ### delete `agents.delete` Permanently delete an agent from a Callingly account **Risk:** `destructive` ```ts theme={null} await corsair.callingly.api.agents.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agentId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### getSchedule `agents.getSchedule` Retrieve the availability schedule for a specific agent **Risk:** `read` ```ts theme={null} await corsair.callingly.api.agents.getSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agentId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > label?: string, > day: number, > is_available: boolean, > times: { > start: string, > end: string > }[] > }[] > ``` *** ### list `agents.list` List all agents and users under the account **Risk:** `read` ```ts theme={null} await corsair.callingly.api.agents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string | number, > account_id?: string | number, > name?: string, > fname?: string, > lname?: string, > email?: string | null, > phone_number?: string, > ext?: string | null, > on_call_id?: string | number | null, > custom_id?: string | number | null, > fub_id?: string | number | null, > hubspot_id?: string | number | null, > donotdisturb?: boolean | number, > donotdisturb_until?: string | null, > priority?: number, > timezone?: string, > is_available?: boolean > }[] > ``` *** ### update `agents.update` Update agent information **Risk:** `write` ```ts theme={null} await corsair.callingly.api.agents.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agentId` | `string \| number` | Yes | — | | `fname` | `string` | No | — | | `lname` | `string` | No | — | | `phone_number` | `string` | No | — | | `ext` | `string` | No | — | | `timezone` | `string` | No | — | | `donotdisturb` | `0 \| 1` | No | — | | `donotdisturb_until` | `string` | No | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | | `name` | `string` | No | — | | `fname` | `string` | No | — | | `lname` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `ext` | `string` | No | — | | `on_call_id` | `string \| number` | No | — | | `custom_id` | `string \| number` | No | — | | `fub_id` | `string \| number` | No | — | | `hubspot_id` | `string \| number` | No | — | | `donotdisturb` | `boolean \| number` | No | — | | `donotdisturb_until` | `string` | No | — | | `priority` | `number` | No | — | | `timezone` | `string` | No | — | | `is_available` | `boolean` | No | — | *** ### updateSchedule `agents.updateSchedule` Update an agent availability schedule **Risk:** `write` ```ts theme={null} await corsair.callingly.api.agents.updateSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agentId` | `string \| number` | Yes | — | | `days` | `object[]` | Yes | — | | `account_id` | `string \| number` | No | — | > **days full type** > > ```ts theme={null} > { > label?: string, > day: number, > is_available: boolean, > times: { > start: string, > end: string > }[] > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > label?: string, > day: number, > is_available: boolean, > times: { > start: string, > end: string > }[] > }[] > ``` *** ## Calls ### create `calls.create` Initiate or trigger a new call to a lead **Risk:** `write` ```ts theme={null} await corsair.callingly.api.calls.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string \| number` | Yes | — | | `phone_number` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `company` | `string` | No | — | | `category` | `string` | No | — | | `source` | `string` | No | — | | `crm_id` | `string \| number` | No | — | | `scheduled_at` | `string` | No | Schedule the call instead of dialing now (YYYY-MM-DD HH:MM:SS) | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `started_at` | `string` | No | — | | `direction` | `string` | No | — | | `status` | `string` | No | — | | `status_formatted` | `string` | No | — | | `lead_status` | `string` | No | — | | `lead_status_formatted` | `string` | No | — | | `ring_status` | `string` | No | — | | `seconds` | `number` | No | — | | `duration` | `string` | No | — | | `retry` | `number` | No | — | | `lead_retry` | `number` | No | — | | `time_formatted` | `string` | No | — | | `from_formatted` | `string` | No | — | | `source` | `string` | No | — | | `recording_url` | `string` | No | — | | `waveform_url` | `string` | No | — | | `error_message` | `string` | No | — | | `phone_number_formatted` | `string` | No | — | | `human_result` | `string` | No | — | | `user` | `object[]` | No | — | | `member` | `object[]` | No | — | | `lead` | `object[]` | No | — | | `profile` | `object[]` | No | — | | `is_voicemail` | `number` | No | — | | `is_queue` | `number` | No | — | | `is_team_offline` | `number` | No | — | | `scheduled_call_type` | `string` | No | — | | `old_lead_owner_id` | `string \| number` | No | — | | `transcript` | `string` | No | — | | `is_error` | `number` | No | — | | `error_code` | `string` | No | — | | `call_id` | `string \| number` | No | — | > **user full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > fname?: string, > lname?: string, > email?: string, > phone_number?: string > } | never[] > ``` > **member full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > fname?: string, > lname?: string, > email?: string, > phone_number?: string > } | never[] > ``` > **lead full type** > > ```ts theme={null} > { > id: string | number, > name?: string | null, > label?: string | null, > fname?: string | null, > lname?: string | null, > email?: string | null, > phone_number?: string | null, > phone_number_formatted?: string | null, > source?: string | null, > crm?: string | null, > source_id?: string | number | null, > deleted_at?: string | null > } | never[] > ``` > **profile full type** > > ```ts theme={null} > { > id?: string | number, > name?: string > } | never[] > ``` *** ### get `calls.get` Retrieve call details, duration, and recording by ID **Risk:** `read` ```ts theme={null} await corsair.callingly.api.calls.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `callId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `started_at` | `string` | No | — | | `direction` | `string` | No | — | | `status` | `string` | No | — | | `status_formatted` | `string` | No | — | | `lead_status` | `string` | No | — | | `lead_status_formatted` | `string` | No | — | | `ring_status` | `string` | No | — | | `seconds` | `number` | No | — | | `duration` | `string` | No | — | | `retry` | `number` | No | — | | `lead_retry` | `number` | No | — | | `time_formatted` | `string` | No | — | | `from_formatted` | `string` | No | — | | `source` | `string` | No | — | | `recording_url` | `string` | No | — | | `waveform_url` | `string` | No | — | | `error_message` | `string` | No | — | | `phone_number_formatted` | `string` | No | — | | `human_result` | `string` | No | — | | `user` | `object[]` | No | — | | `member` | `object[]` | No | — | | `lead` | `object[]` | No | — | | `profile` | `object[]` | No | — | | `is_voicemail` | `number` | No | — | | `is_queue` | `number` | No | — | | `is_team_offline` | `number` | No | — | | `scheduled_call_type` | `string` | No | — | | `old_lead_owner_id` | `string \| number` | No | — | | `transcript` | `string` | No | — | | `is_error` | `number` | No | — | | `error_code` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > fname?: string, > lname?: string, > email?: string, > phone_number?: string > } | never[] > ``` > **member full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > fname?: string, > lname?: string, > email?: string, > phone_number?: string > } | never[] > ``` > **lead full type** > > ```ts theme={null} > { > id: string | number, > name?: string | null, > label?: string | null, > fname?: string | null, > lname?: string | null, > email?: string | null, > phone_number?: string | null, > phone_number_formatted?: string | null, > source?: string | null, > crm?: string | null, > source_id?: string | number | null, > deleted_at?: string | null > } | never[] > ``` > **profile full type** > > ```ts theme={null} > { > id?: string | number, > name?: string > } | never[] > ``` *** ### list `calls.list` List call history with optional date range, team, and paging filters **Risk:** `read` ```ts theme={null} await corsair.callingly.api.calls.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start` | `string` | No | — | | `end` | `string` | No | — | | `team_id` | `string \| number` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string | number, > started_at?: string, > direction?: string, > status?: string | null, > status_formatted?: string, > lead_status?: string | null, > lead_status_formatted?: string, > ring_status?: string, > seconds?: number, > duration?: string, > retry?: number, > lead_retry?: number, > time_formatted?: string, > from_formatted?: string, > source?: string | null, > recording_url?: string | null, > waveform_url?: string | null, > error_message?: string | null, > phone_number_formatted?: string, > human_result?: string | null, > user?: { > id: string | number, > name?: string, > fname?: string, > lname?: string, > email?: string, > phone_number?: string > } | never[] | null, > member?: { > id: string | number, > name?: string, > fname?: string, > lname?: string, > email?: string, > phone_number?: string > } | never[] | null, > lead?: { > id: string | number, > name?: string | null, > label?: string | null, > fname?: string | null, > lname?: string | null, > email?: string | null, > phone_number?: string | null, > phone_number_formatted?: string | null, > source?: string | null, > crm?: string | null, > source_id?: string | number | null, > deleted_at?: string | null > } | never[] | null, > profile?: { > id?: string | number, > name?: string > } | never[] | null, > is_voicemail?: number, > is_queue?: number, > is_team_offline?: number, > scheduled_call_type?: string | null, > old_lead_owner_id?: string | number | null, > transcript?: string | null, > is_error?: number, > error_code?: string > }[] > ``` *** ## Clients ### activateDeactivate `clients.activateDeactivate` Activate or deactivate a client account **Risk:** `write` ```ts theme={null} await corsair.callingly.api.clients.activateDeactivate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string \| number` | Yes | — | | `is_active` | `0 \| 1` | Yes | 1 activates calling for the client, 0 deactivates it | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### create `clients.create` Create a new agency client account **Risk:** `write` ```ts theme={null} await corsair.callingly.api.clients.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fname` | `string` | Yes | — | | `lname` | `string` | Yes | — | | `company` | `string` | Yes | — | | `email` | `string` | Yes | — | | `phone_number` | `string` | Yes | — | | `password` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `billing_email` | `string` | No | — | | `is_active` | `boolean \| number` | No | — | | `billed_users` | `number` | No | — | | `billed_numbers` | `number` | No | — | *** ### delete `clients.delete` Delete an agency client account by ID **Risk:** `destructive` ```ts theme={null} await corsair.callingly.api.clients.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### list `clients.list` List agency client accounts **Risk:** `read` ```ts theme={null} await corsair.callingly.api.clients.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > email?: string, > billing_email?: string, > is_active?: boolean | number, > billed_users?: number, > billed_numbers?: number > }[] > ``` *** ## Leads ### delete `leads.delete` Delete a lead by ID **Risk:** `destructive` ```ts theme={null} await corsair.callingly.api.leads.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### get `leads.get` Retrieve lead details by ID **Risk:** `read` ```ts theme={null} await corsair.callingly.api.leads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | | `lead_owner_id` | `string \| number` | No | — | | `fname` | `string` | No | — | | `lname` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `source` | `string` | No | — | | `source_id` | `string \| number` | No | — | | `created_at` | `string` | No | — | | `company` | `string` | No | — | | `category` | `string` | No | — | | `status` | `string` | No | — | | `result` | `string` | No | — | | `team` | `object` | No | — | | `tags` | `object[]` | No | — | | `stage` | `string` | No | — | | `calls` | `object[]` | No | — | | `scheduled_call_at` | `string` | No | — | | `lead_owner` | `object` | No | — | | `is_stopped` | `number` | No | — | | `is_blocked` | `number` | No | — | > **team full type** > > ```ts theme={null} > { > id?: string | number, > name?: string > } > ``` > **tags full type** > > ```ts theme={null} > ( > string | { > id?: string | number, > name?: string > } > )[] > ``` > **calls full type** > > ```ts theme={null} > { > id: string | number, > source?: string | null, > seconds?: number, > direction?: string, > status?: string | null, > result?: string | null, > agent_retry?: number, > lead_retry?: number, > started_at?: string, > recording_url?: string | null > }[] > ``` > **lead\_owner full type** > > ```ts theme={null} > { > name?: string | null, > phone_number?: string | null, > custom_id?: string | number | null > } > ``` *** ### list `leads.list` List leads with optional date range and phone number filters **Risk:** `read` ```ts theme={null} await corsair.callingly.api.leads.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start` | `string` | No | — | | `end` | `string` | No | — | | `phone_number` | `string` | No | — | | `account_id` | `string \| number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > account_id?: string | number, > lead_owner_id?: string | number | null, > fname?: string | null, > lname?: string | null, > email?: string | null, > phone_number?: string | null, > source?: string | null, > source_id?: string | number | null, > created_at?: string, > company?: string | null, > category?: string | null, > status?: string | null, > result?: string | null, > team?: { > id?: string | number, > name?: string > } | null, > tags?: ( > string | { > id?: string | number, > name?: string > } > )[], > stage?: string | null, > calls?: { > id: string | number, > source?: string | null, > seconds?: number, > direction?: string, > status?: string | null, > result?: string | null, > agent_retry?: number, > lead_retry?: number, > started_at?: string, > recording_url?: string | null > }[], > scheduled_call_at?: string | null, > lead_owner?: { > name?: string | null, > phone_number?: string | null, > custom_id?: string | number | null > } | null, > is_stopped?: number, > is_blocked?: number > }[] > ``` *** ### update `leads.update` Update lead contact details and assignments **Risk:** `write` ```ts theme={null} await corsair.callingly.api.leads.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `string \| number` | Yes | — | | `fname` | `string` | No | — | | `lname` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `source` | `string` | No | — | | `company` | `string` | No | — | | `status` | `string` | No | — | | `result` | `string` | No | — | | `stage` | `string` | No | — | | `is_stopped` | `0 \| 1` | No | — | | `is_blocked` | `0 \| 1` | No | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | | `lead_owner_id` | `string \| number` | No | — | | `fname` | `string` | No | — | | `lname` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `source` | `string` | No | — | | `source_id` | `string \| number` | No | — | | `created_at` | `string` | No | — | | `company` | `string` | No | — | | `category` | `string` | No | — | | `status` | `string` | No | — | | `result` | `string` | No | — | | `team` | `object` | No | — | | `tags` | `object[]` | No | — | | `stage` | `string` | No | — | | `calls` | `object[]` | No | — | | `scheduled_call_at` | `string` | No | — | | `lead_owner` | `object` | No | — | | `is_stopped` | `number` | No | — | | `is_blocked` | `number` | No | — | > **team full type** > > ```ts theme={null} > { > id?: string | number, > name?: string > } > ``` > **tags full type** > > ```ts theme={null} > ( > string | { > id?: string | number, > name?: string > } > )[] > ``` > **calls full type** > > ```ts theme={null} > { > id: string | number, > source?: string | null, > seconds?: number, > direction?: string, > status?: string | null, > result?: string | null, > agent_retry?: number, > lead_retry?: number, > started_at?: string, > recording_url?: string | null > }[] > ``` > **lead\_owner full type** > > ```ts theme={null} > { > name?: string | null, > phone_number?: string | null, > custom_id?: string | number | null > } > ``` *** ## Teams ### create `teams.create` Create a new team in Callingly **Risk:** `write` ```ts theme={null} await corsair.callingly.api.teams.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `is_record` | `0 \| 1` | No | — | | `call_mode` | `string` | No | — | | `whispertext` | `string` | No | — | | `language` | `string` | No | — | | `delay` | `number` | No | — | | `is_retry` | `0 \| 1` | No | — | | `retries` | `number` | No | — | | `retry_schedule` | `number[]` | No | — | | `is_reschedule` | `0 \| 1` | No | — | | `is_retry_lead` | `0 \| 1` | No | — | | `lead_retries` | `number` | No | — | | `lead_retry_schedule` | `number[]` | No | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | | `name` | `string` | Yes | — | | `is_record` | `boolean \| number` | No | — | | `call_mode` | `string` | No | — | | `whispertext` | `string` | No | — | | `post_whispertext` | `string` | No | — | | `language` | `string` | No | — | | `delay` | `number` | No | — | | `is_retry` | `boolean \| number` | No | — | | `retries` | `number` | No | — | | `retry_schedule` | `object[]` | No | — | | `is_reschedule` | `boolean \| number` | No | — | | `is_retry_lead` | `boolean \| number` | No | — | | `lead_retries` | `number` | No | — | | `lead_retry_schedule` | `object[]` | No | — | | `is_sms` | `boolean \| number` | No | — | | `sms_body` | `string` | No | — | | `whispertext_voice` | `string` | No | — | | `is_users_available_for_call` | `boolean` | No | — | > **retry\_schedule full type** > > ```ts theme={null} > ( > number | { > unit: string, > value: number > } > )[] > ``` > **lead\_retry\_schedule full type** > > ```ts theme={null} > ( > number | { > unit: string, > value: number > } > )[] > ``` *** ### get `teams.get` Retrieve team details by ID **Risk:** `read` ```ts theme={null} await corsair.callingly.api.teams.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | | `name` | `string` | Yes | — | | `is_record` | `boolean \| number` | No | — | | `call_mode` | `string` | No | — | | `whispertext` | `string` | No | — | | `post_whispertext` | `string` | No | — | | `language` | `string` | No | — | | `delay` | `number` | No | — | | `is_retry` | `boolean \| number` | No | — | | `retries` | `number` | No | — | | `retry_schedule` | `object[]` | No | — | | `is_reschedule` | `boolean \| number` | No | — | | `is_retry_lead` | `boolean \| number` | No | — | | `lead_retries` | `number` | No | — | | `lead_retry_schedule` | `object[]` | No | — | | `is_sms` | `boolean \| number` | No | — | | `sms_body` | `string` | No | — | | `whispertext_voice` | `string` | No | — | | `is_users_available_for_call` | `boolean` | No | — | > **retry\_schedule full type** > > ```ts theme={null} > ( > number | { > unit: string, > value: number > } > )[] > ``` > **lead\_retry\_schedule full type** > > ```ts theme={null} > ( > number | { > unit: string, > value: number > } > )[] > ``` *** ### list `teams.list` List teams in the Callingly account **Risk:** `read` ```ts theme={null} await corsair.callingly.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string | number, > account_id?: string | number, > name: string, > is_record?: boolean | number, > call_mode?: string, > whispertext?: string, > post_whispertext?: string, > language?: string, > delay?: number, > is_retry?: boolean | number, > retries?: number, > retry_schedule?: ( > number | { > unit: string, > value: number > } > )[], > is_reschedule?: boolean | number, > is_retry_lead?: boolean | number, > lead_retries?: number, > lead_retry_schedule?: ( > number | { > unit: string, > value: number > } > )[], > is_sms?: boolean | number, > sms_body?: string, > whispertext_voice?: string, > is_users_available_for_call?: boolean > }[] > ``` *** ### listUsers `teams.listUsers` Retrieve all agents assigned to a specific team **Risk:** `read` ```ts theme={null} await corsair.callingly.api.teams.listUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `agents` | `object[]` | Yes | — | > **agents full type** > > ```ts theme={null} > { > id: string | number, > team_id?: string | number, > name?: string, > custom_id?: string | number | null, > fub_id?: string | number | null, > priority?: number, > cap?: number | null > }[] > ``` *** ### removeAgent `teams.removeAgent` Remove a specific agent from a team **Risk:** `destructive` ```ts theme={null} await corsair.callingly.api.teams.removeAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string \| number` | Yes | — | | `agentId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### updateAgentSettings `teams.updateAgentSettings` Update priority and capacity settings for a team agent **Risk:** `write` ```ts theme={null} await corsair.callingly.api.teams.updateAgentSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string \| number` | Yes | — | | `agentId` | `string \| number` | Yes | — | | `priority` | `number` | No | — | | `cap` | `number` | No | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `team_id` | `string \| number` | No | — | | `name` | `string` | No | — | | `custom_id` | `string \| number` | No | — | | `fub_id` | `string \| number` | No | — | | `priority` | `number` | No | — | | `cap` | `number` | No | — | *** ### updateUsers `teams.updateUsers` Update the list of agents assigned to a team **Risk:** `write` ```ts theme={null} await corsair.callingly.api.teams.updateUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string \| number` | Yes | — | | `agents` | `(string \| number)[]` | Yes | Agent ids that replace every current team assignment | | `account_id` | `string \| number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > agents: { > id: string | number, > team_id?: string | number, > name?: string, > custom_id?: string | number | null, > fub_id?: string | number | null, > priority?: number, > cap?: number | null > }[] > } | { > success?: boolean, > message?: string > } > ``` *** ## Webhooks ### create `webhooks.create` Create a new webhook for call or lead events **Risk:** `write` ```ts theme={null} await corsair.callingly.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `event` | `call_completed \| lead_created \| lead_updated` | Yes | — | | `target_url` | `string` | Yes | — | | `call_direction` | `outbound \| inbound` | No | call\_completed only | | `call_status` | `completed \| missed \| offline` | No | call\_completed only | | `call_lead_status` | `contacted \| missed \| removed \| voicemail` | No | call\_completed only | | `team_id` | `string \| number` | No | Outbound call\_completed only | | `number_id` | `string \| number` | No | Inbound call\_completed only | | `field` | `lead_owner \| result \| stage \| status \| tags` | No | lead\_created / lead\_updated only: trigger when this field changes | | `filter` | `string` | No | lead\_created / lead\_updated only: required value of `field` | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | | `name` | `string` | No | — | | `event` | `string` | No | — | | `target_url` | `string` | No | — | | `direction` | `string` | No | — | | `call_direction` | `string` | No | — | | `call_status` | `string` | No | — | | `call_lead_status` | `string` | No | — | | `team_id` | `string \| number` | No | — | | `number_id` | `string \| number` | No | — | | `field` | `string` | No | — | | `filter` | `string` | No | — | | `is_active` | `boolean \| number` | No | — | | `consecutive_failures` | `number` | No | — | | `last_failed_at` | `string` | No | — | | `is_auto_disabled` | `boolean \| number` | No | — | *** ### delete `webhooks.delete` Delete a webhook by ID **Risk:** `destructive` ```ts theme={null} await corsair.callingly.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### get `webhooks.get` Retrieve details of a specific webhook by ID **Risk:** `read` ```ts theme={null} await corsair.callingly.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | | `name` | `string` | No | — | | `event` | `string` | No | — | | `target_url` | `string` | No | — | | `direction` | `string` | No | — | | `call_direction` | `string` | No | — | | `call_status` | `string` | No | — | | `call_lead_status` | `string` | No | — | | `team_id` | `string \| number` | No | — | | `number_id` | `string \| number` | No | — | | `field` | `string` | No | — | | `filter` | `string` | No | — | | `is_active` | `boolean \| number` | No | — | | `consecutive_failures` | `number` | No | — | | `last_failed_at` | `string` | No | — | | `is_auto_disabled` | `boolean \| number` | No | — | *** ### list `webhooks.list` List configured webhooks **Risk:** `read` ```ts theme={null} await corsair.callingly.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string \| number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > account_id?: string | number, > name?: string, > event?: string, > target_url?: string, > direction?: string | null, > call_direction?: string | null, > call_status?: string | null, > call_lead_status?: string | null, > team_id?: string | number | null, > number_id?: string | number | null, > field?: string | null, > filter?: string | null, > is_active?: boolean | number, > consecutive_failures?: number, > last_failed_at?: string | null, > is_auto_disabled?: boolean | number > }[] > ``` *** ### update `webhooks.update` Update an existing webhook configuration by ID **Risk:** `write` ```ts theme={null} await corsair.callingly.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `event` | `call_completed \| lead_created \| lead_updated` | No | — | | `target_url` | `string` | No | — | | `call_direction` | `outbound \| inbound` | No | call\_completed only | | `call_status` | `completed \| missed \| offline` | No | call\_completed only | | `call_lead_status` | `contacted \| missed \| removed \| voicemail` | No | call\_completed only | | `team_id` | `string \| number` | No | Outbound call\_completed only | | `number_id` | `string \| number` | No | Inbound call\_completed only | | `field` | `lead_owner \| result \| stage \| status \| tags` | No | lead\_created / lead\_updated only: trigger when this field changes | | `filter` | `string` | No | lead\_created / lead\_updated only: required value of `field` | | `account_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `account_id` | `string \| number` | No | — | | `name` | `string` | No | — | | `event` | `string` | No | — | | `target_url` | `string` | No | — | | `direction` | `string` | No | — | | `call_direction` | `string` | No | — | | `call_status` | `string` | No | — | | `call_lead_status` | `string` | No | — | | `team_id` | `string \| number` | No | — | | `number_id` | `string \| number` | No | — | | `field` | `string` | No | — | | `filter` | `string` | No | — | | `is_active` | `boolean \| number` | No | — | | `consecutive_failures` | `number` | No | — | | `last_failed_at` | `string` | No | — | | `is_auto_disabled` | `boolean \| number` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/callingly/database Callingly local sync: searchable entities, `.search()` filters, and operators. The Callingly plugin syncs data locally. Use `corsair.callingly.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Calls Path: `callingly.db.calls.search` ```ts theme={null} const rows = await corsair.callingly.db.calls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `started_at` | `string` | equals, contains, startsWith, endsWith, in | | `direction` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `status_formatted` | `string` | equals, contains, startsWith, endsWith, in | | `lead_status` | `string` | equals, contains, startsWith, endsWith, in | | `lead_status_formatted` | `string` | equals, contains, startsWith, endsWith, in | | `ring_status` | `string` | equals, contains, startsWith, endsWith, in | | `seconds` | `number` | equals, gt, gte, lt, lte, in | | `duration` | `string` | equals, contains, startsWith, endsWith, in | | `retry` | `number` | equals, gt, gte, lt, lte, in | | `lead_retry` | `number` | equals, gt, gte, lt, lte, in | | `time_formatted` | `string` | equals, contains, startsWith, endsWith, in | | `from_formatted` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `recording_url` | `string` | equals, contains, startsWith, endsWith, in | | `waveform_url` | `string` | equals, contains, startsWith, endsWith, in | | `error_message` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number_formatted` | `string` | equals, contains, startsWith, endsWith, in | | `human_result` | `string` | equals, contains, startsWith, endsWith, in | | `is_voicemail` | `number` | equals, gt, gte, lt, lte, in | | `is_queue` | `number` | equals, gt, gte, lt, lte, in | | `is_team_offline` | `number` | equals, gt, gte, lt, lte, in | | `scheduled_call_type` | `string` | equals, contains, startsWith, endsWith, in | | `transcript` | `string` | equals, contains, startsWith, endsWith, in | | `is_error` | `number` | equals, gt, gte, lt, lte, in | | `error_code` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Clients Path: `callingly.db.clients.search` ```ts theme={null} const rows = await corsair.callingly.db.clients.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `billing_email` | `string` | equals, contains, startsWith, endsWith, in | | `billed_users` | `number` | equals, gt, gte, lt, lte, in | | `billed_numbers` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Leads Path: `callingly.db.leads.search` ```ts theme={null} const rows = await corsair.callingly.db.leads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `fname` | `string` | equals, contains, startsWith, endsWith, in | | `lname` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `result` | `string` | equals, contains, startsWith, endsWith, in | | `stage` | `string` | equals, contains, startsWith, endsWith, in | | `scheduled_call_at` | `string` | equals, contains, startsWith, endsWith, in | | `is_stopped` | `number` | equals, gt, gte, lt, lte, in | | `is_blocked` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Schedules Path: `callingly.db.schedules.search` ```ts theme={null} const rows = await corsair.callingly.db.schedules.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `callingly.db.teams.search` ```ts theme={null} const rows = await corsair.callingly.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `call_mode` | `string` | equals, contains, startsWith, endsWith, in | | `whispertext` | `string` | equals, contains, startsWith, endsWith, in | | `post_whispertext` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `delay` | `number` | equals, gt, gte, lt, lte, in | | `retries` | `number` | equals, gt, gte, lt, lte, in | | `lead_retries` | `number` | equals, gt, gte, lt, lte, in | | `sms_body` | `string` | equals, contains, startsWith, endsWith, in | | `whispertext_voice` | `string` | equals, contains, startsWith, endsWith, in | | `is_users_available_for_call` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Team Users Path: `callingly.db.teamUsers.search` ```ts theme={null} const rows = await corsair.callingly.db.teamUsers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `cap` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `callingly.db.users.search` ```ts theme={null} const rows = await corsair.callingly.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `fname` | `string` | equals, contains, startsWith, endsWith, in | | `lname` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `ext` | `string` | equals, contains, startsWith, endsWith, in | | `donotdisturb_until` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `is_available` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `callingly.db.webhooks.search` ```ts theme={null} const rows = await corsair.callingly.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `event` | `string` | equals, contains, startsWith, endsWith, in | | `target_url` | `string` | equals, contains, startsWith, endsWith, in | | `direction` | `string` | equals, contains, startsWith, endsWith, in | | `call_direction` | `string` | equals, contains, startsWith, endsWith, in | | `call_status` | `string` | equals, contains, startsWith, endsWith, in | | `call_lead_status` | `string` | equals, contains, startsWith, endsWith, in | | `field` | `string` | equals, contains, startsWith, endsWith, in | | `filter` | `string` | equals, contains, startsWith, endsWith, in | | `consecutive_failures` | `number` | equals, gt, gte, lt, lte, in | | `last_failed_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/callingly/overview Callingly plugin for Corsair Use **Callingly** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 29 typed API operations * 8 synced entities (`calls`, `clients`, `leads`, `schedules`, `teams`, `teamUsers`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/callingly ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/callingly ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/callingly ``` ```bash bun theme={null} bun add corsair @corsair-dev/callingly ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { callingly } from '@corsair-dev/callingly'; export const corsair = createCorsair({ plugins: [ callingly(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} callingly() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'callingly', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`agents.getSchedule`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.callingly.api.agents.getSchedule({}); ``` **`agents.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.callingly.api.agents.create({}); ``` See the full list on the [API](/plugins/callingly/api) page. ## Query synced data Synced entities support `tenant.callingly.db..search()` and `.list()`: `calls`, `clients`, `leads`, `schedules`, `teams`, `teamUsers`, `users`, `webhooks`. See [Database](/plugins/callingly/database) for filters and operators. ## What's next > **[API reference](/plugins/callingly/api)** > > Every `callingly.api.*` operation with input and output types. > **[Database](/plugins/callingly/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/callpage/api API reference for CallPage: every `callpage.api.*` operation with input and output types. Every `callpage.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Calls ### get `calls.get` Get a CallPage call by ID. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.calls.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `callId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `to` | `string` | No | — | | `to_formatted` | `string` | No | — | | `human_status` | `string` | No | — | | `created_at` | `string` | No | — | | `scheduled_at` | `string` | No | — | | `cancelled_at` | `string` | No | — | | `scheduled_success` | `boolean` | No | — | | `leadable_id` | `number` | No | — | | `leadable_type` | `string` | No | — | | `leadable_description` | `string` | No | — | | `utm` | `object` | No | — | | `referer` | `object` | No | — | | `request` | `object` | No | — | | `call` | `object` | No | — | > **utm full type** > > ```ts theme={null} > { > utm_medium?: string | null, > utm_source?: string | null, > utm_content?: string | null, > utm_campaign?: string | null > } > ``` > **referer full type** > > ```ts theme={null} > { > medium?: string | null, > source?: string | null > } > ``` > **request full type** > > ```ts theme={null} > { > id?: number, > ip?: string | null, > url?: string | null, > locale?: string | null, > geo_city?: string | null, > geo_country_code?: string | null, > geo_country_name?: string | null, > user_agent_device?: string | null, > user_agent_device_type?: string | null > } > ``` > **call full type** > > ```ts theme={null} > { > id?: number, > sid?: string | null, > type?: number | null, > transcribed?: boolean | null, > billing_time?: number | null > } > ``` *** ### history `calls.history` List and filter CallPage call history. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.calls.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `display_hidden` | `number` | No | — | | `call_id` | `number[]` | No | — | | `phone_number` | `string` | No | — | | `user_ids` | `number[]` | No | — | | `statuses` | `string[]` | No | — | | `tag_ids` | `number[]` | No | — | | `date_from` | `number` | No | — | | `date_to` | `number` | No | — | | `widget_ids` | `number[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `url` | `string` | No | — | | `incoming_number_ids` | `number[]` | No | — | | `tel` | `string` | No | — | | `widget_id` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > to?: string | null, > to_formatted?: string | null, > human_status?: string | null, > created_at?: string | null, > scheduled_at?: string | null, > cancelled_at?: string | null, > scheduled_success?: boolean | null, > leadable_id?: number | null, > leadable_type?: string | null, > leadable_description?: string | null, > utm?: { > utm_medium?: string | null, > utm_source?: string | null, > utm_content?: string | null, > utm_campaign?: string | null > }, > referer?: { > medium?: string | null, > source?: string | null > }, > request?: { > id?: number, > ip?: string | null, > url?: string | null, > locale?: string | null, > geo_city?: string | null, > geo_country_code?: string | null, > geo_country_name?: string | null, > user_agent_device?: string | null, > user_agent_device_type?: string | null > }, > call?: { > id?: number, > sid?: string | null, > type?: number | null, > transcribed?: boolean | null, > billing_time?: number | null > } > }[] > ``` *** ## Managers ### create `managers.create` Create a CallPage manager for a widget. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.managers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | | `widget_id` | `number` | Yes | — | | `enabled` | `boolean` | Yes | — | | `business_times` | `object[]` | No | — | > **business\_times full type** > > ```ts theme={null} > { > day_of_week: number, > enabled: boolean, > start_time?: string | null, > end_time?: string | null > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### delete `managers.delete` Delete a CallPage manager from a widget. **Risk:** `destructive` ```ts theme={null} await corsair.callpage.api.managers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | | `widget_id` | `number` | Yes | — | **Output:** `null` *** ### get `managers.get` Get a CallPage manager by user and widget. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.managers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | | `widget_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `widget_id` | `number` | No | — | | `user_id` | `number` | No | — | | `enabled` | `boolean` | No | — | | `user` | `object` | No | — | | `departments` | `object[]` | No | — | | `business_times` | `object[]` | No | — | > **user full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > tel?: string | null, > email?: string | null, > avatar?: string | null > } > ``` > **departments full type** > > ```ts theme={null} > { > id: number, > name: string > }[] > ``` > **business\_times full type** > > ```ts theme={null} > { > day_of_week: number, > enabled: boolean, > timezone?: string | null, > start_time?: string | null, > end_time?: string | null > }[] > ``` *** ### list `managers.list` List managers for a CallPage widget with pagination. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.managers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > widget_id?: number, > user_id?: number, > enabled?: boolean, > user?: { > id: number, > name?: string | null, > tel?: string | null, > email?: string | null, > avatar?: string | null > }, > departments?: { > id: number, > name: string > }[], > business_times?: { > day_of_week: number, > enabled: boolean, > timezone?: string | null, > start_time?: string | null, > end_time?: string | null > }[] > }[] > ``` *** ### statusStatistics `managers.statusStatistics` Count enabled and disabled managers for a CallPage widget. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.managers.statusStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | Yes | — | | `enabled` | `number` | Yes | — | | `disabled` | `number` | Yes | — | *** ### update `managers.update` Update a CallPage manager. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.managers.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | | `widget_id` | `number` | Yes | — | | `enabled` | `boolean` | Yes | — | | `business_times` | `object[]` | No | — | > **business\_times full type** > > ```ts theme={null} > { > day_of_week: number, > enabled: boolean, > start_time?: string | null, > end_time?: string | null > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ## Root ### get `root.get` Get the CallPage API root greeting to verify connectivity. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.root.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ## Sms ### create `sms.create` Create a custom SMS message for a CallPage widget. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.sms.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | | `message_id` | `string` | Yes | — | | `text` | `string` | Yes | — | | `enabled` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### list `sms.list` List SMS messages for a CallPage widget. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.sms.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > widget_id?: number, > message_id: string, > text: string, > enabled?: boolean | number, > updated_at?: string | null > }[] > ``` *** ### reset `sms.reset` Reset CallPage widget SMS messages to defaults. **Risk:** `destructive` ```ts theme={null} await corsair.callpage.api.sms.reset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | | `message_id` | `string` | No | — | **Output:** `null` *** ### update `sms.update` Update a custom SMS message for a CallPage widget. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.sms.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | | `message_id` | `string` | Yes | — | | `text` | `string` | Yes | — | | `enabled` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ## Users ### create `users.create` Create a CallPage user. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `tel` | `string` | Yes | — | | `email` | `string` | No | — | | `role` | `admin \| manager` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### delete `users.delete` Delete a CallPage user. **Risk:** `destructive` ```ts theme={null} await corsair.callpage.api.users.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `null` *** ### get `users.get` Get a CallPage user. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `email` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `tel` | `string` | No | — | | `tel_formatted` | `string` | No | — | | `tel_extension` | `string` | No | — | | `last_online` | `string` | No | — | | `parent_id` | `number` | No | — | | `activated_at` | `string` | No | — | | `role` | `object` | No | — | | `avatar` | `string` | No | — | | `caller_id` | `object` | No | — | > **role full type** > > ```ts theme={null} > { > slug: string > } > ``` > **caller\_id full type** > > ```ts theme={null} > { > id?: number, > tel?: string | null, > activated_at?: string | null, > updated_at?: string | null, > tel_formatted?: string | null > } > ``` *** ### list `users.list` List CallPage users. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > email?: string | null, > tel?: string | null, > tel_formatted?: string | null, > tel_extension?: string | null, > last_online?: string | null, > parent_id?: number | null, > activated_at?: string | null, > role?: { > slug: string > } | null, > avatar?: string | null, > caller_id?: { > id?: number, > tel?: string | null, > activated_at?: string | null, > updated_at?: string | null, > tel_formatted?: string | null > } | null > }[] > ``` *** ### update `users.update` Update a CallPage user. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `tel` | `string` | Yes | — | | `email` | `string` | No | — | | `role` | `admin \| manager` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ## Voice Messages ### create `voiceMessages.create` Create a custom voice message for a CallPage widget. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.voiceMessages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | | `message_id` | `string` | Yes | — | | `enabled` | `boolean` | Yes | — | | `file` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### list `voiceMessages.list` List voice messages for a CallPage widget. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.voiceMessages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > widget_id?: number, > message_id: string, > enabled?: boolean | number, > updated_at?: string | null, > recording?: { > full_url: string > } | null > }[] > ``` *** ### reset `voiceMessages.reset` Reset CallPage widget voice messages to defaults. **Risk:** `destructive` ```ts theme={null} await corsair.callpage.api.voiceMessages.reset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | | `message_id` | `string` | No | — | **Output:** `null` *** ### update `voiceMessages.update` Update a custom voice message for a CallPage widget. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.voiceMessages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `number` | Yes | — | | `message_id` | `string` | Yes | — | | `enabled` | `boolean` | Yes | — | | `file` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ## Widgets ### addUsers `widgets.addUsers` Add users to a CallPage widget as managers. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.widgets.addUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `user_id` | `number \| number[]` | Yes | — | | `business_times` | `object[]` | No | — | > **business\_times full type** > > ```ts theme={null} > { > day_of_week: number, > enabled: boolean, > start_time?: string | null, > end_time?: string | null > }[] | { > day_of_week: number, > enabled: boolean, > start_time?: string | null, > end_time?: string | null > }[][] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > user_id: number, > manager_id: number > }[] > ``` *** ### call `widgets.call` Initiate a CallPage widget call. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.widgets.call({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `tel` | `string` | Yes | — | | `department_id` | `number` | No | — | | `manager_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### callOrSchedule `widgets.callOrSchedule` Initiate or schedule a CallPage widget call. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.widgets.callOrSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `tel` | `string` | Yes | — | | `department_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### create `widgets.create` Create a CallPage widget. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.widgets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `description` | `string` | No | — | | `settings` | `object` | No | — | | `locale_code` | `string` | No | — | | `enabled` | `boolean` | No | — | > **settings full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### delete `widgets.delete` Delete a CallPage widget. **Risk:** `destructive` ```ts theme={null} await corsair.callpage.api.widgets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `null` *** ### get `widgets.get` Get a CallPage widget. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.widgets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `widget_id` | `number` | No | — | | `encrypted_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `enabled` | `boolean` | No | — | | `locale_code` | `string` | No | — | | `installation_status` | `number` | No | — | | `installed_at` | `string` | No | — | | `company_sms_name` | `string` | No | — | | `call_requests_count` | `number` | No | — | | `managers` | `object[]` | No | — | > **managers full type** > > ```ts theme={null} > { > id: number, > widget_id?: number, > user_id?: number, > enabled?: boolean, > user?: { > id: number, > name?: string | null, > tel?: string | null, > email?: string | null, > avatar?: string | null > }, > departments?: { > id: number, > name: string > }[], > business_times?: { > day_of_week: number, > enabled: boolean, > timezone?: string | null, > start_time?: string | null, > end_time?: string | null > }[] > }[] > ``` *** ### list `widgets.list` List CallPage widgets with pagination. **Risk:** `read` ```ts theme={null} await corsair.callpage.api.widgets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > description?: string | null, > url?: string | null, > enabled?: boolean, > locale_code?: string | null, > installation_status?: number | null, > installed_at?: string | null, > company_sms_name?: string | null, > call_requests_count?: number | null, > managers?: { > id: number, > widget_id?: number, > user_id?: number, > enabled?: boolean, > user?: { > id: number, > name?: string | null, > tel?: string | null, > email?: string | null, > avatar?: string | null > }, > departments?: { > id: number, > name: string > }[], > business_times?: { > day_of_week: number, > enabled: boolean, > timezone?: string | null, > start_time?: string | null, > end_time?: string | null > }[] > }[] > }[] > ``` *** ### update `widgets.update` Update a CallPage widget. **Risk:** `write` ```ts theme={null} await corsair.callpage.api.widgets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `url` | `string` | Yes | — | | `description` | `string` | No | — | | `settings` | `object` | No | — | | `locale_code` | `string` | No | — | | `enabled` | `boolean` | No | — | > **settings full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/callpage/database CallPage local sync: searchable entities, `.search()` filters, and operators. The CallPage plugin syncs data locally. Use `corsair.callpage.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Calls Path: `callpage.db.calls.search` ```ts theme={null} const rows = await corsair.callpage.db.calls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | | `to_formatted` | `string` | equals, contains, startsWith, endsWith, in | | `human_status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `scheduled_at` | `string` | equals, contains, startsWith, endsWith, in | | `cancelled_at` | `string` | equals, contains, startsWith, endsWith, in | | `scheduled_success` | `boolean` | equals | | `leadable_id` | `number` | equals, gt, gte, lt, lte, in | | `leadable_type` | `string` | equals, contains, startsWith, endsWith, in | | `leadable_description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Managers Path: `callpage.db.managers.search` ```ts theme={null} const rows = await corsair.callpage.db.managers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `widget_id` | `number` | equals, gt, gte, lt, lte, in | | `user_id` | `number` | equals, gt, gte, lt, lte, in | | `enabled` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sms Messages Path: `callpage.db.smsMessages.search` ```ts theme={null} const rows = await corsair.callpage.db.smsMessages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `widget_id` | `number` | equals, gt, gte, lt, lte, in | | `message_id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `callpage.db.users.search` ```ts theme={null} const rows = await corsair.callpage.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `tel` | `string` | equals, contains, startsWith, endsWith, in | | `tel_formatted` | `string` | equals, contains, startsWith, endsWith, in | | `tel_extension` | `string` | equals, contains, startsWith, endsWith, in | | `last_online` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `number` | equals, gt, gte, lt, lte, in | | `activated_at` | `string` | equals, contains, startsWith, endsWith, in | | `avatar` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Voice Messages Path: `callpage.db.voiceMessages.search` ```ts theme={null} const rows = await corsair.callpage.db.voiceMessages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `widget_id` | `number` | equals, gt, gte, lt, lte, in | | `message_id` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Widgets Path: `callpage.db.widgets.search` ```ts theme={null} const rows = await corsair.callpage.db.widgets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `enabled` | `boolean` | equals | | `locale_code` | `string` | equals, contains, startsWith, endsWith, in | | `installation_status` | `number` | equals, gt, gte, lt, lte, in | | `installed_at` | `string` | equals, contains, startsWith, endsWith, in | | `company_sms_name` | `string` | equals, contains, startsWith, endsWith, in | | `call_requests_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/callpage/overview Click-to-call widgets that connect website visitors with your sales team. Use **CallPage** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 30 typed API operations * 6 synced entities (`calls`, `managers`, `smsMessages`, `users`, `voiceMessages`, `widgets`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/callpage ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/callpage ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/callpage ``` ```bash bun theme={null} bun add corsair @corsair-dev/callpage ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { callpage } from '@corsair-dev/callpage'; export const corsair = createCorsair({ plugins: [ callpage(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} callpage() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'callpage', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`widgets.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.callpage.api.widgets.list({ limit: 20 }); ``` **`widgets.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.callpage.api.widgets.create({ url: 'https://example.com', description: 'Landing page' }); ``` See the full list on the [API](/plugins/callpage/api) page. ## Query synced data Query synced `widgets` rows without hitting the live API. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.callpage.db.widgets.search({ data: { enabled: true }, limit: 20, }); ``` Synced entities: `calls`, `managers`, `smsMessages`, `users`, `voiceMessages`, `widgets`. See [Database](/plugins/callpage/database) for filters and operators. ## What's next > **[API reference](/plugins/callpage/api)** > > Every `callpage.api.*` operation with input and output types. > **[Database](/plugins/callpage/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/campaigncleaner/api API reference for CampaignCleaner: every `campaigncleaner.api.*` operation with input and output types. Every `campaigncleaner.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Campaign ### delete `campaign.delete` Delete a saved Campaign Cleaner campaign by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.campaigncleaner.api.campaign.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `success \| failure` | Yes | — | | `error` | `string` | No | — | *** ### list `campaign.list` List saved Campaign Cleaner campaigns **Risk:** `read` ```ts theme={null} await corsair.campaigncleaner.api.campaign.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaign_list` | `object[]` | Yes | — | > **campaign\_list full type** > > ```ts theme={null} > { > id: string, > campaign_name: string, > status: processing | completed | paused, > date_added: string > }[] > ``` *** ### pdfAnalysis `campaign.pdfAnalysis` Download PDF analysis for a processed campaign **Risk:** `read` ```ts theme={null} await corsair.campaigncleaner.api.campaign.pdfAnalysis({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content_type` | `string` | Yes | — | | `content_base64` | `string` | Yes | — | *** ### status `campaign.status` Get processing status for a Campaign Cleaner campaign **Risk:** `read` ```ts theme={null} await corsair.campaigncleaner.api.campaign.status({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaign_status` | `object` | Yes | — | > **campaign\_status full type** > > ```ts theme={null} > { > id: string, > campaign_name: string, > status: processing | completed | paused, > date_added: string > } > ``` *** ## Credits ### get `credits.get` Get remaining Campaign Cleaner credits **Risk:** `read` ```ts theme={null} await corsair.campaigncleaner.api.credits.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `credits` | `number` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/campaigncleaner/database CampaignCleaner local sync: searchable entities, `.search()` filters, and operators. The CampaignCleaner plugin syncs data locally. Use `corsair.campaigncleaner.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Campaigns Path: `campaigncleaner.db.campaigns.search` ```ts theme={null} const rows = await corsair.campaigncleaner.db.campaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `campaign_name` | `string` | equals, contains, startsWith, endsWith, in | | `date_added` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Credits Path: `campaigncleaner.db.credits.search` ```ts theme={null} const rows = await corsair.campaigncleaner.db.credits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `credits` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/campaigncleaner/overview CampaignCleaner plugin for Corsair Use **CampaignCleaner** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 2 synced entities (`campaigns`, `credits`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/campaigncleaner ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/campaigncleaner ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/campaigncleaner ``` ```bash bun theme={null} bun add corsair @corsair-dev/campaigncleaner ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { campaigncleaner } from '@corsair-dev/campaigncleaner'; export const corsair = createCorsair({ plugins: [ campaigncleaner(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} campaigncleaner() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'campaigncleaner', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`campaign.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.campaigncleaner.api.campaign.list({}); ``` **`campaign.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.campaigncleaner.api.campaign.delete({}); ``` See the full list on the [API](/plugins/campaigncleaner/api) page. ## Query synced data Synced entities support `tenant.campaigncleaner.db..search()` and `.list()`: `campaigns`, `credits`. See [Database](/plugins/campaigncleaner/database) for filters and operators. ## What's next > **[API reference](/plugins/campaigncleaner/api)** > > Every `campaigncleaner.api.*` operation with input and output types. > **[Database](/plugins/campaigncleaner/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/campayn/api API reference for Campayn: every `campayn.api.*` operation with input and output types. Every `campayn.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Contacts ### createContact `contacts.createContact` Create a new contact in a contact list. **Risk:** `write` ```ts theme={null} await corsair.campayn.api.contacts.createContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string \| number` | Yes | — | | `email` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `title` | `string` | No | — | | `address` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `zip` | `string` | No | — | | `company` | `string` | No | — | | `country` | `string` | No | — | | `phones` | `object[]` | No | — | | `sites` | `object[]` | No | — | | `social` | `object[]` | No | — | | `custom_fields` | `object[]` | No | — | | `failOnDuplicate` | `boolean` | No | — | > **phones full type** > > ```ts theme={null} > { > value: string, > type: string > }[] > ``` > **sites full type** > > ```ts theme={null} > { > value: string, > type: string > }[] > ``` > **social full type** > > ```ts theme={null} > { > value: string, > type: string, > protocol: string > }[] > ``` > **custom\_fields full type** > > ```ts theme={null} > { > field: string, > value?: string, > variable?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean \| 1 \| 0` | Yes | — | *** ### deleteContact `contacts.deleteContact` Delete a contact by contact ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.campayn.api.contacts.deleteContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean \| 1 \| 0` | Yes | — | *** ### getContact `contacts.getContact` Get full contact details by contact ID. **Risk:** `read` ```ts theme={null} await corsair.campayn.api.contacts.getContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `title` | `string` | No | — | | `company` | `string` | No | — | | `address` | `string` | No | — | | `country_id` | `string` | No | — | | `country` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `zip` | `string` | No | — | | `birthday` | `string` | No | — | | `tags` | `string` | No | — | | `phones` | `object[]` | No | — | | `sites` | `object[]` | No | — | | `social` | `object[]` | No | — | | `custom_fields` | `object[]` | No | — | | `image_url` | `string` | No | — | > **phones full type** > > ```ts theme={null} > { > value: string, > type: string > }[] > ``` > **sites full type** > > ```ts theme={null} > { > value: string, > type: string > }[] > ``` > **social full type** > > ```ts theme={null} > { > value: string, > type: string, > protocol: string > }[] > ``` > **custom\_fields full type** > > ```ts theme={null} > { > field: string, > value?: string, > variable?: string > }[] > ``` *** ### getContacts `contacts.getContacts` List contacts for a contact list, with optional contact keyword filtering. **Risk:** `read` ```ts theme={null} await corsair.campayn.api.contacts.getContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string \| number` | Yes | — | | `contactFilter` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > email: string, > first_name?: string | null, > last_name?: string | null, > image_url?: string | null > }[] > ``` *** ### unsubscribeContact `contacts.unsubscribeContact` Unsubscribe contacts from a list by contact ID or by email address. **Risk:** `write` ```ts theme={null} await corsair.campayn.api.contacts.unsubscribeContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string \| number` | Yes | — | | `id` | `string \| number` | No | — | | `email` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > success: boolean | 1 | 0 > } | { > contactCount: number | string, > success: boolean, > msg: string, > unsubscribeCount: number | string > } > ``` *** ## Lists ### deleteList `lists.deleteList` Delete a contact list by list ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.campayn.api.lists.deleteList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean \| 1 \| 0` | Yes | — | *** ### getLists `lists.getLists` List all contact lists visible to the authenticated user. **Risk:** `read` ```ts theme={null} await corsair.campayn.api.lists.getLists({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > list_name: string, > tags?: string, > contact_count: number | string > }[] > ``` *** ### updateList `lists.updateList` Update a contact list name or tags by list ID. **Risk:** `write` ```ts theme={null} await corsair.campayn.api.lists.updateList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string \| number` | Yes | — | | `list_name` | `string` | No | — | | `tags` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `list_name` | `string` | Yes | — | | `tags` | `string` | No | — | | `contact_count` | `number \| string` | Yes | — | *** ## Messages ### getMessages `messages.getMessages` List messages visible to the authenticated user. **Risk:** `read` ```ts theme={null} await corsair.campayn.api.messages.getMessages({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > scheduled_date?: string | null, > send_now?: string | number, > send_count?: string | number, > campaign_title?: string | null, > status?: string, > unique_views?: number | string, > unique_responses?: number | string, > percent_views?: number | string, > percent_responses?: number | string, > preview_url?: string, > preview_thumb?: string, > report_url?: string | null > }[] > ``` *** ### getMessageStatistics `messages.getMessageStatistics` Get message statistics for a specific message ID. **Risk:** `read` ```ts theme={null} await corsair.campayn.api.messages.getMessageStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `scheduled_date` | `string` | No | — | | `send_now` | `string \| number` | No | — | | `send_count` | `string \| number` | No | — | | `campaign_title` | `string` | No | — | | `status` | `string` | No | — | | `unique_views` | `number \| string` | No | — | | `unique_responses` | `number \| string` | No | — | | `percent_views` | `number \| string` | No | — | | `percent_responses` | `number \| string` | No | — | | `preview_url` | `string` | No | — | | `preview_thumb` | `string` | No | — | | `report_url` | `string` | No | — | *** ## Reports ### getReports `reports.getReports` Get report calendar entries for sent and scheduled emails, optionally filtered by Unix timestamp range. **Risk:** `read` ```ts theme={null} await corsair.campayn.api.reports.getReports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > scheduled_date?: string | null, > status: string, > preview_url: string, > report_url?: string | null > }[] > ``` *** ## Signup ### signup `signup.signup` Create a Campayn account via POST /signup on the site root (not /api/v1). **Risk:** `write` ```ts theme={null} await corsair.campayn.api.signup.signup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `password` | `string` | Yes | — | | `subdomain` | `string` | No | — | | `site` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `number \| boolean` | Yes | — | | `msg` | `string` | Yes | — | | `errorCode` | `string` | No | — | *** ## Webforms ### deleteWebform `webforms.deleteWebform` Delete a webform by list ID and webform ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.campayn.api.webforms.deleteWebform({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string \| number` | Yes | — | | `webformId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean \| 1 \| 0` | Yes | — | *** ### getWebform `webforms.getWebform` Get a webform by list ID and webform ID. **Risk:** `read` ```ts theme={null} await corsair.campayn.api.webforms.getWebform({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string \| number` | Yes | — | | `webformId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `contact_list_id` | `string` | Yes | — | | `form_title` | `string` | Yes | — | | `form_type` | `string` | Yes | — | | `form_html` | `string` | Yes | — | | `signup_count` | `string \| number` | Yes | — | *** ### getWebforms `webforms.getWebforms` List webforms for a contact list, with optional form type filter. **Risk:** `read` ```ts theme={null} await corsair.campayn.api.webforms.getWebforms({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string \| number` | Yes | — | | `form_type` | `0 \| 1 \| 2 \| 3` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > contact_list_id: string, > form_title: string, > form_type: string, > form_html: string, > signup_count: string | number > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/campayn/database Campayn local sync: searchable entities, `.search()` filters, and operators. The Campayn plugin syncs data locally. Use `corsair.campayn.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Contacts Path: `campayn.db.contacts.search` ```ts theme={null} const rows = await corsair.campayn.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `country_id` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `zip` | `string` | equals, contains, startsWith, endsWith, in | | `birthday` | `string` | equals, contains, startsWith, endsWith, in | | `tags` | `string` | equals, contains, startsWith, endsWith, in | | `image_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `campayn.db.lists.search` ```ts theme={null} const rows = await corsair.campayn.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `list_name` | `string` | equals, contains, startsWith, endsWith, in | | `tags` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `campayn.db.messages.search` ```ts theme={null} const rows = await corsair.campayn.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `scheduled_date` | `string` | equals, contains, startsWith, endsWith, in | | `campaign_title` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `preview_url` | `string` | equals, contains, startsWith, endsWith, in | | `preview_thumb` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Reports Path: `campayn.db.reports.search` ```ts theme={null} const rows = await corsair.campayn.db.reports.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `scheduled_date` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `preview_url` | `string` | equals, contains, startsWith, endsWith, in | | `report_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webforms Path: `campayn.db.webforms.search` ```ts theme={null} const rows = await corsair.campayn.db.webforms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `contact_list_id` | `string` | equals, contains, startsWith, endsWith, in | | `form_title` | `string` | equals, contains, startsWith, endsWith, in | | `form_type` | `string` | equals, contains, startsWith, endsWith, in | | `form_html` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/campayn/overview Campayn plugin for Corsair Use **Campayn** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 15 typed API operations * 5 synced entities (`contacts`, `lists`, `messages`, `reports`, `webforms`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/campayn ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/campayn ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/campayn ``` ```bash bun theme={null} bun add corsair @corsair-dev/campayn ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { campayn } from '@corsair-dev/campayn'; export const corsair = createCorsair({ plugins: [ campayn(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} campayn() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'campayn', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`contacts.getContact`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.campayn.api.contacts.getContact({}); ``` **`contacts.createContact`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.campayn.api.contacts.createContact({}); ``` See the full list on the [API](/plugins/campayn/api) page. ## Query synced data Synced entities support `tenant.campayn.db..search()` and `.list()`: `contacts`, `lists`, `messages`, `reports`, `webforms`. See [Database](/plugins/campayn/database) for filters and operators. ## What's next > **[API reference](/plugins/campayn/api)** > > Every `campayn.api.*` operation with input and output types. > **[Database](/plugins/campayn/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/canny/api API reference for Canny: every `canny.api.*` operation with input and output types. Every `canny.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Boards ### list `boards.list` List all boards for your company in Canny **Risk:** `read` ```ts theme={null} await corsair.canny.api.boards.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `boards` | `object[]` | Yes | — | > **boards full type** > > ```ts theme={null} > { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }[] > ``` *** ### retrieve `boards.retrieve` Retrieve details of an existing Canny board by ID **Risk:** `read` ```ts theme={null} await corsair.canny.api.boards.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `created` | `string` | Yes | — | | `isPrivate` | `boolean` | Yes | — | | `name` | `string` | Yes | — | | `postCount` | `number` | Yes | — | | `privateComments` | `boolean` | No | — | | `token` | `string` | No | — | | `url` | `string` | Yes | — | *** ## Comments ### create `comments.create` Create a new comment on a Canny post **Risk:** `write` ```ts theme={null} await corsair.canny.api.comments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `authorID` | `string` | Yes | — | | `postID` | `string` | Yes | — | | `value` | `string` | Yes | — | | `imageURLs` | `string[]` | No | — | | `internal` | `boolean` | No | — | | `parentID` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `comments.delete` Delete a comment in Canny \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.canny.api.comments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `commentID` | `string` | Yes | — | **Output:** `success \| string` *** ### list `comments.list` List comments in Canny with optional filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.canny.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `authorID` | `string` | No | — | | `boardID` | `string` | No | — | | `companyID` | `string` | No | — | | `limit` | `number` | No | — | | `postID` | `string` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `comments` | `object[]` | Yes | — | | `hasMore` | `boolean` | Yes | — | > **comments full type** > > ```ts theme={null} > { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board?: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > created: string, > deleteStatus?: string | null, > imageURLs?: string[], > internal?: boolean, > likeCount?: number, > parentID?: string | null, > post?: { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > }, > value: string > }[] > ``` *** ## Posts ### changeStatus `posts.changeStatus` Change an existing Canny post's status **Risk:** `write` ```ts theme={null} await corsair.canny.api.posts.changeStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `changerID` | `string` | Yes | — | | `commentValue` | `string` | No | — | | `postID` | `string` | Yes | — | | `shouldNotifyVoters` | `boolean` | No | — | | `status` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `author` | `object` | Yes | — | | `board` | `object` | Yes | — | | `category` | `object` | No | — | | `commentCount` | `number` | Yes | — | | `created` | `string` | Yes | — | | `details` | `string` | No | — | | `eta` | `string` | No | — | | `imageURLs` | `string[]` | No | — | | `score` | `number` | Yes | — | | `status` | `string` | Yes | — | | `tags` | `object[]` | No | — | | `title` | `string` | Yes | — | | `url` | `string` | Yes | — | | `owner` | `object` | No | — | | `customFields` | `object` | No | — | > **author full type** > > ```ts theme={null} > { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } > ``` > **board full type** > > ```ts theme={null} > { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > } > ``` > **category full type** > > ```ts theme={null} > { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } > ``` > **tags full type** > > ```ts theme={null} > { > id: string, > name: string, > url?: string, > postCount?: number > }[] > ``` > **owner full type** > > ```ts theme={null} > { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } > ``` > **customFields full type** > > ```ts theme={null} > { > } > ``` *** ### create `posts.create` Create a new post in Canny **Risk:** `write` ```ts theme={null} await corsair.canny.api.posts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `authorID` | `string` | Yes | — | | `boardID` | `string` | Yes | — | | `byID` | `string` | No | — | | `createdAt` | `string` | No | — | | `title` | `string` | Yes | — | | `details` | `string` | No | — | | `categoryID` | `string` | No | — | | `customFields` | `object` | No | — | | `eta` | `string` | No | — | | `etaPublic` | `boolean` | No | — | | `imageURLs` | `string[]` | No | — | | `ownerID` | `string` | No | — | > **customFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `posts.delete` Delete a post in Canny \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.canny.api.posts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `postID` | `string` | Yes | — | **Output:** `success \| string` *** ### list `posts.list` List posts in Canny with optional filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.canny.api.posts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `authorID` | `string` | No | — | | `boardID` | `string` | No | — | | `categoryID` | `string` | No | — | | `companyID` | `string` | No | — | | `limit` | `number` | No | — | | `search` | `string` | No | — | | `skip` | `number` | No | — | | `sort` | `newest \| oldest \| relevance \| score \| statusChanged \| trending` | No | — | | `status` | `open \| under review \| planned \| in progress \| complete \| closed` | No | — | | `tagID` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hasMore` | `boolean` | Yes | — | | `posts` | `object[]` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > }[] > ``` *** ### retrieve `posts.retrieve` Retrieve details of an existing Canny post by ID **Risk:** `read` ```ts theme={null} await corsair.canny.api.posts.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `boardID` | `string` | No | — | | `urlName` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `author` | `object` | Yes | — | | `board` | `object` | Yes | — | | `category` | `object` | No | — | | `commentCount` | `number` | Yes | — | | `created` | `string` | Yes | — | | `details` | `string` | No | — | | `eta` | `string` | No | — | | `imageURLs` | `string[]` | No | — | | `score` | `number` | Yes | — | | `status` | `string` | Yes | — | | `tags` | `object[]` | No | — | | `title` | `string` | Yes | — | | `url` | `string` | Yes | — | | `owner` | `object` | No | — | | `customFields` | `object` | No | — | > **author full type** > > ```ts theme={null} > { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } > ``` > **board full type** > > ```ts theme={null} > { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > } > ``` > **category full type** > > ```ts theme={null} > { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } > ``` > **tags full type** > > ```ts theme={null} > { > id: string, > name: string, > url?: string, > postCount?: number > }[] > ``` > **owner full type** > > ```ts theme={null} > { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } > ``` > **customFields full type** > > ```ts theme={null} > { > } > ``` *** ## Votes ### create `votes.create` Create a vote for a Canny post on behalf of a user **Risk:** `write` ```ts theme={null} await corsair.canny.api.votes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `postID` | `string` | Yes | — | | `voterID` | `string` | Yes | — | | `votePriority` | `0 \| 10 \| 20` | No | — | **Output:** `success \| string` *** ### delete `votes.delete` Delete a vote on a Canny post \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.canny.api.votes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `postID` | `string` | Yes | — | | `voterID` | `string` | Yes | — | **Output:** `success \| string` *** ### list `votes.list` List votes in Canny with optional filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.canny.api.votes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardID` | `string` | No | — | | `companyID` | `string` | No | — | | `limit` | `number` | No | — | | `postID` | `string` | No | — | | `skip` | `number` | No | — | | `userID` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hasMore` | `boolean` | Yes | — | | `votes` | `object[]` | Yes | — | > **votes full type** > > ```ts theme={null} > { > id: string, > board?: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > by?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > created: string, > post?: { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > }, > voter?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/canny/database Canny local sync: searchable entities, `.search()` filters, and operators. The Canny plugin syncs data locally. Use `corsair.canny.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Boards Path: `canny.db.boards.search` ```ts theme={null} const rows = await corsair.canny.db.boards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `date` | equals, before, after, between | | `isPrivate` | `boolean` | equals | | `postCount` | `number` | equals, gt, gte, lt, lte, in | | `privateComments` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `token` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Comments Path: `canny.db.comments.search` ```ts theme={null} const rows = await corsair.canny.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `date` | equals, before, after, between | | `postID` | `string` | equals, contains, startsWith, endsWith, in | | `authorID` | `string` | equals, contains, startsWith, endsWith, in | | `parentID` | `string` | equals, contains, startsWith, endsWith, in | | `internal` | `boolean` | equals | | `likeCount` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Posts Path: `canny.db.posts.search` ```ts theme={null} const rows = await corsair.canny.db.posts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `details` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `date` | equals, before, after, between | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `commentCount` | `number` | equals, gt, gte, lt, lte, in | | `eta` | `string` | equals, contains, startsWith, endsWith, in | | `boardID` | `string` | equals, contains, startsWith, endsWith, in | | `authorID` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Votes Path: `canny.db.votes.search` ```ts theme={null} const rows = await corsair.canny.db.votes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `date` | equals, before, after, between | | `postID` | `string` | equals, contains, startsWith, endsWith, in | | `voterID` | `string` | equals, contains, startsWith, endsWith, in | | `boardID` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/canny/overview Canny plugin for Corsair Use **Canny** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 13 typed API operations * 4 synced entities (`boards`, `comments`, `posts`, `votes`) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/canny ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/canny ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/canny ``` ```bash bun theme={null} bun add corsair @corsair-dev/canny ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { canny } from '@corsair-dev/canny'; export const corsair = createCorsair({ plugins: [ canny(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} canny() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'canny', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`boards.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.canny.api.boards.list({}); ``` **`comments.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.canny.api.comments.create({}); ``` See the full list on the [API](/plugins/canny/api) page. ## Query synced data Synced entities support `tenant.canny.db..search()` and `.list()`: `boards`, `comments`, `posts`, `votes`. See [Database](/plugins/canny/database) for filters and operators. ## Webhooks This plugin registers **4** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/canny/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/canny/api)** > > Every `canny.api.*` operation with input and output types. > **[Database](/plugins/canny/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/canny/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/canny/webhooks Canny incoming webhooks: event paths, payloads, and response data. The Canny plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/canny/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `comments` * `created` (`comments.created`) * `posts` * `created` (`posts.created`) * `statusChanged` (`posts.statusChanged`) * `votes` * `created` (`votes.created`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Comments ### Created `comments.created` Occurs when a new comment is created in Canny **Payload** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | Yes | — | | `objectType` | `comment` | Yes | — | | `type` | `comment.created` | Yes | — | | `object` | `object` | Yes | — | > **object full type** > > ```ts theme={null} > { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board?: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > created: string, > deleteStatus?: string | null, > imageURLs?: string[], > internal?: boolean, > likeCount?: number, > parentID?: string | null, > post?: { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > }, > value: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > created: string, > objectType: comment, > type: comment.created, > object: { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board?: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > created: string, > deleteStatus?: string | null, > imageURLs?: string[], > internal?: boolean, > likeCount?: number, > parentID?: string | null, > post?: { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > }, > value: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} canny({ webhookHooks: { comments: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Posts ### Created `posts.created` Occurs when a new post is created in Canny **Payload** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | Yes | — | | `objectType` | `post` | Yes | — | | `type` | `post.created` | Yes | — | | `object` | `object` | Yes | — | > **object full type** > > ```ts theme={null} > { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > created: string, > objectType: post, > type: post.created, > object: { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} canny({ webhookHooks: { posts: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Status Changed `posts.statusChanged` Occurs when a post's status is changed in Canny **Payload** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | Yes | — | | `objectType` | `post` | Yes | — | | `type` | `post.status_changed` | Yes | — | | `object` | `object` | Yes | — | > **object full type** > > ```ts theme={null} > { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > created: string, > objectType: post, > type: post.status_changed, > object: { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} canny({ webhookHooks: { posts: { statusChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Votes ### Created `votes.created` Occurs when a new vote is cast in Canny **Payload** | Name | Type | Required | Description | | - | - | - | - | | `created` | `string` | Yes | — | | `objectType` | `vote` | Yes | — | | `type` | `vote.created` | Yes | — | | `object` | `object` | Yes | — | > **object full type** > > ```ts theme={null} > { > id: string, > board?: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > by?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > created: string, > post?: { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > }, > voter?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > created: string, > objectType: vote, > type: vote.created, > object: { > id: string, > board?: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > by?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > created: string, > post?: { > id: string, > author: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > }, > board: { > id: string, > created: string, > isPrivate: boolean, > name: string, > postCount: number, > privateComments?: boolean, > token?: string, > url: string > }, > category?: { > id: string, > name: string, > url?: string, > postCount?: number, > parentID?: string | null > } | null, > commentCount: number, > created: string, > details?: string, > eta?: string | null, > imageURLs?: string[], > score: number, > status: string, > tags?: { > id: string, > name: string, > url?: string, > postCount?: number > }[], > title: string, > url: string, > owner?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } | null, > customFields?: { > } > }, > voter?: { > id: string, > created: string, > email?: string | null, > name: string, > userID?: string | null, > url: string, > isAdmin: boolean, > avatarURL?: string | null > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} canny({ webhookHooks: { votes: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/canva/api API reference for Canva: every `canva.api.*` operation with input and output types. Every `canva.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Assets ### delete `assets.delete` Delete an asset **Risk:** `destructive` ```ts theme={null} await corsair.canva.api.assets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `assets.get` Get metadata for an asset **Risk:** `read` ```ts theme={null} await corsair.canva.api.assets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset` | `object` | Yes | — | > **asset full type** > > ```ts theme={null} > { > type: image | video, > id: string, > name: string, > tags: string[], > created_at: number, > updated_at: number, > owner?: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > } > } > ``` *** ### update `assets.update` Update an asset name or tags **Risk:** `write` ```ts theme={null} await corsair.canva.api.assets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | Yes | — | | `name` | `string` | No | — | | `tags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset` | `object` | Yes | — | > **asset full type** > > ```ts theme={null} > { > type: image | video, > id: string, > name: string, > tags: string[], > created_at: number, > updated_at: number, > owner?: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > } > } > ``` *** ## Asset Uploads ### create `assetUploads.create` Start a job to upload an asset from binary content **Risk:** `write` ```ts theme={null} await corsair.canva.api.assetUploads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `contentBase64` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > asset?: { > type: image | video, > id: string, > name: string, > tags: string[], > created_at: number, > updated_at: number, > owner?: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > } > }, > error?: { > code: string, > message: string > } > } > ``` *** ### createFromUrl `assetUploads.createFromUrl` Start a job to upload an asset from a URL **Risk:** `write` ```ts theme={null} await corsair.canva.api.assetUploads.createFromUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > asset?: { > type: image | video, > id: string, > name: string, > tags: string[], > created_at: number, > updated_at: number, > owner?: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > } > }, > error?: { > code: string, > message: string > } > } > ``` *** ### get `assetUploads.get` Get the status of an asset upload job **Risk:** `read` ```ts theme={null} await corsair.canva.api.assetUploads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > asset?: { > type: image | video, > id: string, > name: string, > tags: string[], > created_at: number, > updated_at: number, > owner?: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > } > }, > error?: { > code: string, > message: string > } > } > ``` *** ### getFromUrl `assetUploads.getFromUrl` Get the status of a URL asset upload job **Risk:** `read` ```ts theme={null} await corsair.canva.api.assetUploads.getFromUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > asset?: { > type: image | video, > id: string, > name: string, > tags: string[], > created_at: number, > updated_at: number, > owner?: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > } > }, > error?: { > code: string, > message: string > } > } > ``` *** ## Autofills ### create `autofills.create` Start a job to autofill a brand template with data **Risk:** `write` ```ts theme={null} await corsair.canva.api.autofills.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brand_template_id` | `string` | Yes | — | | `data` | `object` | Yes | — | | `title` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > result?: { > type?: string, > design?: { > id: string, > title?: string, > url?: string, > thumbnail?: { > width: number, > height: number, > url: string > }, > current_page_index?: number > } > }, > error?: { > code: string, > message: string > } > } > ``` *** ### get `autofills.get` Get the status of a design autofill job **Risk:** `read` ```ts theme={null} await corsair.canva.api.autofills.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > result?: { > type?: string, > design?: { > id: string, > title?: string, > url?: string, > thumbnail?: { > width: number, > height: number, > url: string > }, > current_page_index?: number > } > }, > error?: { > code: string, > message: string > } > } > ``` *** ## Brand Templates ### get `brandTemplates.get` Get metadata for a brand template **Risk:** `read` ```ts theme={null} await corsair.canva.api.brandTemplates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandTemplateId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `brand_template` | `object` | Yes | — | > **brand\_template full type** > > ```ts theme={null} > { > id: string, > title?: string, > view_url?: string, > create_url?: string, > thumbnail?: { > width: number, > height: number, > url: string > }, > created_at?: number, > updated_at?: number > } > ``` *** ### getDataset `brandTemplates.getDataset` Get the autofill dataset definition for a brand template **Risk:** `read` ```ts theme={null} await corsair.canva.api.brandTemplates.getDataset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandTemplateId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `object` | Yes | — | > **dataset full type** > > ```ts theme={null} > { > } > ``` *** ### list `brandTemplates.list` List the user's brand templates **Risk:** `read` ```ts theme={null} await corsair.canva.api.brandTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `continuation` | `string` | No | — | | `limit` | `number` | No | — | | `ownership` | `any \| owned \| shared` | No | — | | `sort_by` | `relevance \| modified_descending \| modified_ascending \| title_descending \| title_ascending` | No | — | | `dataset` | `any \| non_empty` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `continuation` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > title?: string, > view_url?: string, > create_url?: string, > thumbnail?: { > width: number, > height: number, > url: string > }, > created_at?: number, > updated_at?: number > }[] > ``` *** ## Comments ### createReply `comments.createReply` Reply to a comment thread on a design **Risk:** `write` ```ts theme={null} await corsair.canva.api.comments.createReply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | | `threadId` | `string` | Yes | — | | `message_plaintext` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `reply` | `object` | Yes | — | > **reply full type** > > ```ts theme={null} > { > id: string, > design_id?: string, > thread_id?: string, > author?: { > id: string, > display_name?: string > }, > content?: { > plaintext?: string, > markdown?: string > }, > created_at?: number, > updated_at?: number > } > ``` *** ### createThread `comments.createThread` Create a new comment thread on a design **Risk:** `write` ```ts theme={null} await corsair.canva.api.comments.createThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | | `message_plaintext` | `string` | Yes | — | | `assignee_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `thread` | `object` | Yes | — | > **thread full type** > > ```ts theme={null} > { > id: string, > design_id?: string, > thread_type?: { > type?: string, > content?: { > plaintext?: string, > markdown?: string > } > }, > author?: { > id: string, > display_name?: string > }, > assignee?: { > id: string, > display_name?: string > }, > created_at?: number, > updated_at?: number > } > ``` *** ### getReply `comments.getReply` Get a reply to a comment thread on a design **Risk:** `read` ```ts theme={null} await corsair.canva.api.comments.getReply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | | `threadId` | `string` | Yes | — | | `replyId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `reply` | `object` | Yes | — | > **reply full type** > > ```ts theme={null} > { > id: string, > design_id?: string, > thread_id?: string, > author?: { > id: string, > display_name?: string > }, > content?: { > plaintext?: string, > markdown?: string > }, > created_at?: number, > updated_at?: number > } > ``` *** ### getThread `comments.getThread` Get a comment thread on a design **Risk:** `read` ```ts theme={null} await corsair.canva.api.comments.getThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `thread` | `object` | Yes | — | > **thread full type** > > ```ts theme={null} > { > id: string, > design_id?: string, > thread_type?: { > type?: string, > content?: { > plaintext?: string, > markdown?: string > } > }, > author?: { > id: string, > display_name?: string > }, > assignee?: { > id: string, > display_name?: string > }, > created_at?: number, > updated_at?: number > } > ``` *** ### listReplies `comments.listReplies` List replies to a comment thread on a design **Risk:** `read` ```ts theme={null} await corsair.canva.api.comments.listReplies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | | `threadId` | `string` | Yes | — | | `continuation` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `continuation` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > design_id?: string, > thread_id?: string, > author?: { > id: string, > display_name?: string > }, > content?: { > plaintext?: string, > markdown?: string > }, > created_at?: number, > updated_at?: number > }[] > ``` *** ## Designs ### create `designs.create` Create a new Canva design **Risk:** `write` ```ts theme={null} await corsair.canva.api.designs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `type_and_asset` | No | — | | `design_type` | `object` | No | — | | `asset_id` | `string` | No | — | | `title` | `string` | No | — | > **design\_type full type** > > ```ts theme={null} > { > type: preset, > name: doc | email | presentation | whiteboard > } | { > type: custom, > width: number, > height: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `design` | `object` | Yes | — | > **design full type** > > ```ts theme={null} > { > id: string, > title?: string, > owner: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > }, > urls: { > edit_url: string, > view_url: string > }, > created_at: number, > updated_at: number, > page_count?: number, > design_types?: string[] > } > ``` *** ### get `designs.get` Get metadata for a design **Risk:** `read` ```ts theme={null} await corsair.canva.api.designs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `design` | `object` | Yes | — | > **design full type** > > ```ts theme={null} > { > id: string, > title?: string, > owner: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > }, > urls: { > edit_url: string, > view_url: string > }, > created_at: number, > updated_at: number, > page_count?: number, > design_types?: string[] > } > ``` *** ### getExportFormats `designs.getExportFormats` Get the export formats available for a design **Risk:** `read` ```ts theme={null} await corsair.canva.api.designs.getExportFormats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `formats` | `object` | Yes | — | > **formats full type** > > ```ts theme={null} > { > } > ``` *** ### getPages `designs.getPages` Get pages for a design **Risk:** `read` ```ts theme={null} await corsair.canva.api.designs.getPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id?: string, > index?: number, > page_number?: number, > design_type?: string, > dimensions?: { > width: number, > height: number > }, > thumbnail?: { > width: number, > height: number, > url: string > } > }[] > ``` *** ### list `designs.list` List designs in the user projects **Risk:** `read` ```ts theme={null} await corsair.canva.api.designs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `continuation` | `string` | No | — | | `ownership` | `any \| owned \| shared` | No | — | | `sort_by` | `relevance \| modified_descending \| modified_ascending \| title_descending \| title_ascending` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `continuation` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > title?: string, > owner: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > }, > urls: { > edit_url: string, > view_url: string > }, > created_at: number, > updated_at: number, > page_count?: number, > design_types?: string[] > }[] > ``` *** ## Exports ### create `exports.create` Start a design export job **Risk:** `write` ```ts theme={null} await corsair.canva.api.exports.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `design_id` | `string` | Yes | — | | `format` | `object` | Yes | — | > **format full type** > > ```ts theme={null} > { > type: pdf, > size?: a4 | a3 | letter | legal, > pages?: number[], > export_quality?: regular | pro > } | { > type: jpg, > quality: number, > width?: number, > height?: number, > pages?: number[], > export_quality?: regular | pro > } | { > type: png, > width?: number, > height?: number, > pages?: number[], > lossless?: boolean, > transparent_background?: boolean, > as_single_image?: boolean, > export_quality?: regular | pro > } | { > type: gif, > width?: number, > height?: number, > pages?: number[], > export_quality?: regular | pro > } | { > type: pptx, > pages?: number[] > } | { > type: mp4, > quality?: horizontal_480p | horizontal_720p | horizontal_1080p | horizontal_4k | vertical_480p | vertical_720p | vertical_1080p | vertical_4k > } | { > type: html_bundle, > pages?: number[] > } | { > type: html_standalone, > pages?: number[] > } | { > type: csv, > pages?: number[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > urls?: string[], > error?: { > code: string, > message: string > } > } > ``` *** ### get `exports.get` Get the status of an export job **Risk:** `read` ```ts theme={null} await corsair.canva.api.exports.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `exportId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > urls?: string[], > error?: { > code: string, > message: string > } > } > ``` *** ## Folders ### create `folders.create` Create a folder **Risk:** `write` ```ts theme={null} await corsair.canva.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `parent_folder_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `folder` | `object` | Yes | — | > **folder full type** > > ```ts theme={null} > { > id: string, > name: string, > created_at: number, > updated_at: number, > thumbnail?: { > width: number, > height: number, > url: string > } > } > ``` *** ### delete `folders.delete` Delete a folder **Risk:** `destructive` ```ts theme={null} await corsair.canva.api.folders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `folders.get` Get metadata for a folder **Risk:** `read` ```ts theme={null} await corsair.canva.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `folder` | `object` | Yes | — | > **folder full type** > > ```ts theme={null} > { > id: string, > name: string, > created_at: number, > updated_at: number, > thumbnail?: { > width: number, > height: number, > url: string > } > } > ``` *** ### listItems `folders.listItems` List items in a folder **Risk:** `read` ```ts theme={null} await corsair.canva.api.folders.listItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | | `continuation` | `string` | No | — | | `limit` | `number` | No | — | | `item_types` | `design \| folder \| image \| brand_template[]` | No | — | | `sort_by` | `created_ascending \| created_descending \| modified_ascending \| modified_descending \| title_ascending \| title_descending` | No | — | | `pin_status` | `any \| pinned` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `continuation` | `string` | No | — | > **items full type** > > ```ts theme={null} > ( > { > type: folder, > folder: { > id: string, > name: string, > created_at: number, > updated_at: number, > thumbnail?: { > width: number, > height: number, > url: string > } > } > } | { > type: design, > design: { > id: string, > title?: string, > thumbnail?: { > width: number, > height: number, > url: string > }, > urls: { > edit_url: string, > view_url: string > }, > created_at: number, > updated_at: number, > page_count?: number, > design_types?: string[], > owner?: { > user_id: string, > team_id: string > }, > url?: string > } > } | { > type: image, > image: { > type: image | video, > id: string, > name: string, > tags: string[], > created_at: number, > updated_at: number, > owner?: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > } > } > } | { > type: brand_template, > brand_template: { > id: string, > title?: string, > view_url?: string, > create_url?: string, > thumbnail?: { > width: number, > height: number, > url: string > }, > created_at?: number, > updated_at?: number > } > } > )[] > ``` *** ### moveItem `folders.moveItem` Move an item to another folder **Risk:** `write` ```ts theme={null} await corsair.canva.api.folders.moveItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `to_folder_id` | `string` | Yes | — | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### update `folders.update` Update a folder name **Risk:** `write` ```ts theme={null} await corsair.canva.api.folders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `folder` | `object` | Yes | — | > **folder full type** > > ```ts theme={null} > { > id: string, > name: string, > created_at: number, > updated_at: number, > thumbnail?: { > width: number, > height: number, > url: string > } > } > ``` *** ## Imports ### create `imports.create` Start a job to import a design from binary content **Risk:** `write` ```ts theme={null} await corsair.canva.api.imports.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `contentBase64` | `string` | Yes | — | | `mime_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > result?: { > designs: { > id: string, > title?: string, > url?: string, > thumbnail?: { > width: number, > height: number, > url: string > } > }[] > }, > error?: { > code: string, > message: string > } > } > ``` *** ### createFromUrl `imports.createFromUrl` Start a job to import a design from a URL **Risk:** `write` ```ts theme={null} await corsair.canva.api.imports.createFromUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `url` | `string` | Yes | — | | `mime_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > result?: { > designs: { > id: string, > title?: string, > url?: string, > thumbnail?: { > width: number, > height: number, > url: string > } > }[] > }, > error?: { > code: string, > message: string > } > } > ``` *** ### get `imports.get` Get the status of a design import job **Risk:** `read` ```ts theme={null} await corsair.canva.api.imports.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > result?: { > designs: { > id: string, > title?: string, > url?: string, > thumbnail?: { > width: number, > height: number, > url: string > } > }[] > }, > error?: { > code: string, > message: string > } > } > ``` *** ### getFromUrl `imports.getFromUrl` Get the status of a URL design import job **Risk:** `read` ```ts theme={null} await corsair.canva.api.imports.getFromUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > result?: { > designs: { > id: string, > title?: string, > url?: string, > thumbnail?: { > width: number, > height: number, > url: string > } > }[] > }, > error?: { > code: string, > message: string > } > } > ``` *** ## Resizes ### create `resizes.create` Start a job to resize a design **Risk:** `write` ```ts theme={null} await corsair.canva.api.resizes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `design_id` | `string` | Yes | — | | `design_type` | `object` | Yes | — | > **design\_type full type** > > ```ts theme={null} > { > type: preset, > name: doc | email | presentation | whiteboard > } | { > type: custom, > width: number, > height: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > result?: { > design: { > id: string, > title?: string, > owner: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > }, > urls: { > edit_url: string, > view_url: string > }, > created_at: number, > updated_at: number, > page_count?: number, > design_types?: string[] > } > }, > error?: { > code: string, > message: string > } > } > ``` *** ### get `resizes.get` Get the status of a design resize job **Risk:** `read` ```ts theme={null} await corsair.canva.api.resizes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job` | `object` | Yes | — | > **job full type** > > ```ts theme={null} > { > id: string, > status: in_progress | success | failed, > result?: { > design: { > id: string, > title?: string, > owner: { > user_id: string, > team_id: string > }, > thumbnail?: { > width: number, > height: number, > url: string > }, > urls: { > edit_url: string, > view_url: string > }, > created_at: number, > updated_at: number, > page_count?: number, > design_types?: string[] > } > }, > error?: { > code: string, > message: string > } > } > ``` *** ## Users ### getCapabilities `users.getCapabilities` Get the authenticated user's capabilities **Risk:** `read` ```ts theme={null} await corsair.canva.api.users.getCapabilities({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `capabilities` | `string[]` | Yes | — | *** ### getMe `users.getMe` Get the authenticated user ID and team ID **Risk:** `read` ```ts theme={null} await corsair.canva.api.users.getMe({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `team_user` | `object` | Yes | — | > **team\_user full type** > > ```ts theme={null} > { > user_id: string, > team_id: string > } > ``` *** ### getProfile `users.getProfile` Get the authenticated user profile **Risk:** `read` ```ts theme={null} await corsair.canva.api.users.getProfile({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `profile` | `object` | Yes | — | > **profile full type** > > ```ts theme={null} > { > display_name?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/canva/database Canva local sync: searchable entities, `.search()` filters, and operators. The Canva plugin syncs data locally. Use `corsair.canva.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Assets Path: `canva.db.assets.search` ```ts theme={null} const rows = await corsair.canva.db.assets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Brand Templates Path: `canva.db.brandTemplates.search` ```ts theme={null} const rows = await corsair.canva.db.brandTemplates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `view_url` | `string` | equals, contains, startsWith, endsWith, in | | `create_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Designs Path: `canva.db.designs.search` ```ts theme={null} const rows = await corsair.canva.db.designs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `owner_user_id` | `string` | equals, contains, startsWith, endsWith, in | | `owner_team_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | | `page_count` | `number` | equals, gt, gte, lt, lte, in | | `edit_url` | `string` | equals, contains, startsWith, endsWith, in | | `view_url` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Folders Path: `canva.db.folders.search` ```ts theme={null} const rows = await corsair.canva.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/canva/overview Design platform for creating graphics, presentations, and visual content collaboratively. Use **Canva** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 39 typed API operations * 4 synced entities (`assets`, `brandTemplates`, `designs`, `folders`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/canva ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/canva ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/canva ``` ```bash bun theme={null} bun add corsair @corsair-dev/canva ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { canva } from '@corsair-dev/canva'; export const corsair = createCorsair({ plugins: [ canva(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Canva OAuth app. ```ts theme={null} canva() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'canva', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`assets.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.canva.api.assets.get({}); ``` **`assets.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.canva.api.assets.delete({}); ``` See the full list on the [API](/plugins/canva/api) page. ## Query synced data Synced entities support `tenant.canva.db..search()` and `.list()`: `assets`, `brandTemplates`, `designs`, `folders`. See [Database](/plugins/canva/database) for filters and operators. ## What's next > **[API reference](/plugins/canva/api)** > > Every `canva.api.*` operation with input and output types. > **[Database](/plugins/canva/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/canvas/api API reference for Canvas LMS: every `canvas.api.*` operation with input and output types. Every `canvas.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### closeNotificationForUser `accounts.closeNotificationForUser` Close an account notification for the current user **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.accounts.closeNotificationForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string, > notification_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### createAccountNotification `accounts.createAccountNotification` Creates a global notification within a Canvas account **Risk:** `write` ```ts theme={null} await corsair.canvas.api.accounts.createAccountNotification({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `uuid` | `string` | No | — | | `parent_account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `default_storage_quota_mb` | `number` | No | — | | `default_user_storage_quota_mb` | `number` | No | — | | `default_group_storage_quota_mb` | `number` | No | — | | `default_time_zone` | `string` | No | — | | `sis_account_id` | `string` | No | — | | `workflow_state` | `string` | No | — | *** ### getAccountGraphQl `accounts.getAccountGraphQl` Call Canvas GraphQL (/api/graphql); supply the query document and variables in input.body **Risk:** `write` ```ts theme={null} await corsair.canvas.api.accounts.getAccountGraphQl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### getAccountHelpLinks `accounts.getAccountHelpLinks` Retrieves help links configured for the specified Canvas account **Risk:** `read` ```ts theme={null} await corsair.canvas.api.accounts.getAccountHelpLinks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAccountNotifications `accounts.getAccountNotifications` Retrieve global account notifications for the current user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.accounts.getAccountNotifications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > uuid?: string, > parent_account_id?: string | number | null, > root_account_id?: string | number, > default_storage_quota_mb?: number, > default_user_storage_quota_mb?: number, > default_group_storage_quota_mb?: number, > default_time_zone?: string, > sis_account_id?: string | null, > workflow_state?: string > }[] > ``` *** ### getAccountsThatUsersCanCreateCoursesIn `accounts.getAccountsThatUsersCanCreateCoursesIn` Retrieves Canvas accounts where the current user can create courses **Risk:** `read` ```ts theme={null} await corsair.canvas.api.accounts.getAccountsThatUsersCanCreateCoursesIn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > course_code?: string, > uuid?: string, > sis_course_id?: string | null, > account_id?: string | number, > root_account_id?: string | number, > enrollment_term_id?: string | number, > workflow_state?: unpublished | available | completed | deleted | string, > start_at?: string | null, > end_at?: string | null, > created_at?: string > }[] > ``` *** ### getSingleAccount `accounts.getSingleAccount` Retrieve information on an individual account by ID **Risk:** `read` ```ts theme={null} await corsair.canvas.api.accounts.getSingleAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `uuid` | `string` | No | — | | `parent_account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `default_storage_quota_mb` | `number` | No | — | | `default_user_storage_quota_mb` | `number` | No | — | | `default_group_storage_quota_mb` | `number` | No | — | | `default_time_zone` | `string` | No | — | | `sis_account_id` | `string` | No | — | | `workflow_state` | `string` | No | — | *** ## Appointment Groups ### createAppointmentGroup `appointmentGroups.createAppointmentGroup` Creates a new appointment group in Canvas **Risk:** `write` ```ts theme={null} await corsair.canvas.api.appointmentGroups.createAppointmentGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### deleteAppointmentGroup `appointmentGroups.deleteAppointmentGroup` Permanently deletes an existing appointment group **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.appointmentGroups.deleteAppointmentGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > appointment_group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ## Assignment Groups ### createAssignmentGroup `assignmentGroups.createAssignmentGroup` Create a new assignment group for a course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.assignmentGroups.createAssignmentGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### getAnAssignmentGroup `assignmentGroups.getAnAssignmentGroup` Retrieves the assignment group with the given id **Risk:** `read` ```ts theme={null} await corsair.canvas.api.assignmentGroups.getAnAssignmentGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### getAssignmentGroup `assignmentGroups.getAssignmentGroup` Retrieve information about a specific assignment group by ID **Risk:** `write` ```ts theme={null} await corsair.canvas.api.assignmentGroups.getAssignmentGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ## Assignment Overrides ### createAssignmentOverride `assignmentOverrides.createAssignmentOverride` Creates an assignment override to adjust due/unlock/lock dates **Risk:** `write` ```ts theme={null} await corsair.canvas.api.assignmentOverrides.createAssignmentOverride({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `due_at` | `string` | No | — | | `lock_at` | `string` | No | — | | `unlock_at` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `assignment_group_id` | `string \| number` | No | — | | `points_possible` | `number` | No | — | | `grading_type` | `string` | No | — | | `published` | `boolean` | No | — | | `submission_types` | `string[]` | No | — | *** ### createBatchOverridesInACourse `assignmentOverrides.createBatchOverridesInACourse` Batch create assignment overrides for multiple assignments in a course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.assignmentOverrides.createBatchOverridesInACourse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number > }[] > ``` *** ### deleteAssignmentOverride `assignmentOverrides.deleteAssignmentOverride` Deletes an assignment override and returns its former details **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.assignmentOverrides.deleteAssignmentOverride({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string, > override_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getCourses12Assignments `assignmentOverrides.getCourses12Assignments` Batch retrieve assignment overrides in a course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.assignmentOverrides.getCourses12Assignments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > description?: string | null, > created_at?: string, > updated_at?: string, > due_at?: string | null, > lock_at?: string | null, > unlock_at?: string | null, > course_id?: string | number, > assignment_group_id?: string | number, > points_possible?: number | null, > grading_type?: string, > published?: boolean, > submission_types?: string[] > }[] > ``` *** ### getSingleAssignmentOverride `assignmentOverrides.getSingleAssignmentOverride` Retrieves details of the assignment override with the given id **Risk:** `read` ```ts theme={null} await corsair.canvas.api.assignmentOverrides.getSingleAssignmentOverride({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string, > override_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `due_at` | `string` | No | — | | `lock_at` | `string` | No | — | | `unlock_at` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `assignment_group_id` | `string \| number` | No | — | | `points_possible` | `number` | No | — | | `grading_type` | `string` | No | — | | `published` | `boolean` | No | — | | `submission_types` | `string[]` | No | — | *** ## Assignments ### createAssignment `assignments.createAssignment` Creates a new assignment within a specified course in Canvas LMS **Risk:** `write` ```ts theme={null} await corsair.canvas.api.assignments.createAssignment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `due_at` | `string` | No | — | | `lock_at` | `string` | No | — | | `unlock_at` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `assignment_group_id` | `string \| number` | No | — | | `points_possible` | `number` | No | — | | `grading_type` | `string` | No | — | | `published` | `boolean` | No | — | | `submission_types` | `string[]` | No | — | *** ### createAssignmentGraphQl `assignments.createAssignmentGraphQl` Call Canvas GraphQL (/api/graphql); supply the mutation document and variables in input.body **Risk:** `write` ```ts theme={null} await corsair.canvas.api.assignments.createAssignmentGraphQl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### deleteAssignment `assignments.deleteAssignment` Soft-deletes a specific assignment within a course **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.assignments.deleteAssignment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### editAssignment `assignments.editAssignment` Updates an existing assignment in a Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.assignments.editAssignment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `due_at` | `string` | No | — | | `lock_at` | `string` | No | — | | `unlock_at` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `assignment_group_id` | `string \| number` | No | — | | `points_possible` | `number` | No | — | | `grading_type` | `string` | No | — | | `published` | `boolean` | No | — | | `submission_types` | `string[]` | No | — | *** ### getAllAssignments `assignments.getAllAssignments` Retrieves assignments for a specific Canvas course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.assignments.getAllAssignments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > description?: string | null, > created_at?: string, > updated_at?: string, > due_at?: string | null, > lock_at?: string | null, > unlock_at?: string | null, > course_id?: string | number, > assignment_group_id?: string | number, > points_possible?: number | null, > grading_type?: string, > published?: boolean, > submission_types?: string[] > }[] > ``` *** ### getAssignment `assignments.getAssignment` Retrieves detailed information for a specific assignment **Risk:** `read` ```ts theme={null} await corsair.canvas.api.assignments.getAssignment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `due_at` | `string` | No | — | | `lock_at` | `string` | No | — | | `unlock_at` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `assignment_group_id` | `string \| number` | No | — | | `points_possible` | `number` | No | — | | `grading_type` | `string` | No | — | | `published` | `boolean` | No | — | | `submission_types` | `string[]` | No | — | *** ### getAssignment2 `assignments.getAssignment2` Call Canvas GraphQL (/api/graphql); supply the query document and variables in input.body **Risk:** `write` ```ts theme={null} await corsair.canvas.api.assignments.getAssignment2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### getSubmissionSummary `assignments.getSubmissionSummary` Retrieves submission summary counts for a specific assignment **Risk:** `read` ```ts theme={null} await corsair.canvas.api.assignments.getSubmissionSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `graded` | `number` | No | — | | `ungraded` | `number` | No | — | | `not_submitted` | `number` | No | — | *** ## Audit Reports ### getAuditLogs `auditReports.getAuditLogs` Access Canvas audit logs for a specified asset using GraphQL **Risk:** `write` ```ts theme={null} await corsair.canvas.api.auditReports.getAuditLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### getStatusOfLastReport `auditReports.getStatusOfLastReport` Retrieve the status of the last generated report for a course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.auditReports.getStatusOfLastReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > report_type: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Authentication ### getAuthenticationProvider `authentication.getAuthenticationProvider` Retrieves a specific authentication provider configuration **Risk:** `read` ```ts theme={null} await corsair.canvas.api.authentication.getAuthenticationProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string, > authentication_provider_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `uuid` | `string` | No | — | | `parent_account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `default_storage_quota_mb` | `number` | No | — | | `default_user_storage_quota_mb` | `number` | No | — | | `default_group_storage_quota_mb` | `number` | No | — | | `default_time_zone` | `string` | No | — | | `sis_account_id` | `string` | No | — | | `workflow_state` | `string` | No | — | *** ## Blackout Dates ### createBlackoutDateForCourse `blackoutDates.createBlackoutDateForCourse` Create a blackout date for the given course context **Risk:** `write` ```ts theme={null} await corsair.canvas.api.blackoutDates.createBlackoutDateForCourse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### deleteBlackoutDate `blackoutDates.deleteBlackoutDate` Delete a blackout date for the given course context **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.blackoutDates.deleteBlackoutDate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > blackout_date_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ## Blueprints ### getCoursesBlueprint `blueprints.getCoursesBlueprint` Retrieves blueprint subscription migrations for a Canvas course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.blueprints.getCoursesBlueprint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > subscription_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > course_code?: string, > uuid?: string, > sis_course_id?: string | null, > account_id?: string | number, > root_account_id?: string | number, > enrollment_term_id?: string | number, > workflow_state?: unpublished | available | completed | deleted | string, > start_at?: string | null, > end_at?: string | null, > created_at?: string > }[] > ``` *** ## Bookmarks ### createBookmark `bookmarks.createBookmark` Creates a new bookmark for the authenticated user **Risk:** `write` ```ts theme={null} await corsair.canvas.api.bookmarks.createBookmark({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### deleteBookmark `bookmarks.deleteBookmark` Deletes a bookmark from the current user bookmarks **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.bookmarks.deleteBookmark({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > bookmark_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getBookmark `bookmarks.getBookmark` Retrieves the details for a specific bookmark by ID **Risk:** `read` ```ts theme={null} await corsair.canvas.api.bookmarks.getBookmark({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > bookmark_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ## Brand Config ### getBrandVariables `brandConfig.getBrandVariables` Retrieve all brand configuration variables for the Canvas account **Risk:** `read` ```ts theme={null} await corsair.canvas.api.brandConfig.getBrandVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getInternalSettings `brandConfig.getInternalSettings` Retrieve all internal settings from Canvas using GraphQL **Risk:** `write` ```ts theme={null} await corsair.canvas.api.brandConfig.getInternalSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### getKalturaConfig `brandConfig.getKalturaConfig` Return the config information for the Kaltura plugin **Risk:** `read` ```ts theme={null} await corsair.canvas.api.brandConfig.getKalturaConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Calendar Events ### createCalendarEvent `calendarEvents.createCalendarEvent` Creates a calendar event with options for recurrence **Risk:** `write` ```ts theme={null} await corsair.canvas.api.calendarEvents.createCalendarEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | *** ### createOrUpdateTimetableEvents `calendarEvents.createOrUpdateTimetableEvents` Create or update timetable events for a course or section **Risk:** `write` ```ts theme={null} await corsair.canvas.api.calendarEvents.createOrUpdateTimetableEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### deleteCalendarEvent `calendarEvents.deleteCalendarEvent` Delete a calendar event from Canvas **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.calendarEvents.deleteCalendarEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > calendar_event_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ## Comment Bank ### deleteCommentBankItem `commentBank.deleteCommentBankItem` Delete a comment bank item from Canvas **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.commentBank.deleteCommentBankItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > comment_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ## Communication Channels ### createCommunicationChannel `communicationChannels.createCommunicationChannel` Creates a new communication channel for an existing Canvas user **Risk:** `write` ```ts theme={null} await corsair.canvas.api.communicationChannels.createCommunicationChannel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### deleteCommunicationChannel `communicationChannels.deleteCommunicationChannel` Deletes an existing communication channel for a user **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.communicationChannels.deleteCommunicationChannel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > communication_channel_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### deleteCommunicationChannelByTypeAndAddress `communicationChannels.deleteCommunicationChannelByTypeAndAddress` Deletes a communication channel by type and address **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.communicationChannels.deleteCommunicationChannelByTypeAndAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > type: string, > address: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ## Content Exports ### exportContent `contentExports.exportContent` Initiates an asynchronous export of course content from Canvas **Risk:** `write` ```ts theme={null} await corsair.canvas.api.contentExports.exportContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### exportGroupContent `contentExports.exportGroupContent` Begin a content export job for a group **Risk:** `write` ```ts theme={null} await corsair.canvas.api.contentExports.exportGroupContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### exportUserContent `contentExports.exportUserContent` Begin a content export job for a user **Risk:** `write` ```ts theme={null} await corsair.canvas.api.contentExports.exportUserContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ## Content Migrations ### createAContentMigration4 `contentMigrations.createAContentMigration4` Create a content migration for a Canvas user **Risk:** `write` ```ts theme={null} await corsair.canvas.api.contentMigrations.createAContentMigration4({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### createGroupContentMigration `contentMigrations.createGroupContentMigration` Create a content migration in a Canvas group **Risk:** `write` ```ts theme={null} await corsair.canvas.api.contentMigrations.createGroupContentMigration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### getAContentMigration3 `contentMigrations.getAContentMigration3` Retrieve data on an individual content migration from a group **Risk:** `read` ```ts theme={null} await corsair.canvas.api.contentMigrations.getAContentMigration3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > content_migration_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### getAContentMigration4 `contentMigrations.getAContentMigration4` Retrieve data on an individual content migration from a user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.contentMigrations.getAContentMigration4({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > content_migration_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ## Content Shares ### addUsersToContentShare `contentShares.addUsersToContentShare` Send a previously created content share to additional users **Risk:** `write` ```ts theme={null} await corsair.canvas.api.contentShares.addUsersToContentShare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > content_share_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### createContentShare `contentShares.createContentShare` Shares a Canvas content item to specified users **Risk:** `write` ```ts theme={null} await corsair.canvas.api.contentShares.createContentShare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### getContentShare `contentShares.getContentShare` Retrieves detailed information about a single content share **Risk:** `read` ```ts theme={null} await corsair.canvas.api.contentShares.getContentShare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > content_share_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### getContentSharesUnreadCount `contentShares.getContentSharesUnreadCount` Retrieve the count of unread content shares for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.contentShares.getContentSharesUnreadCount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `unread_count` | `number` | Yes | — | *** ## Conversations ### addConversationMessage `conversations.addConversationMessage` Add a message to an existing Canvas conversation **Risk:** `write` ```ts theme={null} await corsair.canvas.api.conversations.addConversationMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > conversation_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `subject` | `string` | No | — | | `workflow_state` | `string` | No | — | | `last_message` | `string` | No | — | | `last_message_at` | `string` | No | — | | `message_count` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `private` | `boolean` | No | — | | `starred` | `boolean` | No | — | *** ### addRecipientsToConversation `conversations.addRecipientsToConversation` Add recipients to an existing group conversation **Risk:** `write` ```ts theme={null} await corsair.canvas.api.conversations.addRecipientsToConversation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > conversation_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `subject` | `string` | No | — | | `workflow_state` | `string` | No | — | | `last_message` | `string` | No | — | | `last_message_at` | `string` | No | — | | `message_count` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `private` | `boolean` | No | — | | `starred` | `boolean` | No | — | *** ### createConversation `conversations.createConversation` Send messages in Canvas by creating a new conversation **Risk:** `write` ```ts theme={null} await corsair.canvas.api.conversations.createConversation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `subject` | `string` | No | — | | `workflow_state` | `string` | No | — | | `last_message` | `string` | No | — | | `last_message_at` | `string` | No | — | | `message_count` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `private` | `boolean` | No | — | | `starred` | `boolean` | No | — | *** ### createConversationGraphQl `conversations.createConversationGraphQl` Create a new conversation between users in Canvas via GraphQL **Risk:** `write` ```ts theme={null} await corsair.canvas.api.conversations.createConversationGraphQl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### deleteConversationMessages `conversations.deleteConversationMessages` Delete specific messages from a Canvas conversation **Risk:** `write` ```ts theme={null} await corsair.canvas.api.conversations.deleteConversationMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > conversation_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `subject` | `string` | No | — | | `workflow_state` | `string` | No | — | | `last_message` | `string` | No | — | | `last_message_at` | `string` | No | — | | `message_count` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `private` | `boolean` | No | — | | `starred` | `boolean` | No | — | *** ### deleteConversations `conversations.deleteConversations` Delete one or more Canvas conversations **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.conversations.deleteConversations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > conversation_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### editConversation `conversations.editConversation` Update attributes for a single conversation in Canvas **Risk:** `write` ```ts theme={null} await corsair.canvas.api.conversations.editConversation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > conversation_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `subject` | `string` | No | — | | `workflow_state` | `string` | No | — | | `last_message` | `string` | No | — | | `last_message_at` | `string` | No | — | | `message_count` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `private` | `boolean` | No | — | | `starred` | `boolean` | No | — | *** ### findRecipients `conversations.findRecipients` Find valid recipients that the current user can send messages to **Risk:** `read` ```ts theme={null} await corsair.canvas.api.conversations.findRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > sortable_name?: string, > short_name?: string, > sis_user_id?: string | null, > login_id?: string, > email?: string, > avatar_url?: string, > locale?: string | null, > effective_locale?: string > }[] > ``` *** ### getSingleConversation `conversations.getSingleConversation` Retrieve detailed information for a single conversation **Risk:** `read` ```ts theme={null} await corsair.canvas.api.conversations.getSingleConversation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > conversation_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `subject` | `string` | No | — | | `workflow_state` | `string` | No | — | | `last_message` | `string` | No | — | | `last_message_at` | `string` | No | — | | `message_count` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `private` | `boolean` | No | — | | `starred` | `boolean` | No | — | *** ### getUnreadCount `conversations.getUnreadCount` Get the number of unread conversations for the current user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.conversations.getUnreadCount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `unread_count` | `number` | Yes | — | *** ## Course Nicknames ### clearCourseNicknames `courseNicknames.clearCourseNicknames` Remove all stored course nicknames for the current user **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.courseNicknames.clearCourseNicknames({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ## Courses ### addCourseToFavorites `courses.addCourseToFavorites` Add a course to the current user favorites **Risk:** `write` ```ts theme={null} await corsair.canvas.api.courses.addCourseToFavorites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### createCourse `courses.createCourse` Create a new course in Canvas within a specified account **Risk:** `write` ```ts theme={null} await corsair.canvas.api.courses.createCourse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### getAccountCourse `courses.getAccountCourse` Retrieve information on a single course from a Canvas account **Risk:** `read` ```ts theme={null} await corsair.canvas.api.courses.getAccountCourse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string, > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### getCourseLevelParticipationData `courses.getCourseLevelParticipationData` Retrieves daily activity analytics for a specified Canvas course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.courses.getCourseLevelParticipationData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `any[]` *** ### getCoursePermissions `courses.getCoursePermissions` Returns permission information for the calling user in the given course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.courses.getCoursePermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSingleCourse `courses.getSingleCourse` Retrieve detailed information for a specific Canvas course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.courses.getSingleCourse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Discussions ### createDiscussionEntry `discussions.createDiscussionEntry` Create a new entry in a Canvas discussion topic **Risk:** `write` ```ts theme={null} await corsair.canvas.api.discussions.createDiscussionEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > topic_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `message` | `string` | No | — | | `html_url` | `string` | No | — | | `posted_at` | `string` | No | — | | `discussion_type` | `string` | No | — | | `published` | `boolean` | No | — | | `locked` | `boolean` | No | — | | `pinned` | `boolean` | No | — | *** ### createDiscussionEntryGraphQl `discussions.createDiscussionEntryGraphQl` Create a new entry in a Canvas discussion topic via GraphQL **Risk:** `write` ```ts theme={null} await corsair.canvas.api.discussions.createDiscussionEntryGraphQl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### createDiscussionTopic `discussions.createDiscussionTopic` Creates a new discussion topic in a specified Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.discussions.createDiscussionTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `message` | `string` | No | — | | `html_url` | `string` | No | — | | `posted_at` | `string` | No | — | | `discussion_type` | `string` | No | — | | `published` | `boolean` | No | — | | `locked` | `boolean` | No | — | | `pinned` | `boolean` | No | — | *** ### createDiscussionTopicGraphQl `discussions.createDiscussionTopicGraphQl` Create a new discussion topic via GraphQL API **Risk:** `write` ```ts theme={null} await corsair.canvas.api.discussions.createDiscussionTopicGraphQl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### deleteAnEntry `discussions.deleteAnEntry` Delete a discussion entry **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.discussions.deleteAnEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > topic_id: string, > entry_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### deleteDiscussionEntry `discussions.deleteDiscussionEntry` Delete a discussion entry via GraphQL **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.discussions.deleteDiscussionEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### deleteDiscussionTopicGraphQl `discussions.deleteDiscussionTopicGraphQl` Delete a discussion topic in Canvas via GraphQL **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.discussions.deleteDiscussionTopicGraphQl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### getSingleTopic `discussions.getSingleTopic` Retrieve detailed information about a single discussion topic **Risk:** `read` ```ts theme={null} await corsair.canvas.api.discussions.getSingleTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > topic_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `message` | `string` | No | — | | `html_url` | `string` | No | — | | `posted_at` | `string` | No | — | | `discussion_type` | `string` | No | — | | `published` | `boolean` | No | — | | `locked` | `boolean` | No | — | | `pinned` | `boolean` | No | — | *** ## Enrollments ### addLastAttendedDate `enrollments.addLastAttendedDate` Add or update the last attended date for a student enrollment **Risk:** `write` ```ts theme={null} await corsair.canvas.api.enrollments.addLastAttendedDate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### concludeDeactivateOrDeleteEnrollment `enrollments.concludeDeactivateOrDeleteEnrollment` Conclude, deactivate, or delete an enrollment in a Canvas course **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.enrollments.concludeDeactivateOrDeleteEnrollment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > enrollment_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### createEnrollment `enrollments.createEnrollment` Enrolls a user in a Canvas course with a specified role and status **Risk:** `write` ```ts theme={null} await corsair.canvas.api.enrollments.createEnrollment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `user_id` | `string \| number` | No | — | | `course_id` | `string \| number` | No | — | | `type` | `string` | No | — | | `enrollment_state` | `string` | No | — | | `role` | `string` | No | — | | `role_id` | `string \| number` | No | — | | `last_activity_at` | `string` | No | — | | `last_attended_at` | `string` | No | — | *** ### getEnrollmentInvitations `enrollments.getEnrollmentInvitations` Retrieve pending enrollment invitations for the current user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.enrollments.getEnrollmentInvitations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > user_id?: string | number, > course_id?: string | number, > type?: string, > enrollment_state?: string, > role?: string, > role_id?: string | number, > last_activity_at?: string | null, > last_attended_at?: string | null > }[] > ``` *** ## E Portfolios ### getAllEPortfoliosForUser `ePortfolios.getAllEPortfoliosForUser` Retrieve all ePortfolios for a specified user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.ePortfolios.getAllEPortfoliosForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > sortable_name?: string, > short_name?: string, > sis_user_id?: string | null, > login_id?: string, > email?: string, > avatar_url?: string, > locale?: string | null, > effective_locale?: string > }[] > ``` *** ## Epub Exports ### createEpubExport `epubExports.createEpubExport` Initiate an ePub export for a course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.epubExports.createEpubExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ## External Feeds ### createExternalFeed `externalFeeds.createExternalFeed` Creates a new external RSS or Atom feed for a Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.externalFeeds.createExternalFeed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### createExternalFeedForGroup `externalFeeds.createExternalFeedForGroup` Create a new external RSS or Atom feed for a Canvas group **Risk:** `write` ```ts theme={null} await corsair.canvas.api.externalFeeds.createExternalFeedForGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### deleteExternalFeedFromGroup `externalFeeds.deleteExternalFeedFromGroup` Deletes the external feed from the specified group **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.externalFeeds.deleteExternalFeedFromGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > external_feed_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ## External Tools ### createExternalTool `externalTools.createExternalTool` Create an external tool in a Canvas account **Risk:** `write` ```ts theme={null} await corsair.canvas.api.externalTools.createExternalTool({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `uuid` | `string` | No | — | | `parent_account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `default_storage_quota_mb` | `number` | No | — | | `default_user_storage_quota_mb` | `number` | No | — | | `default_group_storage_quota_mb` | `number` | No | — | | `default_time_zone` | `string` | No | — | | `sis_account_id` | `string` | No | — | | `workflow_state` | `string` | No | — | *** ### createExternalToolInCourse `externalTools.createExternalToolInCourse` Create an external tool in a Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.externalTools.createExternalToolInCourse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### createLtiResourceLink `externalTools.createLtiResourceLink` Creates a new LTI Resource Link in a Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.externalTools.createLtiResourceLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### deleteAnExternalTool `externalTools.deleteAnExternalTool` Remove the specified external tool from a course **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.externalTools.deleteAnExternalTool({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > external_tool_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getASingleExternalTool2 `externalTools.getASingleExternalTool2` Retrieve detailed information for a specific external tool in a course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.externalTools.getASingleExternalTool2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > external_tool_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### getSingleExternalTool `externalTools.getSingleExternalTool` Retrieve detailed information for a specific external tool **Risk:** `read` ```ts theme={null} await corsair.canvas.api.externalTools.getSingleExternalTool({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string, > external_tool_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `uuid` | `string` | No | — | | `parent_account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `default_storage_quota_mb` | `number` | No | — | | `default_user_storage_quota_mb` | `number` | No | — | | `default_group_storage_quota_mb` | `number` | No | — | | `default_time_zone` | `string` | No | — | | `sis_account_id` | `string` | No | — | | `workflow_state` | `string` | No | — | *** ## Fetch Data ### fetchData `fetchData.fetchData` Fetches a specific category of Canvas data (accounts, courses, users, etc.) **Risk:** `read` ```ts theme={null} await corsair.canvas.api.fetchData.fetchData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > resource: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | *** ## Files ### copyFileToFolder `files.copyFileToFolder` Copies an existing Canvas file to a specified destination folder **Risk:** `write` ```ts theme={null} await corsair.canvas.api.files.copyFileToFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > dest_folder_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `uuid` | `string` | No | — | | `folder_id` | `string \| number` | No | — | | `display_name` | `string` | No | — | | `filename` | `string` | No | — | | `content_type` | `string` | No | — | | `url` | `string` | No | — | | `size` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### copyFolder `files.copyFolder` Copy a folder to another folder in Canvas **Risk:** `write` ```ts theme={null} await corsair.canvas.api.files.copyFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > dest_folder_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `uuid` | `string` | No | — | | `folder_id` | `string \| number` | No | — | | `display_name` | `string` | No | — | | `filename` | `string` | No | — | | `content_type` | `string` | No | — | | `url` | `string` | No | — | | `size` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### createFiles `files.createFiles` Initiate file upload to Canvas (Step 1 of 3-step process) **Risk:** `write` ```ts theme={null} await corsair.canvas.api.files.createFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `uuid` | `string` | No | — | | `folder_id` | `string \| number` | No | — | | `display_name` | `string` | No | — | | `filename` | `string` | No | — | | `content_type` | `string` | No | — | | `url` | `string` | No | — | | `size` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### createFolder `files.createFolder` Create a folder in the specified context for a user **Risk:** `write` ```ts theme={null} await corsair.canvas.api.files.createFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `uuid` | `string` | No | — | | `folder_id` | `string \| number` | No | — | | `display_name` | `string` | No | — | | `filename` | `string` | No | — | | `content_type` | `string` | No | — | | `url` | `string` | No | — | | `size` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### createFolderInGroup `files.createFolderInGroup` Create a folder within a Canvas group **Risk:** `write` ```ts theme={null} await corsair.canvas.api.files.createFolderInGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `uuid` | `string` | No | — | | `folder_id` | `string \| number` | No | — | | `display_name` | `string` | No | — | | `filename` | `string` | No | — | | `content_type` | `string` | No | — | | `url` | `string` | No | — | | `size` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### deleteFile `files.deleteFile` Remove a file from Canvas **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.files.deleteFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > file_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### deleteFolder `files.deleteFolder` Permanently deletes an existing folder **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.files.deleteFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > folder_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getFolderById `files.getFolderById` Retrieves the details for a specific folder by its ID **Risk:** `read` ```ts theme={null} await corsair.canvas.api.files.getFolderById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > folder_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `uuid` | `string` | No | — | | `folder_id` | `string \| number` | No | — | | `display_name` | `string` | No | — | | `filename` | `string` | No | — | | `content_type` | `string` | No | — | | `url` | `string` | No | — | | `size` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### getGroupFolder `files.getGroupFolder` Retrieves the details for a folder within a Canvas group **Risk:** `read` ```ts theme={null} await corsair.canvas.api.files.getGroupFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > folder_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `uuid` | `string` | No | — | | `folder_id` | `string \| number` | No | — | | `display_name` | `string` | No | — | | `filename` | `string` | No | — | | `content_type` | `string` | No | — | | `url` | `string` | No | — | | `size` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### getQuotaInformation `files.getQuotaInformation` Retrieves the total and used storage quota for a Canvas user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.files.getQuotaInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `quota` | `number` | No | — | | `quota_used` | `number` | No | — | *** ## Gradebook Columns ### createCustomGradebookColumn `gradebookColumns.createCustomGradebookColumn` Creates a new custom gradebook column in a course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.gradebookColumns.createCustomGradebookColumn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### deleteCustomGradebookColumn `gradebookColumns.deleteCustomGradebookColumn` Permanently deletes a custom gradebook column **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.gradebookColumns.deleteCustomGradebookColumn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > column_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### updateCustomGradebookColumnData `gradebookColumns.updateCustomGradebookColumnData` Bulk updates custom gradebook column data for multiple students **Risk:** `write` ```ts theme={null} await corsair.canvas.api.gradebookColumns.updateCustomGradebookColumnData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > column_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Grading ### createCourseGradingStandard `grading.createCourseGradingStandard` Create a new grading standard in a Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.grading.createCourseGradingStandard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### deleteCustomGradeStatus `grading.deleteCustomGradeStatus` Delete a custom grade status from Canvas **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.grading.deleteCustomGradeStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string, > custom_grade_status_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getSingleGradingStandardIn2 `grading.getSingleGradingStandardIn2` Retrieves a single grading standard for the given course context **Risk:** `read` ```ts theme={null} await corsair.canvas.api.grading.getSingleGradingStandardIn2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > grading_standard_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Graphql ### getLegacyNode `graphql.getLegacyNode` Call Canvas GraphQL (/api/graphql); supply the query document and variables in input.body **Risk:** `write` ```ts theme={null} await corsair.canvas.api.graphql.getLegacyNode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ## Group Categories ### assignUnassignedMembersToGroupCategory `groupCategories.assignUnassignedMembersToGroupCategory` Assign unassigned members to groups within a group category **Risk:** `write` ```ts theme={null} await corsair.canvas.api.groupCategories.assignUnassignedMembersToGroupCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_category_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### createGroupCategoryCourses `groupCategories.createGroupCategoryCourses` Creates a new group category within a specified Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.groupCategories.createGroupCategoryCourses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### createGroupInSet `groupCategories.createGroupInSet` Create a new group within a Canvas group set **Risk:** `write` ```ts theme={null} await corsair.canvas.api.groupCategories.createGroupInSet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_category_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### createGroupSet `groupCategories.createGroupSet` Create a new group set (group category) in a Canvas account **Risk:** `write` ```ts theme={null} await corsair.canvas.api.groupCategories.createGroupSet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ## Group Discussions ### createGroupDiscussionTopic `groupDiscussions.createGroupDiscussionTopic` Create a new discussion topic in a Canvas group **Risk:** `write` ```ts theme={null} await corsair.canvas.api.groupDiscussions.createGroupDiscussionTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `message` | `string` | No | — | | `html_url` | `string` | No | — | | `posted_at` | `string` | No | — | | `discussion_type` | `string` | No | — | | `published` | `boolean` | No | — | | `locked` | `boolean` | No | — | | `pinned` | `boolean` | No | — | *** ### deleteAnEntry2 `groupDiscussions.deleteAnEntry2` Delete a discussion entry in a group discussion **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.groupDiscussions.deleteAnEntry2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > topic_id: string, > entry_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### deleteGroupDiscussionTopic `groupDiscussions.deleteGroupDiscussionTopic` Deletes a discussion topic from a group **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.groupDiscussions.deleteGroupDiscussionTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > topic_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### duplicateGroupDiscussionTopic `groupDiscussions.duplicateGroupDiscussionTopic` Duplicate an existing discussion topic in a Canvas group **Risk:** `write` ```ts theme={null} await corsair.canvas.api.groupDiscussions.duplicateGroupDiscussionTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > topic_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `message` | `string` | No | — | | `html_url` | `string` | No | — | | `posted_at` | `string` | No | — | | `discussion_type` | `string` | No | — | | `published` | `boolean` | No | — | | `locked` | `boolean` | No | — | | `pinned` | `boolean` | No | — | *** ### getFullTopicGroups `groupDiscussions.getFullTopicGroups` Retrieve the full cached structure of a group discussion topic **Risk:** `read` ```ts theme={null} await corsair.canvas.api.groupDiscussions.getFullTopicGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > topic_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSingleTopic2 `groupDiscussions.getSingleTopic2` Retrieve detailed information about a single group discussion topic **Risk:** `read` ```ts theme={null} await corsair.canvas.api.groupDiscussions.getSingleTopic2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > topic_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `message` | `string` | No | — | | `html_url` | `string` | No | — | | `posted_at` | `string` | No | — | | `discussion_type` | `string` | No | — | | `published` | `boolean` | No | — | | `locked` | `boolean` | No | — | | `pinned` | `boolean` | No | — | *** ## Group Memberships ### createMembership `groupMemberships.createMembership` Join or request to join a group **Risk:** `write` ```ts theme={null} await corsair.canvas.api.groupMemberships.createMembership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### getASingleGroupMembership `groupMemberships.getASingleGroupMembership` Retrieve a single group membership by its membership\_id **Risk:** `read` ```ts theme={null} await corsair.canvas.api.groupMemberships.getASingleGroupMembership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > membership_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### getASingleGroupMembership2 `groupMemberships.getASingleGroupMembership2` Retrieve a single group membership by user\_id **Risk:** `read` ```ts theme={null} await corsair.canvas.api.groupMemberships.getASingleGroupMembership2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ## Groups ### addGroupToFavorites `groups.addGroupToFavorites` Add a group to the current user favorites **Risk:** `write` ```ts theme={null} await corsair.canvas.api.groups.addGroupToFavorites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### createGroup `groups.createGroup` Create a new community group directly **Risk:** `write` ```ts theme={null} await corsair.canvas.api.groups.createGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### deleteGroup `groups.deleteGroup` Deletes a group and removes all members **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.groups.deleteGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getGroup `groups.getGroup` Retrieves detailed information for a single Canvas group **Risk:** `read` ```ts theme={null} await corsair.canvas.api.groups.getGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### getGroupActivityStreamSummary `groups.getGroupActivityStreamSummary` Retrieves a summary of the group-specific activity stream **Risk:** `read` ```ts theme={null} await corsair.canvas.api.groups.getGroupActivityStreamSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `any[]` *** ### getGroupPermissions `groups.getGroupPermissions` Returns permission information for the calling user in the group **Risk:** `read` ```ts theme={null} await corsair.canvas.api.groups.getGroupPermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Late Policy ### getALatePolicy `latePolicy.getALatePolicy` Retrieve the late policy for a Canvas course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.latePolicy.getALatePolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Modules ### createModule `modules.createModule` Creates a new organizational module within a specified Canvas LMS course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.modules.createModule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `position` | `number` | No | — | | `unlock_at` | `string` | No | — | | `require_sequential_progress` | `boolean` | No | — | | `publish_final_grade` | `boolean` | No | — | | `prerequisite_module_ids` | `(string \| number)[]` | No | — | | `published` | `boolean` | No | — | | `items_count` | `number` | No | — | *** ### createModuleGraphQl `modules.createModuleGraphQl` Create a new module in a Canvas course via GraphQL **Risk:** `write` ```ts theme={null} await corsair.canvas.api.modules.createModuleGraphQl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### createModuleItem `modules.createModuleItem` Create and return a new module item within a Canvas course module **Risk:** `write` ```ts theme={null} await corsair.canvas.api.modules.createModuleItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > module_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `position` | `number` | No | — | | `unlock_at` | `string` | No | — | | `require_sequential_progress` | `boolean` | No | — | | `publish_final_grade` | `boolean` | No | — | | `prerequisite_module_ids` | `(string \| number)[]` | No | — | | `published` | `boolean` | No | — | | `items_count` | `number` | No | — | *** ### getModuleItem `modules.getModuleItem` Retrieve information about a specific module item by ID using GraphQL **Risk:** `write` ```ts theme={null} await corsair.canvas.api.modules.getModuleItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### getModuleItemSequence `modules.getModuleItemSequence` Find the module item sequence for a given asset in a Canvas course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.modules.getModuleItemSequence({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Outcome Groups ### createLinkOutcomeCourses `outcomeGroups.createLinkOutcomeCourses` Link an existing outcome or create a new outcome within a course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.outcomeGroups.createLinkOutcomeCourses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > outcome_group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### createSubgroupCourses `outcomeGroups.createSubgroupCourses` Creates a new empty subgroup under the outcome group **Risk:** `write` ```ts theme={null} await corsair.canvas.api.outcomeGroups.createSubgroupCourses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > outcome_group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### deleteAnOutcomeGroupCourses `outcomeGroups.deleteAnOutcomeGroupCourses` Deletes an outcome group from a course **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.outcomeGroups.deleteAnOutcomeGroupCourses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > outcome_group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getAccountsOutcomeGroups `outcomeGroups.getAccountsOutcomeGroups` Retrieve a specific outcome group from a Canvas account **Risk:** `read` ```ts theme={null} await corsair.canvas.api.outcomeGroups.getAccountsOutcomeGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string, > outcome_group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### getAllOutcomeGroupsForContext `outcomeGroups.getAllOutcomeGroupsForContext` Retrieve all outcome groups for an account context **Risk:** `read` ```ts theme={null} await corsair.canvas.api.outcomeGroups.getAllOutcomeGroupsForContext({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > description?: string | null, > is_public?: boolean, > followed_by_user?: boolean, > join_level?: string, > members_count?: number, > avatar_url?: string, > context_type?: string, > course_id?: string | number, > account_id?: string | number > }[] > ``` *** ### getAllOutcomeGroupsForContext2 `outcomeGroups.getAllOutcomeGroupsForContext2` Retrieve all outcome groups for a course context **Risk:** `read` ```ts theme={null} await corsair.canvas.api.outcomeGroups.getAllOutcomeGroupsForContext2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > description?: string | null, > is_public?: boolean, > followed_by_user?: boolean, > join_level?: string, > members_count?: number, > avatar_url?: string, > context_type?: string, > course_id?: string | number, > account_id?: string | number > }[] > ``` *** ### getAllOutcomeLinksForContext `outcomeGroups.getAllOutcomeLinksForContext` Retrieves all outcome links for an account context **Risk:** `read` ```ts theme={null} await corsair.canvas.api.outcomeGroups.getAllOutcomeLinksForContext({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > uuid?: string, > parent_account_id?: string | number | null, > root_account_id?: string | number, > default_storage_quota_mb?: number, > default_user_storage_quota_mb?: number, > default_group_storage_quota_mb?: number, > default_time_zone?: string, > sis_account_id?: string | null, > workflow_state?: string > }[] > ``` *** ### getAllOutcomeLinksForContext2 `outcomeGroups.getAllOutcomeLinksForContext2` Retrieves all outcome links for a course context **Risk:** `read` ```ts theme={null} await corsair.canvas.api.outcomeGroups.getAllOutcomeLinksForContext2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > course_code?: string, > uuid?: string, > sis_course_id?: string | null, > account_id?: string | number, > root_account_id?: string | number, > enrollment_term_id?: string | number, > workflow_state?: unpublished | available | completed | deleted | string, > start_at?: string | null, > end_at?: string | null, > created_at?: string > }[] > ``` *** ### getGlobalOutcomeGroup `outcomeGroups.getGlobalOutcomeGroup` Retrieves a global outcome group by ID from Canvas **Risk:** `read` ```ts theme={null} await corsair.canvas.api.outcomeGroups.getGlobalOutcomeGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > outcome_group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ### getRootOutcomeGroupForCourse `outcomeGroups.getRootOutcomeGroupForCourse` Retrieves the root outcome group for a specified course context **Risk:** `read` ```ts theme={null} await corsair.canvas.api.outcomeGroups.getRootOutcomeGroupForCourse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_public` | `boolean` | No | — | | `followed_by_user` | `boolean` | No | — | | `join_level` | `string` | No | — | | `members_count` | `number` | No | — | | `avatar_url` | `string` | No | — | | `context_type` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `account_id` | `string \| number` | No | — | *** ## Outcomes ### createLearningOutcome `outcomes.createLearningOutcome` Create a new learning outcome in Canvas using GraphQL **Risk:** `write` ```ts theme={null} await corsair.canvas.api.outcomes.createLearningOutcome({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### deleteOutcomeLinks `outcomes.deleteOutcomeLinks` Delete links between outcomes and content in Canvas **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.outcomes.deleteOutcomeLinks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### getAlignedAssignmentsForAnOutcome `outcomes.getAlignedAssignmentsForAnOutcome` Retrieves outcome alignments for a student or assignment **Risk:** `read` ```ts theme={null} await corsair.canvas.api.outcomes.getAlignedAssignmentsForAnOutcome({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > description?: string | null, > created_at?: string, > updated_at?: string, > due_at?: string | null, > lock_at?: string | null, > unlock_at?: string | null, > course_id?: string | number, > assignment_group_id?: string | number, > points_possible?: number | null, > grading_type?: string, > published?: boolean, > submission_types?: string[] > }[] > ``` *** ### getOutcomeResults `outcomes.getOutcomeResults` Get outcome results for users and outcomes in a course context **Risk:** `read` ```ts theme={null} await corsair.canvas.api.outcomes.getOutcomeResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `outcome_results` | `any[]` | Yes | — | | `linked` | `object` | No | — | > **linked full type** > > ```ts theme={null} > { > } > ``` *** ## Pages ### createPageForCourse `pages.createPageForCourse` Creates a new wiki page in a specified Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.pages.createPageForCourse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string \| number` | No | — | | `url` | `string` | No | — | | `title` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `hide_from_students` | `boolean` | No | — | | `editing_roles` | `string` | No | — | | `published` | `boolean` | No | — | | `front_page` | `boolean` | No | — | | `html_url` | `string` | No | — | *** ### createPageForGroup `pages.createPageForGroup` Creates a new wiki page in a specified Canvas group **Risk:** `write` ```ts theme={null} await corsair.canvas.api.pages.createPageForGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string \| number` | No | — | | `url` | `string` | No | — | | `title` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `hide_from_students` | `boolean` | No | — | | `editing_roles` | `string` | No | — | | `published` | `boolean` | No | — | | `front_page` | `boolean` | No | — | | `html_url` | `string` | No | — | *** ### deletePageForGroup `pages.deletePageForGroup` Deletes a wiki page from a Canvas group **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.pages.deletePageForGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > group_id: string, > url_or_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getPageForCourse `pages.getPageForCourse` Retrieves a specific content page by its URL or ID from a course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.pages.getPageForCourse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > url_or_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string \| number` | No | — | | `url` | `string` | No | — | | `title` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `hide_from_students` | `boolean` | No | — | | `editing_roles` | `string` | No | — | | `published` | `boolean` | No | — | | `front_page` | `boolean` | No | — | | `html_url` | `string` | No | — | *** ## Peer Reviews ### getAllPeerReviews `peerReviews.getAllPeerReviews` Retrieves all peer reviews for a specific submission **Risk:** `read` ```ts theme={null} await corsair.canvas.api.peerReviews.getAllPeerReviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string, > submission_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > description?: string | null, > created_at?: string, > updated_at?: string, > due_at?: string | null, > lock_at?: string | null, > unlock_at?: string | null, > course_id?: string | number, > assignment_group_id?: string | number, > points_possible?: number | null, > grading_type?: string, > published?: boolean, > submission_types?: string[] > }[] > ``` *** ### getAllPeerReviewsForSectionAssignment `peerReviews.getAllPeerReviewsForSectionAssignment` Retrieves all peer reviews for a specific assignment within a section **Risk:** `read` ```ts theme={null} await corsair.canvas.api.peerReviews.getAllPeerReviewsForSectionAssignment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > section_id: string, > assignment_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > description?: string | null, > created_at?: string, > updated_at?: string, > due_at?: string | null, > lock_at?: string | null, > unlock_at?: string | null, > course_id?: string | number, > assignment_group_id?: string | number, > points_possible?: number | null, > grading_type?: string, > published?: boolean, > submission_types?: string[] > }[] > ``` *** ### getAllPeerReviewsForSectionSubmission `peerReviews.getAllPeerReviewsForSectionSubmission` Retrieves all peer reviews for a specific submission within a section **Risk:** `read` ```ts theme={null} await corsair.canvas.api.peerReviews.getAllPeerReviewsForSectionSubmission({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > section_id: string, > assignment_id: string, > submission_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > description?: string | null, > created_at?: string, > updated_at?: string, > due_at?: string | null, > lock_at?: string | null, > unlock_at?: string | null, > course_id?: string | number, > assignment_group_id?: string | number, > points_possible?: number | null, > grading_type?: string, > published?: boolean, > submission_types?: string[] > }[] > ``` *** ## Planner ### createPlannerNote `planner.createPlannerNote` Create a planner note for the current user **Risk:** `write` ```ts theme={null} await corsair.canvas.api.planner.createPlannerNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | *** ### createPlannerOverride `planner.createPlannerOverride` Create a planner override for the current user **Risk:** `write` ```ts theme={null} await corsair.canvas.api.planner.createPlannerOverride({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | *** ### deletePlannerNote `planner.deletePlannerNote` Delete a planner note for the current user **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.planner.deletePlannerNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > planner_note_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### deletePlannerOverride `planner.deletePlannerOverride` Delete a planner override for the current user **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.planner.deletePlannerOverride({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > planner_override_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ## Polls ### createSinglePoll `polls.createSinglePoll` Create a new poll for the current user in Canvas **Risk:** `write` ```ts theme={null} await corsair.canvas.api.polls.createSinglePoll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `polls` | `any[]` | Yes | — | *** ### createSinglePollChoice `polls.createSinglePollChoice` Create one or more poll choices for an existing poll **Risk:** `write` ```ts theme={null} await corsair.canvas.api.polls.createSinglePollChoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > poll_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `poll_choices` | `any[]` | Yes | — | *** ### createSinglePollSession `polls.createSinglePollSession` Create a new poll session for a poll in Canvas **Risk:** `write` ```ts theme={null} await corsair.canvas.api.polls.createSinglePollSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > poll_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `poll_sessions` | `any[]` | Yes | — | *** ### createSinglePollSubmission `polls.createSinglePollSubmission` Create a new poll submission for a poll session **Risk:** `write` ```ts theme={null} await corsair.canvas.api.polls.createSinglePollSubmission({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > poll_id: string, > poll_session_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `poll_submissions` | `any[]` | Yes | — | *** ### deletePoll `polls.deletePoll` Permanently deletes the poll identified by id **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.polls.deletePoll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > poll_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### deletePollChoice `polls.deletePollChoice` Delete a poll choice from a Canvas poll **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.polls.deletePollChoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > poll_id: string, > poll_choice_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### deletePollSession `polls.deletePollSession` Permanently delete a poll session from a poll **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.polls.deletePollSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > poll_id: string, > poll_session_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getSinglePoll `polls.getSinglePoll` Retrieve a single poll by its ID from Canvas **Risk:** `read` ```ts theme={null} await corsair.canvas.api.polls.getSinglePoll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > poll_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | *** ### getSinglePollChoice `polls.getSinglePollChoice` Retrieve a single poll choice by its ID **Risk:** `read` ```ts theme={null} await corsair.canvas.api.polls.getSinglePollChoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > poll_id: string, > poll_choice_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | *** ## Quiz Reports ### abortQuizReportGeneration `quizReports.abortQuizReportGeneration` Aborts the generation of a quiz report or removes a previously generated one **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.quizReports.abortQuizReportGeneration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string, > report_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### createQuizReport `quizReports.createQuizReport` Create a quiz report in Canvas (student or item analysis) **Risk:** `write` ```ts theme={null} await corsair.canvas.api.quizReports.createQuizReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `html_url` | `string` | No | — | | `mobile_url` | `string` | No | — | | `description` | `string` | No | — | | `quiz_type` | `string` | No | — | | `assignment_id` | `string \| number` | No | — | | `time_limit` | `number` | No | — | | `published` | `boolean` | No | — | | `points_possible` | `number` | No | — | *** ### getQuizReport `quizReports.getQuizReport` Retrieves the data for a single quiz report **Risk:** `read` ```ts theme={null} await corsair.canvas.api.quizReports.getQuizReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string, > report_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `html_url` | `string` | No | — | | `mobile_url` | `string` | No | — | | `description` | `string` | No | — | | `quiz_type` | `string` | No | — | | `assignment_id` | `string \| number` | No | — | | `time_limit` | `number` | No | — | | `published` | `boolean` | No | — | | `points_possible` | `number` | No | — | *** ## Quizzes ### answerQuizQuestions `quizzes.answerQuizQuestions` Provide or update answers to quiz questions for a quiz submission **Risk:** `write` ```ts theme={null} await corsair.canvas.api.quizzes.answerQuizQuestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > quiz_submission_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `html_url` | `string` | No | — | | `mobile_url` | `string` | No | — | | `description` | `string` | No | — | | `quiz_type` | `string` | No | — | | `assignment_id` | `string \| number` | No | — | | `time_limit` | `number` | No | — | | `published` | `boolean` | No | — | | `points_possible` | `number` | No | — | *** ### createQuestionGroup `quizzes.createQuestionGroup` Create one or more question groups for a quiz **Risk:** `write` ```ts theme={null} await corsair.canvas.api.quizzes.createQuestionGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `html_url` | `string` | No | — | | `mobile_url` | `string` | No | — | | `description` | `string` | No | — | | `quiz_type` | `string` | No | — | | `assignment_id` | `string \| number` | No | — | | `time_limit` | `number` | No | — | | `published` | `boolean` | No | — | | `points_possible` | `number` | No | — | *** ### createQuiz `quizzes.createQuiz` Creates a new quiz with various settings in a Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.quizzes.createQuiz({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `html_url` | `string` | No | — | | `mobile_url` | `string` | No | — | | `description` | `string` | No | — | | `quiz_type` | `string` | No | — | | `assignment_id` | `string \| number` | No | — | | `time_limit` | `number` | No | — | | `published` | `boolean` | No | — | | `points_possible` | `number` | No | — | *** ### createQuizQuestion `quizzes.createQuizQuestion` Creates a new question for an existing quiz within a course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.quizzes.createQuizQuestion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `html_url` | `string` | No | — | | `mobile_url` | `string` | No | — | | `description` | `string` | No | — | | `quiz_type` | `string` | No | — | | `assignment_id` | `string \| number` | No | — | | `time_limit` | `number` | No | — | | `published` | `boolean` | No | — | | `points_possible` | `number` | No | — | *** ### createQuizSubmission `quizzes.createQuizSubmission` Start taking a quiz by creating a quiz submission **Risk:** `write` ```ts theme={null} await corsair.canvas.api.quizzes.createQuizSubmission({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `html_url` | `string` | No | — | | `mobile_url` | `string` | No | — | | `description` | `string` | No | — | | `quiz_type` | `string` | No | — | | `assignment_id` | `string \| number` | No | — | | `time_limit` | `number` | No | — | | `published` | `boolean` | No | — | | `points_possible` | `number` | No | — | *** ### deleteQuiz `quizzes.deleteQuiz` Permanently deletes the quiz identified by quiz\_id from the course **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.quizzes.deleteQuiz({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### editQuiz `quizzes.editQuiz` Modifies an existing Canvas quiz **Risk:** `write` ```ts theme={null} await corsair.canvas.api.quizzes.editQuiz({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `html_url` | `string` | No | — | | `mobile_url` | `string` | No | — | | `description` | `string` | No | — | | `quiz_type` | `string` | No | — | | `assignment_id` | `string \| number` | No | — | | `time_limit` | `number` | No | — | | `published` | `boolean` | No | — | | `points_possible` | `number` | No | — | *** ### getQuizStatistics `quizzes.getQuizStatistics` Fetch the latest quiz statistics for a Canvas quiz **Risk:** `read` ```ts theme={null} await corsair.canvas.api.quizzes.getQuizStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `quiz_statistics` | `any[]` | Yes | — | *** ### getSingleQuiz `quizzes.getSingleQuiz` Retrieves detailed information for a specific quiz in a course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.quizzes.getSingleQuiz({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > quiz_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `title` | `string` | No | — | | `html_url` | `string` | No | — | | `mobile_url` | `string` | No | — | | `description` | `string` | No | — | | `quiz_type` | `string` | No | — | | `assignment_id` | `string \| number` | No | — | | `time_limit` | `number` | No | — | | `published` | `boolean` | No | — | | `points_possible` | `number` | No | — | *** ## Rubrics ### createRubric `rubrics.createRubric` Create a rubric in a Canvas course **Risk:** `write` ```ts theme={null} await corsair.canvas.api.rubrics.createRubric({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `course_code` | `string` | No | — | | `uuid` | `string` | No | — | | `sis_course_id` | `string` | No | — | | `account_id` | `string \| number` | No | — | | `root_account_id` | `string \| number` | No | — | | `enrollment_term_id` | `string \| number` | No | — | | `workflow_state` | `unpublished \| available \| completed \| deleted \| string` | No | — | | `start_at` | `string` | No | — | | `end_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### getAssignmentRubric `rubrics.getAssignmentRubric` Fetches the detailed rubric for a specified assignment **Risk:** `read` ```ts theme={null} await corsair.canvas.api.rubrics.getAssignmentRubric({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `due_at` | `string` | No | — | | `lock_at` | `string` | No | — | | `unlock_at` | `string` | No | — | | `course_id` | `string \| number` | No | — | | `assignment_group_id` | `string \| number` | No | — | | `points_possible` | `number` | No | — | | `grading_type` | `string` | No | — | | `published` | `boolean` | No | — | | `submission_types` | `string[]` | No | — | *** ### getRubricAssessmentsReadState `rubrics.getRubricAssessmentsReadState` Check whether rubric comments/grading have been seen by the student **Risk:** `read` ```ts theme={null} await corsair.canvas.api.rubrics.getRubricAssessmentsReadState({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > assignment_id: string, > submission_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRubricsUploadTemplate `rubrics.getRubricsUploadTemplate` Retrieve a CSV template file for importing rubrics **Risk:** `read` ```ts theme={null} await corsair.canvas.api.rubrics.getRubricsUploadTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > string | { > id: string | number > } | undefined > ``` *** ## Submissions ### createSubmissionDraft `submissions.createSubmissionDraft` Create a draft submission for an assignment in Canvas via GraphQL **Risk:** `write` ```ts theme={null} await corsair.canvas.api.submissions.createSubmissionDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### deleteSubmissionDraft `submissions.deleteSubmissionDraft` Delete a submission draft in Canvas via GraphQL **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.submissions.deleteSubmissionDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `errors` | `any[]` | No | — | *** ### getAUsersMostRecentlyGraded `submissions.getAUsersMostRecentlyGraded` Retrieves a user most recently graded submissions **Risk:** `read` ```ts theme={null} await corsair.canvas.api.submissions.getAUsersMostRecentlyGraded({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > sortable_name?: string, > short_name?: string, > sis_user_id?: string | null, > login_id?: string, > email?: string, > avatar_url?: string, > locale?: string | null, > effective_locale?: string > }[] > ``` *** ## User Custom Data ### createUsersCustomData `userCustomData.createUsersCustomData` Create or update custom data for a Canvas user within a specified namespace **Risk:** `write` ```ts theme={null} await corsair.canvas.api.userCustomData.createUsersCustomData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### deleteCustomData `userCustomData.deleteCustomData` Delete custom user data for a given namespace **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.userCustomData.deleteCustomData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### deleteUsersCustomDataScope `userCustomData.deleteUsersCustomDataScope` Delete custom user data at a specific scope path **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.userCustomData.deleteUsersCustomDataScope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > scope: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getUsersCustomDataScope `userCustomData.getUsersCustomDataScope` Retrieve custom data stored for a Canvas user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.userCustomData.getUsersCustomDataScope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > scope: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ## User Inbox Labels ### createUserInboxLabel `userInboxLabels.createUserInboxLabel` Create new user inbox labels in Canvas **Risk:** `write` ```ts theme={null} await corsair.canvas.api.userInboxLabels.createUserInboxLabel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### deleteUserInboxLabel `userInboxLabels.deleteUserInboxLabel` Delete user inbox labels in Canvas **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.userInboxLabels.deleteUserInboxLabel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ## Users ### editUser `users.editUser` Modifies an existing Canvas user profile and settings **Risk:** `write` ```ts theme={null} await corsair.canvas.api.users.editUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### getAllUsers `users.getAllUsers` Retrieves a list of users for a specified Canvas account **Risk:** `read` ```ts theme={null} await corsair.canvas.api.users.getAllUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > account_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > uuid?: string, > parent_account_id?: string | number | null, > root_account_id?: string | number, > default_storage_quota_mb?: number, > default_user_storage_quota_mb?: number, > default_group_storage_quota_mb?: number, > default_time_zone?: string, > sis_account_id?: string | null, > workflow_state?: string > }[] > ``` *** ### getCurrentUser `users.getCurrentUser` Retrieves detailed information about the currently authenticated user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.users.getCurrentUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### getCustomColor `users.getCustomColor` Retrieve the custom color for a specific course or context **Risk:** `read` ```ts theme={null} await corsair.canvas.api.users.getCustomColor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > asset_string: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCustomColors `users.getCustomColors` Retrieve all custom colors saved by a user in Canvas LMS **Risk:** `read` ```ts theme={null} await corsair.canvas.api.users.getCustomColors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getDashboardPositions `users.getDashboardPositions` Retrieve all dashboard positions saved for a user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.users.getDashboardPositions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSingleUser `users.getSingleUser` Retrieves detailed information for a single user in a Canvas course **Risk:** `read` ```ts theme={null} await corsair.canvas.api.users.getSingleUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > course_id: string, > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### getUserAvatars `users.getUserAvatars` Retrieve available avatar options for a Canvas user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.users.getUserAvatars({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > sortable_name?: string, > short_name?: string, > sis_user_id?: string | null, > login_id?: string, > email?: string, > avatar_url?: string, > locale?: string | null, > effective_locale?: string > }[] > ``` *** ### getUserProfile `users.getUserProfile` Retrieves profile information for an existing Canvas user **Risk:** `read` ```ts theme={null} await corsair.canvas.api.users.getUserProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `uuid` | `string` | No | — | | `folder_id` | `string \| number` | No | — | | `display_name` | `string` | No | — | | `filename` | `string` | No | — | | `content_type` | `string` | No | — | | `url` | `string` | No | — | | `size` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ## User Tokens ### createUsersTokens `userTokens.createUsersTokens` Create a new access token for a Canvas user **Risk:** `write` ```ts theme={null} await corsair.canvas.api.userTokens.createUsersTokens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | Yes | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** ### deleteAccessToken `userTokens.deleteAccessToken` Delete an access token for a Canvas user **Risk:** `destructive` ```ts theme={null} await corsair.canvas.api.userTokens.deleteAccessToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > token_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string | number > } | { > id: string | number > }[] | undefined | null > ``` *** ### getUsersTokens `userTokens.getUsersTokens` Retrieves detailed information about a specific access token **Risk:** `read` ```ts theme={null} await corsair.canvas.api.userTokens.getUsersTokens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pathParams` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **pathParams full type** > > ```ts theme={null} > { > user_id: string, > token_id: string > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `sortable_name` | `string` | No | — | | `short_name` | `string` | No | — | | `sis_user_id` | `string` | No | — | | `login_id` | `string` | No | — | | `email` | `string` | No | — | | `avatar_url` | `string` | No | — | | `locale` | `string` | No | — | | `effective_locale` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/canvas/database Canvas LMS local sync: searchable entities, `.search()` filters, and operators. The Canvas LMS plugin syncs data locally. Use `corsair.canvas.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `canvas.db.accounts.search` ```ts theme={null} const rows = await corsair.canvas.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `sis_account_id` | `string` | equals, contains, startsWith, endsWith, in | | `workflow_state` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Assignments Path: `canvas.db.assignments.search` ```ts theme={null} const rows = await corsair.canvas.db.assignments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `due_at` | `string` | equals, contains, startsWith, endsWith, in | | `points_possible` | `number` | equals, gt, gte, lt, lte, in | | `published` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Courses Path: `canvas.db.courses.search` ```ts theme={null} const rows = await corsair.canvas.db.courses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `course_code` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `sis_course_id` | `string` | equals, contains, startsWith, endsWith, in | | `workflow_state` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Enrollments Path: `canvas.db.enrollments.search` ```ts theme={null} const rows = await corsair.canvas.db.enrollments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `enrollment_state` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `canvas.db.users.search` ```ts theme={null} const rows = await corsair.canvas.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `sortable_name` | `string` | equals, contains, startsWith, endsWith, in | | `short_name` | `string` | equals, contains, startsWith, endsWith, in | | `sis_user_id` | `string` | equals, contains, startsWith, endsWith, in | | `login_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/canvas/overview Learning management system for courses, assignments, grades, and educational content. Use **Canvas LMS** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 209 typed API operations * 5 synced entities (`accounts`, `assignments`, `courses`, `enrollments`, `users`) for fast `.search()` / `.list()` * 6 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/canvas ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/canvas ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/canvas ``` ```bash bun theme={null} bun add corsair @corsair-dev/canvas ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { canvas } from '@corsair-dev/canvas'; export const corsair = createCorsair({ plugins: [ canvas(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} canvas() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Canvas LMS OAuth app. ```ts theme={null} canvas({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'canvas', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.getAccountHelpLinks`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.canvas.api.accounts.getAccountHelpLinks({}); ``` **`accounts.closeNotificationForUser`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.canvas.api.accounts.closeNotificationForUser({}); ``` See the full list on the [API](/plugins/canvas/api) page. ## Query synced data Synced entities support `tenant.canvas.db..search()` and `.list()`: `accounts`, `assignments`, `courses`, `enrollments`, `users`. See [Database](/plugins/canvas/database) for filters and operators. ## Webhooks This plugin registers **6** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/canvas/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/canvas/api)** > > Every `canvas.api.*` operation with input and output types. > **[Database](/plugins/canvas/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/canvas/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/canvas/webhooks Canvas LMS incoming webhooks: event paths, payloads, and response data. The Canvas LMS plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/canvas/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `triggers` * `assignmentGraded` (`triggers.assignmentGraded`) * `newAssignmentSubmission` (`triggers.newAssignmentSubmission`) * `newCourseCreated` (`triggers.newCourseCreated`) * `newDiscussionMessage` (`triggers.newDiscussionMessage`) * `newDiscussionTopic` (`triggers.newDiscussionTopic`) * `newFileUploaded` (`triggers.newFileUploaded`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Triggers ### Assignment Graded `triggers.assignmentGraded` Canvas Live Event when an assignment grade changes **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `created_at` | `string` | No | — | | `data` | `object` | No | — | | `metadata` | `object` | No | — | | `body` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type?: string, > created_at?: string, > data?: { > }, > metadata?: { > }, > body?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} canvas({ webhookHooks: { triggers: { assignmentGraded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### New Assignment Submission `triggers.newAssignmentSubmission` Canvas Live Event when a new assignment submission is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `created_at` | `string` | No | — | | `data` | `object` | No | — | | `metadata` | `object` | No | — | | `body` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type?: string, > created_at?: string, > data?: { > }, > metadata?: { > }, > body?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} canvas({ webhookHooks: { triggers: { newAssignmentSubmission: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### New Course Created `triggers.newCourseCreated` Canvas Live Event when a course is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `created_at` | `string` | No | — | | `data` | `object` | No | — | | `metadata` | `object` | No | — | | `body` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type?: string, > created_at?: string, > data?: { > }, > metadata?: { > }, > body?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} canvas({ webhookHooks: { triggers: { newCourseCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### New Discussion Message `triggers.newDiscussionMessage` Canvas Live Event when a discussion entry is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `created_at` | `string` | No | — | | `data` | `object` | No | — | | `metadata` | `object` | No | — | | `body` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type?: string, > created_at?: string, > data?: { > }, > metadata?: { > }, > body?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} canvas({ webhookHooks: { triggers: { newDiscussionMessage: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### New Discussion Topic `triggers.newDiscussionTopic` Canvas Live Event when a discussion topic is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `created_at` | `string` | No | — | | `data` | `object` | No | — | | `metadata` | `object` | No | — | | `body` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type?: string, > created_at?: string, > data?: { > }, > metadata?: { > }, > body?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} canvas({ webhookHooks: { triggers: { newDiscussionTopic: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### New File Uploaded `triggers.newFileUploaded` Canvas Live Event when a file attachment is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `created_at` | `string` | No | — | | `data` | `object` | No | — | | `metadata` | `object` | No | — | | `body` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type?: string, > created_at?: string, > data?: { > }, > metadata?: { > }, > body?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} canvas({ webhookHooks: { triggers: { newFileUploaded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/capsulecrm/api API reference for Capsule CRM: every `capsulecrm.api.*` operation with input and output types. Every `capsulecrm.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Activity Types ### get `activityTypes.get` Get an activity type by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.activityTypes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### list `activityTypes.list` List activity types **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.activityTypes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listIcons `activityTypes.listIcons` List activity type icons **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.activityTypes.listIcons({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Attachments ### get `attachments.get` Download an attachment by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.attachments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | No | — | | `contentType` | `string` | No | — | | `contentBase64` | `string` | Yes | — | *** ### upload `attachments.upload` Upload an attachment and receive a token **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.attachments.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | Yes | — | | `contentType` | `string` | Yes | — | | `contentBase64` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `upload` | `object` | Yes | — | > **upload full type** > > ```ts theme={null} > { > token: string > } > ``` *** ## Boards ### delete `boards.delete` Delete (archive) a board **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.boards.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `boards.get` Get a board by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.boards.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### list `boards.list` List boards **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.boards.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listStages `boards.listStages` List stages on a board **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.boards.listStages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `string` | No | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### restore `boards.restore` Restore a deleted board **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.boards.restore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `boards.update` Update a board **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.boards.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Categories ### create `categories.create` Create a task category **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.categories.create({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### delete `categories.delete` Delete a category **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.categories.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `categories.get` Get a category by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.categories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### list `categories.list` List task categories **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.categories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `categories.update` Update a category **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.categories.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Countries ### list `countries.list` List countries **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.countries.list({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Currencies ### list `currencies.list` List currencies **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.currencies.list({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Custom Fields ### create `customFields.create` Create a custom field definition **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.customFields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | **Output:** *empty object* *** ### delete `customFields.delete` Delete a custom field definition **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.customFields.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `customFields.get` Get a custom field definition **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.customFields.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### list `customFields.list` List custom field definitions for an entity type **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.customFields.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | **Output:** *empty object* *** ### update `customFields.update` Update a custom field definition **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.customFields.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Entries ### create `entries.create` Create a note entry **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.entries.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | | `type` | `note` | No | — | **Output:** *empty object* *** ### delete `entries.delete` Delete an entry **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.entries.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `entries.get` Get an entry by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.entries.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listByDate `entries.listByDate` List notes, emails, and completed tasks by date **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.entries.listByDate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listForEntity `entries.listForEntity` List entries for a party, opportunity, or project **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.entries.listForEntity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `entries.update` Update a note or email entry **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.entries.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Filters ### run `filters.run` Run a structured filter query **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.filters.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | | `conditions` | `object[]` | Yes | — | > **conditions full type** > > ```ts theme={null} > { > }[] > ``` **Output:** *empty object* *** ## Goals ### list `goals.list` List goals **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.goals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ## Lost Reasons ### create `lostReasons.create` Create a lost reason **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.lostReasons.create({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### delete `lostReasons.delete` Delete a lost reason **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.lostReasons.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `lostReasons.get` Get a lost reason by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.lostReasons.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### list `lostReasons.list` List lost reasons **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.lostReasons.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `lostReasons.update` Update a lost reason **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.lostReasons.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Milestones ### create `milestones.create` Create a milestone **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.milestones.create({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### delete `milestones.delete` Delete a milestone **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.milestones.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `milestones.get` Get a milestone by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.milestones.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### list `milestones.list` List milestones **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.milestones.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `milestones.update` Update a milestone **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.milestones.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Opportunities ### addParty `opportunities.addParty` Add a party to an opportunity **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.opportunities.addParty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `partyId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### create `opportunities.create` Create an opportunity **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.opportunities.create({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### delete `opportunities.delete` Delete an opportunity **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.opportunities.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### deleteParty `opportunities.deleteParty` Remove a party from an opportunity **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.opportunities.deleteParty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `partyId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `opportunities.get` Get an opportunity by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.opportunities.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### list `opportunities.list` List opportunities **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.opportunities.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `since` | `string` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listDeleted `opportunities.listDeleted` List deleted or restricted opportunities **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.opportunities.listDeleted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `string` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output:** *empty object* *** ### listParties `opportunities.listParties` List additional parties on an opportunity **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.opportunities.listParties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listProjects `opportunities.listProjects` List projects linked to an opportunity **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.opportunities.listProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### search `opportunities.search` Search opportunities by query string **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.opportunities.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `opportunities.update` Update an opportunity **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.opportunities.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Parties ### create `parties.create` Create a person or organisation **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.parties.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `person \| organisation` | Yes | — | **Output:** *empty object* *** ### delete `parties.delete` Delete a party **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.parties.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `parties.get` Get a party by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.parties.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### list `parties.list` List parties (people and organisations) **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.parties.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `since` | `string` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listDeleted `parties.listDeleted` List parties deleted since a date **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.parties.listDeleted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `string` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output:** *empty object* *** ### listEmployees `parties.listEmployees` List employees of an organisation **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.parties.listEmployees({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listOpportunities `parties.listOpportunities` List opportunities for a party **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.parties.listOpportunities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listProjects `parties.listProjects` List projects for a party **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.parties.listProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### search `parties.search` Search parties by query string **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.parties.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `parties.update` Update a party **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.parties.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Pipelines ### get `pipelines.get` Get a pipeline by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.pipelines.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### list `pipelines.list` List sales pipelines **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.pipelines.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listMilestones `pipelines.listMilestones` List milestones on a pipeline **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.pipelines.listMilestones({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `pipelines.update` Update a pipeline **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.pipelines.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Projects ### addParty `projects.addParty` Add a party to a project **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.projects.addParty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `partyId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### create `projects.create` Create a project (case) **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.projects.create({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### delete `projects.delete` Delete a project **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### deleteParty `projects.deleteParty` Remove a party from a project **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.projects.deleteParty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `partyId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `projects.get` Get a project by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### list `projects.list` List projects (kases) **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `since` | `string` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listDeleted `projects.listDeleted` List deleted or restricted projects **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.projects.listDeleted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `string` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output:** *empty object* *** ### listParties `projects.listParties` List parties on a project **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.projects.listParties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### search `projects.search` Search projects by query string **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.projects.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `projects.update` Update a project **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Rest Hooks ### list `restHooks.list` List REST hook subscriptions **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.restHooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ## Site ### get `site.get` Get Capsule site (account) details **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.site.get({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Stages ### create `stages.create` Create a board stage **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.stages.create({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### delete `stages.delete` Delete a stage **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.stages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `stages.get` Get a stage by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.stages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### list `stages.list` List stages across boards **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.stages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `stages.update` Update a stage **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.stages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Tags ### delete `tags.delete` Delete a tag **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `tags.get` Get a tag by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.tags.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `id` | `number` | Yes | — | **Output:** *empty object* *** ### list `tags.list` List tags for an entity type **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `tags.update` Update a tag name **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.tags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Tasks ### create `tasks.create` Create a task **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.tasks.create({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### delete `tasks.delete` Delete a task **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `tasks.get` Get a task by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### list `tasks.list` List tasks **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `tasks.update` Update a task **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Teams ### list `teams.list` List teams **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `embed` | `string` | No | — | **Output:** *empty object* *** ## Titles ### create `titles.create` Create a custom person title **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.titles.create({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### delete `titles.delete` Delete a title **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.titles.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### list `titles.list` List custom person titles **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.titles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ## Track Definitions ### create `trackDefinitions.create` Create a track definition **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.trackDefinitions.create({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### delete `trackDefinitions.delete` Delete a track definition **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.trackDefinitions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `trackDefinitions.get` Get a track definition by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.trackDefinitions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### list `trackDefinitions.list` List track definitions **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.trackDefinitions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `trackDefinitions.update` Update a track definition **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.trackDefinitions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** *empty object* *** ## Tracks ### create `tracks.create` Apply a track definition to an entity **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.tracks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `embed` | `string` | No | — | **Output:** *empty object* *** ### delete `tracks.delete` Delete a track **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.capsulecrm.api.tracks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `tracks.get` Get a track by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.tracks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### listForEntity `tracks.listForEntity` List tracks on an opportunity or project **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.tracks.listForEntity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `parties \| opportunities \| kases` | Yes | — | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `tracks.update` Update a track description or date **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.tracks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ## Users ### get `users.get` Get a user by ID **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** ### getCurrent `users.getCurrent` Get the current authenticated user **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.users.getCurrent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `embed` | `string` | No | — | **Output:** *empty object* *** ### list `users.list` List users **Risk:** `read` ```ts theme={null} await corsair.capsulecrm.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `embed` | `string` | No | — | **Output:** *empty object* *** ### update `users.update` Update user preferences **Risk:** `write` ```ts theme={null} await corsair.capsulecrm.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `embed` | `string` | No | — | **Output:** *empty object* *** # Database Source: https://docs.corsair.dev/plugins/capsulecrm/database Capsule CRM local sync: searchable entities, `.search()` filters, and operators. The Capsule CRM plugin syncs data locally. Use `corsair.capsulecrm.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Boards Path: `capsulecrm.db.boards.search` ```ts theme={null} const rows = await corsair.capsulecrm.db.boards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Entries Path: `capsulecrm.db.entries.search` ```ts theme={null} const rows = await corsair.capsulecrm.db.entries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `entryAt` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Milestones Path: `capsulecrm.db.milestones.search` ```ts theme={null} const rows = await corsair.capsulecrm.db.milestones.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `complete` | `boolean` | equals | | `probability` | `number` | equals, gt, gte, lt, lte, in | | `daysUntilStale` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Opportunities Path: `capsulecrm.db.opportunities.search` ```ts theme={null} const rows = await corsair.capsulecrm.db.opportunities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `probability` | `number` | equals, gt, gte, lt, lte, in | | `expectedCloseOn` | `string` | equals, contains, startsWith, endsWith, in | | `closedOn` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `durationBasis` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Parties Path: `capsulecrm.db.parties.search` ```ts theme={null} const rows = await corsair.capsulecrm.db.parties.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `jobTitle` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `about` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `lastContactedAt` | `string` | equals, contains, startsWith, endsWith, in | | `pictureURL` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `capsulecrm.db.projects.search` ```ts theme={null} const rows = await corsair.capsulecrm.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `startOn` | `string` | equals, contains, startsWith, endsWith, in | | `expectedCloseOn` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Site Path: `capsulecrm.db.site.search` ```ts theme={null} const rows = await corsair.capsulecrm.db.site.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `subdomain` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `capsulecrm.db.tasks.search` ```ts theme={null} const rows = await corsair.capsulecrm.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `dueOn` | `string` | equals, contains, startsWith, endsWith, in | | `dueTime` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `capsulecrm.db.users.search` ```ts theme={null} const rows = await corsair.capsulecrm.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `locale` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `lastLoginAt` | `string` | equals, contains, startsWith, endsWith, in | | `taskReminder` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/capsulecrm/overview Simple CRM for tracking contacts, sales pipelines, and customer relationship history. Use **Capsule CRM** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 110 typed API operations * 9 synced entities (`boards`, `entries`, `milestones`, `opportunities`, `parties`, `projects`, and 3 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/capsulecrm ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/capsulecrm ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/capsulecrm ``` ```bash bun theme={null} bun add corsair @corsair-dev/capsulecrm ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { capsulecrm } from '@corsair-dev/capsulecrm'; export const corsair = createCorsair({ plugins: [ capsulecrm(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} capsulecrm() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Capsule CRM OAuth app. ```ts theme={null} capsulecrm({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'capsulecrm', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`activityTypes.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.capsulecrm.api.activityTypes.get({}); ``` **`attachments.upload`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.capsulecrm.api.attachments.upload({}); ``` See the full list on the [API](/plugins/capsulecrm/api) page. ## Query synced data Synced entities support `tenant.capsulecrm.db..search()` and `.list()`: `boards`, `entries`, `milestones`, `opportunities`, `parties`, `projects`, `site`, `tasks`, `users`. See [Database](/plugins/capsulecrm/database) for filters and operators. ## What's next > **[API reference](/plugins/capsulecrm/api)** > > Every `capsulecrm.api.*` operation with input and output types. > **[Database](/plugins/capsulecrm/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/carbone/api API reference for Carbone: every `carbone.api.*` operation with input and output types. Every `carbone.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Render ### generateReport `render.generateReport` Tool to generate a Carbone report from a template and JSON data. Use when you need to render documents in various formats. **Risk:** `write` ```ts theme={null} await corsair.carbone.api.render.generateReport({ templateId: 'tmpl_1234567890abcdef', data: { customer: 'Acme Corp', amount: 1250 }, convertTo: 'pdf', }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | 64-character hexadecimal template ID or version ID to render | | `data` | `object[]` | No | JSON dataset to merge into the document template placeholders | | `convertTo` | `object` | No | Target file format extension to convert output document into (e.g. pdf, docx, xlsx, html) | | `converter` | `string` | No | Converter engine to use for document conversion | | `lang` | `string` | No | Localization language code for formatting numbers, dates, and currency (e.g. en-US, fr-FR) | | `timezone` | `string` | No | IANA timezone string for date/time calculations (e.g. Europe/Paris, America/New\_York) | | `currency` | `string` | No | ISO 4217 currency code for currency formatters (e.g. USD, EUR) | | `translations` | `object` | No | Dictionary of translation strings per locale | | `enum` | `object` | No | Enum mapping dictionaries for translating code values | | `variable` | `object` | No | Pre-calculated variables accessible globally within the template | | `complement` | `object` | No | Complementary dataset accessible with the c. prefix in templates | | `hardRefresh` | `boolean` | No | When true, recalculates all template functions and forces fresh render | > **data full type** > > ```ts theme={null} > { > } | lazy[] > ``` > **convertTo full type** > > ```ts theme={null} > string | { > formatName: string, > formatOptions?: { > } > } > ``` > **translations full type** > > ```ts theme={null} > { > } > ``` > **enum full type** > > ```ts theme={null} > { > } > ``` > **variable full type** > > ```ts theme={null} > { > } > ``` > **complement full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if report generation succeeded | | `data` | `object` | Yes | Render result payload containing the render ID | > **data full type** > > ```ts theme={null} > { > renderId: string > } > ``` *** ### renderDirect `render.renderDirect` Tool to generate a document by uploading a base64-encoded template and data in a single API call. Use when you need to render documents without uploading templates separately. **Risk:** `write` ```ts theme={null} await corsair.carbone.api.render.renderDirect({ template: 'UEsDBBQAAAAIAAAAIQAAAAAAAAAAAAAAAAAJAAAAdGVtcGxhdGUuZG9jeA==', data: { customer: 'Acme Corp', amount: 1250 }, convertTo: 'pdf', }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template` | `string` | Yes | Base64-encoded document template content | | `data` | `object[]` | No | JSON dataset to merge into the template placeholders | | `convertTo` | `object` | No | Target output document format extension (e.g. pdf, docx, xlsx, html) | | `converter` | `string` | No | Converter engine to use for document conversion | | `lang` | `string` | No | Localization language code for formatting numbers and dates | | `timezone` | `string` | No | IANA timezone string for date operations | | `currency` | `string` | No | ISO 4217 currency code for currency formatting | | `translations` | `object` | No | Translation dictionaries for multi-language templates | | `enum` | `object` | No | Enum dictionaries for code translation | | `variable` | `object` | No | Pre-calculated variables accessible in template | | `complement` | `object` | No | Complementary data accessible with c. prefix | | `hardRefresh` | `boolean` | No | Force complete recalculation of document fields | > **data full type** > > ```ts theme={null} > { > } | lazy[] > ``` > **convertTo full type** > > ```ts theme={null} > string | { > formatName: string, > formatOptions?: { > } > } > ``` > **translations full type** > > ```ts theme={null} > { > } > ``` > **enum full type** > > ```ts theme={null} > { > } > ``` > **variable full type** > > ```ts theme={null} > { > } > ``` > **complement full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if direct template rendering succeeded | | `data` | `object` | Yes | Render result payload | > **data full type** > > ```ts theme={null} > { > renderId: string > } > ``` *** ## Status ### get `status.get` Tool to retrieve the current status and health of the Carbone server. Use before generating reports to ensure the service is operational. **Risk:** `read` ```ts theme={null} await corsair.carbone.api.status.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if the status check request succeeded | | `code` | `number` | No | HTTP status code returned by API | | `message` | `string` | Yes | Status message from Carbone server | | `version` | `string` | No | Active Carbone engine/API version | *** ## Templates ### delete `templates.delete` Permanently delete a template from the Carbone server by its 64-character hexadecimal template ID. This action is irreversible. Ensure you have the correct template ID before deleting. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.carbone.api.templates.delete({ templateId: 'tmpl_1234567890abcdef' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | 64-character hexadecimal template ID to permanently delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if template was successfully deleted | | `message` | `string` | No | Confirmation message from Carbone server | *** ### download `templates.download` Tool to download a template from Carbone by template ID. Use when you need to retrieve the original template file. **Risk:** `read` ```ts theme={null} await corsair.carbone.api.templates.download({ templateId: 'tmpl_1234567890abcdef' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | 64-character hexadecimal template ID to download | **Output** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | ID of the downloaded template | | `content` | `string` | Yes | Base64-encoded binary content of the retrieved template file | | `success` | `boolean` | Yes | Indicates if template download was successful | *** ### list `templates.list` Tool to retrieve a list of templates from Carbone storage with filtering, search, and cursor-based pagination. Use when you need to find templates, search by name or ID, or iterate through all deployed templates. **Risk:** `read` ```ts theme={null} await corsair.carbone.api.templates.list({ id: 'tmpl_1234567890abcdef', cursor: 0 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | Filter templates by exact template ID match | | `templateId` | `string` | No | Alias for id; filter templates by exact template ID match | | `versionId` | `string` | No | Filter templates by exact version ID match | | `category` | `string` | No | Filter templates belonging to a specific category folder | | `search` | `string` | No | Search templates by name or identifier query | | `cursor` | `string \| number` | No | Pagination cursor for iterating through templates | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if listing templates succeeded | | `data` | `object[]` | Yes | Array of deployed Carbone template metadata records | | `hasMore` | `boolean` | No | Whether more template records are available on next page | | `nextCursor` | `string \| number` | No | Cursor to retrieve the next page of templates | > **data full type** > > ```ts theme={null} > { > versionId?: string, > id?: string | null, > name?: string, > category?: string, > type?: string, > size?: number, > comment?: string, > tags?: string[], > deployedAt?: number | null, > createdAt?: number, > expireAt?: number | null, > origin?: number > }[] > ``` *** ### listCategories `templates.listCategories` Tool to retrieve a list of all categories used in templates. Categories function like folders for organizing templates. Use when you need to see available template groupings. **Risk:** `read` ```ts theme={null} await corsair.carbone.api.templates.listCategories({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if listing categories succeeded | | `data` | `object[]` | Yes | List of category folder names used across templates | > **data full type** > > ```ts theme={null} > { > name: string > }[] > ``` *** ### listTags `templates.listTags` Tool to list all tags currently used in templates. Use when you need to discover available tags for categorizing or filtering templates by document type or version. **Risk:** `read` ```ts theme={null} await corsair.carbone.api.templates.listTags({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if listing tags succeeded | | `data` | `object[]` | Yes | List of tag names used across templates | > **data full type** > > ```ts theme={null} > { > name: string > }[] > ``` *** ### update `templates.update` Tool to update metadata and attributes of an existing Carbone template. Use when you need to modify template name, comment, tags, category, or control version deployment and lifecycle. **Risk:** `write` ```ts theme={null} await corsair.carbone.api.templates.update({ templateId: 'tmpl_1234567890abcdef', name: 'Updated invoice template', category: 'Finance', tags: ['invoices', 'v2'], }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | 64-character hexadecimal template ID to update | | `name` | `string` | No | Updated human-readable name of the template | | `category` | `string` | No | Updated category folder for organizing the template | | `comment` | `string` | No | Updated description or version release comment | | `tags` | `string[]` | No | Updated array of tag strings for filtering | | `deployedAt` | `number` | No | Unix timestamp to control version deployment | | `expireAt` | `number` | No | Unix timestamp when the template will automatically expire | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if template metadata update succeeded | | `data` | `object` | No | Updated metadata values of the template | > **data full type** > > ```ts theme={null} > { > name?: string, > category?: string, > comment?: string, > tags?: string[], > deployedAt?: number | null, > versionId?: string, > id?: string | null > } > ``` *** ### upload `templates.upload` Upload a template file to the Carbone server to obtain a template ID for document generation. Supported template formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, XHTML, IDML, HTML, or XML. Templates can contain placeholders like that will be replaced with data during report generation. **Risk:** `write` ```ts theme={null} await corsair.carbone.api.templates.upload({ template: 'UEsDBBQAAAAIAAAAIQAAAAAAAAAAAAAAAAAJAAAAdGVtcGxhdGUuZG9jeA==' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template` | `string` | Yes | Base64-encoded document template payload | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if template upload succeeded | | `data` | `object` | Yes | Metadata of the newly uploaded template | > **data full type** > > ```ts theme={null} > { > templateId?: string, > id?: string, > versionId?: string, > templateExtension?: string, > type?: string, > size?: number, > createdAt?: number > } > ``` *** ## Version ### set `version.set` Tool to set the Carbone API version to be used for subsequent requests. Use before rendering or managing templates to ensure correct version is applied. **Risk:** `write` ```ts theme={null} await corsair.carbone.api.version.set({ version: '5' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | Yes | Carbone API major version string to use for subsequent requests (e.g. "5") | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates if setting API version was successful | | `version` | `string` | Yes | The active Carbone API version now configured | | `message` | `string` | Yes | Confirmation message | *** # Database Source: https://docs.corsair.dev/plugins/carbone/database Carbone local sync: searchable entities, `.search()` filters, and operators. The Carbone plugin syncs data locally. Use `corsair.carbone.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Categories Path: `carbone.db.categories.search` ```ts theme={null} const rows = await corsair.carbone.db.categories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `carbone.db.tags.search` ```ts theme={null} const rows = await corsair.carbone.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `carbone.db.templates.search` ```ts theme={null} const rows = await corsair.carbone.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `versionId` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | | `deployedAt` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `expireAt` | `number` | equals, gt, gte, lt, lte, in | | `origin` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/carbone/overview Document generation and template rendering API for creating files from data-driven templates. Use **Carbone** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 11 typed API operations * 3 synced entities (`categories`, `tags`, `templates`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/carbone ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/carbone ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/carbone ``` ```bash bun theme={null} bun add corsair @corsair-dev/carbone ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { carbone } from '@corsair-dev/carbone'; export const corsair = createCorsair({ plugins: [ carbone(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} carbone() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'carbone', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List templates** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.carbone.api.templates.list({ id: 'tmpl_1234567890abcdef', cursor: 0 }); ``` **Generate report from template** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.carbone.api.render.generateReport({ templateId: 'tmpl_1234567890abcdef', data: { customer: 'Acme Corp', amount: 1250 }, convertTo: 'pdf', }); ``` See the full list on the [API](/plugins/carbone/api) page. ## Query synced data Search synced templates without calling Carbone. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.carbone.db.templates.search({ data: { category: 'Finance' }, limit: 50, }); ``` Synced entities: `categories`, `tags`, `templates`. See [Database](/plugins/carbone/database) for filters and operators. ## What's next > **[API reference](/plugins/carbone/api)** > > Every `carbone.api.*` operation with input and output types. > **[Database](/plugins/carbone/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/castingwords/api API reference for Castingwords: every `castingwords.api.*` operation with input and output types. Every `castingwords.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Audiofile ### get `audiofile.get` Get audiofile details including current state **Risk:** `read` ```ts theme={null} await corsair.castingwords.api.audiofile.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audiofileId` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `audiofile` | `object` | No | — | > **audiofile full type** > > ```ts theme={null} > { > id?: string | number, > statename?: string, > names?: string, > notes?: string, > originallink?: string, > title?: string, > duration?: string | number, > description?: string, > quality_stars?: string | number > } > ``` *** ## Invoice ### get `invoice.get` Get invoice details and line items **Risk:** `read` ```ts theme={null} await corsair.castingwords.api.invoice.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoiceId` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `purchase_order` | `string \| number` | No | — | | `createtime` | `string` | No | — | | `paidtime` | `string` | No | — | | `total` | `string \| number` | No | — | | `items` | `object[]` | No | — | | `state` | `PAID \| SUBMITTED \| OPEN \| CREATED` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string | number, > sku?: string, > quantity?: string | number, > price?: string | number, > audiofile?: string | number, > total?: string | number > }[] > ``` *** ## Order ### create `order.create` Create a transcription order for public audio/video URLs (API4 order\_url) **Risk:** `write` ```ts theme={null} await corsair.castingwords.api.order.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string \| string[]` | Yes | — | | `sku` | `TRANS14 \| TRANS2 \| TRANS6 \| TRANS7 \| EMSR02 \| DIFFQ2 \| TSTMP1 \| CAPTION1[]` | Yes | — | | `test` | `boolean` | No | — | | `notes` | `string` | No | — | | `names` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `audiofiles` | `(string \| number)[]` | Yes | — | | `order` | `string \| number` | Yes | — | | `message` | `string` | No | — | | `hold` | `string` | No | — | *** ## Prepay Balance ### get `prepayBalance.get` Get the current prepaid balance in USD **Risk:** `read` ```ts theme={null} await corsair.castingwords.api.prepayBalance.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `balance` | `number` | Yes | — | *** ## Refund ### create `refund.create` Cancel and refund an audiofile before transcription work starts **Risk:** `destructive` ```ts theme={null} await corsair.castingwords.api.refund.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audiofileId` | `number \| string` | Yes | — | | `test` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `success` | `boolean` | No | — | *** ## Skus ### list `skus.list` List documented CastingWords SKUs from Store API v4 (no live sku endpoint) **Risk:** `read` ```ts theme={null} await corsair.castingwords.api.skus.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `skus` | `object[]` | Yes | — | > **skus full type** > > ```ts theme={null} > { > sku: string, > kind: order | upgrade, > description: string > }[] > ``` *** ## Transcript ### get `transcript.get` Get a completed transcript (txt, doc, rtf, html, srt, docx, tstxt, vtt) **Risk:** `read` ```ts theme={null} await corsair.castingwords.api.transcript.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audiofileId` | `number \| string` | Yes | — | | `extension` | `txt \| doc \| rtf \| html \| srt \| docx \| tstxt \| vtt` | Yes | — | | `test` | `boolean` | No | — | **Output:** `string` *** ## Upgrade ### create `upgrade.create` Order upgrades for an audiofile (timestamps, captions, etc.) **Risk:** `write` ```ts theme={null} await corsair.castingwords.api.upgrade.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audiofileId` | `number \| string` | Yes | — | | `sku` | `DIFFQ2 \| TSTMP1 \| CAPTION1 \| EDIT01 \| UPGRD1 \| UPGRD2 \| UPGRD3[]` | Yes | — | | `test` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `success` | `boolean` | No | — | *** ## Webhook ### get `webhook.get` Get the registered account webhook URL **Risk:** `read` ```ts theme={null} await corsair.castingwords.api.webhook.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhook` | `string \| ` | No | — | *** ### register `webhook.register` Register a webhook URL for CastingWords event notifications **Risk:** `write` ```ts theme={null} await corsair.castingwords.api.webhook.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhook` | `string \| ` | No | — | *** ### test `webhook.test` Request a test webhook POST for a documented event type **Risk:** `write` ```ts theme={null} await corsair.castingwords.api.webhook.test({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event` | `TRANSCRIPT_COMPLETE \| DIFFICULT_AUDIO \| REFUND_ISSUED \| ORDER_ON_HOLD` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhook` | `string \| ` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/castingwords/database Castingwords local sync: searchable entities, `.search()` filters, and operators. The Castingwords plugin syncs data locally. Use `corsair.castingwords.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Audiofiles Path: `castingwords.db.audiofiles.search` ```ts theme={null} const rows = await corsair.castingwords.db.audiofiles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `statename` | `string` | equals, contains, startsWith, endsWith, in | | `names` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `originallink` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Balances Path: `castingwords.db.balances.search` ```ts theme={null} const rows = await corsair.castingwords.db.balances.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `balance` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invoices Path: `castingwords.db.invoices.search` ```ts theme={null} const rows = await corsair.castingwords.db.invoices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `createtime` | `string` | equals, contains, startsWith, endsWith, in | | `paidtime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Orders Path: `castingwords.db.orders.search` ```ts theme={null} const rows = await corsair.castingwords.db.orders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `hold` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Skus Path: `castingwords.db.skus.search` ```ts theme={null} const rows = await corsair.castingwords.db.skus.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `sku` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `castingwords.db.webhooks.search` ```ts theme={null} const rows = await corsair.castingwords.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/castingwords/overview Castingwords plugin for Corsair Use **Castingwords** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 11 typed API operations * 6 synced entities (`audiofiles`, `balances`, `invoices`, `orders`, `skus`, `webhooks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/castingwords ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/castingwords ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/castingwords ``` ```bash bun theme={null} bun add corsair @corsair-dev/castingwords ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { castingwords } from '@corsair-dev/castingwords'; export const corsair = createCorsair({ plugins: [ castingwords(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} castingwords() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'castingwords', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`audiofile.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.castingwords.api.audiofile.get({}); ``` **`order.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.castingwords.api.order.create({}); ``` See the full list on the [API](/plugins/castingwords/api) page. ## Query synced data Synced entities support `tenant.castingwords.db..search()` and `.list()`: `audiofiles`, `balances`, `invoices`, `orders`, `skus`, `webhooks`. See [Database](/plugins/castingwords/database) for filters and operators. ## What's next > **[API reference](/plugins/castingwords/api)** > > Every `castingwords.api.*` operation with input and output types. > **[Database](/plugins/castingwords/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/cdrplatform/api API reference for CDR Platform: every `cdrplatform.api.*` operation with input and output types. Every `cdrplatform.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Cdr ### price `cdr.price` Calculate CO2 removal pricing for a method portfolio. **Risk:** `read` ```ts theme={null} await corsair.cdrplatform.api.cdr.price({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `weight_unit` | `g \| kg \| t` | Yes | — | | `currency` | `usd \| eur \| gbp \| chf` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > method_type: string, > cdr_amount: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `cost` | `object` | Yes | — | | `currency` | `usd \| eur \| gbp \| chf` | Yes | — | | `weight_unit` | `g \| kg \| t` | Yes | — | > **cost full type** > > ```ts theme={null} > { > items: { > method_type: string, > cdr_amount: number, > cost: number > }[], > removal: number, > variable_fees: number, > total: number > } > ``` *** ### purchase `cdr.purchase` Create a CO2 removal purchase request and return its transaction UUID. **Risk:** `write` ```ts theme={null} await corsair.cdrplatform.api.cdr.purchase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `weight_unit` | `g \| kg \| t` | Yes | — | | `currency` | `usd \| eur \| gbp \| chf` | Yes | — | | `items` | `object[]` | Yes | — | | `client_reference_id` | `string` | No | — | | `certificate_display_name` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > method_type: string, > cdr_amount: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `transaction_uuid` | `string` | Yes | — | *** ## Certificate ### get `certificate.get` Retrieve a removal certificate by certificate ID. **Risk:** `read` ```ts theme={null} await corsair.cdrplatform.api.certificate.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `certificate_id` | `string` | Yes | — | | `display_name` | `string` | Yes | — | | `issued_date` | `string` | Yes | — | | `removal_amount_kg` | `number` | Yes | — | *** ## Health ### check `health.check` Check CDR Platform API health status. **Risk:** `read` ```ts theme={null} await corsair.cdrplatform.api.health.check({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `db_up` | `object` | Yes | — | > **db\_up full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/cdrplatform/database CDR Platform local sync: searchable entities, `.search()` filters, and operators. The CDR Platform plugin syncs data locally. Use `corsair.cdrplatform.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Certificates Path: `cdrplatform.db.certificates.search` ```ts theme={null} const rows = await corsair.cdrplatform.db.certificates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `certificate_id` | `string` | equals, contains, startsWith, endsWith, in | | `display_name` | `string` | equals, contains, startsWith, endsWith, in | | `issued_date` | `string` | equals, contains, startsWith, endsWith, in | | `removal_amount_kg` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Price Quotes Path: `cdrplatform.db.priceQuotes.search` ```ts theme={null} const rows = await corsair.cdrplatform.db.priceQuotes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Removal Requests Path: `cdrplatform.db.removalRequests.search` ```ts theme={null} const rows = await corsair.cdrplatform.db.removalRequests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `transaction_uuid` | `string` | equals, contains, startsWith, endsWith, in | | `client_reference_id` | `string` | equals, contains, startsWith, endsWith, in | | `certificate_display_name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/cdrplatform/overview CDR Platform plugin for Corsair Use **CDR Platform** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 3 synced entities (`certificates`, `priceQuotes`, `removalRequests`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cdrplatform ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cdrplatform ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cdrplatform ``` ```bash bun theme={null} bun add corsair @corsair-dev/cdrplatform ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cdrplatform } from '@corsair-dev/cdrplatform'; export const corsair = createCorsair({ plugins: [ cdrplatform(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} cdrplatform() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cdrplatform', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`cdr.price`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cdrplatform.api.cdr.price({}); ``` **`cdr.purchase`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cdrplatform.api.cdr.purchase({}); ``` See the full list on the [API](/plugins/cdrplatform/api) page. ## Query synced data Synced entities support `tenant.cdrplatform.db..search()` and `.list()`: `certificates`, `priceQuotes`, `removalRequests`. See [Database](/plugins/cdrplatform/database) for filters and operators. ## What's next > **[API reference](/plugins/cdrplatform/api)** > > Every `cdrplatform.api.*` operation with input and output types. > **[Database](/plugins/cdrplatform/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/celigo/api API reference for Celigo: every `celigo.api.*` operation with input and output types. Every `celigo.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getTokenInfo `account.getTokenInfo` Get the user id behind the current API token **Risk:** `read` ```ts theme={null} await corsair.celigo.api.account.getTokenInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `_userId` | `string` | Yes | — | *** ### listLicenses `account.listLicenses` List the account licenses and subscriptions **Risk:** `read` ```ts theme={null} await corsair.celigo.api.account.listLicenses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `io` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > type?: string, > tier?: string, > expires?: string > }[] > ``` *** ## Audit ### list `audit.list` List account audit log entries, newest first **Risk:** `read` ```ts theme={null} await corsair.celigo.api.audit.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | | `from` | `string` | No | ISO timestamp lower bound | | `to` | `string` | No | ISO timestamp upper bound | | `action` | `create \| update \| delete \| view \| restore \| purge \| signin \| signout \| purgelogs` | No | — | | `source` | `ui \| api \| system \| connector \| script \| stack \| sso \| cli \| mcp \| ora` | No | — | | `_byUserId` | `string` | No | — | | `resourceType` | `string` | No | Singular resource type, e.g. flow, export, connection | | `_resourceId` | `string` | No | — | | `fieldPath` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > resourceType?: string, > _resourceId?: string, > source?: string, > action?: string, > time?: string, > byUser?: { > _id?: string, > email?: string, > name?: string > } > }[] > ``` *** ## Connections ### create `connections.create` Create a connection **Risk:** `write` ```ts theme={null} await corsair.celigo.api.connections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `string` | Yes | Connection type, e.g. http, netsuite, salesforce, ftp, s3, rdbms, mongodb, wrapper | | `externalId` | `string` | No | — | | `assistant` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### delete `connections.delete` Delete a connection **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.connections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### evaluateVirtualImportMap `connections.evaluateVirtualImportMap` Run only the mapping step of an unsaved import and return the mapped records **Risk:** `read` ```ts theme={null} await corsair.celigo.api.connections.evaluateVirtualImportMap({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `import` | `object` | Yes | Import definition to run without saving it | | `data` | `object[]` | Yes | Records to send through the import | > **import full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > any[] | { > } > ``` *** ### executeVirtualExport `connections.executeVirtualExport` Run an unsaved export definition through a connection **Risk:** `write` ```ts theme={null} await corsair.celigo.api.connections.executeVirtualExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `export` | `object` | Yes | Export definition to run without saving it | > **export full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `dataURIs` | `string \| null[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### executeVirtualExportPaged `connections.executeVirtualExportPaged` Run an unsaved export one page at a time. Pass back pagedExportState for the next page **Risk:** `write` ```ts theme={null} await corsair.celigo.api.connections.executeVirtualExportPaged({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `export` | `object` | Yes | Export definition to run without saving it | | `pagedExportState` | `object` | No | pagedExportState from the previous page; omit for the first page | > **export full type** > > ```ts theme={null} > { > } > ``` > **pagedExportState full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `dataURIs` | `string \| null[]` | No | — | | `pagedExportState` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **pagedExportState full type** > > ```ts theme={null} > { > } > ``` *** ### executeVirtualImport `connections.executeVirtualImport` Send records through an unsaved import definition **Risk:** `write` ```ts theme={null} await corsair.celigo.api.connections.executeVirtualImport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `import` | `object` | Yes | Import definition to run without saving it | | `data` | `object[]` | Yes | Records to send through the import | > **import full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > statusCode?: number, > id?: string, > _json?: { > }, > ignored?: boolean, > stage?: string, > errors?: { > }[] > }[] > ``` *** ### get `connections.get` Get a connection by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.connections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### getAudit `connections.getAudit` List audit log entries for a connection **Risk:** `read` ```ts theme={null} await corsair.celigo.api.connections.getAudit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | | `from` | `string` | No | ISO timestamp lower bound | | `to` | `string` | No | ISO timestamp upper bound | | `action` | `create \| update \| delete \| view \| restore \| purge \| signin \| signout \| purgelogs` | No | — | | `source` | `ui \| api \| system \| connector \| script \| stack \| sso \| cli \| mcp \| ora` | No | — | | `_byUserId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > resourceType?: string, > _resourceId?: string, > source?: string, > action?: string, > time?: string, > byUser?: { > _id?: string, > email?: string, > name?: string > } > }[] > ``` *** ### getDebugLogs `connections.getDebugLogs` Get the debug log text recorded for a connection **Risk:** `read` ```ts theme={null} await corsair.celigo.api.connections.getDebugLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `logs` | `string` | Yes | — | *** ### getDependencies `connections.getDependencies` List resources that depend on a connection **Risk:** `read` ```ts theme={null} await corsair.celigo.api.connections.getDependencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `connections.list` List connections in the account **Risk:** `read` ```ts theme={null} await corsair.celigo.api.connections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | | `include` | `string` | No | Comma-separated fields to return | | `exclude` | `string` | No | Comma-separated fields to omit | | `fetchQueueSize` | `boolean` | No | — | | `externalId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### patch `connections.patch` Apply JSON Patch operations to a connection **Risk:** `write` ```ts theme={null} await corsair.celigo.api.connections.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > op: replace | add | remove, > path: string, > value?: any > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### ping `connections.ping` Test that a saved connection can reach its application **Risk:** `read` ```ts theme={null} await corsair.celigo.api.connections.ping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > code: number > } | { > errors: { > }[] > } > ``` *** ### testVirtual `connections.testVirtual` Test an unsaved connection document without storing it **Risk:** `read` ```ts theme={null} await corsair.celigo.api.connections.testVirtual({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `string` | Yes | Connection type, e.g. http, netsuite, salesforce, ftp, s3, rdbms, mongodb, wrapper | | `externalId` | `string` | No | — | | `assistant` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > code: number > } | { > errors: { > }[] > } > ``` *** ### update `connections.update` Replace a connection document **Risk:** `write` ```ts theme={null} await corsair.celigo.api.connections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | Yes | — | | `type` | `string` | Yes | Connection type, e.g. http, netsuite, salesforce, ftp, s3, rdbms, mongodb, wrapper | | `externalId` | `string` | No | — | | `assistant` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ## Edi Profiles ### list `ediProfiles.list` List EDI trading partner profiles **Risk:** `read` ```ts theme={null} await corsair.celigo.api.ediProfiles.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ## Errors ### assign `errors.assign` Assign flow step errors to a user by email **Risk:** `write` ```ts theme={null} await corsair.celigo.api.errors.assign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `stepId` | `string` | Yes | \_id of the export or import step in the flow | | `errorIds` | `string[]` | Yes | — | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `errorsToReturn` | `string[]` | No | — | *** ### deleteResolved `errors.deleteResolved` Purge resolved errors from a flow step **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.errors.deleteResolved({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `stepId` | `string` | Yes | \_id of the export or import step in the flow | | `errors` | `string[]` | No | errorIds to act on | | `selectAll` | `boolean` | No | — | | `lastErrorAt` | `string` | No | With selectAll, only errors at or before this timestamp | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### list `errors.list` List open errors for one export or import step of a flow **Risk:** `read` ```ts theme={null} await corsair.celigo.api.errors.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `stepId` | `string` | Yes | \_id of the export or import step in the flow | | `_flowJobId` | `string` | No | — | | `occurredAt_gte` | `string` | No | — | | `occurredAt_lte` | `string` | No | — | | `tags` | `string[]` | No | — | | `nextPageURL` | `string` | No | nextPageURL from the previous response; when set, it replaces the filters | **Output** | Name | Type | Required | Description | | - | - | - | - | | `errors` | `object[]` | Yes | — | | `nextPageURL` | `string` | No | — | > **errors full type** > > ```ts theme={null} > { > errorId: string, > occurredAt?: string, > source?: string, > code?: string, > message?: string, > _flowJobId?: string, > traceKey?: string, > retryDataKey?: string > }[] > ``` *** ### listResolved `errors.listResolved` List resolved errors for one step of a flow **Risk:** `read` ```ts theme={null} await corsair.celigo.api.errors.listResolved({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `stepId` | `string` | Yes | \_id of the export or import step in the flow | | `_flowJobId` | `string` | No | — | | `occurredAt_gte` | `string` | No | — | | `occurredAt_lte` | `string` | No | — | | `tags` | `string[]` | No | — | | `nextPageURL` | `string` | No | nextPageURL from the previous response; when set, it replaces the filters | | `resolvedAt_gte` | `string` | No | — | | `resolvedAt_lte` | `string` | No | — | | `resolvedBy` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resolved` | `object[]` | Yes | — | | `nextPageURL` | `string` | No | — | > **resolved full type** > > ```ts theme={null} > { > errorId: string, > occurredAt?: string, > source?: string, > code?: string, > message?: string, > _flowJobId?: string, > traceKey?: string, > retryDataKey?: string > }[] > ``` *** ### resolve `errors.resolve` Mark errors on a flow step as resolved **Risk:** `write` ```ts theme={null} await corsair.celigo.api.errors.resolve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `stepId` | `string` | Yes | \_id of the export or import step in the flow | | `errors` | `string[]` | No | errorIds to act on | | `selectAll` | `boolean` | No | — | | `lastErrorAt` | `string` | No | With selectAll, only errors at or before this timestamp | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### retry `errors.retry` Retry failed records on a flow step **Risk:** `write` ```ts theme={null} await corsair.celigo.api.errors.retry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `stepId` | `string` | Yes | \_id of the export or import step in the flow | | `retryDataKeys` | `string[]` | No | — | | `selectAll` | `boolean` | No | — | | `lastErrorAt` | `string` | No | With selectAll, only errors at or before this timestamp | **Output** | Name | Type | Required | Description | | - | - | - | - | | `retryErrorCount` | `number` | No | — | *** ### updateTags `errors.updateTags` Set tags on flow step errors **Risk:** `write` ```ts theme={null} await corsair.celigo.api.errors.updateTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `stepId` | `string` | Yes | \_id of the export or import step in the flow | | `errors` | `object[]` | Yes | — | | `tagIds` | `string[]` | Yes | — | > **errors full type** > > ```ts theme={null} > { > id?: string, > rdk?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `errorsToReturn` | `object` | No | — | > **errorsToReturn full type** > > ```ts theme={null} > { > } > ``` *** ## Exports ### clone `exports.clone` Clone a export, optionally remapping connections **Risk:** `write` ```ts theme={null} await corsair.celigo.api.exports.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | No | — | | `connectionMap` | `object` | No | Maps source connection \_id to target connection \_id | > **connectionMap full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > } | { > model: string, > _id: string, > name?: string > }[] > ``` *** ### create `exports.create` Create a export **Risk:** `write` ```ts theme={null} await corsair.celigo.api.exports.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### delete `exports.delete` Delete a export **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.exports.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `exports.get` Get a export by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.exports.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### getAudit `exports.getAudit` List audit log entries for a export **Risk:** `read` ```ts theme={null} await corsair.celigo.api.exports.getAudit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | | `from` | `string` | No | ISO timestamp lower bound | | `to` | `string` | No | ISO timestamp upper bound | | `action` | `create \| update \| delete \| view \| restore \| purge \| signin \| signout \| purgelogs` | No | — | | `source` | `ui \| api \| system \| connector \| script \| stack \| sso \| cli \| mcp \| ora` | No | — | | `_byUserId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > resourceType?: string, > _resourceId?: string, > source?: string, > action?: string, > time?: string, > byUser?: { > _id?: string, > email?: string, > name?: string > } > }[] > ``` *** ### list `exports.list` List exports in the account **Risk:** `read` ```ts theme={null} await corsair.celigo.api.exports.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `externalId` | `string` | No | — | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | | `include` | `string` | No | Comma-separated fields to return | | `exclude` | `string` | No | Comma-separated fields to omit | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### patch `exports.patch` Apply JSON Patch operations to a export **Risk:** `write` ```ts theme={null} await corsair.celigo.api.exports.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > op: replace | add | remove, > path: string, > value?: any > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `exports.update` Replace a export document. Send the full document; omitted fields are cleared **Risk:** `write` ```ts theme={null} await corsair.celigo.api.exports.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ## File Definitions ### create `fileDefinitions.create` Create a file definition **Risk:** `write` ```ts theme={null} await corsair.celigo.api.fileDefinitions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### get `fileDefinitions.get` Get a file definition by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.fileDefinitions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### list `fileDefinitions.list` List EDI and fixed-width file definitions **Risk:** `read` ```ts theme={null} await corsair.celigo.api.fileDefinitions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include` | `string` | No | Comma-separated fields to return | | `exclude` | `string` | No | Comma-separated fields to omit | | `externalId` | `string` | No | — | | `limit` | `number` | No | Maximum number of results per page | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ## Flows ### clone `flows.clone` Clone a flow, optionally remapping connections **Risk:** `write` ```ts theme={null} await corsair.celigo.api.flows.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | No | — | | `connectionMap` | `object` | No | Maps source connection \_id to target connection \_id | | `_integrationId` | `string` | Yes | — | > **connectionMap full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > } | { > model: string, > _id: string, > name?: string > }[] > ``` *** ### create `flows.create` Create a flow **Risk:** `write` ```ts theme={null} await corsair.celigo.api.flows.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### delete `flows.delete` Delete a flow **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.flows.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `flows.get` Get a flow by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.flows.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `mergeInstance` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### getAudit `flows.getAudit` List audit log entries for a flow **Risk:** `read` ```ts theme={null} await corsair.celigo.api.flows.getAudit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | | `from` | `string` | No | ISO timestamp lower bound | | `to` | `string` | No | ISO timestamp upper bound | | `action` | `create \| update \| delete \| view \| restore \| purge \| signin \| signout \| purgelogs` | No | — | | `source` | `ui \| api \| system \| connector \| script \| stack \| sso \| cli \| mcp \| ora` | No | — | | `_byUserId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > resourceType?: string, > _resourceId?: string, > source?: string, > action?: string, > time?: string, > byUser?: { > _id?: string, > email?: string, > name?: string > } > }[] > ``` *** ### getDependencies `flows.getDependencies` List resources that depend on a flow **Risk:** `read` ```ts theme={null} await corsair.celigo.api.flows.getDependencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getDescendants `flows.getDescendants` List the exports, imports and tools a flow uses **Risk:** `read` ```ts theme={null} await corsair.celigo.api.flows.getDescendants({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exports` | `object[]` | No | — | | `imports` | `object[]` | No | — | | `tools` | `object[]` | No | — | > **exports full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` > **imports full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` > **tools full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### getLastExportDateTime `flows.getLastExportDateTime` Get when a flow last exported data **Risk:** `read` ```ts theme={null} await corsair.celigo.api.flows.getLastExportDateTime({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lastExportDateTime` | `string` | No | — | *** ### getLatestJobs `flows.getLatestJobs` Get the most recent jobs for a flow **Risk:** `read` ```ts theme={null} await corsair.celigo.api.flows.getLatestJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `include` | `string` | No | Comma-separated fields to return | | `exclude` | `string` | No | Comma-separated fields to omit | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > type?: string, > status?: string, > _flowId?: string, > numError?: number, > numSuccess?: number, > startedAt?: string, > endedAt?: string > }[] > ``` *** ### getTemplate `flows.getTemplate` Get a signed URL to download a flow as a template zip **Risk:** `read` ```ts theme={null} await corsair.celigo.api.flows.getTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `signedURL` | `string` | Yes | — | | `key` | `string` | No | — | *** ### list `flows.list` List flows in the account **Risk:** `read` ```ts theme={null} await corsair.celigo.api.flows.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `_abstractFlowId` | `string` | No | — | | `externalId` | `string` | No | — | | `name` | `string` | No | — | | `disabled` | `boolean` | No | — | | `_integrationId` | `string` | No | — | | `sort_by` | `lastExecutedAt` | No | — | | `includeInstances` | `boolean` | No | — | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | | `include` | `string` | No | Comma-separated fields to return | | `exclude` | `string` | No | Comma-separated fields to omit | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### patch `flows.patch` Apply JSON Patch operations to a flow **Risk:** `write` ```ts theme={null} await corsair.celigo.api.flows.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > op: replace | add | remove, > path: string, > value?: any > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `flows.update` Replace a flow document. Send the full document; omitted fields are cleared **Risk:** `write` ```ts theme={null} await corsair.celigo.api.flows.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ## I Clients ### create `iClients.create` Create an iClient **Risk:** `write` ```ts theme={null} await corsair.celigo.api.iClients.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### delete `iClients.delete` Delete an iClient **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.iClients.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `iClients.get` Get an iClient by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.iClients.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### list `iClients.list` List iClients (stored OAuth app credentials) **Risk:** `read` ```ts theme={null} await corsair.celigo.api.iClients.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### patch `iClients.patch` Patch an iClient. Celigo only allows replacing /oauth2/failPath **Risk:** `write` ```ts theme={null} await corsair.celigo.api.iClients.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > op: replace | add | remove, > path: /oauth2/failPath, > value?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `iClients.update` Replace an iClient document **Risk:** `write` ```ts theme={null} await corsair.celigo.api.iClients.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ## Imports ### clone `imports.clone` Clone a import, optionally remapping connections **Risk:** `write` ```ts theme={null} await corsair.celigo.api.imports.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | No | — | | `connectionMap` | `object` | No | Maps source connection \_id to target connection \_id | > **connectionMap full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > } | { > model: string, > _id: string, > name?: string > }[] > ``` *** ### create `imports.create` Create a import **Risk:** `write` ```ts theme={null} await corsair.celigo.api.imports.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### delete `imports.delete` Delete a import **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.imports.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `imports.get` Get a import by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.imports.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### getAudit `imports.getAudit` List audit log entries for a import **Risk:** `read` ```ts theme={null} await corsair.celigo.api.imports.getAudit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | | `from` | `string` | No | ISO timestamp lower bound | | `to` | `string` | No | ISO timestamp upper bound | | `action` | `create \| update \| delete \| view \| restore \| purge \| signin \| signout \| purgelogs` | No | — | | `source` | `ui \| api \| system \| connector \| script \| stack \| sso \| cli \| mcp \| ora` | No | — | | `_byUserId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > resourceType?: string, > _resourceId?: string, > source?: string, > action?: string, > time?: string, > byUser?: { > _id?: string, > email?: string, > name?: string > } > }[] > ``` *** ### getDependencies `imports.getDependencies` List resources that depend on a import **Risk:** `read` ```ts theme={null} await corsair.celigo.api.imports.getDependencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### invoke `imports.invoke` Run a saved import against the given records **Risk:** `write` ```ts theme={null} await corsair.celigo.api.imports.invoke({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > statusCode?: number, > id?: string, > _json?: { > }, > ignored?: boolean, > stage?: string, > errors?: { > }[] > }[] > ``` *** ### list `imports.list` List imports in the account **Risk:** `read` ```ts theme={null} await corsair.celigo.api.imports.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `externalId` | `string` | No | — | | `include` | `string` | No | Comma-separated fields to return | | `exclude` | `string` | No | Comma-separated fields to omit | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### patch `imports.patch` Apply JSON Patch operations to a import **Risk:** `write` ```ts theme={null} await corsair.celigo.api.imports.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > op: replace | add | remove, > path: string, > value?: any > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `imports.update` Replace a import document. Send the full document; omitted fields are cleared **Risk:** `write` ```ts theme={null} await corsair.celigo.api.imports.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ## Integrations ### clone `integrations.clone` Clone a integration, optionally remapping connections **Risk:** `write` ```ts theme={null} await corsair.celigo.api.integrations.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | No | — | | `description` | `string` | No | — | | `envId` | `string` | No | — | | `connectionMap` | `object` | Yes | Maps source connection \_id to target connection \_id | > **connectionMap full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > } | { > model: string, > _id: string, > name?: string > }[] > ``` *** ### create `integrations.create` Create a integration **Risk:** `write` ```ts theme={null} await corsair.celigo.api.integrations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### createRevision `integrations.createRevision` Snapshot an integration as a new revision **Risk:** `write` ```ts theme={null} await corsair.celigo.api.integrations.createRevision({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `description` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `_integrationId` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | *** ### delete `integrations.delete` Delete a integration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.integrations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `integrations.get` Get a integration by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ### getAudit `integrations.getAudit` List audit log entries for a integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.getAudit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | | `from` | `string` | No | ISO timestamp lower bound | | `to` | `string` | No | ISO timestamp upper bound | | `action` | `create \| update \| delete \| view \| restore \| purge \| signin \| signout \| purgelogs` | No | — | | `source` | `ui \| api \| system \| connector \| script \| stack \| sso \| cli \| mcp \| ora` | No | — | | `_byUserId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > resourceType?: string, > _resourceId?: string, > source?: string, > action?: string, > time?: string, > byUser?: { > _id?: string, > email?: string, > name?: string > } > }[] > ``` *** ### getDependencies `integrations.getDependencies` List resources that depend on a integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.getDependencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTemplate `integrations.getTemplate` Get a signed URL to download an integration as a template zip **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.getTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `signedURL` | `string` | Yes | — | | `key` | `string` | No | — | *** ### list `integrations.list` List integrations in the account **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include` | `string` | No | Comma-separated fields to return | | `exclude` | `string` | No | Comma-separated fields to omit | | `limit` | `number` | No | Maximum number of results per page | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### listConnections `integrations.listConnections` List the connections registered to an integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.listConnections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `limit` | `number` | No | Maximum number of results per page | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### listErrors `integrations.listErrors` Get open error counts per flow in an integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.listErrors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _flowId: string, > numError?: number, > lastErrorAt?: string > }[] > ``` *** ### listExports `integrations.listExports` List the exports in an integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.listExports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `limit` | `number` | No | Maximum number of results per page | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### listFlows `integrations.listFlows` List the flows in an integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.listFlows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `limit` | `number` | No | Maximum number of results per page | | `includeInstances` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### listImports `integrations.listImports` List the imports in an integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.listImports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `limit` | `number` | No | Maximum number of results per page | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### listUsers `integrations.listUsers` List the users shared on an integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.integrations.listUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > name?: string, > createdAt?: string, > lastModified?: string > }[] > ``` *** ### patch `integrations.patch` Apply JSON Patch operations to a integration **Risk:** `write` ```ts theme={null} await corsair.celigo.api.integrations.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > op: replace | add | remove, > path: string, > value?: any > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### registerConnection `integrations.registerConnection` Register a connection to an integration **Risk:** `write` ```ts theme={null} await corsair.celigo.api.integrations.registerConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `connectionId` | `string` | Yes | Connection \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### registerConnections `integrations.registerConnections` Register connections to an integration, one per request body (\_connectionId) **Risk:** `write` ```ts theme={null} await corsair.celigo.api.integrations.registerConnections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `_connectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### unregisterConnection `integrations.unregisterConnection` Unregister a connection from an integration **Risk:** `destructive` ```ts theme={null} await corsair.celigo.api.integrations.unregisterConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `connectionId` | `string` | Yes | Connection \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `integrations.update` Replace a integration document. Send the full document; omitted fields are cleared **Risk:** `write` ```ts theme={null} await corsair.celigo.api.integrations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModified` | `string` | No | — | *** ## Jobs ### getErrors `jobs.getErrors` Get the errors of a job (up to 1000) **Risk:** `read` ```ts theme={null} await corsair.celigo.api.jobs.getErrors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > code?: string, > message?: string, > source?: string, > createdAt?: string, > _jobId?: string, > _retryId?: string > }[] > ``` *** ### list `jobs.list` List jobs filtered by flow, integration, status, type or date **Risk:** `read` ```ts theme={null} await corsair.celigo.api.jobs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `_integrationId` | `string` | No | — | | `_exportId` | `string` | No | — | | `_importId` | `string` | No | — | | `_flowId` | `string` | No | — | | `_flowJobId` | `string` | No | — | | `_flowId_in` | `string` | No | Comma-separated flow ids | | `status_in` | `string` | No | Comma-separated statuses | | `createdAt_lte` | `string` | No | — | | `createdAt_gte` | `string` | No | — | | `status` | `queued \| running \| completed \| failed \| canceled \| canceling \| retrying` | No | — | | `numSuccess_lte` | `number` | No | — | | `numSuccess_gte` | `number` | No | — | | `numIgnore_lte` | `number` | No | — | | `numIgnore_gte` | `number` | No | — | | `numError_gte` | `number` | No | — | | `numError_lte` | `number` | No | — | | `type` | `flow \| export \| import \| retry \| bulk_retry` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > type?: string, > status?: string, > _flowId?: string, > numError?: number, > numSuccess?: number, > startedAt?: string, > endedAt?: string > }[] > ``` *** ## Processors ### generateStructuredFile `processors.generateStructuredFile` Render JSON records as delimited or fixed-width text **Risk:** `read` ```ts theme={null} await corsair.celigo.api.processors.generateStructuredFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `rules` | `object` | Yes | — | | `options` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **rules full type** > > ```ts theme={null} > { > name: string, > version: 1 | 2, > format: delimited | delimited/x12 | delimited/edifact | fixed, > rules: { > }[] > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `mediaType` | `string` | No | — | | `data` | `string` | Yes | — | | `duration` | `number` | No | — | *** ### parseCsv `processors.parseCsv` Parse CSV text into JSON records **Risk:** `read` ```ts theme={null} await corsair.celigo.api.processors.parseCsv({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `string` | Yes | — | | `rules` | `object` | No | columnDelimiter, rowDelimiter, hasHeaderRow, rowsToSkip, keyColumns, ... | | `options` | `object` | No | — | > **rules full type** > > ```ts theme={null} > { > } > ``` > **options full type** > > ```ts theme={null} > { > includeEmptyValues?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `mediaType` | `string` | No | — | | `data` | `any[]` | Yes | — | | `duration` | `number` | No | — | *** ### parseStructuredFile `processors.parseStructuredFile` Parse EDI or fixed-width text into JSON using a file definition **Risk:** `read` ```ts theme={null} await corsair.celigo.api.processors.parseStructuredFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `string` | Yes | — | | `rules` | `object` | Yes | fileDefinition or \_fileDefinitionId, resourcePath | | `options` | `object` | No | — | > **rules full type** > > ```ts theme={null} > { > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `mediaType` | `string` | No | — | | `data` | `any[]` | Yes | — | | `duration` | `number` | No | — | *** ### parseXml `processors.parseXml` Parse XML text into JSON records **Risk:** `read` ```ts theme={null} await corsair.celigo.api.processors.parseXml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `string` | Yes | — | | `rules` | `object` | No | resourcePath, groupByFields, sortByFields, doc | > **rules full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `mediaType` | `string` | No | — | | `data` | `any[]` | Yes | — | | `duration` | `number` | No | — | *** ## Scripts ### create `scripts.create` Create a JavaScript hook script **Risk:** `write` ```ts theme={null} await corsair.celigo.api.scripts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `content` | `string` | No | JavaScript source | | `postResponseHookToProcessOnChildRecord` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `content` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `lastModified` | `string` | Yes | — | *** ### delete `scripts.delete` Delete a script **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.scripts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `scripts.get` Get a script by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.scripts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `content` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `lastModified` | `string` | Yes | — | *** ### getLogs `scripts.getLogs` Get execution logs written by a script **Risk:** `read` ```ts theme={null} await corsair.celigo.api.scripts.getLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `time_lte` | `number` | No | Epoch milliseconds | | `time_gt` | `number` | No | Epoch milliseconds | | `_flowId` | `string` | No | — | | `_resourceId` | `string` | No | — | | `functionType` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `logs` | `object[]` | Yes | — | | `nextPageURL` | `string` | No | — | > **logs full type** > > ```ts theme={null} > { > }[] > ``` *** ### update `scripts.update` Replace a script **Risk:** `write` ```ts theme={null} await corsair.celigo.api.scripts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `content` | `string` | No | JavaScript source | | `postResponseHookToProcessOnChildRecord` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `content` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `lastModified` | `string` | Yes | — | *** ## State ### delete `state.delete` Delete a global state key **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.state.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | State key | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### deleteAll `state.deleteAll` Delete every global state key **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.state.deleteAll({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### deleteAllForResource `state.deleteAllForResource` Delete every state key on an export, import or integration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.state.deleteAllForResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `resourceType` | `exports \| imports \| integrations` | Yes | — | | `resourceId` | `string` | Yes | \_id of the export, import or integration | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### deleteForResource `state.deleteForResource` Delete a state key on an export, import or integration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.state.deleteForResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `resourceType` | `exports \| imports \| integrations` | Yes | — | | `resourceId` | `string` | Yes | \_id of the export, import or integration | | `key` | `string` | Yes | State key | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `state.get` Get the value stored under a global state key **Risk:** `read` ```ts theme={null} await corsair.celigo.api.state.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | State key | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### getForResource `state.getForResource` Get a state value stored on an export, import or integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.state.getForResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `resourceType` | `exports \| imports \| integrations` | Yes | — | | `resourceId` | `string` | Yes | \_id of the export, import or integration | | `key` | `string` | Yes | State key | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### list `state.list` List global state keys **Risk:** `read` ```ts theme={null} await corsair.celigo.api.state.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `keys` | `string[]` | Yes | — | *** ### listForResource `state.listForResource` List state keys stored on an export, import or integration **Risk:** `read` ```ts theme={null} await corsair.celigo.api.state.listForResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `resourceType` | `exports \| imports \| integrations` | Yes | — | | `resourceId` | `string` | Yes | \_id of the export, import or integration | **Output** | Name | Type | Required | Description | | - | - | - | - | | `keys` | `string[]` | Yes | — | *** ### set `state.set` Create or replace the value under a global state key **Risk:** `write` ```ts theme={null} await corsair.celigo.api.state.set({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | State key | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > } | any[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | Yes | OK when replaced, Created when new | *** ### setForResource `state.setForResource` Create or replace a state value on an export, import or integration **Risk:** `write` ```ts theme={null} await corsair.celigo.api.state.setForResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `resourceType` | `exports \| imports \| integrations` | Yes | — | | `resourceId` | `string` | Yes | \_id of the export, import or integration | | `key` | `string` | Yes | State key | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > } | any[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | Yes | OK when replaced, Created when new | *** ## Tags ### create `tags.create` Create an error tag **Risk:** `write` ```ts theme={null} await corsair.celigo.api.tags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `tag` | `string` | No | — | | `tagId` | `string` | No | — | *** ### delete `tags.delete` Delete an error tag **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `tags.get` Get an error tag by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.tags.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `tag` | `string` | No | — | | `tagId` | `string` | No | — | *** ### list `tags.list` List error tags **Risk:** `read` ```ts theme={null} await corsair.celigo.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Maximum number of results per page | | `after` | `string` | No | Return results after this \_id (cursor from the Link header) | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > tag?: string, > tagId?: string > }[] > ``` *** ### update `tags.update` Rename an error tag **Risk:** `write` ```ts theme={null} await corsair.celigo.api.tags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `tag` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `tag` | `string` | No | — | | `tagId` | `string` | No | — | *** ## Users ### delete `users.delete` Remove a user from the account **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.celigo.api.users.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `users.get` Get a user share by id **Risk:** `read` ```ts theme={null} await corsair.celigo.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `accessLevel` | `string` | No | — | | `accepted` | `boolean` | No | — | | `disabled` | `boolean` | No | — | | `sharedWithUser` | `object` | No | — | > **sharedWithUser full type** > > ```ts theme={null} > { > _id?: string, > email?: string, > name?: string > } > ``` *** ### invite `users.invite` Invite one user by email with account or integration access **Risk:** `write` ```ts theme={null} await corsair.celigo.api.users.invite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `accessLevel` | `monitor \| manage \| administrator \| none` | No | Account-wide access level | | `integrationAccessLevel` | `object[]` | No | — | | `accountSSORequired` | `boolean` | No | — | | `accountMFARequired` | `boolean` | No | — | | `allowAccessToAPIM` | `boolean` | No | — | | `allowToEditRetryData` | `boolean` | No | — | | `allowIntegrationWorkspaceCreation` | `boolean` | No | — | > **integrationAccessLevel full type** > > ```ts theme={null} > { > _integrationId: string, > accessLevel: monitor | manage | administrator | none > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `accessLevel` | `string` | No | — | | `accepted` | `boolean` | No | — | | `disabled` | `boolean` | No | — | | `sharedWithUser` | `object` | No | — | > **sharedWithUser full type** > > ```ts theme={null} > { > _id?: string, > email?: string, > name?: string > } > ``` *** ### inviteMultiple `users.inviteMultiple` Invite several users by email with the same access **Risk:** `write` ```ts theme={null} await corsair.celigo.api.users.inviteMultiple({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `string[]` | Yes | — | | `accessLevel` | `monitor \| manage \| administrator \| none` | No | Account-wide access level | | `integrationAccessLevel` | `object[]` | No | — | | `accountSSORequired` | `boolean` | No | — | | `accountMFARequired` | `boolean` | No | — | | `allowAccessToAPIM` | `boolean` | No | — | | `allowToEditRetryData` | `boolean` | No | — | | `allowIntegrationWorkspaceCreation` | `boolean` | No | — | > **integrationAccessLevel full type** > > ```ts theme={null} > { > _integrationId: string, > accessLevel: monitor | manage | administrator | none > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > statusCode?: number, > doc?: { > _id: string, > accessLevel?: string, > accepted?: boolean, > disabled?: boolean, > sharedWithUser?: { > _id?: string, > email?: string, > name?: string > } > } > }[] > ``` *** ### list `users.list` List users the account is shared with **Risk:** `read` ```ts theme={null} await corsair.celigo.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userType` | `workspace \| end-user` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id: string, > accessLevel?: string, > accepted?: boolean, > disabled?: boolean, > sharedWithUser?: { > _id?: string, > email?: string, > name?: string > } > }[] > ``` *** ### update `users.update` Change a user share access level **Risk:** `write` ```ts theme={null} await corsair.celigo.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Celigo resource \_id | | `accessLevel` | `monitor \| manage \| administrator \| none` | No | Account-wide access level | | `integrationAccessLevel` | `object[]` | No | — | | `accountSSORequired` | `boolean` | No | — | | `accountMFARequired` | `boolean` | No | — | | `allowAccessToAPIM` | `boolean` | No | — | | `allowToEditRetryData` | `boolean` | No | — | | `allowIntegrationWorkspaceCreation` | `boolean` | No | — | > **integrationAccessLevel full type** > > ```ts theme={null} > { > _integrationId: string, > accessLevel: monitor | manage | administrator | none > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/celigo/database Celigo local sync: searchable entities, `.search()` filters, and operators. The Celigo plugin syncs data locally. Use `corsair.celigo.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Connections Path: `celigo.db.connections.search` ```ts theme={null} const rows = await corsair.celigo.db.connections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `integrationId` | `string` | equals, contains, startsWith, endsWith, in | | `connectorId` | `string` | equals, contains, startsWith, endsWith, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | | `assistant` | `string` | equals, contains, startsWith, endsWith, in | | `agentId` | `string` | equals, contains, startsWith, endsWith, in | | `borrowConcurrencyFromConnectionId` | `string` | equals, contains, startsWith, endsWith, in | | `parentConnectionId` | `string` | equals, contains, startsWith, endsWith, in | | `mcpOwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `sourceId` | `string` | equals, contains, startsWith, endsWith, in | | `connectionRole` | `string` | equals, contains, startsWith, endsWith, in | | `offline` | `boolean` | equals | | `isHTTP` | `boolean` | equals | | `autoRecoverRateLimitErrors` | `boolean` | equals | | `enableMicroBatchForOneToMany` | `boolean` | equals | | `enableCsvObjectParsing` | `boolean` | equals | | `debugDate` | `date` | equals, before, after, between | | `debugUntil` | `date` | equals, before, after, between | | `parentSyncedAt` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Exports Path: `celigo.db.exports.search` ```ts theme={null} const rows = await corsair.celigo.db.exports.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `connectionId` | `string` | equals, contains, startsWith, endsWith, in | | `integrationId` | `string` | equals, contains, startsWith, endsWith, in | | `connectorId` | `string` | equals, contains, startsWith, endsWith, in | | `adaptorType` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `pageSize` | `number` | equals, gt, gte, lt, lte, in | | `dataURITemplate` | `string` | equals, contains, startsWith, endsWith, in | | `traceKeyTemplate` | `string` | equals, contains, startsWith, endsWith, in | | `skipRetries` | `boolean` | equals | | `oneToMany` | `boolean` | equals | | `pathToMany` | `string` | equals, contains, startsWith, endsWith, in | | `isLookup` | `boolean` | equals | | `ediProfileId` | `string` | equals, contains, startsWith, endsWith, in | | `postParseListenerId` | `string` | equals, contains, startsWith, endsWith, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | | `assistant` | `string` | equals, contains, startsWith, endsWith, in | | `apiIdentifier` | `string` | equals, contains, startsWith, endsWith, in | | `asynchronous` | `boolean` | equals | | `sourceId` | `string` | equals, contains, startsWith, endsWith, in | | `templateId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Flows Path: `celigo.db.flows.search` ```ts theme={null} const rows = await corsair.celigo.db.flows.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `integrationId` | `string` | equals, contains, startsWith, endsWith, in | | `schedule` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `disabled` | `boolean` | equals | | `exportId` | `string` | equals, contains, startsWith, endsWith, in | | `importId` | `string` | equals, contains, startsWith, endsWith, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | | `wizardState` | `string` | equals, contains, startsWith, endsWith, in | | `runPageGeneratorsInParallel` | `boolean` | equals | | `autoResolveMatchingTraceKeys` | `boolean` | equals | | `isAbstract` | `boolean` | equals | | `abstractFlowId` | `string` | equals, contains, startsWith, endsWith, in | | `flowGroupingId` | `string` | equals, contains, startsWith, endsWith, in | | `keepDeltaBehindFlowId` | `string` | equals, contains, startsWith, endsWith, in | | `keepDeltaBehindExportId` | `string` | equals, contains, startsWith, endsWith, in | | `draft` | `boolean` | equals | | `draftExpiresAt` | `date` | equals, before, after, between | | `hidden` | `boolean` | equals | | `numInstances` | `number` | equals, gt, gte, lt, lte, in | | `connectorId` | `string` | equals, contains, startsWith, endsWith, in | | `templateId` | `string` | equals, contains, startsWith, endsWith, in | | `sourceId` | `string` | equals, contains, startsWith, endsWith, in | | `free` | `boolean` | equals | | `lastExecutedAt` | `date` | equals, before, after, between | | `resolvedAt` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Iclients Path: `celigo.db.iclients.search` ```ts theme={null} const rows = await corsair.celigo.db.iclients.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `provider` | `string` | equals, contains, startsWith, endsWith, in | | `published` | `boolean` | equals | | `enableJWT` | `boolean` | equals | | `enableIClientReferences` | `boolean` | equals | | `formType` | `string` | equals, contains, startsWith, endsWith, in | | `httpConnectorId` | `string` | equals, contains, startsWith, endsWith, in | | `httpConnectorApiId` | `string` | equals, contains, startsWith, endsWith, in | | `integrationId` | `string` | equals, contains, startsWith, endsWith, in | | `connectorId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Imports Path: `celigo.db.imports.search` ```ts theme={null} const rows = await corsair.celigo.db.imports.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `connectionId` | `string` | equals, contains, startsWith, endsWith, in | | `integrationId` | `string` | equals, contains, startsWith, endsWith, in | | `connectorId` | `string` | equals, contains, startsWith, endsWith, in | | `adaptorType` | `string` | equals, contains, startsWith, endsWith, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | | `distributed` | `boolean` | equals | | `maxAttempts` | `number` | equals, gt, gte, lt, lte, in | | `ignoreExisting` | `boolean` | equals | | `ignoreMissing` | `boolean` | equals | | `idLockTemplate` | `string` | equals, contains, startsWith, endsWith, in | | `dataURITemplate` | `string` | equals, contains, startsWith, endsWith, in | | `traceKeyTemplate` | `string` | equals, contains, startsWith, endsWith, in | | `oneToMany` | `boolean` | equals | | `pathToMany` | `string` | equals, contains, startsWith, endsWith, in | | `blobKeyPath` | `string` | equals, contains, startsWith, endsWith, in | | `blob` | `boolean` | equals | | `assistant` | `string` | equals, contains, startsWith, endsWith, in | | `deleteAfterImport` | `boolean` | equals | | `ediProfileId` | `string` | equals, contains, startsWith, endsWith, in | | `inputContext` | `string` | equals, contains, startsWith, endsWith, in | | `apiIdentifier` | `string` | equals, contains, startsWith, endsWith, in | | `draft` | `boolean` | equals | | `draftExpiresAt` | `date` | equals, before, after, between | | `debugUntil` | `date` | equals, before, after, between | | `sourceId` | `string` | equals, contains, startsWith, endsWith, in | | `templateId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Integrations Path: `celigo.db.integrations.search` ```ts theme={null} const rows = await corsair.celigo.db.integrations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `readme` | `string` | equals, contains, startsWith, endsWith, in | | `connectorId` | `string` | equals, contains, startsWith, endsWith, in | | `templateId` | `string` | equals, contains, startsWith, endsWith, in | | `parentId` | `string` | equals, contains, startsWith, endsWith, in | | `sourceId` | `string` | equals, contains, startsWith, endsWith, in | | `mode` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `updateInProgress` | `boolean` | equals | | `celigoAgentAutoRunMode` | `boolean` | equals | | `sampleIntegration` | `boolean` | equals | | `syncs` | `boolean` | equals | | `childDisplayName` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedAt` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `celigo.db.jobs.search` ```ts theme={null} const rows = await corsair.celigo.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `integrationId` | `string` | equals, contains, startsWith, endsWith, in | | `flowId` | `string` | equals, contains, startsWith, endsWith, in | | `exportId` | `string` | equals, contains, startsWith, endsWith, in | | `importId` | `string` | equals, contains, startsWith, endsWith, in | | `expOrImpId` | `string` | equals, contains, startsWith, endsWith, in | | `retryOfJobId` | `string` | equals, contains, startsWith, endsWith, in | | `flowJobId` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `parentJobId` | `string` | equals, contains, startsWith, endsWith, in | | `bulkJobId` | `string` | equals, contains, startsWith, endsWith, in | | `triggeredBy` | `string` | equals, contains, startsWith, endsWith, in | | `canceledBy` | `string` | equals, contains, startsWith, endsWith, in | | `flowExecutionGroupId` | `string` | equals, contains, startsWith, endsWith, in | | `numError` | `number` | equals, gt, gte, lt, lte, in | | `numOpenError` | `number` | equals, gt, gte, lt, lte, in | | `numResolved` | `number` | equals, gt, gte, lt, lte, in | | `numResolvedByAdaptor` | `number` | equals, gt, gte, lt, lte, in | | `numSuccess` | `number` | equals, gt, gte, lt, lte, in | | `numIgnore` | `number` | equals, gt, gte, lt, lte, in | | `numExport` | `number` | equals, gt, gte, lt, lte, in | | `numPagesGenerated` | `number` | equals, gt, gte, lt, lte, in | | `numPagesProcessed` | `number` | equals, gt, gte, lt, lte, in | | `doneExporting` | `boolean` | equals | | `retriable` | `boolean` | equals | | `logMode` | `string` | equals, contains, startsWith, endsWith, in | | `startedAt` | `date` | equals, before, after, between | | `endedAt` | `date` | equals, before, after, between | | `resolvedAt` | `date` | equals, before, after, between | | `lastExecutedAt` | `date` | equals, before, after, between | | `purgeAt` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scripts Path: `celigo.db.scripts.search` ```ts theme={null} const rows = await corsair.celigo.db.scripts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `postResponseHookToProcessOnChildRecord` | `boolean` | equals | | `debugUntil` | `date` | equals, before, after, between | | `sourceId` | `string` | equals, contains, startsWith, endsWith, in | | `templateId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `celigo.db.tags.search` ```ts theme={null} const rows = await corsair.celigo.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `tagId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `celigo.db.users.search` ```ts theme={null} const rows = await corsair.celigo.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `sharedWithUserId` | `string` | equals, contains, startsWith, endsWith, in | | `accessLevel` | `string` | equals, contains, startsWith, endsWith, in | | `userType` | `string` | equals, contains, startsWith, endsWith, in | | `accepted` | `boolean` | equals | | `disabled` | `boolean` | equals | | `dismissed` | `boolean` | equals | | `accountSSORequired` | `boolean` | equals | | `accountMFARequired` | `boolean` | equals | | `allowAccessToAPIM` | `boolean` | equals | | `allowToEditRetryData` | `boolean` | equals | | `allowIntegrationWorkspaceCreation` | `boolean` | equals | | `isProductionAdmin` | `boolean` | equals | | `ssoSetupPending` | `boolean` | equals | | `createdVia` | `string` | equals, contains, startsWith, endsWith, in | | `provisionedBy` | `string` | equals, contains, startsWith, endsWith, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | | `scimSsoClientId` | `string` | equals, contains, startsWith, endsWith, in | | `lastSignIn` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `lastModified` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/celigo/overview Integration platform for building, running and monitoring flows, connections, exports and imports. Use **Celigo** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 118 typed API operations * 10 synced entities (`connections`, `exports`, `flows`, `iclients`, `imports`, `integrations`, and 4 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/celigo ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/celigo ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/celigo ``` ```bash bun theme={null} bun add corsair @corsair-dev/celigo ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { celigo } from '@corsair-dev/celigo'; export const corsair = createCorsair({ plugins: [ celigo(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} celigo() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'celigo', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List flows** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.celigo.api.flows.list({}); ``` **Create a tag** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.celigo.api.tags.create({ tag: 'production' }); ``` See the full list on the [API](/plugins/celigo/api) page. ## Query synced data Search flows read through the API without hitting Celigo again. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.celigo.db.flows.search({ data: {}, limit: 50, }); ``` Synced entities: `connections`, `exports`, `flows`, `iclients`, `imports`, `integrations`, `jobs`, `scripts`, `tags`, `users`. See [Database](/plugins/celigo/database) for filters and operators. ## What's next > **[API reference](/plugins/celigo/api)** > > Every `celigo.api.*` operation with input and output types. > **[Database](/plugins/celigo/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/certifier/api API reference for Certifier: every `certifier.api.*` operation with input and output types. Every `certifier.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Attributes ### list `attributes.list` List attribute definitions available for credentials, with pagination. **Risk:** `read` ```ts theme={null} await corsair.certifier.api.attributes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > tag?: string, > name?: string, > type?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > prev?: string | null, > next?: string | null > } > ``` *** ## Credential Interactions ### list `credentialInteractions.list` List credential interaction events, optionally filtered by credential. **Risk:** `read` ```ts theme={null} await corsair.certifier.api.credentialInteractions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `credentialId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > credentialId?: string, > eventType?: string, > triggeredBy?: string, > triggeredAt?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > prev?: string | null, > next?: string | null > } > ``` *** ## Credentials ### createIssueSend `credentials.createIssueSend` Create, issue, and send a credential in a single request. **Risk:** `write` ```ts theme={null} await corsair.certifier.api.credentials.createIssueSend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `recipient` | `object` | Yes | — | | `issueDate` | `string` | No | — | | `expiryDate` | `string` | No | — | | `customAttributes` | `object` | No | — | > **recipient full type** > > ```ts theme={null} > { > name: string, > email: string > } > ``` > **customAttributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `publicId` | `string` | No | — | | `groupId` | `string` | No | — | | `status` | `string` | No | — | | `recipient` | `object` | No | — | | `issueDate` | `string` | No | — | | `expiryDate` | `string` | No | — | | `attributes` | `object` | No | — | | `customAttributes` | `object` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **recipient full type** > > ```ts theme={null} > { > id?: string, > name?: string, > email?: string > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` > **customAttributes full type** > > ```ts theme={null} > { > } > ``` *** ### list `credentials.list` List credentials with cursor pagination. **Risk:** `read` ```ts theme={null} await corsair.certifier.api.credentials.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > publicId?: string, > groupId?: string, > status?: string, > recipient?: { > id?: string, > name?: string, > email?: string > }, > issueDate?: string | null, > expiryDate?: string | null, > attributes?: { > }, > customAttributes?: { > }, > createdAt?: string, > updatedAt?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > prev?: string | null, > next?: string | null > } > ``` *** ### search `credentials.search` Search credentials with AND/OR/NOT filters, sort, and pagination. **Risk:** `read` ```ts theme={null} await corsair.certifier.api.credentials.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter` | `object` | Yes | — | | `sort` | `object` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` > **sort full type** > > ```ts theme={null} > { > property: id | createdAt | updatedAt | issueDate | expiryDate, > order: asc | desc > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > publicId?: string, > groupId?: string, > status?: string, > recipient?: { > id?: string, > name?: string, > email?: string > }, > issueDate?: string | null, > expiryDate?: string | null, > attributes?: { > }, > customAttributes?: { > }, > createdAt?: string, > updatedAt?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > prev?: string | null, > next?: string | null > } > ``` *** ### send `credentials.send` Send an issued credential by email. **Risk:** `write` ```ts theme={null} await corsair.certifier.api.credentials.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `deliveryMethod` | `email` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `publicId` | `string` | No | — | | `groupId` | `string` | No | — | | `status` | `string` | No | — | | `recipient` | `object` | No | — | | `issueDate` | `string` | No | — | | `expiryDate` | `string` | No | — | | `attributes` | `object` | No | — | | `customAttributes` | `object` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **recipient full type** > > ```ts theme={null} > { > id?: string, > name?: string, > email?: string > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` > **customAttributes full type** > > ```ts theme={null} > { > } > ``` *** ## Designs ### list `designs.list` List certificate and badge design templates. **Risk:** `read` ```ts theme={null} await corsair.certifier.api.designs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > type?: string, > previewUrl?: string | null, > createdAt?: string, > updatedAt?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > prev?: string | null, > next?: string | null > } > ``` *** ## Email Templates ### list `emailTemplates.list` List email templates used for credential delivery. **Risk:** `read` ```ts theme={null} await corsair.certifier.api.emailTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > subject?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > prev?: string | null, > next?: string | null > } > ``` *** ## Groups ### list `groups.list` List credential templates (groups) with pagination. **Risk:** `read` ```ts theme={null} await corsair.certifier.api.groups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > designIds?: string[], > certificateDesignId?: string | null, > badgeDesignId?: string | null, > emailTemplateId?: string | null, > createdAt?: string, > updatedAt?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > prev?: string | null, > next?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/certifier/database Certifier local sync: searchable entities, `.search()` filters, and operators. The Certifier plugin syncs data locally. Use `corsair.certifier.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Attributes Path: `certifier.db.attributes.search` ```ts theme={null} const rows = await corsair.certifier.db.attributes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Credential Interactions Path: `certifier.db.credentialInteractions.search` ```ts theme={null} const rows = await corsair.certifier.db.credentialInteractions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `credentialId` | `string` | equals, contains, startsWith, endsWith, in | | `eventType` | `string` | equals, contains, startsWith, endsWith, in | | `triggeredBy` | `string` | equals, contains, startsWith, endsWith, in | | `triggeredAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Credentials Path: `certifier.db.credentials.search` ```ts theme={null} const rows = await corsair.certifier.db.credentials.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `publicId` | `string` | equals, contains, startsWith, endsWith, in | | `groupId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `issueDate` | `string` | equals, contains, startsWith, endsWith, in | | `expiryDate` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Designs Path: `certifier.db.designs.search` ```ts theme={null} const rows = await corsair.certifier.db.designs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `previewUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Email Templates Path: `certifier.db.emailTemplates.search` ```ts theme={null} const rows = await corsair.certifier.db.emailTemplates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Groups Path: `certifier.db.groups.search` ```ts theme={null} const rows = await corsair.certifier.db.groups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `certificateDesignId` | `string` | equals, contains, startsWith, endsWith, in | | `badgeDesignId` | `string` | equals, contains, startsWith, endsWith, in | | `emailTemplateId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/certifier/overview Digital credential platform for issuing certificates, badges, and verifiable achievements. Use **Certifier** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 9 typed API operations * 6 synced entities (`attributes`, `credentialInteractions`, `credentials`, `designs`, `emailTemplates`, `groups`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/certifier ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/certifier ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/certifier ``` ```bash bun theme={null} bun add corsair @corsair-dev/certifier ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { certifier } from '@corsair-dev/certifier'; export const corsair = createCorsair({ plugins: [ certifier(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} certifier() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'certifier', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`attributes.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.certifier.api.attributes.list({}); ``` **`credentials.createIssueSend`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.certifier.api.credentials.createIssueSend({}); ``` See the full list on the [API](/plugins/certifier/api) page. ## Query synced data Synced entities support `tenant.certifier.db..search()` and `.list()`: `attributes`, `credentialInteractions`, `credentials`, `designs`, `emailTemplates`, `groups`. See [Database](/plugins/certifier/database) for filters and operators. ## What's next > **[API reference](/plugins/certifier/api)** > > Every `certifier.api.*` operation with input and output types. > **[Database](/plugins/certifier/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/chaser/api API reference for Chaser: every `chaser.api.*` operation with input and output types. Every `chaser.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Credit Notes ### list `creditNotes.list` List all credit notes **Risk:** `read` ```ts theme={null} await corsair.chaser.api.creditNotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > customer_id: string, > amount: number, > currency: string, > status: string > }[] > ``` *** ## Customers ### list `customers.list` List all customers **Risk:** `read` ```ts theme={null} await corsair.chaser.api.customers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > email?: string, > status?: string > }[] > ``` *** ## Invoices ### get `invoices.get` Get an invoice by ID **Risk:** `read` ```ts theme={null} await corsair.chaser.api.invoices.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `customer_id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `due_date` | `string` | No | — | *** ### list `invoices.list` List all invoices **Risk:** `read` ```ts theme={null} await corsair.chaser.api.invoices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `customer_external_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > customer_id: string, > amount: number, > currency: string, > status: string, > due_date?: string > }[] > ``` *** ## Organization ### get `organization.get` Get organization details **Risk:** `read` ```ts theme={null} await corsair.chaser.api.organization.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `email` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/chaser/database Chaser local sync: searchable entities, `.search()` filters, and operators. The Chaser plugin syncs data locally. Use `corsair.chaser.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/chaser/overview Chaser plugin for Corsair Use **Chaser** through Corsair: one client, typed API calls. **What you get:** * 5 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/chaser ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/chaser ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/chaser ``` ```bash bun theme={null} bun add corsair @corsair-dev/chaser ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { chaser } from '@corsair-dev/chaser'; export const corsair = createCorsair({ plugins: [ chaser(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} chaser() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'chaser', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`creditNotes.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.chaser.api.creditNotes.list({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/chaser/api) reference.* See the full list on the [API](/plugins/chaser/api) page. ## What's next > **[API reference](/plugins/chaser/api)** > > Every `chaser.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/chatbotkit/api API reference for ChatBotKit: every `chatbotkit.api.*` operation with input and output types. Every `chatbotkit.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Blueprints ### create `blueprints.create` Create a new blueprint configuration template **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.blueprints.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the blueprint template | | `description` | `string` | No | Description of the blueprint template | | `config` | `object` | No | Configuration dictionary | | `visibility` | `private \| protected \| public` | No | Visibility level | | `meta` | `object` | No | Custom metadata | > **config full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### delete `blueprints.delete` Permanently delete a blueprint template **Risk:** `destructive` ```ts theme={null} await corsair.chatbotkit.api.blueprints.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the blueprint to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### get `blueprints.get` Fetch a blueprint template by ID **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.blueprints.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the blueprint to fetch | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the blueprint | | `alias` | `string` | No | Custom alias for the blueprint | | `name` | `string` | Yes | Descriptive name of the blueprint | | `description` | `string` | No | Brief description of blueprint configuration | | `config` | `object` | No | Template configuration settings | | `visibility` | `string` | No | Visibility setting | | `meta` | `object` | No | Custom metadata | | `createdAt` | `number` | No | Creation timestamp in milliseconds | | `updatedAt` | `number` | No | Last updated timestamp in milliseconds | > **config full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### list `blueprints.list` List blueprint templates, cursor-paginated **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.blueprints.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Cursor for pagination | | `limit` | `number` | No | Maximum number of items to return | | `order` | `asc \| desc` | No | Sort order by creation time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | List of blueprints matching the query | | `cursor` | `string` | No | Pagination cursor for the next page of results | > **items full type** > > ```ts theme={null} > { > id: string, > alias?: string | null, > name: string, > description?: string | null, > config?: { > } | null, > visibility?: string | null, > meta?: { > } | null, > createdAt?: number | null, > updatedAt?: number | null > }[] > ``` *** ### update `blueprints.update` Update an existing blueprint template **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.blueprints.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the blueprint to update | | `name` | `string` | No | Updated name | | `description` | `string` | No | Updated description | | `config` | `object` | No | Updated configuration | | `visibility` | `private \| protected \| public` | No | Updated visibility | | `meta` | `object` | No | Updated metadata | > **config full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ## Bots ### create `bots.create` Create a new AI bot **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.bots.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the bot | | `description` | `string` | No | Description of the bot | | `backstory` | `string` | No | Instructions and persona for the bot | | `model` | `string` | No | AI model to use for the bot | | `datasetId` | `string` | No | ID of the dataset to connect to the bot | | `skillsetId` | `string` | No | ID of the skillset to connect to the bot | | `blueprintId` | `string` | No | ID of the blueprint template to connect | | `privacy` | `boolean` | No | Enable PII protection and anonymization | | `moderation` | `boolean` | No | Enable content safety and filtering | | `visibility` | `private \| protected \| public` | No | Visibility level of the bot | | `meta` | `object` | No | Custom metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### delete `bots.delete` Permanently delete a bot **Risk:** `destructive` ```ts theme={null} await corsair.chatbotkit.api.bots.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the bot to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### downvote `bots.downvote` Register a downvote for a bot **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.bots.downvote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the bot to downvote | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### get `bots.get` Fetch a single bot by ID or alias **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.bots.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier or alias of the bot to fetch | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the bot | | `alias` | `string` | No | Custom alias for the bot | | `name` | `string` | Yes | Descriptive name of the bot | | `description` | `string` | No | Brief description of the bot purpose | | `blueprintId` | `string` | No | Associated blueprint ID | | `datasetId` | `string` | No | Associated dataset ID for knowledge retrieval | | `skillsetId` | `string` | No | Associated skillset ID for tools and capabilities | | `backstory` | `string` | No | Natural language instructions defining bot personality and behavior | | `model` | `string` | No | AI model configured for the bot | | `privacy` | `boolean` | No | Whether PII protection and anonymization is enabled | | `moderation` | `boolean` | No | Whether content safety and filtering is active | | `visibility` | `string` | No | Visibility access setting (e.g. private, protected, public) | | `meta` | `object` | No | Custom metadata attached to the bot | | `createdAt` | `number` | No | Creation timestamp in milliseconds | | `updatedAt` | `number` | No | Last updated timestamp in milliseconds | > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### list `bots.list` List bots on the ChatBotKit account, cursor-paginated **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.bots.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Cursor for pagination | | `limit` | `number` | No | Maximum number of items to return | | `order` | `asc \| desc` | No | Sort order by creation time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | List of bots matching the query | | `cursor` | `string` | No | Pagination cursor for the next page of results | > **items full type** > > ```ts theme={null} > { > id: string, > alias?: string | null, > name: string, > description?: string | null, > blueprintId?: string | null, > datasetId?: string | null, > skillsetId?: string | null, > backstory?: string | null, > model?: string | null, > privacy?: boolean | null, > moderation?: boolean | null, > visibility?: string | null, > meta?: { > } | null, > createdAt?: number | null, > updatedAt?: number | null > }[] > ``` *** ### update `bots.update` Update an existing bot configuration **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.bots.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the bot to update | | `name` | `string` | No | Updated name of the bot | | `description` | `string` | No | Updated description of the bot | | `backstory` | `string` | No | Updated persona instructions | | `model` | `string` | No | Updated model | | `datasetId` | `string` | No | Updated dataset ID | | `skillsetId` | `string` | No | Updated skillset ID | | `blueprintId` | `string` | No | Updated blueprint ID | | `visibility` | `private \| protected \| public` | No | Updated visibility | | `meta` | `object` | No | Updated metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### upvote `bots.upvote` Register an upvote for a bot **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.bots.upvote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the bot to upvote | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ## Conversations ### complete `conversations.complete` Send message to conversation and get AI response **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.conversations.complete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the conversation | | `text` | `string` | Yes | User message text sent to the chatbot | **Output** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | AI response message text | | `message` | `string` | No | Completion status or error message if limits reached | | `code` | `string` | No | Error code if completion failed | | `usage` | `object` | No | Token usage breakdown | > **usage full type** > > ```ts theme={null} > { > tokens?: number > } > ``` *** ### create `conversations.create` Create a new conversation chat session **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.conversations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | Name of the conversation | | `description` | `string` | No | Description of the conversation | | `botId` | `string` | No | ID of bot to associate | | `datasetId` | `string` | No | Dataset ID override | | `skillsetId` | `string` | No | Skillset ID override | | `blueprintId` | `string` | No | Blueprint template ID | | `visibility` | `private \| protected \| public` | No | Visibility level | | `meta` | `object` | No | Custom metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### delete `conversations.delete` Permanently delete a conversation session **Risk:** `destructive` ```ts theme={null} await corsair.chatbotkit.api.conversations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the conversation to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### get `conversations.get` Fetch a conversation by ID **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.conversations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the conversation to fetch | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the conversation | | `alias` | `string` | No | Custom alias for the conversation | | `name` | `string` | No | Name of the conversation | | `description` | `string` | No | Description of the conversation | | `botId` | `string` | No | Associated bot ID | | `backstory` | `string` | No | Instructions override for the conversation | | `model` | `string` | No | Model override | | `datasetId` | `string` | No | Dataset ID override | | `skillsetId` | `string` | No | Skillset ID override | | `blueprintId` | `string` | No | Associated blueprint ID | | `visibility` | `string` | No | Visibility setting | | `meta` | `object` | No | Custom metadata | | `createdAt` | `number` | No | Creation timestamp in milliseconds | | `updatedAt` | `number` | No | Last updated timestamp in milliseconds | > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### list `conversations.list` List conversations, cursor-paginated **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.conversations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Cursor for pagination | | `limit` | `number` | No | Maximum number of items to return | | `order` | `asc \| desc` | No | Sort order by creation time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | List of conversations matching the query | | `cursor` | `string` | No | Pagination cursor for the next page of results | > **items full type** > > ```ts theme={null} > { > id: string, > alias?: string | null, > name?: string | null, > description?: string | null, > botId?: string | null, > backstory?: string | null, > model?: string | null, > datasetId?: string | null, > skillsetId?: string | null, > blueprintId?: string | null, > visibility?: string | null, > meta?: { > } | null, > createdAt?: number | null, > updatedAt?: number | null > }[] > ``` *** ### update `conversations.update` Update conversation metadata or bot association **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.conversations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the conversation to update | | `name` | `string` | No | Updated name | | `description` | `string` | No | Updated description | | `botId` | `string` | No | Updated bot ID | | `visibility` | `private \| protected \| public` | No | Updated visibility | | `meta` | `object` | No | Updated metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ## Datasets ### create `datasets.create` Create a new knowledge dataset **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.datasets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the dataset | | `description` | `string` | No | Description of the dataset | | `blueprintId` | `string` | No | ID of blueprint template to connect | | `visibility` | `private \| protected \| public` | No | Visibility level | | `meta` | `object` | No | Custom metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### delete `datasets.delete` Permanently delete a dataset **Risk:** `destructive` ```ts theme={null} await corsair.chatbotkit.api.datasets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the dataset to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### get `datasets.get` Fetch a dataset by ID **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.datasets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the dataset to fetch | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the dataset | | `alias` | `string` | No | Custom alias for the dataset | | `name` | `string` | Yes | Descriptive name of the dataset | | `description` | `string` | No | Brief description of dataset contents | | `blueprintId` | `string` | No | Associated blueprint ID | | `reranker` | `string` | No | Configured reranker model | | `recordMaxTokens` | `number` | No | Maximum tokens per record | | `searchMinScore` | `number` | No | Minimum score for search retrieval | | `searchMaxRecords` | `number` | No | Maximum search records returned | | `searchMaxTokens` | `number` | No | Maximum search tokens returned | | `matchInstruction` | `string` | No | Prompt instruction on search match | | `mismatchInstruction` | `string` | No | Prompt instruction on search mismatch | | `separators` | `string[]` | No | Text chunk separators | | `visibility` | `string` | No | Visibility setting | | `meta` | `object` | No | Custom metadata | | `createdAt` | `number` | No | Creation timestamp in milliseconds | | `updatedAt` | `number` | No | Last updated timestamp in milliseconds | > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### list `datasets.list` List knowledge datasets, cursor-paginated **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.datasets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Cursor for pagination | | `limit` | `number` | No | Maximum number of items to return | | `order` | `asc \| desc` | No | Sort order by creation time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | List of datasets matching the query | | `cursor` | `string` | No | Pagination cursor for the next page of results | > **items full type** > > ```ts theme={null} > { > id: string, > alias?: string | null, > name: string, > description?: string | null, > blueprintId?: string | null, > reranker?: string | null, > recordMaxTokens?: number | null, > searchMinScore?: number | null, > searchMaxRecords?: number | null, > searchMaxTokens?: number | null, > matchInstruction?: string | null, > mismatchInstruction?: string | null, > separators?: string[] | null, > visibility?: string | null, > meta?: { > } | null, > createdAt?: number | null, > updatedAt?: number | null > }[] > ``` *** ### search `datasets.search` Search a dataset for relevant knowledge records **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.datasets.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the dataset to search | | `query` | `string` | Yes | Search query string | | `limit` | `number` | No | Max records to return | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | Array of search matches from the dataset | > **items full type** > > ```ts theme={null} > { > id: string, > score?: number, > text: string, > meta?: { > } | null > }[] > ``` *** ### update `datasets.update` Update dataset configuration **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.datasets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the dataset to update | | `name` | `string` | No | Updated name of the dataset | | `description` | `string` | No | Updated description of the dataset | | `blueprintId` | `string` | No | Updated blueprint ID | | `visibility` | `private \| protected \| public` | No | Updated visibility | | `meta` | `object` | No | Updated metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ## Files ### create `files.create` Create a new file record **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.files.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the file | | `description` | `string` | No | Description of the file | | `mimeType` | `string` | No | MIME type of the file | | `visibility` | `private \| protected \| public` | No | Visibility level | | `meta` | `object` | No | Custom metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### delete `files.delete` Permanently delete a file resource **Risk:** `destructive` ```ts theme={null} await corsair.chatbotkit.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the file to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### get `files.get` Fetch file metadata by ID **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the file to fetch | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the file resource | | `name` | `string` | Yes | File name | | `description` | `string` | No | File description | | `mimeType` | `string` | No | MIME type of the file | | `size` | `number` | No | File size in bytes | | `visibility` | `string` | No | Visibility setting | | `meta` | `object` | No | Custom metadata | | `createdAt` | `number` | No | Creation timestamp in milliseconds | | `updatedAt` | `number` | No | Last updated timestamp in milliseconds | > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### list `files.list` List uploaded file resources, cursor-paginated **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Cursor for pagination | | `limit` | `number` | No | Maximum number of items to return | | `order` | `asc \| desc` | No | Sort order by creation time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | List of files matching query | | `cursor` | `string` | No | Pagination cursor for the next page of results | > **items full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > mimeType?: string | null, > size?: number | null, > visibility?: string | null, > meta?: { > } | null, > createdAt?: number | null, > updatedAt?: number | null > }[] > ``` *** ## Secrets ### create `secrets.create` Create a new integration secret credential **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.secrets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the secret | | `description` | `string` | No | Description of the secret | | `blueprintId` | `string` | No | Blueprint template ID | | `type` | `string` | No | Secret type or provider template | | `config` | `object` | No | Secret configuration credentials | | `visibility` | `private \| protected \| public` | No | Visibility level | | `meta` | `object` | No | Custom metadata | > **config full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### delete `secrets.delete` Permanently delete a secret credential **Risk:** `destructive` ```ts theme={null} await corsair.chatbotkit.api.secrets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the secret to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### get `secrets.get` Fetch a secret credential by ID **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.secrets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the secret to fetch | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the secret credential | | `alias` | `string` | No | Custom alias for the secret | | `name` | `string` | Yes | Descriptive name of the secret | | `description` | `string` | No | Description of the secret or connected service | | `blueprintId` | `string` | No | Associated blueprint ID | | `kind` | `string` | No | Kind of secret (e.g. personal, shared) | | `type` | `string` | No | Type of credential template | | `config` | `object` | No | Credential configuration | | `visibility` | `string` | No | Visibility setting | | `meta` | `object` | No | Custom metadata | | `createdAt` | `number` | No | Creation timestamp in milliseconds | | `updatedAt` | `number` | No | Last updated timestamp in milliseconds | > **config full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### list `secrets.list` List integration secrets, cursor-paginated **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.secrets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Cursor for pagination | | `limit` | `number` | No | Maximum number of items to return | | `order` | `asc \| desc` | No | Sort order by creation time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | List of secrets matching the query | | `cursor` | `string` | No | Pagination cursor for the next page of results | > **items full type** > > ```ts theme={null} > { > id: string, > alias?: string | null, > name: string, > description?: string | null, > blueprintId?: string | null, > kind?: string | null, > type?: string | null, > config?: { > } | null, > visibility?: string | null, > meta?: { > } | null, > createdAt?: number | null, > updatedAt?: number | null > }[] > ``` *** ### update `secrets.update` Update an existing integration secret credential **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.secrets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the secret to update | | `name` | `string` | No | Updated name | | `description` | `string` | No | Updated description | | `config` | `object` | No | Updated configuration credentials | | `visibility` | `private \| protected \| public` | No | Updated visibility | | `meta` | `object` | No | Updated metadata | > **config full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ## Skillsets ### create `skillsets.create` Create a new skillset container **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.skillsets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the skillset | | `description` | `string` | No | Description of the skillset | | `blueprintId` | `string` | No | Blueprint template ID | | `visibility` | `private \| protected \| public` | No | Visibility level | | `meta` | `object` | No | Custom metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### delete `skillsets.delete` Permanently delete a skillset **Risk:** `destructive` ```ts theme={null} await corsair.chatbotkit.api.skillsets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the skillset to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### get `skillsets.get` Fetch a skillset by ID **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.skillsets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the skillset to fetch | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the skillset | | `alias` | `string` | No | Custom alias for the skillset | | `name` | `string` | Yes | Descriptive name of the skillset | | `description` | `string` | No | Brief description of skillset capabilities | | `blueprintId` | `string` | No | Associated blueprint ID | | `visibility` | `string` | No | Visibility setting | | `state` | `string` | No | Operational state (e.g. enabled, disabled) | | `meta` | `object` | No | Custom metadata | | `createdAt` | `number` | No | Creation timestamp in milliseconds | | `updatedAt` | `number` | No | Last updated timestamp in milliseconds | > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### list `skillsets.list` List skillsets on the account, cursor-paginated **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.skillsets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Cursor for pagination | | `limit` | `number` | No | Maximum number of items to return | | `order` | `asc \| desc` | No | Sort order by creation time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | List of skillsets matching the query | | `cursor` | `string` | No | Pagination cursor for the next page of results | > **items full type** > > ```ts theme={null} > { > id: string, > alias?: string | null, > name: string, > description?: string | null, > blueprintId?: string | null, > visibility?: string | null, > state?: string | null, > meta?: { > } | null, > createdAt?: number | null, > updatedAt?: number | null > }[] > ``` *** ### update `skillsets.update` Update skillset configuration or state **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.skillsets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the skillset to update | | `name` | `string` | No | Updated name of the skillset | | `description` | `string` | No | Updated description of the skillset | | `visibility` | `private \| protected \| public` | No | Updated visibility | | `state` | `enabled \| disabled` | No | Updated state | | `meta` | `object` | No | Updated metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ## Tasks ### create `tasks.create` Create a new background execution task **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the background task | | `description` | `string` | No | Description of the task | | `botId` | `string` | No | ID of bot executing the task | | `schedule` | `string` | No | Cron schedule expression for recurring runs | | `visibility` | `private \| protected \| public` | No | Visibility level | | `meta` | `object` | No | Custom metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### delete `tasks.delete` Permanently delete a background task **Risk:** `destructive` ```ts theme={null} await corsair.chatbotkit.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the task to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** ### get `tasks.get` Fetch a task by ID **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the task to fetch | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the task | | `name` | `string` | Yes | Descriptive name of the task | | `description` | `string` | No | Brief description of the task | | `botId` | `string` | No | Associated bot ID | | `schedule` | `string` | No | Cron schedule string | | `status` | `string` | No | Task execution status | | `visibility` | `string` | No | Visibility setting | | `meta` | `object` | No | Custom metadata | | `createdAt` | `number` | No | Creation timestamp in milliseconds | | `updatedAt` | `number` | No | Last updated timestamp in milliseconds | > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### list `tasks.list` List background tasks, cursor-paginated **Risk:** `read` ```ts theme={null} await corsair.chatbotkit.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Cursor for pagination | | `limit` | `number` | No | Maximum number of items to return | | `order` | `asc \| desc` | No | Sort order by creation time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | List of tasks matching query | | `cursor` | `string` | No | Pagination cursor for next page of results | > **items full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > botId?: string | null, > schedule?: string | null, > status?: string | null, > visibility?: string | null, > meta?: { > } | null, > createdAt?: number | null, > updatedAt?: number | null > }[] > ``` *** ### update `tasks.update` Update task schedule or bot assignment **Risk:** `write` ```ts theme={null} await corsair.chatbotkit.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | ID of the task to update | | `name` | `string` | No | Updated name | | `description` | `string` | No | Updated description | | `botId` | `string` | No | Updated bot ID | | `schedule` | `string` | No | Updated cron schedule | | `visibility` | `private \| protected \| public` | No | Updated visibility | | `meta` | `object` | No | Updated metadata | > **meta full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the resource | *** # Database Source: https://docs.corsair.dev/plugins/chatbotkit/database ChatBotKit local sync: searchable entities, `.search()` filters, and operators. The ChatBotKit plugin syncs data locally. Use `corsair.chatbotkit.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Blueprints Path: `chatbotkit.db.blueprints.search` ```ts theme={null} const rows = await corsair.chatbotkit.db.blueprints.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Bots Path: `chatbotkit.db.bots.search` ```ts theme={null} const rows = await corsair.chatbotkit.db.bots.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `blueprintId` | `string` | equals, contains, startsWith, endsWith, in | | `datasetId` | `string` | equals, contains, startsWith, endsWith, in | | `skillsetId` | `string` | equals, contains, startsWith, endsWith, in | | `backstory` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `privacy` | `boolean` | equals | | `moderation` | `boolean` | equals | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Conversations Path: `chatbotkit.db.conversations.search` ```ts theme={null} const rows = await corsair.chatbotkit.db.conversations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `botId` | `string` | equals, contains, startsWith, endsWith, in | | `backstory` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `datasetId` | `string` | equals, contains, startsWith, endsWith, in | | `skillsetId` | `string` | equals, contains, startsWith, endsWith, in | | `blueprintId` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Datasets Path: `chatbotkit.db.datasets.search` ```ts theme={null} const rows = await corsair.chatbotkit.db.datasets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `blueprintId` | `string` | equals, contains, startsWith, endsWith, in | | `reranker` | `string` | equals, contains, startsWith, endsWith, in | | `recordMaxTokens` | `number` | equals, gt, gte, lt, lte, in | | `searchMinScore` | `number` | equals, gt, gte, lt, lte, in | | `searchMaxRecords` | `number` | equals, gt, gte, lt, lte, in | | `searchMaxTokens` | `number` | equals, gt, gte, lt, lte, in | | `matchInstruction` | `string` | equals, contains, startsWith, endsWith, in | | `mismatchInstruction` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `chatbotkit.db.files.search` ```ts theme={null} const rows = await corsair.chatbotkit.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `mimeType` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Secrets Path: `chatbotkit.db.secrets.search` ```ts theme={null} const rows = await corsair.chatbotkit.db.secrets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `blueprintId` | `string` | equals, contains, startsWith, endsWith, in | | `kind` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Skillsets Path: `chatbotkit.db.skillsets.search` ```ts theme={null} const rows = await corsair.chatbotkit.db.skillsets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `blueprintId` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `chatbotkit.db.tasks.search` ```ts theme={null} const rows = await corsair.chatbotkit.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `botId` | `string` | equals, contains, startsWith, endsWith, in | | `schedule` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/chatbotkit/overview AI chatbot platform for building conversational agents with custom knowledge bases. Use **ChatBotKit** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 43 typed API operations * 8 synced entities (`blueprints`, `bots`, `conversations`, `datasets`, `files`, `secrets`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/chatbotkit ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/chatbotkit ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/chatbotkit ``` ```bash bun theme={null} bun add corsair @corsair-dev/chatbotkit ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { chatbotkit } from '@corsair-dev/chatbotkit'; export const corsair = createCorsair({ plugins: [ chatbotkit(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} chatbotkit() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'chatbotkit', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`blueprints.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.chatbotkit.api.blueprints.get({}); ``` **`blueprints.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.chatbotkit.api.blueprints.create({}); ``` See the full list on the [API](/plugins/chatbotkit/api) page. ## Query synced data Synced entities support `tenant.chatbotkit.db..search()` and `.list()`: `blueprints`, `bots`, `conversations`, `datasets`, `files`, `secrets`, `skillsets`, `tasks`. See [Database](/plugins/chatbotkit/database) for filters and operators. ## What's next > **[API reference](/plugins/chatbotkit/api)** > > Every `chatbotkit.api.*` operation with input and output types. > **[Database](/plugins/chatbotkit/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/chatfai/api API reference for ChatFAI: every `chatfai.api.*` operation with input and output types. Every `chatfai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Characters ### get `characters.get` Get a public ChatFAI character by ID (GET /v1/characters/) **Risk:** `read` ```ts theme={null} await corsair.chatfai.api.characters.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Public character ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `uid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `nickname` | `string` | No | — | | `publicDescription` | `string` | No | — | | `image` | `string` | No | — | | `visibility` | `string` | No | — | | `categories` | `string[]` | No | — | | `featured` | `boolean` | No | — | | `firstMessage` | `string` | No | — | | `voiceEnabled` | `boolean` | No | — | | `likes` | `number` | No | — | | `installs` | `number` | No | — | | `followers` | `number` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### search `characters.search` Search public ChatFAI characters by name or keyword (GET /v1/characters/search) **Risk:** `read` ```ts theme={null} await corsair.chatfai.api.characters.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Search query for public characters by name or keyword | **Output** | Name | Type | Required | Description | | - | - | - | - | | `characters` | `object[]` | Yes | — | > **characters full type** > > ```ts theme={null} > { > id: string, > uid: string, > name: string, > nickname?: string | null, > publicDescription?: string | null, > image?: string | null, > visibility?: string, > categories?: string[], > featured?: boolean, > firstMessage?: string | null, > voiceEnabled?: boolean, > likes?: number, > installs?: number, > followers?: number, > createdAt?: string, > updatedAt?: string > }[] > ``` *** ## Conversations ### list `conversations.list` List conversations for the authenticated user (GET /v1/conversations) **Risk:** `read` ```ts theme={null} await corsair.chatfai.api.conversations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `conversations` | `object[]` | Yes | — | | `nextCursor` | `string` | No | — | > **conversations full type** > > ```ts theme={null} > { > id: string, > character_id?: string, > characterId?: string, > title?: string, > createdAt?: string, > updatedAt?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/chatfai/database ChatFAI local sync: searchable entities, `.search()` filters, and operators. The ChatFAI plugin syncs data locally. Use `corsair.chatfai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Characters Path: `chatfai.db.characters.search` ```ts theme={null} const rows = await corsair.chatfai.db.characters.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `nickname` | `string` | equals, contains, startsWith, endsWith, in | | `publicDescription` | `string` | equals, contains, startsWith, endsWith, in | | `image` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `featured` | `boolean` | equals | | `firstMessage` | `string` | equals, contains, startsWith, endsWith, in | | `voiceEnabled` | `boolean` | equals | | `likes` | `number` | equals, gt, gte, lt, lte, in | | `installs` | `number` | equals, gt, gte, lt, lte, in | | `followers` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Conversations Path: `chatfai.db.conversations.search` ```ts theme={null} const rows = await corsair.chatfai.db.conversations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `character_id` | `string` | equals, contains, startsWith, endsWith, in | | `characterId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/chatfai/overview Character chat platform for creating AI personas and interactive fictional conversations. Use **ChatFAI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 3 typed API operations * 2 synced entities (`characters`, `conversations`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/chatfai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/chatfai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/chatfai ``` ```bash bun theme={null} bun add corsair @corsair-dev/chatfai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { chatfai } from '@corsair-dev/chatfai'; export const corsair = createCorsair({ plugins: [ chatfai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} chatfai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'chatfai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`characters.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.chatfai.api.characters.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/chatfai/api) reference.* See the full list on the [API](/plugins/chatfai/api) page. ## Query synced data Synced entities support `tenant.chatfai.db..search()` and `.list()`: `characters`, `conversations`. See [Database](/plugins/chatfai/database) for filters and operators. ## What's next > **[API reference](/plugins/chatfai/api)** > > Every `chatfai.api.*` operation with input and output types. > **[Database](/plugins/chatfai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/chatwork/api API reference for Chatwork: every `chatwork.api.*` operation with input and output types. Every `chatwork.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get profile information of the authenticated user **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `number` | Yes | The Chatwork account ID | | `room_id` | `number` | Yes | The user personal room ID | | `name` | `string` | Yes | The user name | | `chatwork_id` | `string` | No | The Chatwork ID handle | | `organization_id` | `number` | No | The organization ID | | `organization_name` | `string` | No | The organization name | | `department` | `string` | No | The department name | | `title` | `string` | No | The user title/position | | `url` | `string` | No | The user website URL | | `introduction` | `string` | No | The user profile introduction | | `login_mail` | `string` | No | The login email address | | `mail` | `string` | No | The user email address | | `tel_organization` | `string` | No | Organization phone number | | `tel_extension` | `string` | No | Extension phone number | | `tel_mobile` | `string` | No | Mobile phone number | | `skype` | `string` | No | Skype handle | | `facebook` | `string` | No | Facebook profile | | `twitter` | `string` | No | Twitter/X handle | | `avatar_image_url` | `string` | No | Avatar image URL | *** ### getStatus `account.getStatus` Get unread, mention and open task counts for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.account.getStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `unread_room_num` | `number` | Yes | Number of rooms with unread messages | | `mention_room_num` | `number` | Yes | Number of rooms with unread mentions | | `mytask_room_num` | `number` | Yes | Number of rooms with my open tasks | | `unread_num` | `number` | Yes | Total unread messages | | `mention_num` | `number` | Yes | Total unread mentions | | `mytask_num` | `number` | Yes | Total open tasks assigned to me | *** ### listTasks `account.listTasks` List tasks assigned to the authenticated user (up to 100) **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.account.listTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assigned_by_account_id` | `number` | No | Only tasks assigned by this account ID | | `status` | `open \| done` | No | Task status filter (default open) | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > task_id: number, > assigned_by_account: { > account_id: number, > name: string, > avatar_image_url?: string > }, > message_id: string, > body: string, > limit_time: number, > status: open | done, > limit_type?: none | date | time, > room: { > room_id: number, > name: string, > icon_path: string > } > }[] > ``` *** ## Contacts ### list `contacts.list` List contacts of the authenticated user **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.contacts.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > account_id: number, > room_id: number, > name: string, > chatwork_id?: string, > organization_id?: number, > organization_name?: string, > department?: string, > avatar_image_url?: string > }[] > ``` *** ### listIncomingRequests `contacts.listIncomingRequests` List pending contact requests sent to the authenticated user (up to 100) **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.contacts.listIncomingRequests({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > request_id: number, > account_id: number, > message?: string | null, > name: string, > chatwork_id?: string, > organization_id?: number, > organization_name?: string, > department?: string, > avatar_image_url?: string > }[] > ``` *** ## Files ### get `files.get` Get file details, optionally with a temporary download URL **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `file_id` | `number` | Yes | The ID of the file | | `create_download_url` | `boolean` | No | Generate a download URL valid for 30 seconds | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `number` | Yes | The file ID | | `account` | `object` | Yes | The uploader | | `message_id` | `string` | Yes | The message ID the file was posted with | | `filename` | `string` | Yes | The file name | | `filesize` | `number` | Yes | The file size in bytes | | `upload_time` | `number` | Yes | Upload timestamp in Unix seconds | | `download_url` | `string` | No | Temporary download URL | > **account full type** > > ```ts theme={null} > { > account_id: number, > name: string, > avatar_image_url?: string > } > ``` *** ### list `files.list` List files uploaded to a chat room (up to 100) **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `account_id` | `number` | No | Only files uploaded by this account ID | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > file_id: number, > account: { > account_id: number, > name: string, > avatar_image_url?: string > }, > message_id: string, > filename: string, > filesize: number, > upload_time: number > }[] > ``` *** ### upload `files.upload` Upload a file to a chat room **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `file_base64` | `string` | Yes | File contents as base64 (max 5MB) | | `file_name` | `string` | Yes | File name including extension | | `content_type` | `string` | No | MIME type of the file (default application/octet-stream) | | `message` | `string` | No | Message body to post together with the file | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `number` | Yes | The uploaded file ID | *** ## Links ### create `links.create` Create an invitation link for a group chat **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.links.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `code` | `string` | No | Path part of the invitation link URL (random if omitted) | | `need_acceptance` | `boolean` | No | Whether joining requires admin approval (default true) | | `description` | `string` | No | Description shown on the link page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `public` | `boolean` | Yes | Whether the invitation link is enabled | | `url` | `string` | No | The invitation link URL | | `need_acceptance` | `boolean` | No | Whether joining requires admin approval | | `description` | `string` | No | The link page description | *** ### delete `links.delete` Delete the invitation link of a group chat **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.chatwork.api.links.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | **Output** | Name | Type | Required | Description | | - | - | - | - | | `public` | `boolean` | Yes | Whether the invitation link is enabled | | `url` | `string` | No | The invitation link URL | | `need_acceptance` | `boolean` | No | Whether joining requires admin approval | | `description` | `string` | No | The link page description | *** ### get `links.get` Get the invitation link of a group chat **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.links.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | **Output** | Name | Type | Required | Description | | - | - | - | - | | `public` | `boolean` | Yes | Whether the invitation link is enabled | | `url` | `string` | No | The invitation link URL | | `need_acceptance` | `boolean` | No | Whether joining requires admin approval | | `description` | `string` | No | The link page description | *** ### update `links.update` Update the invitation link of a group chat **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.links.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `code` | `string` | No | Path part of the invitation link URL (random if omitted) | | `need_acceptance` | `boolean` | No | Whether joining requires admin approval (default true) | | `description` | `string` | No | Description shown on the link page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `public` | `boolean` | Yes | Whether the invitation link is enabled | | `url` | `string` | No | The invitation link URL | | `need_acceptance` | `boolean` | No | Whether joining requires admin approval | | `description` | `string` | No | The link page description | *** ## Members ### list `members.list` List members belonging to a chat room **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.members.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > account_id: number, > role: admin | member | readonly | string, > name: string, > chatwork_id?: string, > organization_id?: number, > organization_name?: string, > department?: string, > avatar_image_url?: string > }[] > ``` *** ### update `members.update` Replace the member list and roles of a group chat **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.members.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `members_admin_ids` | `number[]` | Yes | Account IDs to grant the admin role (at least one) | | `members_member_ids` | `number[]` | No | Account IDs to grant the member role | | `members_readonly_ids` | `number[]` | No | Account IDs to grant the read-only role | | `room_id` | `number` | Yes | The ID of the room | **Output** | Name | Type | Required | Description | | - | - | - | - | | `admin` | `number[]` | Yes | Account IDs with the admin role | | `member` | `number[]` | Yes | Account IDs with the member role | | `readonly` | `number[]` | Yes | Account IDs with the read-only role | *** ## Messages ### delete `messages.delete` Delete a message from a chat room **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.chatwork.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `message_id` | `string` | Yes | The ID of the message to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | The message ID | *** ### get `messages.get` Get a specific message from a chat room **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `message_id` | `string` | Yes | The ID of the message to retrieve | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | The unique message ID | | `account` | `object` | Yes | The sender profile summary | | `body` | `string` | Yes | The message content | | `send_time` | `number` | Yes | Sent timestamp in Unix seconds | | `update_time` | `number` | Yes | Updated timestamp in Unix seconds (0 if not updated) | > **account full type** > > ```ts theme={null} > { > account_id: number, > name: string, > avatar_image_url?: string > } > ``` *** ### list `messages.list` List messages in a chat room (up to 100) **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `force` | `0 \| 1` | No | 0: get only unread messages (default), 1: get up to 100 latest messages | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > message_id: string, > account: { > account_id: number, > name: string, > avatar_image_url?: string > }, > body: string, > send_time: number, > update_time: number > }[] > ``` *** ### markRead `messages.markRead` Mark messages in a chat room as read **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.messages.markRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `message_id` | `string` | No | Mark messages up to this ID as read (all if omitted) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `unread_num` | `number` | Yes | Remaining unread messages in the room | | `mention_num` | `number` | Yes | Remaining unread mentions in the room | *** ### markUnread `messages.markUnread` Mark messages in a chat room as unread from a given message **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.messages.markUnread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `message_id` | `string` | Yes | Mark this message and every later one as unread | **Output** | Name | Type | Required | Description | | - | - | - | - | | `unread_num` | `number` | Yes | Remaining unread messages in the room | | `mention_num` | `number` | Yes | Remaining unread mentions in the room | *** ### send `messages.send` Send a new message to a chat room **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room to post to | | `body` | `string` | Yes | The message body text | | `self_unread` | `0 \| 1 \| boolean` | No | Whether the posted message should be marked as unread for the sender (0: read, 1: unread) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | The ID of the created message | *** ### update `messages.update` Edit the body of a message **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.messages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `message_id` | `string` | Yes | The ID of the message to update | | `body` | `string` | Yes | The new message body | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | The message ID | *** ## Rooms ### create `rooms.create` Create a new group chat **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.rooms.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `members_admin_ids` | `number[]` | Yes | Account IDs to grant the admin role (at least one) | | `members_member_ids` | `number[]` | No | Account IDs to grant the member role | | `members_readonly_ids` | `number[]` | No | Account IDs to grant the read-only role | | `name` | `string` | Yes | The group chat name | | `description` | `string` | No | The group chat description | | `icon_preset` | `group \| check \| document \| meeting \| event \| project \| business \| study \| security \| star \| idea \| heart \| magcup \| beer \| music \| sports \| travel` | No | The group chat icon type | | `link` | `boolean` | No | Whether to create an invitation link | | `link_code` | `string` | No | Path part of the invitation link URL (random if omitted) | | `link_need_acceptance` | `boolean` | No | Whether joining via the link requires admin approval | **Output** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The room ID | *** ### delete `rooms.delete` Leave or permanently delete a group chat **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.chatwork.api.rooms.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `action_type` | `leave \| delete` | Yes | leave: leave the group chat; delete: delete it for every member (irreversible) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Whether the operation succeeded | *** ### get `rooms.get` Get details of a specific chat room **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.rooms.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room to retrieve | **Output** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The room ID | | `name` | `string` | Yes | The room name | | `type` | `string` | Yes | The room type (e.g. my, direct, group) | | `role` | `string` | Yes | The current user role in the room (e.g. admin, member, readonly) | | `sticky` | `boolean` | Yes | Whether the room is pinned | | `unread_num` | `number` | Yes | Number of unread messages | | `mention_num` | `number` | Yes | Number of unread mentions | | `mytask_num` | `number` | Yes | Number of open tasks assigned to me | | `message_num` | `number` | Yes | Total number of messages in the room | | `file_num` | `number` | Yes | Total number of files in the room | | `task_num` | `number` | Yes | Total number of tasks in the room | | `icon_path` | `string` | Yes | Icon image URL or icon path | | `last_update_time` | `number` | Yes | Last updated timestamp in Unix seconds | | `description` | `string` | No | Detailed room description | *** ### list `rooms.list` List chat rooms the authenticated user belongs to **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.rooms.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > room_id: number, > name: string, > type: string, > role: string, > sticky: boolean, > unread_num: number, > mention_num: number, > mytask_num: number, > message_num: number, > file_num: number, > task_num: number, > icon_path: string, > last_update_time: number, > description?: string > }[] > ``` *** ### update `rooms.update` Update the name, description or icon of a group chat **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.rooms.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `name` | `string` | No | New group chat name | | `description` | `string` | No | New group chat description | | `icon_preset` | `group \| check \| document \| meeting \| event \| project \| business \| study \| security \| star \| idea \| heart \| magcup \| beer \| music \| sports \| travel` | No | New group chat icon type | **Output** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The room ID | *** ## Tasks ### create `tasks.create` Create a task in a chat room **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `body` | `string` | Yes | The task content | | `to_ids` | `number[]` | Yes | Account IDs of the assignees | | `limit` | `number` | No | Deadline as a Unix timestamp in seconds | | `limit_type` | `none \| date \| time` | No | The deadline type | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_ids` | `number[]` | Yes | IDs of the created tasks | *** ### get `tasks.get` Get a specific task in a chat room **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `task_id` | `number` | Yes | The ID of the task | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `number` | Yes | The task ID | | `assigned_by_account` | `object` | Yes | The account that assigned the task | | `message_id` | `string` | Yes | The message ID the task belongs to | | `body` | `string` | Yes | The task content | | `limit_time` | `number` | Yes | Deadline in Unix seconds (0 if none) | | `status` | `open \| done` | Yes | The task status | | `limit_type` | `none \| date \| time` | No | The deadline type | | `account` | `object` | Yes | The task assignee | > **assigned\_by\_account full type** > > ```ts theme={null} > { > account_id: number, > name: string, > avatar_image_url?: string > } > ``` > **account full type** > > ```ts theme={null} > { > account_id: number, > name: string, > avatar_image_url?: string > } > ``` *** ### list `tasks.list` List tasks in a chat room (up to 100) **Risk:** `read` ```ts theme={null} await corsair.chatwork.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `account_id` | `number` | No | Only tasks assigned to this account ID | | `assigned_by_account_id` | `number` | No | Only tasks assigned by this account ID | | `status` | `open \| done` | No | Task status filter (default open) | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > task_id: number, > assigned_by_account: { > account_id: number, > name: string, > avatar_image_url?: string > }, > message_id: string, > body: string, > limit_time: number, > status: open | done, > limit_type?: none | date | time, > account: { > account_id: number, > name: string, > avatar_image_url?: string > } > }[] > ``` *** ### updateStatus `tasks.updateStatus` Mark a task as done or reopen it **Risk:** `write` ```ts theme={null} await corsair.chatwork.api.tasks.updateStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `room_id` | `number` | Yes | The ID of the room | | `task_id` | `number` | Yes | The ID of the task | | `status` | `open \| done` | Yes | done: complete the task; open: reopen it | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `number` | Yes | The updated task ID | *** # Database Source: https://docs.corsair.dev/plugins/chatwork/database Chatwork local sync: searchable entities, `.search()` filters, and operators. The Chatwork plugin syncs data locally. Use `corsair.chatwork.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `chatwork.db.accounts.search` ```ts theme={null} const rows = await corsair.chatwork.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `account_id` | `number` | equals, gt, gte, lt, lte, in | | `room_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `chatwork_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `number` | equals, gt, gte, lt, lte, in | | `organization_name` | `string` | equals, contains, startsWith, endsWith, in | | `department` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `introduction` | `string` | equals, contains, startsWith, endsWith, in | | `login_mail` | `string` | equals, contains, startsWith, endsWith, in | | `mail` | `string` | equals, contains, startsWith, endsWith, in | | `tel_organization` | `string` | equals, contains, startsWith, endsWith, in | | `tel_extension` | `string` | equals, contains, startsWith, endsWith, in | | `tel_mobile` | `string` | equals, contains, startsWith, endsWith, in | | `skype` | `string` | equals, contains, startsWith, endsWith, in | | `facebook` | `string` | equals, contains, startsWith, endsWith, in | | `twitter` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_image_url` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `chatwork.db.files.search` ```ts theme={null} const rows = await corsair.chatwork.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `file_id` | `number` | equals, gt, gte, lt, lte, in | | `room_id` | `number` | equals, gt, gte, lt, lte, in | | `message_id` | `string` | equals, contains, startsWith, endsWith, in | | `filename` | `string` | equals, contains, startsWith, endsWith, in | | `filesize` | `number` | equals, gt, gte, lt, lte, in | | `upload_time` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Incoming Requests Path: `chatwork.db.incomingRequests.search` ```ts theme={null} const rows = await corsair.chatwork.db.incomingRequests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `request_id` | `number` | equals, gt, gte, lt, lte, in | | `account_id` | `number` | equals, gt, gte, lt, lte, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `chatwork_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `number` | equals, gt, gte, lt, lte, in | | `organization_name` | `string` | equals, contains, startsWith, endsWith, in | | `department` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_image_url` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Members Path: `chatwork.db.members.search` ```ts theme={null} const rows = await corsair.chatwork.db.members.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `account_id` | `number` | equals, gt, gte, lt, lte, in | | `room_id` | `number` | equals, gt, gte, lt, lte, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `chatwork_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `number` | equals, gt, gte, lt, lte, in | | `organization_name` | `string` | equals, contains, startsWith, endsWith, in | | `department` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_image_url` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `chatwork.db.messages.search` ```ts theme={null} const rows = await corsair.chatwork.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `message_id` | `string` | equals, contains, startsWith, endsWith, in | | `room_id` | `number` | equals, gt, gte, lt, lte, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `send_time` | `number` | equals, gt, gte, lt, lte, in | | `update_time` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Rooms Path: `chatwork.db.rooms.search` ```ts theme={null} const rows = await corsair.chatwork.db.rooms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `room_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `sticky` | `boolean` | equals | | `unread_num` | `number` | equals, gt, gte, lt, lte, in | | `mention_num` | `number` | equals, gt, gte, lt, lte, in | | `mytask_num` | `number` | equals, gt, gte, lt, lte, in | | `message_num` | `number` | equals, gt, gte, lt, lte, in | | `file_num` | `number` | equals, gt, gte, lt, lte, in | | `task_num` | `number` | equals, gt, gte, lt, lte, in | | `icon_path` | `string` | equals, contains, startsWith, endsWith, in | | `last_update_time` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `chatwork.db.tasks.search` ```ts theme={null} const rows = await corsair.chatwork.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `task_id` | `number` | equals, gt, gte, lt, lte, in | | `room_id` | `number` | equals, gt, gte, lt, lte, in | | `message_id` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `limit_time` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `limit_type` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/chatwork/overview Business chat and communication tool for team messaging, room management, and collaboration. Use **Chatwork** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 30 typed API operations * 7 synced entities (`accounts`, `files`, `incomingRequests`, `members`, `messages`, `rooms`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/chatwork ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/chatwork ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/chatwork ``` ```bash bun theme={null} bun add corsair @corsair-dev/chatwork ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { chatwork } from '@corsair-dev/chatwork'; export const corsair = createCorsair({ plugins: [ chatwork({ authType: 'oauth_2', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Chatwork OAuth app. ```ts theme={null} chatwork({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. ```ts theme={null} chatwork() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'chatwork', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List rooms** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.chatwork.api.rooms.list({}); ``` **Send a message to a room** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.chatwork.api.messages.send({ room_id: 123456, body: 'Hello from Corsair!' }); ``` See the full list on the [API](/plugins/chatwork/api) page. ## Query synced data Search synced rooms without hitting the Chatwork API. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.chatwork.db.rooms.search({ data: { type: 'group' }, limit: 20, }); ``` Synced entities: `accounts`, `files`, `incomingRequests`, `members`, `messages`, `rooms`, `tasks`. See [Database](/plugins/chatwork/database) for filters and operators. ## What's next > **[API reference](/plugins/chatwork/api)** > > Every `chatwork.api.*` operation with input and output types. > **[Database](/plugins/chatwork/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/chmeetings/api API reference for ChMeetings: every `chmeetings.api.*` operation with input and output types. Every `chmeetings.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Attendance ### list `attendance.list` List attendance for an occurrence **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.attendance.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `occurrence_id` | `string` | Yes | — | | `status` | `absent \| attended` | No | — | | `group_id` | `string \| number` | No | — | | `ungrouped` | `boolean` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `paging` | `object` | No | — | | `data` | `object[]` | Yes | — | > **paging full type** > > ```ts theme={null} > { > total_count?: string | number, > page?: string | number, > page_size?: string | number > } > ``` > **data full type** > > ```ts theme={null} > { > person?: { > person_id?: string | number | null, > first_name?: string | null, > last_name?: string | null, > full_name?: string | null, > mobile?: string | null, > email?: string | null > }, > status?: absent | attended, > checked_in_at?: string | null, > checked_out_at?: string | null, > check_in_code?: string | null > }[] > ``` *** ## Events ### get `events.get` Get an event by ID **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.events.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `start_date` | `string` | No | — | | `schedule` | `object` | No | — | | `recurrence` | `object` | No | — | | `location` | `object` | No | — | | `visibility` | `string` | No | — | | `image_url` | `string` | No | — | > **schedule full type** > > ```ts theme={null} > { > all_day?: boolean, > start_time?: string | null, > end_time?: string | null, > duration_days?: string | number > } > ``` > **recurrence full type** > > ```ts theme={null} > { > } > ``` > **location full type** > > ```ts theme={null} > { > name?: string | null, > formatted_address?: string | null, > latitude?: number | string | null, > longitude?: number | string | null > } > ``` *** ### list `events.list` List events in a date range (max 366 days) **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.events.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | Yes | — | | `to` | `string` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `paging` | `object` | No | — | | `data` | `object[]` | Yes | — | > **paging full type** > > ```ts theme={null} > { > total_count?: string | number, > page?: string | number, > page_size?: string | number > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > title?: string | null, > description?: string | null, > start_date?: string | null, > schedule?: { > all_day?: boolean, > start_time?: string | null, > end_time?: string | null, > duration_days?: string | number > }, > recurrence?: { > } | null, > location?: { > name?: string | null, > formatted_address?: string | null, > latitude?: number | string | null, > longitude?: number | string | null > } | null, > visibility?: string | null, > image_url?: string | null > }[] > ``` *** ### listOccurrences `events.listOccurrences` List occurrences for an event in a date range **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.events.listOccurrences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_id` | `string \| number` | Yes | — | | `from` | `string` | Yes | — | | `to` | `string` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `paging` | `object` | No | — | | `data` | `object[]` | Yes | — | > **paging full type** > > ```ts theme={null} > { > total_count?: string | number, > page?: string | number, > page_size?: string | number > } > ``` > **data full type** > > ```ts theme={null} > { > occurrence_id?: string | null, > event_id?: string | number, > title?: string | null, > description?: string | null, > start?: string | null, > end?: string | null, > materialized?: boolean, > image_url?: string | null > }[] > ``` *** ## Families ### create `families.create` Create a family with members **Risk:** `write` ```ts theme={null} await corsair.chmeetings.api.families.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `members` | `object[]` | Yes | — | > **members full type** > > ```ts theme={null} > { > person_id: string | number, > family_role: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `family_id` | `string \| number` | No | — | | `members` | `object[]` | No | — | > **members full type** > > ```ts theme={null} > { > id?: string | number, > person_id?: string | number, > first_name?: string | null, > last_name?: string | null, > full_name?: string | null, > family_role?: string | null > }[] > ``` *** ### delete `families.delete` Delete a family **Risk:** `destructive` ```ts theme={null} await corsair.chmeetings.api.families.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `families.get` Get a family by ID **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.families.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `family_id` | `string \| number` | No | — | | `members` | `object[]` | No | — | > **members full type** > > ```ts theme={null} > { > id?: string | number, > person_id?: string | number, > first_name?: string | null, > last_name?: string | null, > full_name?: string | null, > family_role?: string | null > }[] > ``` *** ### list `families.list` List families **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.families.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_text` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `paging` | `object` | No | — | | `data` | `object[]` | Yes | — | > **paging full type** > > ```ts theme={null} > { > total_count?: string | number, > page?: string | number, > page_size?: string | number > } > ``` > **data full type** > > ```ts theme={null} > { > family_id?: string | number, > members?: { > id?: string | number, > person_id?: string | number, > first_name?: string | null, > last_name?: string | null, > full_name?: string | null, > family_role?: string | null > }[] | null > }[] > ``` *** ## Groups ### addMember `groups.addMember` Add a person to a group **Risk:** `write` ```ts theme={null} await corsair.chmeetings.api.groups.addMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string \| number` | Yes | — | | `person_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### create `groups.create` Create a group **Risk:** `write` ```ts theme={null} await corsair.chmeetings.api.groups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `privacy` | `internal \| members \| public` | No | — | | `join_request_option` | `open \| closed \| approval_required` | No | — | | `is_visible_to_non_members` | `boolean` | No | — | | `is_members_visible` | `boolean` | No | — | | `is_group_leaders_visible` | `boolean` | No | — | | `is_chat_enabled` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `privacy` | `internal \| members \| public` | No | — | | `join_request_option` | `open \| closed \| approval_required` | No | — | | `is_visible_to_non_members` | `boolean` | No | — | | `is_members_visible` | `boolean` | No | — | | `is_group_leaders_visible` | `boolean` | No | — | | `is_chat_enabled` | `boolean` | No | — | | `created_on` | `string` | No | — | *** ### delete `groups.delete` Delete a group **Risk:** `destructive` ```ts theme={null} await corsair.chmeetings.api.groups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `groups.get` Get a group by ID **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.groups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `privacy` | `internal \| members \| public` | No | — | | `join_request_option` | `open \| closed \| approval_required` | No | — | | `is_visible_to_non_members` | `boolean` | No | — | | `is_members_visible` | `boolean` | No | — | | `is_group_leaders_visible` | `boolean` | No | — | | `is_chat_enabled` | `boolean` | No | — | | `created_on` | `string` | No | — | *** ### list `groups.list` List groups **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.groups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_text` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > name?: string | null, > description?: string | null, > privacy?: internal | members | public, > join_request_option?: open | closed | approval_required, > is_visible_to_non_members?: boolean, > is_members_visible?: boolean, > is_group_leaders_visible?: boolean, > is_chat_enabled?: boolean, > created_on?: string | null > }[] > ``` *** ### removeMember `groups.removeMember` Remove a person from a group **Risk:** `destructive` ```ts theme={null} await corsair.chmeetings.api.groups.removeMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string \| number` | Yes | — | | `person_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `groups.update` Update a group **Risk:** `write` ```ts theme={null} await corsair.chmeetings.api.groups.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `privacy` | `internal \| members \| public` | No | — | | `join_request_option` | `open \| closed \| approval_required` | No | — | | `is_visible_to_non_members` | `boolean` | No | — | | `is_members_visible` | `boolean` | No | — | | `is_group_leaders_visible` | `boolean` | No | — | | `is_chat_enabled` | `boolean` | No | — | | `group_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `privacy` | `internal \| members \| public` | No | — | | `join_request_option` | `open \| closed \| approval_required` | No | — | | `is_visible_to_non_members` | `boolean` | No | — | | `is_members_visible` | `boolean` | No | — | | `is_group_leaders_visible` | `boolean` | No | — | | `is_chat_enabled` | `boolean` | No | — | | `created_on` | `string` | No | — | *** ## Notes ### list `notes.list` List notes for a person **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.notes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `person_id` | `string \| number` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `paging` | `object` | No | — | | `data` | `object[]` | Yes | — | > **paging full type** > > ```ts theme={null} > { > total_count?: string | number, > page?: string | number, > page_size?: string | number > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > note?: string | null, > person_id?: string | number, > created_on?: string | null, > updated_on?: string | null > }[] > ``` *** ## Organizations ### addPerson `organizations.addPerson` Add a person to an organization **Risk:** `write` ```ts theme={null} await corsair.chmeetings.api.organizations.addPerson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `person_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `organizations.get` Get an organization by ID **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.organizations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `type` | `diocese \| church \| ministry` | No | — | | `name` | `string` | No | — | | `parent_id` | `string` | No | — | | `created_on` | `string` | No | — | | `is_main` | `boolean` | No | — | *** ### list `organizations.list` List organizations from GET /api/v1/organizations **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.organizations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_text` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `paging` | `object` | No | — | | `data` | `object[]` | Yes | — | > **paging full type** > > ```ts theme={null} > { > total_count?: string | number, > page?: string | number, > page_size?: string | number > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | null, > type?: diocese | church | ministry, > name?: string | null, > parent_id?: string | null, > created_on?: string | null, > is_main?: boolean > }[] > ``` *** ### listPeople `organizations.listPeople` List people in an organization **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.organizations.listPeople({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `include_family_members` | `boolean` | No | — | | `include_additional_fields` | `boolean` | No | — | | `include_organizations` | `boolean` | No | — | | `name` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `paging` | `object` | No | — | | `data` | `object[]` | Yes | — | > **paging full type** > > ```ts theme={null} > { > total_count?: string | number, > page?: string | number, > page_size?: string | number > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > first_name?: string | null, > middle_name?: string | null, > last_name?: string | null, > full_name?: string | null, > nick_name?: string | null, > native_name?: string | null, > email?: string | null, > photo?: string | null, > birth_date?: string | null, > mobile?: string | null, > do_not_text?: boolean | null, > do_not_email?: boolean | null, > created_on?: string | null, > updated_on?: string | null, > facebook?: string | null, > gender?: string | null, > social_status?: string | null, > marriage_date?: string | null, > engagement_date?: string | null, > job_title?: string | null, > work_place?: string | null, > qualification?: string | null, > education_level?: string | null, > school?: string | null, > father_name?: string | null, > church?: string | null, > is_deacon?: boolean | null, > rank?: string | null, > bishop_donor?: string | null, > family_role?: string | null, > family?: { > id?: string | number, > person_id?: string | number, > first_name?: string | null, > last_name?: string | null, > full_name?: string | null, > family_role?: string | null > }[] | null, > baptism_date?: string | null, > baptism_location?: string | null, > grade?: string | null, > graduation_year?: string | number | null, > telephone?: string | null, > talents_and_hobbies?: string | null, > is_archived?: boolean, > archived_at?: string | null, > address?: { > country?: string | null, > state?: string | null, > city?: string | null, > building?: string | null, > address_line?: string | null, > address_line2?: string | null, > floor?: string | null, > flat?: string | null, > zip_code?: string | null > } | null, > additional_fields?: { > field_type: string > }[] | null > }[] > ``` *** ### removePerson `organizations.removePerson` Remove a person from an organization **Risk:** `destructive` ```ts theme={null} await corsair.chmeetings.api.organizations.removePerson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | | `person_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ## People ### create `people.create` Create a person via POST /api/v1/people **Risk:** `write` ```ts theme={null} await corsair.chmeetings.api.people.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `middle_name` | `string` | No | — | | `nick_name` | `string` | No | — | | `native_name` | `string` | No | — | | `email` | `string` | No | — | | `birth_date` | `string` | No | — | | `mobile` | `string` | No | — | | `do_not_text` | `boolean` | No | — | | `do_not_email` | `boolean` | No | — | | `facebook` | `string` | No | — | | `gender` | `string` | No | — | | `social_status` | `string` | No | — | | `engagement_date` | `string` | No | — | | `marriage_date` | `string` | No | — | | `job_title` | `string` | No | — | | `work_place` | `string` | No | — | | `qualification` | `string` | No | — | | `education_level` | `string` | No | — | | `school` | `string` | No | — | | `father_name` | `string` | No | — | | `church` | `string` | No | — | | `is_deacon` | `boolean` | No | — | | `rank` | `string` | No | — | | `bishop_donor` | `string` | No | — | | `baptism_date` | `string` | No | — | | `baptism_location` | `string` | No | — | | `grade` | `string` | No | — | | `graduation_year` | `string \| number` | No | — | | `telephone` | `string` | No | — | | `talents_and_hobbies` | `string` | No | — | | `address` | `object` | No | — | | `additional_fields` | `object[]` | No | — | > **address full type** > > ```ts theme={null} > { > country?: string | null, > state?: string | null, > city?: string | null, > building?: string | null, > address_line?: string | null, > address_line2?: string | null, > floor?: string | null, > flat?: string | null, > zip_code?: string | null > } > ``` > **additional\_fields full type** > > ```ts theme={null} > { > field_type: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `first_name` | `string` | No | — | | `middle_name` | `string` | No | — | | `last_name` | `string` | No | — | | `full_name` | `string` | No | — | | `nick_name` | `string` | No | — | | `native_name` | `string` | No | — | | `email` | `string` | No | — | | `photo` | `string` | No | — | | `birth_date` | `string` | No | — | | `mobile` | `string` | No | — | | `do_not_text` | `boolean` | No | — | | `do_not_email` | `boolean` | No | — | | `created_on` | `string` | No | — | | `updated_on` | `string` | No | — | | `facebook` | `string` | No | — | | `gender` | `string` | No | — | | `social_status` | `string` | No | — | | `marriage_date` | `string` | No | — | | `engagement_date` | `string` | No | — | | `job_title` | `string` | No | — | | `work_place` | `string` | No | — | | `qualification` | `string` | No | — | | `education_level` | `string` | No | — | | `school` | `string` | No | — | | `father_name` | `string` | No | — | | `church` | `string` | No | — | | `is_deacon` | `boolean` | No | — | | `rank` | `string` | No | — | | `bishop_donor` | `string` | No | — | | `family_role` | `string` | No | — | | `family` | `object[]` | No | — | | `baptism_date` | `string` | No | — | | `baptism_location` | `string` | No | — | | `grade` | `string` | No | — | | `graduation_year` | `string \| number` | No | — | | `telephone` | `string` | No | — | | `talents_and_hobbies` | `string` | No | — | | `is_archived` | `boolean` | No | — | | `archived_at` | `string` | No | — | | `address` | `object` | No | — | | `additional_fields` | `object[]` | No | — | > **family full type** > > ```ts theme={null} > { > id?: string | number, > person_id?: string | number, > first_name?: string | null, > last_name?: string | null, > full_name?: string | null, > family_role?: string | null > }[] > ``` > **address full type** > > ```ts theme={null} > { > country?: string | null, > state?: string | null, > city?: string | null, > building?: string | null, > address_line?: string | null, > address_line2?: string | null, > floor?: string | null, > flat?: string | null, > zip_code?: string | null > } > ``` > **additional\_fields full type** > > ```ts theme={null} > { > field_type: string > }[] > ``` *** ### delete `people.delete` Delete a person via DELETE /api/v1/people/ **Risk:** `destructive` ```ts theme={null} await corsair.chmeetings.api.people.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `people.get` Get a person by ID from GET /api/v1/people/ **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.people.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `first_name` | `string` | No | — | | `middle_name` | `string` | No | — | | `last_name` | `string` | No | — | | `full_name` | `string` | No | — | | `nick_name` | `string` | No | — | | `native_name` | `string` | No | — | | `email` | `string` | No | — | | `photo` | `string` | No | — | | `birth_date` | `string` | No | — | | `mobile` | `string` | No | — | | `do_not_text` | `boolean` | No | — | | `do_not_email` | `boolean` | No | — | | `created_on` | `string` | No | — | | `updated_on` | `string` | No | — | | `facebook` | `string` | No | — | | `gender` | `string` | No | — | | `social_status` | `string` | No | — | | `marriage_date` | `string` | No | — | | `engagement_date` | `string` | No | — | | `job_title` | `string` | No | — | | `work_place` | `string` | No | — | | `qualification` | `string` | No | — | | `education_level` | `string` | No | — | | `school` | `string` | No | — | | `father_name` | `string` | No | — | | `church` | `string` | No | — | | `is_deacon` | `boolean` | No | — | | `rank` | `string` | No | — | | `bishop_donor` | `string` | No | — | | `family_role` | `string` | No | — | | `family` | `object[]` | No | — | | `baptism_date` | `string` | No | — | | `baptism_location` | `string` | No | — | | `grade` | `string` | No | — | | `graduation_year` | `string \| number` | No | — | | `telephone` | `string` | No | — | | `talents_and_hobbies` | `string` | No | — | | `is_archived` | `boolean` | No | — | | `archived_at` | `string` | No | — | | `address` | `object` | No | — | | `additional_fields` | `object[]` | No | — | > **family full type** > > ```ts theme={null} > { > id?: string | number, > person_id?: string | number, > first_name?: string | null, > last_name?: string | null, > full_name?: string | null, > family_role?: string | null > }[] > ``` > **address full type** > > ```ts theme={null} > { > country?: string | null, > state?: string | null, > city?: string | null, > building?: string | null, > address_line?: string | null, > address_line2?: string | null, > floor?: string | null, > flat?: string | null, > zip_code?: string | null > } > ``` > **additional\_fields full type** > > ```ts theme={null} > { > field_type: string > }[] > ``` *** ### list `people.list` List people from GET /api/v1/people **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.people.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_family_members` | `boolean` | No | — | | `include_additional_fields` | `boolean` | No | — | | `include_organizations` | `boolean` | No | — | | `name` | `string` | No | — | | `mobile` | `string` | No | — | | `email` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `paging` | `object` | No | — | | `data` | `object[]` | Yes | — | > **paging full type** > > ```ts theme={null} > { > total_count?: string | number, > page?: string | number, > page_size?: string | number > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > first_name?: string | null, > middle_name?: string | null, > last_name?: string | null, > full_name?: string | null, > nick_name?: string | null, > native_name?: string | null, > email?: string | null, > photo?: string | null, > birth_date?: string | null, > mobile?: string | null, > do_not_text?: boolean | null, > do_not_email?: boolean | null, > created_on?: string | null, > updated_on?: string | null, > facebook?: string | null, > gender?: string | null, > social_status?: string | null, > marriage_date?: string | null, > engagement_date?: string | null, > job_title?: string | null, > work_place?: string | null, > qualification?: string | null, > education_level?: string | null, > school?: string | null, > father_name?: string | null, > church?: string | null, > is_deacon?: boolean | null, > rank?: string | null, > bishop_donor?: string | null, > family_role?: string | null, > family?: { > id?: string | number, > person_id?: string | number, > first_name?: string | null, > last_name?: string | null, > full_name?: string | null, > family_role?: string | null > }[] | null, > baptism_date?: string | null, > baptism_location?: string | null, > grade?: string | null, > graduation_year?: string | number | null, > telephone?: string | null, > talents_and_hobbies?: string | null, > is_archived?: boolean, > archived_at?: string | null, > address?: { > country?: string | null, > state?: string | null, > city?: string | null, > building?: string | null, > address_line?: string | null, > address_line2?: string | null, > floor?: string | null, > flat?: string | null, > zip_code?: string | null > } | null, > additional_fields?: { > field_type: string > }[] | null > }[] > ``` *** ### listOrganizations `people.listOrganizations` List a person organizations **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.people.listOrganizations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `person_id` | `string \| number` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `paging` | `object` | No | — | | `data` | `object[]` | Yes | — | > **paging full type** > > ```ts theme={null} > { > total_count?: string | number, > page?: string | number, > page_size?: string | number > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | null, > type?: diocese | church | ministry, > name?: string | null, > parent_id?: string | null, > created_on?: string | null, > is_main?: boolean > }[] > ``` *** ### update `people.update` Update a person via PUT /api/v1/people/ **Risk:** `write` ```ts theme={null} await corsair.chmeetings.api.people.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `middle_name` | `string` | No | — | | `nick_name` | `string` | No | — | | `native_name` | `string` | No | — | | `email` | `string` | No | — | | `birth_date` | `string` | No | — | | `mobile` | `string` | No | — | | `do_not_text` | `boolean` | No | — | | `do_not_email` | `boolean` | No | — | | `facebook` | `string` | No | — | | `gender` | `string` | No | — | | `social_status` | `string` | No | — | | `engagement_date` | `string` | No | — | | `marriage_date` | `string` | No | — | | `job_title` | `string` | No | — | | `work_place` | `string` | No | — | | `qualification` | `string` | No | — | | `education_level` | `string` | No | — | | `school` | `string` | No | — | | `father_name` | `string` | No | — | | `church` | `string` | No | — | | `is_deacon` | `boolean` | No | — | | `rank` | `string` | No | — | | `bishop_donor` | `string` | No | — | | `baptism_date` | `string` | No | — | | `baptism_location` | `string` | No | — | | `grade` | `string` | No | — | | `graduation_year` | `string \| number` | No | — | | `telephone` | `string` | No | — | | `talents_and_hobbies` | `string` | No | — | | `address` | `object` | No | — | | `additional_fields` | `object[]` | No | — | | `id` | `string \| number` | Yes | — | > **address full type** > > ```ts theme={null} > { > country?: string | null, > state?: string | null, > city?: string | null, > building?: string | null, > address_line?: string | null, > address_line2?: string | null, > floor?: string | null, > flat?: string | null, > zip_code?: string | null > } > ``` > **additional\_fields full type** > > ```ts theme={null} > { > field_type: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ## Settings ### get `settings.get` Get genders, social statuses, grade values, family roles, and member fields **Risk:** `read` ```ts theme={null} await corsair.chmeetings.api.settings.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `genders` | `unknown[]` | Yes | — | | `social_statuses` | `unknown[]` | Yes | — | | `grade_values` | `unknown[]` | Yes | — | | `family_roles` | `unknown[]` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > sections?: { > }[] | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/chmeetings/database ChMeetings local sync: searchable entities, `.search()` filters, and operators. The ChMeetings plugin syncs data locally. Use `corsair.chmeetings.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Events Path: `chmeetings.db.events.search` ```ts theme={null} const rows = await corsair.chmeetings.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `start_date` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `chmeetings.db.organizations.search` ```ts theme={null} const rows = await corsair.chmeetings.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## People Path: `chmeetings.db.people.search` ```ts theme={null} const rows = await corsair.chmeetings.db.people.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `mobile` | `string` | equals, contains, startsWith, endsWith, in | | `gender` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/chmeetings/overview ChMeetings plugin for Corsair Use **ChMeetings** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 28 typed API operations * 3 synced entities (`events`, `organizations`, `people`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/chmeetings ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/chmeetings ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/chmeetings ``` ```bash bun theme={null} bun add corsair @corsair-dev/chmeetings ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { chmeetings } from '@corsair-dev/chmeetings'; export const corsair = createCorsair({ plugins: [ chmeetings(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} chmeetings() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'chmeetings', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`attendance.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.chmeetings.api.attendance.list({}); ``` **`families.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.chmeetings.api.families.create({}); ``` See the full list on the [API](/plugins/chmeetings/api) page. ## Query synced data Synced entities support `tenant.chmeetings.db..search()` and `.list()`: `events`, `organizations`, `people`. See [Database](/plugins/chmeetings/database) for filters and operators. ## What's next > **[API reference](/plugins/chmeetings/api)** > > Every `chmeetings.api.*` operation with input and output types. > **[Database](/plugins/chmeetings/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/cincopa/api API reference for Cincopa: every `cincopa.api.*` operation with input and output types. Every `cincopa.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Asset ### abortUploadFromUrl `asset.abortUploadFromUrl` Abort an ongoing asset upload-in-progress **Risk:** `write` ```ts theme={null} await corsair.cincopa.api.asset.abortUploadFromUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `statusId` | `string` | Yes | Status tracking identifier of the upload to abort | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `runtime` | `number` | No | — | | `status_id` | `string` | No | — | *** ### getUploadFromUrlStatus `asset.getUploadFromUrlStatus` Check the status of an asset upload initiated via URL **Risk:** `read` ```ts theme={null} await corsair.cincopa.api.asset.getUploadFromUrlStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `statusId` | `string` | Yes | Status tracking identifier from uploadFromUrl | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `runtime` | `number` | No | — | | `status` | `string` | No | — | | `progress` | `string \| number` | No | — | | `progress_bytes` | `string \| number` | No | — | | `file_size_bytes` | `string \| number` | No | — | | `resid` | `string` | No | — | | `more` | `string` | No | — | | `debug` | `string` | No | — | *** ### uploadFromUrl `asset.uploadFromUrl` Upload a new asset directly from a provided external URL **Risk:** `write` ```ts theme={null} await corsair.cincopa.api.asset.uploadFromUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string` | Yes | External URL of the media asset to upload | | `fid` | `string` | No | Optional gallery folder identifier (FID) target | | `rid` | `string` | No | Optional existing resource identifier (RID) to replace | | `type` | `string` | No | Optional media asset type specification | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `runtime` | `number` | No | — | | `status_id` | `string` | Yes | — | *** ## Gallery ### list `gallery.list` List galleries with pagination, search, and tag filtering **Risk:** `read` ```ts theme={null} await corsair.cincopa.api.gallery.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Search term to filter galleries | | `page` | `number` | No | Page number for pagination (starts at 1) | | `itemsPerPage` | `number` | No | Number of items per page (1-100) | | `filterTags` | `string` | No | Filter galleries by tag | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `runtime` | `number` | Yes | — | | `workspace` | `string` | No | — | | `galleries` | `object[]` | Yes | — | | `tag_cloud` | `object` | Yes | — | | `items_data` | `object` | Yes | — | > **galleries full type** > > ```ts theme={null} > { > fid: string, > name: string, > description: string, > upload_url: string, > tags: string, > modified: string, > syncstatus: string > }[] > ``` > **tag\_cloud full type** > > ```ts theme={null} > { > } > ``` > **items\_data full type** > > ```ts theme={null} > { > page: number, > items_per_page: number, > items_count: number, > pages_count: number > } > ``` *** ## General ### getUploadIframe `general.getUploadIframe` Get an embeddable upload iframe URL for a gallery **Risk:** `read` ```ts theme={null} await corsair.cincopa.api.general.getUploadIframe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fid` | `string` | No | Optional gallery folder identifier (FID) target | | `rrid` | `string` | No | Optional replace resource identifier (RRID) target | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public upload iframe URL stripped of credentials | | `html` | `string` | Yes | Safe iframe HTML markup with credentials redacted | *** ### ping `general.ping` Validate API connection **Risk:** `read` ```ts theme={null} await corsair.cincopa.api.general.ping({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `ping` | `string` | No | — | | `runtime` | `number` | No | — | | `accemail` | `string` | No | — | | `accid` | `string` | No | — | | `accid_num` | `number \| string` | No | — | | `permissions` | `string` | No | — | | `useremail` | `string` | No | — | | `userid` | `string` | No | — | | `userid_num` | `number \| string` | No | — | | `ip` | `string` | No | — | | `revertid` | `boolean` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/cincopa/database Cincopa local sync: searchable entities, `.search()` filters, and operators. The Cincopa plugin syncs data locally. Use `corsair.cincopa.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Account Path: `cincopa.db.account.search` ```ts theme={null} const rows = await corsair.cincopa.db.account.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `accid` | `string` | equals, contains, startsWith, endsWith, in | | `accemail` | `string` | equals, contains, startsWith, endsWith, in | | `userid` | `string` | equals, contains, startsWith, endsWith, in | | `useremail` | `string` | equals, contains, startsWith, endsWith, in | | `permissions` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Assets Path: `cincopa.db.assets.search` ```ts theme={null} const rows = await corsair.cincopa.db.assets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `rid` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `filename` | `string` | equals, contains, startsWith, endsWith, in | | `caption` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `long_description` | `string` | equals, contains, startsWith, endsWith, in | | `filesize` | `number` | equals, gt, gte, lt, lte, in | | `tags` | `string` | equals, contains, startsWith, endsWith, in | | `uploaded_by` | `string` | equals, contains, startsWith, endsWith, in | | `uploaded` | `string` | equals, contains, startsWith, endsWith, in | | `modified` | `string` | equals, contains, startsWith, endsWith, in | | `syncstatus` | `string` | equals, contains, startsWith, endsWith, in | | `storage` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Galleries Path: `cincopa.db.galleries.search` ```ts theme={null} const rows = await corsair.cincopa.db.galleries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `fid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `upload_url` | `string` | equals, contains, startsWith, endsWith, in | | `tags` | `string` | equals, contains, startsWith, endsWith, in | | `modified` | `string` | equals, contains, startsWith, endsWith, in | | `syncstatus` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Upload Status Path: `cincopa.db.uploadStatus.search` ```ts theme={null} const rows = await corsair.cincopa.db.uploadStatus.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `status_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `resid` | `string` | equals, contains, startsWith, endsWith, in | | `more` | `string` | equals, contains, startsWith, endsWith, in | | `debug` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/cincopa/overview Cincopa plugin for Corsair Use **Cincopa** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 6 typed API operations * 4 synced entities (`account`, `assets`, `galleries`, `uploadStatus`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cincopa ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cincopa ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cincopa ``` ```bash bun theme={null} bun add corsair @corsair-dev/cincopa ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cincopa } from '@corsair-dev/cincopa'; export const corsair = createCorsair({ plugins: [ cincopa(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} cincopa() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cincopa', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`asset.getUploadFromUrlStatus`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cincopa.api.asset.getUploadFromUrlStatus({}); ``` **`asset.abortUploadFromUrl`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cincopa.api.asset.abortUploadFromUrl({}); ``` See the full list on the [API](/plugins/cincopa/api) page. ## Query synced data Synced entities support `tenant.cincopa.db..search()` and `.list()`: `account`, `assets`, `galleries`, `uploadStatus`. See [Database](/plugins/cincopa/database) for filters and operators. ## What's next > **[API reference](/plugins/cincopa/api)** > > Every `cincopa.api.*` operation with input and output types. > **[Database](/plugins/cincopa/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/circleci/api API reference for CircleCI: every `circleci.api.*` operation with input and output types. Every `circleci.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Contexts ### create `contexts.create` Create a context (REST) **Risk:** `write` ```ts theme={null} await corsair.circleci.api.contexts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `ownerId` | `string` | Yes | — | | `ownerType` | `organization \| account` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `created_at` | `string` | No | — | *** ### createRestriction `contexts.createRestriction` Add a restriction to a context **Risk:** `write` ```ts theme={null} await corsair.circleci.api.contexts.createRestriction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextId` | `string` | Yes | — | | `restrictionType` | `project \| expression \| group` | Yes | — | | `restrictionValue` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `context_id` | `string` | No | — | | `name` | `string` | No | — | | `restriction_type` | `string` | No | — | | `restriction_value` | `string` | No | — | | `project_id` | `string` | No | — | *** ### deleteRestriction `contexts.deleteRestriction` Remove a restriction from a context **Risk:** `destructive` ```ts theme={null} await corsair.circleci.api.contexts.deleteRestriction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextId` | `string` | Yes | — | | `restrictionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `contexts.get` Retrieve a context by id **Risk:** `read` ```ts theme={null} await corsair.circleci.api.contexts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `created_at` | `string` | No | — | *** ### listEnvVars `contexts.listEnvVars` List a context's environment variables **Risk:** `read` ```ts theme={null} await corsair.circleci.api.contexts.listEnvVars({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextId` | `string` | Yes | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_page_token` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > variable?: string | null, > truncated_value?: string | null, > context_id?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` *** ### upsertEnvVar `contexts.upsertEnvVar` Add or update a context environment variable (REST) **Risk:** `write` ```ts theme={null} await corsair.circleci.api.contexts.upsertEnvVar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextId` | `string` | Yes | — | | `variable` | `string` | Yes | — | | `value` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `variable` | `string` | No | — | | `truncated_value` | `string` | No | — | | `context_id` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ## Contexts Graph QL ### create `contextsGraphQL.create` Create a context (GraphQL) **Risk:** `write` ```ts theme={null} await corsair.circleci.api.contextsGraphQL.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextName` | `string` | Yes | — | | `ownerId` | `string` | Yes | — | | `ownerType` | `organization \| account` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | *** ### delete `contextsGraphQL.delete` Permanently delete a context and its environment variables (GraphQL) **Risk:** `destructive` ```ts theme={null} await corsair.circleci.api.contextsGraphQL.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### query `contextsGraphQL.query` Retrieve a context by id (GraphQL) **Risk:** `read` ```ts theme={null} await corsair.circleci.api.contextsGraphQL.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | *** ### removeEnvVar `contextsGraphQL.removeEnvVar` Remove a context environment variable (GraphQL) **Risk:** `destructive` ```ts theme={null} await corsair.circleci.api.contextsGraphQL.removeEnvVar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextId` | `string` | Yes | — | | `variable` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### storeEnvVar `contextsGraphQL.storeEnvVar` Add or update a context environment variable (GraphQL) **Risk:** `write` ```ts theme={null} await corsair.circleci.api.contextsGraphQL.storeEnvVar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contextId` | `string` | Yes | — | | `variable` | `string` | Yes | — | | `value` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Groups ### create `groups.create` Create an organization group **Risk:** `write` ```ts theme={null} await corsair.circleci.api.groups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | *** ### delete `groups.delete` Permanently delete an organization group **Risk:** `destructive` ```ts theme={null} await corsair.circleci.api.groups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgId` | `string` | Yes | — | | `groupId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `groups.get` Retrieve an organization group **Risk:** `read` ```ts theme={null} await corsair.circleci.api.groups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgId` | `string` | Yes | — | | `groupId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | *** ### list `groups.list` List an organization's groups **Risk:** `read` ```ts theme={null} await corsair.circleci.api.groups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgId` | `string` | Yes | — | | `limit` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_page_token` | `string` | No | — | | `total_count` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > description?: string | null > }[] > ``` *** ## Insights ### branches `insights.branches` List branches with workflow runs **Risk:** `read` ```ts theme={null} await corsair.circleci.api.insights.branches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `workflowName` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### flakyTests `insights.flakyTests` Get flaky tests for a project **Risk:** `read` ```ts theme={null} await corsair.circleci.api.insights.flakyTests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### orgSummary `insights.orgSummary` Get org-wide summary metrics with trends **Risk:** `read` ```ts theme={null} await corsair.circleci.api.insights.orgSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgSlug` | `string` | Yes | — | | `reportingWindow` | `string` | No | — | | `projectNames` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### pagesSummary `insights.pagesSummary` Get summary metrics and trends for a project **Risk:** `read` ```ts theme={null} await corsair.circleci.api.insights.pagesSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `reportingWindow` | `string` | No | — | | `branches` | `string[]` | No | — | | `workflowNames` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### planMetrics `insights.planMetrics` Get plan/credit-usage metrics by project and org for a date range (same route as insights.orgSummary) **Risk:** `read` ```ts theme={null} await corsair.circleci.api.insights.planMetrics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgSlug` | `string` | Yes | — | | `reportingWindow` | `string` | No | — | | `projectNames` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### projectWorkflows `insights.projectWorkflows` Get summary metrics for all of a project's workflows **Risk:** `read` ```ts theme={null} await corsair.circleci.api.insights.projectWorkflows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `reportingWindow` | `string` | No | — | | `branch` | `string` | No | — | | `allBranches` | `boolean` | No | — | | `pageToken` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Jobs ### getArtifacts `jobs.getArtifacts` List a job's stored artifacts by number **Risk:** `read` ```ts theme={null} await corsair.circleci.api.jobs.getArtifacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vcsType` | `gh \| bb` | Yes | — | | `username` | `string` | Yes | — | | `project` | `string` | Yes | — | | `buildNumber` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > path?: string | null, > pretty_path?: string | null, > node_index?: number | null, > url?: string | null > }[] > ``` *** ### getDetails `jobs.getDetails` Fetch a job's status, timing and executor by number **Risk:** `read` ```ts theme={null} await corsair.circleci.api.jobs.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vcsType` | `gh \| bb` | Yes | — | | `username` | `string` | Yes | — | | `project` | `string` | Yes | — | | `buildNumber` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `build_num` | `number` | No | — | | `branch` | `string` | No | — | | `status` | `string` | No | — | | `lifecycle` | `string` | No | — | | `outcome` | `string` | No | — | | `start_time` | `string` | No | — | | `stop_time` | `string` | No | — | | `build_time_millis` | `number` | No | — | | `workflows` | `object` | No | — | > **workflows full type** > > ```ts theme={null} > { > } > ``` *** ### getTestMetadata `jobs.getTestMetadata` Fetch a job's stored test results by number **Risk:** `read` ```ts theme={null} await corsair.circleci.api.jobs.getTestMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vcsType` | `gh \| bb` | Yes | — | | `username` | `string` | Yes | — | | `project` | `string` | Yes | — | | `buildNumber` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > message?: string | null, > source?: string | null, > run_time?: number | null, > file?: string | null, > result?: string | null, > name?: string | null, > classname?: string | null > }[] > ``` *** ## Namespace ### delete `namespace.delete` Permanently delete a namespace and all its orbs **Risk:** `destructive` ```ts theme={null} await corsair.circleci.api.namespace.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteAlias `namespace.deleteAlias` Remove a namespace alias (GraphQL) **Risk:** `destructive` ```ts theme={null} await corsair.circleci.api.namespace.deleteAlias({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### queryExists `namespace.queryExists` Check whether a namespace name exists **Risk:** `read` ```ts theme={null} await corsair.circleci.api.namespace.queryExists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exists` | `boolean` | Yes | — | *** ### rename `namespace.rename` Rename a namespace **Risk:** `write` ```ts theme={null} await corsair.circleci.api.namespace.rename({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `newName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | *** ## Orb Allowlist ### create `orbAllowlist.create` Add a URL orb allow-list entry **Risk:** `write` ```ts theme={null} await corsair.circleci.api.orbAllowlist.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgSlugOrId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `prefix` | `string` | Yes | — | | `auth` | `github-oauth \| bitbucket-oauth \| github-app \| none` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `message` | `string` | No | — | *** ### delete `orbAllowlist.delete` Remove a URL orb allow-list entry **Risk:** `destructive` ```ts theme={null} await corsair.circleci.api.orbAllowlist.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgSlugOrId` | `string` | Yes | — | | `entryId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Orbs ### getDetails `orbs.getDetails` Fetch an orb's metadata and versions **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `isPrivate` | `boolean` | No | — | | `versions` | `object[]` | No | — | > **versions full type** > > ```ts theme={null} > { > id?: string | null, > version?: string | null > }[] > ``` *** ### getVersion `orbs.getVersion` Fetch one orb version **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.getVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orbVersionRef` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `version` | `string` | No | — | | `source` | `string` | No | — | *** ### listCategories `orbs.listCategories` List orb categories **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.listCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `pageInfo` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > endCursor?: string | null > } > ``` *** ### listNamespaceOrbs `orbs.listNamespaceOrbs` List orbs in a namespace **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.listNamespaceOrbs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespaceId` | `string` | No | — | | `certified` | `boolean` | No | — | | `private` | `boolean` | No | — | | `pageCursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `page` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > is_private?: boolean | null, > is_listed?: boolean | null > }[] > ``` > **page full type** > > ```ts theme={null} > { > next?: string | null, > prev?: string | null > } > ``` *** ### listOrbs `orbs.listOrbs` List orbs across the registry **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.listOrbs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `pageInfo` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > isPrivate?: boolean | null, > versions?: { > id?: string | null, > version?: string | null > }[] | null > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > endCursor?: string | null > } > ``` *** ### queryCategoryId `orbs.queryCategoryId` Fetch a category's id by name **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.queryCategoryId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | *** ### queryExists `orbs.queryExists` Check whether an orb exists **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.queryExists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exists` | `boolean` | Yes | — | | `isPrivate` | `boolean` | No | — | *** ### queryId `orbs.queryId` Fetch an orb's id by name **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.queryId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `isPrivate` | `boolean` | No | — | | `versions` | `object[]` | No | — | > **versions full type** > > ```ts theme={null} > { > id?: string | null, > version?: string | null > }[] > ``` *** ### queryLatestVersion `orbs.queryLatestVersion` Fetch an orb's latest published version **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.queryLatestVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `version` | `string` | No | — | *** ### querySource `orbs.querySource` Fetch an orb version's source YAML **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.querySource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orbVersionRef` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `version` | `string` | No | — | | `source` | `string` | No | — | *** ### validateConfig `orbs.validateConfig` Validate orb YAML **Risk:** `read` ```ts theme={null} await corsair.circleci.api.orbs.validateConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orbYaml` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `valid` | `boolean` | No | — | | `errors` | `object[]` | No | — | | `sourceYaml` | `string` | No | — | > **errors full type** > > ```ts theme={null} > { > message?: string | null > }[] > ``` *** ## Organization ### get `organization.get` Retrieve an organization by id (GraphQL) **Risk:** `read` ```ts theme={null} await corsair.circleci.api.organization.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | *** ## Pipeline Definitions ### get `pipelineDefinitions.get` Retrieve a pipeline definition **Risk:** `read` ```ts theme={null} await corsair.circleci.api.pipelineDefinitions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `pipelineDefinitionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `config_source` | `object` | No | — | | `checkout_source` | `object` | No | — | > **config\_source full type** > > ```ts theme={null} > { > provider?: string | null, > repo?: { > full_name?: string | null, > external_id?: string | null > } | null, > file_path?: string | null > } > ``` > **checkout\_source full type** > > ```ts theme={null} > { > provider?: string | null, > repo?: { > full_name?: string | null, > external_id?: string | null > } | null > } > ``` *** ### list `pipelineDefinitions.list` List a project's pipeline definitions **Risk:** `read` ```ts theme={null} await corsair.circleci.api.pipelineDefinitions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > description?: string | null, > created_at?: string | null, > config_source?: { > provider?: string | null, > repo?: { > full_name?: string | null, > external_id?: string | null > } | null, > file_path?: string | null > } | null, > checkout_source?: { > provider?: string | null, > repo?: { > full_name?: string | null, > external_id?: string | null > } | null > } | null > }[] > ``` *** ## Pipelines ### getConfig `pipelines.getConfig` Fetch a pipeline's config **Risk:** `read` ```ts theme={null} await corsair.circleci.api.pipelines.getConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pipelineId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `pipelines.list` List pipelines for an organization **Risk:** `read` ```ts theme={null} await corsair.circleci.api.pipelines.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgSlug` | `string` | No | — | | `pageToken` | `string` | No | — | | `mine` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_page_token` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string | null, > project_slug?: string | null, > number?: number | null, > state?: string | null, > created_at?: string | null, > updated_at?: string | null, > trigger?: { > } | null, > vcs?: { > } | null, > errors?: { > }[] | null > }[] > ``` *** ### listForProject `pipelines.listForProject` List a project's pipelines **Risk:** `read` ```ts theme={null} await corsair.circleci.api.pipelines.listForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `branch` | `string` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_page_token` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string | null, > project_slug?: string | null, > number?: number | null, > state?: string | null, > created_at?: string | null, > updated_at?: string | null, > trigger?: { > } | null, > vcs?: { > } | null, > errors?: { > }[] | null > }[] > ``` *** ### trigger `pipelines.trigger` Start a new pipeline run on a branch or tag **Risk:** `write` ```ts theme={null} await corsair.circleci.api.pipelines.trigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `branch` | `string` | No | — | | `tag` | `string` | No | — | | `parameters` | `object` | No | — | > **parameters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `project_slug` | `string` | No | — | | `number` | `number` | No | — | | `state` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `trigger` | `object` | No | — | | `vcs` | `object` | No | — | | `errors` | `object[]` | No | — | > **trigger full type** > > ```ts theme={null} > { > } > ``` > **vcs full type** > > ```ts theme={null} > { > } > ``` > **errors full type** > > ```ts theme={null} > { > }[] > ``` *** ## Project Env Vars ### create `projectEnvVars.create` Create a project environment variable **Risk:** `write` ```ts theme={null} await corsair.circleci.api.projectEnvVars.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `value` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `value` | `string` | No | — | | `created-at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### delete `projectEnvVars.delete` Delete a project environment variable **Risk:** `destructive` ```ts theme={null} await corsair.circleci.api.projectEnvVars.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `projectEnvVars.list` List a project's environment variables **Risk:** `read` ```ts theme={null} await corsair.circleci.api.projectEnvVars.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_page_token` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > name: string, > value?: string | null, > created-at?: string | null, > created_at?: string | null > }[] > ``` *** ## Projects ### create `projects.create` Follow a repository as a new project **Risk:** `write` ```ts theme={null} await corsair.circleci.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgSlugOrId` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `organization_name` | `string` | No | — | | `organization_id` | `string` | No | — | | `organization_slug` | `string` | No | — | | `vcs_info` | `object` | No | — | > **vcs\_info full type** > > ```ts theme={null} > { > vcs_url?: string | null, > provider?: string | null, > default_branch?: string | null > } > ``` *** ### delete `projects.delete` Permanently remove a project and its settings **Risk:** `destructive` ```ts theme={null} await corsair.circleci.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `projects.get` Retrieve a project by slug **Risk:** `read` ```ts theme={null} await corsair.circleci.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `organization_name` | `string` | No | — | | `organization_id` | `string` | No | — | | `organization_slug` | `string` | No | — | | `vcs_info` | `object` | No | — | > **vcs\_info full type** > > ```ts theme={null} > { > vcs_url?: string | null, > provider?: string | null, > default_branch?: string | null > } > ``` *** ## Runners ### list `runners.list` List self-hosted runners **Risk:** `read` ```ts theme={null} await corsair.circleci.api.runners.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | No | — | | `resourceClass` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id?: string | null, > hostname?: string | null, > name?: string | null, > first_connected?: string | null > }[] > ``` *** ## Schedules ### list `schedules.list` List a project's scheduled pipeline triggers **Risk:** `read` ```ts theme={null} await corsair.circleci.api.schedules.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_page_token` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > description?: string | null, > project-slug?: string | null, > created-at?: string | null, > updated-at?: string | null, > actor?: { > id?: string | null, > avatar_url?: string | null, > login?: string | null, > name?: string | null > } | null, > parameters?: { > } | null, > timetable?: { > per-hour?: number | null, > hours-of-day?: number[] | null, > days-of-week?: string[] | null, > days-of-month?: number[] | null, > months?: string[] | null > } | null > }[] > ``` *** ## Usage Export ### create `usageExport.create` Create a usage export job **Risk:** `write` ```ts theme={null} await corsair.circleci.api.usageExport.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgId` | `string` | Yes | — | | `start` | `string` | Yes | — | | `end` | `string` | Yes | — | | `sharedOrgIds` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `usageExport.get` Retrieve a usage export job **Risk:** `read` ```ts theme={null} await corsair.circleci.api.usageExport.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgId` | `string` | Yes | — | | `usageExportJobId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## User ### getCurrent `user.getCurrent` Read the authenticated user's own profile **Risk:** `read` ```ts theme={null} await corsair.circleci.api.user.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `login` | `string` | No | — | | `name` | `string` | No | — | | `avatar_url` | `string` | No | — | *** ### getInfo `user.getInfo` Read another user's profile by id **Risk:** `read` ```ts theme={null} await corsair.circleci.api.user.getInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `login` | `string` | No | — | | `name` | `string` | No | — | | `avatar_url` | `string` | No | — | *** ### listCollaborations `user.listCollaborations` List organizations the caller can collaborate on **Risk:** `read` ```ts theme={null} await corsair.circleci.api.user.listCollaborations({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > vcs_type?: string | null, > name?: string | null, > slug?: string | null, > avatar_url?: string | null > }[] > ``` *** ## Workflows ### getSummary `workflows.getSummary` Get metrics and trends for a workflow **Risk:** `read` ```ts theme={null} await corsair.circleci.api.workflows.getSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `workflowName` | `string` | Yes | — | | `branch` | `string` | No | — | | `allBranches` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listByPipelineId `workflows.listByPipelineId` List a pipeline's workflows **Risk:** `read` ```ts theme={null} await corsair.circleci.api.workflows.listByPipelineId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pipelineId` | `string` | Yes | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_page_token` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > status?: string | null, > pipeline_id?: string | null, > pipeline_number?: number | null, > project_slug?: string | null, > created_at?: string | null, > stopped_at?: string | null, > started_by?: string | null > }[] > ``` *** ### listJobs `workflows.listJobs` Get summary metrics for a workflow's jobs **Risk:** `read` ```ts theme={null} await corsair.circleci.api.workflows.listJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `workflowName` | `string` | Yes | — | | `reportingWindow` | `string` | No | — | | `branch` | `string` | No | — | | `allBranches` | `boolean` | No | — | | `jobName` | `string` | No | — | | `pageToken` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listTestMetrics `workflows.listTestMetrics` Get test metrics for a workflow **Risk:** `read` ```ts theme={null} await corsair.circleci.api.workflows.listTestMetrics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectSlug` | `string` | Yes | — | | `workflowName` | `string` | Yes | — | | `branch` | `string` | No | — | | `allBranches` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/circleci/database CircleCI local sync: searchable entities, `.search()` filters, and operators. The CircleCI plugin syncs data locally. Use `corsair.circleci.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Contexts Path: `circleci.db.contexts.search` ```ts theme={null} const rows = await corsair.circleci.db.contexts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Groups Path: `circleci.db.groups.search` ```ts theme={null} const rows = await corsair.circleci.db.groups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Orb Allowlist Entries Path: `circleci.db.orbAllowlistEntries.search` ```ts theme={null} const rows = await corsair.circleci.db.orbAllowlistEntries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `prefix` | `string` | equals, contains, startsWith, endsWith, in | | `auth` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pipeline Definitions Path: `circleci.db.pipelineDefinitions.search` ```ts theme={null} const rows = await corsair.circleci.db.pipelineDefinitions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Project Env Vars Path: `circleci.db.projectEnvVars.search` ```ts theme={null} const rows = await corsair.circleci.db.projectEnvVars.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `string` | equals, contains, startsWith, endsWith, in | | `created-at` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `circleci.db.projects.search` ```ts theme={null} const rows = await corsair.circleci.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `organization_name` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_slug` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Schedules Path: `circleci.db.schedules.search` ```ts theme={null} const rows = await corsair.circleci.db.schedules.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `project-slug` | `string` | equals, contains, startsWith, endsWith, in | | `created-at` | `string` | equals, contains, startsWith, endsWith, in | | `updated-at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/circleci/overview Continuous integration and delivery platform for automated testing and deployment pipelines. Use **CircleCI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 65 typed API operations * 7 synced entities (`contexts`, `groups`, `orbAllowlistEntries`, `pipelineDefinitions`, `projectEnvVars`, `projects`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/circleci ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/circleci ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/circleci ``` ```bash bun theme={null} bun add corsair @corsair-dev/circleci ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { circleci } from '@corsair-dev/circleci'; export const corsair = createCorsair({ plugins: [ circleci(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} circleci() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'circleci', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`contexts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.circleci.api.contexts.get({}); ``` **`contexts.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.circleci.api.contexts.create({}); ``` See the full list on the [API](/plugins/circleci/api) page. ## Query synced data Synced entities support `tenant.circleci.db..search()` and `.list()`: `contexts`, `groups`, `orbAllowlistEntries`, `pipelineDefinitions`, `projectEnvVars`, `projects`, `schedules`. See [Database](/plugins/circleci/database) for filters and operators. ## What's next > **[API reference](/plugins/circleci/api)** > > Every `circleci.api.*` operation with input and output types. > **[Database](/plugins/circleci/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Database Source: https://docs.corsair.dev/plugins/claidai/database Claid.ai local sync: searchable entities, `.search()` filters, and operators. The Claid.ai plugin syncs data locally. Use `corsair.claidai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Edited Images Path: `claidai.db.editedImages.search` ```ts theme={null} const rows = await corsair.claidai.db.editedImages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ext` | `string` | equals, contains, startsWith, endsWith, in | | `mps` | `number` | equals, gt, gte, lt, lte, in | | `mime` | `string` | equals, contains, startsWith, endsWith, in | | `format` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `number` | equals, gt, gte, lt, lte, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `tmp_url` | `string` | equals, contains, startsWith, endsWith, in | | `object_key` | `string` | equals, contains, startsWith, endsWith, in | | `object_bucket` | `string` | equals, contains, startsWith, endsWith, in | | `object_uri` | `string` | equals, contains, startsWith, endsWith, in | | `claid_storage_uri` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Generated Images Path: `claidai.db.generatedImages.search` ```ts theme={null} const rows = await corsair.claidai.db.generatedImages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ext` | `string` | equals, contains, startsWith, endsWith, in | | `mps` | `number` | equals, gt, gte, lt, lte, in | | `mime` | `string` | equals, contains, startsWith, endsWith, in | | `format` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `number` | equals, gt, gte, lt, lte, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `tmp_url` | `string` | equals, contains, startsWith, endsWith, in | | `object_key` | `string` | equals, contains, startsWith, endsWith, in | | `object_bucket` | `string` | equals, contains, startsWith, endsWith, in | | `object_uri` | `string` | equals, contains, startsWith, endsWith, in | | `claid_storage_uri` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Image Tasks Path: `claidai.db.imageTasks.search` ```ts theme={null} const rows = await corsair.claidai.db.imageTasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `result_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Storages Path: `claidai.db.storages.search` ```ts theme={null} const rows = await corsair.claidai.db.storages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Storage Types Path: `claidai.db.storageTypes.search` ```ts theme={null} const rows = await corsair.claidai.db.storageTypes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/claidai/overview Claid.ai plugin for Corsair Use **Claid.ai** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 15 typed API operations * 5 synced entities (`editedImages`, `generatedImages`, `imageTasks`, `storages`, `storageTypes`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/claidai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/claidai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/claidai ``` ```bash bun theme={null} bun add corsair @corsair-dev/claidai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { claidai } from '@corsair-dev/claidai'; export const corsair = createCorsair({ plugins: [ claidai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} claidai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'claidai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`storageDetails`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.claidai.api.storageDetails({}); ``` **`backgroundGenerate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.claidai.api.backgroundGenerate({}); ``` See the full list on the [API](/plugins/claidai/api) page. ## Query synced data Synced entities support `tenant.claidai.db..search()` and `.list()`: `editedImages`, `generatedImages`, `imageTasks`, `storages`, `storageTypes`. See [Database](/plugins/claidai/database) for filters and operators. ## What's next > **[API reference](/plugins/claidai/api)** > > Every `claidai.api.*` operation with input and output types. > **[Database](/plugins/claidai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/classmarker/api API reference for Classmarker: every `classmarker.api.*` operation with input and output types. Every `classmarker.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Access Lists ### addCodes `accessLists.addCodes` Add access-list codes for a link exam. **Risk:** `write` ```ts theme={null} await corsair.classmarker.api.accessLists.addCodes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `access_list_id` | `number` | Yes | — | | `access_codes` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `access_lists` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **access\_lists full type** > > ```ts theme={null} > { > access_list: { > access_list_id: number, > access_list_name?: string, > num_codes_added?: number, > num_codes_deleted?: number, > num_codes_total?: number > } > } > ``` *** ### deleteCodes `accessLists.deleteCodes` Delete access-list codes for a link exam. **Risk:** `destructive` ```ts theme={null} await corsair.classmarker.api.accessLists.deleteCodes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `access_list_id` | `number` | Yes | — | | `access_codes` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `access_lists` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **access\_lists full type** > > ```ts theme={null} > { > access_list: { > access_list_id: number, > access_list_name?: string, > num_codes_added?: number, > num_codes_deleted?: number, > num_codes_total?: number > } > } > ``` *** ## Api Keys ### delete `apiKeys.delete` Delete a ClassMarker API key by id. **Risk:** `destructive` ```ts theme={null} await corsair.classmarker.api.apiKeys.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_key_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` *** ## Categories ### create `categories.create` Create a category under a parent category. **Risk:** `write` ```ts theme={null} await corsair.classmarker.api.categories.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_name` | `string` | Yes | — | | `parent_category_id` | `number` | Yes | — | | `verify_only` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status: verified, > request_path?: string, > server_timestamp?: number > } | { > status: ok | no_results | error | verified, > request_path?: string, > server_timestamp?: number, > finished_after_timestamp_used?: number, > num_results_available?: number, > num_results_returned?: number, > more_results_exist?: boolean, > next_finished_after_timestamp?: number, > error?: { > error_code?: string, > error_message?: string, > next_request_after?: number > }, > data?: { > parent_category?: { > parent_category_id: number, > parent_category_name: string, > categories?: { > category_id: number, > category_name: string, > parent_category_id: number > }[] > }, > category?: { > category_id: number, > category_name: string, > parent_category_id: number > } > } > } > ``` *** ### list `categories.list` List parent categories and sub-categories. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.categories.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `data` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **data full type** > > ```ts theme={null} > { > parent_categories: { > parent_category_id: number, > parent_category_name: string, > categories?: { > category_id: number, > category_name: string, > parent_category_id: number > }[] > }[] > } > ``` *** ### update `categories.update` Update a category and optionally re-parent it. **Risk:** `write` ```ts theme={null} await corsair.classmarker.api.categories.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `number` | Yes | — | | `category_name` | `string` | Yes | — | | `parent_category_id` | `number` | Yes | — | | `verify_only` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status: verified, > request_path?: string, > server_timestamp?: number > } | { > status: ok | no_results | error | verified, > request_path?: string, > server_timestamp?: number, > finished_after_timestamp_used?: number, > num_results_available?: number, > num_results_returned?: number, > more_results_exist?: boolean, > next_finished_after_timestamp?: number, > error?: { > error_code?: string, > error_message?: string, > next_request_after?: number > }, > data?: { > parent_category?: { > parent_category_id: number, > parent_category_name: string, > categories?: { > category_id: number, > category_name: string, > parent_category_id: number > }[] > }, > category?: { > category_id: number, > category_name: string, > parent_category_id: number > } > } > } > ``` *** ### updateParent `categories.updateParent` Update a parent category in the question bank. **Risk:** `write` ```ts theme={null} await corsair.classmarker.api.categories.updateParent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent_category_id` | `number` | Yes | — | | `parent_category_name` | `string` | Yes | — | | `verify_only` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status: verified, > request_path?: string, > server_timestamp?: number > } | { > status: ok | no_results | error | verified, > request_path?: string, > server_timestamp?: number, > finished_after_timestamp_used?: number, > num_results_available?: number, > num_results_returned?: number, > more_results_exist?: boolean, > next_finished_after_timestamp?: number, > error?: { > error_code?: string, > error_message?: string, > next_request_after?: number > }, > data?: { > parent_category?: { > parent_category_id: number, > parent_category_name: string, > categories?: { > category_id: number, > category_name: string, > parent_category_id: number > }[] > }, > category?: { > category_id: number, > category_name: string, > parent_category_id: number > } > } > } > ``` *** ## Certificates ### list `certificates.list` List all ClassMarker certificates. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.certificates.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `certificates` | `object[]` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **certificates full type** > > ```ts theme={null} > { > }[] > ``` *** ## Groups ### create `groups.create` Create a new ClassMarker group. **Risk:** `write` ```ts theme={null} await corsair.classmarker.api.groups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` *** ### delete `groups.delete` Delete a ClassMarker group. **Risk:** `destructive` ```ts theme={null} await corsair.classmarker.api.groups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` *** ### get `groups.get` Get details for a specific ClassMarker group. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.groups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `group` | `object` | No | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | > **group full type** > > ```ts theme={null} > { > group_id: number, > group_name: string, > assigned_tests?: { > test: { > test_id: number, > test_name: string > } > }[] > } > ``` *** ## Questions ### create `questions.create` Create a new question in the question bank. **Risk:** `write` ```ts theme={null} await corsair.classmarker.api.questions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `question` | `object` | Yes | — | | `verify_only` | `boolean` | No | — | > **question full type** > > ```ts theme={null} > { > question: string, > question_type: multiplechoice | multipleresponse | truefalse, > category_id: number, > points: string | number, > correct_feedback?: string, > incorrect_feedback?: string, > random_answers?: boolean, > options: { > }, > correct_options: string[], > grade_style?: partial_with_deduction | partial_without_deduction | off > } | { > question: string, > question_type: essay, > category_id: number, > points: string | number, > correct_feedback?: string, > incorrect_feedback?: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status: verified, > request_path?: string, > server_timestamp?: number > } | { > question_id: number, > question: string, > question_type: string, > category_id?: number, > random_answers?: boolean, > points?: string | number, > correct_feedback?: string, > incorrect_feedback?: string, > last_updated_timestamp?: number, > status?: string, > grade_style?: string, > options?: { > }, > correct_options?: string[] > } | { > status: ok | no_results | error | verified, > request_path?: string, > server_timestamp?: number, > finished_after_timestamp_used?: number, > num_results_available?: number, > num_results_returned?: number, > more_results_exist?: boolean, > next_finished_after_timestamp?: number, > error?: { > error_code?: string, > error_message?: string, > next_request_after?: number > }, > question_id?: number > } > ``` *** ### get `questions.get` Get one question from the question bank. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.questions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `question_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > question_id: number, > question: string, > question_type: string, > category_id?: number, > random_answers?: boolean, > points?: string | number, > correct_feedback?: string, > incorrect_feedback?: string, > last_updated_timestamp?: number, > status?: string, > grade_style?: string, > options?: { > }, > correct_options?: string[] > } | { > status: ok | no_results | error | verified, > request_path?: string, > server_timestamp?: number, > finished_after_timestamp_used?: number, > num_results_available?: number, > num_results_returned?: number, > more_results_exist?: boolean, > next_finished_after_timestamp?: number, > error?: { > error_code?: string, > error_message?: string, > next_request_after?: number > }, > question_id?: number > } > ``` *** ### list `questions.list` List question-bank questions (200 per page). **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.questions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `questions` | `object[]` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **questions full type** > > ```ts theme={null} > { > question_id: number, > question: string, > question_type: string, > category_id?: number, > random_answers?: boolean, > points?: string | number, > correct_feedback?: string, > incorrect_feedback?: string, > last_updated_timestamp?: number, > status?: string, > grade_style?: string, > options?: { > }, > correct_options?: string[] > }[] > ``` *** ### update `questions.update` Update an existing question in the question bank. **Risk:** `write` ```ts theme={null} await corsair.classmarker.api.questions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `question_id` | `number` | Yes | — | | `question` | `object` | Yes | — | | `verify_only` | `boolean` | No | — | > **question full type** > > ```ts theme={null} > { > question: string, > question_type: multiplechoice | multipleresponse | truefalse, > category_id: number, > points: string | number, > correct_feedback?: string, > incorrect_feedback?: string, > random_answers?: boolean, > options: { > }, > correct_options: string[], > grade_style?: partial_with_deduction | partial_without_deduction | off > } | { > question: string, > question_type: essay, > category_id: number, > points: string | number, > correct_feedback?: string, > incorrect_feedback?: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status: verified, > request_path?: string, > server_timestamp?: number > } | { > question_id: number, > question: string, > question_type: string, > category_id?: number, > random_answers?: boolean, > points?: string | number, > correct_feedback?: string, > incorrect_feedback?: string, > last_updated_timestamp?: number, > status?: string, > grade_style?: string, > options?: { > }, > correct_options?: string[] > } | { > status: ok | no_results | error | verified, > request_path?: string, > server_timestamp?: number, > finished_after_timestamp_used?: number, > num_results_available?: number, > num_results_returned?: number, > more_results_exist?: boolean, > next_finished_after_timestamp?: number, > error?: { > error_code?: string, > error_message?: string, > next_request_after?: number > }, > question_id?: number > } > ``` *** ## Recent Results ### forAllGroups `recentResults.forAllGroups` Fetch recent results across all groups with timestamp pagination. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.recentResults.forAllGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `finishedAfterTimestamp` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `groups` | `object[]` | No | — | | `tests` | `object[]` | No | — | | `results` | `object[]` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **groups full type** > > ```ts theme={null} > { > group: { > group_id: number, > group_name: string, > assigned_tests?: { > test: { > test_id: number, > test_name: string > } > }[] > } > }[] > ``` > **tests full type** > > ```ts theme={null} > { > test: { > test_id: number, > test_name: string > } > }[] > ``` > **results full type** > > ```ts theme={null} > { > result: { > test_id: number, > percentage: number, > points_scored: number, > points_available: number, > time_started: number, > time_finished: number, > status: string, > duration?: string, > percentage_passmark?: number, > passed?: boolean, > requires_grading?: string, > give_certificate_only_when_passed?: boolean, > certificate_url?: string, > certificate_serial?: string, > view_results_url?: string, > test_type?: string, > monitor_events?: { > browser_monitoring?: string, > camera_monitoring?: string, > total_event_count?: number, > total_seconds_away?: number, > events?: { > timestamp: number, > event: string, > seconds_away: number > }[] > }, > user_id: number, > group_id: number, > first?: string, > last?: string, > email?: string > } > }[] > ``` *** ### forAllLinks `recentResults.forAllLinks` Fetch recent results across all links with timestamp pagination. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.recentResults.forAllLinks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `finishedAfterTimestamp` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `links` | `object[]` | No | — | | `tests` | `object[]` | No | — | | `results` | `object[]` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **links full type** > > ```ts theme={null} > { > link: { > link_id: number, > link_name: string, > link_url_id?: string, > access_list_id?: number, > assigned_tests?: { > test: { > test_id: number, > test_name: string > } > }[] > } > }[] > ``` > **tests full type** > > ```ts theme={null} > { > test: { > test_id: number, > test_name: string > } > }[] > ``` > **results full type** > > ```ts theme={null} > { > result: { > test_id: number, > percentage: number, > points_scored: number, > points_available: number, > time_started: number, > time_finished: number, > status: string, > duration?: string, > percentage_passmark?: number, > passed?: boolean, > requires_grading?: string, > give_certificate_only_when_passed?: boolean, > certificate_url?: string, > certificate_serial?: string, > view_results_url?: string, > test_type?: string, > monitor_events?: { > browser_monitoring?: string, > camera_monitoring?: string, > total_event_count?: number, > total_seconds_away?: number, > events?: { > timestamp: number, > event: string, > seconds_away: number > }[] > }, > link_id: number, > first?: string, > last?: string, > email?: string, > access_code?: string, > extra_info?: string, > extra_info2?: string, > extra_info3?: string, > extra_info4?: string, > extra_info5?: string, > link_result_id?: number, > cm_user_id?: string, > ip_address?: string > } > }[] > ``` *** ### forGroupExam `recentResults.forGroupExam` Fetch recent results for one group/test pair. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.recentResults.forGroupExam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number` | Yes | — | | `test_id` | `number` | Yes | — | | `finishedAfterTimestamp` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `groups` | `object[]` | No | — | | `tests` | `object[]` | No | — | | `results` | `object[]` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **groups full type** > > ```ts theme={null} > { > group: { > group_id: number, > group_name: string, > assigned_tests?: { > test: { > test_id: number, > test_name: string > } > }[] > } > }[] > ``` > **tests full type** > > ```ts theme={null} > { > test: { > test_id: number, > test_name: string > } > }[] > ``` > **results full type** > > ```ts theme={null} > { > result: { > test_id: number, > percentage: number, > points_scored: number, > points_available: number, > time_started: number, > time_finished: number, > status: string, > duration?: string, > percentage_passmark?: number, > passed?: boolean, > requires_grading?: string, > give_certificate_only_when_passed?: boolean, > certificate_url?: string, > certificate_serial?: string, > view_results_url?: string, > test_type?: string, > monitor_events?: { > browser_monitoring?: string, > camera_monitoring?: string, > total_event_count?: number, > total_seconds_away?: number, > events?: { > timestamp: number, > event: string, > seconds_away: number > }[] > }, > user_id: number, > group_id: number, > first?: string, > last?: string, > email?: string > } > }[] > ``` *** ### forLinkExam `recentResults.forLinkExam` Fetch recent results for one link/test pair. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.recentResults.forLinkExam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `link_id` | `number` | Yes | — | | `test_id` | `number` | Yes | — | | `finishedAfterTimestamp` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `links` | `object[]` | No | — | | `tests` | `object[]` | No | — | | `results` | `object[]` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **links full type** > > ```ts theme={null} > { > link: { > link_id: number, > link_name: string, > link_url_id?: string, > access_list_id?: number, > assigned_tests?: { > test: { > test_id: number, > test_name: string > } > }[] > } > }[] > ``` > **tests full type** > > ```ts theme={null} > { > test: { > test_id: number, > test_name: string > } > }[] > ``` > **results full type** > > ```ts theme={null} > { > result: { > test_id: number, > percentage: number, > points_scored: number, > points_available: number, > time_started: number, > time_finished: number, > status: string, > duration?: string, > percentage_passmark?: number, > passed?: boolean, > requires_grading?: string, > give_certificate_only_when_passed?: boolean, > certificate_url?: string, > certificate_serial?: string, > view_results_url?: string, > test_type?: string, > monitor_events?: { > browser_monitoring?: string, > camera_monitoring?: string, > total_event_count?: number, > total_seconds_away?: number, > events?: { > timestamp: number, > event: string, > seconds_away: number > }[] > }, > link_id: number, > first?: string, > last?: string, > email?: string, > access_code?: string, > extra_info?: string, > extra_info2?: string, > extra_info3?: string, > extra_info4?: string, > extra_info5?: string, > link_result_id?: number, > cm_user_id?: string, > ip_address?: string > } > }[] > ``` *** ## Tests ### deleteLink `tests.deleteLink` Delete one link assignment from a test. **Risk:** `destructive` ```ts theme={null} await corsair.classmarker.api.tests.deleteLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `link_id` | `number` | Yes | — | | `test_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` *** ### get `tests.get` Get details for a specific ClassMarker test. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.tests.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `test_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `test` | `object` | No | — | | `assignments` | `object[]` | Yes | — | > **test full type** > > ```ts theme={null} > { > test_id: number, > test_name: string > } > ``` > **assignments full type** > > ```ts theme={null} > { > test: { > test_id: number, > test_name: string > }, > group?: { > group_id: number, > group_name: string, > assigned_tests?: { > test: { > test_id: number, > test_name: string > } > }[] > }, > link?: { > link_id: number, > link_name: string, > link_url_id?: string, > access_list_id?: number, > assigned_tests?: { > test: { > test_id: number, > test_name: string > } > }[] > } > }[] > ``` *** ### list `tests.list` List all tests available to the API key. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.tests.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `tests` | `object[]` | Yes | — | > **tests full type** > > ```ts theme={null} > { > test_id: number, > test_name: string > }[] > ``` *** ## Users ### create `users.create` Create a new ClassMarker user. **Risk:** `write` ```ts theme={null} await corsair.classmarker.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `email` | `string` | Yes | — | | `group_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` *** ### delete `users.delete` Delete an existing ClassMarker user. **Risk:** `destructive` ```ts theme={null} await corsair.classmarker.api.users.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` *** ### get `users.get` Get details for one ClassMarker user. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > user_id?: number, > first_name?: string, > last_name?: string, > email?: string > } | { > status: ok | no_results | error | verified, > request_path?: string, > server_timestamp?: number, > finished_after_timestamp_used?: number, > num_results_available?: number, > num_results_returned?: number, > more_results_exist?: boolean, > next_finished_after_timestamp?: number, > error?: { > error_code?: string, > error_message?: string, > next_request_after?: number > }, > user?: { > user_id?: number, > first_name?: string, > last_name?: string, > email?: string > } > } > ``` *** ### list `users.list` List users in your ClassMarker account. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `users` | `object[]` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **users full type** > > ```ts theme={null} > { > user: { > user_id?: number, > first_name?: string, > last_name?: string, > email?: string > } > }[] > ``` *** ## Utility ### getInitialFinishedAfterTimestamp `utility.getInitialFinishedAfterTimestamp` Compute the initial finishedAfterTimestamp cursor for recent-results pagination. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.utility.getInitialFinishedAfterTimestamp({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `finishedAfterTimestamp` | `number` | Yes | — | *** ## Webhooks ### delete `webhooks.delete` Delete a ClassMarker webhook. **Risk:** `destructive` ```ts theme={null} await corsair.classmarker.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` *** ### list `webhooks.list` List configured ClassMarker webhooks. **Risk:** `read` ```ts theme={null} await corsair.classmarker.api.webhooks.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| no_results \| error \| verified` | Yes | — | | `request_path` | `string` | No | — | | `server_timestamp` | `number` | No | — | | `finished_after_timestamp_used` | `number` | No | — | | `num_results_available` | `number` | No | — | | `num_results_returned` | `number` | No | — | | `more_results_exist` | `boolean` | No | — | | `next_finished_after_timestamp` | `number` | No | — | | `error` | `object` | No | — | | `webhooks` | `object[]` | No | — | > **error full type** > > ```ts theme={null} > { > error_code?: string, > error_message?: string, > next_request_after?: number > } > ``` > **webhooks full type** > > ```ts theme={null} > { > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/classmarker/database Classmarker local sync: searchable entities, `.search()` filters, and operators. The Classmarker plugin syncs data locally. Use `corsair.classmarker.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Results Path: `classmarker.db.results.search` ```ts theme={null} const rows = await corsair.classmarker.db.results.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `external_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/classmarker/overview Classmarker plugin for Corsair Use **Classmarker** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 29 typed API operations * 1 synced entity (`results`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/classmarker ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/classmarker ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/classmarker ``` ```bash bun theme={null} bun add corsair @corsair-dev/classmarker ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { classmarker } from '@corsair-dev/classmarker'; export const corsair = createCorsair({ plugins: [ classmarker(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} classmarker() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'classmarker', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`categories.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.classmarker.api.categories.list({}); ``` **`accessLists.addCodes`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.classmarker.api.accessLists.addCodes({}); ``` See the full list on the [API](/plugins/classmarker/api) page. ## Query synced data Synced entities support `tenant.classmarker.db..search()` and `.list()`: `results`. See [Database](/plugins/classmarker/database) for filters and operators. ## What's next > **[API reference](/plugins/classmarker/api)** > > Every `classmarker.api.*` operation with input and output types. > **[Database](/plugins/classmarker/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/clay/api API reference for Clay: every `clay.api.*` operation with input and output types. Every `clay.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### credits `account.credits` Get the workspace data credit and action balances **Risk:** `read` ```ts theme={null} await corsair.clay.api.account.credits({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `balance` | `number` | Yes | — | | `action_execution_balance` | `number` | No | — | *** ### me `account.me` Get the Clay user and workspace for the API key **Risk:** `read` ```ts theme={null} await corsair.clay.api.account.me({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | | `workspace` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > email?: string | null, > cli_onboarded?: boolean > } > ``` > **workspace full type** > > ```ts theme={null} > { > id: string, > name?: string | null > } > ``` *** ## Routines ### getResults `routines.getResults` Get progress, or the paginated per-item results, of a routine run **Risk:** `read` ```ts theme={null} await corsair.clay.api.routines.getResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `routine_run_id` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > routine_run_id: string, > status: in_progress, > total: number, > finished: number > } | { > routine_run_id: string, > status: string, > total: number, > finished: number, > data: { > id: string, > status: complete | failed, > result?: { > }, > error?: { > message: string > } > }[], > cursor?: string > } > ``` *** ### run `routines.run` Run a Clay-managed or custom function routine on 1-100 items; spends credits and returns a routine\_run\_id **Risk:** `write` ```ts theme={null} await corsair.clay.api.routines.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `routine_id` | `string` | Yes | Routine id, for example function:t\_abc123 | | `items` | `object[]` | Yes | — | | `webhook_id` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > inputs: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `routine_run_id` | `string` | Yes | — | | `status` | `in_progress` | Yes | — | *** ## Search ### create `search.create` Create a people or company search over Clay's GTM database from a Clay search query **Risk:** `write` ```ts theme={null} await corsair.clay.api.search.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | Clay advanced search query; see search.reference | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_id` | `string` | Yes | — | | `source_type` | `people \| companies` | Yes | — | *** ### reference `search.reference` Get the Clay search query language reference used by search.create **Risk:** `read` ```ts theme={null} await corsair.clay.api.search.reference({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `reference` | `string` | Yes | — | *** ### run `search.run` Get the next page of a search's results; each row draws from the workspace search quota **Risk:** `write` ```ts theme={null} await corsair.clay.api.search.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_id` | `string` | Yes | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > source_type: people, > data: { > clay_profile_id: number, > name?: string | null, > first_name?: string | null, > last_name?: string | null, > linkedin_url?: string | null, > location: { > name?: string | null, > city?: string | null, > state_or_province?: string | null > }, > matched_experiences: { > company?: string | null, > title?: string | null, > location?: string | null, > start_date?: string | null, > end_date?: string | null > }[] > }[], > has_more: boolean, > exhaustion_reason?: query_limit | no_more_results, > period_quota?: { > limit: number, > used: number, > remaining: number, > resets_at: string > } > } | { > source_type: companies, > data: { > clay_company_id: number, > name?: string | null, > domain?: string | null, > size?: string | null, > type?: string | null, > country?: string | null, > industry?: string | null, > location?: string | null, > description?: string | null, > linkedin_url?: string | null, > annual_revenue?: string | null, > total_funding_amount_range_usd?: number | null > }[], > has_more: boolean, > exhaustion_reason?: query_limit | no_more_results, > period_quota?: { > limit: number, > used: number, > remaining: number, > resets_at: string > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/clay/database Clay local sync: searchable entities, `.search()` filters, and operators. The Clay plugin syncs data locally. Use `corsair.clay.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Companies Path: `clay.db.companies.search` ```ts theme={null} const rows = await corsair.clay.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `clayCompanyId` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `string` | equals, contains, startsWith, endsWith, in | | `industry` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `linkedinUrl` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## People Path: `clay.db.people.search` ```ts theme={null} const rows = await corsair.clay.db.people.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `clayProfileId` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `linkedinUrl` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `currentTitle` | `string` | equals, contains, startsWith, endsWith, in | | `currentCompany` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Routine Runs Path: `clay.db.routineRuns.search` ```ts theme={null} const rows = await corsair.clay.db.routineRuns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `routineRunId` | `string` | equals, contains, startsWith, endsWith, in | | `routineId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `total` | `number` | equals, gt, gte, lt, lte, in | | `finished` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/clay/overview Clay plugin for Corsair Use **Clay** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 7 typed API operations * 3 synced entities (`companies`, `people`, `routineRuns`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/clay ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/clay ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/clay ``` ```bash bun theme={null} bun add corsair @corsair-dev/clay ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { clay } from '@corsair-dev/clay'; export const corsair = createCorsair({ plugins: [ clay(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} clay() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'clay', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.credits`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clay.api.account.credits({}); ``` **`routines.run`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clay.api.routines.run({}); ``` See the full list on the [API](/plugins/clay/api) page. ## Query synced data Synced entities support `tenant.clay.db..search()` and `.list()`: `companies`, `people`, `routineRuns`. See [Database](/plugins/clay/database) for filters and operators. ## What's next > **[API reference](/plugins/clay/api)** > > Every `clay.api.*` operation with input and output types. > **[Database](/plugins/clay/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/clickhouse/api API reference for ClickHouse: every `clickhouse.api.*` operation with input and output types. Every `clickhouse.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Play ### get `play.get` Fetch the ClickHouse Play web UI HTML (Monaco editor + query UI). **Risk:** `read` ```ts theme={null} await corsair.clickhouse.api.play.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The Play UI URL | | `html` | `string` | Yes | Play UI HTML page (Monaco editor + query UI) | | `sizeBytes` | `number` | Yes | — | *** ## Query ### execute `query.execute` Execute a SQL query against the tenant ClickHouse instance and return the result rows. Arbitrary SQL is accepted — destructive statements require explicit permission. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.clickhouse.api.query.execute({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sql` | `string` | Yes | SQL query to execute against ClickHouse | | `database` | `string` | No | Default database context (sent as ?database=) | | `limit` | `number` | No | Maximum rows to return; appended as LIMIT when not present in SQL | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `object[]` | Yes | JSONEachRow objects; column names map to native JSON values | | `rowCount` | `number` | Yes | — | > **rows full type** > > ```ts theme={null} > { > }[] > ``` *** ### listDatabases `query.listDatabases` List all databases on the tenant ClickHouse instance. **Risk:** `read` ```ts theme={null} await corsair.clickhouse.api.query.listDatabases({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `databases` | `object[]` | Yes | — | > **databases full type** > > ```ts theme={null} > { > name: string, > engine: string > }[] > ``` *** ### listTables `query.listTables` List tables in a ClickHouse database with their engine and approximate size. **Risk:** `read` ```ts theme={null} await corsair.clickhouse.api.query.listTables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `database` | `string` | Yes | Database to list tables from | | `limit` | `number` | No | Maximum tables to return | | `offset` | `number` | No | Tables to skip before returning rows | **Output** | Name | Type | Required | Description | | - | - | - | - | | `database` | `string` | Yes | — | | `tables` | `object[]` | Yes | — | | `count` | `number` | Yes | Number of tables returned | > **tables full type** > > ```ts theme={null} > { > name: string, > engine?: string, > totalRows?: number | string | null, > totalBytes?: number | string | null > }[] > ``` *** ## Schema ### getDatabase `schema.getDatabase` Get schema overview for a ClickHouse database; optionally include column definitions for each table. **Risk:** `read` ```ts theme={null} await corsair.clickhouse.api.schema.getDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `database` | `string` | Yes | Database to introspect | | `includeColumns` | `boolean` | No | When true, also fetch column definitions for each table | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `database` | `string` | Yes | — | | `tables` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **tables full type** > > ```ts theme={null} > { > name: string, > engine?: string, > totalRows?: number | string | null, > totalBytes?: number | string | null, > columns?: { > name: string, > type: string, > position?: number | string | null, > comment?: string, > defaultExpression?: string > }[] > }[] > ``` *** ### getTable `schema.getTable` Get column-level schema for a ClickHouse table, optionally with sample rows. **Risk:** `read` ```ts theme={null} await corsair.clickhouse.api.schema.getTable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `database` | `string` | Yes | Database the table belongs to | | `table` | `string` | Yes | Table to introspect | | `includeSample` | `boolean` | No | When true, include up to `sampleSize` rows from the table | | `sampleSize` | `number` | No | Sample row count when includeSample is true; defaults to 5 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `database` | `string` | Yes | — | | `table` | `string` | Yes | — | | `engine` | `string` | No | — | | `totalRows` | `number \| string` | No | — | | `columns` | `object[]` | Yes | — | | `sampleRows` | `object[]` | No | Sample rows; only present when includeSample is true | > **columns full type** > > ```ts theme={null} > { > name: string, > type: string, > position?: number | string | null, > comment?: string, > defaultExpression?: string > }[] > ``` > **sampleRows full type** > > ```ts theme={null} > { > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/clickhouse/database ClickHouse local sync: searchable entities, `.search()` filters, and operators. The ClickHouse plugin syncs data locally. Use `corsair.clickhouse.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Column Path: `clickhouse.db.column.search` ```ts theme={null} const rows = await corsair.clickhouse.db.column.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `database` | `string` | equals, contains, startsWith, endsWith, in | | `table` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | | `default_kind` | `string` | equals, contains, startsWith, endsWith, in | | `default_expression` | `string` | equals, contains, startsWith, endsWith, in | | `defaultExpression` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Database Path: `clickhouse.db.database.search` ```ts theme={null} const rows = await corsair.clickhouse.db.database.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `engine` | `string` | equals, contains, startsWith, endsWith, in | | `data_path` | `string` | equals, contains, startsWith, endsWith, in | | `metadata_path` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `engine_full` | `string` | equals, contains, startsWith, endsWith, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Query Result Path: `clickhouse.db.queryResult.search` ```ts theme={null} const rows = await corsair.clickhouse.db.queryResult.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Table Path: `clickhouse.db.table.search` ```ts theme={null} const rows = await corsair.clickhouse.db.table.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `database` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `engine` | `string` | equals, contains, startsWith, endsWith, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/clickhouse/overview Columnar analytics database for fast OLAP queries on large-scale event and log data. Use **ClickHouse** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 6 typed API operations * 4 synced entities (`column`, `database`, `queryResult`, `table`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/clickhouse ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/clickhouse ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/clickhouse ``` ```bash bun theme={null} bun add corsair @corsair-dev/clickhouse ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { clickhouse } from '@corsair-dev/clickhouse'; export const corsair = createCorsair({ plugins: [ clickhouse(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} clickhouse() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'clickhouse', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`play.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clickhouse.api.play.get({}); ``` **`query.execute`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clickhouse.api.query.execute({}); ``` See the full list on the [API](/plugins/clickhouse/api) page. ## Query synced data Synced entities support `tenant.clickhouse.db..search()` and `.list()`: `column`, `database`, `queryResult`, `table`. See [Database](/plugins/clickhouse/database) for filters and operators. ## What's next > **[API reference](/plugins/clickhouse/api)** > > Every `clickhouse.api.*` operation with input and output types. > **[Database](/plugins/clickhouse/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/clickmeeting/api API reference for ClickMeeting: every `clickmeeting.api.*` operation with input and output types. Every `clickmeeting.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chats ### getChatDetails `chats.getChatDetails` Retrieve details of a specific chat session **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.chats.getChatDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chatId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > id?: string | number, > author?: string, > text?: string, > created_at?: string > }[] > ``` *** ### getChats `chats.getChats` Retrieve a list of all chat sessions **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.chats.getChats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > conference_id?: string | number, > created_at?: string > }[] > ``` *** ## Conferences ### createConference `conferences.createConference` Create a new ClickMeeting conference or webinar **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.conferences.createConference({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Conference room name | | `room_type` | `meeting \| webinar` | No | — | | `permanent_room` | `boolean` | No | — | | `access_type` | `number` | No | 1: open, 2: password, 3: token | | `password` | `string` | No | Required when access\_type is 2 (password-protected) | | `starts_at` | `string` | No | Scheduled start date/time (YYYY-MM-DD HH:MM:SS) | | `duration` | `string` | No | Duration in H:MM format, e.g. 1:20 | | `timezone` | `string` | No | — | | `lobby_description` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `room` | `object` | No | — | > **room full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > room_type?: string, > status?: string, > room_url?: string, > permanent_room?: number | boolean, > access_type?: number, > starts_at?: string, > duration?: number | string, > timezone?: string, > lobby_description?: string, > description?: string > } > ``` *** ### deleteConference `conferences.deleteConference` Delete a specific conference room **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.conferences.deleteConference({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `message` | `string` | No | — | *** ### generateAutologinUrl `conferences.generateAutologinUrl` Generate an autologin hash for a conference participant **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.conferences.generateAutologinUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `email` | `string` | Yes | — | | `nickname` | `string` | Yes | — | | `role` | `listener \| presenter \| moderator \| guest_speaker \| host` | No | — | | `password` | `string` | No | Required when room is password-protected | | `token` | `string` | No | Required when room is token-protected | **Output** | Name | Type | Required | Description | | - | - | - | - | | `autologin_hash` | `string` | No | — | | `url` | `string` | No | — | *** ### getConferenceDetails `conferences.getConferenceDetails` Retrieve detailed information about a specific conference room **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.conferences.getConferenceDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | Conference / Room ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `conference` | `object` | No | — | > **conference full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > room_type?: string, > status?: string, > room_url?: string, > permanent_room?: number | boolean, > access_type?: number, > starts_at?: string, > duration?: number | string, > timezone?: string, > lobby_description?: string, > description?: string > } > ``` *** ### getConferenceFiles `conferences.getConferenceFiles` Retrieve list of files uploaded to a specific conference room **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.conferences.getConferenceFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > size?: string | number > }[] > ``` *** ### getConferences `conferences.getConferences` Retrieve a list of conference rooms filtered by status **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.conferences.getConferences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `active \| inactive` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > room_type?: string, > status?: string, > room_url?: string, > permanent_room?: number | boolean, > access_type?: number, > starts_at?: string, > duration?: number | string, > timezone?: string, > lobby_description?: string, > description?: string > }[] > ``` *** ### getConferenceSkins `conferences.getConferenceSkins` Retrieve list of available conference room skins **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.conferences.getConferenceSkins({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > name?: string > }[] > ``` *** ### sendInvitation `conferences.sendInvitation` Send invitation emails to participants for a conference **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.conferences.sendInvitation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `lang` | `string` | Yes | Language code for the invitation email (e.g. en, pl) | | `attendees` | `string[]` | Yes | List of attendee email addresses | | `role` | `listener \| presenter` | No | — | | `template` | `advanced \| basic` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `queued` | `number` | No | — | | `failed` | `number` | No | — | *** ### updateConference `conferences.updateConference` Update an existing conference room parameters **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.conferences.updateConference({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `room_type` | `meeting \| webinar` | No | — | | `permanent_room` | `boolean` | No | — | | `access_type` | `number` | No | — | | `password` | `string` | No | Required when access\_type is 2 | | `starts_at` | `string` | No | — | | `duration` | `string` | No | Duration in H:MM format, e.g. 1:20 | | `timezone` | `string` | No | — | | `lobby_description` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `room_type` | `string` | No | — | | `status` | `string` | No | — | | `room_url` | `string` | No | — | | `permanent_room` | `number \| boolean` | No | — | | `access_type` | `number` | No | — | | `starts_at` | `string` | No | — | | `duration` | `number \| string` | No | — | | `timezone` | `string` | No | — | | `lobby_description` | `string` | No | — | | `description` | `string` | No | — | *** ## Files ### deleteFile `files.deleteFile` Delete a file from the ClickMeeting file library **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.files.deleteFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `message` | `string` | No | — | *** ### downloadFile `files.downloadFile` Download file content from the ClickMeeting file library **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.files.downloadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | No | — | | `download_url` | `string` | No | — | *** ### getFileDetails `files.getFileDetails` Retrieve detailed information about a specific file **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.files.getFileDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `size` | `string \| number` | No | — | | `created_at` | `string` | No | — | | `download_url` | `string` | No | — | *** ### getFileLibrary `files.getFileLibrary` Retrieve a list of files from ClickMeeting file library **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.files.getFileLibrary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > size?: string | number, > created_at?: string, > download_url?: string > }[] > ``` *** ### uploadFile `files.uploadFile` Upload a file to the ClickMeeting file library **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.files.uploadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | File name | | `content` | `string` | Yes | File content (base64-encoded string, or raw string when encoding is "raw") | | `encoding` | `base64 \| raw` | No | Content encoding discriminator ("base64" or "raw", defaults to "base64") | | `conference_id` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | *** ## Recordings ### deleteRecording `recordings.deleteRecording` Delete a specific recording from a conference room **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.recordings.deleteRecording({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `recordingId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `message` | `string` | No | — | *** ### deleteRecordings `recordings.deleteRecordings` Delete all recordings for a conference room **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.recordings.deleteRecordings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `deleted_count` | `number` | No | — | *** ### getSessionRecordings `recordings.getSessionRecordings` Retrieve all recordings for a conference room **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.recordings.getSessionRecordings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > duration?: number, > recording_url?: string, > created_at?: string > }[] > ``` *** ## Registrations ### createContact `registrations.createContact` Create a new contact in your ClickMeeting account **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.registrations.createContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `phone` | `string` | No | — | | `country` | `string` | No | — | | `city` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `email` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `phone` | `string` | No | — | | `status` | `string` | No | — | *** ### getRegistrations `registrations.getRegistrations` Retrieve registrations for a conference room by status **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.registrations.getRegistrations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `status` | `all \| waiting \| confirmed \| rejected` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > first_name?: string, > last_name?: string, > email?: string, > status?: string, > registered_at?: string > }[] > ``` *** ### listRegistrationsByStatus `registrations.listRegistrationsByStatus` Retrieve registered participants filtered by status **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.registrations.listRegistrationsByStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `status` | `all \| waiting \| confirmed \| rejected` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > first_name?: string, > last_name?: string, > email?: string, > status?: string, > registered_at?: string > }[] > ``` *** ### registerParticipant `registrations.registerParticipant` Register a participant for a conference room **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.registrations.registerParticipant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `registration` | `object` | Yes | Participant registration fields (e.g. first\_name, last\_name, email) | > **registration full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `registration_hash` | `string` | No | — | | `status` | `string` | No | — | | `message` | `string` | No | — | *** ## Sessions ### generateSessionPdfReport `sessions.generateSessionPdfReport` Generate a PDF report containing analytics for a session **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.sessions.generateSessionPdfReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `sessionId` | `string \| number` | Yes | — | | `lang` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `report_url` | `string` | No | — | | `message` | `string` | No | — | *** ### getConferenceSessions `sessions.getConferenceSessions` Retrieve past sessions for a conference room **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.sessions.getConferenceSessions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > starts_at?: string, > duration?: number | string, > attendees_count?: number > }[] > ``` *** ### getSessionAttendees `sessions.getSessionAttendees` Retrieve list of attendees who participated in a session **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.sessions.getSessionAttendees({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `sessionId` | `string \| number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > nickname?: string, > email?: string, > role?: string, > duration?: number > }[] > ``` *** ### getSessionDetails `sessions.getSessionDetails` Retrieve detailed statistics for a specific past conference session **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.sessions.getSessionDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `sessionId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `starts_at` | `string` | No | — | | `duration` | `number \| string` | No | — | | `attendees_count` | `number` | No | — | *** ### getSessionRegistrations `sessions.getSessionRegistrations` Retrieve registrations for a specific session **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.sessions.getSessionRegistrations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `sessionId` | `string \| number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | number, > first_name?: string, > last_name?: string, > email?: string, > status?: string, > registered_at?: string > }[] > ``` *** ## Tokens ### createAccessTokens `tokens.createAccessTokens` Generate access tokens for conference participants **Risk:** `write` ```ts theme={null} await corsair.clickmeeting.api.tokens.createAccessTokens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `how_many` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `access_tokens` | `object[]` | No | — | > **access\_tokens full type** > > ```ts theme={null} > { > token?: string, > email?: string, > sent_to_email?: string | null, > first_use_date?: string | null, > status?: string > }[] > ``` *** ### getTokenByEmail `tokens.getTokenByEmail` Retrieve access tokens assigned to a specific email address **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.tokens.getTokenByEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `access_tokens` | `object[]` | No | — | > **access\_tokens full type** > > ```ts theme={null} > { > token?: string, > email?: string, > sent_to_email?: string | null, > first_use_date?: string | null, > status?: string > }[] > ``` *** ### listAccessTokens `tokens.listAccessTokens` Retrieve all generated access tokens for a conference **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.tokens.listAccessTokens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roomId` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `access_tokens` | `object[]` | No | — | > **access\_tokens full type** > > ```ts theme={null} > { > token?: string, > email?: string, > sent_to_email?: string | null, > first_use_date?: string | null, > status?: string > }[] > ``` *** ## Utility ### getPhoneGateways `utility.getPhoneGateways` Retrieve available phone dial-in numbers for ClickMeeting webinars **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.utility.getPhoneGateways({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > country?: string, > country_name?: string, > phone?: string > }[] > ``` *** ### getPing `utility.getPing` Check ClickMeeting API service status **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.utility.getPing({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `ping` | `string` | No | — | | `status` | `string` | No | — | *** ### getTimeZoneList `utility.getTimeZoneList` Retrieve all available time zones supported by ClickMeeting **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.utility.getTimeZoneList({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > string[] | { > } > ``` *** ### getTimeZoneListByCountry `utility.getTimeZoneListByCountry` Retrieve available time zones for a specific country **Risk:** `read` ```ts theme={null} await corsair.clickmeeting.api.utility.getTimeZoneListByCountry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | ISO 3166-1 alpha-2 country code (e.g. US) | **Output:** `object` > **Output full type** > > ```ts theme={null} > string[] | { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/clickmeeting/database ClickMeeting local sync: searchable entities, `.search()` filters, and operators. The ClickMeeting plugin syncs data locally. Use `corsair.clickmeeting.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Conferences Path: `clickmeeting.db.conferences.search` ```ts theme={null} const rows = await corsair.clickmeeting.db.conferences.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `room_url` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `clickmeeting.db.contacts.search` ```ts theme={null} const rows = await corsair.clickmeeting.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/clickmeeting/overview Video conferencing and webinar platform integration for hosting, attendee management, and session recording. Use **ClickMeeting** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 35 typed API operations * 2 synced entities (`conferences`, `contacts`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/clickmeeting ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/clickmeeting ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/clickmeeting ``` ```bash bun theme={null} bun add corsair @corsair-dev/clickmeeting ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { clickmeeting } from '@corsair-dev/clickmeeting'; export const corsair = createCorsair({ plugins: [ clickmeeting(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} clickmeeting() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'clickmeeting', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`chats.getChatDetails`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clickmeeting.api.chats.getChatDetails({}); ``` **`conferences.createConference`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clickmeeting.api.conferences.createConference({}); ``` See the full list on the [API](/plugins/clickmeeting/api) page. ## Query synced data Synced entities support `tenant.clickmeeting.db..search()` and `.list()`: `conferences`, `contacts`. See [Database](/plugins/clickmeeting/database) for filters and operators. ## What's next > **[API reference](/plugins/clickmeeting/api)** > > Every `clickmeeting.api.*` operation with input and output types. > **[Database](/plugins/clickmeeting/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/clicksend/api API reference for ClickSend: every `clicksend.api.*` operation with input and output types. Every `clicksend.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Retrieve ClickSend account details and credit balance **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number \| string` | Yes | — | | `username` | `string` | Yes | — | | `user_email` | `string` | Yes | — | | `user_first_name` | `string` | No | — | | `user_last_name` | `string` | No | — | | `balance` | `number` | Yes | — | | `currency` | `string` | No | — | *** ### update `account.update` Update ClickSend account profile fields **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.account.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_email` | `string` | No | — | | `user_first_name` | `string` | No | — | | `user_last_name` | `string` | No | — | | `user_phone` | `string` | No | — | | `account_name` | `string` | No | — | | `country` | `string` | No | — | | `timezone` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number \| string` | No | — | | `username` | `string` | No | — | | `user_email` | `string` | No | — | | `user_first_name` | `string` | No | — | | `user_last_name` | `string` | No | — | | `balance` | `number` | No | — | | `currency` | `string` | No | — | *** ## Campaigns ### mms.cancel `campaigns.mms.cancel` Cancel a scheduled MMS campaign **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.campaigns.mms.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mms_campaign_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > mms_campaign_id?: number, > name?: string, > user_id?: number, > subaccount_id?: number, > list_id?: number, > from?: string, > subject?: string, > file_name?: string, > body?: string, > schedule?: number, > status?: string, > date_added?: number, > _total_count?: number, > _list_name?: string, > _media_file_url?: string > } | never[] | { > } | boolean | null > ``` *** ### mms.list `campaigns.mms.list` List MMS campaigns **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.campaigns.mms.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > mms_campaign_id?: number, > name?: string, > user_id?: number, > subaccount_id?: number, > list_id?: number, > from?: string, > subject?: string, > file_name?: string, > body?: string, > schedule?: number, > status?: string, > date_added?: number, > _total_count?: number, > _list_name?: string, > _media_file_url?: string > }[] > ``` *** ### mms.price `campaigns.mms.price` Calculate the price of an MMS campaign **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.campaigns.mms.price({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `body` | `string` | Yes | — | | `from` | `string` | Yes | — | | `subject` | `string` | Yes | — | | `media_file` | `string` | Yes | — | | `schedule` | `number` | No | — | | `url_to_shorten` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_count` | `number` | No | — | | `queued_count` | `number` | No | — | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` *** ### mms.send `campaigns.mms.send` Create and send an MMS campaign to a contact list **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.campaigns.mms.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `body` | `string` | Yes | — | | `from` | `string` | Yes | — | | `subject` | `string` | Yes | — | | `media_file` | `string` | Yes | — | | `schedule` | `number` | No | — | | `url_to_shorten` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_count` | `number` | No | — | | `queued_count` | `number` | No | — | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` *** ### mms.update `campaigns.mms.update` Update a scheduled MMS campaign **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.campaigns.mms.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mms_campaign_id` | `number` | Yes | — | | `list_id` | `number` | No | — | | `name` | `string` | No | — | | `from` | `string` | No | — | | `body` | `string` | No | — | | `subject` | `string` | No | — | | `media_file` | `string` | No | — | | `schedule` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `mms_campaign_id` | `number` | No | — | | `name` | `string` | No | — | | `user_id` | `number` | No | — | | `subaccount_id` | `number` | No | — | | `list_id` | `number` | No | — | | `from` | `string` | No | — | | `subject` | `string` | No | — | | `file_name` | `string` | No | — | | `body` | `string` | No | — | | `schedule` | `number` | No | — | | `status` | `string` | No | — | | `date_added` | `number` | No | — | | `_total_count` | `number` | No | — | | `_list_name` | `string` | No | — | | `_media_file_url` | `string` | No | — | *** ### sms.cancel `campaigns.sms.cancel` Cancel a scheduled SMS campaign **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.campaigns.sms.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sms_campaign_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > sms_campaign_id?: number, > name?: string, > user_id?: number, > subaccount_id?: number, > list_id?: number, > from?: string, > body?: string, > schedule?: number, > status?: string, > date_added?: number, > custom_string?: string, > url_to_shorten?: string, > _total_count?: number, > _list_name?: string > } | never[] | { > } | boolean | null > ``` *** ### sms.get `campaigns.sms.get` Retrieve a single SMS campaign by ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.campaigns.sms.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sms_campaign_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sms_campaign_id` | `number` | No | — | | `name` | `string` | No | — | | `user_id` | `number` | No | — | | `subaccount_id` | `number` | No | — | | `list_id` | `number` | No | — | | `from` | `string` | No | — | | `body` | `string` | No | — | | `schedule` | `number` | No | — | | `status` | `string` | No | — | | `date_added` | `number` | No | — | | `custom_string` | `string` | No | — | | `url_to_shorten` | `string` | No | — | | `_total_count` | `number` | No | — | | `_list_name` | `string` | No | — | *** ### sms.list `campaigns.sms.list` List SMS campaigns with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.campaigns.sms.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `q` | `string` | No | — | | `order_by` | `string` | No | — | | `date_from` | `number` | No | — | | `date_to` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > sms_campaign_id?: number, > name?: string, > user_id?: number, > subaccount_id?: number, > list_id?: number, > from?: string, > body?: string, > schedule?: number, > status?: string, > date_added?: number, > custom_string?: string, > url_to_shorten?: string, > _total_count?: number, > _list_name?: string > }[] > ``` *** ### sms.price `campaigns.sms.price` Calculate the price of an SMS campaign **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.campaigns.sms.price({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `body` | `string` | Yes | — | | `from` | `string` | Yes | — | | `schedule` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_count` | `number` | No | — | | `queued_count` | `number` | No | — | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` *** ### sms.send `campaigns.sms.send` Create and send an SMS campaign to a contact list **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.campaigns.sms.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `body` | `string` | Yes | — | | `from` | `string` | Yes | — | | `senders` | `object[]` | Yes | — | | `source` | `string` | No | — | | `schedule` | `number` | No | — | | `url_to_shorten` | `string` | No | — | > **senders full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_count` | `number` | No | — | | `queued_count` | `number` | No | — | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` *** ### sms.update `campaigns.sms.update` Update a scheduled SMS campaign **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.campaigns.sms.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sms_campaign_id` | `number` | Yes | — | | `list_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `body` | `string` | Yes | — | | `from` | `string` | Yes | — | | `schedule` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sms_campaign_id` | `number` | No | — | | `name` | `string` | No | — | | `user_id` | `number` | No | — | | `subaccount_id` | `number` | No | — | | `list_id` | `number` | No | — | | `from` | `string` | No | — | | `body` | `string` | No | — | | `schedule` | `number` | No | — | | `status` | `string` | No | — | | `date_added` | `number` | No | — | | `custom_string` | `string` | No | — | | `url_to_shorten` | `string` | No | — | | `_total_count` | `number` | No | — | | `_list_name` | `string` | No | — | *** ## Contact Lists ### create `contactLists.create` Create a new contact list **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contactLists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_name` | `string` | Yes | Name for the contact list | **Output** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `list_name` | `string` | Yes | — | | `contact_count` | `number` | No | — | *** ### delete `contactLists.delete` Delete a contact list by ID **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contactLists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `contactLists.get` Retrieve a single contact list by ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.contactLists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | No | — | | `list_name` | `string` | No | — | | `contact_count` | `number` | No | — | *** ### getAll `contactLists.getAll` Retrieve all contact lists with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.contactLists.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `current_page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > list_id: number, > list_name: string, > contact_count?: number > }[] > ``` *** ### update `contactLists.update` Rename a contact list by ID **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contactLists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `list_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | No | — | | `list_name` | `string` | No | — | | `contact_count` | `number` | No | — | *** ## Contacts ### copy `contacts.copy` Copy a contact from one list to another **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contacts.copy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_list_id` | `number` | Yes | — | | `contact_id` | `number` | Yes | — | | `to_list_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `number` | No | — | | `list_id` | `number` | No | — | | `phone_number` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `custom_1` | `string` | No | — | | `custom_2` | `string` | No | — | | `custom_3` | `string` | No | — | | `custom_4` | `string` | No | — | | `date_added` | `string` | No | — | | `date_updated` | `string` | No | — | | `fax_number` | `string` | No | — | | `organization_name` | `string` | No | — | | `email` | `string` | No | — | | `address_line_1` | `string` | No | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | No | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | No | — | | `address_country` | `string` | No | — | *** ### create `contacts.create` Add a new contact to a specific list **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | Target contact list ID | | `phone_number` | `string` | Yes | Phone number of the contact | | `first_name` | `string` | No | First name | | `last_name` | `string` | No | Last name | | `email` | `string` | No | Email address | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `number` | Yes | — | | `list_id` | `number` | Yes | — | | `phone_number` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | *** ### delete `contacts.delete` Delete a contact from a list **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `contact_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `contacts.get` Retrieve a single contact from a list **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `contact_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `number` | No | — | | `list_id` | `number` | No | — | | `phone_number` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `custom_1` | `string` | No | — | | `custom_2` | `string` | No | — | | `custom_3` | `string` | No | — | | `custom_4` | `string` | No | — | | `date_added` | `string` | No | — | | `date_updated` | `string` | No | — | | `fax_number` | `string` | No | — | | `organization_name` | `string` | No | — | | `email` | `string` | No | — | | `address_line_1` | `string` | No | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | No | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | No | — | | `address_country` | `string` | No | — | *** ### import `contacts.import` Bulk-import contacts into a list from a file URL **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contacts.import({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `file_url` | `string` | Yes | — | | `field_order` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `msg` | `string` | No | — | | `ids` | `string[]` | No | — | | `id` | `string \| number` | No | — | *** ### importFields `contacts.importFields` List valid import field mappings for a list **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.contacts.importFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > field: string, > label: string > }[] > ``` *** ### importPreview `contacts.importPreview` Preview the first row of a CSV import file **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contacts.importPreview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `file_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `row` | `string[]` | No | — | *** ### list `contacts.list` List contacts within a specific contact list **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | List ID to fetch contacts from | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `current_page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > contact_id: number, > list_id: number, > phone_number: string, > first_name?: string, > last_name?: string, > email?: string > }[] > ``` *** ### removeOptedOut `contacts.removeOptedOut` Remove opted-out contacts from a list **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contacts.removeOptedOut({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `opt_out_list_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `number` | No | — | *** ### search `contacts.search` Search contact lists and contacts by keyword **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.contacts.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > contact?: string, > contacts_count?: number, > id?: number | string, > name?: string, > type?: string > }[] > ``` *** ### suggestions `contacts.suggestions` List suggested contacts across lists **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.contacts.suggestions({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > contact_id?: number, > list_id?: number, > phone_number?: string, > first_name?: string, > last_name?: string, > custom_1?: string, > custom_2?: string, > custom_3?: string, > custom_4?: string, > date_added?: string, > date_updated?: string, > fax_number?: string, > organization_name?: string, > email?: string, > address_line_1?: string, > address_line_2?: string, > address_city?: string, > address_state?: string, > address_postal_code?: string, > address_country?: string, > _list_name?: string > }[] > ``` *** ### transfer `contacts.transfer` Move a contact from one list to another **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contacts.transfer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_list_id` | `number` | Yes | — | | `contact_id` | `number` | Yes | — | | `to_list_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `number` | No | — | | `list_id` | `number` | No | — | | `phone_number` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `custom_1` | `string` | No | — | | `custom_2` | `string` | No | — | | `custom_3` | `string` | No | — | | `custom_4` | `string` | No | — | | `date_added` | `string` | No | — | | `date_updated` | `string` | No | — | | `fax_number` | `string` | No | — | | `organization_name` | `string` | No | — | | `email` | `string` | No | — | | `address_line_1` | `string` | No | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | No | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | No | — | | `address_country` | `string` | No | — | *** ### update `contacts.update` Update contact fields within a list **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `contact_id` | `number` | Yes | — | | `phone_number` | `string` | No | — | | `email` | `string` | No | — | | `fax_number` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `organization_name` | `string` | No | — | | `address_line_1` | `string` | No | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | No | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | No | — | | `address_country` | `string` | No | — | | `custom_1` | `string` | No | — | | `custom_2` | `string` | No | — | | `custom_3` | `string` | No | — | | `custom_4` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `number` | No | — | | `list_id` | `number` | No | — | | `phone_number` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `custom_1` | `string` | No | — | | `custom_2` | `string` | No | — | | `custom_3` | `string` | No | — | | `custom_4` | `string` | No | — | | `date_added` | `string` | No | — | | `date_updated` | `string` | No | — | | `fax_number` | `string` | No | — | | `organization_name` | `string` | No | — | | `email` | `string` | No | — | | `address_line_1` | `string` | No | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | No | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | No | — | | `address_country` | `string` | No | — | *** ## Countries ### globalList `countries.globalList` List global sending destination countries **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.countries.globalList({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: number, > name?: string, > code?: string, > region?: string > }[] > ``` *** ### list `countries.list` List supported countries as code/value pairs **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.countries.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > code: string, > value: string > }[] > ``` *** ### pricing `countries.pricing` Retrieve per-country pricing for a currency **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.countries.pricing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `currency` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | | `_currency` | `object` | No | — | > **\_currency full type** > > ```ts theme={null} > { > } > ``` *** ### userCountriesAgree `countries.userCountriesAgree` Agree to sending-country compliance rules **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.countries.userCountriesAgree({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### userCountriesGet `countries.userCountriesGet` List enabled global-sending countries **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.countries.userCountriesGet({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### userCountriesSelect `countries.userCountriesSelect` Select enabled global-sending countries **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.countries.userCountriesSelect({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_list_ids` | `number[]` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ## Delivery Issues ### create `deliveryIssues.create` Report a message delivery issue **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.deliveryIssues.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | No | — | | `type` | `string` | Yes | — | | `description` | `string` | Yes | — | | `email_address` | `string` | Yes | — | | `client_comments` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `issue_id` | `number \| string` | No | — | | `user_id` | `number \| string` | No | — | | `message_id` | `string` | No | — | | `type` | `string` | No | — | | `description` | `string` | No | — | | `date_added` | `string` | No | — | | `email_address` | `string` | No | — | *** ### list `deliveryIssues.list` List delivery issues with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.deliveryIssues.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > issue_id?: number | string, > user_id?: number | string, > message_id?: string, > type?: string, > description?: string, > status?: string, > date_added?: string, > resolved?: number | string | boolean, > email_address?: string > }[] > ``` *** ## Email Addresses ### create `emailAddresses.create` Register a new allowed sender email address **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailAddresses.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_address` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email_address_id` | `number` | No | — | | `email_address` | `string` | No | — | | `verified` | `boolean \| number` | No | — | | `date_added` | `string` | No | — | *** ### delete `emailAddresses.delete` Delete an allowed email address by ID **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailAddresses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_address_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `emailAddresses.get` Retrieve a single allowed email address by ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailAddresses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_address_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email_address_id` | `number` | No | — | | `email_address` | `string` | No | — | | `verified` | `boolean \| number` | No | — | | `date_added` | `string` | No | — | *** ### list `emailAddresses.list` List allowed sender email addresses **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailAddresses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > email_address_id?: number, > email_address?: string, > verified?: boolean | number, > date_added?: string > }[] > ``` *** ### sendToken `emailAddresses.sendToken` Send a verification token to an allowed email address **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailAddresses.sendToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_address_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### verify `emailAddresses.verify` Verify an allowed email address with its activation token **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailAddresses.verify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_address_id` | `number` | Yes | — | | `activation_token` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email_address_id` | `number` | No | — | | `email_address` | `string` | No | — | | `verified` | `boolean \| number` | No | — | | `date_added` | `string` | No | — | *** ## Email Campaigns ### get `emailCampaigns.get` Retrieve a single email campaign by ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailCampaigns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_campaign_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email_campaign_id` | `number` | No | — | | `name` | `string` | No | — | | `user_id` | `number` | No | — | | `subaccount_id` | `number` | No | — | | `subject` | `string` | No | — | | `list_id` | `number` | No | — | | `from_email_address_id` | `number` | No | — | | `from_name` | `string` | No | — | | `template_id` | `number` | No | — | | `schedule` | `number \| string` | No | — | | `status` | `string` | No | — | | `date_added` | `string` | No | — | | `custom_string` | `string` | No | — | | `send_count` | `number` | No | — | *** ## Email Master Categories ### get `emailMasterCategories.get` Retrieve a single master template category by ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailMasterCategories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `number` | No | — | | `name` | `string` | No | — | *** ### list `emailMasterCategories.list` List master email template categories **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailMasterCategories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > category_id?: number, > category_name?: string > }[] > ``` *** ## Email Master Templates ### get `emailMasterTemplates.get` Retrieve a single master email template by ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailMasterTemplates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template_id_master` | `number` | No | — | | `template_name` | `string` | No | — | | `date_added` | `string` | No | — | | `body` | `string` | No | — | | `category_id` | `number` | No | — | | `thumbnail` | `object` | No | — | > **thumbnail full type** > > ```ts theme={null} > { > small?: string, > large?: string > } > ``` *** ### list `emailMasterTemplates.list` List ClickSend master email templates **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailMasterTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > template_id_master?: number, > template_name?: string, > date_added?: string, > body?: string, > category_id?: number, > thumbnail?: { > small?: string, > large?: string > } > }[] > ``` *** ### listInCategory `emailMasterTemplates.listInCategory` List master email templates within a category **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailMasterTemplates.listInCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `number` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > template_id_master?: number, > template_name?: string, > date_added?: string, > body?: string, > category_id?: number, > thumbnail?: { > small?: string, > large?: string > } > }[] > ``` *** ## Email Receipt Rules ### create `emailReceiptRules.create` Create an email delivery receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailReceiptRules.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rule_name` | `string` | Yes | — | | `match_type` | `number` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### delete `emailReceiptRules.delete` Delete an email delivery receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailReceiptRules.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `emailReceiptRules.get` Retrieve a single email receipt automation rule **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailReceiptRules.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### list `emailReceiptRules.list` List email delivery receipt automation rules **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailReceiptRules.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > receipt_rule_id?: number, > rule_name?: string, > match_type?: number, > action?: string, > action_address?: string, > enabled?: number > }[] > ``` *** ### update `emailReceiptRules.update` Update an email delivery receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailReceiptRules.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | | `rule_name` | `string` | Yes | — | | `match_type` | `number` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ## Email Templates ### create `emailTemplates.create` Create a user email template from a master template **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailTemplates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id_master` | `number` | Yes | — | | `template_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | No | — | | `template_id_master` | `number` | No | — | | `template_name` | `string` | No | — | | `body` | `string` | No | — | *** ### delete `emailTemplates.delete` Delete a user email template by ID **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailTemplates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `emailTemplates.get` Retrieve a single user email template by ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailTemplates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | No | — | | `template_id_master` | `number` | No | — | | `template_name` | `string` | No | — | | `body` | `string` | No | — | *** ### list `emailTemplates.list` List user email templates **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.emailTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > template_id?: number, > template_id_master?: number, > template_name?: string, > body?: string > }[] > ``` *** ### update `emailTemplates.update` Update a user email template **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.emailTemplates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | | `body` | `string` | Yes | — | | `template_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | No | — | | `template_id_master` | `number` | No | — | | `template_name` | `string` | No | — | | `body` | `string` | No | — | *** ## Fax Inbound Rules ### create `faxInboundRules.create` Create a fax inbound automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.faxInboundRules.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dedicated_number` | `string` | Yes | — | | `rule_name` | `string` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | No | — | | `dedicated_number` | `string` | No | — | | `rule_name` | `string` | No | — | | `user_id` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### delete `faxInboundRules.delete` Delete a fax inbound automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.faxInboundRules.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `faxInboundRules.get` Retrieve a single fax inbound automation rule **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.faxInboundRules.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | No | — | | `dedicated_number` | `string` | No | — | | `rule_name` | `string` | No | — | | `user_id` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### list `faxInboundRules.list` List fax inbound automation rules **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.faxInboundRules.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > inbound_rule_id?: number, > dedicated_number?: string, > rule_name?: string, > user_id?: number, > action?: string, > action_address?: string, > enabled?: number > }[] > ``` *** ### update `faxInboundRules.update` Update a fax inbound automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.faxInboundRules.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | Yes | — | | `dedicated_number` | `string` | Yes | — | | `rule_name` | `string` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | No | — | | `dedicated_number` | `string` | No | — | | `rule_name` | `string` | No | — | | `user_id` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ## Fax Receipt Rules ### create `faxReceiptRules.create` Create a fax receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.faxReceiptRules.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rule_name` | `string` | Yes | — | | `match_type` | `number` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### delete `faxReceiptRules.delete` Delete a fax receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.faxReceiptRules.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `faxReceiptRules.get` Retrieve a single fax receipt automation rule **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.faxReceiptRules.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### list `faxReceiptRules.list` List fax receipt automation rules **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.faxReceiptRules.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > receipt_rule_id?: number, > rule_name?: string, > match_type?: number, > action?: string, > action_address?: string, > enabled?: number > }[] > ``` *** ### update `faxReceiptRules.update` Update a fax receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.faxReceiptRules.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | | `rule_name` | `string` | Yes | — | | `match_type` | `number` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ## Fax Receipts ### createTest `faxReceipts.createTest` Create a test fax delivery receipt for a callback URL **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.faxReceipts.createTest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp_send` | `number` | No | — | | `timestamp` | `number` | No | — | | `message_id` | `string` | No | — | | `status_code` | `string` | No | — | | `status_text` | `string` | No | — | | `error_code` | `string` | No | — | | `error_text` | `string` | No | — | | `custom_string` | `string` | No | — | | `subaccount_id` | `number` | No | — | | `message_type` | `string` | No | — | *** ### get `faxReceipts.get` Retrieve a single fax receipt by message ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.faxReceipts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | No | — | | `subaccount_id` | `number` | No | — | | `list_id` | `number` | No | — | | `message_id` | `string` | No | — | | `to` | `string` | No | — | | `from` | `string` | No | — | | `carrier` | `string` | No | — | | `country` | `string` | No | — | | `custom_string` | `string` | No | — | | `schedule` | `number` | No | — | | `message_pages` | `number` | No | — | | `message_price` | `string` | No | — | | `status_code` | `string` | No | — | | `status_text` | `string` | No | — | | `date_added` | `string` | No | — | | `from_email` | `string` | No | — | | `status` | `string` | No | — | *** ### list `faxReceipts.list` List fax delivery receipts with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.faxReceipts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > timestamp_send?: number, > timestamp?: number, > message_id?: string, > status_code?: string, > status_text?: string, > error_code?: string, > error_text?: string, > custom_string?: string, > subaccount_id?: number, > message_type?: string > }[] > ``` *** ### markRead `faxReceipts.markRead` Mark fax delivery receipts as read **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.faxReceipts.markRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date_before` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ## Mms ### history `mms.history` List MMS message history with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.mms.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `date_from` | `number` | No | — | | `date_to` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > direction?: string, > date?: number, > to?: string, > body?: string, > subject?: string, > from?: string, > schedule?: number, > message_id?: string, > message_parts?: number, > message_price?: string, > custom_string?: string, > user_id?: number, > subaccount_id?: number, > country?: string, > carrier?: string, > currency?: string, > status?: string > }[] > ``` *** ### historyExport `mms.historyExport` Export MMS history to a downloadable file **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.mms.historyExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | No | — | | `q` | `string` | No | — | | `order_by` | `string` | No | — | | `date_from` | `number` | No | — | | `date_to` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | *** ### price `mms.price` Calculate the price of MMS messages without sending **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.mms.price({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_file` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > to: string, > body: string, > subject: string, > from: string, > source?: string, > schedule?: number, > country?: string, > list_id?: number, > custom_string?: string, > from_email?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_count` | `number` | No | — | | `queued_count` | `number` | No | — | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > direction?: string, > date?: number, > to?: string, > body?: string, > subject?: string, > from?: string, > schedule?: number, > message_id?: string, > message_parts?: number, > message_price?: string, > custom_string?: string, > user_id?: number, > subaccount_id?: number, > country?: string, > carrier?: string, > currency?: string, > status?: string > }[] > ``` *** ### receipts `mms.receipts` List MMS delivery receipts with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.mms.receipts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > message_id?: string, > status?: string, > status_code?: string, > status_text?: string, > timestamp?: number, > original_message_id?: string > }[] > ``` *** ### receiptsMarkRead `mms.receiptsMarkRead` Mark MMS delivery receipts as read **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.mms.receiptsMarkRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date_before` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### send `mms.send` Send one or more MMS messages with media **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.mms.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_file` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > to: string, > body: string, > subject: string, > from: string, > source?: string, > schedule?: number, > country?: string, > list_id?: number, > custom_string?: string, > from_email?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_count` | `number` | No | — | | `queued_count` | `number` | No | — | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > direction?: string, > date?: number, > to?: string, > body?: string, > subject?: string, > from?: string, > schedule?: number, > message_id?: string, > message_parts?: number, > message_price?: string, > custom_string?: string, > user_id?: number, > subaccount_id?: number, > country?: string, > carrier?: string, > currency?: string, > status?: string > }[] > ``` *** ## Numbers ### buy `numbers.buy` Purchase a dedicated number **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.numbers.buy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dedicated_number` | `string` | Yes | — | | `type` | `sms \| mms` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dedicated_number` | `string` | No | — | | `country` | `string` | No | — | | `price_total` | `number \| string` | No | — | *** ### list `numbers.list` List owned dedicated numbers **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.numbers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `q` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > dedicated_number?: string, > country?: string, > price?: number | string, > type?: string, > number_type?: string > }[] > ``` *** ### search `numbers.search` Search available dedicated numbers by country **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.numbers.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `search` | `string` | No | — | | `search_type` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > country?: string, > country_name?: string, > dedicated_number?: string, > price_setup?: number | string, > price_monthly?: number | string, > price_total?: number | string > }[] > ``` *** ## Post Direct Mail ### searchLocations `postDirectMail.searchLocations` Search direct mail delivery locations by country **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.postDirectMail.searchLocations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `q` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### send `postDirectMail.send` Send a direct mail campaign **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.postDirectMail.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `size` | `A5 \| DL` | Yes | — | | `file_urls` | `string[]` | Yes | — | | `areas` | `object[]` | No | — | | `schedule` | `number` | No | — | | `source` | `string` | No | — | | `custom_string` | `string` | No | — | > **areas full type** > > ```ts theme={null} > { > location_id?: number, > quantity?: number > }[] > ``` **Output:** *empty object* *** ## Post Letters ### detectAddress `postLetters.detectAddress` Detect a structured address from PDF content or text **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.postLetters.detectAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | No | Letter content to detect the address from; at least one of content or address is expected | | `address` | `string` | No | Address text to parse; at least one of content or address is expected | **Output** | Name | Type | Required | Description | | - | - | - | - | | `address_name` | `string` | No | — | | `address_line_1` | `string` | No | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | No | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | No | — | | `address_country` | `string` | No | — | *** ### history `postLetters.history` List post letter history with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.postLetters.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > message_id?: string, > address_name?: string, > address_line_1?: string, > address_line_2?: string, > address_city?: string, > address_state?: string, > address_postal_code?: string, > address_country?: string, > return_address_id?: number, > custom_string?: string, > schedule?: number, > source?: string, > colour?: number, > duplex?: number, > post_pages?: number, > post_price?: number, > priority_post?: number, > date_added?: string, > status?: string > }[] > ``` *** ### historyExport `postLetters.historyExport` Export post letter history to a downloadable file **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.postLetters.historyExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | Yes | — | | `q` | `string` | No | — | | `order_by` | `string` | No | — | | `date_from` | `string` | No | — | | `date_to` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | *** ### price `postLetters.price` Calculate post letter price without sending **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.postLetters.price({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_url` | `string` | Yes | — | | `recipients` | `object[]` | Yes | — | | `template_used` | `number` | No | — | | `colour` | `number` | No | — | | `duplex` | `number` | No | — | | `priority_post` | `number` | No | — | | `schedule` | `number` | No | — | | `source` | `string` | No | — | > **recipients full type** > > ```ts theme={null} > { > address_name: string, > address_line_1: string, > address_line_2?: string, > address_city: string, > address_state?: string, > address_postal_code: string, > address_country: string, > return_address_id: number, > custom_string?: string, > schedule?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_cost` | `number` | No | — | | `recipients` | `object[]` | No | — | > **recipients full type** > > ```ts theme={null} > { > message_id?: string, > address_name?: string, > address_line_1?: string, > address_line_2?: string, > address_city?: string, > address_state?: string, > address_postal_code?: string, > address_country?: string, > return_address_id?: number, > custom_string?: string, > schedule?: number, > source?: string, > colour?: number, > duplex?: number, > post_pages?: number, > post_price?: number, > priority_post?: number, > date_added?: string, > status?: string > }[] > ``` *** ### send `postLetters.send` Send a physical post letter to recipients **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.postLetters.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_url` | `string` | Yes | — | | `recipients` | `object[]` | Yes | — | | `template_used` | `number` | No | — | | `colour` | `number` | No | — | | `duplex` | `number` | No | — | | `priority_post` | `number` | No | — | | `schedule` | `number` | No | — | | `source` | `string` | No | — | > **recipients full type** > > ```ts theme={null} > { > address_name: string, > address_line_1: string, > address_line_2?: string, > address_city: string, > address_state?: string, > address_postal_code: string, > address_country: string, > return_address_id: number, > custom_string?: string, > schedule?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_cost` | `number` | No | — | | `recipients` | `object[]` | No | — | > **recipients full type** > > ```ts theme={null} > { > message_id?: string, > address_name?: string, > address_line_1?: string, > address_line_2?: string, > address_city?: string, > address_state?: string, > address_postal_code?: string, > address_country?: string, > return_address_id?: number, > custom_string?: string, > schedule?: number, > source?: string, > colour?: number, > duplex?: number, > post_pages?: number, > post_price?: number, > priority_post?: number, > date_added?: string, > status?: string > }[] > ``` *** ## Post Return Addresses ### create `postReturnAddresses.create` Create a post return address **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.postReturnAddresses.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `address_name` | `string` | Yes | — | | `address_line_1` | `string` | Yes | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | Yes | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | Yes | — | | `address_country` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `return_address_id` | `number` | No | — | | `user_id` | `number` | No | — | | `address_name` | `string` | No | — | | `address_line_1` | `string` | No | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | No | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | No | — | | `address_country` | `string` | No | — | *** ### delete `postReturnAddresses.delete` Delete a post return address by ID **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.postReturnAddresses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_address_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `postReturnAddresses.get` Retrieve a single post return address by ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.postReturnAddresses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_address_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `return_address_id` | `number` | No | — | | `user_id` | `number` | No | — | | `address_name` | `string` | No | — | | `address_line_1` | `string` | No | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | No | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | No | — | | `address_country` | `string` | No | — | *** ### list `postReturnAddresses.list` List post return addresses with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.postReturnAddresses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > return_address_id?: number, > user_id?: number, > address_name?: string, > address_line_1?: string, > address_line_2?: string, > address_city?: string, > address_state?: string, > address_postal_code?: string, > address_country?: string > }[] > ``` *** ### update `postReturnAddresses.update` Update a post return address by ID **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.postReturnAddresses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `return_address_id` | `number` | Yes | — | | `address_name` | `string` | Yes | — | | `address_line_1` | `string` | Yes | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | Yes | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | Yes | — | | `address_country` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `return_address_id` | `number` | No | — | | `user_id` | `number` | No | — | | `address_name` | `string` | No | — | | `address_line_1` | `string` | No | — | | `address_line_2` | `string` | No | — | | `address_city` | `string` | No | — | | `address_state` | `string` | No | — | | `address_postal_code` | `string` | No | — | | `address_country` | `string` | No | — | *** ## Recharge ### creditCardGet `recharge.creditCardGet` Retrieve the stored recharge credit card **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.recharge.creditCardGet({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `display_number` | `string` | No | — | | `expiry_month` | `number \| string` | No | — | | `expiry_year` | `number \| string` | No | — | | `name` | `string` | No | — | *** ### creditCardUpdate `recharge.creditCardUpdate` Replace the stored recharge credit card **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.recharge.creditCardUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `number` | `string` | Yes | — | | `expiry_month` | `number \| string` | Yes | — | | `expiry_year` | `number \| string` | Yes | — | | `cvc` | `number \| string` | Yes | — | | `name` | `string` | Yes | — | | `bank_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | *** ### packages `recharge.packages` List available recharge packages and currency **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.recharge.packages({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `packages` | `object[]` | No | — | | `currency` | `string` | No | — | > **packages full type** > > ```ts theme={null} > { > package_id?: number | string, > package_price?: number | string, > price_rate?: number | string, > sms_price?: number | string > }[] > ``` *** ### purchase `recharge.purchase` Purchase a recharge package by ID **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.recharge.purchase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `package_id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number \| string` | No | — | | `amount` | `number \| string` | No | — | | `currency` | `string` | No | — | | `amount_aud` | `number \| string` | No | — | | `date` | `string` | No | — | *** ### transactionGet `recharge.transactionGet` Retrieve a single recharge transaction **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.recharge.transactionGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transaction_id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `invoice_number` | `string \| number` | No | — | | `amount` | `number \| string` | No | — | | `currency` | `string` | No | — | | `date` | `string` | No | — | *** ### transactions `recharge.transactions` List recharge transactions with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.recharge.transactions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > invoice_number?: string | number, > amount?: number | string, > currency?: string, > date?: string > }[] > ``` *** ## Referral ### accountsList `referral.accountsList` List referral accounts **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.referral.accountsList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > referral_rule_id?: number | string, > refered_user_id?: number | string, > date_referred?: string, > percentage_referral?: number | string > }[] > ``` *** ## Reseller ### accountsList `reseller.accountsList` List reseller child accounts **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.reseller.accountsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### settingsGet `reseller.settingsGet` Retrieve reseller settings **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.reseller.settingsGet({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### settingsUpdate `reseller.settingsUpdate` Update reseller settings **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.reseller.settingsUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `allow_public_signups` | `boolean` | No | — | | `company_name` | `string` | No | — | | `default_margin` | `number` | No | — | | `subdomain` | `string` | No | — | | `trial_balance` | `number \| string` | No | — | **Output:** *empty object* *** ## Sms ### cancel `sms.cancel` Cancel a scheduled SMS message **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.sms.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `direction` | `string` | No | — | | `date` | `number` | No | — | | `to` | `string` | Yes | — | | `body` | `string` | Yes | — | | `from` | `string` | No | — | | `schedule` | `number` | No | — | | `message_id` | `string` | Yes | — | | `message_parts` | `number` | No | — | | `message_price` | `string` | No | — | | `custom_string` | `string` | No | — | | `user_id` | `number` | No | — | | `subaccount_id` | `number` | No | — | | `country` | `string` | No | — | | `carrier` | `string` | No | — | | `currency` | `string` | No | — | | `status` | `string` | Yes | — | *** ### cancelAll `sms.cancelAll` Cancel all scheduled SMS messages **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.sms.cancelAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `custom_string` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | *** ### history `sms.history` List sent SMS message history with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.sms.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `date_from` | `number` | No | Start epoch timestamp | | `date_to` | `number` | No | End epoch timestamp | **Output** | Name | Type | Required | Description | | - | - | - | - | | `current_page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > direction?: string, > date?: number, > to: string, > body: string, > from?: string, > schedule?: number, > message_id: string, > message_parts?: number, > message_price?: string, > custom_string?: string, > user_id?: number, > subaccount_id?: number, > country?: string, > carrier?: string, > currency?: string, > status: string > }[] > ``` *** ### historyExport `sms.historyExport` Export SMS history to a downloadable file **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.sms.historyExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `date_from` | `number` | No | — | | `date_to` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | *** ### inbound `sms.inbound` List received inbound SMS messages with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.sms.inbound({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `current_page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > message_id: string, > to: string, > from: string, > body: string, > timestamp?: number, > original_message_id?: string > }[] > ``` *** ### inboundCreateTest `sms.inboundCreateTest` Create a test inbound SMS message **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.sms.inboundCreateTest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `to` | `string` | Yes | — | | `from` | `string` | Yes | — | | `body` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | No | — | | `to` | `string` | No | — | | `from` | `string` | No | — | | `body` | `string` | No | — | | `timestamp` | `number` | No | — | | `original_message_id` | `string` | No | — | *** ### inboundMarkRead `sms.inboundMarkRead` Mark inbound SMS messages as read **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.sms.inboundMarkRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date_before` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### inboundMarkReadOne `sms.inboundMarkReadOne` Mark a single inbound SMS message as read **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.sms.inboundMarkReadOne({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### price `sms.price` Calculate the price of SMS messages without sending **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.sms.price({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > to: string, > body: string, > from?: string, > schedule?: number, > source?: string, > custom_string?: string, > country?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_count` | `number` | No | — | | `queued_count` | `number` | No | — | | `blocked_count` | `number` | No | — | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > direction?: string, > date?: number, > to: string, > body: string, > from?: string, > schedule?: number, > message_id: string, > message_parts?: number, > message_price?: string, > custom_string?: string, > user_id?: number, > subaccount_id?: number, > country?: string, > carrier?: string, > currency?: string, > status: string > }[] > ``` *** ### receiptCreateTest `sms.receiptCreateTest` Create a test SMS delivery receipt for a webhook URL **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.sms.receiptCreateTest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | No | — | | `status` | `string` | No | — | | `status_code` | `string` | No | — | | `status_text` | `string` | No | — | | `timestamp` | `number` | No | — | | `original_message_id` | `string` | No | — | *** ### receiptGet `sms.receiptGet` Retrieve a single SMS delivery receipt by message ID **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.sms.receiptGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | No | — | | `status` | `string` | No | — | | `status_code` | `string` | No | — | | `status_text` | `string` | No | — | | `timestamp` | `number` | No | — | | `original_message_id` | `string` | No | — | *** ### receipts `sms.receipts` List SMS delivery receipts with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.sms.receipts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `current_page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > message_id: string, > status: string, > status_code?: string, > status_text?: string, > timestamp?: number, > original_message_id?: string > }[] > ``` *** ### receiptsMarkRead `sms.receiptsMarkRead` Mark SMS delivery receipts as read **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.sms.receiptsMarkRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date_before` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### send `sms.send` Send one or more SMS messages **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.sms.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | Array of SMS messages to send | > **messages full type** > > ```ts theme={null} > { > to: string, > body: string, > from?: string, > schedule?: number, > source?: string, > custom_string?: string, > country?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_count` | `number` | No | — | | `queued_count` | `number` | No | — | | `blocked_count` | `number` | No | — | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > direction?: string, > date?: number, > to: string, > body: string, > from?: string, > schedule?: number, > message_id: string, > message_parts?: number, > message_price?: string, > custom_string?: string, > user_id?: number, > subaccount_id?: number, > country?: string, > carrier?: string, > currency?: string, > status: string > }[] > ``` *** ### statistics `sms.statistics` Retrieve SMS usage statistics **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.sms.statistics({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `object` | No | — | | `inbound` | `object` | No | — | | `outbound` | `object` | No | — | > **total full type** > > ```ts theme={null} > { > } > ``` > **inbound full type** > > ```ts theme={null} > { > } > ``` > **outbound full type** > > ```ts theme={null} > { > } > ``` *** ## Sms Email Sms ### create `smsEmailSms.create` Allow an email address for email-to-SMS **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsEmailSms.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_address` | `string` | Yes | — | | `from` | `string` | No | — | | `from_fax` | `string` | No | — | | `subaccount_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email_address_id` | `number` | No | — | | `email_address` | `string` | No | — | | `from` | `string` | No | — | | `subaccount_id` | `number` | No | — | | `from_fax` | `string` | No | — | | `voice` | `string` | No | — | | `lang` | `string` | No | — | *** ### list `smsEmailSms.list` List allowed email-to-SMS addresses **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.smsEmailSms.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_address_id?: number, > email_address?: string, > from?: string, > subaccount_id?: number, > from_fax?: string, > voice?: string, > lang?: string > }[] > ``` *** ## Sms Inbound Rules ### create `smsInboundRules.create` Create an SMS inbound automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsInboundRules.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dedicated_number` | `string` | Yes | — | | `rule_name` | `string` | Yes | — | | `message_search_type` | `number` | Yes | — | | `message_search_term` | `string` | No | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `body` | `string` | No | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | No | — | | `dedicated_number` | `string` | No | — | | `rule_name` | `string` | No | — | | `message_search_type` | `number` | No | — | | `message_search_term` | `string` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `body` | `string` | No | — | | `enabled` | `number` | No | — | *** ### delete `smsInboundRules.delete` Delete an SMS inbound automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsInboundRules.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `smsInboundRules.get` Retrieve an SMS inbound automation rule **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.smsInboundRules.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | No | — | | `dedicated_number` | `string` | No | — | | `rule_name` | `string` | No | — | | `message_search_type` | `number` | No | — | | `message_search_term` | `string` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `body` | `string` | No | — | | `enabled` | `number` | No | — | *** ### list `smsInboundRules.list` List SMS inbound automation rules **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.smsInboundRules.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > inbound_rule_id?: number, > dedicated_number?: string, > rule_name?: string, > message_search_type?: number, > message_search_term?: string, > action?: string, > action_address?: string, > body?: string, > enabled?: number > }[] > ``` *** ### update `smsInboundRules.update` Update an SMS inbound automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsInboundRules.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | Yes | — | | `dedicated_number` | `string` | Yes | — | | `rule_name` | `string` | Yes | — | | `message_search_type` | `number` | Yes | — | | `message_search_term` | `string` | No | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `body` | `string` | No | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `inbound_rule_id` | `number` | No | — | | `dedicated_number` | `string` | No | — | | `rule_name` | `string` | No | — | | `message_search_type` | `number` | No | — | | `message_search_term` | `string` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `body` | `string` | No | — | | `enabled` | `number` | No | — | *** ## Sms Receipt Rules ### create `smsReceiptRules.create` Create an SMS receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsReceiptRules.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rule_name` | `string` | Yes | — | | `match_type` | `number` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### delete `smsReceiptRules.delete` Delete an SMS receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsReceiptRules.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `smsReceiptRules.get` Retrieve an SMS receipt automation rule **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.smsReceiptRules.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### list `smsReceiptRules.list` List SMS receipt automation rules **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.smsReceiptRules.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > receipt_rule_id?: number, > rule_name?: string, > match_type?: number, > action?: string, > action_address?: string, > enabled?: number > }[] > ``` *** ### update `smsReceiptRules.update` Update an SMS receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsReceiptRules.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | | `rule_name` | `string` | Yes | — | | `match_type` | `number` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ## Sms Stripped Strings ### create `smsStrippedStrings.create` Create an email-to-SMS stripped-string rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsStrippedStrings.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `strip_string` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `number` | No | — | | `strip_string` | `string` | No | — | | `stripped_string` | `string` | No | — | *** ### delete `smsStrippedStrings.delete` Delete an email-to-SMS stripped-string rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsStrippedStrings.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `smsStrippedStrings.get` Retrieve a single stripped-string rule **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.smsStrippedStrings.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `number` | No | — | | `strip_string` | `string` | No | — | | `stripped_string` | `string` | No | — | *** ### list `smsStrippedStrings.list` List email-to-SMS stripped-string rules **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.smsStrippedStrings.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > rule_id?: number, > strip_string?: string, > stripped_string?: string > }[] > ``` *** ### update `smsStrippedStrings.update` Update an email-to-SMS stripped-string rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsStrippedStrings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `number` | Yes | — | | `strip_string` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `number` | No | — | | `strip_string` | `string` | No | — | | `stripped_string` | `string` | No | — | *** ## Sms Templates ### create `smsTemplates.create` Create an SMS message template **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsTemplates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_name` | `string` | Yes | — | | `body` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | No | — | | `template_name` | `string` | No | — | | `body` | `string` | No | — | *** ### delete `smsTemplates.delete` Delete an SMS template **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsTemplates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `smsTemplates.get` Retrieve a single SMS template **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.smsTemplates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | No | — | | `template_name` | `string` | No | — | | `body` | `string` | No | — | *** ### list `smsTemplates.list` List SMS templates with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.smsTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > template_id?: number, > template_name?: string, > body?: string > }[] > ``` *** ### update `smsTemplates.update` Update an SMS template **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.smsTemplates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | | `template_name` | `string` | No | — | | `body` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | No | — | | `template_name` | `string` | No | — | | `body` | `string` | No | — | *** ## Subaccounts ### create `subaccounts.create` Create a new subaccount **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.subaccounts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_username` | `string` | Yes | — | | `password` | `string` | Yes | — | | `email` | `string` | Yes | — | | `phone_number` | `string` | Yes | — | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `notes` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subaccount_id` | `number \| string` | No | — | | `api_username` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `api_key` | `string` | No | — | *** ### delete `subaccounts.delete` Delete a subaccount **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.subaccounts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subaccount_id` | `number \| string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `subaccounts.get` Retrieve a single subaccount **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.subaccounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subaccount_id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subaccount_id` | `number \| string` | No | — | | `api_username` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `api_key` | `string` | No | — | *** ### list `subaccounts.list` List subaccounts with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.subaccounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > subaccount_id?: number | string, > api_username?: string, > email?: string, > phone_number?: string, > first_name?: string, > last_name?: string, > api_key?: string > }[] > ``` *** ### regenKey `subaccounts.regenKey` Regenerate a subaccount API key **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.subaccounts.regenKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subaccount_id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `api_key` | `string` | No | — | *** ### update `subaccounts.update` Update subaccount contact fields **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.subaccounts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subaccount_id` | `number \| string` | Yes | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `notes` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subaccount_id` | `number \| string` | No | — | | `api_username` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `api_key` | `string` | No | — | *** ## Timezones ### list `timezones.list` List supported timezone names **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.timezones.list({}); ``` **Input:** *empty object* **Output:** `string[]` *** ## Uploads ### upload `uploads.upload` Upload and convert a file for messaging services **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.uploads.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `convert` | `fax \| mms \| csv \| post \| postcard` | Yes | — | | `content` | `string` | Yes | Base64-encoded file content | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_name` | `string` | No | — | | `upload_id` | `number` | No | — | | `user_id` | `number` | No | — | | `date_added` | `string` | No | — | | `date_delete` | `string` | No | — | | `_url` | `string` | No | — | *** ### uploadDocument `uploads.uploadDocument` Upload a document for fax and post services **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.uploads.uploadDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `convert` | `fax \| post \| postcard` | Yes | — | | `content` | `string` | Yes | Base64-encoded file content | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_name` | `string` | No | — | | `upload_id` | `number` | No | — | | `user_id` | `number` | No | — | | `date_added` | `string` | No | — | | `date_delete` | `string` | No | — | | `_url` | `string` | No | — | *** ## Voice ### cancelAll `voice.cancelAll` Cancel all scheduled voice calls **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.voice.cancelAll({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | *** ### history `voice.history` List voice call history with pagination **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.voice.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `current_page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > to: string, > body: string, > voice?: string, > lang?: string, > message_id: string, > status: string, > date?: number > }[] > ``` *** ### historyExport `voice.historyExport` Export voice history to a downloadable file **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.voice.historyExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | No | — | | `q` | `string` | No | — | | `order_by` | `string` | No | — | | `date_from` | `number` | No | — | | `date_to` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | *** ### languages `voice.languages` List available voice-call languages **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.voice.languages({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > code: string, > country?: string, > gender?: string > }[] > ``` *** ### receiptsMarkRead `voice.receiptsMarkRead` Mark voice delivery receipts as read **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.voice.receiptsMarkRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date_before` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### send `voice.send` Initiate outbound text-to-speech voice call **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.voice.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > to: string, > body: string, > voice?: female | male, > lang?: string, > schedule?: number, > require_input?: number, > machine_detection?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_price` | `number` | No | — | | `total_count` | `number` | No | — | | `queued_count` | `number` | No | — | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > to: string, > body: string, > voice?: string, > lang?: string, > message_id: string, > status: string, > date?: number > }[] > ``` *** ### statistics `voice.statistics` Retrieve voice usage statistics **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.voice.statistics({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `object` | No | — | | `inbound` | `object` | No | — | | `outbound` | `object` | No | — | > **total full type** > > ```ts theme={null} > { > } > ``` > **inbound full type** > > ```ts theme={null} > { > } > ``` > **outbound full type** > > ```ts theme={null} > { > } > ``` *** ## Voice Receipt Rules ### create `voiceReceiptRules.create` Create a voice receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.voiceReceiptRules.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rule_name` | `string` | Yes | — | | `match_type` | `number` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### delete `voiceReceiptRules.delete` Delete a voice receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.voiceReceiptRules.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > never[] | { > } | boolean | null > ``` *** ### get `voiceReceiptRules.get` Retrieve a voice receipt automation rule **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.voiceReceiptRules.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** ### list `voiceReceiptRules.list` List voice receipt automation rules **Risk:** `read` ```ts theme={null} await corsair.clicksend.api.voiceReceiptRules.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `current_page` | `number` | No | — | | `last_page` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > receipt_rule_id?: number, > rule_name?: string, > match_type?: number, > action?: string, > action_address?: string, > enabled?: number > }[] > ``` *** ### update `voiceReceiptRules.update` Update a voice receipt automation rule **Risk:** `write` ```ts theme={null} await corsair.clicksend.api.voiceReceiptRules.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | Yes | — | | `rule_name` | `string` | Yes | — | | `match_type` | `number` | Yes | — | | `action` | `string` | Yes | — | | `action_address` | `string` | Yes | — | | `enabled` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_rule_id` | `number` | No | — | | `rule_name` | `string` | No | — | | `match_type` | `number` | No | — | | `action` | `string` | No | — | | `action_address` | `string` | No | — | | `enabled` | `number` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/clicksend/database ClickSend local sync: searchable entities, `.search()` filters, and operators. The ClickSend plugin syncs data locally. Use `corsair.clicksend.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Contacts Path: `clicksend.db.contacts.search` ```ts theme={null} const rows = await corsair.clicksend.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `contact_id` | `string` | equals, contains, startsWith, endsWith, in | | `list_id` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `clicksend.db.messages.search` ```ts theme={null} const rows = await corsair.clicksend.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `message_id` | `string` | equals, contains, startsWith, endsWith, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `direction` | `string` | equals, contains, startsWith, endsWith, in | | `date_sent` | `string` | equals, contains, startsWith, endsWith, in | | `price` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/clicksend/overview Multi-channel communications platform for SMS, MMS, Voice, Fax, Email, Post, contacts, numbers, and billing. Use **ClickSend** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 164 typed API operations * 2 synced entities (`contacts`, `messages`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/clicksend ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/clicksend ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/clicksend ``` ```bash bun theme={null} bun add corsair @corsair-dev/clicksend ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { clicksend } from '@corsair-dev/clicksend'; export const corsair = createCorsair({ plugins: [ clicksend(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} clicksend() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'clicksend', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List SMS history** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clicksend.api.sms.history({}); ``` **Send an SMS message** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clicksend.api.sms.send({ messages: [{ to: '+15555550100', body: 'Hello from Corsair!' }], }); ``` See the full list on the [API](/plugins/clicksend/api) page. ## Query synced data Search synced SMS messages without hitting ClickSend API. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.clicksend.db.messages.search({ data: {}, limit: 50, }); ``` Synced entities: `contacts`, `messages`. See [Database](/plugins/clicksend/database) for filters and operators. ## What's next > **[API reference](/plugins/clicksend/api)** > > Every `clicksend.api.*` operation with input and output types. > **[Database](/plugins/clicksend/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/clickup/api API reference for Clickup: every `clickup.api.*` operation with input and output types. Every `clickup.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chat ### channelsCreate `chat.channelsCreate` Create a chat channel **Risk:** `write` ```ts theme={null} await corsair.clickup.api.chat.channelsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `topic` | `string` | No | — | | `visibility` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### channelsCreateDm `chat.channelsCreateDm` Create a direct message channel **Risk:** `write` ```ts theme={null} await corsair.clickup.api.chat.channelsCreateDm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `user_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### channelsCreateLocation `chat.channelsCreateLocation` Create a location chat channel **Risk:** `write` ```ts theme={null} await corsair.clickup.api.chat.channelsCreateLocation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `space_id` | `string` | No | — | | `folder_id` | `string` | No | — | | `list_id` | `string` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### channelsDelete `chat.channelsDelete` Delete a chat channel **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.chat.channelsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | **Output:** `undefined` *** ### channelsFollowers `chat.channelsFollowers` List followers of a chat channel **Risk:** `read` ```ts theme={null} await corsair.clickup.api.chat.channelsFollowers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `followers` | `object[]` | No | — | > **followers full type** > > ```ts theme={null} > { > }[] > ``` *** ### channelsGet `chat.channelsGet` Get a single chat channel **Risk:** `read` ```ts theme={null} await corsair.clickup.api.chat.channelsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### channelsList `chat.channelsList` List chat channels in a Workspace **Risk:** `read` ```ts theme={null} await corsair.clickup.api.chat.channelsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `is_follower` | `boolean` | No | — | | `include_closed` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `channels` | `object[]` | No | — | > **channels full type** > > ```ts theme={null} > { > }[] > ``` *** ### channelsMembers `chat.channelsMembers` List members of a chat channel **Risk:** `read` ```ts theme={null} await corsair.clickup.api.chat.channelsMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `members` | `object[]` | No | — | > **members full type** > > ```ts theme={null} > { > }[] > ``` *** ### channelsUpdate `chat.channelsUpdate` Update a chat channel **Risk:** `write` ```ts theme={null} await corsair.clickup.api.chat.channelsUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | | `name` | `string` | No | — | | `topic` | `string` | No | — | | `description` | `string` | No | — | | `visibility` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### messagesCreate `chat.messagesCreate` Send a chat message **Risk:** `write` ```ts theme={null} await corsair.clickup.api.chat.messagesCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | | `type` | `message \| post` | Yes | — | | `content` | `string` | Yes | — | | `assignee` | `number` | No | — | | `followers` | `number[]` | No | — | | `content_format` | `text/md \| text/plain` | No | — | **Output:** *empty object* *** ### messagesDelete `chat.messagesDelete` Delete a chat message **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.chat.messagesDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `message_id` | `string \| number` | Yes | — | **Output:** `undefined` *** ### messagesList `chat.messagesList` List messages in a chat channel **Risk:** `read` ```ts theme={null} await corsair.clickup.api.chat.messagesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `content_format` | `text/md \| text/plain` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` *** ### messagesUpdate `chat.messagesUpdate` Update a chat message **Risk:** `write` ```ts theme={null} await corsair.clickup.api.chat.messagesUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `message_id` | `string \| number` | Yes | — | | `content` | `string` | No | — | | `assignee` | `number` | No | — | | `resolved` | `boolean` | No | — | **Output:** *empty object* *** ### reactionsCreate `chat.reactionsCreate` React to a chat message **Risk:** `write` ```ts theme={null} await corsair.clickup.api.chat.reactionsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `message_id` | `string \| number` | Yes | — | | `reaction` | `string` | Yes | — | **Output:** *empty object* *** ### reactionsDelete `chat.reactionsDelete` Remove a reaction from a chat message **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.chat.reactionsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `message_id` | `string \| number` | Yes | — | | `reaction` | `string` | Yes | — | **Output:** `undefined` *** ### reactionsGet `chat.reactionsGet` List reactions on a chat message **Risk:** `read` ```ts theme={null} await corsair.clickup.api.chat.reactionsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `message_id` | `string \| number` | Yes | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `reactions` | `object[]` | No | — | > **reactions full type** > > ```ts theme={null} > { > }[] > ``` *** ### repliesCreate `chat.repliesCreate` Reply to a chat message **Risk:** `write` ```ts theme={null} await corsair.clickup.api.chat.repliesCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `message_id` | `string \| number` | Yes | — | | `type` | `message \| post` | No | — | | `content` | `string` | Yes | — | **Output:** *empty object* *** ### repliesGet `chat.repliesGet` List replies to a chat message **Risk:** `read` ```ts theme={null} await corsair.clickup.api.chat.repliesGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `message_id` | `string \| number` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `replies` | `object[]` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` *** ### subtypes `chat.subtypes` List post subtype IDs for a Workspace **Risk:** `read` ```ts theme={null} await corsair.clickup.api.chat.subtypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `comment_type` | `post \| ai \| syncup \| ai_via_brain` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subtypes` | `object[]` | No | — | > **subtypes full type** > > ```ts theme={null} > { > }[] > ``` *** ### taggedUsers `chat.taggedUsers` List users tagged in a chat message **Risk:** `read` ```ts theme={null} await corsair.clickup.api.chat.taggedUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `message_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | No | — | > **users full type** > > ```ts theme={null} > { > }[] > ``` *** ## Checklists ### create `checklists.create` Create a checklist in a Task **Risk:** `write` ```ts theme={null} await corsair.clickup.api.checklists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `checklists.delete` Delete a checklist **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.checklists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `checklist_id` | `string` | Yes | — | **Output:** `undefined` *** ### itemsCreate `checklists.itemsCreate` Create a checklist item **Risk:** `write` ```ts theme={null} await corsair.clickup.api.checklists.itemsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `checklist_id` | `string` | Yes | — | | `name` | `string` | No | — | | `assignee` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### itemsDelete `checklists.itemsDelete` Delete a checklist item **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.checklists.itemsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `checklist_id` | `string` | Yes | — | | `checklist_item_id` | `string` | Yes | — | **Output:** `undefined` *** ### itemsUpdate `checklists.itemsUpdate` Update a checklist item **Risk:** `write` ```ts theme={null} await corsair.clickup.api.checklists.itemsUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `checklist_id` | `string` | Yes | — | | `checklist_item_id` | `string` | Yes | — | | `name` | `string` | No | — | | `assignee` | `number` | No | — | | `resolved` | `boolean` | No | — | | `parent` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### update `checklists.update` Update a checklist **Risk:** `write` ```ts theme={null} await corsair.clickup.api.checklists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `checklist_id` | `string` | Yes | — | | `name` | `string` | No | — | | `position` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Custom Fields ### accessible `customFields.accessible` List accessible custom fields for a List **Risk:** `read` ```ts theme={null} await corsair.clickup.api.customFields.accessible({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### folderFields `customFields.folderFields` List custom fields available in a Folder **Risk:** `read` ```ts theme={null} await corsair.clickup.api.customFields.folderFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### removeValue `customFields.removeValue` Remove a custom field value from a Task **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.customFields.removeValue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `field_id` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** *empty object* *** ### setValue `customFields.setValue` Set a custom field value on a Task **Risk:** `write` ```ts theme={null} await corsair.clickup.api.customFields.setValue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `field_id` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | | `value` | `any` | Yes | — | **Output:** *empty object* *** ## Dependencies ### add `dependencies.add` Add a waiting-on/blocking dependency to a Task **Risk:** `write` ```ts theme={null} await corsair.clickup.api.dependencies.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `depends_on` | `string` | No | — | | `dependency_of` | `string` | No | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** *empty object* *** ### delete `dependencies.delete` Remove a dependency from a Task **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.dependencies.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `depends_on` | `string` | No | — | | `dependency_of` | `string` | No | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** *empty object* *** ## Docs ### content `docs.content` Get full Doc content **Risk:** `read` ```ts theme={null} await corsair.clickup.api.docs.content({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `doc_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### create `docs.create` Create a new Doc **Risk:** `write` ```ts theme={null} await corsair.clickup.api.docs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `parent` | `string` | No | — | | `visibility` | `PUBLIC \| PRIVATE` | No | — | | `create_page` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createPage `docs.createPage` Create a page in a Doc **Risk:** `write` ```ts theme={null} await corsair.clickup.api.docs.createPage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `doc_id` | `string` | Yes | — | | `name` | `string` | No | — | | `content` | `string` | No | — | | `content_format` | `text/md \| text/plain` | No | — | | `parent_page_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### pageContent `docs.pageContent` Get a single Doc page **Risk:** `read` ```ts theme={null} await corsair.clickup.api.docs.pageContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `doc_id` | `string` | Yes | — | | `page_id` | `string` | Yes | — | | `content_format` | `text/md \| text/plain` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### pageListing `docs.pageListing` Get the page listing structure of a Doc **Risk:** `read` ```ts theme={null} await corsair.clickup.api.docs.pageListing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `doc_id` | `string` | Yes | — | | `max_page_depth` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pages` | `object[]` | No | — | > **pages full type** > > ```ts theme={null} > { > }[] > ``` *** ### pages `docs.pages` List pages in a Doc **Risk:** `read` ```ts theme={null} await corsair.clickup.api.docs.pages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `doc_id` | `string` | Yes | — | | `max_page_depth` | `number` | No | — | | `content_format` | `text/md \| text/plain` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pages` | `object[]` | No | — | > **pages full type** > > ```ts theme={null} > { > }[] > ``` *** ### search `docs.search` Search Docs in a Workspace **Risk:** `read` ```ts theme={null} await corsair.clickup.api.docs.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `creator` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `docs` | `object[]` | No | — | > **docs full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### updatePage `docs.updatePage` Update a Doc page **Risk:** `write` ```ts theme={null} await corsair.clickup.api.docs.updatePage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `doc_id` | `string` | Yes | — | | `page_id` | `string` | Yes | — | | `name` | `string` | No | — | | `sub_title` | `string` | No | — | | `content` | `string` | No | — | | `content_format` | `text/md \| text/plain` | No | — | | `content_edit_mode` | `replace \| append \| prepend` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Folders ### create `folders.create` Create a new Folder **Risk:** `write` ```ts theme={null} await corsair.clickup.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### delete `folders.delete` Delete a Folder **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.folders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | **Output:** `undefined` *** ### get `folders.get` Get a single Folder **Risk:** `read` ```ts theme={null} await corsair.clickup.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### list `folders.list` List Folders in a Space **Risk:** `read` ```ts theme={null} await corsair.clickup.api.folders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `folders` | `object[]` | No | — | > **folders full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### update `folders.update` Rename a Folder **Risk:** `write` ```ts theme={null} await corsair.clickup.api.folders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### viewsCreate `folders.viewsCreate` Create a view in a Folder **Risk:** `write` ```ts theme={null} await corsair.clickup.api.folders.viewsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `list \| board \| calendar \| table \| timeline \| workload \| activity \| map \| chat \| gantt` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### viewsGet `folders.viewsGet` List views in a Folder **Risk:** `read` ```ts theme={null} await corsair.clickup.api.folders.viewsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `views` | `object[]` | No | — | > **views full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ## Goals ### create `goals.create` Create a new Goal **Risk:** `write` ```ts theme={null} await corsair.clickup.api.goals.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `due_date` | `number` | No | — | | `color` | `string` | No | — | | `owners` | `number[]` | No | — | | `multiple_owners` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### delete `goals.delete` Delete a Goal **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.goals.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `goal_id` | `string` | Yes | — | **Output:** `undefined` *** ### get `goals.get` Get a single Goal **Risk:** `read` ```ts theme={null} await corsair.clickup.api.goals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `goal_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### keyResultsCreate `goals.keyResultsCreate` Create a key result for a Goal **Risk:** `write` ```ts theme={null} await corsair.clickup.api.goals.keyResultsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `goal_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `owners` | `number[]` | Yes | — | | `type` | `number \| currency \| boolean \| percentage \| automatic` | Yes | — | | `steps_start` | `number` | No | — | | `steps_end` | `number` | No | — | | `unit` | `string` | No | — | | `task_ids` | `string[]` | No | — | | `list_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### keyResultsDelete `goals.keyResultsDelete` Delete a key result **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.goals.keyResultsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key_result_id` | `string` | Yes | — | **Output:** `undefined` *** ### keyResultsUpdate `goals.keyResultsUpdate` Update a key result **Risk:** `write` ```ts theme={null} await corsair.clickup.api.goals.keyResultsUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key_result_id` | `string` | Yes | — | | `steps_current` | `number` | No | — | | `note` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### list `goals.list` List Goals in a Workspace **Risk:** `read` ```ts theme={null} await corsair.clickup.api.goals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `goals` | `object[]` | No | — | > **goals full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### update `goals.update` Update a Goal **Risk:** `write` ```ts theme={null} await corsair.clickup.api.goals.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `goal_id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `due_date` | `number` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ## Guests ### addToFolder `guests.addToFolder` Share a Folder with a guest **Risk:** `write` ```ts theme={null} await corsair.clickup.api.guests.addToFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `guest_id` | `string` | Yes | — | | `permission_level` | `number` | No | — | **Output:** *empty object* *** ### addToList `guests.addToList` Share a List with a guest **Risk:** `write` ```ts theme={null} await corsair.clickup.api.guests.addToList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `guest_id` | `string` | Yes | — | | `permission_level` | `number` | No | — | **Output:** *empty object* *** ### addToTask `guests.addToTask` Share a Task with a guest **Risk:** `write` ```ts theme={null} await corsair.clickup.api.guests.addToTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `guest_id` | `string` | Yes | — | | `permission_level` | `number` | No | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** *empty object* *** ### get `guests.get` Get a Workspace guest **Risk:** `read` ```ts theme={null} await corsair.clickup.api.guests.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `guest_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `guest` | `object` | No | — | > **guest full type** > > ```ts theme={null} > { > } > ``` *** ### invite `guests.invite` Invite a guest to a Workspace **Risk:** `write` ```ts theme={null} await corsair.clickup.api.guests.invite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `email` | `string` | Yes | — | | `custom_role` | `string` | No | — | | `can_edit_tags` | `boolean` | No | — | | `can_see_time_spent` | `boolean` | No | — | | `can_see_time_estimated` | `boolean` | No | — | | `can_create_views` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `guest` | `object` | No | — | > **guest full type** > > ```ts theme={null} > { > } > ``` *** ### remove `guests.remove` Remove a guest from a Workspace **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.guests.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `guest_id` | `string` | Yes | — | **Output:** *empty object* *** ### removeFromFolder `guests.removeFromFolder` Remove a guest from a Folder **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.guests.removeFromFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `guest_id` | `string` | Yes | — | **Output:** *empty object* *** ### removeFromList `guests.removeFromList` Remove a guest from a List **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.guests.removeFromList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `guest_id` | `string` | Yes | — | **Output:** *empty object* *** ### removeFromTask `guests.removeFromTask` Remove a guest from a Task **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.guests.removeFromTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `guest_id` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** *empty object* *** ### update `guests.update` Update a Workspace guest **Risk:** `write` ```ts theme={null} await corsair.clickup.api.guests.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `guest_id` | `string` | Yes | — | | `username` | `string` | No | — | | `custom_role` | `string` | No | — | | `can_edit_tags` | `boolean` | No | — | | `can_see_time_spent` | `boolean` | No | — | | `can_see_time_estimated` | `boolean` | No | — | | `can_create_views` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `guest` | `object` | No | — | > **guest full type** > > ```ts theme={null} > { > } > ``` *** ## Lists ### commentsCreate `lists.commentsCreate` Comment on a List **Risk:** `write` ```ts theme={null} await corsair.clickup.api.lists.commentsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `comment_text` | `string` | Yes | — | | `assignee` | `number` | No | — | | `notify_all` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### commentsGet `lists.commentsGet` Get comments on a List **Risk:** `read` ```ts theme={null} await corsair.clickup.api.lists.commentsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `start` | `number` | No | — | | `start_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `comments` | `object[]` | No | — | > **comments full type** > > ```ts theme={null} > { > }[] > ``` *** ### create `lists.create` Create a List in a Folder **Risk:** `write` ```ts theme={null} await corsair.clickup.api.lists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | No | — | | `due_date` | `number` | No | — | | `priority` | `number` | No | — | | `assignee` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### createFolderless `lists.createFolderless` Create a folderless List in a Space **Risk:** `write` ```ts theme={null} await corsair.clickup.api.lists.createFolderless({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | No | — | | `due_date` | `number` | No | — | | `priority` | `number` | No | — | | `assignee` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### createFromTemplate `lists.createFromTemplate` Create a List from a template **Risk:** `write` ```ts theme={null} await corsair.clickup.api.lists.createFromTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `template_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### delete `lists.delete` Delete a List **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.lists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | **Output:** `undefined` *** ### folderless `lists.folderless` List folderless Lists in a Space **Risk:** `read` ```ts theme={null} await corsair.clickup.api.lists.folderless({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lists` | `object[]` | No | — | > **lists full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### get `lists.get` Get a single List **Risk:** `read` ```ts theme={null} await corsair.clickup.api.lists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### list `lists.list` List Lists in a Folder **Risk:** `read` ```ts theme={null} await corsair.clickup.api.lists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lists` | `object[]` | No | — | > **lists full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### members `lists.members` List members of a List **Risk:** `read` ```ts theme={null} await corsair.clickup.api.lists.members({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `members` | `object[]` | No | — | > **members full type** > > ```ts theme={null} > { > }[] > ``` *** ### update `lists.update` Update a List **Risk:** `write` ```ts theme={null} await corsair.clickup.api.lists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `name` | `string` | No | — | | `content` | `string` | No | — | | `due_date` | `number` | No | — | | `priority` | `number` | No | — | | `assignee` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### viewsCreate `lists.viewsCreate` Create a view in a List **Risk:** `write` ```ts theme={null} await corsair.clickup.api.lists.viewsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `list \| board \| calendar \| table \| timeline \| workload \| activity \| map \| chat \| gantt` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### viewsGet `lists.viewsGet` List views in a List **Risk:** `read` ```ts theme={null} await corsair.clickup.api.lists.viewsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `views` | `object[]` | No | — | > **views full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ## Spaces ### availableFields `spaces.availableFields` List custom fields available in a Space **Risk:** `read` ```ts theme={null} await corsair.clickup.api.spaces.availableFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### create `spaces.create` Create a new Space **Risk:** `write` ```ts theme={null} await corsair.clickup.api.spaces.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `multiple_assignees` | `boolean` | No | — | | `features` | `object` | No | — | > **features full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### delete `spaces.delete` Delete a Space **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.spaces.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | **Output:** `undefined` *** ### get `spaces.get` Get a single Space **Risk:** `read` ```ts theme={null} await corsair.clickup.api.spaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### list `spaces.list` List Spaces in a Workspace **Risk:** `read` ```ts theme={null} await corsair.clickup.api.spaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spaces` | `object[]` | No | — | > **spaces full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### tagsCreate `spaces.tagsCreate` Create a tag in a Space **Risk:** `write` ```ts theme={null} await corsair.clickup.api.spaces.tagsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `tag_fg` | `string` | No | — | | `tag_bg` | `string` | No | — | **Output:** *empty object* *** ### tagsDelete `spaces.tagsDelete` Delete a tag from a Space **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.spaces.tagsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `tag_name` | `string` | Yes | — | | `tag_name_1` | `string` | No | — | | `tag_tag_fg` | `string` | No | — | | `tag_tag_bg` | `string` | No | — | **Output:** `undefined` *** ### tagsGet `spaces.tagsGet` List tags in a Space **Risk:** `read` ```ts theme={null} await corsair.clickup.api.spaces.tagsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `object[]` | No | — | > **tags full type** > > ```ts theme={null} > { > name: string, > tag_fg?: string, > tag_bg?: string > }[] > ``` *** ### tagsUpdate `spaces.tagsUpdate` Update a tag in a Space **Risk:** `write` ```ts theme={null} await corsair.clickup.api.spaces.tagsUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `tag_name` | `string` | Yes | — | | `name` | `string` | Yes | — | | `tag_fg` | `string` | Yes | — | | `tag_bg` | `string` | Yes | — | **Output:** *empty object* *** ### update `spaces.update` Update an existing Space **Risk:** `write` ```ts theme={null} await corsair.clickup.api.spaces.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `private` | `boolean` | No | — | | `admin_can_manage` | `boolean` | No | — | | `multiple_assignees` | `boolean` | No | — | | `features` | `object` | No | — | > **features full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### viewsCreate `spaces.viewsCreate` Create a view in a Space **Risk:** `write` ```ts theme={null} await corsair.clickup.api.spaces.viewsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `list \| board \| calendar \| table \| timeline \| workload \| activity \| map \| chat \| gantt` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### viewsGet `spaces.viewsGet` List views in a Space **Risk:** `read` ```ts theme={null} await corsair.clickup.api.spaces.viewsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `views` | `object[]` | No | — | > **views full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ## Task Comments ### create `taskComments.create` Comment on a Task **Risk:** `write` ```ts theme={null} await corsair.clickup.api.taskComments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `comment_text` | `string` | Yes | — | | `assignee` | `number` | No | — | | `notify_all` | `boolean` | No | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `taskComments.delete` Delete a Task comment **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.taskComments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | — | **Output:** `undefined` *** ### get `taskComments.get` Get comments on a Task **Risk:** `read` ```ts theme={null} await corsair.clickup.api.taskComments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `start` | `number` | No | — | | `start_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `comments` | `object[]` | No | — | > **comments full type** > > ```ts theme={null} > { > }[] > ``` *** ### threadedCreate `taskComments.threadedCreate` Reply to a comment in a thread **Risk:** `write` ```ts theme={null} await corsair.clickup.api.taskComments.threadedCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | — | | `comment_text` | `string` | Yes | — | | `assignee` | `number` | No | — | | `notify_all` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### threadedGet `taskComments.threadedGet` Get threaded replies to a comment **Risk:** `read` ```ts theme={null} await corsair.clickup.api.taskComments.threadedGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `comments` | `object[]` | No | — | > **comments full type** > > ```ts theme={null} > { > }[] > ``` *** ### update `taskComments.update` Update a Task comment **Risk:** `write` ```ts theme={null} await corsair.clickup.api.taskComments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | — | | `comment_text` | `string` | No | — | | `assignee` | `number` | No | — | | `resolved` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Task Links ### add `taskLinks.add` Link two Tasks **Risk:** `write` ```ts theme={null} await corsair.clickup.api.taskLinks.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `links_to` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** *empty object* *** ### delete `taskLinks.delete` Delete a link between two Tasks **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.taskLinks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `links_to` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** *empty object* *** ## Task Lists ### add `taskLists.add` Add a Task to an additional List **Risk:** `write` ```ts theme={null} await corsair.clickup.api.taskLists.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `task_id` | `string` | Yes | — | **Output:** *empty object* *** ### remove `taskLists.remove` Remove a Task from an additional List **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.taskLists.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `task_id` | `string` | Yes | — | **Output:** *empty object* *** ## Tasks ### attachmentsCreate `tasks.attachmentsCreate` Upload a file attachment to a Task **Risk:** `write` ```ts theme={null} await corsair.clickup.api.tasks.attachmentsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `filename` | `string` | Yes | — | | `content_type` | `string` | No | — | | `file_base64` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ### bulkTimeInStatus `tasks.bulkTimeInStatus` Get time in status for multiple Tasks **Risk:** `read` ```ts theme={null} await corsair.clickup.api.tasks.bulkTimeInStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_ids` | `string[]` | Yes | — | **Output:** *empty object* *** ### create `tasks.create` Create a new Task **Risk:** `write` ```ts theme={null} await corsair.clickup.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `markdown_content` | `string` | No | — | | `assignees` | `number[]` | No | — | | `status` | `string` | No | — | | `priority` | `number` | No | — | | `due_date` | `number` | No | — | | `due_date_time` | `boolean` | No | — | | `time_estimate` | `number` | No | — | | `start_date` | `number` | No | — | | `start_date_time` | `boolean` | No | — | | `notify_all` | `boolean` | No | — | | `parent` | `string` | No | — | | `links_to` | `string` | No | — | | `custom_fields` | `object[]` | No | — | > **custom\_fields full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### createFromTemplate `tasks.createFromTemplate` Create a Task from a template **Risk:** `write` ```ts theme={null} await corsair.clickup.api.tasks.createFromTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `template_id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### delete `tasks.delete` Delete a Task **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** `undefined` *** ### filteredTeam `tasks.filteredTeam` List filtered Tasks across a Workspace **Risk:** `read` ```ts theme={null} await corsair.clickup.api.tasks.filteredTeam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `page` | `number` | No | — | | `space_ids` | `string[]` | No | — | | `project_ids` | `string[]` | No | — | | `list_ids` | `string[]` | No | — | | `statuses` | `string[]` | No | — | | `assignees` | `number[]` | No | — | | `tags` | `string[]` | No | — | | `parent` | `string` | No | — | | `subtasks` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tasks` | `object[]` | No | — | | `last_page` | `boolean` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### get `tasks.get` Get a single Task **Risk:** `read` ```ts theme={null} await corsair.clickup.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | | `include_subtasks` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### list `tasks.list` List Tasks in a List **Risk:** `read` ```ts theme={null} await corsair.clickup.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `page` | `number` | No | — | | `archived` | `boolean` | No | — | | `subtasks` | `boolean` | No | — | | `include_closed` | `boolean` | No | — | | `statuses` | `string[]` | No | — | | `assignees` | `number[]` | No | — | | `tags` | `string[]` | No | — | | `order_by` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tasks` | `object[]` | No | — | | `last_page` | `boolean` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### members `tasks.members` List members with explicit Task access **Risk:** `read` ```ts theme={null} await corsair.clickup.api.tasks.members({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `members` | `object[]` | No | — | > **members full type** > > ```ts theme={null} > { > }[] > ``` *** ### moveToHomeList `tasks.moveToHomeList` Move a Task to a new home List **Risk:** `write` ```ts theme={null} await corsair.clickup.api.tasks.moveToHomeList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `task_id` | `string` | Yes | — | | `list_id` | `string` | Yes | — | | `move_custom_fields` | `boolean` | No | — | | `custom_fields_to_move` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### tagsAdd `tasks.tagsAdd` Add a tag to a Task **Risk:** `write` ```ts theme={null} await corsair.clickup.api.tasks.tagsAdd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `tag_name` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** *empty object* *** ### tagsRemove `tasks.tagsRemove` Remove a tag from a Task **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.tasks.tagsRemove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `tag_name` | `string` | Yes | — | | `custom_task_ids` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output:** *empty object* *** ### templates `tasks.templates` List Task templates in a Workspace **Risk:** `read` ```ts theme={null} await corsair.clickup.api.tasks.templates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `templates` | `object[]` | No | — | > **templates full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### timeInStatus `tasks.timeInStatus` Get time a Task spent in each status **Risk:** `read` ```ts theme={null} await corsair.clickup.api.tasks.timeInStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output:** *empty object* *** ### trackedTimeCreate `tasks.trackedTimeCreate` Record legacy tracked time for a Task **Risk:** `write` ```ts theme={null} await corsair.clickup.api.tasks.trackedTimeCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `start` | `number` | No | — | | `end` | `number` | No | — | | `billable` | `boolean` | No | — | | `description` | `string` | No | — | | `assignee` | `number` | No | — | **Output:** *empty object* *** ### trackedTimeDelete `tasks.trackedTimeDelete` Delete a legacy time-tracked interval **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.tasks.trackedTimeDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `interval_id` | `string` | Yes | — | **Output:** `undefined` *** ### trackedTimeGet `tasks.trackedTimeGet` Get legacy tracked time for a Task **Risk:** `read` ```ts theme={null} await corsair.clickup.api.tasks.trackedTimeGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output:** *empty object* *** ### trackedTimeUpdate `tasks.trackedTimeUpdate` Edit a legacy time-tracked interval **Risk:** `write` ```ts theme={null} await corsair.clickup.api.tasks.trackedTimeUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `interval_id` | `string` | Yes | — | | `start` | `number` | No | — | | `end` | `number` | No | — | | `description` | `string` | No | — | **Output:** *empty object* *** ### update `tasks.update` Update an existing Task **Risk:** `write` ```ts theme={null} await corsair.clickup.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `status` | `string` | No | — | | `priority` | `number` | No | — | | `due_date` | `number` | No | — | | `due_date_time` | `boolean` | No | — | | `time_estimate` | `number` | No | — | | `start_date` | `number` | No | — | | `start_date_time` | `boolean` | No | — | | `assignees` | `number[]` | No | — | | `archived` | `boolean` | No | — | | `parent` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ## Teams ### create `teams.create` Create a user group **Risk:** `write` ```ts theme={null} await corsair.clickup.api.teams.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `members` | `number[]` | No | — | | `admins` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### delete `teams.delete` Delete a user group **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.teams.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | **Output:** `undefined` *** ### list `teams.list` List user groups **Risk:** `read` ```ts theme={null} await corsair.clickup.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `groups` | `object[]` | No | — | > **groups full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### update `teams.update` Update a user group **Risk:** `write` ```ts theme={null} await corsair.clickup.api.teams.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | | `name` | `string` | No | — | | `handle` | `string` | No | — | | `add` | `number[]` | No | — | | `rem` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ## Time Entries ### create `timeEntries.create` Create a time entry **Risk:** `write` ```ts theme={null} await corsair.clickup.api.timeEntries.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `start` | `number` | No | — | | `end` | `number` | No | — | | `duration` | `number` | No | — | | `description` | `string` | No | — | | `tid` | `string` | No | — | | `billable` | `boolean` | No | — | | `tags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `timeEntries.delete` Delete a time entry **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.timeEntries.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `timer_id` | `string` | Yes | — | **Output:** `undefined` *** ### get `timeEntries.get` Get a single time entry **Risk:** `read` ```ts theme={null} await corsair.clickup.api.timeEntries.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `timer_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### history `timeEntries.history` Get time entry change history **Risk:** `read` ```ts theme={null} await corsair.clickup.api.timeEntries.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `timer_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### range `timeEntries.range` List time entries in a date range **Risk:** `read` ```ts theme={null} await corsair.clickup.api.timeEntries.range({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `start_date` | `number` | No | — | | `end_date` | `number` | No | — | | `assignee` | `number` | No | — | | `space_id` | `string` | No | — | | `folder_id` | `string` | No | — | | `list_id` | `string` | No | — | | `task_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### running `timeEntries.running` Get the running time entry **Risk:** `read` ```ts theme={null} await corsair.clickup.api.timeEntries.running({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### start `timeEntries.start` Start a time entry timer **Risk:** `write` ```ts theme={null} await corsair.clickup.api.timeEntries.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `tid` | `string` | No | — | | `description` | `string` | No | — | | `billable` | `boolean` | No | — | | `tags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### stop `timeEntries.stop` Stop the running time entry **Risk:** `write` ```ts theme={null} await corsair.clickup.api.timeEntries.stop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### tagsAdd `timeEntries.tagsAdd` Add tags to time entries **Risk:** `write` ```ts theme={null} await corsair.clickup.api.timeEntries.tagsAdd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `tags` | `string[]` | Yes | — | | `timer_ids` | `string[]` | Yes | — | **Output:** *empty object* *** ### tagsGetAll `timeEntries.tagsGetAll` List all time entry tags in a Workspace **Risk:** `read` ```ts theme={null} await corsair.clickup.api.timeEntries.tagsGetAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### tagsRemove `timeEntries.tagsRemove` Remove tags from time entries **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.timeEntries.tagsRemove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `tags` | `string[]` | Yes | — | | `timer_ids` | `string[]` | Yes | — | **Output:** *empty object* *** ### tagsUpdate `timeEntries.tagsUpdate` Rename a time entry tag **Risk:** `write` ```ts theme={null} await corsair.clickup.api.timeEntries.tagsUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `new_name` | `string` | No | — | | `background_color` | `string` | No | — | | `foreground_color` | `string` | No | — | **Output:** *empty object* *** ### update `timeEntries.update` Update a time entry **Risk:** `write` ```ts theme={null} await corsair.clickup.api.timeEntries.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `timer_id` | `string` | Yes | — | | `description` | `string` | No | — | | `start` | `number` | No | — | | `end` | `number` | No | — | | `duration` | `number` | No | — | | `tid` | `string` | No | — | | `billable` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `tag_action` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Users ### get `users.get` Get a Workspace user **Risk:** `read` ```ts theme={null} await corsair.clickup.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > } > ``` *** ### invite `users.invite` Invite a user to a Workspace **Risk:** `write` ```ts theme={null} await corsair.clickup.api.users.invite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `email` | `string` | Yes | — | | `admin` | `boolean` | No | — | | `custom_role` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > } > ``` *** ### remove `users.remove` Remove a user from a Workspace **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.users.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | **Output:** *empty object* *** ### update `users.update` Update a Workspace user **Risk:** `write` ```ts theme={null} await corsair.clickup.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | | `username` | `string` | No | — | | `admin` | `boolean` | No | — | | `custom_role` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > } > ``` *** ## Views ### chatCommentsCreate `views.chatCommentsCreate` Comment on a Chat view **Risk:** `write` ```ts theme={null} await corsair.clickup.api.views.chatCommentsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `view_id` | `string` | Yes | — | | `comment_text` | `string` | Yes | — | | `assignee` | `number` | No | — | | `notify_all` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### chatCommentsGet `views.chatCommentsGet` Get comments on a Chat view **Risk:** `read` ```ts theme={null} await corsair.clickup.api.views.chatCommentsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `view_id` | `string` | Yes | — | | `start` | `number` | No | — | | `start_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `comments` | `object[]` | No | — | > **comments full type** > > ```ts theme={null} > { > }[] > ``` *** ### delete `views.delete` Delete a View **Risk:** `destructive` ```ts theme={null} await corsair.clickup.api.views.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `view_id` | `string` | Yes | — | **Output:** `undefined` *** ### get `views.get` Get a single View **Risk:** `read` ```ts theme={null} await corsair.clickup.api.views.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `view_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### tasks `views.tasks` List Tasks visible in a View **Risk:** `read` ```ts theme={null} await corsair.clickup.api.views.tasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `view_id` | `string` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tasks` | `object[]` | No | — | | `last_page` | `boolean` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### update `views.update` Update a View **Risk:** `write` ```ts theme={null} await corsair.clickup.api.views.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `view_id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `list \| board \| calendar \| table \| timeline \| workload \| activity \| map \| chat \| gantt` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ## Workspace Acl ### update `workspaceAcl.update` Update privacy and access for a Workspace object **Risk:** `write` ```ts theme={null} await corsair.clickup.api.workspaceAcl.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `object_type` | `space \| folder \| list \| task \| view \| doc \| goal \| dashboard \| whiteboard` | Yes | — | | `object_id` | `string` | Yes | — | | `private` | `boolean` | No | — | | `grants` | `object[]` | No | — | > **grants full type** > > ```ts theme={null} > { > kind: user | group, > id: string, > permission_level: 1 | 3 | 4 | 5 | null > }[] > ``` **Output:** *empty object* *** ## Workspaces ### authorizedUser `workspaces.authorizedUser` Get the authorized ClickUp user **Risk:** `read` ```ts theme={null} await corsair.clickup.api.workspaces.authorizedUser({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: number, > username: string, > email: string > } > ``` *** ### customRoles `workspaces.customRoles` List Workspace custom roles **Risk:** `read` ```ts theme={null} await corsair.clickup.api.workspaces.customRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `include_members` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `custom_roles` | `object[]` | No | — | > **custom\_roles full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### customTaskTypes `workspaces.customTaskTypes` List Workspace custom task types **Risk:** `read` ```ts theme={null} await corsair.clickup.api.workspaces.customTaskTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `custom_items` | `object[]` | No | — | > **custom\_items full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### everythingViewsCreate `workspaces.everythingViewsCreate` Create an Everything-level Workspace view **Risk:** `write` ```ts theme={null} await corsair.clickup.api.workspaces.everythingViewsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `list \| board \| calendar \| table \| timeline \| workload \| activity \| map \| chat \| gantt` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### everythingViewsGet `workspaces.everythingViewsGet` List Everything-level Workspace views **Risk:** `read` ```ts theme={null} await corsair.clickup.api.workspaces.everythingViewsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `views` | `object[]` | No | — | > **views full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### get `workspaces.get` List Workspaces (Teams) **Risk:** `read` ```ts theme={null} await corsair.clickup.api.workspaces.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `teams` | `object[]` | No | — | > **teams full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### plan `workspaces.plan` Get the Workspace subscription plan **Risk:** `read` ```ts theme={null} await corsair.clickup.api.workspaces.plan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `plan` | `string` | No | — | *** ### seats `workspaces.seats` Get Workspace seat utilization **Risk:** `read` ```ts theme={null} await corsair.clickup.api.workspaces.seats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `seats` | `object[]` | No | — | > **seats full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ### sharedHierarchy `workspaces.sharedHierarchy` Get hierarchy shared with the authorized user **Risk:** `read` ```ts theme={null} await corsair.clickup.api.workspaces.sharedHierarchy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `shared` | `object` | No | — | > **shared full type** > > ```ts theme={null} > { > } > ``` *** ### teamFields `workspaces.teamFields` List Workspace-level custom fields **Risk:** `read` ```ts theme={null} await corsair.clickup.api.workspaces.teamFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/clickup/database Clickup local sync: searchable entities, `.search()` filters, and operators. The Clickup plugin syncs data locally. Use `corsair.clickup.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/clickup/overview Clickup plugin for Corsair Use **Clickup** through Corsair: one client, typed API calls. **What you get:** * 157 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/clickup ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/clickup ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/clickup ``` ```bash bun theme={null} bun add corsair @corsair-dev/clickup ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { clickup } from '@corsair-dev/clickup'; export const corsair = createCorsair({ plugins: [ clickup(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} clickup() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'clickup', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`chat.channelsFollowers`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clickup.api.chat.channelsFollowers({}); ``` **`chat.channelsCreate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clickup.api.chat.channelsCreate({}); ``` See the full list on the [API](/plugins/clickup/api) page. ## What's next > **[API reference](/plugins/clickup/api)** > > Every `clickup.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/clientary/api API reference for Clientary: every `clientary.api.*` operation with input and output types. Every `clientary.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Clients ### create `clients.create` Create a client **Risk:** `write` ```ts theme={null} await corsair.clientary.api.clients.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Client name | | `number` | `string` | No | Client number (unique) | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `name` | `string` | Yes | — | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | *** ### delete `clients.delete` Delete a client and all associated projects, invoices, estimates, and contacts **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.clients.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Client ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `clients.get` Get a client by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.clients.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Client ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `name` | `string` | Yes | — | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | *** ### list `clients.list` List clients **Risk:** `read` ```ts theme={null} await corsair.clientary.api.clients.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | | `updated_since` | `string` | No | Only return clients updated since this date (YYYY-MM-DD) | | `sort` | `date` | No | Sort by most recently created | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `clients` | `object[]` | Yes | — | > **clients full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > name: string, > city?: string | null, > address?: string | null, > address_2?: string | null, > zip?: string | null, > country?: string | null, > state?: string | null, > website?: string | null, > description?: string | null, > invoice_extra_fields?: any | null > }[] > ``` *** ### update `clients.update` Update a client **Risk:** `write` ```ts theme={null} await corsair.clientary.api.clients.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Client ID | | `name` | `string` | No | Client name | | `number` | `string` | No | Client number (unique) | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `name` | `string` | Yes | — | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | *** ## Contacts ### create `contacts.create` Create a contact **Risk:** `write` ```ts theme={null} await corsair.clientary.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | Client the contact belongs to | | `name` | `string` | Yes | Contact name | | `email` | `string` | Yes | Contact email | | `title` | `string` | No | — | | `phone` | `string` | No | — | | `mobile` | `string` | No | — | | `ext` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `name` | `string` | Yes | — | | `email` | `string` | No | — | | `title` | `string` | No | — | | `phone` | `string` | No | — | | `mobile` | `string` | No | — | | `ext` | `string` | No | — | | `avatar` | `string` | No | — | *** ### delete `contacts.delete` Delete a contact **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Contact ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `contacts.get` Get a contact by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Contact ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `name` | `string` | Yes | — | | `email` | `string` | No | — | | `title` | `string` | No | — | | `phone` | `string` | No | — | | `mobile` | `string` | No | — | | `ext` | `string` | No | — | | `avatar` | `string` | No | — | *** ### list `contacts.list` List contacts **Risk:** `read` ```ts theme={null} await corsair.clientary.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `contacts` | `object[]` | Yes | — | > **contacts full type** > > ```ts theme={null} > { > id: number, > client_id?: number | null, > name: string, > email?: string | null, > title?: string | null, > phone?: string | null, > mobile?: string | null, > ext?: string | null, > avatar?: string | null > }[] > ``` *** ### listForClient `contacts.listForClient` List contacts belonging to a client **Risk:** `read` ```ts theme={null} await corsair.clientary.api.contacts.listForClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | Client ID to scope contacts by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `contacts` | `object[]` | Yes | — | > **contacts full type** > > ```ts theme={null} > { > id: number, > client_id?: number | null, > name: string, > email?: string | null, > title?: string | null, > phone?: string | null, > mobile?: string | null, > ext?: string | null, > avatar?: string | null > }[] > ``` *** ### update `contacts.update` Update a contact **Risk:** `write` ```ts theme={null} await corsair.clientary.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Contact ID | | `name` | `string` | No | Contact name | | `email` | `string` | No | Contact email | | `title` | `string` | No | — | | `phone` | `string` | No | — | | `mobile` | `string` | No | — | | `ext` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `name` | `string` | Yes | — | | `email` | `string` | No | — | | `title` | `string` | No | — | | `phone` | `string` | No | — | | `mobile` | `string` | No | — | | `ext` | `string` | No | — | | `avatar` | `string` | No | — | *** ## Estimates ### create `estimates.create` Create an estimate **Risk:** `write` ```ts theme={null} await corsair.clientary.api.estimates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `number` | `number` | No | Estimate number (autoincrements) | | `date` | `string` | Yes | Estimate date (YYYY-MM-DD) | | `currency_code` | `string` | Yes | ISO currency code, e.g. USD | | `title` | `string` | No | — | | `note` | `string` | No | — | | `client_id` | `number` | No | — | | `status` | `number` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `tax3` | `number` | No | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | No | — | | `summary` | `string` | No | — | | `estimate_items_attributes` | `object[]` | No | Estimate line items | > **estimate\_items\_attributes full type** > > ```ts theme={null} > { > id?: number, > _destroy?: boolean, > title?: string, > quantity?: number, > price?: number, > taxable?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `title` | `string` | No | — | | `date` | `string` | Yes | — | | `client_id` | `number` | No | — | | `note` | `string` | No | — | | `status` | `number` | Yes | — | | `currency_code` | `string` | Yes | — | | `subtotal` | `number` | Yes | — | | `total_cost` | `number` | Yes | — | | `tax` | `number` | Yes | — | | `tax2` | `number` | Yes | — | | `tax3` | `number` | Yes | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | Yes | — | | `summary` | `string` | No | — | | `estimate_items` | `object[]` | No | — | > **estimate\_items full type** > > ```ts theme={null} > { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[] > ``` *** ### delete `estimates.delete` Delete an estimate **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.estimates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Estimate ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `estimates.get` Get an estimate by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.estimates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Estimate ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `title` | `string` | No | — | | `date` | `string` | Yes | — | | `client_id` | `number` | No | — | | `note` | `string` | No | — | | `status` | `number` | Yes | — | | `currency_code` | `string` | Yes | — | | `subtotal` | `number` | Yes | — | | `total_cost` | `number` | Yes | — | | `tax` | `number` | Yes | — | | `tax2` | `number` | Yes | — | | `tax3` | `number` | Yes | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | Yes | — | | `summary` | `string` | No | — | | `estimate_items` | `object[]` | No | — | > **estimate\_items full type** > > ```ts theme={null} > { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[] > ``` *** ### list `estimates.list` List estimates **Risk:** `read` ```ts theme={null} await corsair.clientary.api.estimates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `estimates` | `object[]` | Yes | — | > **estimates full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > title?: string | null, > date: string, > client_id?: number | null, > note?: string | null, > status: number, > currency_code: string, > subtotal: number, > total_cost: number, > tax: number, > tax2: number, > tax3: number, > tax_label?: string | null, > tax2_label?: string | null, > tax3_label?: string | null, > compound_tax: boolean, > summary?: string | null, > estimate_items?: { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[] > }[] > ``` *** ### listForClient `estimates.listForClient` List estimates belonging to a client **Risk:** `read` ```ts theme={null} await corsair.clientary.api.estimates.listForClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | Client ID to scope estimates by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `estimates` | `object[]` | Yes | — | > **estimates full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > title?: string | null, > date: string, > client_id?: number | null, > note?: string | null, > status: number, > currency_code: string, > subtotal: number, > total_cost: number, > tax: number, > tax2: number, > tax3: number, > tax_label?: string | null, > tax2_label?: string | null, > tax3_label?: string | null, > compound_tax: boolean, > summary?: string | null, > estimate_items?: { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[] > }[] > ``` *** ### listForProject `estimates.listForProject` List estimates belonging to a project **Risk:** `read` ```ts theme={null} await corsair.clientary.api.estimates.listForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | Project ID to scope estimates by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `estimates` | `object[]` | Yes | — | > **estimates full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > title?: string | null, > date: string, > client_id?: number | null, > note?: string | null, > status: number, > currency_code: string, > subtotal: number, > total_cost: number, > tax: number, > tax2: number, > tax3: number, > tax_label?: string | null, > tax2_label?: string | null, > tax3_label?: string | null, > compound_tax: boolean, > summary?: string | null, > estimate_items?: { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[] > }[] > ``` *** ### send `estimates.send` Send an estimate via email **Risk:** `write` ```ts theme={null} await corsair.clientary.api.estimates.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Estimate ID to send | | `recipients` | `string[]` | Yes | Recipient email addresses | | `subject` | `string` | No | Email subject line | | `message` | `string` | No | Email body message | | `send_copy` | `boolean \| number` | No | Send a copy to the sending user | | `attach_pdf` | `boolean \| number` | No | Attach a PDF of the estimate | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sent` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### update `estimates.update` Update an estimate **Risk:** `write` ```ts theme={null} await corsair.clientary.api.estimates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Estimate ID | | `number` | `number` | No | Estimate number (autoincrements) | | `date` | `string` | No | Estimate date (YYYY-MM-DD) | | `currency_code` | `string` | No | ISO currency code, e.g. USD | | `title` | `string` | No | — | | `note` | `string` | No | — | | `client_id` | `number` | No | — | | `status` | `number` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `tax3` | `number` | No | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | No | — | | `summary` | `string` | No | — | | `estimate_items_attributes` | `object[]` | No | Estimate line items | > **estimate\_items\_attributes full type** > > ```ts theme={null} > { > id?: number, > _destroy?: boolean, > title?: string, > quantity?: number, > price?: number, > taxable?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `title` | `string` | No | — | | `date` | `string` | Yes | — | | `client_id` | `number` | No | — | | `note` | `string` | No | — | | `status` | `number` | Yes | — | | `currency_code` | `string` | Yes | — | | `subtotal` | `number` | Yes | — | | `total_cost` | `number` | Yes | — | | `tax` | `number` | Yes | — | | `tax2` | `number` | Yes | — | | `tax3` | `number` | Yes | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | Yes | — | | `summary` | `string` | No | — | | `estimate_items` | `object[]` | No | — | > **estimate\_items full type** > > ```ts theme={null} > { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[] > ``` *** ## Expenses ### create `expenses.create` Create an expense **Risk:** `write` ```ts theme={null} await corsair.clientary.api.expenses.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | Expense amount | | `description` | `string` | No | — | | `incurred_on` | `string` | No | Date incurred (YYYY-MM-DD) | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | | `invoice_id` | `number` | No | — | | `invoice_item_id` | `number` | No | — | | `user_id` | `number` | No | — | | `amount` | `number` | Yes | — | | `description` | `string` | No | — | | `incurred_on` | `string` | Yes | — | *** ### delete `expenses.delete` Delete an expense **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.expenses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Expense ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `expenses.get` Get an expense by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.expenses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Expense ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | | `invoice_id` | `number` | No | — | | `invoice_item_id` | `number` | No | — | | `user_id` | `number` | No | — | | `amount` | `number` | Yes | — | | `description` | `string` | No | — | | `incurred_on` | `string` | Yes | — | *** ### list `expenses.list` List expenses **Risk:** `read` ```ts theme={null} await corsair.clientary.api.expenses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_date` | `string` | No | Start of date range (YYYY-MM-DD) | | `to_date` | `string` | No | End of date range (YYYY-MM-DD) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_count` | `number` | Yes | — | | `from_date` | `string` | Yes | — | | `to_date` | `string` | Yes | — | | `expenses` | `object[]` | Yes | — | > **expenses full type** > > ```ts theme={null} > { > id: number, > client_id?: number | null, > project_id?: number | null, > invoice_id?: number | null, > invoice_item_id?: number | null, > user_id?: number | null, > amount: number, > description?: string | null, > incurred_on: string > }[] > ``` *** ### listForClient `expenses.listForClient` List expenses belonging to a client **Risk:** `read` ```ts theme={null} await corsair.clientary.api.expenses.listForClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | Client ID to scope expenses by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_count` | `number` | Yes | — | | `from_date` | `string` | Yes | — | | `to_date` | `string` | Yes | — | | `expenses` | `object[]` | Yes | — | > **expenses full type** > > ```ts theme={null} > { > id: number, > client_id?: number | null, > project_id?: number | null, > invoice_id?: number | null, > invoice_item_id?: number | null, > user_id?: number | null, > amount: number, > description?: string | null, > incurred_on: string > }[] > ``` *** ### listForProject `expenses.listForProject` List expenses belonging to a project **Risk:** `read` ```ts theme={null} await corsair.clientary.api.expenses.listForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | Project ID to scope expenses by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_count` | `number` | Yes | — | | `from_date` | `string` | Yes | — | | `to_date` | `string` | Yes | — | | `expenses` | `object[]` | Yes | — | > **expenses full type** > > ```ts theme={null} > { > id: number, > client_id?: number | null, > project_id?: number | null, > invoice_id?: number | null, > invoice_item_id?: number | null, > user_id?: number | null, > amount: number, > description?: string | null, > incurred_on: string > }[] > ``` *** ### update `expenses.update` Update an expense **Risk:** `write` ```ts theme={null} await corsair.clientary.api.expenses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Expense ID | | `amount` | `number` | No | Expense amount | | `description` | `string` | No | — | | `incurred_on` | `string` | No | Date incurred (YYYY-MM-DD) | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | | `invoice_id` | `number` | No | — | | `invoice_item_id` | `number` | No | — | | `user_id` | `number` | No | — | | `amount` | `number` | Yes | — | | `description` | `string` | No | — | | `incurred_on` | `string` | Yes | — | *** ## Hours ### create `hours.create` Log hours to a project **Risk:** `write` ```ts theme={null} await corsair.clientary.api.hours.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | Project to log hours against | | `hours` | `number` | Yes | Number of hours logged | | `title` | `string` | Yes | Title of the logged work | | `description` | `string` | No | — | | `date` | `string` | No | Date logged (YYYY-MM-DD) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `user_id` | `number` | No | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `date` | `string` | Yes | — | | `hours` | `number` | Yes | — | | `rate` | `number` | No | — | | `cost` | `number` | No | — | | `billed?` | `boolean` | No | — | *** ### delete `hours.delete` Delete an hours entry **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.hours.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Hours entry ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `hours.get` Get an hours entry by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.hours.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Hours entry ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `user_id` | `number` | No | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `date` | `string` | Yes | — | | `hours` | `number` | Yes | — | | `rate` | `number` | No | — | | `cost` | `number` | No | — | | `billed?` | `boolean` | No | — | *** ### listForProject `hours.listForProject` List hours logged against a project **Risk:** `read` ```ts theme={null} await corsair.clientary.api.hours.listForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | Project ID to scope hours by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | | `filter` | `billed \| unbilled` | No | Narrow to billed or unbilled hours | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hours` | `object[]` | Yes | — | > **hours full type** > > ```ts theme={null} > { > id: number, > project_id: number, > user_id?: number | null, > title: string, > description?: string | null, > date: string, > hours: number, > rate?: number | null, > cost?: number | null, > billed??: boolean > }[] > ``` *** ### update `hours.update` Update an hours entry **Risk:** `write` ```ts theme={null} await corsair.clientary.api.hours.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Hours entry ID | | `hours` | `number` | No | Number of hours logged | | `title` | `string` | No | Title of the logged work | | `description` | `string` | No | — | | `date` | `string` | No | Date logged (YYYY-MM-DD) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `user_id` | `number` | No | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `date` | `string` | Yes | — | | `hours` | `number` | Yes | — | | `rate` | `number` | No | — | | `cost` | `number` | No | — | | `billed?` | `boolean` | No | — | *** ## Invoices ### create `invoices.create` Create an invoice **Risk:** `write` ```ts theme={null} await corsair.clientary.api.invoices.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `number` | `number` | No | Invoice number (autoincrements) | | `date` | `string` | Yes | Invoice date (YYYY-MM-DD) | | `due_date` | `string` | Yes | Invoice due date (YYYY-MM-DD) | | `currency_code` | `string` | Yes | ISO currency code, e.g. USD | | `title` | `string` | No | — | | `note` | `string` | No | — | | `po` | `string` | No | — | | `client_id` | `number` | No | — | | `status` | `number` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `tax3` | `number` | No | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | No | — | | `summary` | `string` | No | — | | `invoice_items_attributes` | `object[]` | No | Invoice line items | > **invoice\_items\_attributes full type** > > ```ts theme={null} > { > id?: number, > _destroy?: boolean, > title?: string, > quantity?: number, > price?: number, > taxable?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `title` | `string` | No | — | | `date` | `string` | Yes | — | | `due_date` | `string` | No | — | | `client_id` | `number` | No | — | | `note` | `string` | No | — | | `po` | `string` | No | — | | `status` | `number` | Yes | — | | `currency_code` | `string` | Yes | — | | `subtotal` | `number` | Yes | — | | `total_cost` | `number` | Yes | — | | `balance` | `number` | Yes | — | | `total_payments` | `number` | Yes | — | | `tax` | `number` | Yes | — | | `tax2` | `number` | Yes | — | | `tax3` | `number` | Yes | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | Yes | — | | `summary` | `string` | No | — | | `invoice_items` | `object[]` | No | — | | `payments` | `object[]` | No | — | | `recurring_schedules` | `object[]` | No | — | > **invoice\_items full type** > > ```ts theme={null} > { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[] > ``` > **payments full type** > > ```ts theme={null} > { > id: number, > amount: number, > note?: string | null, > received_on: string, > invoice_id?: number | null, > updated_at?: string | null > }[] > ``` > **recurring\_schedules full type** > > ```ts theme={null} > { > id: number > }[] > ``` *** ### delete `invoices.delete` Delete an invoice **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.invoices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Invoice ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `invoices.get` Get an invoice by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.invoices.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Invoice ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `title` | `string` | No | — | | `date` | `string` | Yes | — | | `due_date` | `string` | No | — | | `client_id` | `number` | No | — | | `note` | `string` | No | — | | `po` | `string` | No | — | | `status` | `number` | Yes | — | | `currency_code` | `string` | Yes | — | | `subtotal` | `number` | Yes | — | | `total_cost` | `number` | Yes | — | | `balance` | `number` | Yes | — | | `total_payments` | `number` | Yes | — | | `tax` | `number` | Yes | — | | `tax2` | `number` | Yes | — | | `tax3` | `number` | Yes | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | Yes | — | | `summary` | `string` | No | — | | `invoice_items` | `object[]` | No | — | | `payments` | `object[]` | No | — | | `recurring_schedules` | `object[]` | No | — | > **invoice\_items full type** > > ```ts theme={null} > { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[] > ``` > **payments full type** > > ```ts theme={null} > { > id: number, > amount: number, > note?: string | null, > received_on: string, > invoice_id?: number | null, > updated_at?: string | null > }[] > ``` > **recurring\_schedules full type** > > ```ts theme={null} > { > id: number > }[] > ``` *** ### list `invoices.list` List invoices **Risk:** `read` ```ts theme={null} await corsair.clientary.api.invoices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | | `updated_since` | `string` | No | Only return invoices updated since this date (YYYY-MM-DD) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `invoices` | `object[]` | Yes | — | > **invoices full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > title?: string | null, > date: string, > due_date?: string | null, > client_id?: number | null, > note?: string | null, > po?: string | null, > status: number, > currency_code: string, > subtotal: number, > total_cost: number, > balance: number, > total_payments: number, > tax: number, > tax2: number, > tax3: number, > tax_label?: string | null, > tax2_label?: string | null, > tax3_label?: string | null, > compound_tax: boolean, > summary?: string | null, > invoice_items?: { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[], > payments?: { > id: number, > amount: number, > note?: string | null, > received_on: string, > invoice_id?: number | null, > updated_at?: string | null > }[], > recurring_schedules?: { > id: number > }[] > }[] > ``` *** ### listForClient `invoices.listForClient` List invoices belonging to a client **Risk:** `read` ```ts theme={null} await corsair.clientary.api.invoices.listForClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | Client ID to scope invoices by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `invoices` | `object[]` | Yes | — | > **invoices full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > title?: string | null, > date: string, > due_date?: string | null, > client_id?: number | null, > note?: string | null, > po?: string | null, > status: number, > currency_code: string, > subtotal: number, > total_cost: number, > balance: number, > total_payments: number, > tax: number, > tax2: number, > tax3: number, > tax_label?: string | null, > tax2_label?: string | null, > tax3_label?: string | null, > compound_tax: boolean, > summary?: string | null, > invoice_items?: { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[], > payments?: { > id: number, > amount: number, > note?: string | null, > received_on: string, > invoice_id?: number | null, > updated_at?: string | null > }[], > recurring_schedules?: { > id: number > }[] > }[] > ``` *** ### listForProject `invoices.listForProject` List invoices belonging to a project **Risk:** `read` ```ts theme={null} await corsair.clientary.api.invoices.listForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | Project ID to scope invoices by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `invoices` | `object[]` | Yes | — | > **invoices full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > title?: string | null, > date: string, > due_date?: string | null, > client_id?: number | null, > note?: string | null, > po?: string | null, > status: number, > currency_code: string, > subtotal: number, > total_cost: number, > balance: number, > total_payments: number, > tax: number, > tax2: number, > tax3: number, > tax_label?: string | null, > tax2_label?: string | null, > tax3_label?: string | null, > compound_tax: boolean, > summary?: string | null, > invoice_items?: { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[], > payments?: { > id: number, > amount: number, > note?: string | null, > received_on: string, > invoice_id?: number | null, > updated_at?: string | null > }[], > recurring_schedules?: { > id: number > }[] > }[] > ``` *** ### listForRecurring `invoices.listForRecurring` List invoices generated by a recurring schedule **Risk:** `read` ```ts theme={null} await corsair.clientary.api.invoices.listForRecurring({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recurring_id` | `number` | Yes | Recurring schedule ID to scope invoices by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `invoices` | `object[]` | Yes | — | > **invoices full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > title?: string | null, > date: string, > due_date?: string | null, > client_id?: number | null, > note?: string | null, > po?: string | null, > status: number, > currency_code: string, > subtotal: number, > total_cost: number, > balance: number, > total_payments: number, > tax: number, > tax2: number, > tax3: number, > tax_label?: string | null, > tax2_label?: string | null, > tax3_label?: string | null, > compound_tax: boolean, > summary?: string | null, > invoice_items?: { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[], > payments?: { > id: number, > amount: number, > note?: string | null, > received_on: string, > invoice_id?: number | null, > updated_at?: string | null > }[], > recurring_schedules?: { > id: number > }[] > }[] > ``` *** ### send `invoices.send` Send an invoice via email **Risk:** `write` ```ts theme={null} await corsair.clientary.api.invoices.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Estimate ID to send | | `recipients` | `string[]` | Yes | Recipient email addresses | | `subject` | `string` | No | Email subject line | | `message` | `string` | No | Email body message | | `send_copy` | `boolean \| number` | No | Send a copy to the sending user | | `attach_pdf` | `boolean \| number` | No | Attach a PDF of the estimate | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sent` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### update `invoices.update` Update an invoice **Risk:** `write` ```ts theme={null} await corsair.clientary.api.invoices.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Invoice ID | | `number` | `number` | No | Invoice number (autoincrements) | | `date` | `string` | No | Invoice date (YYYY-MM-DD) | | `due_date` | `string` | No | Invoice due date (YYYY-MM-DD) | | `currency_code` | `string` | No | ISO currency code, e.g. USD | | `title` | `string` | No | — | | `note` | `string` | No | — | | `po` | `string` | No | — | | `client_id` | `number` | No | — | | `status` | `number` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `tax3` | `number` | No | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | No | — | | `summary` | `string` | No | — | | `invoice_items_attributes` | `object[]` | No | Invoice line items | > **invoice\_items\_attributes full type** > > ```ts theme={null} > { > id?: number, > _destroy?: boolean, > title?: string, > quantity?: number, > price?: number, > taxable?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `title` | `string` | No | — | | `date` | `string` | Yes | — | | `due_date` | `string` | No | — | | `client_id` | `number` | No | — | | `note` | `string` | No | — | | `po` | `string` | No | — | | `status` | `number` | Yes | — | | `currency_code` | `string` | Yes | — | | `subtotal` | `number` | Yes | — | | `total_cost` | `number` | Yes | — | | `balance` | `number` | Yes | — | | `total_payments` | `number` | Yes | — | | `tax` | `number` | Yes | — | | `tax2` | `number` | Yes | — | | `tax3` | `number` | Yes | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | Yes | — | | `summary` | `string` | No | — | | `invoice_items` | `object[]` | No | — | | `payments` | `object[]` | No | — | | `recurring_schedules` | `object[]` | No | — | > **invoice\_items full type** > > ```ts theme={null} > { > id: number, > title: string, > price: number | string, > quantity: number, > taxable?: boolean > }[] > ``` > **payments full type** > > ```ts theme={null} > { > id: number, > amount: number, > note?: string | null, > received_on: string, > invoice_id?: number | null, > updated_at?: string | null > }[] > ``` > **recurring\_schedules full type** > > ```ts theme={null} > { > id: number > }[] > ``` *** ## Leads ### create `leads.create` Create a lead **Risk:** `write` ```ts theme={null} await corsair.clientary.api.leads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Client name | | `number` | `string` | No | Client number (unique) | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `name` | `string` | Yes | — | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | *** ### delete `leads.delete` Delete a lead **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.leads.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Lead ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `leads.get` Get a lead by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.leads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Lead ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `name` | `string` | Yes | — | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | *** ### list `leads.list` List leads **Risk:** `read` ```ts theme={null} await corsair.clientary.api.leads.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | | `sort` | `name \| oldest` | No | Sort by name or oldest first | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `leads` | `object[]` | Yes | — | > **leads full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > name: string, > city?: string | null, > address?: string | null, > address_2?: string | null, > zip?: string | null, > country?: string | null, > state?: string | null, > website?: string | null, > description?: string | null, > invoice_extra_fields?: any | null > }[] > ``` *** ### update `leads.update` Update a lead **Risk:** `write` ```ts theme={null} await corsair.clientary.api.leads.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Lead ID | | `name` | `string` | No | Client name | | `number` | `string` | No | Client number (unique) | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `name` | `string` | Yes | — | | `city` | `string` | No | — | | `address` | `string` | No | — | | `address_2` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `state` | `string` | No | — | | `website` | `string` | No | — | | `description` | `string` | No | — | | `invoice_extra_fields` | `any` | No | — | *** ## Payment Profiles ### create `paymentProfiles.create` Create a payment profile for a client **Risk:** `write` ```ts theme={null} await corsair.clientary.api.paymentProfiles.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | Client to attach the payment profile to | | `stripe_customer_id` | `string` | Yes | Stripe customer ID | | `stripe_source_id` | `string` | Yes | Stripe source ID | | `last_four_digits` | `string` | Yes | Last four digits of the card | | `name` | `string` | Yes | Cardholder name | | `expiration_date` | `string` | Yes | Card expiration date (YYYY-MM-DD) | | `card_type` | `string` | No | Card brand, e.g. Visa | | `address` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `gateway` | `string` | Yes | — | | `gateway_token` | `string` | No | — | | `address` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | | `expiration_date` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### delete `paymentProfiles.delete` Delete a payment profile **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.paymentProfiles.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | Client the payment profile belongs to | | `id` | `number` | Yes | Payment profile ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### listForClient `paymentProfiles.listForClient` List payment profiles for a client **Risk:** `read` ```ts theme={null} await corsair.clientary.api.paymentProfiles.listForClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | Client ID to scope payment profiles by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `payment_profiles` | `object[]` | Yes | — | > **payment\_profiles full type** > > ```ts theme={null} > { > id: number, > client_id: number, > name: string, > gateway: string, > gateway_token?: string | null, > address?: string | null, > city?: string | null, > state?: string | null, > zip?: string | null, > country?: string | null, > expiration_date?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` *** ## Payments ### create `payments.create` Record a payment **Risk:** `write` ```ts theme={null} await corsair.clientary.api.payments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | Invoice to apply the payment to | | `amount` | `number` | No | Payment amount | | `note` | `string` | No | Payment note | | `payment_profile_id` | `number` | No | Auto-charge this payment profile for the outstanding balance | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `invoice_id` | `number` | Yes | — | | `amount` | `number` | Yes | — | | `note` | `string` | No | — | | `received_on` | `string` | Yes | — | | `transaction_id` | `string` | No | — | | `transaction_fee_amount` | `number` | No | — | *** ### delete `payments.delete` Delete (void) a payment **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.payments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | Invoice the payment belongs to | | `id` | `number` | Yes | Payment ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### list `payments.list` List payments **Risk:** `read` ```ts theme={null} await corsair.clientary.api.payments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | | `sort` | `created_at` | No | Sort by record creation time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_size` | `number` | Yes | — | | `page_count` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `payments` | `object[]` | Yes | — | > **payments full type** > > ```ts theme={null} > { > id: number, > invoice_id: number, > amount: number, > note?: string | null, > received_on: string, > transaction_id?: string | null, > transaction_fee_amount?: number | null > }[] > ``` *** ## Projects ### create `projects.create` Create a project **Risk:** `write` ```ts theme={null} await corsair.clientary.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Project name | | `number` | `string` | No | Project number (unique) | | `rate` | `number` | Yes | Hourly rate (or total cost for fixed amount) | | `client_id` | `number` | No | — | | `description` | `string` | No | — | | `status` | `number` | No | — | | `budget_type` | `0 \| 1` | No | 0 = total budgeted hours, 1 = total budgeted amount | | `project_type` | `0 \| 2` | No | 0 = hourly rate, 2 = fixed amount | | `budget` | `number` | No | — | | `currency_code` | `string` | No | — | | `start_date` | `string` | No | Start date (YYYY-MM-DD) | | `end_date` | `string` | No | End date (YYYY-MM-DD) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `status` | `number` | Yes | — | | `budget_type` | `number` | Yes | — | | `project_type` | `number` | Yes | — | | `budget` | `number` | No | — | | `rate` | `number` | No | — | | `cost` | `number` | No | — | | `worked_hours` | `number` | No | — | | `unbilled_hours` | `number` | No | — | | `currency_code` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `client` | `object` | No | — | > **client full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > name: string, > city?: string | null, > address?: string | null, > address_2?: string | null, > zip?: string | null, > country?: string | null, > state?: string | null, > website?: string | null, > description?: string | null, > invoice_extra_fields?: any | null > } > ``` *** ### delete `projects.delete` Delete a project **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Project ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `projects.get` Get a project by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Project ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `status` | `number` | Yes | — | | `budget_type` | `number` | Yes | — | | `project_type` | `number` | Yes | — | | `budget` | `number` | No | — | | `rate` | `number` | No | — | | `cost` | `number` | No | — | | `worked_hours` | `number` | No | — | | `unbilled_hours` | `number` | No | — | | `currency_code` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `client` | `object` | No | — | > **client full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > name: string, > city?: string | null, > address?: string | null, > address_2?: string | null, > zip?: string | null, > country?: string | null, > state?: string | null, > website?: string | null, > description?: string | null, > invoice_extra_fields?: any | null > } > ``` *** ### list `projects.list` List projects **Risk:** `read` ```ts theme={null} await corsair.clientary.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | | `filter` | `all` | No | Include closed projects (default: active/billable only) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `projects` | `object[]` | Yes | — | > **projects full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > name: string, > description?: string | null, > status: number, > budget_type: number, > project_type: number, > budget?: number | null, > rate?: number | null, > cost?: number | null, > worked_hours?: number | null, > unbilled_hours?: number | null, > currency_code?: string | null, > start_date?: string | null, > end_date?: string | null, > client?: { > id: number, > number?: string | null, > name: string, > city?: string | null, > address?: string | null, > address_2?: string | null, > zip?: string | null, > country?: string | null, > state?: string | null, > website?: string | null, > description?: string | null, > invoice_extra_fields?: any | null > } | null > }[] > ``` *** ### listForClient `projects.listForClient` List projects belonging to a client **Risk:** `read` ```ts theme={null} await corsair.clientary.api.projects.listForClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | Client ID to scope projects by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `projects` | `object[]` | Yes | — | > **projects full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > name: string, > description?: string | null, > status: number, > budget_type: number, > project_type: number, > budget?: number | null, > rate?: number | null, > cost?: number | null, > worked_hours?: number | null, > unbilled_hours?: number | null, > currency_code?: string | null, > start_date?: string | null, > end_date?: string | null, > client?: { > id: number, > number?: string | null, > name: string, > city?: string | null, > address?: string | null, > address_2?: string | null, > zip?: string | null, > country?: string | null, > state?: string | null, > website?: string | null, > description?: string | null, > invoice_extra_fields?: any | null > } | null > }[] > ``` *** ### update `projects.update` Update a project **Risk:** `write` ```ts theme={null} await corsair.clientary.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Project ID | | `name` | `string` | No | Project name | | `number` | `string` | No | Project number (unique) | | `rate` | `number` | No | Hourly rate (or total cost for fixed amount) | | `client_id` | `number` | No | — | | `description` | `string` | No | — | | `status` | `number` | No | — | | `budget_type` | `0 \| 1` | No | 0 = total budgeted hours, 1 = total budgeted amount | | `project_type` | `0 \| 2` | No | 0 = hourly rate, 2 = fixed amount | | `budget` | `number` | No | — | | `currency_code` | `string` | No | — | | `start_date` | `string` | No | Start date (YYYY-MM-DD) | | `end_date` | `string` | No | End date (YYYY-MM-DD) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `number` | `string` | No | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `status` | `number` | Yes | — | | `budget_type` | `number` | Yes | — | | `project_type` | `number` | Yes | — | | `budget` | `number` | No | — | | `rate` | `number` | No | — | | `cost` | `number` | No | — | | `worked_hours` | `number` | No | — | | `unbilled_hours` | `number` | No | — | | `currency_code` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `client` | `object` | No | — | > **client full type** > > ```ts theme={null} > { > id: number, > number?: string | null, > name: string, > city?: string | null, > address?: string | null, > address_2?: string | null, > zip?: string | null, > country?: string | null, > state?: string | null, > website?: string | null, > description?: string | null, > invoice_extra_fields?: any | null > } > ``` *** ## Recurring ### create `recurring.create` Create a recurring schedule **Risk:** `write` ```ts theme={null} await corsair.clientary.api.recurring.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `number` | `number` | No | Schedule number (autoincrements) | | `next_date` | `string` | Yes | Next invoice date (YYYY-MM-DD) | | `due_period` | `number` | Yes | Due in N days | | `currency_code` | `string` | Yes | ISO currency code, e.g. USD | | `time_interval` | `number` | Yes | Frequency (1=weekly ... 11=every 4 months) | | `client_id` | `number` | Yes | Client billed by this schedule | | `title` | `string` | No | — | | `note` | `string` | No | — | | `status` | `number` | No | — | | `action` | `number` | No | 0=send, 1=draft, 2=autobill | | `unlimited` | `boolean` | No | — | | `occurrences_remaining` | `number` | No | — | | `payment_profile_id` | `number` | No | — | | `po` | `string` | No | — | | `summary` | `string` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `tax3` | `number` | No | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | No | — | | `recurring_schedule_items_attributes` | `object[]` | No | Recurring schedule line items | > **recurring\_schedule\_items\_attributes full type** > > ```ts theme={null} > { > id?: number, > _destroy?: boolean, > title?: string, > quantity?: number, > price?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | Yes | — | | `number` | `string` | No | — | | `title` | `string` | Yes | — | | `note` | `string` | No | — | | `status` | `number` | Yes | — | | `action` | `number` | Yes | — | | `time_interval` | `number` | Yes | — | | `due_period` | `number` | Yes | — | | `next_date` | `string` | Yes | — | | `currency_code` | `string` | Yes | — | | `unlimited` | `boolean` | Yes | — | | `occurrences_remaining` | `number` | No | — | | `payment_profile_id` | `number` | No | — | | `po` | `string` | No | — | | `summary` | `string` | No | — | | `subtotal` | `number` | Yes | — | | `total_cost` | `number` | Yes | — | | `tax` | `number` | Yes | — | | `tax2` | `number` | Yes | — | | `tax3` | `number` | Yes | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | Yes | — | | `updated_at` | `string` | No | — | | `client` | `any` | No | — | | `recurring_schedule_items` | `object[]` | No | — | > **recurring\_schedule\_items full type** > > ```ts theme={null} > { > id: number, > recurring_schedule_id?: number | null, > title: string, > price?: string | null, > quantity: number, > item_type: number, > taxable??: boolean, > secondary_tax??: boolean, > tertiary_tax??: boolean, > total_tax?: number > }[] > ``` *** ### delete `recurring.delete` Delete a recurring schedule **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.recurring.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Recurring schedule ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `recurring.get` Get a recurring schedule by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.recurring.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Recurring schedule ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | Yes | — | | `number` | `string` | No | — | | `title` | `string` | Yes | — | | `note` | `string` | No | — | | `status` | `number` | Yes | — | | `action` | `number` | Yes | — | | `time_interval` | `number` | Yes | — | | `due_period` | `number` | Yes | — | | `next_date` | `string` | Yes | — | | `currency_code` | `string` | Yes | — | | `unlimited` | `boolean` | Yes | — | | `occurrences_remaining` | `number` | No | — | | `payment_profile_id` | `number` | No | — | | `po` | `string` | No | — | | `summary` | `string` | No | — | | `subtotal` | `number` | Yes | — | | `total_cost` | `number` | Yes | — | | `tax` | `number` | Yes | — | | `tax2` | `number` | Yes | — | | `tax3` | `number` | Yes | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | Yes | — | | `updated_at` | `string` | No | — | | `client` | `any` | No | — | | `recurring_schedule_items` | `object[]` | No | — | > **recurring\_schedule\_items full type** > > ```ts theme={null} > { > id: number, > recurring_schedule_id?: number | null, > title: string, > price?: string | null, > quantity: number, > item_type: number, > taxable??: boolean, > secondary_tax??: boolean, > tertiary_tax??: boolean, > total_tax?: number > }[] > ``` *** ### list `recurring.list` List recurring schedules **Risk:** `read` ```ts theme={null} await corsair.clientary.api.recurring.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_size` | `number` | Yes | — | | `page_count` | `number` | Yes | — | | `total_count` | `number` | Yes | — | | `recurring` | `object[]` | Yes | — | > **recurring full type** > > ```ts theme={null} > { > id: number, > client_id: number, > number?: string | null, > title: string, > note?: string | null, > status: number, > action: number, > time_interval: number, > due_period: number, > next_date: string, > currency_code: string, > unlimited: boolean, > occurrences_remaining?: number | null, > payment_profile_id?: number | null, > po?: string | null, > summary?: string | null, > subtotal: number, > total_cost: number, > tax: number, > tax2: number, > tax3: number, > tax_label?: string | null, > tax2_label?: string | null, > tax3_label?: string | null, > compound_tax: boolean, > updated_at?: string | null, > client?: any | null, > recurring_schedule_items?: { > id: number, > recurring_schedule_id?: number | null, > title: string, > price?: string | null, > quantity: number, > item_type: number, > taxable??: boolean, > secondary_tax??: boolean, > tertiary_tax??: boolean, > total_tax?: number > }[] > }[] > ``` *** ### update `recurring.update` Update a recurring schedule **Risk:** `write` ```ts theme={null} await corsair.clientary.api.recurring.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Recurring schedule ID | | `number` | `number` | No | Schedule number (autoincrements) | | `next_date` | `string` | No | Next invoice date (YYYY-MM-DD) | | `due_period` | `number` | No | Due in N days | | `currency_code` | `string` | No | ISO currency code, e.g. USD | | `time_interval` | `number` | No | Frequency (1=weekly ... 11=every 4 months) | | `client_id` | `number` | No | Client billed by this schedule | | `title` | `string` | No | — | | `note` | `string` | No | — | | `status` | `number` | No | — | | `action` | `number` | No | 0=send, 1=draft, 2=autobill | | `unlimited` | `boolean` | No | — | | `occurrences_remaining` | `number` | No | — | | `payment_profile_id` | `number` | No | — | | `po` | `string` | No | — | | `summary` | `string` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `tax3` | `number` | No | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | No | — | | `recurring_schedule_items_attributes` | `object[]` | No | Recurring schedule line items | > **recurring\_schedule\_items\_attributes full type** > > ```ts theme={null} > { > id?: number, > _destroy?: boolean, > title?: string, > quantity?: number, > price?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | Yes | — | | `number` | `string` | No | — | | `title` | `string` | Yes | — | | `note` | `string` | No | — | | `status` | `number` | Yes | — | | `action` | `number` | Yes | — | | `time_interval` | `number` | Yes | — | | `due_period` | `number` | Yes | — | | `next_date` | `string` | Yes | — | | `currency_code` | `string` | Yes | — | | `unlimited` | `boolean` | Yes | — | | `occurrences_remaining` | `number` | No | — | | `payment_profile_id` | `number` | No | — | | `po` | `string` | No | — | | `summary` | `string` | No | — | | `subtotal` | `number` | Yes | — | | `total_cost` | `number` | Yes | — | | `tax` | `number` | Yes | — | | `tax2` | `number` | Yes | — | | `tax3` | `number` | Yes | — | | `tax_label` | `string` | No | — | | `tax2_label` | `string` | No | — | | `tax3_label` | `string` | No | — | | `compound_tax` | `boolean` | Yes | — | | `updated_at` | `string` | No | — | | `client` | `any` | No | — | | `recurring_schedule_items` | `object[]` | No | — | > **recurring\_schedule\_items full type** > > ```ts theme={null} > { > id: number, > recurring_schedule_id?: number | null, > title: string, > price?: string | null, > quantity: number, > item_type: number, > taxable??: boolean, > secondary_tax??: boolean, > tertiary_tax??: boolean, > total_tax?: number > }[] > ``` *** ## Staff ### get `staff.get` Get a staff member by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.staff.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Staff user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `name` | `string` | Yes | — | | `email` | `string` | No | — | | `title` | `string` | No | — | | `phone` | `string` | No | — | | `mobile` | `string` | No | — | | `ext` | `string` | No | — | | `avatar` | `string` | No | — | *** ### list `staff.list` List staff members **Risk:** `read` ```ts theme={null} await corsair.clientary.api.staff.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `staff` | `object[]` | Yes | — | > **staff full type** > > ```ts theme={null} > { > id: number, > client_id?: number | null, > name: string, > email?: string | null, > title?: string | null, > phone?: string | null, > mobile?: string | null, > ext?: string | null, > avatar?: string | null > }[] > ``` *** ## Tasks ### create `tasks.create` Create a task **Risk:** `write` ```ts theme={null} await corsair.clientary.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | Task title | | `description` | `string` | No | — | | `project_id` | `number` | No | — | | `assignee_id` | `number` | No | — | | `due_date` | `string` | No | Due date (YYYY-MM-DD) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | | `user_id` | `number` | No | — | | `assignee_id` | `number` | No | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `complete` | `boolean` | Yes | — | | `completed_at` | `string` | No | — | | `due_date` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### delete `tasks.delete` Delete a task **Risk:** `destructive` ```ts theme={null} await corsair.clientary.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Task ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `tasks.get` Get a task by ID **Risk:** `read` ```ts theme={null} await corsair.clientary.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Task ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | | `user_id` | `number` | No | — | | `assignee_id` | `number` | No | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `complete` | `boolean` | Yes | — | | `completed_at` | `string` | No | — | | `due_date` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### list `tasks.list` List tasks **Risk:** `read` ```ts theme={null} await corsair.clientary.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_count` | `number` | Yes | — | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `tasks` | `object[]` | Yes | — | > **tasks full type** > > ```ts theme={null} > { > id: number, > client_id?: number | null, > project_id?: number | null, > user_id?: number | null, > assignee_id?: number | null, > title: string, > description?: string | null, > complete: boolean, > completed_at?: string | null, > due_date?: string | null, > created_at: string, > updated_at: string > }[] > ``` *** ### listForProject `tasks.listForProject` List tasks belonging to a project **Risk:** `read` ```ts theme={null} await corsair.clientary.api.tasks.listForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | Project ID to scope tasks by | | `page` | `number` | No | Page number (starts at 1) | | `page_size` | `number` | No | Results per page (max 100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_count` | `number` | Yes | — | | `page_count` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `tasks` | `object[]` | Yes | — | > **tasks full type** > > ```ts theme={null} > { > id: number, > client_id?: number | null, > project_id?: number | null, > user_id?: number | null, > assignee_id?: number | null, > title: string, > description?: string | null, > complete: boolean, > completed_at?: string | null, > due_date?: string | null, > created_at: string, > updated_at: string > }[] > ``` *** ### update `tasks.update` Update a task **Risk:** `write` ```ts theme={null} await corsair.clientary.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Task ID | | `title` | `string` | No | — | | `description` | `string` | No | — | | `project_id` | `number` | No | — | | `assignee_id` | `number` | No | — | | `due_date` | `string` | No | — | | `complete` | `boolean` | No | Mark the task complete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | | `user_id` | `number` | No | — | | `assignee_id` | `number` | No | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `complete` | `boolean` | Yes | — | | `completed_at` | `string` | No | — | | `due_date` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/clientary/database Clientary local sync: searchable entities, `.search()` filters, and operators. The Clientary plugin syncs data locally. Use `corsair.clientary.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Clients Path: `clientary.db.clients.search` ```ts theme={null} const rows = await corsair.clientary.db.clients.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `address_2` | `string` | equals, contains, startsWith, endsWith, in | | `zip` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `clientary.db.contacts.search` ```ts theme={null} const rows = await corsair.clientary.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `client_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `mobile` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Estimates Path: `clientary.db.estimates.search` ```ts theme={null} const rows = await corsair.clientary.db.estimates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `client_id` | `number` | equals, gt, gte, lt, lte, in | | `status` | `number` | equals, gt, gte, lt, lte, in | | `currency_code` | `string` | equals, contains, startsWith, endsWith, in | | `subtotal` | `number` | equals, gt, gte, lt, lte, in | | `total_cost` | `number` | equals, gt, gte, lt, lte, in | | `tax` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invoices Path: `clientary.db.invoices.search` ```ts theme={null} const rows = await corsair.clientary.db.invoices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `due_date` | `string` | equals, contains, startsWith, endsWith, in | | `client_id` | `number` | equals, gt, gte, lt, lte, in | | `status` | `number` | equals, gt, gte, lt, lte, in | | `currency_code` | `string` | equals, contains, startsWith, endsWith, in | | `subtotal` | `number` | equals, gt, gte, lt, lte, in | | `total_cost` | `number` | equals, gt, gte, lt, lte, in | | `balance` | `number` | equals, gt, gte, lt, lte, in | | `total_payments` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `clientary.db.projects.search` ```ts theme={null} const rows = await corsair.clientary.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `number` | equals, gt, gte, lt, lte, in | | `budget_type` | `number` | equals, gt, gte, lt, lte, in | | `project_type` | `number` | equals, gt, gte, lt, lte, in | | `budget` | `number` | equals, gt, gte, lt, lte, in | | `rate` | `number` | equals, gt, gte, lt, lte, in | | `currency_code` | `string` | equals, contains, startsWith, endsWith, in | | `start_date` | `string` | equals, contains, startsWith, endsWith, in | | `end_date` | `string` | equals, contains, startsWith, endsWith, in | | `client_id` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `clientary.db.tasks.search` ```ts theme={null} const rows = await corsair.clientary.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `client_id` | `number` | equals, gt, gte, lt, lte, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `user_id` | `number` | equals, gt, gte, lt, lte, in | | `assignee_id` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `complete` | `boolean` | equals | | `due_date` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/clientary/overview Client management software for freelancers tracking projects, invoices, and time. Use **Clientary** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 70 typed API operations * 6 synced entities (`clients`, `contacts`, `estimates`, `invoices`, `projects`, `tasks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/clientary ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/clientary ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/clientary ``` ```bash bun theme={null} bun add corsair @corsair-dev/clientary ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { clientary } from '@corsair-dev/clientary'; export const corsair = createCorsair({ plugins: [ clientary(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} clientary() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'clientary', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`clients.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clientary.api.clients.get({}); ``` **`clients.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clientary.api.clients.create({}); ``` See the full list on the [API](/plugins/clientary/api) page. ## Query synced data Synced entities support `tenant.clientary.db..search()` and `.list()`: `clients`, `contacts`, `estimates`, `invoices`, `projects`, `tasks`. See [Database](/plugins/clientary/database) for filters and operators. ## What's next > **[API reference](/plugins/clientary/api)** > > Every `clientary.api.*` operation with input and output types. > **[Database](/plugins/clientary/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/clockify/api API reference for Clockify: every `clockify.api.*` operation with input and output types. Every `clockify.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Projects ### list `projects.list` List projects in a workspace **Risk:** `read` ```ts theme={null} await corsair.clockify.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > workspaceId: string > }[] > ``` *** ## Tasks ### list `tasks.list` List tasks for a project in a workspace **Risk:** `read` ```ts theme={null} await corsair.clockify.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `projectId` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > projectId: string > }[] > ``` *** ## Time Entries ### create `timeEntries.create` Create a new time entry **Risk:** `write` ```ts theme={null} await corsair.clockify.api.timeEntries.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `description` | `string` | Yes | — | | `start` | `string` | Yes | — | | `end` | `string` | No | — | | `projectId` | `string` | No | — | | `taskId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `description` | `string` | Yes | — | | `workspaceId` | `string` | Yes | — | | `projectId` | `string` | No | — | | `taskId` | `string` | No | — | | `timeInterval` | `object` | No | — | > **timeInterval full type** > > ```ts theme={null} > { > start: string, > end?: string | null, > duration?: string | null > } > ``` *** ### list `timeEntries.list` List time entries for a user in a workspace **Risk:** `read` ```ts theme={null} await corsair.clockify.api.timeEntries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `userId` | `string` | Yes | — | | `description` | `string` | No | — | | `project` | `string` | No | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > description: string, > workspaceId: string, > projectId?: string | null, > taskId?: string | null, > timeInterval?: { > start: string, > end?: string | null, > duration?: string | null > } | null > }[] > ``` *** ## Workspaces ### list `workspaces.list` List all workspaces **Risk:** `read` ```ts theme={null} await corsair.clockify.api.workspaces.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/clockify/database Clockify local sync: searchable entities, `.search()` filters, and operators. The Clockify plugin syncs data locally. Use `corsair.clockify.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/clockify/overview Time tracking software for logging hours, projects, teams, and billable work. Use **Clockify** through Corsair: one client, typed API calls. **What you get:** * 5 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/clockify ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/clockify ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/clockify ``` ```bash bun theme={null} bun add corsair @corsair-dev/clockify ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { clockify } from '@corsair-dev/clockify'; export const corsair = createCorsair({ plugins: [ clockify(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} clockify() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'clockify', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`projects.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clockify.api.projects.list({}); ``` **`timeEntries.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.clockify.api.timeEntries.create({}); ``` See the full list on the [API](/plugins/clockify/api) page. ## What's next > **[API reference](/plugins/clockify/api)** > > Every `clockify.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/cloro/api API reference for Cloro: every `cloro.api.*` operation with input and output types. Every `cloro.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Monitor ### chatgpt `monitor.chatgpt` Ask ChatGPT a prompt as a user in a given country and get the structured answer, sources, and shopping cards **Risk:** `write` ```ts theme={null} await corsair.cloro.api.monitor.chatgpt({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string \| string[]` | Yes | — | | `country` | `string` | Yes | ISO 3166-1 alpha-2 country code; see utility.countries | | `state` | `string` | No | US state for state-level targeting (+2 credits); see utility.states | | `include` | `object` | No | — | | `legacy` | `boolean` | No | — | | `disableWebSearch` | `boolean` | No | — | > **include full type** > > ```ts theme={null} > { > html?: boolean, > markdown?: boolean, > rawResponse?: boolean, > searchQueries?: boolean, > ads?: boolean, > shopping?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `result` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > text?: string, > sources?: { > position?: number, > url?: string, > label?: string, > description?: string, > footnote?: boolean, > datePublished?: string > }[], > html?: string, > markdown?: string, > rawResponse?: { > type?: string, > token?: string, > conversation_id?: string, > message?: { > id?: string, > role?: string, > model?: string > }, > delta?: { > content?: { > type?: string, > text_delta?: string > }[] > }, > reason?: string > }[], > searchQueries?: string[], > mapSearchQueries?: string[], > model?: string | null, > shoppingCards?: { > tags?: string[], > products?: { > title?: string, > position?: number, > url?: string, > price?: string, > featured_tag?: string, > merchant?: string, > image_urls?: string[], > rating?: number, > num_reviews?: number, > id?: string, > offers?: { > merchant_name?: string, > marketplace_seller?: string | null, > seller_name?: string, > brand?: string | null, > product_name?: string, > url?: string, > price?: string, > details?: string, > available?: boolean, > checkoutable?: boolean, > price_details?: { > base?: string, > total?: string > }, > tag?: { > text?: string > } > }[], > rating_grouped_citation?: { > title?: string, > url?: string, > supporting_websites?: { > title?: string, > url?: string > }[] > } > }[] > }[], > inlineProducts?: { > product?: { > title?: string, > position?: number, > url?: string, > description?: string, > price?: string, > featured_tag?: string, > rating?: number, > num_reviews?: number, > image_urls?: string[], > id?: string, > variants?: any, > offers?: { > merchant_name?: string, > merchant_subtitle?: string | null, > marketplace_seller?: string | null, > seller_name?: string, > brand?: string | null, > product_name?: string, > url?: string, > price?: string, > details?: string, > original_price?: string | null, > available?: boolean, > checkoutable?: boolean, > is_digital?: boolean | null, > checkout_payload?: string | null, > checkout_image_urls?: string[] | null, > shop_id?: string | null, > provider?: string, > price_details?: { > display_price?: string | null, > base?: string, > shipping?: string | null, > tax?: string | null, > total?: string > }, > tag?: { > text?: string, > tooltip?: string > } | null > }[], > rating_grouped_citation?: { > title?: string, > url?: string, > supporting_websites?: { > title?: string, > url?: string > }[] > }, > provider?: string, > providers?: string[], > product_lookup_key?: { > data?: string > }, > product_lookup_data?: { > request_query?: string, > all_ids?: { > }, > metadata_sources?: string[] > }, > showcase_metadata?: { > image?: { > url: string, > width?: number, > height?: number > }, > background?: { > type?: string, > primary?: string, > secondary?: string > }, > slots?: { > }, > debug?: { > } > }, > show_price_disclosure?: boolean, > analytics_meta?: { > product_event_uuid?: string > }, > metadata_sources?: string[], > product_event_uuid?: string, > generatedProductQuery?: string > }, > render_as?: inline | hero | block > }[], > entities?: { > type: string, > name: string, > product?: { > title?: string, > position?: number, > url?: string, > description?: string, > price?: string, > featured_tag?: string, > rating?: number, > num_reviews?: number, > image_urls?: string[], > id?: string, > variants?: any, > offers?: { > merchant_name?: string, > merchant_subtitle?: string | null, > marketplace_seller?: string | null, > seller_name?: string, > brand?: string | null, > product_name?: string, > url?: string, > price?: string, > details?: string, > original_price?: string | null, > available?: boolean, > checkoutable?: boolean, > is_digital?: boolean | null, > checkout_payload?: string | null, > checkout_image_urls?: string[] | null, > shop_id?: string | null, > provider?: string, > price_details?: { > display_price?: string | null, > base?: string, > shipping?: string | null, > tax?: string | null, > total?: string > }, > tag?: { > text?: string, > tooltip?: string > } | null > }[], > rating_grouped_citation?: { > title?: string, > url?: string, > supporting_websites?: { > title?: string, > url?: string > }[] > }, > provider?: string, > providers?: string[], > product_lookup_key?: { > data?: string > }, > product_lookup_data?: { > request_query?: string, > all_ids?: { > }, > metadata_sources?: string[] > }, > showcase_metadata?: { > image?: { > url: string, > width?: number, > height?: number > }, > background?: { > type?: string, > primary?: string, > secondary?: string > }, > slots?: { > }, > debug?: { > } > }, > show_price_disclosure?: boolean, > analytics_meta?: { > product_event_uuid?: string > }, > metadata_sources?: string[], > product_event_uuid?: string, > generatedProductQuery?: string > } > }[], > map?: { > id?: string, > provider?: string, > name?: string, > position?: number, > address?: string, > latitude?: number, > longitude?: number, > categories?: string[], > rating?: number, > reviewCount?: number, > description?: string, > phone?: string, > websiteUrl?: string > }[], > citationPills?: { > url: string, > label: string, > description?: string, > domain: string, > datePublished?: string, > citationPillId: number, > type: searchResult | groupedWebpage, > position: number > }[], > ads?: { > brand: { > name: string, > url: string, > favicon?: string > }, > cards: { > title: string, > body: string, > url: string, > image?: string > }[], > visibility: string, > adsResponseIndex: number, > rendered: boolean > }[], > followUpForm?: { > questions: { > label: string, > type: radio | checkbox | select | text | textarea | date, > name?: string, > placeholder?: string, > options: { > label: string, > value: string | boolean, > selected: boolean > }[] > }[], > submitLabel?: string, > followUpPrompt?: string > } | null > } | { > text?: string, > sources?: { > position?: number, > url?: string, > label?: string, > description?: string, > footnote?: boolean, > datePublished?: string > }[], > html?: string, > markdown?: string, > rawResponse?: { > type?: string, > token?: string, > conversation_id?: string, > message?: { > id?: string, > role?: string, > model?: string > }, > delta?: { > content?: { > type?: string, > text_delta?: string > }[] > }, > reason?: string > }[], > searchQueries?: string[], > mapSearchQueries?: string[], > model?: string | null, > shoppingCards?: { > tags?: string[], > products?: { > title?: string, > position?: number, > url?: string, > price?: string, > featured_tag?: string, > merchant?: string, > image_urls?: string[], > rating?: number, > num_reviews?: number, > id?: string, > offers?: { > merchant_name?: string, > marketplace_seller?: string | null, > seller_name?: string, > brand?: string | null, > product_name?: string, > url?: string, > price?: string, > details?: string, > available?: boolean, > checkoutable?: boolean, > price_details?: { > base?: string, > total?: string > }, > tag?: { > text?: string > } > }[], > rating_grouped_citation?: { > title?: string, > url?: string, > supporting_websites?: { > title?: string, > url?: string > }[] > } > }[] > }[], > inlineProducts?: { > product?: { > title?: string, > position?: number, > url?: string, > description?: string, > price?: string, > featured_tag?: string, > rating?: number, > num_reviews?: number, > image_urls?: string[], > id?: string, > variants?: any, > offers?: { > merchant_name?: string, > merchant_subtitle?: string | null, > marketplace_seller?: string | null, > seller_name?: string, > brand?: string | null, > product_name?: string, > url?: string, > price?: string, > details?: string, > original_price?: string | null, > available?: boolean, > checkoutable?: boolean, > is_digital?: boolean | null, > checkout_payload?: string | null, > checkout_image_urls?: string[] | null, > shop_id?: string | null, > provider?: string, > price_details?: { > display_price?: string | null, > base?: string, > shipping?: string | null, > tax?: string | null, > total?: string > }, > tag?: { > text?: string, > tooltip?: string > } | null > }[], > rating_grouped_citation?: { > title?: string, > url?: string, > supporting_websites?: { > title?: string, > url?: string > }[] > }, > provider?: string, > providers?: string[], > product_lookup_key?: { > data?: string > }, > product_lookup_data?: { > request_query?: string, > all_ids?: { > }, > metadata_sources?: string[] > }, > showcase_metadata?: { > image?: { > url: string, > width?: number, > height?: number > }, > background?: { > type?: string, > primary?: string, > secondary?: string > }, > slots?: { > }, > debug?: { > } > }, > show_price_disclosure?: boolean, > analytics_meta?: { > product_event_uuid?: string > }, > metadata_sources?: string[], > product_event_uuid?: string, > generatedProductQuery?: string > }, > render_as?: inline | hero | block > }[], > entities?: { > type: string, > name: string, > product?: { > title?: string, > position?: number, > url?: string, > description?: string, > price?: string, > featured_tag?: string, > rating?: number, > num_reviews?: number, > image_urls?: string[], > id?: string, > variants?: any, > offers?: { > merchant_name?: string, > merchant_subtitle?: string | null, > marketplace_seller?: string | null, > seller_name?: string, > brand?: string | null, > product_name?: string, > url?: string, > price?: string, > details?: string, > original_price?: string | null, > available?: boolean, > checkoutable?: boolean, > is_digital?: boolean | null, > checkout_payload?: string | null, > checkout_image_urls?: string[] | null, > shop_id?: string | null, > provider?: string, > price_details?: { > display_price?: string | null, > base?: string, > shipping?: string | null, > tax?: string | null, > total?: string > }, > tag?: { > text?: string, > tooltip?: string > } | null > }[], > rating_grouped_citation?: { > title?: string, > url?: string, > supporting_websites?: { > title?: string, > url?: string > }[] > }, > provider?: string, > providers?: string[], > product_lookup_key?: { > data?: string > }, > product_lookup_data?: { > request_query?: string, > all_ids?: { > }, > metadata_sources?: string[] > }, > showcase_metadata?: { > image?: { > url: string, > width?: number, > height?: number > }, > background?: { > type?: string, > primary?: string, > secondary?: string > }, > slots?: { > }, > debug?: { > } > }, > show_price_disclosure?: boolean, > analytics_meta?: { > product_event_uuid?: string > }, > metadata_sources?: string[], > product_event_uuid?: string, > generatedProductQuery?: string > } > }[], > map?: { > id?: string, > provider?: string, > name?: string, > position?: number, > address?: string, > latitude?: number, > longitude?: number, > categories?: string[], > rating?: number, > reviewCount?: number, > description?: string, > phone?: string, > websiteUrl?: string > }[], > citationPills?: { > url: string, > label: string, > description?: string, > domain: string, > datePublished?: string, > citationPillId: number, > type: searchResult | groupedWebpage, > position: number > }[], > ads?: { > brand: { > name: string, > url: string, > favicon?: string > }, > cards: { > title: string, > body: string, > url: string, > image?: string > }[], > visibility: string, > adsResponseIndex: number, > rendered: boolean > }[], > followUpForm?: { > questions: { > label: string, > type: radio | checkbox | select | text | textarea | date, > name?: string, > placeholder?: string, > options: { > label: string, > value: string | boolean, > selected: boolean > }[] > }[], > submitLabel?: string, > followUpPrompt?: string > } | null > }[] > ``` *** ### copilot `monitor.copilot` Ask Microsoft Copilot a prompt in a given country and get the structured answer and sources **Risk:** `write` ```ts theme={null} await corsair.cloro.api.monitor.copilot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `country` | `string` | Yes | ISO 3166-1 alpha-2 country code; see utility.countries | | `state` | `string` | No | US state for state-level targeting (+2 credits); see utility.states | | `include` | `object` | No | — | > **include full type** > > ```ts theme={null} > { > html?: boolean, > markdown?: boolean, > rawResponse?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > text?: string, > html?: string, > sources?: { > position?: number, > url?: string, > label?: string, > description?: string > }[], > citationPills?: { > label: string, > citationPillId: number, > url: string, > domain: string, > description?: string, > position: number > }[], > shoppingCards?: { > type?: string, > layout?: string, > products?: { > product?: { > id?: string, > groupId?: string, > brandGroupId?: string > }, > position?: number, > offerId?: string, > url?: string, > name?: string, > description?: string, > images?: { > title?: string, > url?: string > }[], > specifications?: { > displayName?: string, > values?: string[] > }[], > tags?: string[], > price?: { > amount?: number, > currency?: string, > currencySymbol?: string > }, > discountPrice?: { > amount?: number, > currency?: string, > currencySymbol?: string > } | null, > seller?: string, > sellerLogoUrl?: string, > brandName?: string, > rating?: { > value?: number, > count?: number, > maxRating?: number | null > }, > canTrackPrice?: boolean > }[] > }[], > map?: { > name?: string, > position?: number, > placeId?: string, > location?: { > address?: string, > latitude?: number, > longitude?: number > }, > phoneNumber?: string, > url?: string, > reviews?: { > count?: number, > rating?: number, > providerName?: string, > providerIconUrl?: string, > url?: string > }[], > photos?: { > url?: string, > altText?: string, > providerName?: string, > providerUrl?: string > }[], > openState?: string, > category?: string, > price?: any, > layerLabel?: string > }[], > searchQueries?: string[], > markdown?: string, > rawResponse?: any[] > } > ``` *** ### gemini `monitor.gemini` Ask Google Gemini a prompt in a given country and get the structured answer and sources **Risk:** `write` ```ts theme={null} await corsair.cloro.api.monitor.gemini({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `country` | `string` | Yes | ISO 3166-1 alpha-2 country code; see utility.countries | | `state` | `string` | No | US state for state-level targeting (+2 credits); see utility.states | | `include` | `object` | No | — | > **include full type** > > ```ts theme={null} > { > html?: boolean, > markdown?: boolean, > rawResponse?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > text?: string, > markdown?: string, > html?: string, > sources?: { > position?: number, > label?: string, > url?: string, > description?: string > }[], > citationPills?: { > label: string, > citationPillId: number, > url: string, > domain: string, > description?: string, > position: number > }[], > places?: { > index: number, > title: string, > link: string, > thumbnail?: string, > rating?: number, > reviews?: number, > type?: string, > description?: string, > price?: string > }[], > shoppingCards?: { > position: number, > title: string, > productLink: string, > productId: string, > price?: { > value?: number, > currency?: string, > raw?: string > }, > oldPrice?: { > value?: number, > currency?: string, > raw?: string > }, > store?: string, > storeLink?: string, > storeCount?: number, > shipping?: string, > deliveryTime?: string, > rating?: number, > reviews?: number, > brand?: string, > description?: string, > thumbnail?: string, > images?: string[], > catalogId?: string, > gpcId?: string > }[], > rawResponse?: any[] > } > ``` *** ### googleAiMode `monitor.googleAiMode` Ask Google AI Mode a prompt and get the structured answer, sources, places, and products **Risk:** `write` ```ts theme={null} await corsair.cloro.api.monitor.googleAiMode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | ISO 3166-1 alpha-2 country code; see utility.countries | | `gl` | `string` | No | ISO 3166-1 alpha-2 country code; see utility.countries | | `hl` | `string` | No | — | | `prompt` | `string` | Yes | — | | `location` | `string` | No | — | | `uule` | `string` | No | — | | `device` | `desktop \| mobile` | No | — | | `include` | `object` | No | — | > **include full type** > > ```ts theme={null} > { > html?: boolean, > markdown?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > text?: string, > html?: string, > sources?: { > position?: number, > url?: string, > label?: string, > description?: string, > redirectLink?: string > }[], > citationPills?: { > label: string, > citationPillId: number, > url: string, > domain: string, > description?: string, > position?: number, > redirectLink?: string > }[], > markdown?: string, > places?: { > title: string, > index: number, > thumbnail?: string, > rating?: number, > reviews?: number, > type?: string, > address?: string, > status?: string, > placeId?: string, > phone?: string, > website?: string, > link?: string, > priceLevel?: string > }[], > shoppingCards?: { > title?: string, > price?: { > value?: number, > currency?: string, > raw?: string > }, > store?: string, > rating?: number, > reviews?: string, > thumbnail?: string, > productLink?: string, > productResultToken?: string, > productDocid?: string, > oldPrice?: { > value?: number, > currency?: string, > raw?: string > }, > snippet?: string, > snippetLinks?: { > text?: string, > link?: string, > redirectLink?: string > }[], > position?: number > }[], > ads?: { > title?: string, > ads?: { > title?: string, > url?: string, > position?: number, > price?: { > value?: number, > currency?: string, > raw?: string > }, > store?: string, > rating?: number, > reviews?: string, > redirectLink?: string > }[] > }, > inlineProducts?: { > title?: string, > position?: number, > price?: { > value?: number, > currency?: string, > raw?: string > }, > oldPrice?: { > value?: number, > currency?: string, > raw?: string > }, > store?: string, > thumbnail?: string, > productLink?: string, > productResultToken?: string, > productDocid?: string > }[], > videos?: { > title: string, > link: string, > platform?: string, > channel?: string, > duration?: string, > thumbnail?: string, > redirectLink?: string > }[], > map?: { > title: string, > index: number, > thumbnail?: string, > rating?: number, > reviews?: number, > type?: string, > address?: string, > status?: string, > placeId: string, > phone?: string, > website?: string, > link: string, > gpsCoordinates: { > latitude?: number, > longitude?: number > } > }[] > } > ``` *** ### googleNews `monitor.googleNews` Run a Google News search (1-10 pages) and get articles **Risk:** `write` ```ts theme={null} await corsair.cloro.api.monitor.googleNews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | ISO 3166-1 alpha-2 country code; see utility.countries | | `gl` | `string` | No | ISO 3166-1 alpha-2 country code; see utility.countries | | `hl` | `string` | No | — | | `query` | `string` | Yes | — | | `device` | `desktop \| mobile \| ios \| android` | No | — | | `pages` | `number` | No | — | | `include` | `object` | No | — | > **include full type** > > ```ts theme={null} > { > html?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > newsResults?: { > position?: number, > title?: string, > link?: string, > snippet?: string, > source?: string, > date?: string, > page?: number, > thumbnail?: string, > redirectLink?: string > }[], > html?: string[] > } > ``` *** ### googleSearch `monitor.googleSearch` Run a Google search (1-10 pages) and get organic results, ads, People Also Ask, and the AI Overview **Risk:** `write` ```ts theme={null} await corsair.cloro.api.monitor.googleSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | ISO 3166-1 alpha-2 country code; see utility.countries | | `gl` | `string` | No | ISO 3166-1 alpha-2 country code; see utility.countries | | `hl` | `string` | No | — | | `query` | `string` | No | — | | `url` | `string` | No | — | | `location` | `string` | No | — | | `uule` | `string` | No | — | | `device` | `desktop \| mobile \| ios \| android` | No | — | | `pages` | `number` | No | — | | `include` | `object` | No | — | > **include full type** > > ```ts theme={null} > { > html?: boolean, > aioverview?: { > markdown?: boolean > }, > paaAioverview?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > organicResults?: { > position?: number, > title?: string, > link?: string, > displayedLink?: string, > snippet?: string, > date?: string, > page?: number, > sitelinks?: { > inline?: { > title?: string, > link?: string, > redirectLink?: string > }[] > }, > redirectLink?: string > }[], > peopleAlsoAsk?: { > question?: string, > type?: AIOVERVIEW | LINK | UNKNOWN, > snippet?: string, > title?: string, > link?: string, > markdown?: string, > sources?: { > label?: string, > url?: string, > description?: string, > position?: number, > redirectLink?: string > }[], > redirectLink?: string > }[], > peopleAreSaying?: { > position: number, > title: string, > link: string, > date: string, > redirectLink?: string > }[], > localResults?: { > position: number, > title: string, > placeId?: string, > rating?: number, > reviews?: string, > price?: string, > type?: string, > yearsInBusiness?: string, > address?: string, > phone?: string, > hours?: string, > description?: string, > links?: { > website?: string, > directions?: string, > redirectLink?: string > } > }[], > localResultsMoreLink?: string, > relatedSearches?: { > query?: string, > link?: string > }[], > ads?: { > position?: number, > blockPosition?: top | bottom | middle | rhs, > type?: RESULT | SHOPPING_CARD, > title?: string, > url?: string, > page?: number, > displayedUrl?: string, > domain?: string, > description?: string, > category?: string, > price?: { > value?: number, > currency?: string, > raw?: string > }, > oldPrice?: { > value?: number, > currency?: string, > raw?: string > }, > store?: string, > imageUrl?: string, > sitelinks?: { > url?: string, > title?: string, > description?: string > }[] > }[], > aioverview?: { > sources?: { > position?: number, > url?: string, > label?: string, > description?: string, > redirectLink?: string > }[], > citationPills?: { > label: string, > citationPillId: number, > url: string, > domain: string, > description?: string, > position: number, > redirectLink?: string > }[], > relatedLinks?: { > label: string, > citationPillId: number, > url: string, > domain: string, > description?: string, > redirectLink?: string > }[], > text?: string, > markdown?: string, > videos?: { > url?: string, > title?: string, > thumbnail?: string, > source?: string, > platform?: string, > date?: string, > duration?: string, > redirectLink?: string > }[], > places?: { > title: string, > index: number, > thumbnail?: string, > rating?: number, > reviews?: number, > type?: string, > address?: string, > status?: string, > placeId?: string, > phone?: string, > website?: string, > link?: string, > priceLevel?: string > }[], > map?: { > title: string, > index: number, > thumbnail?: string, > rating?: number, > reviews?: number, > type?: string, > address?: string, > status?: string, > placeId: string, > phone?: string, > website?: string, > link: string, > gpsCoordinates: { > latitude?: number, > longitude?: number > } > }[], > ads?: { > position: number, > title: string, > url: string, > type: TEXT | SHOPPING, > domain?: string, > description?: string, > price?: { > value?: number, > currency?: string, > raw?: string > }, > old_price?: { > value?: number, > currency?: string, > raw?: string > }, > store?: string, > image?: string > }[] > } | null, > shoppingCards?: { > title: string, > position: number, > productResultToken?: string, > promoLabel?: string, > category?: string, > price?: { > value?: number, > currency?: string, > raw?: string > }, > oldPrice?: { > value?: number, > currency?: string, > raw?: string > }, > store?: string, > rating?: number, > reviews?: string, > thumbnail?: string > }[], > knowledgeGraph?: { > title?: string, > type?: string, > kgmid?: string, > description?: string, > imageUrl?: string, > website?: string, > menu?: string, > trailer?: string, > source?: { > name?: string, > link?: string, > redirectLink?: string > }, > attributes?: { > key?: string, > value?: string > }[], > profiles?: { > name?: string, > link?: string, > redirectLink?: string > }[], > peopleAlsoSearchFor?: { > name?: string, > link?: string, > redirectLink?: string > }[], > thingsToKnow?: { > label?: string, > subtitle?: string > }[], > ratings?: { > platform?: string, > rating?: string, > link?: string, > redirectLink?: string > }[], > streamingOptions?: { > platform?: string, > link?: string, > redirectLink?: string > }[], > webRatings?: { > platform?: string, > rating?: string, > link?: string, > votes?: string, > redirectLink?: string > }[], > statsCard?: { > context?: string, > stats?: { > label?: string, > value?: string > }[] > }, > socialPosts?: { > platform?: string, > text?: string, > link?: string, > date?: string, > redirectLink?: string > }[], > notableAlumni?: { > name?: string, > link?: string, > redirectLink?: string > }[], > contact?: { > label?: string, > url?: string, > redirectLink?: string > }[], > weather?: { > temperature?: string, > condition?: string > }, > rating?: { > rating?: string, > count?: string > }, > admission?: { > provider?: string, > price?: string, > link?: string, > badge?: string, > redirectLink?: string > }[], > artworks?: { > title?: string, > link?: string, > author?: string, > redirectLink?: string > }[], > has3dModel?: boolean, > hotelOptions?: { > provider?: string, > price?: string, > link?: string, > note?: string, > redirectLink?: string > }[], > trendingProducts?: { > title?: string, > price?: string, > link?: string, > redirectLink?: string > }[], > merchantVideos?: { > title?: string, > link?: string, > platform?: string, > duration?: string, > redirectLink?: string > }[], > listenOn?: { > platform?: string, > link?: string, > redirectLink?: string > }[], > redirectLink?: string > }, > productResults?: { > title: string, > stores?: { > name: string, > link?: string, > redirectLink?: string, > price?: { > value: number, > currency: string, > raw?: string > }, > installments?: string, > description?: string, > buyingOptions?: string[], > logo?: string, > shipping?: string, > condition?: string, > rating?: number, > reviews?: string > }[], > aboutTheProduct?: { > description?: string, > features?: string[] > }, > specifications?: { > }, > images?: { > mainUrl: string, > thumbnailUrl?: string, > title?: string > }[], > rating?: number, > reviews?: string, > variants?: { > }[], > userReviews?: { > }[], > relatedProducts?: { > }[], > productDocid?: string > }[], > html?: string[] > } > ``` *** ### perplexity `monitor.perplexity` Ask Perplexity a prompt in a given country and get the structured answer and sources **Risk:** `write` ```ts theme={null} await corsair.cloro.api.monitor.perplexity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `country` | `string` | Yes | ISO 3166-1 alpha-2 country code; see utility.countries | | `state` | `string` | No | US state for state-level targeting (+2 credits); see utility.states | | `include` | `object` | No | — | > **include full type** > > ```ts theme={null} > { > html?: boolean, > markdown?: boolean, > rawResponse?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `result` | `object` | Yes | — | > **result full type** > > ```ts theme={null} > { > text?: string, > html?: string, > sources?: { > position?: number, > url?: string, > label?: string, > description?: string > }[], > citationPills?: { > label: string, > citationPillId: number, > url: string, > domain: string, > description?: string, > position: number > }[], > markdown?: string, > related_queries?: string[], > videos?: { > title?: string, > url?: string, > thumbnail?: string, > medium?: string, > source?: string, > image_width?: number, > image_height?: number, > thumbnail_width?: number, > thumbnail_height?: number > }[], > images?: { > title?: string, > url?: string, > thumbnail?: string, > medium?: string, > source?: string, > image_width?: number, > image_height?: number, > thumbnail_width?: number, > thumbnail_height?: number > }[], > hotels?: { > name?: string, > url?: string, > rating?: number, > num_reviews?: number, > address?: string[], > phone?: string, > description?: string, > image_url?: string, > images?: string[], > lat?: number, > lng?: number, > price_level?: string, > categories?: string[] > }[], > places?: { > name?: string, > url?: string, > rating?: number, > address?: string[], > lat?: number, > lng?: number, > categories?: string[], > map_url?: string, > images?: string[] > }[], > shopping_cards?: { > tags?: string[], > products?: { > title?: string, > id?: string, > url?: string, > price?: string, > merchant?: string, > available?: boolean, > imageUrls?: string[], > numReviews?: number, > offers?: { > url?: string, > price?: string, > merchant_name?: string, > product_name?: string, > available?: boolean, > price_details?: { > display_price?: string > }, > original_price?: string | null > }[], > position?: number, > rating?: number, > original_price?: string | null, > description?: string, > variants?: { > }[] > }[] > }[], > search_model_queries?: string[], > rawResponse?: any[] > } > ``` *** ## Utility ### countries `utility.countries` List the country codes a monitor engine supports **Risk:** `read` ```ts theme={null} await corsair.cloro.api.utility.countries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `aimode \| aioverview \| chatgpt \| copilot \| gemini \| google \| perplexity` | No | — | **Output:** `string[]` *** ### credits `utility.credits` Get the remaining cloro credit balance and billing cycle **Risk:** `read` ```ts theme={null} await corsair.cloro.api.utility.credits({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `remaining` | `number` | Yes | — | | `perCycle` | `number` | No | — | | `cycleResetsAt` | `string` | No | — | *** ### states `utility.states` List the US states supported for state-level targeting **Risk:** `read` ```ts theme={null} await corsair.cloro.api.utility.states({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > code: string, > name: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/cloro/database Cloro local sync: searchable entities, `.search()` filters, and operators. The Cloro plugin syncs data locally. Use `corsair.cloro.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Snapshots Path: `cloro.db.snapshots.search` ```ts theme={null} const rows = await corsair.cloro.db.snapshots.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `prompt` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `area` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/cloro/overview Cloro plugin for Corsair Use **Cloro** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 10 typed API operations * 1 synced entity (`snapshots`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cloro ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cloro ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cloro ``` ```bash bun theme={null} bun add corsair @corsair-dev/cloro ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cloro } from '@corsair-dev/cloro'; export const corsair = createCorsair({ plugins: [ cloro(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} cloro() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cloro', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`utility.countries`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloro.api.utility.countries({}); ``` **`monitor.chatgpt`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloro.api.monitor.chatgpt({}); ``` See the full list on the [API](/plugins/cloro/api) page. ## Query synced data Synced entities support `tenant.cloro.db..search()` and `.list()`: `snapshots`. See [Database](/plugins/cloro/database) for filters and operators. ## What's next > **[API reference](/plugins/cloro/api)** > > Every `cloro.api.*` operation with input and output types. > **[Database](/plugins/cloro/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/close/api API reference for Close: every `close.api.*` operation with input and output types. Every `close.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Activities ### createCall `activities.createCall` Log an external call activity **Risk:** `write` ```ts theme={null} await corsair.close.api.activities.createCall({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | Yes | — | | `direction` | `inbound \| outbound` | No | — | | `contact_id` | `string` | No | — | | `phone` | `string` | No | — | | `duration` | `number` | No | — | | `note` | `string` | No | — | | `recording_url` | `string` | No | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `phone` | `string` | No | — | | `direction` | `string` | No | — | | `duration` | `number` | No | — | | `status` | `string` | No | — | | `user_id` | `string` | No | — | | `organization_id` | `string` | No | — | | `date_created` | `string` | No | — | *** ### createNote `activities.createNote` Create a note activity **Risk:** `write` ```ts theme={null} await corsair.close.api.activities.createNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `note` | `string` | No | — | | `user_id` | `string` | No | — | | `organization_id` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | *** ### createSms `activities.createSms` Create an SMS activity **Risk:** `write` ```ts theme={null} await corsair.close.api.activities.createSms({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | Yes | — | | `local_phone` | `string` | Yes | — | | `text` | `string` | No | — | | `direction` | `inbound \| outbound` | No | — | | `status` | `inbox \| draft \| scheduled \| outbox \| sent \| error` | No | — | | `contact_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `local_phone` | `string` | No | — | | `remote_phone` | `string` | No | — | | `text` | `string` | No | — | | `direction` | `string` | No | — | | `status` | `string` | No | — | | `user_id` | `string` | No | — | | `organization_id` | `string` | No | — | | `date_created` | `string` | No | — | *** ### deleteCall `activities.deleteCall` Delete a call activity **Risk:** `destructive` ```ts theme={null} await corsair.close.api.activities.deleteCall({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | *** ### listCalls `activities.listCalls` List call activities **Risk:** `read` ```ts theme={null} await corsair.close.api.activities.listCalls({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | No | — | | `_limit` | `number` | No | — | | `_skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > lead_id?: string, > phone?: string, > direction?: string, > duration?: number, > status?: string, > user_id?: string | null, > organization_id?: string, > date_created?: string > }[] > ``` *** ### listEmails `activities.listEmails` List email activities **Risk:** `read` ```ts theme={null} await corsair.close.api.activities.listEmails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | No | — | | `_limit` | `number` | No | — | | `_skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > lead_id?: string, > subject?: string, > body_text?: string, > sender?: string, > direction?: string, > user_id?: string | null, > organization_id?: string, > date_created?: string > }[] > ``` *** ### listNotes `activities.listNotes` List note activities **Risk:** `read` ```ts theme={null} await corsair.close.api.activities.listNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | No | — | | `_limit` | `number` | No | — | | `_skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > lead_id?: string, > note?: string, > user_id?: string | null, > organization_id?: string, > date_created?: string, > date_updated?: string > }[] > ``` *** ## Contacts ### create `contacts.create` Create a contact **Risk:** `write` ```ts theme={null} await corsair.close.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | Yes | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `emails` | `object[]` | No | — | | `phones` | `object[]` | No | — | > **emails full type** > > ```ts theme={null} > { > email: string, > type?: string > }[] > ``` > **phones full type** > > ```ts theme={null} > { > phone: string, > type?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `emails` | `object[]` | No | — | | `phones` | `object[]` | No | — | | `organization_id` | `string` | No | — | | `created_by` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | > **emails full type** > > ```ts theme={null} > { > email: string, > type?: string > }[] > ``` > **phones full type** > > ```ts theme={null} > { > phone: string, > type?: string > }[] > ``` *** ### delete `contacts.delete` Delete a contact **Risk:** `destructive` ```ts theme={null} await corsair.close.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | *** ### get `contacts.get` Retrieve a contact by ID **Risk:** `read` ```ts theme={null} await corsair.close.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `emails` | `object[]` | No | — | | `phones` | `object[]` | No | — | | `organization_id` | `string` | No | — | | `created_by` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | > **emails full type** > > ```ts theme={null} > { > email: string, > type?: string > }[] > ``` > **phones full type** > > ```ts theme={null} > { > phone: string, > type?: string > }[] > ``` *** ### list `contacts.list` List contacts **Risk:** `read` ```ts theme={null} await corsair.close.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | No | — | | `_limit` | `number` | No | — | | `_skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > lead_id?: string, > name?: string, > title?: string | null, > emails?: { > email: string, > type?: string > }[], > phones?: { > phone: string, > type?: string > }[], > organization_id?: string, > created_by?: string | null, > date_created?: string, > date_updated?: string > }[] > ``` *** ### update `contacts.update` Update a contact **Risk:** `write` ```ts theme={null} await corsair.close.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `emails` | `object[]` | No | — | | `phones` | `object[]` | No | — | > **emails full type** > > ```ts theme={null} > { > email: string, > type?: string > }[] > ``` > **phones full type** > > ```ts theme={null} > { > phone: string, > type?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `emails` | `object[]` | No | — | | `phones` | `object[]` | No | — | | `organization_id` | `string` | No | — | | `created_by` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | > **emails full type** > > ```ts theme={null} > { > email: string, > type?: string > }[] > ``` > **phones full type** > > ```ts theme={null} > { > phone: string, > type?: string > }[] > ``` *** ## Custom Fields ### listContact `customFields.listContact` List contact custom fields **Risk:** `read` ```ts theme={null} await corsair.close.api.customFields.listContact({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > type?: string, > choices?: string[], > organization_id?: string > }[] > ``` *** ### listLead `customFields.listLead` List lead custom fields **Risk:** `read` ```ts theme={null} await corsair.close.api.customFields.listLead({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > type?: string, > choices?: string[], > organization_id?: string > }[] > ``` *** ## Leads ### create `leads.create` Create a new lead **Risk:** `write` ```ts theme={null} await corsair.close.api.leads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `status_id` | `string` | No | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `custom` | `object` | No | — | | `contacts` | `object[]` | No | — | > **custom full type** > > ```ts theme={null} > { > } > ``` > **contacts full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status_id` | `string` | No | — | | `status_label` | `string` | No | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `organization_id` | `string` | No | — | | `contacts` | `object[]` | No | — | | `custom` | `object` | No | — | | `created_by` | `string` | No | — | | `updated_by` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | > **contacts full type** > > ```ts theme={null} > { > }[] > ``` > **custom full type** > > ```ts theme={null} > { > } > ``` *** ### delete `leads.delete` Delete a lead by ID **Risk:** `destructive` ```ts theme={null} await corsair.close.api.leads.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | *** ### get `leads.get` Retrieve a lead by ID **Risk:** `read` ```ts theme={null} await corsair.close.api.leads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status_id` | `string` | No | — | | `status_label` | `string` | No | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `organization_id` | `string` | No | — | | `contacts` | `object[]` | No | — | | `custom` | `object` | No | — | | `created_by` | `string` | No | — | | `updated_by` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | > **contacts full type** > > ```ts theme={null} > { > }[] > ``` > **custom full type** > > ```ts theme={null} > { > } > ``` *** ### list `leads.list` List leads with optional filters **Risk:** `read` ```ts theme={null} await corsair.close.api.leads.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `_limit` | `number` | No | — | | `_skip` | `number` | No | — | | `query` | `string` | No | — | | `status_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `total_results` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > status_id?: string | null, > status_label?: string | null, > description?: string | null, > url?: string | null, > organization_id?: string, > contacts?: { > }[], > custom?: { > }, > created_by?: string | null, > updated_by?: string | null, > date_created?: string, > date_updated?: string > }[] > ``` *** ### update `leads.update` Update an existing lead **Risk:** `write` ```ts theme={null} await corsair.close.api.leads.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status_id` | `string` | No | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `custom` | `object` | No | — | > **custom full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status_id` | `string` | No | — | | `status_label` | `string` | No | — | | `description` | `string` | No | — | | `url` | `string` | No | — | | `organization_id` | `string` | No | — | | `contacts` | `object[]` | No | — | | `custom` | `object` | No | — | | `created_by` | `string` | No | — | | `updated_by` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | > **contacts full type** > > ```ts theme={null} > { > }[] > ``` > **custom full type** > > ```ts theme={null} > { > } > ``` *** ## Opportunities ### create `opportunities.create` Create an opportunity **Risk:** `write` ```ts theme={null} await corsair.close.api.opportunities.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | Yes | — | | `status_id` | `string` | Yes | — | | `value` | `number` | No | — | | `value_period` | `string` | No | — | | `confidence` | `number` | No | — | | `user_id` | `string` | No | — | | `note` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `lead_name` | `string` | No | — | | `status_id` | `string` | No | — | | `status_label` | `string` | No | — | | `status_type` | `string` | No | — | | `value` | `number` | No | — | | `value_period` | `string` | No | — | | `confidence` | `number` | No | — | | `user_id` | `string` | No | — | | `organization_id` | `string` | No | — | | `date_won` | `string` | No | — | | `date_lost` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | *** ### delete `opportunities.delete` Delete an opportunity **Risk:** `destructive` ```ts theme={null} await corsair.close.api.opportunities.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | *** ### get `opportunities.get` Retrieve an opportunity by ID **Risk:** `read` ```ts theme={null} await corsair.close.api.opportunities.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `lead_name` | `string` | No | — | | `status_id` | `string` | No | — | | `status_label` | `string` | No | — | | `status_type` | `string` | No | — | | `value` | `number` | No | — | | `value_period` | `string` | No | — | | `confidence` | `number` | No | — | | `user_id` | `string` | No | — | | `organization_id` | `string` | No | — | | `date_won` | `string` | No | — | | `date_lost` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | *** ### list `opportunities.list` List opportunities **Risk:** `read` ```ts theme={null} await corsair.close.api.opportunities.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | No | — | | `status_id` | `string` | No | — | | `user_id` | `string` | No | — | | `_limit` | `number` | No | — | | `_skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > lead_id?: string, > lead_name?: string, > status_id?: string, > status_label?: string, > status_type?: string, > value?: number, > value_period?: string, > confidence?: number, > user_id?: string | null, > organization_id?: string, > date_won?: string | null, > date_lost?: string | null, > date_created?: string, > date_updated?: string > }[] > ``` *** ### update `opportunities.update` Update an opportunity **Risk:** `write` ```ts theme={null} await corsair.close.api.opportunities.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status_id` | `string` | No | — | | `value` | `number` | No | — | | `value_period` | `string` | No | — | | `confidence` | `number` | No | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `lead_name` | `string` | No | — | | `status_id` | `string` | No | — | | `status_label` | `string` | No | — | | `status_type` | `string` | No | — | | `value` | `number` | No | — | | `value_period` | `string` | No | — | | `confidence` | `number` | No | — | | `user_id` | `string` | No | — | | `organization_id` | `string` | No | — | | `date_won` | `string` | No | — | | `date_lost` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | *** ## Tasks ### create `tasks.create` Create a task **Risk:** `write` ```ts theme={null} await corsair.close.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | Yes | — | | `text` | `string` | Yes | — | | `due_date` | `string` | No | — | | `assigned_to` | `string` | No | — | | `type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `text` | `string` | No | — | | `due_date` | `string` | No | — | | `is_complete` | `boolean` | No | — | | `assigned_to` | `string` | No | — | | `type` | `string` | No | — | | `organization_id` | `string` | No | — | | `created_by` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | *** ### delete `tasks.delete` Delete a task **Risk:** `destructive` ```ts theme={null} await corsair.close.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | *** ### get `tasks.get` Retrieve a task by ID **Risk:** `read` ```ts theme={null} await corsair.close.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `text` | `string` | No | — | | `due_date` | `string` | No | — | | `is_complete` | `boolean` | No | — | | `assigned_to` | `string` | No | — | | `type` | `string` | No | — | | `organization_id` | `string` | No | — | | `created_by` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | *** ### list `tasks.list` List tasks **Risk:** `read` ```ts theme={null} await corsair.close.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | No | — | | `is_complete` | `boolean` | No | — | | `assigned_to` | `string` | No | — | | `_limit` | `number` | No | — | | `_skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > lead_id?: string, > text?: string, > due_date?: string | null, > is_complete?: boolean, > assigned_to?: string | null, > type?: string, > organization_id?: string, > created_by?: string | null, > date_created?: string, > date_updated?: string > }[] > ``` *** ### update `tasks.update` Update a task **Risk:** `write` ```ts theme={null} await corsair.close.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `text` | `string` | No | — | | `due_date` | `string` | No | — | | `is_complete` | `boolean` | No | — | | `assigned_to` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `lead_id` | `string` | No | — | | `text` | `string` | No | — | | `due_date` | `string` | No | — | | `is_complete` | `boolean` | No | — | | `assigned_to` | `string` | No | — | | `type` | `string` | No | — | | `organization_id` | `string` | No | — | | `created_by` | `string` | No | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | *** ## Users ### getMe `users.getMe` Get current authenticated user info **Risk:** `read` ```ts theme={null} await corsair.close.api.users.getMe({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `image` | `string` | No | — | | `organization_id` | `string` | No | — | *** ### list `users.list` List users in the organization **Risk:** `read` ```ts theme={null} await corsair.close.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `_limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > first_name?: string, > last_name?: string, > email?: string, > image?: string | null, > organization_id?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/close/database Close local sync: searchable entities, `.search()` filters, and operators. The Close plugin syncs data locally. Use `corsair.close.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Activity Call Path: `close.db.activityCall.search` ```ts theme={null} const rows = await corsair.close.db.activityCall.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lead_id` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `direction` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `date_created` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Activity Email Path: `close.db.activityEmail.search` ```ts theme={null} const rows = await corsair.close.db.activityEmail.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lead_id` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `body_text` | `string` | equals, contains, startsWith, endsWith, in | | `sender` | `string` | equals, contains, startsWith, endsWith, in | | `direction` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `date_created` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Activity Note Path: `close.db.activityNote.search` ```ts theme={null} const rows = await corsair.close.db.activityNote.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lead_id` | `string` | equals, contains, startsWith, endsWith, in | | `note` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `date_created` | `string` | equals, contains, startsWith, endsWith, in | | `date_updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Activity Sms Path: `close.db.activitySms.search` ```ts theme={null} const rows = await corsair.close.db.activitySms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lead_id` | `string` | equals, contains, startsWith, endsWith, in | | `local_phone` | `string` | equals, contains, startsWith, endsWith, in | | `remote_phone` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `direction` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `date_created` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contact Path: `close.db.contact.search` ```ts theme={null} const rows = await corsair.close.db.contact.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lead_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `date_created` | `string` | equals, contains, startsWith, endsWith, in | | `date_updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Custom Field Path: `close.db.customField.search` ```ts theme={null} const rows = await corsair.close.db.customField.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lead Path: `close.db.lead.search` ```ts theme={null} const rows = await corsair.close.db.lead.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status_id` | `string` | equals, contains, startsWith, endsWith, in | | `status_label` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `updated_by` | `string` | equals, contains, startsWith, endsWith, in | | `date_created` | `string` | equals, contains, startsWith, endsWith, in | | `date_updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Opportunity Path: `close.db.opportunity.search` ```ts theme={null} const rows = await corsair.close.db.opportunity.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lead_id` | `string` | equals, contains, startsWith, endsWith, in | | `lead_name` | `string` | equals, contains, startsWith, endsWith, in | | `status_id` | `string` | equals, contains, startsWith, endsWith, in | | `status_label` | `string` | equals, contains, startsWith, endsWith, in | | `status_type` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `number` | equals, gt, gte, lt, lte, in | | `value_period` | `string` | equals, contains, startsWith, endsWith, in | | `confidence` | `number` | equals, gt, gte, lt, lte, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `date_won` | `string` | equals, contains, startsWith, endsWith, in | | `date_lost` | `string` | equals, contains, startsWith, endsWith, in | | `date_created` | `string` | equals, contains, startsWith, endsWith, in | | `date_updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Task Path: `close.db.task.search` ```ts theme={null} const rows = await corsair.close.db.task.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lead_id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `due_date` | `string` | equals, contains, startsWith, endsWith, in | | `is_complete` | `boolean` | equals | | `assigned_to` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `date_created` | `string` | equals, contains, startsWith, endsWith, in | | `date_updated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## User Path: `close.db.user.search` ```ts theme={null} const rows = await corsair.close.db.user.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `image` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/close/overview Close plugin for Corsair Use **Close** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 31 typed API operations * 10 synced entities (`activityCall`, `activityEmail`, `activityNote`, `activitySms`, `contact`, `customField`, and 4 more) for fast `.search()` / `.list()` * 6 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/close ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/close ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/close ``` ```bash bun theme={null} bun add corsair @corsair-dev/close ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { close } from '@corsair-dev/close'; export const corsair = createCorsair({ plugins: [ close(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} close() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Close OAuth app. ```ts theme={null} close({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'close', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`activities.listCalls`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.close.api.activities.listCalls({}); ``` **`activities.createCall`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.close.api.activities.createCall({}); ``` See the full list on the [API](/plugins/close/api) page. ## Query synced data Synced entities support `tenant.close.db..search()` and `.list()`: `activityCall`, `activityEmail`, `activityNote`, `activitySms`, `contact`, `customField`, `lead`, `opportunity`, `task`, `user`. See [Database](/plugins/close/database) for filters and operators. ## Webhooks This plugin registers **6** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/close/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/close/api)** > > Every `close.api.*` operation with input and output types. > **[Database](/plugins/close/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/close/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/close/webhooks Close incoming webhooks: event paths, payloads, and response data. The Close plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/close/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `activityNote` * `created` (`activityNote.created`) * `contact` * `created` (`contact.created`) * `lead` * `created` (`lead.created`) * `updated` (`lead.updated`) * `opportunity` * `created` (`opportunity.created`) * `task` * `created` (`task.created`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Activity Note ### Created `activityNote.created` A note activity was created in Close CRM **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscription_id` | `string` | No | — | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id?: string, > object_type: activity.note, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > lead_id?: string, > note?: string, > user_id?: string | null, > organization_id?: string, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > subscription_id?: string, > event: { > id?: string, > object_type: activity.note, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > lead_id?: string, > note?: string, > user_id?: string | null, > organization_id?: string, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} close({ webhookHooks: { activityNote: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Contact ### Created `contact.created` A contact was created in Close CRM **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscription_id` | `string` | No | — | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id?: string, > object_type: contact, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > lead_id?: string, > name?: string, > title?: string | null, > emails?: { > email: string, > type?: string > }[], > phones?: { > phone: string, > type?: string > }[], > organization_id?: string, > created_by?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > subscription_id?: string, > event: { > id?: string, > object_type: contact, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > lead_id?: string, > name?: string, > title?: string | null, > emails?: { > email: string, > type?: string > }[], > phones?: { > phone: string, > type?: string > }[], > organization_id?: string, > created_by?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} close({ webhookHooks: { contact: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Lead ### Created `lead.created` A lead was created in Close CRM **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscription_id` | `string` | No | — | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id?: string, > object_type: lead, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > name?: string, > status_id?: string | null, > status_label?: string | null, > description?: string | null, > url?: string | null, > organization_id?: string, > contacts?: { > }[], > custom?: { > }, > created_by?: string | null, > updated_by?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > subscription_id?: string, > event: { > id?: string, > object_type: lead, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > name?: string, > status_id?: string | null, > status_label?: string | null, > description?: string | null, > url?: string | null, > organization_id?: string, > contacts?: { > }[], > custom?: { > }, > created_by?: string | null, > updated_by?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} close({ webhookHooks: { lead: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `lead.updated` A lead was updated in Close CRM **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscription_id` | `string` | No | — | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id?: string, > object_type: lead, > object_id?: string, > action: updated, > organization_id?: string, > data: { > id: string, > name?: string, > status_id?: string | null, > status_label?: string | null, > description?: string | null, > url?: string | null, > organization_id?: string, > contacts?: { > }[], > custom?: { > }, > created_by?: string | null, > updated_by?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > subscription_id?: string, > event: { > id?: string, > object_type: lead, > object_id?: string, > action: updated, > organization_id?: string, > data: { > id: string, > name?: string, > status_id?: string | null, > status_label?: string | null, > description?: string | null, > url?: string | null, > organization_id?: string, > contacts?: { > }[], > custom?: { > }, > created_by?: string | null, > updated_by?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} close({ webhookHooks: { lead: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Opportunity ### Created `opportunity.created` An opportunity was created in Close CRM **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscription_id` | `string` | No | — | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id?: string, > object_type: opportunity, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > lead_id?: string, > lead_name?: string, > status_id?: string, > status_label?: string, > status_type?: string, > value?: number, > value_period?: string, > confidence?: number, > user_id?: string | null, > organization_id?: string, > date_won?: string | null, > date_lost?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > subscription_id?: string, > event: { > id?: string, > object_type: opportunity, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > lead_id?: string, > lead_name?: string, > status_id?: string, > status_label?: string, > status_type?: string, > value?: number, > value_period?: string, > confidence?: number, > user_id?: string | null, > organization_id?: string, > date_won?: string | null, > date_lost?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} close({ webhookHooks: { opportunity: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Task ### Created `task.created` A task was created in Close CRM **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscription_id` | `string` | No | — | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id?: string, > object_type: string, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > lead_id?: string, > text?: string, > due_date?: string | null, > is_complete?: boolean, > assigned_to?: string | null, > type?: string, > organization_id?: string, > created_by?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > subscription_id?: string, > event: { > id?: string, > object_type: string, > object_id?: string, > action: created, > organization_id?: string, > data: { > id: string, > lead_id?: string, > text?: string, > due_date?: string | null, > is_complete?: boolean, > assigned_to?: string | null, > type?: string, > organization_id?: string, > created_by?: string | null, > date_created?: string, > date_updated?: string > }, > previous_data?: any, > changed_fields?: string[], > date_created?: string, > date_updated?: string, > user_id?: string, > lead_id?: string, > request_id?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} close({ webhookHooks: { task: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/cloudcart/api API reference for Cloudcart: every `cloudcart.api.*` operation with input and output types. Every `cloudcart.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Blogs ### createBlogCategory `blogs.createBlogCategory` Create blog category **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.blogs.createBlogCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createBlogPost `blogs.createBlogPost` Create blog post **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.blogs.createBlogPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createBlogTag `blogs.createBlogTag` Create blog tag **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.blogs.createBlogTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteBlogCategory `blogs.deleteBlogCategory` Delete blog category **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.blogs.deleteBlogCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteBlogPost `blogs.deleteBlogPost` Delete blog post **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.blogs.deleteBlogPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteBlogTag `blogs.deleteBlogTag` Delete blog tag **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.blogs.deleteBlogTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getBlogAuthor `blogs.getBlogAuthor` Get blog author **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.blogs.getBlogAuthor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getBlogCategory `blogs.getBlogCategory` Get blog category **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.blogs.getBlogCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getBlogPost `blogs.getBlogPost` Get blog post **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.blogs.getBlogPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getBlogTag `blogs.getBlogTag` Get blog tag **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.blogs.getBlogTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listBlogCategories `blogs.listBlogCategories` List blog categories **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.blogs.listBlogCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listBlogPosts `blogs.listBlogPosts` List blog posts **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.blogs.listBlogPosts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listBlogTags `blogs.listBlogTags` List blog tags **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.blogs.listBlogTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateBlogCategory `blogs.updateBlogCategory` Update blog category **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.blogs.updateBlogCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateBlogPost `blogs.updateBlogPost` Update blog post **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.blogs.updateBlogPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateBlogTag `blogs.updateBlogTag` Update blog tag **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.blogs.updateBlogTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Carts ### addToCart `carts.addToCart` Add to cart **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.carts.addToCart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | Yes | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | | `quantity` | `number` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### clearCart `carts.clearCart` Clear cart **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.carts.clearCart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getCart `carts.getCart` Get cart **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.carts.getCart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | | `cart_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### removeFromCart `carts.removeFromCart` Remove from cart **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.carts.removeFromCart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | Yes | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### updateCartItem `carts.updateCartItem` Update cart item **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.carts.updateCartItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | Yes | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | | `quantity` | `number` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Categories ### addCategoryProperties `categories.addCategoryProperties` Add category properties **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.categories.addCategoryProperties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### createCategory `categories.createCategory` Create category **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.categories.createCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteCategory `categories.deleteCategory` Delete category **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.categories.deleteCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getCategory `categories.getCategory` Get category **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.categories.getCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getCategoryProperties `categories.getCategoryProperties` Get category properties **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.categories.getCategoryProperties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listCategories `categories.listCategories` List categories **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.categories.listCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateCategory `categories.updateCategory` Update category **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.categories.updateCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Customers ### createCustomer `customers.createCustomer` Create customer **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.createCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createCustomerBillingAddress `customers.createCustomerBillingAddress` Create customer billing address **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.createCustomerBillingAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | Yes | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createCustomerGroup `customers.createCustomerGroup` Create customer group **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.createCustomerGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createCustomerShippingAddress `customers.createCustomerShippingAddress` Create customer shipping address **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.createCustomerShippingAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | Yes | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createCustomerTag `customers.createCustomerTag` Create customer tag **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.createCustomerTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteCustomer `customers.deleteCustomer` Delete customer **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.customers.deleteCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteCustomerBillingAddress `customers.deleteCustomerBillingAddress` Delete customer billing address **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.customers.deleteCustomerBillingAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteCustomerGroup `customers.deleteCustomerGroup` Delete customer group **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.customers.deleteCustomerGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteCustomerShippingAddress `customers.deleteCustomerShippingAddress` Delete customer shipping address **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.customers.deleteCustomerShippingAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteCustomerTag `customers.deleteCustomerTag` Delete customer tag **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.customers.deleteCustomerTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getCustomer `customers.getCustomer` Get customer **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.getCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getCustomerBillingAddress `customers.getCustomerBillingAddress` Get customer billing address **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.getCustomerBillingAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getCustomerGroup `customers.getCustomerGroup` Get customer group **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.getCustomerGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getCustomerGroupsCustomers `customers.getCustomerGroupsCustomers` Get customer group customers **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.getCustomerGroupsCustomers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getCustomerShippingAddress `customers.getCustomerShippingAddress` Get customer shipping address **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.getCustomerShippingAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getCustomerTag `customers.getCustomerTag` Get customer tag **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.getCustomerTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listCustomerBillingAddresses `customers.listCustomerBillingAddresses` List customer billing addresses **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.listCustomerBillingAddresses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listCustomerGroups `customers.listCustomerGroups` List customer groups **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.listCustomerGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listCustomers `customers.listCustomers` List customers **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.listCustomers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listCustomerShippingAddresses `customers.listCustomerShippingAddresses` List customer shipping addresses **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.listCustomerShippingAddresses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listCustomerTags `customers.listCustomerTags` List customer tags **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.customers.listCustomerTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateCustomer `customers.updateCustomer` Update customer **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.updateCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateCustomerBillingAddress `customers.updateCustomerBillingAddress` Update customer billing address **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.updateCustomerBillingAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateCustomerGroup `customers.updateCustomerGroup` Update customer group **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.updateCustomerGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateCustomerShippingAddress `customers.updateCustomerShippingAddress` Update customer shipping address **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.updateCustomerShippingAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateCustomerTag `customers.updateCustomerTag` Update customer tag **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.customers.updateCustomerTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Discounts ### createDiscount `discounts.createDiscount` Create discount **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.discounts.createDiscount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createDiscountCode `discounts.createDiscountCode` Create discount code **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.discounts.createDiscountCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createProductToDiscount `discounts.createProductToDiscount` Create product to discount **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.discounts.createProductToDiscount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteDiscount `discounts.deleteDiscount` Delete discount **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.discounts.deleteDiscount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteDiscountCode `discounts.deleteDiscountCode` Delete discount code **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.discounts.deleteDiscountCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteProductToDiscount `discounts.deleteProductToDiscount` Delete product to discount **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.discounts.deleteProductToDiscount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | Yes | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### generateDiscountCodes `discounts.generateDiscountCodes` Generate discount codes **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.discounts.generateDiscountCodes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listDiscountCodes `discounts.listDiscountCodes` List discount codes **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.discounts.listDiscountCodes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateDiscountCode `discounts.updateDiscountCode` Update discount code **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.discounts.updateDiscountCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Misc ### createRedirect `misc.createRedirect` Create redirect **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.misc.createRedirect({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createVendor `misc.createVendor` Create vendor **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.misc.createVendor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteRedirect `misc.deleteRedirect` Delete redirect **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.misc.deleteRedirect({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteVendor `misc.deleteVendor` Delete vendor **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.misc.deleteVendor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getPaymentMethods `misc.getPaymentMethods` Get payment methods **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.misc.getPaymentMethods({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getShippingMethods `misc.getShippingMethods` Get shipping methods **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.misc.getShippingMethods({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getVendor `misc.getVendor` Get vendor **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.misc.getVendor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listPaymentProviders `misc.listPaymentProviders` List payment providers **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.misc.listPaymentProviders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listRedirects `misc.listRedirects` List redirects **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.misc.listRedirects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listShippingProviders `misc.listShippingProviders` List shipping providers **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.misc.listShippingProviders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listVendors `misc.listVendors` List vendors **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.misc.listVendors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateVendor `misc.updateVendor` Update vendor **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.misc.updateVendor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Orders ### createOrder `orders.createOrder` Create order **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.orders.createOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteOrder `orders.deleteOrder` Delete order **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.orders.deleteOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getOrder `orders.getOrder` Get order **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.orders.getOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listOrderBillingAddresses `orders.listOrderBillingAddresses` List order billing addresses **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.orders.listOrderBillingAddresses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listOrderPayments `orders.listOrderPayments` List order payments **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.orders.listOrderPayments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listOrderProducts `orders.listOrderProducts` List order products **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.orders.listOrderProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listOrderProductsOptions `orders.listOrderProductsOptions` List order products options **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.orders.listOrderProductsOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listOrders `orders.listOrders` List orders **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.orders.listOrders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listOrderShipping `orders.listOrderShipping` List order shipping **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.orders.listOrderShipping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listOrderShippingAddresses `orders.listOrderShippingAddresses` List order shipping addresses **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.orders.listOrderShippingAddresses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listOrderStatus `orders.listOrderStatus` List order statuses **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.orders.listOrderStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateOrder `orders.updateOrder` Update order **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.orders.updateOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Products ### createImage `products.createImage` Create image **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.products.createImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createLinkedProducts `products.createLinkedProducts` Create linked products **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.products.createLinkedProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### createProduct `products.createProduct` Create product **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.products.createProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteImage `products.deleteImage` Delete image **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.products.deleteImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteLinkedProducts `products.deleteLinkedProducts` Delete linked products **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.products.deleteLinkedProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteProduct `products.deleteProduct` Delete product **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.products.deleteProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getImage `products.getImage` Get image **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.products.getImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getProduct `products.getProduct` Get product **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.products.getProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getProductsLinkedProduct `products.getProductsLinkedProduct` Get product linked product **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.products.getProductsLinkedProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getProductsLinkedProducts `products.getProductsLinkedProducts` Get products linked products **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.products.getProductsLinkedProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getProductWithRelations `products.getProductWithRelations` Get product with relations. Pass documented include params (e.g. include=category) to sideload related resources. **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.products.getProductWithRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listImages `products.listImages` List images **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.products.listImages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listProducts `products.listProducts` List products **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.products.listProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateLinkedProduct `products.updateLinkedProduct` Update linked product **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.products.updateLinkedProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### updateProduct `products.updateProduct` Update product **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.products.updateProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Properties ### createProductsPropertyOptions `properties.createProductsPropertyOptions` Create product property options **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.properties.createProductsPropertyOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### createProperty `properties.createProperty` Create property **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.properties.createProperty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createPropertyOption `properties.createPropertyOption` Create property option **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.properties.createPropertyOption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | Yes | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteProperty `properties.deleteProperty` Delete property **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.properties.deleteProperty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deletePropertyOption `properties.deletePropertyOption` Delete property option **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.properties.deletePropertyOption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getProperty `properties.getProperty` Get property **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.properties.getProperty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getPropertyOption `properties.getPropertyOption` Get property option **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.properties.getPropertyOption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getPropertyOptionsRelationship `properties.getPropertyOptionsRelationship` Get property options relationship **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.properties.getPropertyOptionsRelationship({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listProperties `properties.listProperties` List properties **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.properties.listProperties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listPropertyOptions `properties.listPropertyOptions` List property options **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.properties.listPropertyOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateProperty `properties.updateProperty` Update property **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.properties.updateProperty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updatePropertyOption `properties.updatePropertyOption` Update property option **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.properties.updatePropertyOption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Subscribers ### createSubscriber `subscribers.createSubscriber` Create subscriber **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.subscribers.createSubscriber({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createSubscriberChannel `subscribers.createSubscriberChannel` Create subscriber channel **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.subscribers.createSubscriberChannel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createSubscriberTag `subscribers.createSubscriberTag` Create subscriber tag **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.subscribers.createSubscriberTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteSubscriber `subscribers.deleteSubscriber` Delete subscriber **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.subscribers.deleteSubscriber({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteSubscribersChannel `subscribers.deleteSubscribersChannel` Delete subscriber channel **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.subscribers.deleteSubscribersChannel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteSubscriberTag `subscribers.deleteSubscriberTag` Delete subscriber tag **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.subscribers.deleteSubscriberTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getSubscriber `subscribers.getSubscriber` Get subscriber **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.subscribers.getSubscriber({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getSubscribersChannel `subscribers.getSubscribersChannel` Get subscriber channel **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.subscribers.getSubscribersChannel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getSubscriberTag `subscribers.getSubscriberTag` Get subscriber tag **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.subscribers.getSubscriberTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listSubscribers `subscribers.listSubscribers` List subscribers **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.subscribers.listSubscribers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listSubscribersChannels `subscribers.listSubscribersChannels` List subscriber channels **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.subscribers.listSubscribersChannels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listSubscribersTags `subscribers.listSubscribersTags` List subscriber tags **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.subscribers.listSubscribersTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateSubscriber `subscribers.updateSubscriber` Update subscriber **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.subscribers.updateSubscriber({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateSubscribersChannel `subscribers.updateSubscribersChannel` Update subscriber channel **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.subscribers.updateSubscribersChannel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateSubscriberTag `subscribers.updateSubscriberTag` Update subscriber tag **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.subscribers.updateSubscriberTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Variants ### createVariant `variants.createVariant` Create variant **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.variants.createVariant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | Yes | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createVariantOption `variants.createVariantOption` Create variant option **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.variants.createVariantOption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | Yes | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createVariantOptions `variants.createVariantOptions` Create variant options **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.variants.createVariantOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | Yes | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createVariantParameter `variants.createVariantParameter` Create variant parameter **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.variants.createVariantParameter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### createVariantParameterForVariant `variants.createVariantParameterForVariant` Create variant parameter for variant **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.variants.createVariantParameterForVariant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteVariant `variants.deleteVariant` Delete variant **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.variants.deleteVariant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteVariantOption `variants.deleteVariantOption` Delete variant option **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.variants.deleteVariantOption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### deleteVariantParameter `variants.deleteVariantParameter` Delete variant parameter **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.variants.deleteVariantParameter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getVariant `variants.getVariant` Get variant **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.variants.getVariant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getVariantOption `variants.getVariantOption` Get variant option **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.variants.getVariantOption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### getVariantParameter `variants.getVariantParameter` Get variant parameter **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.variants.getVariantParameter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listVariantOptions `variants.listVariantOptions` List variant options **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.variants.listVariantOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listVariantParameters `variants.listVariantParameters` List variant parameters **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.variants.listVariantParameters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listVariants `variants.listVariants` List variants **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.variants.listVariants({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateVariant `variants.updateVariant` Update variant **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.variants.updateVariant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateVariantOption `variants.updateVariantOption` Update variant option **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.variants.updateVariantOption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateVariantParameter `variants.updateVariantParameter` Update variant parameter **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.variants.updateVariantParameter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ## Webhooks ### createWebhook `webhooks.createWebhook` Create webhook **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.webhooks.createWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### deleteWebhook `webhooks.deleteWebhook` Delete webhook **Risk:** `destructive` ```ts theme={null} await corsair.cloudcart.api.webhooks.deleteWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: any > } | { > } > ``` *** ### getWebhook `webhooks.getWebhook` Get webhook **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.webhooks.getWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### listWebhooks `webhooks.listWebhooks` List webhooks **Risk:** `read` ```ts theme={null} await corsair.cloudcart.api.webhooks.listWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** ### updateWebhook `webhooks.updateWebhook` Update webhook **Risk:** `write` ```ts theme={null} await corsair.cloudcart.api.webhooks.updateWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `product_id` | `string \| number` | No | — | | `customer_id` | `string \| number` | No | — | | `property_id` | `string \| number` | No | — | | `discount_id` | `string \| number` | No | — | | `variant_id` | `string \| number` | No | — | | `parameter_id` | `string \| number` | No | — | | `page[number]` | `number` | No | — | | `page[size]` | `number` | No | — | | `sort` | `string` | No | — | | `include` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/cloudcart/database Cloudcart local sync: searchable entities, `.search()` filters, and operators. The Cloudcart plugin syncs data locally. Use `corsair.cloudcart.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Categories Path: `cloudcart.db.categories.search` ```ts theme={null} const rows = await corsair.cloudcart.db.categories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Customers Path: `cloudcart.db.customers.search` ```ts theme={null} const rows = await corsair.cloudcart.db.customers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Orders Path: `cloudcart.db.orders.search` ```ts theme={null} const rows = await corsair.cloudcart.db.orders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `order_total` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `status_fulfillment` | `string` | equals, contains, startsWith, endsWith, in | | `customer_email` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Products Path: `cloudcart.db.products.search` ```ts theme={null} const rows = await corsair.cloudcart.db.products.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `price` | `number` | equals, gt, gte, lt, lte, in | | `sku` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `quantity` | `number` | equals, gt, gte, lt, lte, in | | `weight` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Variants Path: `cloudcart.db.variants.search` ```ts theme={null} const rows = await corsair.cloudcart.db.variants.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `sku` | `string` | equals, contains, startsWith, endsWith, in | | `price` | `number` | equals, gt, gte, lt, lte, in | | `quantity` | `number` | equals, gt, gte, lt, lte, in | | `product_id` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/cloudcart/overview Cloudcart plugin for Corsair Use **Cloudcart** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 151 typed API operations * 5 synced entities (`categories`, `customers`, `orders`, `products`, `variants`) for fast `.search()` / `.list()` * 3 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cloudcart ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cloudcart ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cloudcart ``` ```bash bun theme={null} bun add corsair @corsair-dev/cloudcart ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cloudcart } from '@corsair-dev/cloudcart'; export const corsair = createCorsair({ plugins: [ cloudcart(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} cloudcart() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cloudcart', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`blogs.getBlogAuthor`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloudcart.api.blogs.getBlogAuthor({}); ``` **`blogs.createBlogCategory`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloudcart.api.blogs.createBlogCategory({}); ``` See the full list on the [API](/plugins/cloudcart/api) page. ## Query synced data Synced entities support `tenant.cloudcart.db..search()` and `.list()`: `categories`, `customers`, `orders`, `products`, `variants`. See [Database](/plugins/cloudcart/database) for filters and operators. ## Webhooks This plugin registers **3** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/cloudcart/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/cloudcart/api)** > > Every `cloudcart.api.*` operation with input and output types. > **[Database](/plugins/cloudcart/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/cloudcart/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/cloudcart/webhooks Cloudcart incoming webhooks: event paths, payloads, and response data. The Cloudcart plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/cloudcart/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `customer` * `created` (`customer.created`) * `order` * `created` (`order.created`) * `product` * `created` (`product.created`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Customer ### Created `customer.created` Customer created webhook event **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `email` | `any` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > id: string | number, > email: any > } > ``` **`webhookHooks` example** ```ts theme={null} cloudcart({ webhookHooks: { customer: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Order ### Created `order.created` Order created webhook event **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `order_total` | `any` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > id: string | number, > order_total: any > } > ``` **`webhookHooks` example** ```ts theme={null} cloudcart({ webhookHooks: { order: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Product ### Created `product.created` Product created webhook event **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `sku` | `any` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > id: string | number, > sku: any > } > ``` **`webhookHooks` example** ```ts theme={null} cloudcart({ webhookHooks: { product: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/cloudflare/api API reference for Cloudflare: every `cloudflare.api.*` operation with input and output types. Every `cloudflare.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Dns ### create `dns.create` Create a DNS record in a zone **Risk:** `write` ```ts theme={null} await corsair.cloudflare.api.dns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `ttl` | `number` | No | — | | `proxied` | `boolean` | No | — | | `priority` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `zone_id` | `string` | No | — | | `zone_name` | `string` | No | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `proxiable` | `boolean` | No | — | | `proxied` | `boolean` | No | — | | `ttl` | `number` | No | — | | `locked` | `boolean` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | *** ### delete `dns.delete` Delete a DNS record **Risk:** `destructive` ```ts theme={null} await corsair.cloudflare.api.dns.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `dns_record_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### edit `dns.edit` Update a DNS record **Risk:** `write` ```ts theme={null} await corsair.cloudflare.api.dns.edit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `dns_record_id` | `string` | Yes | — | | `type` | `string` | No | — | | `name` | `string` | No | — | | `content` | `string` | No | — | | `ttl` | `number` | No | — | | `proxied` | `boolean` | No | — | | `priority` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `zone_id` | `string` | No | — | | `zone_name` | `string` | No | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `proxiable` | `boolean` | No | — | | `proxied` | `boolean` | No | — | | `ttl` | `number` | No | — | | `locked` | `boolean` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | *** ### get `dns.get` Retrieve a DNS record by ID **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.dns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `dns_record_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `zone_id` | `string` | No | — | | `zone_name` | `string` | No | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `proxiable` | `boolean` | No | — | | `proxied` | `boolean` | No | — | | `ttl` | `number` | No | — | | `locked` | `boolean` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | *** ### list `dns.list` List DNS records for a zone **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.dns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `zone_id` | `string` | Yes | — | | `type` | `string` | No | — | | `name` | `string` | No | — | | `content` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > zone_id?: string, > zone_name?: string, > type: string, > name: string, > content: string, > proxiable?: boolean, > proxied?: boolean, > ttl?: number, > locked?: boolean, > created_on?: string, > modified_on?: string > }[] > ``` *** ## Rulesets ### create `rulesets.create` Create a ruleset in a zone **Risk:** `write` ```ts theme={null} await corsair.cloudflare.api.rulesets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `kind` | `string` | Yes | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | | `description` | `string` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ### delete `rulesets.delete` Delete a ruleset **Risk:** `destructive` ```ts theme={null} await corsair.cloudflare.api.rulesets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `ruleset_id` | `string` | Yes | — | **Output:** `null` *** ### get `rulesets.get` Retrieve a ruleset by ID **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.rulesets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `ruleset_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ### list `rulesets.list` List rulesets for a zone **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.rulesets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > kind: string, > version?: string, > last_updated?: string, > phase: string, > rules?: { > }[] > }[] > ``` *** ### update `rulesets.update` Update a ruleset **Risk:** `write` ```ts theme={null} await corsair.cloudflare.api.rulesets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `ruleset_id` | `string` | Yes | — | | `rules` | `object[]` | Yes | — | | `description` | `string` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ## Workers ### routes.create `workers.routes.create` Create a Workers route **Risk:** `write` ```ts theme={null} await corsair.cloudflare.api.workers.routes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `pattern` | `string` | Yes | — | | `script` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `pattern` | `string` | Yes | — | | `script` | `string` | No | — | *** ### routes.delete `workers.routes.delete` Delete a Workers route **Risk:** `destructive` ```ts theme={null} await corsair.cloudflare.api.workers.routes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `route_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### routes.edit `workers.routes.edit` Update a Workers route **Risk:** `write` ```ts theme={null} await corsair.cloudflare.api.workers.routes.edit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `route_id` | `string` | Yes | — | | `pattern` | `string` | No | — | | `script` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `pattern` | `string` | Yes | — | | `script` | `string` | No | — | *** ### routes.get `workers.routes.get` Retrieve a Workers route by ID **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.workers.routes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `route_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `pattern` | `string` | Yes | — | | `script` | `string` | No | — | *** ### routes.list `workers.routes.list` List Workers routes for a zone **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.workers.routes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > pattern: string, > script?: string > }[] > ``` *** ### scripts.delete `workers.scripts.delete` Delete a Workers script **Risk:** `destructive` ```ts theme={null} await corsair.cloudflare.api.workers.scripts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | | `script_name` | `string` | Yes | — | **Output:** `null` *** ### scripts.get `workers.scripts.get` Download Workers script source code by name **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.workers.scripts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | | `script_name` | `string` | Yes | — | **Output:** `string` *** ### scripts.list `workers.scripts.list` List Workers scripts for an account **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.workers.scripts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > created_on?: string, > modified_on?: string > }[] > ``` *** ### scripts.upload `workers.scripts.upload` Upload or overwrite a Workers script **Risk:** `write` ```ts theme={null} await corsair.cloudflare.api.workers.scripts.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | | `script_name` | `string` | Yes | — | | `script_content` | `string` | Yes | — | | `bindings` | `object[]` | No | — | | `compatibility_date` | `string` | No | — | > **bindings full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | *** ## Zones ### create `zones.create` Create a new Cloudflare zone **Risk:** `write` ```ts theme={null} await corsair.cloudflare.api.zones.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `account` | `object` | Yes | — | | `jump_start` | `boolean` | No | — | > **account full type** > > ```ts theme={null} > { > id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `string` | No | — | | `paused` | `boolean` | No | — | | `type` | `string` | No | — | | `account` | `object` | No | — | | `name_servers` | `string[]` | No | — | | `original_name_servers` | `string[]` | No | — | | `original_registrar` | `string` | No | — | | `original_dnshost` | `string` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | | `activated_on` | `string` | No | — | > **account full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### delete `zones.delete` Delete a Cloudflare zone **Risk:** `destructive` ```ts theme={null} await corsair.cloudflare.api.zones.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### edit `zones.edit` Update a Cloudflare zone **Risk:** `write` ```ts theme={null} await corsair.cloudflare.api.zones.edit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `paused` | `boolean` | No | — | | `plan` | `object` | No | — | | `vanity_name_servers` | `string[]` | No | — | > **plan full type** > > ```ts theme={null} > { > id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `string` | No | — | | `paused` | `boolean` | No | — | | `type` | `string` | No | — | | `account` | `object` | No | — | | `name_servers` | `string[]` | No | — | | `original_name_servers` | `string[]` | No | — | | `original_registrar` | `string` | No | — | | `original_dnshost` | `string` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | | `activated_on` | `string` | No | — | > **account full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### get `zones.get` Retrieve a Cloudflare zone by ID **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.zones.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `string` | No | — | | `paused` | `boolean` | No | — | | `type` | `string` | No | — | | `account` | `object` | No | — | | `name_servers` | `string[]` | No | — | | `original_name_servers` | `string[]` | No | — | | `original_registrar` | `string` | No | — | | `original_dnshost` | `string` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | | `activated_on` | `string` | No | — | > **account full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### list `zones.list` List Cloudflare zones **Risk:** `read` ```ts theme={null} await corsair.cloudflare.api.zones.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > status?: string, > paused?: boolean, > type?: string, > account?: { > id: string > }, > name_servers?: string[], > original_name_servers?: string[], > original_registrar?: string, > original_dnshost?: string, > created_on?: string, > modified_on?: string, > activated_on?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/cloudflare/database Cloudflare local sync: searchable entities, `.search()` filters, and operators. The Cloudflare plugin syncs data locally. Use `corsair.cloudflare.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Dns Records Path: `cloudflare.db.dnsRecords.search` ```ts theme={null} const rows = await corsair.cloudflare.db.dnsRecords.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `zone_id` | `string` | equals, contains, startsWith, endsWith, in | | `zone_name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `proxiable` | `boolean` | equals | | `proxied` | `boolean` | equals | | `ttl` | `number` | equals, gt, gte, lt, lte, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `locked` | `boolean` | equals | | `created_on` | `date` | equals, before, after, between | | `modified_on` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Rulesets Path: `cloudflare.db.rulesets.search` ```ts theme={null} const rows = await corsair.cloudflare.db.rulesets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `zone_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `kind` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated` | `date` | equals, before, after, between | | `phase` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Worker Routes Path: `cloudflare.db.workerRoutes.search` ```ts theme={null} const rows = await corsair.cloudflare.db.workerRoutes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `zone_id` | `string` | equals, contains, startsWith, endsWith, in | | `pattern` | `string` | equals, contains, startsWith, endsWith, in | | `script` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Worker Scripts Path: `cloudflare.db.workerScripts.search` ```ts theme={null} const rows = await corsair.cloudflare.db.workerScripts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `account_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_on` | `date` | equals, before, after, between | | `modified_on` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Zones Path: `cloudflare.db.zones.search` ```ts theme={null} const rows = await corsair.cloudflare.db.zones.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `paused` | `boolean` | equals | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `created_on` | `date` | equals, before, after, between | | `modified_on` | `date` | equals, before, after, between | | `activated_on` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/cloudflare/get-credentials Step-by-step instructions for obtaining a Cloudflare API token for the Corsair Cloudflare plugin. This guide walks you through obtaining credentials for the Cloudflare plugin. ## Authentication Method The Cloudflare plugin uses API key authentication (Cloudflare **API tokens** sent as `Authorization: Bearer`). * **[`api_key`](/concepts/api-key)** (default) — Cloudflare API token ## API Token ### Step 1: Create a token 1. Sign in to the [Cloudflare dashboard](https://dash.cloudflare.com). 2. Go to **My Profile** → **API Tokens** → **Create Token**. 3. Use a template or **Create Custom Token** with permissions for what you need (for example **Zone Read**, **DNS Read**, **Workers Scripts Read** on your account/zones). 4. Copy the token immediately — it is shown only once. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=cloudflare api_key=your-cloudflare-api-token ``` Or pass the token in plugin options: ```ts corsair.ts theme={null} cloudflare({ key: process.env.CLOUDFLARE_API_TOKEN, }) ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=cloudflare --credentials ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | API token | [`api_key`](/concepts/api-key) auth | Dashboard → My Profile → API Tokens | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/cloudflare/overview Edge cloud platform for DNS, CDN, security, Workers, and internet infrastructure services. Use **Cloudflare** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 24 typed API operations * 5 synced entities (`dnsRecords`, `rulesets`, `workerRoutes`, `workerScripts`, `zones`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cloudflare ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cloudflare ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cloudflare ``` ```bash bun theme={null} bun add corsair @corsair-dev/cloudflare ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cloudflare } from '@corsair-dev/cloudflare'; export const corsair = createCorsair({ plugins: [ cloudflare(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/cloudflare/get-credentials). ```ts theme={null} cloudflare() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cloudflare', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`dns.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloudflare.api.dns.get({}); ``` **`dns.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloudflare.api.dns.create({}); ``` See the full list on the [API](/plugins/cloudflare/api) page. ## Query synced data Synced entities support `tenant.cloudflare.db..search()` and `.list()`: `dnsRecords`, `rulesets`, `workerRoutes`, `workerScripts`, `zones`. See [Database](/plugins/cloudflare/database) for filters and operators. ## What's next > **[API reference](/plugins/cloudflare/api)** > > Every `cloudflare.api.*` operation with input and output types. > **[Database](/plugins/cloudflare/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/cloudflare/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/cloudflareapikey/api API reference for Cloudflare API token: every `cloudflareapikey.api.*` operation with input and output types. Every `cloudflareapikey.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Cache ### getRegionalTieredCache `cache.getRegionalTieredCache` Get the regional tiered cache setting for a zone **Risk:** `read` ```ts theme={null} await corsair.cloudflareapikey.api.cache.getRegionalTieredCache({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `tc_regional \| string` | Yes | — | | `editable` | `boolean` | No | — | | `value` | `on \| off` | Yes | — | | `modified_on` | `string` | No | — | *** ## Dns ### create `dns.create` Create a DNS record in a zone **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.dns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `ttl` | `number` | No | — | | `proxied` | `boolean` | No | — | | `priority` | `number` | No | — | | `comment` | `string` | No | — | | `tags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `zone_id` | `string` | No | — | | `zone_name` | `string` | No | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `proxiable` | `boolean` | No | — | | `proxied` | `boolean` | No | — | | `ttl` | `number` | No | — | | `priority` | `number` | No | — | | `locked` | `boolean` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | *** ### delete `dns.delete` Delete a DNS record \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.cloudflareapikey.api.dns.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `dns_record_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### list `dns.list` List, search, sort, and filter DNS records for a zone **Risk:** `read` ```ts theme={null} await corsair.cloudflareapikey.api.dns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `zone_id` | `string` | Yes | — | | `type` | `string` | No | — | | `name` | `string` | No | — | | `content` | `string` | No | — | | `proxied` | `boolean` | No | — | | `search` | `string` | No | — | | `direction` | `asc \| desc` | No | — | | `order` | `string` | No | — | | `match` | `any \| all` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > zone_id?: string, > zone_name?: string, > type: string, > name: string, > content: string, > proxiable?: boolean, > proxied?: boolean, > ttl?: number, > priority?: number, > locked?: boolean, > created_on?: string, > modified_on?: string > }[] > ``` *** ### overwrite `dns.overwrite` Completely overwrite a DNS record **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.dns.overwrite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `dns_record_id` | `string` | Yes | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `ttl` | `number` | No | — | | `proxied` | `boolean` | No | — | | `priority` | `number` | No | — | | `comment` | `string` | No | — | | `tags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `zone_id` | `string` | No | — | | `zone_name` | `string` | No | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `proxiable` | `boolean` | No | — | | `proxied` | `boolean` | No | — | | `ttl` | `number` | No | — | | `priority` | `number` | No | — | | `locked` | `boolean` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | *** ## Dnssec ### delete `dnssec.delete` Delete DNSSEC configuration for a zone \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.cloudflareapikey.api.dnssec.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | **Output:** `string` *** ### update `dnssec.update` Enable or disable DNSSEC for a zone **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.dnssec.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `status` | `active \| disabled` | No | — | | `dnssec_multi_signer` | `boolean` | No | — | | `dnssec_presigned` | `boolean` | No | — | | `dnssec_use_nsec3` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `algorithm` | `string` | No | — | | `digest` | `string` | No | — | | `digest_algorithm` | `string` | No | — | | `digest_type` | `string` | No | — | | `ds` | `string` | No | — | | `flags` | `number` | No | — | | `key_tag` | `number` | No | — | | `key_type` | `string` | No | — | | `public_key` | `string` | No | — | | `dnssec_multi_signer` | `boolean` | No | — | | `dnssec_presigned` | `boolean` | No | — | | `dnssec_use_nsec3` | `boolean` | No | — | | `modified_on` | `string` | No | — | *** ## Ips ### get `ips.get` Retrieve Cloudflare or JD Cloud IP CIDR blocks **Risk:** `read` ```ts theme={null} await corsair.cloudflareapikey.api.ips.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `networks` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `ipv4_cidrs` | `string[]` | No | — | | `ipv6_cidrs` | `string[]` | No | — | | `jdcloud_cidrs` | `string[]` | No | — | *** ## Lockdowns ### create `lockdowns.create` Create a Zone Lockdown rule **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.lockdowns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `urls` | `string[]` | Yes | — | | `configurations` | `object[]` | Yes | — | | `description` | `string` | No | — | | `paused` | `boolean` | No | — | | `priority` | `number` | No | — | > **configurations full type** > > ```ts theme={null} > { > target?: ip | ip_range, > value?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `urls` | `string[]` | Yes | — | | `configurations` | `object[]` | Yes | — | | `description` | `string` | No | — | | `paused` | `boolean` | No | — | | `priority` | `number` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | > **configurations full type** > > ```ts theme={null} > { > target?: ip | ip_range, > value?: string > }[] > ``` *** ### get `lockdowns.get` Get a Zone Lockdown rule by ID **Risk:** `read` ```ts theme={null} await corsair.cloudflareapikey.api.lockdowns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `lockdown_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `urls` | `string[]` | Yes | — | | `configurations` | `object[]` | Yes | — | | `description` | `string` | No | — | | `paused` | `boolean` | No | — | | `priority` | `number` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | > **configurations full type** > > ```ts theme={null} > { > target?: ip | ip_range, > value?: string > }[] > ``` *** ### update `lockdowns.update` Update a Zone Lockdown rule **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.lockdowns.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `lockdown_id` | `string` | Yes | — | | `urls` | `string[]` | No | — | | `configurations` | `object[]` | No | — | | `description` | `string` | No | — | | `paused` | `boolean` | No | — | | `priority` | `number` | No | — | > **configurations full type** > > ```ts theme={null} > { > target?: ip | ip_range, > value?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `urls` | `string[]` | Yes | — | | `configurations` | `object[]` | Yes | — | | `description` | `string` | No | — | | `paused` | `boolean` | No | — | | `priority` | `number` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | > **configurations full type** > > ```ts theme={null} > { > target?: ip | ip_range, > value?: string > }[] > ``` *** ## Rulesets ### create `rulesets.create` Create a ruleset at account or zone scope **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.rulesets.create({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > zone_id?: string > }& { > name: string, > kind: string, > phase: string, > description?: string, > rules?: { > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ### createRule `rulesets.createRule` Add a rule to an existing ruleset **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.rulesets.createRule({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > zone_id?: string > }& { > ruleset_id: string, > action: string, > expression: string, > description?: string, > enabled?: boolean, > action_parameters?: { > }, > position?: { > index?: number, > before?: string, > after?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ### delete `rulesets.delete` Delete all versions of a ruleset \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.cloudflareapikey.api.rulesets.delete({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > zone_id?: string > }& { > ruleset_id: string > } > ``` **Output:** `null` *** ### deleteRule `rulesets.deleteRule` Delete a rule from a ruleset \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.cloudflareapikey.api.rulesets.deleteRule({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > zone_id?: string > }& { > ruleset_id: string, > rule_id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ### get `rulesets.get` Fetch the latest version of a ruleset by ID **Risk:** `read` ```ts theme={null} await corsair.cloudflareapikey.api.rulesets.get({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > zone_id?: string > }& { > ruleset_id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ### getEntrypointVersion `rulesets.getEntrypointVersion` Get a historical entrypoint ruleset version **Risk:** `read` ```ts theme={null} await corsair.cloudflareapikey.api.rulesets.getEntrypointVersion({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > zone_id?: string > }& { > ruleset_phase: string, > ruleset_version: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ### update `rulesets.update` Update a ruleset (include every rule you want to keep) **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.rulesets.update({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > zone_id?: string > }& { > ruleset_id: string, > name?: string, > description?: string, > rules: { > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateRule `rulesets.updateRule` Update a specific rule in a ruleset **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.rulesets.updateRule({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > zone_id?: string > }& { > ruleset_id: string, > rule_id: string, > action?: string, > expression?: string, > description?: string, > enabled?: boolean, > action_parameters?: { > }, > position?: { > index?: number, > before?: string, > after?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `kind` | `string` | Yes | — | | `version` | `string` | No | — | | `last_updated` | `string` | No | — | | `phase` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > }[] > ``` *** ## S3 ### upload `s3.upload` Upload file content to an R2 bucket (S3-compatible object storage) **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.s3.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | | `bucket_name` | `string` | Yes | — | | `object_key` | `string` | Yes | — | | `content` | `string` | Yes | — | | `content_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `key` | `string` | No | — | | `size` | `string \| number` | No | — | | `storage_class` | `string` | No | — | | `uploaded` | `string` | No | — | | `version` | `string` | No | — | *** ## Zones ### delete `zones.delete` Delete an existing zone \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.cloudflareapikey.api.zones.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `zones.get` Get details for a specific zone **Risk:** `read` ```ts theme={null} await corsair.cloudflareapikey.api.zones.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `string` | No | — | | `paused` | `boolean` | No | — | | `type` | `string` | No | — | | `account` | `object` | No | — | | `name_servers` | `string[]` | No | — | | `original_name_servers` | `string[]` | No | — | | `vanity_name_servers` | `string[]` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | | `activated_on` | `string` | No | — | > **account full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### list `zones.list` List, search, sort, and filter Cloudflare zones **Risk:** `read` ```ts theme={null} await corsair.cloudflareapikey.api.zones.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `account_id` | `string` | No | — | | `direction` | `asc \| desc` | No | — | | `order` | `string` | No | — | | `match` | `any \| all` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > status?: string, > paused?: boolean, > type?: string, > account?: { > id: string > }, > name_servers?: string[], > original_name_servers?: string[], > vanity_name_servers?: string[], > created_on?: string, > modified_on?: string, > activated_on?: string > }[] > ``` *** ### rerunActivationCheck `zones.rerunActivationCheck` Trigger a new activation check for a pending zone **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.zones.rerunActivationCheck({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `string` | No | — | | `paused` | `boolean` | No | — | | `type` | `string` | No | — | | `account` | `object` | No | — | | `name_servers` | `string[]` | No | — | | `original_name_servers` | `string[]` | No | — | | `vanity_name_servers` | `string[]` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | | `activated_on` | `string` | No | — | > **account full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### update `zones.update` Edit a Cloudflare zone (one of paused, type, or vanity\_name\_servers) **Risk:** `write` ```ts theme={null} await corsair.cloudflareapikey.api.zones.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zone_id` | `string` | Yes | — | | `paused` | `boolean` | No | — | | `type` | `string` | No | — | | `vanity_name_servers` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `string` | No | — | | `paused` | `boolean` | No | — | | `type` | `string` | No | — | | `account` | `object` | No | — | | `name_servers` | `string[]` | No | — | | `original_name_servers` | `string[]` | No | — | | `vanity_name_servers` | `string[]` | No | — | | `created_on` | `string` | No | — | | `modified_on` | `string` | No | — | | `activated_on` | `string` | No | — | > **account full type** > > ```ts theme={null} > { > id: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/cloudflareapikey/database Cloudflare API token local sync: searchable entities, `.search()` filters, and operators. The Cloudflare API token plugin syncs data locally. Use `corsair.cloudflareapikey.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Dns Records Path: `cloudflareapikey.db.dnsRecords.search` ```ts theme={null} const rows = await corsair.cloudflareapikey.db.dnsRecords.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `zone_id` | `string` | equals, contains, startsWith, endsWith, in | | `zone_name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `proxiable` | `boolean` | equals | | `proxied` | `boolean` | equals | | `ttl` | `number` | equals, gt, gte, lt, lte, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `locked` | `boolean` | equals | | `created_on` | `date` | equals, before, after, between | | `modified_on` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Dnssec Path: `cloudflareapikey.db.dnssec.search` ```ts theme={null} const rows = await corsair.cloudflareapikey.db.dnssec.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `zone_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `algorithm` | `string` | equals, contains, startsWith, endsWith, in | | `digest` | `string` | equals, contains, startsWith, endsWith, in | | `digest_algorithm` | `string` | equals, contains, startsWith, endsWith, in | | `digest_type` | `string` | equals, contains, startsWith, endsWith, in | | `ds` | `string` | equals, contains, startsWith, endsWith, in | | `dnssec_multi_signer` | `boolean` | equals | | `dnssec_presigned` | `boolean` | equals | | `dnssec_use_nsec3` | `boolean` | equals | | `flags` | `number` | equals, gt, gte, lt, lte, in | | `key_tag` | `number` | equals, gt, gte, lt, lte, in | | `key_type` | `string` | equals, contains, startsWith, endsWith, in | | `public_key` | `string` | equals, contains, startsWith, endsWith, in | | `modified_on` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lockdowns Path: `cloudflareapikey.db.lockdowns.search` ```ts theme={null} const rows = await corsair.cloudflareapikey.db.lockdowns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `zone_id` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `paused` | `boolean` | equals | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `created_on` | `date` | equals, before, after, between | | `modified_on` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## R2Objects Path: `cloudflareapikey.db.r2Objects.search` ```ts theme={null} const rows = await corsair.cloudflareapikey.db.r2Objects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `account_id` | `string` | equals, contains, startsWith, endsWith, in | | `bucket_name` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `etag` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `string` | equals, contains, startsWith, endsWith, in | | `storage_class` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `uploaded` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Rulesets Path: `cloudflareapikey.db.rulesets.search` ```ts theme={null} const rows = await corsair.cloudflareapikey.db.rulesets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `zone_id` | `string` | equals, contains, startsWith, endsWith, in | | `account_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `kind` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated` | `date` | equals, before, after, between | | `phase` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Zones Path: `cloudflareapikey.db.zones.search` ```ts theme={null} const rows = await corsair.cloudflareapikey.db.zones.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `paused` | `boolean` | equals | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `created_on` | `date` | equals, before, after, between | | `modified_on` | `date` | equals, before, after, between | | `activated_on` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/cloudflareapikey/overview Cloudflare API token plugin for Corsair Use **Cloudflare API token** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 25 typed API operations * 6 synced entities (`dnsRecords`, `dnssec`, `lockdowns`, `r2Objects`, `rulesets`, `zones`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cloudflareapikey ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cloudflareapikey ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cloudflareapikey ``` ```bash bun theme={null} bun add corsair @corsair-dev/cloudflareapikey ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cloudflareapikey } from '@corsair-dev/cloudflareapikey'; export const corsair = createCorsair({ plugins: [ cloudflareapikey(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} cloudflareapikey() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cloudflareapikey', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`cache.getRegionalTieredCache`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloudflareapikey.api.cache.getRegionalTieredCache({}); ``` **`dns.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloudflareapikey.api.dns.create({}); ``` See the full list on the [API](/plugins/cloudflareapikey/api) page. ## Query synced data Synced entities support `tenant.cloudflareapikey.db..search()` and `.list()`: `dnsRecords`, `dnssec`, `lockdowns`, `r2Objects`, `rulesets`, `zones`. See [Database](/plugins/cloudflareapikey/database) for filters and operators. ## What's next > **[API reference](/plugins/cloudflareapikey/api)** > > Every `cloudflareapikey.api.*` operation with input and output types. > **[Database](/plugins/cloudflareapikey/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/cloudinary/api API reference for Cloudinary: every `cloudinary.api.*` operation with input and output types. Every `cloudinary.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Adaptive ### getAdaptiveStreamingProfiles `adaptive.getAdaptiveStreamingProfiles` List streaming profiles **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.adaptive.getAdaptiveStreamingProfiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Analysis ### getAnalysisTaskStatus `analysis.getAnalysisTaskStatus` Get analysis task status **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.analysis.getAnalysisTaskStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `task_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Asset ### createAssetRelationsByAssetId `asset.createAssetRelationsByAssetId` Add related assets by asset ID **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.asset.createAssetRelationsByAssetId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `asset_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAssetRelationsByPublicId `asset.createAssetRelationsByPublicId` Add related assets by public ID **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.asset.createAssetRelationsByPublicId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `string` | Yes | — | | `public_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteAssetRelationsByAssetId `asset.deleteAssetRelationsByAssetId` Remove related assets by asset ID **Risk:** `destructive` ```ts theme={null} await corsair.cloudinary.api.asset.deleteAssetRelationsByAssetId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `asset_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### deleteAssetRelationsByPublicId `asset.deleteAssetRelationsByPublicId` Remove related assets by public ID **Risk:** `destructive` ```ts theme={null} await corsair.cloudinary.api.asset.deleteAssetRelationsByPublicId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `string` | Yes | — | | `public_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### destroyAsset `asset.destroyAsset` Destroy asset by public ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.asset.destroyAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### destroyAssetById `asset.destroyAssetById` Destroy asset by asset ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.asset.destroyAssetById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### updateAssetMetadata `asset.updateAssetMetadata` Update asset metadata values **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.asset.updateAssetMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### uploadAsset `asset.uploadAsset` Upload media asset **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.asset.uploadAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Assets ### searchAssets `assets.searchAssets` Search assets with Lucene-like expressions **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.assets.searchAssets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ### searchVisualAssets `assets.searchVisualAssets` Visual search for similar assets **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.assets.searchVisualAssets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ## Chunk ### uploadChunk `chunk.uploadChunk` Upload a file chunk for large uploads (requires content\_range and x\_unique\_upload\_id) **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.chunk.uploadChunk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Cloudinary ### pingCloudinaryServers `cloudinary.pingCloudinaryServers` Ping Cloudinary servers **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.cloudinary.pingCloudinaryServers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ## Config ### getConfig `config.getConfig` Get product environment config **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.config.getConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Context ### manageContext `context.manageContext` Add or remove contextual metadata **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.context.manageContext({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Create ### createTrigger `create.createTrigger` Create webhook trigger **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.create.createTrigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `uri` | `string` | Yes | — | | `event_type` | `string` | Yes | — | | `additive` | `boolean` | No | — | | `auth_scheme` | `string` | No | — | *** ## Datasource ### searchDatasourceInMetadataField `datasource.searchDatasourceInMetadataField` Search datasource in metadata field **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.datasource.searchDatasourceInMetadataField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_id` | `string` | Yes | — | | `term` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Delete ### deleteTrigger `delete.deleteTrigger` Delete webhook trigger **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.delete.deleteTrigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `trigger_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ## Derived ### deleteDerivedResources `derived.deleteDerivedResources` Delete derived resources **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.derived.deleteDerivedResources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ## Entries ### deleteEntriesInMetadataFieldDatasource `entries.deleteEntriesInMetadataFieldDatasource` Delete datasource entries **Risk:** `destructive` ```ts theme={null} await corsair.cloudinary.api.entries.deleteEntriesInMetadataFieldDatasource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### restoreEntriesInMetadataFieldDatasource `entries.restoreEntriesInMetadataFieldDatasource` Restore datasource entries **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.entries.restoreEntriesInMetadataFieldDatasource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | — | | `label` | `string` | No | — | | `type` | `string` | No | — | | `mandatory` | `boolean` | No | — | | `default_value` | `any` | No | — | | `datasource` | `object` | No | — | > **datasource full type** > > ```ts theme={null} > { > values?: { > }[] > } > ``` *** ## File ### uploadFileAutoDetect `file.uploadFileAutoDetect` Upload with auto resource type detection **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.file.uploadFileAutoDetect({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Folder ### createFolder `folder.createFolder` Create a new asset folder **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.folder.createFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `folder` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `external_id` | `string` | No | — | *** ### deleteFolder `folder.deleteFolder` Delete an empty folder **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.folder.deleteFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `folder` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### showFolder `folder.showFolder` List subfolders in a folder **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.folder.showFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `folder` | `string` | Yes | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `folders` | `object[]` | No | — | > **folders full type** > > ```ts theme={null} > { > name: string, > path?: string, > external_id?: string > }[] > ``` *** ### updateFolder `folder.updateFolder` Rename or move a folder **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.folder.updateFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `folder` | `string` | Yes | — | | `to_folder` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `external_id` | `string` | No | — | *** ## Folders ### searchFolders `folders.searchFolders` Search asset folders **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.folders.searchFolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `expression` | `any` | No | — | | `sort_by` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `folders` | `object[]` | No | — | > **folders full type** > > ```ts theme={null} > { > name: string, > path?: string, > external_id?: string > }[] > ``` *** ### searchFoldersV2 `folders.searchFoldersV2` Search folders (v2 POST) **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.folders.searchFoldersV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `folders` | `object[]` | No | — | > **folders full type** > > ```ts theme={null} > { > name: string, > path?: string, > external_id?: string > }[] > ``` *** ## Generate ### generateArchive `generate.generateArchive` Generate ZIP/TGZ archive of assets **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.generate.generateArchive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Image ### createImageFromText `image.createImageFromText` Generate an image from text **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.image.createImageFromText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Images ### listImages `images.listImages` List image assets **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.images.listImages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `any` | No | — | | `prefix` | `any` | No | — | | `public_ids` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | | `start_at` | `any` | No | — | | `direction` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderation` | `any` | No | — | | `tags` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ## Live ### activateLiveStream `live.activateLiveStream` Manually activate a live stream **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.live.activateLiveStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `uri` | `string` | No | — | | `stream_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ### createLiveStream `live.createLiveStream` Create a new live stream **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.live.createLiveStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `uri` | `string` | No | — | | `stream_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ### createLiveStreamOutput `live.createLiveStreamOutput` Create a live stream output **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.live.createLiveStreamOutput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `uri` | `string` | No | — | | `stream_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ### deleteLiveStream `live.deleteLiveStream` Delete a live stream **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.live.deleteLiveStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### deleteLiveStreamOutput `live.deleteLiveStreamOutput` Delete a live stream output **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.live.deleteLiveStreamOutput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | | `liveStreamOutputId` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### getLiveStream `live.getLiveStream` Get live stream details **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.live.getLiveStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `uri` | `string` | No | — | | `stream_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ### getLiveStreamOutput `live.getLiveStreamOutput` Get live stream output details **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.live.getLiveStreamOutput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | | `liveStreamOutputId` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `uri` | `string` | No | — | | `stream_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ### getLiveStreamOutputs `live.getLiveStreamOutputs` List live stream outputs **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.live.getLiveStreamOutputs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > next_cursor?: string | null, > total_count?: number, > live_streams?: { > id: string, > name?: string, > status?: string, > uri?: string, > stream_key?: string, > created_at?: string > }[] > } | { > id: string, > name?: string, > status?: string, > uri?: string, > stream_key?: string, > created_at?: string > }[] > ``` *** ### getLiveStreams `live.getLiveStreams` List live streams **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.live.getLiveStreams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > next_cursor?: string | null, > total_count?: number, > live_streams?: { > id: string, > name?: string, > status?: string, > uri?: string, > stream_key?: string, > created_at?: string > }[] > } | { > id: string, > name?: string, > status?: string, > uri?: string, > stream_key?: string, > created_at?: string > }[] > ``` *** ### idleLiveStream `live.idleLiveStream` Put a live stream into idle state **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.live.idleLiveStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `uri` | `string` | No | — | | `stream_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ### updateLiveStream `live.updateLiveStream` Update live stream configuration **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.live.updateLiveStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `uri` | `string` | No | — | | `stream_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ### updateLiveStreamOutput `live.updateLiveStreamOutput` Update live stream output configuration **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.live.updateLiveStreamOutput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `liveStreamId` | `string` | Yes | — | | `liveStreamOutputId` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `uri` | `string` | No | — | | `stream_key` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Mapping ### createUploadMapping `mapping.createUploadMapping` Create upload mapping **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.mapping.createUploadMapping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `folder` | `string` | Yes | — | | `template` | `string` | No | — | *** ### deleteUploadMapping `mapping.deleteUploadMapping` Delete upload mapping **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.mapping.deleteUploadMapping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `folder` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### getUploadMappingDetails `mapping.getUploadMappingDetails` Get upload mapping details **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.mapping.getUploadMappingDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `folder` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `folder` | `string` | Yes | — | | `template` | `string` | No | — | *** ### updateUploadMapping `mapping.updateUploadMapping` Update upload mapping **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.mapping.updateUploadMapping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `folder` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `folder` | `string` | Yes | — | | `template` | `string` | No | — | *** ## Mappings ### getUploadMappings `mappings.getUploadMappings` List upload mappings **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.mappings.getUploadMappings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `mappings` | `object[]` | No | — | > **mappings full type** > > ```ts theme={null} > { > folder: string, > template?: string > }[] > ``` *** ## Metadata ### createMetadataField `metadata.createMetadataField` Create metadata field definition **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.metadata.createMetadataField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | — | | `label` | `string` | No | — | | `type` | `string` | No | — | | `mandatory` | `boolean` | No | — | | `default_value` | `any` | No | — | | `datasource` | `object` | No | — | > **datasource full type** > > ```ts theme={null} > { > values?: { > }[] > } > ``` *** ### createMetadataRule `metadata.createMetadataRule` Create metadata rule **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.metadata.createMetadataRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `condition` | `object` | No | — | | `result` | `object` | No | — | > **condition full type** > > ```ts theme={null} > { > } > ``` > **result full type** > > ```ts theme={null} > { > } > ``` *** ### deleteMetadataField `metadata.deleteMetadataField` Delete metadata field **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.metadata.deleteMetadataField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### deleteMetadataRule `metadata.deleteMetadataRule` Delete metadata rule **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.metadata.deleteMetadataRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `metadata_rule_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### getMetadataFieldById `metadata.getMetadataFieldById` Get metadata field by external ID **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.metadata.getMetadataFieldById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | — | | `label` | `string` | No | — | | `type` | `string` | No | — | | `mandatory` | `boolean` | No | — | | `default_value` | `any` | No | — | | `datasource` | `object` | No | — | > **datasource full type** > > ```ts theme={null} > { > values?: { > }[] > } > ``` *** ### listMetadataFields `metadata.listMetadataFields` List metadata fields **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.metadata.listMetadataFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_ids` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata_fields` | `object[]` | No | — | > **metadata\_fields full type** > > ```ts theme={null} > { > external_id: string, > label?: string, > type?: string, > mandatory?: boolean, > default_value?: any, > datasource?: { > values?: { > }[] > } > }[] > ``` *** ### listMetadataRules `metadata.listMetadataRules` List metadata rules **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.metadata.listMetadataRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > id: string, > name?: string, > condition?: { > }, > result?: { > } > }[] > ``` *** ### orderMetadataFieldDatasource `metadata.orderMetadataFieldDatasource` Order metadata field datasource **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.metadata.orderMetadataFieldDatasource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | — | | `label` | `string` | No | — | | `type` | `string` | No | — | | `mandatory` | `boolean` | No | — | | `default_value` | `any` | No | — | | `datasource` | `object` | No | — | > **datasource full type** > > ```ts theme={null} > { > values?: { > }[] > } > ``` *** ### reorderMetadataField `metadata.reorderMetadataField` Reorder a metadata field **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.metadata.reorderMetadataField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | — | | `label` | `string` | No | — | | `type` | `string` | No | — | | `mandatory` | `boolean` | No | — | | `default_value` | `any` | No | — | | `datasource` | `object` | No | — | > **datasource full type** > > ```ts theme={null} > { > values?: { > }[] > } > ``` *** ### reorderMetadataFields `metadata.reorderMetadataFields` Reorder all metadata fields **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.metadata.reorderMetadataFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | — | | `label` | `string` | No | — | | `type` | `string` | No | — | | `mandatory` | `boolean` | No | — | | `default_value` | `any` | No | — | | `datasource` | `object` | No | — | > **datasource full type** > > ```ts theme={null} > { > values?: { > }[] > } > ``` *** ### searchMetadataFieldDatasource `metadata.searchMetadataFieldDatasource` Search all metadata datasources **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.metadata.searchMetadataFieldDatasource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `term` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateMetadataField `metadata.updateMetadataField` Update metadata field definition **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.metadata.updateMetadataField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | — | | `label` | `string` | No | — | | `type` | `string` | No | — | | `mandatory` | `boolean` | No | — | | `default_value` | `any` | No | — | | `datasource` | `object` | No | — | > **datasource full type** > > ```ts theme={null} > { > values?: { > }[] > } > ``` *** ### updateMetadataFieldDatasource `metadata.updateMetadataFieldDatasource` Update metadata field datasource **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.metadata.updateMetadataFieldDatasource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | — | | `label` | `string` | No | — | | `type` | `string` | No | — | | `mandatory` | `boolean` | No | — | | `default_value` | `any` | No | — | | `datasource` | `object` | No | — | > **datasource full type** > > ```ts theme={null} > { > values?: { > }[] > } > ``` *** ### updateMetadataRule `metadata.updateMetadataRule` Update metadata rule **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.metadata.updateMetadataRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `metadata_rule_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `condition` | `object` | No | — | | `result` | `object` | No | — | > **condition full type** > > ```ts theme={null} > { > } > ``` > **result full type** > > ```ts theme={null} > { > } > ``` *** ## Multi ### createMultiResource `multi.createMultiResource` Create animation from multiple images **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.multi.createMultiResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Preset ### createUploadPreset `preset.createUploadPreset` Create upload preset **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.preset.createUploadPreset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `unsigned` | `boolean` | No | — | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > } > ``` *** ### deleteUploadPreset `preset.deleteUploadPreset` Delete upload preset **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.preset.deleteUploadPreset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `name` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### getUploadPreset `preset.getUploadPreset` Get upload preset **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.preset.getUploadPreset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `name` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `unsigned` | `boolean` | No | — | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > } > ``` *** ### updateUploadPreset `preset.updateUploadPreset` Update upload preset **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.preset.updateUploadPreset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `name` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `unsigned` | `boolean` | No | — | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > } > ``` *** ## Presets ### listUploadPresets `presets.listUploadPresets` List upload presets **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.presets.listUploadPresets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `presets` | `object[]` | No | — | > **presets full type** > > ```ts theme={null} > { > name: string, > unsigned?: boolean, > settings?: { > } > }[] > ``` *** ## Raw ### listRawFiles `raw.listRawFiles` List raw assets **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.raw.listRawFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `any` | No | — | | `prefix` | `any` | No | — | | `public_ids` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | | `start_at` | `any` | No | — | | `direction` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderation` | `any` | No | — | | `tags` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ## Resource ### explicitResource `resource.explicitResource` Explicitly update or generate derived assets **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.resource.explicitResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### explodeResource `resource.explodeResource` Explode multi-page resource into separate images **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.resource.explodeResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### getResourceByAssetId `resource.getResourceByAssetId` Get resource by asset ID **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resource.getResourceByAssetId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `asset_id` | `string` | Yes | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderations` | `any` | No | — | | `quality_analysis` | `any` | No | — | | `accessibility_analysis` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### getResourceByPublicId `resource.getResourceByPublicId` Get resource by public ID **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resource.getResourceByPublicId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderations` | `any` | No | — | | `quality_analysis` | `any` | No | — | | `accessibility_analysis` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### listResourceTypes `resource.listResourceTypes` List available resource types **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resource.listResourceTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `resource_types` | `string[]` | Yes | — | *** ### renameResource `resource.renameResource` Rename or move resource public ID **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.resource.renameResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### updateResourceByAssetId `resource.updateResourceByAssetId` Update resource by asset ID **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.resource.updateResourceByAssetId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `asset_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### updateResourceByPublicId `resource.updateResourceByPublicId` Update resource by public ID **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.resource.updateResourceByPublicId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `string` | Yes | — | | `public_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### updateResourceTags `resource.updateResourceTags` Add, remove, or replace resource tags **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.resource.updateResourceTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Resources ### deleteResourcesByAssetId `resources.deleteResourcesByAssetId` Delete resources by asset IDs **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.resources.deleteResourcesByAssetId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### deleteResourcesByPublicId `resources.deleteResourcesByPublicId` Delete resources by public ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.resources.deleteResourcesByPublicId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### deleteResourcesByTags `resources.deleteResourcesByTags` Delete resources by tag **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.resources.deleteResourcesByTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `tag` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### getResourcesByAssetFolder `resources.getResourcesByAssetFolder` List assets in a folder **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resources.getResourcesByAssetFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `asset_folder` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | | `tags` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderations` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ### getResourcesByContext `resources.getResourcesByContext` Get resources by context metadata **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resources.getResourcesByContext({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `key` | `any` | No | — | | `value` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `tags` | `any` | No | — | | `moderations` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ### getResourcesInModeration `resources.getResourcesInModeration` Get resources in moderation queue **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resources.getResourcesInModeration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `moderation_kind` | `string` | Yes | — | | `status` | `string` | Yes | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `tags` | `any` | No | — | | `moderations` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ### listResourcesByAssetIds `resources.listResourcesByAssetIds` List resources by asset IDs **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resources.listResourcesByAssetIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `asset_ids` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderations` | `any` | No | — | | `tags` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ### listResourcesByExternalIds `resources.listResourcesByExternalIds` List resources by external IDs **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resources.listResourcesByExternalIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `external_ids` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderations` | `any` | No | — | | `tags` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ### listResourcesByTag `resources.listResourcesByTag` List resources by tag **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resources.listResourcesByTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `tag` | `string` | Yes | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderations` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ### listResourcesByType `resources.listResourcesByType` List resources by type **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.resources.listResourcesByType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `string` | Yes | — | | `prefix` | `any` | No | — | | `public_ids` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | | `start_at` | `any` | No | — | | `direction` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderation` | `any` | No | — | | `tags` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** ### publishResources `resources.publishResources` Publish resources to public access **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.resources.publishResources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### restoreResources `resources.restoreResources` Restore deleted resources by public ID **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.resources.restoreResources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### restoreResourcesByAssetIds `resources.restoreResourcesByAssetIds` Restore resources by asset IDs **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.resources.restoreResourcesByAssetIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Root ### getRootFolders `root.getRootFolders` List root folders **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.root.getRootFolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `folders` | `object[]` | No | — | > **folders full type** > > ```ts theme={null} > { > name: string, > path?: string, > external_id?: string > }[] > ``` *** ## Slideshow ### createSlideshow `slideshow.createSlideshow` Create video slideshow from assets **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.slideshow.createSlideshow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `public_id` | `string` | Yes | — | | `resource_type` | `image \| video \| raw` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `created_at` | `string` | No | — | | `tags` | `string[]` | No | — | | `context` | `object` | No | — | | `metadata` | `object` | No | — | | `asset_folder` | `string` | No | — | | `display_name` | `string` | No | — | | `status` | `string` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Sprite ### generateSprite `sprite.generateSprite` Generate sprite from images (deprecated) **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.sprite.generateSprite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Streaming ### createStreamingProfile `streaming.createStreamingProfile` Create adaptive streaming profile **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.streaming.createStreamingProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteStreamingProfile `streaming.deleteStreamingProfile` Delete streaming profile **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.streaming.deleteStreamingProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `name` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### getStreamingProfileDetails `streaming.getStreamingProfileDetails` Get streaming profile details **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.streaming.getStreamingProfileDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `name` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateStreamingProfile `streaming.updateStreamingProfile` Update streaming profile **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.streaming.updateStreamingProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `name` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Tags ### getTags `tags.getTags` List tags for a resource type **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.tags.getTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `string` | Yes | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `prefix` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `object[]` | No | — | > **tags full type** > > ```ts theme={null} > ( > string | { > tag: string > } > )[] > ``` *** ## Transformation ### createTransformation `transformation.createTransformation` Create named transformation **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.transformation.createTransformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `name` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `transformation` | `string` | No | — | | `allowed_for_strict` | `boolean` | No | — | | `used` | `boolean` | No | — | *** ### getTransformation `transformation.getTransformation` Get transformation details **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.transformation.getTransformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `transformation` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `transformation` | `string` | No | — | | `allowed_for_strict` | `boolean` | No | — | | `used` | `boolean` | No | — | *** ## Transformation2 ### deleteTransformation2 `transformation2.deleteTransformation2` Delete named transformation **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.cloudinary.api.transformation2.deleteTransformation2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `transformation` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | No | — | *** ### updateTransformation2 `transformation2.updateTransformation2` Update named transformation **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.transformation2.updateTransformation2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `transformation` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `transformation` | `string` | No | — | | `allowed_for_strict` | `boolean` | No | — | | `used` | `boolean` | No | — | *** ## Transformations ### getTransformations `transformations.getTransformations` List transformations **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.transformations.getTransformations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `named` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `transformations` | `object[]` | No | — | > **transformations full type** > > ```ts theme={null} > { > name?: string, > transformation?: string, > allowed_for_strict?: boolean, > used?: boolean > }[] > ``` *** ## Triggers ### getTriggers `triggers.getTriggers` List webhook triggers **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.triggers.getTriggers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `event_type` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `triggers` | `object[]` | No | — | > **triggers full type** > > ```ts theme={null} > { > id: string, > uri: string, > event_type: string, > additive?: boolean, > auth_scheme?: string > }[] > ``` *** ## Update ### updateTrigger `update.updateTrigger` Update webhook trigger **Risk:** `write` ```ts theme={null} await corsair.cloudinary.api.update.updateTrigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `trigger_id` | `string` | Yes | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `uri` | `string` | Yes | — | | `event_type` | `string` | Yes | — | | `additive` | `boolean` | No | — | | `auth_scheme` | `string` | No | — | *** ## Usage ### getUsage `usage.getUsage` Get account usage details **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.usage.getUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `date` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `plan` | `string` | No | — | | `last_updated` | `string` | No | — | | `credits` | `object` | No | — | | `storage` | `object` | No | — | | `bandwidth` | `object` | No | — | | `resources` | `number` | No | — | | `derived_resources` | `number` | No | — | > **credits full type** > > ```ts theme={null} > { > } > ``` > **storage full type** > > ```ts theme={null} > { > } > ``` > **bandwidth full type** > > ```ts theme={null} > { > } > ``` *** ## Video ### getVideoViews `video.getVideoViews` Get video analytics views **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.video.getVideoViews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `public_ids` | `any` | No | — | | `start_date` | `any` | No | — | | `end_date` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Videos ### listVideos `videos.listVideos` List video assets **Risk:** `read` ```ts theme={null} await corsair.cloudinary.api.videos.listVideos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `any` | No | — | | `file` | `custom` | No | — | | `resource_type` | `image \| video \| raw \| auto` | No | — | | `upload_resource_type` | `image \| video \| raw \| auto` | No | — | | `type` | `any` | No | — | | `prefix` | `any` | No | — | | `public_ids` | `any` | No | — | | `max_results` | `any` | No | — | | `next_cursor` | `any` | No | — | | `start_at` | `any` | No | — | | `direction` | `any` | No | — | | `context` | `any` | No | — | | `metadata` | `any` | No | — | | `moderation` | `any` | No | — | | `tags` | `any` | No | — | | `fields` | `any` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | > **resources full type** > > ```ts theme={null} > { > asset_id: string, > public_id: string, > resource_type?: image | video | raw, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > created_at?: string, > tags?: string[], > context?: { > }, > metadata?: { > }, > asset_folder?: string, > display_name?: string, > status?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/cloudinary/database Cloudinary local sync: searchable entities, `.search()` filters, and operators. The Cloudinary plugin syncs data locally. Use `corsair.cloudinary.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Folders Path: `cloudinary.db.folders.search` ```ts theme={null} const rows = await corsair.cloudinary.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `external_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Live Streams Path: `cloudinary.db.liveStreams.search` ```ts theme={null} const rows = await corsair.cloudinary.db.liveStreams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `stream_key` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Metadata Fields Path: `cloudinary.db.metadataFields.search` ```ts theme={null} const rows = await corsair.cloudinary.db.metadataFields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `external_id` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `mandatory` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Metadata Rules Path: `cloudinary.db.metadataRules.search` ```ts theme={null} const rows = await corsair.cloudinary.db.metadataRules.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Resources Path: `cloudinary.db.resources.search` ```ts theme={null} const rows = await corsair.cloudinary.db.resources.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `asset_id` | `string` | equals, contains, startsWith, endsWith, in | | `public_id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `format` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `secure_url` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `number` | equals, gt, gte, lt, lte, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `bytes` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `asset_folder` | `string` | equals, contains, startsWith, endsWith, in | | `display_name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transformations Path: `cloudinary.db.transformations.search` ```ts theme={null} const rows = await corsair.cloudinary.db.transformations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `transformation` | `string` | equals, contains, startsWith, endsWith, in | | `allowed_for_strict` | `boolean` | equals | | `used` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Triggers Path: `cloudinary.db.triggers.search` ```ts theme={null} const rows = await corsair.cloudinary.db.triggers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `event_type` | `string` | equals, contains, startsWith, endsWith, in | | `additive` | `boolean` | equals | | `auth_scheme` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Upload Mappings Path: `cloudinary.db.uploadMappings.search` ```ts theme={null} const rows = await corsair.cloudinary.db.uploadMappings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `folder` | `string` | equals, contains, startsWith, endsWith, in | | `template` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Upload Presets Path: `cloudinary.db.uploadPresets.search` ```ts theme={null} const rows = await corsair.cloudinary.db.uploadPresets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `unsigned` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Usage Path: `cloudinary.db.usage.search` ```ts theme={null} const rows = await corsair.cloudinary.db.usage.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `plan` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated` | `string` | equals, contains, startsWith, endsWith, in | | `resources` | `number` | equals, gt, gte, lt, lte, in | | `derived_resources` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/cloudinary/overview Media management API for uploading, transforming, optimizing, and delivering images and video. Use **Cloudinary** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 110 typed API operations * 10 synced entities (`folders`, `liveStreams`, `metadataFields`, `metadataRules`, `resources`, `transformations`, and 4 more) for fast `.search()` / `.list()` * 13 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cloudinary ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cloudinary ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cloudinary ``` ```bash bun theme={null} bun add corsair @corsair-dev/cloudinary ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cloudinary } from '@corsair-dev/cloudinary'; export const corsair = createCorsair({ plugins: [ cloudinary(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** Auth methods depend on how you configure `cloudinary({ ... })` — check the plugin source `*PluginOptions` type. **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cloudinary', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`adaptive.getAdaptiveStreamingProfiles`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloudinary.api.adaptive.getAdaptiveStreamingProfiles({}); ``` **`asset.createAssetRelationsByAssetId`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cloudinary.api.asset.createAssetRelationsByAssetId({}); ``` See the full list on the [API](/plugins/cloudinary/api) page. ## Query synced data Synced entities support `tenant.cloudinary.db..search()` and `.list()`: `folders`, `liveStreams`, `metadataFields`, `metadataRules`, `resources`, `transformations`, `triggers`, `uploadMappings`, `uploadPresets`, `usage`. See [Database](/plugins/cloudinary/database) for filters and operators. ## Webhooks This plugin registers **13** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/cloudinary/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/cloudinary/api)** > > Every `cloudinary.api.*` operation with input and output types. > **[Database](/plugins/cloudinary/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/cloudinary/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/cloudinary/webhooks Cloudinary incoming webhooks: event paths, payloads, and response data. The Cloudinary plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/cloudinary/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `delete` * `delete` (`delete.delete`) * `eager` * `eager` (`eager.eager`) * `folder` * `createFolder` (`folder.createFolder`) * `deleteFolder` (`folder.deleteFolder`) * `move` (`folder.move`) * `other` * `accessControlChanged` (`other.accessControlChanged`) * `explode` (`other.explode`) * `relatedAssets` (`other.relatedAssets`) * `rename` * `rename` (`rename.rename`) * `resource` * `resourceContextChanged` (`resource.resourceContextChanged`) * `resourceMetadataChanged` (`resource.resourceMetadataChanged`) * `resourceTagsChanged` (`resource.resourceTagsChanged`) * `upload` * `upload` (`upload.upload`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Delete ### Delete `delete.delete` Notification when an asset is deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `delete` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `asset_id` | `string` | No | — | | `public_id` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > notification_type: delete, > request_id?: string, > signature_key?: string, > asset_id?: string, > public_id?: string > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { delete: { delete: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Eager ### Eager `eager.eager` Notification when eager transformations complete **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `eager` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `eager` | `object[]` | No | — | | `batch_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `public_id` | `string` | No | — | > **eager full type** > > ```ts theme={null} > { > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > notification_type: eager, > request_id?: string, > signature_key?: string, > eager?: { > }[], > batch_id?: string, > asset_id?: string, > public_id?: string > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { eager: { eager: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Folder ### Create Folder `folder.createFolder` Notification when a folder is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `create_folder` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `folder` | `object` | No | — | > **folder full type** > > ```ts theme={null} > { > path?: string, > name?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > notification_type: create_folder, > request_id?: string, > signature_key?: string, > folder?: { > path?: string, > name?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { folder: { createFolder: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Delete Folder `folder.deleteFolder` Notification when a folder is deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `delete_folder` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `folder` | `object` | No | — | > **folder full type** > > ```ts theme={null} > { > path?: string, > name?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > notification_type: delete_folder, > request_id?: string, > signature_key?: string, > folder?: { > path?: string, > name?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { folder: { deleteFolder: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Move `folder.move` Notification when an asset is moved between folders **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `move` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `public_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > notification_type: move, > request_id?: string, > signature_key?: string, > public_id?: string, > asset_id?: string, > asset_folder?: string > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { folder: { move: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Other ### Access Control Changed `other.accessControlChanged` Notification when asset access control changes **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `access_control_changed` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `public_id` | `string` | No | — | | `asset_id` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > notification_type: access_control_changed, > request_id?: string, > signature_key?: string, > public_id?: string, > asset_id?: string > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { other: { accessControlChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Explode `other.explode` Notification when explode processing completes **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `explode` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `public_id` | `string` | No | — | | `asset_id` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > notification_type: explode, > request_id?: string, > signature_key?: string, > public_id?: string, > asset_id?: string > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { other: { explode: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Related Assets `other.relatedAssets` Notification when related assets change **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `related_assets` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `asset_id` | `string` | No | — | | `public_id` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > notification_type: related_assets, > request_id?: string, > signature_key?: string, > asset_id?: string, > public_id?: string > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { other: { relatedAssets: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Rename ### Rename `rename.rename` Notification when an asset is renamed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `rename` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `from_public_id` | `string` | No | — | | `to_public_id` | `string` | No | — | | `asset_id` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > notification_type: rename, > request_id?: string, > signature_key?: string, > from_public_id?: string, > to_public_id?: string, > asset_id?: string > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { rename: { rename: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Resource ### Resource Context Changed `resource.resourceContextChanged` Notification when resource context metadata changes **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `resource_context_changed` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `public_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `context` | `object` | No | — | > **context full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > notification_type: resource_context_changed, > request_id?: string, > signature_key?: string, > public_id?: string, > asset_id?: string, > context?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { resource: { resourceContextChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Resource Metadata Changed `resource.resourceMetadataChanged` Notification when structured metadata changes **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `resource_metadata_changed` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `public_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > notification_type: resource_metadata_changed, > request_id?: string, > signature_key?: string, > public_id?: string, > asset_id?: string, > metadata?: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { resource: { resourceMetadataChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Resource Tags Changed `resource.resourceTagsChanged` Notification when resource tags change **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `resource_tags_changed` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `public_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `tags` | `string[]` | No | — | > **Response data full type** > > ```ts theme={null} > { > notification_type: resource_tags_changed, > request_id?: string, > signature_key?: string, > public_id?: string, > asset_id?: string, > tags?: string[] > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { resource: { resourceTagsChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Upload ### Upload `upload.upload` Notification when an upload completes **Payload** | Name | Type | Required | Description | | - | - | - | - | | `notification_type` | `upload` | Yes | — | | `request_id` | `string` | No | — | | `signature_key` | `string` | No | — | | `asset_id` | `string` | No | — | | `public_id` | `string` | Yes | — | | `resource_type` | `string` | No | — | | `type` | `string` | No | — | | `format` | `string` | No | — | | `version` | `number` | No | — | | `url` | `string` | No | — | | `secure_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `bytes` | `number` | No | — | | `tags` | `string[]` | No | — | > **Response data full type** > > ```ts theme={null} > { > notification_type: upload, > request_id?: string, > signature_key?: string, > asset_id?: string, > public_id: string, > resource_type?: string, > type?: string, > format?: string, > version?: number, > url?: string, > secure_url?: string, > width?: number, > height?: number, > bytes?: number, > tags?: string[] > } > ``` **`webhookHooks` example** ```ts theme={null} cloudinary({ webhookHooks: { upload: { upload: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/coda/api API reference for Coda: every `coda.api.*` operation with input and output types. Every `coda.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getMutationStatus `account.getMutationStatus` Check whether an asynchronous mutation has been applied **Risk:** `read` ```ts theme={null} await corsair.coda.api.account.getMutationStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | ID of the request. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `completed` | `boolean` | Yes | — | | `warning` | `string` | No | — | *** ### resolveBrowserLink `account.resolveBrowserLink` Resolve a Coda browser URL to the API object it points at **Risk:** `read` ```ts theme={null} await corsair.coda.api.account.resolveBrowserLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The browser link to try to resolve. | | `degradeGracefully` | `boolean` | No | By default, attempting to resolve the Coda URL of a deleted object will result in an error. If this flag is set, the next-available object, all the way up to the doc itself, will be resolved. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `apiLink` | Yes | — | | `href` | `string` | Yes | — | | `browserLink` | `string` | No | — | | `resource` | `object` | Yes | — | > **resource full type** > > ```ts theme={null} > { > type: aclMetadata | aclPermissions | aclSettings | agentPackLog | agentRun | analyticsLastUpdated | apiLink | automation | column | control | doc | customDocDomain | customDocDomainProvider | docAnalytics | docAnalyticsSummary | docAnalyticsV2 | folder | formula | goLink | ingestionBatchExecution | ingestionExecution | ingestionExecutionAttempt | ingestionPackLog | ingestionParentItem | mutationStatus | pack | packAclPermissions | packAnalytics | packAnalyticsSummary | packAsset | packCategory | packConfigurationSchema | packFeaturedDocs | packFormulaAnalytics | packInvitation | packListingDraft | packLog | packMaker | packOauthConfig | packRelease | packReview | packSourceCode | packSystemConnection | packVersion | page | pageContentExport | pageContentExportStatus | principal | row | table | user | workspace, > id: string, > name?: string, > href: string > } > ``` *** ### whoami `account.whoami` Get info about the user that owns the API token **Risk:** `read` ```ts theme={null} await corsair.coda.api.account.whoami({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `loginId` | `string` | Yes | — | | `type` | `user` | Yes | — | | `pictureLink` | `string` | No | — | | `scoped` | `boolean` | Yes | — | | `tokenName` | `string` | Yes | — | | `href` | `string` | Yes | — | | `workspace` | `object` | Yes | — | > **workspace full type** > > ```ts theme={null} > { > id: string, > type: workspace, > organizationId?: string, > browserLink: string, > name?: string > } > ``` *** ## Analytics ### getDocsSummary `analytics.getDocsSummary` Get a summary of doc analytics **Risk:** `read` ```ts theme={null} await corsair.coda.api.analytics.getDocsSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `isPublished` | `boolean` | No | Limit results to only published items. | | `sinceDate` | `string` | No | Limit results to activity on or after this date. | | `untilDate` | `string` | No | Limit results to activity on or before this date. | | `workspaceId` | `string` | No | ID of the workspace. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSessions` | `number` | Yes | — | *** ### getLastUpdated `analytics.getLastUpdated` Get the days analytics were last updated **Risk:** `read` ```ts theme={null} await corsair.coda.api.analytics.getLastUpdated({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `docAnalyticsLastUpdated` | `string` | Yes | — | | `packAnalyticsLastUpdated` | `string` | Yes | — | | `packFormulaAnalyticsLastUpdated` | `string` | Yes | — | *** ### getPacksSummary `analytics.getPacksSummary` Get a summary of Pack analytics **Risk:** `read` ```ts theme={null} await corsair.coda.api.analytics.getPacksSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packIds` | `number[]` | No | Which Pack IDs to fetch. | | `workspaceId` | `string` | No | ID of the workspace. | | `isPublished` | `boolean` | No | Limit results to only published items. If false or unspecified, returns all items including published ones. | | `sinceDate` | `string` | No | Limit results to activity on or after this date. | | `untilDate` | `string` | No | Limit results to activity on or before this date. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalDocInstalls` | `number` | Yes | — | | `totalWorkspaceInstalls` | `number` | Yes | — | | `totalInvocations` | `number` | Yes | — | *** ### listDocs `analytics.listDocs` List analytics for docs **Risk:** `read` ```ts theme={null} await corsair.coda.api.analytics.listDocs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docIds` | `string[]` | No | List of docIds to fetch. | | `workspaceId` | `string` | No | ID of the workspace. | | `query` | `string` | No | Search term used to filter down results. | | `isPublished` | `boolean` | No | Limit results to only published items. | | `sinceDate` | `string` | No | Limit results to activity on or after this date. | | `untilDate` | `string` | No | Limit results to activity on or before this date. | | `scale` | `daily \| cumulative` | No | Quantization period over which to view analytics. Defaults to daily. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `orderBy` | `date \| docId \| title \| createdAt \| publishedAt \| likes \| copies \| views \| sessionsDesktop \| sessionsMobile \| sessionsOther \| totalSessions \| aiCreditsChat \| aiCreditsBlock \| aiCreditsColumn \| aiCreditsAssistant \| aiCreditsReviewer \| aiCredits` | No | Use this parameter to order the doc analytics returned. | | `direction` | `ascending \| descending` | No | Direction to sort results in. | | `limit` | `number` | No | Maximum number of results to return in this query. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > doc: { > id: string, > type: doc, > href: string, > browserLink: string, > title: string, > icon?: { > name: string, > type: string, > browserLink: string > }, > createdAt: string, > publishedAt?: string > }, > metrics: { > date: string, > views: number, > copies: number, > likes: number, > sessionsMobile: number, > sessionsDesktop: number, > sessionsOther: number, > totalSessions: number, > aiCreditsChat?: number, > aiCreditsBlock?: number, > aiCreditsColumn?: number, > aiCreditsAssistant?: number, > aiCreditsReviewer?: number, > aiCredits?: number > }[] > }[] > ``` *** ### listPackFormulas `analytics.listPackFormulas` List analytics for the formulas of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.analytics.listPackFormulas({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `packFormulaNames` | `string[]` | No | A list of Pack formula names (case-sensitive) for which to retrieve analytics. | | `packFormulaTypes` | `action \| formula \| sync \| metadata[]` | No | A list of Pack formula types corresponding to the `packFormulaNames`. If specified, this must have the same length as `packFormulaNames`. | | `sinceDate` | `string` | No | Limit results to activity on or after this date. | | `untilDate` | `string` | No | Limit results to activity on or before this date. | | `scale` | `daily \| cumulative` | No | Quantization period over which to view analytics. Defaults to daily. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `orderBy` | `date \| formulaName \| formulaType \| formulaInvocations \| medianLatencyMs \| medianResponseSizeBytes \| errors \| docsActivelyUsing \| docsActivelyUsing7Day \| docsActivelyUsing30Day \| docsActivelyUsing90Day \| docsActivelyUsingAllTime \| workspacesActivelyUsing \| workspacesActivelyUsing7Day \| workspacesActivelyUsing30Day \| workspacesActivelyUsing90Day \| workspacesActivelyUsingAllTime` | No | Use this parameter to order the Pack formula analytics returned. | | `direction` | `ascending \| descending` | No | Direction to sort results in. | | `limit` | `number` | No | Maximum number of results to return in this query. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > formula: { > name: string, > type: action | formula | sync | metadata > }, > metrics: { > date: string, > formulaInvocations: number, > errors: number, > medianLatencyMs?: number, > medianResponseSizeBytes?: number, > docsActivelyUsing: number, > docsActivelyUsing7Day: number, > docsActivelyUsing30Day: number, > docsActivelyUsing90Day: number, > docsActivelyUsingAllTime: number, > workspacesActivelyUsing: number, > workspacesActivelyUsing7Day: number, > workspacesActivelyUsing30Day: number, > workspacesActivelyUsing90Day: number, > workspacesActivelyUsingAllTime: number, > workspacesActivelyTrialing?: number, > workspacesActivelyTrialing7Day?: number, > workspacesActivelyTrialing30Day?: number, > workspacesActivelyTrialing90Day?: number, > workspacesActivelyTrialingAllTime?: number, > workspacesNewlySubscribed?: number, > workspacesWithActiveSubscriptions?: number, > workspacesWithSuccessfulTrials?: number, > revenueUsd?: string > }[] > }[] > ``` *** ### listPacks `analytics.listPacks` List analytics for Packs the user can edit **Risk:** `read` ```ts theme={null} await corsair.coda.api.analytics.listPacks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packIds` | `number[]` | No | Which Pack IDs to fetch. | | `workspaceId` | `string` | No | ID of the workspace. | | `query` | `string` | No | Search term used to filter down results. | | `sinceDate` | `string` | No | Limit results to activity on or after this date. | | `untilDate` | `string` | No | Limit results to activity on or before this date. | | `scale` | `daily \| cumulative` | No | Quantization period over which to view analytics. Defaults to daily. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `orderBy` | `date \| packId \| name \| createdAt \| docInstalls \| workspaceInstalls \| numFormulaInvocations \| numActionInvocations \| numSyncInvocations \| numMetadataInvocations \| docsActivelyUsing \| docsActivelyUsing7Day \| docsActivelyUsing30Day \| docsActivelyUsing90Day \| docsActivelyUsingAllTime \| workspacesActivelyUsing \| workspacesActivelyUsing7Day \| workspacesActivelyUsing30Day \| workspacesActivelyUsing90Day \| workspacesActivelyUsingAllTime \| workspacesWithActiveSubscriptions \| workspacesWithSuccessfulTrials \| revenueUsd` | No | Use this parameter to order the Pack analytics returned. | | `direction` | `ascending \| descending` | No | Direction to sort results in. | | `isPublished` | `boolean` | No | Limit results to only published items. If false or unspecified, returns all items including published ones. | | `limit` | `number` | No | Maximum number of results to return in this query. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > pack: { > id: number, > name: string, > logoUrl?: string, > createdAt: string > }, > metrics: { > date: string, > docInstalls: number, > workspaceInstalls: number, > numFormulaInvocations: number, > numActionInvocations: number, > numSyncInvocations: number, > numMetadataInvocations: number, > docsActivelyUsing: number, > docsActivelyUsing7Day: number, > docsActivelyUsing30Day: number, > docsActivelyUsing90Day: number, > docsActivelyUsingAllTime: number, > workspacesActivelyUsing: number, > workspacesActivelyUsing7Day: number, > workspacesActivelyUsing30Day: number, > workspacesActivelyUsing90Day: number, > workspacesActivelyUsingAllTime: number, > workspacesActivelyTrialing: number, > workspacesActivelyTrialing7Day: number, > workspacesActivelyTrialing30Day: number, > workspacesActivelyTrialing90Day: number, > workspacesActivelyTrialingAllTime: number, > workspacesNewlySubscribed: number, > workspacesWithActiveSubscriptions: number, > workspacesWithSuccessfulTrials: number, > revenueUsd: string > }[] > }[] > ``` *** ### listPages `analytics.listPages` List page-level analytics for a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.analytics.listPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `sinceDate` | `string` | No | Limit results to activity on or after this date. | | `untilDate` | `string` | No | Limit results to activity on or before this date. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `limit` | `number` | No | Maximum number of results to return in this query. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > page: { > id: string, > name: string, > icon?: { > name: string, > type: string, > browserLink: string > } > }, > metrics: { > date: string, > views: number, > sessions: number, > users: number, > averageSecondsViewed: number, > medianSecondsViewed: number, > tabs: number > }[] > }[] > ``` *** ## Automations ### trigger `automations.trigger` Trigger a webhook-invoked automation in a doc **Risk:** `write` ```ts theme={null} await corsair.coda.api.automations.trigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `ruleId` | `string` | Yes | ID of the automation rule. | | `payload` | `object` | No | JSON payload passed to the automation. | > **payload full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | *** ## Categories ### list `categories.list` List the categories available for docs **Risk:** `read` ```ts theme={null} await corsair.coda.api.categories.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > name: string > }[] > ``` *** ## Columns ### get `columns.get` Get details about a column **Risk:** `read` ```ts theme={null} await corsair.coda.api.columns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `columnIdOrName` | `string` | Yes | ID or name of the column. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `column` | Yes | — | | `href` | `string` | Yes | — | | `name` | `string` | Yes | — | | `display` | `boolean` | No | — | | `calculated` | `boolean` | No | — | | `formula` | `string` | No | — | | `defaultValue` | `string` | No | — | | `format` | `object` | Yes | — | | `parent` | `object` | Yes | — | > **format full type** > > ```ts theme={null} > { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > label?: string, > disableIf?: string, > action?: string > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > displayType: toggle | check > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > format?: string > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > dateFormat?: string, > timeFormat?: string > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > precision?: number, > maxUnit?: days | hours | minutes | seconds > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > display?: iconAndEmail | iconOnly | emailOnly, > autocomplete?: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > display?: iconOnly | url | title | card | embed, > force?: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > currencyCode?: string, > precision?: number, > format?: currency | accounting | financial > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > width: number | string, > height: number | string, > style: auto | circle > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > precision?: number, > useThousandsSeparator?: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > table: { > id: string, > type: table, > tableType: table | view | database, > href: string, > browserLink: string, > name: string, > parent?: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > } > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > options?: { > name: string, > backgroundColor?: string, > foregroundColor?: string > }[] > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > maximum: number, > icon: star | circle | fire | bug | diamond | bell | thumbsup | heart | chili | smiley | lightning | currency | coffee | person | battery | cocktail | cloud | sun | checkmark | lightbulb > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > minimum?: number | string, > maximum?: number | string, > step?: number | string, > displayType?: slider | progress, > showValue?: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > format?: string > } > ``` > **parent full type** > > ```ts theme={null} > { > id: string, > type: table, > tableType: table | view | database, > href: string, > browserLink: string, > name: string, > parent?: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > } > ``` *** ### list `columns.list` List columns in a table **Risk:** `read` ```ts theme={null} await corsair.coda.api.columns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `visibleOnly` | `boolean` | No | If true, returns only visible columns for the table. This parameter only applies to base tables, and not views. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: column, > href: string, > name: string, > display?: boolean, > calculated?: boolean, > formula?: string, > defaultValue?: string, > format: { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > label?: string, > disableIf?: string, > action?: string > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > displayType: toggle | check > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > format?: string > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > dateFormat?: string, > timeFormat?: string > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > precision?: number, > maxUnit?: days | hours | minutes | seconds > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > display?: iconAndEmail | iconOnly | emailOnly, > autocomplete?: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > display?: iconOnly | url | title | card | embed, > force?: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > currencyCode?: string, > precision?: number, > format?: currency | accounting | financial > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > width: number | string, > height: number | string, > style: auto | circle > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > precision?: number, > useThousandsSeparator?: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > table: { > id: string, > type: table, > tableType: table | view | database, > href: string, > browserLink: string, > name: string, > parent?: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > } > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > options?: { > name: string, > backgroundColor?: string, > foregroundColor?: string > }[] > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > maximum: number, > icon: star | circle | fire | bug | diamond | bell | thumbsup | heart | chili | smiley | lightning | currency | coffee | person | battery | cocktail | cloud | sun | checkmark | lightbulb > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > minimum?: number | string, > maximum?: number | string, > step?: number | string, > displayType?: slider | progress, > showValue?: boolean > } | { > type: text | person | lookup | number | percent | currency | date | dateTime | time | duration | email | link | slider | scale | image | imageReference | attachments | button | checkbox | select | packObject | reaction | canvas | other, > isArray: boolean, > format?: string > } > }[] > ``` *** ## Controls ### get `controls.get` Get a control and its value **Risk:** `read` ```ts theme={null} await corsair.coda.api.controls.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `controlIdOrName` | `string` | Yes | ID or name of the control. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `control` | Yes | — | | `href` | `string` | Yes | — | | `name` | `string` | Yes | — | | `parent` | `object` | No | — | | `controlType` | `aiBlock \| button \| checkbox \| datePicker \| dateRangePicker \| dateTimePicker \| lookup \| multiselect \| select \| scale \| slider \| reaction \| textbox \| timePicker` | Yes | — | | `value` | `string \| number \| boolean \| (string \| number \| boolean \| (string \| number \| boolean)[])[]` | Yes | — | > **parent full type** > > ```ts theme={null} > { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > ``` *** ### list `controls.list` List controls in a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.controls.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `sortBy` | `name` | No | Determines how to sort the given objects. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: control, > href: string, > name: string, > parent?: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > }[] > ``` *** ## Docs ### copy `docs.copy` Create a copy of an existing doc **Risk:** `write` ```ts theme={null} await corsair.coda.api.docs.copy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | Title of the new doc. Defaults to 'Untitled'. | | `sourceDoc` | `string` | Yes | ID of the doc to copy. | | `timezone` | `string` | No | The timezone to use for the newly created doc. | | `folderId` | `string` | No | The ID of the folder within which to create this doc. Defaults to your "My docs" folder in the oldest workspace you joined; this is subject to change. You can get this ID by opening the folder in the docs list on your computer and grabbing the `folderId` query parameter. | | `initialPage` | `object` | No | — | > **initialPage full type** > > ```ts theme={null} > { > name?: string, > subtitle?: string, > iconName?: string, > imageUrl?: string, > parentPageId?: string, > pageContent?: { > type: canvas, > canvasContent: { > format: html | markdown, > content: string > } > } | { > type: embed, > url: string, > renderMethod?: compatibility | standard > } | { > type: syncPage, > mode: page, > includeSubpages: boolean, > sourcePageId: string, > sourceDocId: string > } | { > type: syncPage, > mode: document, > sourceDocId: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `doc` | Yes | — | | `href` | `string` | Yes | — | | `browserLink` | `string` | Yes | — | | `icon` | `object` | No | — | | `name` | `string` | Yes | — | | `owner` | `string` | Yes | — | | `ownerName` | `string` | Yes | — | | `docSize` | `object` | No | — | | `sourceDoc` | `object` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | | `published` | `object` | No | — | | `folder` | `object` | Yes | — | | `workspace` | `object` | Yes | — | | `workspaceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `requestId` | `string` | No | — | > **icon full type** > > ```ts theme={null} > { > name: string, > type: string, > browserLink: string > } > ``` > **docSize full type** > > ```ts theme={null} > { > totalRowCount: number, > tableAndViewCount: number, > baseTableCount?: number, > pageCount: number, > overApiSizeLimit: boolean > } > ``` > **sourceDoc full type** > > ```ts theme={null} > { > id: string, > type: doc, > href: string, > browserLink: string > } > ``` > **published full type** > > ```ts theme={null} > { > description?: string, > browserLink: string, > imageLink?: string, > discoverable: boolean, > earnCredit: boolean, > mode: view | play | edit, > categories: { > name: string > }[] > } > ``` > **folder full type** > > ```ts theme={null} > { > id: string, > type: folder, > browserLink: string, > name?: string > } > ``` > **workspace full type** > > ```ts theme={null} > { > id: string, > type: workspace, > organizationId?: string, > browserLink: string, > name?: string > } > ``` *** ### create `docs.create` Create a new doc **Risk:** `write` ```ts theme={null} await corsair.coda.api.docs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | Title of the new doc. Defaults to 'Untitled'. | | `sourceDoc` | `string` | No | An optional doc ID from which to create a copy. | | `timezone` | `string` | No | The timezone to use for the newly created doc. | | `folderId` | `string` | No | The ID of the folder within which to create this doc. Defaults to your "My docs" folder in the oldest workspace you joined; this is subject to change. You can get this ID by opening the folder in the docs list on your computer and grabbing the `folderId` query parameter. | | `initialPage` | `object` | No | — | > **initialPage full type** > > ```ts theme={null} > { > name?: string, > subtitle?: string, > iconName?: string, > imageUrl?: string, > parentPageId?: string, > pageContent?: { > type: canvas, > canvasContent: { > format: html | markdown, > content: string > } > } | { > type: embed, > url: string, > renderMethod?: compatibility | standard > } | { > type: syncPage, > mode: page, > includeSubpages: boolean, > sourcePageId: string, > sourceDocId: string > } | { > type: syncPage, > mode: document, > sourceDocId: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `doc` | Yes | — | | `href` | `string` | Yes | — | | `browserLink` | `string` | Yes | — | | `icon` | `object` | No | — | | `name` | `string` | Yes | — | | `owner` | `string` | Yes | — | | `ownerName` | `string` | Yes | — | | `docSize` | `object` | No | — | | `sourceDoc` | `object` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | | `published` | `object` | No | — | | `folder` | `object` | Yes | — | | `workspace` | `object` | Yes | — | | `workspaceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `requestId` | `string` | No | — | > **icon full type** > > ```ts theme={null} > { > name: string, > type: string, > browserLink: string > } > ``` > **docSize full type** > > ```ts theme={null} > { > totalRowCount: number, > tableAndViewCount: number, > baseTableCount?: number, > pageCount: number, > overApiSizeLimit: boolean > } > ``` > **sourceDoc full type** > > ```ts theme={null} > { > id: string, > type: doc, > href: string, > browserLink: string > } > ``` > **published full type** > > ```ts theme={null} > { > description?: string, > browserLink: string, > imageLink?: string, > discoverable: boolean, > earnCredit: boolean, > mode: view | play | edit, > categories: { > name: string > }[] > } > ``` > **folder full type** > > ```ts theme={null} > { > id: string, > type: folder, > browserLink: string, > name?: string > } > ``` > **workspace full type** > > ```ts theme={null} > { > id: string, > type: workspace, > organizationId?: string, > browserLink: string, > name?: string > } > ``` *** ### delete `docs.delete` Permanently delete a doc **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.docs.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | **Output:** *empty object* *** ### get `docs.get` Get metadata for a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.docs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `doc` | Yes | — | | `href` | `string` | Yes | — | | `browserLink` | `string` | Yes | — | | `icon` | `object` | No | — | | `name` | `string` | Yes | — | | `owner` | `string` | Yes | — | | `ownerName` | `string` | Yes | — | | `docSize` | `object` | No | — | | `sourceDoc` | `object` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | | `published` | `object` | No | — | | `folder` | `object` | Yes | — | | `workspace` | `object` | Yes | — | | `workspaceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | > **icon full type** > > ```ts theme={null} > { > name: string, > type: string, > browserLink: string > } > ``` > **docSize full type** > > ```ts theme={null} > { > totalRowCount: number, > tableAndViewCount: number, > baseTableCount?: number, > pageCount: number, > overApiSizeLimit: boolean > } > ``` > **sourceDoc full type** > > ```ts theme={null} > { > id: string, > type: doc, > href: string, > browserLink: string > } > ``` > **published full type** > > ```ts theme={null} > { > description?: string, > browserLink: string, > imageLink?: string, > discoverable: boolean, > earnCredit: boolean, > mode: view | play | edit, > categories: { > name: string > }[] > } > ``` > **folder full type** > > ```ts theme={null} > { > id: string, > type: folder, > browserLink: string, > name?: string > } > ``` > **workspace full type** > > ```ts theme={null} > { > id: string, > type: workspace, > organizationId?: string, > browserLink: string, > name?: string > } > ``` *** ### list `docs.list` List docs the user can access **Risk:** `read` ```ts theme={null} await corsair.coda.api.docs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `isOwner` | `boolean` | No | Show only docs owned by the user. | | `isPublished` | `boolean` | No | Show only published docs. | | `query` | `string` | No | Search term used to filter down results. | | `sourceDoc` | `string` | No | Show only docs copied from the specified doc ID. | | `isStarred` | `boolean` | No | If true, returns docs that are starred. If false, returns docs that are not starred. | | `inGallery` | `boolean` | No | Show only docs visible within the gallery. | | `workspaceId` | `string` | No | Show only docs belonging to the given workspace. | | `folderId` | `string` | No | Show only docs belonging to the given folder. | | `minimumAccess` | `readonly \| write \| comment` | No | Show only docs where the user has at least this access. Uses the same access values as doc permissions (`readonly`, `comment`, `write`). `write` includes both editors and managers. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: doc, > href: string, > browserLink: string, > icon?: { > name: string, > type: string, > browserLink: string > }, > name: string, > owner: string, > ownerName: string, > docSize?: { > totalRowCount: number, > tableAndViewCount: number, > baseTableCount?: number, > pageCount: number, > overApiSizeLimit: boolean > }, > sourceDoc?: { > id: string, > type: doc, > href: string, > browserLink: string > }, > createdAt: string, > updatedAt: string, > published?: { > description?: string, > browserLink: string, > imageLink?: string, > discoverable: boolean, > earnCredit: boolean, > mode: view | play | edit, > categories: { > name: string > }[] > }, > folder: { > id: string, > type: folder, > browserLink: string, > name?: string > }, > workspace: { > id: string, > type: workspace, > organizationId?: string, > browserLink: string, > name?: string > }, > workspaceId: string, > folderId: string > }[] > ``` *** ### publish `docs.publish` Publish a doc or update its publish settings **Risk:** `write` ```ts theme={null} await corsair.coda.api.docs.publish({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `slug` | `string` | No | Slug for the published doc. | | `discoverable` | `boolean` | No | If true, indicates that the doc is discoverable. | | `categoryNames` | `string[]` | No | The names of categories to apply to the document. | | `mode` | `view \| play \| edit` | No | Which interaction mode the published doc should use. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | *** ### unpublish `docs.unpublish` Unpublish a doc **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.docs.unpublish({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | **Output:** *empty object* *** ### update `docs.update` Update the title or icon of a doc **Risk:** `write` ```ts theme={null} await corsair.coda.api.docs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `title` | `string` | No | Title of the doc. | | `iconName` | `string` | No | Name of the icon. | **Output:** *empty object* *** ## Domains ### add `domains.add` Add a custom domain to a published doc **Risk:** `write` ```ts theme={null} await corsair.coda.api.domains.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `customDocDomain` | `string` | Yes | The custom domain. | **Output:** *empty object* *** ### delete `domains.delete` Remove a custom domain from a published doc **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.domains.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `customDocDomain` | `string` | Yes | A custom domain for a published doc. | **Output:** *empty object* *** ### getProvider `domains.getProvider` Identify the registrar of a custom domain **Risk:** `read` ```ts theme={null} await corsair.coda.api.domains.getProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customDocDomain` | `string` | Yes | A custom domain for a published doc. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `provider` | `GoDaddy \| Namecheap \| Hover (Tucows) \| Network Solutions \| Google Domains \| Other` | Yes | — | *** ### list `domains.list` List custom domains of a published doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.domains.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `customDocDomains` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **customDocDomains full type** > > ```ts theme={null} > { > customDocDomain: string, > hasCertificate: boolean, > hasDnsDocId: boolean, > setupStatus: pending | succeeded | failed, > domainStatus: connected | notConnected, > lastVerifiedTimestamp?: string > }[] > ``` *** ### update `domains.update` Update a custom domain of a published doc **Risk:** `write` ```ts theme={null} await corsair.coda.api.domains.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `customDocDomain` | `string` | Yes | A custom domain for a published doc. | | `body` | `object` | Yes | Credentials patch for the system connection. | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Folders ### create `folders.create` Create a folder in a workspace **Risk:** `write` ```ts theme={null} await corsair.coda.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the folder. | | `workspaceId` | `string` | Yes | ID of the workspace where the folder should be created. | | `description` | `string` | No | Description of the folder. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `folder` | Yes | — | | `name` | `string` | Yes | — | | `browserLink` | `string` | Yes | — | | `description` | `string` | No | — | | `icon` | `object` | No | — | | `iconColor` | `DARK_BLUE \| DARK_YELLOW \| DARK_PURPLE \| DARK_PINK \| DARK_ORANGE \| DARK_GREEN \| DARK_RED \| DARK_GRAY \| LIGHT_BLUE \| LIGHT_YELLOW \| LIGHT_PURPLE \| LIGHT_PINK \| LIGHT_ORANGE \| LIGHT_GREEN \| LIGHT_RED \| LIGHT_GRAY` | No | — | | `createdAt` | `string` | No | — | | `canEdit` | `boolean` | No | — | | `workspace` | `object` | Yes | — | > **icon full type** > > ```ts theme={null} > { > name: string, > type: string, > browserLink: string > } > ``` > **workspace full type** > > ```ts theme={null} > { > id: string, > type: workspace, > organizationId?: string, > browserLink: string, > name?: string > } > ``` *** ### delete `folders.delete` Delete a folder **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.folders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | ID of the folder. | **Output:** *empty object* *** ### get `folders.get` Get metadata about a folder **Risk:** `read` ```ts theme={null} await corsair.coda.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | ID of the folder. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `folder` | Yes | — | | `name` | `string` | Yes | — | | `browserLink` | `string` | Yes | — | | `description` | `string` | No | — | | `icon` | `object` | No | — | | `iconColor` | `DARK_BLUE \| DARK_YELLOW \| DARK_PURPLE \| DARK_PINK \| DARK_ORANGE \| DARK_GREEN \| DARK_RED \| DARK_GRAY \| LIGHT_BLUE \| LIGHT_YELLOW \| LIGHT_PURPLE \| LIGHT_PINK \| LIGHT_ORANGE \| LIGHT_GREEN \| LIGHT_RED \| LIGHT_GRAY` | No | — | | `createdAt` | `string` | No | — | | `canEdit` | `boolean` | No | — | | `workspace` | `object` | Yes | — | > **icon full type** > > ```ts theme={null} > { > name: string, > type: string, > browserLink: string > } > ``` > **workspace full type** > > ```ts theme={null} > { > id: string, > type: workspace, > organizationId?: string, > browserLink: string, > name?: string > } > ``` *** ### list `folders.list` List folders the user can access **Risk:** `read` ```ts theme={null} await corsair.coda.api.folders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | Show only folders belonging to the given workspace. | | `isStarred` | `boolean` | No | If true, returns folders that are starred. If false, returns folders that are not starred. If not specified, returns all folders. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: folder, > name: string, > browserLink: string, > description?: string, > icon?: { > name: string, > type: string, > browserLink: string > }, > iconColor?: DARK_BLUE | DARK_YELLOW | DARK_PURPLE | DARK_PINK | DARK_ORANGE | DARK_GREEN | DARK_RED | DARK_GRAY | LIGHT_BLUE | LIGHT_YELLOW | LIGHT_PURPLE | LIGHT_PINK | LIGHT_ORANGE | LIGHT_GREEN | LIGHT_RED | LIGHT_GRAY, > createdAt?: string, > canEdit?: boolean, > workspace: { > id: string, > type: workspace, > organizationId?: string, > browserLink: string, > name?: string > } > }[] > ``` *** ### update `folders.update` Update the name or description of a folder **Risk:** `write` ```ts theme={null} await corsair.coda.api.folders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | ID of the folder. | | `name` | `string` | No | Name of the folder. | | `description` | `string` | No | Description of the folder. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `folder` | Yes | — | | `name` | `string` | Yes | — | | `browserLink` | `string` | Yes | — | | `description` | `string` | No | — | | `icon` | `object` | No | — | | `iconColor` | `DARK_BLUE \| DARK_YELLOW \| DARK_PURPLE \| DARK_PINK \| DARK_ORANGE \| DARK_GREEN \| DARK_RED \| DARK_GRAY \| LIGHT_BLUE \| LIGHT_YELLOW \| LIGHT_PURPLE \| LIGHT_PINK \| LIGHT_ORANGE \| LIGHT_GREEN \| LIGHT_RED \| LIGHT_GRAY` | No | — | | `createdAt` | `string` | No | — | | `canEdit` | `boolean` | No | — | | `workspace` | `object` | Yes | — | > **icon full type** > > ```ts theme={null} > { > name: string, > type: string, > browserLink: string > } > ``` > **workspace full type** > > ```ts theme={null} > { > id: string, > type: workspace, > organizationId?: string, > browserLink: string, > name?: string > } > ``` *** ## Formulas ### get `formulas.get` Get a named formula and its value **Risk:** `read` ```ts theme={null} await corsair.coda.api.formulas.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `formulaIdOrName` | `string` | Yes | ID or name of the formula. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `formula` | Yes | — | | `href` | `string` | Yes | — | | `name` | `string` | Yes | — | | `parent` | `object` | No | — | | `value` | `string \| number \| boolean \| (string \| number \| boolean \| (string \| number \| boolean)[])[]` | Yes | — | > **parent full type** > > ```ts theme={null} > { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > ``` *** ### list `formulas.list` List named formulas in a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.formulas.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `sortBy` | `name` | No | Determines how to sort the given objects. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: formula, > href: string, > name: string, > parent?: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > }[] > ``` *** ## Pack Assets ### upload `packAssets.upload` Get a signed URL to upload a Pack asset **Risk:** `write` ```ts theme={null} await corsair.coda.api.packAssets.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `packAssetType` | `logo \| cover \| exampleImage \| agentImage` | Yes | — | | `imageHash` | `string` | Yes | The SHA-256 hash of the image to be uploaded. | | `mimeType` | `string` | Yes | The media type of the image being sent. | | `filename` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uploadUrl` | `string` | Yes | — | | `packAssetUploadedPathName` | `string` | Yes | — | | `headers` | `object` | Yes | — | > **headers full type** > > ```ts theme={null} > { > } > ``` *** ### uploadComplete `packAssets.uploadComplete` Mark the upload of a Pack asset as complete **Risk:** `write` ```ts theme={null} await corsair.coda.api.packAssets.uploadComplete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `packAssetId` | `string` | Yes | Unique identifier for a Pack asset. | | `packAssetType` | `logo \| cover \| exampleImage \| agentImage` | Yes | Pack asset type. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `assetId` | `string` | Yes | — | *** ## Pack Categories ### add `packCategories.add` Add a publishing category to a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packCategories.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `categoryName` | `string` | Yes | Name of the publishing category. | **Output:** *empty object* *** ### delete `packCategories.delete` Remove a publishing category from a Pack **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.packCategories.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `categoryName` | `string` | Yes | Name of a publishing category | **Output:** *empty object* *** ### list `packCategories.list` List the publishing categories of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packCategories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output** | Name | Type | Required | Description | | - | - | - | - | | `categories` | `object[]` | Yes | — | > **categories full type** > > ```ts theme={null} > { > categoryId: string, > categoryName: string, > categorySlug?: string > }[] > ``` *** ## Pack Connections ### getOauthConfig `packConnections.getOauthConfig` Get the OAuth configuration of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packConnections.getOauthConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maskedClientId` | `string` | Yes | — | | `maskedClientSecret` | `string` | Yes | — | | `authorizationUrl` | `string` | Yes | — | | `tokenUrl` | `string` | Yes | — | | `tokenPrefix` | `string` | No | — | | `scopes` | `string` | No | — | | `redirectUri` | `string` | Yes | — | | `useDynamicClientRegistration` | `boolean` | No | — | *** ### getSystemConnection `packConnections.getSystemConnection` Get the system connection metadata of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packConnections.getSystemConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > type: header, > maskedToken?: string, > headerName: string, > tokenPrefix: string > } | { > type: multiHeader, > headers: { > headerName: string, > maskedToken: string, > tokenPrefix?: string > }[], > presets: { > headerName: string, > tokenPrefix?: string > }[] > } | { > type: urlParam, > params: { > key: string, > maskedValue: string > }[], > domain: string, > presetKeys: string[] > } | { > type: httpBasic, > maskedUsername?: string, > maskedPassword?: string > } | { > type: custom, > params: { > key: string, > maskedValue: string > }[], > domain: string, > presetKeys: string[] > } | { > type: oauth2ClientCredentials, > location: automatic | body | header, > maskedClientId: string, > maskedClientSecret: string > } | { > type: googleServiceAccount, > maskedServiceAccountKey: string > } | { > type: awsAssumeRole, > service: string, > roleArn: string, > externalId: string > } | { > type: awsAccessKey, > service: string, > maskedAccessKeyId: string, > maskedSecretAccessKey: string > } > ``` *** ### patchSystemConnection `packConnections.patchSystemConnection` Patch the system connection credentials of a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packConnections.patchSystemConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `body` | `object` | Yes | Credentials patch for the system connection. | > **body full type** > > ```ts theme={null} > { > type: header, > token?: string > } | { > type: multiHeader, > tokensToPatch?: { > key: string, > value: string > }[] > } | { > type: urlParam, > paramsToPatch?: { > key: string, > value: string > }[] > } | { > type: httpBasic, > username?: string, > password?: string > } | { > type: custom, > paramsToPatch?: { > key: string, > value: string > }[] > } | { > type: oauth2ClientCredentials, > clientId?: string, > clientSecret?: string > } | { > type: googleServiceAccount, > serviceAccountKey?: string > } | { > type: awsAssumeRole, > roleArn?: string, > externalId?: string > } | { > type: awsAccessKey, > accessKeyId?: string, > secretAccessKey?: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > type: header, > maskedToken?: string, > headerName: string, > tokenPrefix: string > } | { > type: multiHeader, > headers: { > headerName: string, > maskedToken: string, > tokenPrefix?: string > }[], > presets: { > headerName: string, > tokenPrefix?: string > }[] > } | { > type: urlParam, > params: { > key: string, > maskedValue: string > }[], > domain: string, > presetKeys: string[] > } | { > type: httpBasic, > maskedUsername?: string, > maskedPassword?: string > } | { > type: custom, > params: { > key: string, > maskedValue: string > }[], > domain: string, > presetKeys: string[] > } | { > type: oauth2ClientCredentials, > location: automatic | body | header, > maskedClientId: string, > maskedClientSecret: string > } | { > type: googleServiceAccount, > maskedServiceAccountKey: string > } | { > type: awsAssumeRole, > service: string, > roleArn: string, > externalId: string > } | { > type: awsAccessKey, > service: string, > maskedAccessKeyId: string, > maskedSecretAccessKey: string > } > ``` *** ### setOauthConfig `packConnections.setOauthConfig` Set the OAuth client credentials of a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packConnections.setOauthConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `clientId` | `string` | No | — | | `clientSecret` | `string` | No | — | | `redirectUri` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maskedClientId` | `string` | Yes | — | | `maskedClientSecret` | `string` | Yes | — | | `authorizationUrl` | `string` | Yes | — | | `tokenUrl` | `string` | Yes | — | | `tokenPrefix` | `string` | No | — | | `scopes` | `string` | No | — | | `redirectUri` | `string` | Yes | — | | `useDynamicClientRegistration` | `boolean` | No | — | *** ### setSystemConnection `packConnections.setSystemConnection` Set the system connection credentials of a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packConnections.setSystemConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `credentials` | `object` | Yes | Credentials of a Pack connection. | > **credentials full type** > > ```ts theme={null} > { > type: header, > token: string > } | { > type: multiHeader, > tokens: { > key: string, > value: string > }[] > } | { > type: urlParam, > params: { > key: string, > value: string > }[] > } | { > type: httpBasic, > username: string, > password?: string > } | { > type: custom, > params: { > key: string, > value: string > }[] > } | { > type: oauth2ClientCredentials, > clientId: string, > clientSecret: string > } | { > type: googleServiceAccount, > serviceAccountKey: string > } | { > type: awsAssumeRole, > roleArn: string, > externalId: string > } | { > type: awsAccessKey, > accessKeyId: string, > secretAccessKey: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > type: header, > maskedToken?: string, > headerName: string, > tokenPrefix: string > } | { > type: multiHeader, > headers: { > headerName: string, > maskedToken: string, > tokenPrefix?: string > }[], > presets: { > headerName: string, > tokenPrefix?: string > }[] > } | { > type: urlParam, > params: { > key: string, > maskedValue: string > }[], > domain: string, > presetKeys: string[] > } | { > type: httpBasic, > maskedUsername?: string, > maskedPassword?: string > } | { > type: custom, > params: { > key: string, > maskedValue: string > }[], > domain: string, > presetKeys: string[] > } | { > type: oauth2ClientCredentials, > location: automatic | body | header, > maskedClientId: string, > maskedClientSecret: string > } | { > type: googleServiceAccount, > maskedServiceAccountKey: string > } | { > type: awsAssumeRole, > service: string, > roleArn: string, > externalId: string > } | { > type: awsAccessKey, > service: string, > maskedAccessKeyId: string, > maskedSecretAccessKey: string > } > ``` *** ## Pack Featured Docs ### list `packFeaturedDocs.list` List the featured docs of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packFeaturedDocs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > doc: { > id: string, > type: doc, > href: string, > browserLink: string > }, > isPinned: boolean, > docStatus?: docInaccessibleOrDoesNotExist | invalidPublishedDocUrl, > publishedUrl?: string > }[] > ``` *** ### update `packFeaturedDocs.update` Replace the featured docs of a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packFeaturedDocs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `items` | `object[]` | Yes | A list of docs to set as the featured docs for a Pack. | > **items full type** > > ```ts theme={null} > { > url: string, > isPinned?: boolean > }[] > ``` **Output:** *empty object* *** ## Pack Invitations ### create `packInvitations.create` Invite a user to collaborate on a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packInvitations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `email` | `string` | Yes | Email address of the user to invite | | `access` | `none \| view \| test \| edit \| admin` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `invitationId` | `string` | Yes | — | *** ### listForUser `packInvitations.listForUser` List pending Pack invitations for the user **Risk:** `read` ```ts theme={null} await corsair.coda.api.packInvitations.listForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > invitation: { > invitationId: string, > packId: number, > inviteeEmail: string, > inviterUserId: number, > access: none | view | test | edit | admin, > createdAt: string, > expiresAt: string > }, > pack: { > id: number, > logoUrl?: string, > coverUrl?: string, > exampleImages?: { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[], > agentImages?: { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[], > workspaceId: string, > categories: { > categoryId: string, > categoryName: string, > categorySlug?: string > }[], > certified?: boolean, > certifiedAgent?: boolean, > sourceCodeVisibility?: private | shared, > packEntrypoints?: go | docs[], > verifiedVersion?: string, > name: string, > description: string, > shortDescription: string, > agentShortDescription?: string, > agentDescription?: string, > supportEmail?: string, > termsOfServiceUrl?: string, > privacyPolicyUrl?: string > }, > makers: { > name: string, > pictureLink?: string, > slug?: string, > jobTitle?: string, > employer?: string, > description?: string, > loginId: string > }[], > networkDomains: string[] > }[] > ``` *** ## Pack Listings ### deleteDraft `packListings.deleteDraft` Delete the listing draft of a Pack **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.packListings.deleteDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output:** *empty object* *** ### get `packListings.get` Get the public listing of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packListings.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `workspaceId` | `string` | No | ID of the target workspace (if applicable) for checking installation privileges. | | `docId` | `string` | No | ID of the target document for checking installation privileges | | `ingestionId` | `string` | No | ID of the target ingestion for checking limit settings | | `installContext` | `workspace \| doc` | No | Type of installation context for which Pack information is being requested. | | `releaseChannel` | `LIVE \| LATEST` | No | Release channel for which Pack information is being requested. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | — | | `packVersion` | `string` | Yes | — | | `releaseId` | `number` | No | — | | `lastReleasedAt` | `string` | No | — | | `logoUrl` | `string` | Yes | — | | `logo` | `object` | Yes | — | | `coverUrl` | `string` | No | — | | `cover` | `object` | No | — | | `exampleImages` | `object[]` | No | — | | `agentImages` | `object[]` | No | — | | `name` | `string` | Yes | — | | `description` | `string` | Yes | — | | `shortDescription` | `string` | Yes | — | | `agentShortDescription` | `string` | No | — | | `agentDescription` | `string` | No | — | | `supportEmail` | `string` | No | — | | `termsOfServiceUrl` | `string` | No | — | | `privacyPolicyUrl` | `string` | No | — | | `categories` | `object[]` | Yes | — | | `makers` | `object[]` | Yes | — | | `certified` | `boolean` | No | — | | `certifiedAgent` | `boolean` | No | — | | `minimumFeatureSet` | `Basic \| Pro \| Team \| Enterprise` | No | — | | `unrestrictedFeatureSet` | `Basic \| Pro \| Team \| Enterprise` | No | — | | `externalMetadataUrl` | `string` | Yes | — | | `standardPackPlan` | `object` | No | — | | `bundledPackPlan` | `object` | No | — | | `sourceCodeVisibility` | `private \| shared` | No | — | | `sdkVersion` | `string` | Yes | — | | `packCategoryType` | `connector \| agent \| customAgent` | Yes | — | | `discoverability` | `public \| nomosOrganization \| group \| grammarlyInstitution \| workspace \| private` | Yes | — | | `userAccess` | `object` | Yes | — | | `codaHelpCenterUrl` | `string` | No | — | | `configuration` | `object` | No | — | > **logo full type** > > ```ts theme={null} > { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > } > ``` > **cover full type** > > ```ts theme={null} > { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > } > ``` > **exampleImages full type** > > ```ts theme={null} > { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[] > ``` > **agentImages full type** > > ```ts theme={null} > { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[] > ``` > **categories full type** > > ```ts theme={null} > { > categoryId: string, > categoryName: string, > categorySlug?: string > }[] > ``` > **makers full type** > > ```ts theme={null} > { > name: string, > pictureLink?: string, > slug?: string, > jobTitle?: string, > employer?: string, > description?: string > }[] > ``` > **standardPackPlan full type** > > ```ts theme={null} > { > packPlanId: string, > packId: number, > pricing: { > type: Free > } | { > type: MonthlyDocMaker, > amount: number, > currency: USD > }, > createdAt: string > } > ``` > **bundledPackPlan full type** > > ```ts theme={null} > { > packPlanId: string, > packId: number, > pricing: { > type: BundledWithTier, > minimumFeatureSet: Pro | Team | Enterprise > }, > createdAt: string > } > ``` > **userAccess full type** > > ```ts theme={null} > { > canEdit: boolean, > canTest: boolean, > canView: boolean, > canInstall: boolean, > canPurchase: boolean, > requiresTrial: boolean, > canConnectAccount: boolean, > usesSystemConnection?: boolean, > organization?: { > canRequestAccess: boolean, > hasRequestedAccess: boolean, > requiresConfiguration: boolean, > allowedConfigurations?: { > configurationId: string, > name: string, > policy?: { > }, > hasSharedConnection?: boolean > }[], > allowedPackIds?: number[], > incompatibleDocPermissions?: { > principal: { > type: email, > email: string > } | { > type: group, > groupId: string, > groupName: string > } | { > type: domain, > domain: string > } | { > type: workspace, > workspaceId: string > } | { > type: anyone > } | { > type: internalAccess, > internalAccessType: string > }, > id: string, > access: readonly | write | comment | none > }[], > incompatibleDocOwner?: { > name: string, > loginId: string, > type: user, > pictureLink?: string > }, > incompatibleDocFolder?: { > id: string, > type: folder, > browserLink: string, > name?: string > }, > isDocOwner?: boolean > } | { > canRequestAccess: boolean, > hasRequestedAccess: boolean, > requiresConfiguration: boolean, > allowedConfigurations?: { > configurationId: string, > name: string, > policy?: { > }, > hasSharedConnection?: boolean > }[], > allowedPackIds?: number[] > }, > ingestionLimitSettings?: { > tableSettings?: { > }, > maxBytesPerSyncTableDefault?: number | null, > allowedTablesCount: number > } > } > ``` > **configuration full type** > > ```ts theme={null} > { > configurationId: string, > name: string, > policy?: { > }, > hasSharedConnection?: boolean > } > ``` *** ### list `packListings.list` List the Pack listings the user can access **Risk:** `read` ```ts theme={null} await corsair.coda.api.packListings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packAccessTypes` | `none \| view \| test \| edit \| admin[]` | No | Pack access types. | | `packIds` | `number[]` | No | Which Pack IDs to fetch. | | `onlyWorkspaceId` | `string` | No | Use only this workspace (not all of a user's workspaces) to check for Packs shared via workspace ACL. | | `parentWorkspaceIds` | `string[]` | No | Filter to only Packs whose parent workspace is one of the given IDs. | | `excludePublicPacks` | `boolean` | No | Only get Packs shared with users/workspaces, not publicly. | | `packEntrypoint` | `go \| docs` | No | Entrypoint for which this Pack call is being made. Used to filter non relevant Packs | | `certifiedAgentsOnly` | `boolean` | No | Only include Packs that are certified for agent use. Depending on server configuration, may also include Packs that the user is an admin of. | | `packCategories` | `connector \| agent \| customAgent[]` | No | Filter Packs by one or more category types. | | `sortBy` | `packId \| name \| packVersion \| packVersionModifiedAt \| agentDirectorySort` | No | Specify a sort order for the returned Pack listings returned. | | `orderBy` | `packId \| name \| packVersion \| packVersionModifiedAt \| agentDirectorySort` | No | Deprecated: use sortBy instead. | | `direction` | `ascending \| descending` | No | Direction to sort results in. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `installContext` | `workspace \| doc` | No | Type of installation context for which Pack information is being requested. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > packId: number, > packVersion: string, > releaseId?: number, > lastReleasedAt?: string, > logoUrl: string, > logo: { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }, > coverUrl?: string, > cover?: { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }, > exampleImages?: { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[], > agentImages?: { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[], > name: string, > description: string, > shortDescription: string, > agentShortDescription?: string, > agentDescription?: string, > supportEmail?: string, > termsOfServiceUrl?: string, > privacyPolicyUrl?: string, > categories: { > categoryId: string, > categoryName: string, > categorySlug?: string > }[], > makers: { > name: string, > pictureLink?: string, > slug?: string, > jobTitle?: string, > employer?: string, > description?: string > }[], > certified?: boolean, > certifiedAgent?: boolean, > minimumFeatureSet?: Basic | Pro | Team | Enterprise, > unrestrictedFeatureSet?: Basic | Pro | Team | Enterprise, > externalMetadataUrl: string, > standardPackPlan?: { > packPlanId: string, > packId: number, > pricing: { > type: Free > } | { > type: MonthlyDocMaker, > amount: number, > currency: USD > }, > createdAt: string > }, > bundledPackPlan?: { > packPlanId: string, > packId: number, > pricing: { > type: BundledWithTier, > minimumFeatureSet: Pro | Team | Enterprise > }, > createdAt: string > }, > sourceCodeVisibility?: private | shared, > sdkVersion: string, > packCategoryType: connector | agent | customAgent > }[] > ``` *** ## Pack Logs ### getDetails `packLogs.getDetails` Get the details of a Pack ingestion log entry **Risk:** `read` ```ts theme={null} await corsair.coda.api.packLogs.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `tenantId` | `string` | Yes | ID of the tenant. | | `rootIngestionId` | `string` | Yes | ID of the root ingestion. | | `logId` | `string` | Yes | The id of the log to retrieve. | | `detailsKey` | `string` | Yes | The key of the details to retrieve. | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > type: fetcher, > request: string, > response?: string > } | { > type: invocation, > result?: { > stringVal: string, > int64Val: number, > doubleVal: number, > objectVal: string, > boolVal: boolean, > dateVal: number > }, > resultDetail?: string, > continuationJson?: string, > completionJson?: string, > deletedItemIdsJson?: string, > permissionsContextJson?: string > } | { > type: agentRuntime, > input?: string, > output?: string > } > ``` *** ### list `packLogs.list` List the execution logs of a Pack in a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.packLogs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `docId` | `string` | Yes | ID of the doc. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `logTypes` | `custom \| fetcher \| invocation \| internal \| auth \| ingestionLifecycle \| ingestionDebug \| agentRuntime \| mcp[]` | No | Only return logs of the given types. | | `beforeTimestamp` | `string` | No | Only return logs before the given time (non-inclusive). | | `afterTimestamp` | `string` | No | Only return logs after the given time (non-inclusive). | | `order` | `asc \| desc` | No | Specifies if the logs will be returned in time desc or asc. Default is desc. | | `q` | `string` | No | A search query that follows Lucene syntax. | | `requestIds` | `string[]` | No | Only return logs matching provided request IDs. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > ( > { > type: custom, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: invocation, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > cacheHit?: boolean, > duration?: number, > error?: { > message: string, > stack?: string > } > } | { > type: fetcher, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > requestSizeBytes?: number, > responseCode?: number, > responseSizeBytes?: number, > method?: GET | POST | PUT | DELETE | PATCH | HEAD, > baseUrl?: string, > cacheHit?: boolean, > duration?: number > } | { > type: internal, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: auth, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > path: string, > errorMessage?: string, > errorStack?: string > } | { > type: ingestionLifecycle, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: ingestionDebug, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: agentRuntime, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > turnType: string, > durationMs?: number, > name?: string, > model?: string, > tokenUsage?: string, > instructions?: string, > fromAgent?: string, > toAgent?: string > } | { > type: mcp, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message?: string, > error?: { > message: string, > stack?: string > } > } > )[] > ``` *** ### listGrouped `packLogs.listGrouped` List the execution logs of a Pack in a doc grouped by invocation **Risk:** `read` ```ts theme={null} await corsair.coda.api.packLogs.listGrouped({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `docId` | `string` | Yes | ID of the doc. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `beforeTimestamp` | `string` | No | Only return logs before the given time (non-inclusive). | | `afterTimestamp` | `string` | No | Only return logs after the given time (non-inclusive). | | `order` | `asc \| desc` | No | Specifies if the logs will be returned in time desc or asc. Default is desc. | | `q` | `string` | No | A search query that follows Lucene syntax. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | | `incompleteRelatedLogs` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > ( > { > type: invocation, > invocationLog: { > type: invocation, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > cacheHit?: boolean, > duration?: number, > error?: { > message: string, > stack?: string > } > }, > relatedLogs: ( > { > type: custom, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: invocation, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > cacheHit?: boolean, > duration?: number, > error?: { > message: string, > stack?: string > } > } | { > type: fetcher, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > requestSizeBytes?: number, > responseCode?: number, > responseSizeBytes?: number, > method?: GET | POST | PUT | DELETE | PATCH | HEAD, > baseUrl?: string, > cacheHit?: boolean, > duration?: number > } | { > type: internal, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: auth, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > path: string, > errorMessage?: string, > errorStack?: string > } | { > type: ingestionLifecycle, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: ingestionDebug, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: agentRuntime, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > turnType: string, > durationMs?: number, > name?: string, > model?: string, > tokenUsage?: string, > instructions?: string, > fromAgent?: string, > toAgent?: string > } | { > type: mcp, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message?: string, > error?: { > message: string, > stack?: string > } > } > )[] > } | { > type: auth, > authLog: { > type: auth, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > path: string, > errorMessage?: string, > errorStack?: string > }, > relatedLogs: ( > { > type: custom, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: invocation, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > cacheHit?: boolean, > duration?: number, > error?: { > message: string, > stack?: string > } > } | { > type: fetcher, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > requestSizeBytes?: number, > responseCode?: number, > responseSizeBytes?: number, > method?: GET | POST | PUT | DELETE | PATCH | HEAD, > baseUrl?: string, > cacheHit?: boolean, > duration?: number > } | { > type: internal, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: auth, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > path: string, > errorMessage?: string, > errorStack?: string > } | { > type: ingestionLifecycle, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: ingestionDebug, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: agentRuntime, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > turnType: string, > durationMs?: number, > name?: string, > model?: string, > tokenUsage?: string, > instructions?: string, > fromAgent?: string, > toAgent?: string > } | { > type: mcp, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message?: string, > error?: { > message: string, > stack?: string > } > } > )[] > } > )[] > ``` *** ### listGroupedIngestion `packLogs.listGroupedIngestion` List the logs of a Pack ingestion grouped by invocation **Risk:** `read` ```ts theme={null} await corsair.coda.api.packLogs.listGroupedIngestion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `tenantId` | `string` | Yes | ID of the tenant. | | `rootIngestionId` | `string` | Yes | ID of the root ingestion. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `ingestionExecutionId` | `string` | No | ID of the ingestion execution. | | `beforeTimestamp` | `string` | No | Only return logs before the given time (non-inclusive). | | `afterTimestamp` | `string` | No | Only return logs after the given time (non-inclusive). | | `order` | `asc \| desc` | No | Specifies if the logs will be returned in time desc or asc. Default is desc. | | `q` | `string` | No | A search query that follows Lucene syntax. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | | `incompleteRelatedLogs` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > ( > { > type: invocation, > invocationLog: { > type: invocation, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > cacheHit?: boolean, > duration?: number, > error?: { > message: string, > stack?: string > } > }, > relatedLogs: ( > { > type: custom, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: invocation, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > cacheHit?: boolean, > duration?: number, > error?: { > message: string, > stack?: string > } > } | { > type: fetcher, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > requestSizeBytes?: number, > responseCode?: number, > responseSizeBytes?: number, > method?: GET | POST | PUT | DELETE | PATCH | HEAD, > baseUrl?: string, > cacheHit?: boolean, > duration?: number > } | { > type: internal, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: auth, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > path: string, > errorMessage?: string, > errorStack?: string > } | { > type: ingestionLifecycle, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: ingestionDebug, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: agentRuntime, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > turnType: string, > durationMs?: number, > name?: string, > model?: string, > tokenUsage?: string, > instructions?: string, > fromAgent?: string, > toAgent?: string > } | { > type: mcp, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message?: string, > error?: { > message: string, > stack?: string > } > } > )[] > } | { > type: auth, > authLog: { > type: auth, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > path: string, > errorMessage?: string, > errorStack?: string > }, > relatedLogs: ( > { > type: custom, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: invocation, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > cacheHit?: boolean, > duration?: number, > error?: { > message: string, > stack?: string > } > } | { > type: fetcher, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > requestSizeBytes?: number, > responseCode?: number, > responseSizeBytes?: number, > method?: GET | POST | PUT | DELETE | PATCH | HEAD, > baseUrl?: string, > cacheHit?: boolean, > duration?: number > } | { > type: internal, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: auth, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > path: string, > errorMessage?: string, > errorStack?: string > } | { > type: ingestionLifecycle, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: ingestionDebug, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: agentRuntime, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > turnType: string, > durationMs?: number, > name?: string, > model?: string, > tokenUsage?: string, > instructions?: string, > fromAgent?: string, > toAgent?: string > } | { > type: mcp, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message?: string, > error?: { > message: string, > stack?: string > } > } > )[] > } > )[] > ``` *** ### listIngestion `packLogs.listIngestion` List the logs of a Pack ingestion **Risk:** `read` ```ts theme={null} await corsair.coda.api.packLogs.listIngestion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `tenantId` | `string` | Yes | ID of the tenant. | | `rootIngestionId` | `string` | Yes | ID of the root ingestion. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `logTypes` | `custom \| fetcher \| invocation \| internal \| auth \| ingestionLifecycle \| ingestionDebug \| agentRuntime \| mcp[]` | No | Only return logs of the given types. | | `ingestionExecutionId` | `string` | No | ID of the ingestion execution. | | `beforeTimestamp` | `string` | No | Only return logs before the given time (non-inclusive). | | `afterTimestamp` | `string` | No | Only return logs after the given time (non-inclusive). | | `ingestionStatus` | `QUEUED \| STARTED \| CANCELLED \| UP_FOR_RETRY \| COMPLETED \| FAILED` | No | Only fetch logs with the given ingestion status. This only works in combination with the onlyExecutionCompletions parameter. | | `onlyExecutionCompletions` | `boolean` | No | Only fetch logs that represent the completion of a child execution. | | `order` | `asc \| desc` | No | Specifies if the logs will be returned in time desc or asc. Default is desc. | | `q` | `string` | No | A search query that follows Lucene syntax. | | `requestIds` | `string[]` | No | Only return logs matching provided request IDs. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > ( > { > type: custom, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: invocation, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > cacheHit?: boolean, > duration?: number, > error?: { > message: string, > stack?: string > } > } | { > type: fetcher, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > requestSizeBytes?: number, > responseCode?: number, > responseSizeBytes?: number, > method?: GET | POST | PUT | DELETE | PATCH | HEAD, > baseUrl?: string, > cacheHit?: boolean, > duration?: number > } | { > type: internal, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: auth, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > path: string, > errorMessage?: string, > errorStack?: string > } | { > type: ingestionLifecycle, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: ingestionDebug, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message: string, > level: error | warn | info | debug | trace | unknown > } | { > type: agentRuntime, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > turnType: string, > durationMs?: number, > name?: string, > model?: string, > tokenUsage?: string, > instructions?: string, > fromAgent?: string, > toAgent?: string > } | { > type: mcp, > context: { > docId: string, > packId: string, > packVersion: string, > formulaName: string, > userId: string, > connectionId: string, > connectionName?: string, > requestId: string, > requestType: unknown | connectionNameMetadataRequest | parameterAutocompleteMetadataRequest | postAuthSetupMetadataRequest | propertyOptionsMetadataRequest | getSyncTableSchemaMetadataRequest | getDynamicSyncTableNameMetadataRequest | listSyncTableDynamicUrlsMetadataRequest | searchSyncTableDynamicUrlsMetadataRequest | getDynamicSyncTableDisplayUrlMetadataRequest | getIdentifiersForConnectionRequest | invokeFormulaRequest | invokeSyncFormulaRequest | invokeSyncUpdateFormulaRequest | invokeExecuteGetPermissionsRequest | validateParametersMetadataRequest | mcp, > createdAt: string, > logId: string, > docObjectId?: string, > docRowId?: string, > docColumnId?: string, > isSyncTable?: boolean, > isContinuedSyncTable?: boolean, > autocompleteParameterName?: string, > invocationSource?: string, > detailsKey: string, > ingestionChildExecutionIndex?: number, > ingestionId?: string, > rootIngestionId?: string, > ingestionExecutionId?: string, > ingestionStage?: string, > ingestionParentStage?: string, > ingestionExecutionAttempt?: number, > ingestionParentItemId?: string, > ingestionProcessId?: string, > additionalMetadata?: { > }, > agentSessionId?: string, > agentInstanceId?: string, > executingAgentInstanceId?: string > }, > message?: string, > error?: { > message: string, > stack?: string > } > } > )[] > ``` *** ### listIngestionExecutions `packLogs.listIngestionExecutions` List the batch executions of a Pack ingestion **Risk:** `read` ```ts theme={null} await corsair.coda.api.packLogs.listIngestionExecutions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `tenantId` | `string` | Yes | ID of the tenant. | | `rootIngestionId` | `string` | Yes | ID of the root ingestion. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `datasource` | `string` | No | Only show batch executions for this datasource (sync table). | | `executionType` | `FULL \| INCREMENTAL` | No | Only show batch executions with this execution type. | | `includeDeletedIngestions` | `boolean` | No | Include deleted ingestion executions in the response | | `ingestionExecutionId` | `string` | No | Only retrieve this single batch execution. | | `ingestionId` | `string` | No | Only show batch executions for this sync table ingestion. | | `ingestionStatus` | `QUEUED \| STARTED \| CANCELLED \| UP_FOR_RETRY \| COMPLETED \| FAILED` | No | Only show batch executions with this status. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > completionTimestamp: number, > creationTimestamp: number, > dynamicLabel?: string, > dynamicUrl?: string, > executionType: FULL | INCREMENTAL, > fullExecutionId: string, > ingestionExecutionId: string, > ingestionId: string, > ingestionName: string, > ingestionStatusCounts?: { > }, > lastFinishedFullWorkflowExecutionId?: string, > lastFinishedIncrementalWorkflowExecutionId?: string, > latestFullWorkflowExecutionId?: string, > latestIncrementalWorkflowExecutionId?: string, > latestIngestionSequenceId?: string, > liveIngestionSequenceId?: string, > parentSyncTableIngestionId?: string, > startTimestamp: number, > totalRowCount?: number > }[] > ``` *** ## Pack Makers ### add `packMakers.add` Add a maker to a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packMakers.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `loginId` | `string` | Yes | The email of the Pack maker. | **Output:** *empty object* *** ### delete `packMakers.delete` Remove a maker from a Pack **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.packMakers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `loginId` | `string` | Yes | Email of a Coda user. | **Output:** *empty object* *** ### list `packMakers.list` List the makers of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packMakers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output** | Name | Type | Required | Description | | - | - | - | - | | `makers` | `object[]` | Yes | — | > **makers full type** > > ```ts theme={null} > { > name: string, > pictureLink?: string, > slug?: string, > jobTitle?: string, > employer?: string, > description?: string, > loginId: string > }[] > ``` *** ## Pack Permissions ### add `packPermissions.add` Grant a principal access to a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packPermissions.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `principal` | `object` | Yes | Metadata about a Pack principal. | | `access` | `none \| view \| test \| edit \| admin` | Yes | — | > **principal full type** > > ```ts theme={null} > { > type: user, > email: string > } | { > type: workspace, > workspaceId: string > } | { > type: worldwide > } | { > type: nomosOrganization, > nomosOrganizationId: string > } | { > type: group, > groupId: string, > groupName?: string > } | { > type: grammarlyInstitution, > grammarlyInstitutionId: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `permissionId` | `string` | Yes | — | *** ### delete `packPermissions.delete` Remove a permission from a Pack **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.packPermissions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `permissionId` | `string` | Yes | ID of a permission on a doc. | **Output:** *empty object* *** ### list `packPermissions.list` List the permissions of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packPermissions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `permissionUsers` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > principal: { > type: user, > email: string > } | { > type: workspace, > workspaceId: string > } | { > type: worldwide > } | { > type: nomosOrganization, > nomosOrganizationId: string > } | { > type: group, > groupId: string, > groupName?: string > } | { > type: grammarlyInstitution, > grammarlyInstitutionId: number > }, > access: none | view | test | edit | admin > }[] > ``` > **permissionUsers full type** > > ```ts theme={null} > { > name: string, > loginId: string, > type: user, > pictureLink?: string > }[] > ``` *** ## Pack Releases ### create `packReleases.create` Release a Pack version **Risk:** `write` ```ts theme={null} await corsair.coda.api.packReleases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `packVersion` | `string` | Yes | Which semantic Pack version that the release will be created on. | | `releaseNotes` | `string` | No | Developers notes. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | — | | `releaseNotes` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `releaseId` | `number` | Yes | — | | `packVersion` | `string` | Yes | — | | `sdkVersion` | `string` | Yes | — | *** ### list `packReleases.list` List the releases of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packReleases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > packId: number, > releaseNotes: string, > createdAt: string, > releaseId: number, > packVersion: string, > sdkVersion: string > }[] > ``` *** ### update `packReleases.update` Update the release notes of a Pack release **Risk:** `write` ```ts theme={null} await corsair.coda.api.packReleases.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `packReleaseId` | `number` | Yes | ID of a Pack release | | `releaseNotes` | `string` | No | Notes about key features or changes in this release that the Pack maker wants to communicate to users. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | — | | `releaseNotes` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `releaseId` | `number` | Yes | — | | `packVersion` | `string` | Yes | — | | `sdkVersion` | `string` | Yes | — | *** ## Packs ### create `packs.create` Create a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | The parent workspace for the Pack. If unspecified, the user's default workspace will be used. | | `name` | `string` | No | The name for the Pack. | | `description` | `string` | No | A brief description of the Pack. | | `sourcePackId` | `number` | No | The ID of the new Pack's source, if this new Pack was forked. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | — | *** ### delete `packs.delete` Delete a Pack **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.packs.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output:** *empty object* *** ### get `packs.get` Get a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `logoUrl` | `string` | No | — | | `coverUrl` | `string` | No | — | | `exampleImages` | `object[]` | No | — | | `agentImages` | `object[]` | No | — | | `workspaceId` | `string` | Yes | — | | `categories` | `object[]` | Yes | — | | `certified` | `boolean` | No | — | | `certifiedAgent` | `boolean` | No | — | | `sourceCodeVisibility` | `private \| shared` | No | — | | `packEntrypoints` | `go \| docs[]` | No | — | | `verifiedVersion` | `string` | No | — | | `name` | `string` | Yes | — | | `description` | `string` | Yes | — | | `shortDescription` | `string` | Yes | — | | `agentShortDescription` | `string` | No | — | | `agentDescription` | `string` | No | — | | `supportEmail` | `string` | No | — | | `termsOfServiceUrl` | `string` | No | — | | `privacyPolicyUrl` | `string` | No | — | | `overallRateLimit` | `object` | No | — | | `perConnectionRateLimit` | `object` | No | — | | `featuredDocStatus` | `docInaccessibleOrDoesNotExist \| invalidPublishedDocUrl` | No | — | | `additionalInformation` | `object` | No | — | > **exampleImages full type** > > ```ts theme={null} > { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[] > ``` > **agentImages full type** > > ```ts theme={null} > { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[] > ``` > **categories full type** > > ```ts theme={null} > { > categoryId: string, > categoryName: string, > categorySlug?: string > }[] > ``` > **overallRateLimit full type** > > ```ts theme={null} > { > intervalSeconds: number, > operationsPerInterval: number > } > ``` > **perConnectionRateLimit full type** > > ```ts theme={null} > { > intervalSeconds: number, > operationsPerInterval: number > } > ``` > **additionalInformation full type** > > ```ts theme={null} > { > privacyCollectsPersonalInfo?: boolean | null, > privacyPersonalInfoCategories?: string[] | null, > privacyDataUsagePurposes?: string[] | null, > privacyDataCollectedBy?: string[] | null > } > ``` *** ### getConfigurationSchema `packs.getConfigurationSchema` Get the JSON Schema of the configuration of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packs.getConfigurationSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `packs.list` List Packs the user can access **Risk:** `read` ```ts theme={null} await corsair.coda.api.packs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accessType` | `none \| view \| test \| edit \| admin` | No | Deprecated, use accessTypes instead. Filter to only return the Packs for which the current user has this access type | | `accessTypes` | `none \| view \| test \| edit \| admin[]` | No | Filter to only return the Packs for which the current user has these access types. | | `sortBy` | `title \| createdAt \| updatedAt` | No | The sort order of the Packs returned. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `direction` | `ascending \| descending` | No | Direction to sort results in. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `onlyWorkspaceId` | `string` | No | Use only this workspace (not all of a user's workspaces) to check for Packs shared via workspace ACL. | | `parentWorkspaceIds` | `string[]` | No | Filter to only Packs whose parent workspace is one of the given IDs. | | `excludePublicPacks` | `boolean` | No | Only get Packs shared with users/workspaces, not publicly. | | `packEntrypoint` | `go \| docs` | No | Entrypoint for which this Pack call is being made. Used to filter non relevant Packs | | `excludePackCategories` | `connector \| agent \| customAgent[]` | No | Exclude Packs of one or more category types. Categories not listed stay visible. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: number, > logoUrl?: string, > coverUrl?: string, > exampleImages?: { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[], > agentImages?: { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[], > workspaceId: string, > categories: { > categoryId: string, > categoryName: string, > categorySlug?: string > }[], > certified?: boolean, > certifiedAgent?: boolean, > sourceCodeVisibility?: private | shared, > packEntrypoints?: go | docs[], > verifiedVersion?: string, > name: string, > description: string, > shortDescription: string, > agentShortDescription?: string, > agentDescription?: string, > supportEmail?: string, > termsOfServiceUrl?: string, > privacyPolicyUrl?: string > }[] > ``` *** ### update `packs.update` Update the metadata of a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `overallRateLimit` | `object` | No | Rate limit in Pack settings. | | `perConnectionRateLimit` | `object` | No | Rate limit in Pack settings. | | `logo` | `object` | No | Information about an image file for an update Pack request. | | `cover` | `object` | No | Information about an image file for an update Pack request. | | `exampleImages` | `object[]` | No | The example images for the Pack. | | `agentImages` | `object[]` | No | The agent images for the Pack. | | `sourceCodeVisibility` | `private \| shared` | No | Visibility of a Pack's source code. | | `packEntrypoints` | `go \| docs[]` | No | Pack entrypoints where this Pack is available | | `name` | `string` | No | The name of the Pack. | | `description` | `string` | No | The full description of the Pack. | | `shortDescription` | `string` | No | A short version of the description of the Pack. | | `agentShortDescription` | `string` | No | A short description for the Pack as an agent. | | `agentDescription` | `string` | No | A full description for the Pack as an agent. | | `supportEmail` | `string` | No | A contact email for the Pack. | | `termsOfServiceUrl` | `string` | No | A Terms of Service URL for the Pack. | | `privacyPolicyUrl` | `string` | No | A Privacy Policy URL for the Pack. | > **overallRateLimit full type** > > ```ts theme={null} > { > intervalSeconds: number, > operationsPerInterval: number > } > ``` > **perConnectionRateLimit full type** > > ```ts theme={null} > { > intervalSeconds: number, > operationsPerInterval: number > } > ``` > **logo full type** > > ```ts theme={null} > { > assetId: string, > filename: string, > mimeType?: string > } > ``` > **cover full type** > > ```ts theme={null} > { > assetId: string, > filename: string, > mimeType?: string > } > ``` > **exampleImages full type** > > ```ts theme={null} > { > assetId: string, > filename: string, > mimeType?: string > }[] > ``` > **agentImages full type** > > ```ts theme={null} > { > assetId: string, > filename: string, > mimeType?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `logoUrl` | `string` | No | — | | `coverUrl` | `string` | No | — | | `exampleImages` | `object[]` | No | — | | `agentImages` | `object[]` | No | — | | `workspaceId` | `string` | Yes | — | | `categories` | `object[]` | Yes | — | | `certified` | `boolean` | No | — | | `certifiedAgent` | `boolean` | No | — | | `sourceCodeVisibility` | `private \| shared` | No | — | | `packEntrypoints` | `go \| docs[]` | No | — | | `verifiedVersion` | `string` | No | — | | `name` | `string` | Yes | — | | `description` | `string` | Yes | — | | `shortDescription` | `string` | Yes | — | | `agentShortDescription` | `string` | No | — | | `agentDescription` | `string` | No | — | | `supportEmail` | `string` | No | — | | `termsOfServiceUrl` | `string` | No | — | | `privacyPolicyUrl` | `string` | No | — | | `overallRateLimit` | `object` | No | — | | `perConnectionRateLimit` | `object` | No | — | | `featuredDocStatus` | `docInaccessibleOrDoesNotExist \| invalidPublishedDocUrl` | No | — | | `additionalInformation` | `object` | No | — | > **exampleImages full type** > > ```ts theme={null} > { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[] > ``` > **agentImages full type** > > ```ts theme={null} > { > filename: string, > imageUrl: string, > assetId: string, > altText?: string, > mimeType?: string > }[] > ``` > **categories full type** > > ```ts theme={null} > { > categoryId: string, > categoryName: string, > categorySlug?: string > }[] > ``` > **overallRateLimit full type** > > ```ts theme={null} > { > intervalSeconds: number, > operationsPerInterval: number > } > ``` > **perConnectionRateLimit full type** > > ```ts theme={null} > { > intervalSeconds: number, > operationsPerInterval: number > } > ``` > **additionalInformation full type** > > ```ts theme={null} > { > privacyCollectsPersonalInfo?: boolean | null, > privacyPersonalInfoCategories?: string[] | null, > privacyDataUsagePurposes?: string[] | null, > privacyDataCollectedBy?: string[] | null > } > ``` *** ## Pack Versions ### getDiff `packVersions.getDiff` Get the differences between two Pack versions **Risk:** `read` ```ts theme={null} await corsair.coda.api.packVersions.getDiff({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `basePackVersion` | `string` | Yes | Semantic version of the previous Pack version. | | `targetPackVersion` | `string` | Yes | Semantic version of the new Pack version. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `findings` | `string[]` | Yes | — | | `findingDetails` | `object[]` | Yes | — | > **findingDetails full type** > > ```ts theme={null} > { > finding: string, > path: string > }[] > ``` *** ### getNext `packVersions.getNext` Get the next valid version number for a Pack **Risk:** `write` ```ts theme={null} await corsair.coda.api.packVersions.getNext({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `proposedMetadata` | `string` | No | The metadata for the next version of the Pack. | | `sdkVersion` | `string` | No | The SDK version the metadata was built on. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nextVersion` | `string` | Yes | — | | `findings` | `string[]` | Yes | — | | `findingDetails` | `object[]` | Yes | — | > **findingDetails full type** > > ```ts theme={null} > { > finding: string, > path: string > }[] > ``` *** ### getSourceCode `packVersions.getSourceCode` Get download URLs for the source code of a Pack version **Risk:** `read` ```ts theme={null} await corsair.coda.api.packVersions.getSourceCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `packVersion` | `string` | Yes | Semantic version of a Pack | **Output** | Name | Type | Required | Description | | - | - | - | - | | `files` | `object[]` | Yes | — | > **files full type** > > ```ts theme={null} > { > filename: string, > url: string > }[] > ``` *** ### list `packVersions.list` List the versions of a Pack **Risk:** `read` ```ts theme={null} await corsair.coda.api.packVersions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `creationUsers` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > packId: number, > buildNotes: string, > createdAt: string, > creationUserLoginId: string, > releaseId?: number, > packVersion: string, > sdkVersion?: string, > source?: web | cli > }[] > ``` > **creationUsers full type** > > ```ts theme={null} > { > name: string, > loginId: string, > type: user, > pictureLink?: string > }[] > ``` *** ### register `packVersions.register` Register a new Pack version and get an upload URL for its bundle **Risk:** `write` ```ts theme={null} await corsair.coda.api.packVersions.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `packVersion` | `string` | Yes | Semantic version of a Pack | | `bundleHash` | `string` | Yes | The SHA-256 hash of the file to be uploaded. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uploadUrl` | `string` | Yes | — | | `headers` | `object` | Yes | — | > **headers full type** > > ```ts theme={null} > { > } > ``` *** ### sourceCodeUploadComplete `packVersions.sourceCodeUploadComplete` Mark the upload of Pack source code as complete **Risk:** `write` ```ts theme={null} await corsair.coda.api.packVersions.sourceCodeUploadComplete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `packVersion` | `string` | Yes | Semantic version of a Pack | | `filename` | `string` | Yes | — | | `codeHash` | `string` | Yes | A SHA-256 hash of the source code used to identify duplicate uploads. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | *** ### uploadComplete `packVersions.uploadComplete` Mark the upload of a Pack version bundle as complete **Risk:** `write` ```ts theme={null} await corsair.coda.api.packVersions.uploadComplete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `packVersion` | `string` | Yes | Semantic version of a Pack | | `notes` | `string` | No | Developer notes of the new Pack version. | | `source` | `web \| cli` | No | — | | `allowOlderSdkVersion` | `boolean` | No | Bypass the Coda protection against SDK version regression when multiple makers build versions. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deprecationWarnings` | `object[]` | No | — | > **deprecationWarnings full type** > > ```ts theme={null} > { > path: string, > message: string > }[] > ``` *** ### uploadSourceCode `packVersions.uploadSourceCode` Get a signed URL to upload the source code of a Pack version **Risk:** `write` ```ts theme={null} await corsair.coda.api.packVersions.uploadSourceCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `packId` | `number` | Yes | ID of a Pack | | `payloadHash` | `string` | Yes | The SHA-256 hash of the image to be uploaded. | | `filename` | `string` | Yes | — | | `packVersion` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uploadUrl` | `string` | Yes | — | | `uploadedPathName` | `string` | Yes | — | | `headers` | `object` | Yes | — | > **headers full type** > > ```ts theme={null} > { > } > ``` *** ## Pages ### beginExport `pages.beginExport` Start an asynchronous export of page content **Risk:** `write` ```ts theme={null} await corsair.coda.api.pages.beginExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `pageIdOrName` | `string` | Yes | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected. | | `outputFormat` | `html \| markdown` | Yes | Supported output content formats that can be requested for getting content for an existing page. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `href` | `string` | Yes | — | *** ### create `pages.create` Create a new page in a doc **Risk:** `write` ```ts theme={null} await corsair.coda.api.pages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `name` | `string` | No | Name of the page. | | `subtitle` | `string` | No | Subtitle of the page. | | `iconName` | `string` | No | Name of the icon. | | `imageUrl` | `string` | No | Url of the cover image to use. | | `parentPageId` | `string` | No | The ID of this new page's parent, if creating a subpage. | | `pageContent` | `object` | No | Content that can be added to a page at creation time, either text (or rich text) or a URL to create a full-page embed. | > **pageContent full type** > > ```ts theme={null} > { > type: canvas, > canvasContent: { > format: html | markdown, > content: string > } > } | { > type: embed, > url: string, > renderMethod?: compatibility | standard > } | { > type: syncPage, > mode: page, > includeSubpages: boolean, > sourcePageId: string, > sourceDocId: string > } | { > type: syncPage, > mode: document, > sourceDocId: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `id` | `string` | Yes | — | *** ### delete `pages.delete` Delete a page **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.pages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `pageIdOrName` | `string` | Yes | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `id` | `string` | Yes | — | *** ### deleteContent `pages.deleteContent` Delete content elements from a page **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.pages.deleteContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `pageIdOrName` | `string` | Yes | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected. | | `elementIds` | `string[]` | No | IDs of the elements to delete from the page. If omitted or empty, all content will be deleted. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `id` | `string` | Yes | — | *** ### get `pages.get` Get details about a page **Risk:** `read` ```ts theme={null} await corsair.coda.api.pages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `pageIdOrName` | `string` | Yes | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `page` | Yes | — | | `href` | `string` | Yes | — | | `browserLink` | `string` | Yes | — | | `name` | `string` | Yes | — | | `subtitle` | `string` | No | — | | `icon` | `object` | No | — | | `image` | `object` | No | — | | `contentType` | `canvas \| embed \| syncPage` | Yes | — | | `isHidden` | `boolean` | Yes | — | | `isEffectivelyHidden` | `boolean` | Yes | — | | `parent` | `object` | No | — | | `children` | `object[]` | Yes | — | | `authors` | `object[]` | No | — | | `createdAt` | `string` | No | — | | `createdBy` | `object` | No | — | | `updatedAt` | `string` | No | — | | `updatedBy` | `object` | No | — | > **icon full type** > > ```ts theme={null} > { > name: string, > type: string, > browserLink: string > } > ``` > **image full type** > > ```ts theme={null} > { > browserLink: string, > type?: string, > width?: number, > height?: number > } > ``` > **parent full type** > > ```ts theme={null} > { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > ``` > **children full type** > > ```ts theme={null} > { > id: string, > type: page, > href: string, > browserLink: string, > name: string > }[] > ``` > **authors full type** > > ```ts theme={null} > { > @context: string, > @type: Person, > additionalType?: string, > name: string, > email?: string > }[] > ``` > **createdBy full type** > > ```ts theme={null} > { > @context: string, > @type: Person, > additionalType?: string, > name: string, > email?: string > } > ``` > **updatedBy full type** > > ```ts theme={null} > { > @context: string, > @type: Person, > additionalType?: string, > name: string, > email?: string > } > ``` *** ### getExportStatus `pages.getExportStatus` Check the status of a page content export **Risk:** `read` ```ts theme={null} await corsair.coda.api.pages.getExportStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `pageIdOrName` | `string` | Yes | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected. | | `requestId` | `string` | Yes | ID of the request. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `href` | `string` | Yes | — | | `downloadLink` | `string` | No | — | | `error` | `string` | No | — | *** ### list `pages.list` List pages in a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.pages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: page, > href: string, > browserLink: string, > name: string, > subtitle?: string, > icon?: { > name: string, > type: string, > browserLink: string > }, > image?: { > browserLink: string, > type?: string, > width?: number, > height?: number > }, > contentType: canvas | embed | syncPage, > isHidden: boolean, > isEffectivelyHidden: boolean, > parent?: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > }, > children: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > }[], > authors?: { > @context: string, > @type: Person, > additionalType?: string, > name: string, > email?: string > }[], > createdAt?: string, > createdBy?: { > @context: string, > @type: Person, > additionalType?: string, > name: string, > email?: string > }, > updatedAt?: string, > updatedBy?: { > @context: string, > @type: Person, > additionalType?: string, > name: string, > email?: string > } > }[] > ``` *** ### listContent `pages.listContent` List the content elements of a page **Risk:** `read` ```ts theme={null} await corsair.coda.api.pages.listContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `pageIdOrName` | `string` | Yes | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected. | | `limit` | `number` | No | Maximum number of content items to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `contentFormat` | `plainText` | No | The format to return content in. Defaults to plainText. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: line, > itemContent?: { > style: blockQuote | bulletedList | checkboxList | code | collapsibleList | h1 | h2 | h3 | numberedList | paragraph | pullQuote, > format: plainText, > content: string, > lineLevel?: number > } > }[] > ``` *** ### update `pages.update` Update the properties or content of a page **Risk:** `write` ```ts theme={null} await corsair.coda.api.pages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `pageIdOrName` | `string` | Yes | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected. | | `name` | `string` | No | Name of the page. | | `subtitle` | `string` | No | Subtitle of the page. | | `iconName` | `string` | No | Name of the icon. | | `imageUrl` | `string` | No | Url of the cover image to use. | | `isHidden` | `boolean` | No | Whether the page is hidden or not. Note that for pages that cannot be hidden, like the sole top-level page in a doc, this will be ignored. | | `contentUpdate` | `object` | No | — | > **contentUpdate full type** > > ```ts theme={null} > { > insertionMode: append | prepend | replace, > elementId?: string, > canvasContent: { > format: html | markdown, > content: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `id` | `string` | Yes | — | *** ## Permissions ### add `permissions.add` Share a doc with a user, domain or anyone **Risk:** `write` ```ts theme={null} await corsair.coda.api.permissions.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `access` | `readonly \| write \| comment` | Yes | Type of access (excluding none). | | `principal` | `object` | Yes | Metadata about a principal to add to a doc. | | `suppressEmail` | `boolean` | No | When true suppresses email notification | > **principal full type** > > ```ts theme={null} > { > type: email, > email: string > } | { > type: group, > groupId: string > } | { > type: domain, > domain: string > } | { > type: workspace, > workspaceId: string > } | { > type: anyone > } > ``` **Output:** *empty object* *** ### delete `permissions.delete` Remove a sharing permission from a doc **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.permissions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `permissionId` | `string` | Yes | ID of a permission on a doc. | **Output:** *empty object* *** ### getAclSettings `permissions.getAclSettings` Get the access control settings of a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.permissions.getAclSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `allowEditorsToChangePermissions` | `boolean` | Yes | — | | `allowCopying` | `boolean` | Yes | — | | `allowViewersToRequestEditing` | `boolean` | Yes | — | *** ### getSharingMetadata `permissions.getSharingMetadata` Get sharing capabilities of the user for a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.permissions.getSharingMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `canShare` | `boolean` | Yes | — | | `canShareWithWorkspace` | `boolean` | Yes | — | | `canShareWithOrg` | `boolean` | Yes | — | | `canCopy` | `boolean` | Yes | — | *** ### list `permissions.list` List the sharing permissions of a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.permissions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > principal: { > type: email, > email: string > } | { > type: group, > groupId: string, > groupName: string > } | { > type: domain, > domain: string > } | { > type: workspace, > workspaceId: string > } | { > type: anyone > } | { > type: internalAccess, > internalAccessType: string > }, > id: string, > access: readonly | write | comment | none > }[] > ``` *** ### searchPrincipals `permissions.searchPrincipals` Search users and groups a doc can be shared with **Risk:** `read` ```ts theme={null} await corsair.coda.api.permissions.searchPrincipals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `query` | `string` | No | Search term used to filter down results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | | `groups` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > name: string, > loginId: string, > type: user, > pictureLink?: string > }[] > ``` > **groups full type** > > ```ts theme={null} > { > type: group, > groupId: string, > groupName: string > }[] > ``` *** ### updateAclSettings `permissions.updateAclSettings` Update the access control settings of a doc **Risk:** `write` ```ts theme={null} await corsair.coda.api.permissions.updateAclSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `allowEditorsToChangePermissions` | `boolean` | No | When true, allows editors to change doc permissions. When false, only doc owner can change doc permissions. | | `allowCopying` | `boolean` | No | When true, allows doc viewers to copy the doc. | | `allowViewersToRequestEditing` | `boolean` | No | When true, allows doc viewers to request editing permissions. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `allowEditorsToChangePermissions` | `boolean` | Yes | — | | `allowCopying` | `boolean` | Yes | — | | `allowViewersToRequestEditing` | `boolean` | Yes | — | *** ## Rows ### delete `rows.delete` Delete a row from a table **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.rows.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `rowIdOrName` | `string` | Yes | ID or name of the row. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If there are multiple rows with the same value in the identifying column, an arbitrary one will be selected. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `id` | `string` | Yes | — | *** ### deleteMany `rows.deleteMany` Delete several rows from a table **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.coda.api.rows.deleteMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `rowIds` | `string[]` | Yes | Row IDs to delete. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `rowIds` | `string[]` | Yes | — | *** ### get `rows.get` Get a row in a table **Risk:** `read` ```ts theme={null} await corsair.coda.api.rows.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `rowIdOrName` | `string` | Yes | ID or name of the row. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If there are multiple rows with the same value in the identifying column, an arbitrary one will be selected. | | `useColumnNames` | `boolean` | No | Use column names instead of column IDs in the returned output. This is generally discouraged as it is fragile. If columns are renamed, code using original names may throw errors. | | `valueFormat` | `simple \| simpleWithArrays \| rich` | No | The format that cell values are returned as. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `row` | Yes | — | | `href` | `string` | Yes | — | | `name` | `string` | Yes | — | | `index` | `number` | Yes | — | | `browserLink` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | | `values` | `object` | Yes | — | | `parent` | `object` | Yes | — | > **values full type** > > ```ts theme={null} > { > } > ``` > **parent full type** > > ```ts theme={null} > { > id: string, > type: table, > tableType: table | view | database, > href: string, > browserLink: string, > name: string, > parent?: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > } > ``` *** ### list `rows.list` List rows in a table **Risk:** `read` ```ts theme={null} await corsair.coda.api.rows.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `query` | `string` | No | Query used to filter returned rows, specified as `:`. If you'd like to use a column name instead of an ID, you must quote it (e.g., `"My Column":123`). Also note that `value` is a JSON value; if you'd like to use a string, you must surround it in quotes (e.g., `"groceries"`). | | `sortBy` | `createdAt \| natural \| updatedAt` | No | Specifies the sort order of the rows returned. If left unspecified, rows are returned by creation time ascending. "UpdatedAt" sort ordering is the order of rows based upon when they were last updated. This does not include updates to calculated values. "Natural" sort ordering is the order that the rows appear in the table view in the application. This ordering is only meaningfully defined for rows that are visible (unfiltered). Because of this, using this sort order will imply visibleOnly=true, that is, to only return visible rows. If you pass sortBy=natural and visibleOnly=false explicitly, this will result in a Bad Request error as this condition cannot be satisfied. | | `useColumnNames` | `boolean` | No | Use column names instead of column IDs in the returned output. This is generally discouraged as it is fragile. If columns are renamed, code using original names may throw errors. | | `valueFormat` | `simple \| simpleWithArrays \| rich` | No | The format that cell values are returned as. | | `visibleOnly` | `boolean` | No | If true, returns only visible rows and columns for the table. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `syncToken` | `string` | No | An opaque token returned from a previous call that can be used to return results that are relevant to the query since the call where the syncToken was generated. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | | `nextSyncToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: row, > href: string, > name: string, > index: number, > browserLink: string, > createdAt: string, > updatedAt: string, > values: { > } > }[] > ``` *** ### pushButton `rows.pushButton` Push a button column in a row **Risk:** `write` ```ts theme={null} await corsair.coda.api.rows.pushButton({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `rowIdOrName` | `string` | Yes | ID or name of the row. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If there are multiple rows with the same value in the identifying column, an arbitrary one will be selected. | | `columnIdOrName` | `string` | Yes | ID or name of the column. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `rowId` | `string` | Yes | — | | `columnId` | `string` | Yes | — | *** ### update `rows.update` Update a row in a table **Risk:** `write` ```ts theme={null} await corsair.coda.api.rows.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `rowIdOrName` | `string` | Yes | ID or name of the row. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If there are multiple rows with the same value in the identifying column, an arbitrary one will be selected. | | `disableParsing` | `boolean` | No | If true, the API will not attempt to parse the data in any way. | | `row` | `object` | Yes | An edit made to a particular row. | > **row full type** > > ```ts theme={null} > { > cells: { > column: string, > value: string | number | boolean | ( > string | number | boolean | ( > string | number | boolean > )[] > )[] > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `id` | `string` | Yes | — | *** ### upsert `rows.upsert` Insert rows into a table, or update them when key columns match **Risk:** `write` ```ts theme={null} await corsair.coda.api.rows.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `disableParsing` | `boolean` | No | If true, the API will not attempt to parse the data in any way. | | `rows` | `object[]` | Yes | — | | `keyColumns` | `string[]` | No | Optional column IDs, URLs, or names (fragile and discouraged), specifying columns to be used as upsert keys. | > **rows full type** > > ```ts theme={null} > { > cells: { > column: string, > value: string | number | boolean | ( > string | number | boolean | ( > string | number | boolean > )[] > )[] > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `addedRowIds` | `string[]` | No | — | *** ## Tables ### get `tables.get` Get details about a table or view **Risk:** `read` ```ts theme={null} await corsair.coda.api.tables.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `tableIdOrName` | `string` | Yes | ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. | | `useUpdatedTableLayouts` | `boolean` | No | Return "detail" and "form" for the `layout` field of detail and form layouts respectively (instead of "masterDetail" for both) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `table` | Yes | — | | `tableType` | `table \| view \| database` | Yes | — | | `href` | `string` | Yes | — | | `browserLink` | `string` | Yes | — | | `name` | `string` | Yes | — | | `parent` | `object` | Yes | — | | `parentTable` | `object` | No | — | | `displayColumn` | `object` | Yes | — | | `rowCount` | `number` | Yes | — | | `sorts` | `object[]` | Yes | — | | `layout` | `default \| areaChart \| barChart \| bubbleChart \| calendar \| card \| detail \| form \| ganttChart \| lineChart \| masterDetail \| pieChart \| scatterChart \| slide \| wordCloud` | Yes | — | | `filter` | `object` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **parent full type** > > ```ts theme={null} > { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > ``` > **parentTable full type** > > ```ts theme={null} > { > id: string, > type: table, > tableType: table | view | database, > href: string, > browserLink: string, > name: string, > parent?: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > } > ``` > **displayColumn full type** > > ```ts theme={null} > { > id: string, > type: column, > href: string > } > ``` > **sorts full type** > > ```ts theme={null} > { > column: { > id: string, > type: column, > href: string > }, > direction: ascending | descending > }[] > ``` > **filter full type** > > ```ts theme={null} > { > valid: boolean, > isVolatile?: boolean, > hasUserFormula?: boolean, > hasTodayFormula?: boolean, > hasNowFormula?: boolean > } > ``` *** ### list `tables.list` List tables and views in a doc **Risk:** `read` ```ts theme={null} await corsair.coda.api.tables.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `docId` | `string` | Yes | ID of the doc. | | `limit` | `number` | No | Maximum number of results to return in this query. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | | `sortBy` | `name` | No | Determines how to sort the given objects. | | `tableTypes` | `table \| view \| database[]` | No | Comma-separated list of table types to include in results. If omitted, includes tables, views, and databases. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `href` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: table, > tableType: table | view | database, > href: string, > browserLink: string, > name: string, > parent?: { > id: string, > type: page, > href: string, > browserLink: string, > name: string > } > }[] > ``` *** ## Workspaces ### changeUserRole `workspaces.changeUserRole` Change the role of a workspace member **Risk:** `write` ```ts theme={null} await corsair.coda.api.workspaces.changeUserRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | ID of the workspace. | | `email` | `string` | Yes | Email of the user. | | `newRole` | `Admin \| DocMaker \| Editor` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `roleChangedAt` | `string` | Yes | — | *** ### listRoles `workspaces.listRoles` List user counts by role over time for a workspace **Risk:** `read` ```ts theme={null} await corsair.coda.api.workspaces.listRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | ID of the workspace. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > month: string, > activeAdminCount: number, > activeDocMakerCount: number, > activeEditorCount: number, > inactiveAdminCount: number, > inactiveDocMakerCount: number, > inactiveEditorCount: number > }[] > ``` *** ### listUsers `workspaces.listUsers` List members of a workspace **Risk:** `read` ```ts theme={null} await corsair.coda.api.workspaces.listUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | ID of the workspace. | | `includedRoles` | `Admin \| DocMaker \| Editor[]` | No | Show only the members that match the included roles. Multiple roles can be specified with a comma-delimited list. | | `pageToken` | `string` | No | An opaque token used to fetch the next page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | | `nextPageLink` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > email: string, > name: string, > role: Admin | DocMaker | Editor, > pictureUrl?: string, > registeredAt: string, > roleChangedAt?: string, > lastActiveAt?: string, > ownedDocs?: number, > docsLastActiveAt?: string, > docCollaboratorCount?: number, > totalDocs?: number, > totalDocsLastActiveAt?: string, > totalDocCollaboratorsLast90Days?: number > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/coda/database Coda local sync: searchable entities, `.search()` filters, and operators. The Coda plugin syncs data locally. Use `corsair.coda.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Columns Path: `coda.db.columns.search` ```ts theme={null} const rows = await corsair.coda.db.columns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `display` | `boolean` | equals | | `calculated` | `boolean` | equals | | `formula` | `string` | equals, contains, startsWith, endsWith, in | | `defaultValue` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Controls Path: `coda.db.controls.search` ```ts theme={null} const rows = await corsair.coda.db.controls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `controlType` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Documents Path: `coda.db.documents.search` ```ts theme={null} const rows = await corsair.coda.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `browserLink` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `owner` | `string` | equals, contains, startsWith, endsWith, in | | `ownerName` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `folderId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Folders Path: `coda.db.folders.search` ```ts theme={null} const rows = await corsair.coda.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `browserLink` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `iconColor` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `canEdit` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Formulas Path: `coda.db.formulas.search` ```ts theme={null} const rows = await corsair.coda.db.formulas.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Packs Path: `coda.db.packs.search` ```ts theme={null} const rows = await corsair.coda.db.packs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `logoUrl` | `string` | equals, contains, startsWith, endsWith, in | | `coverUrl` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `certified` | `boolean` | equals | | `certifiedAgent` | `boolean` | equals | | `sourceCodeVisibility` | `string` | equals, contains, startsWith, endsWith, in | | `verifiedVersion` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `shortDescription` | `string` | equals, contains, startsWith, endsWith, in | | `agentShortDescription` | `string` | equals, contains, startsWith, endsWith, in | | `agentDescription` | `string` | equals, contains, startsWith, endsWith, in | | `supportEmail` | `string` | equals, contains, startsWith, endsWith, in | | `termsOfServiceUrl` | `string` | equals, contains, startsWith, endsWith, in | | `privacyPolicyUrl` | `string` | equals, contains, startsWith, endsWith, in | | `featuredDocStatus` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pages Path: `coda.db.pages.search` ```ts theme={null} const rows = await corsair.coda.db.pages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `browserLink` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subtitle` | `string` | equals, contains, startsWith, endsWith, in | | `contentType` | `string` | equals, contains, startsWith, endsWith, in | | `isHidden` | `boolean` | equals | | `isEffectivelyHidden` | `boolean` | equals | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Rows Path: `coda.db.rows.search` ```ts theme={null} const rows = await corsair.coda.db.rows.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `index` | `number` | equals, gt, gte, lt, lte, in | | `browserLink` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tables Path: `coda.db.tables.search` ```ts theme={null} const rows = await corsair.coda.db.tables.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `tableType` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `browserLink` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `rowCount` | `number` | equals, gt, gte, lt, lte, in | | `layout` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/coda/overview All-in-one doc for teams that combines pages, tables, automations and Packs. Use **Coda** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 110 typed API operations * 9 synced entities (`columns`, `controls`, `documents`, `folders`, `formulas`, `packs`, and 3 more) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/coda ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/coda ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/coda ``` ```bash bun theme={null} bun add corsair @corsair-dev/coda ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { coda } from '@corsair-dev/coda'; export const corsair = createCorsair({ plugins: [ coda(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} coda() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'coda', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List docs** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.coda.api.docs.list({}); ``` **Insert rows into a table** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.coda.api.rows.upsert({ docId: 'AbCDeFGH', tableIdOrName: 'Tasks', rows: [{ cells: [{ column: 'Name', value: 'Ship the launch plan' }], }], }); ``` See the full list on the [API](/plugins/coda/api) page. ## Query synced data Search synced Coda docs without hitting the API. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.coda.db.documents.search({ data: {}, limit: 50, }); ``` Synced entities: `columns`, `controls`, `documents`, `folders`, `formulas`, `packs`, `pages`, `rows`, `tables`. See [Database](/plugins/coda/database) for filters and operators. ## Webhooks Fires when a doc is created or copied in your Coda organization (Admin API audit webhook, Enterprise plan). ```ts theme={null} coda({ webhookHooks: { docs: { created: { after: async (ctx, result) => { console.log('Coda docs created:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/coda/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/coda/api)** > > Every `coda.api.*` operation with input and output types. > **[Database](/plugins/coda/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/coda/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/coda/webhooks Coda incoming webhooks: event paths, payloads, and response data. The Coda plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/coda/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `docs` * `created` (`docs.created`) * `deleted` (`docs.deleted`) * `pages` * `created` (`pages.created`) * `updated` (`pages.updated`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Docs ### Created `docs.created` A doc was created or copied in the organization **Payload** | Name | Type | Required | Description | | - | - | - | - | | `events` | `object[]` | Yes | — | > **events full type** > > ```ts theme={null} > { > eventId: string, > timestamp: number, > action: string, > result: string, > organizationId: string, > user: { > type: user, > id: number, > email: string > }, > userContext: { > source: string > }, > eventDetails?: { > }, > entity: { > type: string > } > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > events: { > eventId: string, > timestamp: number, > action: string, > result: string, > organizationId: string, > user: { > type: user, > id: number, > email: string > }, > userContext: { > source: string > }, > eventDetails?: { > }, > entity: { > type: doc, > doc: { > id: string, > type: doc, > docType: string, > name: string, > href: string, > browserLink: string, > folderId: string, > workspaceId: string, > owner?: string, > ownerName?: string, > createdAt?: string, > updatedAt?: string, > isDeleted?: boolean > } > } > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} coda({ webhookHooks: { docs: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `docs.deleted` A doc was deleted in the organization **Payload** | Name | Type | Required | Description | | - | - | - | - | | `events` | `object[]` | Yes | — | > **events full type** > > ```ts theme={null} > { > eventId: string, > timestamp: number, > action: string, > result: string, > organizationId: string, > user: { > type: user, > id: number, > email: string > }, > userContext: { > source: string > }, > eventDetails?: { > }, > entity: { > type: string > } > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > events: { > eventId: string, > timestamp: number, > action: string, > result: string, > organizationId: string, > user: { > type: user, > id: number, > email: string > }, > userContext: { > source: string > }, > eventDetails?: { > }, > entity: { > type: doc, > doc: { > id: string, > type: doc, > docType: string, > name: string, > href: string, > browserLink: string, > folderId: string, > workspaceId: string, > owner?: string, > ownerName?: string, > createdAt?: string, > updatedAt?: string, > isDeleted?: boolean > } > } > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} coda({ webhookHooks: { docs: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Pages ### Created `pages.created` A page was added to a doc **Payload** | Name | Type | Required | Description | | - | - | - | - | | `events` | `object[]` | Yes | — | > **events full type** > > ```ts theme={null} > { > eventId: string, > timestamp: number, > action: string, > result: string, > organizationId: string, > user: { > type: user, > id: number, > email: string > }, > userContext: { > source: string > }, > eventDetails?: { > }, > entity: { > type: string > } > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > events: { > eventId: string, > timestamp: number, > action: string, > result: string, > organizationId: string, > user: { > type: user, > id: number, > email: string > }, > userContext: { > source: string > }, > eventDetails?: { > }, > entity: { > type: page, > page: { > id: string, > type: page, > name: string, > href: string, > browserLink: string, > subtitle?: string > } > } > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} coda({ webhookHooks: { pages: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `pages.updated` A page in a doc was edited, renamed or moved **Payload** | Name | Type | Required | Description | | - | - | - | - | | `events` | `object[]` | Yes | — | > **events full type** > > ```ts theme={null} > { > eventId: string, > timestamp: number, > action: string, > result: string, > organizationId: string, > user: { > type: user, > id: number, > email: string > }, > userContext: { > source: string > }, > eventDetails?: { > }, > entity: { > type: string > } > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > events: { > eventId: string, > timestamp: number, > action: string, > result: string, > organizationId: string, > user: { > type: user, > id: number, > email: string > }, > userContext: { > source: string > }, > eventDetails?: { > }, > entity: { > type: page, > page: { > id: string, > type: page, > name: string, > href: string, > browserLink: string, > subtitle?: string > } > } > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} coda({ webhookHooks: { pages: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/codeinterpreter/api API reference for CodeInterpreter: every `codeinterpreter.api.*` operation with input and output types. Every `codeinterpreter.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Code ### execute `code.execute` Execute code in the sandbox **Risk:** `write` ```ts theme={null} await corsair.codeinterpreter.api.code.execute({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `language` | `string` | No | — | | `session_id` | `string` | No | — | | `args` | `string[]` | No | — | | `files` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exit_code` | `number` | Yes | — | | `stdout` | `string` | No | — | | `stderr` | `string` | No | — | | `logs` | `string` | No | — | | `output_files` | `object[]` | No | — | | `session_id` | `string` | No | — | > **output\_files full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ## File ### delete `file.delete` Delete a file from the sandbox **Risk:** `destructive` ```ts theme={null} await corsair.codeinterpreter.api.file.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `session_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `file_id` | `string` | Yes | — | *** ### download `file.download` Download a file from the sandbox **Risk:** `read` ```ts theme={null} await corsair.codeinterpreter.api.file.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `session_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `filename` | `string` | No | — | | `content` | `string` | Yes | — | | `mime_type` | `string` | No | — | *** ### list `file.list` List files in the sandbox **Risk:** `read` ```ts theme={null} await corsair.codeinterpreter.api.file.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `files` | `object[]` | Yes | — | > **files full type** > > ```ts theme={null} > { > id: string, > name: string, > size?: number, > mime_type?: string > }[] > ``` *** ### upload `file.upload` Upload a file to the sandbox **Risk:** `write` ```ts theme={null} await corsair.codeinterpreter.api.file.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | Yes | — | | `content` | `string` | Yes | — | | `content_encoding` | `utf8 \| base64` | No | — | | `session_id` | `string` | No | — | | `mime_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `filename` | `string` | Yes | — | | `size` | `number` | No | — | | `session_id` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/codeinterpreter/database CodeInterpreter local sync: searchable entities, `.search()` filters, and operators. The CodeInterpreter plugin syncs data locally. Use `corsair.codeinterpreter.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Executions Path: `codeinterpreter.db.executions.search` ```ts theme={null} const rows = await corsair.codeinterpreter.db.executions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `exit_code` | `number` | equals, gt, gte, lt, lte, in | | `stdout` | `string` | equals, contains, startsWith, endsWith, in | | `stderr` | `string` | equals, contains, startsWith, endsWith, in | | `logs` | `string` | equals, contains, startsWith, endsWith, in | | `session_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `codeinterpreter.db.files.search` ```ts theme={null} const rows = await corsair.codeinterpreter.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `mime_type` | `string` | equals, contains, startsWith, endsWith, in | | `session_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sessions Path: `codeinterpreter.db.sessions.search` ```ts theme={null} const rows = await corsair.codeinterpreter.db.sessions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/codeinterpreter/overview CodeInterpreter plugin for Corsair Use **CodeInterpreter** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 3 synced entities (`executions`, `files`, `sessions`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/codeinterpreter ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/codeinterpreter ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/codeinterpreter ``` ```bash bun theme={null} bun add corsair @corsair-dev/codeinterpreter ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { codeinterpreter } from '@corsair-dev/codeinterpreter'; export const corsair = createCorsair({ plugins: [ codeinterpreter(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} codeinterpreter() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'codeinterpreter', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`file.download`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.codeinterpreter.api.file.download({}); ``` **`code.execute`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.codeinterpreter.api.code.execute({}); ``` See the full list on the [API](/plugins/codeinterpreter/api) page. ## Query synced data Synced entities support `tenant.codeinterpreter.db..search()` and `.list()`: `executions`, `files`, `sessions`. See [Database](/plugins/codeinterpreter/database) for filters and operators. ## What's next > **[API reference](/plugins/codeinterpreter/api)** > > Every `codeinterpreter.api.*` operation with input and output types. > **[Database](/plugins/codeinterpreter/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/cody/api API reference for Cody: every `cody.api.*` operation with input and output types. Every `cody.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Bots ### list `bots.list` Get all bots with optional keyword filtering **Risk:** `read` ```ts theme={null} await corsair.cody.api.bots.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Keyword to filter bots by name | | `keyword` | `string` | No | Keyword to filter bots by name | | `page` | `number` | No | Page number for pagination | | `per_page` | `number` | No | Number of items per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > model?: string, > created_at?: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > total?: number, > count?: number, > per_page?: number, > current_page?: number, > total_pages?: number, > links?: { > } > } > } > ``` *** ## Conversations ### create `conversations.create` Create a new conversation with a specified bot and optional focus mode documents **Risk:** `write` ```ts theme={null} await corsair.cody.api.conversations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the conversation | | `bot_id` | `string` | Yes | Bot ID to create the conversation with | | `document_ids` | `string[]` | No | Optional document IDs to limit bot focus to specific knowledge | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > bot_id: string, > created_at?: number, > document_ids?: string[] > } > ``` *** ### delete `conversations.delete` Delete a conversation by its ID **Risk:** `write` ```ts theme={null} await corsair.cody.api.conversations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the conversation to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `boolean \| null` | No | — | | `success` | `boolean` | No | — | *** ### get `conversations.get` Fetch a conversation by its ID from Cody AI **Risk:** `read` ```ts theme={null} await corsair.cody.api.conversations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the conversation | | `includes` | `string` | No | Extra attributes to include (e.g. document\_ids) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > bot_id: string, > created_at?: number, > document_ids?: string[] > } > ``` *** ### list `conversations.list` Get all conversations with optional filtering by bot, keyword, or includes **Risk:** `read` ```ts theme={null} await corsair.cody.api.conversations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Keyword to filter conversations by name | | `keyword` | `string` | No | Keyword to filter conversations by name | | `bot_id` | `string` | No | Filter conversations by bot ID | | `includes` | `string` | No | Extra attributes to include (e.g. document\_ids) | | `page` | `number` | No | Page number for pagination | | `per_page` | `number` | No | Number of items per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > bot_id: string, > created_at?: number, > document_ids?: string[] > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > total?: number, > count?: number, > per_page?: number, > current_page?: number, > total_pages?: number, > links?: { > } > } > } > ``` *** ### update `conversations.update` Update a conversation by its ID including name, bot\_id, and document\_ids **Risk:** `write` ```ts theme={null} await corsair.cody.api.conversations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the conversation | | `name` | `string` | No | Updated name for the conversation | | `bot_id` | `string` | No | Updated bot ID for the conversation | | `document_ids` | `string[]` | No | Updated document IDs for focus mode | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > bot_id: string, > created_at?: number, > document_ids?: string[] > } > ``` *** ## Documents ### create `documents.create` Create a new document with text or HTML content in Cody AI **Risk:** `write` ```ts theme={null} await corsair.cody.api.documents.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the document | | `content` | `string` | Yes | Text or HTML content of the document (up to 768 KB) | | `content_type` | `text/plain \| text/html` | Yes | MIME content type of the content body | | `folder_id` | `string` | No | Folder ID where the document should be stored | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > status?: string, > content_url?: string, > folder_id?: string | null, > created_at?: number > } > ``` *** ### createFromFile `documents.createFromFile` Create a document by uploading a file (up to 100 MB) **Risk:** `write` ```ts theme={null} await corsair.cody.api.documents.createFromFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | S3 storage key obtained from uploads.getSignedUrl | | `folder_id` | `string` | No | Folder ID where the document should be stored | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > status?: string, > content_url?: string, > folder_id?: string | null, > created_at?: number > } > ``` *** ### createFromWebpage `documents.createFromWebpage` Create a document from a publicly accessible webpage URL **Risk:** `write` ```ts theme={null} await corsair.cody.api.documents.createFromWebpage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Publicly accessible webpage URL to import | | `folder_id` | `string` | No | Folder ID where the document should be stored | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > status?: string, > content_url?: string, > folder_id?: string | null, > created_at?: number > } > ``` *** ### delete `documents.delete` Delete a document by id **Risk:** `write` ```ts theme={null} await corsair.cody.api.documents.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the document to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `boolean \| null` | No | — | | `success` | `boolean` | No | — | *** ### get `documents.get` Retrieve a specific document by its identifier from Cody AI **Risk:** `read` ```ts theme={null} await corsair.cody.api.documents.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the document | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > status?: string, > content_url?: string, > folder_id?: string | null, > created_at?: number > } > ``` *** ### list `documents.list` Retrieve all documents from Cody AI account with optional filtering **Risk:** `read` ```ts theme={null} await corsair.cody.api.documents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Keyword to filter documents by name | | `keyword` | `string` | No | Keyword to filter documents by name | | `folder_id` | `string` | No | Filter documents by folder ID | | `conversation_id` | `string` | No | Filter documents by conversation ID | | `page` | `number` | No | Page number for pagination | | `per_page` | `number` | No | Number of items per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > status?: string, > content_url?: string, > folder_id?: string | null, > created_at?: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > total?: number, > count?: number, > per_page?: number, > current_page?: number, > total_pages?: number, > links?: { > } > } > } > ``` *** ## Folders ### create `folders.create` Create a new folder in Cody AI for organizing content **Risk:** `write` ```ts theme={null} await corsair.cody.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the folder | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > created_at?: number > } > ``` *** ### get `folders.get` Retrieve a specific folder by its identifier **Risk:** `read` ```ts theme={null} await corsair.cody.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the folder | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > created_at?: number > } > ``` *** ### list `folders.list` Retrieve all folders with optional keyword filtering **Risk:** `read` ```ts theme={null} await corsair.cody.api.folders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Keyword to filter folders by name | | `keyword` | `string` | No | Keyword to filter folders by name | | `page` | `number` | No | Page number for pagination | | `per_page` | `number` | No | Number of items per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > created_at?: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > total?: number, > count?: number, > per_page?: number, > current_page?: number, > total_pages?: number, > links?: { > } > } > } > ``` *** ### update `folders.update` Update a folder by its ID **Risk:** `write` ```ts theme={null} await corsair.cody.api.folders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the folder to update | | `name` | `string` | Yes | New name for the folder | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > created_at?: number > } > ``` *** ## Messages ### get `messages.get` Fetch a specific message by its ID from Cody AI **Risk:** `read` ```ts theme={null} await corsair.cody.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier of the message | | `includes` | `string` | No | Extra message attributes to include (sources, usage) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > content: string, > conversation_id: string, > machine?: boolean, > failed_responding?: boolean, > flagged?: boolean, > created_at?: number, > sources?: { > data?: { > }[] > }, > usage?: { > tokens?: number, > credits?: number > } > } > ``` *** ### list `messages.list` Retrieve a paginated list of messages from Cody, optionally filtered by conversation **Risk:** `read` ```ts theme={null} await corsair.cody.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversation_id` | `string` | Yes | Conversation ID to retrieve messages for | | `includes` | `string` | No | Extra message attributes to include (sources, usage) | | `page` | `number` | No | Page number for pagination | | `per_page` | `number` | No | Number of items per page | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > content: string, > conversation_id: string, > machine?: boolean, > failed_responding?: boolean, > flagged?: boolean, > created_at?: number, > sources?: { > data?: { > }[] > }, > usage?: { > tokens?: number, > credits?: number > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > total?: number, > count?: number, > per_page?: number, > current_page?: number, > total_pages?: number, > links?: { > } > } > } > ``` *** ### send `messages.send` Send a message to Cody AI and receive an AI-generated response **Risk:** `write` ```ts theme={null} await corsair.cody.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversation_id` | `string` | Yes | Conversation ID to send the message in | | `content` | `string` | Yes | Text content of the message (up to 2000 characters) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > content: string, > conversation_id: string, > machine?: boolean, > failed_responding?: boolean, > flagged?: boolean, > created_at?: number, > sources?: { > data?: { > }[] > }, > usage?: { > tokens?: number, > credits?: number > } > } > ``` *** ### sendForStream `messages.sendForStream` Send a message to Cody AI and receive a Server-Sent Events (SSE) stream URL for the AI response **Risk:** `write` ```ts theme={null} await corsair.cody.api.messages.sendForStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversation_id` | `string` | Yes | Conversation ID to send the streaming message in | | `content` | `string` | Yes | Text content of the message (up to 2000 characters) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > stream_url: string > } > ``` *** ## Uploads ### getSignedUrl `uploads.getSignedUrl` Get an AWS S3 signed upload URL for file uploads **Risk:** `read` ```ts theme={null} await corsair.cody.api.uploads.getSignedUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_name` | `string` | Yes | Original file name with extension to upload (e.g. document.pdf) | | `content_type` | `string` | Yes | MIME content type of the file (e.g. application/pdf) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > url: string, > key: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/cody/database Cody local sync: searchable entities, `.search()` filters, and operators. The Cody plugin syncs data locally. Use `corsair.cody.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Bots Path: `cody.db.bots.search` ```ts theme={null} const rows = await corsair.cody.db.bots.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Conversations Path: `cody.db.conversations.search` ```ts theme={null} const rows = await corsair.cody.db.conversations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `bot_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Documents Path: `cody.db.documents.search` ```ts theme={null} const rows = await corsair.cody.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `content_url` | `string` | equals, contains, startsWith, endsWith, in | | `folder_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Folders Path: `cody.db.folders.search` ```ts theme={null} const rows = await corsair.cody.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `cody.db.messages.search` ```ts theme={null} const rows = await corsair.cody.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `conversation_id` | `string` | equals, contains, startsWith, endsWith, in | | `machine` | `boolean` | equals | | `failed_responding` | `boolean` | equals | | `flagged` | `boolean` | equals | | `created_at` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Usage Path: `cody.db.usage.search` ```ts theme={null} const rows = await corsair.cody.db.usage.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `tokens` | `number` | equals, gt, gte, lt, lte, in | | `credits` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/cody/overview Cody plugin for Corsair Use **Cody** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 21 typed API operations * 6 synced entities (`bots`, `conversations`, `documents`, `folders`, `messages`, `usage`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cody ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cody ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cody ``` ```bash bun theme={null} bun add corsair @corsair-dev/cody ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cody } from '@corsair-dev/cody'; export const corsair = createCorsair({ plugins: [ cody(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} cody() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cody', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`bots.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cody.api.bots.list({}); ``` **`conversations.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cody.api.conversations.create({}); ``` See the full list on the [API](/plugins/cody/api) page. ## Query synced data Synced entities support `tenant.cody.db..search()` and `.list()`: `bots`, `conversations`, `documents`, `folders`, `messages`, `usage`. See [Database](/plugins/cody/database) for filters and operators. ## What's next > **[API reference](/plugins/cody/api)** > > Every `cody.api.*` operation with input and output types. > **[Database](/plugins/cody/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/coinbase/api API reference for Coinbase: every `coinbase.api.*` operation with input and output types. Every `coinbase.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### get `accounts.get` Get a Coinbase account by id or currency code **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.accounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `primary` | `boolean` | No | — | | `type` | `string` | No | — | | `currency` | `object` | No | — | | `balance` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `resource` | `string` | No | — | | `resource_path` | `string` | No | — | | `ready` | `boolean` | No | — | > **currency full type** > > ```ts theme={null} > string | { > code: string, > name?: string, > type?: string, > asset_id?: string, > slug?: string, > color?: string, > exponent?: number, > sort_index?: number, > address_regex?: string > } > ``` > **balance full type** > > ```ts theme={null} > { > amount: string, > currency: string > } > ``` *** ### list `accounts.list` List Coinbase accounts and balances **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.accounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | | `order` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > ending_before?: string | null, > starting_after?: string | null, > limit?: number, > order?: string, > previous_uri?: string | null, > next_uri?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > primary?: boolean, > type?: string, > currency?: string | { > code: string, > name?: string, > type?: string, > asset_id?: string, > slug?: string, > color?: string, > exponent?: number, > sort_index?: number, > address_regex?: string > }, > balance?: { > amount: string, > currency: string > }, > created_at?: string | null, > updated_at?: string | null, > resource?: string, > resource_path?: string, > ready?: boolean > }[] > ``` *** ## Data ### getExchangeRates `data.getExchangeRates` Get exchange rates for a base currency **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.data.getExchangeRates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `currency` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `currency` | `string` | Yes | — | | `rates` | `object` | Yes | — | > **rates full type** > > ```ts theme={null} > { > } > ``` *** ### getTime `data.getTime` Get Coinbase API server time **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.data.getTime({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `iso` | `string` | Yes | — | | `epoch` | `number` | Yes | — | *** ### listCurrencies `data.listCurrencies` List currencies supported by Coinbase **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.data.listCurrencies({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > min_size?: string, > status?: string, > message?: string | null, > convertible_to?: string[] > }[] > ``` *** ## Markets ### getCurrency `markets.getCurrency` Get a Coinbase App currency by id **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.getCurrency({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `currency_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > min_size?: string, > status?: string, > message?: string | null, > convertible_to?: string[] > } > ``` *** ### getMarketProductBook `markets.getMarketProductBook` Get the Advanced Trade public product book **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.getMarketProductBook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | Currency pair such as BTC-USD | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pricebook` | `object` | No | — | > **pricebook full type** > > ```ts theme={null} > { > product_id?: string, > bids?: { > price?: string, > size?: string > }[], > asks?: { > price?: string, > size?: string > }[], > time?: string > } > ``` *** ### getProduct `markets.getProduct` Get an Advanced Trade product by id **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.getProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | Currency pair such as BTC-USD | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | No | — | | `price` | `string` | No | — | | `base_currency_id` | `string` | No | — | | `quote_currency_id` | `string` | No | — | | `status` | `string` | No | — | | `volume_24h` | `string` | No | — | *** ### getProductBook `markets.getProductBook` Get the Advanced Trade product order book **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.getProductBook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | Currency pair such as BTC-USD | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pricebook` | `object` | No | — | > **pricebook full type** > > ```ts theme={null} > { > product_id?: string, > bids?: { > price?: string, > size?: string > }[], > asks?: { > price?: string, > size?: string > }[], > time?: string > } > ``` *** ### getPublicTrades `markets.getPublicTrades` Get public Advanced Trade market trades **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.getPublicTrades({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | Currency pair such as BTC-USD | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `trades` | `object[]` | No | — | | `best_bid` | `string` | No | — | | `best_ask` | `string` | No | — | > **trades full type** > > ```ts theme={null} > { > }[] > ``` *** ### getServerTime `markets.getServerTime` Get Coinbase Advanced Trade server time **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.getServerTime({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `iso` | `string` | No | — | | `epochSeconds` | `string \| number` | No | — | | `epochMillis` | `string \| number` | No | — | *** ### getTicker `markets.getTicker` Get the Advanced Trade public product ticker and trades **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.getTicker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | Currency pair such as BTC-USD | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `trades` | `object[]` | No | — | | `best_bid` | `string` | No | — | | `best_ask` | `string` | No | — | > **trades full type** > > ```ts theme={null} > { > }[] > ``` *** ### getVolumeSummary `markets.getVolumeSummary` List Advanced Trade products including 24h volume **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.getVolumeSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `product_type` | `string` | No | — | | `product_ids` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `products` | `object[]` | No | — | | `num_products` | `number` | No | — | > **products full type** > > ```ts theme={null} > { > product_id?: string, > price?: string, > base_currency_id?: string, > quote_currency_id?: string, > status?: string, > volume_24h?: string > }[] > ``` *** ### listExchangeProducts `markets.listExchangeProducts` List Advanced Trade trading products **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.listExchangeProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `product_type` | `string` | No | — | | `product_ids` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `products` | `object[]` | No | — | | `num_products` | `number` | No | — | > **products full type** > > ```ts theme={null} > { > product_id?: string, > price?: string, > base_currency_id?: string, > quote_currency_id?: string, > status?: string, > volume_24h?: string > }[] > ``` *** ### listProductCandles `markets.listProductCandles` List Advanced Trade product candles **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.listProductCandles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | Currency pair such as BTC-USD | | `start` | `string` | No | — | | `end` | `string` | No | — | | `granularity` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `candles` | `object[]` | No | — | > **candles full type** > > ```ts theme={null} > { > start?: string, > low?: string, > high?: string, > open?: string, > close?: string, > volume?: string > }[] > ``` *** ### listProducts `markets.listProducts` List Advanced Trade market products **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.listProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `product_type` | `string` | No | — | | `product_ids` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `products` | `object[]` | No | — | | `num_products` | `number` | No | — | > **products full type** > > ```ts theme={null} > { > product_id?: string, > price?: string, > base_currency_id?: string, > quote_currency_id?: string, > status?: string, > volume_24h?: string > }[] > ``` *** ### listProductsCandles `markets.listProductsCandles` List Advanced Trade candlestick history **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.listProductsCandles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | Currency pair such as BTC-USD | | `start` | `string` | No | — | | `end` | `string` | No | — | | `granularity` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `candles` | `object[]` | No | — | > **candles full type** > > ```ts theme={null} > { > start?: string, > low?: string, > high?: string, > open?: string, > close?: string, > volume?: string > }[] > ``` *** ### listStats `markets.listStats` Get Advanced Trade product details and 24h stats **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.listStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | Currency pair such as BTC-USD | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | No | — | | `price` | `string` | No | — | | `base_currency_id` | `string` | No | — | | `quote_currency_id` | `string` | No | — | | `status` | `string` | No | — | | `volume_24h` | `string` | No | — | *** ### listTrades `markets.listTrades` List recent Advanced Trade market trades **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.listTrades({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | Currency pair such as BTC-USD | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `trades` | `object[]` | No | — | | `best_bid` | `string` | No | — | | `best_ask` | `string` | No | — | > **trades full type** > > ```ts theme={null} > { > }[] > ``` *** ### listWallets `markets.listWallets` List Coinbase App wallets (accounts) **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.markets.listWallets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | | `order` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > ending_before?: string | null, > starting_after?: string | null, > limit?: number, > order?: string, > previous_uri?: string | null, > next_uri?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > primary?: boolean, > type?: string, > currency?: string | { > code: string, > name?: string, > type?: string, > asset_id?: string, > slug?: string, > color?: string, > exponent?: number, > sort_index?: number, > address_regex?: string > }, > balance?: { > amount: string, > currency: string > }, > created_at?: string | null, > updated_at?: string | null, > resource?: string, > resource_path?: string, > ready?: boolean > }[] > ``` *** ## Payment Methods ### list `paymentMethods.list` List payment methods on the authenticated Coinbase account **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.paymentMethods.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | | `order` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > ending_before?: string | null, > starting_after?: string | null, > limit?: number, > order?: string, > previous_uri?: string | null, > next_uri?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > id: string, > type?: string, > name?: string, > currency?: string, > primary_buy?: boolean, > primary_sell?: boolean, > allow_buy?: boolean, > allow_sell?: boolean, > allow_deposit?: boolean, > allow_withdraw?: boolean, > instant_buy?: boolean, > instant_sell?: boolean, > created_at?: string | null, > updated_at?: string | null, > resource?: string, > resource_path?: string > }[] > ``` *** ## Prices ### getBuy `prices.getBuy` Get the Coinbase buy price for a currency pair **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.prices.getBuy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `currency_pair` | `string` | Yes | Currency pair such as BTC-USD | **Output** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `string` | Yes | — | | `currency` | `string` | Yes | — | | `base` | `string` | No | — | *** ### getSell `prices.getSell` Get the Coinbase sell price for a currency pair **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.prices.getSell({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `currency_pair` | `string` | Yes | Currency pair such as BTC-USD | **Output** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `string` | Yes | — | | `currency` | `string` | Yes | — | | `base` | `string` | No | — | *** ### getSpot `prices.getSpot` Get the current or historic spot price for a currency pair **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.prices.getSpot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `currency_pair` | `string` | Yes | Currency pair such as BTC-USD | | `date` | `string` | No | Historic spot price date (YYYY-MM-DD, UTC) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `string` | Yes | — | | `currency` | `string` | Yes | — | | `base` | `string` | No | — | *** ## Transactions ### get `transactions.get` Get a transaction on a Coinbase account **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.transactions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | | `transaction_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `amount` | `object` | No | — | | `native_amount` | `object` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `resource` | `string` | No | — | | `resource_path` | `string` | No | — | | `instant_exchange` | `boolean` | No | — | | `network` | `object` | No | — | | `to` | `object` | No | — | | `from` | `object` | No | — | | `details` | `object` | No | — | > **amount full type** > > ```ts theme={null} > { > amount: string, > currency: string > } > ``` > **native\_amount full type** > > ```ts theme={null} > { > amount: string, > currency: string > } > ``` > **network full type** > > ```ts theme={null} > { > status?: string, > hash?: string | null, > name?: string, > transaction_url?: string | null, > status_description?: string | null > } > ``` > **to full type** > > ```ts theme={null} > { > } > ``` > **from full type** > > ```ts theme={null} > { > } > ``` > **details full type** > > ```ts theme={null} > { > } > ``` *** ### list `transactions.list` List transactions for a Coinbase account **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.transactions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | | `order` | `asc \| desc` | No | — | | `account_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > ending_before?: string | null, > starting_after?: string | null, > limit?: number, > order?: string, > previous_uri?: string | null, > next_uri?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > id: string, > type?: string, > status?: string, > amount?: { > amount: string, > currency: string > }, > native_amount?: { > amount: string, > currency: string > }, > description?: string | null, > created_at?: string | null, > updated_at?: string | null, > resource?: string, > resource_path?: string, > instant_exchange?: boolean, > network?: { > status?: string, > hash?: string | null, > name?: string, > transaction_url?: string | null, > status_description?: string | null > }, > to?: { > }, > from?: { > }, > details?: { > } > }[] > ``` *** ## User ### get `user.get` Get the authenticated Coinbase user profile **Risk:** `read` ```ts theme={null} await corsair.coinbase.api.user.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `username` | `string` | No | — | | `profile_location` | `string` | No | — | | `profile_bio` | `string` | No | — | | `profile_url` | `string` | No | — | | `avatar_url` | `string` | No | — | | `resource` | `string` | No | — | | `resource_path` | `string` | No | — | | `email` | `string` | No | — | | `time_zone` | `string` | No | — | | `native_currency` | `string` | No | — | | `bitcoin_unit` | `string` | No | — | | `country` | `object` | No | — | | `created_at` | `string` | No | — | > **country full type** > > ```ts theme={null} > { > code: string, > name?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/coinbase/database Coinbase local sync: searchable entities, `.search()` filters, and operators. The Coinbase plugin syncs data locally. Use `corsair.coinbase.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `coinbase.db.accounts.search` ```ts theme={null} const rows = await corsair.coinbase.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `primary` | `boolean` | equals | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `resource_path` | `string` | equals, contains, startsWith, endsWith, in | | `ready` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Currencies Path: `coinbase.db.currencies.search` ```ts theme={null} const rows = await corsair.coinbase.db.currencies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `min_size` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payment Methods Path: `coinbase.db.paymentMethods.search` ```ts theme={null} const rows = await corsair.coinbase.db.paymentMethods.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `primary_buy` | `boolean` | equals | | `primary_sell` | `boolean` | equals | | `allow_buy` | `boolean` | equals | | `allow_sell` | `boolean` | equals | | `allow_deposit` | `boolean` | equals | | `allow_withdraw` | `boolean` | equals | | `instant_buy` | `boolean` | equals | | `instant_sell` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `resource_path` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Prices Path: `coinbase.db.prices.search` ```ts theme={null} const rows = await corsair.coinbase.db.prices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `base` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transactions Path: `coinbase.db.transactions.search` ```ts theme={null} const rows = await corsair.coinbase.db.transactions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `resource_path` | `string` | equals, contains, startsWith, endsWith, in | | `instant_exchange` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `coinbase.db.users.search` ```ts theme={null} const rows = await corsair.coinbase.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `profile_location` | `string` | equals, contains, startsWith, endsWith, in | | `profile_bio` | `string` | equals, contains, startsWith, endsWith, in | | `profile_url` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `resource` | `string` | equals, contains, startsWith, endsWith, in | | `resource_path` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `time_zone` | `string` | equals, contains, startsWith, endsWith, in | | `native_currency` | `string` | equals, contains, startsWith, endsWith, in | | `bitcoin_unit` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/coinbase/overview Coinbase plugin for Corsair Use **Coinbase** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 27 typed API operations * 6 synced entities (`accounts`, `currencies`, `paymentMethods`, `prices`, `transactions`, `users`) for fast `.search()` / `.list()` * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/coinbase ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/coinbase ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/coinbase ``` ```bash bun theme={null} bun add corsair @corsair-dev/coinbase ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { coinbase } from '@corsair-dev/coinbase'; export const corsair = createCorsair({ plugins: [ coinbase(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} coinbase() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Coinbase OAuth app. ```ts theme={null} coinbase({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'coinbase', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.coinbase.api.accounts.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/coinbase/api) reference.* See the full list on the [API](/plugins/coinbase/api) page. ## Query synced data Synced entities support `tenant.coinbase.db..search()` and `.list()`: `accounts`, `currencies`, `paymentMethods`, `prices`, `transactions`, `users`. See [Database](/plugins/coinbase/database) for filters and operators. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/coinbase/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/coinbase/api)** > > Every `coinbase.api.*` operation with input and output types. > **[Database](/plugins/coinbase/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/coinbase/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/coinbase/webhooks Coinbase incoming webhooks: event paths, payloads, and response data. The Coinbase plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/coinbase/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `notifications` * `newPayment` (`notifications.newPayment`) * `ping` (`notifications.ping`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Notifications ### New Payment `notifications.newPayment` A new on-chain payment arrived at a watched address **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `type` | `wallet:addresses:new-payment` | Yes | — | | `data` | `object` | No | — | | `user` | `object` | No | — | | `account` | `object` | No | — | | `delivery_attempts` | `number` | No | — | | `created_at` | `string` | No | — | | `resource` | `string` | No | — | | `resource_path` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **user full type** > > ```ts theme={null} > { > id?: string, > resource?: string, > resource_path?: string > } > ``` > **account full type** > > ```ts theme={null} > { > id?: string, > resource?: string, > resource_path?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > id?: string, > type: wallet:addresses:new-payment, > data?: { > }, > user?: { > id?: string, > resource?: string, > resource_path?: string > }, > account?: { > id?: string, > resource?: string, > resource_path?: string > }, > delivery_attempts?: number, > created_at?: string, > resource?: string, > resource_path?: string > } > ``` **`webhookHooks` example** ```ts theme={null} coinbase({ webhookHooks: { notifications: { newPayment: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Ping `notifications.ping` Coinbase webhook ping used to verify a notification URL **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `type` | `ping` | Yes | — | | `data` | `object` | No | — | | `user` | `object` | No | — | | `account` | `object` | No | — | | `delivery_attempts` | `number` | No | — | | `created_at` | `string` | No | — | | `resource` | `string` | No | — | | `resource_path` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **user full type** > > ```ts theme={null} > { > id?: string, > resource?: string, > resource_path?: string > } > ``` > **account full type** > > ```ts theme={null} > { > id?: string, > resource?: string, > resource_path?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > id?: string, > type: ping, > data?: { > }, > user?: { > id?: string, > resource?: string, > resource_path?: string > }, > account?: { > id?: string, > resource?: string, > resource_path?: string > }, > delivery_attempts?: number, > created_at?: string, > resource?: string, > resource_path?: string > } > ``` **`webhookHooks` example** ```ts theme={null} coinbase({ webhookHooks: { notifications: { ping: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/coinmarketcal/api API reference for CoinMarketCal: every `coinmarketcal.api.*` operation with input and output types. Every `coinmarketcal.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Categories ### list `categories.list` List event categories from CoinMarketCal **Risk:** `read` ```ts theme={null} await corsair.coinmarketcal.api.categories.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > slug?: string > }[] > ``` *** ## Coins ### get `coins.get` Get a cryptocurrency by slug from CoinMarketCal **Risk:** `read` ```ts theme={null} await corsair.coinmarketcal.api.coins.get({ slug: 'bitcoin' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | | `symbol` | `string` | No | — | | `name` | `string` | No | — | | `rank` | `number` | No | — | | `tracked` | `boolean` | No | — | | `iconUrl` | `string` | No | — | | `upcomingCount` | `number` | No | — | | `majorCount` | `number` | No | — | | `peakImpact` | `number` | No | — | *** ### list `coins.list` List available cryptocurrencies from CoinMarketCal **Risk:** `read` ```ts theme={null} await corsair.coinmarketcal.api.coins.list({ q: 'bitcoin', tracked: true, limit: 50 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `tracked` | `boolean` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > slug: string, > symbol?: string, > name?: string, > rank?: number | null, > tracked?: boolean, > iconUrl?: string | null, > upcomingCount?: number | null, > majorCount?: number | null, > peakImpact?: number | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > cursor?: string | null > } > ``` *** ## Events ### get `events.get` Get a cryptocurrency event by id from CoinMarketCal **Risk:** `read` ```ts theme={null} await corsair.coinmarketcal.api.events.get({ id: '12345' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `date` | `string` | No | — | | `dateEnd` | `string` | No | — | | `dateType` | `string` | No | — | | `isEstimated` | `boolean` | No | — | | `displayedDate` | `string` | No | — | | `categories` | `string[]` | No | — | | `coins` | `object[]` | No | — | | `impact` | `number \| string` | No | — | | `impactSummary` | `string` | No | — | | `sourceUrl` | `string` | No | — | | `snapshotUrl` | `string` | No | — | | `lastVerifiedAt` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **coins full type** > > ```ts theme={null} > { > slug: string, > symbol: string, > name: string > }[] > ``` *** ### list `events.list` List cryptocurrency events from CoinMarketCal **Risk:** `read` ```ts theme={null} await corsair.coinmarketcal.api.events.list({ coins: 'bitcoin,ethereum', from: '2026-01-01', to: '2026-03-31', limit: 20, }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `coins` | `string` | No | — | | `categories` | `string` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `keyword` | `string` | No | — | | `impactMin` | `number` | No | — | | `sortBy` | `date_asc \| date_desc \| created_desc \| created_desc_and_updated_desc \| impact_desc` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > slug?: string, > title?: string, > description?: string | null, > date?: string, > dateEnd?: string | null, > dateType?: string, > isEstimated?: boolean, > displayedDate?: string, > categories?: string[], > coins?: { > slug: string, > symbol: string, > name: string > }[], > impact?: number | string | null, > impactSummary?: string | null, > sourceUrl?: string | null, > snapshotUrl?: string | null, > lastVerifiedAt?: string | null, > createdAt?: string, > updatedAt?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > cursor?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/coinmarketcal/database CoinMarketCal local sync: searchable entities, `.search()` filters, and operators. The CoinMarketCal plugin syncs data locally. Use `corsair.coinmarketcal.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Categories Path: `coinmarketcal.db.categories.search` ```ts theme={null} const rows = await corsair.coinmarketcal.db.categories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Coins Path: `coinmarketcal.db.coins.search` ```ts theme={null} const rows = await corsair.coinmarketcal.db.coins.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `rank` | `number` | equals, gt, gte, lt, lte, in | | `tracked` | `boolean` | equals | | `iconUrl` | `string` | equals, contains, startsWith, endsWith, in | | `upcomingCount` | `number` | equals, gt, gte, lt, lte, in | | `majorCount` | `number` | equals, gt, gte, lt, lte, in | | `peakImpact` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Events Path: `coinmarketcal.db.events.search` ```ts theme={null} const rows = await corsair.coinmarketcal.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `dateEnd` | `string` | equals, contains, startsWith, endsWith, in | | `dateType` | `string` | equals, contains, startsWith, endsWith, in | | `isEstimated` | `boolean` | equals | | `displayedDate` | `string` | equals, contains, startsWith, endsWith, in | | `impactSummary` | `string` | equals, contains, startsWith, endsWith, in | | `sourceUrl` | `string` | equals, contains, startsWith, endsWith, in | | `snapshotUrl` | `string` | equals, contains, startsWith, endsWith, in | | `lastVerifiedAt` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/coinmarketcal/overview Curated calendar of cryptocurrency events with impacted coins, dates, sources, and impact scores. Use **CoinMarketCal** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 3 synced entities (`categories`, `coins`, `events`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/coinmarketcal ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/coinmarketcal ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/coinmarketcal ``` ```bash bun theme={null} bun add corsair @corsair-dev/coinmarketcal ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { coinmarketcal } from '@corsair-dev/coinmarketcal'; export const corsair = createCorsair({ plugins: [ coinmarketcal(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} coinmarketcal() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'coinmarketcal', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List upcoming Ethereum events** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.coinmarketcal.api.events.list({ coins: 'ethereum', limit: 20 }); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/coinmarketcal/api) reference.* See the full list on the [API](/plugins/coinmarketcal/api) page. ## Query synced data Synced entities support `tenant.coinmarketcal.db..search()` and `.list()`: `categories`, `coins`, `events`. See [Database](/plugins/coinmarketcal/database) for filters and operators. ## What's next > **[API reference](/plugins/coinmarketcal/api)** > > Every `coinmarketcal.api.*` operation with input and output types. > **[Database](/plugins/coinmarketcal/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/collegefootballdata/api API reference for College Football Data: every `collegefootballdata.api.*` operation with input and output types. Every `collegefootballdata.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getUserInfo `account.getUserInfo` Get the authenticated user's subscription tier and remaining API calls **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.account.getUserInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `patronLevel` | `number` | No | — | | `tierName` | `string` | No | — | | `monthlyLimit` | `number` | No | — | | `remainingCalls` | `number` | No | — | | `usedCalls` | `number` | No | — | | `resetAt` | `string` | No | — | | `sharedPool` | `boolean` | No | — | | `products` | `string[]` | No | — | | `features` | `object` | No | — | > **features full type** > > ```ts theme={null} > { > } > ``` *** ## Betting ### getLines `betting.getLines` Get betting lines and totals by game and provider **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.betting.getLines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gameId` | `number` | No | — | | `year` | `number` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `week` | `number` | No | — | | `team` | `string` | No | — | | `home` | `string` | No | — | | `away` | `string` | No | — | | `conference` | `string` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | | `provider` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > season?: number | null, > seasonType?: string | null, > week?: number | null, > startDate?: string | null, > homeTeamId?: number | null, > homeTeam?: string | null, > homeConference?: string | null, > homeClassification?: string | null, > homeScore?: number | null, > awayTeamId?: number | null, > awayTeam?: string | null, > awayConference?: string | null, > awayClassification?: string | null, > awayScore?: number | null, > lines?: { > }[] | null > }[] > ``` *** ## Coaches ### list `coaches.list` Get coaching records and history **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.coaches.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `team` | `string` | No | — | | `year` | `number` | No | — | | `minYear` | `number` | No | — | | `maxYear` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > firstName?: string | null, > lastName?: string | null, > hireDate?: string | null, > seasons?: { > teamId?: number | null, > school?: string | null, > conference?: string | null, > year?: number | null, > games?: number | null, > wins?: number | null, > losses?: number | null, > ties?: number | null, > winPercentage?: number | null, > preseasonRank?: number | null, > postseasonRank?: number | null, > srs?: number | null, > spOverall?: number | null, > spOffense?: number | null, > spDefense?: number | null > }[] | null > }[] > ``` *** ## Conferences ### list `conferences.list` List all conferences across every NCAA division **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.conferences.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > shortName?: string | null, > abbreviation?: string | null, > classification?: string | null, > memberCount?: number | null > }[] > ``` *** ### listDivisions `conferences.listDivisions` List conference divisions with active years and metadata **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.conferences.listDivisions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `year` | `number` | No | — | | `minYear` | `number` | No | — | | `maxYear` | `number` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > teamId?: number | null, > team?: string | null, > conferenceId?: number | null, > conference?: string | null, > conferenceAbbreviation?: string | null, > classification?: string | null, > conferenceDivision?: string | null, > startYear?: number | null, > endYear?: number | null > }[] > ``` *** ### listMemberships `conferences.listMemberships` Get current/historical conference memberships for teams **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.conferences.listMemberships({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `year` | `number` | No | — | | `minYear` | `number` | No | — | | `maxYear` | `number` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > teamId?: number | null, > team?: string | null, > conferenceId?: number | null, > conference?: string | null, > conferenceAbbreviation?: string | null, > classification?: string | null, > conferenceDivision?: string | null, > startYear?: number | null, > endYear?: number | null > }[] > ``` *** ## Draft ### listPicks `draft.listPicks` List NFL draft picks **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.draft.listPicks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `school` | `string` | No | — | | `conference` | `string` | No | — | | `position` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > collegeAthleteId?: string | null, > nflAthleteId?: string | null, > collegeId?: number | null, > collegeTeam?: string | null, > collegeConference?: string | null, > nflTeamId?: number | null, > nflTeam?: string | null, > year?: number | null, > overall?: number | null, > round?: number | null, > pick?: number | null, > name?: string | null, > position?: string | null, > height?: number | null, > weight?: number | null, > preDraftRanking?: number | null, > preDraftPositionRanking?: number | null, > preDraftGrade?: number | null, > hometownInfo?: { > city?: string | null, > state?: string | null, > country?: string | null > } | null > }[] > ``` *** ### listPositions `draft.listPositions` Get the standardized list of NFL draft positions **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.draft.listPositions({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > abbreviation?: string | null > }[] > ``` *** ### listTeams `draft.listTeams` List NFL teams used in draft endpoints **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.draft.listTeams({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > location?: string | null, > nickname?: string | null, > displayName?: string | null, > logo?: string | null > }[] > ``` *** ## Drives ### list `drives.list` Get drive-level data for games **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.drives.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | | `week` | `number` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `team` | `string` | No | — | | `offense` | `string` | No | — | | `defense` | `string` | No | — | | `conference` | `string` | No | — | | `offenseConference` | `string` | No | — | | `defenseConference` | `string` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > gameId?: number | null, > offense?: string | null, > offenseConference?: string | null, > defense?: string | null, > defenseConference?: string | null, > driveNumber?: number | null, > scoring?: boolean | null, > startPeriod?: number | null, > startYardline?: number | null, > startYardsToGoal?: number | null, > startTime?: { > } | null, > endPeriod?: number | null, > endYardline?: number | null, > endYardsToGoal?: number | null, > endTime?: { > } | null, > elapsed?: { > } | null, > plays?: number | null, > yards?: number | null, > driveResult?: string | null, > isHomeOffense?: boolean | null, > startOffenseScore?: number | null, > startDefenseScore?: number | null, > endOffenseScore?: number | null, > endDefenseScore?: number | null > }[] > ``` *** ## Games ### getAdvancedBoxScore `games.getAdvancedBoxScore` Get advanced analytics for a single game **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.games.getAdvancedBoxScore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `gameInfo` | `object` | No | — | | `teams` | `object` | No | — | | `players` | `object` | No | — | > **gameInfo full type** > > ```ts theme={null} > { > } > ``` > **teams full type** > > ```ts theme={null} > { > } > ``` > **players full type** > > ```ts theme={null} > { > } > ``` *** ### getGamesAndResults `games.getGamesAndResults` Get game schedules and results, filtered by season/week/team **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.games.getGamesAndResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `week` | `number` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | | `team` | `string` | No | — | | `home` | `string` | No | — | | `away` | `string` | No | — | | `conference` | `string` | No | — | | `id` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > season?: number | null, > week?: number | null, > seasonType?: string | null, > startDate?: string | null, > startTimeTBD?: boolean | null, > completed?: boolean | null, > neutralSite?: boolean | null, > conferenceGame?: boolean | null, > attendance?: number | null, > venueId?: number | null, > venue?: string | null, > homeId?: number | null, > homeTeam?: string | null, > homeClassification?: string | null, > homeConference?: string | null, > homePoints?: number | null, > homeLineScores?: number[] | null, > homePostgameWinProbability?: number | null, > homePregameElo?: number | null, > homePostgameElo?: number | null, > awayId?: number | null, > awayTeam?: string | null, > awayClassification?: string | null, > awayConference?: string | null, > awayPoints?: number | null, > awayLineScores?: number[] | null, > awayPostgameWinProbability?: number | null, > awayPregameElo?: number | null, > awayPostgameElo?: number | null, > excitementIndex?: number | null, > highlights?: string | null, > notes?: string | null, > playoff?: { > competition?: string | null, > format?: string | null, > round?: string | null, > roundName?: string | null, > bracketSlot?: string | null, > homeSeed?: number | null, > awaySeed?: number | null, > bowlName?: string | null > } | null > }[] > ``` *** ### getMedia `games.getMedia` Get broadcast/media information for games **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.games.getMedia({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | | `week` | `number` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | | `mediaType` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > season?: number | null, > week?: number | null, > seasonType?: string | null, > startTime?: string | null, > isStartTimeTBD?: boolean | null, > homeTeam?: string | null, > homeConference?: string | null, > awayTeam?: string | null, > awayConference?: string | null, > mediaType?: string | null, > outlet?: string | null > }[] > ``` *** ### getPlayerStats `games.getPlayerStats` Get player-level stats for games **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.games.getPlayerStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `week` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `category` | `string` | No | — | | `id` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > teams?: { > }[] | null > }[] > ``` *** ### getTeamStats `games.getTeamStats` Get team-level box score stats for games **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.games.getTeamStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `week` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `id` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > teams?: { > }[] | null > }[] > ``` *** ## Metrics ### getFieldGoalExpectedPoints `metrics.getFieldGoalExpectedPoints` Get field goal expected-points model data by distance **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.metrics.getFieldGoalExpectedPoints({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > yardsToGoal?: number | null, > distance?: number | null, > expectedPoints?: number | null > }[] > ``` *** ### getPregameWinProbabilities `metrics.getPregameWinProbabilities` Get pregame win probabilities for games **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.metrics.getPregameWinProbabilities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `week` | `number` | No | — | | `team` | `string` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > week?: number | null, > seasonType?: string | null, > gameId?: number | null, > homeTeam?: string | null, > awayTeam?: string | null, > spread?: number | null, > homeWinProbability?: number | null > }[] > ``` *** ### getWinProbability `metrics.getWinProbability` Get play-by-play win probabilities for a game **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.metrics.getWinProbability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gameId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > gameId?: number | null, > homeId?: number | null, > home?: string | null, > awayId?: number | null, > away?: string | null, > playId?: string | null, > playText?: string | null, > homeScore?: number | null, > awayScore?: number | null, > down?: number | null, > distance?: number | null, > homeWinProbability?: number | null, > spread?: number | null, > yardLine?: number | null, > homeBall?: boolean | null, > playNumber?: number | null > }[] > ``` *** ## Players ### getReturningProduction `players.getReturningProduction` Get returning production splits by team **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.players.getReturningProduction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > team?: string | null, > conference?: string | null, > totalPPA?: number | null, > totalPassingPPA?: number | null, > totalReceivingPPA?: number | null, > totalRushingPPA?: number | null, > percentPPA?: number | null, > percentPassingPPA?: number | null, > percentReceivingPPA?: number | null, > percentRushingPPA?: number | null, > usage?: number | null, > passingUsage?: number | null, > receivingUsage?: number | null, > rushingUsage?: number | null > }[] > ``` *** ### getUsage `players.getUsage` Get player usage rates for a season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.players.getUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | | `conference` | `string` | No | — | | `position` | `string` | No | — | | `team` | `string` | No | — | | `playerId` | `string` | No | — | | `excludeGarbageTime` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > id?: string | null, > name?: string | null, > position?: string | null, > team?: string | null, > conference?: string | null, > usage?: { > } | null > }[] > ``` *** ### listTransferPortal `players.listTransferPortal` Get transfer portal entries for a season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.players.listTransferPortal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > firstName?: string | null, > lastName?: string | null, > position?: string | null, > origin?: string | null, > destination?: string | null, > transferDate?: string | null, > rating?: number | null, > stars?: number | null, > eligibility?: string | null > }[] > ``` *** ### search `players.search` Search for players by name **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.players.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `searchTerm` | `string` | Yes | — | | `position` | `string` | No | — | | `team` | `string` | No | — | | `year` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > team?: string | null, > name?: string | null, > firstName?: string | null, > lastName?: string | null, > weight?: number | null, > height?: number | null, > jersey?: number | null, > position?: string | null, > hometown?: string | null, > teamColor?: string | null, > teamColorSecondary?: string | null, > activeStartYear?: number | null, > activeEndYear?: number | null, > teamStints?: { > }[] | null > }[] > ``` *** ## Plays ### list `plays.list` Get play-by-play data for games **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.plays.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | | `week` | `number` | Yes | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `team` | `string` | No | — | | `offense` | `string` | No | — | | `defense` | `string` | No | — | | `conference` | `string` | No | — | | `offenseConference` | `string` | No | — | | `defenseConference` | `string` | No | — | | `playType` | `string` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > gameId?: number | null, > driveId?: string | null, > id?: string | null, > driveNumber?: number | null, > playNumber?: number | null, > offense?: string | null, > offenseConference?: string | null, > offenseScore?: number | null, > defense?: string | null, > defenseConference?: string | null, > defenseScore?: number | null, > home?: string | null, > away?: string | null, > period?: number | null, > clock?: { > } | null, > offenseTimeouts?: number | null, > defenseTimeouts?: number | null, > yardline?: number | null, > yardsToGoal?: number | null, > down?: number | null, > distance?: number | null, > yardsGained?: number | null, > scoring?: boolean | null, > playType?: string | null, > playText?: string | null, > ppa?: number | null, > wallclock?: string | null > }[] > ``` *** ### listStats `plays.listStats` Get player-level statistics tied to individual plays **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.plays.listStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `week` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `gameId` | `number` | No | — | | `statTypeId` | `number` | No | — | | `athleteId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > gameId?: number | null, > season?: number | null, > week?: number | null, > team?: string | null, > conference?: string | null, > opponent?: string | null, > teamScore?: number | null, > opponentScore?: number | null, > driveId?: string | null, > playId?: string | null, > period?: number | null, > clock?: { > } | null, > yardsToGoal?: number | null, > down?: number | null, > distance?: number | null, > athleteId?: string | null, > athleteName?: string | null, > statType?: string | null, > stat?: string | null > }[] > ``` *** ### listStatTypes `plays.listStatTypes` List play-level stat type definitions **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.plays.listStatTypes({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > text?: string | null, > abbreviation?: string | null > }[] > ``` *** ### listTypes `plays.listTypes` List available play types **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.plays.listTypes({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > text?: string | null, > abbreviation?: string | null > }[] > ``` *** ## Ppa ### getByPlayerGame `ppa.getByPlayerGame` Get player PPA by game **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ppa.getByPlayerGame({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | | `week` | `number` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `team` | `string` | No | — | | `position` | `string` | No | — | | `playerId` | `string` | No | — | | `threshold` | `number` | No | — | | `excludeGarbageTime` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > week?: number | null, > seasonType?: string | null, > id?: string | null, > name?: string | null, > position?: string | null, > team?: string | null, > opponent?: string | null, > averagePPA?: { > } | null > }[] > ``` *** ### getByPlayerSeason `ppa.getByPlayerSeason` Get player PPA aggregated by season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ppa.getByPlayerSeason({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `conference` | `string` | No | — | | `team` | `string` | No | — | | `position` | `string` | No | — | | `playerId` | `string` | No | — | | `threshold` | `number` | No | — | | `excludeGarbageTime` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > id?: string | null, > name?: string | null, > position?: string | null, > team?: string | null, > conference?: string | null, > averagePPA?: { > } | null, > totalPPA?: { > } | null > }[] > ``` *** ### getByTeamGame `ppa.getByTeamGame` Get team PPA by game **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ppa.getByTeamGame({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | | `week` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `excludeGarbageTime` | `boolean` | No | — | | `classification` | `fbs \| fcs \| ii \| iii` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > gameId?: number | null, > season?: number | null, > week?: number | null, > seasonType?: string | null, > team?: string | null, > conference?: string | null, > opponent?: string | null, > offense?: { > overall?: number | null, > passing?: number | null, > rushing?: number | null, > firstDown?: number | null, > secondDown?: number | null, > thirdDown?: number | null > } | null, > defense?: { > overall?: number | null, > passing?: number | null, > rushing?: number | null, > firstDown?: number | null, > secondDown?: number | null, > thirdDown?: number | null > } | null > }[] > ``` *** ### getByTeamSeason `ppa.getByTeamSeason` Get team PPA (Predicted Points Added) by season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ppa.getByTeamSeason({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `excludeGarbageTime` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > conference?: string | null, > team?: string | null, > offense?: { > overall?: number | null, > passing?: number | null, > rushing?: number | null, > firstDown?: number | null, > secondDown?: number | null, > thirdDown?: number | null > } | null, > defense?: { > overall?: number | null, > passing?: number | null, > rushing?: number | null, > firstDown?: number | null, > secondDown?: number | null, > thirdDown?: number | null > } | null > }[] > ``` *** ### getPredictedPoints `ppa.getPredictedPoints` Get expected points for a down/distance across field positions **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ppa.getPredictedPoints({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `down` | `number` | Yes | — | | `distance` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > yardLine?: number | null, > predictedPoints?: number | null > }[] > ``` *** ## Rankings ### list `rankings.list` Get poll rankings by season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.rankings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `week` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > seasonType?: string | null, > week?: number | null, > polls?: { > poll?: string | null, > isFinal?: boolean | null, > ranks?: { > rank?: number | null, > teamId?: number | null, > school?: string | null, > conference?: string | null, > firstPlaceVotes?: number | null, > points?: number | null > }[] | null > }[] | null > }[] > ``` *** ## Ratings ### getConferenceSP `ratings.getConferenceSP` Get SP+ ratings aggregated by conference **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ratings.getConferenceSP({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `conference` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > conference?: string | null, > rating?: number | null, > secondOrderWins?: number | null, > sos?: number | null, > offense?: { > ranking?: number | null, > rating?: number | null, > success?: number | null, > explosiveness?: number | null, > rushing?: number | null, > passing?: number | null, > standardDowns?: number | null, > passingDowns?: number | null, > runRate?: number | null, > pace?: number | null > } | null, > defense?: { > ranking?: number | null, > rating?: number | null, > success?: number | null, > explosiveness?: number | null, > rushing?: number | null, > passing?: number | null, > standardDowns?: number | null, > passingDowns?: number | null, > runRate?: number | null, > pace?: number | null > } | null, > specialTeams?: { > } | null > }[] > ``` *** ### getElo `ratings.getElo` Get Elo ratings by season or team **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ratings.getElo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > team?: string | null, > conference?: string | null, > elo?: number | null > }[] > ``` *** ### getFPI `ratings.getFPI` Get ESPN FPI (Football Power Index) ratings **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ratings.getFPI({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > team?: string | null, > conference?: string | null, > fpi?: number | null, > resumeRanks?: { > } | null, > efficiencies?: { > } | null > }[] > ``` *** ### getSP `ratings.getSP` Get SP+ team ratings **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ratings.getSP({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > team?: string | null, > conference?: string | null, > rating?: number | null, > ranking?: number | null, > secondOrderWins?: number | null, > sos?: number | null, > offense?: { > ranking?: number | null, > rating?: number | null, > success?: number | null, > explosiveness?: number | null, > rushing?: number | null, > passing?: number | null, > standardDowns?: number | null, > passingDowns?: number | null, > runRate?: number | null, > pace?: number | null > } | null, > defense?: { > ranking?: number | null, > rating?: number | null, > success?: number | null, > explosiveness?: number | null, > rushing?: number | null, > passing?: number | null, > standardDowns?: number | null, > passingDowns?: number | null, > runRate?: number | null, > pace?: number | null > } | null, > specialTeams?: { > } | null > }[] > ``` *** ### getSRS `ratings.getSRS` Get SRS (Simple Rating System) ratings **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.ratings.getSRS({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > team?: string | null, > conference?: string | null, > division?: string | null, > ranking?: number | null, > rating?: number | null > }[] > ``` *** ## Recruiting ### getGroupRatings `recruiting.getGroupRatings` Get recruiting data grouped by position **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.recruiting.getGroupRatings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `recruitType` | `string` | No | — | | `startYear` | `number` | No | — | | `endYear` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > team?: string | null, > conference?: string | null, > positionGroup?: string | null, > averageRating?: number | null, > totalRating?: number | null, > commits?: number | null, > averageStars?: number | null > }[] > ``` *** ### getTeamRankings `recruiting.getTeamRankings` Get team recruiting class rankings **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.recruiting.getTeamRankings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > team?: string | null, > rank?: number | null, > points?: number | null > }[] > ``` *** ### getTeamTalent `recruiting.getTeamTalent` Get composite team talent rankings for a season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.recruiting.getTeamTalent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > team?: string | null, > talent?: number | null > }[] > ``` *** ### listRecruits `recruiting.listRecruits` Get recruit rankings **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.recruiting.listRecruits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `classification` | `string` | No | — | | `position` | `string` | No | — | | `state` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > athleteId?: string | null, > recruitType?: string | null, > year?: number | null, > ranking?: number | null, > name?: string | null, > school?: string | null, > committedTo?: string | null, > position?: string | null, > height?: number | null, > weight?: number | null, > stars?: number | null, > rating?: number | null, > city?: string | null, > stateProvince?: string | null, > country?: string | null, > hometownInfo?: { > city?: string | null, > state?: string | null, > country?: string | null, > latitude?: number | null, > longitude?: number | null, > countyFips?: string | null > } | null > }[] > ``` *** ## Season Types ### list `seasonTypes.list` Get the valid season-type vocabulary **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.seasonTypes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | **Output:** `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason[]` *** ## Stats ### getAdvancedGameStats `stats.getAdvancedGameStats` Get advanced team metrics at the game level **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.stats.getAdvancedGameStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `week` | `number` | No | — | | `team` | `string` | No | — | | `opponent` | `string` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | | `excludeGarbageTime` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > gameId?: number | null, > season?: number | null, > seasonType?: string | null, > week?: number | null, > team?: string | null, > opponent?: string | null, > offense?: { > } | null, > defense?: { > } | null > }[] > ``` *** ### getAdvancedSeasonStats `stats.getAdvancedSeasonStats` Get advanced season-level team statistics **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.stats.getAdvancedSeasonStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `excludeGarbageTime` | `boolean` | No | — | | `startWeek` | `number` | No | — | | `endWeek` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > gameId?: number | null, > season?: number | null, > seasonType?: string | null, > week?: number | null, > team?: string | null, > opponent?: string | null, > offense?: { > } | null, > defense?: { > } | null > }[] > ``` *** ### getGameHavocStats `stats.getGameHavocStats` Get havoc statistics aggregated by game **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.stats.getGameHavocStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `week` | `number` | No | — | | `team` | `string` | No | — | | `opponent` | `string` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > gameId?: number | null, > season?: number | null, > seasonType?: string | null, > week?: number | null, > team?: string | null, > conference?: string | null, > opponent?: string | null, > opponentConference?: string | null, > offense?: { > } | null, > defense?: { > } | null > }[] > ``` *** ### getPlayerSeasonStats `stats.getPlayerSeasonStats` Get aggregated season statistics for players **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.stats.getPlayerSeasonStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | | `conference` | `string` | No | — | | `team` | `string` | No | — | | `category` | `string` | No | — | | `seasonType` | `regular \| postseason \| both \| allstar \| spring_regular \| spring_postseason` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > playerId?: string | null, > player?: string | null, > position?: string | null, > team?: string | null, > conference?: string | null, > category?: string | null, > statType?: string | null, > stat?: string | null > }[] > ``` *** ### getTeamSeasonStats `stats.getTeamSeasonStats` Get basic season stats aggregated by team **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.stats.getTeamSeasonStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | | `startWeek` | `number` | No | — | | `endWeek` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > season?: number | null, > team?: string | null, > conference?: string | null, > statName?: string | null, > statValue?: number | null > }[] > ``` *** ### listCategories `stats.listCategories` List valid team statistical category names **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.stats.listCategories({}); ``` **Input:** *empty object* **Output:** `string[]` *** ## Teams ### getATSRecords `teams.getATSRecords` Get against-the-spread (ATS) summary by team **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.teams.getATSRecords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > teamId?: number | null, > team?: string | null, > conference?: string | null, > games?: number | null, > atsWins?: number | null, > atsLosses?: number | null, > atsPushes?: number | null, > avgCoverMargin?: number | null > }[] > ``` *** ### getMatchup `teams.getMatchup` Get head-to-head matchup history between two teams **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.teams.getMatchup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team1` | `string` | Yes | — | | `team2` | `string` | Yes | — | | `minYear` | `number` | No | — | | `maxYear` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `team1` | `string` | No | — | | `team2` | `string` | No | — | | `team1Wins` | `number` | No | — | | `team2Wins` | `number` | No | — | | `ties` | `number` | No | — | | `games` | `object[]` | No | — | > **games full type** > > ```ts theme={null} > { > }[] > ``` *** ### getRecords `teams.getRecords` Get team win-loss records for a season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.teams.getRecords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | Yes | — | | `team` | `string` | No | — | | `conference` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > year?: number | null, > teamId?: number | null, > team?: string | null, > classification?: string | null, > conference?: string | null, > division?: string | null, > expectedWins?: number | null, > total?: { > games?: number | null, > wins?: number | null, > losses?: number | null, > ties?: number | null > } | null, > conferenceGames?: { > games?: number | null, > wins?: number | null, > losses?: number | null, > ties?: number | null > } | null, > homeGames?: { > games?: number | null, > wins?: number | null, > losses?: number | null, > ties?: number | null > } | null, > awayGames?: { > games?: number | null, > wins?: number | null, > losses?: number | null, > ties?: number | null > } | null, > neutralSiteGames?: { > games?: number | null, > wins?: number | null, > losses?: number | null, > ties?: number | null > } | null, > regularSeason?: { > games?: number | null, > wins?: number | null, > losses?: number | null, > ties?: number | null > } | null, > postseason?: { > games?: number | null, > wins?: number | null, > losses?: number | null, > ties?: number | null > } | null > }[] > ``` *** ### getRoster `teams.getRoster` Get a team's roster for a season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.teams.getRoster({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team` | `string` | No | — | | `year` | `number` | No | — | | `classification` | `fbs \| fcs` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > firstName?: string | null, > lastName?: string | null, > team?: string | null, > weight?: number | null, > height?: number | null, > jersey?: number | null, > year?: number | null, > position?: string | null, > homeCity?: string | null, > homeState?: string | null, > homeCountry?: string | null, > homeLatitude?: number | null, > homeLongitude?: number | null, > homeCountyFIPS?: string | null, > recruitIds?: ( > string | number > )[] | null > }[] > ``` *** ### list `teams.list` List teams, optionally filtered by conference/season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conference` | `string` | No | — | | `year` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > school: string, > mascot?: string | null, > abbreviation?: string | null, > alternateNames?: string[] | null, > conference?: string | null, > division?: string | null, > classification?: string | null, > color?: string | null, > alternateColor?: string | null, > logos?: string[] | null, > twitter?: string | null, > location?: { > id?: number | null, > name?: string | null, > city?: string | null, > state?: string | null, > zip?: string | null, > countryCode?: string | null, > timezone?: string | null, > latitude?: number | null, > longitude?: number | null, > elevation?: string | null, > capacity?: number | null, > constructionYear?: number | null, > grass?: boolean | null, > dome?: boolean | null > } | null > }[] > ``` *** ### listFBS `teams.listFBS` List FBS teams for a season **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.teams.listFBS({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > school: string, > mascot?: string | null, > abbreviation?: string | null, > alternateNames?: string[] | null, > conference?: string | null, > division?: string | null, > classification?: string | null, > color?: string | null, > alternateColor?: string | null, > logos?: string[] | null, > twitter?: string | null, > location?: { > id?: number | null, > name?: string | null, > city?: string | null, > state?: string | null, > zip?: string | null, > countryCode?: string | null, > timezone?: string | null, > latitude?: number | null, > longitude?: number | null, > elevation?: string | null, > capacity?: number | null, > constructionYear?: number | null, > grass?: boolean | null, > dome?: boolean | null > } | null > }[] > ``` *** ### listFCS `teams.listFCS` List FCS teams for a season/conference **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.teams.listFCS({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conference` | `string` | No | — | | `year` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > school: string, > mascot?: string | null, > abbreviation?: string | null, > alternateNames?: string[] | null, > conference?: string | null, > division?: string | null, > classification?: string | null, > color?: string | null, > alternateColor?: string | null, > logos?: string[] | null, > twitter?: string | null, > location?: { > id?: number | null, > name?: string | null, > city?: string | null, > state?: string | null, > zip?: string | null, > countryCode?: string | null, > timezone?: string | null, > latitude?: number | null, > longitude?: number | null, > elevation?: string | null, > capacity?: number | null, > constructionYear?: number | null, > grass?: boolean | null, > dome?: boolean | null > } | null > }[] > ``` *** ## Venues ### list `venues.list` List venues with metadata **Risk:** `read` ```ts theme={null} await corsair.collegefootballdata.api.venues.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > city?: string | null, > state?: string | null, > zip?: string | null, > countryCode?: string | null, > timezone?: string | null, > latitude?: number | null, > longitude?: number | null, > elevation?: string | null, > capacity?: number | null, > constructionYear?: number | null, > grass?: boolean | null, > dome?: boolean | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/collegefootballdata/database College Football Data local sync: searchable entities, `.search()` filters, and operators. The College Football Data plugin syncs data locally. Use `corsair.collegefootballdata.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Coaches Path: `collegefootballdata.db.coaches.search` ```ts theme={null} const rows = await corsair.collegefootballdata.db.coaches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `hireDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Conferences Path: `collegefootballdata.db.conferences.search` ```ts theme={null} const rows = await corsair.collegefootballdata.db.conferences.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `shortName` | `string` | equals, contains, startsWith, endsWith, in | | `abbreviation` | `string` | equals, contains, startsWith, endsWith, in | | `classification` | `string` | equals, contains, startsWith, endsWith, in | | `memberCount` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `collegefootballdata.db.teams.search` ```ts theme={null} const rows = await corsair.collegefootballdata.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `school` | `string` | equals, contains, startsWith, endsWith, in | | `mascot` | `string` | equals, contains, startsWith, endsWith, in | | `abbreviation` | `string` | equals, contains, startsWith, endsWith, in | | `conference` | `string` | equals, contains, startsWith, endsWith, in | | `division` | `string` | equals, contains, startsWith, endsWith, in | | `classification` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `alternateColor` | `string` | equals, contains, startsWith, endsWith, in | | `twitter` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Venues Path: `collegefootballdata.db.venues.search` ```ts theme={null} const rows = await corsair.collegefootballdata.db.venues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `zip` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `latitude` | `number` | equals, gt, gte, lt, lte, in | | `longitude` | `number` | equals, gt, gte, lt, lte, in | | `elevation` | `string` | equals, contains, startsWith, endsWith, in | | `capacity` | `number` | equals, gt, gte, lt, lte, in | | `constructionYear` | `number` | equals, gt, gte, lt, lte, in | | `grass` | `boolean` | equals | | `dome` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/collegefootballdata/overview College football statistics API for games, teams, players, and historical NCAA data. Use **College Football Data** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 56 typed API operations * 4 synced entities (`coaches`, `conferences`, `teams`, `venues`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/collegefootballdata ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/collegefootballdata ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/collegefootballdata ``` ```bash bun theme={null} bun add corsair @corsair-dev/collegefootballdata ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { collegefootballdata } from '@corsair-dev/collegefootballdata'; export const corsair = createCorsair({ plugins: [ collegefootballdata(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} collegefootballdata() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'collegefootballdata', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getUserInfo`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.collegefootballdata.api.account.getUserInfo({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/collegefootballdata/api) reference.* See the full list on the [API](/plugins/collegefootballdata/api) page. ## Query synced data Synced entities support `tenant.collegefootballdata.db..search()` and `.list()`: `coaches`, `conferences`, `teams`, `venues`. See [Database](/plugins/collegefootballdata/database) for filters and operators. ## What's next > **[API reference](/plugins/collegefootballdata/api)** > > Every `collegefootballdata.api.*` operation with input and output types. > **[Database](/plugins/collegefootballdata/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/composio/api API reference for Composio: every `composio.api.*` operation with input and output types. Every `composio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Connections ### create `connections.create` Create a connected-account auth link **Risk:** `write` ```ts theme={null} await corsair.composio.api.connections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `auth_config_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | | `alias` | `string` | No | — | | `callback_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `link_token` | `string` | Yes | — | | `redirect_url` | `string` | Yes | — | | `expires_at` | `string` | Yes | — | | `connected_account_id` | `string` | Yes | — | *** ### delete `connections.delete` Delete a connected account **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.composio.api.connections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connected_account_id` | `string` | Yes | — | | `revoke_on_delete` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `revoke_job_id` | `string` | No | — | *** ### list `connections.list` List connected accounts **Risk:** `read` ```ts theme={null} await corsair.composio.api.connections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `toolkit_slugs` | `string[]` | No | — | | `statuses` | `INITIALIZING \| INITIATED \| ACTIVE \| FAILED \| EXPIRED \| INACTIVE \| REVOKED[]` | No | — | | `user_ids` | `string[]` | No | — | | `auth_config_ids` | `string[]` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `account_type` | `PRIVATE \| SHARED \| ALL` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `total_pages` | `number` | Yes | — | | `current_page` | `number` | Yes | — | | `total_items` | `number` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > status: string, > user_id: string, > alias?: string | null, > created_at: string, > updated_at: string, > is_disabled: boolean, > toolkit: { > slug: string > }, > auth_config: { > id: string, > auth_scheme?: string, > is_composio_managed?: boolean, > is_disabled?: boolean > }, > authScheme?: string, > word_id?: string | null, > status_reason?: string | null > }[] > ``` *** ## Meta ### checkActiveConnection `meta.checkActiveConnection` COMPOSIO\_CHECK\_ACTIVE\_CONNECTION: check one connection **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.checkActiveConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > toolkit?: string, > connected_account_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### checkActiveConnections `meta.checkActiveConnections` COMPOSIO\_CHECK\_ACTIVE\_CONNECTIONS: check many connections **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.checkActiveConnections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > requests: { > toolkit?: string, > connected_account_id?: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### createPlan `meta.createPlan` COMPOSIO\_CREATE\_PLAN: plan a multi-step workflow **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.createPlan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > difficulty: medium | hard, > known_fields: string, > primary_tool_slugs: string[], > reasoning: string, > use_case: string, > related_tool_slugs?: string[], > session_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### enableTrigger `meta.enableTrigger` COMPOSIO\_ENABLE\_TRIGGER: enable a trigger on an account **Risk:** `write` ```ts theme={null} await corsair.composio.api.meta.enableTrigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > connected_account_id: string, > toolkit_slug: string, > trigger_name: string, > config_params?: { > }, > user_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### executeTool `meta.executeTool` COMPOSIO\_EXECUTE\_TOOL: run one tool **Risk:** `write` ```ts theme={null} await corsair.composio.api.meta.executeTool({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > tool_slug: string, > arguments: { > }, > connected_account_id?: string, > allow_destructive?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### getDependencyGraph `meta.getDependencyGraph` COMPOSIO\_GET\_DEPENDENCY\_GRAPH: tools a tool depends on **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.getDependencyGraph({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > tool_name: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### getRequiredParameters `meta.getRequiredParameters` COMPOSIO\_GET\_REQUIRED\_PARAMETERS: auth fields of a toolkit **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.getRequiredParameters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > toolkit: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### getResponseSchema `meta.getResponseSchema` COMPOSIO\_GET\_RESPONSE\_SCHEMA: output schema of a tool **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.getResponseSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > tool: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### getToolSchemas `meta.getToolSchemas` COMPOSIO\_GET\_TOOL\_SCHEMAS: input schemas by slug **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.getToolSchemas({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | Session id from sessions.create | | `arguments` | `object` | Yes | — | > **arguments full type** > > ```ts theme={null} > { > tool_slugs: string[], > include?: input_schema | output_schema[], > session_id?: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > result_type: completed | failed, > data: { > }, > error?: string | null, > log_id: string > } | { > result_type: input_required, > input_requests: { > }, > request_state?: string > } > ``` *** ### initiateConnection `meta.initiateConnection` COMPOSIO\_INITIATE\_CONNECTION: start connecting a toolkit **Risk:** `write` ```ts theme={null} await corsair.composio.api.meta.initiateConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > toolkit: string, > parameters?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### listToolkits `meta.listToolkits` COMPOSIO\_LIST\_TOOLKITS: list toolkits **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.listToolkits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > category?: string, > name_filter?: string, > min_tools?: number, > no_auth_only?: boolean, > size?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### listTriggers `meta.listTriggers` COMPOSIO\_LIST\_TRIGGERS: list trigger types **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.listTriggers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > toolkit_names?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### manageConnections `meta.manageConnections` COMPOSIO\_MANAGE\_CONNECTIONS: check or connect toolkits **Risk:** `write` ```ts theme={null} await corsair.composio.api.meta.manageConnections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | Session id from sessions.create | | `arguments` | `object` | Yes | — | > **arguments full type** > > ```ts theme={null} > { > toolkits: string[], > reinitiate_all?: boolean, > session_id?: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > result_type: completed | failed, > data: { > }, > error?: string | null, > log_id: string > } | { > result_type: input_required, > input_requests: { > }, > request_state?: string > } > ``` *** ### multiExecuteTool `meta.multiExecuteTool` COMPOSIO\_MULTI\_EXECUTE\_TOOL: run tools in parallel **Risk:** `write` ```ts theme={null} await corsair.composio.api.meta.multiExecuteTool({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | Session id from sessions.create | | `arguments` | `object` | Yes | — | > **arguments full type** > > ```ts theme={null} > { > tools: { > tool_slug: string, > arguments: { > } > }[], > sync_response_to_workbench: boolean, > memory?: { > }, > thought?: string, > current_step?: string, > current_step_metric?: string, > session_id?: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > result_type: completed | failed, > data: { > }, > error?: string | null, > log_id: string > } | { > result_type: input_required, > input_requests: { > }, > request_state?: string > } > ``` *** ### remoteBashTool `meta.remoteBashTool` COMPOSIO\_REMOTE\_BASH\_TOOL: run bash in the sandbox **Risk:** `write` ```ts theme={null} await corsair.composio.api.meta.remoteBashTool({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | Session id from sessions.create | | `arguments` | `object` | Yes | — | > **arguments full type** > > ```ts theme={null} > { > command: string, > session_id?: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > result_type: completed | failed, > data: { > }, > error?: string | null, > log_id: string > } | { > result_type: input_required, > input_requests: { > }, > request_state?: string > } > ``` *** ### remoteWorkbench `meta.remoteWorkbench` COMPOSIO\_REMOTE\_WORKBENCH: run Python in the sandbox **Risk:** `write` ```ts theme={null} await corsair.composio.api.meta.remoteWorkbench({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | Session id from sessions.create | | `arguments` | `object` | Yes | — | > **arguments full type** > > ```ts theme={null} > { > code_to_execute: string, > thought?: string, > current_step?: string, > current_step_metric?: string, > session_id?: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > result_type: completed | failed, > data: { > }, > error?: string | null, > log_id: string > } | { > result_type: input_required, > input_requests: { > }, > request_state?: string > } > ``` *** ### searchTools `meta.searchTools` COMPOSIO\_SEARCH\_TOOLS: find tools for a use case **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.searchTools({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | Session id from sessions.create | | `arguments` | `object` | Yes | — | > **arguments full type** > > ```ts theme={null} > { > queries: { > use_case: string, > known_fields?: string > }[], > session?: { > generate_id: true > } | { > id: string > }, > model?: string, > search_strategy?: auto | tool_search > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > result_type: completed | failed, > data: { > }, > error?: string | null, > log_id: string > } | { > result_type: input_required, > input_requests: { > }, > request_state?: string > } > ``` *** ### waitForConnection `meta.waitForConnection` COMPOSIO\_WAIT\_FOR\_CONNECTION: wait until toolkits connect **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.waitForConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `arguments` | `object` | Yes | — | | `user_id` | `string` | No | Composio user the call runs for | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > toolkits: string[], > mode?: any | all, > timeout_seconds?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### waitForConnections `meta.waitForConnections` COMPOSIO\_WAIT\_FOR\_CONNECTIONS: wait inside a session **Risk:** `read` ```ts theme={null} await corsair.composio.api.meta.waitForConnections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | Session id from sessions.create | | `arguments` | `object` | Yes | — | > **arguments full type** > > ```ts theme={null} > { > toolkits: string[], > mode?: any | all, > session_id?: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > result_type: completed | failed, > data: { > }, > error?: string | null, > log_id: string > } | { > result_type: input_required, > input_requests: { > }, > request_state?: string > } > ``` *** ## Sessions ### create `sessions.create` Create a tool router session for a user **Risk:** `write` ```ts theme={null} await corsair.composio.api.sessions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | | `toolkits` | `object` | No | Allowlist (enable) or denylist (disable) of toolkit slugs | > **toolkits full type** > > ```ts theme={null} > { > enable: string[] > } | { > disable: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `mcp` | `object` | Yes | — | | `tool_router_tools` | `string[]` | Yes | — | | `config` | `object` | No | — | | `config_version` | `number` | No | — | > **mcp full type** > > ```ts theme={null} > { > type: http, > url: string > } > ``` > **config full type** > > ```ts theme={null} > { > user_id?: string > } > ``` *** ## Toolkits ### list `toolkits.list` List toolkits **Risk:** `read` ```ts theme={null} await corsair.composio.api.toolkits.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category` | `string` | No | — | | `managed_by` | `composio \| all \| project` | No | — | | `type` | `native \| custom \| all` | No | — | | `sort_by` | `usage \| alphabetically` | No | — | | `search` | `string` | No | — | | `include_deprecated` | `boolean` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `total_pages` | `number` | Yes | — | | `current_page` | `number` | Yes | — | | `total_items` | `number` | Yes | — | > **items full type** > > ```ts theme={null} > { > slug: string, > name: string, > type: string, > auth_schemes?: string[], > no_auth?: boolean, > composio_managed_auth_schemes?: string[], > is_local_toolkit?: boolean, > auth_guide_url?: string | null, > meta: { > created_at?: string, > updated_at?: string, > description?: string, > logo?: string, > app_url?: string | null, > categories?: { > id: string, > name: string > }[], > triggers_count?: number, > tools_count?: number, > version?: string > } > }[] > ``` *** ## Tools ### execute `tools.execute` Execute a tool by slug **Risk:** `write` ```ts theme={null} await corsair.composio.api.tools.execute({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tool_slug` | `string` | Yes | — | | `arguments` | `object` | Yes | Arguments the tool takes | | `connected_account_id` | `string` | No | — | | `user_id` | `string` | No | — | | `version` | `string` | No | Toolkit version. Composio runs the latest when omitted. | > **arguments full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | JSON object mapping string keys to JSON values | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | | `log_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### get `tools.get` Get a tool by slug **Risk:** `read` ```ts theme={null} await corsair.composio.api.tools.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tool_slug` | `string` | Yes | — | | `version` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | Yes | — | | `toolkit` | `object` | Yes | — | | `input_parameters` | `object` | Yes | JSON object mapping string keys to JSON values | | `output_parameters` | `object` | Yes | JSON object mapping string keys to JSON values | | `no_auth` | `boolean` | Yes | — | | `version` | `string` | Yes | — | | `available_versions` | `string[]` | Yes | — | | `scopes` | `string[]` | No | — | | `tags` | `string[]` | Yes | — | | `human_description` | `string` | No | — | | `is_deprecated` | `boolean` | Yes | — | > **toolkit full type** > > ```ts theme={null} > { > slug: string, > name: string, > logo?: string > } > ``` > **input\_parameters full type** > > ```ts theme={null} > { > } > ``` > **output\_parameters full type** > > ```ts theme={null} > { > } > ``` *** ### list `tools.list` List Composio tools **Risk:** `read` ```ts theme={null} await corsair.composio.api.tools.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `toolkit_slug` | `string` | No | — | | `tool_slugs` | `string` | No | Comma-separated tool slugs | | `query` | `string` | No | — | | `important` | `true \| false` | No | — | | `include_deprecated` | `boolean` | No | — | | `toolkit_versions` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `total_pages` | `number` | Yes | — | | `current_page` | `number` | Yes | — | | `total_items` | `number` | Yes | — | > **items full type** > > ```ts theme={null} > { > slug: string, > name: string, > description: string, > toolkit: { > slug: string, > name: string, > logo?: string > }, > input_parameters: { > }, > output_parameters: { > }, > no_auth: boolean, > version: string, > available_versions: string[], > scopes?: string[], > tags: string[], > human_description?: string, > is_deprecated: boolean > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/composio/database Composio local sync: searchable entities, `.search()` filters, and operators. The Composio plugin syncs data locally. Use `corsair.composio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Connected Accounts Path: `composio.db.connectedAccounts.search` ```ts theme={null} const rows = await corsair.composio.db.connectedAccounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `status_reason` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `word_id` | `string` | equals, contains, startsWith, endsWith, in | | `authScheme` | `string` | equals, contains, startsWith, endsWith, in | | `is_disabled` | `boolean` | equals | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sessions Path: `composio.db.sessions.search` ```ts theme={null} const rows = await corsair.composio.db.sessions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `session_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `config_version` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Toolkits Path: `composio.db.toolkits.search` ```ts theme={null} const rows = await corsair.composio.db.toolkits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `is_local_toolkit` | `boolean` | equals | | `no_auth` | `boolean` | equals | | `auth_guide_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tools Path: `composio.db.tools.search` ```ts theme={null} const rows = await corsair.composio.db.tools.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `no_auth` | `boolean` | equals | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `human_description` | `string` | equals, contains, startsWith, endsWith, in | | `is_deprecated` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/composio/overview Composio plugin for Corsair Use **Composio** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 27 typed API operations * 4 synced entities (`connectedAccounts`, `sessions`, `toolkits`, `tools`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/composio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/composio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/composio ``` ```bash bun theme={null} bun add corsair @corsair-dev/composio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { composio } from '@corsair-dev/composio'; export const corsair = createCorsair({ plugins: [ composio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} composio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'composio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`connections.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.composio.api.connections.list({}); ``` **`connections.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.composio.api.connections.create({}); ``` See the full list on the [API](/plugins/composio/api) page. ## Query synced data Synced entities support `tenant.composio.db..search()` and `.list()`: `connectedAccounts`, `sessions`, `toolkits`, `tools`. See [Database](/plugins/composio/database) for filters and operators. ## What's next > **[API reference](/plugins/composio/api)** > > Every `composio.api.*` operation with input and output types. > **[Database](/plugins/composio/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/confluence/api API reference for Confluence: every `confluence.api.*` operation with input and output types. Every `confluence.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Pages ### get `pages.get` List Confluence pages **Risk:** `read` ```ts theme={null} await corsair.confluence.api.pages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | No | Filter by space ID | | `title` | `string` | No | Filter pages by title | | `status` | `current \| trashed \| draft` | No | Filter pages by content status | | `cursor` | `string` | No | Pagination cursor | | `limit` | `number` | No | Maximum number of pages to return | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `_links` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > status?: string, > title: string, > spaceId?: string, > parentId?: string | null, > parentType?: string | null, > authorId?: string, > createdAt?: string, > version?: { > createdAt?: string, > message?: string, > number?: number, > minorEdit?: boolean, > authorId?: string > }, > body?: { > storage?: { > value?: string, > representation?: string > }, > atlas_doc_format?: { > value?: string, > representation?: string > } > }, > _links?: { > webui?: string, > editui?: string, > tinyui?: string, > self?: string > } > }[] > ``` > **\_links full type** > > ```ts theme={null} > { > next?: string, > base?: string, > self?: string > } > ``` *** ### search `pages.search` Search Confluence pages via CQL **Risk:** `read` ```ts theme={null} await corsair.confluence.api.pages.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cql` | `string` | Yes | Confluence Query Language (CQL) query string | | `cqlcontext` | `string` | No | Context for the CQL query | | `includeArchivedSpaces` | `boolean` | No | Include archived spaces in results | | `limit` | `number` | No | Maximum results | | `start` | `number` | No | Pagination offset for the first result | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `start` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `size` | `number` | Yes | — | | `totalSize` | `number` | No | — | | `cqlQuery` | `string` | No | — | | `searchDuration` | `number` | No | — | | `archivedResultCount` | `number` | No | — | | `_links` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > content: { > id: string, > type: string, > status?: string, > title: string, > childTypes?: { > }, > macroRenderedOutput?: { > }, > restrictions?: { > }, > _expandable?: { > }, > _links?: { > webui?: string, > self?: string, > tinyui?: string > } > }, > title: string, > excerpt?: string, > url?: string, > resultGlobalContainer?: { > title: string, > displayUrl: string > }, > breadcrumbs?: any[], > entityType?: string, > iconCssClass?: string, > lastModified?: string, > friendlyLastModified?: string, > score?: number > }[] > ``` > **\_links full type** > > ```ts theme={null} > { > base?: string, > context?: string, > self?: string > } > ``` *** ## Spaces ### list `spaces.list` List Confluence spaces **Risk:** `read` ```ts theme={null} await corsair.confluence.api.spaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | No | Filter by space key | | `type` | `global \| personal` | No | Filter by space type | | `status` | `current \| archived` | No | Filter by space status | | `label` | `string` | No | Filter by space label | | `cursor` | `string` | No | Pagination cursor | | `limit` | `number` | No | Maximum number of spaces to return | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `start` | `number` | No | — | | `limit` | `number` | No | — | | `size` | `number` | No | — | | `_links` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > ari?: string, > key: string, > alias?: string, > name: string, > type?: string, > status?: string, > description?: any, > homepage?: any, > _expandable?: { > }, > _links?: { > } > }[] > ``` > **\_links full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/confluence/database Confluence local sync: searchable entities, `.search()` filters, and operators. The Confluence plugin syncs data locally. Use `corsair.confluence.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/confluence/overview Team wiki and documentation platform for knowledge bases and collaborative page editing. Use **Confluence** through Corsair: one client, typed API calls. **What you get:** * 3 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/confluence ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/confluence ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/confluence ``` ```bash bun theme={null} bun add corsair @corsair-dev/confluence ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { confluence } from '@corsair-dev/confluence'; export const corsair = createCorsair({ plugins: [ confluence(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} confluence() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Confluence OAuth app. ```ts theme={null} confluence({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'confluence', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`pages.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.confluence.api.pages.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/confluence/api) reference.* See the full list on the [API](/plugins/confluence/api) page. ## What's next > **[API reference](/plugins/confluence/api)** > > Every `confluence.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/connecteam/api API reference for Connecteam: every `connecteam.api.*` operation with input and output types. Every `connecteam.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Attachments ### generateUploadUrl `attachments.generateUploadUrl` Generate a time-limited pre-signed file upload URL **Risk:** `write` ```ts theme={null} await corsair.connecteam.api.attachments.generateUploadUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileName` | `string` | Yes | — | | `featureType` | `chat \| shiftscheduler \| users \| quicktasks` | Yes | — | | `fileTypeHint` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > fileId: string, > uploadFileUrl: string > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Chat ### get `chat.get` List team chats and channels **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.chat.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > conversations?: { > id?: number | string, > conversationId?: number | string, > type?: string | null, > title?: string | null > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Custom Field Categories ### get `customFieldCategories.get` List custom field categories **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.customFieldCategories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `ids` | `number[]` | No | — | | `names` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > categories: { > id: number, > name?: string | null > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Custom Fields ### get `customFields.get` List custom fields with optional filters and pagination **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.customFields.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `customFieldTypes` | `string[]` | No | — | | `customFieldIds` | `number[]` | No | — | | `names` | `string[]` | No | — | | `categoryIds` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > customFields: { > id: number, > name?: string | null, > type?: string | null, > categoryId?: number | null, > isRequired?: boolean | null, > isVisibleToAllAdmins?: boolean | null, > isEditableForAllAdmins?: boolean | null, > isVisibleToUsers?: boolean | null, > isEditableForUsers?: boolean | null, > isMultiSelect?: boolean | null, > dropdownOptions?: any[] > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Forms ### get `forms.get` List form definitions **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.forms.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > forms: { > formId: number, > formName?: string | null, > createdAt?: number | null, > lastUpdatedAt?: number | null, > questions?: any[], > settings?: any > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Jobs ### get `jobs.get` List jobs for a scheduler or time clock instance **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.jobs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instanceIds` | `number[]` | No | — | | `jobIds` | `string[]` | No | — | | `jobNames` | `string[]` | No | — | | `jobCodes` | `string[]` | No | — | | `includeDeleted` | `boolean` | No | — | | `sort` | `title` | No | — | | `order` | `asc \| desc` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > jobs: { > jobId: string, > title?: string | null, > code?: string | null, > color?: string | null, > description?: string | null, > gps?: any, > isDeleted?: boolean | null, > assign?: any, > useParentData?: boolean | null, > parentId?: string | null, > subJobs?: any[], > instanceIds?: number[], > customFields?: any[] > }[], > paging?: { > offset?: number > } > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Me ### list `me.list` Get Connecteam account company name and company ID **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.me.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > companyId: string, > companyName?: string | null > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Performance Indicators ### get `performanceIndicators.get` List performance metric indicators **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.performanceIndicators.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > indicators?: { > id?: string | number, > name?: string | null > }[], > performanceIndicators?: { > id?: string | number, > name?: string | null > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Policy Types ### get `policyTypes.get` List time-off policy types **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.policyTypes.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > policyTypes?: { > id?: string | number, > policyTypeId?: string | number, > name?: string | null, > policies?: { > id?: string | number, > name?: string | null, > unit?: string | null, > accrualType?: string | null > }[] > }[], > policies?: { > id?: string | number, > policyTypeId?: string | number, > name?: string | null, > policies?: { > id?: string | number, > name?: string | null, > unit?: string | null, > accrualType?: string | null > }[] > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Publishers ### get `publishers.get` List custom publishers **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.publishers.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > publishers?: { > id?: number, > publisherId?: number | null, > name?: string | null > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Schedulers ### get `schedulers.get` List job schedulers **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.schedulers.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > schedulers: { > schedulerId: number, > name?: string | null, > isArchived?: boolean | null, > timezone?: string | null > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Smart Groups ### get `smartGroups.get` List smart groups **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.smartGroups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > groups?: { > id?: number, > smartGroupId?: number | null, > name?: string | null, > groupSegmentId?: number | null, > description?: string | null > }[], > smartGroups?: { > id?: number, > smartGroupId?: number | null, > name?: string | null, > groupSegmentId?: number | null, > description?: string | null > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Task Boards ### get `taskBoards.get` List task boards **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.taskBoards.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > taskBoards?: { > id?: number | string, > taskBoardId?: number | null, > name?: string | null, > title?: string | null, > isArchived?: boolean | null > }[], > taskboards?: { > id?: number | string, > taskBoardId?: number | null, > name?: string | null, > title?: string | null, > isArchived?: boolean | null > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ## Users ### archive `users.archive` Archive Connecteam users by ID without deleting records **Risk:** `write` ```ts theme={null} await corsair.connecteam.api.users.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userIds` | `number[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | *** ### create `users.create` Create users in Connecteam **Risk:** `write` ```ts theme={null} await corsair.connecteam.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | | `sendActivation` | `boolean` | No | — | > **users full type** > > ```ts theme={null} > { > firstName: string, > lastName?: string, > phoneNumber: string, > email?: string, > userType?: user, > isArchived?: boolean, > customFields?: any[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | No | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > results?: { > userId: number, > firstName?: string | null, > lastName?: string | null, > phoneNumber?: string | null, > userType?: string | null, > email?: string | null, > customFields?: any[], > isArchived?: boolean | null, > kioskCode?: string | null, > createdAt?: number | null, > modifiedAt?: number | null, > archivedAt?: number | null, > lastLogin?: number | null, > smartGroupsIds?: number[], > invitedToBeManager?: boolean | null, > profilePictureUrl?: string | null, > mobileDevice?: string | null, > osVersion?: string | null, > appVersion?: string | null, > mobileDeviceId?: string | null > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** ### get `users.get` List Connecteam users with optional filters and pagination **Risk:** `read` ```ts theme={null} await corsair.connecteam.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `sort` | `created_at` | No | — | | `order` | `asc \| desc` | No | — | | `userIds` | `number[]` | No | — | | `userStatus` | `active \| archived \| all` | No | — | | `fullNames` | `string[]` | No | — | | `phoneNumbers` | `string[]` | No | — | | `emailAddresses` | `string[]` | No | — | | `createdAt` | `number` | No | — | | `modifiedAt` | `number` | No | — | | `lastLogin` | `number` | No | — | | `archivedAt` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | No | — | | `data` | `object` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > users: { > userId: number, > firstName?: string | null, > lastName?: string | null, > phoneNumber?: string | null, > userType?: string | null, > email?: string | null, > customFields?: any[], > isArchived?: boolean | null, > kioskCode?: string | null, > createdAt?: number | null, > modifiedAt?: number | null, > archivedAt?: number | null, > lastLogin?: number | null, > smartGroupsIds?: number[], > invitedToBeManager?: boolean | null, > profilePictureUrl?: string | null, > mobileDevice?: string | null, > osVersion?: string | null, > appVersion?: string | null, > mobileDeviceId?: string | null > }[] > } > ``` > **paging full type** > > ```ts theme={null} > { > offset?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/connecteam/database Connecteam local sync: searchable entities, `.search()` filters, and operators. The Connecteam plugin syncs data locally. Use `corsair.connecteam.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Account Path: `connecteam.db.account.search` ```ts theme={null} const rows = await corsair.connecteam.db.account.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `companyId` | `string` | equals, contains, startsWith, endsWith, in | | `companyName` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Conversations Path: `connecteam.db.conversations.search` ```ts theme={null} const rows = await corsair.connecteam.db.conversations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Custom Field Categories Path: `connecteam.db.customFieldCategories.search` ```ts theme={null} const rows = await corsair.connecteam.db.customFieldCategories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Custom Fields Path: `connecteam.db.customFields.search` ```ts theme={null} const rows = await corsair.connecteam.db.customFields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `categoryId` | `number` | equals, gt, gte, lt, lte, in | | `isRequired` | `boolean` | equals | | `isVisibleToAllAdmins` | `boolean` | equals | | `isEditableForAllAdmins` | `boolean` | equals | | `isVisibleToUsers` | `boolean` | equals | | `isEditableForUsers` | `boolean` | equals | | `isMultiSelect` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Forms Path: `connecteam.db.forms.search` ```ts theme={null} const rows = await corsair.connecteam.db.forms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `formId` | `number` | equals, gt, gte, lt, lte, in | | `formName` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `lastUpdatedAt` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `connecteam.db.jobs.search` ```ts theme={null} const rows = await corsair.connecteam.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `isDeleted` | `boolean` | equals | | `useParentData` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Performance Indicators Path: `connecteam.db.performanceIndicators.search` ```ts theme={null} const rows = await corsair.connecteam.db.performanceIndicators.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Policy Types Path: `connecteam.db.policyTypes.search` ```ts theme={null} const rows = await corsair.connecteam.db.policyTypes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Publishers Path: `connecteam.db.publishers.search` ```ts theme={null} const rows = await corsair.connecteam.db.publishers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `publisherId` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Schedulers Path: `connecteam.db.schedulers.search` ```ts theme={null} const rows = await corsair.connecteam.db.schedulers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `schedulerId` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `isArchived` | `boolean` | equals | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Smart Groups Path: `connecteam.db.smartGroups.search` ```ts theme={null} const rows = await corsair.connecteam.db.smartGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `smartGroupId` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `groupSegmentId` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Task Boards Path: `connecteam.db.taskBoards.search` ```ts theme={null} const rows = await corsair.connecteam.db.taskBoards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `taskBoardId` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `isArchived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `connecteam.db.users.search` ```ts theme={null} const rows = await corsair.connecteam.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `number` | equals, gt, gte, lt, lte, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `phoneNumber` | `string` | equals, contains, startsWith, endsWith, in | | `userType` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `isArchived` | `boolean` | equals | | `kioskCode` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `modifiedAt` | `number` | equals, gt, gte, lt, lte, in | | `archivedAt` | `number` | equals, gt, gte, lt, lte, in | | `lastLogin` | `number` | equals, gt, gte, lt, lte, in | | `invitedToBeManager` | `boolean` | equals | | `profilePictureUrl` | `string` | equals, contains, startsWith, endsWith, in | | `mobileDevice` | `string` | equals, contains, startsWith, endsWith, in | | `osVersion` | `string` | equals, contains, startsWith, endsWith, in | | `appVersion` | `string` | equals, contains, startsWith, endsWith, in | | `mobileDeviceId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/connecteam/overview Workforce management app for deskless teams, scheduling, chat, and mobile operations. Use **Connecteam** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 16 typed API operations * 13 synced entities (`account`, `conversations`, `customFieldCategories`, `customFields`, `forms`, `jobs`, and 7 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/connecteam ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/connecteam ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/connecteam ``` ```bash bun theme={null} bun add corsair @corsair-dev/connecteam ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { connecteam } from '@corsair-dev/connecteam'; export const corsair = createCorsair({ plugins: [ connecteam(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} connecteam() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'connecteam', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`chat.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.connecteam.api.chat.get({}); ``` **`attachments.generateUploadUrl`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.connecteam.api.attachments.generateUploadUrl({}); ``` See the full list on the [API](/plugins/connecteam/api) page. ## Query synced data Synced entities support `tenant.connecteam.db..search()` and `.list()`: `account`, `conversations`, `customFieldCategories`, `customFields`, `forms`, `jobs`, `performanceIndicators`, `policyTypes`, `publishers`, `schedulers`, `smartGroups`, `taskBoards`, `users`. See [Database](/plugins/connecteam/database) for filters and operators. ## What's next > **[API reference](/plugins/connecteam/api)** > > Every `connecteam.api.*` operation with input and output types. > **[Database](/plugins/connecteam/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/contactout/api API reference for ContactOut: every `contactout.api.*` operation with input and output types. Every `contactout.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### stats `account.stats` Get email, phone, and search credit usage for a month **Risk:** `read` ```ts theme={null} await corsair.contactout.api.account.stats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `period` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `period` | `object` | Yes | — | | `usage` | `object` | Yes | — | > **period full type** > > ```ts theme={null} > { > start: string, > end: string > } > ``` > **usage full type** > > ```ts theme={null} > { > count: number, > quota: number, > remaining?: number | null, > over_quota?: number | null, > phone_count: number, > phone_quota: number, > phone_remaining?: number | null, > phone_over_quota?: number | null, > search_count: number, > search_quota: number, > search_remaining?: number | null, > search_over_quota?: number | null > } > ``` *** ## Company ### enrichDomains `company.enrichDomains` Get company details for up to 30 domains **Risk:** `read` ```ts theme={null} await corsair.contactout.api.company.enrichDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domains` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `companies` | `object[]` | Yes | — | > **companies full type** > > ```ts theme={null} > { > } | { > }[] > ``` *** ### search `company.search` Search companies by name, domain, size, location, industry, technology, revenue, or founding year **Risk:** `read` ```ts theme={null} await corsair.contactout.api.company.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `linkedin_url` | `string[]` | No | — | | `name` | `string[]` | No | — | | `domain` | `string[]` | No | — | | `size` | `string[]` | No | — | | `hq_only` | `boolean` | No | — | | `location` | `string[]` | No | — | | `industries` | `string[]` | No | — | | `technologies` | `string[]` | No | — | | `min_revenue` | `number` | No | — | | `max_revenue` | `number` | No | — | | `year_founded_from` | `number` | No | — | | `year_founded_to` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `metadata` | `object` | Yes | — | | `companies` | `object[]` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > page: number, > page_size: number, > total_results: number > } > ``` > **companies full type** > > ```ts theme={null} > { > name?: string | null, > url?: string | null, > li_vanity?: string | null, > linkedin_company_id?: number | null, > domain?: string | null, > email_domain?: string | null, > overview?: string | null, > description?: string | null, > type?: string | null, > size?: number | null, > country?: string | null, > revenue?: number | string | null, > founded_at?: number | null, > industry?: string | null, > headquarter?: string | null, > website?: string | null, > location?: string | null, > logo_url?: string | null, > specialties?: string[], > technologies?: string[], > locations?: ( > string | { > city?: string | null, > line1?: string | null, > line2?: string | null, > state?: string | null, > country?: string | null, > postalCode?: string | null, > description?: string | null, > isPrimary?: boolean > } > )[], > employees?: number | null, > followers?: number | null, > funding?: { > total_funding_usd?: number | null, > rounds?: { > funding_type?: string | null, > announced_date?: string | null, > investor_names?: string[], > lead_investors?: string[], > money_raised_usd?: number | null, > number_of_investors?: number | null > }[], > funding_status?: string | null, > latest_date?: string | null, > number_of_funding_rounds?: number | null > } | null > }[] > ``` *** ## Email ### enrich `email.enrich` Get the profile behind an email address **Risk:** `read` ```ts theme={null} await corsair.contactout.api.email.enrich({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `include` | `work_email` | No | — | | `emailType` | `work \| personal` | No | Send the work-email key (default) or the personal-email key | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `profile` | `object` | Yes | — | > **profile full type** > > ```ts theme={null} > { > email?: string | null, > workEmail?: string | null, > workEmailStatus?: string | null, > fullName?: string | null, > headline?: string | null, > industry?: string | null, > linkedinUrl?: string | null, > profilePictureUrl?: string | null, > confidenceLevel?: string | null, > altMatches?: string[], > phone?: string | null, > twitter?: string | null, > github?: string | null, > experience?: { > title?: string | null, > summary?: string | null, > locality?: string | null, > company_name?: string | null, > linkedin_url?: string | null, > domain?: string | null, > logo_url?: string | null, > start_date?: string | null, > end_date?: string | null, > is_current?: boolean | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > education?: { > school_name?: string | null, > degree?: string | null, > field_of_study?: string | null, > description?: string | null, > url?: string | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > volunteeringExperiences?: { > role?: string | null, > company_name?: string | null, > company_url?: string | null, > cause?: string | null, > company_id?: number | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > jobFunction?: string | null, > workStatus?: string | null, > updatedAt?: string | null, > company?: { > name?: string | null, > url?: string | null, > li_vanity?: string | null, > linkedin_company_id?: number | null, > domain?: string | null, > email_domain?: string | null, > overview?: string | null, > description?: string | null, > type?: string | null, > size?: number | null, > country?: string | null, > revenue?: number | string | null, > founded_at?: number | null, > industry?: string | null, > headquarter?: string | null, > website?: string | null, > location?: string | null, > logo_url?: string | null, > specialties?: string[], > technologies?: string[], > locations?: ( > string | { > city?: string | null, > line1?: string | null, > line2?: string | null, > state?: string | null, > country?: string | null, > postalCode?: string | null, > description?: string | null, > isPrimary?: boolean > } > )[], > employees?: number | null, > followers?: number | null, > funding?: { > total_funding_usd?: number | null, > rounds?: { > funding_type?: string | null, > announced_date?: string | null, > investor_names?: string[], > lead_investors?: string[], > money_raised_usd?: number | null, > number_of_investors?: number | null > }[], > funding_status?: string | null, > latest_date?: string | null, > number_of_funding_rounds?: number | null > } | null > } | null, > location?: string | null, > languages?: { > name?: string | null, > proficiency?: string | null > }[], > summary?: string | null, > skills?: string[], > certifications?: { > name?: string | null, > title?: string | null, > authority?: string | null, > license?: string | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > publications?: { > url?: string | null, > title?: string | null, > description?: string | null, > publisher?: string | null, > authors?: string[], > published_on_year?: number | null, > published_on_month?: number | null, > published_on_day?: number | null > }[], > projects?: { > title?: string | null, > description?: string | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > followers?: number | null, > seniority?: string | null > } > ``` *** ### toLinkedin `email.toLinkedin` Get the LinkedIn profile URL for an email address **Risk:** `read` ```ts theme={null} await corsair.contactout.api.email.toLinkedin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `profile` | `object` | Yes | — | > **profile full type** > > ```ts theme={null} > { > email?: string | null, > linkedin?: string | null > } > ``` *** ### verify `email.verify` Verify whether an email address is deliverable **Risk:** `read` ```ts theme={null} await corsair.contactout.api.email.verify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > status: valid | invalid | accept_all | disposable | unknown > } > ``` *** ## Linkedin ### contactInfo `linkedin.contactInfo` Get only the emails and phones for a LinkedIn profile **Risk:** `read` ```ts theme={null} await corsair.contactout.api.linkedin.contactInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile` | `string` | Yes | — | | `include_phone` | `boolean` | No | — | | `email_type` | `personal \| work \| personal,work \| none` | No | — | | `emailType` | `work \| personal` | No | Send the work-email key (default) or the personal-email key | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `profile` | `object` | Yes | — | > **profile full type** > > ```ts theme={null} > { > url?: string | null, > email?: string[], > work_email?: string[], > work_email_status?: { > }, > personal_email?: string[], > phone?: string[], > github?: string[] > } > ``` *** ### enrich `linkedin.enrich` Get a full LinkedIn profile with emails and phones; emailType picks the work or personal key **Risk:** `read` ```ts theme={null} await corsair.contactout.api.linkedin.enrich({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile` | `string` | Yes | — | | `profile_only` | `boolean` | No | — | | `emailType` | `work \| personal` | No | Send the work-email key (default) or the personal-email key | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `profile` | `object` | Yes | — | > **profile full type** > > ```ts theme={null} > { > url?: string | null, > email?: string[], > work_email?: string[], > personal_email?: string[], > phone?: string[], > github?: string[], > twitter?: string[], > full_name?: string | null, > headline?: string | null, > industry?: string | null, > country?: string | null, > experience?: { > title?: string | null, > summary?: string | null, > locality?: string | null, > company_name?: string | null, > linkedin_url?: string | null, > domain?: string | null, > logo_url?: string | null, > start_date?: string | null, > end_date?: string | null, > is_current?: boolean | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > education?: { > school_name?: string | null, > degree?: string | null, > field_of_study?: string | null, > description?: string | null, > url?: string | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > volunteering_experiences?: { > role?: string | null, > company_name?: string | null, > company_url?: string | null, > cause?: string | null, > company_id?: number | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > job_function?: string | null, > work_status?: string | null, > profile_picture_url?: string | null, > updated_at?: string | null, > company?: { > name?: string | null, > url?: string | null, > li_vanity?: string | null, > linkedin_company_id?: number | null, > domain?: string | null, > email_domain?: string | null, > overview?: string | null, > description?: string | null, > type?: string | null, > size?: number | null, > country?: string | null, > revenue?: number | string | null, > founded_at?: number | null, > industry?: string | null, > headquarter?: string | null, > website?: string | null, > location?: string | null, > logo_url?: string | null, > specialties?: string[], > technologies?: string[], > locations?: ( > string | { > city?: string | null, > line1?: string | null, > line2?: string | null, > state?: string | null, > country?: string | null, > postalCode?: string | null, > description?: string | null, > isPrimary?: boolean > } > )[], > employees?: number | null, > followers?: number | null, > funding?: { > total_funding_usd?: number | null, > rounds?: { > funding_type?: string | null, > announced_date?: string | null, > investor_names?: string[], > lead_investors?: string[], > money_raised_usd?: number | null, > number_of_investors?: number | null > }[], > funding_status?: string | null, > latest_date?: string | null, > number_of_funding_rounds?: number | null > } | null > } | null, > location?: string | null, > languages?: { > name?: string | null, > proficiency?: string | null > }[], > summary?: string | null, > skills?: string[], > certifications?: { > name?: string | null, > title?: string | null, > authority?: string | null, > license?: string | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > publications?: { > url?: string | null, > title?: string | null, > description?: string | null, > publisher?: string | null, > authors?: string[], > published_on_year?: number | null, > published_on_month?: number | null, > published_on_day?: number | null > }[], > projects?: { > title?: string | null, > description?: string | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > followers?: number | null, > seniority?: string | null > } | tuple > ``` *** ### personalEmailStatus `linkedin.personalEmailStatus` Check whether a LinkedIn profile has a personal email (free) **Risk:** `read` ```ts theme={null} await corsair.contactout.api.linkedin.personalEmailStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `profile` | `object` | Yes | — | > **profile full type** > > ```ts theme={null} > { > email: boolean > } > ``` *** ### phoneStatus `linkedin.phoneStatus` Check whether a LinkedIn profile has a phone number (free) **Risk:** `read` ```ts theme={null} await corsair.contactout.api.linkedin.phoneStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `profile` | `object` | Yes | — | > **profile full type** > > ```ts theme={null} > { > phone: boolean > } > ``` *** ### workEmailStatus `linkedin.workEmailStatus` Check whether a LinkedIn profile has a work email (free) **Risk:** `read` ```ts theme={null} await corsair.contactout.api.linkedin.workEmailStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `profile` | `object` | Yes | — | > **profile full type** > > ```ts theme={null} > { > email: boolean, > email_status?: string | null > } > ``` *** ## People ### count `people.count` Count profiles matching search filters (free) **Risk:** `read` ```ts theme={null} await corsair.contactout.api.people.count({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `job_title` | `string[]` | No | — | | `past_job_title` | `string[]` | No | — | | `exclude_job_titles` | `string[]` | No | — | | `job_function` | `string[]` | No | — | | `seniority` | `string[]` | No | — | | `current_titles_only` | `boolean` | No | — | | `include_related_job_titles` | `boolean` | No | — | | `match_experience` | `current \| past \| both` | No | — | | `skills` | `string[]` | No | — | | `languages` | `object[]` | No | — | | `education` | `string[]` | No | — | | `educations` | `object[]` | No | — | | `location` | `string[]` | No | — | | `location_radius` | `number` | No | — | | `current_work_location` | `string[]` | No | — | | `past_work_location` | `string[]` | No | — | | `company` | `string[]` | No | — | | `past_company` | `string[]` | No | — | | `company_filter` | `current \| past \| past_only \| both` | No | — | | `current_company_only` | `boolean` | No | — | | `exclude_companies` | `string[]` | No | — | | `exclude_companies_filter` | `current \| past \| both` | No | — | | `domain` | `string[]` | No | — | | `industry` | `string[]` | No | — | | `keyword` | `string` | No | — | | `company_size` | `string[]` | No | — | | `years_of_experience` | `string[]` | No | — | | `years_in_current_role` | `string[]` | No | — | | `recently_changed_jobs` | `boolean` | No | — | | `is_currently_working` | `boolean` | No | — | > **languages full type** > > ```ts theme={null} > { > language: string, > proficiency?: string[] > }[] > ``` > **educations full type** > > ```ts theme={null} > { > school_name?: string, > field_of_study?: string, > location?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `total_results` | `number` | Yes | — | | `estimated_personal_emails` | `number` | No | — | | `estimated_work_emails` | `number` | No | — | | `estimated_phones` | `number` | No | — | *** ### decisionMakers `people.decisionMakers` List a company's decision makers by domain, name, or LinkedIn URL **Risk:** `read` ```ts theme={null} await corsair.contactout.api.people.decisionMakers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `linkedin_url` | `string` | No | — | | `domain` | `string` | No | — | | `name` | `string` | No | — | | `page` | `number` | No | — | | `reveal_info` | `boolean` | No | — | | `emailType` | `work \| personal` | No | Send the work-email key (default) or the personal-email key | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `metadata` | `object` | Yes | — | | `profiles` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > page: number, > page_size: number, > total_results: number > } > ``` > **profiles full type** > > ```ts theme={null} > { > } | tuple > ``` *** ### enrich `people.enrich` Find a profile from a LinkedIn URL, email, phone, or name plus company, school, or location **Risk:** `read` ```ts theme={null} await corsair.contactout.api.people.enrich({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `linkedin_url` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `full_name` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `company` | `string[]` | No | — | | `company_domain` | `string[]` | No | — | | `education` | `string[]` | No | — | | `location` | `string` | No | — | | `job_title` | `string` | No | — | | `include` | `work_email \| personal_email \| phone[]` | No | — | | `emailType` | `work \| personal` | No | Send the work-email key (default) or the personal-email key | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `profile` | `object` | Yes | — | > **profile full type** > > ```ts theme={null} > { > url?: string | null, > email?: string[], > work_email?: string[], > personal_email?: string[], > phone?: string[], > github?: string[], > twitter?: string[], > full_name?: string | null, > headline?: string | null, > industry?: string | null, > country?: string | null, > experience?: { > title?: string | null, > summary?: string | null, > locality?: string | null, > company_name?: string | null, > linkedin_url?: string | null, > domain?: string | null, > logo_url?: string | null, > start_date?: string | null, > end_date?: string | null, > is_current?: boolean | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > education?: { > school_name?: string | null, > degree?: string | null, > field_of_study?: string | null, > description?: string | null, > url?: string | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > volunteering_experiences?: { > role?: string | null, > company_name?: string | null, > company_url?: string | null, > cause?: string | null, > company_id?: number | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > job_function?: string | null, > work_status?: string | null, > profile_picture_url?: string | null, > updated_at?: string | null, > company?: { > name?: string | null, > url?: string | null, > li_vanity?: string | null, > linkedin_company_id?: number | null, > domain?: string | null, > email_domain?: string | null, > overview?: string | null, > description?: string | null, > type?: string | null, > size?: number | null, > country?: string | null, > revenue?: number | string | null, > founded_at?: number | null, > industry?: string | null, > headquarter?: string | null, > website?: string | null, > location?: string | null, > logo_url?: string | null, > specialties?: string[], > technologies?: string[], > locations?: ( > string | { > city?: string | null, > line1?: string | null, > line2?: string | null, > state?: string | null, > country?: string | null, > postalCode?: string | null, > description?: string | null, > isPrimary?: boolean > } > )[], > employees?: number | null, > followers?: number | null, > funding?: { > total_funding_usd?: number | null, > rounds?: { > funding_type?: string | null, > announced_date?: string | null, > investor_names?: string[], > lead_investors?: string[], > money_raised_usd?: number | null, > number_of_investors?: number | null > }[], > funding_status?: string | null, > latest_date?: string | null, > number_of_funding_rounds?: number | null > } | null > } | null, > location?: string | null, > languages?: { > name?: string | null, > proficiency?: string | null > }[], > summary?: string | null, > skills?: string[], > certifications?: { > name?: string | null, > title?: string | null, > authority?: string | null, > license?: string | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > publications?: { > url?: string | null, > title?: string | null, > description?: string | null, > publisher?: string | null, > authors?: string[], > published_on_year?: number | null, > published_on_month?: number | null, > published_on_day?: number | null > }[], > projects?: { > title?: string | null, > description?: string | null, > start_date_year?: number | string | null, > start_date_month?: number | null, > end_date_year?: number | string | null, > end_date_month?: number | null > }[], > followers?: number | null, > seniority?: string | null > } > ``` *** ### search `people.search` Search profiles by title, company, location, skills, and more, 25 per page **Risk:** `read` ```ts theme={null} await corsair.contactout.api.people.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `job_title` | `string[]` | No | — | | `past_job_title` | `string[]` | No | — | | `exclude_job_titles` | `string[]` | No | — | | `job_function` | `string[]` | No | — | | `seniority` | `string[]` | No | — | | `current_titles_only` | `boolean` | No | — | | `include_related_job_titles` | `boolean` | No | — | | `match_experience` | `current \| past \| both` | No | — | | `skills` | `string[]` | No | — | | `languages` | `object[]` | No | — | | `education` | `string[]` | No | — | | `educations` | `object[]` | No | — | | `location` | `string[]` | No | — | | `location_radius` | `number` | No | — | | `current_work_location` | `string[]` | No | — | | `past_work_location` | `string[]` | No | — | | `company` | `string[]` | No | — | | `past_company` | `string[]` | No | — | | `company_filter` | `current \| past \| past_only \| both` | No | — | | `current_company_only` | `boolean` | No | — | | `exclude_companies` | `string[]` | No | — | | `exclude_companies_filter` | `current \| past \| both` | No | — | | `domain` | `string[]` | No | — | | `industry` | `string[]` | No | — | | `keyword` | `string` | No | — | | `company_size` | `string[]` | No | — | | `years_of_experience` | `string[]` | No | — | | `years_in_current_role` | `string[]` | No | — | | `recently_changed_jobs` | `boolean` | No | — | | `is_currently_working` | `boolean` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `data_types` | `personal_email \| work_email \| phone[]` | No | — | | `reveal_info` | `boolean` | No | — | | `detailed_experience` | `boolean` | No | — | | `detailed_education` | `boolean` | No | — | | `output_fields` | `string[]` | No | — | | `emailType` | `work \| personal` | No | Send the work-email key (default) or the personal-email key | > **languages full type** > > ```ts theme={null} > { > language: string, > proficiency?: string[] > }[] > ``` > **educations full type** > > ```ts theme={null} > { > school_name?: string, > field_of_study?: string, > location?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | Yes | — | | `metadata` | `object` | Yes | — | | `profiles` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > page: number, > page_size: number, > total_results: number > } > ``` > **profiles full type** > > ```ts theme={null} > { > } | tuple > ``` *** # Database Source: https://docs.corsair.dev/plugins/contactout/database ContactOut local sync: searchable entities, `.search()` filters, and operators. The ContactOut plugin syncs data locally. Use `corsair.contactout.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Companies Path: `contactout.db.companies.search` ```ts theme={null} const rows = await corsair.contactout.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `linkedinUrl` | `string` | equals, contains, startsWith, endsWith, in | | `industry` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `foundedAt` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Profiles Path: `contactout.db.profiles.search` ```ts theme={null} const rows = await corsair.contactout.db.profiles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `linkedinUrl` | `string` | equals, contains, startsWith, endsWith, in | | `fullName` | `string` | equals, contains, startsWith, endsWith, in | | `headline` | `string` | equals, contains, startsWith, endsWith, in | | `companyName` | `string` | equals, contains, startsWith, endsWith, in | | `companyDomain` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `seniority` | `string` | equals, contains, startsWith, endsWith, in | | `hasWorkEmail` | `boolean` | equals | | `hasPersonalEmail` | `boolean` | equals | | `hasPhone` | `boolean` | equals | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/contactout/overview ContactOut plugin for Corsair Use **ContactOut** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 15 typed API operations * 2 synced entities (`companies`, `profiles`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/contactout ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/contactout ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/contactout ``` ```bash bun theme={null} bun add corsair @corsair-dev/contactout ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { contactout } from '@corsair-dev/contactout'; export const corsair = createCorsair({ plugins: [ contactout(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} contactout() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'contactout', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.stats`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.contactout.api.account.stats({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/contactout/api) reference.* See the full list on the [API](/plugins/contactout/api) page. ## Query synced data Synced entities support `tenant.contactout.db..search()` and `.list()`: `companies`, `profiles`. See [Database](/plugins/contactout/database) for filters and operators. ## What's next > **[API reference](/plugins/contactout/api)** > > Every `contactout.api.*` operation with input and output types. > **[Database](/plugins/contactout/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/contentfulgraphql/api API reference for Contentful: every `contentfulgraphql.api.*` operation with input and output types. Every `contentfulgraphql.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Get Cma Token ### getCmaToken `getCmaToken` Get the stored Contentful access token, space ID, and environment ID **Risk:** `read` ```ts theme={null} await corsair.contentfulgraphql.api.getCmaToken({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `environment_id` | `string` | No | — | *** ## Graph Ql Content Api Persisted Query ### graphQlContentApiPersistedQuery `graphQlContentApiPersistedQuery` Run an automatic persisted query (APQ) against the Contentful GraphQL Content API using a SHA-256 hash **Risk:** `read` ```ts theme={null} await corsair.contentfulgraphql.api.graphQlContentApiPersistedQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `sha256Hash` | `string` | No | — | | `variables` | `object` | No | — | | `operationName` | `string` | No | — | > **variables full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ## Graph Ql Content Api Query ### graphQlContentApiQuery `graphQlContentApiQuery` Run a GraphQL query against the Contentful GraphQL Content API for the configured space and environment **Risk:** `read` ```ts theme={null} await corsair.contentfulgraphql.api.graphQlContentApiQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `variables` | `object` | No | — | | `operationName` | `string` | No | — | > **variables full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/contentfulgraphql/database Contentful local sync: searchable entities, `.search()` filters, and operators. The Contentful plugin syncs data locally. Use `corsair.contentfulgraphql.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/contentfulgraphql/overview Headless CMS for structured content modeling, delivery, and omnichannel publishing via GraphQL. Use **Contentful** through Corsair: one client, typed API calls. **What you get:** * 3 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/contentfulgraphql ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/contentfulgraphql ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/contentfulgraphql ``` ```bash bun theme={null} bun add corsair @corsair-dev/contentfulgraphql ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { contentfulgraphql } from '@corsair-dev/contentfulgraphql'; export const corsair = createCorsair({ plugins: [ contentfulgraphql(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} contentfulgraphql() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'contentfulgraphql', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`getCmaToken`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.contentfulgraphql.api.getCmaToken({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/contentfulgraphql/api) reference.* See the full list on the [API](/plugins/contentfulgraphql/api) page. ## What's next > **[API reference](/plugins/contentfulgraphql/api)** > > Every `contentfulgraphql.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/contextdev/api API reference for Context.dev: every `contextdev.api.*` operation with input and output types. Every `contextdev.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### usage `account.usage` Get the credit balance, current-period usage, and next refill **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.account.usage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `credits_remaining` | `number` | Yes | — | | `period` | `object` | No | — | | `next_refill` | `object` | No | — | | `auto_topup` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **period full type** > > ```ts theme={null} > { > start: string, > credits_used: number > } > ``` > **next\_refill full type** > > ```ts theme={null} > { > at: string, > credits: number > } > ``` > **auto\_topup full type** > > ```ts theme={null} > { > enabled: boolean, > credits_used_this_period: number, > monthly_budget_credits?: number | null > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ## Brand ### fonts `brand.fonts` List the fonts a website uses and how much of the page each covers **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.brand.fonts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `directUrl` | `string` | No | — | | `maxAgeMs` | `number` | No | — | | `timeoutOpts` | `object` | No | — | | `tags` | `string[]` | No | — | > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `finalDOMState` | `loaded \| still-loading` | No | — | | `status` | `string` | Yes | — | | `domain` | `string` | Yes | — | | `fonts` | `object[]` | Yes | — | | `fontLinks` | `object` | No | — | | `code` | `number` | Yes | — | | `cache_metadata` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **fonts full type** > > ```ts theme={null} > { > font: string, > uses: string[], > fallbacks: string[], > num_elements: number, > num_words: number, > percent_words: number, > percent_elements: number > }[] > ``` > **fontLinks full type** > > ```ts theme={null} > { > } > ``` > **cache\_metadata full type** > > ```ts theme={null} > { > status: hit | miss | zdr, > age_ms: number > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ### naics `brand.naics` Classify a brand or business description into NAICS codes **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.brand.naics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string` | Yes | Brand domain, title, or a description of the business | | `minResults` | `number` | No | — | | `maxResults` | `number` | No | — | | `timeoutOpts` | `object` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `partial` | `boolean` | No | — | | `status` | `string` | No | — | | `domain` | `string` | No | — | | `type` | `string` | No | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | | `codes` | `object[]` | No | — | > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` > **codes full type** > > ```ts theme={null} > { > code: string, > name: string, > confidence: high | medium | low > }[] > ``` *** ### prefetch `brand.prefetch` Queue brand or styleguide data so a later lookup returns sooner **Risk:** `write` ```ts theme={null} await corsair.contextdev.api.brand.prefetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `brand \| styleguide` | Yes | — | | `identifier` | `object` | Yes | — | | `timeoutOpts` | `object` | No | — | | `tags` | `string[]` | No | — | > **identifier full type** > > ```ts theme={null} > { > domain: string > } | { > email: string > } > ``` > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `message` | `string` | No | — | | `type` | `brand \| styleguide` | No | — | | `domain` | `string` | No | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ### retrieve `brand.retrieve` Get a brand profile (logos, colors, socials, address, industry) by domain, name, email, ticker, URL, or card transaction **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.brand.retrieve({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > type: by_domain, > domain: string, > force_language?: string | null, > maxSpeed?: boolean, > maxAgeMs?: number, > timeoutOpts?: { > milliseconds: number, > behavior?: fail | return-partial > }, > tags?: string[] > } | { > type: by_name, > name: string, > country_gl?: string, > force_language?: string | null, > maxSpeed?: boolean, > maxAgeMs?: number, > timeoutOpts?: { > milliseconds: number, > behavior?: fail | return-partial > }, > tags?: string[] > } | { > type: by_email, > email: string, > force_language?: string | null, > maxSpeed?: boolean, > maxAgeMs?: number, > timeoutOpts?: { > milliseconds: number, > behavior?: fail | return-partial > }, > tags?: string[] > } | { > type: by_ticker, > ticker: string, > ticker_exchange?: string, > force_language?: string | null, > maxSpeed?: boolean, > maxAgeMs?: number, > timeoutOpts?: { > milliseconds: number, > behavior?: fail | return-partial > }, > tags?: string[] > } | { > type: by_direct_url, > direct_url: string, > timeoutOpts?: { > milliseconds: number, > behavior?: fail | return-partial > }, > tags?: string[] > } | { > type: by_transaction, > transaction_info: string, > country_gl?: string, > city?: string, > mcc?: string | number, > phone?: string | number, > high_confidence_only?: boolean, > force_language?: string | null, > maxSpeed?: boolean, > maxAgeMs?: number, > timeoutOpts?: { > milliseconds: number, > behavior?: fail | return-partial > }, > tags?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `partial` | `boolean` | No | — | | `status` | `string` | Yes | — | | `brand` | `object` | Yes | — | | `code` | `number` | Yes | — | | `cache_metadata` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **brand full type** > > ```ts theme={null} > { > domain?: string, > title?: string, > description?: string, > slogan?: string, > colors?: { > hex?: string, > name?: string, > source?: site | logo > }[], > logos?: { > url?: string, > mode?: light | dark | has_opaque_background, > colors?: { > hex?: string, > name?: string > }[], > resolution?: { > width?: number, > height?: number, > aspect_ratio?: number > }, > type?: icon | logo > }[], > backdrops?: { > url?: string, > colors?: { > hex?: string, > name?: string > }[], > resolution?: { > width?: number, > height?: number, > aspect_ratio?: number > } > }[], > socials?: { > type?: string, > url?: string > }[], > address?: { > street?: string, > city?: string, > country?: string, > country_code?: string, > state_province?: string, > state_code?: string, > postal_code?: string > }, > stock?: { > ticker?: string, > exchange?: string > }, > employees?: { > range?: string, > exact?: number > }, > is_nsfw?: boolean, > email?: string, > phone?: string, > industries?: { > eic?: { > industry: string, > subindustry: string > }[] > }, > links?: { > careers?: string | null, > privacy?: string | null, > terms?: string | null, > contact?: string | null, > blog?: string | null, > pricing?: string | null > }, > primary_language?: string | null > } > ``` > **cache\_metadata full type** > > ```ts theme={null} > { > status: hit | miss | zdr, > age_ms: number > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ### search `brand.search` Find up to 10 brands by name or domain **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.brand.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `autocomplete` | `boolean` | No | — | | `queryBy` | `name \| domain[]` | No | — | | `typoTolerance` | `number` | No | — | | `tags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **results full type** > > ```ts theme={null} > { > domain: string, > name: string, > logo: string > }[] > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ### sic `brand.sic` Classify a brand or business description into SIC codes **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.brand.sic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string` | Yes | Brand domain, title, or a description of the business | | `minResults` | `number` | No | — | | `maxResults` | `number` | No | — | | `timeoutOpts` | `object` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | | `type` | `original_sic \| latest_sec` | No | — | > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `partial` | `boolean` | No | — | | `status` | `string` | No | — | | `domain` | `string` | No | — | | `type` | `string` | No | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | | `classification` | `original_sic \| latest_sec` | No | — | | `codes` | `object[]` | No | — | > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` > **codes full type** > > ```ts theme={null} > { > code: string, > name: string, > confidence: high | medium | low, > majorGroup?: string, > majorGroupName?: string, > office?: string > }[] > ``` *** ### styleguide `brand.styleguide` Extract a website's colors, typography, spacing, shadows, and button styles **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.brand.styleguide({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `directUrl` | `string` | No | — | | `maxAgeMs` | `number` | No | — | | `timeoutOpts` | `object` | No | — | | `colorScheme` | `light \| dark` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `finalDOMState` | `loaded \| still-loading` | No | — | | `status` | `string` | No | — | | `domain` | `string` | No | — | | `styleguide` | `object` | No | — | | `code` | `number` | No | — | | `cache_metadata` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **styleguide full type** > > ```ts theme={null} > { > mode: light | dark, > colors: { > accent: string, > background: string, > text: string > }, > typography: { > headings: { > h1?: { > fontFamily: string, > fontFallbacks: string[], > fontSize: string, > fontWeight: number, > lineHeight: string, > letterSpacing: string > }, > h2?: { > fontFamily: string, > fontFallbacks: string[], > fontSize: string, > fontWeight: number, > lineHeight: string, > letterSpacing: string > }, > h3?: { > fontFamily: string, > fontFallbacks: string[], > fontSize: string, > fontWeight: number, > lineHeight: string, > letterSpacing: string > }, > h4?: { > fontFamily: string, > fontFallbacks: string[], > fontSize: string, > fontWeight: number, > lineHeight: string, > letterSpacing: string > } > }, > p?: { > fontFamily: string, > fontFallbacks: string[], > fontSize: string, > fontWeight: number, > lineHeight: string, > letterSpacing: string > } > }, > elementSpacing: { > xs: string, > sm: string, > md: string, > lg: string, > xl: string > }, > shadows: { > sm: string, > md: string, > lg: string, > xl: string, > inner: string > }, > fontLinks: { > }, > components: { > button: { > primary?: { > backgroundColor: string, > color: string, > borderColor: string, > borderRadius: string, > borderWidth: string, > borderStyle: string, > padding: string, > minWidth: string, > minHeight: string, > fontSize: string, > fontWeight: number, > fontFamily?: string, > fontFallbacks?: string[], > textDecoration: string, > textDecorationColor?: string, > boxShadow: string, > css: string > }, > secondary?: { > backgroundColor: string, > color: string, > borderColor: string, > borderRadius: string, > borderWidth: string, > borderStyle: string, > padding: string, > minWidth: string, > minHeight: string, > fontSize: string, > fontWeight: number, > fontFamily?: string, > fontFallbacks?: string[], > textDecoration: string, > textDecorationColor?: string, > boxShadow: string, > css: string > }, > link?: { > backgroundColor: string, > color: string, > borderColor: string, > borderRadius: string, > borderWidth: string, > borderStyle: string, > padding: string, > minWidth: string, > minHeight: string, > fontSize: string, > fontWeight: number, > fontFamily?: string, > fontFallbacks?: string[], > textDecoration: string, > textDecorationColor?: string, > boxShadow: string, > css: string > } > }, > card?: { > backgroundColor: string, > borderColor: string, > borderRadius: string, > borderWidth: string, > borderStyle: string, > padding: string, > boxShadow: string, > textColor: string, > css: string > } > } > } > ``` > **cache\_metadata full type** > > ```ts theme={null} > { > status: hit | miss | zdr, > age_ms: number > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ## News ### search `news.search` Search company news by name, domain, ticker, or ISIN, paginated by cursor **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.news.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `searchBy` | `object` | Yes | — | | `filterBy` | `object` | No | — | | `sortBy` | `object` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `tags` | `string[]` | No | — | > **searchBy full type** > > ```ts theme={null} > { > type: entity, > entity: { > type: name, > name: string > } | { > type: domain, > domain: string > } | { > type: ticker, > ticker: string, > exchange?: string > } | { > type: isin, > isin: string > } > } > ``` > **filterBy full type** > > ```ts theme={null} > { > sourceDomain?: string[], > sourceCountry?: string[], > articleLanguage?: string[], > articleType?: editorial | press_release | regulatory_filing | advisory[], > date?: { > from?: number, > to?: number > } > } > ``` > **sortBy full type** > > ```ts theme={null} > { > type: relevance | newest > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_cursor` | `string` | No | — | | `meta` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > story_id: string, > url: string, > title: string, > description?: string | null, > language?: string | null, > authors: string[], > image_url?: string | null, > published_at?: string | null, > type: editorial | press_release | regulatory_filing | advisory, > source: { > name: string, > domain: string, > direct: boolean > }, > match: { > level: primary | secondary, > confidence?: number | null > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count: number > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ## People ### enrich `people.enrich` Find a person from an email, profile URLs, or name and return their profile with a match score **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.people.enrich({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `social_urls` | `string[]` | No | — | | `name` | `object` | No | — | | `email` | `string` | No | — | | `company` | `object` | No | — | | `education` | `object[]` | No | — | | `location` | `object` | No | — | | `timeoutOpts` | `object` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | > **name full type** > > ```ts theme={null} > { > first?: string, > last?: string > } > ``` > **company full type** > > ```ts theme={null} > { > name?: string, > domain?: string > } > ``` > **education full type** > > ```ts theme={null} > { > institution?: { > name?: string, > domain?: string > }, > degree?: string, > field_of_study?: string, > graduation_year?: number > }[] > ``` > **location full type** > > ```ts theme={null} > { > city?: string, > region?: string, > country?: string > } > ``` > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `partial` | `boolean` | No | — | | `match` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **match full type** > > ```ts theme={null} > { > status: candidate, > score: number, > person: { > name?: { > full?: string, > first?: string, > last?: string > }, > email?: string, > avatar_url?: string, > bio?: string, > location?: { > display?: string, > city?: string, > region?: string, > country?: string, > country_code?: string > }, > social_urls: string[], > website_urls: string[], > current_role?: { > title: string, > organization: { > name: string, > domain?: string > }, > location?: string, > description?: string, > start_date?: { > year: number, > month?: number, > day?: number > }, > end_date?: { > year: number, > month?: number, > day?: number > }, > is_current?: boolean > }, > current_role_status: present | none | unknown, > experience: { > title: string, > organization: { > name: string, > domain?: string > }, > location?: string, > description?: string, > start_date?: { > year: number, > month?: number, > day?: number > }, > end_date?: { > year: number, > month?: number, > day?: number > }, > is_current?: boolean > }[], > education: { > institution: { > name: string, > domain?: string > }, > degree?: string, > field_of_study?: string, > description?: string, > start_date?: { > year: number, > month?: number, > day?: number > }, > end_date?: { > year: number, > month?: number, > day?: number > } > }[], > skills: string[], > last_updated?: string, > checked_at?: string > } > } | { > status: not_found, > score: null, > person: null > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ## Web ### answers `web.answers` Research a task on the web and return a sourced answer in a requested JSON shape **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.web.answers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task` | `string` | Yes | — | | `mode` | `fast \| ultra` | No | — | | `json_format` | `object` | No | — | | `timeoutOpts` | `object` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | > **json\_format full type** > > ```ts theme={null} > { > } > ``` > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `partial` | `boolean` | No | — | | `json_content` | `object` | Yes | — | | `sources` | `string[]` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | No | — | > **json\_content full type** > > ```ts theme={null} > { > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ### crawl `web.crawl` Crawl a website (up to 500 pages) and return each page as Markdown **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.web.crawl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `maxPages` | `number` | No | — | | `urlRegex` | `string` | No | — | | `includeLinks` | `boolean` | No | — | | `includeImages` | `boolean` | No | — | | `shortenBase64Images` | `boolean` | No | — | | `useMainContentOnly` | `boolean` | No | — | | `pdf` | `object` | No | — | | `includeSelectors` | `string[]` | No | — | | `excludeSelectors` | `string[]` | No | — | | `country` | `string` | No | — | | `maxDepth` | `number` | No | — | | `followSubdomains` | `boolean` | No | — | | `includeFrames` | `boolean` | No | — | | `maxAgeMs` | `number` | No | — | | `waitForMs` | `number` | No | — | | `settleAnimations` | `boolean` | No | — | | `stopAfterMs` | `number` | No | — | | `timeoutOpts` | `object` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | > **pdf full type** > > ```ts theme={null} > { > shouldParse?: boolean, > start?: number, > end?: number, > ocr?: boolean > } > ``` > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `partial` | `boolean` | No | — | | `results` | `object[]` | Yes | — | | `metadata` | `object` | Yes | — | | `cache_metadata` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **results full type** > > ```ts theme={null} > { > markdown: string, > metadata: { > title: string, > description?: string, > language?: string, > keywords?: string[], > canonicalUrl?: string, > author?: string, > siteName?: string, > image?: string, > favicon?: string, > publishedTime?: string, > modifiedTime?: string, > robots?: string, > openGraph?: { > }, > twitter?: { > }, > alternates?: { > href: string, > hreflang?: string, > type?: string, > title?: string > }[], > headings?: { > level: number, > text: string > }[], > jsonLd?: { > }[], > additionalMeta?: { > }, > sourceUrl: string, > finalUrl: string, > url: string, > crawlDepth: number, > statusCode: number, > success: boolean > } > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > numUrls: number, > maxCrawlDepth: number, > numSucceeded: number, > numFailed: number, > numSkipped: number > } > ``` > **cache\_metadata full type** > > ```ts theme={null} > { > status: hit | miss | zdr, > age_ms: number > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ### extract `web.extract` Extract structured data from a website using a JSON Schema **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.web.extract({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `schema` | `object` | Yes | — | | `instructions` | `string` | No | — | | `factCheck` | `boolean` | No | — | | `maxPages` | `number` | No | — | | `pdf` | `object` | No | — | | `actions` | `object[]` | No | — | | `maxDepth` | `number` | No | — | | `followSubdomains` | `boolean` | No | — | | `includeFrames` | `boolean` | No | — | | `maxAgeMs` | `number` | No | — | | `waitForMs` | `number` | No | — | | `settleAnimations` | `boolean` | No | — | | `stopAfterMs` | `number` | No | — | | `timeoutOpts` | `object` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | > **schema full type** > > ```ts theme={null} > { > } > ``` > **pdf full type** > > ```ts theme={null} > { > shouldParse?: boolean, > start?: number, > end?: number > } > ``` > **actions full type** > > ```ts theme={null} > ( > { > do: wait, > timeMs: number > } | { > do: perform, > action: string > } | { > do: scroll, > direction?: up | down | left | right, > amount?: number | viewport | max, > container?: string, > maxScrolls?: number > } > )[] > ``` > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `partial` | `boolean` | No | — | | `status` | `string` | Yes | — | | `url` | `string` | Yes | — | | `urls_analyzed` | `string[]` | Yes | — | | `data` | `object` | Yes | — | | `metadata` | `object` | Yes | — | | `cache_metadata` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > numUrls: number, > maxCrawlDepth: number, > numSucceeded: number, > numFailed: number, > numSkipped: number, > numBlocked: number, > actionsApplied?: { > instruction: string, > status: applied | failed | skipped, > method?: string, > targetDescription?: string, > completionEvidence?: string, > error?: string, > durationMs?: number > }[] > } > ``` > **cache\_metadata full type** > > ```ts theme={null} > { > status: hit | miss | zdr, > age_ms: number > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ### scrape `web.scrape` Scrape a URL as HTML, Markdown, screenshot, images, highlights, or schema-driven JSON **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.web.scrape({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `formats` | `object` | Yes | — | | `markdownParams` | `object` | No | — | | `screenshotParams` | `object` | No | — | | `imageParams` | `object` | No | — | | `highlightsParams` | `object` | No | — | | `jsonParams` | `object` | No | — | | `parseParams` | `object` | No | — | | `productParams` | `object` | No | — | | `sharedParams` | `object` | No | — | | `maxAgeMs` | `number` | No | — | | `timeoutOpts` | `object` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | > **formats full type** > > ```ts theme={null} > { > html?: boolean, > markdown?: boolean, > screenshot?: boolean, > images?: boolean, > bytes?: boolean, > parse?: boolean, > highlights?: boolean, > json?: boolean, > product?: boolean > } > ``` > **markdownParams full type** > > ```ts theme={null} > { > includeLinks?: boolean, > includeImages?: boolean, > inlineImages?: placeholder | preserve > } > ``` > **screenshotParams full type** > > ```ts theme={null} > { > area?: viewport | fullPage | { > selector: string > } | { > x: number, > y: number, > width: number, > height: number > }, > format?: png | jpeg | webp > } > ``` > **imageParams full type** > > ```ts theme={null} > { > enrich?: dimensions | classification | file[], > dedupe?: none | visual > } > ``` > **highlightsParams full type** > > ```ts theme={null} > { > query: string, > maxCharacters?: number > } > ``` > **jsonParams full type** > > ```ts theme={null} > { > schema: { > }, > instructions?: string > } > ``` > **parseParams full type** > > ```ts theme={null} > { > type?: custom, > rules: lazy > } | { > type: prebuilt, > parser: google-maps | google-play | google-play-reviews | app-store | app-store-reviews | emails | phone-numbers | links > } > ``` > **productParams full type** > > ```ts theme={null} > { > dedupeImages?: boolean > } > ``` > **sharedParams full type** > > ```ts theme={null} > { > country?: string, > headers?: { > }, > viewport?: { > width?: number, > height?: number > }, > theme?: light | dark, > dismissCookies?: boolean, > dismissPopups?: boolean, > actions?: ( > { > type: perform, > action: string > } | { > type: scroll, > direction?: down | up | left | right, > amount?: number | viewport | max, > selector?: string, > maxScrolls?: number > } | { > type: wait, > milliseconds: number > } | { > type: waitFor, > selector: string > } > )[], > waitFor?: number | string, > settleAnimations?: boolean, > mainContentOnly?: boolean, > includeSelectors?: string[], > excludeSelectors?: string[], > includeFrames?: boolean, > parsers?: { > pdf?: { > startPage?: number, > endPage?: number, > ocr?: off | auto > } > }, > profile?: { > type: existing, > profileId: string > } | { > type: new, > identifier: string, > password: string > } > } > ``` > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `html` | `object` | Yes | — | | `markdown` | `object` | Yes | — | | `screenshot` | `object` | Yes | — | | `images` | `object` | Yes | — | | `bytes` | `object` | Yes | — | | `parsed` | `object` | Yes | — | | `highlights` | `object` | Yes | — | | `json` | `object` | Yes | — | | `product` | `object` | Yes | — | | `profile` | `object` | No | — | | `isPartial` | `true` | No | — | | `metadata` | `object` | Yes | — | | `cache_metadata` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **html full type** > > ```ts theme={null} > { > requested: boolean, > success?: boolean | null, > data?: string | null, > error_code?: string, > message?: string > } > ``` > **markdown full type** > > ```ts theme={null} > { > requested: boolean, > success?: boolean | null, > data?: string | null, > error_code?: string, > message?: string > } > ``` > **screenshot full type** > > ```ts theme={null} > { > requested: boolean, > success?: boolean | null, > data?: string | null, > error_code?: string, > message?: string > } > ``` > **images full type** > > ```ts theme={null} > { > requested: boolean, > success?: boolean | null, > data?: { > url: string, > alt?: string | null, > width?: number, > height?: number, > classification?: photography | illustration | logo | wordmark | icon | pattern | graphic | other, > fileUrl?: string > }[] | null, > error_code?: string, > message?: string > } > ``` > **bytes full type** > > ```ts theme={null} > { > requested: boolean, > success?: boolean | null, > data?: { > contentType: string, > base64: string > } | null, > error_code?: string, > message?: string > } > ``` > **parsed full type** > > ```ts theme={null} > { > requested: boolean, > success?: boolean | null, > data?: { > } | null, > error_code?: string, > message?: string, > type: google-maps | google-play | google-play-reviews | app-store | app-store-reviews | emails | phone-numbers | links | custom > } > ``` > **highlights full type** > > ```ts theme={null} > { > requested: boolean, > success?: boolean | null, > data?: string[] | null, > error_code?: string, > message?: string > } > ``` > **json full type** > > ```ts theme={null} > { > requested: boolean, > success?: boolean | null, > data?: { > } | null, > error_code?: string, > message?: string, > isTruncated?: true > } > ``` > **product full type** > > ```ts theme={null} > { > requested: boolean, > success?: boolean | null, > data?: { > isProductPage: boolean, > product?: { > name: string, > description?: string | null, > brand?: string | null, > sku?: string | null, > price?: number | null, > regularPrice?: number | null, > currency?: string | null, > availability?: in_stock | out_of_stock | limited_availability | preorder | backorder | made_to_order | discontinued | null, > category?: string | null, > imageUrl?: string | null, > images: string[], > dimensions: string[], > features: string[], > targetAudience: string[], > tags: string[], > variants: { > sku?: string | null, > attributes: { > }, > url?: string | null, > images: string[] > }[] > } | null > } | null, > error_code?: string, > message?: string > } > ``` > **profile full type** > > ```ts theme={null} > { > id: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > title?: string, > description?: string, > language?: string, > keywords?: string[], > canonicalUrl?: string, > author?: string, > siteName?: string, > image?: string, > favicon?: string, > publishedTime?: string, > modifiedTime?: string, > robots?: string, > openGraph?: { > }, > twitter?: { > }, > alternates?: { > href: string, > hreflang?: string, > type?: string, > title?: string > }[], > headings?: { > level: number, > text: string > }[], > jsonLd?: { > }[], > additionalMeta?: { > } > } > ``` > **cache\_metadata full type** > > ```ts theme={null} > { > status: hit | miss | zdr, > age_ms: number > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ### search `web.search` Search the web, optionally with page Markdown or highlights per result **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.web.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `numResults` | `number` | No | — | | `includeDomains` | `string[]` | No | — | | `excludeDomains` | `string[]` | No | — | | `freshness` | `last_24_hours \| last_week \| last_month \| last_year` | No | — | | `country` | `string` | No | — | | `queryFanout` | `boolean` | No | — | | `markdownOptions` | `object` | No | — | | `highlightsOptions` | `object` | No | — | | `descriptionMaxCharacters` | `number` | No | — | | `timeoutOpts` | `object` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | > **markdownOptions full type** > > ```ts theme={null} > { > enabled?: boolean, > includeLinks?: boolean, > includeImages?: boolean, > shortenBase64Images?: boolean, > useMainContentOnly?: boolean, > pdf?: { > shouldParse?: boolean, > start?: number, > end?: number > }, > includeFrames?: boolean, > maxAgeMs?: number | null, > waitForMs?: number | null, > timeoutOpts?: { > milliseconds: number, > behavior?: fail | return-partial > } > } > ``` > **highlightsOptions full type** > > ```ts theme={null} > { > enabled?: boolean, > maxCharacters?: number > } > ``` > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `partial` | `boolean` | No | — | | `query` | `string` | Yes | — | | `results` | `object[]` | Yes | — | | `cache_metadata` | `object` | Yes | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **results full type** > > ```ts theme={null} > { > url: string, > title: string, > description: string, > relevance: high | medium | low, > markdown: { > finalDOMState?: loaded | still-loading, > markdown?: string | null, > code: SUCCESS | NOT_REQUESTED | TIMEOUT | CONTENT_TOO_LARGE | WEBSITE_ACCESS_ERROR | WEBSITE_BLOCKED | ERROR > }, > highlights: { > highlights?: string[] | null, > code: SUCCESS | NOT_REQUESTED | TIMEOUT | CONTENT_TOO_LARGE | WEBSITE_ACCESS_ERROR | WEBSITE_BLOCKED | ERROR > } > }[] > ``` > **cache\_metadata full type** > > ```ts theme={null} > { > status: hit | miss | zdr, > age_ms: number > } > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** ### urls `web.urls` Map a domain's URLs with titles and descriptions **Risk:** `read` ```ts theme={null} await corsair.contextdev.api.web.urls({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `headers` | `object` | No | — | | `includeSubdomains` | `boolean` | No | — | | `maxLinks` | `number` | No | — | | `sitemapUrl` | `string` | No | — | | `urlRegex` | `string` | No | — | | `search` | `string` | No | — | | `timeoutOpts` | `object` | No | — | | `zdr` | `enabled \| disabled` | No | — | | `tags` | `string[]` | No | — | > **headers full type** > > ```ts theme={null} > { > } > ``` > **timeoutOpts full type** > > ```ts theme={null} > { > milliseconds: number, > behavior?: fail | return-partial > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `domain` | `string` | Yes | — | | `urls` | `object[]` | Yes | — | | `partial` | `boolean` | No | — | | `key_metadata` | `object` | No | — | | `request_id` | `string` | Yes | — | > **urls full type** > > ```ts theme={null} > { > url: string, > title?: string, > description?: string, > keywords?: string[], > language?: string > }[] > ``` > **key\_metadata full type** > > ```ts theme={null} > { > credits_consumed: number, > credits_remaining: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/contextdev/database Context.dev local sync: searchable entities, `.search()` filters, and operators. The Context.dev plugin syncs data locally. Use `corsair.contextdev.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Brands Path: `contextdev.db.brands.search` ```ts theme={null} const rows = await corsair.contextdev.db.brands.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `logoUrl` | `string` | equals, contains, startsWith, endsWith, in | | `primaryColor` | `string` | equals, contains, startsWith, endsWith, in | | `industry` | `string` | equals, contains, startsWith, endsWith, in | | `employeeRange` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## News Articles Path: `contextdev.db.newsArticles.search` ```ts theme={null} const rows = await corsair.contextdev.db.newsArticles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `storyId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `sourceDomain` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `publishedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/contextdev/overview Web context API for agents that scrapes, crawls, searches, and extracts web pages, and looks up brands, company news, and people. Use **Context.dev** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 16 typed API operations * 2 synced entities (`brands`, `newsArticles`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/contextdev ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/contextdev ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/contextdev ``` ```bash bun theme={null} bun add corsair @corsair-dev/contextdev ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { contextdev } from '@corsair-dev/contextdev'; export const corsair = createCorsair({ plugins: [ contextdev(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} contextdev() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'contextdev', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.usage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.contextdev.api.account.usage({}); ``` **`brand.prefetch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.contextdev.api.brand.prefetch({}); ``` See the full list on the [API](/plugins/contextdev/api) page. ## Query synced data Synced entities support `tenant.contextdev.db..search()` and `.list()`: `brands`, `newsArticles`. See [Database](/plugins/contextdev/database) for filters and operators. ## What's next > **[API reference](/plugins/contextdev/api)** > > Every `contextdev.api.*` operation with input and output types. > **[Database](/plugins/contextdev/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/contextsevenmcp/api API reference for Context7: every `contextsevenmcp.api.*` operation with input and output types. Every `contextsevenmcp.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Context ### get `context.get` Get documentation context for a library **Risk:** `read` ```ts theme={null} await corsair.contextsevenmcp.api.context.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `libraryId` | `string` | Yes | — | | `query` | `string` | Yes | — | | `type` | `json \| txt` | No | — | | `fast` | `true \| false` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `codeSnippets` | `object[]` | Yes | — | | `infoSnippets` | `object[]` | Yes | — | | `rules` | `object` | No | — | > **codeSnippets full type** > > ```ts theme={null} > { > codeTitle: string, > codeDescription: string, > codeLanguage: string, > codeTokens: number, > codeId: string, > pageTitle: string, > codeList: { > language: string, > code: string > }[], > isDynamic?: boolean, > sourceFile?: string > }[] > ``` > **infoSnippets full type** > > ```ts theme={null} > { > pageId?: string, > breadcrumb?: string, > content: string, > contentTokens: number > }[] > ``` > **rules full type** > > ```ts theme={null} > { > global?: string[], > libraryOwn?: string[], > libraryTeam?: string[] > } > ``` *** ## Library ### search `library.search` Search Context7 libraries by name **Risk:** `read` ```ts theme={null} await corsair.contextsevenmcp.api.library.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `libraryName` | `string` | Yes | — | | `query` | `string` | Yes | — | | `fast` | `true \| false` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `searchFilterApplied` | `boolean` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > title?: string, > description?: string, > branch?: string, > lastUpdateDate?: string, > state?: string, > totalTokens?: number, > totalSnippets?: number, > stars?: number, > trustScore?: number, > benchmarkScore?: number, > versions?: string[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/contextsevenmcp/database Context7 local sync: searchable entities, `.search()` filters, and operators. The Context7 plugin syncs data locally. Use `corsair.contextsevenmcp.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/contextsevenmcp/overview Documentation context MCP server for injecting up-to-date library docs into AI coding agents. Use **Context7** through Corsair: one client, typed API calls. **What you get:** * 2 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/contextsevenmcp ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/contextsevenmcp ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/contextsevenmcp ``` ```bash bun theme={null} bun add corsair @corsair-dev/contextsevenmcp ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { contextsevenmcp } from '@corsair-dev/contextsevenmcp'; export const corsair = createCorsair({ plugins: [ contextsevenmcp(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} contextsevenmcp() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'contextsevenmcp', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`context.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.contextsevenmcp.api.context.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/contextsevenmcp/api) reference.* See the full list on the [API](/plugins/contextsevenmcp/api) page. ## What's next > **[API reference](/plugins/contextsevenmcp/api)** > > Every `contextsevenmcp.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/convex/api API reference for Convex: every `convex.api.*` operation with input and output types. Every `convex.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Custom Domains ### delete `customDomains.delete` Remove a custom domain from a Convex deployment **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.convex.api.customDomains.delete({ deployment_name: 'happy-otter-123', requestDestination: 'convexSite', domain: 'api.example.com' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deployment_name` | `string` | Yes | — | | `requestDestination` | `convexCloud \| convexSite` | Yes | — | | `domain` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Deploy Keys ### create `deployKeys.create` Create a deploy key for a Convex deployment **Risk:** `write` ```ts theme={null} await corsair.convex.api.deployKeys.create({ deployment_name: 'happy-otter-123', name: 'ci', allowedActions: ['deployment:deploy'], }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deployment_name` | `string` | Yes | — | | `name` | `string` | Yes | — | | `allowedActions` | `deployment:deploy \| deployment:env:view \| deployment:env:write \| deployment:pause \| deployment:unpause \| deployment:logs:view \| deployment:metrics:view \| deployment:integrations:view \| deployment:integrations:write \| deployment:data:view \| deployment:data:write \| deployment:backups:view \| deployment:backups:create \| deployment:backups:download \| deployment:backups:delete \| deployment:backups:import \| deployment:functions:actAsUser \| deployment:functions:runInternalQueries \| deployment:functions:runInternalMutations \| deployment:functions:runInternalActions \| deployment:functions:runTestQuery \| deployment:auditLog:view \| deployment:usageLimits:view \| deployment:usageLimits:write \| deployment:usage:view \| deployment:aiGateway:use[]` | No | — | | `expiresAt` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deployKey` | `string` | Yes | — | *** ### list `deployKeys.list` List deploy keys for a Convex deployment **Risk:** `read` ```ts theme={null} await corsair.convex.api.deployKeys.list({ deployment_name: 'happy-otter-123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deployment_name` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > creationTime: number, > lastUsedTime?: number | null, > expiresAt?: number | null, > creator?: number | null, > managedBy?: vercel | { > oauthApp: string > } | null, > allowedActions: string[] > }[] > ``` *** ## Deployment ### executeQueryBatch `deployment.executeQueryBatch` Execute a batch of Convex queries against a deployment **Risk:** `read` ```ts theme={null} await corsair.convex.api.deployment.executeQueryBatch({ subdomain: 'happy-otter-123', queries: [{ path: 'messages:list', args: { channel: 'general' }, }], }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subdomain` | `string` | No | — | | `deploymentUrl` | `string` | No | — | | `deployKey` | `string` | No | — | | `queries` | `object[]` | Yes | — | > **queries full type** > > ```ts theme={null} > { > path: string, > args: { > }, > format?: string | null > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > ( > { > status: success, > value: lazy, > logLines?: string[] > } | { > status: error, > errorMessage: string, > errorData?: lazy, > logLines?: string[] > } > )[] > ``` *** ### getQueryTimestamp `deployment.getQueryTimestamp` Get the current query timestamp for a Convex deployment **Risk:** `read` ```ts theme={null} await corsair.convex.api.deployment.getQueryTimestamp({ subdomain: 'happy-otter-123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subdomain` | `string` | No | — | | `deploymentUrl` | `string` | No | — | | `deployKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ts` | `string` | Yes | — | *** ### listLogStreams `deployment.listLogStreams` List log streams configured for a Convex deployment **Risk:** `read` ```ts theme={null} await corsair.convex.api.deployment.listLogStreams({ subdomain: 'happy-otter-123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subdomain` | `string` | No | — | | `deploymentUrl` | `string` | No | — | | `deployKey` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > logStreamType: datadog | webhook | axiom | sentry | postHogLogs | postHogErrorTracking | s3Export, > status: { > type: pending | restarting | failed | active | deleting, > reason?: string > }, > topics?: string[] | null > }[] > ``` *** ## Deployments ### create `deployments.create` Create a new deployment for a Convex project **Risk:** `write` ```ts theme={null} await corsair.convex.api.deployments.create({ project_id: '123', type: 'prod', region: 'aws-us-east-1' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `type` | `dev \| prod \| preview \| custom` | Yes | — | | `class` | `string` | No | — | | `region` | `string` | No | — | | `reference` | `string` | No | — | | `isDefault` | `boolean` | No | — | | `expiresAt` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | Yes | — | | `createTime` | `number` | Yes | — | | `lastDeployTime` | `number` | No | — | | `deploymentType` | `dev \| prod \| preview \| custom` | Yes | — | | `projectId` | `number` | Yes | — | | `creator` | `number` | No | — | | `previewIdentifier` | `string` | No | — | | `region` | `string` | No | — | | `isDefault` | `boolean` | No | — | | `reference` | `string` | No | — | | `dashboardEditConfirmation` | `boolean` | No | — | | `deploymentUrl` | `string` | No | — | | `expiresAt` | `number` | No | — | | `class` | `string` | No | — | | `sendLogsToClient` | `boolean` | No | — | | `kind` | `cloud \| local` | Yes | — | | `port` | `number` | No | — | | `deviceName` | `string` | No | — | | `isActive` | `boolean` | No | — | *** ### delete `deployments.delete` Delete a Convex deployment and all of its data and files **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.convex.api.deployments.delete({ deployment_name: 'happy-otter-123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deployment_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `deployments.get` Get details about a Convex cloud deployment **Risk:** `read` ```ts theme={null} await corsair.convex.api.deployments.get({ deployment_name: 'happy-otter-123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deployment_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | Yes | — | | `createTime` | `number` | Yes | — | | `lastDeployTime` | `number` | No | — | | `deploymentType` | `dev \| prod \| preview \| custom` | Yes | — | | `projectId` | `number` | Yes | — | | `creator` | `number` | No | — | | `previewIdentifier` | `string` | No | — | | `region` | `string` | No | — | | `isDefault` | `boolean` | No | — | | `reference` | `string` | No | — | | `dashboardEditConfirmation` | `boolean` | No | — | | `deploymentUrl` | `string` | No | — | | `expiresAt` | `number` | No | — | | `class` | `string` | No | — | | `sendLogsToClient` | `boolean` | No | — | | `kind` | `cloud \| local` | Yes | — | | `port` | `number` | No | — | | `deviceName` | `string` | No | — | | `isActive` | `boolean` | No | — | *** ### list `deployments.list` List deployments for a Convex project **Risk:** `read` ```ts theme={null} await corsair.convex.api.deployments.list({ project_id: '123', deploymentType: 'prod' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `includeLocal` | `boolean` | No | — | | `isDefault` | `boolean` | No | — | | `deploymentType` | `dev \| prod \| preview \| custom` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: number, > name: string, > createTime: number, > lastDeployTime?: number | null, > deploymentType: dev | prod | preview | custom, > projectId: number, > creator?: number | null, > previewIdentifier?: string | null, > region?: string, > isDefault?: boolean, > reference?: string, > dashboardEditConfirmation?: boolean | null, > deploymentUrl?: string, > expiresAt?: number | null, > class?: string, > sendLogsToClient?: boolean | null, > kind: cloud | local, > port?: number, > deviceName?: string, > isActive?: boolean > }[] > ``` *** ### update `deployments.update` Update properties of an existing Convex deployment **Risk:** `write` ```ts theme={null} await corsair.convex.api.deployments.update({ deployment_name: 'happy-otter-123', reference: 'staging' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deployment_name` | `string` | Yes | — | | `reference` | `string` | No | — | | `dashboardEditConfirmation` | `boolean` | No | — | | `expiresAt` | `number` | No | — | | `sendLogsToClient` | `boolean` | No | — | | `class` | `string` | No | — | | `isDefault` | `boolean` | No | — | | `deploymentType` | `dev \| prod \| preview \| custom` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Platform ### getTokenDetails `platform.getTokenDetails` Get details about the token used to authenticate **Risk:** `read` ```ts theme={null} await corsair.convex.api.platform.getTokenDetails({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `teamId` | `number` | No | — | | `projectId` | `number` | No | — | | `name` | `string` | Yes | — | | `createTime` | `number` | Yes | — | | `type` | `teamToken \| projectToken` | Yes | — | *** ### listDeploymentClasses `platform.listDeploymentClasses` List the deployment classes available to a Convex team **Risk:** `read` ```ts theme={null} await corsair.convex.api.platform.listDeploymentClasses({ team_id: '41' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > type: string, > available: boolean > }[] > ``` *** ### listDeploymentRegions `platform.listDeploymentRegions` List the deployment regions available to a Convex team **Risk:** `read` ```ts theme={null} await corsair.convex.api.platform.listDeploymentRegions({ team_id: '41' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > name: string, > displayName: string, > available: boolean > }[] > ``` *** ## Projects ### create `projects.create` Create a new Convex project, optionally provisioning a deployment **Risk:** `write` ```ts theme={null} await corsair.convex.api.projects.create({ team_id: '41', projectName: 'My App', deploymentType: 'dev' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `projectName` | `string` | Yes | — | | `deploymentType` | `dev \| prod \| preview \| custom` | No | — | | `deploymentClass` | `string` | No | — | | `deploymentRegion` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `id` | `number` | Yes | — | | `slug` | `string` | Yes | — | | `deploymentName` | `string` | No | — | | `deploymentUrl` | `string` | No | — | *** ### delete `projects.delete` Delete a Convex project and all of its deployments **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.convex.api.projects.delete({ project_id: '123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getById `projects.getById` Get a Convex project by its ID **Risk:** `read` ```ts theme={null} await corsair.convex.api.projects.getById({ project_id: '123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `teamId` | `number` | Yes | — | | `teamSlug` | `string` | Yes | — | | `createTime` | `number` | Yes | — | | `prodDeploymentName` | `string` | No | — | | `devDeploymentName` | `string` | No | — | *** ### getBySlug `projects.getBySlug` Get a Convex project by team identifier and project slug **Risk:** `read` ```ts theme={null} await corsair.convex.api.projects.getBySlug({ team_id_or_slug: 'acme', project_slug: 'my-app' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id_or_slug` | `string` | Yes | — | | `project_slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `teamId` | `number` | Yes | — | | `teamSlug` | `string` | Yes | — | | `createTime` | `number` | Yes | — | | `prodDeploymentName` | `string` | No | — | | `devDeploymentName` | `string` | No | — | *** ### list `projects.list` List projects in a Convex team **Risk:** `read` ```ts theme={null} await corsair.convex.api.projects.list({ team_id: '41', limit: 20 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `q` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > name: string, > slug: string, > teamId: number, > teamSlug: string, > createTime: number, > prodDeploymentName?: string | null, > devDeploymentName?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > hasMore: boolean, > nextCursor?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/convex/database Convex local sync: searchable entities, `.search()` filters, and operators. The Convex plugin syncs data locally. Use `corsair.convex.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Deploy Keys Path: `convex.db.deployKeys.search` ```ts theme={null} const rows = await corsair.convex.db.deployKeys.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `deploymentName` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `creationTime` | `number` | equals, gt, gte, lt, lte, in | | `lastUsedTime` | `number` | equals, gt, gte, lt, lte, in | | `expiresAt` | `number` | equals, gt, gte, lt, lte, in | | `creator` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deployments Path: `convex.db.deployments.search` ```ts theme={null} const rows = await corsair.convex.db.deployments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createTime` | `number` | equals, gt, gte, lt, lte, in | | `lastDeployTime` | `number` | equals, gt, gte, lt, lte, in | | `projectId` | `number` | equals, gt, gte, lt, lte, in | | `creator` | `number` | equals, gt, gte, lt, lte, in | | `previewIdentifier` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `isDefault` | `boolean` | equals | | `reference` | `string` | equals, contains, startsWith, endsWith, in | | `dashboardEditConfirmation` | `boolean` | equals | | `deploymentUrl` | `string` | equals, contains, startsWith, endsWith, in | | `expiresAt` | `number` | equals, gt, gte, lt, lte, in | | `class` | `string` | equals, contains, startsWith, endsWith, in | | `sendLogsToClient` | `boolean` | equals | | `port` | `number` | equals, gt, gte, lt, lte, in | | `deviceName` | `string` | equals, contains, startsWith, endsWith, in | | `isActive` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `convex.db.projects.search` ```ts theme={null} const rows = await corsair.convex.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `number` | equals, gt, gte, lt, lte, in | | `teamSlug` | `string` | equals, contains, startsWith, endsWith, in | | `createTime` | `number` | equals, gt, gte, lt, lte, in | | `prodDeploymentName` | `string` | equals, contains, startsWith, endsWith, in | | `devDeploymentName` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/convex/overview Convex plugin for Corsair Use **Convex** through Corsair: one client, typed API calls, local DB sync. Convex is a reactive backend platform for TypeScript apps. This plugin wraps the Convex Management API ([https://api.convex.dev/v1](https://api.convex.dev/v1)) for teams, projects, deployments, deploy keys, and custom domains, plus the deployment-scoped REST API for executing query batches, reading query timestamps, and listing log streams. Authentication follows the Convex authorization model: * Management API operations authenticate with `Authorization: Bearer ` using a Convex personal/team access token. An `api_key` or `oauth_2` connection must therefore store an access token — deploy keys are not accepted as bearer credentials by the Management API. * Deployment-scoped operations require a deployment admin deploy key and authenticate with `Authorization: Convex `. Supply one per call via the `deployKey` input, or store it on the connection as `deploy_key`; the plugin credential (an access token) is not a valid deploy key. The deployment name (subdomain) is resolved from the connection or the `subdomain` option. Connections that only store a deploy key can use deployment-scoped operations, while Management operations require the access token. Use Corsair permissions for destructive actions such as deleting projects, deployments, or custom domains. **What you get:** * 19 typed API operations * 3 synced entities (`deployKeys`, `deployments`, `projects`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/convex ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/convex ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/convex ``` ```bash bun theme={null} bun add corsair @corsair-dev/convex ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { convex } from '@corsair-dev/convex'; export const corsair = createCorsair({ plugins: [ convex(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} convex() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Convex OAuth app. ```ts theme={null} convex({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'convex', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List projects in a team** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.convex.api.projects.list({ team_id: '41' }); ``` **Create a deploy key** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.convex.api.deployKeys.create({ deployment_name: 'happy-otter-123', name: 'ci' }); ``` See the full list on the [API](/plugins/convex/api) page. ## Query synced data Synced entities support `tenant.convex.db..search()` and `.list()`: `deployKeys`, `deployments`, `projects`. See [Database](/plugins/convex/database) for filters and operators. ## What's next > **[API reference](/plugins/convex/api)** > > Every `convex.api.*` operation with input and output types. > **[Database](/plugins/convex/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/convoloai/api API reference for ConvoloAi: every `convoloai.api.*` operation with input and output types. Every `convoloai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agent ### create `agent.create` Create a new agent **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.agent.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `agent.delete` Delete an agent **Risk:** `destructive` ```ts theme={null} await corsair.convoloai.api.agent.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `any` *** ### get `agent.get` Get one agent by id **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.agent.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### list `agent.list` List agents with filtering, sorting, and pagination **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.agent.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `searchString` | `string` | No | — | | `page` | `number` | No | — | | `itemsPerPage` | `number` | No | — | | `sortBy` | `name` | No | — | | `sortDirection` | `ASC \| DESC` | No | — | | `status` | `boolean` | No | — | | `withStats` | `boolean` | No | — | | `withActiveWidgetsData` | `boolean` | No | — | | `withDeletedWidgetsData` | `boolean` | No | — | | `dateFrom` | `string` | No | — | | `dateTo` | `string` | No | — | | `isDeleted` | `boolean` | No | — | | `isDelegate` | `boolean` | No | — | | `teamMemberOnly` | `boolean` | No | — | | `fullAccountAccess` | `boolean` | No | — | | `delegateAccessToDialerAgentId` | `number` | No | — | **Output:** *empty object* *** ### listV2 `agent.listV2` List agents via the v2 endpoint **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.agent.listV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `searchString` | `string` | No | — | | `page` | `number` | No | — | | `itemsPerPage` | `number` | No | — | | `sortBy` | `name` | No | — | | `sortDirection` | `ASC \| DESC` | No | — | | `status` | `boolean` | No | — | | `withStats` | `boolean` | No | — | | `withActiveWidgetsData` | `boolean` | No | — | | `withDeletedWidgetsData` | `boolean` | No | — | | `dateFrom` | `string` | No | — | | `dateTo` | `string` | No | — | | `isDeleted` | `boolean` | No | — | | `isDelegate` | `boolean` | No | — | | `teamMemberOnly` | `boolean` | No | — | | `fullAccountAccess` | `boolean` | No | — | | `delegateAccessToDialerAgentId` | `number` | No | — | **Output:** *empty object* *** ### update `agent.update` Update an agent **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.agent.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### updateSchedule `agent.updateSchedule` Update the working schedule of an agent **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.agent.updateSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Call ### getDetails `call.getDetails` Get detailed info for one call **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.call.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `callId` | `string` | Yes | — | **Output:** *empty object* *** ### getEndWebhookPayload `call.getEndWebhookPayload` Get the end-call webhook payload for one call **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.call.getEndWebhookPayload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `callId` | `string` | Yes | — | **Output:** *empty object* *** ### getLog `call.getLog` Get the log for one call **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.call.getLog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `callId` | `string` | Yes | — | **Output:** *empty object* *** ### list `call.list` List calls with filters and pagination **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.call.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date_from` | `string` | No | — | | `date_to` | `string` | No | — | | `widget_ids` | `string[]` | No | — | | `max_calls` | `number` | No | — | | `page` | `number` | No | — | | `search_string` | `string` | No | — | | `status` | `CallStatusType.OPERATOR_ANSWERED \| CallStatusType.CLIENT_ANSWERED \| CallStatusType.NO_ANSWER \| CallStatusType.FAILED \| CallStatusType.PENDING \| CallStatusType.INITIATED \| CallStatusType.ON_DEMAND \| CallStatusType.FUTURE \| CallStatusType.DONE \| CallStatusType.PROCESSED` | No | — | | `filter_url` | `string` | No | — | | `filter_referer` | `string` | No | — | | `filter_lead_number` | `string` | No | — | | `filter_agent` | `string` | No | — | | `filter_answer_time_from` | `number` | No | — | | `filter_answer_time_to` | `number` | No | — | | `filter_talk_time_from` | `number` | No | — | | `filter_talk_time_to` | `number` | No | — | | `filter_wait_time_from` | `number` | No | — | | `filter_wait_time_to` | `number` | No | — | | `filter_disconnected_by` | `lead \| agent \| none` | No | — | | `timezone` | `string` | No | — | **Output:** *empty object* *** ### listPayloadData `call.listPayloadData` List webhook payload data for calls **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.call.listPayloadData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date_from` | `string` | No | — | | `date_to` | `string` | No | — | | `widget_ids` | `string[]` | No | — | | `max_calls` | `number` | No | — | | `page` | `number` | No | — | | `search_string` | `string` | No | — | | `status` | `CallStatusType.OPERATOR_ANSWERED \| CallStatusType.CLIENT_ANSWERED \| CallStatusType.NO_ANSWER \| CallStatusType.FAILED \| CallStatusType.PENDING \| CallStatusType.INITIATED \| CallStatusType.ON_DEMAND \| CallStatusType.FUTURE \| CallStatusType.DONE \| CallStatusType.PROCESSED` | No | — | | `filter_url` | `string` | No | — | | `filter_referer` | `string` | No | — | | `filter_lead_number` | `string` | No | — | | `filter_agent` | `string` | No | — | | `filter_answer_time_from` | `number` | No | — | | `filter_answer_time_to` | `number` | No | — | | `filter_talk_time_from` | `number` | No | — | | `filter_talk_time_to` | `number` | No | — | | `filter_wait_time_from` | `number` | No | — | | `filter_wait_time_to` | `number` | No | — | | `filter_disconnected_by` | `lead \| agent \| none` | No | — | | `timezone` | `string` | No | — | **Output:** *empty object* *** ### listV5 `call.listV5` List calls via the v5 endpoint with fixed delegate logic **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.call.listV5({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date_from` | `string` | No | — | | `date_to` | `string` | No | — | | `widget_ids` | `string[]` | No | — | | `max_calls` | `number` | No | — | | `page` | `number` | No | — | | `search_string` | `string` | No | — | | `status` | `CallStatusType.OPERATOR_ANSWERED \| CallStatusType.CLIENT_ANSWERED \| CallStatusType.NO_ANSWER \| CallStatusType.FAILED \| CallStatusType.PENDING \| CallStatusType.INITIATED \| CallStatusType.ON_DEMAND \| CallStatusType.FUTURE \| CallStatusType.DONE \| CallStatusType.PROCESSED` | No | — | | `filter_url` | `string` | No | — | | `filter_referer` | `string` | No | — | | `filter_lead_number` | `string` | No | — | | `filter_agent` | `string` | No | — | | `filter_answer_time_from` | `number` | No | — | | `filter_answer_time_to` | `number` | No | — | | `filter_talk_time_from` | `number` | No | — | | `filter_talk_time_to` | `number` | No | — | | `filter_wait_time_from` | `number` | No | — | | `filter_wait_time_to` | `number` | No | — | | `filter_disconnected_by` | `lead \| agent \| none` | No | — | | `timezone` | `string` | No | — | **Output:** *empty object* *** ### listWithTags `call.listWithTags` List calls with S2L tag filters **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.call.listWithTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date_from` | `string` | No | — | | `date_to` | `string` | No | — | | `widget_ids` | `string[]` | No | — | | `max_calls` | `number` | No | — | | `page` | `number` | No | — | | `search_string` | `string` | No | — | | `status` | `CallStatusType.OPERATOR_ANSWERED \| CallStatusType.CLIENT_ANSWERED \| CallStatusType.NO_ANSWER \| CallStatusType.FAILED \| CallStatusType.PENDING \| CallStatusType.INITIATED \| CallStatusType.ON_DEMAND \| CallStatusType.FUTURE \| CallStatusType.DONE \| CallStatusType.PROCESSED` | No | — | | `filter_url` | `string` | No | — | | `filter_referer` | `string` | No | — | | `filter_lead_number` | `string` | No | — | | `filter_agent` | `string` | No | — | | `filter_answer_time_from` | `number` | No | — | | `filter_answer_time_to` | `number` | No | — | | `filter_talk_time_from` | `number` | No | — | | `filter_talk_time_to` | `number` | No | — | | `filter_wait_time_from` | `number` | No | — | | `filter_wait_time_to` | `number` | No | — | | `filter_disconnected_by` | `lead \| agent \| none` | No | — | | `timezone` | `string` | No | — | | `filter_s2l_ai_action_set_ids` | `string[]` | No | — | | `filter_s2l_tag_names` | `string[]` | No | — | | `filter_s2l_tag_categories` | `string[]` | No | — | | `filter_s2l_has_tag` | `boolean` | No | — | **Output:** *empty object* *** ### setRating `call.setRating` Set a rating on a call for an agent or supervisor **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.call.setRating({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `callId` | `string` | Yes | — | | `tag` | `string` | No | — | | `type` | `positive \| negative \| neutral` | No | — | **Output:** *empty object* *** ### setS2lTag `call.setS2lTag` Set an S2L tag on a call from an external AI agent **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.call.setS2lTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `callId` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### trigger `call.trigger` Trigger a call through the external call API **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.call.trigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_key` | `string` | Yes | — | | `widget_key` | `string` | Yes | — | | `lc_number` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Get Custom Widget Params ### getCustomWidgetParams `getCustomWidgetParams` Get custom widget fields for integrations **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.getCustomWidgetParams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_key` | `string` | Yes | — | | `api_key` | `string` | Yes | — | **Output:** *empty object* *** ## Get Open Api Document ### getOpenApiDocument `getOpenApiDocument` Get the OpenAPI document this API key may call **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.getOpenApiDocument({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Lead ### getOutcomeTags `lead.getOutcomeTags` Get widget outcome tags by lead id **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.lead.getOutcomeTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### list `lead.list` List leads with filters and pagination **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.lead.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_string` | `string` | No | — | | `name` | `string` | No | — | | `phone` | `string` | No | — | | `email` | `string` | No | — | | `websites` | `string[]` | No | — | | `widgets` | `string[]` | No | — | | `lc_params` | `string[]` | No | — | | `date_from` | `string` | No | — | | `date_to` | `string` | No | — | | `agent_answer_time_lte` | `number` | No | — | | `agent_answer_time_gte` | `number` | No | — | | `talk_time_lte` | `number` | No | — | | `talk_time_gte` | `number` | No | — | | `status` | `string[]` | No | — | | `agents` | `string[]` | No | — | | `lead_status` | `string` | No | — | | `search_lead_data` | `string` | No | — | | `rating` | `string` | No | — | | `comment` | `string` | No | — | | `visitor_source` | `string` | No | — | | `page` | `number` | No | — | | `items_per_page` | `number` | No | — | **Output:** *empty object* *** ### listByPost `lead.listByPost` List leads via a POST body query **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.lead.listByPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Widget ### create `widget.create` Create a new widget **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.widget.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `widget.delete` Delete a widget **Risk:** `destructive` ```ts theme={null} await corsair.convoloai.api.widget.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `any` *** ### get `widget.get` Get one widget by id **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.widget.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### getHtmlSiteCode `widget.getHtmlSiteCode` Get the HTML site code for a widget **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.widget.getHtmlSiteCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### list `widget.list` List widgets with filters and pagination **Risk:** `read` ```ts theme={null} await corsair.convoloai.api.widget.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `searchString` | `string` | No | — | | `status` | `boolean` | No | — | | `page` | `number` | No | — | | `itemsPerPage` | `number` | No | — | | `sortBy` | `siteName \| createDate` | No | — | | `sortDirection` | `ASC \| DESC` | No | — | | `statsDateFrom` | `string` | No | — | | `statsDateTo` | `string` | No | — | | `needCallsAndVisitsStats` | `boolean` | No | — | | `createdDateFrom` | `string` | No | — | | `createdDateTo` | `string` | No | — | | `isDelegate` | `boolean` | No | — | | `isDeleted` | `boolean` | No | — | **Output:** *empty object* *** ### toggle `widget.toggle` Toggle a widget on or off **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.widget.toggle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `new_state` | `0 \| 1` | Yes | — | **Output:** *empty object* *** ### update `widget.update` Update a widget **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.widget.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### updateSettings `widget.updateSettings` Update widget settings via the external API **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.widget.updateSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_key` | `string` | Yes | — | | `api_key` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### updateV2 `widget.updateV2` Update a widget via the v2 endpoint **Risk:** `write` ```ts theme={null} await corsair.convoloai.api.widget.updateV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widgetId` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** # Database Source: https://docs.corsair.dev/plugins/convoloai/database ConvoloAi local sync: searchable entities, `.search()` filters, and operators. The ConvoloAi plugin syncs data locally. Use `corsair.convoloai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Agents Path: `convoloai.db.agents.search` ```ts theme={null} const rows = await corsair.convoloai.db.agents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Calls Path: `convoloai.db.calls.search` ```ts theme={null} const rows = await corsair.convoloai.db.calls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `callId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `widgetId` | `string` | equals, contains, startsWith, endsWith, in | | `leadNumber` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Leads Path: `convoloai.db.leads.search` ```ts theme={null} const rows = await corsair.convoloai.db.leads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `rating` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Widgets Path: `convoloai.db.widgets.search` ```ts theme={null} const rows = await corsair.convoloai.db.widgets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `siteName` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/convoloai/overview ConvoloAi plugin for Corsair Use **ConvoloAi** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 31 typed API operations * 4 synced entities (`agents`, `calls`, `leads`, `widgets`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/convoloai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/convoloai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/convoloai ``` ```bash bun theme={null} bun add corsair @corsair-dev/convoloai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { convoloai } from '@corsair-dev/convoloai'; export const corsair = createCorsair({ plugins: [ convoloai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} convoloai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'convoloai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`agent.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.convoloai.api.agent.get({}); ``` **`agent.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.convoloai.api.agent.create({}); ``` See the full list on the [API](/plugins/convoloai/api) page. ## Query synced data Synced entities support `tenant.convoloai.db..search()` and `.list()`: `agents`, `calls`, `leads`, `widgets`. See [Database](/plugins/convoloai/database) for filters and operators. ## What's next > **[API reference](/plugins/convoloai/api)** > > Every `convoloai.api.*` operation with input and output types. > **[Database](/plugins/convoloai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/cosmic/api API reference for Cosmic: every `cosmic.api.*` operation with input and output types. Every `cosmic.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Media ### delete `media.delete` Delete Media by id **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.media.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `id` | `string` | Yes | — | | `trigger_webhook` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### find `media.find` List Media in a Bucket **Risk:** `read` ```ts theme={null} await corsair.cosmic.api.media.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `query` | `object` | No | — | | `props` | `string` | No | — | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `skip` | `number` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `media` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `limit` | `number` | No | — | > **media full type** > > ```ts theme={null} > { > id: string, > name: string, > original_name?: string, > url?: string, > imgix_url?: string, > folder?: string, > alt_text?: string, > width?: number, > height?: number, > size?: number | string, > type?: string, > bucket?: string, > created_at?: string, > metadata?: { > } > }[] > ``` *** ### findOne `media.findOne` Get a single Media item by name **Risk:** `read` ```ts theme={null} await corsair.cosmic.api.media.findOne({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `name` | `string` | Yes | — | | `props` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `media` | `object` | Yes | — | > **media full type** > > ```ts theme={null} > { > id: string, > name: string, > original_name?: string, > url?: string, > imgix_url?: string, > folder?: string, > alt_text?: string, > width?: number, > height?: number, > size?: number | string, > type?: string, > bucket?: string, > created_at?: string, > metadata?: { > } > } > ``` *** ### insert `media.insert` Upload Media to a Bucket **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.media.insert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `filename` | `string` | Yes | — | | `contentType` | `string` | Yes | — | | `data` | `string` | Yes | — | | `folder` | `string` | No | — | | `alt_text` | `string` | No | — | | `metadata` | `object` | No | — | | `trigger_webhook` | `boolean` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `media` | `object` | Yes | — | > **media full type** > > ```ts theme={null} > { > id: string, > name: string, > original_name?: string, > url?: string, > imgix_url?: string, > folder?: string, > alt_text?: string, > width?: number, > height?: number, > size?: number | string, > type?: string, > bucket?: string, > created_at?: string, > metadata?: { > } > } > ``` *** ### update `media.update` Update Media metadata by id **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.media.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `id` | `string` | Yes | — | | `folder` | `string` | No | — | | `alt_text` | `string` | No | — | | `metadata` | `object` | No | — | | `trigger_webhook` | `boolean` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ## Objects ### batch `objects.batch` Run up to 25 Object operations in one request **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.objects.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > method: add | edit | delete, > object_id?: string, > object?: { > }, > trigger_webhook?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > method: string, > status: string, > object?: { > }, > message?: string > }[] > ``` *** ### delete `objects.delete` Delete an Object by id **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.objects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `id` | `string` | Yes | — | | `trigger_webhook` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### find `objects.find` List Objects in a Bucket with filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.cosmic.api.objects.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `type` | `string` | No | — | | `query` | `object` | No | — | | `props` | `string` | No | — | | `status` | `published \| draft \| any` | No | — | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `after` | `string` | No | — | | `depth` | `number` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `objects` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `limit` | `number` | No | — | > **objects full type** > > ```ts theme={null} > { > id: string, > slug?: string, > title?: string, > type?: string, > status?: string, > metadata?: { > }, > created_at?: string, > modified_at?: string, > published_at?: string, > bucket?: string > }[] > ``` *** ### findOne `objects.findOne` Get a single Object by type and slug **Risk:** `read` ```ts theme={null} await corsair.cosmic.api.objects.findOne({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `type` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `props` | `string` | No | — | | `status` | `published \| draft \| any` | No | — | | `depth` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `object` | Yes | — | > **object full type** > > ```ts theme={null} > { > id: string, > slug?: string, > title?: string, > type?: string, > status?: string, > metadata?: { > }, > created_at?: string, > modified_at?: string, > published_at?: string, > bucket?: string > } > ``` *** ### getById `objects.getById` Get a single Object by id **Risk:** `read` ```ts theme={null} await corsair.cosmic.api.objects.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `id` | `string` | Yes | — | | `props` | `string` | No | — | | `status` | `published \| draft \| any` | No | — | | `depth` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `object` | Yes | — | > **object full type** > > ```ts theme={null} > { > id: string, > slug?: string, > title?: string, > type?: string, > status?: string, > metadata?: { > }, > created_at?: string, > modified_at?: string, > published_at?: string, > bucket?: string > } > ``` *** ### insert `objects.insert` Create an Object in a Bucket **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.objects.insert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `title` | `string` | Yes | — | | `type` | `string` | Yes | — | | `slug` | `string` | No | — | | `status` | `published \| draft` | No | — | | `metadata` | `object` | No | — | | `trigger_webhook` | `boolean` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `object` | Yes | — | > **object full type** > > ```ts theme={null} > { > id: string, > slug: string, > title: string, > type: string, > status?: string, > metadata?: { > }, > created_at?: string, > modified_at?: string, > published_at?: string, > bucket?: string > } > ``` *** ### update `objects.update` Update an Object by id **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.objects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `slug` | `string` | No | — | | `status` | `published \| draft` | No | — | | `metadata` | `object` | No | — | | `trigger_webhook` | `boolean` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `object` | Yes | — | > **object full type** > > ```ts theme={null} > { > id: string, > slug: string, > title: string, > type: string, > status?: string, > metadata?: { > }, > created_at?: string, > modified_at?: string, > published_at?: string, > bucket?: string > } > ``` *** ## Object Types ### delete `objectTypes.delete` Delete an Object type by slug **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.objectTypes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `slug` | `string` | Yes | — | | `trigger_webhook` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### find `objectTypes.find` List Object types in a Bucket **Risk:** `read` ```ts theme={null} await corsair.cosmic.api.objectTypes.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object_types` | `object[]` | Yes | — | > **object\_types full type** > > ```ts theme={null} > { > id: string, > title: string, > slug: string, > singular?: string, > singleton?: boolean, > emoji?: string, > metafields?: { > id?: string, > title: string, > key: string, > type: string, > required?: boolean > }[], > created_at?: string, > modified_at?: string > }[] > ``` *** ### findOne `objectTypes.findOne` Get a single Object type by slug **Risk:** `read` ```ts theme={null} await corsair.cosmic.api.objectTypes.findOne({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object_type` | `object` | Yes | — | > **object\_type full type** > > ```ts theme={null} > { > id: string, > title: string, > slug: string, > singular?: string, > singleton?: boolean, > emoji?: string, > metafields?: { > id?: string, > title: string, > key: string, > type: string, > required?: boolean > }[], > created_at?: string, > modified_at?: string > } > ``` *** ### insert `objectTypes.insert` Create an Object type **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.objectTypes.insert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `title` | `string` | Yes | — | | `slug` | `string` | No | — | | `singular` | `string` | No | — | | `singleton` | `boolean` | No | — | | `emoji` | `string` | No | — | | `metafields` | `object[]` | No | — | | `localization` | `boolean` | No | — | | `options` | `object` | No | — | > **metafields full type** > > ```ts theme={null} > { > id?: string, > title: string, > key: string, > type: string, > required?: boolean > }[] > ``` > **options full type** > > ```ts theme={null} > { > slug_field?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object_type` | `object` | Yes | — | > **object\_type full type** > > ```ts theme={null} > { > id: string, > title: string, > slug: string, > singular?: string, > singleton?: boolean, > emoji?: string, > metafields?: { > id?: string, > title: string, > key: string, > type: string, > required?: boolean > }[], > created_at?: string, > modified_at?: string > } > ``` *** ### update `objectTypes.update` Update an Object type by slug **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.objectTypes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `slug` | `string` | Yes | — | | `title` | `string` | No | — | | `singular` | `string` | No | — | | `singleton` | `boolean` | No | — | | `emoji` | `string` | No | — | | `metafields` | `object[]` | No | — | > **metafields full type** > > ```ts theme={null} > { > id?: string, > title: string, > key: string, > type: string, > required?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object_type` | `object` | Yes | — | > **object\_type full type** > > ```ts theme={null} > { > id: string, > title: string, > slug: string, > singular?: string, > singleton?: boolean, > emoji?: string, > metafields?: { > id?: string, > title: string, > key: string, > type: string, > required?: boolean > }[], > created_at?: string, > modified_at?: string > } > ``` *** ## Revisions ### find `revisions.find` List Revisions for an Object **Risk:** `read` ```ts theme={null} await corsair.cosmic.api.revisions.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `objectId` | `string` | Yes | — | | `props` | `string` | No | — | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `sort` | `created_at \| -created_at` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `revisions` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `limit` | `number` | No | — | > **revisions full type** > > ```ts theme={null} > { > id: string, > object_id: string, > title: string, > slug: string, > status?: string, > metadata?: { > }, > created_at?: string > }[] > ``` *** ### findOne `revisions.findOne` Get a single Revision by id **Risk:** `read` ```ts theme={null} await corsair.cosmic.api.revisions.findOne({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `objectId` | `string` | Yes | — | | `revisionId` | `string` | Yes | — | | `props` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `revision` | `object` | Yes | — | > **revision full type** > > ```ts theme={null} > { > id: string, > object_id: string, > title: string, > slug: string, > status?: string, > metadata?: { > }, > created_at?: string > } > ``` *** ### insert `revisions.insert` Add a draft Revision to an Object **Risk:** `write` ```ts theme={null} await corsair.cosmic.api.revisions.insert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucketSlug` | `string` | No | — | | `objectId` | `string` | Yes | — | | `title` | `string` | No | — | | `slug` | `string` | No | — | | `metadata` | `object` | No | — | | `trigger_webhook` | `boolean` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `revision` | `object` | Yes | — | > **revision full type** > > ```ts theme={null} > { > id: string, > object_id: string, > title: string, > slug: string, > status?: string, > metadata?: { > }, > created_at?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/cosmic/database Cosmic local sync: searchable entities, `.search()` filters, and operators. The Cosmic plugin syncs data locally. Use `corsair.cosmic.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/cosmic/overview Cosmic plugin for Corsair Use **Cosmic** through Corsair: one client, typed API calls. **What you get:** * 20 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cosmic ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cosmic ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cosmic ``` ```bash bun theme={null} bun add corsair @corsair-dev/cosmic ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cosmic } from '@corsair-dev/cosmic'; export const corsair = createCorsair({ plugins: [ cosmic(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} cosmic() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cosmic', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`media.find`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cosmic.api.media.find({}); ``` **`media.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cosmic.api.media.delete({}); ``` See the full list on the [API](/plugins/cosmic/api) page. ## What's next > **[API reference](/plugins/cosmic/api)** > > Every `cosmic.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/countdownapi/api API reference for CountdownApi: every `countdownapi.api.*` operation with input and output types. Every `countdownapi.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Autocomplete ### get `autocomplete.get` Get eBay search autocomplete suggestions **Risk:** `read` ```ts theme={null} await corsair.countdownapi.api.autocomplete.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `ebay_domain` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_metadata` | `object` | Yes | — | | `request_info` | `object` | No | — | | `request_parameters` | `object` | No | — | | `autocomplete_results` | `object[]` | Yes | — | > **request\_metadata full type** > > ```ts theme={null} > { > id: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > ebay_url?: string > } > ``` > **request\_info full type** > > ```ts theme={null} > { > success?: boolean, > credits_used?: number, > credits_remaining?: number > } > ``` > **request\_parameters full type** > > ```ts theme={null} > { > type: string, > ebay_domain?: string, > search_term?: string, > epid?: string, > gtin?: string, > url?: string > } > ``` > **autocomplete\_results full type** > > ```ts theme={null} > { > suggestion: string, > type?: string, > category_id?: string | number, > category_name?: string > }[] > ``` *** ## Product ### get `product.get` Get eBay product data using Countdown API **Risk:** `read` ```ts theme={null} await corsair.countdownapi.api.product.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `epid` | `string` | No | — | | `gtin` | `string` | No | — | | `ebay_domain` | `string` | Yes | — | | `include_html` | `boolean` | No | — | | `skip_gtin_cache` | `boolean` | No | — | | `include_parts_compatibility` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > request_metadata: { > id: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > ebay_url?: string > }, > request_info?: { > success?: boolean, > credits_used?: number, > credits_remaining?: number > }, > request_parameters?: { > type: string, > ebay_domain?: string, > search_term?: string, > epid?: string, > gtin?: string, > url?: string > }, > is_master?: false, > product: { > title: string, > link?: string, > epid?: string, > gtin?: string, > images?: { > link: string > }[], > attributes?: { > name: string, > value?: string > }[] > } > } | { > request_metadata: { > id: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > ebay_url?: string > }, > request_info?: { > success?: boolean, > credits_used?: number, > credits_remaining?: number > }, > request_parameters?: { > type: string, > ebay_domain?: string, > search_term?: string, > epid?: string, > gtin?: string, > url?: string > }, > is_master: true, > sold_out?: boolean, > top_picks: { > product: { > title: string, > link?: string, > epid?: string, > gtin?: string, > images?: { > link: string > }[], > attributes?: { > name: string, > value?: string > }[] > }, > all_listings?: { > link?: string, > count?: number > }, > seller?: { > name?: string, > link?: string, > feedback_score?: number, > positive_feedback_percent?: number | string > }, > shipping?: { > raw?: string, > price?: number, > currency?: string, > location?: string, > delivery_estimate?: string > }, > condition?: { > raw?: string, > name?: string, > is_new?: boolean, > is_used?: boolean > }, > is_auction?: boolean, > offer?: { > price?: number, > raw?: string, > currency?: string > } > }[] > } | { > request_metadata: { > id: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > ebay_url?: string > }, > request_info?: { > success?: boolean, > credits_used?: number, > credits_remaining?: number > }, > request_parameters?: { > type: string, > ebay_domain?: string, > search_term?: string, > epid?: string, > gtin?: string, > url?: string > }, > redirected?: boolean, > redirected_link: string, > redirected_epid: string > } > ``` *** ## Search ### get `search.get` Search eBay products using Countdown API **Risk:** `read` ```ts theme={null} await corsair.countdownapi.api.search.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `ebay_domain` | `string` | Yes | — | | `page` | `number` | No | — | | `category_id` | `string` | No | — | | `listing_type` | `all \| buy_it_now \| auction \| accepts_offers` | No | — | | `sort_by` | `best_match \| price_high_to_low \| price_low_to_high \| price_high_to_low_plus_postage \| price_low_to_high_plus_postage \| newly_listed \| ending_soonest` | No | — | | `condition` | `all \| new \| used \| open_box \| manufacturer_refurbished \| seller_refurbished \| parts_or_not_working \| not_specified` | No | — | | `max_page` | `number` | No | — | | `num` | `60 \| 120 \| 240` | No | — | | `url` | `string` | No | — | | `authorized_sellers` | `boolean` | No | — | | `returns_accepted` | `boolean` | No | — | | `free_returns` | `boolean` | No | — | | `authenticity_verified` | `boolean` | No | — | | `deals_and_savings` | `boolean` | No | — | | `sale_items` | `boolean` | No | — | | `facets` | `string` | No | — | | `allow_rewritten_results` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_metadata` | `object` | Yes | — | | `request_info` | `object` | No | — | | `request_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `search_results` | `object[]` | Yes | — | | `facets` | `object[]` | No | — | | `pagination` | `object` | No | — | > **request\_metadata full type** > > ```ts theme={null} > { > id: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > ebay_url?: string > } > ``` > **request\_info full type** > > ```ts theme={null} > { > success?: boolean, > credits_used?: number, > credits_remaining?: number > } > ``` > **request\_parameters full type** > > ```ts theme={null} > { > type: string, > ebay_domain?: string, > search_term?: string, > epid?: string, > gtin?: string, > url?: string > } > ``` > **search\_information full type** > > ```ts theme={null} > { > original_search_term?: string, > did_you_mean?: string, > did_you_mean_results_count?: number, > spelling_correction?: string > } > ``` > **search\_results full type** > > ```ts theme={null} > { > position?: number, > title: string, > epid?: string, > link: string, > image?: string, > hotness?: string, > condition?: string, > is_auction?: boolean, > buy_it_now?: boolean, > free_returns?: boolean, > sponsored?: boolean, > item_location?: string, > rating?: number, > ratings_total?: number, > shipping_cost?: number, > prices?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }[], > price?: { > symbol?: string, > value?: number, > currency?: string, > raw?: string, > name?: string > }, > ended?: { > type?: string, > date?: { > raw?: string > } > }, > seller_info?: { > name?: string, > review_count?: number, > positive_feedback_percent?: number > } > }[] > ``` > **facets full type** > > ```ts theme={null} > { > name: string, > display_name?: string, > values?: { > name: string, > count?: number, > param_value?: string > }[] > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > current_page?: number, > total_results?: number | string, > has_next_page?: boolean, > next_page?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/countdownapi/database CountdownApi local sync: searchable entities, `.search()` filters, and operators. The CountdownApi plugin syncs data locally. Use `corsair.countdownapi.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/countdownapi/overview CountdownApi plugin for Corsair Use **CountdownApi** through Corsair: one client, typed API calls. **What you get:** * 3 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/countdownapi ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/countdownapi ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/countdownapi ``` ```bash bun theme={null} bun add corsair @corsair-dev/countdownapi ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { countdownapi } from '@corsair-dev/countdownapi'; export const corsair = createCorsair({ plugins: [ countdownapi(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} countdownapi() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'countdownapi', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`autocomplete.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.countdownapi.api.autocomplete.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/countdownapi/api) reference.* See the full list on the [API](/plugins/countdownapi/api) page. ## What's next > **[API reference](/plugins/countdownapi/api)** > > Every `countdownapi.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/crowterminal/api API reference for Crow Terminal: every `crowterminal.api.*` operation with input and output types. Every `crowterminal.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agent ### register `agent.register` Self-register an agent and receive a new API key **Risk:** `write` ```ts theme={null} await corsair.crowterminal.api.agent.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agentName` | `string` | Yes | — | | `agentDescription` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | | `apiKey` | `string` | No | — | | `agentId` | `string` | No | — | *** ## Data ### getTypes `data.getTypes` List the analytics data types each platform accepts **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.data.getTypes({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `dataTypes` | `object` | Yes | — | > **dataTypes full type** > > ```ts theme={null} > { > } > ``` *** ### ingest `data.ingest` Ingest one platform analytics data point **Risk:** `write` ```ts theme={null} await corsair.crowterminal.api.data.ingest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | | `platform` | `TIKTOK \| INSTAGRAM \| YOUTUBE` | Yes | — | | `dataType` | `retention \| demographics \| traffic_sources \| watch_time \| audience_activity \| follower_growth \| video_performance \| sound_performance \| hashtag_performance \| reach_sources \| content_interactions \| story_metrics \| reel_metrics \| subscriber_growth \| click_through_rate \| impression_sources \| end_screen_performance` | Yes | — | | `videoId` | `string` | No | — | | `data` | `object` | Yes | — | | `confidence` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### ingestBulk `data.ingestBulk` Ingest up to 50 analytics data points at once **Risk:** `write` ```ts theme={null} await corsair.crowterminal.api.data.ingestBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > clientId: string, > platform: TIKTOK | INSTAGRAM | YOUTUBE, > dataType: retention | demographics | traffic_sources | watch_time | audience_activity | follower_growth | video_performance | sound_performance | hashtag_performance | reach_sources | content_interactions | story_metrics | reel_metrics | subscriber_growth | click_through_rate | impression_sources | end_screen_performance, > videoId?: string, > data: { > }, > confidence?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `total` | `number` | No | — | | `results` | `any[]` | No | — | *** ## Intelligence ### getByokPlatform `intelligence.getByokPlatform` Get raw algorithm context without LLM inference charges **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.intelligence.getByokPlatform({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `platforms` | `string[]` | No | — | | `intelligence` | `any` | No | — | *** ### getPlatform `intelligence.getPlatform` Get TikTok, Instagram and YouTube algorithm insights **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.intelligence.getPlatform({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `data` | `any` | No | — | *** ## Memory ### compareMd `memory.compareMd` Diff an agent markdown against all stored versions **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.memory.compareMd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | | `agentMd` | `object` | Yes | — | > **agentMd full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `clientId` | `string` | No | — | | `comparison` | `string` | No | — | | `message` | `string` | No | — | | `recommendation` | `string` | No | — | | `differences` | `any[]` | No | — | | `missingFields` | `string[]` | No | — | *** ### engagementAnalysis `memory.engagementAnalysis` Correlate every agent field with historical engagement **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.memory.engagementAnalysis({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | | `agentMd` | `object` | Yes | — | > **agentMd full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `clientId` | `string` | No | — | | `analysis` | `string` | No | — | | `message` | `string` | No | — | | `versionsAnalyzed` | `number` | No | — | | `overallStats` | `object` | No | — | | `fieldAnalysis` | `any[]` | No | — | > **overallStats full type** > > ```ts theme={null} > { > } > ``` *** ### get `memory.get` Get the stored skill for one client **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.memory.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `clientId` | `string` | No | — | | `clientName` | `string` | No | — | | `version` | `number` | No | — | | `updatedAt` | `string` | No | — | | `skill` | `object` | No | — | > **skill full type** > > ```ts theme={null} > { > primaryNiche?: string, > subNiches?: string[], > contentStyle?: string, > signatureStyle?: string, > hookPatterns?: string[], > avgEngagement?: number, > bestPostingTimes?: { > day?: number, > hour?: number, > score?: number > }[] > } > ``` *** ### getBulk `memory.getBulk` Read stored skills for up to 50 clients **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.memory.getBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `total` | `number` | No | — | | `clients` | `object[]` | Yes | — | > **clients full type** > > ```ts theme={null} > { > clientId: string, > success?: boolean, > skill?: { > primaryNiche?: string, > subNiches?: string[], > contentStyle?: string, > signatureStyle?: string, > hookPatterns?: string[], > avgEngagement?: number, > bestPostingTimes?: { > day?: number, > hour?: number, > score?: number > }[] > } | null > }[] > ``` *** ### getChangelog `memory.getChangelog` Read the change history of a client skill **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.memory.getChangelog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `clientId` | `string` | No | — | | `message` | `string` | No | — | | `changelog` | `any[]` | Yes | — | *** ### getPattern `memory.getPattern` Trend one skill field across stored versions **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.memory.getPattern({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | | `field` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `clientId` | `string` | No | — | | `field` | `string` | No | — | | `trend` | `string` | No | — | | `versionsAnalyzed` | `number` | No | — | | `dataPoints` | `any[]` | Yes | — | *** ### validateChanges `memory.validateChanges` Check proposed edits against historical outcomes **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.memory.validateChanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | | `proposedChanges` | `object[]` | Yes | — | > **proposedChanges full type** > > ```ts theme={null} > { > field: string, > oldValue?: any, > newValue?: any > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `clientId` | `string` | No | — | | `validation` | `string` | No | — | | `message` | `string` | No | — | | `warnings` | `any[]` | Yes | — | | `recommendations` | `any[]` | Yes | — | *** ## Sandbox ### engagementAnalysis `sandbox.engagementAnalysis` Run a mock engagement analysis **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.sandbox.engagementAnalysis({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agentMd` | `object` | No | — | > **agentMd full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `versionsAnalyzed` | `number` | No | — | | `overallStats` | `object` | No | — | | `fieldAnalysis` | `any[]` | No | — | > **overallStats full type** > > ```ts theme={null} > { > } > ``` *** ### getClient `sandbox.getClient` Get mock client data for testing **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.sandbox.getClient({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `clientId` | `string` | No | — | | `clientName` | `string` | No | — | | `version` | `number` | No | — | | `skill` | `object` | No | — | > **skill full type** > > ```ts theme={null} > { > primaryNiche?: string, > subNiches?: string[], > contentStyle?: string, > signatureStyle?: string, > hookPatterns?: string[], > avgEngagement?: number, > bestPostingTimes?: { > day?: number, > hour?: number, > score?: number > }[] > } > ``` *** ### getMemory `sandbox.getMemory` Get mock skill data for testing **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.sandbox.getMemory({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `clientId` | `string` | No | — | | `clientName` | `string` | No | — | | `version` | `number` | No | — | | `skill` | `object` | No | — | > **skill full type** > > ```ts theme={null} > { > primaryNiche?: string, > subNiches?: string[], > contentStyle?: string, > signatureStyle?: string, > hookPatterns?: string[], > avgEngagement?: number, > bestPostingTimes?: { > day?: number, > hour?: number, > score?: number > }[] > } > ``` *** ### validate `sandbox.validate` Run a mock validation **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.sandbox.validate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `proposedChanges` | `object[]` | Yes | — | > **proposedChanges full type** > > ```ts theme={null} > { > field: string, > oldValue?: any, > newValue?: any > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `validation` | `string` | No | — | | `warnings` | `any[]` | Yes | — | | `recommendations` | `any[]` | Yes | — | *** ## Status ### get `status.get` Get CrowTerminal service health **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.status.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `timestamp` | `string` | No | — | | `version` | `string` | No | — | | `services` | `object` | No | — | | `metrics` | `object` | No | — | | `endpoints` | `object` | No | — | > **services full type** > > ```ts theme={null} > { > } > ``` > **metrics full type** > > ```ts theme={null} > { > } > ``` > **endpoints full type** > > ```ts theme={null} > { > } > ``` *** ### getComponents `status.getComponents` Get per-component health and latency **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.status.getComponents({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `components` | `object[]` | Yes | — | | `summary` | `object` | No | — | > **components full type** > > ```ts theme={null} > { > name: string, > status: string, > latency?: string, > details?: string > }[] > ``` > **summary full type** > > ```ts theme={null} > { > } > ``` *** ### getHistory `status.getHistory` Get seven days of uptime points for charting **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.status.getHistory({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `period` | `string` | No | — | | `dataPoints` | `object[]` | Yes | — | | `summary` | `object` | No | — | > **dataPoints full type** > > ```ts theme={null} > { > date: string, > uptime?: number > }[] > ``` > **summary full type** > > ```ts theme={null} > { > } > ``` *** ### getIncidents `status.getIncidents` List recent incidents and affected components **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.status.getIncidents({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `incidents` | `object[]` | Yes | — | | `subscribe` | `string` | No | — | > **incidents full type** > > ```ts theme={null} > { > timestamp?: string, > status?: string, > duration?: string, > components?: string[] > }[] > ``` *** ### getUptime `status.getUptime` Get 24h and 7d uptime percentages **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.status.getUptime({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `string` | No | — | | `currentStatus` | `string` | No | — | | `uptime` | `object` | Yes | — | | `recentIncidents` | `any[]` | No | — | > **uptime full type** > > ```ts theme={null} > { > } > ``` *** ### ping `status.ping` Check that CrowTerminal is responding **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.status.ping({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `pong` | `boolean` | Yes | — | | `timestamp` | `string` | No | — | *** ## Webhooks ### create `webhooks.create` Register a CrowTerminal webhook **Risk:** `write` ```ts theme={null} await corsair.crowterminal.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `events` | `skill.updated \| skill.version_created \| data.ingested \| validation.blocked \| posting.completed \| posting.failed[]` | Yes | — | | `secret` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `id` | `string` | No | — | | `secret` | `string` | No | — | *** ### delete `webhooks.delete` Delete a CrowTerminal webhook **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.crowterminal.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### list `webhooks.list` List registered CrowTerminal webhooks **Risk:** `read` ```ts theme={null} await corsair.crowterminal.api.webhooks.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `webhooks` | `object[]` | Yes | — | > **webhooks full type** > > ```ts theme={null} > { > id?: string > }[] > ``` *** ### test `webhooks.test` Send a test delivery to a webhook URL **Risk:** `write` ```ts theme={null} await corsair.crowterminal.api.webhooks.test({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `secret` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### update `webhooks.update` Update a CrowTerminal webhook **Risk:** `write` ```ts theme={null} await corsair.crowterminal.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | | `url` | `string` | No | — | | `events` | `skill.updated \| skill.version_created \| data.ingested \| validation.blocked \| posting.completed \| posting.failed[]` | No | — | | `isActive` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/crowterminal/database Crow Terminal local sync: searchable entities, `.search()` filters, and operators. The Crow Terminal plugin syncs data locally. Use `corsair.crowterminal.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Data Points Path: `crowterminal.db.dataPoints.search` ```ts theme={null} const rows = await corsair.crowterminal.db.dataPoints.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Incidents Path: `crowterminal.db.incidents.search` ```ts theme={null} const rows = await corsair.crowterminal.db.incidents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Skills Path: `crowterminal.db.skills.search` ```ts theme={null} const rows = await corsair.crowterminal.db.skills.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `clientName` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `number` | equals, gt, gte, lt, lte, in | | `primaryNiche` | `string` | equals, contains, startsWith, endsWith, in | | `contentStyle` | `string` | equals, contains, startsWith, endsWith, in | | `signatureStyle` | `string` | equals, contains, startsWith, endsWith, in | | `avgEngagement` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `crowterminal.db.webhooks.search` ```ts theme={null} const rows = await corsair.crowterminal.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `isActive` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/crowterminal/overview Financial terminal API for market data, trading tools, and investment research workflows. Use **Crow Terminal** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 28 typed API operations * 4 synced entities (`dataPoints`, `incidents`, `skills`, `webhooks`) for fast `.search()` / `.list()` * 6 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/crowterminal ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/crowterminal ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/crowterminal ``` ```bash bun theme={null} bun add corsair @corsair-dev/crowterminal ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { crowterminal } from '@corsair-dev/crowterminal'; export const corsair = createCorsair({ plugins: [ crowterminal(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} crowterminal() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'crowterminal', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`data.getTypes`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.crowterminal.api.data.getTypes({}); ``` **`agent.register`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.crowterminal.api.agent.register({}); ``` See the full list on the [API](/plugins/crowterminal/api) page. ## Query synced data Synced entities support `tenant.crowterminal.db..search()` and `.list()`: `dataPoints`, `incidents`, `skills`, `webhooks`. See [Database](/plugins/crowterminal/database) for filters and operators. ## Webhooks This plugin registers **6** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/crowterminal/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/crowterminal/api)** > > Every `crowterminal.api.*` operation with input and output types. > **[Database](/plugins/crowterminal/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/crowterminal/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/crowterminal/webhooks Crow Terminal incoming webhooks: event paths, payloads, and response data. The Crow Terminal plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/crowterminal/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `data` * `ingested` (`data.ingested`) * `posting` * `completed` (`posting.completed`) * `failed` (`posting.failed`) * `skill` * `updated` (`skill.updated`) * `versionCreated` (`skill.versionCreated`) * `validation` * `blocked` (`validation.blocked`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Data ### Ingested `data.ingested` Agent data was ingested **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `data.ingested` | Yes | — | | `timestamp` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | | `agentId` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: data.ingested, > timestamp: string, > webhookId: string, > agentId: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} crowterminal({ webhookHooks: { data: { ingested: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Posting ### Completed `posting.completed` Content posting completed successfully **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `posting.completed` | Yes | — | | `timestamp` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | | `agentId` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: posting.completed, > timestamp: string, > webhookId: string, > agentId: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} crowterminal({ webhookHooks: { posting: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Failed `posting.failed` Content posting failed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `posting.failed` | Yes | — | | `timestamp` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | | `agentId` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: posting.failed, > timestamp: string, > webhookId: string, > agentId: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} crowterminal({ webhookHooks: { posting: { failed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Skill ### Updated `skill.updated` A client skill was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `skill.updated` | Yes | — | | `timestamp` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | | `agentId` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: skill.updated, > timestamp: string, > webhookId: string, > agentId: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} crowterminal({ webhookHooks: { skill: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Version Created `skill.versionCreated` A new skill version was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `skill.version_created` | Yes | — | | `timestamp` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | | `agentId` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: skill.version_created, > timestamp: string, > webhookId: string, > agentId: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} crowterminal({ webhookHooks: { skill: { versionCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Validation ### Blocked `validation.blocked` A proposed memory change was blocked **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `validation.blocked` | Yes | — | | `timestamp` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | | `agentId` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: validation.blocked, > timestamp: string, > webhookId: string, > agentId: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} crowterminal({ webhookHooks: { validation: { blocked: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/currentsapi/api API reference for CurrentsApi: every `currentsapi.api.*` operation with input and output types. Every `currentsapi.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Categories ### get `categories.get` List valid category codes **Risk:** `read` ```ts theme={null} await corsair.currentsapi.api.categories.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `categories` | `string[]` | Yes | — | | `description` | `string` | No | — | | `status` | `string` | No | — | *** ## Languages ### get `languages.get` List valid language codes **Risk:** `read` ```ts theme={null} await corsair.currentsapi.api.languages.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `languages` | `object` | Yes | — | | `description` | `string` | No | — | | `status` | `string` | No | — | > **languages full type** > > ```ts theme={null} > { > } > ``` *** ## Latest ### get `latest.get` Get latest news headlines **Risk:** `read` ```ts theme={null} await corsair.currentsapi.api.latest.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `string` | Yes | — | | `category` | `string` | No | — | | `country` | `string` | No | — | | `page_number` | `number` | No | — | | `page_size` | `number` | No | — | | `type` | `1 \| 2 \| 3` | No | — | | `domain` | `string` | No | — | | `domain_not` | `string` | No | — | | `author` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| error` | Yes | — | | `news` | `object[]` | Yes | — | | `page` | `number` | Yes | — | | `query_matched` | `boolean` | No | — | | `query_scope` | `string` | No | — | | `reason` | `string` | No | — | | `page_has_results` | `boolean` | No | — | > **news full type** > > ```ts theme={null} > { > id: string, > title: string, > description?: string, > url?: string, > author?: string, > image?: string, > language?: string, > category?: string[], > source_category?: string[], > published?: string > }[] > ``` *** ## Regions ### get `regions.get` List valid country region codes **Risk:** `read` ```ts theme={null} await corsair.currentsapi.api.regions.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `regions` | `object` | Yes | — | | `description` | `string` | No | — | | `status` | `string` | No | — | > **regions full type** > > ```ts theme={null} > { > } > ``` *** ## Search ### get `search.get` Search news articles by keywords with filters **Risk:** `read` ```ts theme={null} await corsair.currentsapi.api.search.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keywords` | `string` | No | — | | `query` | `string` | No | — | | `language` | `string` | Yes | — | | `category` | `string` | No | — | | `country` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `page_number` | `number` | No | — | | `page_size` | `number` | No | — | | `limit` | `number` | No | — | | `type` | `1 \| 2 \| 3` | No | — | | `domain` | `string` | No | — | | `domain_not` | `string` | No | — | | `author` | `string` | No | — | | `has_image` | `boolean` | No | — | | `has_description` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok \| error` | Yes | — | | `news` | `object[]` | Yes | — | | `page` | `number` | Yes | — | | `query_matched` | `boolean` | No | — | | `query_scope` | `string` | No | — | | `reason` | `string` | No | — | | `page_has_results` | `boolean` | No | — | > **news full type** > > ```ts theme={null} > { > id: string, > title: string, > description?: string, > url?: string, > author?: string, > image?: string, > language?: string, > category?: string[], > source_category?: string[], > published?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/currentsapi/database CurrentsApi local sync: searchable entities, `.search()` filters, and operators. The CurrentsApi plugin syncs data locally. Use `corsair.currentsapi.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/currentsapi/overview CurrentsApi plugin for Corsair Use **CurrentsApi** through Corsair: one client, typed API calls. **What you get:** * 5 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/currentsapi ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/currentsapi ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/currentsapi ``` ```bash bun theme={null} bun add corsair @corsair-dev/currentsapi ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { currentsapi } from '@corsair-dev/currentsapi'; export const corsair = createCorsair({ plugins: [ currentsapi(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} currentsapi() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'currentsapi', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`categories.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.currentsapi.api.categories.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/currentsapi/api) reference.* See the full list on the [API](/plugins/currentsapi/api) page. ## What's next > **[API reference](/plugins/currentsapi/api)** > > Every `currentsapi.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/cursor/api API reference for Cursor: every `cursor.api.*` operation with input and output types. Every `cursor.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getMe `account.getMe` Retrieve API key information including name, creation date, and owner email **Risk:** `read` ```ts theme={null} await corsair.cursor.api.account.getMe({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `apiKeyName` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `userEmail` | `string` | No | — | *** ## Agents ### getConversation `agents.getConversation` Retrieve the conversation history for a specific cloud agent **Risk:** `read` ```ts theme={null} await corsair.cursor.api.agents.getConversation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > id?: string, > text?: string, > type?: user_message | assistant_message > }[] > ``` *** ### list `agents.list` Retrieve a paginated list of Cursor Cloud agents **Risk:** `read` ```ts theme={null} await corsair.cursor.api.agents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `agents` | `object[]` | Yes | — | | `nextCursor` | `string` | No | — | > **agents full type** > > ```ts theme={null} > { > id?: string, > name?: string, > source?: { > ref?: string, > repository?: string > }, > status?: RUNNING | FINISHED | ERROR | CREATING | EXPIRED, > target?: { > url?: string, > prUrl?: string, > branchName?: string, > autoCreatePr?: boolean, > skipReviewerRequest?: boolean, > openAsCursorGithubApp?: boolean > }, > summary?: string, > createdAt?: string > }[] > ``` *** ## Models ### list `models.list` Retrieve the list of available AI models in Cursor **Risk:** `read` ```ts theme={null} await corsair.cursor.api.models.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `models` | `string[]` | Yes | — | *** ## Repositories ### list `repositories.list` List GitHub repositories accessible to the authenticated user **Risk:** `read` ```ts theme={null} await corsair.cursor.api.repositories.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `repositories` | `object[]` | Yes | — | > **repositories full type** > > ```ts theme={null} > { > name?: string, > owner?: string, > repository?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/cursor/database Cursor local sync: searchable entities, `.search()` filters, and operators. The Cursor plugin syncs data locally. Use `corsair.cursor.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Agents Path: `cursor.db.agents.search` ```ts theme={null} const rows = await corsair.cursor.db.agents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `sourceRef` | `string` | equals, contains, startsWith, endsWith, in | | `sourceRepository` | `string` | equals, contains, startsWith, endsWith, in | | `targetUrl` | `string` | equals, contains, startsWith, endsWith, in | | `targetPrUrl` | `string` | equals, contains, startsWith, endsWith, in | | `targetBranchName` | `string` | equals, contains, startsWith, endsWith, in | | `targetAutoCreatePr` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Api Keys Path: `cursor.db.apiKeys.search` ```ts theme={null} const rows = await corsair.cursor.db.apiKeys.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `apiKeyName` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `userEmail` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Models Path: `cursor.db.models.search` ```ts theme={null} const rows = await corsair.cursor.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Repositories Path: `cursor.db.repositories.search` ```ts theme={null} const rows = await corsair.cursor.db.repositories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `owner` | `string` | equals, contains, startsWith, endsWith, in | | `repository` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/cursor/get-credentials Step-by-step instructions for obtaining Cursor API credentials. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Cursor API key ## API Key Setup ### Step 1: Get Your API Key 1. Log in to [Cursor](https://cursor.com) 2. Go to your account settings 3. Navigate to the **API** or **Developer** section 4. Generate or copy your API key 5. Store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=cursor api_key=your-api-key ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Key | All API calls | Cursor account settings → API | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/cursor/overview AI-powered code editor integrations for developer workflows and programming assistance tools. Use **Cursor** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 4 synced entities (`agents`, `apiKeys`, `models`, `repositories`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cursor ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cursor ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cursor ``` ```bash bun theme={null} bun add corsair @corsair-dev/cursor ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cursor } from '@corsair-dev/cursor'; export const corsair = createCorsair({ plugins: [ cursor(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/cursor/get-credentials). ```ts theme={null} cursor() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cursor', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getMe`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cursor.api.account.getMe({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/cursor/api) reference.* See the full list on the [API](/plugins/cursor/api) page. ## Query synced data Synced entities support `tenant.cursor.db..search()` and `.list()`: `agents`, `apiKeys`, `models`, `repositories`. See [Database](/plugins/cursor/database) for filters and operators. ## What's next > **[API reference](/plugins/cursor/api)** > > Every `cursor.api.*` operation with input and output types. > **[Database](/plugins/cursor/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/cursor/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/customerio/api API reference for Customer.io: every `customerio.api.*` operation with input and output types. Every `customerio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Broadcasts ### getTrigger `broadcasts.getTrigger` Get details of a specific broadcast trigger **Risk:** `read` ```ts theme={null} await corsair.customerio.api.broadcasts.getTrigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `broadcast_id` | `number` | Yes | — | | `trigger_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `broadcast_id` | `number` | No | — | | `campaign_id` | `number` | No | — | | `state` | `string` | No | — | | `data` | `lazy` | No | — | | `created` | `number \| string` | No | — | | `created_at` | `number \| string` | No | — | | `processed_at` | `number \| string` | No | — | *** ### listTriggers `broadcasts.listTriggers` List API trigger instances for a broadcast **Risk:** `read` ```ts theme={null} await corsair.customerio.api.broadcasts.listTriggers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `broadcast_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `triggers` | `object[]` | Yes | — | | `next` | `string` | No | — | > **triggers full type** > > ```ts theme={null} > { > id: number, > broadcast_id?: number, > campaign_id?: number, > state?: string, > data?: lazy, > created?: number | string, > created_at?: number | string, > processed_at?: number | string > }[] > ``` *** ### trigger `broadcasts.trigger` Trigger a Customer.io broadcast to a defined audience **Risk:** `write` ```ts theme={null} await corsair.customerio.api.broadcasts.trigger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `broadcast_id` | `number` | Yes | — | | `data` | `lazy` | No | — | | `recipients` | `lazy` | No | — | | `ids` | `string[]` | No | — | | `emails` | `string[]` | No | — | | `per_user_data` | `object[]` | No | — | | `data_file_url` | `string` | No | — | | `email_add_duplicates` | `boolean` | No | — | | `email_ignore_missing` | `boolean` | No | — | | `id_ignore_missing` | `boolean` | No | — | > **per\_user\_data full type** > > ```ts theme={null} > { > id?: string, > email?: string, > data?: lazy > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `broadcast_id` | `number` | No | — | | `trigger_id` | `number` | No | — | | `created` | `number \| string` | No | — | *** ## Cdp ### batch `cdp.batch` Send multiple CDP calls (identify, track, page, screen, group, alias) in one batch **Risk:** `write` ```ts theme={null} await corsair.customerio.api.cdp.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch` | `object[]` | Yes | — | | `context` | `lazy` | No | — | > **batch full type** > > ```ts theme={null} > ( > { > type: identify, > userId?: string, > anonymousId?: string, > traits?: lazy, > context?: lazy, > timestamp?: string > } | { > type: track, > userId?: string, > anonymousId?: string, > event: string, > properties?: lazy, > context?: lazy, > timestamp?: string > } | { > type: page, > userId?: string, > anonymousId?: string, > name?: string, > properties?: lazy, > context?: lazy, > timestamp?: string > } | { > type: screen, > userId?: string, > anonymousId?: string, > name: string, > properties?: lazy, > context?: lazy, > timestamp?: string > } | { > type: group, > userId?: string, > anonymousId?: string, > groupId: string, > traits?: lazy, > context?: lazy, > timestamp?: string > } | { > type: alias, > userId: string, > previousId: string, > context?: lazy, > timestamp?: string > } > )[] > ``` **Output:** *empty object* *** ### page `cdp.page` Track a website page view via the CDP API **Risk:** `write` ```ts theme={null} await corsair.customerio.api.cdp.page({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `anonymousId` | `string` | No | — | | `name` | `string` | No | — | | `properties` | `lazy` | No | — | | `context` | `lazy` | No | — | | `timestamp` | `string` | No | — | **Output:** *empty object* *** ### screen `cdp.screen` Track a mobile screen view via the CDP API **Risk:** `write` ```ts theme={null} await corsair.customerio.api.cdp.screen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `anonymousId` | `string` | No | — | | `name` | `string` | Yes | — | | `properties` | `lazy` | No | — | | `context` | `lazy` | No | — | | `timestamp` | `string` | No | — | **Output:** *empty object* *** ## Collections ### list `collections.list` List Collections metadata in the workspace **Risk:** `read` ```ts theme={null} await corsair.customerio.api.collections.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `collections` | `object[]` | No | — | > **collections full type** > > ```ts theme={null} > { > id?: string, > name?: string, > schema?: lazy, > rows?: number, > bytes?: number, > created?: number | string > }[] > ``` *** ## Groups ### addPerson `groups.addPerson` Add a person to a group (company, account or project) **Risk:** `write` ```ts theme={null} await corsair.customerio.api.groups.addPerson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `groupId` | `string` | Yes | — | | `traits` | `lazy` | No | — | **Output:** *empty object* *** ## Info ### listIps `info.listIps` List IP addresses used by Customer.io for sending messages **Risk:** `read` ```ts theme={null} await corsair.customerio.api.info.listIps({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `ip_addresses` | `string[]` | Yes | — | *** ## Messages ### list `messages.list` List messages sent from the workspace with pagination **Risk:** `read` ```ts theme={null} await corsair.customerio.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `start` | `string` | No | — | | `drafts` | `boolean` | No | — | | `type` | `email \| push \| sms \| in_app \| inbox \| whatsapp` | No | — | | `campaign_id` | `number` | No | — | | `newsletter_id` | `number` | No | — | | `action_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | — | | `next` | `string` | No | — | > **messages full type** > > ```ts theme={null} > { > id?: string | number, > type?: string, > customer_id?: string, > campaign_id?: number, > newsletter_id?: number, > action_id?: number, > subject?: string, > created?: number | string > }[] > ``` *** ## Newsletters ### list `newsletters.list` List one-time sends (newsletters) with pagination **Risk:** `read` ```ts theme={null} await corsair.customerio.api.newsletters.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `start` | `string` | No | — | | `sort` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `newsletters` | `object[]` | Yes | — | | `next` | `string` | No | — | > **newsletters full type** > > ```ts theme={null} > { > id?: number, > name?: string, > type?: string, > content_ids?: number[], > sent_at?: number | string > }[] > ``` *** ## Profiles ### alias `profiles.alias` Merge two profiles by aliasing the secondary into the primary **Risk:** `write` ```ts theme={null} await corsair.customerio.api.profiles.alias({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `primary` | `object` | Yes | — | | `secondary` | `object` | Yes | — | > **primary full type** > > ```ts theme={null} > { > id?: string | number, > email?: string, > cio_id?: string > } > ``` > **secondary full type** > > ```ts theme={null} > { > id?: string | number, > email?: string, > cio_id?: string > } > ``` **Output:** *empty object* *** ### identify `profiles.identify` Identify a person and assign traits (creates or updates the profile) **Risk:** `write` ```ts theme={null} await corsair.customerio.api.profiles.identify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `email` | `string` | No | — | | `id` | `string \| number` | No | — | | `created_at` | `number` | No | — | | `attributes` | `lazy` | No | — | **Output:** *empty object* *** ### reportPush `profiles.reportPush` Report delivery metrics via the metrics endpoint (push events endpoint is deprecated) **Risk:** `write` ```ts theme={null} await corsair.customerio.api.profiles.reportPush({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `delivery_id` | `string` | Yes | — | | `metric` | `bounced \| clicked \| converted \| deferred \| delivered \| dropped \| opened \| spammed` | No | — | | `event` | `bounced \| clicked \| converted \| deferred \| delivered \| dropped \| opened \| spammed` | No | — | | `href` | `string` | No | — | | `reason` | `string` | No | — | | `timestamp` | `number` | No | — | | `recipient` | `string` | No | — | **Output:** *empty object* *** ### suppress `profiles.suppress` Suppress a profile: permanently deletes it and blocks re-adding **Risk:** `destructive` ```ts theme={null} await corsair.customerio.api.profiles.suppress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | **Output:** *empty object* *** ### trackEvent `profiles.trackEvent` Record an event for a person **Risk:** `write` ```ts theme={null} await corsair.customerio.api.profiles.trackEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `name` | `string` | Yes | — | | `data` | `lazy` | No | — | | `timestamp` | `number` | No | — | | `type` | `string` | No | — | | `anonymous_id` | `string` | No | — | **Output:** *empty object* *** ### unsubscribe `profiles.unsubscribe` Unsubscribe a person from emails for a specific delivery **Risk:** `write` ```ts theme={null} await corsair.customerio.api.profiles.unsubscribe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `delivery_id` | `string` | Yes | — | | `unsubscribe` | `boolean` | No | — | **Output:** *empty object* *** ## Reporting Webhooks ### list `reportingWebhooks.list` List reporting webhook configurations in the workspace **Risk:** `read` ```ts theme={null} await corsair.customerio.api.reportingWebhooks.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `reporting_webhooks` | `object[]` | No | — | > **reporting\_webhooks full type** > > ```ts theme={null} > { > id?: number, > name?: string, > endpoint?: string, > events?: string[], > disabled?: boolean > }[] > ``` *** ## Segments ### get `segments.get` Get details of a specific segment **Risk:** `read` ```ts theme={null} await corsair.customerio.api.segments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segment_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segment` | `object` | Yes | — | > **segment full type** > > ```ts theme={null} > { > id: number, > name?: string, > description?: string, > type?: string, > created?: number | string, > updated?: number | string > } > ``` *** ### list `segments.list` List segments in the workspace **Risk:** `read` ```ts theme={null} await corsair.customerio.api.segments.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `segments` | `object[]` | Yes | — | > **segments full type** > > ```ts theme={null} > { > id: number, > name?: string, > description?: string, > type?: string, > created?: number | string, > updated?: number | string > }[] > ``` *** ### membership `segments.membership` List customers in a segment with pagination **Risk:** `read` ```ts theme={null} await corsair.customerio.api.segments.membership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segment_id` | `number` | Yes | — | | `limit` | `number` | No | — | | `start` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `customers` | `lazy[]` | No | — | | `ids` | `string[]` | No | — | | `next` | `string` | No | — | *** ## Snippets ### list `snippets.list` List reusable content snippets in the workspace **Risk:** `read` ```ts theme={null} await corsair.customerio.api.snippets.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `snippets` | `object[]` | Yes | — | > **snippets full type** > > ```ts theme={null} > { > name: string, > value?: string, > updated_at?: number | string > }[] > ``` *** ## Transactional ### list `transactional.list` List transactional message templates and their IDs **Risk:** `read` ```ts theme={null} await corsair.customerio.api.transactional.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > id?: string | number, > transactional_id?: string | number, > name?: string, > trigger_name?: string, > description?: string, > created_at?: number | string, > updated_at?: number | string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/customerio/database Customer.io local sync: searchable entities, `.search()` filters, and operators. The Customer.io plugin syncs data locally. Use `corsair.customerio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/customerio/overview Customer.io plugin for Corsair Use **Customer.io** through Corsair: one client, typed API calls. **What you get:** * 23 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/customerio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/customerio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/customerio ``` ```bash bun theme={null} bun add corsair @corsair-dev/customerio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { customerio } from '@corsair-dev/customerio'; export const corsair = createCorsair({ plugins: [ customerio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} customerio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'customerio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`broadcasts.getTrigger`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.customerio.api.broadcasts.getTrigger({}); ``` **`broadcasts.trigger`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.customerio.api.broadcasts.trigger({}); ``` See the full list on the [API](/plugins/customerio/api) page. ## What's next > **[API reference](/plugins/customerio/api)** > > Every `customerio.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/customgpt/api API reference for CustomGPT: every `customgpt.api.*` operation with input and output types. Every `customgpt.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Conversations ### create `conversations.create` Tool to create a new conversation session for a CustomGPT agent. Use this when starting a new chat interaction - it returns a session ID that you'll use to send messages. Optionally provide a name to help identify the conversation later. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.conversations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: number, > session_id: string, > name?: string | null, > project_id?: string | number, > created_by?: string | number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > } > ``` *** ## Licenses ### delete `licenses.delete` Deletes a license from a CustomGPT project/agent. Requires numeric project ID and license ID. This action is idempotent - it succeeds even if the license doesn't exist (404). The project must have licenses enabled in its plan for this endpoint to work properly. \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.customgpt.api.licenses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `licenseId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > deleted?: boolean > } > ``` *** ### get `licenses.get` Tool to retrieve a license for a specific project. Use when you need to fetch license details by license ID. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.licenses.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `licenseId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `license` | `object` | Yes | — | > **license full type** > > ```ts theme={null} > { > key: string, > name?: string, > project_id?: number, > created_at?: string, > updated_at?: string, > syncedAt?: Date > } > ``` *** ### list `licenses.list` List all licenses for a CustomGPT project/agent. Returns an array of license objects with details like ID, type, status, and timestamps. Returns an empty array if the project has no licenses or if licenses are not enabled for the project. Use this when you need to check what licenses exist for a specific project/agent. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.licenses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > key: string, > name?: string, > project_id?: number, > created_at?: string, > updated_at?: string, > syncedAt?: Date > }[] > ``` *** ### update `licenses.update` Updates the name of an existing license for a CustomGPT project/agent. Prerequisites: - The project must have licenses enabled in its plan - Both project ID and license ID must be valid and exist - Use List Projects to get valid project IDs - Use List Project Licenses to get valid license IDs for a project This action only updates the license name. Other license properties cannot be modified through this endpoint. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.licenses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `licenseId` | `number` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `license` | `object` | Yes | — | > **license full type** > > ```ts theme={null} > { > key: string, > name?: string, > project_id?: number, > created_at?: string, > updated_at?: string, > syncedAt?: Date > } > ``` *** ## Limits ### getUsage `limits.getUsage` Get account usage limits showing current usage vs. maximum allowed for projects, storage credits, and API queries. This returns how many projects, storage credits (characters indexed), and queries you've used compared to your account's maximum limits. Use this to monitor quota consumption. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.limits.getUsage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > max_projects_num?: number, > current_projects_num?: number, > max_total_storage_credits?: number, > current_total_storage_credits?: number, > max_queries?: number, > current_queries?: number > } > ``` *** ## Messages ### get `messages.get` Tool to get message details from a CustomGPT conversation. Returns the complete details for a single message, including the user's prompt, the agent's response, timestamps, citations, and any attached metadata. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `sessionId` | `string` | Yes | — | | `promptId` | `number` | Yes | — | | `includeInsights` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > conversation_id?: number, > user_id?: number | null, > user_query?: string | null, > openai_response?: string | null, > citations?: number[] | null, > tools?: string[] | null, > metadata?: { > user_ip?: string | null, > user_agent?: string | null, > external_id?: string | null, > request_source?: string | null > } | null, > response_feedback?: { > created_at?: string, > updated_at?: string, > user_id?: number | null, > reaction?: neutral | disliked | liked > } | null, > customer_intelligence?: { > prompt_id?: number, > conversation_id?: number, > project_id?: number, > user_query?: string | null, > ai_response?: string | null, > created_at?: string, > content_source?: string | null, > user_emotion?: string | null, > user_intent?: string | null, > language?: string | null, > human_request?: true | false | unclear | null, > user_id?: number | null, > feedback?: string | null, > user_location?: string | null, > chatbot_deployment?: string | null, > risk_fidelity?: string | null, > risk_jailbreak?: string | null, > risk_prompt_leakage?: string | null, > risk_profanity?: string | null, > accuracy?: string | null, > stakeholder_status?: string | null, > browser?: string | null > } | null, > created_at?: string, > updated_at?: string, > syncedAt?: Date > } > ``` *** ### getTrustScore `messages.getTrustScore` Tool to retrieve verification trust score for a message in a CustomGPT conversation. Returns a score calculated by checking how well the agent's claims are supported by source documents. Higher scores indicate better-grounded responses with stronger evidence. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.messages.getTrustScore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `sessionId` | `string` | Yes | — | | `promptId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > overall_status?: string, > stakeholder_analysis?: { > end_user?: { > flag?: string, > rationale?: string, > stakeholder?: string, > recommendations?: string[] > }, > security_it?: { > flag?: string, > rationale?: string, > stakeholder?: string, > recommendations?: string[] > }, > risk_compliance?: { > flag?: string, > rationale?: string, > stakeholder?: string, > recommendations?: string[] > }, > legal_compliance?: { > flag?: string, > rationale?: string, > stakeholder?: string, > recommendations?: string[] > }, > public_relations?: { > flag?: string, > rationale?: string, > stakeholder?: string, > recommendations?: string[] > }, > executive_leadership?: { > flag?: string, > rationale?: string, > stakeholder?: string, > recommendations?: string[] > } > } > } > ``` *** ### list `messages.list` Retrieves all messages from a CustomGPT conversation, including both user queries and AI responses. Use this to view the complete chat history for a specific conversation session. Returns an empty list if the conversation doesn't exist or has no messages. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `sessionId` | `string` | Yes | — | | `page` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `includeInsights` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > conversation?: { > id?: number, > session_id: string, > name?: string | null, > project_id?: string | number, > created_by?: string | number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }, > messages: { > current_page?: number, > data: { > id: number, > conversation_id?: number, > user_id?: number | null, > user_query?: string | null, > openai_response?: string | null, > citations?: number[] | null, > tools?: string[] | null, > metadata?: { > user_ip?: string | null, > user_agent?: string | null, > external_id?: string | null, > request_source?: string | null > } | null, > response_feedback?: { > created_at?: string, > updated_at?: string, > user_id?: number | null, > reaction?: neutral | disliked | liked > } | null, > customer_intelligence?: { > prompt_id?: number, > conversation_id?: number, > project_id?: number, > user_query?: string | null, > ai_response?: string | null, > created_at?: string, > content_source?: string | null, > user_emotion?: string | null, > user_intent?: string | null, > language?: string | null, > human_request?: true | false | unclear | null, > user_id?: number | null, > feedback?: string | null, > user_location?: string | null, > chatbot_deployment?: string | null, > risk_fidelity?: string | null, > risk_jailbreak?: string | null, > risk_prompt_leakage?: string | null, > risk_profanity?: string | null, > accuracy?: string | null, > stakeholder_status?: string | null, > browser?: string | null > } | null, > created_at?: string, > updated_at?: string, > syncedAt?: Date > }[], > first_page_url?: string | null, > from?: number | null, > last_page?: number, > last_page_url?: string | null, > next_page_url?: string | null, > path?: string, > per_page?: number | string, > prev_page_url?: string | null, > to?: number | null, > total?: number > } > } > ``` *** ### submitFeedback `messages.submitFeedback` Tool to submit feedback (thumbs up/down) for a message in a CustomGPT conversation. Use this to record user satisfaction signals that help identify which AI responses are helpful and which need improvement. Feedback can be changed by submitting a new reaction value. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.messages.submitFeedback({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `sessionId` | `string` | Yes | — | | `promptId` | `number` | Yes | — | | `reaction` | `neutral \| disliked \| liked` | Yes | — | | `includeInsights` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > conversation_id?: number, > user_id?: number | null, > user_query?: string | null, > openai_response?: string | null, > citations?: number[] | null, > tools?: string[] | null, > metadata?: { > user_ip?: string | null, > user_agent?: string | null, > external_id?: string | null, > request_source?: string | null > } | null, > response_feedback?: { > created_at?: string, > updated_at?: string, > user_id?: number | null, > reaction?: neutral | disliked | liked > } | null, > customer_intelligence?: { > prompt_id?: number, > conversation_id?: number, > project_id?: number, > user_query?: string | null, > ai_response?: string | null, > created_at?: string, > content_source?: string | null, > user_emotion?: string | null, > user_intent?: string | null, > language?: string | null, > human_request?: true | false | unclear | null, > user_id?: number | null, > feedback?: string | null, > user_location?: string | null, > chatbot_deployment?: string | null, > risk_fidelity?: string | null, > risk_jailbreak?: string | null, > risk_prompt_leakage?: string | null, > risk_profanity?: string | null, > accuracy?: string | null, > stakeholder_status?: string | null, > browser?: string | null > } | null, > created_at?: string, > updated_at?: string, > syncedAt?: Date > } > ``` *** ### verify `messages.verify` Tool to verify message accuracy by triggering a fact-checking verification process. Use when you need to verify claims in a conversation message against source documents. The system compares each claim and reports which claims are supported, partially supported, or unsupported. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.messages.verify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `sessionId` | `string` | Yes | — | | `promptId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > message?: string > } > ``` *** ## Pages ### delete `pages.delete` Tool to delete a document from a CustomGPT agent's knowledge base. Permanently removes a document and the agent will no longer reference this content when answering questions. Use this to remove outdated or incorrect information. Warning: This action cannot be undone. \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.customgpt.api.pages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `pageId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > deleted?: boolean > } > ``` *** ### getMetadata `pages.getMetadata` Tool to get document metadata including title, source URL, word count, and custom metadata fields. Use this to display document information or manage your knowledge base. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.pages.getMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `pageId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: number, > url?: string | null, > title?: string | null, > description?: string | null, > image?: string | null > } > ``` *** ### list `pages.list` Lists all documents in a CustomGPT agent's knowledge base. Returns indexed content including webpages, PDFs, and uploaded files that the agent can reference. Supports filtering by crawl/index status and pagination. Use this to audit knowledge sources or verify successful document ingestion. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.pages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `search` | `string` | No | — | | `crawl_status` | `all \| ok \| failed \| n/a \| queued \| limited` | No | — | | `index_status` | `all \| ok \| failed \| n/a \| queued \| limited` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > project?: { > id: number, > project_name?: string, > sitemap_path?: string | null, > is_chat_active?: boolean, > is_master?: boolean, > user_id?: number, > team_id?: number, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > type?: SITEMAP | URL, > is_shared?: boolean, > shareable_slug?: string | null, > shareable_link?: string | null, > embed_code?: string | null, > live_chat_code?: string | null, > are_licenses_allowed?: boolean, > subdomain_slug?: string | null, > syncedAt?: Date > }, > pages: { > current_page?: number, > data: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[], > first_page_url?: string | null, > from?: number | null, > last_page?: number, > last_page_url?: string | null, > next_page_url?: string | null, > path?: string, > per_page?: number | string, > prev_page_url?: string | null, > to?: number | null, > total?: number > } > } > ``` *** ### reindex `pages.reindex` Tool to reindex a document in CustomGPT knowledge base. Re-crawls and re-indexes a URL-based document to update its content. Use this when the source content has changed and you want the agent to use the updated version. Only works for URL-based documents. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.pages.reindex({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `pageId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > updated?: boolean > } > ``` *** ### updateMetadata `pages.updateMetadata` Update document metadata for a specific page in a CustomGPT project. Updates custom metadata fields such as title, description, URL, and image that help organize and manage your knowledge base. Use when you need to add tags, categories, or other organizational information to documents. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.pages.updateMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `pageId` | `number` | Yes | — | | `title` | `string` | No | — | | `url` | `string` | No | — | | `description` | `string` | No | — | | `image` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: number, > url?: string | null, > title?: string | null, > description?: string | null, > image?: string | null > } > ``` *** ## Personas ### activate `personas.activate` Restore a previous persona version for a CustomGPT agent. Activates a previous persona version, making it the current active persona. This creates a new version entry in the history (it doesn't overwrite), preserving the full audit trail. Use this to roll back to a known-good configuration. Requires Custom plan. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.personas.activate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `version` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > updated?: boolean > } > ``` *** ### list `personas.list` Tool to list persona versions for a CustomGPT agent. Use when you need to view the version history of an agent's persona. Every time the persona is updated, a snapshot is automatically saved, allowing you to view changes over time or restore a previous version. Results are paginated. Requires Custom plan. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.personas.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > current_page?: number, > data: { > version?: number, > is_active?: boolean, > created_at?: string, > instructions?: string | null > }[], > first_page_url?: string | null, > from?: number | null, > last_page?: number, > last_page_url?: string | null, > next_page_url?: string | null, > path?: string, > per_page?: number | string, > prev_page_url?: string | null, > to?: number | null, > total?: number > } > ``` *** ## Projects ### clone `projects.clone` Tool to clone a CustomGPT agent (project). Creates a complete copy of an existing agent, including its knowledge base, persona, and settings. Use this to create variations of an agent for testing, or to use an existing agent as a template for a new one. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.projects.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > project_name?: string, > sitemap_path?: string | null, > is_chat_active?: boolean, > is_master?: boolean, > user_id?: number, > team_id?: number, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > type?: SITEMAP | URL, > is_shared?: boolean, > shareable_slug?: string | null, > shareable_link?: string | null, > embed_code?: string | null, > live_chat_code?: string | null, > are_licenses_allowed?: boolean, > subdomain_slug?: string | null, > syncedAt?: Date > } > ``` *** ### create `projects.create` Tool to create a new CustomGPT agent from a sitemap URL or file upload. The agent immediately begins processing the content to build its knowledge base. Use when you need to create a new AI agent with custom knowledge from web content or documents. Either sitemap\_path or file must be provided. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_name` | `string` | No | — | | `is_master` | `boolean` | No | — | | `use_planner_mode` | `boolean` | No | — | | `sitemap_path` | `string` | No | — | | `file_data_retension` | `boolean` | No | — | | `is_ocr_enabled` | `0 \| 1 \| 2` | No | — | | `is_anonymized` | `boolean` | No | — | | `is_vision_enabled` | `boolean` | No | — | | `is_vision_compress_image` | `boolean` | No | — | | `is_low_performance_mode_enabled` | `boolean` | No | — | | `allow_extra_timeout` | `boolean` | No | — | | `use_full_url_crawl` | `boolean` | No | — | | `image_extraction_type` | `none \| sync_from_sitemap` | No | — | | `file` | `object` | No | — | | `files` | `object[]` | No | — | > **file full type** > > ```ts theme={null} > { > filename: string, > content_base64: string, > content_type?: string > } > ``` > **files full type** > > ```ts theme={null} > { > filename: string, > content_base64: string, > content_type?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > project_name?: string, > sitemap_path?: string | null, > is_chat_active?: boolean, > is_master?: boolean, > user_id?: number, > team_id?: number, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > type?: SITEMAP | URL, > is_shared?: boolean, > shareable_slug?: string | null, > shareable_link?: string | null, > embed_code?: string | null, > live_chat_code?: string | null, > are_licenses_allowed?: boolean, > subdomain_slug?: string | null, > syncedAt?: Date > } > ``` *** ### delete `projects.delete` Tool to delete a CustomGPT project by ID. Use when you need to permanently remove an existing agent after confirming the ID. \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.customgpt.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > deleted?: boolean > } > ``` *** ### get `projects.get` Tool to get agent details. Returns the full configuration and current status for a specific agent. Use this to check processing status, view settings, or retrieve metadata about the agent. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `width` | `string` | No | — | | `height` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > project_name?: string, > sitemap_path?: string | null, > is_chat_active?: boolean, > is_master?: boolean, > user_id?: number, > team_id?: number, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > type?: SITEMAP | URL, > is_shared?: boolean, > shareable_slug?: string | null, > shareable_link?: string | null, > embed_code?: string | null, > live_chat_code?: string | null, > are_licenses_allowed?: boolean, > subdomain_slug?: string | null, > syncedAt?: Date > } > ``` *** ### list `projects.list` Lists all CustomGPT projects (agents) for the authenticated user. Returns projects with full details including ID, name, type, chat status, and timestamps. Supports pagination via the 'page' parameter. Use this to discover available projects or iterate through all projects. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `duration` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `orderBy` | `id \| created_at` | No | — | | `name` | `string` | No | — | | `width` | `string` | No | — | | `height` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > current_page?: number, > data: { > id: number, > project_name?: string, > sitemap_path?: string | null, > is_chat_active?: boolean, > is_master?: boolean, > user_id?: number, > team_id?: number, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > type?: SITEMAP | URL, > is_shared?: boolean, > shareable_slug?: string | null, > shareable_link?: string | null, > embed_code?: string | null, > live_chat_code?: string | null, > are_licenses_allowed?: boolean, > subdomain_slug?: string | null, > syncedAt?: Date > }[], > first_page_url?: string | null, > from?: number | null, > last_page?: number, > last_page_url?: string | null, > next_page_url?: string | null, > path?: string, > per_page?: number | string, > prev_page_url?: string | null, > to?: number | null, > total?: number > } > ``` *** ### plugins `projects.plugins` Tool to retrieve plugin details for a specific CustomGPT agent (project). Use when you need to inspect plugin configuration, status, and metadata for an agent. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.projects.plugins({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > tools?: { > key?: string, > name?: string, > is_enabled?: boolean, > settings?: { > } | null > }[] > } > ``` *** ### stats `projects.stats` Tool to get agent statistics. Returns usage metrics and performance statistics for an agent, including total conversations, query counts, document statistics, and processing information. Use when you need to monitor agent performance or generate usage reports. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.projects.stats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > pages_found?: number, > pages_crawled?: number, > pages_indexed?: number, > crawl_credits_used?: number, > query_credits_used?: number, > total_queries?: number, > total_words_indexed?: number, > total_storage_credits_used?: number > } > ``` *** ### update `projects.update` Updates an existing CustomGPT agent's name or configuration settings. Use this to rename an agent or modify its basic properties without affecting its knowledge base. Returns the complete updated project details including all metadata. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `project_name` | `string` | No | — | | `is_shared` | `boolean` | No | — | | `are_licenses_allowed` | `boolean` | No | — | | `sitemap_path` | `string` | No | — | | `file_data_retension` | `boolean` | No | — | | `is_ocr_enabled` | `0 \| 1 \| 2` | No | — | | `is_anonymized` | `boolean` | No | — | | `is_vision_enabled` | `boolean` | No | — | | `is_vision_compress_image` | `boolean` | No | — | | `is_low_performance_mode_enabled` | `boolean` | No | — | | `allow_extra_timeout` | `boolean` | No | — | | `use_full_url_crawl` | `boolean` | No | — | | `image_extraction_type` | `none \| sync_from_sitemap` | No | — | | `file` | `object` | No | — | | `files` | `object[]` | No | — | > **file full type** > > ```ts theme={null} > { > filename: string, > content_base64: string, > content_type?: string > } > ``` > **files full type** > > ```ts theme={null} > { > filename: string, > content_base64: string, > content_type?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > project_name?: string, > sitemap_path?: string | null, > is_chat_active?: boolean, > is_master?: boolean, > user_id?: number, > team_id?: number, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > type?: SITEMAP | URL, > is_shared?: boolean, > shareable_slug?: string | null, > shareable_link?: string | null, > embed_code?: string | null, > live_chat_code?: string | null, > are_licenses_allowed?: boolean, > subdomain_slug?: string | null, > syncedAt?: Date > } > ``` *** ## Reports ### exportLeads `reports.exportLeads` Export leads from a CustomGPT project. Returns lead information captured from conversations including email addresses, names, phone numbers, and custom fields. Supports pagination and date range filtering. Use this to sync leads with CRM or marketing tools. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.reports.exportLeads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `session_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > current_page?: number, > data: { > project_id?: number, > session_id?: string, > query_id?: number, > name?: string | null, > email?: string | null, > phone_number?: string | null, > company?: string | null, > captured_at?: string | null, > other_data?: { > } | null, > user_defined?: { > } | null, > tags?: string[] | null, > syncedAt?: Date > }[], > first_page_url?: string | null, > from?: number | null, > last_page?: number, > last_page_url?: string | null, > next_page_url?: string | null, > path?: string, > per_page?: number | string, > prev_page_url?: string | null, > to?: number | null, > total?: number > } > ``` *** ### getAnalysis `reports.getAnalysis` Tool to retrieve analytics chart data for a CustomGPT project. Returns time-series data formatted for charts, with daily or weekly breakdowns of key metrics including conversation counts, query counts, and queries-per-conversation ratios. Use this to generate usage reports, track project engagement over time, or visualize chatbot performance trends. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.reports.getAnalysis({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `filters` | `queries \| conversations \| queries_per_conversation[]` | Yes | — | | `interval` | `daily \| weekly` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > queries?: { > queries_number?: number, > created_at_interval?: string > }[], > conversations?: { > queries_number?: number, > created_at_interval?: string > }[], > queries_per_conversation?: { > queries_number?: number, > created_at_interval?: string > }[] > } > ``` *** ### getConversations `reports.getConversations` Tool to get conversation analytics for a CustomGPT project. Returns conversation metrics including total conversations, average queries per conversation, and other engagement statistics. Use this to understand how users engage with your agent and analyze conversation patterns over time. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.reports.getConversations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `filters` | `total \| average_queries_per_conversation[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > total?: number, > average_queries_per_conversation?: number > } > ``` *** ### getIntelligence `reports.getIntelligence` Tool to get customer intelligence for a CustomGPT project. Returns AI-analyzed insights about users including common intents, emotional sentiment, frequently discussed topics, and emerging trends. Use this to understand what users are asking about and identify patterns in user behavior. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.reports.getIntelligence({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `content_source` | `in-context \| out-of-context \| not-used[]` | No | — | | `accuracy` | `string` | No | — | | `stakeholder_status` | `APPROVED \| FLAGGED \| BLOCKED[]` | No | — | | `user_emotion` | `positive \| neutral \| frustration \| dissatisfaction \| confusion \| unclear[]` | No | — | | `user_intent` | `informational \| troubleshooting \| instructional \| greetings \| transactional \| navigational \| follow-up \| unclear[]` | No | — | | `human_request` | `true \| false \| unclear[]` | No | — | | `language` | `string[]` | No | — | | `external_id` | `string[]` | No | — | | `country` | `string[]` | No | — | | `tools` | `string[]` | No | — | | `leads` | `(0 \| 1)[]` | No | — | | `request_source` | `string[]` | No | — | | `risk_fidelity` | `string[]` | No | — | | `risk_jailbreak` | `string[]` | No | — | | `risk_prompt_leakage` | `string[]` | No | — | | `risk_profanity` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | | `total_queries` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > current_page?: number, > data: { > prompt_id?: number, > conversation_id?: number, > project_id?: number, > user_query?: string | null, > ai_response?: string | null, > created_at?: string, > content_source?: string | null, > user_emotion?: string | null, > user_intent?: string | null, > language?: string | null, > human_request?: true | false | unclear | null, > user_id?: number | null, > feedback?: string | null, > user_location?: string | null, > chatbot_deployment?: string | null, > risk_fidelity?: string | null, > risk_jailbreak?: string | null, > risk_prompt_leakage?: string | null, > risk_profanity?: string | null, > accuracy?: string | null, > stakeholder_status?: string | null, > browser?: string | null > }[], > first_page_url?: string | null, > from?: number | null, > last_page?: number, > last_page_url?: string | null, > next_page_url?: string | null, > path?: string, > per_page?: number | string, > prev_page_url?: string | null, > to?: number | null, > total?: number > } > ``` *** ### getTraffic `reports.getTraffic` Tool to retrieve traffic analytics for a CustomGPT agent/project. Returns user traffic metrics including unique visitors, session counts, geographic distribution, and device types. Use this to understand who's using your agent and how they're accessing it. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.reports.getTraffic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `filters` | `sources[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > sources?: { > request_source?: string, > request_source_number?: number > }[] > } > ``` *** ## Settings ### get `settings.get` Retrieve configuration settings for a specific CustomGPT agent/project. Returns settings including: chatbot avatar, background, default prompt, example questions, response source, language, and branding preferences. Use this to inspect agent configuration, audit settings, or retrieve values before making updates. Note: Some newly created projects may not have settings initialized yet and will return a 404. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.settings.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > chatbot_avatar?: string, > chatbot_background_type?: image | color, > radius_styling?: sharp | soft | round | legacy, > font_family?: inter | public-sans, > chatbot_background?: string, > chatbot_background_color?: string, > chatbot_color_scheme?: fresh | legacy, > default_prompt?: string, > example_questions?: string[], > response_source?: default | own_content | openai_content, > chatbot_msg_lang?: string, > chatbot_color?: string, > chatbot_toolbar_color?: string, > persona_instructions?: string | null, > citations_answer_source_label_msg?: string | null, > citations_sources_label_msg?: string | null, > hang_in_there_msg?: string | null, > chatbot_siesta_msg?: string | null, > chatbot_failed_moderation_msg?: string | null, > account_out_of_queries_msg?: string | null, > is_loading_indicator_enabled?: boolean | null, > enable_citations?: 0 | 1 | 2 | 3 | null, > enable_feedbacks?: boolean | null, > enable_copy_button?: boolean | null, > citations_view_type?: user | show | hide | null, > image_citation_display?: default | first_only | null, > limit_image_citation_height?: boolean, > use_opengraph_image_citation?: boolean, > no_answer_message?: string | null, > ending_message?: string | null, > try_asking_questions_msg?: string | null, > view_more_msg?: string | null, > view_less_msg?: string | null, > remove_branding?: boolean | null, > private_deployment?: 0 | 1 | 2 | null, > enable_recaptcha_for_public_chatbots?: boolean | null, > chatbot_model?: gpt-4-1 | gpt-4-o | gpt-5.1-none | gpt-5.1-low | gpt-5.2-none | gpt-5.2-low | gpt-5.4-low | gpt-4-1-mini | gpt-4o-mini | claude-4.8-opus | claude-4.6-opus | claude-4.5-opus | claude-4.6-sonnet | claude-4.6-sonnet-thinking | claude-4.5-sonnet | claude-4.5-haiku | gpt-o4-mini-low | gpt-o4-mini-medium | gpt-o4-mini-high | gemini-3.1-pro | gemini-3-pro | gemini-3.5-flash | null, > is_selling_enabled?: boolean | null, > license_slug?: boolean | null, > selling_url?: string | null, > can_share_conversation?: boolean | null, > can_export_conversation?: boolean | null, > hide_sources_from_responses?: boolean | null, > input_field_addendum?: string | null, > ai_disclaimer?: string | null, > user_avatar_enabled?: boolean, > user_avatar?: string, > title_avatar_enabled?: boolean, > spotlight_avatar_enabled?: boolean, > spotlight_avatar?: string, > spotlight_avatar_shape?: circle | rectangle, > spotlight_avatar_type?: default | image, > user_avatar_orientation?: string, > agent_title_avatar_alignment?: left | center | right, > chatbot_title?: string | null, > chatbot_title_color?: string | null, > enable_inline_citations_api?: boolean | null, > conversation_time_window?: 0 | 1 | 2 | null, > conversation_retention_period?: custom | year | never, > conversation_retention_days?: number, > use_context_aware_starter_question?: boolean | null, > enable_agent_knowledge_base_awareness?: boolean, > markdown_enabled?: boolean, > is_hybrid_search?: boolean, > user_awareness?: boolean, > agent_capability?: fastest-responses | optimal-choice | advanced-reasoning | complex-tasks, > context_depth?: compact | balanced | extended | rich | max | custom, > use_planner_mode?: boolean, > master_project_smart_routing_mode?: off | start-only | every-message, > master_project_user_agent_switching_enabled?: boolean, > max_actions_per_query?: number, > is_in_chat_agent_avatar_enabled?: boolean, > is_in_chat_user_avatar_enabled?: boolean, > conversation_history?: hidden | team_members | everyone, > is_pdf_viewer?: boolean, > is_pdf_viewer_autoopen?: boolean, > is_anonymize_pdfs?: boolean, > is_pdf_page_visibility_limited?: boolean, > pdf_limited_page_label?: string, > is_pdf_limited_label_linked?: boolean, > allowed_domains_for_embedding?: string[] | null > } > ``` *** ### update `settings.update` Update CustomGPT agent configuration settings. Updates persona instructions, response format, citation style, branding, and deployment settings. Only include fields you want to change - omitted fields retain their current values. Use this to configure agent behavior, customize appearance, or adjust user experience settings. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.settings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chat_bot_avatar` | `string` | No | — | | `chat_bot_bg` | `string` | No | — | | `chat_bot_bg_type` | `image \| color` | No | — | | `chat_bot_bg_color` | `string` | No | — | | `chat_bot_color_scheme` | `fresh \| legacy` | No | — | | `radius_styling` | `sharp \| soft \| round \| legacy` | No | — | | `font_family` | `inter \| public-sans` | No | — | | `default_prompt` | `string` | No | — | | `example_questions[]` | `string[]` | No | — | | `response_source` | `default \| own_content \| openai_content` | No | — | | `chatbot_msg_lang` | `sq \| ar \| hy \| az \| ba \| eu \| be \| bn \| bh \| bs \| pt-BR \| bg \| yue \| ca \| hne \| hr \| cs \| da \| doi \| nl \| en \| et \| fo \| fi \| fr \| gl \| ka \| de \| el \| gu \| hry \| he \| hi \| hu \| id \| ga \| it \| ja \| jv \| kn \| ks \| kk \| kok \| ko \| ky \| lv \| lt \| mk \| mai \| ms \| mt \| cmn \| mr \| mwr \| nan \| mo \| mn \| me \| ne \| no \| or \| ps \| fa \| pl \| pt \| pa \| raj \| ro \| ru \| sa \| sat \| sr \| sd \| si \| sk \| sl \| es \| sw \| sv \| tg \| ta \| tt \| te \| th \| tr \| tk \| uk \| ur \| uz \| vi \| cy \| wuu` | No | — | | `chatbot_color` | `string` | No | — | | `chatbot_toolbar_color` | `string` | No | — | | `persona_instructions` | `string` | No | — | | `citations_answer_source_label_msg` | `string` | No | — | | `citations_sources_label_msg` | `string` | No | — | | `hang_in_there_msg` | `string` | No | — | | `chatbot_siesta_msg` | `string` | No | — | | `chatbot_failed_moderation_msg` | `string` | No | — | | `account_out_of_queries_msg` | `string` | No | — | | `is_loading_indicator_enabled` | `boolean` | No | — | | `enable_citations` | `0 \| 1 \| 2 \| 3` | No | — | | `enable_feedbacks` | `boolean` | No | — | | `enable_copy_button` | `boolean` | No | — | | `citations_view_type` | `user \| show \| hide` | No | — | | `image_citation_display` | `default \| first_only` | No | — | | `limit_image_citation_height` | `boolean` | No | — | | `use_opengraph_image_citation` | `boolean` | No | — | | `max_inline_images_per_response` | `0 \| 1 \| 2 \| 3` | No | — | | `no_answer_message` | `string` | No | — | | `ending_message` | `string` | No | — | | `try_asking_questions_msg` | `string` | No | — | | `view_more_msg` | `string` | No | — | | `view_less_msg` | `string` | No | — | | `remove_branding` | `boolean` | No | — | | `enable_recaptcha_for_public_chatbots` | `boolean` | No | — | | `chatbot_model` | `gpt-4-1 \| gpt-4-o \| gpt-5.1-none \| gpt-5.1-low \| gpt-5.2-none \| gpt-5.2-low \| gpt-5.4-low \| gpt-4-1-mini \| gpt-4o-mini \| claude-4.8-opus \| claude-4.6-opus \| claude-4.5-opus \| claude-4.6-sonnet \| claude-4.6-sonnet-thinking \| claude-4.5-sonnet \| claude-4.5-haiku \| gpt-o4-mini-low \| gpt-o4-mini-medium \| gpt-o4-mini-high \| gemini-3.1-pro \| gemini-3-pro \| gemini-3.5-flash` | No | — | | `is_selling_enabled` | `boolean` | No | — | | `can_share_conversation` | `boolean` | No | — | | `can_export_conversation` | `boolean` | No | — | | `hide_sources_from_responses` | `boolean` | No | — | | `agent_capability` | `fastest-responses \| optimal-choice \| advanced-reasoning \| complex-tasks` | No | — | | `input_field_addendum` | `string` | No | — | | `ai_disclaimer` | `string` | No | — | | `user_avatar_enabled` | `boolean` | No | — | | `user_avatar` | `string` | No | — | | `title_avatar_enabled` | `boolean` | No | — | | `spotlight_avatar_enabled` | `boolean` | No | — | | `spotlight_avatar` | `string` | No | — | | `spotlight_avatar_shape` | `circle \| rectangle` | No | — | | `spotlight_avatar_type` | `default \| image` | No | — | | `user_avatar_orientation` | `agent-left-user-right \| agent-right-user-right \| agent-right-user-left \| agent-left-user-left` | No | — | | `agent_title_avatar_alignment` | `left \| center \| right` | No | — | | `chatbot_title` | `string` | No | — | | `chatbot_title_color` | `string` | No | — | | `enable_inline_citations_api` | `boolean` | No | — | | `conversation_time_window` | `0 \| 1 \| 2` | No | — | | `conversation_retention_period` | `custom \| year \| never` | No | — | | `conversation_retention_days` | `number` | No | — | | `use_context_aware_starter_question` | `boolean` | No | — | | `enable_agent_knowledge_base_awareness` | `boolean` | No | — | | `markdown_enabled` | `boolean` | No | — | | `is_hybrid_search` | `boolean` | No | — | | `user_awareness` | `boolean` | No | — | | `context_depth` | `compact \| balanced \| extended \| rich \| max \| custom` | No | — | | `use_planner_mode` | `boolean` | No | — | | `master_project_smart_routing_mode` | `off \| start-only \| every-message` | No | — | | `master_project_user_agent_switching_enabled` | `boolean` | No | — | | `max_actions_per_query` | `number` | No | — | | `is_in_chat_agent_avatar_enabled` | `boolean` | No | — | | `is_in_chat_user_avatar_enabled` | `boolean` | No | — | | `conversation_history` | `hidden \| team_members \| everyone` | No | — | | `is_pdf_viewer` | `boolean` | No | — | | `is_pdf_viewer_autoopen` | `boolean` | No | — | | `is_anonymize_pdfs` | `boolean` | No | — | | `is_pdf_page_visibility_limited` | `boolean` | No | — | | `pdf_limited_page_label` | `string` | No | — | | `is_pdf_limited_label_linked` | `boolean` | No | — | | `allowed_domains_for_embedding` | `string[]` | No | — | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > updated?: boolean > } > ``` *** ## Sources ### add `sources.add` Add a data source to a CustomGPT agent's knowledge base. Connects content via sitemap URL, file upload, or integration. The system begins indexing immediately after creation. Use when adding documentation, FAQs, or knowledge content to an agent. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.sources.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `sync_all_images` | `boolean` | No | — | | `sitemap_path` | `string` | No | — | | `file_data_retension` | `boolean` | No | — | | `is_ocr_enabled` | `0 \| 1 \| 2` | No | — | | `is_anonymized` | `boolean` | No | — | | `is_vision_enabled` | `boolean` | No | — | | `is_vision_compress_image` | `boolean` | No | — | | `is_low_performance_mode_enabled` | `boolean` | No | — | | `allow_extra_timeout` | `boolean` | No | — | | `use_full_url_crawl` | `boolean` | No | — | | `image_extraction_type` | `none \| sync_from_sitemap` | No | — | | `file` | `object` | No | — | | `files` | `object[]` | No | — | > **file full type** > > ```ts theme={null} > { > filename: string, > content_base64: string, > content_type?: string > } > ``` > **files full type** > > ```ts theme={null} > { > filename: string, > content_base64: string, > content_type?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > } > ``` *** ### delete `sources.delete` Tool to delete a data source from a CustomGPT agent. Removes the source and all its documents from the agent's knowledge base. Use this to disconnect content that's no longer relevant or to clean up after testing. \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.customgpt.api.sources.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `sourceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > deleted?: boolean > } > ``` *** ### list `sources.list` Tool to list all data sources connected to an agent. Returns sources from various origins like sitemaps, Google Drive folders, SharePoint sites, or uploaded files. Use this to manage what content feeds into an agent's knowledge base. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.sources.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > uploads?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > } | null, > sitemaps?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > zapiers?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > confluences?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > youtubes?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > vimeos?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > sharepoints?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > sharepoint_sites?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > one_drives?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > google_drives?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > notions?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > zendesks?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[], > hubspots?: { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > }[] > } > ``` *** ### update `sources.update` Update source settings for a CustomGPT agent data source. Configure how the source is indexed and kept up to date by adjusting auto-sync frequency, crawl depth, file filters, and refresh behavior. Use this to fine-tune sitemap crawling (JavaScript execution, image extraction), control which pages are added or removed during syncs, and set up custom refresh schedules. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.sources.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `sourceId` | `number` | Yes | — | | `executive_js` | `boolean` | No | — | | `data_refresh_frequency` | `never \| daily \| weekly \| monthly \| advanced` | No | — | | `create_new_pages` | `boolean` | No | — | | `remove_unexist_pages` | `boolean` | No | — | | `refresh_existing_pages` | `never \| always \| if_updated` | No | — | | `refresh_schedule` | `object` | No | — | | `allow_extra_timeout` | `boolean` | No | — | | `image_extraction_type` | `none \| sync_from_sitemap` | No | — | | `update_existing_images` | `boolean` | No | — | | `sync_all_images` | `boolean` | No | — | > **refresh\_schedule full type** > > ```ts theme={null} > { > days?: number[], > hours?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > project_id?: number, > created_at?: string, > updated_at?: string, > type?: sitemap | upload, > settings?: { > executive_js?: boolean, > data_refresh_frequency?: never | daily | weekly | monthly | advanced, > create_new_pages?: boolean, > remove_unexist_pages?: boolean, > refresh_existing_pages?: never | always | if_updated, > sitemap_path?: string | null, > image_extraction_type?: none | sync_from_sitemap, > update_existing_images?: boolean, > sync_all_images?: boolean > }, > pages?: { > id: number, > page_url?: string, > page_url_hash?: string, > project_id?: number, > s3_path?: string | null, > crawl_status?: ok | queued | failed | n/a | limited, > index_status?: ok | queued | failed | n/a | limited, > is_file?: boolean, > is_refreshable?: boolean, > is_file_kept?: boolean, > filename?: string | null, > filesize?: number | null, > created_at?: string, > updated_at?: string, > deleted_at?: string | null, > syncedAt?: Date > }[] | null, > syncedAt?: Date > } > ``` *** ## User ### getProfile `user.getProfile` Tool to retrieve the current user's profile information. Use when you need to display or verify authenticated user details after login. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.user.getProfile({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string, > name?: string | null, > current_team_id?: number | null, > profile_photo_url?: string | null, > created_at?: string, > updated_at?: string > } > ``` *** ### searchTeamMembers `user.searchTeamMembers` Tool to search for team members by email address or user ID. Use this to find users when assigning permissions or managing team access. Requires Owner or Admin role to execute. **Risk:** `read` ```ts theme={null} await corsair.customgpt.api.user.searchTeamMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `user_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string, > name?: string | null, > current_team_id?: number | null, > profile_photo_url?: string | null, > created_at?: string, > updated_at?: string > } > ``` *** ### updateProfile `user.updateProfile` Updates the authenticated user's profile information in CustomGPT. Use this action to modify profile details such as the user's display name, email address, or profile photo URL. All fields are optional - only the fields you provide will be updated. The action returns the complete updated user profile. **Risk:** `write` ```ts theme={null} await corsair.customgpt.api.user.updateProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `profile_photo` | `object` | No | — | > **profile\_photo full type** > > ```ts theme={null} > { > filename: string, > content_base64: string, > content_type?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string, > name?: string | null, > current_team_id?: number | null, > profile_photo_url?: string | null, > created_at?: string, > updated_at?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/customgpt/database CustomGPT local sync: searchable entities, `.search()` filters, and operators. The CustomGPT plugin syncs data locally. Use `corsair.customgpt.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Conversations Path: `customgpt.db.conversations.search` ```ts theme={null} const rows = await corsair.customgpt.db.conversations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `session_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | | `syncedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Leads Path: `customgpt.db.leads.search` ```ts theme={null} const rows = await corsair.customgpt.db.leads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `session_id` | `string` | equals, contains, startsWith, endsWith, in | | `query_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `string` | equals, contains, startsWith, endsWith, in | | `syncedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Licenses Path: `customgpt.db.licenses.search` ```ts theme={null} const rows = await corsair.customgpt.db.licenses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `syncedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `customgpt.db.messages.search` ```ts theme={null} const rows = await corsair.customgpt.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `conversation_id` | `number` | equals, gt, gte, lt, lte, in | | `user_id` | `number` | equals, gt, gte, lt, lte, in | | `user_query` | `string` | equals, contains, startsWith, endsWith, in | | `openai_response` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `syncedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pages Path: `customgpt.db.pages.search` ```ts theme={null} const rows = await corsair.customgpt.db.pages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `page_url` | `string` | equals, contains, startsWith, endsWith, in | | `page_url_hash` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `s3_path` | `string` | equals, contains, startsWith, endsWith, in | | `is_file` | `boolean` | equals | | `is_refreshable` | `boolean` | equals | | `is_file_kept` | `boolean` | equals | | `filename` | `string` | equals, contains, startsWith, endsWith, in | | `filesize` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | | `syncedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `customgpt.db.projects.search` ```ts theme={null} const rows = await corsair.customgpt.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `project_name` | `string` | equals, contains, startsWith, endsWith, in | | `sitemap_path` | `string` | equals, contains, startsWith, endsWith, in | | `is_chat_active` | `boolean` | equals | | `is_master` | `boolean` | equals | | `user_id` | `number` | equals, gt, gte, lt, lte, in | | `team_id` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | | `is_shared` | `boolean` | equals | | `shareable_slug` | `string` | equals, contains, startsWith, endsWith, in | | `shareable_link` | `string` | equals, contains, startsWith, endsWith, in | | `embed_code` | `string` | equals, contains, startsWith, endsWith, in | | `live_chat_code` | `string` | equals, contains, startsWith, endsWith, in | | `are_licenses_allowed` | `boolean` | equals | | `subdomain_slug` | `string` | equals, contains, startsWith, endsWith, in | | `syncedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sources Path: `customgpt.db.sources.search` ```ts theme={null} const rows = await corsair.customgpt.db.sources.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `syncedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/customgpt/overview Platform for building custom ChatGPT-style agents trained on your business content. Use **CustomGPT** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 40 typed API operations * 7 synced entities (`conversations`, `leads`, `licenses`, `messages`, `pages`, `projects`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/customgpt ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/customgpt ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/customgpt ``` ```bash bun theme={null} bun add corsair @corsair-dev/customgpt ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { customgpt } from '@corsair-dev/customgpt'; export const corsair = createCorsair({ plugins: [ customgpt(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} customgpt() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'customgpt', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`licenses.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.customgpt.api.licenses.get({}); ``` **`conversations.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.customgpt.api.conversations.create({}); ``` See the full list on the [API](/plugins/customgpt/api) page. ## Query synced data Synced entities support `tenant.customgpt.db..search()` and `.list()`: `conversations`, `leads`, `licenses`, `messages`, `pages`, `projects`, `sources`. See [Database](/plugins/customgpt/database) for filters and operators. ## What's next > **[API reference](/plugins/customgpt/api)** > > Every `customgpt.api.*` operation with input and output types. > **[Database](/plugins/customgpt/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/cuttly/api API reference for Cutt.ly: every `cuttly.api.*` operation with input and output types. Every `cuttly.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Links ### analytics `links.analytics` Retrieve click analytics for a Cutt.ly short link. **Risk:** `read` ```ts theme={null} await corsair.cuttly.api.links.analytics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shortUrl` | `string` | Yes | Short link to retrieve analytics for | | `dateFrom` | `string` | No | Start date filter YYYY-MM-DD (Team plan) | | `dateTo` | `string` | No | End date filter YYYY-MM-DD (Team plan) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `stats` | `object` | Yes | — | > **stats full type** > > ```ts theme={null} > { > status: number, > date?: string, > clicks?: number, > title?: string, > fullLink?: string, > shortLink?: string, > qrCode?: string, > facebook?: number, > twitter?: number, > linkedin?: number, > rest?: number, > bots?: number | string > } > ``` *** ### shorten `links.shorten` Create a Cutt.ly short URL with an optional custom alias and QR code. **Risk:** `write` ```ts theme={null} await corsair.cuttly.api.links.shorten({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Destination URL to shorten | | `alias` | `string` | No | Preferred custom alias when not already taken | | `useCustomDomain` | `boolean` | No | Use the active branded domain from the account (paid plan) | | `publicStats` | `boolean` | No | Make click stats public for this link (Single plan and above) | | `noTitle` | `boolean` | No | Skip destination title lookup for a faster response (Team Enterprise) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `object` | Yes | — | > **url full type** > > ```ts theme={null} > { > status: number, > date?: string, > shortLink?: string, > fullLink?: string, > title?: string, > qrCode?: string > } > ``` *** ### update `links.update` Update the destination URL and/or custom alias for an existing Cutt.ly short link. **Risk:** `write` ```ts theme={null} await corsair.cuttly.api.links.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shortUrl` | `string` | Yes | Existing Cutt.ly short link to edit | | `url` | `string` | No | New destination URL for the short link | | `alias` | `string` | No | New custom alias when not already taken | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `object` | Yes | — | > **url full type** > > ```ts theme={null} > { > status: number, > date?: string, > shortLink?: string, > fullLink?: string, > title?: string, > qrCode?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/cuttly/database Cutt.ly local sync: searchable entities, `.search()` filters, and operators. The Cutt.ly plugin syncs data locally. Use `corsair.cuttly.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Links Path: `cuttly.db.links.search` ```ts theme={null} const rows = await corsair.cuttly.db.links.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `number` | equals, gt, gte, lt, lte, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `shortLink` | `string` | equals, contains, startsWith, endsWith, in | | `fullLink` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `qrCode` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/cuttly/overview Create branded short links, access QR code URLs, and retrieve click analytics. Use **Cutt.ly** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 3 typed API operations * 1 synced entity (`links`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/cuttly ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/cuttly ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/cuttly ``` ```bash bun theme={null} bun add corsair @corsair-dev/cuttly ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { cuttly } from '@corsair-dev/cuttly'; export const corsair = createCorsair({ plugins: [ cuttly(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} cuttly() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'cuttly', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`links.analytics`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cuttly.api.links.analytics({}); ``` **`links.shorten`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.cuttly.api.links.shorten({}); ``` See the full list on the [API](/plugins/cuttly/api) page. ## Query synced data Synced entities support `tenant.cuttly.db..search()` and `.list()`: `links`. See [Database](/plugins/cuttly/database) for filters and operators. ## What's next > **[API reference](/plugins/cuttly/api)** > > Every `cuttly.api.*` operation with input and output types. > **[Database](/plugins/cuttly/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/dadataru/api API reference for Dadataru: every `dadataru.api.*` operation with input and output types. Every `dadataru.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Clean ### address `clean.address` Clean and standardize Russian addresses **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.clean.address({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `queries` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### birthdate `clean.birthdate` Clean and standardize birthdates **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.clean.birthdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `queries` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### email `clean.email` Clean and standardize email addresses **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.clean.email({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `queries` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### name `clean.name` Clean and parse full names **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.clean.name({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `queries` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### passport `clean.passport` Clean and validate Russian passport numbers **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.clean.passport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `queries` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### phone `clean.phone` Clean and standardize phone numbers **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.clean.phone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `queries` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### record `clean.record` Clean composite multi-field records **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.clean.record({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `structure` | `string[]` | Yes | — | | `data` | `string[][]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `structure` | `string[]` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[][] > ``` *** ### vehicle `clean.vehicle` Clean and recognize vehicle models **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.clean.vehicle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `queries` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ## Find ### address `find.address` Find address details by ID **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.address({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### bank `find.bank` Find bank details **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.bank({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### carBrand `find.carBrand` Find car brand details **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.carBrand({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### companyByEmail `find.companyByEmail` Find companies by email domain **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.companyByEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### country `find.country` Find country metadata **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.country({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### courtById `find.courtById` Find court details by ID **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.courtById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### currency `find.currency` Find currency details **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.currency({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### delivery `find.delivery` Find delivery city mapping IDs **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.delivery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### fiasById `find.fiasById` Find address by FIAS ID **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.fiasById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### fmsUnit `find.fmsUnit` Find passport issuing authority (FMS) **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.fmsUnit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### fnsUnit `find.fnsUnit` Find tax office (FNS) details **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.fnsUnit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### ftsUnit `find.ftsUnit` Find customs office (FTS) details **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.ftsUnit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### medicalPositionById `find.medicalPositionById` Find medical positions by ID **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.medicalPositionById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### mktu `find.mktu` Find MKTU trademark classification items **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.mktu({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### okpd2ById `find.okpd2ById` Find OKPD2 classifications by ID **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.okpd2ById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### okpdtrPosition `find.okpdtrPosition` Find OKPDTR job positions by code **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.okpdtrPosition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### okpdtrProfession `find.okpdtrProfession` Find OKPDTR worker professions **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.okpdtrProfession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### oktmoById `find.oktmoById` Find territory details by OKTMO code **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.oktmoById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### okved2 `find.okved2` Find OKVED2 economic activities **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.okved2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### party `find.party` Find Russian party/company details **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.party({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### partyBy `find.partyBy` Find Belarus party by UNP **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.partyBy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### partyKz `find.partyKz` Find Kazakhstan company details **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.partyKz({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### postalOffice `find.postalOffice` Find postal office details **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.postalOffice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### postalUnitById `find.postalUnitById` Find postal unit details **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.find.postalUnitById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ## Geolocate ### address `geolocate.address` Find addresses near coordinates **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.geolocate.address({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | — | | `lon` | `number` | Yes | — | | `radius_meters` | `number` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### postalUnit `geolocate.postalUnit` Find postal units near coordinates **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.geolocate.postalUnit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | — | | `lon` | `number` | Yes | — | | `radius_meters` | `number` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ## Ip Locate ### address `ipLocate.address` Geolocate address by IP **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.ipLocate.address({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `location` | `object` | No | — | > **location full type** > > ```ts theme={null} > { > } > ``` *** ## Profile ### balance `profile.balance` Get current account balance **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.profile.balance({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `balance` | `number` | Yes | — | *** ### statistics `profile.statistics` Get usage statistics **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.profile.statistics({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### versions `profile.versions` Get reference database update versions **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.profile.versions({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Suggest ### address `suggest.address` Autocomplete and suggest addresses **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.address({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### bank `suggest.bank` Autocomplete and suggest banks **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.bank({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### carBrand `suggest.carBrand` Autocomplete and suggest car brands **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.carBrand({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### country `suggest.country` Autocomplete and suggest countries **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.country({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### court `suggest.court` Autocomplete and suggest courts **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.court({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### currency `suggest.currency` Autocomplete and suggest currencies **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.currency({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### email `suggest.email` Autocomplete and suggest emails **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.email({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### fias `suggest.fias` Autocomplete and suggest FIAS addresses **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.fias({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### fmsUnit `suggest.fmsUnit` Suggest passport issuing departments **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.fmsUnit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### fnsUnit `suggest.fnsUnit` Suggest tax inspection (FNS) offices **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.fnsUnit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### ftsUnit `suggest.ftsUnit` Suggest customs (FTS) offices **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.ftsUnit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### medicalPosition `suggest.medicalPosition` Suggest medical positions/specialties **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.medicalPosition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### metro `suggest.metro` Suggest metro stations **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.metro({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### mktu `suggest.mktu` Suggest MKTU trademark classifications **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.mktu({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### name `suggest.name` Autocomplete and suggest names (FIO) **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.name({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### okpd2 `suggest.okpd2` Suggest product classification (OKPD2) codes **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.okpd2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### okpdtrPosition `suggest.okpdtrPosition` Suggest job positions from OKPDTR classifier **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.okpdtrPosition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### okpdtrProfession `suggest.okpdtrProfession` Suggest worker professions from OKPDTR **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.okpdtrProfession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### oktmo `suggest.oktmo` Suggest municipal territories (OKTMO) **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.oktmo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### okved2 `suggest.okved2` Suggest economic activities (OKVED2) **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.okved2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### party `suggest.party` Suggest Russian parties/companies **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.party({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### partyBy `suggest.partyBy` Suggest Belarus parties/companies **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.partyBy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### partyKz `suggest.partyKz` Suggest Kazakhstan parties/companies **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.partyKz({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### postalOffice `suggest.postalOffice` Suggest postal offices **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.postalOffice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** ### postalUnit `suggest.postalUnit` Suggest postal units **Risk:** `read` ```ts theme={null} await corsair.dadataru.api.suggest.postalUnit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `kpp` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > value: string, > unrestricted_value: string, > data: { > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/dadataru/database Dadataru local sync: searchable entities, `.search()` filters, and operators. The Dadataru plugin syncs data locally. Use `corsair.dadataru.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/dadataru/overview Dadataru plugin for Corsair Use **Dadataru** through Corsair: one client, typed API calls. **What you get:** * 63 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dadataru ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dadataru ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dadataru ``` ```bash bun theme={null} bun add corsair @corsair-dev/dadataru ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dadataru } from '@corsair-dev/dadataru'; export const corsair = createCorsair({ plugins: [ dadataru(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} dadataru() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dadataru', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`clean.address`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dadataru.api.clean.address({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/dadataru/api) reference.* See the full list on the [API](/plugins/dadataru/api) page. ## What's next > **[API reference](/plugins/dadataru/api)** > > Every `dadataru.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/daffy/api API reference for Daffy: every `daffy.api.*` operation with input and output types. Every `daffy.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### cancelDonation `accounts.cancelDonation` Cancel a pending donation owned by the API key holder. **Risk:** `destructive` ```ts theme={null} await corsair.daffy.api.accounts.cancelDonation({ donationId: 1234 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `donationId` | `number` | Yes | — | **Output:** *empty object* *** ### createDonation `accounts.createDonation` Create a donation to a nonprofit (minimum \$10 USD). **Risk:** `write` ```ts theme={null} await corsair.daffy.api.accounts.createDonation({ amount: 25, ein: '941156258', note: 'love what they do!' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | — | | `ein` | `string` | Yes | — | | `note` | `string` | No | — | | `privateMemo` | `string` | No | — | | `userId` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Donation ID. | | `amount` | `number` | No | Donation amount in US dollars. | | `user_id` | `number` | No | Donating user ID. | | `status` | `string` | Yes | Donation status. | | `note` | `string` | No | Public donation note. | | `scheduled_donation_id` | `number` | No | Scheduled donation ID. | | `visibility` | `string` | No | Donation visibility. | | `created_at` | `string` | Yes | Donation creation timestamp. | | `mailed_at` | `string` | No | Donation mailed timestamp. | | `non_profit` | `object` | Yes | Recipient nonprofit. | | `fund` | `object` | No | Donor fund. | | `user` | `object` | No | Donating user. | > **non\_profit full type** > > ```ts theme={null} > { > ein: string, > name: string, > website?: string | null, > city: string, > state: string, > public_path: string, > public_url: string, > latitude?: number | null, > longitude?: number | null, > logo?: string | null, > cause_id?: number, > cause?: { > id: number, > name: string, > logo?: string | null, > color: string > }, > causes?: { > id: number, > name: string, > logo?: string | null, > color: string > }[] > } > ``` > **fund full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` > **user full type** > > ```ts theme={null} > { > id: number, > name: string, > avatar?: string | null, > slug: string, > city?: string | null > } > ``` *** ### getBalance `accounts.getBalance` Retrieve the authenticated user's fund balance. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.accounts.getBalance({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | — | | `pending_deposit_balance` | `number` | Yes | — | | `portfolio_balance` | `number` | Yes | — | | `available_balance` | `number` | Yes | — | *** ### getContributions `accounts.getContributions` List contributions made to the authenticated fund. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.accounts.getContributions({ page: 1 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | Page of returned records. | | `meta` | `object` | Yes | Pagination metadata. | > **items full type** > > ```ts theme={null} > { > units: number, > type: string, > status: string, > valuation: number, > currency: string, > frequency: string, > created_at: string, > received_at?: string | null, > completed_at?: string | null, > id: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count: number, > page: number, > last: number > } > ``` *** ### getDonation `accounts.getDonation` Retrieve a single donation by user and donation ID. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.accounts.getDonation({ userId: 1234, donationId: 5678 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `number` | Yes | — | | `donationId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | Donation ID. | | `amount` | `number` | No | Donation amount in US dollars. | | `user_id` | `number` | No | Donating user ID. | | `status` | `string` | Yes | Donation status. | | `note` | `string` | No | Public donation note. | | `scheduled_donation_id` | `number` | No | Scheduled donation ID. | | `visibility` | `string` | No | Donation visibility. | | `created_at` | `string` | Yes | Donation creation timestamp. | | `mailed_at` | `string` | No | Donation mailed timestamp. | | `non_profit` | `object` | Yes | Recipient nonprofit. | | `fund` | `object` | No | Donor fund. | | `user` | `object` | No | Donating user. | > **non\_profit full type** > > ```ts theme={null} > { > ein: string, > name: string, > website?: string | null, > city: string, > state: string, > public_path: string, > public_url: string, > latitude?: number | null, > longitude?: number | null, > logo?: string | null, > cause_id?: number, > cause?: { > id: number, > name: string, > logo?: string | null, > color: string > }, > causes?: { > id: number, > name: string, > logo?: string | null, > color: string > }[] > } > ``` > **fund full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` > **user full type** > > ```ts theme={null} > { > id: number, > name: string, > avatar?: string | null, > slug: string, > city?: string | null > } > ``` *** ### getDonations `accounts.getDonations` List donations made by the authenticated user. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.accounts.getDonations({ page: 1 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | Page of returned records. | | `meta` | `object` | Yes | Pagination metadata. | > **items full type** > > ```ts theme={null} > { > id: number, > amount?: number, > user_id?: number, > status: string, > note?: string | null, > scheduled_donation_id?: number | null, > visibility?: string, > created_at: string, > mailed_at?: string | null, > non_profit: { > ein: string, > name: string, > website?: string | null, > city: string, > state: string, > public_path: string, > public_url: string, > latitude?: number | null, > longitude?: number | null, > logo?: string | null, > cause_id?: number, > cause?: { > id: number, > name: string, > logo?: string | null, > color: string > }, > causes?: { > id: number, > name: string, > logo?: string | null, > color: string > }[] > }, > fund?: { > id: number, > name: string > }, > user?: { > id: number, > name: string, > avatar?: string | null, > slug: string, > city?: string | null > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count: number, > page: number, > last: number > } > ``` *** ### getUserByUsername `accounts.getUserByUsername` Retrieve a public user profile by username. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.accounts.getUserByUsername({ username: 'api-user' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | User ID. | | `name` | `string` | Yes | User name. | | `avatar` | `string` | No | User avatar URL. | | `slug` | `string` | Yes | User profile slug. | | `cover_image` | `string` | No | User cover image URL. | | `fund_name` | `string` | Yes | User fund name. | | `current_fund` | `object` | Yes | Current donor-advised fund. | | `follows_user` | `boolean` | Yes | Whether the viewer follows this user. | | `follows_viewer` | `boolean` | Yes | Whether this user follows the viewer. | | `onboarding_status` | `string` | Yes | User onboarding status. | > **current\_fund full type** > > ```ts theme={null} > { > id: number, > name: string, > summary: string, > causes: { > id: number, > name: string, > logo?: string | null, > color: string > }[], > users: { > id: number, > name: string, > avatar?: string | null, > slug: string > }[] > } > ``` *** ### getUserCauses `accounts.getUserCauses` Retrieve a user's supported charitable causes. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.accounts.getUserCauses({ userId: 1 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > logo?: string | null, > color: string > }[] > ``` *** ### getUserDonations `accounts.getUserDonations` Retrieve a user's public donations. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.accounts.getUserDonations({ userId: 1, page: 1 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `userId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | Page of returned records. | | `meta` | `object` | Yes | Pagination metadata. | > **items full type** > > ```ts theme={null} > { > id: number, > amount?: number, > user_id?: number, > status: string, > note?: string | null, > scheduled_donation_id?: number | null, > visibility?: string, > created_at: string, > mailed_at?: string | null, > non_profit: { > ein: string, > name: string, > website?: string | null, > city: string, > state: string, > public_path: string, > public_url: string, > latitude?: number | null, > longitude?: number | null, > logo?: string | null, > cause_id?: number, > cause?: { > id: number, > name: string, > logo?: string | null, > color: string > }, > causes?: { > id: number, > name: string, > logo?: string | null, > color: string > }[] > }, > fund?: { > id: number, > name: string > }, > user?: { > id: number, > name: string, > avatar?: string | null, > slug: string, > city?: string | null > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count: number, > page: number, > last: number > } > ``` *** ### getUserProfile `accounts.getUserProfile` Retrieve the authenticated user's profile. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.accounts.getUserProfile({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | User ID. | | `name` | `string` | Yes | User name. | | `avatar` | `string` | No | User avatar URL. | | `slug` | `string` | Yes | User profile slug. | | `cover_image` | `string` | No | User cover image URL. | | `fund_name` | `string` | Yes | User fund name. | | `current_fund` | `object` | Yes | Current donor-advised fund. | | `follows_user` | `boolean` | Yes | Whether the viewer follows this user. | | `follows_viewer` | `boolean` | Yes | Whether this user follows the viewer. | | `onboarding_status` | `string` | Yes | User onboarding status. | > **current\_fund full type** > > ```ts theme={null} > { > id: number, > name: string, > summary: string, > causes: { > id: number, > name: string, > logo?: string | null, > color: string > }[], > users: { > id: number, > name: string, > avatar?: string | null, > slug: string > }[] > } > ``` *** ## Gifts ### create `gifts.create` Create a Daffy charitable gift for a beneficiary. **Risk:** `write` ```ts theme={null} await corsair.daffy.api.gifts.create({ name: 'Jamie', amount: 18 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `amount` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Gift beneficiary name. | | `amount` | `number` | Yes | Gift amount in US dollars. | | `message` | `string` | No | Gift message. | | `code` | `string` | Yes | Unique gift code. | | `ein` | `string` | No | Associated nonprofit EIN. | | `seen` | `boolean` | Yes | Whether the gift was seen. | | `status` | `new \| accepted \| denied \| claimed` | Yes | Gift status. | | `updated_at` | `string` | Yes | Gift status update timestamp. | | `created_at` | `string` | Yes | Gift creation timestamp. | | `claimed` | `boolean` | Yes | Whether the gift was claimed. | | `url` | `string` | Yes | Shareable gift URL. | *** ### getByCode `gifts.getByCode` Retrieve a gift by its unique code. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.gifts.getByCode({ code: '6ba7b810-9dad-11d1-80b4-00c04fd430c8' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Gift beneficiary name. | | `amount` | `number` | Yes | Gift amount in US dollars. | | `message` | `string` | No | Gift message. | | `code` | `string` | Yes | Unique gift code. | | `ein` | `string` | No | Associated nonprofit EIN. | | `seen` | `boolean` | Yes | Whether the gift was seen. | | `status` | `new \| accepted \| denied \| claimed` | Yes | Gift status. | | `updated_at` | `string` | Yes | Gift status update timestamp. | | `created_at` | `string` | Yes | Gift creation timestamp. | | `claimed` | `boolean` | Yes | Whether the gift was claimed. | | `url` | `string` | Yes | Shareable gift URL. | *** ### list `gifts.list` List gifts associated with the authenticated user. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.gifts.list({ page: 1 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | Page of returned records. | | `meta` | `object` | Yes | Pagination metadata. | > **items full type** > > ```ts theme={null} > { > name: string, > amount: number, > message?: string | null, > code: string, > ein?: string | null, > seen: boolean, > status: new | accepted | denied | claimed, > updated_at: string, > created_at: string, > claimed: boolean, > url: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count: number, > page: number, > last: number > } > ``` *** ## Non Profits ### getByEin `nonProfits.getByEin` Retrieve a nonprofit organization by EIN. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.nonProfits.getByEin({ ein: '261544963' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ein` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ein` | `string` | Yes | Employer Identification Number. | | `name` | `string` | Yes | Organization name. | | `website` | `string` | No | Organization website URL. | | `city` | `string` | Yes | Organization city. | | `state` | `string` | Yes | Organization state. | | `public_path` | `string` | Yes | Daffy public profile path. | | `public_url` | `string` | Yes | Daffy public profile URL. | | `latitude` | `number` | No | Organization latitude. | | `longitude` | `number` | No | Organization longitude. | | `logo` | `string` | No | Organization logo URL. | | `cause` | `object` | Yes | Primary charitable cause. | | `causes` | `object[]` | Yes | All charitable causes. | > **cause full type** > > ```ts theme={null} > { > id: number, > name: string, > logo?: string | null, > color: string > } > ``` > **causes full type** > > ```ts theme={null} > { > id: number, > name: string, > logo?: string | null, > color: string > }[] > ``` *** ### search `nonProfits.search` Search nonprofit organizations by cause or text. **Risk:** `read` ```ts theme={null} await corsair.daffy.api.nonProfits.search({ query: 'education', page: 1 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `causeId` | `number` | No | — | | `query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | Page of returned records. | | `meta` | `object` | Yes | Pagination metadata. | > **items full type** > > ```ts theme={null} > { > ein: string, > name: string, > website?: string | null, > city: string, > state: string, > public_path: string, > public_url: string, > latitude?: number | null, > longitude?: number | null, > logo?: string | null, > cause: { > id: number, > name: string, > logo?: string | null, > color: string > }, > causes: { > id: number, > name: string, > logo?: string | null, > color: string > }[] > }[] > ``` > **meta full type** > > ```ts theme={null} > { > count: number, > page: number, > last: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/daffy/database Daffy local sync: searchable entities, `.search()` filters, and operators. The Daffy plugin syncs data locally. Use `corsair.daffy.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/daffy/overview Donor-advised fund platform for charitable giving, gifts, and nonprofit search. Use **Daffy** through Corsair: one client, typed API calls. **What you get:** * 15 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/daffy ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/daffy ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/daffy ``` ```bash bun theme={null} bun add corsair @corsair-dev/daffy ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { daffy } from '@corsair-dev/daffy'; export const corsair = createCorsair({ plugins: [ daffy(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} daffy() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'daffy', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.getBalance`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.daffy.api.accounts.getBalance({}); ``` **`gifts.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.daffy.api.gifts.create({ name: 'Jamie', amount: 18 }); ``` See the full list on the [API](/plugins/daffy/api) page. ## What's next > **[API reference](/plugins/daffy/api)** > > Every `daffy.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/databricks/api API reference for Databricks: every `databricks.api.*` operation with input and output types. Every `databricks.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Apps ### createDatabricksApp `apps.createDatabricksApp` Create app **Risk:** `write` ```ts theme={null} await corsair.databricks.api.apps.createDatabricksApp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `spec` | `object` | No | — | > **spec full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### deleteDatabricksApp `apps.deleteDatabricksApp` Delete app **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.apps.deleteDatabricksApp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deployDatabricksApp `apps.deployDatabricksApp` Deploy app **Risk:** `write` ```ts theme={null} await corsair.databricks.api.apps.deployDatabricksApp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `source_code_path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deployment_id` | `string` | No | — | *** ## Catalog ### assignMetastoreToWorkspace `catalog.assignMetastoreToWorkspace` Assign metastore to workspace **Risk:** `write` ```ts theme={null} await corsair.databricks.api.catalog.assignMetastoreToWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `metastore_id` | `string` | Yes | — | | `workspace_id` | `number` | Yes | — | | `default_catalog_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### batchCreateAccessRequests `catalog.batchCreateAccessRequests` Batch create access requests **Risk:** `write` ```ts theme={null} await corsair.databricks.api.catalog.batchCreateAccessRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | > **requests full type** > > ```ts theme={null} > { > securable_type: string, > securable_full_name: string, > privileges: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `responses` | `any[]` | No | — | *** ### checkTableExists `catalog.checkTableExists` Check table existence **Risk:** `read` ```ts theme={null} await corsair.databricks.api.catalog.checkTableExists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalog_name` | `string` | Yes | — | | `schema_name` | `string` | Yes | — | | `table_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exists` | `boolean` | Yes | — | *** ### createCatalogConnection `catalog.createCatalogConnection` Create catalog connection **Risk:** `write` ```ts theme={null} await corsair.databricks.api.catalog.createCatalogConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `connection_type` | `string` | Yes | — | | `options` | `object` | Yes | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### createCatalogCredential `catalog.createCatalogCredential` Create catalog credential **Risk:** `write` ```ts theme={null} await corsair.databricks.api.catalog.createCatalogCredential({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `credential_type` | `string` | No | — | | `aws_iam_role` | `object` | No | — | | `azure_service_principal` | `object` | No | — | | `gcp_service_account_key` | `object` | No | — | > **aws\_iam\_role full type** > > ```ts theme={null} > { > role_arn: string > } > ``` > **azure\_service\_principal full type** > > ```ts theme={null} > { > directory_id: string, > application_id: string, > client_secret: string > } > ``` > **gcp\_service\_account\_key full type** > > ```ts theme={null} > { > email: string, > private_key: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### createExternalLocation `catalog.createExternalLocation` Create external location **Risk:** `write` ```ts theme={null} await corsair.databricks.api.catalog.createExternalLocation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | | `credential_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### createMetastore `catalog.createMetastore` Create Unity Catalog metastore **Risk:** `write` ```ts theme={null} await corsair.databricks.api.catalog.createMetastore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `storage_root` | `string` | Yes | — | | `owner` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metastore_id` | `string` | Yes | — | *** ### createStorageCredential `catalog.createStorageCredential` Create storage credential **Risk:** `write` ```ts theme={null} await corsair.databricks.api.catalog.createStorageCredential({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `aws_iam_role` | `object` | No | — | | `azure_service_principal` | `object` | No | — | > **aws\_iam\_role full type** > > ```ts theme={null} > { > role_arn: string > } > ``` > **azure\_service\_principal full type** > > ```ts theme={null} > { > directory_id: string, > application_id: string, > client_secret: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### deleteCatalog `catalog.deleteCatalog` Delete catalog **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.catalog.deleteCatalog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `force` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteCatalogConnection `catalog.deleteCatalogConnection` Delete catalog connection **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.catalog.deleteCatalogConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteCatalogCredential `catalog.deleteCatalogCredential` Delete catalog credential **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.catalog.deleteCatalogCredential({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `force` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteCatalogTable `catalog.deleteCatalogTable` Delete catalog table **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.catalog.deleteCatalogTable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `full_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteExternalLocation `catalog.deleteExternalLocation` Delete external location **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.catalog.deleteExternalLocation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `force` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteMetastore `catalog.deleteMetastore` Delete metastore **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.catalog.deleteMetastore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `force` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteOnlineTable `catalog.deleteOnlineTable` Delete online table **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.catalog.deleteOnlineTable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteStorageCredential `catalog.deleteStorageCredential` Delete storage credential **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.catalog.deleteStorageCredential({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `force` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### disableSystemSchema `catalog.disableSystemSchema` Disable system schema **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.catalog.disableSystemSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `metastore_id` | `string` | Yes | — | | `schema_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Cleanrooms ### createCleanRoom `cleanrooms.createCleanRoom` Create clean room **Risk:** `write` ```ts theme={null} await corsair.databricks.api.cleanrooms.createCleanRoom({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `collaborators` | `object[]` | Yes | — | > **collaborators full type** > > ```ts theme={null} > { > collaborator_alias: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `status` | `string` | No | — | *** ### createCleanRoomAutoApprovalRule `cleanrooms.createCleanRoomAutoApprovalRule` Create clean room auto approval rule **Risk:** `write` ```ts theme={null} await corsair.databricks.api.cleanrooms.createCleanRoomAutoApprovalRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clean_room_name` | `string` | Yes | — | | `author_collaborator_alias` | `string` | No | — | | `author_scope` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `string` | No | — | *** ## Compute ### addComputeInstanceProfile `compute.addComputeInstanceProfile` Add compute instance profile **Risk:** `write` ```ts theme={null} await corsair.databricks.api.compute.addComputeInstanceProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instance_profile_arn` | `string` | Yes | — | | `iam_role_arn` | `string` | No | — | | `is_meta_instance_profile` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### createComputeClusterPolicy `compute.createComputeClusterPolicy` Create cluster policy **Risk:** `write` ```ts theme={null} await corsair.databricks.api.compute.createComputeClusterPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `definition` | `string` | No | — | | `policy_family_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `policy_id` | `string` | Yes | — | *** ### createComputeInstancePool `compute.createComputeInstancePool` Create instance pool **Risk:** `write` ```ts theme={null} await corsair.databricks.api.compute.createComputeInstancePool({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instance_pool_name` | `string` | Yes | — | | `node_type_id` | `string` | Yes | — | | `min_idle_instances` | `number` | No | — | | `max_capacity` | `number` | No | — | | `idle_instance_autotermination_minutes` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `instance_pool_id` | `string` | Yes | — | *** ### createDatabricksCluster `compute.createDatabricksCluster` Create Spark cluster **Risk:** `write` ```ts theme={null} await corsair.databricks.api.compute.createDatabricksCluster({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cluster_name` | `string` | Yes | — | | `spark_version` | `string` | Yes | — | | `node_type_id` | `string` | Yes | — | | `num_workers` | `number` | No | — | | `autoscale` | `object` | No | — | | `autotermination_minutes` | `number` | No | — | > **autoscale full type** > > ```ts theme={null} > { > min_workers: number, > max_workers: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `cluster_id` | `string` | Yes | — | *** ### createGlobalInitScript `compute.createGlobalInitScript` Create global init script **Risk:** `write` ```ts theme={null} await corsair.databricks.api.compute.createGlobalInitScript({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `script` | `string` | Yes | Base64 encoded script | | `position` | `number` | No | — | | `enabled` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `script_id` | `string` | Yes | — | *** ### deleteComputeClusterPolicy `compute.deleteComputeClusterPolicy` Delete cluster policy **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.compute.deleteComputeClusterPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `policy_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteComputeInstancePool `compute.deleteComputeInstancePool` Delete instance pool **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.compute.deleteComputeInstancePool({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `instance_pool_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteDatabricksCluster `compute.deleteDatabricksCluster` Terminate Spark cluster **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.compute.deleteDatabricksCluster({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cluster_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteGlobalInitScript `compute.deleteGlobalInitScript` Delete global init script **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.compute.deleteGlobalInitScript({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `script_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Dashboards ### createGenieMessage `dashboards.createGenieMessage` Create Genie message **Risk:** `write` ```ts theme={null} await corsair.databricks.api.dashboards.createGenieMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `conversation_id` | `string` | Yes | — | | `content` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | No | — | | `status` | `string` | No | — | *** ### createGenieSpace `dashboards.createGenieSpace` Create Genie space **Risk:** `write` ```ts theme={null} await corsair.databricks.api.dashboards.createGenieSpace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `warehouse_id` | `string` | Yes | — | | `serialized_space` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | *** ### createLakeviewDashboard `dashboards.createLakeviewDashboard` Create Lakeview dashboard **Risk:** `write` ```ts theme={null} await corsair.databricks.api.dashboards.createLakeviewDashboard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `display_name` | `string` | Yes | — | | `serialized_dashboard` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dashboard_id` | `string` | No | — | *** ### deleteGenieConversation `dashboards.deleteGenieConversation` Delete Genie conversation **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.dashboards.deleteGenieConversation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `conversation_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteGenieConversationMessage `dashboards.deleteGenieConversationMessage` Delete Genie message **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.dashboards.deleteGenieConversationMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space_id` | `string` | Yes | — | | `conversation_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteLakeviewDashboardSchedule `dashboards.deleteLakeviewDashboardSchedule` Delete Lakeview schedule **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.dashboards.deleteLakeviewDashboardSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dashboard_id` | `string` | Yes | — | | `schedule_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Database ### createDatabaseInstance `database.createDatabaseInstance` Create database instance **Risk:** `write` ```ts theme={null} await corsair.databricks.api.database.createDatabaseInstance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `capacity` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `status` | `string` | No | — | *** ### deleteDatabaseInstance `database.deleteDatabaseInstance` Delete database instance **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.database.deleteDatabaseInstance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSyncedDatabaseTable `database.deleteSyncedDatabaseTable` Delete synced database table **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.database.deleteSyncedDatabaseTable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Dataquality ### createDataQualityMonitor `dataquality.createDataQualityMonitor` Create data quality monitor **Risk:** `write` ```ts theme={null} await corsair.databricks.api.dataquality.createDataQualityMonitor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `table_name` | `string` | Yes | — | | `assets_dir` | `string` | Yes | — | | `output_schema_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `monitor_id` | `string` | No | — | *** ### createQualityMonitorV2 `dataquality.createQualityMonitorV2` Create quality monitor V2 **Risk:** `write` ```ts theme={null} await corsair.databricks.api.dataquality.createQualityMonitorV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `table_name` | `string` | Yes | — | | `assets_dir` | `string` | Yes | — | | `output_schema_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `monitor_id` | `string` | No | — | *** ## Dbfs ### addBlockToDbfsStream `dbfs.addBlockToDbfsStream` Add block to DBFS stream **Risk:** `write` ```ts theme={null} await corsair.databricks.api.dbfs.addBlockToDbfsStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `handle` | `number` | Yes | — | | `data` | `string` | Yes | Base64-encoded string block (max 1MB) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### createDbfsFileStream `dbfs.createDbfsFileStream` Create DBFS file stream **Risk:** `write` ```ts theme={null} await corsair.databricks.api.dbfs.createDbfsFileStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `overwrite` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `handle` | `number` | Yes | — | *** ### deleteDbfsFileOrDirectory `dbfs.deleteDbfsFileOrDirectory` Delete file or directory from DBFS **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.dbfs.deleteDbfsFileOrDirectory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `recursive` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Iam ### addMemberToSecurityGroup `iam.addMemberToSecurityGroup` Add member to security group **Risk:** `write` ```ts theme={null} await corsair.databricks.api.iam.addMemberToSecurityGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | | `member_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### createIamGroupV2 `iam.createIamGroupV2` Create IAM group **Risk:** `write` ```ts theme={null} await corsair.databricks.api.iam.createIamGroupV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `displayName` | `string` | Yes | — | | `members` | `object[]` | No | — | > **members full type** > > ```ts theme={null} > { > value: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `displayName` | `string` | Yes | — | *** ### createIamServicePrincipalV2 `iam.createIamServicePrincipalV2` Create IAM service principal **Risk:** `write` ```ts theme={null} await corsair.databricks.api.iam.createIamServicePrincipalV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `applicationId` | `string` | Yes | — | | `displayName` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `applicationId` | `string` | Yes | — | *** ### createIamUserV2 `iam.createIamUserV2` Create IAM user **Risk:** `write` ```ts theme={null} await corsair.databricks.api.iam.createIamUserV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `displayName` | `string` | No | — | | `active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `userName` | `string` | Yes | — | *** ### createIpAccessList `iam.createIpAccessList` Create IP access list **Risk:** `write` ```ts theme={null} await corsair.databricks.api.iam.createIpAccessList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | Yes | — | | `list_type` | `ALLOW \| BLOCK` | Yes | — | | `ip_addresses` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ip_access_list` | `object` | Yes | — | > **ip\_access\_list full type** > > ```ts theme={null} > { > list_id: string > } > ``` *** ### deleteIamGroupV2 `iam.deleteIamGroupV2` Delete IAM group **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.iam.deleteIamGroupV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteIamServicePrincipalV2 `iam.deleteIamServicePrincipalV2` Delete service principal **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.iam.deleteIamServicePrincipalV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteIamUserV2 `iam.deleteIamUserV2` Delete user **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.iam.deleteIamUserV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Jobs ### cancelAllJobRuns `jobs.cancelAllJobRuns` Cancel all job runs **Risk:** `write` ```ts theme={null} await corsair.databricks.api.jobs.cancelAllJobRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `number` | No | — | | `all_queued_runs` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### cancelJobRun `jobs.cancelJobRun` Cancel job run **Risk:** `write` ```ts theme={null} await corsair.databricks.api.jobs.cancelJobRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `run_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteDatabricksJobRun `jobs.deleteDatabricksJobRun` Delete job run **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.jobs.deleteDatabricksJobRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `run_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Marketplace ### batchGetMarketplaceConsumerListings `marketplace.batchGetMarketplaceConsumerListings` Batch get consumer listings **Risk:** `read` ```ts theme={null} await corsair.databricks.api.marketplace.batchGetMarketplaceConsumerListings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `listings` | `object[]` | Yes | — | > **listings full type** > > ```ts theme={null} > { > }[] > ``` *** ### batchGetMarketplaceConsumerProviders `marketplace.batchGetMarketplaceConsumerProviders` Batch get consumer providers **Risk:** `read` ```ts theme={null} await corsair.databricks.api.marketplace.batchGetMarketplaceConsumerProviders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `providers` | `object[]` | Yes | — | > **providers full type** > > ```ts theme={null} > { > }[] > ``` *** ### createMarketplaceConsumerInstallation `marketplace.createMarketplaceConsumerInstallation` Create marketplace consumer installation **Risk:** `write` ```ts theme={null} await corsair.databricks.api.marketplace.createMarketplaceConsumerInstallation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listing_id` | `string` | Yes | — | | `catalog_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createMarketplaceProviderListing `marketplace.createMarketplaceProviderListing` Create marketplace provider listing **Risk:** `write` ```ts theme={null} await corsair.databricks.api.marketplace.createMarketplaceProviderListing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `summary` | `string` | Yes | — | | `listing_type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createProviderAnalyticsDashboard `marketplace.createProviderAnalyticsDashboard` Create provider analytics dashboard **Risk:** `write` ```ts theme={null} await corsair.databricks.api.marketplace.createProviderAnalyticsDashboard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dashboard_id` | `string` | No | — | *** ### deleteListingFromExchange `marketplace.deleteListingFromExchange` Delete listing from exchange **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.marketplace.deleteListingFromExchange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `exchange_id` | `string` | Yes | — | | `listing_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteMarketplaceConsumerInstallation `marketplace.deleteMarketplaceConsumerInstallation` Delete marketplace consumer installation **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.marketplace.deleteMarketplaceConsumerInstallation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Ml ### createLoggedModel `ml.createLoggedModel` Create logged model **Risk:** `write` ```ts theme={null} await corsair.databricks.api.ml.createLoggedModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `experiment_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | Yes | — | *** ### createMlExperiment `ml.createMlExperiment` Create ML experiment **Risk:** `write` ```ts theme={null} await corsair.databricks.api.ml.createMlExperiment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `artifact_location` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `experiment_id` | `string` | Yes | — | *** ### createMlFeatureStoreOnlineStore `ml.createMlFeatureStoreOnlineStore` Create ML online feature store **Risk:** `write` ```ts theme={null} await corsair.databricks.api.ml.createMlFeatureStoreOnlineStore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `store_type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### createMlflowExperimentRun `ml.createMlflowExperimentRun` Create MLflow experiment run **Risk:** `write` ```ts theme={null} await corsair.databricks.api.ml.createMlflowExperimentRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `experiment_id` | `string` | Yes | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `run_id` | `string` | Yes | — | *** ### createMlForecastingExperiment `ml.createMlForecastingExperiment` Create ML forecasting experiment **Risk:** `write` ```ts theme={null} await corsair.databricks.api.ml.createMlForecastingExperiment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `target_col` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `experiment_id` | `string` | Yes | — | *** ### deleteLoggedModel `ml.deleteLoggedModel` Delete logged model **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.ml.deleteLoggedModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteLoggedModelTag `ml.deleteLoggedModelTag` Delete logged model tag **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.ml.deleteLoggedModelTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteMlExperiment `ml.deleteMlExperiment` Delete ML experiment **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.ml.deleteMlExperiment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `experiment_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteMlExperimentRun `ml.deleteMlExperimentRun` Delete ML run **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.ml.deleteMlExperimentRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `run_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteMlExperimentRuns `ml.deleteMlExperimentRuns` Delete ML runs **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.ml.deleteMlExperimentRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `experiment_id` | `string` | Yes | — | | `max_timestamp_millis` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteMlExperimentRunTag `ml.deleteMlExperimentRunTag` Delete ML run tag **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.ml.deleteMlExperimentRunTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `run_id` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteMlFeatureEngKafkaConfig `ml.deleteMlFeatureEngKafkaConfig` Delete Kafka config **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.ml.deleteMlFeatureEngKafkaConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `config_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteMlFeatureStoreOnlineStore `ml.deleteMlFeatureStoreOnlineStore` Delete ML online store **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.ml.deleteMlFeatureStoreOnlineStore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteMlFeatureTag `ml.deleteMlFeatureTag` Delete ML feature tag **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.ml.deleteMlFeatureTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `feature_table_name` | `string` | Yes | — | | `feature_name` | `string` | Yes | — | | `tag_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Security ### createNotificationDestination `security.createNotificationDestination` Create notification destination **Risk:** `write` ```ts theme={null} await corsair.databricks.api.security.createNotificationDestination({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `display_name` | `string` | Yes | — | | `config` | `object` | Yes | — | > **config full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createOAuthServicePrincipalSecret `security.createOAuthServicePrincipalSecret` Create OAuth SP secret **Risk:** `write` ```ts theme={null} await corsair.databricks.api.security.createOAuthServicePrincipalSecret({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | | `service_principal_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `secret_id` | `string` | Yes | — | | `secret_value` | `string` | No | — | *** ### createPersonalAccessToken `security.createPersonalAccessToken` Create personal access token **Risk:** `write` ```ts theme={null} await corsair.databricks.api.security.createPersonalAccessToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment` | `string` | No | — | | `lifetime_seconds` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `token_value` | `string` | No | — | | `token_info` | `object` | No | — | > **token\_info full type** > > ```ts theme={null} > { > } > ``` *** ### deleteNotificationDestination `security.deleteNotificationDestination` Delete notification destination **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.security.deleteNotificationDestination({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteOAuth2ServicePrincipalSecret `security.deleteOAuth2ServicePrincipalSecret` Delete OAuth SP secret **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.security.deleteOAuth2ServicePrincipalSecret({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | | `service_principal_id` | `string` | Yes | — | | `secret_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteTokenManagement `security.deleteTokenManagement` Delete token management **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.security.deleteTokenManagement({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `token_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Serving ### createProvisionedThroughputEndpoint `serving.createProvisionedThroughputEndpoint` Create provisioned throughput endpoint **Risk:** `write` ```ts theme={null} await corsair.databricks.api.serving.createProvisionedThroughputEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `config` | `object` | Yes | — | > **config full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### createVectorSearchEndpoint `serving.createVectorSearchEndpoint` Create vector search endpoint **Risk:** `write` ```ts theme={null} await corsair.databricks.api.serving.createVectorSearchEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `endpoint_type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### deleteServingEndpoint `serving.deleteServingEndpoint` Delete serving endpoint **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.serving.deleteServingEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteVectorSearchIndex `serving.deleteVectorSearchIndex` Delete vector search index **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.serving.deleteVectorSearchIndex({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Sharing ### createShare `sharing.createShare` Create share **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sharing.createShare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### createSharingProvider `sharing.createSharingProvider` Create sharing provider **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sharing.createSharingProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `authentication_type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### createSharingRecipient `sharing.createSharingRecipient` Create sharing recipient **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sharing.createSharingRecipient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `authentication_type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | *** ### deleteShare `sharing.deleteShare` Delete share **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.sharing.deleteShare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSharingRecipient `sharing.deleteSharingRecipient` Delete sharing recipient **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.sharing.deleteSharingRecipient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Sql ### cancelSqlStatementExecution `sql.cancelSqlStatementExecution` Cancel SQL statement execution **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sql.cancelSqlStatementExecution({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `statement_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ### createLegacySqlAlert `sql.createLegacySqlAlert` Create legacy SQL alert **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sql.createLegacySqlAlert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `query_id` | `string` | Yes | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createLegacySqlQuery `sql.createLegacySqlQuery` Create legacy SQL query **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sql.createLegacySqlQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `query` | `string` | Yes | — | | `data_source_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createLegacySqlQueryVisualization `sql.createLegacySqlQueryVisualization` Create legacy SQL visualization **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sql.createLegacySqlQueryVisualization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query_id` | `string` | Yes | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createSqlAlert `sql.createSqlAlert` Create SQL alert **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sql.createSqlAlert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `query_id` | `string` | Yes | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createSqlQuery `sql.createSqlQuery` Create SQL query **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sql.createSqlQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `query` | `string` | Yes | — | | `warehouse_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createSqlQueryVisualization `sql.createSqlQueryVisualization` Create SQL query visualization **Risk:** `write` ```ts theme={null} await corsair.databricks.api.sql.createSqlQueryVisualization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query_id` | `string` | Yes | — | | `type` | `string` | Yes | — | | `name` | `string` | Yes | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteLegacySqlAlert `sql.deleteLegacySqlAlert` Delete legacy SQL alert **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.sql.deleteLegacySqlAlert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteLegacySqlQuery `sql.deleteLegacySqlQuery` Delete legacy SQL query **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.sql.deleteLegacySqlQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteLegacySqlQueryVisualization `sql.deleteLegacySqlQueryVisualization` Delete legacy SQL visualization **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.sql.deleteLegacySqlQueryVisualization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSqlAlert `sql.deleteSqlAlert` Delete SQL alert **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.sql.deleteSqlAlert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSqlDashboard `sql.deleteSqlDashboard` Delete SQL dashboard **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.sql.deleteSqlDashboard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSqlQuery `sql.deleteSqlQuery` Delete SQL query **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.sql.deleteSqlQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSqlWarehouse `sql.deleteSqlWarehouse` Delete SQL warehouse **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.sql.deleteSqlWarehouse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Workspace ### createSecretScope `workspace.createSecretScope` Create secret scope **Risk:** `write` ```ts theme={null} await corsair.databricks.api.workspace.createSecretScope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scope` | `string` | Yes | — | | `initial_manage_principal` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### createTagPolicy `workspace.createTagPolicy` Create tag policy **Risk:** `write` ```ts theme={null} await corsair.databricks.api.workspace.createTagPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_key` | `string` | Yes | — | | `values` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tag_key` | `string` | Yes | — | *** ### createWorkspaceDirectory `workspace.createWorkspaceDirectory` Create workspace directory **Risk:** `write` ```ts theme={null} await corsair.databricks.api.workspace.createWorkspaceDirectory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### createWorkspaceGitCredentials `workspace.createWorkspaceGitCredentials` Create workspace git credentials **Risk:** `write` ```ts theme={null} await corsair.databricks.api.workspace.createWorkspaceGitCredentials({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `git_username` | `string` | Yes | — | | `git_provider` | `string` | Yes | — | | `personal_access_token` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `credential_id` | `number` | No | — | *** ### createWorkspaceRepo `workspace.createWorkspaceRepo` Create workspace repo **Risk:** `write` ```ts theme={null} await corsair.databricks.api.workspace.createWorkspaceRepo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `provider` | `string` | Yes | — | | `path` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | *** ### deleteAibiDashboardEmbeddingAccessPolicy `workspace.deleteAibiDashboardEmbeddingAccessPolicy` Delete AI/BI dashboard embedding access policy **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteAibiDashboardEmbeddingAccessPolicy({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteAibiDashboardEmbeddingApprovedDomains `workspace.deleteAibiDashboardEmbeddingApprovedDomains` Delete AI/BI embedding approved domains **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteAibiDashboardEmbeddingApprovedDomains({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteCustomLlmAgent `workspace.deleteCustomLlmAgent` Delete custom LLM agent **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteCustomLlmAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agent_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteDashboardEmailSubscriptionsSetting `workspace.deleteDashboardEmailSubscriptionsSetting` Delete dashboard email subscriptions setting **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteDashboardEmailSubscriptionsSetting({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteDatabricksPipeline `workspace.deleteDatabricksPipeline` Delete Databricks pipeline **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteDatabricksPipeline({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pipeline_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteDefaultNamespaceSetting `workspace.deleteDefaultNamespaceSetting` Delete default namespace setting **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteDefaultNamespaceSetting({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteDefaultWarehouseIdSetting `workspace.deleteDefaultWarehouseIdSetting` Delete default warehouse ID setting **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteDefaultWarehouseIdSetting({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteDisableLegacyAccessSetting `workspace.deleteDisableLegacyAccessSetting` Delete disable legacy access setting **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteDisableLegacyAccessSetting({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteDisableLegacyDbfsSetting `workspace.deleteDisableLegacyDbfsSetting` Delete disable legacy DBFS setting **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteDisableLegacyDbfsSetting({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteLlmProxyPartnerSetting `workspace.deleteLlmProxyPartnerSetting` Delete LLM proxy partner setting **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteLlmProxyPartnerSetting({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteRestrictWorkspaceAdminsSetting `workspace.deleteRestrictWorkspaceAdminsSetting` Delete restrict workspace admins setting **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteRestrictWorkspaceAdminsSetting({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSecretsAcl `workspace.deleteSecretsAcl` Delete secrets ACL **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteSecretsAcl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scope` | `string` | Yes | — | | `principal` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSecretScope `workspace.deleteSecretScope` Delete secret scope **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteSecretScope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scope` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSqlResultsDownloadSetting `workspace.deleteSqlResultsDownloadSetting` Delete SQL results download setting **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteSqlResultsDownloadSetting({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteTagPolicy `workspace.deleteTagPolicy` Delete tag policy **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteTagPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteWorkspaceGitCredentials `workspace.deleteWorkspaceGitCredentials` Delete workspace git credentials **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteWorkspaceGitCredentials({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `credential_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteWorkspaceObject `workspace.deleteWorkspaceObject` Delete workspace object **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteWorkspaceObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `recursive` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteWorkspaceRepo `workspace.deleteWorkspaceRepo` Delete workspace repo **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteWorkspaceRepo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteWorkspaceSecret `workspace.deleteWorkspaceSecret` Delete workspace secret **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.databricks.api.workspace.deleteWorkspaceSecret({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scope` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/databricks/database Databricks local sync: searchable entities, `.search()` filters, and operators. The Databricks plugin syncs data locally. Use `corsair.databricks.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Catalog Path: `databricks.db.catalog.search` ```ts theme={null} const rows = await corsair.databricks.db.catalog.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `metastore_id` | `string` | equals, contains, startsWith, endsWith, in | | `owner` | `string` | equals, contains, startsWith, endsWith, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Cluster Path: `databricks.db.cluster.search` ```ts theme={null} const rows = await corsair.databricks.db.cluster.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `cluster_id` | `string` | equals, contains, startsWith, endsWith, in | | `cluster_name` | `string` | equals, contains, startsWith, endsWith, in | | `spark_version` | `string` | equals, contains, startsWith, endsWith, in | | `node_type_id` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `num_workers` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Job Path: `databricks.db.job.search` ```ts theme={null} const rows = await corsair.databricks.db.job.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `job_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `creator_user_name` | `string` | equals, contains, startsWith, endsWith, in | | `created_time` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Warehouse Path: `databricks.db.warehouse.search` ```ts theme={null} const rows = await corsair.databricks.db.warehouse.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `cluster_size` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `creator_name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/databricks/overview Unified data and AI platform for lakehouse analytics, notebooks, and machine learning. Use **Databricks** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 130 typed API operations * 4 synced entities (`catalog`, `cluster`, `job`, `warehouse`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/databricks ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/databricks ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/databricks ``` ```bash bun theme={null} bun add corsair @corsair-dev/databricks ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { databricks } from '@corsair-dev/databricks'; export const corsair = createCorsair({ plugins: [ databricks(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} databricks() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Databricks OAuth app. ```ts theme={null} databricks({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'databricks', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`catalog.checkTableExists`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.databricks.api.catalog.checkTableExists({}); ``` **`apps.createDatabricksApp`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.databricks.api.apps.createDatabricksApp({}); ``` See the full list on the [API](/plugins/databricks/api) page. ## Query synced data Synced entities support `tenant.databricks.db..search()` and `.list()`: `catalog`, `cluster`, `job`, `warehouse`. See [Database](/plugins/databricks/database) for filters and operators. ## What's next > **[API reference](/plugins/databricks/api)** > > Every `databricks.api.*` operation with input and output types. > **[Database](/plugins/databricks/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/datadog/api API reference for Datadog: every `datadog.api.*` operation with input and output types. Every `datadog.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Api Keys ### list `apiKeys.list` List API key metadata **Risk:** `read` ```ts theme={null} await corsair.datadog.api.apiKeys.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageNumber` | `number` | No | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > type?: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Aws ### list `aws.list` List AWS integration accounts **Risk:** `read` ```ts theme={null} await corsair.datadog.api.aws.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `accounts` | `object[]` | No | — | > **accounts full type** > > ```ts theme={null} > { > account_id?: string | null, > role_name?: string | null, > filter_tags?: string[], > host_tags?: string[], > metrics_collection_enabled?: boolean > }[] > ``` *** ## Dashboards ### create `dashboards.create` Create a dashboard **Risk:** `write` ```ts theme={null} await corsair.datadog.api.dashboards.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `widgets` | `object[]` | Yes | — | | `layoutType` | `ordered \| free` | Yes | — | | `description` | `string` | No | — | | `notifyList` | `string[]` | No | — | | `tags` | `string[]` | No | — | > **widgets full type** > > ```ts theme={null} > { > id?: number, > definition: { > }, > layout?: { > x: number, > y: number, > width: number, > height: number > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `layout_type` | `string` | No | — | | `url` | `string` | No | — | | `author_handle` | `string` | No | — | | `is_read_only` | `boolean` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `widgets` | `object[]` | No | — | | `template_variables` | `object[]` | No | — | | `notify_list` | `string[]` | No | — | | `tags` | `string[]` | No | — | > **widgets full type** > > ```ts theme={null} > { > id?: number, > definition: { > }, > layout?: { > x: number, > y: number, > width: number, > height: number > } > }[] > ``` > **template\_variables full type** > > ```ts theme={null} > { > }[] > ``` *** ### delete `dashboards.delete` Delete a dashboard \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datadog.api.dashboards.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dashboardId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_dashboard_id` | `string` | No | — | *** ### get `dashboards.get` Get a dashboard with its widgets **Risk:** `read` ```ts theme={null} await corsair.datadog.api.dashboards.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dashboardId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `layout_type` | `string` | No | — | | `url` | `string` | No | — | | `author_handle` | `string` | No | — | | `is_read_only` | `boolean` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `widgets` | `object[]` | No | — | | `template_variables` | `object[]` | No | — | | `notify_list` | `string[]` | No | — | | `tags` | `string[]` | No | — | > **widgets full type** > > ```ts theme={null} > { > id?: number, > definition: { > }, > layout?: { > x: number, > y: number, > width: number, > height: number > } > }[] > ``` > **template\_variables full type** > > ```ts theme={null} > { > }[] > ``` *** ### list `dashboards.list` List dashboards **Risk:** `read` ```ts theme={null} await corsair.datadog.api.dashboards.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filterShared` | `boolean` | No | — | | `filterDeleted` | `boolean` | No | — | | `count` | `number` | No | — | | `start` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dashboards` | `object[]` | No | — | > **dashboards full type** > > ```ts theme={null} > { > id?: string, > title?: string, > description?: string | null, > layout_type?: string, > url?: string, > author_handle?: string, > is_read_only?: boolean, > created_at?: string, > modified_at?: string > }[] > ``` *** ### update `dashboards.update` Update a dashboard **Risk:** `write` ```ts theme={null} await corsair.datadog.api.dashboards.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `widgets` | `object[]` | Yes | — | | `layoutType` | `ordered \| free` | Yes | — | | `description` | `string` | No | — | | `notifyList` | `string[]` | No | — | | `tags` | `string[]` | No | — | | `dashboardId` | `string` | Yes | — | > **widgets full type** > > ```ts theme={null} > { > id?: number, > definition: { > }, > layout?: { > x: number, > y: number, > width: number, > height: number > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `layout_type` | `string` | No | — | | `url` | `string` | No | — | | `author_handle` | `string` | No | — | | `is_read_only` | `boolean` | No | — | | `created_at` | `string` | No | — | | `modified_at` | `string` | No | — | | `widgets` | `object[]` | No | — | | `template_variables` | `object[]` | No | — | | `notify_list` | `string[]` | No | — | | `tags` | `string[]` | No | — | > **widgets full type** > > ```ts theme={null} > { > id?: number, > definition: { > }, > layout?: { > x: number, > y: number, > width: number, > height: number > } > }[] > ``` > **template\_variables full type** > > ```ts theme={null} > { > }[] > ``` *** ## Downtimes ### create `downtimes.create` Schedule a downtime (suppresses monitor alerts) **Risk:** `write` ```ts theme={null} await corsair.datadog.api.downtimes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scope` | `string` | Yes | — | | `message` | `string` | No | — | | `monitorId` | `number` | No | — | | `start` | `string` | No | — | | `end` | `string` | No | — | | `timezone` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > type?: string, > attributes?: { > scope?: string, > status?: string, > message?: string | null, > created?: string, > modified?: string, > monitor_identifier?: { > }, > schedule?: { > } > } > } > ``` *** ### list `downtimes.list` List downtimes **Risk:** `read` ```ts theme={null} await corsair.datadog.api.downtimes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `currentOnly` | `boolean` | No | — | | `pageOffset` | `number` | No | — | | `pageLimit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data?: { > id?: string, > type?: string, > attributes?: { > scope?: string, > status?: string, > message?: string | null, > created?: string, > modified?: string, > monitor_identifier?: { > }, > schedule?: { > } > } > }[] > }& { > page?: { > total_count?: number, > total_filtered_count?: number, > after?: string > } > } > ``` *** ## Events ### create `events.create` Post an event **Risk:** `write` ```ts theme={null} await corsair.datadog.api.events.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `text` | `string` | Yes | — | | `tags` | `string[]` | No | — | | `alertType` | `error \| warning \| info \| success \| user_update \| recommendation \| snapshot` | No | — | | `priority` | `normal \| low` | No | — | | `host` | `string` | No | — | | `aggregationKey` | `string` | No | — | | `sourceTypeName` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `event` | `object` | No | — | > **event full type** > > ```ts theme={null} > { > id?: number, > title?: string, > text?: string, > date_happened?: number, > priority?: string | null, > tags?: string[] | null, > alert_type?: string, > source?: string, > host?: string | null, > url?: string > } > ``` *** ### list `events.list` List events in a time window **Risk:** `read` ```ts theme={null} await corsair.datadog.api.events.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start` | `number` | Yes | — | | `end` | `number` | Yes | — | | `priority` | `normal \| low` | No | — | | `sources` | `string` | No | — | | `tags` | `string` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `events` | `object[]` | No | — | > **events full type** > > ```ts theme={null} > { > id?: number, > title?: string, > text?: string, > date_happened?: number, > priority?: string | null, > tags?: string[] | null, > alert_type?: string, > source?: string, > host?: string | null, > url?: string > }[] > ``` *** ## Hosts ### list `hosts.list` List infrastructure hosts **Risk:** `read` ```ts theme={null} await corsair.datadog.api.hosts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter` | `string` | No | — | | `sortField` | `string` | No | — | | `sortDir` | `asc \| desc` | No | — | | `start` | `number` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `host_list` | `object[]` | No | — | | `total_matching` | `number` | No | — | | `total_returned` | `number` | No | — | > **host\_list full type** > > ```ts theme={null} > { > name?: string, > host_name?: string, > id?: number, > aliases?: string[], > apps?: string[], > is_muted?: boolean, > last_reported_time?: number, > up?: boolean, > sources?: string[], > tags_by_source?: { > } > }[] > ``` *** ### totals `hosts.totals` Get host totals (active/up) **Risk:** `read` ```ts theme={null} await corsair.datadog.api.hosts.totals({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_active` | `number` | No | — | | `total_up` | `number` | No | — | *** ## Incidents ### list `incidents.list` List incidents **Risk:** `read` ```ts theme={null} await corsair.datadog.api.incidents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageOffset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > type?: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Logs ### aggregate `logs.aggregate` Aggregate log analytics **Risk:** `read` ```ts theme={null} await corsair.datadog.api.logs.aggregate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `from` | `string` | Yes | — | | `to` | `string` | Yes | — | | `aggregation` | `string` | Yes | — | | `metric` | `string` | No | — | | `groupBy` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### listIndexes `logs.listIndexes` List log indexes **Risk:** `read` ```ts theme={null} await corsair.datadog.api.logs.listIndexes({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `indexes` | `object[]` | No | — | > **indexes full type** > > ```ts theme={null} > { > name?: string, > filter?: { > }, > is_rate_limited?: boolean, > daily_limit?: number | null, > num_retention_days?: number > }[] > ``` *** ### search `logs.search` Search logs **Risk:** `read` ```ts theme={null} await corsair.datadog.api.logs.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `from` | `string` | Yes | — | | `to` | `string` | Yes | — | | `indexes` | `string[]` | No | — | | `sort` | `timestamp \| -timestamp` | No | — | | `pageLimit` | `number` | No | — | | `pageCursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > type?: string, > attributes?: { > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > page?: { > total_count?: number, > total_filtered_count?: number, > after?: string > } > } > ``` *** ## Metrics ### listActive `metrics.listActive` List actively reporting metrics **Risk:** `read` ```ts theme={null} await corsair.datadog.api.metrics.listActive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | Yes | — | | `host` | `string` | No | — | | `tagFilter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metrics` | `string[]` | No | — | | `from` | `string` | No | — | *** ### query `metrics.query` Query timeseries points **Risk:** `read` ```ts theme={null} await corsair.datadog.api.metrics.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `from` | `number` | Yes | — | | `to` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `query` | `string` | No | — | | `from_date` | `number` | No | — | | `to_date` | `number` | No | — | | `series` | `object[]` | No | — | > **series full type** > > ```ts theme={null} > { > metric?: string, > display_name?: string, > pointlist?: number | null[][], > scope?: string, > unit?: { > } | null[] | null > }[] > ``` *** ### submit `metrics.submit` Submit metric series points **Risk:** `write` ```ts theme={null} await corsair.datadog.api.metrics.submit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `series` | `object[]` | Yes | — | > **series full type** > > ```ts theme={null} > { > metric: string, > points: tuple[], > type?: gauge | count | rate, > host?: string, > tags?: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ## Monitors ### create `monitors.create` Create a monitor **Risk:** `write` ```ts theme={null} await corsair.datadog.api.monitors.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `query` | `string` | Yes | — | | `name` | `string` | Yes | — | | `message` | `string` | No | — | | `tags` | `string[]` | No | — | | `priority` | `number` | No | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `query` | `string` | No | — | | `message` | `string` | No | — | | `tags` | `string[]` | No | — | | `priority` | `number` | No | — | | `overall_state` | `string` | No | — | | `created` | `string` | No | — | | `modified` | `string` | No | — | | `creator` | `object` | No | — | | `options` | `object` | No | — | > **creator full type** > > ```ts theme={null} > { > name?: string | null, > email?: string, > handle?: string > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` *** ### delete `monitors.delete` Delete a monitor \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datadog.api.monitors.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `monitorId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_monitor_id` | `number` | No | — | *** ### get `monitors.get` Get a monitor **Risk:** `read` ```ts theme={null} await corsair.datadog.api.monitors.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `monitorId` | `number` | Yes | — | | `groupStates` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `query` | `string` | No | — | | `message` | `string` | No | — | | `tags` | `string[]` | No | — | | `priority` | `number` | No | — | | `overall_state` | `string` | No | — | | `created` | `string` | No | — | | `modified` | `string` | No | — | | `creator` | `object` | No | — | | `options` | `object` | No | — | > **creator full type** > > ```ts theme={null} > { > name?: string | null, > email?: string, > handle?: string > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` *** ### list `monitors.list` List monitors **Risk:** `read` ```ts theme={null} await corsair.datadog.api.monitors.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `tags` | `string` | No | — | | `monitorTags` | `string` | No | — | | `groupStates` | `string` | No | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: number, > name?: string, > type?: string, > query?: string, > message?: string, > tags?: string[], > priority?: number | null, > overall_state?: string, > created?: string, > modified?: string, > creator?: { > name?: string | null, > email?: string, > handle?: string > }, > options?: { > } > }[] > ``` *** ### mute `monitors.mute` Mute a monitor (suppresses alerting) **Risk:** `write` ```ts theme={null} await corsair.datadog.api.monitors.mute({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `monitorId` | `number` | Yes | — | | `scope` | `string` | No | — | | `end` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `query` | `string` | No | — | | `message` | `string` | No | — | | `tags` | `string[]` | No | — | | `priority` | `number` | No | — | | `overall_state` | `string` | No | — | | `created` | `string` | No | — | | `modified` | `string` | No | — | | `creator` | `object` | No | — | | `options` | `object` | No | — | > **creator full type** > > ```ts theme={null} > { > name?: string | null, > email?: string, > handle?: string > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` *** ### search `monitors.search` Search monitors **Risk:** `read` ```ts theme={null} await corsair.datadog.api.monitors.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `sort` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `monitors` | `object[]` | No | — | | `metadata` | `object` | No | — | > **monitors full type** > > ```ts theme={null} > { > id?: number, > name?: string, > type?: string, > query?: string, > message?: string, > tags?: string[], > priority?: number | null, > overall_state?: string, > created?: string, > modified?: string, > creator?: { > name?: string | null, > email?: string, > handle?: string > }, > options?: { > } > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_count?: number, > per_page?: number > } > ``` *** ### unmute `monitors.unmute` Unmute a monitor **Risk:** `write` ```ts theme={null} await corsair.datadog.api.monitors.unmute({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `monitorId` | `number` | Yes | — | | `scope` | `string` | No | — | | `allScopes` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `query` | `string` | No | — | | `message` | `string` | No | — | | `tags` | `string[]` | No | — | | `priority` | `number` | No | — | | `overall_state` | `string` | No | — | | `created` | `string` | No | — | | `modified` | `string` | No | — | | `creator` | `object` | No | — | | `options` | `object` | No | — | > **creator full type** > > ```ts theme={null} > { > name?: string | null, > email?: string, > handle?: string > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` *** ### update `monitors.update` Update a monitor **Risk:** `write` ```ts theme={null} await corsair.datadog.api.monitors.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `monitorId` | `number` | Yes | — | | `name` | `string` | No | — | | `query` | `string` | No | — | | `message` | `string` | No | — | | `tags` | `string[]` | No | — | | `priority` | `number` | No | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `query` | `string` | No | — | | `message` | `string` | No | — | | `tags` | `string[]` | No | — | | `priority` | `number` | No | — | | `overall_state` | `string` | No | — | | `created` | `string` | No | — | | `modified` | `string` | No | — | | `creator` | `object` | No | — | | `options` | `object` | No | — | > **creator full type** > > ```ts theme={null} > { > name?: string | null, > email?: string, > handle?: string > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` *** ## Roles ### list `roles.list` List roles **Risk:** `read` ```ts theme={null} await corsair.datadog.api.roles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageNumber` | `number` | No | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > type?: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Services ### listDefinitions `services.listDefinitions` List APM service definitions **Risk:** `read` ```ts theme={null} await corsair.datadog.api.services.listDefinitions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageNumber` | `number` | No | — | | `schemaVersion` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id?: string, > attributes?: { > } > }[] > ``` *** ## Slos ### create `slos.create` Create an SLO **Risk:** `write` ```ts theme={null} await corsair.datadog.api.slos.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `metric \| monitor` | Yes | — | | `thresholds` | `object[]` | Yes | — | | `description` | `string` | No | — | | `tags` | `string[]` | No | — | | `monitorIds` | `number[]` | No | — | | `query` | `object` | No | — | > **thresholds full type** > > ```ts theme={null} > { > timeframe: string, > target: number, > warning?: number > }[] > ``` > **query full type** > > ```ts theme={null} > { > numerator: string, > denominator: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `error` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > type?: string, > description?: string | null, > tags?: string[], > thresholds?: { > timeframe: string, > target: number, > warning?: number > }[], > monitor_ids?: number[], > query?: { > numerator?: string, > denominator?: string > }, > created_at?: number, > modified_at?: number > }[] > ``` *** ### list `slos.list` List SLOs **Risk:** `read` ```ts theme={null} await corsair.datadog.api.slos.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string` | No | — | | `query` | `string` | No | — | | `tagsQuery` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `metadata` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > type?: string, > description?: string | null, > tags?: string[], > thresholds?: { > timeframe: string, > target: number, > warning?: number > }[], > monitor_ids?: number[], > query?: { > numerator?: string, > denominator?: string > }, > created_at?: number, > modified_at?: number > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > page?: { > total_count?: number, > total_filtered_count?: number > } > } > ``` *** ## Spans ### aggregate `spans.aggregate` Aggregate APM span analytics **Risk:** `read` ```ts theme={null} await corsair.datadog.api.spans.aggregate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `from` | `string` | Yes | — | | `to` | `string` | Yes | — | | `aggregation` | `string` | Yes | — | | `metric` | `string` | No | — | | `groupBy` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > attributes?: { > } > } | { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### search `spans.search` Search APM spans **Risk:** `read` ```ts theme={null} await corsair.datadog.api.spans.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `from` | `string` | Yes | — | | `to` | `string` | Yes | — | | `sort` | `string` | No | — | | `pageLimit` | `number` | No | — | | `pageCursor` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data?: { > id?: string, > type?: string, > attributes?: { > } > }[], > meta?: { > page?: { > total_count?: number, > total_filtered_count?: number, > after?: string > } > } > }& { > links?: { > } > } > ``` *** ## Synthetics ### createApiTest `synthetics.createApiTest` Create a synthetic API test **Risk:** `write` ```ts theme={null} await corsair.datadog.api.synthetics.createApiTest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `config` | `object` | Yes | — | | `locations` | `string[]` | Yes | — | | `options` | `object` | Yes | — | | `message` | `string` | No | — | | `tags` | `string[]` | No | — | | `subtype` | `string` | No | — | > **config full type** > > ```ts theme={null} > { > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `public_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `subtype` | `string` | No | — | | `status` | `string` | No | — | | `tags` | `string[]` | No | — | | `locations` | `string[]` | No | — | | `config` | `object` | No | — | | `options` | `object` | No | — | | `message` | `string` | No | — | > **config full type** > > ```ts theme={null} > { > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` *** ### getApiTest `synthetics.getApiTest` Get a synthetic API test **Risk:** `read` ```ts theme={null} await corsair.datadog.api.synthetics.getApiTest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `publicId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `public_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `subtype` | `string` | No | — | | `status` | `string` | No | — | | `tags` | `string[]` | No | — | | `locations` | `string[]` | No | — | | `config` | `object` | No | — | | `options` | `object` | No | — | | `message` | `string` | No | — | > **config full type** > > ```ts theme={null} > { > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` *** ### listLocations `synthetics.listLocations` List synthetic test locations **Risk:** `read` ```ts theme={null} await corsair.datadog.api.synthetics.listLocations({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `locations` | `object[]` | No | — | > **locations full type** > > ```ts theme={null} > { > id?: string, > name?: string, > display_name?: string, > region?: string > }[] > ``` *** ### listTests `synthetics.listTests` List synthetic tests **Risk:** `read` ```ts theme={null} await corsair.datadog.api.synthetics.listTests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageNumber` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tests` | `object[]` | No | — | > **tests full type** > > ```ts theme={null} > { > public_id?: string, > name?: string, > type?: string, > subtype?: string, > status?: string, > tags?: string[], > locations?: string[], > config?: { > }, > options?: { > }, > message?: string > }[] > ``` *** ## Tags ### getHost `tags.getHost` Get tags for a host **Risk:** `read` ```ts theme={null} await corsair.datadog.api.tags.getHost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hostName` | `string` | Yes | — | | `source` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | No | — | | `tags` | `string[]` | No | — | *** ### list `tags.list` List host tags **Risk:** `read` ```ts theme={null} await corsair.datadog.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `source` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### updateHost `tags.updateHost` Replace tags for a host **Risk:** `write` ```ts theme={null} await corsair.datadog.api.tags.updateHost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hostName` | `string` | Yes | — | | `tags` | `string[]` | Yes | — | | `source` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | No | — | | `tags` | `string[]` | No | — | *** ## Usage ### getSummary `usage.getSummary` Get usage summary across products **Risk:** `read` ```ts theme={null} await corsair.datadog.api.usage.getSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `startMonth` | `string` | Yes | — | | `endMonth` | `string` | No | — | | `includeOrgDetails` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `usage` | `object[]` | No | — | > **usage full type** > > ```ts theme={null} > { > }[] > ``` *** ## Users ### list `users.list` List organization users **Risk:** `read` ```ts theme={null} await corsair.datadog.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageNumber` | `number` | No | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > type?: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ## Webhooks ### create `webhooks.create` Create a webhook integration **Risk:** `write` ```ts theme={null} await corsair.datadog.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | | `payload` | `string` | No | — | | `customHeaders` | `string` | No | — | | `encodeAs` | `json \| form` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `url` | `string` | No | — | | `payload` | `string` | No | — | | `custom_headers` | `string` | No | — | | `encode_as` | `string` | No | — | *** ### get `webhooks.get` Get a webhook integration by name **Risk:** `read` ```ts theme={null} await corsair.datadog.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `url` | `string` | No | — | | `payload` | `string` | No | — | | `custom_headers` | `string` | No | — | | `encode_as` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/datadog/database Datadog local sync: searchable entities, `.search()` filters, and operators. The Datadog plugin syncs data locally. Use `corsair.datadog.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Dashboards Path: `datadog.db.dashboards.search` ```ts theme={null} const rows = await corsair.datadog.db.dashboards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `layoutType` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `authorHandle` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Incidents Path: `datadog.db.incidents.search` ```ts theme={null} const rows = await corsair.datadog.db.incidents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Monitors Path: `datadog.db.monitors.search` ```ts theme={null} const rows = await corsair.datadog.db.monitors.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `overallState` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Slos Path: `datadog.db.slos.search` ```ts theme={null} const rows = await corsair.datadog.db.slos.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/datadog/overview Monitoring and observability platform for metrics, logs, traces, and infrastructure alerts. Use **Datadog** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 45 typed API operations * 4 synced entities (`dashboards`, `incidents`, `monitors`, `slos`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/datadog ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/datadog ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/datadog ``` ```bash bun theme={null} bun add corsair @corsair-dev/datadog ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { datadog } from '@corsair-dev/datadog'; export const corsair = createCorsair({ plugins: [ datadog(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} datadog() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'datadog', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`apiKeys.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.datadog.api.apiKeys.list({}); ``` **`dashboards.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.datadog.api.dashboards.create({}); ``` See the full list on the [API](/plugins/datadog/api) page. ## Query synced data Synced entities support `tenant.datadog.db..search()` and `.list()`: `dashboards`, `incidents`, `monitors`, `slos`. See [Database](/plugins/datadog/database) for filters and operators. ## What's next > **[API reference](/plugins/datadog/api)** > > Every `datadog.api.*` operation with input and output types. > **[Database](/plugins/datadog/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/dataforseo/api API reference for DataForSeo: every `dataforseo.api.*` operation with input and output types. Every `dataforseo.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### userData `account.userData` Get the account login, balance, and subscription expiry dates (free) **Risk:** `read` ```ts theme={null} await corsair.dataforseo.api.account.userData({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > login: string, > timezone?: string | null, > money?: { > total?: number | null, > balance?: number | null > } | null, > backlinks_subscription_expiry_date?: string | null, > llm_mentions_subscription_expiry_date?: string | null > }[] | null > }[] > ``` *** ## Ai ### chatgptResponse `ai.chatgptResponse` Get a ChatGPT model response to a prompt, with web sources when web search is on **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.ai.chatgptResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_prompt` | `string` | Yes | — | | `model_name` | `string` | Yes | Model name, e.g. gpt-4.1; see the provider models endpoint | | `max_output_tokens` | `number` | No | — | | `top_p` | `number` | No | — | | `system_message` | `string` | No | — | | `message_chain` | `object[]` | No | — | | `tag` | `string` | No | — | | `temperature` | `number` | No | — | | `web_search` | `boolean` | No | — | | `force_web_search` | `boolean` | No | — | | `web_search_country_iso_code` | `string` | No | — | | `web_search_city` | `string` | No | — | > **message\_chain full type** > > ```ts theme={null} > { > role: user | ai, > message: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > model_name?: string | null, > input_tokens?: number | null, > output_tokens?: number | null, > reasoning_tokens?: number | null, > web_search?: boolean | null, > money_spent?: number | null, > datetime?: string | null, > items?: { > type: message | reasoning, > sections?: { > type?: string | null, > text?: string | null, > annotations?: { > title?: string | null, > url?: string | null, > direct_url?: string | null, > start_index?: number | null, > end_index?: number | null, > text?: string | null > }[] | null > }[] | null > }[] | null, > fan_out_queries?: string[] | { > } | null > }[] | null > }[] > ``` *** ### geminiResponse `ai.geminiResponse` Get a Gemini model response to a prompt **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.ai.geminiResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_prompt` | `string` | Yes | — | | `model_name` | `string` | Yes | Model name, e.g. gpt-4.1; see the provider models endpoint | | `max_output_tokens` | `number` | No | — | | `top_p` | `number` | No | — | | `system_message` | `string` | No | — | | `message_chain` | `object[]` | No | — | | `tag` | `string` | No | — | | `temperature` | `number` | No | — | | `web_search` | `boolean` | No | — | | `use_reasoning` | `boolean` | No | — | > **message\_chain full type** > > ```ts theme={null} > { > role: user | ai, > message: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > model_name?: string | null, > input_tokens?: number | null, > output_tokens?: number | null, > reasoning_tokens?: number | null, > web_search?: boolean | null, > money_spent?: number | null, > datetime?: string | null, > items?: { > type: message | reasoning, > sections?: { > type?: string | null, > text?: string | null, > annotations?: { > title?: string | null, > url?: string | null, > direct_url?: string | null, > start_index?: number | null, > end_index?: number | null, > text?: string | null > }[] | null > }[] | null > }[] | null, > fan_out_queries?: string[] | { > } | null > }[] | null > }[] > ``` *** ### mentionsSearch `ai.mentionsSearch` Search AI answers (ChatGPT, Google AI) that mention a domain or keyword **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.ai.mentionsSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target` | `object[]` | Yes | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `platform` | `chat_gpt \| google` | No | — | | `filters` | `lazy` | No | — | | `order_by` | `string[]` | No | — | | `limit` | `number` | No | — | | `tag` | `string` | No | — | | `offset` | `number` | No | — | | `search_after_token` | `string` | No | — | > **target full type** > > ```ts theme={null} > ( > { > domain: string, > include_subdomains?: boolean > } | { > keyword: string, > match_type?: word_match | partial_match > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > total_count?: number | null, > offset?: number | null, > search_after_token?: string | null, > items_count?: number | null, > items?: { > platform?: string | null, > model_name?: string | null, > location_code?: number | null, > language_code?: string | null, > question?: string | null, > answer?: string | null, > sources?: { > rank?: number | null, > title?: string | null, > domain?: string | null, > url?: string | null, > publication_date?: string | null, > snippet?: string | null, > source_name?: string | null, > thumbnail?: string | null, > markdown?: string | null > }[] | null, > search_results?: { > rank?: number | null, > title?: string | null, > domain?: string | null, > url?: string | null, > publication_date?: string | null, > description?: string | null, > breadcrumb?: string | null > }[] | null, > ai_search_volume?: number | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null, > first_response_at?: string | null, > last_response_at?: string | null, > brand_entities?: { > rank?: number | null, > title?: string | null, > category?: string | null > }[] | null, > fan_out_queries?: string[] | null, > is_web_search_based?: boolean | null > }[] | null > }[] | null > }[] > ``` *** ### mentionsTopDomains `ai.mentionsTopDomains` Rank the domains cited most in AI answers about a domain or keyword **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.ai.mentionsTopDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target` | `object[]` | Yes | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `platform` | `chat_gpt \| google` | No | — | | `filters` | `lazy` | No | — | | `order_by` | `string[]` | No | — | | `limit` | `number` | No | — | | `tag` | `string` | No | — | | `offset` | `number` | No | — | | `links_scope` | `sources \| search_results` | No | — | | `initial_dataset_filters` | `lazy` | No | — | | `internal_list_limit` | `number` | No | — | | `include_domains` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | > **target full type** > > ```ts theme={null} > ( > { > domain: string, > include_subdomains?: boolean > } | { > keyword: string, > match_type?: word_match | partial_match > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > total_count?: number | null, > offset?: number | null, > items_count?: number | null, > aggregated_metrics?: { > location?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > language?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > platform?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > sources_domain?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > search_results_domain?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > brand_entities_title?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > brand_entities_category?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > total?: { > mentions?: number | null, > ai_search_volume?: number | null > } | null > } | null, > items?: { > domain?: string | null, > location?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > language?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > platform?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > sources_domain?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > search_results_domain?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > brand_entities_title?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > brand_entities_category?: { > key?: string | null, > mentions?: number | null, > ai_search_volume?: number | null > }[] | null, > total?: { > mentions?: number | null, > ai_search_volume?: number | null > } | null > }[] | null > }[] | null > }[] > ``` *** ### perplexityResponse `ai.perplexityResponse` Get a Perplexity model response to a prompt, with cited sources **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.ai.perplexityResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_prompt` | `string` | Yes | — | | `model_name` | `string` | Yes | Model name, e.g. gpt-4.1; see the provider models endpoint | | `max_output_tokens` | `number` | No | — | | `top_p` | `number` | No | — | | `system_message` | `string` | No | — | | `message_chain` | `object[]` | No | — | | `tag` | `string` | No | — | | `temperature` | `number` | No | — | | `web_search_country_iso_code` | `string` | No | — | > **message\_chain full type** > > ```ts theme={null} > { > role: user | ai, > message: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > model_name?: string | null, > input_tokens?: number | null, > output_tokens?: number | null, > reasoning_tokens?: number | null, > web_search?: boolean | null, > money_spent?: number | null, > datetime?: string | null, > items?: { > type: message | reasoning, > sections?: { > type?: string | null, > text?: string | null, > annotations?: { > title?: string | null, > url?: string | null, > direct_url?: string | null, > start_index?: number | null, > end_index?: number | null, > text?: string | null > }[] | null > }[] | null > }[] | null, > fan_out_queries?: string[] | { > } | null > }[] | null > }[] > ``` *** ## Amazon ### asin `amazon.asin` Get an Amazon product page by ASIN: price, rating, details, and top reviews **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.amazon.asin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `asin` | `string` | Yes | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `location_coordinate` | `string` | No | — | | `se_domain` | `string` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > asin?: string | null, > type?: string | null, > se_domain?: string | null, > location_code?: number | null, > language_code?: string | null, > check_url?: string | null, > datetime?: string | null, > item_types?: string[] | null, > items_count?: number | null, > items?: { > type?: string | null, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > xpath?: string | null, > title?: string | null, > details?: string | null, > image_url?: string | null, > author?: string | null, > data_asin?: string | null, > parent_asin?: string | null, > product_asins?: string[] | null, > price_from?: number | null, > price_to?: number | null, > percentage_discount?: string | null, > currency?: string | null, > is_amazon_choice?: boolean | null, > rating?: { > type?: string | null, > position?: string | null, > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > is_newer_model_available?: boolean | null, > is_prime_video?: boolean | null, > newer_model?: { > title?: string | null, > newer_model_asin?: string | null > } | null, > categories?: { > category?: string | null, > url?: string | null > }[] | null, > product_information?: ( > { > type: product_information_details_item, > section_name?: string | null, > body?: { > } | null > } | { > type: product_information_text_item, > section_name?: string | null, > text?: string | null > } | { > type: product_information_extended_item, > section_name?: string | null, > contents?: { > type?: string | null, > title?: string | null, > rows?: { > type?: string | null, > text?: string | null, > alt?: string | null, > url?: string | null > }[] | null > }[] | null > } > )[] | null, > product_images_list?: string[] | null, > product_videos_list?: string[] | null, > description?: string | null, > is_available?: boolean | null, > top_local_reviews?: { > type?: string | null, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > xpath?: string | null, > verified?: boolean | null, > subtitle?: string | null, > helpful_votes?: string | null, > images?: { > type?: string | null, > alt?: string | null, > url?: string | null, > image_url?: string | null > }[] | null, > videos?: { > type?: string | null, > source?: string | null, > preview?: string | null, > title?: string | null, > timestamp?: string | null, > url?: string | null > }[] | null, > user_profile?: { > name?: string | null, > avatar?: string | null, > url?: string | null, > reviews_count?: number | null, > locations?: string | null > } | null, > title?: string | null, > url?: string | null, > review_text?: string | null, > publication_date?: string | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null > }[] | null, > top_global_reviews?: { > type?: string | null, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > xpath?: string | null, > verified?: boolean | null, > subtitle?: string | null, > helpful_votes?: string | null, > images?: { > type?: string | null, > alt?: string | null, > url?: string | null, > image_url?: string | null > }[] | null, > videos?: { > type?: string | null, > source?: string | null, > preview?: string | null, > title?: string | null, > timestamp?: string | null, > url?: string | null > }[] | null, > user_profile?: { > name?: string | null, > avatar?: string | null, > url?: string | null, > reviews_count?: number | null, > locations?: string | null > } | null, > title?: string | null, > url?: string | null, > review_text?: string | null, > publication_date?: string | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null > }[] | null > }[] | null > }[] | null > }[] > ``` *** ### products `amazon.products` Get live Amazon search results for a keyword **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.amazon.products({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyword` | `string` | Yes | — | | `url` | `string` | No | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `location_coordinate` | `string` | No | — | | `se_domain` | `string` | No | — | | `tag` | `string` | No | — | | `depth` | `number` | No | — | | `max_crawl_pages` | `number` | No | — | | `department` | `string` | No | — | | `search_param` | `string` | No | — | | `price_min` | `number` | No | — | | `price_max` | `number` | No | — | | `sort_by` | `relevance \| price_low_to_high \| price_high_to_low \| featured \| avg_customer_review \| newest_arrival` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > keyword?: string | null, > type?: string | null, > se_domain?: string | null, > location_code?: number | null, > language_code?: string | null, > check_url?: string | null, > datetime?: string | null, > spell?: { > keyword?: string | null, > type?: string | null > } | null, > item_types?: string[] | null, > se_results_count?: number | null, > categories?: { > } | null, > items_count?: number | null, > items?: ( > { > type: amazon_serp, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > xpath?: string | null, > domain?: string | null, > title?: string | null, > url?: string | null, > image_url?: string | null, > bought_past_month?: number | null, > price_from?: number | null, > price_to?: number | null, > currency?: string | null, > special_offers?: string[] | null, > data_asin?: string | null, > rating?: { > type?: string | null, > position?: string | null, > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > is_amazon_choice?: boolean | null, > is_best_seller?: boolean | null, > delivery_info?: { > delivery_message?: string | null, > delivery_date_from?: string | null, > delivery_date_to?: string | null, > fastest_delivery_date_from?: string | null, > fastest_delivery_date_to?: string | null, > delivery_price?: { > current?: number | null, > regular?: number | null, > max_value?: number | null, > currency?: string | null, > is_price_range?: boolean | null, > displayed_price?: string | null > } | null > } | null, > labels?: { > type?: string | null, > title?: string | null, > url?: string | null, > domain?: string | null > }[] | null > } | { > type: amazon_paid, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > xpath?: string | null, > domain?: string | null, > title?: string | null, > url?: string | null, > image_url?: string | null, > bought_past_month?: number | null, > price_from?: number | null, > price_to?: number | null, > currency?: string | null, > special_offers?: string[] | null, > data_asin?: string | null, > rating?: { > type?: string | null, > position?: string | null, > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > is_amazon_choice?: boolean | null, > is_best_seller?: boolean | null, > delivery_info?: { > delivery_message?: string | null, > delivery_date_from?: string | null, > delivery_date_to?: string | null, > fastest_delivery_date_from?: string | null, > fastest_delivery_date_to?: string | null, > delivery_price?: { > current?: number | null, > regular?: number | null, > max_value?: number | null, > currency?: string | null, > is_price_range?: boolean | null, > displayed_price?: string | null > } | null > } | null, > labels?: { > type?: string | null, > title?: string | null, > url?: string | null, > domain?: string | null > }[] | null > } | { > type: editorial_recommendations, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > xpath?: string | null, > items?: { > type?: string | null, > xpath?: string | null, > domain?: string | null, > title?: string | null, > url?: string | null, > image_url?: string | null, > bought_past_month?: number | null, > price_from?: number | null, > price_to?: number | null, > currency?: string | null, > special_offers?: string[] | null, > data_asin?: string | null, > rating?: { > type?: string | null, > position?: string | null, > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > is_amazon_choice?: boolean | null, > is_best_seller?: boolean | null, > delivery_info?: { > delivery_message?: string | null, > delivery_date_from?: string | null, > delivery_date_to?: string | null, > fastest_delivery_date_from?: string | null, > fastest_delivery_date_to?: string | null, > delivery_price?: { > current?: number | null, > regular?: number | null, > max_value?: number | null, > currency?: string | null, > is_price_range?: boolean | null, > displayed_price?: string | null > } | null > } | null, > labels?: { > type?: string | null, > title?: string | null, > url?: string | null, > domain?: string | null > }[] | null > }[] | null > } | { > type: top_rated_from_our_brands, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > xpath?: string | null, > items?: { > type?: string | null, > xpath?: string | null, > domain?: string | null, > title?: string | null, > url?: string | null, > image_url?: string | null, > bought_past_month?: number | null, > price_from?: number | null, > price_to?: number | null, > currency?: string | null, > special_offers?: string[] | null, > data_asin?: string | null, > rating?: { > type?: string | null, > position?: string | null, > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > is_amazon_choice?: boolean | null, > is_best_seller?: boolean | null, > delivery_info?: { > delivery_message?: string | null, > delivery_date_from?: string | null, > delivery_date_to?: string | null, > fastest_delivery_date_from?: string | null, > fastest_delivery_date_to?: string | null, > delivery_price?: { > current?: number | null, > regular?: number | null, > max_value?: number | null, > currency?: string | null, > is_price_range?: boolean | null, > displayed_price?: string | null > } | null > } | null, > labels?: { > type?: string | null, > title?: string | null, > url?: string | null, > domain?: string | null > }[] | null > }[] | null > } | { > type: related_searches, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > xpath?: string | null, > items?: { > type?: string | null, > title?: string | null, > url?: string | null, > image_alt?: string | null, > image_url?: string | null > }[] | null > } > )[] | null > }[] | null > }[] > ``` *** ## App Store ### infoResult `appStore.infoResult` Get the results of an App Store app info task by task id **Risk:** `read` ```ts theme={null} await corsair.dataforseo.api.appStore.infoResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > app_id?: string | null, > se_domain?: string | null, > location_code?: number | null, > language_code?: string | null, > check_url?: string | null, > datetime?: string | null, > se_results_count?: number | null, > items_count?: number | null, > items?: { > type?: string | null, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > app_id?: string | null, > title?: string | null, > url?: string | null, > icon?: string | null, > reviews_count?: number | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > price?: { > current?: number | null, > regular?: number | null, > max_value?: number | null, > currency?: string | null, > is_price_range?: boolean | null, > displayed_price?: string | null > } | null, > is_free?: boolean | null, > subtitle?: string | null, > description?: string | null, > main_category?: string | null, > categories?: string[] | null, > languages?: string[] | null, > advisories?: string[] | null, > developer?: string | null, > developer_id?: string | null, > developer_url?: string | null, > version?: string | null, > minimum_os_version?: string | null, > size?: string | null, > released_date?: string | null, > last_update_date?: string | null, > update_notes?: string | null, > images?: string[] | null, > similar_apps?: { > app_id?: string | null, > title?: string | null, > url?: string | null > }[] | null, > more_apps_by_developer?: { > app_id?: string | null, > title?: string | null, > url?: string | null > }[] | null > }[] | null > }[] | null > }[] > ``` *** ### infoTask `appStore.infoTask` Post an App Store app info task; fetch it with appStore.infoResult **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.appStore.infoTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `string` | Yes | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `priority` | `1 \| 2` | No | — | | `postback_url` | `string` | No | — | | `postback_data` | `advanced` | No | — | | `pingback_url` | `string` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > }[] | null > }[] > ``` *** ### reviewsResult `appStore.reviewsResult` Get the results of an App Store reviews task by task id **Risk:** `read` ```ts theme={null} await corsair.dataforseo.api.appStore.reviewsResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > app_id?: string | null, > type?: string | null, > title?: string | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > reviews_count?: number | null, > se_domain?: string | null, > location_code?: number | null, > language_code?: string | null, > check_url?: string | null, > datetime?: string | null, > se_results_count?: number | null, > items_count?: number | null, > items?: { > type?: string | null, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > id?: string | null, > version?: string | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > timestamp?: string | null, > title?: string | null, > review_text?: string | null, > user_profile?: { > profile_name?: string | null, > profile_image_url?: string | null > } | null > }[] | null > }[] | null > }[] > ``` *** ### reviewsTask `appStore.reviewsTask` Post an App Store reviews task; fetch it with appStore.reviewsResult **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.appStore.reviewsTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `string` | Yes | — | | `depth` | `number` | No | — | | `sort_by` | `most_recent \| most_helpful` | No | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `priority` | `1 \| 2` | No | — | | `postback_url` | `string` | No | — | | `postback_data` | `advanced` | No | — | | `pingback_url` | `string` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > }[] | null > }[] > ``` *** ### searchResult `appStore.searchResult` Get the results of an App Store search task by task id **Risk:** `read` ```ts theme={null} await corsair.dataforseo.api.appStore.searchResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > keyword?: string | null, > se_domain?: string | null, > location_code?: number | null, > language_code?: string | null, > check_url?: string | null, > datetime?: string | null, > se_results_count?: number | null, > items_count?: number | null, > items?: { > type?: string | null, > rank_group?: number | null, > rank_absolute?: number | null, > position?: string | null, > app_id?: string | null, > title?: string | null, > url?: string | null, > icon?: string | null, > reviews_count?: number | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > price?: { > current?: number | null, > regular?: number | null, > max_value?: number | null, > currency?: string | null, > is_price_range?: boolean | null, > displayed_price?: string | null > } | null, > is_free?: boolean | null > }[] | null > }[] | null > }[] > ``` *** ### searchTask `appStore.searchTask` Post an App Store search task; fetch it with appStore.searchResult **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.appStore.searchTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyword` | `string` | Yes | — | | `depth` | `number` | No | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `priority` | `1 \| 2` | No | — | | `postback_url` | `string` | No | — | | `postback_data` | `advanced` | No | — | | `pingback_url` | `string` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > }[] | null > }[] > ``` *** ## Backlinks ### anchors `backlinks.anchors` List anchor texts used in links to a target **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.backlinks.anchors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target` | `string` | Yes | Domain or subdomain without https\:// and [www](http://www)., or an absolute page URL | | `rank_scale` | `one_hundred \| one_thousand` | No | — | | `tag` | `string` | No | — | | `include_subdomains` | `boolean` | No | — | | `exclude_internal_backlinks` | `boolean` | No | — | | `backlinks_status_type` | `all \| live \| lost` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `filters` | `lazy` | No | — | | `order_by` | `string[]` | No | — | | `include_indirect_links` | `boolean` | No | — | | `internal_list_limit` | `number` | No | — | | `backlinks_filters` | `lazy` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > target?: string | null, > total_count?: number | null, > items_count?: number | null, > items?: { > type?: string | null, > anchor?: string | null, > rank?: number | null, > backlinks?: number | null, > first_seen?: string | null, > lost_date?: string | null, > backlinks_spam_score?: number | null, > broken_backlinks?: number | null, > broken_pages?: number | null, > referring_domains?: number | null, > referring_domains_nofollow?: number | null, > referring_main_domains?: number | null, > referring_main_domains_nofollow?: number | null, > referring_ips?: number | null, > referring_subnets?: number | null, > referring_pages?: number | null, > referring_pages_nofollow?: number | null, > referring_links_tld?: { > } | null, > referring_links_types?: { > } | null, > referring_links_attributes?: { > } | null, > referring_links_platform_types?: { > } | null, > referring_links_semantic_locations?: { > } | null, > referring_links_countries?: { > } | null > }[] | null > }[] | null > }[] > ``` *** ### bulkRanks `backlinks.bulkRanks` Get the rank of up to 1000 domains, subdomains, or pages **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.backlinks.bulkRanks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `targets` | `string[]` | Yes | — | | `rank_scale` | `one_hundred \| one_thousand` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > items_count?: number | null, > items?: { > target?: string | null, > rank?: number | null > }[] | null > }[] | null > }[] > ``` *** ### competitors `backlinks.competitors` Find domains that share backlinks with a target **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.backlinks.competitors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target` | `string` | Yes | Domain or subdomain without https\:// and [www](http://www)., or an absolute page URL | | `rank_scale` | `one_hundred \| one_thousand` | No | — | | `tag` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `filters` | `lazy` | No | — | | `order_by` | `string[]` | No | — | | `main_domain` | `boolean` | No | — | | `exclude_large_domains` | `boolean` | No | — | | `exclude_internal_backlinks` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > total_count?: number | null, > items_count?: number | null, > items?: { > type?: string | null, > target?: string | null, > rank?: number | null, > intersections?: number | null > }[] | null > }[] | null > }[] > ``` *** ### list `backlinks.list` List backlinks pointing to a target **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.backlinks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target` | `string` | Yes | Domain or subdomain without https\:// and [www](http://www)., or an absolute page URL | | `rank_scale` | `one_hundred \| one_thousand` | No | — | | `tag` | `string` | No | — | | `include_subdomains` | `boolean` | No | — | | `exclude_internal_backlinks` | `boolean` | No | — | | `backlinks_status_type` | `all \| live \| lost` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `filters` | `lazy` | No | — | | `order_by` | `string[]` | No | — | | `search_after_token` | `string` | No | — | | `mode` | `as_is \| one_per_domain \| one_per_anchor` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > target?: string | null, > mode?: string | null, > search_after_token?: string | null, > total_count?: number | null, > items_count?: number | null, > items?: { > type?: string | null, > domain_from?: string | null, > url_from?: string | null, > url_from_https?: boolean | null, > domain_to?: string | null, > url_to?: string | null, > url_to_https?: boolean | null, > tld_from?: string | null, > is_new?: boolean | null, > is_lost?: boolean | null, > backlink_spam_score?: number | null, > rank?: number | null, > page_from_rank?: number | null, > domain_from_rank?: number | null, > domain_from_platform_type?: string[] | null, > domain_from_is_ip?: boolean | null, > domain_from_ip?: string | null, > domain_from_country?: string | null, > page_from_external_links?: number | null, > page_from_internal_links?: number | null, > page_from_size?: number | null, > page_from_encoding?: string | null, > page_from_language?: string | null, > page_from_title?: string | null, > page_from_status_code?: number | null, > first_seen?: string | null, > prev_seen?: string | null, > last_seen?: string | null, > item_type?: string | null, > attributes?: string[] | null, > dofollow?: boolean | null, > original?: boolean | null, > alt?: string | null, > image_url?: string | null, > anchor?: string | null, > text_pre?: string | null, > text_post?: string | null, > semantic_location?: string | null, > links_count?: number | null, > group_count?: number | null, > is_broken?: boolean | null, > url_to_status_code?: number | null, > url_to_spam_score?: number | null, > url_to_redirect_target?: string | null, > is_indirect_link?: boolean | null, > indirect_link_path?: { > type?: string | null, > status_code?: number | null, > url?: string | null > }[] | null, > ranked_keywords_info?: { > page_from_keywords_count_top_3?: number | null, > page_from_keywords_count_top_10?: number | null, > page_from_keywords_count_top_100?: number | null > } | null > }[] | null > }[] | null > }[] > ``` *** ### referringDomains `backlinks.referringDomains` List domains linking to a target with per-domain link metrics **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.backlinks.referringDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target` | `string` | Yes | Domain or subdomain without https\:// and [www](http://www)., or an absolute page URL | | `rank_scale` | `one_hundred \| one_thousand` | No | — | | `tag` | `string` | No | — | | `include_subdomains` | `boolean` | No | — | | `exclude_internal_backlinks` | `boolean` | No | — | | `backlinks_status_type` | `all \| live \| lost` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `filters` | `lazy` | No | — | | `order_by` | `string[]` | No | — | | `include_indirect_links` | `boolean` | No | — | | `internal_list_limit` | `number` | No | — | | `backlinks_filters` | `lazy` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > target?: string | null, > total_count?: number | null, > items_count?: number | null, > items?: { > type?: string | null, > domain?: string | null, > rank?: number | null, > backlinks?: number | null, > first_seen?: string | null, > lost_date?: string | null, > backlinks_spam_score?: number | null, > broken_backlinks?: number | null, > broken_pages?: number | null, > referring_domains?: number | null, > referring_domains_nofollow?: number | null, > referring_main_domains?: number | null, > referring_main_domains_nofollow?: number | null, > referring_ips?: number | null, > referring_subnets?: number | null, > referring_pages?: number | null, > referring_pages_nofollow?: number | null, > referring_links_tld?: { > } | null, > referring_links_types?: { > } | null, > referring_links_attributes?: { > } | null, > referring_links_platform_types?: { > } | null, > referring_links_semantic_locations?: { > } | null, > referring_links_countries?: { > } | null > }[] | null > }[] | null > }[] > ``` *** ### summary `backlinks.summary` Get a backlink profile summary for a domain, subdomain, or page **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.backlinks.summary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target` | `string` | Yes | Domain or subdomain without https\:// and [www](http://www)., or an absolute page URL | | `rank_scale` | `one_hundred \| one_thousand` | No | — | | `tag` | `string` | No | — | | `include_subdomains` | `boolean` | No | — | | `exclude_internal_backlinks` | `boolean` | No | — | | `backlinks_status_type` | `all \| live \| lost` | No | — | | `include_indirect_links` | `boolean` | No | — | | `internal_list_limit` | `number` | No | — | | `backlinks_filters` | `lazy` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > target?: string | null, > crawled_pages?: number | null, > internal_links_count?: number | null, > external_links_count?: number | null, > info?: { > server?: string | null, > cms?: string | null, > platform_type?: string[] | null, > ip_address?: string | null, > country?: string | null, > is_ip?: boolean | null, > target_spam_score?: number | null > } | null, > rank?: number | null, > backlinks?: number | null, > first_seen?: string | null, > lost_date?: string | null, > backlinks_spam_score?: number | null, > broken_backlinks?: number | null, > broken_pages?: number | null, > referring_domains?: number | null, > referring_domains_nofollow?: number | null, > referring_main_domains?: number | null, > referring_main_domains_nofollow?: number | null, > referring_ips?: number | null, > referring_subnets?: number | null, > referring_pages?: number | null, > referring_pages_nofollow?: number | null, > referring_links_tld?: { > } | null, > referring_links_types?: { > } | null, > referring_links_attributes?: { > } | null, > referring_links_platform_types?: { > } | null, > referring_links_semantic_locations?: { > } | null, > referring_links_countries?: { > } | null > }[] | null > }[] > ``` *** ## Keywords ### ideas `keywords.ideas` Get keyword ideas related to up to 200 seed keywords **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.keywords.ideas({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keywords` | `string[]` | Yes | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `closely_variants` | `boolean` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `offset_token` | `string` | No | — | | `filters` | `lazy` | No | — | | `order_by` | `string[]` | No | — | | `include_serp_info` | `boolean` | No | — | | `include_clickstream_data` | `boolean` | No | — | | `ignore_synonyms` | `boolean` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > seed_keywords?: string[] | null, > se_type?: string | null, > location_code?: number | null, > language_code?: string | null, > total_count?: number | null, > items_count?: number | null, > offset?: number | null, > offset_token?: string | null, > items?: { > se_type?: string | null, > keyword: string, > location_code?: number | null, > language_code?: string | null, > keyword_info?: { > se_type?: string | null, > last_updated_time?: string | null, > competition?: number | null, > competition_level?: string | null, > cpc?: number | null, > search_volume?: number | null, > low_top_of_page_bid?: number | null, > high_top_of_page_bid?: number | null, > categories?: number[] | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null, > search_volume_trend?: { > monthly?: number | null, > quarterly?: number | null, > yearly?: number | null > } | null > } | null, > keyword_info_normalized_with_bing?: { > last_updated_time?: string | null, > search_volume?: number | null, > is_normalized?: boolean | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > } | null, > keyword_info_normalized_with_clickstream?: { > last_updated_time?: string | null, > search_volume?: number | null, > is_normalized?: boolean | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > } | null, > clickstream_keyword_info?: { > search_volume?: number | null, > last_updated_time?: string | null, > gender_distribution?: { > } | null, > age_distribution?: { > } | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > } | null, > keyword_properties?: { > se_type?: string | null, > core_keyword?: string | null, > synonym_clustering_algorithm?: string | null, > keyword_difficulty?: number | null, > detected_language?: string | null, > is_another_language?: boolean | null, > words_count?: number | null > } | null, > serp_info?: { > se_type?: string | null, > check_url?: string | null, > serp_item_types?: string[] | null, > se_results_count?: number | null, > last_updated_time?: string | null, > previous_updated_time?: string | null > } | null, > avg_backlinks_info?: { > se_type?: string | null, > backlinks?: number | null, > dofollow?: number | null, > referring_pages?: number | null, > referring_domains?: number | null, > referring_main_domains?: number | null, > rank?: number | null, > main_domain_rank?: number | null, > last_updated_time?: string | null > } | null, > search_intent_info?: { > se_type?: string | null, > main_intent?: string | null, > foreign_intent?: string[] | null, > last_updated_time?: string | null > } | null > }[] | null > }[] | null > }[] > ``` *** ### locations `keywords.locations` List DataForSEO Labs locations and languages (free) **Risk:** `read` ```ts theme={null} await corsair.dataforseo.api.keywords.locations({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > location_code: number, > location_name: string, > location_code_parent?: number | null, > country_iso_code?: string | null, > location_type?: string | null, > available_languages?: { > available_sources?: string[] | null, > language_name?: string | null, > language_code?: string | null, > keywords?: number | null, > serps?: number | null > }[] | null > }[] | null > }[] > ``` *** ### searchVolume `keywords.searchVolume` Get Google Ads search volume, CPC, and competition for up to 1000 keywords **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.keywords.searchVolume({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keywords` | `string[]` | Yes | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `location_coordinate` | `string` | No | — | | `search_partners` | `boolean` | No | — | | `date_from` | `string` | No | — | | `date_to` | `string` | No | — | | `include_adult_keywords` | `boolean` | No | — | | `sort_by` | `relevance \| search_volume \| competition_index \| low_top_of_page_bid \| high_top_of_page_bid` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > keyword: string, > spell?: string | null, > location_code?: number | null, > language_code?: string | null, > search_partners?: boolean | null, > competition?: string | null, > competition_index?: number | null, > search_volume?: number | null, > low_top_of_page_bid?: number | null, > high_top_of_page_bid?: number | null, > cpc?: number | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > }[] | null > }[] > ``` *** ### suggestions `keywords.suggestions` Get keyword suggestions that contain a seed keyword, with search volume and difficulty **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.keywords.suggestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyword` | `string` | Yes | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `include_seed_keyword` | `boolean` | No | — | | `exact_match` | `boolean` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `offset_token` | `string` | No | — | | `filters` | `lazy` | No | — | | `order_by` | `string[]` | No | — | | `include_serp_info` | `boolean` | No | — | | `include_clickstream_data` | `boolean` | No | — | | `ignore_synonyms` | `boolean` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > seed_keyword?: string | null, > seed_keyword_data?: { > se_type?: string | null, > keyword: string, > location_code?: number | null, > language_code?: string | null, > keyword_info?: { > se_type?: string | null, > last_updated_time?: string | null, > competition?: number | null, > competition_level?: string | null, > cpc?: number | null, > search_volume?: number | null, > low_top_of_page_bid?: number | null, > high_top_of_page_bid?: number | null, > categories?: number[] | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null, > search_volume_trend?: { > monthly?: number | null, > quarterly?: number | null, > yearly?: number | null > } | null > } | null, > keyword_info_normalized_with_bing?: { > last_updated_time?: string | null, > search_volume?: number | null, > is_normalized?: boolean | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > } | null, > keyword_info_normalized_with_clickstream?: { > last_updated_time?: string | null, > search_volume?: number | null, > is_normalized?: boolean | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > } | null, > clickstream_keyword_info?: { > search_volume?: number | null, > last_updated_time?: string | null, > gender_distribution?: { > } | null, > age_distribution?: { > } | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > } | null, > keyword_properties?: { > se_type?: string | null, > core_keyword?: string | null, > synonym_clustering_algorithm?: string | null, > keyword_difficulty?: number | null, > detected_language?: string | null, > is_another_language?: boolean | null, > words_count?: number | null > } | null, > serp_info?: { > se_type?: string | null, > check_url?: string | null, > serp_item_types?: string[] | null, > se_results_count?: number | null, > last_updated_time?: string | null, > previous_updated_time?: string | null > } | null, > avg_backlinks_info?: { > se_type?: string | null, > backlinks?: number | null, > dofollow?: number | null, > referring_pages?: number | null, > referring_domains?: number | null, > referring_main_domains?: number | null, > rank?: number | null, > main_domain_rank?: number | null, > last_updated_time?: string | null > } | null, > search_intent_info?: { > se_type?: string | null, > main_intent?: string | null, > foreign_intent?: string[] | null, > last_updated_time?: string | null > } | null > } | null, > se_type?: string | null, > location_code?: number | null, > language_code?: string | null, > total_count?: number | null, > items_count?: number | null, > offset?: number | null, > offset_token?: string | null, > items?: { > se_type?: string | null, > keyword: string, > location_code?: number | null, > language_code?: string | null, > keyword_info?: { > se_type?: string | null, > last_updated_time?: string | null, > competition?: number | null, > competition_level?: string | null, > cpc?: number | null, > search_volume?: number | null, > low_top_of_page_bid?: number | null, > high_top_of_page_bid?: number | null, > categories?: number[] | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null, > search_volume_trend?: { > monthly?: number | null, > quarterly?: number | null, > yearly?: number | null > } | null > } | null, > keyword_info_normalized_with_bing?: { > last_updated_time?: string | null, > search_volume?: number | null, > is_normalized?: boolean | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > } | null, > keyword_info_normalized_with_clickstream?: { > last_updated_time?: string | null, > search_volume?: number | null, > is_normalized?: boolean | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > } | null, > clickstream_keyword_info?: { > search_volume?: number | null, > last_updated_time?: string | null, > gender_distribution?: { > } | null, > age_distribution?: { > } | null, > monthly_searches?: { > year: number, > month: number, > search_volume?: number | null > }[] | null > } | null, > keyword_properties?: { > se_type?: string | null, > core_keyword?: string | null, > synonym_clustering_algorithm?: string | null, > keyword_difficulty?: number | null, > detected_language?: string | null, > is_another_language?: boolean | null, > words_count?: number | null > } | null, > serp_info?: { > se_type?: string | null, > check_url?: string | null, > serp_item_types?: string[] | null, > se_results_count?: number | null, > last_updated_time?: string | null, > previous_updated_time?: string | null > } | null, > avg_backlinks_info?: { > se_type?: string | null, > backlinks?: number | null, > dofollow?: number | null, > referring_pages?: number | null, > referring_domains?: number | null, > referring_main_domains?: number | null, > rank?: number | null, > main_domain_rank?: number | null, > last_updated_time?: string | null > } | null, > search_intent_info?: { > se_type?: string | null, > main_intent?: string | null, > foreign_intent?: string[] | null, > last_updated_time?: string | null > } | null > }[] | null > }[] | null > }[] > ``` *** ## Serp ### googleNews `serp.googleNews` Get live Google News results for a keyword **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.serp.googleNews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyword` | `string` | Yes | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `location_coordinate` | `string` | No | — | | `depth` | `number` | No | — | | `max_crawl_pages` | `number` | No | — | | `search_param` | `string` | No | — | | `se_domain` | `string` | No | — | | `url` | `string` | No | — | | `tag` | `string` | No | — | | `os` | `windows \| macos` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > keyword?: string | null, > type?: string | null, > se_domain?: string | null, > location_code?: number | null, > language_code?: string | null, > check_url?: string | null, > datetime?: string | null, > spell?: { > keyword?: string | null, > type?: string | null > } | null, > item_types?: string[] | null, > se_results_count?: number | null, > items_count?: number | null, > includes_non_news_search_results?: boolean | null, > items?: ( > { > type: news_search, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > domain?: string | null, > title?: string | null, > url?: string | null, > image_url?: string | null, > snippet?: string | null, > time_published?: string | null, > timestamp?: string | null > } | { > type: top_stories, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > items?: { > type?: string | null, > source?: string | null, > domain?: string | null, > title?: string | null, > date?: string | null, > timestamp?: string | null, > url?: string | null, > image_url?: string | null > }[] | null > } > )[] | null > }[] | null > }[] > ``` *** ### googleOrganic `serp.googleOrganic` Get the live Google organic SERP for a keyword: organic, paid, AI Overview, People Also Ask, and other result types **Risk:** `write` ```ts theme={null} await corsair.dataforseo.api.serp.googleOrganic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyword` | `string` | Yes | — | | `location_name` | `string` | No | — | | `location_code` | `number` | No | — | | `language_name` | `string` | No | — | | `language_code` | `string` | No | — | | `location_coordinate` | `string` | No | — | | `depth` | `number` | No | — | | `max_crawl_pages` | `number` | No | — | | `search_param` | `string` | No | — | | `se_domain` | `string` | No | — | | `url` | `string` | No | — | | `tag` | `string` | No | — | | `device` | `desktop \| mobile` | No | — | | `os` | `windows \| macos \| android \| ios` | No | — | | `load_async_ai_overview` | `boolean` | No | — | | `people_also_ask_click_depth` | `number` | No | — | | `group_organic_results` | `boolean` | No | — | | `remove_from_url` | `string[]` | No | — | | `target` | `string` | No | — | | `target_search_mode` | `all \| any` | No | — | | `find_targets_in` | `organic \| paid \| local_pack \| featured_snippet \| events \| google_flights \| images \| jobs \| knowledge_graph \| local_service \| map \| scholarly_articles \| third_party_reviews \| twitter[]` | No | — | | `ignore_targets_in` | `organic \| paid \| local_pack \| featured_snippet \| events \| google_flights \| images \| jobs \| knowledge_graph \| local_service \| map \| scholarly_articles \| third_party_reviews \| twitter[]` | No | — | | `stop_crawl_on_match` | `object[]` | No | — | > **stop\_crawl\_on\_match full type** > > ```ts theme={null} > { > match_value: string, > match_type: domain | with_subdomains | wildcard > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > keyword?: string | null, > type?: string | null, > se_domain?: string | null, > location_code?: number | null, > language_code?: string | null, > check_url?: string | null, > datetime?: string | null, > spell?: { > keyword?: string | null, > type?: string | null > } | null, > item_types?: string[] | null, > se_results_count?: number | null, > items_count?: number | null, > pages_count?: number | null, > refinement_chips?: { > type?: string | null, > xpath?: string | null, > items?: { > type?: string | null, > title?: string | null, > url?: string | null, > domain?: string | null > }[] | null > } | null, > items?: ( > { > type: organic, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > domain?: string | null, > title?: string | null, > description?: string | null, > url?: string | null, > breadcrumb?: string | null, > website_name?: string | null, > is_image?: boolean | null, > is_video?: boolean | null, > images?: { > type?: string | null, > alt?: string | null, > url?: string | null, > image_url?: string | null > }[] | null, > highlighted?: string[] | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > price?: { > current?: number | null, > regular?: number | null, > max_value?: number | null, > currency?: string | null, > is_price_range?: boolean | null, > displayed_price?: string | null > } | null, > timestamp?: string | null, > cache_url?: string | null, > related_search_url?: string | null, > is_featured_snippet?: boolean | null, > is_malicious?: boolean | null, > is_web_story?: boolean | null, > pre_snippet?: string | null, > extended_snippet?: string | null, > amp_version?: boolean | null, > links?: { > type?: string | null, > title?: string | null, > snippet?: string | null, > description?: string | null, > url?: string | null, > domain?: string | null > }[] | null, > faq?: { > type?: string | null, > items?: { > type?: string | null, > title?: string | null, > description?: string | null, > links?: { > type?: string | null, > title?: string | null, > snippet?: string | null, > description?: string | null, > url?: string | null, > domain?: string | null > }[] | null > }[] | null > } | null > } | { > type: paid, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > domain?: string | null, > title?: string | null, > description?: string | null, > url?: string | null, > breadcrumb?: string | null, > website_name?: string | null, > is_image?: boolean | null, > is_video?: boolean | null, > images?: { > type?: string | null, > alt?: string | null, > url?: string | null, > image_url?: string | null > }[] | null, > highlighted?: string[] | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > price?: { > current?: number | null, > regular?: number | null, > max_value?: number | null, > currency?: string | null, > is_price_range?: boolean | null, > displayed_price?: string | null > } | null, > timestamp?: string | null, > description_rows?: string[] | null, > links?: { > type?: string | null, > title?: string | null, > description?: string | null, > url?: string | null, > domain?: string | null > }[] | null > } | { > type: featured_snippet, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > domain?: string | null, > title?: string | null, > description?: string | null, > url?: string | null, > breadcrumb?: string | null, > website_name?: string | null, > is_image?: boolean | null, > is_video?: boolean | null, > images?: { > type?: string | null, > alt?: string | null, > url?: string | null, > image_url?: string | null > }[] | null, > highlighted?: string[] | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > price?: { > current?: number | null, > regular?: number | null, > max_value?: number | null, > currency?: string | null, > is_price_range?: boolean | null, > displayed_price?: string | null > } | null, > timestamp?: string | null, > featured_title?: string | null, > table?: { > table_element?: string | null, > table_header?: string[] | null, > table_content?: string[][] | null > } | null > } | { > type: people_also_ask, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > items?: { > type?: string | null, > title?: string | null, > seed_question?: string | null, > xpath?: string | null, > expanded_element?: { > type?: string | null, > featured_title?: string | null, > url?: string | null, > domain?: string | null, > title?: string | null, > description?: string | null, > images?: { > type?: string | null, > alt?: string | null, > url?: string | null, > image_url?: string | null > }[] | null, > timestamp?: string | null, > asynchronous_ai_overview?: boolean | null, > references?: { > type?: string | null, > source?: string | null, > domain?: string | null, > url?: string | null, > title?: string | null, > text?: string | null > }[] | null > }[] | null > }[] | null > } | { > type: related_searches, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > items?: string[] | null > } | { > type: top_stories, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > title?: string | null, > items?: { > type?: string | null, > source?: string | null, > domain?: string | null, > title?: string | null, > date?: string | null, > timestamp?: string | null, > url?: string | null, > image_url?: string | null > }[] | null > } | { > type: local_pack, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > title?: string | null, > description?: string | null, > domain?: string | null, > phone?: string | null, > booking_url?: string | null, > url?: string | null, > is_paid?: boolean | null, > rating?: { > rating_type?: string | null, > value?: number | null, > votes_count?: number | null, > rating_max?: number | null > } | null, > cid?: string | null > } | { > type: ai_overview, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > asynchronous_ai_overview?: boolean | null, > markdown?: string | null, > references?: { > type?: string | null, > source?: string | null, > domain?: string | null, > url?: string | null, > title?: string | null, > text?: string | null > }[] | null > } | { > type: video, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null, > items?: { > type?: string | null, > source?: string | null, > preview?: string | null, > title?: string | null, > timestamp?: string | null, > url?: string | null > }[] | null > } | { > type: string, > rank_group?: number | null, > rank_absolute?: number | null, > page?: number | null, > position?: string | null, > xpath?: string | null > } > )[] | null > }[] | null > }[] > ``` *** ### languages `serp.languages` List Google SERP language codes (free) **Risk:** `read` ```ts theme={null} await corsair.dataforseo.api.serp.languages({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > language_name: string, > language_code: string > }[] | null > }[] > ``` *** ### locations `serp.locations` List Google SERP location codes, optionally for one country (free) **Risk:** `read` ```ts theme={null} await corsair.dataforseo.api.serp.locations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | | `status_code` | `number` | Yes | — | | `status_message` | `string` | No | — | | `time` | `string` | No | — | | `cost` | `number` | No | — | | `tasks_count` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks` | `object[]` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: string, > status_code: number, > status_message?: string | null, > time?: string | null, > cost?: number | null, > result_count?: number | null, > path?: string[] | null, > data?: { > } | null, > result?: { > location_code: number, > location_name: string, > location_code_parent?: number | null, > country_iso_code?: string | null, > location_type?: string | null > }[] | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/dataforseo/database DataForSeo local sync: searchable entities, `.search()` filters, and operators. The DataForSeo plugin syncs data locally. Use `corsair.dataforseo.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Amazon Products Path: `dataforseo.db.amazonProducts.search` ```ts theme={null} const rows = await corsair.dataforseo.db.amazonProducts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `asin` | `string` | equals, contains, startsWith, endsWith, in | | `seDomain` | `string` | equals, contains, startsWith, endsWith, in | | `locationCode` | `number` | equals, gt, gte, lt, lte, in | | `languageCode` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `priceFrom` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `rating` | `number` | equals, gt, gte, lt, lte, in | | `ratingCount` | `number` | equals, gt, gte, lt, lte, in | | `isAvailable` | `boolean` | equals | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Backlink Targets Path: `dataforseo.db.backlinkTargets.search` ```ts theme={null} const rows = await corsair.dataforseo.db.backlinkTargets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `target` | `string` | equals, contains, startsWith, endsWith, in | | `rank` | `number` | equals, gt, gte, lt, lte, in | | `backlinks` | `number` | equals, gt, gte, lt, lte, in | | `referringDomains` | `number` | equals, gt, gte, lt, lte, in | | `referringMainDomains` | `number` | equals, gt, gte, lt, lte, in | | `spamScore` | `number` | equals, gt, gte, lt, lte, in | | `firstSeen` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Keywords Path: `dataforseo.db.keywords.search` ```ts theme={null} const rows = await corsair.dataforseo.db.keywords.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `keyword` | `string` | equals, contains, startsWith, endsWith, in | | `locationCode` | `number` | equals, gt, gte, lt, lte, in | | `languageCode` | `string` | equals, contains, startsWith, endsWith, in | | `searchVolume` | `number` | equals, gt, gte, lt, lte, in | | `cpc` | `number` | equals, gt, gte, lt, lte, in | | `competition` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/dataforseo/overview DataForSeo plugin for Corsair Use **DataForSeo** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 28 typed API operations * 3 synced entities (`amazonProducts`, `backlinkTargets`, `keywords`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dataforseo ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dataforseo ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dataforseo ``` ```bash bun theme={null} bun add corsair @corsair-dev/dataforseo ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dataforseo } from '@corsair-dev/dataforseo'; export const corsair = createCorsair({ plugins: [ dataforseo(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} dataforseo() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dataforseo', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.userData`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dataforseo.api.account.userData({}); ``` **`ai.chatgptResponse`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dataforseo.api.ai.chatgptResponse({}); ``` See the full list on the [API](/plugins/dataforseo/api) page. ## Query synced data Synced entities support `tenant.dataforseo.db..search()` and `.list()`: `amazonProducts`, `backlinkTargets`, `keywords`. See [Database](/plugins/dataforseo/database) for filters and operators. ## What's next > **[API reference](/plugins/dataforseo/api)** > > Every `dataforseo.api.*` operation with input and output types. > **[Database](/plugins/dataforseo/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/datarobot/api API reference for DataRobot: every `datarobot.api.*` operation with input and output types. Every `datarobot.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Batch Predictions ### batchPredictionsCreate `batchPredictions.batchPredictionsCreate` Creates a new Batch Prediction job **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.batchPredictions.batchPredictionsCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### batchPredictionsDelete `batchPredictions.batchPredictionsDelete` Cancel a Batch Prediction job by prediction job ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.batchPredictions.batchPredictionsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `predictionJobId` | `string` | Yes | — | | `partNumber` | `string` | Yes | — | **Output:** *empty object* *** ### batchPredictionsFromExistingCreate `batchPredictions.batchPredictionsFromExistingCreate` Create a new a Batch Prediction job based **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.batchPredictions.batchPredictionsFromExistingCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### batchPredictionsFromJobDefinitionCreate `batchPredictions.batchPredictionsFromJobDefinitionCreate` Launch a Batch Prediction job **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.batchPredictions.batchPredictionsFromJobDefinitionCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### batchPredictionsList `batchPredictions.batchPredictionsList` List batch prediction jobs **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.batchPredictions.batchPredictionsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `status` | `string` | No | — | | `source` | `string` | No | — | | `deploymentId` | `string` | No | — | | `modelId` | `string` | No | — | | `jobId` | `string` | No | — | | `orderBy` | `created \| -created \| status \| -status` | No | — | | `allJobs` | `boolean` | No | — | | `cutoffHours` | `number` | No | — | | `startDateTime` | `string` | No | — | | `endDateTime` | `string` | No | — | | `batchPredictionJobDefinitionId` | `string` | No | — | | `hostname` | `string` | No | — | | `intakeType` | `string` | No | — | | `outputType` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### batchPredictionsRetrieve `batchPredictions.batchPredictionsRetrieve` Retrieve Batch Prediction job by prediction job ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.batchPredictions.batchPredictionsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `predictionJobId` | `string` | Yes | — | | `partNumber` | `string` | Yes | — | **Output:** *empty object* *** ## Catalog Items ### catalogItemsList `catalogItems.catalogItemsList` List all catalog items accessible by the user. **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.catalogItems.catalogItemsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `initialCacheSize` | `number` | No | — | | `useCache` | `false \| False \| true \| True` | No | — | | `orderBy` | `originalName \| -originalName \| catalogName \| -catalogName \| description \| -description \| created \| -created \| relevance \| -relevance` | No | — | | `searchFor` | `string` | No | — | | `tag` | `string` | No | — | | `accessType` | `owner \| shared \| any \| created` | No | — | | `datasourceType` | `string` | No | — | | `category` | `string` | No | — | | `filterFailed` | `false \| False \| true \| True` | No | — | | `ownerUserId` | `string` | No | — | | `ownerUsername` | `string` | No | — | | `type` | `dataset \| snapshot_dataset \| remote_dataset \| user_blueprint \| files` | No | — | | `isUxrPreviewable` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### catalogItemsRetrieve `catalogItems.catalogItemsRetrieve` Retrieves latest version information, by ID by catalog ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.catalogItems.catalogItemsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalogId` | `string` | Yes | — | **Output:** *empty object* *** ## Credentials ### credentialsCreate `credentials.credentialsCreate` Store a new set of credentials which can be used **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.credentials.credentialsCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### credentialsDelete `credentials.credentialsDelete` Delete the credentials set by credential ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.credentials.credentialsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `credentialId` | `string` | Yes | — | **Output:** *empty object* *** ### credentialsList `credentials.credentialsList` List credentials. **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.credentials.credentialsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `types` | `string` | No | — | | `orderBy` | `creationDate \| -creationDate` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### credentialsRetrieve `credentials.credentialsRetrieve` Retrieve the credentials set by credential ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.credentials.credentialsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `credentialId` | `string` | Yes | — | **Output:** *empty object* *** ## Custom Models ### customModelsCreate `customModels.customModelsCreate` Create custom model. **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.customModels.customModelsCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### customModelsDelete `customModels.customModelsDelete` Delete custom model by custom model ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.customModels.customModelsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customModelId` | `string` | Yes | — | **Output:** *empty object* *** ### customModelsList `customModels.customModelsList` List custom models. **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.customModels.customModelsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `customModelType` | `training \| inference` | No | — | | `targetType` | `Binary \| Regression \| Multiclass \| Anomaly \| Transform \| TextGeneration \| GeoPoint \| Unstructured \| VectorDatabase \| AgenticWorkflow \| MCP \| Multilabel` | No | — | | `isDeployed` | `false \| False \| true \| True` | No | — | | `orderBy` | `created \| -created \| updated \| -updated` | No | — | | `searchFor` | `string` | No | — | | `tagKeys` | `string` | No | — | | `tagValues` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### customModelsRetrieve `customModels.customModelsRetrieve` Get custom model by custom model ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.customModels.customModelsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customModelId` | `string` | Yes | — | **Output:** *empty object* *** ### customModelsVersionsCreate `customModels.customModelsVersionsCreate` Create custom model version by custom model ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.customModels.customModelsVersionsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customModelId` | `string` | Yes | — | **Output:** *empty object* *** ### customModelsVersionsList `customModels.customModelsVersionsList` List custom model versions by custom model ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.customModels.customModelsVersionsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customModelId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `mainBranchCommitSha` | `string` | No | — | **Output:** *empty object* *** ## Datasets ### datasetsAllFeaturesDetailsList `datasets.datasetsAllFeaturesDetailsList` Get dataset features by dataset ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsAllFeaturesDetailsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `featureType \| name \| id \| unique \| missing \| stddev \| mean \| median \| min \| max \| dataQualityIssues \| -featureType \| -name \| -id \| -unique \| -missing \| -stddev \| -mean \| -median \| -min \| -max \| -dataQualityIssues` | No | — | | `includePlot` | `false \| False \| true \| True` | No | — | | `searchFor` | `string` | No | — | | `featurelistId` | `string` | No | — | | `includeDataQuality` | `false \| False \| true \| True` | No | — | **Output:** *empty object* *** ### datasetsDelete `datasets.datasetsDelete` Delete dataset by dataset ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.datasets.datasetsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | **Output:** *empty object* *** ### datasetsFeaturelistsList `datasets.datasetsFeaturelistsList` Retrieve dataset featurelists by dataset ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsFeaturelistsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `orderBy` | `name \| description \| featuresNumber \| creationDate \| userCreated \| -name \| -description \| -featuresNumber \| -creationDate \| -userCreated` | No | — | | `searchFor` | `string` | No | — | **Output:** *empty object* *** ### datasetsFileList `datasets.datasetsFileList` Retrieve original dataset data by dataset ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsFileList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | **Output:** *empty object* *** ### datasetsFromDataSourceCreate `datasets.datasetsFromDataSourceCreate` Create a dataset from a data source **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsFromDataSourceCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### datasetsFromFileCreate `datasets.datasetsFromFileCreate` Create a dataset from a file **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsFromFileCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### datasetsFromURLCreate `datasets.datasetsFromURLCreate` Create a dataset from an URL **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsFromURLCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### datasetsList `datasets.datasetsList` List datasets **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category` | `TRAINING \| PREDICTION \| SAMPLE` | No | — | | `orderBy` | `created \| -created` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `filterFailed` | `false \| False \| true \| True` | No | — | | `datasetVersionIds` | `string` | No | — | | `useCaseIds` | `string` | No | — | | `vectorDatabaseEligibleOnly` | `false \| False \| true \| True` | No | — | | `vectorDatabaseMetadataEligibleOnly` | `false \| False \| true \| True` | No | — | | `isDeleted` | `false \| False \| true \| True` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### datasetsPatch `datasets.datasetsPatch` Modify dataset by dataset ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsPatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | **Output:** *empty object* *** ### datasetsProjectsList `datasets.datasetsProjectsList` Get dataset projects by dataset ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsProjectsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** *empty object* *** ### datasetsRetrieve `datasets.datasetsRetrieve` Get dataset details by dataset ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | **Output:** *empty object* *** ### datasetsVersionsDelete `datasets.datasetsVersionsDelete` Delete dataset version by dataset ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.datasets.datasetsVersionsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | | `datasetVersionId` | `string` | Yes | — | **Output:** *empty object* *** ### datasetsVersionsFromFileCreate `datasets.datasetsVersionsFromFileCreate` Create a version from a file **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsVersionsFromFileCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | **Output:** *empty object* *** ### datasetsVersionsFromURLCreate `datasets.datasetsVersionsFromURLCreate` Create a version from an URL **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsVersionsFromURLCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | **Output:** *empty object* *** ### datasetsVersionsList `datasets.datasetsVersionsList` List dataset versions by dataset ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsVersionsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | | `category` | `TRAINING \| PREDICTION \| SAMPLE` | No | — | | `orderBy` | `created \| -created` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `filterFailed` | `false \| False \| true \| True` | No | — | **Output:** *empty object* *** ### datasetsVersionsRetrieve `datasets.datasetsVersionsRetrieve` Get dataset details by version by dataset ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.datasets.datasetsVersionsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasetId` | `string` | Yes | — | | `datasetVersionId` | `string` | Yes | — | **Output:** *empty object* *** ## Deployments ### deploymentsAccuracyList `deployments.deploymentsAccuracyList` Retrieve accuracy metric by deployment ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsAccuracyList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | | `start` | `string` | No | — | | `end` | `string` | No | — | | `modelId` | `string` | No | — | | `batchId` | `string` | No | — | | `segmentAttribute` | `string` | No | — | | `segmentValue` | `string` | No | — | | `targetClass` | `string` | No | — | | `metric` | `AUC \| Accuracy \| Balanced Accuracy \| F1 \| FPR \| FVE Binomial \| FVE Gamma \| FVE Multinomial \| FVE Poisson \| FVE Tweedie \| Gamma Deviance \| Gini Norm \| Kolmogorov-Smirnov \| LogLoss \| MAE \| MAPE \| MCC \| NPV \| PPV \| Poisson Deviance \| R Squared \| RMSE \| RMSLE \| Rate@Top10% \| Rate@Top5% \| TNR \| TPR \| Tweedie Deviance \| WGS84 MAE \| WGS84 RMSE` | No | — | | `baselineModelId` | `string` | No | — | **Output:** *empty object* *** ### deploymentsAccuracyOverTimeList `deployments.deploymentsAccuracyOverTimeList` Retrieve accuracy over time by deployment ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsAccuracyOverTimeList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | | `start` | `string` | No | — | | `end` | `string` | No | — | | `bucketSize` | `string` | No | — | | `modelId` | `string` | No | — | | `metric` | `AUC \| Accuracy \| Balanced Accuracy \| F1 \| FPR \| FVE Binomial \| FVE Gamma \| FVE Multinomial \| FVE Poisson \| FVE Tweedie \| Gamma Deviance \| Gini Norm \| Kolmogorov-Smirnov \| LogLoss \| MAD \| MAE \| MAPE \| MCC \| NPV \| PPV \| Poisson Deviance \| R Squared \| RMSE \| RMSLE \| Rate@Top10% \| Rate@Top5% \| TNR \| TPR \| Tweedie Deviance \| WGS84 MAE \| WGS84 RMSE` | No | — | | `segmentAttribute` | `string` | No | — | | `segmentValue` | `string` | No | — | | `targetClass` | `string` | No | — | **Output:** *empty object* *** ### deploymentsCapabilitiesList `deployments.deploymentsCapabilitiesList` Retrieve capabilities by deployment ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsCapabilitiesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | **Output:** *empty object* *** ### deploymentsDelete `deployments.deploymentsDelete` Delete deployment by deployment ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | | `ignoreManagementAgent` | `false \| False \| true \| True` | No | — | **Output:** *empty object* *** ### deploymentsFeaturesList `deployments.deploymentsFeaturesList` Get deployment features by deployment ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsFeaturesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `includeNonPredictionFeatures` | `false \| False \| true \| True` | No | — | | `forSegmentedAnalysis` | `false \| False \| true \| True` | No | — | | `search` | `string` | No | — | | `orderBy` | `name \| -name \| importance \| -importance` | No | — | **Output:** *empty object* *** ### deploymentsFromLearningModelCreate `deployments.deploymentsFromLearningModelCreate` Create deployment **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsFromLearningModelCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### deploymentsFromModelPackageCreate `deployments.deploymentsFromModelPackageCreate` Create a deployment from a model package **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsFromModelPackageCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### deploymentsList `deployments.deploymentsList` List deployments **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `orderBy` | `label \| -label \| serviceHealth \| -serviceHealth \| modelHealth \| -modelHealth \| accuracyHealth \| -accuracyHealth \| recentPredictions \| -recentPredictions \| lastPredictionTimestamp \| -lastPredictionTimestamp \| currentModelDeployedTimestamp \| -currentModelDeployedTimestamp \| createdAtTimestamp \| -createdAtTimestamp \| importance \| -importance \| fairnessHealth \| -fairnessHealth \| customMetricsHealth \| -customMetricsHealth \| actualsTimelinessHealth \| -actualsTimelinessHealth \| predictionsTimelinessHealth \| -predictionsTimelinessHealth` | No | — | | `search` | `string` | No | — | | `serviceHealth` | `(string \| number)[]` | No | — | | `modelHealth` | `(string \| number)[]` | No | — | | `accuracyHealth` | `(string \| number)[]` | No | — | | `role` | `OWNER \| USER` | No | — | | `status` | `(string \| number)[]` | No | — | | `importance` | `(string \| number)[]` | No | — | | `lastPredictionTimestampStart` | `string` | No | — | | `lastPredictionTimestampEnd` | `string` | No | — | | `predictionUsageDailyAvgGreaterThan` | `number` | No | — | | `predictionUsageDailyAvgLessThan` | `number` | No | — | | `defaultPredictionServerId` | `(string \| number)[]` | No | — | | `buildEnvironmentType` | `(string \| number)[]` | No | — | | `executionEnvironmentType` | `(string \| number)[]` | No | — | | `predictionEnvironmentPlatform` | `(string \| number)[]` | No | — | | `createdByMe` | `false \| False \| true \| True` | No | — | | `createdBy` | `string` | No | — | | `championModelExecutionType` | `custom_inference_model \| external \| dedicated` | No | — | | `championModelTargetType` | `string` | No | — | | `tagKeys` | `string` | No | — | | `tagValues` | `string` | No | — | | `isA2AAgent` | `false \| False \| true \| True` | No | — | | `predictionEnvironmentTagKeys` | `string` | No | — | | `predictionEnvironmentTagValues` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### deploymentsModelHistoryList `deployments.deploymentsModelHistoryList` Retrieve champion model history of deployment by deployment ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsModelHistoryList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** *empty object* *** ### deploymentsModelPatchMany `deployments.deploymentsModelPatchMany` Model Replacement by deployment ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsModelPatchMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | **Output:** *empty object* *** ### deploymentsPatch `deployments.deploymentsPatch` Update deployment by deployment ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsPatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | **Output:** *empty object* *** ### deploymentsPredictionsOverTimeList `deployments.deploymentsPredictionsOverTimeList` Retrieve metrics about predictions over time by deployment ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsPredictionsOverTimeList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | | `start` | `string` | No | — | | `end` | `string` | No | — | | `bucketSize` | `PT1H \| P1D \| P7D \| P1M` | No | — | | `segmentAttribute` | `string` | No | — | | `segmentValue` | `string` | No | — | | `modelId` | `string` | No | — | | `targetClass` | `string` | No | — | | `includePercentiles` | `false \| False \| true \| True` | No | — | **Output:** *empty object* *** ### deploymentsRetrieve `deployments.deploymentsRetrieve` Retrieve deployment by deployment ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | **Output:** *empty object* *** ### deploymentsServiceStatsList `deployments.deploymentsServiceStatsList` Retrieve service stats by ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsServiceStatsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | | `start` | `string` | No | — | | `end` | `string` | No | — | | `executionTimeQuantile` | `number` | No | — | | `responseTimeQuantile` | `number` | No | — | | `slowRequestsThreshold` | `number` | No | — | | `segmentAttribute` | `DataRobot-Consumer \| DataRobot-Remote-IP \| DataRobot-Host-IP` | No | — | | `segmentValue` | `string` | No | — | | `modelId` | `string` | No | — | **Output:** *empty object* *** ### deploymentsSettingsList `deployments.deploymentsSettingsList` Retrieve deployment settings by deployment ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsSettingsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | **Output:** *empty object* *** ### deploymentsSettingsPatchMany `deployments.deploymentsSettingsPatchMany` Update deployment settings by deployment ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsSettingsPatchMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | **Output:** *empty object* *** ### deploymentsSharedRolesList `deployments.deploymentsSharedRolesList` Get the model deployment access control list by deployment ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.deployments.deploymentsSharedRolesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | | `id` | `string` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `name` | `string` | No | — | | `shareRecipientType` | `user \| group \| organization \| externalApplication` | No | — | **Output:** *empty object* *** ## Model Packages ### modelPackagesFeaturesList `modelPackages.modelPackagesFeaturesList` Retrieve feature list by model package ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.modelPackages.modelPackagesFeaturesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `modelPackageId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `includeNonPredictionFeatures` | `false \| False \| true \| True` | No | — | | `forSegmentedAnalysis` | `false \| False \| true \| True` | No | — | | `search` | `string` | No | — | | `orderBy` | `name \| importance \| -name \| -importance` | No | — | **Output:** *empty object* *** ### modelPackagesFromLeaderboardCreate `modelPackages.modelPackagesFromLeaderboardCreate` Create model package **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.modelPackages.modelPackagesFromLeaderboardCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### modelPackagesList `modelPackages.modelPackagesList` List model packages **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.modelPackages.modelPackagesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `modelId` | `string` | No | — | | `similarTo` | `string` | No | — | | `forChallenger` | `boolean` | No | — | | `search` | `string` | No | — | | `predictionThreshold` | `number` | No | — | | `imported` | `boolean` | No | — | | `predictionEnvironmentId` | `string` | No | — | | `modelKind` | `string` | No | — | | `buildStatus` | `inProgress \| complete \| failed` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### modelPackagesRetrieve `modelPackages.modelPackagesRetrieve` Retrieve info about a model package by model package ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.modelPackages.modelPackagesRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `modelPackageId` | `string` | Yes | — | **Output:** *empty object* *** ## Prediction Servers ### predictionServersList `predictionServers.predictionServersList` List prediction servers. **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.predictionServers.predictionServersList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ## Projects ### configureAndStartAutopilot `projects.configureAndStartAutopilot` Start modeling by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.configureAndStartAutopilot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsAccessControlList `projects.projectsAccessControlList` Get the project access control list by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsAccessControlList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `username` | `string` | No | — | | `userId` | `string` | No | — | **Output:** *empty object* *** ### projectsAutopilotCreate `projects.projectsAutopilotCreate` Pause by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsAutopilotCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsAutopilotsCreate `projects.projectsAutopilotsCreate` Start autopilot by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsAutopilotsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsBlueprintsList `projects.projectsBlueprintsList` List blueprints by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsBlueprintsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsBlueprintsRetrieve `projects.projectsBlueprintsRetrieve` Retrieve a blueprint by its ID. **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsBlueprintsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `blueprintId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsCreate `projects.projectsCreate` Create a project. **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### projectsDatetimeModelsList `projects.projectsDatetimeModelsList` List datetime partitioned project models by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsDatetimeModelsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `bulkOperationId` | `string` | No | — | **Output:** *empty object* *** ### projectsDelete `projects.projectsDelete` Delete a project by project ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.projects.projectsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsDeploymentReadyModelsCreate `projects.projectsDeploymentReadyModelsCreate` Prepare a model by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsDeploymentReadyModelsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsFeaturelistsCreate `projects.projectsFeaturelistsCreate` Create a new featurelist by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsFeaturelistsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsFeaturelistsDelete `projects.projectsFeaturelistsDelete` Delete a specified featurelist by project ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.projects.projectsFeaturelistsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `featurelistId` | `string` | Yes | — | | `dryRun` | `false \| False \| true \| True` | No | — | | `deleteDependencies` | `false \| False \| true \| True` | No | — | **Output:** *empty object* *** ### projectsFeaturelistsList `projects.projectsFeaturelistsList` List featurelists by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsFeaturelistsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `sortBy` | `name \| description \| features \| numModels \| created \| isUserCreated \| -name \| -description \| -features \| -numModels \| -created \| -isUserCreated` | No | — | | `searchFor` | `string` | No | — | **Output:** *empty object* *** ### projectsFeaturelistsPatch `projects.projectsFeaturelistsPatch` Update an existing featurelist by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsFeaturelistsPatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `featurelistId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsFeaturelistsRetrieve `projects.projectsFeaturelistsRetrieve` Retrieve a feature list by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsFeaturelistsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `featurelistId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsFeaturesList `projects.projectsFeaturesList` List project features by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsFeaturesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `sortBy` | `name \| id \| importance \| featureType \| uniqueCount \| naCount \| mean \| stdDev \| median \| min \| max \| -name \| -id \| -importance \| -featureType \| -uniqueCount \| -naCount \| -mean \| -stdDev \| -median \| -min \| -max` | No | — | | `searchFor` | `string` | No | — | | `featurelistId` | `string` | No | — | | `forSegmentedAnalysis` | `false \| False \| true \| True` | No | — | **Output:** *empty object* *** ### projectsFeaturesRetrieve `projects.projectsFeaturesRetrieve` Get a project feature by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsFeaturesRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `featureName` | `string` | Yes | — | **Output:** *empty object* *** ### projectsJobsDelete `projects.projectsJobsDelete` Cancel a job by project ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.projects.projectsJobsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `jobId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsJobsList `projects.projectsJobsList` List project jobs by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsJobsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `status` | `queue \| inprogress \| error` | No | — | **Output:** *empty object* *** ### projectsJobsRetrieve `projects.projectsJobsRetrieve` Get a job by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsJobsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `jobId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsList `projects.projectsList` List projects. **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectName` | `string` | No | — | | `projectId` | `string` | No | — | | `orderBy` | `projectName \| -projectName` | No | — | | `featureDiscovery` | `false \| False \| true \| True` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### projectsModelingFeaturelistsCreate `projects.projectsModelingFeaturelistsCreate` Create a new modeling featurelist by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsModelingFeaturelistsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsModelingFeaturelistsList `projects.projectsModelingFeaturelistsList` List all modeling featurelists by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsModelingFeaturelistsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `sortBy` | `name \| description \| features \| numModels \| created \| isUserCreated \| -name \| -description \| -features \| -numModels \| -created \| -isUserCreated` | No | — | | `searchFor` | `string` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** *empty object* *** ### projectsModelsCreate `projects.projectsModelsCreate` Train a new model by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsModelsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsModelsDelete `projects.projectsModelsDelete` Delete a model by project ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.projects.projectsModelsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `modelId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsModelsFromModelCreate `projects.projectsModelsFromModelCreate` Retrain a model by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsModelsFromModelCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsModelsList `projects.projectsModelsList` List project models by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsModelsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `withMetric` | `string` | No | — | | `showInSampleScores` | `boolean` | No | — | | `name` | `string` | No | — | | `samplePct` | `number` | No | — | | `isStarred` | `false \| False \| true \| True` | No | — | | `orderBy` | `metric \| -metric \| samplePct \| -samplePct` | No | — | **Output:** *empty object* *** ### projectsModelsRetrieve `projects.projectsModelsRetrieve` Get model by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsModelsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `modelId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsPatch `projects.projectsPatch` Update a project by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsPatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsPredictionDatasetsDelete `projects.projectsPredictionDatasetsDelete` Delete a dataset that was uploaded by project ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.projects.projectsPredictionDatasetsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsPredictionDatasetsList `projects.projectsPredictionDatasetsList` List prediction datasets uploaded by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsPredictionDatasetsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** *empty object* *** ### projectsPredictionDatasetsRetrieve `projects.projectsPredictionDatasetsRetrieve` Get the metadata of a specific dataset by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsPredictionDatasetsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsPredictionsCreate `projects.projectsPredictionsCreate` Make new predictions by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsPredictionsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsPredictionsList `projects.projectsPredictionsList` Get the list of prediction records by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsPredictionsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `datasetId` | `string` | No | — | | `modelId` | `string` | No | — | **Output:** *empty object* *** ### projectsPredictionsRetrieve `projects.projectsPredictionsRetrieve` Get a completed set of predictions by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsPredictionsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `predictionId` | `string` | Yes | — | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsRecommendedModelsList `projects.projectsRecommendedModelsList` List recommended models by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsRecommendedModelsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsRetrieve `projects.projectsRetrieve` Get project by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsStatusList `projects.projectsStatusList` Check project status by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.projectsStatusList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### projectsTrainingPredictionsCreate `projects.projectsTrainingPredictionsCreate` Submits a job by project ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.projects.projectsTrainingPredictionsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### trainingPredictionsList `projects.trainingPredictionsList` List training prediction jobs by project ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.projects.trainingPredictionsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** *empty object* *** ## Status ### statusList `status.statusList` List tasks **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.status.statusList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### statusRetrieve `status.statusRetrieve` Get task status by status ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.status.statusRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `statusId` | `string` | Yes | — | **Output:** *empty object* *** ## Use Cases ### useCasesCreate `useCases.useCasesCreate` Get a use case. **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.useCases.useCasesCreate({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### useCasesDatasetsList `useCases.useCasesDatasetsList` Get the list of the datasets associated by use case ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.useCases.useCasesDatasetsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `useCaseId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `sort` | `-columnCount \| -createdAt \| -createdBy \| -dataSourceType \| -datasetSize \| -datasetSourceType \| -lastActivity \| -modifiedAt \| -modifiedBy \| -name \| -rowCount \| columnCount \| createdAt \| createdBy \| dataSourceType \| datasetSize \| datasetSourceType \| lastActivity \| modifiedAt \| modifiedBy \| name \| rowCount` | No | — | | `orderBy` | `-columnCount \| -createdAt \| -createdBy \| -dataSourceType \| -datasetSize \| -datasetSourceType \| -lastActivity \| -modifiedAt \| -modifiedBy \| -name \| -rowCount \| columnCount \| createdAt \| createdBy \| dataSourceType \| datasetSize \| datasetSourceType \| lastActivity \| modifiedAt \| modifiedBy \| name \| rowCount` | No | — | | `search` | `string` | No | — | **Output:** *empty object* *** ### useCasesDelete `useCases.useCasesDelete` Delete a Use Case by use case ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.datarobot.api.useCases.useCasesDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `useCaseId` | `string` | Yes | — | **Output:** *empty object* *** ### useCasesDeploymentsList `useCases.useCasesDeploymentsList` Get the deployments associated by use case ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.useCases.useCasesDeploymentsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `useCaseId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `orderBy` | `-createdAt \| -createdBy \| -lastActivity \| -name \| -updatedAt \| -updatedBy \| createdAt \| createdBy \| lastActivity \| name \| updatedAt \| updatedBy` | No | — | | `search` | `string` | No | — | **Output:** *empty object* *** ### useCasesList `useCases.useCasesList` Retrieve the list of use cases. **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.useCases.useCasesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `search` | `string` | No | — | | `projectId` | `string` | No | — | | `applicationId` | `string` | No | — | | `entityId` | `string` | No | — | | `entityType` | `project \| dataset \| file \| notebook \| application \| recipe \| playground \| vectorDatabase \| syftrSearchInstance \| embeddingModelValidation \| customModelVersion \| registeredModelVersion \| deployment \| customApplication \| customJob` | No | — | | `sort` | `-applicationsCount \| -createdAt \| -createdBy \| -customApplicationsCount \| -datasetsCount \| -description \| -filesCount \| -id \| -name \| -notebooksCount \| -playgroundsCount \| -potentialValue \| -projectsCount \| -riskLevel \| -stage \| -updatedAt \| -updatedBy \| -vectorDatabasesCount \| applicationsCount \| createdAt \| createdBy \| customApplicationsCount \| datasetsCount \| description \| filesCount \| id \| name \| notebooksCount \| playgroundsCount \| potentialValue \| projectsCount \| riskLevel \| stage \| updatedAt \| updatedBy \| vectorDatabasesCount` | No | — | | `orderBy` | `-applicationsCount \| -createdAt \| -createdBy \| -customApplicationsCount \| -datasetsCount \| -description \| -filesCount \| -id \| -name \| -notebooksCount \| -playgroundsCount \| -potentialValue \| -projectsCount \| -riskLevel \| -stage \| -updatedAt \| -updatedBy \| -vectorDatabasesCount \| applicationsCount \| createdAt \| createdBy \| customApplicationsCount \| datasetsCount \| description \| filesCount \| id \| name \| notebooksCount \| playgroundsCount \| potentialValue \| projectsCount \| riskLevel \| stage \| updatedAt \| updatedBy \| vectorDatabasesCount` | No | — | | `usecaseType` | `all \| general \| walkthrough` | No | — | | `riskLevel` | `string` | No | — | | `stage` | `string` | No | — | | `createdBy` | `string` | No | — | | `showOrgUseCases` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** ### useCasesPatch `useCases.useCasesPatch` Update a Use Case by use case ID **Risk:** `write` ```ts theme={null} await corsair.datarobot.api.useCases.useCasesPatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `useCaseId` | `string` | Yes | — | **Output:** *empty object* *** ### useCasesProjectsList `useCases.useCasesProjectsList` Get the list of the projects associated by use case ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.useCases.useCasesProjectsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `useCaseId` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `search` | `string` | No | — | | `sort` | `-createdAt \| -createdBy \| -dataset \| -featureCount \| -fullName \| -lastActivity \| -models \| -name \| -projectId \| -rowCount \| -target \| -targetType \| -timeAware \| -updatedAt \| -updatedBy \| createdAt \| createdBy \| dataset \| featureCount \| fullName \| lastActivity \| models \| name \| projectId \| rowCount \| target \| targetType \| timeAware \| updatedAt \| updatedBy` | No | — | | `orderBy` | `-createdAt \| -createdBy \| -dataset \| -featureCount \| -fullName \| -lastActivity \| -models \| -name \| -projectId \| -rowCount \| -target \| -targetType \| -timeAware \| -updatedAt \| -updatedBy \| createdAt \| createdBy \| dataset \| featureCount \| fullName \| lastActivity \| models \| name \| projectId \| rowCount \| target \| targetType \| timeAware \| updatedAt \| updatedBy` | No | — | **Output:** *empty object* *** ### useCasesRetrieve `useCases.useCasesRetrieve` Get a use case by use case ID **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.useCases.useCasesRetrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `useCaseId` | `string` | Yes | — | **Output:** *empty object* *** ## Version ### versionList `version.versionList` Retrieve version information. **Risk:** `read` ```ts theme={null} await corsair.datarobot.api.version.versionList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `data` | `any[]` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/datarobot/database DataRobot local sync: searchable entities, `.search()` filters, and operators. The DataRobot plugin syncs data locally. Use `corsair.datarobot.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Dataset Path: `datarobot.db.dataset.search` ```ts theme={null} const rows = await corsair.datarobot.db.dataset.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `datasetId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `versionId` | `string` | equals, contains, startsWith, endsWith, in | | `columnCount` | `number` | equals, gt, gte, lt, lte, in | | `rowCount` | `number` | equals, gt, gte, lt, lte, in | | `datasetSize` | `number` | equals, gt, gte, lt, lte, in | | `createdBy` | `string` | equals, contains, startsWith, endsWith, in | | `creationDate` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `processingState` | `string` | equals, contains, startsWith, endsWith, in | | `dataPersisted` | `boolean` | equals | | `isSnapshot` | `boolean` | equals | | `isLatestVersion` | `boolean` | equals | | `uri` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deployment Path: `datarobot.db.deployment.search` ```ts theme={null} const rows = await corsair.datarobot.db.deployment.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `importance` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Project Path: `datarobot.db.project.search` ```ts theme={null} const rows = await corsair.datarobot.db.project.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `projectName` | `string` | equals, contains, startsWith, endsWith, in | | `fileName` | `string` | equals, contains, startsWith, endsWith, in | | `stage` | `string` | equals, contains, startsWith, endsWith, in | | `target` | `string` | equals, contains, startsWith, endsWith, in | | `targetType` | `string` | equals, contains, startsWith, endsWith, in | | `metric` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `catalogId` | `string` | equals, contains, startsWith, endsWith, in | | `catalogVersionId` | `string` | equals, contains, startsWith, endsWith, in | | `holdoutUnlocked` | `boolean` | equals | | `unsupervisedMode` | `boolean` | equals | | `useFeatureDiscovery` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Use Case Path: `datarobot.db.useCase.search` ```ts theme={null} const rows = await corsair.datarobot.db.useCase.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `tenantId` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `projectsCount` | `number` | equals, gt, gte, lt, lte, in | | `datasetsCount` | `number` | equals, gt, gte, lt, lte, in | | `deploymentsCount` | `number` | equals, gt, gte, lt, lte, in | | `notebooksCount` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## User Path: `datarobot.db.user.search` ```ts theme={null} const rows = await corsair.datarobot.db.user.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `userhash` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/datarobot/overview Enterprise AI platform for automated machine learning model building and deployment. Use **DataRobot** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 107 typed API operations * 5 synced entities (`dataset`, `deployment`, `project`, `useCase`, `user`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/datarobot ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/datarobot ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/datarobot ``` ```bash bun theme={null} bun add corsair @corsair-dev/datarobot ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { datarobot } from '@corsair-dev/datarobot'; export const corsair = createCorsair({ plugins: [ datarobot(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} datarobot() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'datarobot', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`batchPredictions.batchPredictionsList`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.datarobot.api.batchPredictions.batchPredictionsList({}); ``` **`batchPredictions.batchPredictionsCreate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.datarobot.api.batchPredictions.batchPredictionsCreate({}); ``` See the full list on the [API](/plugins/datarobot/api) page. ## Query synced data Synced entities support `tenant.datarobot.db..search()` and `.list()`: `dataset`, `deployment`, `project`, `useCase`, `user`. See [Database](/plugins/datarobot/database) for filters and operators. ## What's next > **[API reference](/plugins/datarobot/api)** > > Every `datarobot.api.*` operation with input and output types. > **[Database](/plugins/datarobot/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/deepseek/api API reference for DeepSeek: every `deepseek.api.*` operation with input and output types. Every `deepseek.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Anthropic ### createMessage `anthropic.createMessage` Generate a response via DeepSeek's Anthropic-compatible Messages API, with support for system prompts, tool calling, and thinking mode **Risk:** `write` ```ts theme={null} await corsair.deepseek.api.anthropic.createMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `deepseek-chat \| deepseek-reasoner` | Yes | — | | `maxTokens` | `number` | Yes | — | | `messages` | `object[]` | Yes | — | | `system` | `object[]` | No | — | | `stopSequences` | `string[]` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `topK` | `number` | No | — | | `tools` | `object[]` | No | — | | `toolChoice` | `object` | No | — | | `thinking` | `object` | No | — | | `metadata` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > role: user | assistant, > content: string | ( > { > type: text, > text: string > } | { > type: tool_use, > id: string, > name: string, > input: { > } > } | { > type: tool_result, > tool_use_id: string, > content?: string | { > type: text, > text: string > }[], > is_error?: boolean > } | { > type: thinking, > thinking: string, > signature: string > } | { > type: redacted_thinking, > data: string > } > )[] > }[] > ``` > **system full type** > > ```ts theme={null} > string | { > type: text, > text: string > }[] > ``` > **tools full type** > > ```ts theme={null} > { > name: string, > description?: string, > input_schema: { > } > }[] > ``` > **toolChoice full type** > > ```ts theme={null} > { > type: auto, > disable_parallel_tool_use?: boolean > } | { > type: any, > disable_parallel_tool_use?: boolean > } | { > type: tool, > name: string, > disable_parallel_tool_use?: boolean > } > ``` > **thinking full type** > > ```ts theme={null} > { > type: enabled, > budget_tokens: number > } | { > type: disabled > } > ``` > **metadata full type** > > ```ts theme={null} > { > user_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `message` | Yes | — | | `role` | `assistant` | Yes | — | | `model` | `string` | Yes | — | | `content` | `object[]` | Yes | — | | `stop_reason` | `end_turn \| max_tokens \| stop_sequence \| tool_use` | No | — | | `stop_sequence` | `string` | No | — | | `usage` | `object` | Yes | — | > **content full type** > > ```ts theme={null} > ( > { > type: text, > text: string > } | { > type: tool_use, > id: string, > name: string, > input: { > } > } | { > type: tool_result, > tool_use_id: string, > content?: string | { > type: text, > text: string > }[], > is_error?: boolean > } | { > type: thinking, > thinking: string, > signature: string > } | { > type: redacted_thinking, > data: string > } > )[] > ``` > **usage full type** > > ```ts theme={null} > { > input_tokens: number, > output_tokens: number, > cache_creation_input_tokens?: number | null, > cache_read_input_tokens?: number | null > } > ``` *** ## Chat ### createCompletion `chat.createCompletion` Generate an AI chat response using deepseek-chat or deepseek-reasoner, with support for temperature, tool calling, and structured output **Risk:** `write` ```ts theme={null} await corsair.deepseek.api.chat.createCompletion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `deepseek-chat \| deepseek-reasoner` | Yes | — | | `messages` | `object[]` | Yes | — | | `frequencyPenalty` | `number` | No | — | | `maxTokens` | `number` | No | — | | `presencePenalty` | `number` | No | — | | `responseFormat` | `object` | No | — | | `stop` | `string \| string[]` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `tools` | `object[]` | No | — | | `toolChoice` | `object` | No | — | | `logprobs` | `boolean` | No | — | | `topLogprobs` | `number` | No | — | > **messages full type** > > ```ts theme={null} > { > role: system | user | assistant | tool, > content?: string | null, > name?: string, > tool_calls?: { > id: string, > type: function, > function: { > name: string, > arguments: string > } > }[], > tool_call_id?: string, > prefix?: boolean > }[] > ``` > **responseFormat full type** > > ```ts theme={null} > { > type: text > } | { > type: json_object > } > ``` > **tools full type** > > ```ts theme={null} > { > type: function, > function: { > name: string, > description?: string, > parameters?: { > } > } > }[] > ``` > **toolChoice full type** > > ```ts theme={null} > none | auto | required | { > type: function, > function: { > name: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `chat.completion` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | | `choices` | `object[]` | Yes | — | | `system_fingerprint` | `string` | No | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > index: number, > message: { > role: assistant, > content?: string | null, > reasoning_content?: string | null, > tool_calls?: { > id: string, > type: function, > function: { > name: string, > arguments: string > } > }[] > }, > logprobs?: { > content?: any[] | null > } | null, > finish_reason: stop | length | content_filter | tool_calls | insufficient_system_resource > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number, > prompt_cache_hit_tokens?: number, > prompt_cache_miss_tokens?: number, > completion_tokens_details?: { > reasoning_tokens?: number > } > } > ``` *** ## Models ### list `models.list` List the DeepSeek models currently available to the account **Risk:** `read` ```ts theme={null} await corsair.deepseek.api.models.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: model, > owned_by: string > }[] > ``` *** ## User ### getBalance `user.getBalance` Get the current account balance, including granted and topped-up amounts broken down by currency **Risk:** `read` ```ts theme={null} await corsair.deepseek.api.user.getBalance({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `is_available` | `boolean` | Yes | — | | `balance_infos` | `object[]` | Yes | — | > **balance\_infos full type** > > ```ts theme={null} > { > currency: CNY | USD, > total_balance: string, > granted_balance: string, > topped_up_balance: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/deepseek/database DeepSeek local sync: searchable entities, `.search()` filters, and operators. The DeepSeek plugin syncs data locally. Use `corsair.deepseek.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/deepseek/overview AI model provider API for chat completions, reasoning, and code generation tasks. Use **DeepSeek** through Corsair: one client, typed API calls. **What you get:** * 4 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/deepseek ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/deepseek ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/deepseek ``` ```bash bun theme={null} bun add corsair @corsair-dev/deepseek ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { deepseek } from '@corsair-dev/deepseek'; export const corsair = createCorsair({ plugins: [ deepseek(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} deepseek() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'deepseek', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`models.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.deepseek.api.models.list({}); ``` **`anthropic.createMessage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.deepseek.api.anthropic.createMessage({}); ``` See the full list on the [API](/plugins/deepseek/api) page. ## What's next > **[API reference](/plugins/deepseek/api)** > > Every `deepseek.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/devinmcp/api API reference for Devin MCP: every `devinmcp.api.*` operation with input and output types. Every `devinmcp.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Session ### create `session.create` Create a new Devin session to start working on a task **Risk:** `write` ```ts theme={null} await corsair.devinmcp.api.session.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_id` | `string` | Yes | — | | `prompt` | `string` | Yes | — | | `create_as_user_id` | `string` | No | — | | `playbook_id` | `string` | No | — | | `title` | `string` | No | — | | `tags` | `string[]` | No | — | | `knowledge_ids` | `string[]` | No | — | | `max_acu_limit` | `number` | No | — | | `snapshot_id` | `string` | No | — | | `idempotent` | `boolean` | No | — | | `unlisted` | `boolean` | No | — | | `structured_output_schema` | `object` | No | — | > **structured\_output\_schema full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `status` | `string` | Yes | — | | `tags` | `string[]` | Yes | — | | `org_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `updated_at` | `number` | Yes | — | | `acus_consumed` | `number` | Yes | — | | `pull_requests` | `object[]` | Yes | — | | `title` | `string` | No | — | | `user_id` | `string` | No | — | | `status_detail` | `string` | No | — | | `structured_output` | `object` | No | — | | `playbook_id` | `string` | No | — | | `parent_session_id` | `string` | No | — | > **pull\_requests full type** > > ```ts theme={null} > { > url?: string > }[] > ``` > **structured\_output full type** > > ```ts theme={null} > { > } > ``` *** ### get `session.get` Get details and status of an existing Devin session **Risk:** `read` ```ts theme={null} await corsair.devinmcp.api.session.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_id` | `string` | Yes | — | | `session_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `status` | `string` | Yes | — | | `tags` | `string[]` | Yes | — | | `org_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `updated_at` | `number` | Yes | — | | `acus_consumed` | `number` | Yes | — | | `pull_requests` | `object[]` | Yes | — | | `title` | `string` | No | — | | `user_id` | `string` | No | — | | `status_detail` | `string` | No | — | | `structured_output` | `object` | No | — | | `playbook_id` | `string` | No | — | | `parent_session_id` | `string` | No | — | > **pull\_requests full type** > > ```ts theme={null} > { > url?: string > }[] > ``` > **structured\_output full type** > > ```ts theme={null} > { > } > ``` *** ### list `session.list` List Devin sessions **Risk:** `read` ```ts theme={null} await corsair.devinmcp.api.session.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_id` | `string` | Yes | — | | `first` | `number` | No | — | | `after` | `string` | No | — | | `tags` | `string[]` | No | — | | `user_ids` | `string[]` | No | — | | `session_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `end_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | | `total` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > session_id: string, > url: string, > status: string, > tags: string[], > org_id: string, > created_at: number, > updated_at: number, > acus_consumed: number, > pull_requests: { > url?: string > }[], > title?: string | null, > user_id?: string | null, > status_detail?: string | null, > structured_output?: { > } | null, > playbook_id?: string | null, > parent_session_id?: string | null > }[] > ``` *** ### sendMessage `session.sendMessage` Send a follow-up message to an existing Devin session **Risk:** `write` ```ts theme={null} await corsair.devinmcp.api.session.sendMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_id` | `string` | Yes | — | | `session_id` | `string` | Yes | — | | `message` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `status` | `string` | Yes | — | | `tags` | `string[]` | Yes | — | | `org_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `updated_at` | `number` | Yes | — | | `acus_consumed` | `number` | Yes | — | | `pull_requests` | `object[]` | Yes | — | | `title` | `string` | No | — | | `user_id` | `string` | No | — | | `status_detail` | `string` | No | — | | `structured_output` | `object` | No | — | | `playbook_id` | `string` | No | — | | `parent_session_id` | `string` | No | — | > **pull\_requests full type** > > ```ts theme={null} > { > url?: string > }[] > ``` > **structured\_output full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/devinmcp/database Devin MCP local sync: searchable entities, `.search()` filters, and operators. The Devin MCP plugin syncs data locally. Use `corsair.devinmcp.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/devinmcp/overview MCP integration for Devin AI software engineering agent capabilities and tooling. Use **Devin MCP** through Corsair: one client, typed API calls. **What you get:** * 4 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/devinmcp ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/devinmcp ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/devinmcp ``` ```bash bun theme={null} bun add corsair @corsair-dev/devinmcp ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { devinmcp } from '@corsair-dev/devinmcp'; export const corsair = createCorsair({ plugins: [ devinmcp(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} devinmcp() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'devinmcp', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`session.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.devinmcp.api.session.get({}); ``` **`session.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.devinmcp.api.session.create({}); ``` See the full list on the [API](/plugins/devinmcp/api) page. ## What's next > **[API reference](/plugins/devinmcp/api)** > > Every `devinmcp.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/diffbot/api API reference for Diffbot: every `diffbot.api.*` operation with input and output types. Every `diffbot.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getAccount `account.getAccount` Retrieve Diffbot account details, credit balance, and plan usage **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.account.getAccount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `plan` | `string` | No | — | | `planStart` | `string` | No | — | | `planCalls` | `number` | No | — | | `apiCalls` | `number` | No | — | | `status` | `string` | No | — | *** ## Bulk ### createBulk `bulk.createBulk` Submit an asynchronous bulk extract job to process multiple URLs **Risk:** `write` ```ts theme={null} await corsair.diffbot.api.bulk.createBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the bulk job (unique per token) | | `apiUrl` | `string` | Yes | Full Diffbot Extract API URL (e.g. "[https://api.diffbot.com/v3/article](https://api.diffbot.com/v3/article)") | | `urls` | `string[]` | Yes | Array of URLs to process with the Extract API | | `notifyEmail` | `string` | No | Email to notify when processing is completed | | `maxRounds` | `number` | No | Max rounds of URL processing | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `string` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `message` | `string` | No | — | *** ### getBulkData `bulk.getBulkData` Download extracted results from a completed bulk extract job **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.bulk.getBulkData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | The name of the completed bulk job to download | | `format` | `json \| csv` | No | Download format (default json) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `data` | `any` | No | — | *** ### listBulkJobs `bulk.listBulkJobs` List all bulk extract jobs associated with the token **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.bulk.listBulkJobs({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `jobs` | `object[]` | No | — | > **jobs full type** > > ```ts theme={null} > { > }[] > ``` *** ### startBulk `bulk.startBulk` Start a bulk extract job using query parameters **Risk:** `write` ```ts theme={null} await corsair.diffbot.api.bulk.startBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Unique name for the bulk extract job | | `apiUrl` | `string` | Yes | Full Diffbot Extract API URL | | `urls` | `string` | Yes | Comma-separated or space-separated list of URLs to process | | `notifyEmail` | `string` | No | Notification email address | | `maxRounds` | `number` | No | Max rounds of URL processing | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `string` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | *** ### stopBulkJob `bulk.stopBulkJob` Pause or stop an active bulk extract job **Risk:** `write` ```ts theme={null} await corsair.diffbot.api.bulk.stopBulkJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | The name of the bulk extract job to pause/stop | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `string` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | *** ## Crawl ### getCrawlData `crawl.getCrawlData` Download extracted data from a completed crawl job **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.crawl.getCrawlData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | The name of the completed crawl job to download | | `format` | `json \| csv` | No | Download format (default json) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `data` | `any` | No | — | *** ### manageCrawl `crawl.manageCrawl` Inspect, pause, restart, or delete crawl jobs **Risk:** `write` ```ts theme={null} await corsair.diffbot.api.crawl.manageCrawl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | The name of the crawl job to inspect or modify | | `pause` | `number` | No | Set to 1 to pause an active crawl job, 0 to resume | | `restart` | `number` | No | Set to 1 to restart a completed/paused crawl job | | `delete` | `number` | No | Set to 1 to delete a crawl job and its data | | `roundProxy` | `number` | No | Set to 1 to rotate proxy IP on each round | | `maxRounds` | `number` | No | Update max rounds | | `maxHops` | `number` | No | Update max hops | **Output** | Name | Type | Required | Description | | - | - | - | - | | `jobs` | `object[]` | No | — | | `response` | `string` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | > **jobs full type** > > ```ts theme={null} > { > }[] > ``` *** ### startCrawl `crawl.startCrawl` Initiate a website crawl job starting from seed URLs **Risk:** `write` ```ts theme={null} await corsair.diffbot.api.crawl.startCrawl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Unique name for the crawl job | | `seeds` | `string` | Yes | Space-separated seed URL(s) from which the crawl begins | | `apiUrl` | `string` | Yes | Full Diffbot Extract API URL used to process pages (e.g. "[https://api.diffbot.com/v3/article](https://api.diffbot.com/v3/article)") | | `maxHops` | `number` | No | Max depth of links to crawl from seeds (default -1 for no limit) | | `maxRounds` | `number` | No | Max rounds of repeat crawling for recurring crawls | | `maxTags` | `number` | No | Max tags to extract per page | | `crawlSubdomains` | `number` | No | Set to 1 to crawl subdomains of seeds | | `notifyEmail` | `string` | No | Email notification upon crawl completion | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `string` | No | — | | `name` | `string` | No | — | | `status` | `string` | No | — | *** ## Custom Api ### createCustomApi `customApi.createCustomApi` Create or update custom API rules and selectors for URL patterns **Risk:** `write` ```ts theme={null} await corsair.diffbot.api.customApi.createCustomApi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api` | `string` | Yes | Name of the custom API (e.g. "myCustomArticleApi") | | `url` | `string` | Yes | Sample URL that this custom API applies to | | `pattern` | `string` | No | URL regex pattern to match pages for this custom API | | `rules` | `object` | No | Extraction rules and CSS selector definitions | > **rules full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `string` | No | — | | `api` | `string` | No | — | | `url` | `string` | No | — | | `status` | `string` | No | — | *** ### deleteCustomApi `customApi.deleteCustomApi` Delete custom API definitions for a given URL pattern **Risk:** `destructive` ```ts theme={null} await corsair.diffbot.api.customApi.deleteCustomApi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api` | `string` | Yes | Name of the custom API to delete | | `url` | `string` | No | URL pattern or test URL of the custom API | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `string` | No | — | | `api` | `string` | No | — | | `status` | `string` | No | — | *** ### listCustomApis `customApi.listCustomApis` List all custom API definitions configured on the account **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.customApi.listCustomApis({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `customApis` | `object[]` | No | — | | `apis` | `object[]` | No | — | > **customApis full type** > > ```ts theme={null} > { > }[] > ``` > **apis full type** > > ```ts theme={null} > { > }[] > ``` *** ## Enhance ### combineEntityProfiles `enhance.combineEntityProfiles` Combine entity profiles into a unified view with organization affiliations **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.enhance.combineEntityProfiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | Person name | | `type` | `string` | No | Entity type (defaults to Person) | | `email` | `string` | No | Email address | | `employer` | `string` | No | Employer name or organization | | `url` | `string` | No | Profile URL or organization homepage | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `number` | No | — | | `hits` | `number` | No | — | | `kgversion` | `string` | No | — | | `data` | `object[]` | No | — | | `errors` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **errors full type** > > ```ts theme={null} > { > }[] > ``` *** ### enhanceEntity `enhance.enhanceEntity` Enrich person or organization data with Knowledge Graph records **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.enhance.enhanceEntity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | Entity name (person or organization) | | `type` | `string` | No | Entity type filter: "Organization" or "Person" | | `email` | `string` | No | Email address of the entity | | `employer` | `string` | No | Current employer of a Person entity | | `url` | `string` | No | Homepage or profile URL (e.g. LinkedIn / Website) | | `phone` | `string` | No | Phone number | | `location` | `string` | No | Location or address | | `size` | `number` | No | Number of matching entity records to return | | `refresh` | `boolean` | No | Force refresh data from live web sources | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `number` | No | — | | `hits` | `number` | No | — | | `kgversion` | `string` | No | — | | `request_ctx` | `object` | No | — | | `data` | `object[]` | No | — | | `errors` | `object[]` | No | — | > **request\_ctx full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > }[] > ``` > **errors full type** > > ```ts theme={null} > { > }[] > ``` *** ### getKgCoverageReportById `enhance.getKgCoverageReportById` Download Knowledge Graph coverage report by report ID **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.enhance.getKgCoverageReportById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reportId` | `string` | Yes | Coverage report ID generated from DQL query or bulk job | | `bulkjobId` | `string` | No | Optional bulkjob ID associated with the report | **Output** | Name | Type | Required | Description | | - | - | - | - | | `reportId` | `string` | No | — | | `status` | `string` | No | — | | `coverage` | `object` | No | — | | `data` | `any` | No | — | | `csv` | `string` | No | — | > **coverage full type** > > ```ts theme={null} > { > } > ``` *** ### resolveLostId `enhance.resolveLostId` Resolve lost or legacy identifiers to canonical Knowledge Graph entities **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.enhance.resolveLostId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The lost or non-canonical identifier to resolve | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `canonicalId` | `string` | No | — | | `diffbotUri` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `hits` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ## Extract ### extractJob `extract.extractJob` Extract structured job posting data including compensation, requirements, and company info **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.extract.extractJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the job posting page | | `fields` | `string` | No | Optional fields to return | | `timeout` | `number` | No | Timeout in milliseconds | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `objects` | `object[]` | Yes | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > type?: job, > title?: string, > description?: string, > company?: { > }, > locations?: string[], > employmentType?: string, > compensation?: { > }, > requirements?: string[], > skills?: string[], > postedDate?: string, > pageUrl?: string, > humanLanguage?: string, > diffbotUri?: string > }[] > ``` *** ### extractList `extract.extractList` Extract structured items from list-style pages, catalogs, and news indexes **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.extract.extractList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the list / directory / index page | | `fields` | `string` | No | Optional fields to return | | `timeout` | `number` | No | Timeout in milliseconds | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `objects` | `object[]` | Yes | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > type?: list, > title?: string, > numItems?: number, > items?: { > }[], > pageUrl?: string, > humanLanguage?: string > }[] > ``` *** ### getAnalyze `extract.getAnalyze` Automatically analyze web page to determine its type and extract structured data **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.extract.getAnalyze({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL to analyze — Diffbot auto-detects the page type | | `fields` | `string` | No | Comma-separated list of optional fields | | `timeout` | `number` | No | Timeout in milliseconds | | `fallback` | `string` | No | API to fall back to if page type cannot be detected (e.g. "article") | | `discussion` | `false \| true` | No | Set to "false" to disable comment extraction | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `type` | `string` | No | Detected page type (article, product, discussion, etc.) | | `humanLanguage` | `string` | No | — | | `title` | `string` | No | — | | `objects` | `object[]` | No | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > }[] > ``` *** ### getArticle `extract.getArticle` Extract article title, text, author, date, and metadata from any URL **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.extract.getArticle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the article to extract | | `fields` | `string` | No | Comma-separated list of optional fields (e.g. "links,meta") | | `timeout` | `number` | No | Timeout in milliseconds (default 30000) | | `paging` | `false \| true` | No | Set to "false" to disable automatic pagination following | | `maxTags` | `number` | No | Maximum number of tags to return | | `naturalLanguage` | `string` | No | Language hint for NLP | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `objects` | `object[]` | Yes | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > type?: article, > title?: string, > text?: string, > html?: string, > date?: string, > estimatedDate?: string, > author?: string, > authorUrl?: string, > siteName?: string, > pageUrl?: string, > resolvedPageUrl?: string, > humanLanguage?: string, > numPages?: number, > nextPage?: string, > nextPages?: string[], > images?: { > url?: string, > title?: string, > width?: number, > height?: number, > naturalWidth?: number, > naturalHeight?: number, > primary?: boolean, > xpath?: string, > attrTitle?: string, > attrAlt?: string, > caption?: string > }[], > videos?: { > }[], > tags?: { > id?: number, > label: string, > uri?: string, > types?: string[], > score?: number, > count?: number, > prevalence?: number, > rdfTypes?: string[] > }[], > links?: string[], > breadcrumb?: { > link?: string, > name?: string > }[], > publisherRegion?: string, > publisherCountry?: string, > sentiment?: number, > diffbotUri?: string > }[] > ``` *** ### getDiscussion `extract.getDiscussion` Extract structured discussion threads, forum posts, and comments from web pages **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.extract.getDiscussion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the discussion / forum / comment page | | `fields` | `string` | No | Optional fields to return | | `timeout` | `number` | No | Timeout in milliseconds | | `maxTags` | `number` | No | Max tags to return | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `objects` | `object[]` | Yes | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > type?: discussion, > title?: string, > text?: string, > numPosts?: number, > numParticipants?: number, > participants?: string[], > rssUrl?: string, > posts?: { > }[], > pageUrl?: string, > humanLanguage?: string, > diffbotUri?: string > }[] > ``` *** ### getEvent `extract.getEvent` Extract event details including dates, venues, organizers, and descriptions **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.extract.getEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the event page to extract | | `fields` | `string` | No | Optional fields to return | | `timeout` | `number` | No | Timeout in milliseconds | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `objects` | `object[]` | Yes | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > type?: event, > title?: string, > description?: string, > startDate?: string, > endDate?: string, > location?: string, > venue?: { > }, > organizer?: string, > ticketUrl?: string, > pageUrl?: string, > humanLanguage?: string, > diffbotUri?: string > }[] > ``` *** ### getImage `extract.getImage` Extract detailed image information including dimensions and recognition data **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.extract.getImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the page or image to extract | | `fields` | `string` | No | Optional fields to return | | `timeout` | `number` | No | Timeout in milliseconds | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `objects` | `object[]` | Yes | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > type?: image, > url?: string, > title?: string, > naturalHeight?: number, > naturalWidth?: number, > width?: number, > height?: number, > primary?: boolean, > xpath?: string, > attrTitle?: string, > attrAlt?: string, > caption?: string, > pageUrl?: string, > humanLanguage?: string, > diffbotUri?: string > }[] > ``` *** ### getProduct `extract.getProduct` Extract product price, availability, images, and specifications from any e-commerce URL **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.extract.getProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the product page to extract | | `fields` | `string` | No | Comma-separated list of optional fields | | `timeout` | `number` | No | Timeout in milliseconds (default 30000) | | `discussion` | `false \| true` | No | Set to "false" to disable review/discussion extraction | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `objects` | `object[]` | Yes | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > type?: product, > title?: string, > text?: string, > brand?: string, > offerPrice?: string, > offerPriceDetails?: { > amount?: number, > symbol?: string, > text?: string > }, > regularPrice?: string, > saveAmount?: string, > shippingAmount?: string, > availability?: boolean, > sku?: string, > mpn?: string, > upc?: string, > isbn?: string, > images?: { > url?: string, > title?: string, > width?: number, > height?: number, > naturalWidth?: number, > naturalHeight?: number, > primary?: boolean, > xpath?: string, > attrTitle?: string, > attrAlt?: string, > caption?: string > }[], > offers?: { > }[], > colors?: string[], > pageUrl?: string, > humanLanguage?: string, > tags?: { > id?: number, > label: string, > uri?: string, > types?: string[], > score?: number, > count?: number, > prevalence?: number, > rdfTypes?: string[] > }[], > diffbotUri?: string > }[] > ``` *** ### getVideo `extract.getVideo` Extract structured metadata from videos including embed HTML and durations **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.extract.getVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the video page to extract | | `fields` | `string` | No | Optional fields to return | | `timeout` | `number` | No | Timeout in milliseconds | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `objects` | `object[]` | Yes | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **objects full type** > > ```ts theme={null} > { > type?: video, > url?: string, > title?: string, > naturalHeight?: number, > naturalWidth?: number, > duration?: number, > viewCount?: number, > uploadDate?: string, > author?: string, > embedUrl?: string, > html?: string, > pageUrl?: string, > humanLanguage?: string, > diffbotUri?: string > }[] > ``` *** ## Kg Bulk Enhance ### createKgBulkEnhance `kgBulkEnhance.createKgBulkEnhance` Submit an asynchronous bulk enhance job for multiple entities **Risk:** `write` ```ts theme={null} await corsair.diffbot.api.kgBulkEnhance.createKgBulkEnhance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entities` | `object[]` | Yes | Array of entity objects to enhance | | `notifyEmail` | `string` | No | Email address to notify upon job completion | | `name` | `string` | No | Custom name for the bulk job | > **entities full type** > > ```ts theme={null} > { > name?: string, > type?: string, > email?: string, > employer?: string, > url?: string, > phone?: string, > location?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | No | — | | `job_id` | `string` | No | — | | `status` | `string` | No | — | | `total` | `number` | No | — | | `message` | `string` | No | — | *** ### deleteKgEnhanceBulkjob `kgBulkEnhance.deleteKgEnhanceBulkjob` Delete a Knowledge Graph bulk enhance job and its results **Risk:** `destructive` ```ts theme={null} await corsair.diffbot.api.kgBulkEnhance.deleteKgEnhanceBulkjob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | Yes | The ID of the bulk enhance job to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | No | — | | `status` | `string` | No | — | | `message` | `string` | No | — | *** ### downloadBulkResults `kgBulkEnhance.downloadBulkResults` Download bulk enhance results with filtering and custom output formats **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.kgBulkEnhance.downloadBulkResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | Yes | The ID of the bulk enhance job to download | | `format` | `json \| jsonl \| csv \| xls \| xlsx` | No | Export format | | `filter` | `string` | No | DQL filter criteria to apply to the output | | `fields` | `string` | No | Comma-separated list of fields to include | | `head` | `number` | No | Number of records to export | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | No | — | | `status` | `string` | No | — | | `data` | `object[]` | No | — | | `raw` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### getBulkJobStatus `kgBulkEnhance.getBulkJobStatus` Poll the status and progress of a Knowledge Graph bulk enhance job **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.kgBulkEnhance.getBulkJobStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | Yes | The ID of the bulk enhance job to check | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | No | — | | `status` | `string` | No | — | | `jobStatus` | `object` | No | — | | `total` | `number` | No | — | | `completed` | `number` | No | — | | `failed` | `number` | No | — | | `progress` | `number` | No | — | > **jobStatus full type** > > ```ts theme={null} > { > } > ``` *** ### getBulkResults `kgBulkEnhance.getBulkResults` Download results of a completed Knowledge Graph bulk enhance job **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.kgBulkEnhance.getBulkResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | Yes | The ID of the bulk enhance job to download | | `format` | `json \| jsonl \| csv \| xls \| xlsx` | No | Download output format (default jsonl) | | `head` | `number` | No | Preview only the first N results from the job | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | No | — | | `status` | `string` | No | — | | `data` | `object[]` | No | — | | `raw` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### getBulkSingleResult `kgBulkEnhance.getBulkSingleResult` Download single enriched entity result from a bulk enhance job by index **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.kgBulkEnhance.getBulkSingleResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | Yes | The bulk enhance job ID | | `jobIndex` | `number` | Yes | Zero-indexed position of the entity record within the bulk job | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | No | — | | `jobIndex` | `number` | No | — | | `data` | `object` | No | — | | `entity` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **entity full type** > > ```ts theme={null} > { > } > ``` *** ### listBulkJobsStatusForToken `kgBulkEnhance.listBulkJobsStatusForToken` List all Knowledge Graph bulk enhance jobs and their statuses for token **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.kgBulkEnhance.listBulkJobsStatusForToken({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `jobs` | `object[]` | No | — | | `bulkjobs` | `object[]` | No | — | > **jobs full type** > > ```ts theme={null} > { > }[] > ``` > **bulkjobs full type** > > ```ts theme={null} > { > }[] > ``` *** ### stopKgBulkJobById `kgBulkEnhance.stopKgBulkJobById` Stop or pause an active Knowledge Graph bulk enhance job by ID **Risk:** `write` ```ts theme={null} await corsair.diffbot.api.kgBulkEnhance.stopKgBulkJobById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | Yes | The ID of the bulk enhance job to pause/stop | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulkjobId` | `string` | No | — | | `status` | `string` | No | — | | `message` | `string` | No | — | *** ## Search ### search `search.search` Search the Diffbot Knowledge Graph using DQL (Diffbot Query Language) **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.search.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | DQL query string (e.g. "type:Organization name:\\"OpenAI\\"") | | `entityType` | `string` | No | Entity type filter prepended to query (e.g. "Organization") | | `queryType` | `query \| text \| queryTextFallback \| crawl` | No | Execution mode for the DQL request | | `size` | `number` | No | Number of results to return | | `from` | `number` | No | Zero-indexed offset for pagination | | `col` | `string` | No | Crawl collection name to query | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `number` | No | — | | `hits` | `number` | No | — | | `results` | `number` | No | — | | `kgversion` | `string` | No | — | | `diffbot_type` | `string` | No | — | | `facet` | `object` | No | — | | `data` | `object[]` | No | — | | `cursor` | `string` | No | — | > **facet full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### searchCrawlData `search.searchCrawlData` Query crawl job collections using DQL or keyword search **Risk:** `read` ```ts theme={null} await corsair.diffbot.api.search.searchCrawlData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `col` | `string` | Yes | The name of the crawl job collection to search | | `query` | `string` | Yes | Search query string or DQL filter | | `num` | `number` | No | Number of results to return (max 25) | | `start` | `number` | No | Zero-indexed offset for pagination | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request` | `object` | No | — | | `results` | `object[]` | No | — | | `numResults` | `number` | No | — | | `hits` | `number` | No | — | > **request full type** > > ```ts theme={null} > { > pageUrl?: string, > api?: string, > version?: number > } > ``` > **results full type** > > ```ts theme={null} > { > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/diffbot/database Diffbot local sync: searchable entities, `.search()` filters, and operators. The Diffbot plugin syncs data locally. Use `corsair.diffbot.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `diffbot.db.accounts.search` ```ts theme={null} const rows = await corsair.diffbot.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `token` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `plan` | `string` | equals, contains, startsWith, endsWith, in | | `planStart` | `string` | equals, contains, startsWith, endsWith, in | | `planCalls` | `number` | equals, gt, gte, lt, lte, in | | `apiCalls` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Articles Path: `diffbot.db.articles.search` ```ts theme={null} const rows = await corsair.diffbot.db.articles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `pageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedPageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `html` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `estimatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `authorUrl` | `string` | equals, contains, startsWith, endsWith, in | | `siteName` | `string` | equals, contains, startsWith, endsWith, in | | `humanLanguage` | `string` | equals, contains, startsWith, endsWith, in | | `numPages` | `number` | equals, gt, gte, lt, lte, in | | `nextPage` | `string` | equals, contains, startsWith, endsWith, in | | `publisherRegion` | `string` | equals, contains, startsWith, endsWith, in | | `publisherCountry` | `string` | equals, contains, startsWith, endsWith, in | | `sentiment` | `number` | equals, gt, gte, lt, lte, in | | `diffbotUri` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Bulk Jobs Path: `diffbot.db.bulkJobs.search` ```ts theme={null} const rows = await corsair.diffbot.db.bulkJobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `bulkjobId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `total` | `number` | equals, gt, gte, lt, lte, in | | `completed` | `number` | equals, gt, gte, lt, lte, in | | `failed` | `number` | equals, gt, gte, lt, lte, in | | `format` | `string` | equals, contains, startsWith, endsWith, in | | `apiUrl` | `string` | equals, contains, startsWith, endsWith, in | | `urls` | `string` | equals, contains, startsWith, endsWith, in | | `downloadUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Crawl Jobs Path: `diffbot.db.crawlJobs.search` ```ts theme={null} const rows = await corsair.diffbot.db.crawlJobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `sentToCrawler` | `number` | equals, gt, gte, lt, lte, in | | `objectsHarvested` | `number` | equals, gt, gte, lt, lte, in | | `urlsHarvested` | `number` | equals, gt, gte, lt, lte, in | | `pageRounds` | `number` | equals, gt, gte, lt, lte, in | | `maxRounds` | `number` | equals, gt, gte, lt, lte, in | | `maxHops` | `number` | equals, gt, gte, lt, lte, in | | `pause` | `number` | equals, gt, gte, lt, lte, in | | `roundProxy` | `number` | equals, gt, gte, lt, lte, in | | `seeds` | `string` | equals, contains, startsWith, endsWith, in | | `apiUrl` | `string` | equals, contains, startsWith, endsWith, in | | `downloadUrl` | `string` | equals, contains, startsWith, endsWith, in | | `maxTags` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Custom Apis Path: `diffbot.db.customApis.search` ```ts theme={null} const rows = await corsair.diffbot.db.customApis.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `api` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `pattern` | `string` | equals, contains, startsWith, endsWith, in | | `testUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Discussions Path: `diffbot.db.discussions.search` ```ts theme={null} const rows = await corsair.diffbot.db.discussions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `pageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedPageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `numPosts` | `number` | equals, gt, gte, lt, lte, in | | `numParticipants` | `number` | equals, gt, gte, lt, lte, in | | `rssUrl` | `string` | equals, contains, startsWith, endsWith, in | | `humanLanguage` | `string` | equals, contains, startsWith, endsWith, in | | `diffbotUri` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Events Path: `diffbot.db.events.search` ```ts theme={null} const rows = await corsair.diffbot.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `pageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedPageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `endDate` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `organizer` | `string` | equals, contains, startsWith, endsWith, in | | `ticketUrl` | `string` | equals, contains, startsWith, endsWith, in | | `humanLanguage` | `string` | equals, contains, startsWith, endsWith, in | | `diffbotUri` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Images Path: `diffbot.db.images.search` ```ts theme={null} const rows = await corsair.diffbot.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `pageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedPageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `naturalHeight` | `number` | equals, gt, gte, lt, lte, in | | `naturalWidth` | `number` | equals, gt, gte, lt, lte, in | | `width` | `number` | equals, gt, gte, lt, lte, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `primary` | `boolean` | equals | | `xpath` | `string` | equals, contains, startsWith, endsWith, in | | `attrTitle` | `string` | equals, contains, startsWith, endsWith, in | | `attrAlt` | `string` | equals, contains, startsWith, endsWith, in | | `caption` | `string` | equals, contains, startsWith, endsWith, in | | `humanLanguage` | `string` | equals, contains, startsWith, endsWith, in | | `diffbotUri` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `diffbot.db.jobs.search` ```ts theme={null} const rows = await corsair.diffbot.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `pageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedPageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `employmentType` | `string` | equals, contains, startsWith, endsWith, in | | `postedDate` | `string` | equals, contains, startsWith, endsWith, in | | `humanLanguage` | `string` | equals, contains, startsWith, endsWith, in | | `diffbotUri` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `diffbot.db.lists.search` ```ts theme={null} const rows = await corsair.diffbot.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `pageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedPageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `numItems` | `number` | equals, gt, gte, lt, lte, in | | `humanLanguage` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `diffbot.db.organizations.search` ```ts theme={null} const rows = await corsair.diffbot.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `diffbotUri` | `string` | equals, contains, startsWith, endsWith, in | | `homepageUri` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `logo` | `string` | equals, contains, startsWith, endsWith, in | | `image` | `string` | equals, contains, startsWith, endsWith, in | | `nbEmployees` | `number` | equals, gt, gte, lt, lte, in | | `nbEmployeesMin` | `number` | equals, gt, gte, lt, lte, in | | `nbEmployeesMax` | `number` | equals, gt, gte, lt, lte, in | | `revenue` | `number` | equals, gt, gte, lt, lte, in | | `isPublic` | `boolean` | equals | | `isNonProfit` | `boolean` | equals | | `isAcquired` | `boolean` | equals | | `isDissolved` | `boolean` | equals | | `totalInvestment` | `number` | equals, gt, gte, lt, lte, in | | `linkedInUri` | `string` | equals, contains, startsWith, endsWith, in | | `twitterUri` | `string` | equals, contains, startsWith, endsWith, in | | `facebookUri` | `string` | equals, contains, startsWith, endsWith, in | | `githubUri` | `string` | equals, contains, startsWith, endsWith, in | | `wikipediaUri` | `string` | equals, contains, startsWith, endsWith, in | | `crunchbaseUri` | `string` | equals, contains, startsWith, endsWith, in | | `angellistUri` | `string` | equals, contains, startsWith, endsWith, in | | `naicsClassification` | `string` | equals, contains, startsWith, endsWith, in | | `sicClassification` | `string` | equals, contains, startsWith, endsWith, in | | `naceClassification` | `string` | equals, contains, startsWith, endsWith, in | | `crawlTimestamp` | `number` | equals, gt, gte, lt, lte, in | | `importance` | `number` | equals, gt, gte, lt, lte, in | | `origin` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## People Path: `diffbot.db.people.search` ```ts theme={null} const rows = await corsair.diffbot.db.people.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `diffbotUri` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `image` | `string` | equals, contains, startsWith, endsWith, in | | `gender` | `string` | equals, contains, startsWith, endsWith, in | | `birthDate` | `string` | equals, contains, startsWith, endsWith, in | | `deathDate` | `string` | equals, contains, startsWith, endsWith, in | | `linkedInUri` | `string` | equals, contains, startsWith, endsWith, in | | `twitterUri` | `string` | equals, contains, startsWith, endsWith, in | | `facebookUri` | `string` | equals, contains, startsWith, endsWith, in | | `githubUri` | `string` | equals, contains, startsWith, endsWith, in | | `wikipediaUri` | `string` | equals, contains, startsWith, endsWith, in | | `crunchbaseUri` | `string` | equals, contains, startsWith, endsWith, in | | `angellistUri` | `string` | equals, contains, startsWith, endsWith, in | | `homepageUri` | `string` | equals, contains, startsWith, endsWith, in | | `crawlTimestamp` | `number` | equals, gt, gte, lt, lte, in | | `importance` | `number` | equals, gt, gte, lt, lte, in | | `origin` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Products Path: `diffbot.db.products.search` ```ts theme={null} const rows = await corsair.diffbot.db.products.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `pageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedPageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `brand` | `string` | equals, contains, startsWith, endsWith, in | | `offerPrice` | `string` | equals, contains, startsWith, endsWith, in | | `regularPrice` | `string` | equals, contains, startsWith, endsWith, in | | `saveAmount` | `string` | equals, contains, startsWith, endsWith, in | | `shippingAmount` | `string` | equals, contains, startsWith, endsWith, in | | `availability` | `boolean` | equals | | `sku` | `string` | equals, contains, startsWith, endsWith, in | | `mpn` | `string` | equals, contains, startsWith, endsWith, in | | `upc` | `string` | equals, contains, startsWith, endsWith, in | | `isbn` | `string` | equals, contains, startsWith, endsWith, in | | `humanLanguage` | `string` | equals, contains, startsWith, endsWith, in | | `diffbotUri` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Videos Path: `diffbot.db.videos.search` ```ts theme={null} const rows = await corsair.diffbot.db.videos.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `pageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedPageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `naturalHeight` | `number` | equals, gt, gte, lt, lte, in | | `naturalWidth` | `number` | equals, gt, gte, lt, lte, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `viewCount` | `number` | equals, gt, gte, lt, lte, in | | `uploadDate` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `embedUrl` | `string` | equals, contains, startsWith, endsWith, in | | `html` | `string` | equals, contains, startsWith, endsWith, in | | `humanLanguage` | `string` | equals, contains, startsWith, endsWith, in | | `diffbotUri` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/diffbot/overview Knowledge graph and web extraction API for structured data from articles and pages. Use **Diffbot** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 35 typed API operations * 14 synced entities (`accounts`, `articles`, `bulkJobs`, `crawlJobs`, `customApis`, `discussions`, and 8 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/diffbot ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/diffbot ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/diffbot ``` ```bash bun theme={null} bun add corsair @corsair-dev/diffbot ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { diffbot } from '@corsair-dev/diffbot'; export const corsair = createCorsair({ plugins: [ diffbot(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} diffbot() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'diffbot', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getAccount`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.diffbot.api.account.getAccount({}); ``` **`bulk.createBulk`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.diffbot.api.bulk.createBulk({}); ``` See the full list on the [API](/plugins/diffbot/api) page. ## Query synced data Synced entities support `tenant.diffbot.db..search()` and `.list()`: `accounts`, `articles`, `bulkJobs`, `crawlJobs`, `customApis`, `discussions`, `events`, `images`, `jobs`, `lists`, `organizations`, `people`, `products`, `videos`. See [Database](/plugins/diffbot/database) for filters and operators. ## What's next > **[API reference](/plugins/diffbot/api)** > > Every `diffbot.api.*` operation with input and output types. > **[Database](/plugins/diffbot/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/digitalocean/api API reference for DigitalOcean: every `digitalocean.api.*` operation with input and output types. Every `digitalocean.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Databases ### createDatabaseCluster `databases.createDatabaseCluster` Creates a new managed database cluster on DigitalOcean. Provisions a database with specified engine (PostgreSQL, MySQL, Valkey, MongoDB, Kafka, or OpenSearch), version, region, size, and node count. Returns connection credentials and cluster details. The cluster will be in 'creating' status initially and take several minutes to become fully operational. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.databases.createDatabaseCluster({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `size` | `string` | Yes | — | | `tags` | `any[]` | No | — | | `engine` | `string` | No | — | | `region` | `string` | Yes | — | | `version` | `string` | Yes | — | | `db_names` | `any[]` | No | — | | `sql_mode` | `string` | No | — | | `num_nodes` | `number` | Yes | — | | `user_names` | `any[]` | No | — | | `backup_restore` | `object` | No | — | | `eviction_policy` | `string` | No | — | | `storage_size_gb` | `number` | No | — | | `maintenance_window` | `object` | No | — | | `private_network_uuid` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **backup\_restore full type** > > ```ts theme={null} > { > } > ``` > **maintenance\_window full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDatabaseCluster `databases.deleteDatabaseCluster` Tool to delete a database cluster by UUID. Use when you have confirmed the cluster is no longer needed. Returns HTTP 204 No Content on success. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.databases.deleteDatabaseCluster({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `database_cluster_uuid` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllDatabases `databases.listAllDatabases` Tool to list all managed database clusters on your account. Supports pagination and filtering by tag. A single request returns only one page; iterate using `page` and `per_page` to retrieve all clusters. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.databases.listAllDatabases({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `tag_name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listDatabaseOptions `databases.listDatabaseOptions` Lists all available configuration options for DigitalOcean managed database clusters, including supported engines (PostgreSQL, MySQL, MongoDB, Valkey, Kafka, OpenSearch), versions, regions, and cluster sizes/layouts. Use this to discover valid parameter values when creating a new database cluster. #### Output | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string | Yes | Data from the action execution | | `error` | string | No | Error if any occurred during the execution of the action | | `successful` | boolean | Yes | Whether or not the action execution was successful or not | **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.databases.listDatabaseOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Domain Records ### createNewDomainRecord `domainRecords.createNewDomainRecord` Tool to create a new DNS record for a domain. Use after confirming domain exists and record specifics. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.domainRecords.createNewDomainRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `string` | No | — | | `ttl` | `number` | No | — | | `data` | `string` | Yes | — | | `name` | `string` | No | — | | `port` | `number` | No | — | | `type` | `string` | No | — | | `flags` | `number` | No | — | | `weight` | `number` | No | — | | `priority` | `number` | No | — | | `domain_name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDomainRecord `domainRecords.deleteDomainRecord` Tool to delete a DNS record by its record ID for a domain. Use when you need to remove an existing DNS record and have the domain name and record ID. Returns HTTP 204 No Content on success. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.domainRecords.deleteDomainRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain_name` | `string` | Yes | — | | `record_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listDomainRecords `domainRecords.listDomainRecords` Tool to list all DNS records for a domain. Use when you need to inspect or filter a domain's DNS configuration. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.domainRecords.listDomainRecords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `type` | `string` | No | — | | `per_page` | `number` | No | — | | `domain_name` | `string` | Yes | — | | `record_name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### retrieveDomainRecord `domainRecords.retrieveDomainRecord` Tool to retrieve a specific DNS record for a domain by its record ID. Use when you have the domain name and record ID to fetch record details. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.domainRecords.retrieveDomainRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain_name` | `string` | Yes | — | | `record_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDomainRecord `domainRecords.updateDomainRecord` Tool to update an existing DNS record for a domain. Use when you need to modify any valid attribute of a record after confirming its record ID. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.domainRecords.updateDomainRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `string` | No | — | | `ttl` | `number` | No | — | | `data` | `string` | No | — | | `name` | `string` | No | — | | `port` | `number` | No | — | | `type` | `string` | No | — | | `flags` | `number` | No | — | | `weight` | `number` | No | — | | `priority` | `number` | No | — | | `record_id` | `number` | Yes | — | | `domain_name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Domains ### createNewDomain `domains.createNewDomain` Creates a new domain in DigitalOcean's DNS management system. This adds the domain to your DigitalOcean account and allows you to manage its DNS records. Use this action when you need to: - Add a domain to DigitalOcean DNS for DNS hosting and management - Set up a new domain with an optional initial A record pointing to an IP address - Transfer DNS management of an existing domain to DigitalOcean Note: The domain name must be unique within your DigitalOcean account and use a recognized top-level domain (TLD). After creation, you can add additional DNS records using the create domain record action. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.domains.createNewDomain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `ip_address` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDomain `domains.deleteDomain` Deletes a domain from DigitalOcean DNS. This action is permanent and cannot be undone. Note: If the domain is associated with a Let's Encrypt certificate, delete the certificate first and reconfigure any resources using it (e.g., load balancer SSL termination, Spaces CDN endpoints). Returns 204 No Content on successful deletion. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.domains.deleteDomain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllDomains `domains.listAllDomains` Lists all DNS domains configured in your DigitalOcean account. Returns domain names, TTL values, and complete zone files. Supports pagination for large domain lists. Use this action to discover available domains, check domain configurations, or as a prerequisite for domain-specific operations like managing DNS records. No parameters are required - calling without parameters returns the first 20 domains (default page size). **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.domains.listAllDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### retrieveDomain `domains.retrieveDomain` Retrieves complete details about a specific domain including its TTL and DNS zone file configuration. Use this when you need to check domain settings, verify DNS configuration, or get the full zone file contents for a domain in your DigitalOcean account. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.domains.retrieveDomain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Droplets ### createNewDroplet `droplets.createNewDroplet` Tool to create a new Droplet. Use when you need to provision a VM with name, region, size, and image. The `image`, `region`, and `size` must be mutually compatible — the chosen `region` must be listed in the image's available regions. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.droplets.createNewDroplet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ipv6` | `boolean` | No | — | | `name` | `string` | Yes | — | | `size` | `string` | Yes | — | | `tags` | `any[]` | No | — | | `image` | `string` | Yes | — | | `region` | `string` | Yes | — | | `backups` | `boolean` | No | — | | `volumes` | `any[]` | No | — | | `ssh_keys` | `any[]` | No | — | | `vpc_uuid` | `string` | No | — | | `user_data` | `string` | No | — | | `monitoring` | `boolean` | No | — | | `private_networking` | `boolean` | No | — | | `with_droplet_agent` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteExistingDroplet `droplets.deleteExistingDroplet` Tool to delete a Droplet by ID. Deletion is irreversible — all data is permanently lost. Confirm droplet\_id with the user and verify a backup or snapshot exists before proceeding. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.droplets.deleteExistingDroplet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `droplet_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllDroplets `droplets.listAllDroplets` Lists all Droplets (virtual machines) in your DigitalOcean account with pagination support. Returns detailed information including: ID, name, specs (memory, vCPUs, disk), status, networking (IP addresses), region, image, size, tags, and VPC. Supports filtering by tag and pagination for large result sets. Use this to get an overview of your infrastructure, find specific droplets, or monitor droplet status. Default page size is 20; accounts with more droplets require explicit pagination (increment `page`, up to `per_page=200`) to avoid silently incomplete results. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.droplets.listAllDroplets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `tag_name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### retrieveExistingDroplet `droplets.retrieveExistingDroplet` Retrieve detailed information about a specific DigitalOcean Droplet by its unique numeric ID. Returns comprehensive droplet details including: current status, specifications (memory, CPU, disk), networking configuration (IPv4/IPv6 addresses), image information, region, VPC, backup settings, attached volumes, and tags. Use this when you need to check a droplet's current state, configuration, or IP addresses. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.droplets.retrieveExistingDroplet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `droplet_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Firewalls ### createNewFirewall `firewalls.createNewFirewall` Creates a new cloud firewall with custom inbound and outbound rules. Use this action to set up network security rules that control traffic to and from your Droplets. You can specify rules using IP addresses (CIDR notation), Droplet IDs, tags, Load Balancer UUIDs, or Kubernetes cluster IDs. The firewall can be applied to specific Droplets, all Droplets with certain tags, or scoped to a VPC. Requires at least one inbound rule and one outbound rule. Supports tcp, udp, and icmp protocols. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.firewalls.createNewFirewall({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `tags` | `any[]` | No | — | | `vpc_uuid` | `string` | No | — | | `droplet_ids` | `any[]` | No | — | | `inbound_rules` | `any[]` | Yes | — | | `outbound_rules` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteFirewall `firewalls.deleteFirewall` Tool to delete a firewall by ID. Use when you have confirmed the firewall is no longer needed. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.firewalls.deleteFirewall({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `firewall_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllFirewalls `firewalls.listAllFirewalls` List all cloud firewalls configured in your DigitalOcean account. Returns comprehensive firewall details including inbound/outbound rules, associated droplets, tags, and status. Supports pagination for accounts with many firewalls. Use this to audit network security, discover existing firewall configurations, or retrieve firewall IDs for subsequent operations. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.firewalls.listAllFirewalls({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Images ### createCustomImage `images.createCustomImage` Creates a custom image in DigitalOcean by importing a Linux VM disk image from a publicly accessible URL. Use this action to upload custom OS images (Ubuntu, Debian, CentOS, Fedora, etc.) that can later be used to create Droplets. The image will be processed asynchronously and its status can be monitored via the returned image ID. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.images.createCustomImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `name` | `string` | Yes | — | | `tags` | `any[]` | No | — | | `region` | `string` | Yes | — | | `description` | `string` | No | — | | `distribution` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteImage `images.deleteImage` Deletes a user-created custom image or snapshot from your DigitalOcean account by its numeric ID. This action permanently removes the image and cannot be undone. Only custom images and snapshots you own can be deleted - attempting to delete distribution images or marketplace applications will fail with a 403 Forbidden error. Use this when cleaning up unused images that are no longer needed and have no dependent resources. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.images.deleteImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image_id` | `number` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllImages `images.listAllImages` Tool to list all images available on your account. Use after obtaining a valid API token to retrieve images optionally filtered by type, private visibility, or tag\_name. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.images.listAllImages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `type` | `string` | No | — | | `private` | `boolean` | No | — | | `per_page` | `number` | No | — | | `tag_name` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### retrieveExistingImage `images.retrieveExistingImage` Tool to retrieve information about an image by ID or slug. Use when you need detailed metadata for a known image. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.images.retrieveExistingImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Kubernetes ### createNewKubernetesCluster `kubernetes.createNewKubernetesCluster` Creates a new DigitalOcean Kubernetes (DOKS) cluster with managed control plane. Required: cluster name, region slug, Kubernetes version slug, and at least one node pool configuration. Optional: tags, auto-upgrade settings, maintenance policy, node labels/taints, and auto-scaling. The cluster will be created in 'provisioning' state and may take several minutes to become 'running'. Query /v2/kubernetes/options endpoint to get available regions, versions, and node sizes. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.kubernetes.createNewKubernetesCluster({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `tags` | `any[]` | No | — | | `region` | `string` | Yes | — | | `version` | `string` | Yes | — | | `node_pools` | `any[]` | Yes | — | | `auto_upgrade` | `boolean` | No | — | | `maintenance_policy` | `object` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **maintenance\_policy full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllKubernetesClusters `kubernetes.listAllKubernetesClusters` Tool to list all Kubernetes clusters on your account. Use when you need to enumerate every cluster and handle pagination. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.kubernetes.listAllKubernetesClusters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Load Balancers ### createNewLoadBalancer `loadBalancers.createNewLoadBalancer` Tool to create a new load balancer. Use after specifying region, forwarding rules, and targets. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.loadBalancers.createNewLoadBalancer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `string` | No | — | | `name` | `string` | Yes | — | | `region` | `string` | Yes | — | | `vpc_uuid` | `string` | No | — | | `algorithm` | `string` | No | — | | `droplet_ids` | `any[]` | No | — | | `health_check` | `object` | No | — | | `firewall_policy` | `string` | No | — | | `sticky_sessions` | `object` | No | — | | `forwarding_rules` | `any[]` | Yes | — | | `enable_proxy_protocol` | `boolean` | No | — | | `redirect_http_to_https` | `boolean` | No | — | | `enable_backend_keepalive` | `boolean` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **health\_check full type** > > ```ts theme={null} > { > } > ``` > **sticky\_sessions full type** > > ```ts theme={null} > { > } > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteLoadBalancer `loadBalancers.deleteLoadBalancer` Tool to delete a load balancer instance by ID. Use when you need to permanently remove an existing load balancer after confirming its ID. Returns 204 No Content on success. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.loadBalancers.deleteLoadBalancer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `load_balancer_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllLoadBalancers `loadBalancers.listAllLoadBalancers` List all load balancers in your DigitalOcean account with pagination support. Returns load balancer details including IDs, names, IP addresses, forwarding rules, health checks, sticky sessions, assigned Droplets, and region information. Use this to get an overview of all load balancers or to find specific load balancers by iterating through results. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.loadBalancers.listAllLoadBalancers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Snapshots ### listAllSnapshots `snapshots.listAllSnapshots` Tool to list all snapshots available on your DigitalOcean account. Use when you need to fetch and optionally filter snapshots by resource type (droplet or volume) and handle pagination for inventory or backup workflows. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.snapshots.listAllSnapshots({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `resource_type` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Ssh Keys ### createNewSshKey `sshKeys.createNewSshKey` Registers a new SSH public key with your DigitalOcean account. The registered key can then be automatically added to new Droplets during creation, enabling secure SSH access. The key must be provided in OpenSSH format (ssh-rsa, ssh-ed25519, etc.) and must not already exist on the account. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.sshKeys.createNewSshKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `public_key` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteSshKey `sshKeys.deleteSshKey` Tool to delete a public SSH key. Use when you need to remove an SSH key from your account by its ID or fingerprint after confirming its ownership. Returns 204 No Content on success. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.sshKeys.deleteSshKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key_id_or_fingerprint` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllSshKeys `sshKeys.listAllSshKeys` Lists all SSH keys associated with your DigitalOcean account. Returns SSH key details including ID, name, public key content, and fingerprint. Supports pagination for accounts with many SSH keys. Use this when you need to view available SSH keys or retrieve an SSH key ID for use with other operations like creating droplets. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.sshKeys.listAllSshKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Tags ### createNewTag `tags.createNewTag` Creates a new tag in DigitalOcean for organizing and grouping resources. Tags can be applied to droplets, images, volumes, volume snapshots, and databases. If a tag with the same name already exists, the API returns the existing tag (idempotent operation). Tag names must be 1-255 characters containing only letters, numbers, hyphens, or underscores. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.tags.createNewTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteTag `tags.deleteTag` Deletes a tag from your DigitalOcean account. When a tag is deleted, it is automatically removed from all resources that were tagged with it. This operation is idempotent - deleting a non-existent tag will also return success (204 No Content). **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.tags.deleteTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllTags `tags.listAllTags` Tool to list all tags in your account. Use when you need to retrieve available tags and pagination info. A single request returns only one page of results; iterate using `page` and `per_page` to retrieve all tags. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.tags.listAllTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### retrieveTag `tags.retrieveTag` Tool to retrieve an individual tag by name. Use when you need to inspect the resources grouped under a specific tag. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.tags.retrieveTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### tagResource `tags.tagResource` Tool to tag resources by name. Use when you need to assign an existing tag to one or more resources. Returns 204 No Content on success. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.tags.tagResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_name` | `string` | Yes | — | | `resources` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### untagResource `tags.untagResource` Tool to untag resources by tag name. Use when you need to remove an existing tag from multiple resources in a single operation. **Risk:** `destructive` ```ts theme={null} await corsair.digitalocean.api.tags.untagResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_name` | `string` | Yes | — | | `resources` | `any[]` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Volumes ### createNewBlockStorageVolume `volumes.createNewBlockStorageVolume` Tool to create a new block storage volume. Use when you need to provision persistent block storage after confirming the target region supports volumes. Example: "Create a 100 GiB ext4 backup volume named 'db-backup' in nyc1." **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.volumes.createNewBlockStorageVolume({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `tags` | `any[]` | No | — | | `region` | `string` | Yes | — | | `description` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `size_gigabytes` | `number` | Yes | — | | `filesystem_type` | `string` | No | — | | `filesystem_label` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteBlockStorageVolume `volumes.deleteBlockStorageVolume` Permanently deletes a block storage volume by its unique ID. Use this tool when you need to remove an existing volume. The volume must not be attached to any Droplet before deletion. This operation cannot be undone. Returns HTTP 204 No Content on success. Note: To delete by volume name instead of ID, you would need a different endpoint that accepts both name and region parameters. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.volumes.deleteBlockStorageVolume({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `volume_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllVolumes `volumes.listAllVolumes` Tool to list all block storage volumes available on your account. Use when you need to retrieve volumes and optionally filter by name and region. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.volumes.listAllVolumes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `page` | `number` | No | — | | `region` | `string` | No | — | | `per_page` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Vpcs ### createNewVpc `vpcs.createNewVpc` Creates a new Virtual Private Cloud (VPC) in a specified DigitalOcean region. VPCs are private networks for isolating your resources. Traffic within a VPC is free and doesn't count toward bandwidth limits. VPCs support Droplets, managed databases, load balancers, and Kubernetes clusters. The first VPC created in a region automatically becomes the default VPC for that region. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.vpcs.createNewVpc({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `tags` | `any[]` | No | — | | `region` | `string` | Yes | — | | `ip_range` | `string` | No | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteVpc `vpcs.deleteVpc` Delete a VPC (Virtual Private Cloud) by its unique identifier. Use this tool when you need to permanently remove a VPC from your DigitalOcean account. Deletion is irreversible — always confirm the vpc\_id with the user before proceeding. **Important Restrictions:** - Cannot delete a VPC that is the default VPC for its region - Cannot delete a VPC that has member resources (droplets, databases, load balancers, etc.) — all resources must be detached or migrated first - VPC must be empty before deletion Returns an empty response (HTTP 204) on successful deletion. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.digitalocean.api.vpcs.deleteVpc({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vpc_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllVpcs `vpcs.listAllVpcs` Tool to list all VPCs on your account. Use when you need an inventory of your VPC resources. A single request returns only one page; iterate through all pages using `page` and `per_page` (max 200) to retrieve the complete set. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.vpcs.listAllVpcs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### retrieveVpc `vpcs.retrieveVpc` Tool to retrieve details about a specific VPC by its ID. Use when you need to inspect VPC properties for configuration or auditing. **Risk:** `read` ```ts theme={null} await corsair.digitalocean.api.vpcs.retrieveVpc({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vpc_uuid` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateVpc `vpcs.updateVpc` Tool to update information about a VPC. Use when you need to modify the name, description, or default status of an existing VPC. **Risk:** `write` ```ts theme={null} await corsair.digitalocean.api.vpcs.updateVpc({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `vpc_id` | `string` | Yes | — | | `default` | `boolean` | No | — | | `description` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/digitalocean/database DigitalOcean local sync: searchable entities, `.search()` filters, and operators. The DigitalOcean plugin syncs data locally. Use `corsair.digitalocean.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Databases Path: `digitalocean.db.databases.search` ```ts theme={null} const rows = await corsair.digitalocean.db.databases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `engine` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Droplets Path: `digitalocean.db.droplets.search` ```ts theme={null} const rows = await corsair.digitalocean.db.droplets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Volumes Path: `digitalocean.db.volumes.search` ```ts theme={null} const rows = await corsair.digitalocean.db.volumes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `size_gigabytes` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/digitalocean/overview Cloud infrastructure provider for droplets, Kubernetes, databases, and developer hosting. Use **DigitalOcean** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 47 typed API operations * 3 synced entities (`databases`, `droplets`, `volumes`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/digitalocean ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/digitalocean ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/digitalocean ``` ```bash bun theme={null} bun add corsair @corsair-dev/digitalocean ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { digitalocean } from '@corsair-dev/digitalocean'; export const corsair = createCorsair({ plugins: [ digitalocean(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} digitalocean() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'digitalocean', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`databases.listAllDatabases`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.digitalocean.api.databases.listAllDatabases({}); ``` **`databases.createDatabaseCluster`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.digitalocean.api.databases.createDatabaseCluster({}); ``` See the full list on the [API](/plugins/digitalocean/api) page. ## Query synced data Synced entities support `tenant.digitalocean.db..search()` and `.list()`: `databases`, `droplets`, `volumes`. See [Database](/plugins/digitalocean/database) for filters and operators. ## What's next > **[API reference](/plugins/digitalocean/api)** > > Every `digitalocean.api.*` operation with input and output types. > **[Database](/plugins/digitalocean/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/discord/api API reference for Discord: every `discord.api.*` operation with input and output types. Every `discord.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Channels ### list `channels.list` List channels in a guild **Risk:** `read` ```ts theme={null} await corsair.discord.api.channels.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `guild_id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: number, > guild_id?: string, > name?: string | null, > topic?: string | null, > position?: number, > parent_id?: string | null, > last_message_id?: string | null, > owner_id?: string, > thread_metadata?: { > archived: boolean, > auto_archive_duration: number, > archive_timestamp: string, > locked: boolean, > invitable?: boolean > } > }[] > ``` *** ## Guilds ### get `guilds.get` Get info about a guild **Risk:** `read` ```ts theme={null} await corsair.discord.api.guilds.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `guild_id` | `string` | Yes | — | | `with_counts` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `icon` | `string` | No | — | | `splash` | `string` | No | — | | `owner_id` | `string` | Yes | — | | `afk_timeout` | `number` | Yes | — | | `verification_level` | `number` | Yes | — | | `default_message_notifications` | `number` | Yes | — | | `explicit_content_filter` | `number` | Yes | — | | `roles` | `object[]` | Yes | — | | `features` | `string[]` | Yes | — | | `mfa_level` | `number` | Yes | — | | `description` | `string` | No | — | | `premium_tier` | `number` | Yes | — | | `premium_subscription_count` | `number` | No | — | | `preferred_locale` | `string` | Yes | — | | `approximate_member_count` | `number` | No | — | | `approximate_presence_count` | `number` | No | — | > **roles full type** > > ```ts theme={null} > { > id: string, > name: string, > permissions: string, > position: number, > color: number, > hoist: boolean, > managed: boolean, > mentionable: boolean > }[] > ``` *** ### list `guilds.list` List guilds the bot is a member of **Risk:** `read` ```ts theme={null} await corsair.discord.api.guilds.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `before` | `string` | No | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `with_counts` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > icon?: string | null, > owner: boolean, > permissions: string, > features: string[], > approximate_member_count?: number, > approximate_presence_count?: number > }[] > ``` *** ## Members ### get `members.get` Get info about a guild member **Risk:** `read` ```ts theme={null} await corsair.discord.api.members.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `guild_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | | `nick` | `string` | No | — | | `avatar` | `string` | No | — | | `roles` | `string[]` | Yes | — | | `joined_at` | `string` | Yes | — | | `premium_since` | `string` | No | — | | `deaf` | `boolean` | Yes | — | | `mute` | `boolean` | Yes | — | | `flags` | `number` | Yes | — | | `pending` | `boolean` | No | — | > **user full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > } > ``` *** ### list `members.list` List members of a guild **Risk:** `read` ```ts theme={null} await corsair.discord.api.members.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `guild_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > nick?: string | null, > avatar?: string | null, > roles: string[], > joined_at: string, > premium_since?: string | null, > deaf: boolean, > mute: boolean, > flags: number, > pending?: boolean > }[] > ``` *** ## Messages ### delete `messages.delete` Permanently delete a message **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.discord.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### edit `messages.edit` Edit an existing message **Risk:** `write` ```ts theme={null} await corsair.discord.api.messages.edit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | | `content` | `string` | No | — | | `embeds` | `object[]` | No | — | | `components` | `object[]` | No | — | | `allowed_mentions` | `object` | No | — | > **embeds full type** > > ```ts theme={null} > { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[] > ``` > **components full type** > > ```ts theme={null} > { > type: 1, > components: ( > { > type: 2, > style: number, > label?: string, > emoji?: { > id?: string, > name?: string, > animated?: boolean > }, > custom_id?: string, > url?: string, > sku_id?: string, > disabled?: boolean > } | { > type: 3, > custom_id: string, > options: { > label: string, > value: string, > description?: string, > emoji?: { > id?: string, > name?: string, > animated?: boolean > }, > default?: boolean > }[], > placeholder?: string, > min_values?: number, > max_values?: number, > disabled?: boolean > } | { > type: 5 | 6 | 7 | 8, > custom_id: string, > placeholder?: string, > min_values?: number, > max_values?: number, > channel_types?: number[], > disabled?: boolean > } > )[] > }[] > ``` > **allowed\_mentions full type** > > ```ts theme={null} > { > parse?: ('roles' | 'users' | 'everyone')[], > roles?: string[], > users?: string[], > replied_user?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | | `author` | `object` | Yes | — | | `content` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | | `edited_timestamp` | `string` | No | — | | `tts` | `boolean` | Yes | — | | `mention_everyone` | `boolean` | Yes | — | | `mentions` | `object[]` | Yes | — | | `mention_roles` | `string[]` | Yes | — | | `attachments` | `object[]` | Yes | — | | `embeds` | `object[]` | Yes | — | | `reactions` | `object[]` | No | — | | `pinned` | `boolean` | Yes | — | | `type` | `number` | Yes | — | | `flags` | `number` | No | — | | `components` | `object[]` | No | — | | `message_reference` | `object` | No | — | | `thread` | `object` | No | — | | `nonce` | `string \| number` | No | — | | `referenced_message` | `lazy` | Yes | — | > **author full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > } > ``` > **mentions full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > id: string, > filename: string, > description?: string, > content_type?: string, > size: number, > url: string, > proxy_url: string, > height?: number | null, > width?: number | null > }[] > ``` > **embeds full type** > > ```ts theme={null} > { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[] > ``` > **reactions full type** > > ```ts theme={null} > { > count: number, > me: boolean, > emoji: { > id?: string | null, > name: string > } > }[] > ``` > **components full type** > > ```ts theme={null} > { > type: number > }[] > ``` > **message\_reference full type** > > ```ts theme={null} > { > message_id?: string, > channel_id?: string, > guild_id?: string > } > ``` > **thread full type** > > ```ts theme={null} > { > id: string, > type: number, > guild_id?: string, > name?: string | null, > topic?: string | null, > position?: number, > parent_id?: string | null, > last_message_id?: string | null, > owner_id?: string, > thread_metadata?: { > archived: boolean, > auto_archive_duration: number, > archive_timestamp: string, > locked: boolean, > invitable?: boolean > } > } > ``` *** ### get `messages.get` Get a specific message **Risk:** `read` ```ts theme={null} await corsair.discord.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | | `author` | `object` | Yes | — | | `content` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | | `edited_timestamp` | `string` | No | — | | `tts` | `boolean` | Yes | — | | `mention_everyone` | `boolean` | Yes | — | | `mentions` | `object[]` | Yes | — | | `mention_roles` | `string[]` | Yes | — | | `attachments` | `object[]` | Yes | — | | `embeds` | `object[]` | Yes | — | | `reactions` | `object[]` | No | — | | `pinned` | `boolean` | Yes | — | | `type` | `number` | Yes | — | | `flags` | `number` | No | — | | `components` | `object[]` | No | — | | `message_reference` | `object` | No | — | | `thread` | `object` | No | — | | `nonce` | `string \| number` | No | — | | `referenced_message` | `lazy` | Yes | — | > **author full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > } > ``` > **mentions full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > id: string, > filename: string, > description?: string, > content_type?: string, > size: number, > url: string, > proxy_url: string, > height?: number | null, > width?: number | null > }[] > ``` > **embeds full type** > > ```ts theme={null} > { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[] > ``` > **reactions full type** > > ```ts theme={null} > { > count: number, > me: boolean, > emoji: { > id?: string | null, > name: string > } > }[] > ``` > **components full type** > > ```ts theme={null} > { > type: number > }[] > ``` > **message\_reference full type** > > ```ts theme={null} > { > message_id?: string, > channel_id?: string, > guild_id?: string > } > ``` > **thread full type** > > ```ts theme={null} > { > id: string, > type: number, > guild_id?: string, > name?: string | null, > topic?: string | null, > position?: number, > parent_id?: string | null, > last_message_id?: string | null, > owner_id?: string, > thread_metadata?: { > archived: boolean, > auto_archive_duration: number, > archive_timestamp: string, > locked: boolean, > invitable?: boolean > } > } > ``` *** ### list `messages.list` List recent messages in a channel **Risk:** `read` ```ts theme={null} await corsair.discord.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `before` | `string` | No | — | | `after` | `string` | No | — | | `around` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > channel_id: string, > author: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > content: string, > timestamp: string, > edited_timestamp?: string | null, > tts: boolean, > mention_everyone: boolean, > mentions: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }[], > mention_roles: string[], > attachments: { > id: string, > filename: string, > description?: string, > content_type?: string, > size: number, > url: string, > proxy_url: string, > height?: number | null, > width?: number | null > }[], > embeds: { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[], > reactions?: { > count: number, > me: boolean, > emoji: { > id?: string | null, > name: string > } > }[], > pinned: boolean, > type: number, > flags?: number, > components?: { > type: number > }[], > message_reference?: { > message_id?: string, > channel_id?: string, > guild_id?: string > }, > thread?: { > id: string, > type: number, > guild_id?: string, > name?: string | null, > topic?: string | null, > position?: number, > parent_id?: string | null, > last_message_id?: string | null, > owner_id?: string, > thread_metadata?: { > archived: boolean, > auto_archive_duration: number, > archive_timestamp: string, > locked: boolean, > invitable?: boolean > } > }, > nonce?: string | number, > referenced_message: lazy > }[] > ``` *** ### reply `messages.reply` Reply to a message in a channel **Risk:** `write` ```ts theme={null} await corsair.discord.api.messages.reply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | | `content` | `string` | No | — | | `embeds` | `object[]` | No | — | | `components` | `object[]` | No | — | | `allowed_mentions` | `object` | No | — | | `fail_if_not_exists` | `boolean` | No | — | > **embeds full type** > > ```ts theme={null} > { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[] > ``` > **components full type** > > ```ts theme={null} > { > type: 1, > components: ( > { > type: 2, > style: number, > label?: string, > emoji?: { > id?: string, > name?: string, > animated?: boolean > }, > custom_id?: string, > url?: string, > sku_id?: string, > disabled?: boolean > } | { > type: 3, > custom_id: string, > options: { > label: string, > value: string, > description?: string, > emoji?: { > id?: string, > name?: string, > animated?: boolean > }, > default?: boolean > }[], > placeholder?: string, > min_values?: number, > max_values?: number, > disabled?: boolean > } | { > type: 5 | 6 | 7 | 8, > custom_id: string, > placeholder?: string, > min_values?: number, > max_values?: number, > channel_types?: number[], > disabled?: boolean > } > )[] > }[] > ``` > **allowed\_mentions full type** > > ```ts theme={null} > { > parse?: ('roles' | 'users' | 'everyone')[], > roles?: string[], > users?: string[], > replied_user?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | | `author` | `object` | Yes | — | | `content` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | | `edited_timestamp` | `string` | No | — | | `tts` | `boolean` | Yes | — | | `mention_everyone` | `boolean` | Yes | — | | `mentions` | `object[]` | Yes | — | | `mention_roles` | `string[]` | Yes | — | | `attachments` | `object[]` | Yes | — | | `embeds` | `object[]` | Yes | — | | `reactions` | `object[]` | No | — | | `pinned` | `boolean` | Yes | — | | `type` | `number` | Yes | — | | `flags` | `number` | No | — | | `components` | `object[]` | No | — | | `message_reference` | `object` | No | — | | `thread` | `object` | No | — | | `nonce` | `string \| number` | No | — | | `referenced_message` | `lazy` | Yes | — | > **author full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > } > ``` > **mentions full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > id: string, > filename: string, > description?: string, > content_type?: string, > size: number, > url: string, > proxy_url: string, > height?: number | null, > width?: number | null > }[] > ``` > **embeds full type** > > ```ts theme={null} > { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[] > ``` > **reactions full type** > > ```ts theme={null} > { > count: number, > me: boolean, > emoji: { > id?: string | null, > name: string > } > }[] > ``` > **components full type** > > ```ts theme={null} > { > type: number > }[] > ``` > **message\_reference full type** > > ```ts theme={null} > { > message_id?: string, > channel_id?: string, > guild_id?: string > } > ``` > **thread full type** > > ```ts theme={null} > { > id: string, > type: number, > guild_id?: string, > name?: string | null, > topic?: string | null, > position?: number, > parent_id?: string | null, > last_message_id?: string | null, > owner_id?: string, > thread_metadata?: { > archived: boolean, > auto_archive_duration: number, > archive_timestamp: string, > locked: boolean, > invitable?: boolean > } > } > ``` *** ### send `messages.send` Send a message to a channel **Risk:** `write` ```ts theme={null} await corsair.discord.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `content` | `string` | No | — | | `embeds` | `object[]` | No | — | | `components` | `object[]` | No | — | | `allowed_mentions` | `object` | No | — | | `tts` | `boolean` | No | — | | `nonce` | `string \| number` | No | — | > **embeds full type** > > ```ts theme={null} > { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[] > ``` > **components full type** > > ```ts theme={null} > { > type: 1, > components: ( > { > type: 2, > style: number, > label?: string, > emoji?: { > id?: string, > name?: string, > animated?: boolean > }, > custom_id?: string, > url?: string, > sku_id?: string, > disabled?: boolean > } | { > type: 3, > custom_id: string, > options: { > label: string, > value: string, > description?: string, > emoji?: { > id?: string, > name?: string, > animated?: boolean > }, > default?: boolean > }[], > placeholder?: string, > min_values?: number, > max_values?: number, > disabled?: boolean > } | { > type: 5 | 6 | 7 | 8, > custom_id: string, > placeholder?: string, > min_values?: number, > max_values?: number, > channel_types?: number[], > disabled?: boolean > } > )[] > }[] > ``` > **allowed\_mentions full type** > > ```ts theme={null} > { > parse?: ('roles' | 'users' | 'everyone')[], > roles?: string[], > users?: string[], > replied_user?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `channel_id` | `string` | Yes | — | | `author` | `object` | Yes | — | | `content` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | | `edited_timestamp` | `string` | No | — | | `tts` | `boolean` | Yes | — | | `mention_everyone` | `boolean` | Yes | — | | `mentions` | `object[]` | Yes | — | | `mention_roles` | `string[]` | Yes | — | | `attachments` | `object[]` | Yes | — | | `embeds` | `object[]` | Yes | — | | `reactions` | `object[]` | No | — | | `pinned` | `boolean` | Yes | — | | `type` | `number` | Yes | — | | `flags` | `number` | No | — | | `components` | `object[]` | No | — | | `message_reference` | `object` | No | — | | `thread` | `object` | No | — | | `nonce` | `string \| number` | No | — | | `referenced_message` | `lazy` | Yes | — | > **author full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > } > ``` > **mentions full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > id: string, > filename: string, > description?: string, > content_type?: string, > size: number, > url: string, > proxy_url: string, > height?: number | null, > width?: number | null > }[] > ``` > **embeds full type** > > ```ts theme={null} > { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[] > ``` > **reactions full type** > > ```ts theme={null} > { > count: number, > me: boolean, > emoji: { > id?: string | null, > name: string > } > }[] > ``` > **components full type** > > ```ts theme={null} > { > type: number > }[] > ``` > **message\_reference full type** > > ```ts theme={null} > { > message_id?: string, > channel_id?: string, > guild_id?: string > } > ``` > **thread full type** > > ```ts theme={null} > { > id: string, > type: number, > guild_id?: string, > name?: string | null, > topic?: string | null, > position?: number, > parent_id?: string | null, > last_message_id?: string | null, > owner_id?: string, > thread_metadata?: { > archived: boolean, > auto_archive_duration: number, > archive_timestamp: string, > locked: boolean, > invitable?: boolean > } > } > ``` *** ## Reactions ### add `reactions.add` Add a reaction to a message **Risk:** `write` ```ts theme={null} await corsair.discord.api.reactions.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | | `emoji` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### list `reactions.list` List reactions on a message **Risk:** `read` ```ts theme={null} await corsair.discord.api.reactions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | | `emoji` | `string` | Yes | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }[] > ``` *** ### remove `reactions.remove` Remove a reaction from a message **Risk:** `write` ```ts theme={null} await corsair.discord.api.reactions.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | | `emoji` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ## Threads ### create `threads.create` Create a new thread in a channel **Risk:** `write` ```ts theme={null} await corsair.discord.api.threads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `auto_archive_duration` | `60 \| 1440 \| 4320 \| 10080` | No | — | | `type` | `number` | No | — | | `invitable` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `number` | Yes | — | | `guild_id` | `string` | No | — | | `name` | `string` | No | — | | `topic` | `string` | No | — | | `position` | `number` | No | — | | `parent_id` | `string` | No | — | | `last_message_id` | `string` | No | — | | `owner_id` | `string` | No | — | | `thread_metadata` | `object` | No | — | > **thread\_metadata full type** > > ```ts theme={null} > { > archived: boolean, > auto_archive_duration: number, > archive_timestamp: string, > locked: boolean, > invitable?: boolean > } > ``` *** ### createFromMessage `threads.createFromMessage` Create a thread from an existing message **Risk:** `write` ```ts theme={null} await corsair.discord.api.threads.createFromMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `auto_archive_duration` | `60 \| 1440 \| 4320 \| 10080` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `number` | Yes | — | | `guild_id` | `string` | No | — | | `name` | `string` | No | — | | `topic` | `string` | No | — | | `position` | `number` | No | — | | `parent_id` | `string` | No | — | | `last_message_id` | `string` | No | — | | `owner_id` | `string` | No | — | | `thread_metadata` | `object` | No | — | > **thread\_metadata full type** > > ```ts theme={null} > { > archived: boolean, > auto_archive_duration: number, > archive_timestamp: string, > locked: boolean, > invitable?: boolean > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/discord/database Discord local sync: searchable entities, `.search()` filters, and operators. The Discord plugin syncs data locally. Use `corsair.discord.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Channels Path: `discord.db.channels.search` ```ts theme={null} const rows = await corsair.discord.db.channels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | | `guild_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `topic` | `string` | equals, contains, startsWith, endsWith, in | | `position` | `number` | equals, gt, gte, lt, lte, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `last_message_id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Guilds Path: `discord.db.guilds.search` ```ts theme={null} const rows = await corsair.discord.db.guilds.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | | `owner_id` | `string` | equals, contains, startsWith, endsWith, in | | `approximate_member_count` | `number` | equals, gt, gte, lt, lte, in | | `approximate_presence_count` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `premium_tier` | `number` | equals, gt, gte, lt, lte, in | | `preferred_locale` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Members Path: `discord.db.members.search` ```ts theme={null} const rows = await corsair.discord.db.members.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `guild_id` | `string` | equals, contains, startsWith, endsWith, in | | `nick` | `string` | equals, contains, startsWith, endsWith, in | | `joined_at` | `string` | equals, contains, startsWith, endsWith, in | | `premium_since` | `string` | equals, contains, startsWith, endsWith, in | | `deaf` | `boolean` | equals | | `mute` | `boolean` | equals | | `pending` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `discord.db.messages.search` ```ts theme={null} const rows = await corsair.discord.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `channel_id` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `edited_timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `tts` | `boolean` | equals | | `mention_everyone` | `boolean` | equals | | `pinned` | `boolean` | equals | | `type` | `number` | equals, gt, gte, lt, lte, in | | `flags` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `authorId` | `string` | equals, contains, startsWith, endsWith, in | | `thread_ts` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/discord/get-credentials Step-by-step instructions for obtaining a Discord bot token, application public key, and related credentials for the Corsair Discord plugin. This guide walks you through obtaining all required credentials for the Discord plugin. ## Authentication Method The Discord plugin uses API key authentication for the REST API. Internally, Corsair treats your **bot token** as the [`api_key`](/concepts/api-key) value and sends it as `Authorization: Bot `. * **[`api_key`](/concepts/api-key)** (default) — Bot token for Discord’s API Discord does **not** use OAuth in this plugin’s `authType` surface; you operate as a bot using the bot token. ## Bot Token (API Key) ### Step 1: Create a Discord Application 1. Open the [Discord Developer Portal](https://discord.com/developers/applications). 2. Click **New Application**, name it, and create it. ### Step 2: Add a Bot and Copy the Token 1. Open your application → **Bot**. 2. Click **Add Bot** if you have not already. 3. Under **Token**, click **Reset Token** or **Copy** to copy the bot token. 4. Store it securely — anyone with the token can control the bot. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=discord api_key=your-bot-token ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=discord --credentials ``` ### Step 3: Invite the Bot (Guilds) In the Developer Portal, use **OAuth2** → **URL Generator** (or **Installation**) to generate an invite URL with the **bot** scope and the permissions your integration needs. Open the URL in a browser and add the bot to the servers you manage. ## Interaction Public Key (Webhooks) Discord **Interaction** payloads (slash commands, buttons, modals) are signed with Ed25519. Corsair verifies them using your application’s **Public Key**. In the key store, this value is stored as the webhook signing material (`webhook_signature`). 1. In the Developer Portal, open your application → **General Information**. 2. Find **Public Key** and copy it. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=discord webhook_signature=your-application-public-key ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | Bot token | [`api_key`](/concepts/api-key) / REST API | Application → **Bot** → Token | | Application public key | Interaction webhook verification | Application → **General Information** → Public Key | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/discord/overview Community chat platform for servers, channels, voice, bots, and real-time group messaging. Use **Discord** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 16 typed API operations * 4 synced entities (`channels`, `guilds`, `members`, `messages`) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/discord ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/discord ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/discord ``` ```bash bun theme={null} bun add corsair @corsair-dev/discord ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { discord } from '@corsair-dev/discord'; export const corsair = createCorsair({ plugins: [ discord(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/discord/get-credentials). ```ts theme={null} discord() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'discord', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List channels** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.discord.api.channels.list({ guild_id: '123456789' }); ``` **Send a message** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.discord.api.messages.send({ channel_id: '123456789', content: 'Hello from Corsair!' }); ``` See the full list on the [API](/plugins/discord/api) page. ## Query synced data Search synced channels without hitting Discord. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.discord.db.channels.search({ data: {}, limit: 50, }); ``` Synced entities: `channels`, `guilds`, `members`, `messages`. See [Database](/plugins/discord/database) for filters and operators. ## Webhooks Fires when a user invokes a slash command or context-menu action. ```ts theme={null} discord({ webhookHooks: { interactions: { applicationCommand: { after: async (ctx, result) => { console.log('Discord application command:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/discord/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/discord/api)** > > Every `discord.api.*` operation with input and output types. > **[Database](/plugins/discord/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/discord/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/discord/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/discord/webhooks Discord incoming webhooks: event paths, payloads, and response data. The Discord plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/discord/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `interactions` * `applicationCommand` (`interactions.applicationCommand`) * `messageComponent` (`interactions.messageComponent`) * `modalSubmit` (`interactions.modalSubmit`) * `ping` (`interactions.ping`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Interactions ### Application Command `interactions.applicationCommand` A user invoked a slash command or context-menu action **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `application_id` | `string` | Yes | — | | `token` | `string` | Yes | — | | `version` | `1` | Yes | — | | `guild_id` | `string` | No | — | | `channel_id` | `string` | No | — | | `member` | `object` | No | — | | `user` | `object` | No | — | | `locale` | `string` | No | — | | `guild_locale` | `string` | No | — | | `app_permissions` | `string` | No | — | | `type` | `2` | Yes | — | | `data` | `object` | Yes | — | > **member full type** > > ```ts theme={null} > { > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > nick?: string | null, > roles: string[], > joined_at: string, > permissions: string, > deaf: boolean, > mute: boolean > } > ``` > **user full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > } > ``` > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > type: number, > options?: { > name: string, > type: number, > value?: string | number | boolean, > focused?: boolean, > options?: lazy > }[], > guild_id?: string, > target_id?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > application_id: string, > token: string, > version: 1, > guild_id?: string, > channel_id?: string, > member?: { > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > nick?: string | null, > roles: string[], > joined_at: string, > permissions: string, > deaf: boolean, > mute: boolean > }, > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > locale?: string, > guild_locale?: string, > app_permissions?: string, > type: 2, > data: { > id: string, > name: string, > type: number, > options?: { > name: string, > type: number, > value?: string | number | boolean, > focused?: boolean, > options?: lazy > }[], > guild_id?: string, > target_id?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} discord({ webhookHooks: { interactions: { applicationCommand: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Message Component `interactions.messageComponent` A user clicked a button or selected a menu option **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `application_id` | `string` | Yes | — | | `token` | `string` | Yes | — | | `version` | `1` | Yes | — | | `guild_id` | `string` | No | — | | `channel_id` | `string` | No | — | | `member` | `object` | No | — | | `user` | `object` | No | — | | `locale` | `string` | No | — | | `guild_locale` | `string` | No | — | | `app_permissions` | `string` | No | — | | `type` | `3` | Yes | — | | `data` | `object` | Yes | — | | `message` | `object` | Yes | — | > **member full type** > > ```ts theme={null} > { > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > nick?: string | null, > roles: string[], > joined_at: string, > permissions: string, > deaf: boolean, > mute: boolean > } > ``` > **user full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > } > ``` > **data full type** > > ```ts theme={null} > { > custom_id: string, > component_type: number, > values?: string[] > } > ``` > **message full type** > > ```ts theme={null} > { > id: string, > channel_id: string, > content: string, > author: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > timestamp: string, > edited_timestamp?: string | null, > tts: boolean, > mention_everyone: boolean, > mentions: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }[], > attachments: any[], > embeds: { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[], > pinned: boolean, > type: number > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > application_id: string, > token: string, > version: 1, > guild_id?: string, > channel_id?: string, > member?: { > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > nick?: string | null, > roles: string[], > joined_at: string, > permissions: string, > deaf: boolean, > mute: boolean > }, > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > locale?: string, > guild_locale?: string, > app_permissions?: string, > type: 3, > data: { > custom_id: string, > component_type: number, > values?: string[] > }, > message: { > id: string, > channel_id: string, > content: string, > author: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > timestamp: string, > edited_timestamp?: string | null, > tts: boolean, > mention_everyone: boolean, > mentions: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }[], > attachments: any[], > embeds: { > title?: string, > description?: string, > url?: string, > color?: number, > fields?: { > name: string, > value: string, > inline?: boolean > }[], > footer?: { > text: string, > icon_url?: string > }, > image?: { > url: string > }, > thumbnail?: { > url: string > }, > author?: { > name: string, > url?: string, > icon_url?: string > }, > timestamp?: string > }[], > pinned: boolean, > type: number > } > } > ``` **`webhookHooks` example** ```ts theme={null} discord({ webhookHooks: { interactions: { messageComponent: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Modal Submit `interactions.modalSubmit` A user submitted a modal dialog **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `application_id` | `string` | Yes | — | | `token` | `string` | Yes | — | | `version` | `1` | Yes | — | | `guild_id` | `string` | No | — | | `channel_id` | `string` | No | — | | `member` | `object` | No | — | | `user` | `object` | No | — | | `locale` | `string` | No | — | | `guild_locale` | `string` | No | — | | `app_permissions` | `string` | No | — | | `type` | `5` | Yes | — | | `data` | `object` | Yes | — | > **member full type** > > ```ts theme={null} > { > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > nick?: string | null, > roles: string[], > joined_at: string, > permissions: string, > deaf: boolean, > mute: boolean > } > ``` > **user full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > } > ``` > **data full type** > > ```ts theme={null} > { > custom_id: string, > components: { > type: number, > components: { > type: number, > custom_id: string, > value: string > }[] > }[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > application_id: string, > token: string, > version: 1, > guild_id?: string, > channel_id?: string, > member?: { > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > nick?: string | null, > roles: string[], > joined_at: string, > permissions: string, > deaf: boolean, > mute: boolean > }, > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > locale?: string, > guild_locale?: string, > app_permissions?: string, > type: 5, > data: { > custom_id: string, > components: { > type: number, > components: { > type: number, > custom_id: string, > value: string > }[] > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} discord({ webhookHooks: { interactions: { modalSubmit: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Ping `interactions.ping` Discord sends a PING to verify the endpoint is live **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `application_id` | `string` | Yes | — | | `token` | `string` | Yes | — | | `version` | `1` | Yes | — | | `guild_id` | `string` | No | — | | `channel_id` | `string` | No | — | | `member` | `object` | No | — | | `user` | `object` | No | — | | `locale` | `string` | No | — | | `guild_locale` | `string` | No | — | | `app_permissions` | `string` | No | — | | `type` | `1` | Yes | — | > **member full type** > > ```ts theme={null} > { > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > nick?: string | null, > roles: string[], > joined_at: string, > permissions: string, > deaf: boolean, > mute: boolean > } > ``` > **user full type** > > ```ts theme={null} > { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > application_id: string, > token: string, > version: 1, > guild_id?: string, > channel_id?: string, > member?: { > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > nick?: string | null, > roles: string[], > joined_at: string, > permissions: string, > deaf: boolean, > mute: boolean > }, > user?: { > id: string, > username: string, > discriminator: string, > global_name?: string | null, > avatar?: string | null, > bot?: boolean, > system?: boolean, > email?: string | null, > verified?: boolean, > locale?: string, > premium_type?: number, > public_flags?: number, > flags?: number > }, > locale?: string, > guild_locale?: string, > app_permissions?: string, > type: 1 > } > ``` **`webhookHooks` example** ```ts theme={null} discord({ webhookHooks: { interactions: { ping: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/dockerhub/api API reference for Docker Hub: every `dockerhub.api.*` operation with input and output types. Every `dockerhub.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Images ### get `images.get` Get image variant by digest **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.images.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `digest` | `string` | Yes | — | | `pageSize` | `number` | No | — | **Output:** `any` *** ### list `images.list` List platform image variants (from tags) **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.images.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `any` *** ## Organizations ### addMember `organizations.addMember` Invite a member to an organization (bulk invite API) **Risk:** `write` ```ts theme={null} await corsair.dockerhub.api.organizations.addMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `member` | `string` | Yes | — | | `role` | `member \| owner \| editor` | No | — | | `team` | `string` | No | — | **Output:** `any` *** ### create `organizations.create` Create a Docker Hub organization **Risk:** `write` ```ts theme={null} await corsair.dockerhub.api.organizations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `fullName` | `string` | No | — | | `company` | `string` | No | — | | `location` | `string` | No | — | | `profileUrl` | `string` | No | — | | `gravatarEmail` | `string` | No | — | **Output:** `any` *** ### delete `organizations.delete` Delete an organization (idempotent) **Risk:** `destructive` ```ts theme={null} await corsair.dockerhub.api.organizations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | **Output:** `any` *** ### list `organizations.list` List organizations for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.organizations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `any` *** ### listAccessTokens `organizations.listAccessTokens` List organization access tokens **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.organizations.listAccessTokens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `any` *** ### listMembers `organizations.listMembers` List organization members **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.organizations.listMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `any` *** ### removeMember `organizations.removeMember` Remove a member from an organization **Risk:** `destructive` ```ts theme={null} await corsair.dockerhub.api.organizations.removeMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `username` | `string` | Yes | — | **Output:** `any` *** ## Repositories ### create `repositories.create` Create a repository under a namespace **Risk:** `write` ```ts theme={null} await corsair.dockerhub.api.repositories.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `isPrivate` | `boolean` | No | — | | `fullDescription` | `string` | No | — | **Output:** `any` *** ### delete `repositories.delete` Delete a repository (idempotent) **Risk:** `destructive` ```ts theme={null} await corsair.dockerhub.api.repositories.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output:** `any` *** ### get `repositories.get` Get repository metadata **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.repositories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output:** `any` *** ### list `repositories.list` List repositories under a namespace **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.repositories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `any` *** ## Tags ### delete `tags.delete` Delete a repository tag **Risk:** `destructive` ```ts theme={null} await corsair.dockerhub.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output:** `any` *** ### get `tags.get` Get a specific repository tag **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.tags.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output:** `any` *** ### list `tags.list` List tags for a repository **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `any` *** ## Teams ### delete `teams.delete` Delete a team (idempotent) **Risk:** `destructive` ```ts theme={null} await corsair.dockerhub.api.teams.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `teamname` | `string` | Yes | — | **Output:** `any` *** ### get `teams.get` Get team details **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.teams.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `teamname` | `string` | Yes | — | **Output:** `any` *** ### list `teams.list` List teams (groups) in an organization **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `any` *** ### listMembers `teams.listMembers` List team members **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.teams.listMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `teamname` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `any` *** ### removeMember `teams.removeMember` Remove a member from a team **Risk:** `destructive` ```ts theme={null} await corsair.dockerhub.api.teams.removeMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgname` | `string` | Yes | — | | `teamname` | `string` | Yes | — | | `username` | `string` | Yes | — | **Output:** `any` *** ## Webhooks ### create `webhooks.create` Create a repository webhook with hook URL **Risk:** `write` ```ts theme={null} await corsair.dockerhub.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `webhookName` | `string` | Yes | — | | `hookUrl` | `string` | Yes | — | **Output:** `any` *** ### delete `webhooks.delete` Delete a repository webhook **Risk:** `destructive` ```ts theme={null} await corsair.dockerhub.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `webhookId` | `string \| number` | Yes | — | **Output:** `any` *** ### get `webhooks.get` Get a repository webhook **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `webhookId` | `string \| number` | Yes | — | **Output:** `any` *** ### list `webhooks.list` List repository webhooks **Risk:** `read` ```ts theme={null} await corsair.dockerhub.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/dockerhub/database Docker Hub local sync: searchable entities, `.search()` filters, and operators. The Docker Hub plugin syncs data locally. Use `corsair.dockerhub.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Images Path: `dockerhub.db.images.search` ```ts theme={null} const rows = await corsair.dockerhub.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `architecture` | `string` | equals, contains, startsWith, endsWith, in | | `features` | `string` | equals, contains, startsWith, endsWith, in | | `variant` | `string` | equals, contains, startsWith, endsWith, in | | `digest` | `string` | equals, contains, startsWith, endsWith, in | | `os` | `string` | equals, contains, startsWith, endsWith, in | | `os_features` | `string` | equals, contains, startsWith, endsWith, in | | `os_version` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `last_pulled` | `string` | equals, contains, startsWith, endsWith, in | | `last_pushed` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invites Path: `dockerhub.db.invites.search` ```ts theme={null} const rows = await corsair.dockerhub.db.invites.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `inviter_username` | `string` | equals, contains, startsWith, endsWith, in | | `invitee` | `string` | equals, contains, startsWith, endsWith, in | | `org` | `string` | equals, contains, startsWith, endsWith, in | | `team` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Org Access Tokens Path: `dockerhub.db.orgAccessTokens.search` ```ts theme={null} const rows = await corsair.dockerhub.db.orgAccessTokens.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `is_active` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `expires_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_used_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `dockerhub.db.organizations.search` ```ts theme={null} const rows = await corsair.dockerhub.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `orgname` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `profile_url` | `string` | equals, contains, startsWith, endsWith, in | | `gravatar_email` | `string` | equals, contains, startsWith, endsWith, in | | `gravatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `badge` | `string` | equals, contains, startsWith, endsWith, in | | `date_joined` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Org Members Path: `dockerhub.db.orgMembers.search` ```ts theme={null} const rows = await corsair.dockerhub.db.orgMembers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `date_joined` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `gravatar_email` | `string` | equals, contains, startsWith, endsWith, in | | `gravatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `profile_url` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `is_guest` | `boolean` | equals | | `primary_email` | `string` | equals, contains, startsWith, endsWith, in | | `last_logged_in_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_seen_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_desktop_version` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Repositories Path: `dockerhub.db.repositories.search` ```ts theme={null} const rows = await corsair.dockerhub.db.repositories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `namespace` | `string` | equals, contains, startsWith, endsWith, in | | `repository_type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `number` | equals, gt, gte, lt, lte, in | | `status_description` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `is_private` | `boolean` | equals | | `is_automated` | `boolean` | equals | | `star_count` | `number` | equals, gt, gte, lt, lte, in | | `pull_count` | `number` | equals, gt, gte, lt, lte, in | | `last_updated` | `string` | equals, contains, startsWith, endsWith, in | | `last_modified` | `string` | equals, contains, startsWith, endsWith, in | | `date_registered` | `string` | equals, contains, startsWith, endsWith, in | | `collaborator_count` | `number` | equals, gt, gte, lt, lte, in | | `affiliation` | `string` | equals, contains, startsWith, endsWith, in | | `hub_user` | `string` | equals, contains, startsWith, endsWith, in | | `has_starred` | `boolean` | equals | | `full_description` | `string` | equals, contains, startsWith, endsWith, in | | `storage_size` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `dockerhub.db.tags.search` ```ts theme={null} const rows = await corsair.dockerhub.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `repository` | `number` | equals, gt, gte, lt, lte, in | | `creator` | `number` | equals, gt, gte, lt, lte, in | | `last_updater` | `number` | equals, gt, gte, lt, lte, in | | `last_updater_username` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated` | `string` | equals, contains, startsWith, endsWith, in | | `full_size` | `number` | equals, gt, gte, lt, lte, in | | `digest` | `string` | equals, contains, startsWith, endsWith, in | | `media_type` | `string` | equals, contains, startsWith, endsWith, in | | `content_type` | `string` | equals, contains, startsWith, endsWith, in | | `tag_status` | `string` | equals, contains, startsWith, endsWith, in | | `tag_last_pulled` | `string` | equals, contains, startsWith, endsWith, in | | `tag_last_pushed` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Team Members Path: `dockerhub.db.teamMembers.search` ```ts theme={null} const rows = await corsair.dockerhub.db.teamMembers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `date_joined` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `gravatar_email` | `string` | equals, contains, startsWith, endsWith, in | | `gravatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `profile_url` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `dockerhub.db.teams.search` ```ts theme={null} const rows = await corsair.dockerhub.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `member_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `dockerhub.db.users.search` ```ts theme={null} const rows = await corsair.dockerhub.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `date_joined` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `gravatar_email` | `string` | equals, contains, startsWith, endsWith, in | | `gravatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `profile_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/dockerhub/overview Container registry for storing, sharing, and distributing Docker images and repositories. Use **Docker Hub** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 25 typed API operations * 10 synced entities (`images`, `invites`, `orgAccessTokens`, `organizations`, `orgMembers`, `repositories`, and 4 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dockerhub ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dockerhub ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dockerhub ``` ```bash bun theme={null} bun add corsair @corsair-dev/dockerhub ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dockerhub } from '@corsair-dev/dockerhub'; export const corsair = createCorsair({ plugins: [ dockerhub(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} dockerhub() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dockerhub', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`images.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dockerhub.api.images.get({}); ``` **`organizations.addMember`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dockerhub.api.organizations.addMember({}); ``` See the full list on the [API](/plugins/dockerhub/api) page. ## Query synced data Synced entities support `tenant.dockerhub.db..search()` and `.list()`: `images`, `invites`, `orgAccessTokens`, `organizations`, `orgMembers`, `repositories`, `tags`, `teamMembers`, `teams`, `users`. See [Database](/plugins/dockerhub/database) for filters and operators. ## What's next > **[API reference](/plugins/dockerhub/api)** > > Every `dockerhub.api.*` operation with input and output types. > **[Database](/plugins/dockerhub/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/docmosis/api API reference for Docmosis: every `docmosis.api.*` operation with input and output types. Every `docmosis.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Admin ### environmentReady `admin.environmentReady` Check whether the environment is active and ready to render **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.admin.environmentReady({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | *** ### environmentSummary `admin.environmentSummary` Get environment status, plan details, and quota usage **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.admin.environmentSummary({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | | `accountEnvironmentSummary` | `object` | No | — | > **accountEnvironmentSummary full type** > > ```ts theme={null} > { > ready?: boolean | string, > accountEnvDetails?: { > name?: string, > description?: string, > isActivated?: boolean | string, > isDisabled?: boolean | string, > isDeleted?: boolean | string, > auditInfo?: { > lastUpdatedByUser?: string, > lastUpdatedTime?: number > } > }, > pageQuota?: { > used?: number | string, > quota?: number | string, > pctUsed?: number | string, > pctUsedStr?: string, > isHardLimited?: boolean | string > }, > plan?: { > name?: string > } > } > ``` *** ### getBatchUploadStatus `admin.getBatchUploadStatus` Check status for a template batch upload job **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.admin.getBatchUploadStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userJobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | | `jobStatus` | `object` | No | — | > **jobStatus full type** > > ```ts theme={null} > { > userJobId?: string, > isEnded?: boolean, > status?: string, > type?: string, > processingMsg?: string, > startedTime?: number, > finishedTime?: number, > duration?: number, > pctComplete?: number, > jobResult?: { > errorsDetected?: boolean, > uploadedIntoFolder?: string, > devMode?: boolean, > uploadedTotalCount?: number, > processedWithErrorsCount?: number, > processedWithoutErrorsCount?: number > } > } > ``` *** ### getRenderQueue `admin.getRenderQueue` Get current render queue utilization and delay **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.admin.getRenderQueue({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | | `queue` | `object` | No | — | > **queue full type** > > ```ts theme={null} > { > rejected?: boolean, > availablePct?: number, > delaySeconds?: number > } > ``` *** ### getRenderTags `admin.getRenderTags` Get monthly render statistics grouped by custom tags **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.admin.getRenderTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `string` | Yes | — | | `year` | `number \| string` | No | — | | `month` | `number \| string` | No | — | | `nMonths` | `number \| string` | No | — | | `padBlanks` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | | `renderTags` | `object[]` | No | — | > **renderTags full type** > > ```ts theme={null} > { > year?: number | string, > month?: number | string, > tags?: { > name?: string, > countPages?: number | string, > countDocuments?: number | string > }[] > }[] > ``` *** ### ping `admin.ping` Check basic connectivity to the Docmosis API **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.admin.ping({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### pingService `admin.pingService` Verify that Docmosis service listeners are online **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.admin.pingService({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Auth ### getApiKey `auth.getApiKey` Confirm a Docmosis access key is configured and return a masked preview of it **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.auth.getApiKey({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `configured` | `boolean` | Yes | Whether a Docmosis access key is configured | | `keyPreview` | `string` | Yes | Last 4 characters of the configured access key | *** ## Images ### delete `images.delete` Delete one or more stored images **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.docmosis.api.images.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageName` | `string \| string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | *** ### get `images.get` Download one or more uploaded images **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.images.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageName` | `string \| string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `dataBase64` | `string` | Yes | — | | `byteLength` | `number` | Yes | — | *** ### list `images.list` List available stored images, optionally by folder **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.images.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder` | `string` | No | — | | `includeSubFolders` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | | `imageListStale` | `boolean` | No | — | | `imageList` | `object[]` | No | — | > **imageList full type** > > ```ts theme={null} > { > name?: string, > lastModifiedMillisSinceEpoch?: number, > lastModifiedISO8601?: string, > sizeBytes?: number, > md5?: string > }[] > ``` *** ## Templates ### delete `templates.delete` Delete one or more templates from the environment **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.docmosis.api.templates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateName` | `string \| string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | *** ### get `templates.get` Download one or more template files **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.templates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateName` | `string \| string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `dataBase64` | `string` | Yes | — | | `byteLength` | `number` | Yes | — | *** ### getDetails `templates.getDetails` Get metadata details for a specific template **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.templates.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateName` | `string` | Yes | — | | `stringify` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | | `templateDetails` | `object` | No | — | > **templateDetails full type** > > ```ts theme={null} > { > name?: string, > lastModifiedMillisSinceEpoch?: number, > lastModifiedISO8601?: string, > sizeBytes?: number, > md5?: string, > templatePlainTextFieldPrefix?: string, > templatePlainTextFieldSuffix?: string, > templateHasErrors?: boolean, > templateDevMode?: boolean, > templateDescription?: string > } > ``` *** ### getSampleData `templates.getSampleData` Generate sample JSON or XML data from a template structure **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.templates.getSampleData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateName` | `string` | Yes | — | | `stringify` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — | | `format` | `json \| xml` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | | `templateSampleData` | `object` | No | — | | `templateDetails` | `object` | No | — | > **templateSampleData full type** > > ```ts theme={null} > { > } | string > ``` > **templateDetails full type** > > ```ts theme={null} > { > templateHasErrors?: boolean, > templateFirstError?: string > } > ``` *** ### getStructure `templates.getStructure` Get parsed field and structure metadata for a template **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.templates.getStructure({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateName` | `string` | Yes | — | | `stringify` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | | `templateHasErrors` | `boolean` | No | — | | `templateErrorMessage` | `string` | No | — | | `templateStructure` | `object` | No | — | > **templateStructure full type** > > ```ts theme={null} > { > type?: string, > text?: string, > dataRefs?: string[], > fieldIdx?: number, > repeatIdx?: number, > conditionIdx?: number, > contains?: lazy > }[] | string > ``` *** ### list `templates.list` List templates with optional folder and paging filters **Risk:** `read` ```ts theme={null} await corsair.docmosis.api.templates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `includeDetail` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — | | `folder` | `string` | No | — | | `includeSubFolders` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — | | `paging` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — | | `pageToken` | `string` | No | — | | `pageSize` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `succeeded` | `boolean` | Yes | — | | `shortMsg` | `string` | No | — | | `longMsg` | `string` | No | — | | `templateListStale` | `boolean` | No | — | | `nextPageToken` | `string` | No | — | | `pageSize` | `number` | No | — | | `templateList` | `object[]` | No | — | > **templateList full type** > > ```ts theme={null} > { > name?: string, > lastModifiedMillisSinceEpoch?: number, > lastModifiedISO8601?: string, > sizeBytes?: number, > md5?: string, > templatePlainTextFieldPrefix?: string, > templatePlainTextFieldSuffix?: string, > templateHasErrors?: boolean, > templateDevMode?: boolean, > templateDescription?: string > }[] > ``` *** ### render `templates.render` Generate a document from a template and JSON/XML data **Risk:** `write` ```ts theme={null} await corsair.docmosis.api.templates.render({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateName` | `string` | Yes | — | | `data` | `object` | Yes | — | | `outputName` | `string` | Yes | — | | `outputFormat` | `string` | No | — | | `devMode` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — | | `tags` | `string` | No | — | > **data full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `dataBase64` | `string` | Yes | — | | `byteLength` | `number` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/docmosis/database Docmosis local sync: searchable entities, `.search()` filters, and operators. The Docmosis plugin syncs data locally. Use `corsair.docmosis.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Batch Upload Jobs Path: `docmosis.db.batchUploadJobs.search` ```ts theme={null} const rows = await corsair.docmosis.db.batchUploadJobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `isEnded` | `boolean` | equals | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `processingMsg` | `string` | equals, contains, startsWith, endsWith, in | | `startedTime` | `number` | equals, gt, gte, lt, lte, in | | `finishedTime` | `number` | equals, gt, gte, lt, lte, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `pctComplete` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Environments Path: `docmosis.db.environments.search` ```ts theme={null} const rows = await corsair.docmosis.db.environments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `planName` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Images Path: `docmosis.db.images.search` ```ts theme={null} const rows = await corsair.docmosis.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedMillisSinceEpoch` | `number` | equals, gt, gte, lt, lte, in | | `lastModifiedISO8601` | `string` | equals, contains, startsWith, endsWith, in | | `sizeBytes` | `number` | equals, gt, gte, lt, lte, in | | `md5` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Renders Path: `docmosis.db.renders.search` ```ts theme={null} const rows = await corsair.docmosis.db.renders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `templateName` | `string` | equals, contains, startsWith, endsWith, in | | `outputName` | `string` | equals, contains, startsWith, endsWith, in | | `outputFormat` | `string` | equals, contains, startsWith, endsWith, in | | `contentType` | `string` | equals, contains, startsWith, endsWith, in | | `byteLength` | `number` | equals, gt, gte, lt, lte, in | | `devMode` | `boolean` | equals | | `tags` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `docmosis.db.templates.search` ```ts theme={null} const rows = await corsair.docmosis.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedMillisSinceEpoch` | `number` | equals, gt, gte, lt, lte, in | | `lastModifiedISO8601` | `string` | equals, contains, startsWith, endsWith, in | | `sizeBytes` | `number` | equals, gt, gte, lt, lte, in | | `templatePlainTextFieldPrefix` | `string` | equals, contains, startsWith, endsWith, in | | `templatePlainTextFieldSuffix` | `string` | equals, contains, startsWith, endsWith, in | | `templateDevMode` | `boolean` | equals | | `templateHasErrors` | `boolean` | equals | | `templateDescription` | `string` | equals, contains, startsWith, endsWith, in | | `md5` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/docmosis/overview Generate documents from templates with Docmosis Cloud, including template/image management and environment diagnostics. Use **Docmosis** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 18 typed API operations * 5 synced entities (`batchUploadJobs`, `environments`, `images`, `renders`, `templates`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/docmosis ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/docmosis ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/docmosis ``` ```bash bun theme={null} bun add corsair @corsair-dev/docmosis ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { docmosis } from '@corsair-dev/docmosis'; export const corsair = createCorsair({ plugins: [ docmosis(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} docmosis() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'docmosis', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`admin.environmentReady`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.docmosis.api.admin.environmentReady({}); ``` **`templates.render`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.docmosis.api.templates.render({ templateName: '/samples/WelcomeTemplate.docx', data: { title: 'Hello from Corsair' }, outputName: 'output.pdf', }); ``` See the full list on the [API](/plugins/docmosis/api) page. ## Query synced data Synced entities support `tenant.docmosis.db..search()` and `.list()`: `batchUploadJobs`, `environments`, `images`, `renders`, `templates`. See [Database](/plugins/docmosis/database) for filters and operators. ## What's next > **[API reference](/plugins/docmosis/api)** > > Every `docmosis.api.*` operation with input and output types. > **[Database](/plugins/docmosis/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/docsumo/api API reference for Docsumo: every `docsumo.api.*` operation with input and output types. Every `docsumo.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agents ### listCases `agents.listCases` List cases for an external agent case type with pagination **Risk:** `read` ```ts theme={null} await corsair.docsumo.api.agents.listCases({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `casetype_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `sort_by` | `created_date.asc \| created_date.desc \| modified_date.asc \| modified_date.desc` | No | — | | `stage_id` | `string[]` | No | — | | `assigned_to` | `string[]` | No | — | | `workflow_state` | `string[]` | No | — | | `created_date_from` | `string` | No | — | | `created_date_to` | `string` | No | — | | `modified_date_from` | `string` | No | — | | `modified_date_to` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > cases?: { > }[], > pagination?: { > limit?: number, > offset?: number, > total?: number > } > } > ``` *** ### listExternal `agents.listExternal` List external agents configured in the Docsumo account **Risk:** `read` ```ts theme={null} await corsair.docsumo.api.agents.listExternal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `all \| doctype \| casetype` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > agents?: { > }[], > disabled_agents?: any[] > } > ``` *** ## Analytics ### mcaAnalysis `analytics.mcaAnalysis` Run MCA analysis on uploaded bank statement documents **Risk:** `read` ```ts theme={null} await corsair.docsumo.api.analytics.mcaAnalysis({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `doc_ids` | `string[]` | Yes | — | | `mca_list_db_table` | `string` | No | — | | `non_mca_list_db_table` | `string` | No | — | | `allow_partial` | `boolean` | No | — | | `webhook` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `account_summaries` | `object[]` | No | — | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | > **account\_summaries full type** > > ```ts theme={null} > { > }[][] > ``` *** ## Documents ### listAll `documents.listAll` List documents with optional filters and pagination **Risk:** `read` ```ts theme={null} await corsair.docsumo.api.documents.listAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `view` | `files \| folder \| all_files` | No | — | | `folder_id` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `doc_type` | `string` | No | — | | `status` | `reviewing \| processed \| erred` | No | — | | `q` | `string` | No | — | | `sort_by` | `created_date.asc \| created_date.desc` | No | — | | `created_date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > documents?: { > }[], > limit?: number, > offset?: number, > total?: number > } > ``` *** ## Document Types ### getEnabled `documentTypes.getEnabled` Get a summary of enabled and disabled document types for the account **Risk:** `read` ```ts theme={null} await corsair.docsumo.api.documentTypes.getEnabled({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### listEnabled `documentTypes.listEnabled` List document types currently enabled for the account **Risk:** `read` ```ts theme={null} await corsair.docsumo.api.documentTypes.listEnabled({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > document?: { > title?: string, > doc_type?: string > }[] > } > ``` *** ## Folders ### create `folders.create` Create a folder for organizing Docsumo documents **Risk:** `write` ```ts theme={null} await corsair.docsumo.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_name` | `string` | Yes | — | | `type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ## Tables ### addRow `tables.addRow` Add a new empty row to a Docsumo database table **Risk:** `write` ```ts theme={null} await corsair.docsumo.api.tables.addRow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ddid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### delete `tables.delete` Delete one or more Docsumo database tables **Risk:** `write` ```ts theme={null} await corsair.docsumo.api.tables.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dd_ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | *** ### getData `tables.getData` Retrieve all rows from a Docsumo database table **Risk:** `read` ```ts theme={null} await corsair.docsumo.api.tables.getData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ddid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > data?: { > }[], > limit?: number, > offset?: number, > total?: number > } > ``` *** ## User ### getDocumentTypes `user.getDocumentTypes` Get user account details and available document types **Risk:** `read` ```ts theme={null} await corsair.docsumo.api.user.getDocumentTypes({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `status_code` | `number` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `error_code` | `string` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > document_types?: { > title?: string, > value?: string > }[], > email?: string, > full_name?: string, > monthly_doc_current?: number, > monthly_doc_limit?: number, > user_id?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/docsumo/database Docsumo local sync: searchable entities, `.search()` filters, and operators. The Docsumo plugin syncs data locally. Use `corsair.docsumo.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/docsumo/overview Docsumo plugin for Corsair Use **Docsumo** through Corsair: one client, typed API calls. **What you get:** * 11 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/docsumo ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/docsumo ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/docsumo ``` ```bash bun theme={null} bun add corsair @corsair-dev/docsumo ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { docsumo } from '@corsair-dev/docsumo'; export const corsair = createCorsair({ plugins: [ docsumo(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} docsumo() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'docsumo', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`agents.listCases`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.docsumo.api.agents.listCases({}); ``` **`folders.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.docsumo.api.folders.create({}); ``` See the full list on the [API](/plugins/docsumo/api) page. ## What's next > **[API reference](/plugins/docsumo/api)** > > Every `docsumo.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/docupost/api API reference for Docupost: every `docupost.api.*` operation with input and output types. Every `docupost.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### balance `account.balance` Fetch the remaining DocuPost account balance **Risk:** `read` ```ts theme={null} await corsair.docupost.api.account.balance({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `balance` | `any` | No | — | *** ## Send ### letter `send.letter` Send a physical letter through DocuPost **Risk:** `write` ```ts theme={null} await corsair.docupost.api.send.letter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `to_name` | `string` | Yes | — | | `to_address` | `string` | Yes | — | | `to_city` | `string` | Yes | — | | `to_state` | `string` | Yes | — | | `to_zip` | `string` | Yes | — | | `from_name` | `string` | Yes | — | | `from_address` | `string` | Yes | — | | `from_city` | `string` | Yes | — | | `from_state` | `string` | Yes | — | | `from_zip` | `string` | Yes | — | | `pdf_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `status` | `string` | No | — | *** ### postcard `send.postcard` Send a physical postcard through DocuPost **Risk:** `write` ```ts theme={null} await corsair.docupost.api.send.postcard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `to_name` | `string` | Yes | — | | `to_address` | `string` | Yes | — | | `to_city` | `string` | Yes | — | | `to_state` | `string` | Yes | — | | `to_zip` | `string` | Yes | — | | `from_name` | `string` | Yes | — | | `from_address` | `string` | Yes | — | | `from_city` | `string` | Yes | — | | `from_state` | `string` | Yes | — | | `from_zip` | `string` | Yes | — | | `front_image_url` | `string` | Yes | — | | `back_image_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `status` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/docupost/database Docupost local sync: searchable entities, `.search()` filters, and operators. The Docupost plugin syncs data locally. Use `corsair.docupost.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/docupost/overview Docupost plugin for Corsair Use **Docupost** through Corsair: one client, typed API calls. **What you get:** * 3 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/docupost ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/docupost ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/docupost ``` ```bash bun theme={null} bun add corsair @corsair-dev/docupost ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { docupost } from '@corsair-dev/docupost'; export const corsair = createCorsair({ plugins: [ docupost(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} docupost() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'docupost', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.balance`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.docupost.api.account.balance({}); ``` **`send.letter`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.docupost.api.send.letter({}); ``` See the full list on the [API](/plugins/docupost/api) page. ## What's next > **[API reference](/plugins/docupost/api)** > > Every `docupost.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/docusign/api API reference for DocuSign: every `docusign.api.*` operation with input and output types. Every `docusign.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Add Contacts To Contacts List ### addContactsToContactsList `addContactsToContactsList` Adds multiple contacts to a user's contacts list in DocuSign. This endpoint allows for bulk addition of contacts with detailed information, including cloud provider details, phone numbers, email addresses, and notary-specific information. It's particularly useful for populating a user's address book **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addContactsToContactsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Email Overrides To Envelope ### addEmailOverridesToEnvelope `addEmailOverridesToEnvelope` Adds or modifies email override settings for a specific DocuSign envelope, allowing customization of the reply-to email address and name, as well as BCC email addresses for archiving purposes. This endpoint should be used when you need to change email settings for an individual envelope, overriding **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addEmailOverridesToEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Envelope Attachments ### addEnvelopeAttachments `addEnvelopeAttachments` Adds one or more envelope attachments to a draft or in-process envelope in DocuSign. This endpoint allows developers to include additional files with an envelope that are not converted to PDF and are only accessible through the API. It's useful for attaching supporting documents or metadata files th **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addEnvelopeAttachments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Existing Brand To Group ### addExistingBrandToGroup `addExistingBrandToGroup` This endpoint adds one or more existing brands to a specified group in DocuSign. It allows users to associate multiple brands with a group, enabling customized branding for different groups within an account. The endpoint should be used when there's a need to update the brands associated with a part **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addExistingBrandToGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add File To Workspace ### addFileToWorkspace `addFileToWorkspace` This endpoint adds a file to a specific folder within a DocuSign workspace. It allows users to upload and organize files in their DocuSign account, enabling better document management and collaboration. The method should be used when integrating file upload functionality with DocuSign workspaces, su **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addFileToWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Members To Signing Group ### addMembersToSigningGroup `addMembersToSigningGroup` This endpoint adds one or more new members to a specified signing group within a DocuSign account. Signing groups allow multiple users to act as potential signers for a document, where any member of the group can sign on behalf of the group. This tool should be used when you need to expand or update **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addMembersToSigningGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signingGroupId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add New Users To ASpecified Account ### addNewUsersToASpecifiedAccount `addNewUsersToASpecifiedAccount` This endpoint adds new users to a specified DocuSign account, allowing bulk creation of up to 500 users in a single call. It's ideal for quickly setting up multiple users with customized permissions and settings. The endpoint requires at least a username and email for each user, but supports additio **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addNewUsersToASpecifiedAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Or Update Account Stamps ### addOrUpdateAccountStamps `addOrUpdateAccountStamps` Add or update account-level stamps (Japanese Hanko-style stamps) in DocuSign. Stamps are pre-configured signature images that can be applied to documents. This action supports creating new stamps or updating existing ones by including the signatureId. \*\*Common use cases:\*\* - Create name stamps ( **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addOrUpdateAccountStamps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `decode_only` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Or Update User Custom Settings ### addOrUpdateUserCustomSettings `addOrUpdateUserCustomSettings` Adds or updates custom user settings for a specified DocuSign user. This endpoint allows for flexible storage and retrieval of user-specific information that can be used in your own system, separate from standard DocuSign account settings. It supports grouping of settings using the X-DocuSign-User-S **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addOrUpdateUserCustomSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Or Update User Signature ### addOrUpdateUserSignature `addOrUpdateUserSignature` This endpoint allows you to add or update a user's signature in DocuSign. It provides comprehensive management of signature properties, including the signature image, font, initials, and stamp details. Use this endpoint when you need to create a new signature for a user or modify an existing one. Th **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addOrUpdateUserSignature({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Part To Chunked Upload ### addPartToChunkedUpload `addPartToChunkedUpload` Adds a chunk or part to an existing chunked upload in DocuSign. This endpoint is used for uploading large files in smaller pieces, allowing for documents that exceed standard file size limits. It should be used after initiating a new chunked upload and uploading the first part. The method is particu **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addPartToChunkedUpload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chunkedUploadId` | `string` | Yes | — | | `chunkedUploadPartSeq` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Step To Envelope Workflow ### addStepToEnvelopeWorkflow `addStepToEnvelopeWorkflow` This endpoint adds a new step to an existing envelope's workflow in DocuSign. It allows for the configuration of complex workflow rules, including delayed routing, conditional recipients, and specific actions based on envelope status or recipient actions. Use this endpoint when you need to modify an **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addStepToEnvelopeWorkflow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Templates To Document In Envelope ### addTemplatesToDocumentInEnvelope `addTemplatesToDocumentInEnvelope` This endpoint adds pre-configured templates to a specific document within an existing envelope in DocuSign. It allows you to apply standardized content, such as tabs and anchor text, from templates to documents, streamlining the process of preparing documents for signature. Use this when you need to **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addTemplatesToDocumentInEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `preserve_template_recipient` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Templates To Envelope ### addTemplatesToEnvelope `addTemplatesToEnvelope` This endpoint adds templates to an existing DocuSign envelope. It's used to apply pre-defined document templates, including content and settings, to standardize workflows. The operation can affect existing recipients based on the 'preserve\_template\_recipient' parameter. It's suitable for adding co **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addTemplatesToEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `preserve_template_recipient` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add User Signature And Initials Images ### addUserSignatureAndInitialsImages `addUserSignatureAndInitialsImages` Add or update a user's signature and initials images in DocuSign. This action creates default signature images based on the user's name and a DocuSign font style. When using JSON content type (as this action does), DocuSign automatically generates signature images based on the signatureName and sign **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addUserSignatureAndInitialsImages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Add Users To Existing Group ### addUsersToExistingGroup `addUsersToExistingGroup` Adds one or more existing DocuSign users to an existing group within a specified account. This endpoint is used to manage group memberships by adding users to a predefined group. It requires the account ID and group ID as path parameters, and accepts a list of user information in the request body. T **Risk:** `write` ```ts theme={null} await corsair.docusign.api.addUsersToExistingGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Apply Action To Bulk Send Envelopes ### applyActionToBulkSendEnvelopes `applyActionToBulkSendEnvelopes` This endpoint allows users to apply specific actions (resend, correct, or void) to all envelopes within a specified DocuSign bulk send batch. It's designed for managing large-scale document signing processes efficiently, enabling users to update the status or take action on multiple envelopes simult **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.applyActionToBulkSendEnvelopes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkSendBatchId` | `string` | Yes | — | | `bulkAction` | `resend \| correct \| void` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Change Users In Account ### changeUsersInAccount `changeUsersInAccount` This endpoint allows you to update information for one or more users within a DocuSign account. It is used to modify various user attributes such as personal information, settings, permissions, and notification preferences. The endpoint is particularly useful for account administrators who need to m **Risk:** `write` ```ts theme={null} await corsair.docusign.api.changeUsersInAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `allow_all_languages` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Close Users In Account ### closeUsersInAccount `closeUsersInAccount` Closes one or more users in a DocuSign account, preventing them from accessing account features without permanently deleting them. This endpoint is useful for temporarily disabling user access, such as when an employee is on leave or has changed roles. It allows for easy re-activation of users throu **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.closeUsersInAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `delete` | `string` | No | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > users: { > userId?: string, > userName?: string, > email?: string > }[] > } > ``` **Output:** *empty object* *** ## Commit Chunked Upload For Envelopes ### commitChunkedUploadForEnvelopes `commitChunkedUploadForEnvelopes` This endpoint commits a chunked upload in DocuSign, finalizing the upload process and preparing the uploaded content for use in other API calls. It should be used after all parts of a large document have been uploaded using the chunked upload method. The endpoint performs integrity checks on the upl **Risk:** `write` ```ts theme={null} await corsair.docusign.api.commitChunkedUploadForEnvelopes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chunkedUploadId` | `string` | Yes | — | | `action` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Configure Cloud Storage Redirect Url ### configureCloudStorageRedirectUrl `configureCloudStorageRedirectUrl` Configures the OAuth redirect URL for one or more cloud storage providers (Box, Dropbox, GoogleDrive, SkyDrive/OneDrive, Salesforce) for a specific user in DocuSign. This action sets up the authentication flow between DocuSign and cloud storage services by specifying where users should be redirected **Risk:** `write` ```ts theme={null} await corsair.docusign.api.configureCloudStorageRedirectUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Account Custom Field ### createAccountCustomField `createAccountCustomField` Creates a new custom field at the account level in DocuSign, making it available for all new envelopes associated with the account. This endpoint enables account administrators to define custom fields for enhanced envelope management and grouping. The created custom field can be of type 'text' or 'l **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createAccountCustomField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apply_to_templates` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create ACollaborative Workspace ### createACollaborativeWorkspace `createACollaborativeWorkspace` Creates a new collaborative workspace in DocuSign for document management and team collaboration. A workspace provides a centralized area for file sharing and collaborative work on agreements. Use this when setting up a new project or team workspace. The creator becomes the workspace owner automatic **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createACollaborativeWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Bcc Email Archive Configuration ### createBccEmailArchiveConfiguration `createBccEmailArchiveConfiguration` Creates a BCC email archive configuration for a DocuSign account, enabling automatic archiving of DocuSign-generated emails. This endpoint allows you to set up a BCC email address that will receive copies of all DocuSign notifications for the specified account. It's particularly useful for organizat **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createBccEmailArchiveConfiguration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Brand Profiles For Account ### createBrandProfilesForAccount `createBrandProfilesForAccount` Creates a new brand profile for a DocuSign account to customize the signing and sending experience with your organization's visual identity and branding elements. This action allows you to define brand properties such as company name, brand languages, colors for UI elements (buttons, headers), and c **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createBrandProfilesForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Bulk Send Request ### createBulkSendRequest `createBulkSendRequest` Initiates a bulk send process in DocuSign to send a single template or envelope to multiple recipients in a single batch operation. This is ideal for large-scale document distribution scenarios such as sending contracts to numerous clients or company-wide notices. \*\*Prerequisites:\*\* 1. Create a **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createBulkSendRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkSendListId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Bulk Send Test Request ### createBulkSendTestRequest `createBulkSendTestRequest` This endpoint creates a Bulk Send Test Request to validate the compatibility between a bulk send list and an envelope or template for DocuSign's bulk sending feature. It performs comprehensive checks on envelope state, recipients, tabs, and custom fields to ensure a successful bulk send operation. U **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createBulkSendTestRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkSendListId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Connect Configuration For Account ### createConnectConfigurationForAccount `createConnectConfigurationForAccount` This endpoint creates a custom Connect configuration for a specified DocuSign account, enabling webhook notifications for envelope and recipient events. It allows users to set up real-time updates for eSignature workflows without the need for polling. The configuration can be customized for differen **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createConnectConfigurationForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Custom Document Fields In Envelope ### createCustomDocumentFieldsInEnvelope `createCustomDocumentFieldsInEnvelope` Creates custom document fields in an existing envelope document within DocuSign. This endpoint allows you to add metadata to specific documents in an envelope, which can be used for tracking, sorting, and reporting purposes. It's particularly useful when you need to associate additional information **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createCustomDocumentFieldsInEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Custom Fields For Envelope ### createCustomFieldsForEnvelope `createCustomFieldsForEnvelope` This endpoint allows you to create or update custom fields for a specific DocuSign envelope. It is used to add or modify additional metadata to envelopes, which can be utilized for sorting, organizing, searching, and other downstream processes. The endpoint supports both list-type custom fields (wit **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createCustomFieldsForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Custom Fields In Template Document ### createCustomFieldsInTemplateDocument `createCustomFieldsInTemplateDocument` Creates custom document fields in an existing template document within DocuSign. This endpoint allows users to add metadata to specific documents in a template, enhancing document management and workflow customization. It is particularly useful for prepopulating custom data fields that will be appli **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createCustomFieldsInTemplateDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > documentFields: { > name?: string, > value?: string > }[] > } > ``` **Output:** *empty object* *** ## Create Custom Tab With Properties ### createCustomTabWithProperties `createCustomTabWithProperties` Creates a custom tab with pre-defined properties for use in DocuSign envelopes. This endpoint allows users to define reusable tab types with specific configurations such as font styles, validation patterns, and positioning rules. Custom tabs can be created for various field types including text, che **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createCustomTabWithProperties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Document Responsive Html Preview ### createDocumentResponsiveHtmlPreview `createDocumentResponsiveHtmlPreview` Creates a responsive HTML preview for a specific document in an envelope. Generates a mobile-friendly preview showing how the document renders on different devices. Useful for testing smart sections, collapsible content, and responsive tables before sending. \*\*Requirements:\*\* Envelope and docume **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createDocumentResponsiveHtmlPreview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Envelope ### createEnvelope `createEnvelope` Creates a signing envelope from a pre-existing DocuSign template. **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | No | — | | `emailSubject` | `string` | Yes | — | | `status` | `sent \| created` | Yes | — | | `templateRoles` | `object[]` | No | — | | `documents` | `object[]` | No | — | | `recipients` | `object` | No | — | > **templateRoles full type** > > ```ts theme={null} > { > email: string, > name: string, > roleName: string > }[] > ``` > **documents full type** > > ```ts theme={null} > { > documentId: string, > name: string, > fileExtension?: string, > documentBase64?: string > }[] > ``` > **recipients full type** > > ```ts theme={null} > { > signers?: { > email: string, > name: string, > recipientId: string, > routingOrder?: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `status` | `string` | Yes | — | | `statusDateTime` | `string` | No | — | | `uri` | `string` | No | — | *** ## Create Groups For Account ### createGroupsForAccount `createGroupsForAccount` Creates one or more groups for a specified DocuSign account. This endpoint is used for managing user access and permissions by organizing users into groups. Groups can be associated with permission profiles to streamline user management for large numbers of users. The endpoint accepts an array of gr **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createGroupsForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Idproof Resource Token For Recipient ### createIdproofResourceTokenForRecipient `createIdproofResourceTokenForRecipient` Generates a 2-minute resource token to access recipient identity verification data via DocuSign's ID Evidence API. \*\*Requirements:\*\* Recipient must have completed identity verification (phone auth, ID scan, etc.) during envelope signing. Fails if envelope is draft or verification incomplete. \*\\ **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createIdproofResourceTokenForRecipient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `token_scopes` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create New Account Permission Profile ### createNewAccountPermissionProfile `createNewAccountPermissionProfile` This endpoint creates a new permission profile for a DocuSign account, defining specific sets of permissions for user groups. It allows administrators to establish role-based access control within their DocuSign environment. The profile controls a wide range of user capabilities, from basic envelope **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createNewAccountPermissionProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Notary Jurisdiction Object ### createNotaryJurisdictionObject `createNotaryJurisdictionObject` Registers a notary jurisdiction for the current DocuSign user, enabling electronic notarizations for a specific U.S. state. A user can only have ONE jurisdiction at a time. Required fields: commissionExpiration (MM/DD/YYYY format), commissionId, registeredName, sealType, and jurisdiction details (ju **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createNotaryJurisdictionObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Or Update User Authorizations ### createOrUpdateUserAuthorizations `createOrUpdateUserAuthorizations` Creates or updates user authorizations in DocuSign, allowing an agent user to perform actions on behalf of a principal user. Grants permissions like Send, Manage, Sign, or Edit. Requirements: principal must be authenticated user or caller must be admin; agent users must be active; principal and agen **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createOrUpdateUserAuthorizations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Preview Of Responsive Html ### createPreviewOfResponsiveHtml `createPreviewOfResponsiveHtml` Creates a preview of the responsive HTML version of a specific template document in DocuSign. This endpoint allows users to visualize how a PDF document will be converted to responsive HTML across various device types before sending it for signing. It's particularly useful for ensuring that template **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createPreviewOfResponsiveHtml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Preview Of Responsive Html In Envelope ### createPreviewOfResponsiveHtmlInEnvelope `createPreviewOfResponsiveHtmlInEnvelope` Creates a preview of the responsive HTML versions of all documents in an envelope, allowing users to review how PDF documents will appear as responsive HTML across different device types before sending. This endpoint is particularly useful for ensuring document compatibility and readability on vario **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createPreviewOfResponsiveHtmlInEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Recipient Manual Review Link ### createRecipientManualReviewLink `createRecipientManualReviewLink` Creates a URL for manually reviewing a recipient's identity in DocuSign. This endpoint is used when automatic identity verification has failed and manual review is required. It returns a URL that allows the sender to access a page for manually verifying the recipient's ID. This method should only be **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createRecipientManualReviewLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Recipient Preview For Envelope ### createRecipientPreviewForEnvelope `createRecipientPreviewForEnvelope` Creates a URL for previewing the recipient's view of a draft envelope or template. This endpoint allows senders to simulate the recipient's experience by generating an embeddable preview URL. It's useful for verifying the appearance and functionality of an envelope before sending it to recipients. T **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createRecipientPreviewForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Recipient View Url ### createRecipientViewUrl `createRecipientViewUrl` Generates a recipient view URL for embedded signing or viewing. **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createRecipientViewUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `userName` | `string` | Yes | — | | `email` | `string` | Yes | — | | `returnUrl` | `string` | Yes | — | | `authenticationMethod` | `string` | No | — | | `recipientId` | `string` | Yes | — | | `clientUserId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | *** ## Create Sender View Url For Envelope ### createSenderViewUrlForEnvelope `createSenderViewUrlForEnvelope` Creates a URL for the sender view of a DocuSign envelope, enabling the embedding of DocuSign UI within an external application. This endpoint is crucial for integrating envelope sending functionality, allowing users to prepare and send envelopes directly from your application. The returned URL provi **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createSenderViewUrlForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Signing Group ### createSigningGroup `createSigningGroup` Creates one or more signing groups in a DocuSign account. This endpoint allows account administrators to set up predefined groups of recipients for document signing. Multiple signing groups can be created in a single API call, enhancing efficiency in setting up complex signing workflows. Use this wh **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createSigningGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Template Document Custom Fields ### createTemplateDocumentCustomFields `createTemplateDocumentCustomFields` Creates custom fields on a DocuSign template to capture additional metadata. Custom fields allow you to: - Add dropdown lists (listCustomFields) where senders select from predefined options - Add text fields (textCustomFields) where senders enter free-form text - Set default values and mark fields a **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createTemplateDocumentCustomFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Template Recipient Preview Url ### createTemplateRecipientPreviewUrl `createTemplateRecipientPreviewUrl` Generate a preview URL showing how a template will appear to recipients. This action creates an embeddable URL that displays a template from the recipient's perspective, allowing senders to verify the signing experience before sending the actual document. This is particularly useful for: - Previewin **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createTemplateRecipientPreviewUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Template Responsive Html Preview ### createTemplateResponsiveHtmlPreview `createTemplateResponsiveHtmlPreview` Creates a preview of the responsive HTML versions of all documents associated with a DocuSign template. This endpoint enables users to generate and customize the HTML preview of PDF documents across various device types before sending them for signing. It is particularly useful for ensuring that doc **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createTemplateResponsiveHtmlPreview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Template Workflow Step ### createTemplateWorkflowStep `createTemplateWorkflowStep` Adds a new workflow step to an existing DocuSign template. This action enables sophisticated document routing automation within templates, including: - Pausing workflows before specific routing steps - Implementing delayed sending with scheduled resume dates - Setting up conditional recipient routin **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createTemplateWorkflowStep({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create Urlfor Template Edit View ### createUrlforTemplateEditView `createUrlforTemplateEditView` Creates a URL for embedding the DocuSign Template Edit view within an application. This endpoint enables developers to integrate DocuSign's template creation and editing functionality directly into their applications, allowing users to manage templates without leaving the app environment. The genera **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createUrlforTemplateEditView({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Create User Authorization For Agent User ### createUserAuthorizationForAgentUser `createUserAuthorizationForAgentUser` Creates a user authorization in DocuSign, enabling an agent user to perform specific actions on behalf of a principal user within the same account. This endpoint is essential for setting up delegated access, allowing users to share envelope management, signing, or sending capabilities. It's particul **Risk:** `write` ```ts theme={null} await corsair.docusign.api.createUserAuthorizationForAgentUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Delete Account Brand ### deleteAccountBrand `deleteAccountBrand` This endpoint deletes a specific brand from a DocuSign account. It should be used when you need to permanently remove a brand configuration from an account, such as when a brand is no longer needed or has been replaced. The operation requires that branding for either signing or sending (or both) is **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteAccountBrand({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Account Custom Field ### deleteAccountCustomField `deleteAccountCustomField` Deletes an existing account custom field from a DocuSign account. This endpoint should be used when you need to remove a custom field that is no longer required or relevant for your account. It permanently removes the custom field, so use with caution. The deletion can optionally be applied to templ **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteAccountCustomField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customFieldId` | `string` | Yes | — | | `apply_to_templates` | `string` | No | — | **Output:** *empty object* *** ## Delete Account Permission Profile ### deleteAccountPermissionProfile `deleteAccountPermissionProfile` This endpoint deletes a specific permission profile from a DocuSign account. It is used to remove outdated or unnecessary permission profiles, helping to streamline account management. The endpoint requires that the profile being deleted has no associated users, unless they are being reassigned to a **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteAccountPermissionProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `permissionProfileId` | `string` | Yes | — | | `move_users_to` | `string` | No | — | **Output:** *empty object* *** ## Delete Account Stamp ### deleteAccountStamp `deleteAccountStamp` Deletes a specific account stamp (signature) from a DocuSign account. This endpoint should be used when you need to permanently remove a stamp from an account, such as when it's no longer needed or has been replaced. The operation is irreversible, so use it with caution. It's particularly useful for **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteAccountStamp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signatureId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Bcc Email Archive Configuration ### deleteBccEmailArchiveConfiguration `deleteBccEmailArchiveConfiguration` This endpoint deletes a BCC (Blind Carbon Copy) email archive configuration from a specified DocuSign account. When invoked, it changes the status of the targeted configuration to 'closed' and immediately stops the archiving of DocuSign-generated email messages to the associated BCC email address. T **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteBccEmailArchiveConfiguration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bccEmailArchiveId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Brand From Group ### deleteBrandFromGroup `deleteBrandFromGroup` This endpoint allows users to delete one or more brands from a specified group within a DocuSign account. It is used to manage brand associations with groups, enabling customization of branding for different envelopes and signing experiences. The operation removes the specified brands from the group **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteBrandFromGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Brand Logo By Type ### deleteBrandLogoByType `deleteBrandLogoByType` This endpoint deletes a specific logo from an account brand in DocuSign. It allows users to remove primary, secondary, or email logos associated with their brand, helping maintain brand consistency across DocuSign documents. The endpoint should be used when updating or removing branding elements fro **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteBrandLogoByType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `logoType` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Brand Profiles ### deleteBrandProfiles `deleteBrandProfiles` This endpoint allows you to delete one or more brand profiles from a DocuSign account. It is used to remove custom branding configurations that are no longer needed. The method requires either the 'canSelfBrandSign' or 'canSelfBrandSend' setting to be enabled for the account. It's important to note **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteBrandProfiles({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Delete Chunked Upload ### deleteChunkedUpload `deleteChunkedUpload` Deletes a chunked upload that has been committed but not yet consumed in the DocuSign system. This endpoint is useful for managing large file uploads and maintaining quota efficiency. It should be used when a chunked upload is no longer needed and hasn't been used in other API calls. The endpoint ca **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteChunkedUpload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chunkedUploadId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Connect Configuration ### deleteConnectConfiguration `deleteConnectConfiguration` Deletes a specified DocuSign Connect configuration from the given account. This endpoint should be used when you need to remove an existing Connect integration setup. It requires account administrator privileges and that Connect is enabled on the account. The operation is irreversible, so use with c **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteConnectConfiguration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Connect Failure Log Entry ### deleteConnectFailureLogEntry `deleteConnectFailureLogEntry` Deletes one or all Connect failure log entries for a specified DocuSign account. This endpoint is used for maintenance and cleanup of Connect integration logs, allowing account administrators to remove specific failure records or clear all failure logs. It should be used when troubleshooting Connect **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteConnectFailureLogEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `failureId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Connect Log Entries ### deleteConnectLogEntries `deleteConnectLogEntries` Deletes Connect log entries for a DocuSign account. This endpoint allows account administrators to manage and clean up Connect event logs, which record webhook delivery attempts and outcomes. \*\*Use Case:\*\* Remove Connect log entries for data management, privacy compliance, or housekeeping purpos **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteConnectLogEntries({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Delete Connect Oauth Configuration ### deleteConnectOauthConfiguration `deleteConnectOauthConfiguration` Deletes the Connect OAuth configuration for a specified DocuSign account. This endpoint is used to remove the OAuth settings that allow DocuSign Connect to securely integrate with other applications and send webhook notifications. It should be used when you need to disable or reconfigure the Connect **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteConnectOauthConfiguration({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Delete Contact From Account ### deleteContactFromAccount `deleteContactFromAccount` Deletes a specific contact from a DocuSign account. This endpoint should be used when you need to remove a contact's information from an account's address book. It requires both the account ID and the specific contact ID to be provided. Upon successful deletion, it returns an updated list of contact **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteContactFromAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Custom Document Fields ### deleteCustomDocumentFields `deleteCustomDocumentFields` Deletes custom document fields from an existing envelope document in DocuSign. This endpoint allows you to remove specific metadata or custom data strings associated with a document within an envelope. It's useful for updating or cleaning up custom information that is no longer relevant or needed. T **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteCustomDocumentFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Custom Document Fields From Template ### deleteCustomDocumentFieldsFromTemplate `deleteCustomDocumentFieldsFromTemplate` Deletes specified custom document fields from an existing template document in DocuSign. This endpoint is useful for maintaining and updating templates by removing unnecessary or outdated custom fields. It should be used when you need to clean up or modify the structure of a template document. The o **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteCustomDocumentFieldsFromTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Custom Fields In Template ### deleteCustomFieldsInTemplate `deleteCustomFieldsInTemplate` Deletes specified custom fields from a DocuSign template. This action removes envelope-level custom fields (both list and text types) that are no longer needed. \*\*How it works:\*\* - Specify which custom fields to delete by providing their fieldId values - You can delete multiple list and/or text **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteCustomFieldsInTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Delete Custom Tab Information ### deleteCustomTabInformation `deleteCustomTabInformation` Deletes a specified custom tab from a DocuSign account. This endpoint should be used when you need to remove a custom tab that is no longer needed or is obsolete. It permanently removes the custom tab from the account, so it should be used with caution. The operation requires both the account ID and **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteCustomTabInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customTabId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Custom User Settings ### deleteCustomUserSettings `deleteCustomUserSettings` Deletes specified custom user settings for a DocuSign user by their names. Custom user settings allow flexible storage and retrieval of user-specific information within DocuSign (separate from standard account settings). This endpoint removes one or more custom settings by specifying their names in **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteCustomUserSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Delayed Routing Rule For Envelope Step ### deleteDelayedRoutingRuleForEnvelopeStep `deleteDelayedRoutingRuleForEnvelopeStep` This endpoint deletes the delayed routing object for a specific envelope's workflow step in DocuSign. It allows users to remove scheduled delays in the routing process of an envelope. The endpoint should be used when you need to cancel a planned delay in the envelope's workflow, but it cannot be cal **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteDelayedRoutingRuleForEnvelopeStep({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Delayed Routing Rules For Template ### deleteDelayedRoutingRulesForTemplate `deleteDelayedRoutingRulesForTemplate` Deletes the delayed routing rules for a specific template workflow step in DocuSign. This endpoint should be used when you need to remove timing or conditional routing logic from a template, allowing for immediate progression to the next step in the workflow. It's particularly useful when updating o **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteDelayedRoutingRulesForTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Draft Envelope Attachments ### deleteDraftEnvelopeAttachments `deleteDraftEnvelopeAttachments` Deletes one or more envelope attachments from a draft envelope in DocuSign. This endpoint allows users to remove attachments that are no longer needed or were added in error before the envelope is sent. It's important to note that this operation only works on draft envelopes and is distinct from man **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteDraftEnvelopeAttachments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > attachments: { > attachmentId: string > }[] > } > ``` **Output:** *empty object* *** ## Delete Enote Configuration ### deleteEnoteConfiguration `deleteEnoteConfiguration` Deletes an existing eNote configuration associated with a specific DocuSign account. This endpoint is part of the ENoteConfigurations API and is currently in beta status. It should be used when you need to remove an eNote configuration that is no longer needed or is incorrect. The operation is irrev **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteEnoteConfiguration({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Delete Envelope Custom Fields ### deleteEnvelopeCustomFields `deleteEnvelopeCustomFields` This endpoint deletes envelope custom fields for draft and in-process envelopes in DocuSign. It allows users to remove both list custom fields (predefined options) and text custom fields (free-form text) associated with a specific envelope. The operation requires the account ID and envelope ID to id **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteEnvelopeCustomFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Envelope Email Settings ### deleteEnvelopeEmailSettings `deleteEnvelopeEmailSettings` Deletes all existing email override settings for a specific envelope in DocuSign. This endpoint reverts the envelope's email configuration back to the account's default settings, affecting only future email communications. It's useful when you need to remove customized email settings for an envelope **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteEnvelopeEmailSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Envelope Lock ### deleteEnvelopeLock `deleteEnvelopeLock` Deletes the lock from a specified envelope, allowing it to be modified again. \*\*Important Requirements:\*\* - Only the user who originally locked the envelope can delete the lock - The lock is automatically released when the lock duration expires - Deleting a lock without the X-DocuSign-Edit heade **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteEnvelopeLock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `lockToken` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Delete Envelope Scheduled Sending Rules ### deleteEnvelopeScheduledSendingRules `deleteEnvelopeScheduledSendingRules` Deletes the scheduled sending rules for a specific envelope's workflow in DocuSign. This endpoint should be used when you need to cancel or remove previously set rules for scheduled sending of an envelope. It's particularly useful for managing automated document workflows where timing adjustments ar **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteEnvelopeScheduledSendingRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Envelope Transfer Rule ### deleteEnvelopeTransferRule `deleteEnvelopeTransferRule` Deletes a specific envelope transfer rule from a DocuSign account. This endpoint allows account administrators to remove previously created rules that automatically transfer ownership of envelopes between users. It should be used when a transfer rule is no longer needed or requires updating. The ope **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteEnvelopeTransferRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeTransferRuleId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Envelope Workflow Definition ### deleteEnvelopeWorkflowDefinition `deleteEnvelopeWorkflowDefinition` This endpoint deletes the workflow definition for a specified envelope in DocuSign. It's used to remove any scheduled or automated processes associated with the envelope, such as delayed sending or routing. When called, it cancels any scheduled send and resets the envelope status to 'created'. This **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteEnvelopeWorkflowDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Envelope Workflow Step ### deleteEnvelopeWorkflowStep `deleteEnvelopeWorkflowStep` Deletes a specific workflow step from an envelope in DocuSign. This endpoint allows you to remove a single step from an envelope's workflow definition, potentially altering the envelope's processing lifecycle. Use this when you need to modify an envelope's workflow by removing unnecessary or outdate **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteEnvelopeWorkflowStep({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Existing Workspace Logically ### deleteExistingWorkspaceLogically `deleteExistingWorkspaceLogically` Marks a DocuSign workspace as deleted by changing its status to "status\_deleted". This is a logical deletion that makes the workspace inaccessible to users but preserves the workspace data in the system. The workspace will no longer appear in active workspace lists and users cannot access its files **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteExistingWorkspaceLogically({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Members From Signing Group ### deleteMembersFromSigningGroup `deleteMembersFromSigningGroup` Removes one or more members from a specified DocuSign signing group. This endpoint allows you to manage the composition of your signing groups by deleting users who no longer need access. It should be used when you want to remove specific individuals from a signing group, such as when an employee le **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteMembersFromSigningGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signingGroupId` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > users: { > userName?: string, > email?: string > }[] > } > ``` **Output:** *empty object* *** ## Delete Multiple Contacts From Account ### deleteMultipleContactsFromAccount `deleteMultipleContactsFromAccount` Deletes multiple contacts associated with a specific DocuSign account. This endpoint allows for bulk removal of contacts from an account's address book, streamlining contact management operations. It's particularly useful for cleaning up outdated or unnecessary contacts, or when reorganizing large c **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteMultipleContactsFromAccount({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Delete Notary Jurisdiction ### deleteNotaryJurisdiction `deleteNotaryJurisdiction` Deletes a specified notary jurisdiction from the DocuSign system. This endpoint should be used when you need to remove a notary jurisdiction from your DocuSign account, typically when a notary is no longer active in a particular jurisdiction or when correcting erroneously added jurisdictions. The op **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteNotaryJurisdiction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jurisdictionId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete One Or More Signing Groups ### deleteOneOrMoreSigningGroups `deleteOneOrMoreSigningGroups` Deletes one or more signing groups from a specified DocuSign account. This endpoint allows for bulk deletion of signing groups, which are collections of users authorized to sign documents on behalf of the group. It should be used when you need to remove outdated or unnecessary signing groups from yo **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteOneOrMoreSigningGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > groups: { > signingGroupId?: string > }[] > } > ``` **Output:** *empty object* *** ## Delete Page From Document In Envelope ### deletePageFromDocumentInEnvelope `deletePageFromDocumentInEnvelope` Deletes a specific page from a document within a DocuSign envelope. This endpoint removes a single page from a document based on its page number. The page is permanently deleted and this operation cannot be undone. \*\*Important Requirements:\*\* - The envelope must be in draft status (not yet sent) **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deletePageFromDocumentInEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `pageNumber` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Page From Template Document ### deletePageFromTemplateDocument `deletePageFromTemplateDocument` Deletes a specific page from a document within a DocuSign template. This endpoint allows you to remove a single page from a template document, which can be useful for updating or refining existing templates. Use this when you need to modify the structure of a template by removing unnecessary or outd **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deletePageFromTemplateDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `pageNumber` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Power Form By Id ### deletePowerFormById `deletePowerFormById` This endpoint deletes a specific PowerForm identified by its unique ID within a DocuSign account. PowerForms are pre-configured document templates that can be accessed via a custom URL, allowing for easy collection of signatures and form data. Use this endpoint when you need to permanently remove a **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deletePowerFormById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `powerFormId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Request Log Files ### deleteRequestLogFiles `deleteRequestLogFiles` Deletes all request log files for the authenticated user in DocuSign. This endpoint clears the diagnostic log buffer by removing all current request/response log entries. API request logging in DocuSign captures up to 50 request/response pairs for troubleshooting purposes. Use this action to clear t **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteRequestLogFiles({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Delete Scheduled Sending Rules ### deleteScheduledSendingRules `deleteScheduledSendingRules` Deletes all scheduled sending rules associated with a specific DocuSign template's workflow. This endpoint should be used when you need to remove automated sending schedules for a template, reverting it to manual sending only. It's particularly useful for updating or removing outdated scheduling con **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteScheduledSendingRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Signature For Captive Recipients ### deleteSignatureForCaptiveRecipients `deleteSignatureForCaptiveRecipients` Deletes the signature for one or more captive (embedded) recipients in DocuSign. This endpoint is primarily used for testing and development purposes to reset signatures associated with embedded recipients (identified by clientUserId). After deletion, a new signature can be created the next time the **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteSignatureForCaptiveRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recipientPart` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Specific Connect Log Entry ### deleteSpecificConnectLogEntry `deleteSpecificConnectLogEntry` Deletes a specified entry or all entries from the DocuSign Connect log for a given account. This endpoint is crucial for managing and cleaning up Connect logs, which contain records of events and updates in eSignature workflows. It should be used when you need to remove specific log entries, perhaps **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteSpecificConnectLogEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `logId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Specified Account ### deleteSpecifiedAccount `deleteSpecifiedAccount` Deletes (closes) a specified DocuSign account. This operation permanently closes the account and can only be performed by an account admin. Once an account is closed, it cannot be reopened by users and must be reactivated by DocuSign support. Use this endpoint with caution as it has significant impl **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteSpecifiedAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `redact_user_data` | `string` | No | — | **Output:** *empty object* *** ## Delete Stamp Image For Account ### deleteStampImageForAccount `deleteStampImageForAccount` This endpoint deletes a specific stamp image associated with an account signature in DocuSign. It is used to remove the visual representation of a stamp from a user's account, which can be useful for updating or removing outdated stamps. The endpoint requires the account ID, the type of image being **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteStampImageForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signatureId` | `string` | Yes | — | | `imageType` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Template From Envelope Document ### deleteTemplateFromEnvelopeDocument `deleteTemplateFromEnvelopeDocument` Deletes a template from a document within an envelope. Removes a previously applied template from a specific document. This is useful when: - Replacing one template with another - Reverting a document to its original state - Correcting template application errors ⚠️ This operation is permanent and c **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteTemplateFromEnvelopeDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Template Lock ### deleteTemplateLock `deleteTemplateLock` Deletes the lock from a specified DocuSign template, releasing it for editing by others. \*\*Important Requirements:\*\* - The lock token is required to authenticate ownership of the lock - Only the user/application that created the lock can delete it - The lock is automatically released when the lo **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteTemplateLock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `lockToken` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Delete Template Workflow Step ### deleteTemplateWorkflowStep `deleteTemplateWorkflowStep` Deletes a specific workflow step from a template's workflow definition in DocuSign. This endpoint allows users to customize and refine their document workflows by removing individual steps from existing templates. It should be used when modifying the structure of a template's workflow, such as remov **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteTemplateWorkflowStep({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete User Auth For Cloud Storage Providers ### deleteUserAuthForCloudStorageProviders `deleteUserAuthForCloudStorageProviders` This endpoint deletes the user authentication information for one or more cloud storage providers associated with a specific DocuSign user account. It's used to revoke access to connected cloud storage services, requiring the user to re-authenticate the next time they attempt to access these provide **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteUserAuthForCloudStorageProviders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `serviceId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete User Authorization ### deleteUserAuthorization `deleteUserAuthorization` Deletes a specific user authorization within the DocuSign system. This endpoint is used to revoke or remove permissions previously granted to a user. It requires either account administrator privileges or being the principal user of the specified authorization. The operation is irreversible, so it s **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteUserAuthorization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `authorizationId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete User Authorizations ### deleteUserAuthorizations `deleteUserAuthorizations` The DeleteUserAuthorizations endpoint is used to remove one or more user authorizations for a specified principal user within a DocuSign account. This tool allows account administrators or the principal user themselves to revoke specific permissions or access rights previously granted to the user. I **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteUserAuthorizations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete User Cloud Storage Authentication ### deleteUserCloudStorageAuthentication `deleteUserCloudStorageAuthentication` This endpoint deletes the user authentication information for a specified cloud storage provider in DocuSign. It's used to remove the stored credentials that allow a user to access their cloud storage within the DocuSign platform. After deletion, the next time the user attempts to access this cloud **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteUserCloudStorageAuthentication({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete User Group ### deleteUserGroup `deleteUserGroup` Deletes one or more existing user groups from a specified DocuSign account. This endpoint should be used when you need to remove user groups that are no longer needed or have become obsolete. It requires the account ID and the group ID(s) of the group(s) to be deleted. The operation is irreversible, **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteUserGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > groups: { > groupId?: string > }[] > } > ``` **Output:** *empty object* *** ## Delete User Initials Or Signature Image ### deleteUserInitialsOrSignatureImage `deleteUserInitialsOrSignatureImage` This endpoint deletes a specified initials image or signature image for a user in DocuSign. It allows users to remove either their initials image or signature image from their DocuSign account. The endpoint should be used when a user wants to update or remove their existing signature or initials ima **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteUserInitialsOrSignatureImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `signatureId` | `string` | Yes | — | | `imageType` | `string` | Yes | — | **Output:** *empty object* *** ## Delete User Profile Image ### deleteUserProfileImage `deleteUserProfileImage` Deletes the profile image of a specified user within a DocuSign account. This endpoint should be used when a user wants to remove their current profile picture from their DocuSign account. It's important to note that this operation can only be performed by the user on their own profile; even users w **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteUserProfileImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Users From Group ### deleteUsersFromGroup `deleteUsersFromGroup` Deletes one or more users from a specified group within a DocuSign account. This endpoint allows for bulk removal of users from a group, streamlining group management operations. It requires the account ID, group ID, and a list of users to be deleted. The endpoint is useful for maintaining group mem **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteUsersFromGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > users: { > userId?: string, > userName?: string, > email?: string > }[] > } > ``` **Output:** *empty object* *** ## Delete Workflow Definition For Template ### deleteWorkflowDefinitionForTemplate `deleteWorkflowDefinitionForTemplate` Deletes the workflow definition associated with a specific template in DocuSign. This endpoint is used to remove any existing workflow settings from a template, such as scheduled sending or delayed routing. It's particularly useful when you need to reset a template's workflow or prepare it for new w **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteWorkflowDefinitionForTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Delete Workspace Files Or Folders ### deleteWorkspaceFilesOrFolders `deleteWorkspaceFilesOrFolders` This endpoint allows for the deletion of one or more files or sub-folders from a DocuSign workspace folder or root. It's used to remove unwanted or obsolete items from a workspace, helping to maintain organization and manage storage. The operation can handle bulk deletions, making it efficient for c **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.deleteWorkspaceFilesOrFolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | **Output:** *empty object* *** ## Deprecated Endpoint For Tab Blob ### deprecatedEndpointForTabBlob `deprecatedEndpointForTabBlob` This deprecated endpoint is used to update tab-related data (tab blobs) within a specific envelope in a DocuSign account. It is important to note that this endpoint should not be used in new integrations or applications due to its deprecated status. The endpoint requires both an account identifier a **Risk:** `read` ```ts theme={null} await corsair.docusign.api.deprecatedEndpointForTabBlob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Export Brand To Xmlfile ### exportBrandToXmlfile `exportBrandToXmlfile` Exports a DocuSign brand's configuration as an XML string. Use this action to retrieve comprehensive brand data including brand ID, name, company name, color scheme (background/text colors), logos (Base64-encoded), language settings, and custom links/landing pages. The XML format makes it suitable f **Risk:** `read` ```ts theme={null} await corsair.docusign.api.exportBrandToXmlfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | **Output:** `string` *** ## Fetch Recipient Names For Email ### fetchRecipientNamesForEmail `fetchRecipientNamesForEmail` Retrieves the names associated with an email address from all recipient types on an envelope. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.fetchRecipientNamesForEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `names` | `string[]` | Yes | — | | `count` | `number` | Yes | — | *** ## Generate Edit View Urlfor Envelope ### generateEditViewUrlforEnvelope `generateEditViewUrlforEnvelope` Generates a URL for accessing and editing an existing envelope within the DocuSign UI, allowing for embedded editing functionality in external applications. This endpoint is identical to the createSender endpoint and is recommended to be replaced by it. The generated URL provides a customizable view **Risk:** `write` ```ts theme={null} await corsair.docusign.api.generateEditViewUrlforEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Generate Envelope Correction Url ### generateEnvelopeCorrectionUrl `generateEnvelopeCorrectionUrl` Generates a URL that allows embedding the envelope correction view of the DocuSign UI within an application. This endpoint enables customization of the correction view appearance and functionality through query parameters. The returned URL provides temporary, one-time access to the envelope correcti **Risk:** `write` ```ts theme={null} await corsair.docusign.api.generateEnvelopeCorrectionUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Generate Recipient Shared View Url ### generateRecipientSharedViewUrl `generateRecipientSharedViewUrl` Generates a URL for embedding the DocuSign recipient view of a shared envelope in your application. IMPORTANT: This endpoint requires the envelope to be explicitly shared with users on the same DocuSign account. The envelope must be shared first using DocuSign's envelope sharing feature. Required: e **Risk:** `write` ```ts theme={null} await corsair.docusign.api.generateRecipientSharedViewUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Get Account Billing Charges List ### getAccountBillingChargesList `getAccountBillingChargesList` Retrieves a detailed list of recurring and usage charges for a specified DocuSign account. This endpoint provides comprehensive information about the account's billing structure, including charge names, types, pricing, and usage quantities for various DocuSign services. It's particularly useful for **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getAccountBillingChargesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_charges` | `string` | No | — | **Output:** *empty object* *** ## Get Account Password Rules ### getAccountPasswordRules `getAccountPasswordRules` Retrieves the current password rules and security settings for a specified DocuSign account. This endpoint provides detailed information about password expiration policies, lockout durations, password strength requirements, and security question configurations. It is useful for account administrator **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getAccountPasswordRules({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Account Stamp Image ### getAccountStampImage `getAccountStampImage` Retrieves the image file for a specific account stamp, signature, or initials in DocuSign. This endpoint allows users to obtain the visual representation of stamps or signatures associated with their DocuSign account. It's particularly useful when you need to display or embed these images in other d **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getAccountStampImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signatureId` | `string` | Yes | — | | `imageType` | `string` | Yes | — | | `include_chrome` | `string` | No | — | **Output:** `string` *** ## Get Agent User Authorizations ### getAgentUserAuthorizations `getAgentUserAuthorizations` Returns the authorizations for which the specified user is the agent user. An agent user can act on behalf of other users (principal users) in the account. This endpoint retrieves the list of principal users and their authorization details, including permissions like Send, Manage, Sign, and Edit. Su **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getAgentUserAuthorizations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `active_only` | `string` | No | — | | `count` | `string` | No | — | | `email_substring` | `string` | No | — | | `include_closed_users` | `string` | No | — | | `permissions` | `string` | No | — | | `start_position` | `string` | No | — | | `task_source` | `string` | No | — | | `task_type` | `string` | No | — | | `user_name_substring` | `string` | No | — | **Output:** *empty object* *** ## Get Bcc Email Archive Configurations ### getBccEmailArchiveConfigurations `getBccEmailArchiveConfigurations` Retrieves a list of BCC (Blind Carbon Copy) email archive configurations associated with a specified DocuSign account. This endpoint allows users to fetch details about email addresses used for archiving DocuSign-generated emails. It supports pagination for large result sets and provides comprehensi **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getBccEmailArchiveConfigurations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## Get Bccemail Archive History ### getBccemailArchiveHistory `getBccemailArchiveHistory` Retrieves the history of changes made to a specific BCC email archive configuration for a DocuSign account. This endpoint allows users to track modifications, including creation, updates, and closure of email addresses used for archiving DocuSign-generated emails. It provides detailed information ab **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getBccemailArchiveHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bccEmailArchiveId` | `string` | Yes | — | | `count` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## Get Brand Logo By Type ### getBrandLogoByType `getBrandLogoByType` Retrieves a specific logo used in a brand for a DocuSign account. This endpoint allows you to fetch the image file for a primary, secondary, or email logo associated with a particular brand in your DocuSign account. It's useful for maintaining consistent branding across DocuSign documents and commun **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getBrandLogoByType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `logoType` | `string` | Yes | — | **Output:** `string` *** ## Get Brands Information For Group ### getBrandsInformationForGroup `getBrandsInformationForGroup` Retrieves detailed brand information associated with a specific group within a DocuSign account. This endpoint provides a comprehensive view of the brand settings, including default brands for recipients and senders, as well as a list of all available brands with their properties. It's particularly **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getBrandsInformationForGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Bulk Send Batch Status ### getBulkSendBatchStatus `getBulkSendBatchStatus` Get the status and progress of a DocuSign bulk send batch operation. This action retrieves comprehensive status information for a bulk send batch, including counts of sent, queued, and failed envelopes. Use this to monitor the progress of large-scale document distribution operations. \*\*Key Respons **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getBulkSendBatchStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkSendBatchId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Bulk Send Lists Information ### getBulkSendListsInformation `getBulkSendListsInformation` Retrieves a list of Bulk Send Lists belonging to the current user in a specified DocuSign account. This endpoint provides basic information about each Bulk Send List, including its unique identifier, creator, creation date, and name. It is particularly useful for managing and tracking bulk send oper **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getBulkSendListsInformation({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Docusign Account Contacts ### getDocusignAccountContacts `getDocusignAccountContacts` Retrieves detailed information about a specific contact from a DocuSign account's address book. Use this action when you need to look up a contact's details including their name, email addresses, phone numbers, organization, notary certifications, and signing group associations. Requires the contact **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getDocusignAccountContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | | `cloud_provider` | `string` | No | — | **Output:** *empty object* *** ## Get Downgrade Plan Info For Account ### getDowngradePlanInfoForAccount `getDowngradePlanInfoForAccount` Retrieves detailed billing information related to a downgrade request for a specific DocuSign account. This endpoint provides essential data about the requested downgrade plan, including the new plan details, payment method, effective date, and current status of the downgrade request. It should be u **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getDowngradePlanInfoForAccount({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Electronic Disclosure For Recipient ### getElectronicDisclosureForRecipient `getElectronicDisclosureForRecipient` Retrieves the HTML-formatted Electronic Record and Signature Disclosure (ERSD) for a specific envelope recipient in DocuSign. This endpoint allows you to obtain the customized disclosure that may differ from the account-level disclosure based on the signing brand applied to the envelope and the reci **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getElectronicDisclosureForRecipient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `langCode` | `string` | Yes | — | **Output:** *empty object* *** ## Get Electronic Record And Signature Disclosure ### getElectronicRecordAndSignatureDisclosure `getElectronicRecordAndSignatureDisclosure` Retrieves the HTML-formatted Electronic Record and Signature Disclosure (ERSD) associated with a specific DocuSign account. This endpoint allows you to fetch the current version of the ERSD, which is crucial for obtaining a consumer's consent to receive notices and disclosures electronically. It sup **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getElectronicRecordAndSignatureDisclosure({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `langCode` | `string` | No | — | **Output:** *empty object* *** ## Get Enote Integration Settings ### getEnoteIntegrationSettings `getEnoteIntegrationSettings` Retrieves the eNote integration settings for a specified DocuSign account. This endpoint provides crucial information about the eNote configuration status, Connect configuration status, and necessary credentials for eNote functionality. It should be used when setting up or verifying the eNote integr **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getEnoteIntegrationSettings({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Envelope ### getEnvelope `getEnvelope` Gets the status and basic information about an envelope from DocuSign. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | No | — | | `status` | `string` | No | — | *** ## Get Envelope Doc Gen Form Fields ### getEnvelopeDocGenFormFields `getEnvelopeDocGenFormFields` Retrieves document generation form fields from an envelope's documents. DocGen form fields are placeholder fields (tags) in template documents that can be dynamically populated with data before sending. This action returns the list of available form fields including their names, types, validation ru **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getEnvelopeDocGenFormFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Envelope Document Fields ### getEnvelopeDocumentFields `getEnvelopeDocumentFields` Retrieves custom document fields from a specific document within a DocuSign envelope. Custom document fields are metadata key-value pairs attached to individual documents in an envelope. They are different from: - Envelope custom fields (which apply to the entire envelope) - Tabs/fields (which are f **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getEnvelopeDocumentFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Envelope Lock Information ### getEnvelopeLockInformation `getEnvelopeLockInformation` Retrieves general information about an envelope lock in DocuSign. This endpoint is used to obtain details about the lock on a specific envelope, including the lock token, duration, owner, and expiration time. It's particularly useful for recovering lock information when managing concurrent access to **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getEnvelopeLockInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Envelope Notification Defaults ### getEnvelopeNotificationDefaults `getEnvelopeNotificationDefaults` Retrieves the default email notification settings for envelopes at the account level. This endpoint returns account-wide defaults for envelope notifications including: - Reminder settings (frequency, email subject/body for reminders) - Expiration settings (days until expiration, warning days) - Deli **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getEnvelopeNotificationDefaults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Envelope Workflow Definition ### getEnvelopeWorkflowDefinition `getEnvelopeWorkflowDefinition` Retrieves the workflow definition for a specified envelope in DocuSign. This endpoint provides detailed information about the envelope's workflow steps, scheduled sending settings, and delayed routing configurations. It is useful for developers who need to understand or analyze the current state and **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getEnvelopeWorkflowDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Envelope Workflow Delayed Routing Definition ### getEnvelopeWorkflowDelayedRoutingDefinition `getEnvelopeWorkflowDelayedRoutingDefinition` Retrieves the delayed routing rules for a specific workflow step within a DocuSign envelope. This endpoint allows users to access information about when and how an envelope is scheduled to be sent to recipients associated with a particular workflow step. It's useful for checking the current delay se **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getEnvelopeWorkflowDelayedRoutingDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Groups Information For Account ### getGroupsInformationForAccount `getGroupsInformationForAccount` Retrieves detailed information about groups associated with a specific DocuSign account. This endpoint allows users to fetch a list of groups, including their IDs, names, types, and user counts. It's particularly useful for account administrators who need to manage user access, set permissions, or o **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getGroupsInformationForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `string` | No | — | | `group_type` | `string` | No | — | | `include_usercount` | `string` | No | — | | `search_text` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## Get List Of Account Permission Profiles ### getListOfAccountPermissionProfiles `getListOfAccountPermissionProfiles` This endpoint retrieves a comprehensive list of permission profiles associated with a specified DocuSign account. It provides detailed information about each profile, including its unique identifier, name, last modification timestamp, and an extensive set of permission settings. This tool is essenti **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getListOfAccountPermissionProfiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include` | `string` | No | — | **Output:** *empty object* *** ## Get Members Of ASigning Group ### getMembersOfASigningGroup `getMembersOfASigningGroup` Retrieves the list of members in a specified DocuSign Signing Group. This endpoint provides detailed information about users in a particular Signing Group, including their email addresses and usernames. Use this tool to audit or manage Signing Group composition, which is crucial for maintaining prop **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getMembersOfASigningGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signingGroupId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Notary Journals ### getNotaryJournals `getNotaryJournals` Tool to retrieve notary journal entries for the current user. Use when you need to access a user's notary journal records, which contain information about notarized documents including signer names, document names, jurisdictions, and timestamps. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getNotaryJournals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `string` | No | — | | `search_text` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## Get Notary Jurisdiction Object ### getNotaryJurisdictionObject `getNotaryJurisdictionObject` Retrieves detailed information about a specific notary jurisdiction for the authenticated user. This endpoint should be used when a notary needs to access information about their registered jurisdiction, including commission details, seal requirements, and jurisdiction-specific rules. It provides cr **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getNotaryJurisdictionObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jurisdictionId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Notary Jurisdiction Seal ### getNotaryJurisdictionSeal `getNotaryJurisdictionSeal` Retrieves the notary seal for a specific jurisdiction registered to the current user. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getNotaryJurisdictionSeal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jurisdictionId` | `string` | Yes | — | **Output:** `string` *** ## Get Notary User Settings ### getNotaryUserSettings `getNotaryUserSettings` Retrieves notary settings and configuration for the currently authenticated user. This endpoint returns comprehensive notary account information including personal details (name, email, userId), notary status (enabled/disabled), and optionally jurisdiction details when include\_jurisdictions is set **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getNotaryUserSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_jurisdictions` | `string` | No | — | **Output:** *empty object* *** ## Get Original Html Definition For Template ### getOriginalHtmlDefinitionForTemplate `getOriginalHtmlDefinitionForTemplate` Retrieves the original HTML definition for a specified DocuSign template. This endpoint is used to obtain the properties that define how to generate the responsive-formatted HTML for the template's documents. It provides detailed information about display settings, anchors, and collapsible sections **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getOriginalHtmlDefinitionForTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Page Image From Envelope ### getPageImageFromEnvelope `getPageImageFromEnvelope` Retrieves an image of a specific page from a document within a DocuSign envelope. This endpoint is used to fetch a visual representation of a document page, which can be useful for previewing or displaying document contents without accessing the full document. The returned image is in PNG format and **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getPageImageFromEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `pageNumber` | `string` | Yes | — | | `dpi` | `string` | No | — | | `max_height` | `string` | No | — | | `max_width` | `string` | No | — | | `show_changes` | `string` | No | — | **Output:** `string` *** ## Get Pdftranscript Of Envelope Comments ### getPdftranscriptOfEnvelopeComments `getPdftranscriptOfEnvelopeComments` Retrieves a PDF transcript containing all comments added by senders and recipients to documents within a specific envelope in a DocuSign account. This endpoint is useful for obtaining a comprehensive record of all discussions and annotations related to the documents in an envelope. It should be used **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getPdftranscriptOfEnvelopeComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `encoding` | `string` | No | — | **Output:** `string` *** ## Get Permission Profile For Account ### getPermissionProfileForAccount `getPermissionProfileForAccount` This endpoint retrieves detailed information about a specific permission profile in a DocuSign account. It provides a comprehensive view of permissions, settings, and capabilities assigned to a profile. Useful for auditing or reviewing permissions granted to user groups, it returns data on account r **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getPermissionProfileForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `permissionProfileId` | `string` | Yes | — | | `include` | `string` | No | — | **Output:** *empty object* *** ## Get Power Form Senders ### getPowerFormSenders `getPowerFormSenders` Retrieves a list of users who have sent PowerForms within a specified DocuSign account. This endpoint is useful for monitoring PowerForm usage, tracking sender activity, and gathering insights on user engagement with PowerForms. It returns detailed information about each sender, including their acco **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getPowerFormSenders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## Get Recipient Document Visibility ### getRecipientDocumentVisibility `getRecipientDocumentVisibility` Retrieves document visibility settings for a specific recipient within a DocuSign envelope. This endpoint allows you to check which documents are visible to a particular recipient and their access rights (editable or read-only). Use this method when you need to verify or audit the document access co **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getRecipientDocumentVisibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Request Logging Log File ### getRequestLoggingLogFile `getRequestLoggingLogFile` Downloads the complete log file for a specific API request from DocuSign's Diagnostics service. This action is essential for debugging and troubleshooting API interactions by providing detailed request/response information. The log file contains: - Full HTTP request details (method, URL, headers, bo **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getRequestLoggingLogFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requestLogId` | `string` | Yes | — | **Output:** `string` *** ## Get Request Logs ### getRequestLogs `getRequestLogs` Retrieves a list of API request log entries as a JSON object. Use when you need to view diagnostic information about API requests made to DocuSign. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getRequestLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `encoding` | `string` | No | — | **Output:** *empty object* *** ## Get Request Log Settings ### getRequestLogSettings `getRequestLogSettings` Tool to retrieve current API request logging settings for the authenticated user. Use when you need to check logging configuration or remaining log entries. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getRequestLogSettings({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Resource Information ### getResourceInformation `getResourceInformation` Retrieves the base resources available for the DocuSign eSignature REST API. Use when you need to discover available API endpoints and resources. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getResourceInformation({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Service Information ### getServiceInformation `getServiceInformation` Gets the current version and other information about the DocuSign eSignature REST API. Use this to retrieve service information including API versions and build details. This returns the available REST API versions (v1, v2, v2.1) with their endpoint URLs, the current build version string, and linked **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getServiceInformation({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Signature Information For Recipient ### getSignatureInformationForRecipient `getSignatureInformationForRecipient` Retrieves signature information for a specific recipient in a DocuSign envelope. Returns signature metadata including: signature ID, name, type, initials, adoption and modification timestamps, signature image URI, base64-encoded image data, and stamp properties if applicable. \*\*Use when you need t **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getSignatureInformationForRecipient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Signing Group Information ### getSigningGroupInformation `getSigningGroupInformation` Retrieves detailed information about a specific signing group in a DocuSign account. Returns comprehensive data including the group's name, type (sharedSigningGroup, privateSigningGroup, or systemSigningGroup), email address, creation/modification timestamps, and a complete list of member users with **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getSigningGroupInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signingGroupId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Specific Brand Resource File ### getSpecificBrandResourceFile `getSpecificBrandResourceFile` Retrieves a specific branding resource file (XML format) for customizing DocuSign experiences. Brand resource files control text and visual elements for sending, signing, email, and captive signing experiences. IMPORTANT: Resource files must be pre-configured for the brand. This is an advanced featu **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getSpecificBrandResourceFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `resourceContentType` | `string` | Yes | — | | `langcode` | `string` | No | — | | `return_master` | `string` | No | — | **Output:** `string` *** ## Get Specified Account Stamp Info ### getSpecifiedAccountStampInfo `getSpecifiedAccountStampInfo` Retrieves detailed information about a specific account stamp (signature) in DocuSign. This endpoint allows users to fetch comprehensive data about a signature, including its creation and modification dates, image URIs, associated users, and formatting details. It's particularly useful when you need **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getSpecifiedAccountStampInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signatureId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Supported Languages For Recipients ### getSupportedLanguagesForRecipients `getSupportedLanguagesForRecipients` Retrieves a comprehensive list of supported languages that can be set for individual recipients when creating a DocuSign envelope. This endpoint allows developers to access the available language options for customizing the standard email format and signing view for each recipient. It's particularly **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getSupportedLanguagesForRecipients({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Tabs Blob For Envelope ### getTabsBlobForEnvelope `getTabsBlobForEnvelope` This deprecated endpoint retrieves the tabs blob associated with a specific envelope in DocuSign. It allows developers to access detailed information about the tabs (such as signature fields, text fields, etc.) within a document envelope. However, as this endpoint is no longer recommended for use, d **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTabsBlobForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Tab Settings For Account ### getTabSettingsForAccount `getTabSettingsForAccount` Retrieves the current tab settings and functionality enabled for a specific DocuSign account. This endpoint provides detailed information about various tab types (such as checkbox, radio, text) and related features (like tab order, data labels, text formatting) that are currently active or inactive **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTabSettingsForAccount({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Template ### getTemplate `getTemplate` Gets a template definition from the specified account. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | No | — | | `name` | `string` | No | — | *** ## Get Template Delayed Routing Rules ### getTemplateDelayedRoutingRules `getTemplateDelayedRoutingRules` Retrieves the delayed routing rules for a specific workflow step within a DocuSign template. This endpoint allows users to fetch the scheduled sending and routing information for a particular step in a template's workflow. It's useful for understanding when and how an envelope will be sent to recipi **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTemplateDelayedRoutingRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Template Document Html Definition ### getTemplateDocumentHtmlDefinition `getTemplateDocumentHtmlDefinition` Retrieves the HTML definition for a specific document within a DocuSign template. This endpoint is used to obtain the properties that define how to generate responsive-formatted HTML for the document, including display anchors, collapsible sections, and other formatting settings. It's particularly u **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTemplateDocumentHtmlDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Template Lock Information ### getTemplateLockInformation `getTemplateLockInformation` Retrieves lock information for a DocuSign template. Returns details about an existing template lock including the lock token, duration, expiration time, and information about the user who locked the template. The lock token is required in the X-DocuSign-Edit header for subsequent update operations. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTemplateLockInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Template Notification Information ### getTemplateNotificationInformation `getTemplateNotificationInformation` Retrieves the envelope notification, reminders, and expiration information for an existing template in DocuSign. This endpoint allows users to get detailed settings about how notifications are configured for envelopes created from the specified template. It provides information on expiration setting **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTemplateNotificationInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Template Recipient Document Visibility ### getTemplateRecipientDocumentVisibility `getTemplateRecipientDocumentVisibility` Retrieves document visibility settings for a specific recipient in a DocuSign template. Returns which documents are visible to a recipient and their access rights (view/edit). Document visibility controls show or hide specific documents from recipients in multi-document templates, ensuring sensitive **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTemplateRecipientDocumentVisibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Template Scheduled Sending Settings ### getTemplateScheduledSendingSettings `getTemplateScheduledSendingSettings` Retrieves the scheduled sending settings for a specified DocuSign template. This endpoint allows developers to access and review the configuration that determines when and how envelopes based on the template will be sent. It's particularly useful for automating document workflows and managing the ti **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTemplateScheduledSendingSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Templates For Envelope Document ### getTemplatesForEnvelopeDocument `getTemplatesForEnvelopeDocument` Retrieves the templates associated with a specific document within a DocuSign envelope. This endpoint is useful for identifying and managing templates linked to individual documents in an envelope, which can be beneficial for template management and document processing workflows. It should be used w **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTemplatesForEnvelopeDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `include` | `string` | No | — | **Output:** *empty object* *** ## Get Templates Used In Envelope ### getTemplatesUsedInEnvelope `getTemplatesUsedInEnvelope` This endpoint retrieves a list of server-side templates used in a specific DocuSign envelope. It provides detailed information about each template, including its name, ID, and other relevant attributes. The endpoint is particularly useful for understanding which templates have been applied to an env **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getTemplatesUsedInEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `include` | `string` | No | — | **Output:** *empty object* *** ## Get Unsupported File Types List ### getUnsupportedFileTypesList `getUnsupportedFileTypesList` Retrieves the list of file types (extensions and MIME types) that DocuSign does not support for upload. Use this to validate file types before upload or to display supported formats to users. The list may change as DocuSign updates its supported file types. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getUnsupportedFileTypesList({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Urlfor Embedding Docusign Ui ### getUrlforEmbeddingDocusignUi `getUrlforEmbeddingDocusignUi` Generate a URL to embed the DocuSign console view within your application. This action creates a URL that provides access to the DocuSign web interface, allowing users to interact with DocuSign features directly from your application without leaving your UI. \*\*Use Cases:\*\* - Display DocuSign con **Risk:** `write` ```ts theme={null} await corsair.docusign.api.getUrlforEmbeddingDocusignUi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Get User Authorization Details ### getUserAuthorizationDetails `getUserAuthorizationDetails` Retrieves detailed information about a specific user authorization in DocuSign. This endpoint allows account administrators or the principal user to fetch comprehensive data about an authorization, including the agent user, principal user, permission levels, and relevant timestamps. It's particularl **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getUserAuthorizationDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `authorizationId` | `string` | Yes | — | **Output:** *empty object* *** ## Get User Authorizations For Principal ### getUserAuthorizationsForPrincipal `getUserAuthorizationsForPrincipal` Retrieves user authorizations for a specified principal user within a DocuSign account. This endpoint allows account administrators or the principal user themselves to view and manage user access and permissions. It provides detailed information about each authorization, including the agent user, pe **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getUserAuthorizationsForPrincipal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `active_only` | `string` | No | — | | `count` | `string` | No | — | | `email_substring` | `string` | No | — | | `include_closed_users` | `string` | No | — | | `permissions` | `string` | No | — | | `start_position` | `string` | No | — | | `task_source` | `string` | No | — | | `task_type` | `string` | No | — | | `user_name_substring` | `string` | No | — | **Output:** *empty object* *** ## Get User Cloud Storage Provider Configuration ### getUserCloudStorageProviderConfiguration `getUserCloudStorageProviderConfiguration` Retrieves the cloud storage provider configuration for a specific cloud storage service (identified by serviceId) for a user within a DocuSign account. This endpoint returns configuration details for the specified provider, such as service name and serviceId. Note: This endpoint primarily works with **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getUserCloudStorageProviderConfiguration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `serviceId` | `string` | Yes | — | | `redirectUrl` | `string` | No | — | **Output:** *empty object* *** ## Get User Information By Id ### getUserInformationById `getUserInformationById` Retrieves detailed information about a specific user within a DocuSign account. This endpoint provides comprehensive data about the user, including personal details, account settings, and permissions. It's useful for account administrators and system integrations needing to verify or sync user confi **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getUserInformationById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `additional_info` | `string` | No | — | | `email` | `string` | No | — | | `include_license` | `string` | No | — | **Output:** *empty object* *** ## Get Users In Group ### getUsersInGroup `getUsersInGroup` Retrieves a paginated list of users belonging to a specific group within a DocuSign account. This endpoint is useful for managing and auditing group memberships, allowing administrators to view detailed information about users associated with a particular group. It supports pagination to handle larg **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getUsersInGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `count` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## Get Watermark Details For Account ### getWatermarkDetailsForAccount `getWatermarkDetailsForAccount` Retrieves and previews the watermark details for a specific DocuSign account. This endpoint allows users to view the current watermark configuration, including its visual properties and enabled status. It's useful for verifying existing watermark settings or preparing to update them. The endpoint re **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getWatermarkDetailsForAccount({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Get Workflow Step For Envelope ### getWorkflowStepForEnvelope `getWorkflowStepForEnvelope` Retrieves detailed information about a specific workflow step for a DocuSign envelope. This endpoint allows you to fetch comprehensive data about a single step in an envelope's workflow, including its action, status, delayed routing settings, and recipient routing rules. It's particularly useful whe **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getWorkflowStepForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | **Output:** *empty object* *** ## Get Workspace File ### getWorkspaceFile `getWorkspaceFile` Retrieves a binary version of a file from a DocuSign workspace. This endpoint allows you to access and download files stored within a specific workspace, folder, and account. It's particularly useful for retrieving document content for further processing or viewing outside the DocuSign platform. The **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getWorkspaceFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | | `is_download` | `string` | No | — | | `pdf_version` | `string` | No | — | **Output:** `string` *** ## Get Workspace Folder Contents ### getWorkspaceFolderContents `getWorkspaceFolderContents` Retrieves the contents of a specific workspace folder in DocuSign, including sub-folders and files. This endpoint provides detailed information about the items within the folder, such as metadata, user permissions, and hierarchical structure. It can be used to navigate and explore the contents of a **Risk:** `read` ```ts theme={null} await corsair.docusign.api.getWorkspaceFolderContents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `count` | `string` | No | — | | `include_files` | `string` | No | — | | `include_sub_folders` | `string` | No | — | | `include_thumbnails` | `string` | No | — | | `include_user_detail` | `string` | No | — | | `start_position` | `string` | No | — | | `workspace_user_id` | `string` | No | — | **Output:** *empty object* *** ## Initiate New Chunked Upload ### initiateNewChunkedUpload `initiateNewChunkedUpload` Initiates a new chunked upload in DocuSign by sending the first part of the content. This endpoint is designed to handle large file uploads by breaking them into smaller, manageable pieces. It's particularly useful for adding documents to envelopes in DocuSign's electronic signature workflow. The me **Risk:** `write` ```ts theme={null} await corsair.docusign.api.initiateNewChunkedUpload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## List Billing Invoices ### listBillingInvoices `listBillingInvoices` Retrieves a list of billing invoices for a specified DocuSign account. This endpoint allows account administrators to fetch detailed invoice information, including total amounts, due dates, and itemized charges. It supports optional date range filtering and provides a paginated response for efficien **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listBillingInvoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_date` | `string` | No | — | | `to_date` | `string` | No | — | **Output:** *empty object* *** ## List Brands For Account ### listBrandsForAccount `listBrandsForAccount` Retrieves a comprehensive list of brands associated with a DocuSign account, including default brand profiles. This endpoint provides detailed information about each brand, such as visual elements, language settings, and resource URLs for customizing various DocuSign experiences. It's particularly u **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listBrandsForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `exclude_distributor_brand` | `string` | No | — | | `include_logos` | `string` | No | — | **Output:** *empty object* *** ## List Bulk Send Batch Summaries ### listBulkSendBatchSummaries `listBulkSendBatchSummaries` Retrieves a summary of bulk send batches for a DocuSign account. This endpoint allows users to query and filter bulk send batch information, providing details such as batch status, size, and processing information. It's particularly useful for monitoring the progress of large-scale document sending **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listBulkSendBatchSummaries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch_ids` | `string` | No | — | | `count` | `string` | No | — | | `from_date` | `string` | No | — | | `search_text` | `string` | No | — | | `start_position` | `string` | No | — | | `status` | `string` | No | — | | `to_date` | `string` | No | — | | `user_id` | `string` | No | — | **Output:** *empty object* *** ## List Cloud Storage Items ### listCloudStorageItems `listCloudStorageItems` Retrieves a list of items (files and folders) from a specific folder in a cloud storage provider integrated with DocuSign. This endpoint enables browsing and searching cloud storage contents directly within DocuSign, making it easier to select documents for signing workflows. Prerequisites: - The cl **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listCloudStorageItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `serviceId` | `string` | Yes | — | | `cloud_storage_folder_path` | `string` | No | — | | `count` | `string` | No | — | | `order` | `string` | No | — | | `order_by` | `string` | No | — | | `search_text` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## List Envelope And Document Custom Fields ### listEnvelopeAndDocumentCustomFields `listEnvelopeAndDocumentCustomFields` Retrieves all account-level custom fields defined for a DocuSign account. Account custom fields are envelope custom fields that can be applied across multiple envelopes, enabling account administrators to group, track, and manage envelopes consistently. The response includes two types of custom fiel **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listEnvelopeAndDocumentCustomFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## List Envelope Attachments By Envelope Id ### listEnvelopeAttachmentsByEnvelopeId `listEnvelopeAttachmentsByEnvelopeId` Retrieves a list of envelope attachments associated with a specified envelope in DocuSign. This endpoint is used to fetch developer-only files attached to an envelope, providing details such as attachment IDs, types, and access controls. It's important to note that this operation returns envelope at **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listEnvelopeAttachmentsByEnvelopeId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## List Notary Journals ### listNotaryJournals `listNotaryJournals` Gets notary journals for the current user. Use when you need to retrieve notary journal data. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listNotaryJournals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `string` | No | — | | `search_text` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## List OAuth User Info ### listOAuthUserInfo `listOAuthUserInfo` Retrieves the authenticated user's account information from DocuSign OAuth, including user ID, name, email, accounts, base URIs, and account IDs. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listOAuthUserInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `authServer` | `string` | No | — | **Output:** *empty object* *** ## List Past Due Invoices ### listPastDueInvoices `listPastDueInvoices` Retrieves a list of past due invoices for a specified DocuSign account and indicates if payment can be made through the REST API. This endpoint is designed for account administrators to manage outstanding financial obligations. It provides comprehensive invoice details including total amounts, balan **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listPastDueInvoices({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## List Payment Gateway Accounts Info ### listPaymentGatewayAccountsInfo `listPaymentGatewayAccountsInfo` Retrieves a list of all payment gateway accounts associated with a specific DocuSign account, along with detailed information about each account. This endpoint is useful for obtaining an overview of the payment gateways configured for an account, including their status, supported currencies, and pay **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listPaymentGatewayAccountsInfo({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## List Registered Notary Jurisdictions ### listRegisteredNotaryJurisdictions `listRegisteredNotaryJurisdictions` Retrieves a paginated list of registered notary jurisdictions for the current user, who must be a notary. This endpoint provides detailed information about each jurisdiction where the notary is registered, including commission details, seal settings, and supported features. It is useful for managing **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listRegisteredNotaryJurisdictions({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## List Signature Providers For Account ### listSignatureProvidersForAccount `listSignatureProvidersForAccount` Retrieves a list of signature providers available for a specified DocuSign account. This endpoint allows users to obtain detailed information about electronic and digital signature providers, including standards-based signatures, that can be used within the account. It's particularly useful when set **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listSignatureProvidersForAccount({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## List Templates ### listTemplates `listTemplates` Gets the definition of templates in the specified account. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `startPosition` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `envelopeTemplates` | `object[]` | No | — | > **envelopeTemplates full type** > > ```ts theme={null} > { > }[] > ``` *** ## List Users For Account ### listUsersForAccount `listUsersForAccount` Retrieves a list of users for a specified DocuSign account. This endpoint allows for detailed querying of user information, including their account status, email addresses, and various account settings. It's particularly useful for account administrators who need to manage users or gather informatio **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listUsersForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `additional_info` | `string` | No | — | | `alternate_admins_only` | `string` | No | — | | `count` | `string` | No | — | | `domain_users_only` | `string` | No | — | | `email` | `string` | No | — | | `email_substring` | `string` | No | — | | `group_id` | `string` | No | — | | `include_license` | `string` | No | — | | `include_usersettings_for_csv` | `string` | No | — | | `login_status` | `string` | No | — | | `not_group_id` | `string` | No | — | | `start_position` | `string` | No | — | | `status` | `string` | No | — | | `user_name_substring` | `string` | No | — | **Output:** *empty object* *** ## List Workspace File Pages ### listWorkspaceFilePages `listWorkspaceFilePages` Retrieves a workspace file as rasterized pages from a DocuSign workspace. This endpoint allows users to fetch file pages as images with customizable resolution and dimensions. It supports pagination for handling large files efficiently. Use this method when you need to view or process workspace file **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listWorkspaceFilePages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | | `count` | `string` | No | — | | `dpi` | `string` | No | — | | `max_height` | `string` | No | — | | `max_width` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## List Workspaces ### listWorkspaces `listWorkspaces` Retrieves a list of DocuSign workspaces and their associated information for a specified account. This endpoint allows users to get a comprehensive view of all workspaces they have access to, including details such as workspace IDs, names, descriptions, creation dates, and user information. It's par **Risk:** `read` ```ts theme={null} await corsair.docusign.api.listWorkspaces({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Lock An Envelope For Editing ### lockAnEnvelopeForEditing `lockAnEnvelopeForEditing` This endpoint locks an envelope for editing, preventing other users or recipients from changing it. It's used to ensure exclusive access to an envelope during updates. The method returns a lock token that must be included in subsequent PUT requests to modify the locked envelope. Use this endpoint wh **Risk:** `write` ```ts theme={null} await corsair.docusign.api.lockAnEnvelopeForEditing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Lock Template For Editing ### lockTemplateForEditing `lockTemplateForEditing` Locks a specified DocuSign template for editing to prevent concurrent modifications. This endpoint acquires an exclusive lock on a template, ensuring that only the lock holder can make changes during the lock period. The response includes a lockToken that must be included in the X-DocuSign-Edit head **Risk:** `write` ```ts theme={null} await corsair.docusign.api.lockTemplateForEditing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Modify Account Notification Settings ### modifyAccountNotificationSettings `modifyAccountNotificationSettings` Updates the default email notification settings for envelope senders and signers in a DocuSign account. This endpoint allows customization of when and what type of notifications users receive regarding envelope status changes (e.g., signed, declined, completed), comments, and other events. Use this **Risk:** `write` ```ts theme={null} await corsair.docusign.api.modifyAccountNotificationSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Modify Tab Settings For Account ### modifyTabSettingsForAccount `modifyTabSettingsForAccount` This endpoint modifies the tab types and tab functionality that are enabled for a DocuSign account. It allows administrators to configure various tab-related settings, such as enabling or disabling specific tab types, controlling tab order, and managing compliance with FDA regulations. The endpoint **Risk:** `write` ```ts theme={null} await corsair.docusign.api.modifyTabSettingsForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Post Payment To Invoice ### postPaymentToInvoice `postPaymentToInvoice` Posts a payment to past due invoices for a DocuSign account. This action applies a payment amount to settle outstanding invoice balances and creates a payment transaction record. Before using this action, retrieve past due invoice information using the 'List Past Due Invoices' action to get the tota **Risk:** `write` ```ts theme={null} await corsair.docusign.api.postPaymentToInvoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Purchase Additional Envelopes ### purchaseAdditionalEnvelopes `purchaseAdditionalEnvelopes` This endpoint completes the purchase of additional envelopes for a DocuSign account through an internal workflow interaction with an envelope vendor. It is designed to handle the financial transaction and update the account's envelope quota. This tool should be used when there's a need to increase t **Risk:** `write` ```ts theme={null} await corsair.docusign.api.purchaseAdditionalEnvelopes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Queue Downgrade Billing Plan Request ### queueDowngradeBillingPlanRequest `queueDowngradeBillingPlanRequest` Queues a downgrade request for a DocuSign account's billing plan. This action initiates the process of changing an account to a lower-tier or less expensive billing plan without immediately applying the change. Use this action when an account administrator needs to: - Downgrade from a paid plan to a **Risk:** `write` ```ts theme={null} await corsair.docusign.api.queueDowngradeBillingPlanRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Register Current User As Notary ### registerCurrentUserAsNotary `registerCurrentUserAsNotary` This endpoint registers the current user as a notary in DocuSign, enabling remote online notarization capabilities. It configures the user's notary profile, settings, and permissions. Use this when setting up a new notary within the DocuSign system. Note that this does not replace legal notary certi **Risk:** `write` ```ts theme={null} await corsair.docusign.api.registerCurrentUserAsNotary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Remove Bulk Send List ### removeBulkSendList `removeBulkSendList` This endpoint deletes a specific bulk send list from a DocuSign account. It is used to permanently remove a bulk send list that is no longer needed or was created in error. The operation requires both the account identifier and the specific bulk send list ID to ensure precise targeting of the list t **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.removeBulkSendList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkSendListId` | `string` | Yes | — | **Output:** *empty object* *** ## Remove Group Sharing Permissions For Template ### removeGroupSharingPermissionsForTemplate `removeGroupSharingPermissionsForTemplate` Removes sharing permissions for specified member groups from a DocuSign template. This endpoint is used to revoke access to a template for one or more groups, enhancing template security and access control. It's particularly useful when reorganizing team structures, updating project access, or when **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.removeGroupSharingPermissionsForTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `templatePart` | `string` | Yes | — | **Output:** *empty object* *** ## Remove Templates From Favorites ### removeTemplatesFromFavorites `removeTemplatesFromFavorites` Removes one or more templates from an account's list of favorite templates in DocuSign. This endpoint allows users to manage their favorite templates by specifying which templates should no longer be marked as favorites. It accepts an account identifier and a list of template IDs to be removed from **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.removeTemplatesFromFavorites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Remove User Signature Information ### removeUserSignatureInformation `removeUserSignatureInformation` Removes the signature information for a specific user in DocuSign. This endpoint should be used when a user wants to delete their existing signature from their DocuSign account. It's particularly useful for updating or refreshing signature information. The operation is restricted to the authenticate **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.removeUserSignatureInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `signatureId` | `string` | Yes | — | **Output:** *empty object* *** ## Republish Connect Data For Envelope ### republishConnectDataForEnvelope `republishConnectDataForEnvelope` Republishes Connect information for a specified envelope in DocuSign. This endpoint is used to retry sending Connect event data that may have failed to deliver previously. It's particularly useful for ensuring that all relevant updates about an envelope are successfully communicated to integrated sy **Risk:** `write` ```ts theme={null} await corsair.docusign.api.republishConnectDataForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Republish Connect Info For Envelopes ### republishConnectInfoForEnvelopes `republishConnectInfoForEnvelopes` Republishes Connect webhook information for multiple DocuSign envelopes. Queues envelopes for Connect webhook republishing to retry failed webhook deliveries. When DocuSign Connect fails to deliver webhook events to your endpoint, envelopes are added to a failure queue. This action manually triggers **Risk:** `write` ```ts theme={null} await corsair.docusign.api.republishConnectInfoForEnvelopes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Retrieve Account Billing Plan ### retrieveAccountBillingPlan `retrieveAccountBillingPlan` Retrieves detailed billing plan information for a specified DocuSign account. This endpoint provides comprehensive data about the current billing plan, successor plans, billing address, and credit card information associated with the account. It is particularly useful for obtaining an overview of an **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountBillingPlan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_credit_card_information` | `string` | No | — | | `include_downgrade_information` | `string` | No | — | | `include_metadata` | `string` | No | — | | `include_successor_plans` | `string` | No | — | | `include_tax_exempt_id` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Account Brand Information ### retrieveAccountBrandInformation `retrieveAccountBrandInformation` Retrieves detailed information about a specific brand associated with a DocuSign account. This endpoint allows users to access comprehensive brand settings, including company name, languages, colors, logos, and resource URLs for customizing various DocuSign experiences such as email, sending, and si **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountBrandInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `include_external_references` | `string` | No | — | | `include_logos` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Account Envelope Purge Config ### retrieveAccountEnvelopePurgeConfig `retrieveAccountEnvelopePurgeConfig` Retrieves the current envelope purge configuration for a specified DocuSign account. This endpoint allows account administrators to view the settings that control how and when documents are permanently removed from completed and voided envelopes after a specified retention period. It provides crucia **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountEnvelopePurgeConfig({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Retrieve Account Favorite Templates ### retrieveAccountFavoriteTemplates `retrieveAccountFavoriteTemplates` Retrieves the list of favorite templates for a DocuSign account. Returns an array of template IDs and the dates they were marked as favorites. This is useful for identifying which templates a user has marked for quick access. Note: This endpoint only returns template IDs and favorited dates, not the **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountFavoriteTemplates({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Retrieve Account Information For Specified Account ### retrieveAccountInformationForSpecifiedAccount `retrieveAccountInformationForSpecifiedAccount` Retrieves comprehensive information for a specified DocuSign account, including account details, billing information, plan specifics, and optionally detailed account settings. This endpoint is used to gather extensive data about an account's configuration, status, and capabilities within the DocuSig **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountInformationForSpecifiedAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_account_settings` | `string` | No | — | | `include_trial_eligibility` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Account Provisioning Info ### retrieveAccountProvisioningInfo `retrieveAccountProvisioningInfo` Retrieves the account provisioning information for a DocuSign account. This endpoint returns crucial setup and configuration details including default connection IDs, billing plan identifiers, distributor codes, password policy rules, and promotional information. Use this action when you need to: - **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountProvisioningInfo({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Retrieve Account Seal Providers ### retrieveAccountSealProviders `retrieveAccountSealProviders` Retrieves electronic seal providers (eSeals) available for a DocuSign account. Electronic seals certify document origin and integrity using a legal entity identity rather than an individual signature. Returns seal identifiers and names for all configured seals in the account. Use this to display ava **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountSealProviders({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Retrieve Account Settings Information ### retrieveAccountSettingsInformation `retrieveAccountSettingsInformation` Retrieves the comprehensive account settings information for a specified DocuSign account. This endpoint provides a detailed view of the account's configuration, including access code formats, account-wide preferences, feature toggles, security settings, UI customization options, and compliance-rela **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountSettingsInformation({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Retrieve Account Signing Groups ### retrieveAccountSigningGroups `retrieveAccountSigningGroups` Retrieves a comprehensive list of all signing groups within a specified DocuSign account. This endpoint allows you to obtain detailed information about each signing group, including group names, types, IDs, and optionally, member details. It's particularly useful for managing and auditing signing gr **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountSigningGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_type` | `string` | No | — | | `include_users` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Account Verification Workflows ### retrieveAccountVerificationWorkflows `retrieveAccountVerificationWorkflows` Retrieves a list of Identity Verification workflows available for a DocuSign account. This endpoint allows account administrators or senders to fetch details about the verification methods that can be applied to signers during the document signing process. It provides information about active, deact **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAccountVerificationWorkflows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identity_verification_workflow_status` | `string` | No | — | **Output:** *empty object* *** ## Retrieve All Account Tabs ### retrieveAllAccountTabs `retrieveAllAccountTabs` Retrieves a comprehensive list of all tabs associated with a specified DocuSign account. It returns detailed information about each tab, including type, label, validation rules, and formatting settings. Use this endpoint for auditing tab configurations, managing account-wide tab settings, or integra **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAllAccountTabs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `custom_tab_only` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Available Account Stamps ### retrieveAvailableAccountStamps `retrieveAvailableAccountStamps` Retrieves a list of stamps available in a DocuSign account. This endpoint allows users to fetch detailed information about various types of stamps, signatures, and related properties associated with the specified account. It's particularly useful for applications that need to display or manage avail **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveAvailableAccountStamps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `stamp_format` | `string` | No | — | | `stamp_name` | `string` | No | — | | `stamp_type` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Billing Invoice ### retrieveBillingInvoice `retrieveBillingInvoice` Retrieves a specific billing invoice for a DocuSign account, providing detailed information about charges and payment details. This endpoint allows account administrators to access invoice data in both JSON format and, when available, as a downloadable PDF. It's particularly useful for financial rec **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveBillingInvoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoiceId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Billing Payment Info ### retrieveBillingPaymentInfo `retrieveBillingPaymentInfo` Retrieves detailed information for a specific billing payment in a DocuSign account. Returns payment details including ID, number, amount, description, and date. Useful for auditing, reconciliation, and reviewing payment records. \*\*Production Account Required:\*\* This endpoint ONLY works with pro **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveBillingPaymentInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `paymentId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Chunked Upload Metadata ### retrieveChunkedUploadMetadata `retrieveChunkedUploadMetadata` Retrieves metadata for a specific chunked upload in DocuSign. This endpoint allows users to check the status, parts, and other details of a large file upload that has been split into chunks. It's particularly useful for verifying the integrity and completeness of an upload before committing it for u **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveChunkedUploadMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chunkedUploadId` | `string` | Yes | — | | `include` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Cloud Storage Provider Configuration ### retrieveCloudStorageProviderConfiguration `retrieveCloudStorageProviderConfiguration` Retrieves the list of cloud storage providers enabled for a specific user in a DocuSign account, along with their configuration information. This endpoint is essential for integrating external cloud storage services with DocuSign, allowing users to access and manage documents from various providers. **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveCloudStorageProviderConfiguration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `redirectUrl` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Connect Configuration Details ### retrieveConnectConfigurationDetails `retrieveConnectConfigurationDetails` Retrieves detailed information for a specific DocuSign Connect configuration. This endpoint allows account administrators to access and review the settings of a custom Connect configuration, including event triggers, delivery modes, and integration details. It's particularly useful for auditing exis **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveConnectConfigurationDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Connect Configurations ### retrieveConnectConfigurations `retrieveConnectConfigurations` Retrieves all Docusign Custom Connect definitions for a specified account. This endpoint allows account administrators to fetch detailed information about existing Connect configurations, including webhook settings, event triggers, and delivery modes. It provides a comprehensive view of how the acco **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveConnectConfigurations({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Retrieve Connect Failure Logs ### retrieveConnectFailureLogs `retrieveConnectFailureLogs` Retrieves the Connect failure log information for a specified DocuSign account. This endpoint is specifically designed for account administrators to identify which envelopes failed to post during Connect events. It provides detailed information about each failure, including error messages, retry cou **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveConnectFailureLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_date` | `string` | No | — | | `to_date` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Connect Log Entry ### retrieveConnectLogEntry `retrieveConnectLogEntry` Retrieves a specific Connect log entry for a DocuSign account. This endpoint provides detailed information about a Connect event, including account details, configuration information, envelope data, and potential error details. It is particularly useful for troubleshooting Connect integrations, audi **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveConnectLogEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `logId` | `string` | Yes | — | | `additional_info` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Connect Logs ### retrieveConnectLogs `retrieveConnectLogs` Retrieves the 100 most recent Connect log entries for a specified DocuSign account. This endpoint is essential for monitoring and troubleshooting DocuSign Connect integrations, providing detailed information about both successful and failed Connect events. It allows administrators to review recent a **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveConnectLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_date` | `string` | No | — | | `to_date` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Connect Oauth Configuration ### retrieveConnectOauthConfiguration `retrieveConnectOauthConfiguration` Retrieves the Connect OAuth configuration for a specified DocuSign account. This endpoint allows account administrators to access the OAuth settings used for DocuSign Connect, which is crucial for webhook integrations and automated notifications. The retrieved configuration includes essential detail **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveConnectOauthConfiguration({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Retrieve Credit Card Info ### retrieveCreditCardInfo `retrieveCreditCardInfo` This endpoint retrieves detailed credit card information associated with a specific DocuSign account. It provides comprehensive details about the credit card on file, including the card number (partially masked), type, expiration date, cardholder name, and associated billing address. This tool shoul **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveCreditCardInfo({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Retrieve Custom Fields For Envelope ### retrieveCustomFieldsForEnvelope `retrieveCustomFieldsForEnvelope` Retrieves custom field metadata for a specified envelope. Custom fields are additional data points attached to envelopes that are NOT visible to document recipients. They're used for: - Organizing and categorizing envelopes internally - Tracking workflow stages or approval statuses - Storing referen **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveCustomFieldsForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Custom Fields For Template ### retrieveCustomFieldsForTemplate `retrieveCustomFieldsForTemplate` This endpoint retrieves the custom document fields for an existing template document in DocuSign. It allows users to access name-value pairs of custom data strings associated with a specific document within a template. This tool is useful for retrieving metadata or custom information that has been a **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveCustomFieldsForTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Custom Tab Information ### retrieveCustomTabInformation `retrieveCustomTabInformation` Retrieves detailed information about a specific custom tab associated with a DocuSign account. This endpoint allows users to access the properties and settings of a custom tab, including its anchor information, formatting options, merge field details, and locale settings. It is particularly useful w **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveCustomTabInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customTabId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Custom User Settings ### retrieveCustomUserSettings `retrieveCustomUserSettings` Retrieves a list of custom user settings for a single user in DocuSign. This endpoint allows flexible storage and retrieval of user-specific information that can be used in your own system, separate from standard user account settings. It supports both grouped and ungrouped custom settings, with the **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveCustomUserSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Default Disclosure For Envelope ### retrieveDefaultDisclosureForEnvelope `retrieveDefaultDisclosureForEnvelope` Retrieves the default HTML-formatted Electronic Record and Signature Disclosure (ERSD) for a specified envelope in DocuSign. This endpoint is used to obtain the standard disclosure text that recipients must agree to before signing documents electronically. It is particularly useful for retrieving la **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveDefaultDisclosureForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `langCode` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Envelope Attachment ### retrieveEnvelopeAttachment `retrieveEnvelopeAttachment` Downloads a developer-only envelope attachment file from a DocuSign envelope. This retrieves attachments that were added programmatically to an envelope (not signer attachments). These are files associated with the envelope that are only accessible via the API and not visible to signers in the DocuS **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveEnvelopeAttachment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `attachmentId` | `string` | Yes | — | **Output:** `string` *** ## Retrieve Envelope Audit Events ### retrieveEnvelopeAuditEvents `retrieveEnvelopeAuditEvents` Retrieves the audit events for a specified envelope in DocuSign. This endpoint allows users to access a detailed history of all actions and changes made to a particular envelope, providing a comprehensive audit trail. It is particularly useful for compliance, security, and tracking purposes, allowin **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveEnvelopeAuditEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `locale` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Envelope Documents ### retrieveEnvelopeDocuments `retrieveEnvelopeDocuments` Retrieves one or more documents from a DocuSign envelope. This endpoint allows users to fetch a single document, all documents combined, or specific document sets in various formats (PDF, ZIP, PDF portfolio). It's particularly useful for accessing signed documents, certificates of completion, or ent **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveEnvelopeDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documents_by_userid` | `string` | No | — | | `include_agreement_type` | `string` | No | — | | `include_docgen_formfields` | `string` | No | — | | `include_is_edited` | `string` | No | — | | `include_metadata` | `string` | No | — | | `include_tabs` | `string` | No | — | | `recipient_id` | `string` | No | — | | `shared_user_id` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Envelope Email Overrides ### retrieveEnvelopeEmailOverrides `retrieveEnvelopeEmailOverrides` Retrieves custom email settings for a specific DocuSign envelope. Use this action to get the envelope-specific email configuration overrides including: - Reply-to email address and display name - BCC email addresses for archiving (up to 5 addresses) These settings override the account-level defaults **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveEnvelopeEmailOverrides({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Envelope Html Definition ### retrieveEnvelopeHtmlDefinition `retrieveEnvelopeHtmlDefinition` Retrieves the original HTML definition used to generate the responsive HTML for a specific document within an envelope in a DocuSign account. This endpoint is crucial for developers working with DocuSign's responsive signing feature, as it provides detailed information about how the document is form **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveEnvelopeHtmlDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Envelope Notification Details ### retrieveEnvelopeNotificationDetails `retrieveEnvelopeNotificationDetails` Retrieves the notification, reminder, and expiration settings for an existing envelope in DocuSign. This endpoint allows developers to access and review the current notification configuration for a specific envelope, including expiration timelines and reminder schedules. It's particularly useful whe **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveEnvelopeNotificationDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Items In Cloud Storage Folder ### retrieveItemsInCloudStorageFolder `retrieveItemsInCloudStorageFolder` Retrieves a list of items (files and folders) from a specified folder in an integrated cloud storage provider. This endpoint allows users to browse and search their cloud storage contents directly within the DocuSign application, facilitating document selection for e-signature workflows. It supports **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveItemsInCloudStorageFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `serviceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `cloud_storage_folder_path` | `string` | No | — | | `cloud_storage_folderid_plain` | `string` | No | — | | `count` | `string` | No | — | | `order` | `string` | No | — | | `order_by` | `string` | No | — | | `search_text` | `string` | No | — | | `sky_drive_skip_token` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## Retrieve List Of Billing Plans ### retrieveListOfBillingPlans `retrieveListOfBillingPlans` Retrieves a comprehensive list of billing plans associated with a distributor in the DocuSign system. This endpoint provides detailed information about each billing plan, including plan names, IDs, payment cycles, methods, and pricing details in various currencies. It is particularly useful for admi **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveListOfBillingPlans({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Retrieve Payment Information List ### retrievePaymentInformationList `retrievePaymentInformationList` Retrieves a list of payment information for a specific DocuSign account. This endpoint allows you to fetch detailed payment data, including amounts, descriptions, payment dates, and IDs. It's particularly useful for accounting purposes, reconciliation, or generating financial reports. By default, it **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrievePaymentInformationList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_date` | `string` | No | — | | `to_date` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Pdf From Specified Template ### retrievePdfFromSpecifiedTemplate `retrievePdfFromSpecifiedTemplate` Retrieves one or more PDF documents from a specified DocuSign template. This endpoint allows you to fetch individual documents or combine all documents in the template into a single PDF file. It's particularly useful when you need to access template documents for review, processing, or to create new **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrievePdfFromSpecifiedTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `encrypt` | `string` | No | — | | `file_type` | `string` | No | — | | `show_changes` | `string` | No | — | **Output:** `string` *** ## Retrieve Power Form Data Entries ### retrievePowerFormDataEntries `retrievePowerFormDataEntries` This endpoint retrieves data entries for a specific PowerForm within a DocuSign account. It allows PowerForm Administrators or the PowerForm sender to download the information entered by recipients into a PowerForm. The data can be retrieved in various formats (JSON, XML, or CSV) and can be filtered **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrievePowerFormDataEntries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `powerFormId` | `string` | Yes | — | | `data_layout` | `string` | No | — | | `from_date` | `string` | No | — | | `to_date` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Properties About Workspace ### retrievePropertiesAboutWorkspace `retrievePropertiesAboutWorkspace` Retrieves detailed properties and information about a specific DocuSign workspace. This endpoint allows you to fetch comprehensive data about a workspace, including its settings, user details, and various metadata. It's particularly useful when you need to access or verify workspace information, suc **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrievePropertiesAboutWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Shared Item Status For Users ### retrieveSharedItemStatusForUsers `retrieveSharedItemStatusForUsers` Retrieves shared item status for one or more users and types of items within a DocuSign account. This endpoint provides detailed information about how envelopes, templates, and folders are shared among users and groups. It can be used to audit sharing permissions, track shared resources, or gather i **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveSharedItemStatusForUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `string` | No | — | | `envelopes_not_shared_user_status` | `string` | No | — | | `folder_ids` | `string` | No | — | | `item_type` | `string` | No | — | | `search_text` | `string` | No | — | | `shared` | `string` | No | — | | `start_position` | `string` | No | — | | `user_ids` | `string` | No | — | **Output:** *empty object* *** ## Retrieve Signer Signature Image Information ### retrieveSignerSignatureImageInformation `retrieveSignerSignatureImageInformation` Retrieves the specified user's signature image from a DocuSign envelope. This endpoint allows developers to access the electronic signature image of a specific recipient within an envelope, which can be useful for verification, display, or record-keeping purposes. The image is returned in its origin **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveSignerSignatureImageInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `include_chrome` | `string` | No | — | **Output:** `string` *** ## Retrieve Template Custom Fields ### retrieveTemplateCustomFields `retrieveTemplateCustomFields` Retrieves the custom document field information from an existing template in DocuSign. This endpoint allows users to fetch both list and text custom fields associated with a specific template. It's particularly useful when you need to view or work with the custom fields that have been set up for a t **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveTemplateCustomFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Template Document Page Images ### retrieveTemplateDocumentPageImages `retrieveTemplateDocumentPageImages` Retrieves and returns images of pages from a specified template document in DocuSign. This endpoint allows users to fetch visual representations of template pages with customizable image properties such as resolution and dimensions. It's particularly useful for previewing or displaying template cont **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveTemplateDocumentPageImages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `pageNumber` | `string` | Yes | — | | `dpi` | `string` | No | — | | `max_height` | `string` | No | — | | `max_width` | `string` | No | — | | `show_changes` | `string` | No | — | **Output:** `string` *** ## Retrieve Template Page Image ### retrieveTemplatePageImage `retrieveTemplatePageImage` Retrieves a specific page image from a template document for display purposes. This endpoint is part of the DocuSign Templates API and allows developers to fetch and display individual pages from template documents. It's particularly useful when you need to preview or display a specific page of a te **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveTemplatePageImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `count` | `string` | No | — | | `dpi` | `string` | No | — | | `max_height` | `string` | No | — | | `max_width` | `string` | No | — | | `nocache` | `string` | No | — | | `show_changes` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## Retrieve User Account Settings ### retrieveUserAccountSettings `retrieveUserAccountSettings` Retrieves a comprehensive list of account settings and email notification preferences for a specified user within a DocuSign account. This endpoint provides detailed information about the user's configuration, including locale settings, email notification preferences, account management capabilities **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveUserAccountSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve User Initials Image For Envelopes ### retrieveUserInitialsImageForEnvelopes `retrieveUserInitialsImageForEnvelopes` Retrieves the initials image that a recipient used when signing a DocuSign envelope. This endpoint allows you to fetch the recipient's initials image in its original format (GIF, PNG, JPEG, or BMP), with an option to include or exclude the chrome (added line and identifier around the image). The ini **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveUserInitialsImageForEnvelopes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `include_chrome` | `string` | No | — | **Output:** `string` *** ## Retrieve User Profile Image ### retrieveUserProfileImage `retrieveUserProfileImage` Retrieves the user profile picture for a specified user within a DocuSign account. This endpoint allows users to fetch their own profile image, which is returned in the same format as it was originally uploaded. It's particularly useful for applications that need to display user avatars or profile p **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveUserProfileImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `encoding` | `string` | No | — | **Output:** `string` *** ## Retrieve User Profile Information ### retrieveUserProfileInformation `retrieveUserProfileInformation` This endpoint retrieves comprehensive user profile information for a specified user within a DocuSign account. It provides detailed data about the user's personal information, settings, preferences, and permissions. The endpoint is particularly useful for obtaining an in-depth view of a user's confi **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveUserProfileInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve User Signature Definitions ### retrieveUserSignatureDefinitions `retrieveUserSignatureDefinitions` This endpoint retrieves the signature definitions for a specified user within a DocuSign account. It allows users to access their own signature information, including details about signature images, stamps, and associated metadata. The endpoint is useful for applications that need to display or mana **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveUserSignatureDefinitions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `stamp_type` | `string` | No | — | **Output:** *empty object* *** ## Retrieve User Signature Image ### retrieveUserSignatureImage `retrieveUserSignatureImage` Retrieves a specified user's signature or initials image from DocuSign. This endpoint allows you to fetch the image in its original upload format, with an option to include or exclude the chrome (frame) around the image. It's useful for applications that need to display or process user signatures. T **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveUserSignatureImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `signatureId` | `string` | Yes | — | | `imageType` | `string` | Yes | — | | `include_chrome` | `string` | No | — | **Output:** `string` *** ## Retrieve User Signature Information ### retrieveUserSignatureInformation `retrieveUserSignatureInformation` This endpoint retrieves the detailed structure and information of a single user signature within a DocuSign account. It provides comprehensive details about the signature, including its creation date, image URIs, stamp properties, and associated rights. The endpoint is designed for users to access a **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveUserSignatureInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `signatureId` | `string` | Yes | — | **Output:** *empty object* *** ## Retrieve Workflow Step For Template ### retrieveWorkflowStepForTemplate `retrieveWorkflowStepForTemplate` Retrieves detailed information about a specific workflow step for a DocuSign template. This endpoint allows users to access the configuration and status of a single step within a template's workflow, including delayed routing settings and conditional recipient rules. It's particularly useful for mon **Risk:** `read` ```ts theme={null} await corsair.docusign.api.retrieveWorkflowStepForTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | **Output:** *empty object* *** ## Return All Connect Service Users ### returnAllConnectServiceUsers `returnAllConnectServiceUsers` Retrieves all users from the configured Connect service for a specific DocuSign account and Connect configuration. This endpoint allows account administrators to fetch user information, including email addresses, user IDs, and inclusion status in the Connect service. It supports filtering by email, **Risk:** `read` ```ts theme={null} await corsair.docusign.api.returnAllConnectServiceUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectId` | `string` | Yes | — | | `count` | `string` | No | — | | `domain_users_only` | `string` | No | — | | `email_substring` | `string` | No | — | | `start_position` | `string` | No | — | | `status` | `string` | No | — | | `user_name_substring` | `string` | No | — | **Output:** *empty object* *** ## Return Brand Resource Metadata For Account ### returnBrandResourceMetadataForAccount `returnBrandResourceMetadataForAccount` Retrieves metadata about the branding resources associated with a specific DocuSign account and brand. This endpoint returns detailed information about various brand resource types, including those used for sending, signing, email, and captive (embedded) signing experiences. It's particularly useful **Risk:** `read` ```ts theme={null} await corsair.docusign.api.returnBrandResourceMetadataForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | **Output:** *empty object* *** ## Return Envelope Tab Data For Existing Envelope ### returnEnvelopeTabDataForExistingEnvelope `returnEnvelopeTabDataForExistingEnvelope` Retrieves detailed form data from a DocuSign envelope, including the current values of form fields, recipient information, and envelope status. This endpoint is used to download envelope and tab data from in-process, completed, or canceled envelopes that the user has sent or that are shared with the **Risk:** `read` ```ts theme={null} await corsair.docusign.api.returnEnvelopeTabDataForExistingEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Return Scheduled Sending Rules For Envelope ### returnScheduledSendingRulesForEnvelope `returnScheduledSendingRulesForEnvelope` Get the scheduled sending configuration for a DocuSign envelope. Returns when and how an envelope is scheduled to be sent, including: - Send date/time (resumeDate): When the envelope will be sent - Delay rules: Time to wait before sending (format: d.hh:mm:ss) - Status: Whether sending is pending, st **Risk:** `read` ```ts theme={null} await corsair.docusign.api.returnScheduledSendingRulesForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Returns Document Page Images Based On Input ### returnsDocumentPageImagesBasedOnInput `returnsDocumentPageImagesBasedOnInput` Retrieves images of document pages from a specific envelope in a DocuSign account. This endpoint allows users to fetch page images with customizable parameters such as resolution (DPI), image dimensions, and pagination options. It's particularly useful when you need to display or process document pa **Risk:** `read` ```ts theme={null} await corsair.docusign.api.returnsDocumentPageImagesBasedOnInput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `count` | `string` | No | — | | `dpi` | `string` | No | — | | `max_height` | `string` | No | — | | `max_width` | `string` | No | — | | `nocache` | `string` | No | — | | `show_changes` | `string` | No | — | | `start_position` | `string` | No | — | **Output:** *empty object* *** ## Return Template Workflow Definition ### returnTemplateWorkflowDefinition `returnTemplateWorkflowDefinition` Retrieves the workflow definition for a specified DocuSign template. This endpoint returns detailed information about the template's workflow, including scheduled sending settings, workflow status, and individual workflow steps. It's useful for understanding and managing the automated process flow o **Risk:** `read` ```ts theme={null} await corsair.docusign.api.returnTemplateWorkflowDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | **Output:** *empty object* *** ## Return Users From Connect Service ### returnUsersFromConnectService `returnUsersFromConnectService` Retrieves users associated with a specific DocuSign Connect configuration. This endpoint returns information about which users are linked to a Connect configuration, indicating either that all users are selected (allUsersSelected) or providing a list of specific users. Connect configurations define **Risk:** `read` ```ts theme={null} await corsair.docusign.api.returnUsersFromConnectService({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `connectId` | `string` | Yes | — | | `count` | `string` | No | — | | `email_substring` | `string` | No | — | | `list_included_users` | `string` | No | — | | `start_position` | `string` | No | — | | `status` | `string` | No | — | | `user_name_substring` | `string` | No | — | **Output:** *empty object* *** ## Revoke Envelope Correction Url ### revokeEnvelopeCorrectionUrl `revokeEnvelopeCorrectionUrl` This endpoint revokes the correction view URL for a specific envelope in DocuSign, effectively disabling the ability to make further corrections to the envelope. It should be used when you want to prevent any additional modifications to an envelope that was previously available for correction. This **Risk:** `destructive` ```ts theme={null} await corsair.docusign.api.revokeEnvelopeCorrectionUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output:** *empty object* *** ## Rotate Page Image For Envelope ### rotatePageImageForEnvelope `rotatePageImageForEnvelope` This endpoint rotates a page image within a specific document of an envelope in DocuSign. It allows users to change the orientation of a page to either left or right for improved display and readability. This function is particularly useful when dealing with documents that may have been scanned or u **Risk:** `write` ```ts theme={null} await corsair.docusign.api.rotatePageImageForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `pageNumber` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Rotate Template Page Image ### rotateTemplatePageImage `rotateTemplatePageImage` Rotates a page image within a DocuSign template for display purposes. This endpoint allows users to adjust the orientation of a specific page image to either the left or right within a template. It is particularly useful when preparing templates for use in electronic signature processes, ensuring th **Risk:** `write` ```ts theme={null} await corsair.docusign.api.rotateTemplatePageImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `pageNumber` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Send Envelope ### sendEnvelope `sendEnvelope` Sends a draft envelope by updating its status to sent. **Risk:** `write` ```ts theme={null} await corsair.docusign.api.sendEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | No | — | | `status` | `string` | No | — | *** ## Set Envelope Purge Config For Account ### setEnvelopePurgeConfigForAccount `setEnvelopePurgeConfigForAccount` Configures automatic envelope purge settings for a DocuSign account. This action allows account administrators to set up policies for automatically removing envelope documents after a specified retention period. The configuration includes options for: - Enabling/disabling automatic purging - Setting **Risk:** `write` ```ts theme={null} await corsair.docusign.api.setEnvelopePurgeConfigForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Set Initials Image For Accountless Signer ### setInitialsImageForAccountlessSigner `setInitialsImageForAccountlessSigner` This endpoint allows you to update the initials image for a signer who does not have a DocuSign account within a specific envelope. It's used to customize the appearance of a signer's initials on documents, enhancing the personalization of the signing process. The endpoint supports various image for **Risk:** `write` ```ts theme={null} await corsair.docusign.api.setInitialsImageForAccountlessSigner({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `imageBase64` | `string` | Yes | — | | `contentType` | `image/gif \| image/png \| image/jpeg \| image/bmp` | Yes | — | **Output:** *empty object* *** ## Set Shared Access For Users And Templates ### setSharedAccessForUsersAndTemplates `setSharedAccessForUsersAndTemplates` This endpoint sets shared access for users and templates in DocuSign. It manages collaboration and access control within an organization for envelopes, templates, and folders. Only users with admin privileges can set envelope access, while template access requires ownership or admin rights. Changes **Risk:** `write` ```ts theme={null} await corsair.docusign.api.setSharedAccessForUsersAndTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_type` | `string` | No | — | | `preserve_existing_shared_access` | `string` | No | — | | `user_ids` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Set Signature Image For No Account Signer ### setSignatureImageForNoAccountSigner `setSignatureImageForNoAccountSigner` This endpoint updates the signature image for an accountless signer in a DocuSign envelope. It allows you to set a custom signature image for recipients who don't have a DocuSign account, enhancing the flexibility of the signing process. The endpoint supports gif, png, jpeg, and bmp image formats, w **Risk:** `write` ```ts theme={null} await corsair.docusign.api.setSignatureImageForNoAccountSigner({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `imageBase64` | `string` | Yes | — | | `contentType` | `image/gif \| image/png \| image/jpeg \| image/bmp` | Yes | — | **Output:** *empty object* *** ## Set Templates As Account Favorites ### setTemplatesAsAccountFavorites `setTemplatesAsAccountFavorites` This endpoint allows users to set one or more templates as account favorites in DocuSign. It's used to mark specific templates for quick access within a user's account. The endpoint can handle multiple templates in a single request, making it efficient for bulk operations. It's particularly useful f **Risk:** `write` ```ts theme={null} await corsair.docusign.api.setTemplatesAsAccountFavorites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Set Up Connect Oauth Configuration ### setUpConnectOauthConfiguration `setUpConnectOauthConfiguration` Sets up Connect OAuth configuration for a specified DocuSign account using a custom authorization server. This endpoint enables secure, OAuth-based communication for DocuSign Connect, allowing real-time notifications about envelope status changes. It should be used when integrating DocuSign Connect **Risk:** `write` ```ts theme={null} await corsair.docusign.api.setUpConnectOauthConfiguration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Set User Signature Image ### setUserSignatureImage `setUserSignatureImage` Sets or updates a user's signature image, initials, or stamp in their DocuSign account. This endpoint uploads an image file to replace or create a signature element. Use this action to: - Upload a signature image for electronic document signing - Set initials image for a user - Add custom stamp imag **Risk:** `write` ```ts theme={null} await corsair.docusign.api.setUserSignatureImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `signatureId` | `string` | Yes | — | | `imageType` | `string` | Yes | — | | `transparent_png` | `string` | No | — | | `imageBase64` | `string` | Yes | — | | `contentType` | `image/gif \| image/png \| image/jpeg \| image/bmp` | Yes | — | **Output:** *empty object* *** ## Share Template With Group ### shareTemplateWithGroup `shareTemplateWithGroup` This endpoint allows you to share a DocuSign template with a specified members group. It's used to grant access to templates for collaboration and reuse within an organization. Note that this endpoint is deprecated, and for newer functionality, it's recommended to use the 'Accounts: Update Shared Ac **Risk:** `write` ```ts theme={null} await corsair.docusign.api.shareTemplateWithGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `templatePart` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Submit Batch Historical Envelopes To Webhook ### submitBatchHistoricalEnvelopesToWebhook `submitBatchHistoricalEnvelopesToWebhook` This endpoint submits a batch of existing envelopes to a specified webhook for historical publishing. It allows you to retroactively send envelope data to your systems for completed transactions, which is useful for data synchronization, auditing, or recovering missed notifications. The endpoint use **Risk:** `write` ```ts theme={null} await corsair.docusign.api.submitBatchHistoricalEnvelopesToWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Toggle Api Request Logging ### toggleApiRequestLogging `toggleApiRequestLogging` This endpoint enables or disables API request logging for troubleshooting purposes in DocuSign. It allows users to toggle the logging of REST API requests and responses, set the maximum number of log entries, and view the remaining log capacity. The tool is crucial for debugging API integrations by **Risk:** `write` ```ts theme={null} await corsair.docusign.api.toggleApiRequestLogging({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Account Brand Settings ### updateAccountBrandSettings `updateAccountBrandSettings` The UpdateAccountBrandSettings endpoint modifies or replaces an existing brand configuration for a DocuSign account. It customizes various brand aspects like company name, languages, colors, and landing pages. Use this tool to update branding elements for consistency across DocuSign interactions. It **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateAccountBrandSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `brandId` | `string` | Yes | — | | `replace_brand` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Account Custom Field ### updateAccountCustomField `updateAccountCustomField` This endpoint updates an existing account custom field in DocuSign. It allows you to modify the properties of a custom field, such as its name, type, required status, visibility, and value. The endpoint supports both list and text custom fields, enabling account administrators to refine and adjust c **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateAccountCustomField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customFieldId` | `string` | Yes | — | | `apply_to_templates` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Account Password Rules ### updateAccountPasswordRules `updateAccountPasswordRules` This endpoint updates the password rules for a DocuSign account. It allows account administrators to modify various password policy settings, including expiration, complexity requirements, lockout durations, and security question requirements. Use this endpoint to enhance account security, comply wi **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateAccountPasswordRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Account Settings ### updateAccountSettings `updateAccountSettings` Updates various settings for a specified DocuSign account. This endpoint allows administrators to configure a wide range of account-level options, including security settings, compliance features, and user interface preferences. Use this when you need to modify your DocuSign account configuration to **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateAccountSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Account Stamp By Id ### updateAccountStampById `updateAccountStampById` This endpoint allows you to update an existing account stamp (signature) in DocuSign. It provides extensive customization options for the stamp's appearance, associated users, and properties. Use this when you need to modify an existing stamp's details, such as its image, font, size, or user permiss **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateAccountStampById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signatureId` | `string` | Yes | — | | `close_existing_signature` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Account Stamps ### updateAccountStamps `updateAccountStamps` Update existing account stamps (signatures) in a DocuSign account. Modifies properties of existing stamps by referencing their signatureId. Supports updating names, sizes, formats (NameHanko/NameDateHanko), resize permissions, phonetic names, and external IDs. Supports batch updates of multiple stam **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateAccountStamps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Account Watermark Information ### updateAccountWatermarkInformation `updateAccountWatermarkInformation` This endpoint updates the watermark settings for a specified DocuSign account. It allows customization of various watermark properties such as display angle, font, color, size, and transparency. The endpoint can be used to enable or disable the watermark feature, change the watermark text, or modify **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateAccountWatermarkInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Account Watermark Preview ### updateAccountWatermarkPreview `updateAccountWatermarkPreview` Updates and previews watermark settings for a DocuSign account before applying them. This endpoint allows you to test watermark appearance settings including text, font, color, size, display angle, and transparency without permanently saving the configuration. Use this action when you want to previe **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateAccountWatermarkPreview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Billing Plan For Account ### updateBillingPlanForAccount `updateBillingPlanForAccount` Updates billing plan information, address, and payment details for a DocuSign account. Allows comprehensive modifications to billing setup, including payment methods, plan features, and promotional offers. Offers a preview mode for reviewing changes before applying. Use for significant billing confi **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateBillingPlanForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `preview_billing_plan` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Bulk Send Batch Name ### updateBulkSendBatchName `updateBulkSendBatchName` Updates the name of an existing DocuSign bulk send batch. This action allows you to rename a specific bulk send batch for better organization and identification. Use this when you need to update the batch name after creation, for example to reflect the batch purpose or processing status. Key points: **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateBulkSendBatchName({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulkSendBatchId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Connect Oauth Configuration ### updateConnectOauthConfiguration `updateConnectOauthConfiguration` This endpoint updates an existing Connect OAuth Configuration for a DocuSign account. Use it to modify OAuth settings for DocuSign Connect integrations, such as updating authorization URLs, client credentials, or scopes. It's crucial for maintaining secure data exchange between DocuSign and integrat **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateConnectOauthConfiguration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Contacts Information ### updateContactsInformation `updateContactsInformation` This endpoint updates one or more contacts associated with a DocuSign account. It allows for comprehensive modifications to contact information, including personal details, communication methods, and notary-specific data. The endpoint supports bulk updates, enabling efficient management of multiple **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateContactsInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Custom Fields In Envelope Document ### updateCustomFieldsInEnvelopeDocument `updateCustomFieldsInEnvelopeDocument` This endpoint allows you to update existing custom document fields in a specific document within an envelope in DocuSign. Custom document fields are name-value pairs that can be used to store additional metadata or information about the document. This function is useful when you need to modify or ad **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateCustomFieldsInEnvelopeDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Custom Tab Information For Account ### updateCustomTabInformationForAccount `updateCustomTabInformationForAccount` This endpoint updates the information for a custom tab associated with a specific DocuSign account. It allows for extensive customization of tab properties, including appearance, behavior, and positioning within documents. The endpoint is used when modifying existing custom tabs to change their char **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateCustomTabInformationForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customTabId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Document Visibility Recipients ### updateDocumentVisibilityRecipients `updateDocumentVisibilityRecipients` Updates document visibility settings for multiple recipients in a DocuSign envelope. Use this action to control which documents each recipient can see and their access level (read-only or editable). This is essential for managing multi-document envelopes where different recipients should only access **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateDocumentVisibilityRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Docusign Connect Configuration ### updateDocusignConnectConfiguration `updateDocusignConnectConfiguration` This endpoint updates an existing DocuSign Connect configuration for a specified account. It allows you to modify various settings such as the events that trigger notifications, the endpoint URL for receiving webhooks, data format preferences, and integration details with Salesforce. Use this endpoi **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateDocusignConnectConfiguration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Electronic Record Disclosure ### updateElectronicRecordDisclosure `updateElectronicRecordDisclosure` Updates the Electronic Record and Signature Disclosure (ERSD) for a DocuSign account. Allows administrators to customize the default disclosure, switch to a custom one, or update existing custom disclosures in multiple languages. Only account administrators can use this method. Changes may require u **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateElectronicRecordDisclosure({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `langCode` | `string` | Yes | — | | `include_metadata` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Enote Integration Config ### updateEnoteIntegrationConfig `updateEnoteIntegrationConfig` Updates the eNote integration configuration for a specific DocuSign account. This endpoint allows users to modify settings related to eNote functionality, including API key, Connect configuration, eNote configuration, organization details, and user credentials. It should be used when setting up or m **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnoteIntegrationConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Envelope Attachment ### updateEnvelopeAttachment `updateEnvelopeAttachment` Updates an existing attachment for a draft or in-process envelope in DocuSign. This endpoint allows you to modify attachment properties such as access control, type, content, label, and name. It supports file attachments up to 50 MB and provides options for chunked uploads of large files. Use this e **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnvelopeAttachment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `attachmentId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Envelope Custom Fields ### updateEnvelopeCustomFields `updateEnvelopeCustomFields` This endpoint allows users to update custom fields for draft and in-process envelopes in DocuSign. It enables the modification of both list-based and text-based custom fields, which can be used for sorting, organizing, searching, and other downstream processes. This tool is particularly useful when **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnvelopeCustomFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Envelope Delayed Routing Rules ### updateEnvelopeDelayedRoutingRules `updateEnvelopeDelayedRoutingRules` Updates the delayed routing rules for a specific workflow step in a DocuSign envelope. This endpoint allows you to add or modify delayed routing settings for both draft and sent envelopes, as long as the previous workflow step has not been completed. It enables you to control when the envelope will **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnvelopeDelayedRoutingRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Envelope Doc Gen Form Fields ### updateEnvelopeDocGenFormFields `updateEnvelopeDocGenFormFields` This method dynamically generates an envelope's documents by populating its sender fields. The envelope must be in a draft state. Use the DocumentGeneration::getEnvelopeDocGenFormFields response to retrieve the list of sender fields for your envelope. Use that list to build the request for this meth **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnvelopeDocGenFormFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `update_docgen_formfields_only` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Envelope Email Settings ### updateEnvelopeEmailSettings `updateEnvelopeEmailSettings` Updates the existing email override settings for a specified envelope in DocuSign. This endpoint allows customization of the Reply To email address and name, as well as BCC email addresses for a specific envelope. It's particularly useful when you need to modify email settings for an individual enve **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnvelopeEmailSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Envelope Notification Settings ### updateEnvelopeNotificationSettings `updateEnvelopeNotificationSettings` Updates the notification settings for a specific DocuSign envelope, including reminders and expirations. This endpoint allows you to customize when and how often recipients receive reminder emails, as well as set the expiration period for the envelope. It can either apply custom settings or use the **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnvelopeNotificationSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Envelope Scheduled Sending Rules ### updateEnvelopeScheduledSendingRules `updateEnvelopeScheduledSendingRules` Updates the scheduled sending rules for an envelope's workflow in DocuSign. This endpoint allows users to set or modify when an envelope will be sent, providing precise control over document delivery timing. It can be used to delay sending, schedule future sends, or manage bulk send operations with **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnvelopeScheduledSendingRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Envelope Workflow Definition ### updateEnvelopeWorkflowDefinition `updateEnvelopeWorkflowDefinition` Updates the workflow definition for a specified envelope in DocuSign. It allows modification of scheduled sending, delayed routing, and conditional recipient rules. Use this endpoint to add or update scheduling for draft or in-progress envelopes, or to add delayed routing to envelopes not yet in wor **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnvelopeWorkflowDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Envelope Workflow Step ### updateEnvelopeWorkflowStep `updateEnvelopeWorkflowStep` Updates a specific workflow step for a DocuSign envelope, allowing for customization of envelope processing, including delayed routing and conditional recipients. This endpoint can be used to modify workflow steps for both draft envelopes and sent envelopes (as long as the previous step hasn't been **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateEnvelopeWorkflowStep({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Group Information ### updateGroupInformation `updateGroupInformation` Updates group information for one or more user groups in a DocuSign account. This action allows you to modify group properties such as group name and permission profile assignments. \*\*Required Parameters:\*\* - groups: A list of group objects to update. Each group must include: - groupId: The Docu **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateGroupInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Lock For Envelope ### updateLockForEnvelope `updateLockForEnvelope` Updates lock settings for an already-locked envelope in DocuSign to extend duration or modify the locking application identifier. Use this to extend lock time during long editing sessions (max 1800 seconds/30 minutes) or update the lockedByApp identifier. Returns updated lock information including t **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateLockForEnvelope({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `lockToken` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Notary Jurisdiction Info ### updateNotaryJurisdictionInfo `updateNotaryJurisdictionInfo` Updates the jurisdiction information for a notary in the DocuSign system. This endpoint allows for modification of various details related to a notary's commission and jurisdiction settings. It should be used when there are changes to a notary's information, such as their registered name, commission **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateNotaryJurisdictionInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jurisdictionId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Permission Profile Settings ### updatePermissionProfileSettings `updatePermissionProfileSettings` This endpoint updates an existing account permission profile in DocuSign. It allows administrators to modify various settings and permissions for users associated with the profile, providing granular control over user capabilities within the DocuSign platform. The endpoint is used to customize user **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updatePermissionProfileSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `permissionProfileId` | `string` | Yes | — | | `include` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Recipient Document Visibility ### updateRecipientDocumentVisibility `updateRecipientDocumentVisibility` This endpoint updates the document visibility settings for a specific recipient within a DocuSign envelope. It allows fine-grained control over which documents a recipient can see and whether they have read-only or edit access. Use this when you need to modify document access for a particular recipi **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateRecipientDocumentVisibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `envelopeId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > documentVisibility: { > recipientId?: string, > documentId?: string, > visible?: string > }[] > } > ``` **Output:** *empty object* *** ## Update Signing Group Details ### updateSigningGroupDetails `updateSigningGroupDetails` Updates the details of a specified signing group within a DocuSign account, including the group name, email, and member information. This endpoint allows for modifying existing group data and adding new members to the signing group, with a maximum limit of 50 members per group. It's particularly use **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateSigningGroupDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signingGroupId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Signing Group Names ### updateSigningGroupNames `updateSigningGroupNames` Updates the names of one or more existing signing groups in DocuSign. This endpoint allows you to modify the names of signing groups, which are collections of users grouped together for document signing purposes. It's useful when you need to rename signing groups to reflect organizational changes or **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateSigningGroupNames({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Template Custom Fields ### updateTemplateCustomFields `updateTemplateCustomFields` Updates the custom fields in a DocuSign template. This endpoint allows you to modify both list and text custom fields associated with a specific template, ensuring each field has a unique name. It's used to customize templates for specific use cases, enabling prepopulation of metadata for envelopes **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateTemplateCustomFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Template Delayed Routing Rules ### updateTemplateDelayedRoutingRules `updateTemplateDelayedRoutingRules` This endpoint updates the scheduled sending rules for a specific workflow step in a DocuSign template. It allows users to set up delayed routing for envelopes, controlling when documents are sent to recipients associated with the workflow step. The function can be used to implement time-based workfl **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateTemplateDelayedRoutingRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Template Document Custom Fields ### updateTemplateDocumentCustomFields `updateTemplateDocumentCustomFields` This endpoint updates existing custom document fields in a specific document within a DocuSign template. It allows you to modify metadata associated with a template document without changing the document's content or structure. Use this when you need to update or add custom information to a template **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateTemplateDocumentCustomFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `documentId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Template Doc Visibility ### updateTemplateDocVisibility `updateTemplateDocVisibility` This endpoint updates document visibility settings for one or more recipients in a DocuSign template. It allows fine-grained control over which documents are visible to specific recipients, enhancing document security and workflow customization. The method is particularly useful when you need to res **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateTemplateDocVisibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Template Lock Information ### updateTemplateLockInformation `updateTemplateLockInformation` This endpoint allows you to update the lock information for an already locked template in DocuSign. It is used to modify the duration of an existing lock or change the name of the application that has locked the template. This operation is crucial for managing access to templates that are currently **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateTemplateLockInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `lockToken` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Template Notification Settings ### updateTemplateNotificationSettings `updateTemplateNotificationSettings` This endpoint updates the notification structure for an existing DocuSign template. It allows users to customize reminder and expiration notifications for a specific template, which can then be used to create envelopes with these predefined settings. The endpoint is particularly useful when you need **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateTemplateNotificationSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Template Recipient Document Visibility ### updateTemplateRecipientDocumentVisibility `updateTemplateRecipientDocumentVisibility` Updates document visibility settings for a specific recipient in a DocuSign template. This endpoint allows you to control which documents a particular recipient can see in a template with multiple documents. Use this when you need to: - Restrict certain documents from specific recipients for securit **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateTemplateRecipientDocumentVisibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `recipientId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Template Scheduled Sending Rules ### updateTemplateScheduledSendingRules `updateTemplateScheduledSendingRules` Updates the scheduled sending rules for a DocuSign template, controlling when envelopes created from this template are automatically sent. Use this to set up either a relative delay (e.g., send 2 days after creation) or an absolute future date/time. This is useful for: - Automating timed document de **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateTemplateScheduledSendingRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Template Workflow Definition ### updateTemplateWorkflowDefinition `updateTemplateWorkflowDefinition` Updates the workflow definition for a specified template in DocuSign, allowing for customization of the document signing process. This endpoint enables users to modify the sequence of steps, set up conditional routing, schedule envelope sending, and define recipient rules for a template. It's partic **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateTemplateWorkflowDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update User Account Settings ### updateUserAccountSettings `updateUserAccountSettings` This endpoint updates the account settings and email notification types for a specified user in DocuSign. It allows for comprehensive customization of a user's experience within the DocuSign platform, including locale preferences, timezone settings, email notifications, account management capabiliti **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateUserAccountSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `allow_all_languages` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update User Authorization Dates ### updateUserAuthorizationDates `updateUserAuthorizationDates` Updates the start and/or end dates for a specified user authorization in DocuSign. This endpoint allows account administrators or the principal user to modify the duration of an existing authorization, enabling precise control over when an agent can act on behalf of the principal user. It's particul **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateUserAuthorizationDates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `authorizationId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update User Information For Specified User ### updateUserInformationForSpecifiedUser `updateUserInformationForSpecifiedUser` The User\_PutUser endpoint allows updating user information for a specified user within a DocuSign account. It provides comprehensive control over user settings, including personal information, permissions, notification preferences, and locale settings. This endpoint should be used when modifying us **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateUserInformationForSpecifiedUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `allow_all_languages` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update User Notary Information ### updateUserNotaryInformation `updateUserNotaryInformation` The UpdateUserNotaryInformation endpoint modifies a notary's profile and settings in DocuSign. It manages account details, preferences, and operational parameters. Use this to update a notary's visibility, capabilities, or personal settings. It's crucial for maintaining accurate records and ensuring **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateUserNotaryInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update User Profile Image ### updateUserProfileImage `updateUserProfileImage` Updates the user's profile image in DocuSign by uploading a new image file. This action allows users to personalize their DocuSign account by uploading a profile picture. Supported formats include GIF, PNG, JPEG, and BMP. The image file must be less than 200KB, and for optimal display, DocuSign reco **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateUserProfileImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `imageBase64` | `string` | Yes | — | | `contentType` | `image/gif \| image/png \| image/jpeg \| image/bmp` | Yes | — | **Output:** *empty object* *** ## Update User Profile Information ### updateUserProfileInformation `updateUserProfileInformation` Updates a user's profile in DocuSign, including personal details, privacy settings, and user ID card information. It allows modifications to name, address, locale preferences, and various account settings. Users can only update their own information. Some settings may require admin rights to modify. **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateUserProfileInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update User Signature By Id ### updateUserSignatureById `updateUserSignatureById` Updates or creates a user's signature and initials for a specified DocuSign account. This endpoint allows for customization of signature appearance, including font, stamp format, and date stamp properties. It can be used to modify an existing signature or create a default signature if one doesn't ex **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateUserSignatureById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `signatureId` | `string` | Yes | — | | `close_existing_signature` | `string` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Workflow Step For Template ### updateWorkflowStepForTemplate `updateWorkflowStepForTemplate` This endpoint updates a specified workflow step for a DocuSign template. It allows users to modify various aspects of the workflow step, including delayed routing settings, recipient routing rules, and conditional recipient configurations. The endpoint is used to fine-tune the automation and customi **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateWorkflowStepForTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `templateId` | `string` | Yes | — | | `workflowStepId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Workspace Information ### updateWorkspaceInformation `updateWorkspaceInformation` Updates information about a specific DocuSign workspace. This endpoint allows you to modify various aspects of a workspace, including its name, description, settings, and status. It's used when you need to change workspace details or adjust collaboration settings. The endpoint requires both the acco **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateWorkspaceInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Update Workspace Item Metadata ### updateWorkspaceItemMetadata `updateWorkspaceItemMetadata` Updates the metadata for a specific file in a DocuSign workspace. This endpoint allows you to modify file properties such as name, content type, extension, and visibility settings without changing the actual file content. Use this action when you need to rename a file, update its MIME type, or chang **Risk:** `write` ```ts theme={null} await corsair.docusign.api.updateWorkspaceItemMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** # Database Source: https://docs.corsair.dev/plugins/docusign/database DocuSign local sync: searchable entities, `.search()` filters, and operators. The DocuSign plugin syncs data locally. Use `corsair.docusign.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `docusign.db.accounts.search` ```ts theme={null} const rows = await corsair.docusign.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `accountIdGuid` | `string` | equals, contains, startsWith, endsWith, in | | `accountName` | `string` | equals, contains, startsWith, endsWith, in | | `externalAccountId` | `string` | equals, contains, startsWith, endsWith, in | | `planName` | `string` | equals, contains, startsWith, endsWith, in | | `planClassification` | `string` | equals, contains, startsWith, endsWith, in | | `planStartDate` | `string` | equals, contains, startsWith, endsWith, in | | `planEndDate` | `string` | equals, contains, startsWith, endsWith, in | | `currentPlanId` | `string` | equals, contains, startsWith, endsWith, in | | `currencyCode` | `string` | equals, contains, startsWith, endsWith, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `billingPeriodStartDate` | `string` | equals, contains, startsWith, endsWith, in | | `billingPeriodEndDate` | `string` | equals, contains, startsWith, endsWith, in | | `billingPeriodEnvelopesAllowed` | `string` | equals, contains, startsWith, endsWith, in | | `billingPeriodEnvelopesSent` | `string` | equals, contains, startsWith, endsWith, in | | `billingPeriodDaysRemaining` | `string` | equals, contains, startsWith, endsWith, in | | `connectPermission` | `string` | equals, contains, startsWith, endsWith, in | | `distributorCode` | `string` | equals, contains, startsWith, endsWith, in | | `envelopeSendingBlocked` | `string` | equals, contains, startsWith, endsWith, in | | `suspensionStatus` | `string` | equals, contains, startsWith, endsWith, in | | `suspensionDate` | `string` | equals, contains, startsWith, endsWith, in | | `usesAPI` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Brands Path: `docusign.db.brands.search` ```ts theme={null} const rows = await corsair.docusign.db.brands.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `brandId` | `string` | equals, contains, startsWith, endsWith, in | | `brandName` | `string` | equals, contains, startsWith, endsWith, in | | `brandCompany` | `string` | equals, contains, startsWith, endsWith, in | | `defaultBrandLanguage` | `string` | equals, contains, startsWith, endsWith, in | | `isOverridingCompanyName` | `boolean` | equals | | `isSendingDefault` | `boolean` | equals | | `isSigningDefault` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Bulk Send Lists Path: `docusign.db.bulkSendLists.search` ```ts theme={null} const rows = await corsair.docusign.db.bulkSendLists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `listId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `createdByUser` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Connect Configurations Path: `docusign.db.connectConfigurations.search` ```ts theme={null} const rows = await corsair.docusign.db.connectConfigurations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `connectId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `urlToPublishTo` | `string` | equals, contains, startsWith, endsWith, in | | `configurationType` | `string` | equals, contains, startsWith, endsWith, in | | `allUsers` | `string` | equals, contains, startsWith, endsWith, in | | `allowEnvelopePublish` | `string` | equals, contains, startsWith, endsWith, in | | `enableLog` | `string` | equals, contains, startsWith, endsWith, in | | `includeDocuments` | `string` | equals, contains, startsWith, endsWith, in | | `includeCertificateOfCompletion` | `string` | equals, contains, startsWith, endsWith, in | | `includeHMAC` | `string` | equals, contains, startsWith, endsWith, in | | `includeTimeZoneInformation` | `string` | equals, contains, startsWith, endsWith, in | | `requiresAcknowledgement` | `string` | equals, contains, startsWith, endsWith, in | | `useSoapInterface` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `docusign.db.contacts.search` ```ts theme={null} const rows = await corsair.docusign.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `contactId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `string` | equals, contains, startsWith, endsWith, in | | `contactUri` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Custom Tabs Path: `docusign.db.customTabs.search` ```ts theme={null} const rows = await corsair.docusign.db.customTabs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `customTabId` | `string` | equals, contains, startsWith, endsWith, in | | `tabLabel` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `anchor` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `string` | equals, contains, startsWith, endsWith, in | | `required` | `string` | equals, contains, startsWith, endsWith, in | | `locked` | `string` | equals, contains, startsWith, endsWith, in | | `height` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `string` | equals, contains, startsWith, endsWith, in | | `lastModified` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedByDisplayName` | `string` | equals, contains, startsWith, endsWith, in | | `createdByDisplayName` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Documents Path: `docusign.db.documents.search` ```ts theme={null} const rows = await corsair.docusign.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `envelopeId` | `string` | equals, contains, startsWith, endsWith, in | | `documentId` | `string` | equals, contains, startsWith, endsWith, in | | `documentIdGuid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `order` | `string` | equals, contains, startsWith, endsWith, in | | `display` | `string` | equals, contains, startsWith, endsWith, in | | `includeInDownload` | `string` | equals, contains, startsWith, endsWith, in | | `signerMustAcknowledge` | `string` | equals, contains, startsWith, endsWith, in | | `templateRequired` | `string` | equals, contains, startsWith, endsWith, in | | `containsPdfFormFields` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Envelopes Path: `docusign.db.envelopes.search` ```ts theme={null} const rows = await corsair.docusign.db.envelopes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `envelopeId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `emailSubject` | `string` | equals, contains, startsWith, endsWith, in | | `emailBlurb` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `envelopeUri` | `string` | equals, contains, startsWith, endsWith, in | | `documentsUri` | `string` | equals, contains, startsWith, endsWith, in | | `recipientsUri` | `string` | equals, contains, startsWith, endsWith, in | | `templatesUri` | `string` | equals, contains, startsWith, endsWith, in | | `customFieldsUri` | `string` | equals, contains, startsWith, endsWith, in | | `notificationUri` | `string` | equals, contains, startsWith, endsWith, in | | `attachmentsUri` | `string` | equals, contains, startsWith, endsWith, in | | `brandId` | `string` | equals, contains, startsWith, endsWith, in | | `allowMarkup` | `string` | equals, contains, startsWith, endsWith, in | | `allowReassign` | `string` | equals, contains, startsWith, endsWith, in | | `allowViewHistory` | `string` | equals, contains, startsWith, endsWith, in | | `enableWetSign` | `string` | equals, contains, startsWith, endsWith, in | | `isSignatureProviderEnvelope` | `string` | equals, contains, startsWith, endsWith, in | | `purgeState` | `string` | equals, contains, startsWith, endsWith, in | | `voidedReason` | `string` | equals, contains, startsWith, endsWith, in | | `createdDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `sentDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `deliveredDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `completedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `declinedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `voidedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `deletedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `initialSentDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `statusChangedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `statusDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Groups Path: `docusign.db.groups.search` ```ts theme={null} const rows = await corsair.docusign.db.groups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `groupId` | `string` | equals, contains, startsWith, endsWith, in | | `groupName` | `string` | equals, contains, startsWith, endsWith, in | | `groupType` | `string` | equals, contains, startsWith, endsWith, in | | `permissionProfileId` | `string` | equals, contains, startsWith, endsWith, in | | `usersCount` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Permission Profiles Path: `docusign.db.permissionProfiles.search` ```ts theme={null} const rows = await corsair.docusign.db.permissionProfiles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `permissionProfileId` | `string` | equals, contains, startsWith, endsWith, in | | `permissionProfileName` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedByUsername` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `userCount` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Recipients Path: `docusign.db.recipients.search` ```ts theme={null} const rows = await corsair.docusign.db.recipients.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `envelopeId` | `string` | equals, contains, startsWith, endsWith, in | | `recipientId` | `string` | equals, contains, startsWith, endsWith, in | | `recipientType` | `string` | equals, contains, startsWith, endsWith, in | | `recipientIdGuid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `userName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `roleName` | `string` | equals, contains, startsWith, endsWith, in | | `routingOrder` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `clientUserId` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `note` | `string` | equals, contains, startsWith, endsWith, in | | `deliveryMethod` | `string` | equals, contains, startsWith, endsWith, in | | `declinedReason` | `string` | equals, contains, startsWith, endsWith, in | | `sentDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `deliveredDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `signedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `declinedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Signing Groups Path: `docusign.db.signingGroups.search` ```ts theme={null} const rows = await corsair.docusign.db.signingGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `signingGroupId` | `string` | equals, contains, startsWith, endsWith, in | | `groupName` | `string` | equals, contains, startsWith, endsWith, in | | `groupType` | `string` | equals, contains, startsWith, endsWith, in | | `groupEmail` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `createdBy` | `string` | equals, contains, startsWith, endsWith, in | | `modified` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedBy` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `docusign.db.templates.search` ```ts theme={null} const rows = await corsair.docusign.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `templateId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `string` | equals, contains, startsWith, endsWith, in | | `pageCount` | `number` | equals, gt, gte, lt, lte, in | | `folderId` | `string` | equals, contains, startsWith, endsWith, in | | `folderName` | `string` | equals, contains, startsWith, endsWith, in | | `folderUri` | `string` | equals, contains, startsWith, endsWith, in | | `emailSubject` | `string` | equals, contains, startsWith, endsWith, in | | `emailBlurb` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `lastModified` | `string` | equals, contains, startsWith, endsWith, in | | `lastUsed` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `docusign.db.users.search` ```ts theme={null} const rows = await corsair.docusign.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `userName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `middleName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `suffixName` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `jobTitle` | `string` | equals, contains, startsWith, endsWith, in | | `userStatus` | `string` | equals, contains, startsWith, endsWith, in | | `userType` | `string` | equals, contains, startsWith, endsWith, in | | `isAdmin` | `string` | equals, contains, startsWith, endsWith, in | | `loginStatus` | `string` | equals, contains, startsWith, endsWith, in | | `permissionProfileId` | `string` | equals, contains, startsWith, endsWith, in | | `permissionProfileName` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `createdDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastLogin` | `string` | equals, contains, startsWith, endsWith, in | | `userAddedToAccountDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `enableConnectForUser` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `docusign.db.workspaces.search` ```ts theme={null} const rows = await corsair.docusign.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceName` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceDescription` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceUri` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `lastModified` | `string` | equals, contains, startsWith, endsWith, in | | `billableAccountId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/docusign/overview Electronic signature platform for sending, signing, and managing agreements. Use **DocuSign** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 340 typed API operations * 15 synced entities (`accounts`, `brands`, `bulkSendLists`, `connectConfigurations`, `contacts`, `customTabs`, and 9 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/docusign ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/docusign ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/docusign ``` ```bash bun theme={null} bun add corsair @corsair-dev/docusign ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { docusign } from '@corsair-dev/docusign'; export const corsair = createCorsair({ plugins: [ docusign({ authType: 'oauth_2', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your DocuSign OAuth app. ```ts theme={null} docusign({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'docusign', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Get an envelope** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.docusign.api.getEnvelope({ envelopeId: '3a1b2c4d-0000-1111-2222-333344445555' }); ``` **Send an envelope from a template** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.docusign.api.createEnvelope({ emailSubject: 'Please sign the agreement', templateId: '7f6e5d4c-0000-1111-2222-333344445555', templateRoles: [{ email: 'jane@example.com', name: 'Jane Doe', roleName: 'Signer' }], }); ``` See the full list on the [API](/plugins/docusign/api) page. ## Query synced data Search envelopes synced from earlier getEnvelope calls. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.docusign.db.envelopes.search({ data: {}, limit: 50, }); ``` Synced entities: `accounts`, `brands`, `bulkSendLists`, `connectConfigurations`, `contacts`, `customTabs`, `documents`, `envelopes`, `groups`, `permissionProfiles`, `recipients`, `signingGroups`, `templates`, `users`, `workspaces`. See [Database](/plugins/docusign/database) for filters and operators. ## What's next > **[API reference](/plugins/docusign/api)** > > Every `docusign.api.*` operation with input and output types. > **[Database](/plugins/docusign/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/dodopayments/api API reference for Dodo Payments: every `dodopayments.api.*` operation with input and output types. Every `dodopayments.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Customers ### create `customers.create` Create a Dodo customer **Risk:** `write` ```ts theme={null} await corsair.dodopayments.api.customers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `email` | `string` | Yes | — | | `phone_number` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `created_at` | `string` | No | — | *** ### get `customers.get` Fetch a Dodo customer by ID **Risk:** `read` ```ts theme={null} await corsair.dodopayments.api.customers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Payments ### create `payments.create` Create a Dodo payment **Risk:** `write` ```ts theme={null} await corsair.dodopayments.api.payments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `customer_id` | `string` | No | — | | `payment_method` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `customer_id` | `string` | No | — | | `subscription_id` | `string` | No | — | | `billing` | `object` | No | — | | `payment_link` | `string` | No | — | | `created_at` | `string` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` *** ### get `payments.get` Fetch a Dodo payment by ID **Risk:** `read` ```ts theme={null} await corsair.dodopayments.api.payments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `customer_id` | `string` | No | — | | `subscription_id` | `string` | No | — | | `billing` | `object` | No | — | | `payment_link` | `string` | No | — | | `created_at` | `string` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` *** ### list `payments.list` List Dodo payments **Risk:** `read` ```ts theme={null} await corsair.dodopayments.api.payments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > amount: number, > currency: string, > status: string, > customer_id?: string | null, > subscription_id?: string | null, > billing?: { > } | null, > payment_link?: string | null, > created_at?: string > }[] > ``` *** ## Refunds ### create `refunds.create` Create a refund for a Dodo payment **Risk:** `write` ```ts theme={null} await corsair.dodopayments.api.refunds.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payment_id` | `string` | Yes | — | | `amount` | `number` | No | — | | `reason` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `payment_id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `status` | `string` | Yes | — | | `reason` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Subscriptions ### cancel `subscriptions.cancel` Cancel a Dodo subscription **Risk:** `write` ```ts theme={null} await corsair.dodopayments.api.subscriptions.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `customer_id` | `string` | Yes | — | | `plan_id` | `string` | No | — | | `status` | `string` | Yes | — | | `billing_cycle` | `object` | No | — | | `created_at` | `string` | No | — | > **billing\_cycle full type** > > ```ts theme={null} > { > } > ``` *** ### create `subscriptions.create` Create a Dodo subscription **Risk:** `write` ```ts theme={null} await corsair.dodopayments.api.subscriptions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customer_id` | `string` | Yes | — | | `plan_id` | `string` | Yes | — | | `quantity` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `customer_id` | `string` | Yes | — | | `plan_id` | `string` | No | — | | `status` | `string` | Yes | — | | `billing_cycle` | `object` | No | — | | `created_at` | `string` | No | — | > **billing\_cycle full type** > > ```ts theme={null} > { > } > ``` *** ### get `subscriptions.get` Fetch a Dodo subscription by ID **Risk:** `read` ```ts theme={null} await corsair.dodopayments.api.subscriptions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `customer_id` | `string` | Yes | — | | `plan_id` | `string` | No | — | | `status` | `string` | Yes | — | | `billing_cycle` | `object` | No | — | | `created_at` | `string` | No | — | > **billing\_cycle full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/dodopayments/database Dodo Payments local sync: searchable entities, `.search()` filters, and operators. The Dodo Payments plugin syncs data locally. Use `corsair.dodopayments.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Customers Path: `dodopayments.db.customers.search` ```ts theme={null} const rows = await corsair.dodopayments.db.customers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payments Path: `dodopayments.db.payments.search` ```ts theme={null} const rows = await corsair.dodopayments.db.payments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `customer_id` | `string` | equals, contains, startsWith, endsWith, in | | `subscription_id` | `string` | equals, contains, startsWith, endsWith, in | | `payment_link` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Refunds Path: `dodopayments.db.refunds.search` ```ts theme={null} const rows = await corsair.dodopayments.db.refunds.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `payment_id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `reason` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Subscriptions Path: `dodopayments.db.subscriptions.search` ```ts theme={null} const rows = await corsair.dodopayments.db.subscriptions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `customer_id` | `string` | equals, contains, startsWith, endsWith, in | | `plan_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/dodopayments/overview Payment processing platform for subscriptions, checkout, and global merchant transactions. Use **Dodo Payments** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 9 typed API operations * 4 synced entities (`customers`, `payments`, `refunds`, `subscriptions`) for fast `.search()` / `.list()` * 5 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dodopayments ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dodopayments ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dodopayments ``` ```bash bun theme={null} bun add corsair @corsair-dev/dodopayments ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dodopayments } from '@corsair-dev/dodopayments'; export const corsair = createCorsair({ plugins: [ dodopayments(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} dodopayments() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dodopayments', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`customers.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dodopayments.api.customers.get({}); ``` **`customers.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dodopayments.api.customers.create({}); ``` See the full list on the [API](/plugins/dodopayments/api) page. ## Query synced data Synced entities support `tenant.dodopayments.db..search()` and `.list()`: `customers`, `payments`, `refunds`, `subscriptions`. See [Database](/plugins/dodopayments/database) for filters and operators. ## Webhooks This plugin registers **5** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/dodopayments/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/dodopayments/api)** > > Every `dodopayments.api.*` operation with input and output types. > **[Database](/plugins/dodopayments/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/dodopayments/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/dodopayments/webhooks Dodo Payments incoming webhooks: event paths, payloads, and response data. The Dodo Payments plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/dodopayments/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `payments` * `failed` (`payments.failed`) * `succeeded` (`payments.succeeded`) * `refunds` * `succeeded` (`refunds.succeeded`) * `subscriptions` * `active` (`subscriptions.active`) * `cancelled` (`subscriptions.cancelled`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Payments ### Failed `payments.failed` A Dodo payment failed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `payment.failed` | Yes | — | | `created_at` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > amount: number, > currency: string, > status: string, > customer_id?: string | null, > subscription_id?: string | null, > billing?: { > } | null, > payment_link?: string | null, > created_at?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: payment.failed, > created_at?: string, > data: { > id: string, > amount: number, > currency: string, > status: string, > customer_id?: string | null, > subscription_id?: string | null, > billing?: { > } | null, > payment_link?: string | null, > created_at?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} dodopayments({ webhookHooks: { payments: { failed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Succeeded `payments.succeeded` A Dodo payment succeeded **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `payment.succeeded` | Yes | — | | `created_at` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > amount: number, > currency: string, > status: string, > customer_id?: string | null, > subscription_id?: string | null, > billing?: { > } | null, > payment_link?: string | null, > created_at?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: payment.succeeded, > created_at?: string, > data: { > id: string, > amount: number, > currency: string, > status: string, > customer_id?: string | null, > subscription_id?: string | null, > billing?: { > } | null, > payment_link?: string | null, > created_at?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} dodopayments({ webhookHooks: { payments: { succeeded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Refunds ### Succeeded `refunds.succeeded` A Dodo refund succeeded **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `refund.succeeded` | Yes | — | | `created_at` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > payment_id: string, > amount: number, > status: string, > reason?: string | null, > created_at?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: refund.succeeded, > created_at?: string, > data: { > id: string, > payment_id: string, > amount: number, > status: string, > reason?: string | null, > created_at?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} dodopayments({ webhookHooks: { refunds: { succeeded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Subscriptions ### Active `subscriptions.active` A Dodo subscription became active **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `subscription.active` | Yes | — | | `created_at` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > customer_id: string, > plan_id?: string | null, > status: string, > billing_cycle?: { > } | null, > created_at?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: subscription.active, > created_at?: string, > data: { > id: string, > customer_id: string, > plan_id?: string | null, > status: string, > billing_cycle?: { > } | null, > created_at?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} dodopayments({ webhookHooks: { subscriptions: { active: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Cancelled `subscriptions.cancelled` A Dodo subscription was cancelled **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `subscription.cancelled` | Yes | — | | `created_at` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > customer_id: string, > plan_id?: string | null, > status: string, > billing_cycle?: { > } | null, > created_at?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: subscription.cancelled, > created_at?: string, > data: { > id: string, > customer_id: string, > plan_id?: string | null, > status: string, > billing_cycle?: { > } | null, > created_at?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} dodopayments({ webhookHooks: { subscriptions: { cancelled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/doppler/api API reference for Doppler: every `doppler.api.*` operation with input and output types. Every `doppler.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Activity Logs ### list `activityLogs.list` List workplace activity log entries **Risk:** `read` ```ts theme={null} await corsair.doppler.api.activityLogs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `string` | No | — | | `perPage` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `logs` | `object[]` | Yes | — | | `page` | `number` | No | — | > **logs full type** > > ```ts theme={null} > { > id?: string | null, > text?: string | null, > html?: string | null, > created_at?: string | null, > config?: string | null, > environment?: string | null, > project?: string | null, > enclave_project?: string | null, > enclave_environment?: string | null, > enclave_config?: string | null, > user?: { > } | null, > diff?: { > } | null > }[] > ``` *** ### retrieve `activityLogs.retrieve` Retrieve a single activity log entry **Risk:** `read` ```ts theme={null} await corsair.doppler.api.activityLogs.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `log` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `text` | `string` | No | — | | `html` | `string` | No | — | | `created_at` | `string` | No | — | | `config` | `string` | No | — | | `environment` | `string` | No | — | | `project` | `string` | No | — | | `enclave_project` | `string` | No | — | | `enclave_environment` | `string` | No | — | | `enclave_config` | `string` | No | — | | `user` | `object` | No | — | | `diff` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > } > ``` > **diff full type** > > ```ts theme={null} > { > } > ``` *** ## Auth ### me `auth.me` Read information about the authenticated token **Risk:** `read` ```ts theme={null} await corsair.doppler.api.auth.me({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `created_at` | `string` | No | — | | `last_seen_at` | `string` | No | — | | `type` | `string` | No | — | | `token_preview` | `string` | No | — | | `workplace` | `object` | No | — | | `principal` | `object` | No | — | > **workplace full type** > > ```ts theme={null} > { > slug?: string | null, > name?: string | null > } > ``` > **principal full type** > > ```ts theme={null} > { > type?: string | null, > slug?: string | null > } > ``` *** ## Change Requests ### list `changeRequests.list` List change requests (Team/Enterprise plans only) **Risk:** `read` ```ts theme={null} await corsair.doppler.api.changeRequests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `status` | `string[]` | No | — | | `title` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ## Config Logs ### get `configLogs.get` Retrieve a config log entry, including its secret diff **Risk:** `read` ```ts theme={null} await corsair.doppler.api.configLogs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `log` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `text` | `string` | No | — | | `html` | `string` | No | — | | `created_at` | `string` | No | — | | `user` | `object` | No | — | | `diff` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > } > ``` > **diff full type** > > ```ts theme={null} > { > } > ``` *** ### list `configLogs.list` List a config's change-log entries **Risk:** `read` ```ts theme={null} await corsair.doppler.api.configLogs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `logs` | `object[]` | Yes | — | | `page` | `number` | No | — | > **logs full type** > > ```ts theme={null} > { > id?: string | null, > text?: string | null, > html?: string | null, > created_at?: string | null, > user?: { > } | null, > diff?: { > } | null > }[] > ``` *** ### rollback `configLogs.rollback` Roll a config back to a prior log entry's state **Risk:** `write` ```ts theme={null} await corsair.doppler.api.configLogs.rollback({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `log` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `text` | `string` | No | — | | `html` | `string` | No | — | | `created_at` | `string` | No | — | | `user` | `object` | No | — | | `diff` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > } > ``` > **diff full type** > > ```ts theme={null} > { > } > ``` *** ## Configs ### clone `configs.clone` Clone a config into a new branch config **Risk:** `write` ```ts theme={null} await corsair.doppler.api.configs.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `slug` | `string` | No | — | | `project` | `string` | No | — | | `environment` | `string` | No | — | | `root` | `boolean` | No | — | | `inheritable` | `boolean` | No | — | | `inheriting` | `boolean` | No | — | | `inherits` | `any[]` | No | — | | `inheritedBy` | `any[]` | No | — | | `locked` | `boolean` | No | — | | `initial_fetch_at` | `string` | No | — | | `last_fetch_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### create `configs.create` Create a branch config within an environment **Risk:** `write` ```ts theme={null} await corsair.doppler.api.configs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `environment` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `slug` | `string` | No | — | | `project` | `string` | No | — | | `environment` | `string` | No | — | | `root` | `boolean` | No | — | | `inheritable` | `boolean` | No | — | | `inheriting` | `boolean` | No | — | | `inherits` | `any[]` | No | — | | `inheritedBy` | `any[]` | No | — | | `locked` | `boolean` | No | — | | `initial_fetch_at` | `string` | No | — | | `last_fetch_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### delete `configs.delete` Permanently delete a config and its secrets **Risk:** `destructive` ```ts theme={null} await corsair.doppler.api.configs.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `configs.get` Retrieve a config **Risk:** `read` ```ts theme={null} await corsair.doppler.api.configs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `slug` | `string` | No | — | | `project` | `string` | No | — | | `environment` | `string` | No | — | | `root` | `boolean` | No | — | | `inheritable` | `boolean` | No | — | | `inheriting` | `boolean` | No | — | | `inherits` | `any[]` | No | — | | `inheritedBy` | `any[]` | No | — | | `locked` | `boolean` | No | — | | `initial_fetch_at` | `string` | No | — | | `last_fetch_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### list `configs.list` List a project's configs **Risk:** `read` ```ts theme={null} await corsair.doppler.api.configs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `environment` | `string` | No | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `configs` | `object[]` | Yes | — | | `page` | `number` | No | — | > **configs full type** > > ```ts theme={null} > { > name: string, > slug?: string | null, > project?: string | null, > environment?: string | null, > root?: boolean | null, > inheritable?: boolean | null, > inheriting?: boolean | null, > inherits?: any[] | null, > inheritedBy?: any[] | null, > locked?: boolean | null, > initial_fetch_at?: string | null, > last_fetch_at?: string | null, > created_at?: string | null > }[] > ``` *** ### lock `configs.lock` Lock a config so it cannot be renamed or deleted **Risk:** `write` ```ts theme={null} await corsair.doppler.api.configs.lock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `slug` | `string` | No | — | | `project` | `string` | No | — | | `environment` | `string` | No | — | | `root` | `boolean` | No | — | | `inheritable` | `boolean` | No | — | | `inheriting` | `boolean` | No | — | | `inherits` | `any[]` | No | — | | `inheritedBy` | `any[]` | No | — | | `locked` | `boolean` | No | — | | `initial_fetch_at` | `string` | No | — | | `last_fetch_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### unlock `configs.unlock` Unlock a config so it can be renamed or deleted **Risk:** `write` ```ts theme={null} await corsair.doppler.api.configs.unlock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `slug` | `string` | No | — | | `project` | `string` | No | — | | `environment` | `string` | No | — | | `root` | `boolean` | No | — | | `inheritable` | `boolean` | No | — | | `inheriting` | `boolean` | No | — | | `inherits` | `any[]` | No | — | | `inheritedBy` | `any[]` | No | — | | `locked` | `boolean` | No | — | | `initial_fetch_at` | `string` | No | — | | `last_fetch_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### update `configs.update` Rename a config **Risk:** `write` ```ts theme={null} await corsair.doppler.api.configs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `slug` | `string` | No | — | | `project` | `string` | No | — | | `environment` | `string` | No | — | | `root` | `boolean` | No | — | | `inheritable` | `boolean` | No | — | | `inheriting` | `boolean` | No | — | | `inherits` | `any[]` | No | — | | `inheritedBy` | `any[]` | No | — | | `locked` | `boolean` | No | — | | `initial_fetch_at` | `string` | No | — | | `last_fetch_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Dynamic Secrets ### revokeLease `dynamicSecrets.revokeLease` Revoke a leased dynamic secret credential **Risk:** `destructive` ```ts theme={null} await corsair.doppler.api.dynamicSecrets.revokeLease({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `dynamicSecret` | `string` | Yes | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ## Environments ### create `environments.create` Create an environment within a project **Risk:** `write` ```ts theme={null} await corsair.doppler.api.environments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `name` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `personalConfigs` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `project` | `string` | No | — | | `initial_fetch_at` | `string` | No | — | | `created_at` | `string` | No | — | | `personal_configs` | `boolean` | No | — | *** ### delete `environments.delete` Permanently delete an environment and its configs **Risk:** `destructive` ```ts theme={null} await corsair.doppler.api.environments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `environment` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `environments.get` Retrieve an environment **Risk:** `read` ```ts theme={null} await corsair.doppler.api.environments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `environment` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `project` | `string` | No | — | | `initial_fetch_at` | `string` | No | — | | `created_at` | `string` | No | — | | `personal_configs` | `boolean` | No | — | *** ### list `environments.list` List a project's environments **Risk:** `read` ```ts theme={null} await corsair.doppler.api.environments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > slug?: string | null, > name?: string | null, > project?: string | null, > initial_fetch_at?: string | null, > created_at?: string | null, > personal_configs?: boolean | null > }[] > ``` *** ### rename `environments.rename` Rename an environment's display name or slug **Risk:** `write` ```ts theme={null} await corsair.doppler.api.environments.rename({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `environment` | `string` | Yes | — | | `name` | `string` | No | — | | `slug` | `string` | No | — | | `personalConfigs` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `project` | `string` | No | — | | `initial_fetch_at` | `string` | No | — | | `created_at` | `string` | No | — | | `personal_configs` | `boolean` | No | — | *** ## Groups ### deleteMember `groups.deleteMember` Remove a member from a workplace group **Risk:** `destructive` ```ts theme={null} await corsair.doppler.api.groups.deleteMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group` | `string` | Yes | — | | `type` | `workplace_user \| group \| invite \| service_account` | Yes | — | | `memberSlug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ## Integrations ### list `integrations.list` List third-party integrations **Risk:** `read` ```ts theme={null} await corsair.doppler.api.integrations.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ## Invites ### list `invites.list` List pending workplace invites **Risk:** `read` ```ts theme={null} await corsair.doppler.api.invites.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `invites` | `object[]` | Yes | — | | `page` | `number` | No | — | > **invites full type** > > ```ts theme={null} > { > }[] > ``` *** ## Project Members ### delete `projectMembers.delete` Remove a member from a project **Risk:** `destructive` ```ts theme={null} await corsair.doppler.api.projectMembers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `type` | `workplace_user \| group \| invite \| service_account` | Yes | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `projectMembers.get` Retrieve a project member **Risk:** `read` ```ts theme={null} await corsair.doppler.api.projectMembers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `type` | `workplace_user \| group \| invite \| service_account` | Yes | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `slug` | `string` | No | — | | `role` | `object` | No | — | | `environments` | `any[]` | No | — | > **role full type** > > ```ts theme={null} > { > } > ``` *** ### list `projectMembers.list` List a project's members **Risk:** `read` ```ts theme={null} await corsair.doppler.api.projectMembers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `members` | `object[]` | Yes | — | | `page` | `number` | No | — | > **members full type** > > ```ts theme={null} > { > type?: string | null, > slug?: string | null, > role?: { > } | null, > environments?: any[] | null > }[] > ``` *** ## Project Roles ### get `projectRoles.get` Retrieve a project-level role **Risk:** `read` ```ts theme={null} await corsair.doppler.api.projectRoles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | No | — | | `name` | `string` | No | — | | `permissions` | `string[]` | No | — | | `created_at` | `string` | No | — | | `is_custom_role` | `boolean` | No | — | *** ### list `projectRoles.list` List project-level roles **Risk:** `read` ```ts theme={null} await corsair.doppler.api.projectRoles.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > identifier?: string | null, > name?: string | null, > permissions?: string[] | null, > created_at?: string | null, > is_custom_role?: boolean | null > }[] > ``` *** ### listPermissions `projectRoles.listPermissions` List permissions grantable to a project-level role **Risk:** `read` ```ts theme={null} await corsair.doppler.api.projectRoles.listPermissions({}); ``` **Input:** *empty object* **Output:** `string[]` *** ## Projects ### create `projects.create` Create a project **Risk:** `write` ```ts theme={null} await corsair.doppler.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | *** ### delete `projects.delete` Permanently delete a project and everything in it **Risk:** `destructive` ```ts theme={null} await corsair.doppler.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `projects.get` Retrieve a project **Risk:** `read` ```ts theme={null} await corsair.doppler.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | *** ### list `projects.list` List projects **Risk:** `read` ```ts theme={null} await corsair.doppler.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projects` | `object[]` | Yes | — | | `page` | `number` | No | — | > **projects full type** > > ```ts theme={null} > { > id: string, > slug?: string | null, > name?: string | null, > description?: string | null, > created_at?: string | null > }[] > ``` *** ### update `projects.update` Update a project's name or description **Risk:** `write` ```ts theme={null} await corsair.doppler.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Secrets ### delete `secrets.delete` Delete a secret **Risk:** `destructive` ```ts theme={null} await corsair.doppler.api.secrets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### download `secrets.download` Download a config's secrets in a given format **Risk:** `read` ```ts theme={null} await corsair.doppler.api.secrets.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `format` | `json \| env \| yaml \| docker \| env-no-quotes` | No | — | | `nameTransformer` | `string` | No | — | | `includeDynamicSecrets` | `boolean` | No | — | | `dynamicSecretsTtlSec` | `number` | No | — | | `secrets` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `secrets.get` Retrieve a single secret's value **Risk:** `read` ```ts theme={null} await corsair.doppler.api.secrets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `raw` | `string` | No | — | | `computed` | `string` | No | — | | `note` | `string` | No | — | | `rawVisibility` | `string` | No | — | | `computedVisibility` | `string` | No | — | | `rawValueType` | `object` | No | — | | `computedValueType` | `object` | No | — | | `name` | `string` | Yes | — | > **rawValueType full type** > > ```ts theme={null} > { > } > ``` > **computedValueType full type** > > ```ts theme={null} > { > } > ``` *** ### list `secrets.list` List a config's secrets, values included **Risk:** `read` ```ts theme={null} await corsair.doppler.api.secrets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `includeDynamicSecrets` | `boolean` | No | — | | `includeManagedSecrets` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### names `secrets.names` List a config's secret names, without values **Risk:** `read` ```ts theme={null} await corsair.doppler.api.secrets.names({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `includeDynamicSecrets` | `boolean` | No | — | | `includeManagedSecrets` | `boolean` | No | — | **Output:** `string[]` *** ### update `secrets.update` Bulk-set (or delete, via null) secrets in a config **Risk:** `write` ```ts theme={null} await corsair.doppler.api.secrets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `secrets` | `object` | Yes | — | > **secrets full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateNote `secrets.updateNote` Set a secret's note (project-scoped route) **Risk:** `write` ```ts theme={null} await corsair.doppler.api.secrets.updateNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `secret` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `secret` | `string` | No | — | | `note` | `string` | No | — | *** ### updateNoteViaConfig `secrets.updateNoteViaConfig` Set a secret's note (config-scoped route) **Risk:** `write` ```ts theme={null} await corsair.doppler.api.secrets.updateNoteViaConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `secret` | `string` | Yes | — | | `note` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `secret` | `string` | No | — | | `note` | `string` | No | — | *** ## Service Tokens ### create `serviceTokens.create` Create a service token for a config **Risk:** `write` ```ts theme={null} await corsair.doppler.api.serviceTokens.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `name` | `string` | Yes | — | | `access` | `read \| read/write` | No | — | | `expireAt` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `slug` | `string` | No | — | | `access` | `string` | No | — | | `created_at` | `string` | No | — | | `key` | `string` | No | — | | `project` | `string` | No | — | | `environment` | `string` | No | — | | `config` | `string` | No | — | | `expires_at` | `string` | No | — | | `last_seen_at` | `string` | No | — | | `token_preview` | `string` | No | — | *** ### delete `serviceTokens.delete` Revoke a service token **Risk:** `destructive` ```ts theme={null} await corsair.doppler.api.serviceTokens.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### list `serviceTokens.list` List a config's service tokens **Risk:** `read` ```ts theme={null} await corsair.doppler.api.serviceTokens.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `config` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > slug?: string | null, > access?: string | null, > created_at?: string | null, > key?: string | null, > project?: string | null, > environment?: string | null, > config?: string | null, > expires_at?: string | null, > last_seen_at?: string | null, > token_preview?: string | null > }[] > ``` *** ## Share ### createEncrypted `share.createEncrypted` Create a Doppler Share link from a caller-encrypted payload (zero-knowledge) **Risk:** `write` ```ts theme={null} await corsair.doppler.api.share.createEncrypted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `encryptedSecret` | `string` | Yes | — | | `hashedPassword` | `string` | Yes | — | | `encryptionKdf` | `pbkdf2` | No | — | | `encryptionSaltRounds` | `1000000` | No | — | | `expireViews` | `number \| -1` | No | — | | `expireDays` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `authenticated_url` | `string` | No | — | | `password` | `string` | No | — | *** ### createPlain `share.createPlain` Create a Doppler Share link from a plaintext secret **Risk:** `write` ```ts theme={null} await corsair.doppler.api.share.createPlain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `secret` | `string` | Yes | — | | `expireViews` | `number \| -1` | No | — | | `expireDays` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `authenticated_url` | `string` | No | — | | `password` | `string` | No | — | *** ## Webhooks ### add `webhooks.add` Create a webhook **Risk:** `write` ```ts theme={null} await corsair.doppler.api.webhooks.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `url` | `string` | Yes | — | | `name` | `string` | No | — | | `secret` | `string` | No | — | | `authentication` | `object` | No | — | | `payload` | `string` | No | — | | `enableConfigs` | `string[]` | No | — | > **authentication full type** > > ```ts theme={null} > { > type: None | Bearer | Basic, > token?: string, > username?: string, > password?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `enabled` | `boolean` | No | — | | `hasSecret` | `boolean` | No | — | | `authentication` | `any` | No | — | | `enabledConfigs` | `any[]` | No | — | | `canManage` | `boolean` | No | — | *** ### delete `webhooks.delete` Permanently delete a webhook **Risk:** `destructive` ```ts theme={null} await corsair.doppler.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### disable `webhooks.disable` Disable a webhook **Risk:** `write` ```ts theme={null} await corsair.doppler.api.webhooks.disable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `enabled` | `boolean` | No | — | | `hasSecret` | `boolean` | No | — | | `authentication` | `any` | No | — | | `enabledConfigs` | `any[]` | No | — | | `canManage` | `boolean` | No | — | *** ### enable `webhooks.enable` Enable a webhook **Risk:** `write` ```ts theme={null} await corsair.doppler.api.webhooks.enable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `enabled` | `boolean` | No | — | | `hasSecret` | `boolean` | No | — | | `authentication` | `any` | No | — | | `enabledConfigs` | `any[]` | No | — | | `canManage` | `boolean` | No | — | *** ### get `webhooks.get` Retrieve a webhook **Risk:** `read` ```ts theme={null} await corsair.doppler.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `enabled` | `boolean` | No | — | | `hasSecret` | `boolean` | No | — | | `authentication` | `any` | No | — | | `enabledConfigs` | `any[]` | No | — | | `canManage` | `boolean` | No | — | *** ### list `webhooks.list` List webhooks **Risk:** `read` ```ts theme={null} await corsair.doppler.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > url?: string | null, > enabled?: boolean | null, > hasSecret?: boolean | null, > authentication?: any | null, > enabledConfigs?: any[] | null, > canManage?: boolean | null > }[] > ``` *** ### update `webhooks.update` Update a webhook **Risk:** `write` ```ts theme={null} await corsair.doppler.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `slug` | `string` | Yes | — | | `url` | `string` | No | — | | `name` | `string` | No | — | | `secret` | `string` | No | — | | `authentication` | `object` | No | — | | `payload` | `string` | No | — | | `enableConfigs` | `string[]` | No | — | | `disableConfigs` | `string[]` | No | — | > **authentication full type** > > ```ts theme={null} > { > type: None | Bearer | Basic, > token?: string, > username?: string, > password?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `enabled` | `boolean` | No | — | | `hasSecret` | `boolean` | No | — | | `authentication` | `any` | No | — | | `enabledConfigs` | `any[]` | No | — | | `canManage` | `boolean` | No | — | *** ## Workplace ### get `workplace.get` Retrieve the workplace **Risk:** `read` ```ts theme={null} await corsair.doppler.api.workplace.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `billing_email` | `string` | No | — | | `security_email` | `string` | No | — | *** ### update `workplace.update` Update the workplace's name, billing email, or security email **Risk:** `write` ```ts theme={null} await corsair.doppler.api.workplace.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `billingEmail` | `string` | No | — | | `securityEmail` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `billing_email` | `string` | No | — | | `security_email` | `string` | No | — | *** ## Workplace Roles ### get `workplaceRoles.get` Retrieve a workplace role **Risk:** `read` ```ts theme={null} await corsair.doppler.api.workplaceRoles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `permissions` | `string[]` | No | — | *** ### list `workplaceRoles.list` List workplace roles **Risk:** `read` ```ts theme={null} await corsair.doppler.api.workplaceRoles.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > permissions?: string[] | null > }[] > ``` *** ### listPermissions `workplaceRoles.listPermissions` List permissions grantable to a workplace role **Risk:** `read` ```ts theme={null} await corsair.doppler.api.workplaceRoles.listPermissions({}); ``` **Input:** *empty object* **Output:** `string[]` *** ## Workplace Users ### get `workplaceUsers.get` Retrieve a workplace user by id **Risk:** `read` ```ts theme={null} await corsair.doppler.api.workplaceUsers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `access` | `string` | No | — | | `created_at` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id?: string | null, > email?: string | null, > name?: string | null, > username?: string | null > } > ``` *** ### list `workplaceUsers.list` List users in the workplace **Risk:** `read` ```ts theme={null} await corsair.doppler.api.workplaceUsers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `email` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `workplace_users` | `object[]` | Yes | — | | `page` | `number` | No | — | > **workplace\_users full type** > > ```ts theme={null} > { > access?: string | null, > created_at?: string | null, > user?: { > id?: string | null, > email?: string | null, > name?: string | null, > username?: string | null > } | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/doppler/database Doppler local sync: searchable entities, `.search()` filters, and operators. The Doppler plugin syncs data locally. Use `corsair.doppler.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Configs Path: `doppler.db.configs.search` ```ts theme={null} const rows = await corsair.doppler.db.configs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `environment` | `string` | equals, contains, startsWith, endsWith, in | | `root` | `boolean` | equals | | `inheritable` | `boolean` | equals | | `inheriting` | `boolean` | equals | | `locked` | `boolean` | equals | | `initial_fetch_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_fetch_at` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Environments Path: `doppler.db.environments.search` ```ts theme={null} const rows = await corsair.doppler.db.environments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `initial_fetch_at` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `personal_configs` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `doppler.db.projects.search` ```ts theme={null} const rows = await corsair.doppler.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `doppler.db.webhooks.search` ```ts theme={null} const rows = await corsair.doppler.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `enabled` | `boolean` | equals | | `hasSecret` | `boolean` | equals | | `canManage` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workplace Path: `doppler.db.workplace.search` ```ts theme={null} const rows = await corsair.doppler.db.workplace.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `billing_email` | `string` | equals, contains, startsWith, endsWith, in | | `security_email` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/doppler/overview Secrets management platform for syncing environment variables across teams and deployments. Use **Doppler** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 62 typed API operations * 5 synced entities (`configs`, `environments`, `projects`, `webhooks`, `workplace`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/doppler ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/doppler ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/doppler ``` ```bash bun theme={null} bun add corsair @corsair-dev/doppler ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { doppler } from '@corsair-dev/doppler'; export const corsair = createCorsair({ plugins: [ doppler(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} doppler() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'doppler', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`activityLogs.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.doppler.api.activityLogs.list({}); ``` **`configLogs.rollback`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.doppler.api.configLogs.rollback({}); ``` See the full list on the [API](/plugins/doppler/api) page. ## Query synced data Synced entities support `tenant.doppler.db..search()` and `.list()`: `configs`, `environments`, `projects`, `webhooks`, `workplace`. See [Database](/plugins/doppler/database) for filters and operators. ## What's next > **[API reference](/plugins/doppler/api)** > > Every `doppler.api.*` operation with input and output types. > **[Database](/plugins/doppler/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/dovetail/api API reference for Dovetail: every `dovetail.api.*` operation with input and output types. Every `dovetail.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Channels ### create `channels.create` Creates a new channel in Dovetail to organize and collect feedback data. Channels are containers for specific types of customer feedback such as app reviews, NPS responses, churn reasons, product reviews, or support tickets. Use this to set up a new data collection source before importing feedback data. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.channels.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `content_type` | `APP_REVIEW \| CHURN_REASONS \| NPS_FEEDBACK \| PRODUCT_REVIEW \| SUPPORT_TICKETS` | Yes | — | | `project_category_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > content_type?: string, > project_category_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > url?: string, > topics?: { > id: string, > channel_id?: string, > title: string, > description?: string, > created_at?: string | null, > updated_at?: string | null > }[], > project_category?: { > id: string > } | null > } > ``` *** ### createDataPoint `channels.createDataPoint` Tool to create a data point within a channel. Use after capturing new content to record and classify it in Dovetail. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.channels.createDataPoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `text` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | | `source_title` | `string` | No | — | | `source_url` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > channel_id?: string, > text?: string, > timestamp?: string | null, > source_title?: string | null, > source_url?: string | null, > created_at?: string | null, > topics?: { > id: string, > title?: string > }[] > } > ``` *** ### createTopic `channels.createTopic` Tool to create a new topic in a Dovetail channel. Requires channel\_id, title, and description. Use to organize feedback within channels by creating themed discussion topics. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.channels.createTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > channel_id?: string, > title: string, > description?: string, > created_at?: string | null, > updated_at?: string | null, > channel?: { > id: string > } > } > ``` *** ### delete `channels.delete` Tool to delete an existing channel. Use when you need to remove a channel and move it to the project's trash (restorable for 30 days). Confirm the channel ID before calling. **Risk:** `destructive` ```ts theme={null} await corsair.dovetail.api.channels.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > deleted_at: string, > deleted: boolean, > url?: string > } > ``` *** ### deleteTopic `channels.deleteTopic` Tool to delete an existing topic. Use when you have confirmed the topic ID and want to move it to trash (restorable for 30 days). Example: "Delete topic with ID 123e4567-e89b-12d3-a456-426614174000." **Risk:** `destructive` ```ts theme={null} await corsair.dovetail.api.channels.deleteTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `topic_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > description?: string, > deleted_at: string, > deleted: boolean > } > ``` *** ### update `channels.update` Tool to update an existing channel's title or context. Use after confirming the channel ID and fields to change. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.channels.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `context` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > content_type?: string, > project_category_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > url?: string, > topics?: { > id: string, > channel_id?: string, > title: string, > description?: string, > created_at?: string | null, > updated_at?: string | null > }[], > project_category?: { > id: string > } | null > } > ``` *** ### updateTopic `channels.updateTopic` Tool to update an existing topic. Use after confirming the topic ID and fields to change. Example: "Update topic with id 123... to have title 'New'". **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.channels.updateTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `topic_id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > channel_id?: string, > title: string, > description?: string, > created_at?: string | null, > updated_at?: string | null, > channel?: { > id: string > } > } > ``` *** ## Contacts ### create `contacts.create` Tool to create a new contact in Dovetail. Use when you need to register a contact before logging interactions. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `email` | `string` | Yes | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > email?: string | null, > avatar_url?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### get `contacts.get` Tool to retrieve details of a specific contact. Use when you have confirmed the contact ID and need full contact metadata from Dovetail. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > email?: string | null, > avatar_url?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### list `contacts.list` Retrieves a paginated list of contacts from a Dovetail workspace. Returns contact IDs, names, creation timestamps, and custom fields. Use cursor-based pagination (limit + start\_cursor) to navigate large contact lists efficiently. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > name?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > email?: string | null, > avatar_url?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ### update `contacts.update` Tool to update an existing contact in Dovetail. Use when you need to modify a contact's name, email, or custom fields. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > email?: string | null, > avatar_url?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ## Data ### create `data.create` Tool to create a data item in a Dovetail project with text content, title, and/or structured fields. Use when you need to capture and store research data, interview notes, or other content in a project. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.data.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `title` | `string` | No | — | | `content` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted?: boolean, > deleted_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### delete `data.delete` Tool to delete an existing data item. Use when you have confirmed the data ID and want to move it to trash (restorable for 30 days). Example: "Delete data with ID 1tFfvvAmYPCLUqb9zO8dgN." **Risk:** `destructive` ```ts theme={null} await corsair.dovetail.api.data.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted?: boolean, > deleted_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### export `data.export` Tool to export data in HTML or Markdown format. Use when you need to retrieve a formatted version of data items from Dovetail. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.data.export({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_id` | `string` | Yes | — | | `type` | `html \| markdown` | Yes | — | | `include_file_content` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > content_html?: string, > content_markdown?: string, > content_text?: string, > files?: { > id: string, > name?: string, > text_status?: string > }[], > indexed?: boolean, > truncated?: boolean > } > ``` *** ### get `data.get` Tool to retrieve details of a specific data item by ID. Use when you have confirmed the data ID and need full metadata including custom fields, files, and project information from Dovetail. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.data.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted?: boolean, > deleted_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### importFile `data.importFile` Tool to import a public URL of a file as new data in Dovetail. Use when you need to add external files to a project. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.data.importFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `url` | `string` | No | — | | `file_id` | `string` | No | — | | `mime_type` | `string` | No | — | | `author_id` | `string` | No | — | | `created_at` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted?: boolean, > deleted_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### list `data.list` Tool to list data items in Dovetail. Use when you need to retrieve, filter, sort, or paginate through your workspace data. Supports filtering by created\_at (date range), project\_id, and title. Results can be sorted by created\_at or title. Uses cursor-based pagination with configurable page size. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.data.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > project_id?: string, > folder_id?: string, > title?: string, > created_at?: { > gt?: string, > gte?: string, > lt?: string, > lte?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted?: boolean, > deleted_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ### update `data.update` Tool to update a data item in Dovetail. Use when you need to modify the title or fields of an existing data item. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.data.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_id` | `string` | Yes | — | | `title` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted?: boolean, > deleted_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ## Docs ### create `docs.create` Tool to create a doc in a Dovetail project with text content, title and/or custom fields. Use when you need to document research findings, store notes, or create structured content within a project. The doc content is stored but not returned in the response. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.docs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `content` | `string` | No | — | | `content_type` | `text \| html \| markdown` | No | — | | `project_id` | `string` | No | — | | `folder_id` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### delete `docs.delete` Tool to delete an existing doc. Use when you need to remove a doc and move it to the project's trash (restorable for 30 days). **Risk:** `destructive` ```ts theme={null} await corsair.dovetail.api.docs.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `doc_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### export `docs.export` Tool to export a doc in HTML or Markdown format. Use when you need to retrieve the full content of a doc from Dovetail in a specific format. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.docs.export({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `doc_id` | `string` | Yes | — | | `type` | `html \| markdown` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > content_html?: string, > content_markdown?: string > } > ``` *** ### get `docs.get` Tool to retrieve details of a specific doc by ID. Use when you have confirmed the doc ID and need full doc metadata from Dovetail. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.docs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `doc_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### importFile `docs.importFile` Tool to import a public file URL as a new doc in Dovetail. Use when you need to create a doc from an external file source. The file must be publicly accessible at the provided URL. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.docs.importFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `project_id` | `string` | No | — | | `folder_id` | `string` | No | — | | `url` | `string` | No | — | | `file_id` | `string` | No | — | | `mime_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### list `docs.list` Tool to list docs in a Dovetail workspace with optional filtering, sorting, and pagination. Use when you need to retrieve docs, optionally filtered by project, title, content, or creation date. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.docs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > project_id?: string, > folder_id?: string, > title?: string, > created_at?: { > gt?: string, > gte?: string, > lt?: string, > lte?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ### listUserDocs `docs.listUserDocs` Tool to get a list of docs associated with a user in Dovetail. Use when you need to retrieve documents for a specific user or the authenticated user (use 'me' as user\_id). **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.docs.listUserDocs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > project_id?: string, > folder_id?: string, > title?: string, > created_at?: { > gt?: string, > gte?: string, > lt?: string, > lte?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ### update `docs.update` Tool to update a doc in Dovetail. Use when you need to modify a doc's title or custom fields. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.docs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `doc_id` | `string` | Yes | — | | `title` | `string` | No | — | | `folder_id` | `string` | No | — | | `cover_image_file_id` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ## Files ### get `files.get` Tool to retrieve details of a specific file by its ID. Use when you need file metadata, download URL, or processing status from Dovetail. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > mime_type?: string, > status?: string, > created_at?: string | null, > updated_at?: string | null, > download_url?: string > } > ``` *** ## Folders ### get `folders.get` Tool to retrieve details of a specific folder. Use when you have confirmed the folder ID and need full folder metadata from Dovetail. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > parent_folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > folders?: string[] | null > } > ``` *** ### list `folders.list` Tool to get a list of folders associated with a workspace. Use when you need to retrieve folder hierarchy, search for folders by title, or navigate the folder structure with pagination support. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.folders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > parent_folder_id?: string | null, > title?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > parent_folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > folders?: string[] | null > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ## Highlights ### list `highlights.list` List highlights from your Dovetail workspace with optional filtering and pagination. Use this action to retrieve highlights that have been created across your notes and projects. Supports filtering by project or note, and cursor-based pagination for large result sets. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.highlights.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > project_id?: string, > tag_id?: string, > highlight_id?: string, > created_at?: { > gt?: string, > gte?: string, > lt?: string, > lte?: string > }, > updated_at?: { > gt?: string, > gte?: string, > lt?: string, > lte?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > note_id?: string, > tag_id?: string | null, > text?: string, > start_time?: number | null, > end_time?: number | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ## Insights ### create `insights.create` Creates a new insight in Dovetail to store synthesized research findings, observations, or conclusions. Use this tool when you need to document and save key findings from user research, interviews, or data analysis. Insights can optionally be linked to a project for better organization. Returns the created insight's ID, title, creation timestamp, and other metadata. Note: The body content is stored but not included in the response. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.insights.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `content` | `string` | No | — | | `content_type` | `text \| html \| markdown` | No | — | | `project_id` | `string` | No | — | | `folder_id` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### delete `insights.delete` Tool to delete an existing insight. Use when you have confirmed the insight ID and want to move it to trash (restorable for 30 days). **Risk:** `destructive` ```ts theme={null} await corsair.dovetail.api.insights.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `insight_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### export `insights.export` Tool to export an insight in HTML or Markdown format. Use when you need to retrieve the full content of an insight for documentation, reporting, or sharing purposes. The exported content includes the insight's title and body in the specified format. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.insights.export({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `insight_id` | `string` | Yes | — | | `type` | `html \| markdown` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > content_html?: string, > content_markdown?: string > } > ``` *** ### get `insights.get` Tool to retrieve details of a specific insight by ID. Use when you need full insight metadata from Dovetail. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.insights.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `insight_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### importFile `insights.importFile` Tool to import a file from a public URL as a new insight in Dovetail. Use when you need to create an insight from an external file source such as PDFs, images, or documents. The file must be publicly accessible for Dovetail to fetch and import it. After import, the insight can be analyzed, tagged, and connected to projects. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.insights.importFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `project_id` | `string` | No | — | | `folder_id` | `string` | No | — | | `url` | `string` | No | — | | `file_id` | `string` | No | — | | `mime_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### list `insights.list` Tool to get a list of insights associated with a workspace. Use when you need to retrieve insights with optional filtering by project, publication status, or title, and support for cursor-based pagination. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.insights.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > project_id?: string, > folder_id?: string, > title?: string, > created_at?: { > gt?: string, > gte?: string, > lt?: string, > lte?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ### listUserInsights `insights.listUserInsights` List personal insights for a user in Dovetail. Returns a paginated list of insights including their IDs, titles, creation dates, and published status. Use DOVETAIL\_GET\_TOKEN\_INFO to obtain a valid user\_id. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.insights.listUserInsights({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > project_id?: string, > folder_id?: string, > title?: string, > created_at?: { > gt?: string, > gte?: string, > lt?: string, > lte?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ### update `insights.update` Updates an existing insight in Dovetail, allowing you to modify the title and custom fields. Use when you need to revise insight information, correct titles, or update custom field values. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.insights.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `insight_id` | `string` | Yes | — | | `title` | `string` | No | — | | `folder_id` | `string` | No | — | | `cover_image_file_id` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > project_id?: string | null, > folder_id?: string | null, > cover_image_file_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ## Notes ### create `notes.create` Tool to create a note in a Dovetail project with text content, title and/or custom fields. Use when you need to document research notes, store interview findings, or create structured content within a project. The note content is stored but not returned in the response. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.notes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `title` | `string` | No | — | | `content` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### delete `notes.delete` Tool to delete an existing note. Use when you have confirmed the note ID and want to move it to trash (restorable for 30 days). **Risk:** `destructive` ```ts theme={null} await corsair.dovetail.api.notes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `note_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### export `notes.export` Tool to export a note from Dovetail in HTML or Markdown format. Use when you need to retrieve the full content of a note in a specific export format. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.notes.export({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `note_id` | `string` | Yes | — | | `type` | `html \| markdown` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > content_html?: string, > content_markdown?: string > } > ``` *** ### get `notes.get` Tool to retrieve details of a specific note. Use when you have confirmed the note ID and need full note metadata from Dovetail. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.notes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `note_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### importFile `notes.importFile` Tool to import a file from a public URL as a new note in Dovetail. Use when you need to create a note by importing content from an accessible file URL (PDF, video, audio, etc.). **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.notes.importFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `url` | `string` | Yes | — | | `mime_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ### list `notes.list` List notes in Dovetail workspace with optional pagination and sorting. Use this tool to retrieve notes from your Dovetail workspace. Supports pagination for large result sets and sorting options. Returns note metadata including IDs, titles, timestamps, and associated project information. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.notes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > project_id?: string, > folder_id?: string, > created_at?: { > gt?: string, > gte?: string, > lt?: string, > lte?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ### update `notes.update` Tool to update an existing note in Dovetail. Use when you need to modify a note's title, content, or custom fields. Example: "Update note 8IFq5LEC6hV1Vgsu0jPNJ with new title 'Q1 Review'". **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.notes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `note_id` | `string` | Yes | — | | `title` | `string` | No | — | | `fields` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > label: string, > value?: any, > type?: BOOLEAN | DATETIME | EMAIL | NPS | NUMBER | PERSON | PHONE | SELECT | TEXT | URL > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > project_id?: string, > title?: string | null, > folder_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > fields?: { > id?: string, > label: string, > value?: any, > type?: string > }[] > } > ``` *** ## Projects ### create `projects.create` Tool to create a new project in your Dovetail workspace. Use when you need to create a project to organize research data. **Risk:** `write` ```ts theme={null} await corsair.dovetail.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `folder_id` | `string` | No | — | | `template_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > folder_id?: string | null, > template_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > overview?: string | null > } > ``` *** ### get `projects.get` Tool to retrieve details of a specific project. Use when you have confirmed the project ID and need full project metadata from Dovetail. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > folder_id?: string | null, > template_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > overview?: string | null > } > ``` *** ### list `projects.list` Tool to list all projects in Dovetail. Use after authenticating with a valid workspace token when you need to retrieve the full project list. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > folder_id?: string, > title?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > folder_id?: string | null, > template_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > overview?: string | null > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ## Search ### magicSearch `search.magicSearch` Tool to perform a magic search across workspace data. Use when you need to retrieve relevant highlights, notes, insights, channels, themes, or tags by query. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.search.magicSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `highlights` | `any[]` | No | — | | `notes` | `any[]` | No | — | | `insights` | `any[]` | No | — | | `channels` | `any[]` | No | — | | `tags` | `any[]` | No | — | | `themes` | `any[]` | No | — | *** ## Tags ### list `tags.list` List all tags in the authenticated Dovetail workspace. Returns tag details including title, color, highlight count, and timestamps. Supports pagination for workspaces with many tags. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `object` | No | — | | `filter` | `object` | No | — | | `sort` | `string` | No | — | > **page full type** > > ```ts theme={null} > { > start_cursor?: string, > limit?: number > } > ``` > **filter full type** > > ```ts theme={null} > { > project_id?: string, > tag_board_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `page` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > color?: string, > project_id?: string | null, > tag_board_id?: string | null, > scope?: string, > highlight_count?: number, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **page full type** > > ```ts theme={null} > { > total_count?: number, > has_more?: boolean, > next_cursor?: string | null > } > ``` *** ## Token ### getInfo `token.getInfo` Retrieves information about the current API token, including its unique identifier and the associated workspace subdomain. Use this to verify which workspace the token belongs to. **Risk:** `read` ```ts theme={null} await corsair.dovetail.api.token.getInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > subdomain: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/dovetail/database Dovetail local sync: searchable entities, `.search()` filters, and operators. The Dovetail plugin syncs data locally. Use `corsair.dovetail.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Channels Path: `dovetail.db.channels.search` ```ts theme={null} const rows = await corsair.dovetail.db.channels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `content_type` | `string` | equals, contains, startsWith, endsWith, in | | `project_category_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `dovetail.db.contacts.search` ```ts theme={null} const rows = await corsair.dovetail.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Data Path: `dovetail.db.data.search` ```ts theme={null} const rows = await corsair.dovetail.db.data.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `folder_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted` | `boolean` | equals | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Data Points Path: `dovetail.db.dataPoints.search` ```ts theme={null} const rows = await corsair.dovetail.db.dataPoints.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `channel_id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `source_title` | `string` | equals, contains, startsWith, endsWith, in | | `source_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Docs Path: `dovetail.db.docs.search` ```ts theme={null} const rows = await corsair.dovetail.db.docs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `folder_id` | `string` | equals, contains, startsWith, endsWith, in | | `cover_image_file_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `dovetail.db.files.search` ```ts theme={null} const rows = await corsair.dovetail.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `mime_type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Folders Path: `dovetail.db.folders.search` ```ts theme={null} const rows = await corsair.dovetail.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `parent_folder_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Highlights Path: `dovetail.db.highlights.search` ```ts theme={null} const rows = await corsair.dovetail.db.highlights.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `note_id` | `string` | equals, contains, startsWith, endsWith, in | | `tag_id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `start_time` | `number` | equals, gt, gte, lt, lte, in | | `end_time` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Insights Path: `dovetail.db.insights.search` ```ts theme={null} const rows = await corsair.dovetail.db.insights.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `folder_id` | `string` | equals, contains, startsWith, endsWith, in | | `cover_image_file_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Notes Path: `dovetail.db.notes.search` ```ts theme={null} const rows = await corsair.dovetail.db.notes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `folder_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `dovetail.db.projects.search` ```ts theme={null} const rows = await corsair.dovetail.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `folder_id` | `string` | equals, contains, startsWith, endsWith, in | | `template_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `dovetail.db.tags.search` ```ts theme={null} const rows = await corsair.dovetail.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `tag_board_id` | `string` | equals, contains, startsWith, endsWith, in | | `scope` | `string` | equals, contains, startsWith, endsWith, in | | `highlight_count` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Topics Path: `dovetail.db.topics.search` ```ts theme={null} const rows = await corsair.dovetail.db.topics.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `channel_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/dovetail/overview Dovetail plugin for Corsair Use **Dovetail** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 51 typed API operations * 13 synced entities (`channels`, `contacts`, `data`, `dataPoints`, `docs`, `files`, and 7 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dovetail ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dovetail ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dovetail ``` ```bash bun theme={null} bun add corsair @corsair-dev/dovetail ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dovetail } from '@corsair-dev/dovetail'; export const corsair = createCorsair({ plugins: [ dovetail(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} dovetail() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dovetail', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`contacts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dovetail.api.contacts.get({}); ``` **`channels.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dovetail.api.channels.create({}); ``` See the full list on the [API](/plugins/dovetail/api) page. ## Query synced data Synced entities support `tenant.dovetail.db..search()` and `.list()`: `channels`, `contacts`, `data`, `dataPoints`, `docs`, `files`, `folders`, `highlights`, `insights`, `notes`, `projects`, `tags`, `topics`. See [Database](/plugins/dovetail/database) for filters and operators. ## What's next > **[API reference](/plugins/dovetail/api)** > > Every `dovetail.api.*` operation with input and output types. > **[Database](/plugins/dovetail/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/dreamstudio/api API reference for DreamStudio: every `dreamstudio.api.*` operation with input and output types. Every `dreamstudio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Engines ### list `engines.list` List Stability engines available to this API key. The v1 API returns the full list with no pagination. **Risk:** `read` ```ts theme={null} await corsair.dreamstudio.api.engines.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `engines` | `object[]` | Yes | — | > **engines full type** > > ```ts theme={null} > { > id: string, > name: string, > description: string, > type: AUDIO | CLASSIFICATION | PICTURE | STORAGE | TEXT | VIDEO > }[] > ``` *** ## Generation ### imageFromImage `generation.imageFromImage` Generate a new image from an init image and text prompts via POST /v1/generation//image-to-image **Risk:** `write` ```ts theme={null} await corsair.dreamstudio.api.generation.imageFromImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `engine_id` | `string` | Yes | Engine id from GET /v1/engines/list | | `init_image` | `string` | Yes | Init image as base64 or a data URL | | `text_prompts` | `object[]` | Yes | — | | `init_image_mode` | `IMAGE_STRENGTH \| STEP_SCHEDULE` | Yes | — | | `image_strength` | `number` | No | — | | `step_schedule_start` | `number` | No | — | | `step_schedule_end` | `number` | No | — | | `cfg_scale` | `number` | No | — | | `clip_guidance_preset` | `FAST_BLUE \| FAST_GREEN \| NONE \| SIMPLE \| SLOW \| SLOWER \| SLOWEST` | No | — | | `sampler` | `DDIM \| DDPM \| K_DPMPP_2M \| K_DPMPP_2S_ANCESTRAL \| K_DPM_2 \| K_DPM_2_ANCESTRAL \| K_EULER \| K_EULER_ANCESTRAL \| K_HEUN \| K_LMS` | No | — | | `samples` | `number` | No | — | | `steps` | `number` | No | — | | `seed` | `number` | No | — | | `style_preset` | `3d-model \| analog-film \| anime \| cinematic \| comic-book \| digital-art \| enhance \| fantasy-art \| isometric \| line-art \| low-poly \| modeling-compound \| neon-punk \| origami \| photographic \| pixel-art \| tile-texture` | No | — | > **text\_prompts full type** > > ```ts theme={null} > { > text: string, > weight?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `artifacts` | `object[]` | Yes | — | > **artifacts full type** > > ```ts theme={null} > { > base64: string, > finishReason: CONTENT_FILTERED | ERROR | SUCCESS, > seed: number > }[] > ``` *** ## User ### account `user.account` Get the authenticated Stability user id, email, organizations, and profile picture **Risk:** `read` ```ts theme={null} await corsair.dreamstudio.api.user.account({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | Yes | — | | `organizations` | `object[]` | Yes | — | | `profile_picture` | `string` | No | — | > **organizations full type** > > ```ts theme={null} > { > id: string, > name: string, > role: string, > is_default: boolean > }[] > ``` *** ### balance `user.balance` Get the credit balance of the Stability account tied to the API key **Risk:** `read` ```ts theme={null} await corsair.dreamstudio.api.user.balance({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `credits` | `number` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/dreamstudio/database DreamStudio local sync: searchable entities, `.search()` filters, and operators. The DreamStudio plugin syncs data locally. Use `corsair.dreamstudio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `dreamstudio.db.accounts.search` ```ts theme={null} const rows = await corsair.dreamstudio.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `profile_picture` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Balances Path: `dreamstudio.db.balances.search` ```ts theme={null} const rows = await corsair.dreamstudio.db.balances.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `credits` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Engines Path: `dreamstudio.db.engines.search` ```ts theme={null} const rows = await corsair.dreamstudio.db.engines.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Images Path: `dreamstudio.db.images.search` ```ts theme={null} const rows = await corsair.dreamstudio.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `base64` | `string` | equals, contains, startsWith, endsWith, in | | `seed` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `dreamstudio.db.organizations.search` ```ts theme={null} const rows = await corsair.dreamstudio.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `is_default` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/dreamstudio/overview Stability AI image generation service for creating artwork from text prompts. Use **DreamStudio** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 5 synced entities (`accounts`, `balances`, `engines`, `images`, `organizations`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dreamstudio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dreamstudio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dreamstudio ``` ```bash bun theme={null} bun add corsair @corsair-dev/dreamstudio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dreamstudio } from '@corsair-dev/dreamstudio'; export const corsair = createCorsair({ plugins: [ dreamstudio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} dreamstudio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dreamstudio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`engines.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dreamstudio.api.engines.list({}); ``` **`generation.imageFromImage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dreamstudio.api.generation.imageFromImage({}); ``` See the full list on the [API](/plugins/dreamstudio/api) page. ## Query synced data Synced entities support `tenant.dreamstudio.db..search()` and `.list()`: `accounts`, `balances`, `engines`, `images`, `organizations`. See [Database](/plugins/dreamstudio/database) for filters and operators. ## What's next > **[API reference](/plugins/dreamstudio/api)** > > Every `dreamstudio.api.*` operation with input and output types. > **[Database](/plugins/dreamstudio/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/dripcel/api API reference for Dripcel: every `dripcel.api.*` operation with input and output types. Every `dripcel.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Balance ### get `balance.get` Get the current Dripcel credit balance **Risk:** `read` ```ts theme={null} await corsair.dripcel.api.balance.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `balance` | `number` | Yes | — | *** ## Campaigns ### list `campaigns.list` List Dripcel campaigns **Risk:** `read` ```ts theme={null} await corsair.dripcel.api.campaigns.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaigns` | `object[]` | Yes | — | > **campaigns full type** > > ```ts theme={null} > { > _id?: string, > name?: string, > status?: string, > active?: boolean, > createdAt?: string, > updatedAt?: string > }[] > ``` *** ## Compliance ### checkSend `compliance.checkSend` Check whether phone numbers may receive SMS **Risk:** `read` ```ts theme={null} await corsair.dripcel.api.compliance.checkSend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cells` | `string[]` | Yes | — | | `country` | `string` | Yes | — | | `campaign_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | No | — | | `credits_used` | `number` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > cell: string, > can_send: boolean > }[] > ``` *** ## Contacts ### addTags `contacts.addTags` Add tags to a Dripcel contact by cell number **Risk:** `write` ```ts theme={null} await corsair.dripcel.api.contacts.addTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cell` | `string` | Yes | — | | `tag_ids` | `string[]` | No | — | | `tags` | `string[]` | No | — | | `create_missing_contact` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `matchedCount` | `number` | Yes | — | | `modifiedCount` | `number` | Yes | — | *** ### create `contacts.create` Create new Dripcel contacts in bulk (POST /contacts) **Risk:** `write` ```ts theme={null} await corsair.dripcel.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | Yes | — | | `country` | `ZA \| NA` | No | — | | `tag_ids` | `string[]` | No | — | | `send` | `object` | No | — | > **contacts full type** > > ```ts theme={null} > { > _id?: string, > cell: string, > firstname?: string, > lastname?: string, > email?: string, > tag_ids?: string[], > tags?: string[], > createdAt?: string, > updatedAt?: string > }[] > ``` > **send full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `validContacts` | `number` | Yes | — | | `invalidContacts` | `any[]` | Yes | — | *** ### delete `contacts.delete` Delete a Dripcel contact by cell number **Risk:** `destructive` ```ts theme={null} await corsair.dripcel.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cell` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### get `contacts.get` Get a Dripcel contact by cell number (MSISDN) **Risk:** `read` ```ts theme={null} await corsair.dripcel.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cell` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | No | — | | `cell` | `string` | No | — | | `firstname` | `string` | No | — | | `lastname` | `string` | No | — | | `email` | `string` | No | — | | `tag_ids` | `string[]` | No | — | | `tags` | `string[]` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### optOut `contacts.optOut` Opt a Dripcel contact out of campaigns **Risk:** `write` ```ts theme={null} await corsair.dripcel.api.contacts.optOut({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cell` | `string` | Yes | — | | `campaign_ids` | `string[]` | No | — | | `all` | `boolean` | No | — | | `create_missing_contact` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `matchedCount` | `number` | Yes | — | | `modifiedCount` | `number` | Yes | — | *** ### upsert `contacts.upsert` Create or update Dripcel contacts in bulk (PUT /contacts) **Risk:** `write` ```ts theme={null} await corsair.dripcel.api.contacts.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | Yes | — | | `country` | `ZA \| NA` | No | — | | `tag_ids` | `string[]` | No | — | | `send` | `object` | No | — | > **contacts full type** > > ```ts theme={null} > { > _id?: string, > cell: string, > firstname?: string, > lastname?: string, > email?: string, > tag_ids?: string[], > tags?: string[], > createdAt?: string, > updatedAt?: string > }[] > ``` > **send full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `validContacts` | `number` | Yes | — | | `invalidContacts` | `any[]` | Yes | — | *** ## Deliveries ### list `deliveries.list` List Dripcel deliveries by cell or send customerId **Risk:** `read` ```ts theme={null} await corsair.dripcel.api.deliveries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cell` | `string` | No | — | | `customerId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deliveries` | `object[]` | Yes | — | > **deliveries full type** > > ```ts theme={null} > { > _id?: string, > cell?: string, > customerId?: string, > status?: string > }[] > ``` *** ## Email Templates ### list `emailTemplates.list` List Dripcel email templates **Risk:** `read` ```ts theme={null} await corsair.dripcel.api.emailTemplates.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `templates` | `object[]` | Yes | — | > **templates full type** > > ```ts theme={null} > { > _id?: string, > name?: string, > subject?: string, > content?: string > }[] > ``` *** ## Replies ### search `replies.search` Search Dripcel message replies **Risk:** `read` ```ts theme={null} await corsair.dripcel.api.replies.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string \| string[]` | No | — | | `Message` | `string` | No | — | | `kind` | `string \| string[]` | No | — | | `Msisdn` | `string \| string[]` | No | — | | `campaign_id` | `string \| string[]` | No | — | | `UserReference` | `string \| string[]` | No | — | | `Received` | `object` | No | — | > **Received full type** > > ```ts theme={null} > { > $gte?: string, > $lte?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `replies` | `object[]` | Yes | — | > **replies full type** > > ```ts theme={null} > { > _id?: string, > Msisdn?: string, > Message?: string, > campaign_id?: string, > UserReference?: string, > kind?: optIn | optOut | unknown, > Received?: string, > updatedAt?: string > }[] > ``` *** ## Sales ### upload `sales.upload` Upload sales to Dripcel (POST /sales) **Risk:** `write` ```ts theme={null} await corsair.dripcel.api.sales.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sales` | `object[]` | Yes | — | > **sales full type** > > ```ts theme={null} > { > _id?: string, > campaign_id: string, > send_id?: string, > click_id?: string, > cell: string, > soldAt?: string, > saleValue?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ## Send ### bulkEmail `send.bulkEmail` Send bulk email via a Dripcel template **Risk:** `write` ```ts theme={null} await corsair.dripcel.api.send.bulkEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | Yes | — | | `template_id` | `string` | Yes | — | | `destinations` | `string[]` | Yes | — | | `filter_non_contacts` | `boolean` | No | — | | `to_start_at` | `string` | No | — | **Output:** *empty object* *** ### sms `send.sms` Send a single SMS via Dripcel **Risk:** `write` ```ts theme={null} await corsair.dripcel.api.send.sms({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | | `cell` | `string` | Yes | — | | `skipNonContacts` | `boolean` | Yes | — | | `country` | `string` | Yes | — | | `deliveryMethod` | `reverse \| standard \| transactional` | Yes | — | | `campaign_id` | `string` | No | — | | `sendOptions` | `object` | No | — | > **sendOptions full type** > > ```ts theme={null} > { > testMode?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `string` | Yes | — | | `totalCost` | `number` | Yes | — | *** ## Send Logs ### search `sendLogs.search` Search Dripcel send logs **Risk:** `read` ```ts theme={null} await corsair.dripcel.api.sendLogs.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `find` | `object` | No | — | | `options` | `object` | No | — | > **find full type** > > ```ts theme={null} > { > campaign_id?: string[], > startDeliveryAt?: { > $gte?: string, > $lte?: string > } > } > ``` > **options full type** > > ```ts theme={null} > { > skip?: number, > limit?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | Yes | — | | `send_logs` | `object[]` | Yes | — | | `parsed` | `object` | No | — | > **send\_logs full type** > > ```ts theme={null} > { > _id?: string, > campaign_id?: string, > message?: string, > triggeredBy?: string, > startDeliveryAt?: string, > destinations?: number | string[] > }[] > ``` > **parsed full type** > > ```ts theme={null} > { > } > ``` *** ## Tags ### delete `tags.delete` Delete a Dripcel tag by ID **Risk:** `destructive` ```ts theme={null} await corsair.dripcel.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `color` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### list `tags.list` List all Dripcel tags **Risk:** `read` ```ts theme={null} await corsair.dripcel.api.tags.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `object[]` | Yes | — | > **tags full type** > > ```ts theme={null} > { > _id?: string, > name?: string, > description?: string, > color?: string, > createdAt?: string, > updatedAt?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/dripcel/database Dripcel local sync: searchable entities, `.search()` filters, and operators. The Dripcel plugin syncs data locally. Use `corsair.dripcel.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Campaigns Path: `dripcel.db.campaigns.search` ```ts theme={null} const rows = await corsair.dripcel.db.campaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `dripcel.db.contacts.search` ```ts theme={null} const rows = await corsair.dripcel.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `cell` | `string` | equals, contains, startsWith, endsWith, in | | `firstname` | `string` | equals, contains, startsWith, endsWith, in | | `lastname` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deliveries Path: `dripcel.db.deliveries.search` ```ts theme={null} const rows = await corsair.dripcel.db.deliveries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `cell` | `string` | equals, contains, startsWith, endsWith, in | | `customerId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Email Templates Path: `dripcel.db.emailTemplates.search` ```ts theme={null} const rows = await corsair.dripcel.db.emailTemplates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Replies Path: `dripcel.db.replies.search` ```ts theme={null} const rows = await corsair.dripcel.db.replies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `Msisdn` | `string` | equals, contains, startsWith, endsWith, in | | `Message` | `string` | equals, contains, startsWith, endsWith, in | | `campaign_id` | `string` | equals, contains, startsWith, endsWith, in | | `UserReference` | `string` | equals, contains, startsWith, endsWith, in | | `Received` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sales Path: `dripcel.db.sales.search` ```ts theme={null} const rows = await corsair.dripcel.db.sales.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `campaign_id` | `string` | equals, contains, startsWith, endsWith, in | | `send_id` | `string` | equals, contains, startsWith, endsWith, in | | `click_id` | `string` | equals, contains, startsWith, endsWith, in | | `cell` | `string` | equals, contains, startsWith, endsWith, in | | `soldAt` | `string` | equals, contains, startsWith, endsWith, in | | `saleValue` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Send Logs Path: `dripcel.db.sendLogs.search` ```ts theme={null} const rows = await corsair.dripcel.db.sendLogs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `campaign_id` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `triggeredBy` | `string` | equals, contains, startsWith, endsWith, in | | `startDeliveryAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `dripcel.db.tags.search` ```ts theme={null} const rows = await corsair.dripcel.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/dripcel/overview SMS marketing platform for campaigns, automations, and two-way customer text messaging. Use **Dripcel** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 18 typed API operations * 8 synced entities (`campaigns`, `contacts`, `deliveries`, `emailTemplates`, `replies`, `sales`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dripcel ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dripcel ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dripcel ``` ```bash bun theme={null} bun add corsair @corsair-dev/dripcel ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dripcel } from '@corsair-dev/dripcel'; export const corsair = createCorsair({ plugins: [ dripcel(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} dripcel() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dripcel', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`balance.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dripcel.api.balance.get({}); ``` **`contacts.addTags`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dripcel.api.contacts.addTags({}); ``` See the full list on the [API](/plugins/dripcel/api) page. ## Query synced data Synced entities support `tenant.dripcel.db..search()` and `.list()`: `campaigns`, `contacts`, `deliveries`, `emailTemplates`, `replies`, `sales`, `sendLogs`, `tags`. See [Database](/plugins/dripcel/database) for filters and operators. ## What's next > **[API reference](/plugins/dripcel/api)** > > Every `dripcel.api.*` operation with input and output types. > **[Database](/plugins/dripcel/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/dropbox/api API reference for Dropbox: every `dropbox.api.*` operation with input and output types. Every `dropbox.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Files ### copy `files.copy` Copy a file to a new location **Risk:** `write` ```ts theme={null} await corsair.dropbox.api.files.copy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_path` | `string` | Yes | — | | `to_path` | `string` | Yes | — | | `allow_shared_folder` | `boolean` | No | — | | `autorename` | `boolean` | No | — | | `allow_ownership_transfer` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > .tag: file, > id: string, > name: string, > path_lower?: string, > path_display?: string, > size?: number, > is_downloadable?: boolean, > server_modified?: string, > client_modified?: string, > rev?: string, > content_hash?: string > } | { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } | { > .tag: deleted, > name: string, > path_lower?: string, > path_display?: string > } > ``` *** ### delete `files.delete` Delete a file **Risk:** `destructive` ```ts theme={null} await corsair.dropbox.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > .tag: file, > id: string, > name: string, > path_lower?: string, > path_display?: string, > size?: number, > is_downloadable?: boolean, > server_modified?: string, > client_modified?: string, > rev?: string, > content_hash?: string > } | { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } | { > .tag: deleted, > name: string, > path_lower?: string, > path_display?: string > } > ``` *** ### download `files.download` Download a file **Risk:** `read` ```ts theme={null} await corsair.dropbox.api.files.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | | `name` | `string` | No | — | | `size` | `number` | No | — | | `path_lower` | `string` | No | — | *** ### move `files.move` Move a file to a new location **Risk:** `write` ```ts theme={null} await corsair.dropbox.api.files.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_path` | `string` | Yes | — | | `to_path` | `string` | Yes | — | | `allow_shared_folder` | `boolean` | No | — | | `autorename` | `boolean` | No | — | | `allow_ownership_transfer` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > .tag: file, > id: string, > name: string, > path_lower?: string, > path_display?: string, > size?: number, > is_downloadable?: boolean, > server_modified?: string, > client_modified?: string, > rev?: string, > content_hash?: string > } | { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } | { > .tag: deleted, > name: string, > path_lower?: string, > path_display?: string > } > ``` *** ### upload `files.upload` Upload a file **Risk:** `write` ```ts theme={null} await corsair.dropbox.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `content` | `string` | Yes | — | | `mode` | `add \| overwrite \| update` | No | — | | `autorename` | `boolean` | No | — | | `mute` | `boolean` | No | — | | `strict_conflict` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `path_lower` | `string` | No | — | | `path_display` | `string` | No | — | | `size` | `number` | No | — | | `is_downloadable` | `boolean` | No | — | | `server_modified` | `string` | No | — | | `client_modified` | `string` | No | — | | `rev` | `string` | No | — | | `content_hash` | `string` | No | — | *** ## Folders ### copy `folders.copy` Copy a folder to a new location **Risk:** `write` ```ts theme={null} await corsair.dropbox.api.folders.copy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_path` | `string` | Yes | — | | `to_path` | `string` | Yes | — | | `allow_shared_folder` | `boolean` | No | — | | `autorename` | `boolean` | No | — | | `allow_ownership_transfer` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > .tag: file, > id: string, > name: string, > path_lower?: string, > path_display?: string, > size?: number, > is_downloadable?: boolean, > server_modified?: string, > client_modified?: string, > rev?: string, > content_hash?: string > } | { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } | { > .tag: deleted, > name: string, > path_lower?: string, > path_display?: string > } > ``` *** ### create `folders.create` Create a new folder **Risk:** `write` ```ts theme={null} await corsair.dropbox.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `autorename` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } > ``` *** ### delete `folders.delete` Delete a folder and all its contents **Risk:** `destructive` ```ts theme={null} await corsair.dropbox.api.folders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > .tag: file, > id: string, > name: string, > path_lower?: string, > path_display?: string, > size?: number, > is_downloadable?: boolean, > server_modified?: string, > client_modified?: string, > rev?: string, > content_hash?: string > } | { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } | { > .tag: deleted, > name: string, > path_lower?: string, > path_display?: string > } > ``` *** ### list `folders.list` List files and folders within a folder **Risk:** `read` ```ts theme={null} await corsair.dropbox.api.folders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `recursive` | `boolean` | No | — | | `include_deleted` | `boolean` | No | — | | `include_mounted_folders` | `boolean` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entries` | `object[]` | Yes | — | | `cursor` | `string` | Yes | — | | `has_more` | `boolean` | Yes | — | > **entries full type** > > ```ts theme={null} > ( > { > .tag: file, > id: string, > name: string, > path_lower?: string, > path_display?: string, > size?: number, > is_downloadable?: boolean, > server_modified?: string, > client_modified?: string, > rev?: string, > content_hash?: string > } | { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } | { > .tag: deleted, > name: string, > path_lower?: string, > path_display?: string > } > )[] > ``` *** ### listContinue `folders.listContinue` Continue listing from a cursor returned by folders.list **Risk:** `read` ```ts theme={null} await corsair.dropbox.api.folders.listContinue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entries` | `object[]` | Yes | — | | `cursor` | `string` | Yes | — | | `has_more` | `boolean` | Yes | — | > **entries full type** > > ```ts theme={null} > ( > { > .tag: file, > id: string, > name: string, > path_lower?: string, > path_display?: string, > size?: number, > is_downloadable?: boolean, > server_modified?: string, > client_modified?: string, > rev?: string, > content_hash?: string > } | { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } | { > .tag: deleted, > name: string, > path_lower?: string, > path_display?: string > } > )[] > ``` *** ### move `folders.move` Move a folder to a new location **Risk:** `write` ```ts theme={null} await corsair.dropbox.api.folders.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_path` | `string` | Yes | — | | `to_path` | `string` | Yes | — | | `allow_shared_folder` | `boolean` | No | — | | `autorename` | `boolean` | No | — | | `allow_ownership_transfer` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > .tag: file, > id: string, > name: string, > path_lower?: string, > path_display?: string, > size?: number, > is_downloadable?: boolean, > server_modified?: string, > client_modified?: string, > rev?: string, > content_hash?: string > } | { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } | { > .tag: deleted, > name: string, > path_lower?: string, > path_display?: string > } > ``` *** ## Search ### query `search.query` Search for files and folders by name or content **Risk:** `read` ```ts theme={null} await corsair.dropbox.api.search.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `path` | `string` | No | — | | `max_results` | `number` | No | — | | `filename_only` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `matches` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `cursor` | `string` | No | — | > **matches full type** > > ```ts theme={null} > { > metadata?: { > metadata: { > .tag: file, > id: string, > name: string, > path_lower?: string, > path_display?: string, > size?: number, > is_downloadable?: boolean, > server_modified?: string, > client_modified?: string, > rev?: string, > content_hash?: string > } | { > .tag: folder, > id: string, > name: string, > path_lower?: string, > path_display?: string > } | { > .tag: deleted, > name: string, > path_lower?: string, > path_display?: string > } > }, > match_type?: { > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/dropbox/database Dropbox local sync: searchable entities, `.search()` filters, and operators. The Dropbox plugin syncs data locally. Use `corsair.dropbox.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Files Path: `dropbox.db.files.search` ```ts theme={null} const rows = await corsair.dropbox.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `path_lower` | `string` | equals, contains, startsWith, endsWith, in | | `path_display` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `is_downloadable` | `boolean` | equals | | `server_modified` | `date` | equals, before, after, between | | `client_modified` | `date` | equals, before, after, between | | `content_hash` | `string` | equals, contains, startsWith, endsWith, in | | `rev` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Folders Path: `dropbox.db.folders.search` ```ts theme={null} const rows = await corsair.dropbox.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `path_lower` | `string` | equals, contains, startsWith, endsWith, in | | `path_display` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/dropbox/get-credentials Step-by-step instructions for obtaining Dropbox OAuth credentials. ## Authentication Method * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 ## OAuth App Setup ### Step 1: Create a Dropbox App 1. Go to the [Dropbox App Console](https://www.dropbox.com/developers/apps) 2. Click **Create app** 3. Choose **Scoped access** and select the access type (Full Dropbox or App folder) 4. Give your app a name 5. Click **Create app** ### Step 2: Configure OAuth Settings 1. In your app settings, go to the **Settings** tab 2. Under **OAuth 2**, add a redirect URI (e.g., `http://localhost:3456/callback`) 3. Copy your **App key** (client ID) and **App secret** (client secret) ### Step 3: Set Required Scopes In the **Permissions** tab, enable the scopes your app needs: * `files.metadata.read` — Read file metadata * `files.content.read` — Read file content * `files.content.write` — Write files ### Step 4: Store Credentials ```bash theme={null} pnpm corsair setup --plugin=dropbox client_id=your-app-key client_secret=your-app-secret ``` ### Step 5: Authorize ```bash theme={null} pnpm corsair auth --plugin=dropbox ``` This opens a browser window to complete the OAuth flow. Tokens are saved automatically. ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | App Key | OAuth flow | Dropbox App Console → Settings | | App Secret | OAuth flow | Dropbox App Console → Settings | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/dropbox/overview Cloud file storage and sync service for sharing documents and collaborating on files. Use **Dropbox** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 12 typed API operations * 2 synced entities (`files`, `folders`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dropbox ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dropbox ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dropbox ``` ```bash bun theme={null} bun add corsair @corsair-dev/dropbox ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dropbox } from '@corsair-dev/dropbox'; export const corsair = createCorsair({ plugins: [ dropbox({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Dropbox** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/dropbox/get-credentials). ```ts theme={null} dropbox({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Dropbox OAuth app. Provider walkthrough: [Get Credentials](/plugins/dropbox/get-credentials). ```ts theme={null} dropbox() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dropbox', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`files.download`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dropbox.api.files.download({}); ``` **`files.copy`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dropbox.api.files.copy({}); ``` See the full list on the [API](/plugins/dropbox/api) page. ## Query synced data Synced entities support `tenant.dropbox.db..search()` and `.list()`: `files`, `folders`. See [Database](/plugins/dropbox/database) for filters and operators. ## Webhooks This plugin registers **1** webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/dropbox/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/dropbox/api)** > > Every `dropbox.api.*` operation with input and output types. > **[Database](/plugins/dropbox/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/dropbox/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/dropbox/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/dropbox/webhooks Dropbox incoming webhooks: event paths, payloads, and response data. The Dropbox plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/dropbox/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `filesystem` * `changed` (`filesystem.changed`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Filesystem ### Changed `filesystem.changed` A file or folder was added, modified, deleted, or a share link was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `delta` | `object` | No | — | | `list_folder` | `object` | No | — | > **delta full type** > > ```ts theme={null} > { > users: number[] > } > ``` > **list\_folder full type** > > ```ts theme={null} > { > accounts: string[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > delta?: { > users: number[] > }, > list_folder?: { > accounts: string[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} dropbox({ webhookHooks: { filesystem: { changed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/dropboxsign/api API reference for Dropbox Sign: every `dropboxsign.api.*` operation with input and output types. Every `dropboxsign.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### create `account.create` Creates a new Dropbox Sign account **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.account.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_address` | `string` | Yes | — | | `client_id` | `string` | No | — | | `client_secret` | `string` | No | — | | `locale` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **account full type** > > ```ts theme={null} > { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### get `account.get` Retrieves detailed information about a Dropbox Sign account **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.account.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `email_address` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **account full type** > > ```ts theme={null} > { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### update `account.update` Updates Dropbox Sign account settings **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.account.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `callback_url` | `string` | No | — | | `locale` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **account full type** > > ```ts theme={null} > { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### verify `account.verify` Verifies whether a Dropbox Sign account exists **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.account.verify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_address` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `account` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **account full type** > > ```ts theme={null} > { > email_address: string > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ## Api Apps ### authorize `apiApps.authorize` Generates OAuth authorization URL **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.apiApps.authorize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `string` | Yes | — | | `response_type` | `string` | Yes | — | | `state` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | *** ### create `apiApps.create` Creates a new API App **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.apiApps.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `domains` | `string[]` | No | — | | `callback_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `api_app` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **api\_app full type** > > ```ts theme={null} > { > client_id?: string, > name?: string, > domain?: string | null, > callback_url?: string | null, > is_approved?: boolean, > created_at?: number > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### delete `apiApps.delete` Deletes an API App **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.apiApps.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `string` | Yes | — | **Output:** *empty object* *** ### get `apiApps.get` Retrieves API App details **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.apiApps.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `api_app` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **api\_app full type** > > ```ts theme={null} > { > client_id?: string, > name?: string, > domain?: string | null, > callback_url?: string | null, > is_approved?: boolean, > created_at?: number > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### list `apiApps.list` Lists API Apps **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.apiApps.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `api_apps` | `object[]` | Yes | — | | `list_info` | `object` | No | — | > **api\_apps full type** > > ```ts theme={null} > { > client_id?: string, > name?: string, > domain?: string | null, > callback_url?: string | null, > is_approved?: boolean, > created_at?: number > }[] > ``` > **list\_info full type** > > ```ts theme={null} > { > page?: number, > num_pages?: number, > num_results?: number, > page_size?: number > } > ``` *** ### update `apiApps.update` Updates an existing API App **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.apiApps.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `string` | Yes | — | | `name` | `string` | No | — | | `domains` | `string[]` | No | — | | `callback_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `api_app` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **api\_app full type** > > ```ts theme={null} > { > client_id?: string, > name?: string, > domain?: string | null, > callback_url?: string | null, > is_approved?: boolean, > created_at?: number > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ## Bulk Send ### createEmbeddedWithTemplate `bulkSend.createEmbeddedWithTemplate` Bulk creates embedded signature requests with template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.bulkSend.createEmbeddedWithTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `string` | Yes | — | | `template_ids` | `string[]` | Yes | — | | `signer_file` | `string` | No | — | | `signer_list` | `object[]` | No | — | > **signer\_list full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulk_send_job` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **bulk\_send\_job full type** > > ```ts theme={null} > { > bulk_send_job_id?: string, > total?: number, > is_creator?: boolean, > created_at?: number > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### getJob `bulkSend.getJob` Gets bulk send job status **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.bulkSend.getJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulk_send_job_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulk_send_job` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **bulk\_send\_job full type** > > ```ts theme={null} > { > bulk_send_job_id?: string, > total?: number, > is_creator?: boolean, > created_at?: number > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### listJobs `bulkSend.listJobs` Lists bulk send jobs **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.bulkSend.listJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulk_send_jobs` | `object[]` | Yes | — | | `list_info` | `object` | No | — | > **bulk\_send\_jobs full type** > > ```ts theme={null} > { > bulk_send_job_id?: string, > total?: number, > is_creator?: boolean, > created_at?: number > }[] > ``` > **list\_info full type** > > ```ts theme={null} > { > page?: number, > num_pages?: number, > num_results?: number, > page_size?: number > } > ``` *** ### sendWithTemplate `bulkSend.sendWithTemplate` Bulk sends signature requests with template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.bulkSend.sendWithTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_ids` | `string[]` | Yes | — | | `signer_list` | `object[]` | No | — | | `title` | `string` | No | — | > **signer\_list full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulk_send_job` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **bulk\_send\_job full type** > > ```ts theme={null} > { > bulk_send_job_id?: string, > total?: number, > is_creator?: boolean, > created_at?: number > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ## Drafts ### createEmbeddedUnclaimedWithTemplate `drafts.createEmbeddedUnclaimedWithTemplate` Creates embedded unclaimed draft with template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.drafts.createEmbeddedUnclaimedWithTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `string` | Yes | — | | `template_ids` | `string[]` | Yes | — | | `signers` | `object[]` | No | — | | `requester_email_address` | `string` | No | — | > **signers full type** > > ```ts theme={null} > { > email_address?: string, > name?: string, > role?: string, > order?: number > }[] > ``` **Output:** *empty object* *** ### createUnclaimed `drafts.createUnclaimed` Creates an unclaimed draft **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.drafts.createUnclaimed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `send_document \| request_signature` | No | — | | `files` | `string[]` | No | — | | `file_urls` | `string[]` | No | — | | `signers` | `object[]` | No | — | > **signers full type** > > ```ts theme={null} > { > email_address?: string, > name?: string, > role?: string, > order?: number > }[] > ``` **Output:** *empty object* *** ### editAndResendUnclaimed `drafts.editAndResendUnclaimed` Edits and resends an unclaimed draft **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.drafts.editAndResendUnclaimed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | | `client_id` | `string` | Yes | — | | `test_mode` | `boolean` | No | — | **Output:** *empty object* *** ## Embedded ### getSignUrl `embedded.getSignUrl` Gets embedded signing URL **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.embedded.getSignUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `embedded` | `object` | Yes | — | > **embedded full type** > > ```ts theme={null} > { > sign_url?: string, > expires_at?: number > } > ``` *** ### getTemplateEditUrl `embedded.getTemplateEditUrl` Gets embedded template edit URL **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.embedded.getTemplateEditUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | | `force_signer_roles` | `boolean` | No | — | | `force_subject_message` | `boolean` | No | — | | `test_mode` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `embedded` | `object` | Yes | — | > **embedded full type** > > ```ts theme={null} > { > edit_url?: string, > expires_at?: number > } > ``` *** ## Fax And Reports ### createReport `faxAndReports.createReport` Requests CSV report generation **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.faxAndReports.createReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `report_type` | `user_activity \| document_status \| sms_activity \| fax_usage[]` | Yes | — | | `start_date` | `string` | Yes | — | | `end_date` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `report` | `object` | Yes | — | > **report full type** > > ```ts theme={null} > { > success?: string, > start_date?: string, > end_date?: string, > report_type?: string[] > } > ``` *** ### deleteFax `faxAndReports.deleteFax` Deletes a fax **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.faxAndReports.deleteFax({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fax_id` | `string` | Yes | — | **Output:** *empty object* *** ### getAreaCodes `faxAndReports.getAreaCodes` Gets available fax line area codes **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.faxAndReports.getAreaCodes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `state` | `string` | No | — | | `city` | `string` | No | — | **Output:** *empty object* *** ### listFaxes `faxAndReports.listFaxes` Lists faxes **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.faxAndReports.listFaxes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `faxes` | `object[]` | Yes | — | | `list_info` | `object` | No | — | > **faxes full type** > > ```ts theme={null} > { > fax_id?: string, > title?: string, > original_title?: string, > message?: string | null, > created_at?: number, > sender?: string, > files_url?: string, > transmissions?: { > }[] > }[] > ``` > **list\_info full type** > > ```ts theme={null} > { > page?: number, > num_pages?: number, > num_results?: number, > page_size?: number > } > ``` *** ### listFaxLines `faxAndReports.listFaxLines` Lists fax lines **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.faxAndReports.listFaxLines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output:** *empty object* *** ## Signature Requests ### cancel `signatureRequests.cancel` Cancels an incomplete signature request **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | **Output:** *empty object* *** ### createEmbedded `signatureRequests.createEmbedded` Creates an embedded signature request **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.createEmbedded({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `string` | Yes | — | | `title` | `string` | No | — | | `subject` | `string` | No | — | | `message` | `string` | No | — | | `signers` | `object[]` | No | — | | `files` | `string[]` | No | — | | `file_urls` | `string[]` | No | — | | `test_mode` | `boolean` | No | — | > **signers full type** > > ```ts theme={null} > { > email_address?: string, > name?: string, > role?: string, > order?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### createEmbeddedWithTemplate `signatureRequests.createEmbeddedWithTemplate` Creates an embedded signature request with template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.createEmbeddedWithTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `string` | Yes | — | | `template_ids` | `string[]` | Yes | — | | `title` | `string` | No | — | | `subject` | `string` | No | — | | `message` | `string` | No | — | | `signers` | `object[]` | No | — | | `test_mode` | `boolean` | No | — | > **signers full type** > > ```ts theme={null} > { > email_address?: string, > name?: string, > role?: string, > order?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### downloadFiles `signatureRequests.downloadFiles` Downloads signature request files **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.downloadFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | | `file_type` | `pdf \| zip` | No | — | **Output:** *empty object* *** ### editAndResend `signatureRequests.editAndResend` Edits and resends a signature request **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.editAndResend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | | `title` | `string` | No | — | | `subject` | `string` | No | — | | `message` | `string` | No | — | | `signers` | `object[]` | No | — | | `files` | `string[]` | No | — | | `file_urls` | `string[]` | No | — | > **signers full type** > > ```ts theme={null} > { > email_address?: string, > name?: string, > role?: string, > order?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### editAndResendEmbedded `signatureRequests.editAndResendEmbedded` Edits and resends an embedded signature request **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.editAndResendEmbedded({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | | `client_id` | `string` | No | — | | `title` | `string` | No | — | | `signers` | `object[]` | No | — | > **signers full type** > > ```ts theme={null} > { > email_address?: string, > name?: string, > role?: string, > order?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### editAndResendEmbeddedTemplate `signatureRequests.editAndResendEmbeddedTemplate` Edits and resends an embedded signature request with template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.editAndResendEmbeddedTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | | `client_id` | `string` | No | — | | `template_ids` | `string[]` | No | — | | `signers` | `object[]` | No | — | > **signers full type** > > ```ts theme={null} > { > email_address?: string, > name?: string, > role?: string, > order?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### get `signatureRequests.get` Retrieves details of a signature request **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### getFilesAsDataUri `signatureRequests.getFilesAsDataUri` Gets signature request files as Data URI **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.getFilesAsDataUri({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data_uri` | `string` | No | — | *** ### getFilesAsFileUrl `signatureRequests.getFilesAsFileUrl` Gets temporary file URL for signature request **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.getFilesAsFileUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_url` | `string` | No | — | | `expires_at` | `number` | No | — | *** ### list `signatureRequests.list` Lists signature requests **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_requests` | `object[]` | Yes | — | | `list_info` | `object` | No | — | | `warnings` | `object[]` | No | — | > **signature\_requests full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > }[] > ``` > **list\_info full type** > > ```ts theme={null} > { > page?: number, > num_pages?: number, > num_results?: number, > page_size?: number > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### releaseHold `signatureRequests.releaseHold` Releases a held signature request **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.releaseHold({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### remind `signatureRequests.remind` Sends a reminder to a signer **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.remind({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | | `email_address` | `string` | Yes | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### send `signatureRequests.send` Sends a signature request **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `subject` | `string` | No | — | | `message` | `string` | No | — | | `signers` | `object[]` | No | — | | `files` | `string[]` | No | — | | `file_urls` | `string[]` | No | — | | `test_mode` | `boolean` | No | — | > **signers full type** > > ```ts theme={null} > { > email_address?: string, > name?: string, > role?: string, > order?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### update `signatureRequests.update` Updates signer contact information on signature request **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.signatureRequests.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `signature_request_id` | `string` | Yes | — | | `signature_id` | `string` | No | — | | `email_address` | `string` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `signature_request` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **signature\_request full type** > > ```ts theme={null} > { > signature_request_id?: string, > title?: string, > original_title?: string, > subject?: string, > message?: string, > is_complete?: boolean, > is_declined?: boolean, > has_error?: boolean, > files_url?: string, > details_url?: string, > signing_url?: string | null, > created_at?: number, > signatures?: { > signature_id?: string, > signer_email_address?: string, > signer_name?: string, > signer_role?: string | null, > order?: number | null, > status_code?: string, > signed_at?: number | null, > last_viewed_at?: number | null, > last_reminded_at?: number | null, > has_pin?: boolean > }[], > template_ids?: string[] | null > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ## Teams ### addMember `teams.addMember` Invites or adds a user to team **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.teams.addMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `email_address` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `team` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **team full type** > > ```ts theme={null} > { > name?: string, > team_id?: string, > num_members?: number, > num_sub_teams?: number, > accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_emails?: string[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### getCurrent `teams.getCurrent` Gets current team membership **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.teams.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `team` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **team full type** > > ```ts theme={null} > { > name?: string, > team_id?: string, > num_members?: number, > num_sub_teams?: number, > accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_emails?: string[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### getInfo `teams.getInfo` Retrieves team details **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.teams.getInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `team` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **team full type** > > ```ts theme={null} > { > name?: string, > team_id?: string, > num_members?: number, > num_sub_teams?: number, > accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_emails?: string[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### list `teams.list` Lists all accessible teams **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `team` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **team full type** > > ```ts theme={null} > { > name?: string, > team_id?: string, > num_members?: number, > num_sub_teams?: number, > accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_emails?: string[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### listMembers `teams.listMembers` Lists team members **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.teams.listMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `team_members` | `object[]` | Yes | — | | `list_info` | `object` | No | — | > **team\_members full type** > > ```ts theme={null} > { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[] > ``` > **list\_info full type** > > ```ts theme={null} > { > page?: number, > num_pages?: number, > num_results?: number, > page_size?: number > } > ``` *** ### listSubTeams `teams.listSubTeams` Lists sub-teams for a team **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.teams.listSubTeams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `teams` | `object[]` | Yes | — | | `list_info` | `object` | No | — | > **teams full type** > > ```ts theme={null} > { > name?: string, > team_id?: string, > num_members?: number, > num_sub_teams?: number, > accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_accounts?: { > account_id?: string, > email_address?: string, > is_locked?: boolean, > is_paid_hs?: boolean, > is_paid_hf?: boolean, > quotas?: { > api_signature_requests_left?: number | null, > documents_left?: number | null, > templates_total?: number | null, > templates_left?: number | null, > sms_verifications_left?: number | null, > num_fax_pages_left?: number | null > }, > callback_url?: string | null, > role_code?: string | null, > team_id?: string | null, > locale?: string | null > }[], > invited_emails?: string[] > }[] > ``` > **list\_info full type** > > ```ts theme={null} > { > page?: number, > num_pages?: number, > num_results?: number, > page_size?: number > } > ``` *** ## Templates ### addUser `templates.addUser` Adds user access to template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.templates.addUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | | `account_id` | `string` | No | — | | `email_address` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **template full type** > > ```ts theme={null} > { > template_id?: string, > title?: string, > message?: string, > updated_at?: number, > is_creator?: boolean, > is_embedded?: boolean, > can_edit?: boolean, > is_locked?: boolean, > signer_roles?: { > name?: string, > order?: number | null > }[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### create `templates.create` Creates a reusable template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.templates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `subject` | `string` | No | — | | `message` | `string` | No | — | | `signer_roles` | `object[]` | No | — | | `files` | `string[]` | No | — | | `file_urls` | `string[]` | No | — | > **signer\_roles full type** > > ```ts theme={null} > { > name: string, > order?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `template` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **template full type** > > ```ts theme={null} > { > template_id?: string, > title?: string, > message?: string, > updated_at?: number, > is_creator?: boolean, > is_embedded?: boolean, > can_edit?: boolean, > is_locked?: boolean, > signer_roles?: { > name?: string, > order?: number | null > }[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### createEmbeddedDraft `templates.createEmbeddedDraft` Creates an embedded template draft **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.templates.createEmbeddedDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `string` | Yes | — | | `title` | `string` | No | — | | `signer_roles` | `object[]` | No | — | | `files` | `string[]` | No | — | | `test_mode` | `boolean` | No | — | > **signer\_roles full type** > > ```ts theme={null} > { > name: string, > order?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `template` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **template full type** > > ```ts theme={null} > { > template_id?: string, > title?: string, > message?: string, > updated_at?: number, > is_creator?: boolean, > is_embedded?: boolean, > can_edit?: boolean, > is_locked?: boolean, > signer_roles?: { > name?: string, > order?: number | null > }[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### delete `templates.delete` Deletes a template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.templates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | **Output:** *empty object* *** ### get `templates.get` Retrieves a template by ID **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.templates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **template full type** > > ```ts theme={null} > { > template_id?: string, > title?: string, > message?: string, > updated_at?: number, > is_creator?: boolean, > is_embedded?: boolean, > can_edit?: boolean, > is_locked?: boolean, > signer_roles?: { > name?: string, > order?: number | null > }[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### getFiles `templates.getFiles` Downloads template documents **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.templates.getFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | | `file_type` | `pdf \| zip` | No | — | **Output:** *empty object* *** ### getFilesAsDataUri `templates.getFilesAsDataUri` Gets template files as Data URI **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.templates.getFilesAsDataUri({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data_uri` | `string` | No | — | *** ### getFilesAsFileUrl `templates.getFilesAsFileUrl` Gets template files as URL **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.templates.getFilesAsFileUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_url` | `string` | No | — | | `expires_at` | `number` | No | — | *** ### list `templates.list` Lists templates **Risk:** `read` ```ts theme={null} await corsair.dropboxsign.api.templates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `templates` | `object[]` | Yes | — | | `list_info` | `object` | No | — | | `warnings` | `object[]` | No | — | > **templates full type** > > ```ts theme={null} > { > template_id?: string, > title?: string, > message?: string, > updated_at?: number, > is_creator?: boolean, > is_embedded?: boolean, > can_edit?: boolean, > is_locked?: boolean, > signer_roles?: { > name?: string, > order?: number | null > }[] > }[] > ``` > **list\_info full type** > > ```ts theme={null} > { > page?: number, > num_pages?: number, > num_results?: number, > page_size?: number > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### removeUser `templates.removeUser` Removes user access from template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.templates.removeUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | | `account_id` | `string` | No | — | | `email_address` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **template full type** > > ```ts theme={null} > { > template_id?: string, > title?: string, > message?: string, > updated_at?: number, > is_creator?: boolean, > is_embedded?: boolean, > can_edit?: boolean, > is_locked?: boolean, > signer_roles?: { > name?: string, > order?: number | null > }[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** ### updateFiles `templates.updateFiles` Updates files for a template **Risk:** `write` ```ts theme={null} await corsair.dropboxsign.api.templates.updateFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | | `files` | `string[]` | No | — | | `file_urls` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `template` | `object` | Yes | — | | `warnings` | `object[]` | No | — | > **template full type** > > ```ts theme={null} > { > template_id?: string, > title?: string, > message?: string, > updated_at?: number, > is_creator?: boolean, > is_embedded?: boolean, > can_edit?: boolean, > is_locked?: boolean, > signer_roles?: { > name?: string, > order?: number | null > }[] > } > ``` > **warnings full type** > > ```ts theme={null} > { > warning_msg: string, > warning_name: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/dropboxsign/database Dropbox Sign local sync: searchable entities, `.search()` filters, and operators. The Dropbox Sign plugin syncs data locally. Use `corsair.dropboxsign.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Account Path: `dropboxsign.db.account.search` ```ts theme={null} const rows = await corsair.dropboxsign.db.account.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `account_id` | `string` | equals, contains, startsWith, endsWith, in | | `email_address` | `string` | equals, contains, startsWith, endsWith, in | | `is_locked` | `boolean` | equals | | `is_paid_hs` | `boolean` | equals | | `is_paid_hf` | `boolean` | equals | | `callback_url` | `string` | equals, contains, startsWith, endsWith, in | | `role_code` | `string` | equals, contains, startsWith, endsWith, in | | `team_id` | `string` | equals, contains, startsWith, endsWith, in | | `locale` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Api App Path: `dropboxsign.db.apiApp.search` ```ts theme={null} const rows = await corsair.dropboxsign.db.apiApp.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `client_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `callback_url` | `string` | equals, contains, startsWith, endsWith, in | | `is_approved` | `boolean` | equals | | `created_at` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Bulk Send Job Path: `dropboxsign.db.bulkSendJob.search` ```ts theme={null} const rows = await corsair.dropboxsign.db.bulkSendJob.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `bulk_send_job_id` | `string` | equals, contains, startsWith, endsWith, in | | `total` | `number` | equals, gt, gte, lt, lte, in | | `is_creator` | `boolean` | equals | | `created_at` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Fax Path: `dropboxsign.db.fax.search` ```ts theme={null} const rows = await corsair.dropboxsign.db.fax.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `fax_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `original_title` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `sender` | `string` | equals, contains, startsWith, endsWith, in | | `files_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Signature Request Path: `dropboxsign.db.signatureRequest.search` ```ts theme={null} const rows = await corsair.dropboxsign.db.signatureRequest.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `signature_request_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `original_title` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `is_complete` | `boolean` | equals | | `is_declined` | `boolean` | equals | | `has_error` | `boolean` | equals | | `files_url` | `string` | equals, contains, startsWith, endsWith, in | | `details_url` | `string` | equals, contains, startsWith, endsWith, in | | `signing_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Team Path: `dropboxsign.db.team.search` ```ts theme={null} const rows = await corsair.dropboxsign.db.team.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `team_id` | `string` | equals, contains, startsWith, endsWith, in | | `num_members` | `number` | equals, gt, gte, lt, lte, in | | `num_sub_teams` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Template Path: `dropboxsign.db.template.search` ```ts theme={null} const rows = await corsair.dropboxsign.db.template.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `template_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `number` | equals, gt, gte, lt, lte, in | | `is_creator` | `boolean` | equals | | `is_embedded` | `boolean` | equals | | `can_edit` | `boolean` | equals | | `is_locked` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/dropboxsign/overview E-signature platform for sending, signing, and tracking legally binding document agreements. Use **Dropbox Sign** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 56 typed API operations * 7 synced entities (`account`, `apiApp`, `bulkSendJob`, `fax`, `signatureRequest`, `team`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dropboxsign ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dropboxsign ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dropboxsign ``` ```bash bun theme={null} bun add corsair @corsair-dev/dropboxsign ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dropboxsign } from '@corsair-dev/dropboxsign'; export const corsair = createCorsair({ plugins: [ dropboxsign(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} dropboxsign() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Dropbox Sign OAuth app. ```ts theme={null} dropboxsign({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dropboxsign', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dropboxsign.api.account.get({}); ``` **`account.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dropboxsign.api.account.create({}); ``` See the full list on the [API](/plugins/dropboxsign/api) page. ## Query synced data Synced entities support `tenant.dropboxsign.db..search()` and `.list()`: `account`, `apiApp`, `bulkSendJob`, `fax`, `signatureRequest`, `team`, `template`. See [Database](/plugins/dropboxsign/database) for filters and operators. ## What's next > **[API reference](/plugins/dropboxsign/api)** > > Every `dropboxsign.api.*` operation with input and output types. > **[Database](/plugins/dropboxsign/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/dynapictures/api API reference for Dynapictures: every `dynapictures.api.*` operation with input and output types. Every `dynapictures.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Media ### upload `media.upload` Upload an image and create a media asset in a workspace **Risk:** `write` ```ts theme={null} await corsair.dynapictures.api.media.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | The ID of a workspace to upload an image to. | | `fileUrl` | `string` | Yes | Public URL of the image uploaded as the official file field. | | `filename` | `string` | No | Filename of uploaded image. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of an asset. | | `folder` | `boolean` | Yes | Whether this asset is a folder instead of an image. | | `mimeType` | `string` | Yes | MIME type of an image. | | `filename` | `string` | Yes | Filename of an image. | | `size` | `number` | Yes | Image size in bytes. | | `animated` | `boolean` | No | — | | `url` | `string` | Yes | Link to an image. | | `thumbnailUrl` | `string` | Yes | Link to an image thumbnail. | | `dateCreated` | `string` | Yes | Creation date of an asset. | | `dateUpdated` | `string` | Yes | Last modification date of an asset. | *** ## Templates ### list `templates.list` Get image templates that are ready and have Sync to Zapier enabled **Risk:** `read` ```ts theme={null} await corsair.dynapictures.api.templates.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > thumbnail: string, > dateCreated: string, > dateUpdated: string, > layers?: { > type: string, > name: string, > width?: string, > height?: string, > text?: string | null > }[] > }[] > ``` *** ## Webhooks ### unsubscribe `webhooks.unsubscribe` Unsubscribe from webhook notifications using the original subscribe fields **Risk:** `write` ```ts theme={null} await corsair.dynapictures.api.webhooks.unsubscribe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `targetUrl` | `string` | Yes | The URL of the REST endpoint receiving notifications. | | `eventType` | `NEW_IMAGE` | Yes | Event type passed when subscribing this webhook. | | `templateId` | `string` | Yes | The UID of the image template used when subscribing. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | Yes | — | *** ## Workspaces ### create `workspaces.create` Create a new workspace for templates, images, and media **Risk:** `write` ```ts theme={null} await corsair.dynapictures.api.workspaces.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of a new workspace. Required field. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of a workspace. | | `name` | `string` | Yes | The name of a workspace. | | `dateCreated` | `string` | Yes | Creation date of a workspace. | | `dateUpdated` | `string` | Yes | Last modification date of a workspace. | | `memberRole` | `string` | No | — | *** ### delete `workspaces.delete` Permanently delete a workspace and all associated templates, media, and images **Risk:** `destructive` ```ts theme={null} await corsair.dynapictures.api.workspaces.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of a workspace to be deleted. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of a workspace. | | `name` | `string` | Yes | The name of a workspace. | | `dateCreated` | `string` | Yes | Creation date of a workspace. | | `dateUpdated` | `string` | Yes | Last modification date of a workspace. | | `memberRole` | `string` | No | — | *** ### list `workspaces.list` Get all workspaces the authenticated user is a member of **Risk:** `read` ```ts theme={null} await corsair.dynapictures.api.workspaces.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > dateCreated: string, > dateUpdated: string, > memberRole?: string | null > }[] > ``` *** ### update `workspaces.update` Update an existing workspace name by workspace ID **Risk:** `write` ```ts theme={null} await corsair.dynapictures.api.workspaces.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of a workspace to be updated. | | `name` | `string` | Yes | New name of a workspace. Required field. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of a workspace. | | `name` | `string` | Yes | The name of a workspace. | | `dateCreated` | `string` | Yes | Creation date of a workspace. | | `dateUpdated` | `string` | Yes | Last modification date of a workspace. | | `memberRole` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/dynapictures/database Dynapictures local sync: searchable entities, `.search()` filters, and operators. The Dynapictures plugin syncs data locally. Use `corsair.dynapictures.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Media Path: `dynapictures.db.media.search` ```ts theme={null} const rows = await corsair.dynapictures.db.media.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `folder` | `boolean` | equals | | `mimeType` | `string` | equals, contains, startsWith, endsWith, in | | `filename` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `animated` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnailUrl` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `string` | equals, contains, startsWith, endsWith, in | | `dateUpdated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `dynapictures.db.templates.search` ```ts theme={null} const rows = await corsair.dynapictures.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnail` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `string` | equals, contains, startsWith, endsWith, in | | `dateUpdated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `dynapictures.db.webhooks.search` ```ts theme={null} const rows = await corsair.dynapictures.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uid` | `string` | equals, contains, startsWith, endsWith, in | | `eventType` | `string` | equals, contains, startsWith, endsWith, in | | `targetUrl` | `string` | equals, contains, startsWith, endsWith, in | | `designUid` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `dynapictures.db.workspaces.search` ```ts theme={null} const rows = await corsair.dynapictures.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `string` | equals, contains, startsWith, endsWith, in | | `dateUpdated` | `string` | equals, contains, startsWith, endsWith, in | | `memberRole` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/dynapictures/overview Dynamic image generation API for personalized visuals, banners, and automated creatives. Use **Dynapictures** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 7 typed API operations * 4 synced entities (`media`, `templates`, `webhooks`, `workspaces`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/dynapictures ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/dynapictures ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/dynapictures ``` ```bash bun theme={null} bun add corsair @corsair-dev/dynapictures ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { dynapictures } from '@corsair-dev/dynapictures'; export const corsair = createCorsair({ plugins: [ dynapictures(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} dynapictures() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'dynapictures', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`templates.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dynapictures.api.templates.list({}); ``` **`media.upload`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.dynapictures.api.media.upload({}); ``` See the full list on the [API](/plugins/dynapictures/api) page. ## Query synced data Synced entities support `tenant.dynapictures.db..search()` and `.list()`: `media`, `templates`, `webhooks`, `workspaces`. See [Database](/plugins/dynapictures/database) for filters and operators. ## What's next > **[API reference](/plugins/dynapictures/api)** > > Every `dynapictures.api.*` operation with input and output types. > **[Database](/plugins/dynapictures/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/emelia/api API reference for Emelia: every `emelia.api.*` operation with input and output types. Every `emelia.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### me `account.me` Retrieve authenticated Emelia account details **Risk:** `read` ```ts theme={null} await corsair.emelia.api.account.me({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `me` | `object` | No | — | > **me full type** > > ```ts theme={null} > { > uid?: string, > name?: string, > email?: string, > showMailbox?: boolean, > picture?: string, > due_invoice?: boolean, > joinedDate?: string > } > ``` *** ## Blacklist ### add `blacklist.add` Add a contact to the email blacklist **Risk:** `write` ```ts theme={null} await corsair.emelia.api.blacklist.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### remove `blacklist.remove` Remove a contact from the email blacklist **Risk:** `destructive` ```ts theme={null} await corsair.emelia.api.blacklist.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ## Campaigns ### addContact `campaigns.addContact` Add a contact to a campaign **Risk:** `write` ```ts theme={null} await corsair.emelia.api.campaigns.addContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `contact` | `object` | Yes | — | > **contact full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `addContactToCampaignHook` | `any` | No | — | *** ### list `campaigns.list` List all cold outreach campaigns **Risk:** `read` ```ts theme={null} await corsair.emelia.api.campaigns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `all_campaigns` | `object[]` | No | — | > **all\_campaigns full type** > > ```ts theme={null} > { > _id: string, > name?: string, > status?: string, > createdAt?: string, > provider?: string, > useManyProviders?: boolean, > plannedStart?: string > }[] > ``` *** ### removeContact `campaigns.removeContact` Remove a contact from a campaign **Risk:** `destructive` ```ts theme={null} await corsair.emelia.api.campaigns.removeContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `removeOneContactFromCampaign` | `any` | No | — | *** ## Contacts ### addToList `contacts.addToList` Add a contact to a contact list **Risk:** `write` ```ts theme={null} await corsair.emelia.api.contacts.addToList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `contact` | `object` | Yes | — | > **contact full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `addContactsToListHook` | `any` | No | — | *** ### listLists `contacts.listLists` List all contact lists **Risk:** `read` ```ts theme={null} await corsair.emelia.api.contacts.listLists({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact_lists` | `object[]` | No | — | > **contact\_lists full type** > > ```ts theme={null} > { > _id: string, > name?: string, > contactCount?: number, > fields?: string[], > usedInCampaign?: boolean > }[] > ``` *** ## Email Campaigns ### addContact `emailCampaigns.addContact` Add a contact to an email campaign (legacy REST) **Risk:** `write` ```ts theme={null} await corsair.emelia.api.emailCampaigns.addContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | Yes | — | | `contact` | `object` | Yes | — | > **contact full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### deleteContact `emailCampaigns.deleteContact` Remove a contact from an email campaign **Risk:** `destructive` ```ts theme={null} await corsair.emelia.api.emailCampaigns.deleteContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | Yes | — | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### listContacts `emailCampaigns.listContacts` List contacts in an email campaign **Risk:** `read` ```ts theme={null} await corsair.emelia.api.emailCampaigns.listContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > email?: string, > firstName?: string, > lastName?: string, > status?: string > }[] | { > contacts?: { > id?: string, > email?: string, > firstName?: string, > lastName?: string, > status?: string > }[], > data?: { > id?: string, > email?: string, > firstName?: string, > lastName?: string, > status?: string > }[], > total?: number > } > ``` *** ## Linkedin ### createCampaign `linkedin.createCampaign` Create a new LinkedIn campaign **Risk:** `write` ```ts theme={null} await corsair.emelia.api.linkedin.createCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | | `campaignId` | `string` | No | — | | `id` | `string` | No | — | | `name` | `string` | No | — | *** ### deleteContact `linkedin.deleteContact` Delete a contact from a LinkedIn campaign **Risk:** `destructive` ```ts theme={null} await corsair.emelia.api.linkedin.deleteContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | No | — | | `contactUrl` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### getActivities `linkedin.getActivities` Retrieve activities for a LinkedIn campaign **Risk:** `read` ```ts theme={null} await corsair.emelia.api.linkedin.getActivities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > type?: string, > event?: string, > date?: string, > step?: number > }[] | { > activities?: { > id?: string, > type?: string, > event?: string, > date?: string, > step?: number > }[], > data?: { > id?: string, > type?: string, > event?: string, > date?: string, > step?: number > }[], > total?: number > } > ``` *** ### listCampaigns `linkedin.listCampaigns` List all LinkedIn campaigns **Risk:** `read` ```ts theme={null} await corsair.emelia.api.linkedin.listCampaigns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > campaignId?: string, > name?: string, > status?: string > }[] | { > campaigns?: { > id?: string, > campaignId?: string, > name?: string, > status?: string > }[], > data?: { > id?: string, > campaignId?: string, > name?: string, > status?: string > }[], > total?: number > } > ``` *** ## Providers ### list `providers.list` List all configured email providers **Risk:** `read` ```ts theme={null} await corsair.emelia.api.providers.list({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > email?: string, > type?: string, > status?: string > }[] | { > providers?: { > id?: string, > name?: string, > email?: string, > type?: string, > status?: string > }[], > data?: { > id?: string, > name?: string, > email?: string, > type?: string, > status?: string > }[] > } > ``` *** ## Rest Campaigns ### create `restCampaigns.create` Create a new email campaign (REST) **Risk:** `write` ```ts theme={null} await corsair.emelia.api.restCampaigns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | | `campaignId` | `string` | No | — | | `id` | `string` | No | — | | `name` | `string` | No | — | *** ### getActivities `restCampaigns.getActivities` Retrieve activities for an email campaign **Risk:** `read` ```ts theme={null} await corsair.emelia.api.restCampaigns.getActivities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > type?: string, > event?: string, > date?: string, > step?: number > }[] | { > activities?: { > id?: string, > type?: string, > event?: string, > date?: string, > step?: number > }[], > data?: { > id?: string, > type?: string, > event?: string, > date?: string, > step?: number > }[], > total?: number > } > ``` *** ### list `restCampaigns.list` List all email campaigns (REST) **Risk:** `read` ```ts theme={null} await corsair.emelia.api.restCampaigns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > campaignId?: string, > name?: string, > status?: string > }[] | { > campaigns?: { > id?: string, > campaignId?: string, > name?: string, > status?: string > }[], > data?: { > id?: string, > campaignId?: string, > name?: string, > status?: string > }[], > total?: number, > page?: number, > limit?: number > } > ``` *** ## Tools ### findEmailSingle `tools.findEmailSingle` Initiate a find-email job for a single contact **Risk:** `write` ```ts theme={null} await corsair.emelia.api.tools.findEmailSingle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fullname` | `string` | Yes | — | | `companyName` | `string` | Yes | — | | `companyWebsite` | `string` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `jobId` | `string` | Yes | — | *** ### findPhoneSingle `tools.findPhoneSingle` Initiate a phone-find job for a single contact **Risk:** `write` ```ts theme={null} await corsair.emelia.api.tools.findPhoneSingle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `linkedinUrl` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `jobId` | `string` | Yes | — | *** ### getFindEmailResult `tools.getFindEmailResult` Retrieve the result of a find-email job **Risk:** `read` ```ts theme={null} await corsair.emelia.api.tools.getFindEmailResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > fullname?: string, > companyName?: string, > companyWebsite?: string, > email: string, > qualification?: valid | invalid, > status: running | done | error, > date?: string > } > ``` *** ### getFindPhoneResult `tools.getFindPhoneResult` Retrieve the result of a phone-find job **Risk:** `read` ```ts theme={null} await corsair.emelia.api.tools.getFindPhoneResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > linkedinUrl: string, > phoneNumber?: string, > country?: string, > qualification?: found | not_found, > status: running | done | error, > date?: string > } > ``` *** ### getVerifyEmailResult `tools.getVerifyEmailResult` Retrieve the result of an email verification job **Risk:** `read` ```ts theme={null} await corsair.emelia.api.tools.getVerifyEmailResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email: string, > qualification?: valid | invalid, > status: running | done | error, > date?: string > } > ``` *** ### verifyEmailSingle `tools.verifyEmailSingle` Initiate an email verification job **Risk:** `write` ```ts theme={null} await corsair.emelia.api.tools.verifyEmailSingle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `jobId` | `string` | Yes | — | *** ## Webhooks ### create `webhooks.create` Create a webhook for campaign events **Risk:** `write` ```ts theme={null} await corsair.emelia.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | Yes | — | | `url` | `string` | Yes | — | | `events` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | | `id` | `string` | No | — | | `url` | `string` | No | — | *** ### list `webhooks.list` List all webhooks **Risk:** `read` ```ts theme={null} await corsair.emelia.api.webhooks.list({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > url?: string, > webhookUrl?: string, > campaignId?: string, > events?: string[] > }[] | { > webhooks?: { > id?: string, > url?: string, > webhookUrl?: string, > campaignId?: string, > events?: string[] > }[], > data?: { > id?: string, > url?: string, > webhookUrl?: string, > campaignId?: string, > events?: string[] > }[] > } > ``` *** ### remove `webhooks.remove` Delete a webhook by URL **Risk:** `destructive` ```ts theme={null} await corsair.emelia.api.webhooks.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/emelia/database Emelia local sync: searchable entities, `.search()` filters, and operators. The Emelia plugin syncs data locally. Use `corsair.emelia.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Campaign Path: `emelia.db.campaign.search` ```ts theme={null} const rows = await corsair.emelia.db.campaign.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contact List Path: `emelia.db.contactList.search` ```ts theme={null} const rows = await corsair.emelia.db.contactList.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `contact_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/emelia/overview Emelia plugin for Corsair Use **Emelia** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 28 typed API operations * 2 synced entities (`campaign`, `contactList`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/emelia ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/emelia ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/emelia ``` ```bash bun theme={null} bun add corsair @corsair-dev/emelia ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { emelia } from '@corsair-dev/emelia'; export const corsair = createCorsair({ plugins: [ emelia(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} emelia() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'emelia', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.me`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.emelia.api.account.me({}); ``` **`blacklist.add`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.emelia.api.blacklist.add({}); ``` See the full list on the [API](/plugins/emelia/api) page. ## Query synced data Synced entities support `tenant.emelia.db..search()` and `.list()`: `campaign`, `contactList`. See [Database](/plugins/emelia/database) for filters and operators. ## What's next > **[API reference](/plugins/emelia/api)** > > Every `emelia.api.*` operation with input and output types. > **[Database](/plugins/emelia/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/epicgames/api API reference for Epic Games: every `epicgames.api.*` operation with input and output types. Every `epicgames.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Islands ### get `islands.get` Get metadata for a Fortnite island by code **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAvgMinutesPerPlayer `islands.getAvgMinutesPerPlayer` Get average minutes per unique player for an island **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.getAvgMinutesPerPlayer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `interval` | `day \| hour \| minute` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getFavorites `islands.getFavorites` Get island favorites metrics for an interval **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.getFavorites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `interval` | `day \| hour \| minute` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMetricsByInterval `islands.getMetricsByInterval` Get island usage metrics aggregated by time interval **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.getMetricsByInterval({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `interval` | `day \| hour \| minute` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `metrics` | `averageMinutesPerPlayer \| peakCCU \| favorites \| minutesPlayed \| recommendations \| plays \| uniquePlayers \| retention \| averageMinutesPerPlayer \| peakCCU \| favorites \| minutesPlayed \| recommendations \| plays \| uniquePlayers \| retention[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMinutesPlayed `islands.getMinutesPlayed` Get total minutes played on an island for an interval **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.getMinutesPlayed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `interval` | `day \| hour \| minute` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPeakCcu `islands.getPeakCcu` Get peak concurrent users for an island over an interval **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.getPeakCcu({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `interval` | `day \| hour \| minute` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPlays `islands.getPlays` Get island play/session-start counts for an interval **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.getPlays({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `interval` | `day \| hour \| minute` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRecommendations `islands.getRecommendations` Get island recommendation counts for an interval **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.getRecommendations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `interval` | `day \| hour \| minute` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRetention `islands.getRetention` Get day-over-day retention metrics for an island **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.getRetention({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `interval` | `day` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUniquePlayers `islands.getUniquePlayers` Get unique player counts for an island over an interval **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.getUniquePlayers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `interval` | `day \| hour \| minute` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `islands.list` List public discoverable Fortnite Creative islands **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.islands.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `size` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > data?: { > }[], > items?: { > }[], > results?: { > }[], > islands?: { > }[], > links?: { > }, > meta?: { > } > } > ``` *** ## Remote ### batch `remote.batch` Batch multiple Remote Control API calls into one request **Risk:** `write` ```ts theme={null} await corsair.epicgames.api.remote.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | > **requests full type** > > ```ts theme={null} > { > RequestId: number, > URL: string, > Verb: PUT | POST | GET | DELETE > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### callObjectFunction `remote.callObjectFunction` Call a Blueprint-callable function on a UObject **Risk:** `write` ```ts theme={null} await corsair.epicgames.api.remote.callObjectFunction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `objectPath` | `string` | Yes | — | | `functionName` | `string` | Yes | — | | `parameters` | `object` | No | — | | `generateTransaction` | `boolean` | No | — | > **parameters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### corsPreflight `remote.corsPreflight` CORS preflight OPTIONS against the Remote Control API **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.remote.corsPreflight({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deletePresetMetadataKey `remote.deletePresetMetadataKey` Delete a metadata key from a Remote Control preset **Risk:** `write` ```ts theme={null} await corsair.epicgames.api.remote.deletePresetMetadataKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `presetName` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### describeObject `remote.describeObject` Describe a UObject by path via Remote Control **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.remote.describeObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `objectPath` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getObjectThumbnail `remote.getObjectThumbnail` Fetch Content Browser thumbnail for an asset path **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.remote.getObjectThumbnail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `objectPath` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPreset `remote.getPreset` Get a Remote Control preset by name **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.remote.getPreset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `presetName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPresetMetadata `remote.getPresetMetadata` Get all metadata entries for a Remote Control preset **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.remote.getPresetMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `presetName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPresetMetadataKey `remote.getPresetMetadataKey` Get a single metadata key for a Remote Control preset **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.remote.getPresetMetadataKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `presetName` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPresetProperty `remote.getPresetProperty` Read a property exposed on a Remote Control preset **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.remote.getPresetProperty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `presetName` | `string` | Yes | — | | `propertyName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### initiateSession `remote.initiateSession` Initiate an Unreal Web Remote Control session **Risk:** `write` ```ts theme={null} await corsair.epicgames.api.remote.initiateSession({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### invokePresetFunction `remote.invokePresetFunction` Invoke a function exposed on a Remote Control preset **Risk:** `write` ```ts theme={null} await corsair.epicgames.api.remote.invokePresetFunction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `presetName` | `string` | Yes | — | | `functionName` | `string` | Yes | — | | `parameters` | `object` | No | — | > **parameters full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listBlueprintCallableFunctions `remote.listBlueprintCallableFunctions` List Blueprint-callable functions exposed by a UObject **Risk:** `read` ```ts theme={null} await corsair.epicgames.api.remote.listBlueprintCallableFunctions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `objectPath` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### putObjectProperty `remote.putObjectProperty` Read or set UObject property values via Remote Control **Risk:** `write` ```ts theme={null} await corsair.epicgames.api.remote.putObjectProperty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `objectPath` | `string` | Yes | — | | `propertyName` | `string` | No | — | | `access` | `READ_ACCESS \| WRITE_ACCESS \| WRITE_TRANSACTION_ACCESS` | No | — | | `propertyValue` | `object` | No | — | > **propertyValue full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### putPresetMetadataKey `remote.putPresetMetadataKey` Create or update a metadata key on a Remote Control preset **Risk:** `write` ```ts theme={null} await corsair.epicgames.api.remote.putPresetMetadataKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `presetName` | `string` | Yes | — | | `key` | `string` | Yes | — | | `value` | `any` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updatePresetProperty `remote.updatePresetProperty` Update a property exposed on a Remote Control preset **Risk:** `write` ```ts theme={null} await corsair.epicgames.api.remote.updatePresetProperty({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `presetName` | `string` | Yes | — | | `propertyName` | `string` | Yes | — | | `value` | `any` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### waitForObjectEvent `remote.waitForObjectEvent` Wait for a UObject event (experimental; requires EnableExperimentalRoutes) **Risk:** `write` ```ts theme={null} await corsair.epicgames.api.remote.waitForObjectEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `objectPath` | `string` | Yes | — | | `eventType` | `ObjectPropertyChanged \| PreObjectPropertyChanged` | No | — | | `propertyName` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/epicgames/database Epic Games local sync: searchable entities, `.search()` filters, and operators. The Epic Games plugin syncs data locally. Use `corsair.epicgames.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Islands Path: `epicgames.db.islands.search` ```ts theme={null} const rows = await corsair.epicgames.db.islands.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `creatorCode` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `createdIn` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/epicgames/overview Gaming platform APIs for Epic Online Services, accounts, and game backend features. Use **Epic Games** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 28 typed API operations * 1 synced entity (`islands`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/epicgames ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/epicgames ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/epicgames ``` ```bash bun theme={null} bun add corsair @corsair-dev/epicgames ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { epicgames } from '@corsair-dev/epicgames'; export const corsair = createCorsair({ plugins: [ epicgames(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Epic Games OAuth app. ```ts theme={null} epicgames() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'epicgames', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`islands.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.epicgames.api.islands.get({}); ``` **`remote.batch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.epicgames.api.remote.batch({}); ``` See the full list on the [API](/plugins/epicgames/api) page. ## Query synced data Synced entities support `tenant.epicgames.db..search()` and `.list()`: `islands`. See [Database](/plugins/epicgames/database) for filters and operators. ## What's next > **[API reference](/plugins/epicgames/api)** > > Every `epicgames.api.*` operation with input and output types. > **[Database](/plugins/epicgames/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/everhour/api API reference for Everhour: every `everhour.api.*` operation with input and output types. Every `everhour.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Clients ### createClient `clients.createClient` Create a client **Risk:** `write` ```ts theme={null} await corsair.everhour.api.clients.createClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `projects` | `string[]` | No | — | | `businessDetails` | `string` | No | — | | `email` | `string[]` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | Yes | — | | `email` | `string \| string[]` | No | — | | `phone` | `string` | No | — | | `address` | `string` | No | — | | `projects` | `string[]` | No | — | | `businessDetails` | `string` | No | — | | `status` | `string` | No | — | *** ### deleteClient `clients.deleteClient` Delete a client **Risk:** `write` ```ts theme={null} await corsair.everhour.api.clients.deleteClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | **Output:** `null` *** ### getClient `clients.getClient` Get a client **Risk:** `read` ```ts theme={null} await corsair.everhour.api.clients.getClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | Yes | — | | `email` | `string \| string[]` | No | — | | `phone` | `string` | No | — | | `address` | `string` | No | — | | `projects` | `string[]` | No | — | | `businessDetails` | `string` | No | — | | `status` | `string` | No | — | *** ### listClients `clients.listClients` List clients **Risk:** `read` ```ts theme={null} await corsair.everhour.api.clients.listClients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name: string, > email?: string | string[], > phone?: string, > address?: string, > projects?: string[], > businessDetails?: string | null, > status?: string > }[] > ``` *** ### updateClient `clients.updateClient` Update a client **Risk:** `write` ```ts theme={null} await corsair.everhour.api.clients.updateClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | | `name` | `string` | No | — | | `projects` | `string[]` | No | — | | `businessDetails` | `string` | No | — | | `email` | `string[]` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | Yes | — | | `email` | `string \| string[]` | No | — | | `phone` | `string` | No | — | | `address` | `string` | No | — | | `projects` | `string[]` | No | — | | `businessDetails` | `string` | No | — | | `status` | `string` | No | — | *** ## Expenses ### listExpenseCategories `expenses.listExpenseCategories` List expense categories **Risk:** `read` ```ts theme={null} await corsair.everhour.api.expenses.listExpenseCategories({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > color?: string, > unitBased?: boolean, > unitName?: string, > unitPrice?: number > }[] > ``` *** ### listExpenses `expenses.listExpenses` List expenses **Risk:** `read` ```ts theme={null} await corsair.everhour.api.expenses.listExpenses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > amount?: number, > date?: string, > project?: string, > category?: string | number, > user?: string | number, > billable?: boolean, > details?: string > }[] > ``` *** ## Hooks ### createWebhook `hooks.createWebhook` Create a webhook **Risk:** `write` ```ts theme={null} await corsair.everhour.api.hooks.createWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `targetUrl` | `string` | Yes | — | | `events` | `string[]` | Yes | — | | `project` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `targetUrl` | `string` | Yes | — | | `events` | `string[]` | Yes | — | | `project` | `string` | No | — | | `active` | `boolean` | No | — | | `createdAt` | `string` | Yes | — | | `lastUsedAt` | `string` | No | — | *** ### deleteWebhook `hooks.deleteWebhook` Delete a webhook **Risk:** `write` ```ts theme={null} await corsair.everhour.api.hooks.deleteWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hookId` | `string` | Yes | — | **Output:** `null` *** ### getWebhook `hooks.getWebhook` Get a webhook **Risk:** `read` ```ts theme={null} await corsair.everhour.api.hooks.getWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `targetUrl` | `string` | Yes | — | | `events` | `string[]` | Yes | — | | `project` | `string` | No | — | | `active` | `boolean` | No | — | | `createdAt` | `string` | Yes | — | | `lastUsedAt` | `string` | No | — | *** ### listWebhooks `hooks.listWebhooks` List webhooks **Risk:** `read` ```ts theme={null} await corsair.everhour.api.hooks.listWebhooks({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > targetUrl: string, > events: string[], > project?: string | null, > active?: boolean, > createdAt: string, > lastUsedAt?: string > }[] > ``` *** ### updateWebhook `hooks.updateWebhook` Update a webhook **Risk:** `write` ```ts theme={null} await corsair.everhour.api.hooks.updateWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hookId` | `string` | Yes | — | | `events` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `targetUrl` | `string` | Yes | — | | `events` | `string[]` | Yes | — | | `project` | `string` | No | — | | `active` | `boolean` | No | — | | `createdAt` | `string` | Yes | — | | `lastUsedAt` | `string` | No | — | *** ## Invoices ### listInvoices `invoices.listInvoices` List invoices **Risk:** `read` ```ts theme={null} await corsair.everhour.api.invoices.listInvoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > status?: string, > createdAt?: string, > publicId?: string, > totalAmount?: number > }[] > ``` *** ## Platforms ### listPlatforms `platforms.listPlatforms` List supported platforms **Risk:** `read` ```ts theme={null} await corsair.everhour.api.platforms.listPlatforms({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > type?: string > }[] > ``` *** ## Projects ### createProject `projects.createProject` Create a project **Risk:** `write` ```ts theme={null} await corsair.everhour.api.projects.createProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `board \| list` | Yes | — | | `users` | `number[]` | No | — | | `client` | `number` | No | — | | `privacy` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `client` | `string \| number` | No | — | | `client_id` | `string` | No | — | | `color` | `string` | No | — | | `is_archived` | `boolean` | No | — | | `users` | `(string \| number)[]` | No | — | | `type` | `string` | No | — | *** ### deleteProject `projects.deleteProject` Delete a project **Risk:** `write` ```ts theme={null} await corsair.everhour.api.projects.deleteProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** `null` *** ### getProject `projects.getProject` Get a project **Risk:** `read` ```ts theme={null} await corsair.everhour.api.projects.getProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `client` | `string \| number` | No | — | | `client_id` | `string` | No | — | | `color` | `string` | No | — | | `is_archived` | `boolean` | No | — | | `users` | `(string \| number)[]` | No | — | | `type` | `string` | No | — | *** ### listProjects `projects.listProjects` List projects **Risk:** `read` ```ts theme={null} await corsair.everhour.api.projects.listProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `platform` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > client?: string | number | null, > client_id?: string, > color?: string, > is_archived?: boolean, > users?: ( > string | number > )[], > type?: string > }[] > ``` *** ### updateProject `projects.updateProject` Update a project **Risk:** `write` ```ts theme={null} await corsair.everhour.api.projects.updateProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `board \| list` | No | — | | `users` | `number[]` | No | — | | `client` | `number` | No | — | | `privacy` | `boolean` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `client` | `string \| number` | No | — | | `client_id` | `string` | No | — | | `color` | `string` | No | — | | `is_archived` | `boolean` | No | — | | `users` | `(string \| number)[]` | No | — | | `type` | `string` | No | — | *** ## Sections ### createSection `sections.createSection` Create a section **Risk:** `write` ```ts theme={null} await corsair.everhour.api.sections.createSection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `open \| archived` | No | — | | `collapsed` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | Yes | — | | `project` | `string` | Yes | — | | `position` | `number` | Yes | — | | `status` | `string` | No | — | | `collapsed` | `boolean` | No | — | *** ### deleteSection `sections.deleteSection` Delete a section **Risk:** `write` ```ts theme={null} await corsair.everhour.api.sections.deleteSection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sectionId` | `string` | Yes | — | **Output:** `null` *** ### getSection `sections.getSection` Get a section **Risk:** `read` ```ts theme={null} await corsair.everhour.api.sections.getSection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | Yes | — | | `project` | `string` | Yes | — | | `position` | `number` | Yes | — | | `status` | `string` | No | — | | `collapsed` | `boolean` | No | — | *** ### listSections `sections.listSections` List sections in a project **Risk:** `read` ```ts theme={null} await corsair.everhour.api.sections.listSections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name: string, > project: string, > position: number, > status?: string, > collapsed?: boolean | null > }[] > ``` *** ## Tags ### listTags `tags.listTags` List workspace tags **Risk:** `read` ```ts theme={null} await corsair.everhour.api.tags.listTags({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > color?: string > }[] > ``` *** ## Tasks ### createTask `tasks.createTask` Create a task **Risk:** `write` ```ts theme={null} await corsair.everhour.api.tasks.createTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `section` | `number` | No | — | | `labels` | `string[]` | No | — | | `status` | `open \| closed` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `projects` | `string[]` | No | — | | `project_id` | `string` | No | — | | `description` | `string` | No | — | | `estimate` | `any` | No | — | | `status` | `string` | No | — | | `is_archived` | `boolean` | No | — | | `section` | `number` | No | — | | `labels` | `string[]` | No | — | *** ### getTask `tasks.getTask` Get a specific task **Risk:** `read` ```ts theme={null} await corsair.everhour.api.tasks.getTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `projects` | `string[]` | No | — | | `project_id` | `string` | No | — | | `description` | `string` | No | — | | `estimate` | `any` | No | — | | `status` | `string` | No | — | | `is_archived` | `boolean` | No | — | | `section` | `number` | No | — | | `labels` | `string[]` | No | — | *** ### listTasksForProject `tasks.listTasksForProject` List tasks for a project **Risk:** `read` ```ts theme={null} await corsair.everhour.api.tasks.listTasksForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > query?: string, > limit?: number, > page?: number, > searchInClosed?: boolean, > searchInUnscheduled?: boolean > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > projects?: string[], > project_id?: string, > description?: string | null, > estimate?: any, > status?: string, > is_archived?: boolean, > section?: number | null, > labels?: string[] > }[] > ``` *** ### searchTasks `tasks.searchTasks` Search tasks across projects **Risk:** `read` ```ts theme={null} await corsair.everhour.api.tasks.searchTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `project` | `string` | No | — | | `limit` | `number` | No | — | | `searchInClosed` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > projects?: string[], > project_id?: string, > description?: string | null, > estimate?: any, > status?: string, > is_archived?: boolean, > section?: number | null, > labels?: string[] > }[] > ``` *** ## Time ### deleteTimeEntry `time.deleteTimeEntry` Delete a time record **Risk:** `write` ```ts theme={null} await corsair.everhour.api.time.deleteTimeEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timeId` | `string` | Yes | — | **Output:** `null` *** ### discardTimesheetApproval `time.discardTimesheetApproval` Discard a pending timesheet approval request **Risk:** `write` ```ts theme={null} await corsair.everhour.api.time.discardTimesheetApproval({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timesheetId` | `string` | Yes | — | | `comment` | `string` | No | — | | `reviewer` | `number` | No | — | | `sendNotification` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `user` | `string \| number` | No | — | | `weekId` | `number` | No | — | | `status` | `string` | No | — | *** ### listUserTime `time.listUserTime` List time records for a user **Risk:** `read` ```ts theme={null} await corsair.everhour.api.time.listUserTime({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > time?: number, > user?: string | number, > date?: string, > task?: any, > task_id?: string, > user_id?: string, > start_date?: Date, > end_date?: Date | null, > duration?: number, > description?: string, > comment?: string, > is_billable?: boolean > }[] > ``` *** ### listUserTimesheets `time.listUserTimesheets` List timesheets for a user **Risk:** `read` ```ts theme={null} await corsair.everhour.api.time.listUserTimesheets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number > }[] > ``` *** ### logTime `time.logTime` Log a new time record **Risk:** `write` ```ts theme={null} await corsair.everhour.api.time.logTime({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `time` | `number` | Yes | — | | `date` | `string` | No | — | | `task` | `string` | No | — | | `user` | `number` | No | — | | `comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `time` | `number` | No | — | | `user` | `string \| number` | No | — | | `date` | `string` | No | — | | `task` | `any` | No | — | | `task_id` | `string` | No | — | | `user_id` | `string` | No | — | | `start_date` | `Date` | No | — | | `end_date` | `Date` | No | — | | `duration` | `number` | No | — | | `description` | `string` | No | — | | `comment` | `string` | No | — | | `is_billable` | `boolean` | No | — | *** ### requestTimesheetApproval `time.requestTimesheetApproval` Request approval for a timesheet week **Risk:** `write` ```ts theme={null} await corsair.everhour.api.time.requestTimesheetApproval({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timesheetId` | `string` | Yes | — | | `comment` | `string` | No | — | | `reviewer` | `number` | No | — | | `sendNotification` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `user` | `string \| number` | No | — | | `weekId` | `number` | No | — | | `status` | `string` | No | — | *** ### updateTimeEntry `time.updateTimeEntry` Update a time record **Risk:** `write` ```ts theme={null} await corsair.everhour.api.time.updateTimeEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timeId` | `string` | Yes | — | | `time` | `number` | Yes | — | | `date` | `string` | No | — | | `task` | `string` | No | — | | `user` | `number` | No | — | | `comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `time` | `number` | No | — | | `user` | `string \| number` | No | — | | `date` | `string` | No | — | | `task` | `any` | No | — | | `task_id` | `string` | No | — | | `user_id` | `string` | No | — | | `start_date` | `Date` | No | — | | `end_date` | `Date` | No | — | | `duration` | `number` | No | — | | `description` | `string` | No | — | | `comment` | `string` | No | — | | `is_billable` | `boolean` | No | — | *** ## Timecards ### clockIn `timecards.clockIn` Clock a user in **Risk:** `write` ```ts theme={null} await corsair.everhour.api.timecards.clockIn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `userDate` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string \| number` | Yes | — | | `workTime` | `number` | Yes | — | | `clockIn` | `string` | No | — | | `clockOut` | `string` | No | — | | `breakTime` | `number` | No | — | | `date` | `string` | No | — | | `weekId` | `number` | No | — | | `isLocked` | `boolean` | No | — | *** ### clockOut `timecards.clockOut` Clock a user out **Risk:** `write` ```ts theme={null} await corsair.everhour.api.timecards.clockOut({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `userDate` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string \| number` | Yes | — | | `workTime` | `number` | Yes | — | | `clockIn` | `string` | No | — | | `clockOut` | `string` | No | — | | `breakTime` | `number` | No | — | | `date` | `string` | No | — | | `weekId` | `number` | No | — | | `isLocked` | `boolean` | No | — | *** ### deleteTimecard `timecards.deleteTimecard` Delete a user timecard **Risk:** `write` ```ts theme={null} await corsair.everhour.api.timecards.deleteTimecard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `date` | `string` | Yes | — | **Output:** `null` *** ### getTimecard `timecards.getTimecard` Get a user timecard for a date **Risk:** `read` ```ts theme={null} await corsair.everhour.api.timecards.getTimecard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `date` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string \| number` | Yes | — | | `workTime` | `number` | Yes | — | | `clockIn` | `string` | No | — | | `clockOut` | `string` | No | — | | `breakTime` | `number` | No | — | | `date` | `string` | No | — | | `weekId` | `number` | No | — | | `isLocked` | `boolean` | No | — | *** ### listTimecards `timecards.listTimecards` List team timecards **Risk:** `read` ```ts theme={null} await corsair.everhour.api.timecards.listTimecards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > user: string | number, > workTime: number, > clockIn?: string, > clockOut?: string, > breakTime?: number, > date?: string, > weekId?: number, > isLocked?: boolean > }[] > ``` *** ### listUserTimecards `timecards.listUserTimecards` List timecards for a user **Risk:** `read` ```ts theme={null} await corsair.everhour.api.timecards.listUserTimecards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > user: string | number, > workTime: number, > clockIn?: string, > clockOut?: string, > breakTime?: number, > date?: string, > weekId?: number, > isLocked?: boolean > }[] > ``` *** ### updateTimecard `timecards.updateTimecard` Update a user timecard **Risk:** `write` ```ts theme={null} await corsair.everhour.api.timecards.updateTimecard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `date` | `string` | Yes | — | | `clockIn` | `string` | No | — | | `clockOut` | `string` | No | — | | `breakTime` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string \| number` | Yes | — | | `workTime` | `number` | Yes | — | | `clockIn` | `string` | No | — | | `clockOut` | `string` | No | — | | `breakTime` | `number` | No | — | | `date` | `string` | No | — | | `weekId` | `number` | No | — | | `isLocked` | `boolean` | No | — | *** ## Timer ### getCurrentTimer `timer.getCurrentTimer` Get the current active timer **Risk:** `read` ```ts theme={null} await corsair.everhour.api.timer.getCurrentTimer({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `task_id` | `string` | No | — | | `start_time` | `string` | No | — | | `status` | `active \| stopped` | No | — | | `duration` | `number` | No | — | | `startedAt` | `string` | No | — | | `task` | `any` | No | — | *** ### startTimer `timer.startTimer` Start a new timer **Risk:** `write` ```ts theme={null} await corsair.everhour.api.timer.startTimer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task` | `string` | Yes | — | | `userDate` | `string` | No | — | | `comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `task_id` | `string` | No | — | | `start_time` | `string` | No | — | | `status` | `active \| stopped` | No | — | | `duration` | `number` | No | — | | `startedAt` | `string` | No | — | | `task` | `any` | No | — | *** ### stopTimer `timer.stopTimer` Stop the currently running timer **Risk:** `write` ```ts theme={null} await corsair.everhour.api.timer.stopTimer({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `task_id` | `string` | No | — | | `start_time` | `string` | No | — | | `status` | `active \| stopped` | No | — | | `duration` | `number` | No | — | | `startedAt` | `string` | No | — | | `task` | `any` | No | — | *** ## User ### getUser `user.getUser` Get current user profile **Risk:** `read` ```ts theme={null} await corsair.everhour.api.user.getUser({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `avatarUrl` | `string` | No | — | | `avatar` | `string` | No | — | | `role` | `string` | No | — | | `status` | `string` | No | — | | `headline` | `string` | No | — | | `team` | `any` | No | — | *** ### listTeams `user.listTeams` Get the authenticated Everhour workspace **Risk:** `read` ```ts theme={null} await corsair.everhour.api.user.listTeams({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### listTeamUsers `user.listTeamUsers` List all team users **Risk:** `read` ```ts theme={null} await corsair.everhour.api.user.listTeamUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `limit` | `number` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > first_name?: string, > last_name?: string, > email?: string, > avatarUrl?: string, > avatar?: string, > role?: string, > status?: string, > headline?: string | null, > team?: any > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/everhour/database Everhour local sync: searchable entities, `.search()` filters, and operators. The Everhour plugin syncs data locally. Use `corsair.everhour.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Clients Path: `everhour.db.clients.search` ```ts theme={null} const rows = await corsair.everhour.db.clients.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `businessDetails` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Expense Categories Path: `everhour.db.expenseCategories.search` ```ts theme={null} const rows = await corsair.everhour.db.expenseCategories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `unitBased` | `boolean` | equals | | `unitName` | `string` | equals, contains, startsWith, endsWith, in | | `unitPrice` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Expenses Path: `everhour.db.expenses.search` ```ts theme={null} const rows = await corsair.everhour.db.expenses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `billable` | `boolean` | equals | | `details` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invoices Path: `everhour.db.invoices.search` ```ts theme={null} const rows = await corsair.everhour.db.invoices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `publicId` | `string` | equals, contains, startsWith, endsWith, in | | `totalAmount` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Platforms Path: `everhour.db.platforms.search` ```ts theme={null} const rows = await corsair.everhour.db.platforms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `everhour.db.projects.search` ```ts theme={null} const rows = await corsair.everhour.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `client_id` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `is_archived` | `boolean` | equals | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sections Path: `everhour.db.sections.search` ```ts theme={null} const rows = await corsair.everhour.db.sections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `position` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `collapsed` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `everhour.db.tags.search` ```ts theme={null} const rows = await corsair.everhour.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `everhour.db.tasks.search` ```ts theme={null} const rows = await corsair.everhour.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `is_archived` | `boolean` | equals | | `section` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Timecards Path: `everhour.db.timecards.search` ```ts theme={null} const rows = await corsair.everhour.db.timecards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `workTime` | `number` | equals, gt, gte, lt, lte, in | | `clockIn` | `string` | equals, contains, startsWith, endsWith, in | | `clockOut` | `string` | equals, contains, startsWith, endsWith, in | | `breakTime` | `number` | equals, gt, gte, lt, lte, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `weekId` | `number` | equals, gt, gte, lt, lte, in | | `isLocked` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Time Entries Path: `everhour.db.timeEntries.search` ```ts theme={null} const rows = await corsair.everhour.db.timeEntries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `number` | equals, gt, gte, lt, lte, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `task_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `start_date` | `date` | equals, before, after, between | | `end_date` | `date` | equals, before, after, between | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | | `is_billable` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `everhour.db.users.search` ```ts theme={null} const rows = await corsair.everhour.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `avatarUrl` | `string` | equals, contains, startsWith, endsWith, in | | `avatar` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `headline` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `everhour.db.webhooks.search` ```ts theme={null} const rows = await corsair.everhour.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `targetUrl` | `string` | equals, contains, startsWith, endsWith, in | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `lastUsedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/everhour/overview Everhour plugin for Corsair Use **Everhour** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 48 typed API operations * 13 synced entities (`clients`, `expenseCategories`, `expenses`, `invoices`, `platforms`, `projects`, and 7 more) for fast `.search()` / `.list()` * 20 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/everhour ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/everhour ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/everhour ``` ```bash bun theme={null} bun add corsair @corsair-dev/everhour ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { everhour } from '@corsair-dev/everhour'; export const corsair = createCorsair({ plugins: [ everhour(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} everhour() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Everhour OAuth app. ```ts theme={null} everhour({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'everhour', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`clients.getClient`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.everhour.api.clients.getClient({}); ``` **`clients.createClient`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.everhour.api.clients.createClient({}); ``` See the full list on the [API](/plugins/everhour/api) page. ## Query synced data Synced entities support `tenant.everhour.db..search()` and `.list()`: `clients`, `expenseCategories`, `expenses`, `invoices`, `platforms`, `projects`, `sections`, `tags`, `tasks`, `timecards`, `timeEntries`, `users`, `webhooks`. See [Database](/plugins/everhour/database) for filters and operators. ## Webhooks This plugin registers **20** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/everhour/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/everhour/api)** > > Every `everhour.api.*` operation with input and output types. > **[Database](/plugins/everhour/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/everhour/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/everhour/webhooks Everhour incoming webhooks: event paths, payloads, and response data. The Everhour plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/everhour/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `client` * `created` (`client.created`) * `updated` (`client.updated`) * `estimate` * `updated` (`estimate.updated`) * `invoice` * `created` (`invoice.created`) * `deleted` (`invoice.deleted`) * `updated` (`invoice.updated`) * `project` * `created` (`project.created`) * `removed` (`project.removed`) * `updated` (`project.updated`) * `section` * `created` (`section.created`) * `recovered` (`section.recovered`) * `removed` (`section.removed`) * `updated` (`section.updated`) * `task` * `created` (`task.created`) * `recovered` (`task.recovered`) * `removed` (`task.removed`) * `updated` (`task.updated`) * `time` * `updated` (`time.updated`) * `timer` * `started` (`timer.started`) * `stopped` (`timer.stopped`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Client ### Created `client.created` A client was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { client: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `client.updated` A client was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { client: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Estimate ### Updated `estimate.updated` A task estimate was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { estimate: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Invoice ### Created `invoice.created` An invoice was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { invoice: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `invoice.deleted` An invoice was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { invoice: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `invoice.updated` An invoice was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { invoice: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Project ### Created `project.created` A project was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { project: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Removed `project.removed` A project was removed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { project: { removed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `project.updated` A project was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { project: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Section ### Created `section.created` A section was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { section: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Recovered `section.recovered` A section was recovered **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { section: { recovered: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Removed `section.removed` A section was removed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { section: { removed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `section.updated` A section was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { section: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Task ### Created `task.created` A task was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { task: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Recovered `task.recovered` A task was recovered **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { task: { recovered: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Removed `task.removed` A task was removed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { task: { removed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `task.updated` A task was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { task: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Time ### Updated `time.updated` A time record is created or modified **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `api:time:updated` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > task_id: string, > user_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: api:time:updated, > created_at: string, > data: { > id: string, > task_id: string, > user_id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { time: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Timer ### Started `timer.started` A timer was started **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { timer: { started: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Stopped `timer.stopped` A timer was stopped **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: string, > created_at: string, > data: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} everhour({ webhookHooks: { timer: { stopped: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/exa/api API reference for Exa: every `exa.api.*` operation with input and output types. Every `exa.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Answer ### get `answer.get` Generate a direct, citation-backed answer to a natural language question **Risk:** `read` ```ts theme={null} await corsair.exa.api.answer.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `text` | `boolean` | No | — | | `stream` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `answer` | `string` | Yes | — | | `citations` | `object[]` | No | — | | `requestId` | `string` | No | — | > **citations full type** > > ```ts theme={null} > { > id: string, > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null, > score?: number, > text?: string, > highlights?: string[], > highlightScores?: number[], > summary?: string > }[] > ``` *** ## Contents ### get `contents.get` Retrieve full text, highlights, or summaries from URLs or document IDs **Risk:** `read` ```ts theme={null} await corsair.exa.api.contents.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | | `text` | `object` | No | — | | `highlights` | `object` | No | — | | `summary` | `object` | No | — | > **text full type** > > ```ts theme={null} > { > maxCharacters?: number, > includeHtmlTags?: boolean > } | boolean > ``` > **highlights full type** > > ```ts theme={null} > { > numSentences?: number, > highlightsPerUrl?: number, > query?: string > } | boolean > ``` > **summary full type** > > ```ts theme={null} > { > query?: string > } | boolean > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `requestId` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null, > score?: number, > text?: string, > highlights?: string[], > highlightScores?: number[], > summary?: string > }[] > ``` *** ## Events ### get `events.get` Get details of a specific webset event by its ID **Risk:** `read` ```ts theme={null} await corsair.exa.api.events.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `websetId` | `string` | Yes | — | | `eventId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `type` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `data` | `any` | No | — | *** ### list `events.list` List all events that have occurred for a webset **Risk:** `read` ```ts theme={null} await corsair.exa.api.events.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `websetId` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `hasMore` | `boolean` | No | — | | `nextCursor` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: event, > type: string, > createdAt: string, > data?: any > }[] > ``` *** ## Imports ### create `imports.create` Create a new import to upload data into a webset **Risk:** `write` ```ts theme={null} await corsair.exa.api.imports.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `websetId` | `string` | Yes | — | | `urls` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `import` | Yes | — | | `websetId` | `string` | Yes | — | | `urls` | `string[]` | No | — | | `status` | `pending \| processing \| completed \| failed` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | No | — | *** ### delete `imports.delete` Delete an existing import **Risk:** `destructive` ```ts theme={null} await corsair.exa.api.imports.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `websetId` | `string` | Yes | — | | `importId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### list `imports.list` List all imports for a webset **Risk:** `read` ```ts theme={null} await corsair.exa.api.imports.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `websetId` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `hasMore` | `boolean` | No | — | | `nextCursor` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: import, > websetId: string, > urls?: string[], > status?: pending | processing | completed | failed, > createdAt: string, > updatedAt?: string > }[] > ``` *** ## Monitors ### create `monitors.create` Create a new monitor to watch a webset for changes **Risk:** `write` ```ts theme={null} await corsair.exa.api.monitors.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `websetId` | `string` | Yes | — | | `cadence` | `object` | Yes | — | > **cadence full type** > > ```ts theme={null} > { > type: realtime | hourly | daily | weekly > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `monitor` | Yes | — | | `websetId` | `string` | Yes | — | | `cadence` | `object` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | No | — | > **cadence full type** > > ```ts theme={null} > { > type: realtime | hourly | daily | weekly > } > ``` *** ## Search ### findSimilar `search.findSimilar` Find web pages semantically similar to a given URL **Risk:** `read` ```ts theme={null} await corsair.exa.api.search.findSimilar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `numResults` | `number` | No | — | | `includeDomains` | `string[]` | No | — | | `excludeDomains` | `string[]` | No | — | | `startCrawlDate` | `string` | No | — | | `endCrawlDate` | `string` | No | — | | `startPublishedDate` | `string` | No | — | | `endPublishedDate` | `string` | No | — | | `excludeSourceDomain` | `boolean` | No | — | | `category` | `string` | No | — | | `contents` | `object` | No | — | > **contents full type** > > ```ts theme={null} > { > text?: { > maxCharacters?: number, > includeHtmlTags?: boolean > } | boolean, > highlights?: { > numSentences?: number, > highlightsPerUrl?: number, > query?: string > } | boolean, > summary?: { > query?: string > } | boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `requestId` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null, > score?: number, > text?: string, > highlights?: string[], > highlightScores?: number[], > summary?: string > }[] > ``` *** ### search `search.search` Search the web using neural or keyword search **Risk:** `read` ```ts theme={null} await corsair.exa.api.search.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `numResults` | `number` | No | — | | `includeDomains` | `string[]` | No | — | | `excludeDomains` | `string[]` | No | — | | `startCrawlDate` | `string` | No | — | | `endCrawlDate` | `string` | No | — | | `startPublishedDate` | `string` | No | — | | `endPublishedDate` | `string` | No | — | | `useAutoprompt` | `boolean` | No | — | | `type` | `keyword \| neural \| auto` | No | — | | `category` | `string` | No | — | | `contents` | `object` | No | — | > **contents full type** > > ```ts theme={null} > { > text?: { > maxCharacters?: number, > includeHtmlTags?: boolean > } | boolean, > highlights?: { > numSentences?: number, > highlightsPerUrl?: number, > query?: string > } | boolean, > summary?: { > query?: string > } | boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `autopromptString` | `string` | No | — | | `requestId` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null, > score?: number, > text?: string, > highlights?: string[], > highlightScores?: number[], > summary?: string > }[] > ``` *** ## Webhooks Api ### list `webhooksApi.list` List all webhooks configured for websets **Risk:** `read` ```ts theme={null} await corsair.exa.api.webhooksApi.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `hasMore` | `boolean` | No | — | | `nextCursor` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: webhook, > url: string, > events?: string[], > status?: active | inactive, > createdAt: string, > updatedAt?: string > }[] > ``` *** ## Websets ### create `websets.create` Create a new webset with search, import, and enrichment setup **Risk:** `write` ```ts theme={null} await corsair.exa.api.websets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `searches` | `object[]` | No | — | | `enrichments` | `object[]` | No | — | | `externalId` | `string` | No | — | > **searches full type** > > ```ts theme={null} > { > query: string, > count?: number, > entity?: { > type?: company | person | article | research paper | repository | event | product | video | job | podcast > }, > criteria?: { > description: string, > successRate?: string > }[] > }[] > ``` > **enrichments full type** > > ```ts theme={null} > { > description: string, > format?: text | date | number | options | boolean, > options?: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `webset` | Yes | — | | `status` | `idle \| running \| paused \| done` | Yes | — | | `externalId` | `string` | No | — | | `searches` | `object[]` | No | — | | `enrichments` | `object[]` | No | — | | `imports` | `object[]` | No | — | | `monitors` | `object[]` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **searches full type** > > ```ts theme={null} > { > query: string, > count?: number, > entity?: { > type?: company | person | article | research paper | repository | event | product | video | job | podcast > }, > criteria?: { > description: string, > successRate?: string > }[] > }[] > ``` > **enrichments full type** > > ```ts theme={null} > { > id: string, > description: string, > format: text | date | number | options | boolean, > options?: string[], > createdAt: string, > updatedAt: string > }[] > ``` > **imports full type** > > ```ts theme={null} > { > id: string, > object: import, > websetId: string, > urls?: string[], > status?: pending | processing | completed | failed, > createdAt: string, > updatedAt?: string > }[] > ``` > **monitors full type** > > ```ts theme={null} > { > id: string, > object: monitor, > websetId: string, > cadence: { > type: realtime | hourly | daily | weekly > }, > createdAt: string, > updatedAt?: string > }[] > ``` *** ### delete `websets.delete` Delete a webset **Risk:** `destructive` ```ts theme={null} await corsair.exa.api.websets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `webset` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### get `websets.get` Get details of a specific webset by its ID **Risk:** `read` ```ts theme={null} await corsair.exa.api.websets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `webset` | Yes | — | | `status` | `idle \| running \| paused \| done` | Yes | — | | `externalId` | `string` | No | — | | `searches` | `object[]` | No | — | | `enrichments` | `object[]` | No | — | | `imports` | `object[]` | No | — | | `monitors` | `object[]` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **searches full type** > > ```ts theme={null} > { > query: string, > count?: number, > entity?: { > type?: company | person | article | research paper | repository | event | product | video | job | podcast > }, > criteria?: { > description: string, > successRate?: string > }[] > }[] > ``` > **enrichments full type** > > ```ts theme={null} > { > id: string, > description: string, > format: text | date | number | options | boolean, > options?: string[], > createdAt: string, > updatedAt: string > }[] > ``` > **imports full type** > > ```ts theme={null} > { > id: string, > object: import, > websetId: string, > urls?: string[], > status?: pending | processing | completed | failed, > createdAt: string, > updatedAt?: string > }[] > ``` > **monitors full type** > > ```ts theme={null} > { > id: string, > object: monitor, > websetId: string, > cadence: { > type: realtime | hourly | daily | weekly > }, > createdAt: string, > updatedAt?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/exa/database Exa local sync: searchable entities, `.search()` filters, and operators. The Exa plugin syncs data locally. Use `corsair.exa.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Events Path: `exa.db.events.search` ```ts theme={null} const rows = await corsair.exa.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `websetId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Imports Path: `exa.db.imports.search` ```ts theme={null} const rows = await corsair.exa.db.imports.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `websetId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Monitors Path: `exa.db.monitors.search` ```ts theme={null} const rows = await corsair.exa.db.monitors.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `websetId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Search Results Path: `exa.db.searchResults.search` ```ts theme={null} const rows = await corsair.exa.db.searchResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `publishedDate` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhook Configs Path: `exa.db.webhookConfigs.search` ```ts theme={null} const rows = await corsair.exa.db.webhookConfigs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Websets Path: `exa.db.websets.search` ```ts theme={null} const rows = await corsair.exa.db.websets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/exa/get-credentials Step-by-step instructions for obtaining an Exa API key. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Exa API key ## API Key Setup ### Step 1: Create an Exa Account 1. Go to [dashboard.exa.ai](https://dashboard.exa.ai) 2. Sign up or log in ### Step 2: Get Your API Key 1. Navigate to **API Keys** in the sidebar 2. Click **Create API Key** 3. Give it a name and copy the key 4. Store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=exa api_key=your-api-key ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Key | All API calls | Exa Dashboard → API Keys | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/exa/overview AI-native search API for finding high-quality web content and research results. Use **Exa** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 14 typed API operations * 6 synced entities (`events`, `imports`, `monitors`, `searchResults`, `webhookConfigs`, `websets`) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/exa ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/exa ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/exa ``` ```bash bun theme={null} bun add corsair @corsair-dev/exa ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { exa } from '@corsair-dev/exa'; export const corsair = createCorsair({ plugins: [ exa(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/exa/get-credentials). ```ts theme={null} exa() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'exa', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`answer.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.exa.api.answer.get({}); ``` **`imports.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.exa.api.imports.create({}); ``` See the full list on the [API](/plugins/exa/api) page. ## Query synced data Synced entities support `tenant.exa.db..search()` and `.list()`: `events`, `imports`, `monitors`, `searchResults`, `webhookConfigs`, `websets`. See [Database](/plugins/exa/database) for filters and operators. ## Webhooks This plugin registers **4** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/exa/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/exa/api)** > > Every `exa.api.*` operation with input and output types. > **[Database](/plugins/exa/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/exa/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/exa/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/exa/webhooks Exa incoming webhooks: event paths, payloads, and response data. The Exa plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/exa/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `content` * `contentIndexed` (`content.contentIndexed`) * `search` * `searchAlert` (`search.searchAlert`) * `webset` * `websetItemsFound` (`webset.websetItemsFound`) * `websetSearchCompleted` (`webset.websetSearchCompleted`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Content ### Content Indexed `content.contentIndexed` A new web page has been indexed by Exa **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `content.indexed` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null, > indexedAt: string > } > ``` **`webhookHooks` example** ```ts theme={null} exa({ webhookHooks: { content: { contentIndexed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Search ### Search Alert `search.searchAlert` A monitored search query has new matching results **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `search.alert` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > query: string, > results: { > id: string, > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null, > score?: number, > text?: string, > highlights?: string[], > summary?: string > }[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > query: string, > results: { > id: string, > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null, > score?: number, > text?: string, > highlights?: string[], > summary?: string > }[], > triggeredAt: string > } > ``` **`webhookHooks` example** ```ts theme={null} exa({ webhookHooks: { search: { searchAlert: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Webset ### Webset Items Found `webset.websetItemsFound` New items were found for a webset search **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webset.items_found` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > webset: { > id: string, > object: webset, > status: idle | running | paused | done, > externalId?: string, > createdAt: string, > updatedAt: string > }, > items: { > id: string, > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null, > score?: number, > text?: string, > highlights?: string[], > summary?: string > }[], > itemCount?: number > } > ``` > **Response data full type** > > ```ts theme={null} > { > webset: { > id: string, > object: webset, > status: idle | running | paused | done, > externalId?: string, > createdAt: string, > updatedAt: string > }, > items: { > id: string, > url: string, > title?: string | null, > publishedDate?: string | null, > author?: string | null, > score?: number, > text?: string, > highlights?: string[], > summary?: string > }[], > itemCount?: number, > triggeredAt: string > } > ``` **`webhookHooks` example** ```ts theme={null} exa({ webhookHooks: { webset: { websetItemsFound: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Webset Search Completed `webset.websetSearchCompleted` A webset search has completed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `webset.search.completed` | Yes | — | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > webset: { > id: string, > object: webset, > status: idle | running | paused | done, > externalId?: string, > createdAt: string, > updatedAt: string > }, > totalItems?: number > } > ``` > **Response data full type** > > ```ts theme={null} > { > webset: { > id: string, > object: webset, > status: idle | running | paused | done, > externalId?: string, > createdAt: string, > updatedAt: string > }, > totalItems?: number, > completedAt: string > } > ``` **`webhookHooks` example** ```ts theme={null} exa({ webhookHooks: { webset: { websetSearchCompleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/exist/api API reference for Exist: every `exist.api.*` operation with input and output types. Every `exist.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Attributes ### acquire `attributes.acquire` Take ownership of attributes so this client can write their values, creating templated attributes the user does not have yet **Risk:** `write` ```ts theme={null} await corsair.exist.api.attributes.acquire({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `attributes` | `object[]` | Yes | — | | `success_objects` | `boolean` | No | — | > **attributes full type** > > ```ts theme={null} > { > template?: string, > name?: string, > manual?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `object[]` | Yes | — | | `failed` | `object[]` | Yes | — | > **success full type** > > ```ts theme={null} > { > name: string > }[] > ``` > **failed full type** > > ```ts theme={null} > { > error: string, > error_code: string > }[] > ``` *** ### increment `attributes.increment` Add a delta to owned attributes' values for a given day **Risk:** `write` ```ts theme={null} await corsair.exist.api.attributes.increment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `attributes` | `object[]` | Yes | — | > **attributes full type** > > ```ts theme={null} > { > name: string, > date?: string, > value: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `object[]` | Yes | — | | `failed` | `object[]` | Yes | — | > **success full type** > > ```ts theme={null} > { > name: string, > value: number, > current?: number > }[] > ``` > **failed full type** > > ```ts theme={null} > { > error: string, > error_code: string > }[] > ``` *** ### list `attributes.list` List the user's attributes without their values **Risk:** `read` ```ts theme={null} await corsair.exist.api.attributes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `groups` | `string[]` | No | — | | `attributes` | `string[]` | No | — | | `exclude_custom` | `boolean` | No | — | | `manual` | `boolean` | No | — | | `include_inactive` | `boolean` | No | — | | `include_low_priority` | `boolean` | No | — | | `owned` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > template?: string | null, > name: string, > label: string, > group: { > name: string, > label: string, > priority: number > }, > service?: { > name: string, > label: string > } | null, > active: boolean, > priority: number, > manual: boolean, > value_type: number, > value_type_description: string, > available_services?: { > name: string, > label: string > }[] > }[] > ``` *** ### listOwned `attributes.listOwned` List the attributes currently owned by this client **Risk:** `read` ```ts theme={null} await corsair.exist.api.attributes.listOwned({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `groups` | `string[]` | No | — | | `attributes` | `string[]` | No | — | | `exclude_custom` | `boolean` | No | — | | `manual` | `boolean` | No | — | | `include_inactive` | `boolean` | No | — | | `include_low_priority` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > template?: string | null, > name: string, > label: string, > group: { > name: string, > label: string, > priority: number > }, > service?: { > name: string, > label: string > } | null, > active: boolean, > priority: number, > manual: boolean, > value_type: number, > value_type_description: string, > available_services?: { > name: string, > label: string > }[] > }[] > ``` *** ### listTemplates `attributes.listTemplates` List the attribute templates Exist supports **Risk:** `read` ```ts theme={null} await corsair.exist.api.attributes.listTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `include_low_priority` | `boolean` | No | — | | `groups` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > name: string, > label: string, > group: { > name: string, > label: string, > priority: number > }, > priority: number, > value_type: number, > value_type_description: string > }[] > ``` *** ### listWithValues `attributes.listWithValues` List the user's attributes along with recent day values **Risk:** `read` ```ts theme={null} await corsair.exist.api.attributes.listWithValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `days` | `number` | No | — | | `date_max` | `string` | No | — | | `groups` | `string[]` | No | — | | `attributes` | `string[]` | No | — | | `templates` | `string[]` | No | — | | `manual` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > template?: string | null, > name: string, > label: string, > group: { > name: string, > label: string, > priority: number > }, > service?: { > name: string, > label: string > } | null, > active: boolean, > priority: number, > manual: boolean, > value_type: number, > value_type_description: string, > available_services?: { > name: string, > label: string > }[], > values: { > date: string, > value?: string | number | boolean | null > }[] > }[] > ``` *** ### release `attributes.release` Release ownership of attributes, passing them to another service or making them inactive **Risk:** `write` ```ts theme={null} await corsair.exist.api.attributes.release({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `attributes` | `object[]` | Yes | — | > **attributes full type** > > ```ts theme={null} > { > name: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `object[]` | Yes | — | | `failed` | `object[]` | Yes | — | > **success full type** > > ```ts theme={null} > { > name: string > }[] > ``` > **failed full type** > > ```ts theme={null} > { > error: string, > error_code: string > }[] > ``` *** ### update `attributes.update` Overwrite owned attributes' total values for a given day, in batches of up to 35 **Risk:** `write` ```ts theme={null} await corsair.exist.api.attributes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `attributes` | `object[]` | Yes | — | > **attributes full type** > > ```ts theme={null} > { > name: string, > date: string, > value?: string | number | boolean | null > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `object[]` | Yes | — | | `failed` | `object[]` | Yes | — | > **success full type** > > ```ts theme={null} > { > name: string, > date: string, > value?: string | number | boolean | null > }[] > ``` > **failed full type** > > ```ts theme={null} > { > error: string, > error_code: string > }[] > ``` *** ## Averages ### list `averages.list` List weekly average values per attribute **Risk:** `read` ```ts theme={null} await corsair.exist.api.averages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `date_min` | `string` | No | — | | `date_max` | `string` | No | — | | `groups` | `string[]` | No | — | | `attributes` | `string[]` | No | — | | `include_historical` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > attribute: string, > date: string, > overall?: number | null, > monday?: number | null, > tuesday?: number | null, > wednesday?: number | null, > thursday?: number | null, > friday?: number | null, > saturday?: number | null, > sunday?: number | null > }[] > ``` *** ## Correlations ### list `correlations.list` List correlations Exist computed between the user's attributes **Risk:** `read` ```ts theme={null} await corsair.exist.api.correlations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `strong` | `boolean` | No | — | | `confident` | `boolean` | No | — | | `attribute` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > date: string, > period: number, > offset: number, > attribute: string, > attribute2: string, > value: number, > p: number, > percentage: number, > stars: number, > second_person: string, > second_person_elements: string[], > attribute_category?: string | null, > strength_description?: string | null, > stars_description?: string | null, > description?: string | null, > occurrence?: string | null, > rating?: { > positive: boolean, > rating_type: number, > rating: string > } | null > }[] > ``` *** ## Insights ### list `insights.list` List insights Exist generated about the user's data **Risk:** `read` ```ts theme={null} await corsair.exist.api.insights.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `date_min` | `string` | No | — | | `date_max` | `string` | No | — | | `priority` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > created: string, > target_date?: string | null, > type: { > name: string, > period: number, > priority: number, > attribute?: { > name: string, > label: string, > group: { > name: string, > label: string, > priority: number > }, > priority: number, > value_type: number, > value_type_description: string > } | null > }, > html: string, > text: string > }[] > ``` *** ## Oauth ### authorize `oauth.authorize` Build the Exist OAuth2 authorisation URL a user visits to grant access, with a CSRF state value; makes no API call **Risk:** `read` ```ts theme={null} await corsair.exist.api.oauth.authorize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scopes` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `state` | `string` | Yes | — | | `scopes` | `string[]` | Yes | — | *** ## Users ### getProfile `users.getProfile` Get the authenticated Exist user profile and unit preferences **Risk:** `read` ```ts theme={null} await corsair.exist.api.users.getProfile({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `avatar` | `string` | No | — | | `timezone` | `string` | Yes | — | | `local_time` | `string` | Yes | — | | `imperial_distance` | `boolean` | Yes | — | | `imperial_weight` | `boolean` | Yes | — | | `imperial_energy` | `boolean` | Yes | — | | `imperial_liquid` | `boolean` | Yes | — | | `imperial_temperature` | `boolean` | Yes | — | | `trial` | `boolean` | Yes | — | | `delinquent` | `boolean` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/exist/database Exist local sync: searchable entities, `.search()` filters, and operators. The Exist plugin syncs data locally. Use `corsair.exist.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Attributes Path: `exist.db.attributes.search` ```ts theme={null} const rows = await corsair.exist.db.attributes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `template` | `string` | equals, contains, startsWith, endsWith, in | | `group_name` | `string` | equals, contains, startsWith, endsWith, in | | `group_label` | `string` | equals, contains, startsWith, endsWith, in | | `service_name` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `manual` | `boolean` | equals | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `value_type` | `number` | equals, gt, gte, lt, lte, in | | `value_type_description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Attribute Values Path: `exist.db.attributeValues.search` ```ts theme={null} const rows = await corsair.exist.db.attributeValues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `attribute` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Averages Path: `exist.db.averages.search` ```ts theme={null} const rows = await corsair.exist.db.averages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `attribute` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `overall` | `number` | equals, gt, gte, lt, lte, in | | `monday` | `number` | equals, gt, gte, lt, lte, in | | `tuesday` | `number` | equals, gt, gte, lt, lte, in | | `wednesday` | `number` | equals, gt, gte, lt, lte, in | | `thursday` | `number` | equals, gt, gte, lt, lte, in | | `friday` | `number` | equals, gt, gte, lt, lte, in | | `saturday` | `number` | equals, gt, gte, lt, lte, in | | `sunday` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Correlations Path: `exist.db.correlations.search` ```ts theme={null} const rows = await corsair.exist.db.correlations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `attribute` | `string` | equals, contains, startsWith, endsWith, in | | `attribute2` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `period` | `number` | equals, gt, gte, lt, lte, in | | `offset` | `number` | equals, gt, gte, lt, lte, in | | `value` | `number` | equals, gt, gte, lt, lte, in | | `p` | `number` | equals, gt, gte, lt, lte, in | | `percentage` | `number` | equals, gt, gte, lt, lte, in | | `stars` | `number` | equals, gt, gte, lt, lte, in | | `second_person` | `string` | equals, contains, startsWith, endsWith, in | | `strength_description` | `string` | equals, contains, startsWith, endsWith, in | | `stars_description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Insights Path: `exist.db.insights.search` ```ts theme={null} const rows = await corsair.exist.db.insights.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type_name` | `string` | equals, contains, startsWith, endsWith, in | | `target_date` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `attribute` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `html` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Profile Path: `exist.db.profile.search` ```ts theme={null} const rows = await corsair.exist.db.profile.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `avatar` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `local_time` | `string` | equals, contains, startsWith, endsWith, in | | `imperial_distance` | `boolean` | equals | | `imperial_weight` | `boolean` | equals | | `imperial_energy` | `boolean` | equals | | `imperial_liquid` | `boolean` | equals | | `imperial_temperature` | `boolean` | equals | | `trial` | `boolean` | equals | | `delinquent` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/exist/overview Exist plugin for Corsair Use **Exist** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 13 typed API operations * 6 synced entities (`attributes`, `attributeValues`, `averages`, `correlations`, `insights`, `profile`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/exist ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/exist ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/exist ``` ```bash bun theme={null} bun add corsair @corsair-dev/exist ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { exist } from '@corsair-dev/exist'; export const corsair = createCorsair({ plugins: [ exist(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Exist OAuth app. ```ts theme={null} exist() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'exist', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`attributes.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.exist.api.attributes.list({}); ``` **`attributes.acquire`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.exist.api.attributes.acquire({}); ``` See the full list on the [API](/plugins/exist/api) page. ## Query synced data Synced entities support `tenant.exist.db..search()` and `.list()`: `attributes`, `attributeValues`, `averages`, `correlations`, `insights`, `profile`. See [Database](/plugins/exist/database) for filters and operators. ## What's next > **[API reference](/plugins/exist/api)** > > Every `exist.api.*` operation with input and output types. > **[Database](/plugins/exist/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/extractaai/api API reference for Extractaai: every `extractaai.api.*` operation with input and output types. Every `extractaai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Classification ### create `classification.create` Create a document classification (EXTRACTA\_AI\_CREATE\_CLASSIFICATION) **Risk:** `write` ```ts theme={null} await corsair.extractaai.api.classification.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `classificationDetails` | `object` | Yes | — | > **classificationDetails full type** > > ```ts theme={null} > { > name: string, > description?: string, > documentTypes: { > name: string, > description: string, > uniqueWords: string[], > extractionId?: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `created` | Yes | — | | `createdAt` | `number` | Yes | — | | `classificationId` | `string` | Yes | — | *** ### delete `classification.delete` Delete a document classification (EXTRACTA\_AI\_DELETE\_CLASSIFICATION) \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.extractaai.api.classification.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `classificationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `success` | Yes | — | | `message` | `string` | No | — | *** ### update `classification.update` Update a document classification (EXTRACTA\_AI\_UPDATE\_CLASSIFICATION) **Risk:** `write` ```ts theme={null} await corsair.extractaai.api.classification.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `classificationId` | `string` | Yes | — | | `classificationDetails` | `object` | Yes | — | > **classificationDetails full type** > > ```ts theme={null} > { > name: string, > description: string, > documentTypes: { > name: string, > description: string, > uniqueWords: string[], > extractionId?: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `updated` | Yes | — | | `updatedAt` | `number` | Yes | — | | `classificationId` | `string` | Yes | — | *** ### view `classification.view` View a document classification configuration (EXTRACTA\_AI\_VIEW\_CLASSIFICATION) **Risk:** `read` ```ts theme={null} await corsair.extractaai.api.classification.view({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `classificationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `success` | Yes | — | | `classificationId` | `string` | Yes | — | | `classificationDetails` | `object` | Yes | — | > **classificationDetails full type** > > ```ts theme={null} > { > createdAt?: number, > name: string, > description?: string, > documentTypes: { > name: string, > description: string, > uniqueWords: string[], > extractionId?: string > }[] > } > ``` *** ## Credits ### get `credits.get` Get the account credit balance (EXTRACTA\_AI\_GET\_CREDITS) **Risk:** `read` ```ts theme={null} await corsair.extractaai.api.credits.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok` | Yes | — | | `credits` | `number` | Yes | — | *** ## Extraction ### create `extraction.create` Create a document extraction template (EXTRACTA\_AI\_CREATE\_EXTRACTION) **Risk:** `write` ```ts theme={null} await corsair.extractaai.api.extraction.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `extractionDetails` | `object` | Yes | — | > **extractionDetails full type** > > ```ts theme={null} > { > name: string, > description?: string, > language: string, > options?: { > hasTable?: boolean, > hasVisuals?: boolean, > handwrittenTextRecognition?: boolean, > checkboxRecognition?: boolean, > longDocument?: boolean, > splitPdfPages?: boolean, > specificPageProcessing?: boolean, > specificPageProcessingOptions?: { > from: number, > to: number > } > }, > fields: { > key: string, > description?: string, > example?: string, > type?: string | object | array, > properties?: lazy[], > items?: { > type: string | object, > example?: string, > properties?: lazy[] > } > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `created` | Yes | — | | `createdAt` | `number` | Yes | — | | `extractionId` | `string` | Yes | — | *** ### delete `extraction.delete` Delete an extraction, batch, or file (EXTRACTA\_AI\_DELETE\_EXTRACTION) \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.extractaai.api.extraction.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `extractionId` | `string` | Yes | — | | `batchId` | `string` | No | — | | `fileId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `deleted` | Yes | — | | `deletedAt` | `number` | Yes | — | *** ### getBatchResults `extraction.getBatchResults` Get extraction results for a batch (EXTRACTA\_AI\_GET\_BATCH\_RESULTS) **Risk:** `read` ```ts theme={null} await corsair.extractaai.api.extraction.getBatchResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `extractionId` | `string` | Yes | — | | `batchId` | `string` | Yes | — | | `fileId` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status: waiting, > extractionId?: string, > batchId?: string, > fileId?: string > } | { > extractionId: string, > batchId: string, > fileId?: string, > files: { > fileId?: string, > fileName?: string, > status: string, > result?: lazy, > url?: string > }[] > } > ``` *** ### update `extraction.update` Update a document extraction configuration (EXTRACTA\_AI\_UPDATE\_EXTRACTION) **Risk:** `write` ```ts theme={null} await corsair.extractaai.api.extraction.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `extractionId` | `string` | Yes | — | | `extractionDetails` | `object` | Yes | — | > **extractionDetails full type** > > ```ts theme={null} > { > name?: string, > description?: string, > language?: string, > options?: { > hasTable?: boolean, > hasVisuals?: boolean, > handwrittenTextRecognition?: boolean, > checkboxRecognition?: boolean, > longDocument?: boolean, > splitPdfPages?: boolean, > specificPageProcessing?: boolean, > specificPageProcessingOptions?: { > from: number, > to: number > } > }, > fields?: { > key: string, > description?: string, > example?: string, > type?: string | object | array, > properties?: lazy[], > items?: { > type: string | object, > example?: string, > properties?: lazy[] > } > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `updated` | Yes | — | | `updatedAt` | `number` | Yes | — | | `extractionId` | `string` | Yes | — | *** ### view `extraction.view` View a document extraction configuration (EXTRACTA\_AI\_VIEW\_EXTRACTION) **Risk:** `read` ```ts theme={null} await corsair.extractaai.api.extraction.view({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `extractionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `extractionId` | `string` | Yes | — | | `extractionDetails` | `object` | Yes | — | > **extractionDetails full type** > > ```ts theme={null} > { > name: string, > description?: string, > language: string, > options?: { > hasTable?: boolean, > hasVisuals?: boolean, > handwrittenTextRecognition?: boolean, > checkboxRecognition?: boolean, > longDocument?: boolean, > splitPdfPages?: boolean, > specificPageProcessing?: boolean, > specificPageProcessingOptions?: { > from: number, > to: number > } > }, > fields: { > key: string, > description?: string, > example?: string, > type?: string | object | array, > properties?: lazy[], > items?: { > type: string | object, > example?: string, > properties?: lazy[] > } > }[], > status?: string, > batches?: { > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/extractaai/database Extractaai local sync: searchable entities, `.search()` filters, and operators. The Extractaai plugin syncs data locally. Use `corsair.extractaai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Classifications Path: `extractaai.db.classifications.search` ```ts theme={null} const rows = await corsair.extractaai.db.classifications.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `classificationId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Extractions Path: `extractaai.db.extractions.search` ```ts theme={null} const rows = await corsair.extractaai.db.extractions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `extractionId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/extractaai/overview Extractaai plugin for Corsair Use **Extractaai** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 10 typed API operations * 2 synced entities (`classifications`, `extractions`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/extractaai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/extractaai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/extractaai ``` ```bash bun theme={null} bun add corsair @corsair-dev/extractaai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { extractaai } from '@corsair-dev/extractaai'; export const corsair = createCorsair({ plugins: [ extractaai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} extractaai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'extractaai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`classification.view`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.extractaai.api.classification.view({}); ``` **`classification.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.extractaai.api.classification.create({}); ``` See the full list on the [API](/plugins/extractaai/api) page. ## Query synced data Synced entities support `tenant.extractaai.db..search()` and `.list()`: `classifications`, `extractions`. See [Database](/plugins/extractaai/database) for filters and operators. ## What's next > **[API reference](/plugins/extractaai/api)** > > Every `extractaai.api.*` operation with input and output types. > **[Database](/plugins/extractaai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/facebook/api API reference for Facebook: every `facebook.api.*` operation with input and output types. Every `facebook.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Comments ### create `comments.create` Create a comment on a Page post or other object. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.comments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `object_id` | `string` | Yes | Post ID, photo ID, or other commentable object ID. | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when object\_id is composite PageID\_PostID. | | `message` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `comments.delete` Delete a comment. **Risk:** `write` · **Irreversible** ```ts theme={null} await corsair.facebook.api.comments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | — | | `page_id` | `string` | Yes | Page ID used to resolve the Page access token. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `comments.get` Retrieve a single comment by ID. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.comments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | — | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when comment\_id embeds the page id. | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `message` | `string` | No | — | | `created_time` | `string` | No | — | | `from` | `object` | No | — | | `is_hidden` | `boolean` | No | — | | `like_count` | `number` | No | — | | `comment_count` | `number` | No | — | > **from full type** > > ```ts theme={null} > { > id?: string, > name?: string > } > ``` *** ### list `comments.list` List comments on a Page post or other object. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `object_id` | `string` | Yes | Object ID whose comments should be listed. | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when object\_id is composite PageID\_PostID. | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `filter` | `stream \| toplevel` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > message?: string, > created_time?: string, > from?: { > id?: string, > name?: string > }, > is_hidden?: boolean, > like_count?: number, > comment_count?: number > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### update `comments.update` Update or hide a comment. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.comments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | — | | `page_id` | `string` | Yes | Page ID used to resolve the Page access token. | | `message` | `string` | No | — | | `is_hidden` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Conversations ### getMessages `conversations.getMessages` List messages in a Messenger conversation. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.conversations.getMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `conversation_id` | `string` | Yes | — | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > message?: string, > created_time?: string, > from?: { > id?: string, > name?: string, > email?: string > }, > to?: { > data?: { > id?: string, > name?: string, > email?: string > }[] > }, > attachments?: { > data?: { > }[] > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### list `conversations.list` List Messenger conversations for a Page (optional platform filter). **Risk:** `read` ```ts theme={null} await corsair.facebook.api.conversations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | Facebook Page ID | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `platform` | `messenger \| instagram \| whatsapp` | No | Filter conversations by messaging platform. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > link?: string, > updated_time?: string, > message_count?: number, > unread_count?: number, > snippet?: string, > participants?: { > data?: { > id?: string, > name?: string, > email?: string > }[] > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ## Messages ### getDetails `messages.getDetails` Retrieve a single Messenger message by ID. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.messages.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `message_id` | `string` | Yes | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `message` | `string` | No | — | | `created_time` | `string` | No | — | | `from` | `object` | No | — | | `to` | `object` | No | — | | `attachments` | `object` | No | — | > **from full type** > > ```ts theme={null} > { > id?: string, > name?: string, > email?: string > } > ``` > **to full type** > > ```ts theme={null} > { > data?: { > id?: string, > name?: string, > email?: string > }[] > } > ``` > **attachments full type** > > ```ts theme={null} > { > data?: { > }[] > } > ``` *** ### markSeen `messages.markSeen` Mark the most recent messages in a conversation as seen. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.messages.markSeen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `recipient_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `recipient_id` | `string` | No | — | | `message_id` | `string` | No | — | *** ### send `messages.send` Send a text Messenger message from a Page. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `recipient_id` | `string` | Yes | — | | `message` | `string` | Yes | — | | `messaging_type` | `RESPONSE \| UPDATE \| MESSAGE_TAG \| UTILITY` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `recipient_id` | `string` | No | — | | `message_id` | `string` | No | — | *** ### sendMedia `messages.sendMedia` Send a media Messenger message from a Page. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.messages.sendMedia({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `recipient_id` | `string` | Yes | — | | `attachment_type` | `image \| video \| audio \| file` | Yes | — | | `attachment_url` | `string` | Yes | — | | `messaging_type` | `RESPONSE \| UPDATE \| MESSAGE_TAG \| UTILITY` | No | — | | `tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `recipient_id` | `string` | No | — | | `message_id` | `string` | No | — | *** ### toggleTyping `messages.toggleTyping` Show or hide the Messenger typing indicator. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.messages.toggleTyping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `recipient_id` | `string` | Yes | — | | `action` | `typing_on \| typing_off` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `recipient_id` | `string` | No | — | | `message_id` | `string` | No | — | *** ## Pages ### assignTask `pages.assignTask` Assign Page tasks to a business/system user via /assigned\_users. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.pages.assignTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `user` | `string` | Yes | Business user or system user ID to assign tasks to. | | `tasks` | `string[]` | Yes | Page tasks such as MANAGE, CREATE\_CONTENT, MODERATE, ADVERTISE, ANALYZE. | | `business` | `string` | No | Business ID. Required for many Business Manager assigned\_users flows. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getDetails `pages.getDetails` Retrieve metadata for a Facebook Page. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.pages.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | Facebook Page ID | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `access_token` | `string` | No | — | | `category` | `string` | No | — | | `category_list` | `object[]` | No | — | | `tasks` | `string[]` | No | — | | `about` | `string` | No | — | | `link` | `string` | No | — | | `phone` | `string` | No | — | | `website` | `string` | No | — | | `emails` | `string[]` | No | — | | `picture` | `object` | No | — | > **category\_list full type** > > ```ts theme={null} > { > id?: string, > name?: string > }[] > ``` > **picture full type** > > ```ts theme={null} > { > data?: { > url?: string > } > } > ``` *** ### getInsights `pages.getInsights` Retrieve Page insights for the given metrics and period. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.pages.getInsights({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | Facebook Page ID | | `metric` | `string \| string[]` | Yes | Insight metric name(s), e.g. page\_follows, page\_views\_total. | | `period` | `day \| week \| days_28 \| month \| lifetime` | No | — | | `since` | `string \| number` | No | — | | `until` | `string \| number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > name: string, > period?: string, > values?: { > value: number | string | { > }, > end_time?: string > }[], > title?: string, > description?: string, > id?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### getRoles `pages.getRoles` List users and their roles on a Facebook Page. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.pages.getRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | Facebook Page ID | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > tasks?: string[], > role?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### listManaged `pages.listManaged` List Facebook Pages the authenticated user manages, including page access tokens. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.pages.listManaged({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > access_token?: string, > category?: string, > category_list?: { > id?: string, > name?: string > }[], > tasks?: string[], > about?: string, > link?: string, > phone?: string, > website?: string, > emails?: string[], > picture?: { > data?: { > url?: string > } > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### removeTask `pages.removeTask` Remove a business/system user from Page task assignments. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.pages.removeTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `user` | `string` | Yes | Business user or system user ID to remove from Page tasks. | | `business` | `string` | No | Business ID. Required for many Business Manager assigned\_users flows. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### search `pages.search` Search Pages via /pages/search (deprecated for most apps; Workplace-only). Prefer pages.listManaged or pages.getDetails. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.pages.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Search query for page names. | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > access_token?: string, > category?: string, > category_list?: { > id?: string, > name?: string > }[], > tasks?: string[], > about?: string, > link?: string, > phone?: string, > website?: string, > emails?: string[], > picture?: { > data?: { > url?: string > } > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### updateSettings `pages.updateSettings` Update editable settings on a Facebook Page. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.pages.updateSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `about` | `string` | No | — | | `description` | `string` | No | — | | `emails` | `string[]` | No | — | | `phone` | `string` | No | — | | `website` | `string` | No | — | | `general_info` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Photos ### addToAlbum `photos.addToAlbum` Add a photo to an existing album. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.photos.addToAlbum({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `album_id` | `string` | Yes | — | | `page_id` | `string` | Yes | Page ID used to resolve the Page access token. | | `url` | `string` | Yes | Publicly accessible image URL. | | `caption` | `string` | No | — | | `message` | `string` | No | Deprecated alias for caption; mapped to caption at runtime. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createAlbum `photos.createAlbum` Create a photo album on a Page. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.photos.createAlbum({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `message` | `string` | No | — | | `location` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createPost `photos.createPost` Create and publish a photo post on a Page (uses caption per Graph docs). **Risk:** `write` ```ts theme={null} await corsair.facebook.api.photos.createPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `caption` | `string` | No | Preferred photo caption field per Graph docs. | | `message` | `string` | No | Deprecated alias for caption; mapped to caption at runtime. | | `published` | `boolean` | No | — | | `scheduled_publish_time` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### list `photos.list` List Page photos via /photos (defaults to type=uploaded). **Risk:** `read` ```ts theme={null} await corsair.facebook.api.photos.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | Facebook Page ID | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `type` | `uploaded \| profile \| tagged` | No | Defaults to uploaded. Graph defaults to profile without this. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > created_time?: string, > source?: string, > link?: string, > images?: { > height?: number, > width?: number, > source?: string > }[] > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### upload `photos.upload` Upload a photo to a Page. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.photos.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `url` | `string` | Yes | Publicly accessible image URL. | | `caption` | `string` | No | — | | `published` | `boolean` | No | Defaults to false so the photo can be attached to a feed post. | | `temporary` | `boolean` | No | — | | `no_story` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### uploadBatch `photos.uploadBatch` Upload multiple photos using the Graph API batch endpoint. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.photos.uploadBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `photos` | `object[]` | Yes | — | > **photos full type** > > ```ts theme={null} > { > url: string, > caption?: string, > published?: boolean > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > code: number, > headers?: { > name: string, > value: string > }[], > body?: string > }[] > ``` *** ## Posts ### create `posts.create` Publish or schedule a Page feed post (supports attached\_media for multi-photo). **Risk:** `write` ```ts theme={null} await corsair.facebook.api.posts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `message` | `string` | No | — | | `link` | `string` | No | — | | `published` | `boolean` | No | — | | `scheduled_publish_time` | `number` | No | — | | `unpublished_content_type` | `SCHEDULED \| DRAFT \| ADS_POST` | No | Required by Graph for some unpublished/scheduled media attach flows. | | `attached_media` | `object[]` | No | Multi-photo/video attach. Upload unpublished media first, then pass media\_fbid values. | | `targeting` | `object` | No | — | > **attached\_media full type** > > ```ts theme={null} > { > media_fbid: string > }[] > ``` > **targeting full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `posts.delete` Delete a Page post. **Risk:** `write` · **Irreversible** ```ts theme={null} await corsair.facebook.api.posts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `post_id` | `string` | Yes | — | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when post\_id is composite PageID\_PostID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `posts.get` Retrieve a single Page post by ID. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.posts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `post_id` | `string` | Yes | — | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when post\_id is composite PageID\_PostID. | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `message` | `string` | No | — | | `created_time` | `string` | No | — | | `updated_time` | `string` | No | — | | `is_published` | `boolean` | No | — | | `scheduled_publish_time` | `number` | No | — | | `status_type` | `string` | No | — | | `permalink_url` | `string` | No | — | | `full_picture` | `string` | No | — | *** ### getInsights `posts.getInsights` Retrieve insights for a Page post. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.posts.getInsights({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `post_id` | `string` | Yes | — | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when post\_id is composite PageID\_PostID. | | `metric` | `string \| string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > name: string, > period?: string, > values?: { > value: number | string | { > }, > end_time?: string > }[], > title?: string, > description?: string, > id?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### getReactions `posts.getReactions` List reactions on a Page post. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.posts.getReactions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `post_id` | `string` | Yes | — | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when post\_id is composite PageID\_PostID. | | `type` | `LIKE \| LOVE \| WOW \| HAHA \| SAD \| ANGRY \| CARE` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > type?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### list `posts.list` List Page timeline content via /feed (page posts + visitor posts + tagged posts). **Risk:** `read` ```ts theme={null} await corsair.facebook.api.posts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | Facebook Page ID | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > message?: string, > created_time?: string, > updated_time?: string, > is_published?: boolean, > scheduled_publish_time?: number, > status_type?: string, > permalink_url?: string, > full_picture?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### listScheduled `posts.listScheduled` List scheduled but unpublished Page posts. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.posts.listScheduled({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | Facebook Page ID | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > message?: string, > created_time?: string, > updated_time?: string, > is_published?: boolean, > scheduled_publish_time?: number, > status_type?: string, > permalink_url?: string, > full_picture?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### listTagged `posts.listTagged` List posts in which the Page is tagged. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.posts.listTagged({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | Facebook Page ID | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > message?: string, > created_time?: string, > updated_time?: string, > is_published?: boolean, > scheduled_publish_time?: number, > status_type?: string, > permalink_url?: string, > full_picture?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### publishScheduled `posts.publishScheduled` Publish a previously scheduled post immediately. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.posts.publishScheduled({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `post_id` | `string` | Yes | — | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when post\_id is composite PageID\_PostID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### reschedule `posts.reschedule` Change the scheduled publish time of a post. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.posts.reschedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `post_id` | `string` | Yes | — | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when post\_id is composite PageID\_PostID. | | `scheduled_publish_time` | `number` | Yes | Unix timestamp for the new scheduled publish time. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### update `posts.update` Update an existing Page post. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.posts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `post_id` | `string` | Yes | — | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when post\_id is composite PageID\_PostID. | | `message` | `string` | No | — | | `is_hidden` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Reactions ### add `reactions.add` Add a LIKE to a post or comment via /likes (Graph only allows LIKE programmatically). **Risk:** `write` ```ts theme={null} await corsair.facebook.api.reactions.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `object_id` | `string` | Yes | Post ID, comment ID, or other reactable object ID. | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when object\_id is composite PageID\_PostID. | | `type` | `LIKE` | No | Only LIKE is supported by the Graph API for programmatic reactions. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### unlike `reactions.unlike` Remove a LIKE from a post or comment via DELETE /likes. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.reactions.unlike({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `object_id` | `string` | Yes | Post ID or comment ID to remove a like/reaction from. | | `page_id` | `string` | No | Page ID for Page-token auth. Optional when object\_id is composite PageID\_PostID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Users ### getCurrentUser `users.getCurrentUser` Get the authenticated Facebook user via /me. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.users.getCurrentUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | *** ### getUserPages `users.getUserPages` Deprecated. List Facebook Pages for the authenticated user via /me/accounts. **Risk:** `read` ```ts theme={null} await corsair.facebook.api.users.getUserPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > access_token?: string, > category?: string, > category_list?: { > id?: string, > name?: string > }[], > tasks?: string[], > about?: string, > link?: string, > phone?: string, > website?: string, > emails?: string[], > picture?: { > data?: { > url?: string > } > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ## Videos ### createPost `videos.createPost` Create a video post on a Page using file\_url. **Risk:** `write` ```ts theme={null} await corsair.facebook.api.videos.createPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `file_url` | `string` | Yes | Publicly accessible video URL. | | `title` | `string` | No | — | | `description` | `string` | No | — | | `published` | `boolean` | No | — | | `scheduled_publish_time` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### list `videos.list` List Page videos via GET //videos (Video API; needs pages\_read\_engagement + MANAGE). **Risk:** `read` ```ts theme={null} await corsair.facebook.api.videos.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | Facebook Page ID | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string, > description?: string, > created_time?: string, > source?: string, > length?: number, > permalink_url?: string, > status?: { > video_status?: string, > processing_progress?: number > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string, > previous?: string > } > ``` *** ### upload `videos.upload` Publish a Page video from file\_url (same edge as createPost; not resumable/chunked). **Risk:** `write` ```ts theme={null} await corsair.facebook.api.videos.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `file_url` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `published` | `boolean` | No | — | | `scheduled_publish_time` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/facebook/database Facebook local sync: searchable entities, `.search()` filters, and operators. The Facebook plugin syncs data locally. Use `corsair.facebook.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Albums Path: `facebook.db.albums.search` ```ts theme={null} const rows = await corsair.facebook.db.albums.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `albumId` | `string` | equals, contains, startsWith, endsWith, in | | `pageId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `photoCount` | `number` | equals, gt, gte, lt, lte, in | | `link` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Comments Path: `facebook.db.comments.search` ```ts theme={null} const rows = await corsair.facebook.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `commentId` | `string` | equals, contains, startsWith, endsWith, in | | `objectId` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `authorId` | `string` | equals, contains, startsWith, endsWith, in | | `authorName` | `string` | equals, contains, startsWith, endsWith, in | | `isHidden` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Conversations Path: `facebook.db.conversations.search` ```ts theme={null} const rows = await corsair.facebook.db.conversations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `conversationId` | `string` | equals, contains, startsWith, endsWith, in | | `pageId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedTime` | `string` | equals, contains, startsWith, endsWith, in | | `messageCount` | `number` | equals, gt, gte, lt, lte, in | | `unreadCount` | `number` | equals, gt, gte, lt, lte, in | | `snippet` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Insights Path: `facebook.db.insights.search` ```ts theme={null} const rows = await corsair.facebook.db.insights.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `insightId` | `string` | equals, contains, startsWith, endsWith, in | | `objectId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `period` | `string` | equals, contains, startsWith, endsWith, in | | `endTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `facebook.db.messages.search` ```ts theme={null} const rows = await corsair.facebook.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `messageId` | `string` | equals, contains, startsWith, endsWith, in | | `conversationId` | `string` | equals, contains, startsWith, endsWith, in | | `pageId` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `senderId` | `string` | equals, contains, startsWith, endsWith, in | | `senderName` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Page Roles Path: `facebook.db.pageRoles.search` ```ts theme={null} const rows = await corsair.facebook.db.pageRoles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `pageId` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pages Path: `facebook.db.pages.search` ```ts theme={null} const rows = await corsair.facebook.db.pages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `facebookId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `accessToken` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `about` | `string` | equals, contains, startsWith, endsWith, in | | `link` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Photos Path: `facebook.db.photos.search` ```ts theme={null} const rows = await corsair.facebook.db.photos.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `photoId` | `string` | equals, contains, startsWith, endsWith, in | | `pageId` | `string` | equals, contains, startsWith, endsWith, in | | `albumId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `link` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Posts Path: `facebook.db.posts.search` ```ts theme={null} const rows = await corsair.facebook.db.posts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `postId` | `string` | equals, contains, startsWith, endsWith, in | | `pageId` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `isPublished` | `boolean` | equals | | `permalinkUrl` | `string` | equals, contains, startsWith, endsWith, in | | `scheduledPublishTime` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Reactions Path: `facebook.db.reactions.search` ```ts theme={null} const rows = await corsair.facebook.db.reactions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `objectId` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `facebook.db.users.search` ```ts theme={null} const rows = await corsair.facebook.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `facebookUserId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Videos Path: `facebook.db.videos.search` ```ts theme={null} const rows = await corsair.facebook.db.videos.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `videoId` | `string` | equals, contains, startsWith, endsWith, in | | `pageId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `permalinkUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/facebook/overview Social media platform APIs for pages, posts, ads, and Meta business integrations. Use **Facebook** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 44 typed API operations * 12 synced entities (`albums`, `comments`, `conversations`, `insights`, `messages`, `pageRoles`, and 6 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/facebook ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/facebook ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/facebook ``` ```bash bun theme={null} bun add corsair @corsair-dev/facebook ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { facebook } from '@corsair-dev/facebook'; export const corsair = createCorsair({ plugins: [ facebook(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Facebook OAuth app. ```ts theme={null} facebook() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'facebook', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`comments.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.facebook.api.comments.get({}); ``` **`comments.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.facebook.api.comments.create({}); ``` See the full list on the [API](/plugins/facebook/api) page. ## Query synced data Synced entities support `tenant.facebook.db..search()` and `.list()`: `albums`, `comments`, `conversations`, `insights`, `messages`, `pageRoles`, `pages`, `photos`, `posts`, `reactions`, `users`, `videos`. See [Database](/plugins/facebook/database) for filters and operators. ## What's next > **[API reference](/plugins/facebook/api)** > > Every `facebook.api.*` operation with input and output types. > **[Database](/plugins/facebook/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/faraday/api API reference for Faraday: every `faraday.api.*` operation with input and output types. Every `faraday.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### create `accounts.create` Create a Faraday subaccount **Risk:** `write` ```ts theme={null} await corsair.faraday.api.accounts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `branding` | `object` | No | — | > **branding full type** > > ```ts theme={null} > { > suppress_from_reports?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `resource_type` | `string` | No | — | | `status` | `new \| starting \| running \| ready \| error \| string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `archived_at` | `string` | No | — | | `status_changed_at` | `string` | No | — | | `status_error` | `string` | No | — | | `last_read_input_at` | `string` | No | — | | `last_updated_config_at` | `string` | No | — | | `last_updated_output_at` | `string` | No | — | | `branding` | `object` | No | — | | `commitment` | `object` | No | — | | `contract_started_at` | `string` | No | — | | `identity_graph` | `object` | No | — | | `parent_account_id` | `string` | No | — | | `stripe_customer_id` | `string` | No | — | > **branding full type** > > ```ts theme={null} > { > suppress_from_reports?: boolean > } > ``` > **commitment full type** > > ```ts theme={null} > { > monthly_cost?: number, > renewal_date?: string > } > ``` > **identity\_graph full type** > > ```ts theme={null} > { > feature_store_id: string > } > ``` *** ### delete `accounts.delete` Delete a Faraday account **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.accounts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `accounts.get` Retrieve a Faraday account **Risk:** `read` ```ts theme={null} await corsair.faraday.api.accounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `resource_type` | `string` | No | — | | `status` | `new \| starting \| running \| ready \| error \| string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `archived_at` | `string` | No | — | | `status_changed_at` | `string` | No | — | | `status_error` | `string` | No | — | | `last_read_input_at` | `string` | No | — | | `last_updated_config_at` | `string` | No | — | | `last_updated_output_at` | `string` | No | — | | `branding` | `object` | No | — | | `commitment` | `object` | No | — | | `contract_started_at` | `string` | No | — | | `identity_graph` | `object` | No | — | | `parent_account_id` | `string` | No | — | | `stripe_customer_id` | `string` | No | — | > **branding full type** > > ```ts theme={null} > { > suppress_from_reports?: boolean > } > ``` > **commitment full type** > > ```ts theme={null} > { > monthly_cost?: number, > renewal_date?: string > } > ``` > **identity\_graph full type** > > ```ts theme={null} > { > feature_store_id: string > } > ``` *** ### getBilling `accounts.getBilling` Get billing for a Faraday account **Risk:** `read` ```ts theme={null} await corsair.faraday.api.accounts.getBilling({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getCurrent `accounts.getCurrent` Retrieve the current Faraday account **Risk:** `read` ```ts theme={null} await corsair.faraday.api.accounts.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `resource_type` | `string` | No | — | | `status` | `new \| starting \| running \| ready \| error \| string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `archived_at` | `string` | No | — | | `status_changed_at` | `string` | No | — | | `status_error` | `string` | No | — | | `last_read_input_at` | `string` | No | — | | `last_updated_config_at` | `string` | No | — | | `last_updated_output_at` | `string` | No | — | | `branding` | `object` | No | — | | `commitment` | `object` | No | — | | `contract_started_at` | `string` | No | — | | `identity_graph` | `object` | No | — | | `parent_account_id` | `string` | No | — | | `stripe_customer_id` | `string` | No | — | > **branding full type** > > ```ts theme={null} > { > suppress_from_reports?: boolean > } > ``` > **commitment full type** > > ```ts theme={null} > { > monthly_cost?: number, > renewal_date?: string > } > ``` > **identity\_graph full type** > > ```ts theme={null} > { > feature_store_id: string > } > ``` *** ### getCurrentBilling `accounts.getCurrentBilling` Get billing for the current Faraday account **Risk:** `read` ```ts theme={null} await corsair.faraday.api.accounts.getCurrentBilling({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `accounts.list` List Faraday accounts **Risk:** `read` ```ts theme={null} await corsair.faraday.api.accounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string, > resource_type?: string, > status?: new | starting | running | ready | error | string, > created_at?: string, > updated_at?: string, > archived_at?: string | null, > status_changed_at?: string, > status_error?: string | null, > last_read_input_at?: string, > last_updated_config_at?: string, > last_updated_output_at?: string, > branding?: { > suppress_from_reports?: boolean > }, > commitment?: { > monthly_cost?: number, > renewal_date?: string > }, > contract_started_at?: string, > identity_graph?: { > feature_store_id: string > }, > parent_account_id?: string, > stripe_customer_id?: string > }[] > ``` *** ### update `accounts.update` Update a Faraday account (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.accounts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `resource_type` | `string` | No | — | | `status` | `new \| starting \| running \| ready \| error \| string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `archived_at` | `string` | No | — | | `status_changed_at` | `string` | No | — | | `status_error` | `string` | No | — | | `last_read_input_at` | `string` | No | — | | `last_updated_config_at` | `string` | No | — | | `last_updated_output_at` | `string` | No | — | | `branding` | `object` | No | — | | `commitment` | `object` | No | — | | `contract_started_at` | `string` | No | — | | `identity_graph` | `object` | No | — | | `parent_account_id` | `string` | No | — | | `stripe_customer_id` | `string` | No | — | > **branding full type** > > ```ts theme={null} > { > suppress_from_reports?: boolean > } > ``` > **commitment full type** > > ```ts theme={null} > { > monthly_cost?: number, > renewal_date?: string > } > ``` > **identity\_graph full type** > > ```ts theme={null} > { > feature_store_id: string > } > ``` *** ## Attributes ### list `attributes.list` List Faraday attributes **Risk:** `read` ```ts theme={null} await corsair.faraday.api.attributes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ## Cohorts ### archive `cohorts.archive` Archive a Faraday cohort **Risk:** `write` ```ts theme={null} await corsair.faraday.api.cohorts.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### create `cohorts.create` Create a Faraday cohort **Risk:** `write` ```ts theme={null} await corsair.faraday.api.cohorts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### delete `cohorts.delete` Delete a Faraday cohort **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.cohorts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `cohorts.forceUpdate` Force update a Faraday cohort **Risk:** `write` ```ts theme={null} await corsair.faraday.api.cohorts.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `cohorts.get` Retrieve a Faraday cohort **Risk:** `read` ```ts theme={null} await corsair.faraday.api.cohorts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getMembershipAnalysis `cohorts.getMembershipAnalysis` Get Faraday cohort membership analysis **Risk:** `read` ```ts theme={null} await corsair.faraday.api.cohorts.getMembershipAnalysis({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `cohorts.list` List Faraday cohorts **Risk:** `read` ```ts theme={null} await corsair.faraday.api.cohorts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### unarchive `cohorts.unarchive` Unarchive a Faraday cohort **Risk:** `write` ```ts theme={null} await corsair.faraday.api.cohorts.unarchive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### update `cohorts.update` Update a Faraday cohort (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.cohorts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Connections ### archive `connections.archive` Archive a Faraday connection **Risk:** `write` ```ts theme={null} await corsair.faraday.api.connections.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### delete `connections.delete` Delete a Faraday connection **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.connections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `connections.forceUpdate` Force update a Faraday connection **Risk:** `write` ```ts theme={null} await corsair.faraday.api.connections.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### getDatasets `connections.getDatasets` List datasets for a Faraday connection **Risk:** `read` ```ts theme={null} await corsair.faraday.api.connections.getDatasets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getTargets `connections.getTargets` List targets for a Faraday connection **Risk:** `read` ```ts theme={null} await corsair.faraday.api.connections.getTargets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `connections.list` List Faraday connections **Risk:** `read` ```ts theme={null} await corsair.faraday.api.connections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### update `connections.update` Update a Faraday connection (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.connections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Datasets ### archive `datasets.archive` Archive a Faraday dataset **Risk:** `write` ```ts theme={null} await corsair.faraday.api.datasets.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### create `datasets.create` Create a Faraday dataset **Risk:** `write` ```ts theme={null} await corsair.faraday.api.datasets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### delete `datasets.delete` Delete a Faraday dataset **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.datasets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `datasets.forceUpdate` Force update a Faraday dataset **Risk:** `write` ```ts theme={null} await corsair.faraday.api.datasets.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `datasets.get` Retrieve a Faraday dataset **Risk:** `read` ```ts theme={null} await corsair.faraday.api.datasets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getIngressLogs `datasets.getIngressLogs` Get Faraday dataset ingress logs **Risk:** `read` ```ts theme={null} await corsair.faraday.api.datasets.getIngressLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `datasets.list` List Faraday datasets **Risk:** `read` ```ts theme={null} await corsair.faraday.api.datasets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### unarchive `datasets.unarchive` Unarchive a Faraday dataset **Risk:** `write` ```ts theme={null} await corsair.faraday.api.datasets.unarchive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### update `datasets.update` Update a Faraday dataset (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.datasets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Feature Stores ### list `featureStores.list` List Faraday feature stores **Risk:** `read` ```ts theme={null} await corsair.faraday.api.featureStores.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ## Graph ### get `graph.get` Retrieve the Faraday resource dependency graph **Risk:** `read` ```ts theme={null} await corsair.faraday.api.graph.get({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > downstream_id: string, > downstream_literate?: string, > downstream_status?: string, > downstream_type?: string, > upstream_id: string, > upstream_literate?: string, > upstream_status?: string, > upstream_type?: string > }[] > ``` *** ## Market Opportunity Analyses ### list `marketOpportunityAnalyses.list` List Faraday market opportunity analyses **Risk:** `read` ```ts theme={null} await corsair.faraday.api.marketOpportunityAnalyses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ## Outcomes ### archive `outcomes.archive` Archive a Faraday outcome **Risk:** `write` ```ts theme={null} await corsair.faraday.api.outcomes.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### create `outcomes.create` Create a Faraday outcome **Risk:** `write` ```ts theme={null} await corsair.faraday.api.outcomes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### delete `outcomes.delete` Delete a Faraday outcome **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.outcomes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `outcomes.forceUpdate` Force update a Faraday outcome **Risk:** `write` ```ts theme={null} await corsair.faraday.api.outcomes.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `outcomes.get` Retrieve a Faraday outcome **Risk:** `read` ```ts theme={null} await corsair.faraday.api.outcomes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `outcomes.list` List Faraday outcomes **Risk:** `read` ```ts theme={null} await corsair.faraday.api.outcomes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### unarchive `outcomes.unarchive` Unarchive a Faraday outcome **Risk:** `write` ```ts theme={null} await corsair.faraday.api.outcomes.unarchive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### update `outcomes.update` Update a Faraday outcome (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.outcomes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Persona Sets ### archive `personaSets.archive` Archive a Faraday persona set **Risk:** `write` ```ts theme={null} await corsair.faraday.api.personaSets.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### create `personaSets.create` Create a Faraday persona set **Risk:** `write` ```ts theme={null} await corsair.faraday.api.personaSets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### delete `personaSets.delete` Delete a Faraday persona set **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.personaSets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `personaSets.forceUpdate` Force update a Faraday persona set **Risk:** `write` ```ts theme={null} await corsair.faraday.api.personaSets.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `personaSets.get` Retrieve a Faraday persona set **Risk:** `read` ```ts theme={null} await corsair.faraday.api.personaSets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getAnalysisDimensions `personaSets.getAnalysisDimensions` Get Faraday persona set dimension analysis **Risk:** `read` ```ts theme={null} await corsair.faraday.api.personaSets.getAnalysisDimensions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getAnalysisFlow `personaSets.getAnalysisFlow` Get Faraday persona set flow analysis **Risk:** `read` ```ts theme={null} await corsair.faraday.api.personaSets.getAnalysisFlow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `personaSets.list` List Faraday persona sets **Risk:** `read` ```ts theme={null} await corsair.faraday.api.personaSets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### unarchive `personaSets.unarchive` Unarchive a Faraday persona set **Risk:** `write` ```ts theme={null} await corsair.faraday.api.personaSets.unarchive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### update `personaSets.update` Update a Faraday persona set (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.personaSets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Places ### archive `places.archive` Archive a Faraday place **Risk:** `write` ```ts theme={null} await corsair.faraday.api.places.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### create `places.create` Create a Faraday place **Risk:** `write` ```ts theme={null} await corsair.faraday.api.places.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### delete `places.delete` Delete a Faraday place **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.places.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `places.forceUpdate` Force update a Faraday place **Risk:** `write` ```ts theme={null} await corsair.faraday.api.places.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `places.get` Retrieve a Faraday place **Risk:** `read` ```ts theme={null} await corsair.faraday.api.places.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `places.list` List Faraday places **Risk:** `read` ```ts theme={null} await corsair.faraday.api.places.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### unarchive `places.unarchive` Unarchive a Faraday place **Risk:** `write` ```ts theme={null} await corsair.faraday.api.places.unarchive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### update `places.update` Update a Faraday place (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.places.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Recommenders ### list `recommenders.list` List Faraday recommenders **Risk:** `read` ```ts theme={null} await corsair.faraday.api.recommenders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ## Scopes ### archive `scopes.archive` Archive a Faraday scope **Risk:** `write` ```ts theme={null} await corsair.faraday.api.scopes.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### create `scopes.create` Create a Faraday scope **Risk:** `write` ```ts theme={null} await corsair.faraday.api.scopes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### delete `scopes.delete` Delete a Faraday scope **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.scopes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `scopes.forceUpdate` Force update a Faraday scope **Risk:** `write` ```ts theme={null} await corsair.faraday.api.scopes.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `scopes.get` Retrieve a Faraday scope **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getAnalysis `scopes.getAnalysis` Get Faraday scope analysis **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getAnalysis({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getDatasets `scopes.getDatasets` List datasets for a Faraday scope **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getDatasets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getEfficacy `scopes.getEfficacy` Get Faraday scope efficacy **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getEfficacy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getPayloadCohorts `scopes.getPayloadCohorts` Get Faraday scope payload cohorts **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getPayloadCohorts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getPayloadOutcomes `scopes.getPayloadOutcomes` Get Faraday scope payload outcomes **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getPayloadOutcomes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getPayloadPersonaSets `scopes.getPayloadPersonaSets` Get Faraday scope payload persona sets **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getPayloadPersonaSets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getPayloadRecommenders `scopes.getPayloadRecommenders` Get Faraday scope payload recommenders **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getPayloadRecommenders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getPopulationCohorts `scopes.getPopulationCohorts` Get Faraday scope population cohorts **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getPopulationCohorts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getPopulationExclusionCohorts `scopes.getPopulationExclusionCohorts` Get Faraday scope population exclusion cohorts **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getPopulationExclusionCohorts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getTargets `scopes.getTargets` Get Faraday scope targets **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.getTargets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `scopes.list` List Faraday scopes **Risk:** `read` ```ts theme={null} await corsair.faraday.api.scopes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### unarchive `scopes.unarchive` Unarchive a Faraday scope **Risk:** `write` ```ts theme={null} await corsair.faraday.api.scopes.unarchive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### update `scopes.update` Update a Faraday scope (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.scopes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Streams ### archive `streams.archive` Archive a Faraday stream **Risk:** `write` ```ts theme={null} await corsair.faraday.api.streams.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### create `streams.create` Create a Faraday stream **Risk:** `write` ```ts theme={null} await corsair.faraday.api.streams.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### delete `streams.delete` Delete a Faraday stream **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.streams.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `streams.forceUpdate` Force update a Faraday stream **Risk:** `write` ```ts theme={null} await corsair.faraday.api.streams.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `streams.get` Retrieve a Faraday stream **Risk:** `read` ```ts theme={null} await corsair.faraday.api.streams.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getAnalysis `streams.getAnalysis` Get Faraday stream event analysis **Risk:** `read` ```ts theme={null} await corsair.faraday.api.streams.getAnalysis({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `streams.list` List Faraday streams **Risk:** `read` ```ts theme={null} await corsair.faraday.api.streams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### unarchive `streams.unarchive` Unarchive a Faraday stream **Risk:** `write` ```ts theme={null} await corsair.faraday.api.streams.unarchive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### update `streams.update` Update a Faraday stream (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.streams.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Targets ### archive `targets.archive` Archive a Faraday target **Risk:** `write` ```ts theme={null} await corsair.faraday.api.targets.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### create `targets.create` Create a Faraday target **Risk:** `write` ```ts theme={null} await corsair.faraday.api.targets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### createPreview `targets.createPreview` Start a Faraday target preview delivery **Risk:** `write` ```ts theme={null} await corsair.faraday.api.targets.createPreview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### delete `targets.delete` Delete a Faraday target **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.targets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `targets.forceUpdate` Force update a Faraday target **Risk:** `write` ```ts theme={null} await corsair.faraday.api.targets.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `targets.get` Retrieve a Faraday target **Risk:** `read` ```ts theme={null} await corsair.faraday.api.targets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getAnalysis `targets.getAnalysis` Get Faraday target analysis **Risk:** `read` ```ts theme={null} await corsair.faraday.api.targets.getAnalysis({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `targets.list` List Faraday targets **Risk:** `read` ```ts theme={null} await corsair.faraday.api.targets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### update `targets.update` Update a Faraday target (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.targets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Traits ### archive `traits.archive` Archive a Faraday trait **Risk:** `write` ```ts theme={null} await corsair.faraday.api.traits.archive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### create `traits.create` Create a Faraday trait **Risk:** `write` ```ts theme={null} await corsair.faraday.api.traits.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### delete `traits.delete` Delete a Faraday trait **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.traits.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### deleteOrphaned `traits.deleteOrphaned` Delete all orphaned Faraday traits **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.traits.deleteOrphaned({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### forceUpdate `traits.forceUpdate` Force update a Faraday trait **Risk:** `write` ```ts theme={null} await corsair.faraday.api.traits.forceUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `traits.get` Retrieve a Faraday trait **Risk:** `read` ```ts theme={null} await corsair.faraday.api.traits.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getAnalysisDimensions `traits.getAnalysisDimensions` Get Faraday trait dimension analysis **Risk:** `read` ```ts theme={null} await corsair.faraday.api.traits.getAnalysisDimensions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### getCsv `traits.getCsv` Download Faraday traits as CSV **Risk:** `read` ```ts theme={null} await corsair.faraday.api.traits.getCsv({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | *** ### list `traits.list` List Faraday traits **Risk:** `read` ```ts theme={null} await corsair.faraday.api.traits.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### unarchive `traits.unarchive` Unarchive a Faraday trait **Risk:** `write` ```ts theme={null} await corsair.faraday.api.traits.unarchive({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_id?: string, > cohort_id?: string, > dataset_id?: string, > stream_id?: string, > outcome_id?: string, > persona_set_id?: string, > place_id?: string, > scope_id?: string, > target_id?: string, > trait_id?: string, > connection_id?: string, > webhook_endpoint_id?: string, > id?: string > }& { > cascade_to?: string[], > cascade_to_all?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### update `traits.update` Update a Faraday trait (JSON Merge Patch) **Risk:** `write` ```ts theme={null} await corsair.faraday.api.traits.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Uploads ### delete `uploads.delete` Delete a Faraday uploaded file **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.uploads.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `directory` | `string` | Yes | — | | `filename` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `uploads.get` Download a Faraday uploaded file **Risk:** `read` ```ts theme={null} await corsair.faraday.api.uploads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `directory` | `string` | Yes | — | | `filename` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > content: string > } | { > } > ``` *** ### list `uploads.list` List Faraday uploaded files **Risk:** `read` ```ts theme={null} await corsair.faraday.api.uploads.list({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ## Usages ### get `usages.get` Get Faraday account usage stats **Risk:** `read` ```ts theme={null} await corsair.faraday.api.usages.get({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ## Webhook Endpoints ### create `webhookEndpoints.create` Create a Faraday webhook endpoint **Risk:** `write` ```ts theme={null} await corsair.faraday.api.webhookEndpoints.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `enabled_events` | `resource.errored \| resource.ready_with_update[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### delete `webhookEndpoints.delete` Delete a Faraday webhook endpoint **Risk:** `destructive` ```ts theme={null} await corsair.faraday.api.webhookEndpoints.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > ok: true > } | { > } | { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } > ``` *** ### get `webhookEndpoints.get` Retrieve a Faraday webhook endpoint **Risk:** `read` ```ts theme={null} await corsair.faraday.api.webhookEndpoints.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | No | — | | `cohort_id` | `string` | No | — | | `dataset_id` | `string` | No | — | | `stream_id` | `string` | No | — | | `outcome_id` | `string` | No | — | | `persona_set_id` | `string` | No | — | | `place_id` | `string` | No | — | | `scope_id` | `string` | No | — | | `target_id` | `string` | No | — | | `trait_id` | `string` | No | — | | `connection_id` | `string` | No | — | | `webhook_endpoint_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** ### list `webhookEndpoints.list` List Faraday webhook endpoints **Risk:** `read` ```ts theme={null} await corsair.faraday.api.webhookEndpoints.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > }[] | { > } > ``` *** ### update `webhookEndpoints.update` Update a Faraday webhook endpoint **Risk:** `write` ```ts theme={null} await corsair.faraday.api.webhookEndpoints.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_endpoint_id` | `string` | Yes | — | | `url` | `string` | No | — | | `status` | `enabled \| disabled` | No | — | | `enabled_events` | `resource.errored \| resource.ready_with_update[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > resource_type?: string, > status?: string, > created_at?: string, > updated_at?: string, > archived_at?: string | null > } | { > } | { > ok: true > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/faraday/database Faraday local sync: searchable entities, `.search()` filters, and operators. The Faraday plugin syncs data locally. Use `corsair.faraday.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `faraday.db.accounts.search` ```ts theme={null} const rows = await corsair.faraday.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | | `contract_started_at` | `string` | equals, contains, startsWith, endsWith, in | | `parent_account_id` | `string` | equals, contains, startsWith, endsWith, in | | `stripe_customer_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Cohorts Path: `faraday.db.cohorts.search` ```ts theme={null} const rows = await corsair.faraday.db.cohorts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Connections Path: `faraday.db.connections.search` ```ts theme={null} const rows = await corsair.faraday.db.connections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Datasets Path: `faraday.db.datasets.search` ```ts theme={null} const rows = await corsair.faraday.db.datasets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Graph Edges Path: `faraday.db.graphEdges.search` ```ts theme={null} const rows = await corsair.faraday.db.graphEdges.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `downstream_id` | `string` | equals, contains, startsWith, endsWith, in | | `downstream_literate` | `string` | equals, contains, startsWith, endsWith, in | | `downstream_status` | `string` | equals, contains, startsWith, endsWith, in | | `downstream_type` | `string` | equals, contains, startsWith, endsWith, in | | `upstream_id` | `string` | equals, contains, startsWith, endsWith, in | | `upstream_literate` | `string` | equals, contains, startsWith, endsWith, in | | `upstream_status` | `string` | equals, contains, startsWith, endsWith, in | | `upstream_type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Outcomes Path: `faraday.db.outcomes.search` ```ts theme={null} const rows = await corsair.faraday.db.outcomes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Persona Sets Path: `faraday.db.personaSets.search` ```ts theme={null} const rows = await corsair.faraday.db.personaSets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Places Path: `faraday.db.places.search` ```ts theme={null} const rows = await corsair.faraday.db.places.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scopes Path: `faraday.db.scopes.search` ```ts theme={null} const rows = await corsair.faraday.db.scopes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Streams Path: `faraday.db.streams.search` ```ts theme={null} const rows = await corsair.faraday.db.streams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Targets Path: `faraday.db.targets.search` ```ts theme={null} const rows = await corsair.faraday.db.targets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Traits Path: `faraday.db.traits.search` ```ts theme={null} const rows = await corsair.faraday.db.traits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `resource_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_changed_at` | `string` | equals, contains, startsWith, endsWith, in | | `status_error` | `string` | equals, contains, startsWith, endsWith, in | | `last_read_input_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_config_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_output_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhook Endpoints Path: `faraday.db.webhookEndpoints.search` ```ts theme={null} const rows = await corsair.faraday.db.webhookEndpoints.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/faraday/overview Customer prediction platform for propensity scores, personas, and marketing intelligence. Use **Faraday** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 120 typed API operations * 13 synced entities (`accounts`, `cohorts`, `connections`, `datasets`, `graphEdges`, `outcomes`, and 7 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/faraday ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/faraday ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/faraday ``` ```bash bun theme={null} bun add corsair @corsair-dev/faraday ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { faraday } from '@corsair-dev/faraday'; export const corsair = createCorsair({ plugins: [ faraday(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} faraday() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'faraday', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.faraday.api.accounts.get({}); ``` **`accounts.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.faraday.api.accounts.create({}); ``` See the full list on the [API](/plugins/faraday/api) page. ## Query synced data Synced entities support `tenant.faraday.db..search()` and `.list()`: `accounts`, `cohorts`, `connections`, `datasets`, `graphEdges`, `outcomes`, `personaSets`, `places`, `scopes`, `streams`, `targets`, `traits`, `webhookEndpoints`. See [Database](/plugins/faraday/database) for filters and operators. ## What's next > **[API reference](/plugins/faraday/api)** > > Every `faraday.api.*` operation with input and output types. > **[Database](/plugins/faraday/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/figma/api API reference for Figma: every `figma.api.*` operation with input and output types. Every `figma.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Activity Logs ### list `activityLogs.list` List Figma organization activity logs **Risk:** `read` ```ts theme={null} await corsair.figma.api.activityLogs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `number` | No | — | | `end_time` | `number` | No | — | | `limit` | `number` | No | — | | `order` | `string` | No | — | | `events` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `activity_logs` | `any[]` | No | — | | `cursor` | `string` | No | — | | `next_page` | `boolean` | No | — | *** ## Comments ### add `comments.add` Add a comment to a Figma file **Risk:** `write` ```ts theme={null} await corsair.figma.api.comments.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | | `file_key` | `string` | Yes | — | | `comment_id` | `string` | No | — | | `client_meta` | `any` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `uuid` | `string` | No | — | | `message` | `string` | No | — | | `file_key` | `string` | No | — | | `order_id` | `string` | No | — | | `parent_id` | `string` | No | — | | `reactions` | `object[]` | No | — | | `created_at` | `string` | No | — | | `client_meta` | `any` | No | — | | `resolved_at` | `string` | No | — | | `user` | `object` | No | — | > **reactions full type** > > ```ts theme={null} > { > user?: { > id: string, > handle?: string, > img_url?: string > }, > emoji?: string, > created_at?: string > }[] > ``` > **user full type** > > ```ts theme={null} > { > id: string, > handle?: string, > img_url?: string > } > ``` *** ### addReaction `comments.addReaction` Add a reaction to a comment **Risk:** `write` ```ts theme={null} await corsair.figma.api.comments.addReaction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `comment_id` | `string` | Yes | — | | `emoji` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | | `error` | `boolean` | No | — | *** ### delete `comments.delete` Delete a comment from a Figma file **Risk:** `destructive` ```ts theme={null} await corsair.figma.api.comments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `comment_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | | `error` | `boolean` | No | — | *** ### deleteReaction `comments.deleteReaction` Delete a reaction from a comment **Risk:** `write` ```ts theme={null} await corsair.figma.api.comments.deleteReaction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `comment_id` | `string` | Yes | — | | `emoji` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | | `error` | `boolean` | No | — | *** ### getReactions `comments.getReactions` Get reactions on a comment **Risk:** `read` ```ts theme={null} await corsair.figma.api.comments.getReactions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `comment_id` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `reactions` | `object[]` | No | — | | `pagination` | `object` | No | — | > **reactions full type** > > ```ts theme={null} > { > user?: { > id: string, > handle?: string, > img_url?: string > }, > emoji?: string, > created_at?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > cursor?: string > } > ``` *** ### list `comments.list` List comments on a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `as_md` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `comments` | `object[]` | No | — | > **comments full type** > > ```ts theme={null} > { > id: string, > uuid?: string | null, > message?: string, > file_key?: string, > order_id?: string | null, > parent_id?: string | null, > reactions?: { > user?: { > id: string, > handle?: string, > img_url?: string > }, > emoji?: string, > created_at?: string > }[], > created_at?: string, > client_meta?: any, > resolved_at?: string | null, > user?: { > id: string, > handle?: string, > img_url?: string > } > }[] > ``` *** ## Components ### get `components.get` Get a Figma component by key **Risk:** `read` ```ts theme={null} await corsair.figma.api.components.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `status` | `number` | No | — | > **meta full type** > > ```ts theme={null} > { > component?: { > key: string, > file_key?: string, > node_id?: string, > thumbnail_url?: string, > name?: string, > description?: string, > created_at?: string, > updated_at?: string, > containing_frame?: { > name?: string, > node_id?: string > }, > user?: { > id: string, > handle?: string, > img_url?: string > } > } > } > ``` *** ### getComponentSet `components.getComponentSet` Get a Figma component set by key **Risk:** `read` ```ts theme={null} await corsair.figma.api.components.getComponentSet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `status` | `number` | No | — | > **meta full type** > > ```ts theme={null} > { > component_set?: { > key: string, > name?: string, > description?: string, > thumbnail_url?: string > } > } > ``` *** ### getComponentSetsForFile `components.getComponentSetsForFile` Get all component sets in a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.components.getComponentSetsForFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > component_sets?: { > key: string, > name?: string > }[] > } > ``` *** ### getComponentSetsForTeam `components.getComponentSetsForTeam` Get all component sets for a Figma team **Risk:** `read` ```ts theme={null} await corsair.figma.api.components.getComponentSetsForTeam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `page_size` | `number` | No | — | | `after` | `number` | No | — | | `before` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `cursor` | `string` | No | — | > **meta full type** > > ```ts theme={null} > { > component_sets?: { > key: string, > name?: string > }[] > } > ``` *** ### getForFile `components.getForFile` Get all components in a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.components.getForFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `status` | `number` | No | — | > **meta full type** > > ```ts theme={null} > { > components?: { > key: string, > file_key?: string, > node_id?: string, > thumbnail_url?: string, > name?: string, > description?: string, > created_at?: string, > updated_at?: string, > containing_frame?: { > name?: string, > node_id?: string > }, > user?: { > id: string, > handle?: string, > img_url?: string > } > }[] > } > ``` *** ### getForTeam `components.getForTeam` Get all components for a Figma team **Risk:** `read` ```ts theme={null} await corsair.figma.api.components.getForTeam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `page_size` | `number` | No | — | | `after` | `number` | No | — | | `before` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `cursor` | `string` | No | — | > **meta full type** > > ```ts theme={null} > { > components?: { > key: string, > file_key?: string, > node_id?: string, > thumbnail_url?: string, > name?: string, > description?: string, > created_at?: string, > updated_at?: string, > containing_frame?: { > name?: string, > node_id?: string > }, > user?: { > id: string, > handle?: string, > img_url?: string > } > }[] > } > ``` *** ## Design Tools ### designTokensToTailwind `designTools.designTokensToTailwind` Convert Figma design tokens to a Tailwind CSS configuration **Risk:** `read` ```ts theme={null} await corsair.figma.api.designTools.designTokensToTailwind({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tokens` | `object` | Yes | — | | `prefix` | `string` | No | — | | `config_format` | `string` | No | — | | `include_font_imports` | `boolean` | No | — | > **tokens full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `config` | `string` | No | — | | `css` | `string` | No | — | *** ### discoverResources `designTools.discoverResources` Discover Figma files, projects, and teams **Risk:** `read` ```ts theme={null} await corsair.figma.api.designTools.discoverResources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `figma_url` | `string` | No | — | | `file_key` | `string` | No | — | | `team_id` | `string` | No | — | | `project_id` | `string` | No | — | | `max_depth` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `files` | `any[]` | No | — | | `projects` | `any[]` | No | — | | `teams` | `any[]` | No | — | *** ### downloadImages `designTools.downloadImages` Download rendered images for Figma nodes **Risk:** `read` ```ts theme={null} await corsair.figma.api.designTools.downloadImages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `images` | `object[]` | Yes | — | | `scale` | `number` | No | — | | `svg_include_id` | `boolean` | No | — | | `svg_outline_text` | `boolean` | No | — | | `svg_simplify_stroke` | `boolean` | No | — | > **images full type** > > ```ts theme={null} > { > node_id: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `images` | `object` | No | — | > **images full type** > > ```ts theme={null} > { > } > ``` *** ### extractDesignTokens `designTools.extractDesignTokens` Extract design tokens (variables and styles) from a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.designTools.extractDesignTokens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `include_variables` | `boolean` | No | — | | `include_local_styles` | `boolean` | No | — | | `extract_from_nodes` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tokens` | `object` | No | — | > **tokens full type** > > ```ts theme={null} > { > } > ``` *** ### extractPrototypeInteractions `designTools.extractPrototypeInteractions` Extract prototype interactions and flows from a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.designTools.extractPrototypeInteractions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `analyze_components` | `boolean` | No | — | | `include_animations` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `interactions` | `any[]` | No | — | | `flows` | `any[]` | No | — | *** ## Dev Resources ### create `devResources.create` Create dev resources on a Figma file **Risk:** `write` ```ts theme={null} await corsair.figma.api.devResources.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dev_resources` | `object[]` | Yes | — | > **dev\_resources full type** > > ```ts theme={null} > { > url: string, > name: string, > node_id: string, > file_key: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `links_created` | `object[]` | No | — | | `errors` | `object[]` | No | — | > **links\_created full type** > > ```ts theme={null} > { > id: string, > url: string, > name: string, > node_id: string, > file_key: string > }[] > ``` > **errors full type** > > ```ts theme={null} > { > error: string, > node_id?: string, > file_key?: string > }[] > ``` *** ### delete `devResources.delete` Delete a dev resource from a Figma file **Risk:** `destructive` ```ts theme={null} await corsair.figma.api.devResources.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `dev_resource_id` | `string` | Yes | — | **Output:** *empty object* *** ### get `devResources.get` Get dev resources for a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.devResources.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `node_ids` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dev_resources` | `object[]` | No | — | > **dev\_resources full type** > > ```ts theme={null} > { > id: string, > url: string, > name: string, > node_id: string, > file_key: string > }[] > ``` *** ### update `devResources.update` Update dev resources on a Figma file **Risk:** `write` ```ts theme={null} await corsair.figma.api.devResources.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dev_resources` | `object[]` | Yes | — | > **dev\_resources full type** > > ```ts theme={null} > { > id: string, > url?: string, > name?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `links_updated` | `object[]` | No | — | | `errors` | `object[]` | No | — | > **links\_updated full type** > > ```ts theme={null} > { > id: string, > url?: string, > name?: string > }[] > ``` > **errors full type** > > ```ts theme={null} > { > error: string, > dev_resource_id?: string > }[] > ``` *** ## Files ### getImageFills `files.getImageFills` Get image fills from a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.files.getImageFills({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `error` | `boolean` | No | — | > **meta full type** > > ```ts theme={null} > { > images?: { > } > } > ``` *** ### getJSON `files.getJSON` Get full Figma file JSON **Risk:** `read` ```ts theme={null} await corsair.figma.api.files.getJSON({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `version` | `string` | No | — | | `ids` | `string` | No | — | | `depth` | `number` | No | — | | `geometry` | `string` | No | — | | `plugin_data` | `string` | No | — | | `branch_data` | `boolean` | No | — | | `simplify` | `boolean` | No | — | | `include_raw` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `role` | `string` | No | — | | `lastModified` | `string` | No | — | | `editorType` | `string` | No | — | | `thumbnailUrl` | `string` | No | — | | `version` | `string` | No | — | | `document` | `any` | No | — | | `components` | `object` | No | — | | `styles` | `object` | No | — | > **components full type** > > ```ts theme={null} > { > } > ``` > **styles full type** > > ```ts theme={null} > { > } > ``` *** ### getMetadata `files.getMetadata` Get Figma file metadata **Risk:** `read` ```ts theme={null} await corsair.figma.api.files.getMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `role` | `string` | No | — | | `last_modified` | `string` | No | — | | `editorType` | `string` | No | — | | `thumbnail_url` | `string` | No | — | | `version` | `string` | No | — | *** ### getNodes `files.getNodes` Get specific nodes from a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.files.getNodes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `ids` | `string` | Yes | — | | `version` | `string` | No | — | | `depth` | `number` | No | — | | `geometry` | `string` | No | — | | `plugin_data` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `nodes` | `object` | No | — | > **nodes full type** > > ```ts theme={null} > { > } > ``` *** ### getProjectFiles `files.getProjectFiles` Get all files in a Figma project **Risk:** `read` ```ts theme={null} await corsair.figma.api.files.getProjectFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_data` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `files` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > key: string, > name?: string, > thumbnail_url?: string | null, > last_modified?: string > }[] > ``` *** ### getStyles `files.getStyles` Get styles from a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.files.getStyles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > styles?: { > key: string, > file_key?: string, > node_id?: string, > style_type?: string, > name?: string, > description?: string > }[] > } > ``` *** ### getVersions `files.getVersions` Get version history of a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.files.getVersions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `page_size` | `number` | No | — | | `before` | `number` | No | — | | `after` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `versions` | `object[]` | No | — | | `pagination` | `object` | No | — | > **versions full type** > > ```ts theme={null} > { > id: string, > created_at?: string, > label?: string | null, > description?: string | null, > user?: { > id: string, > handle?: string, > img_url?: string > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > cursor?: string > } > ``` *** ### renderImages `files.renderImages` Render Figma nodes as images **Risk:** `read` ```ts theme={null} await corsair.figma.api.files.renderImages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `ids` | `string` | Yes | — | | `scale` | `number` | No | — | | `format` | `jpg \| png \| svg \| pdf` | No | — | | `version` | `string` | No | — | | `contents_only` | `boolean` | No | — | | `svg_include_id` | `boolean` | No | — | | `svg_outline_text` | `boolean` | No | — | | `svg_include_node_id` | `boolean` | No | — | | `svg_simplify_stroke` | `boolean` | No | — | | `use_absolute_bounds` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `images` | `object` | No | — | | `err` | `string` | No | — | > **images full type** > > ```ts theme={null} > { > } > ``` *** ## Library Analytics ### componentActions `libraryAnalytics.componentActions` Get library component action analytics **Risk:** `read` ```ts theme={null} await corsair.figma.api.libraryAnalytics.componentActions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `group_by` | `string` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `any[]` | No | — | | `cursor` | `string` | No | — | | `next_page` | `boolean` | No | — | *** ### componentUsages `libraryAnalytics.componentUsages` Get library component usage analytics **Risk:** `read` ```ts theme={null} await corsair.figma.api.libraryAnalytics.componentUsages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `group_by` | `string` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `any[]` | No | — | | `cursor` | `string` | No | — | | `next_page` | `boolean` | No | — | *** ### styleActions `libraryAnalytics.styleActions` Get library style action analytics **Risk:** `read` ```ts theme={null} await corsair.figma.api.libraryAnalytics.styleActions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `group_by` | `string` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `any[]` | No | — | | `cursor` | `string` | No | — | | `next_page` | `boolean` | No | — | *** ### styleUsages `libraryAnalytics.styleUsages` Get library style usage analytics **Risk:** `read` ```ts theme={null} await corsair.figma.api.libraryAnalytics.styleUsages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `group_by` | `string` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `any[]` | No | — | | `cursor` | `string` | No | — | | `next_page` | `boolean` | No | — | *** ### variableActions `libraryAnalytics.variableActions` Get library variable action analytics **Risk:** `read` ```ts theme={null} await corsair.figma.api.libraryAnalytics.variableActions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `group_by` | `string` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `any[]` | No | — | | `cursor` | `string` | No | — | | `next_page` | `boolean` | No | — | *** ### variableUsages `libraryAnalytics.variableUsages` Get library variable usage analytics **Risk:** `read` ```ts theme={null} await corsair.figma.api.libraryAnalytics.variableUsages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `group_by` | `string` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `any[]` | No | — | | `cursor` | `string` | No | — | | `next_page` | `boolean` | No | — | *** ## Payments ### get `payments.get` Get payment information for a Figma plugin or widget **Risk:** `read` ```ts theme={null} await corsair.figma.api.payments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `plugin_id` | `string` | No | — | | `widget_id` | `string` | No | — | | `community_file_id` | `string` | No | — | | `plugin_payment_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `status` | `number` | No | — | > **meta full type** > > ```ts theme={null} > { > payment_information?: any > } > ``` *** ## Projects ### getTeamProjects `projects.getTeamProjects` Get all projects for a Figma team **Risk:** `read` ```ts theme={null} await corsair.figma.api.projects.getTeamProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `projects` | `object[]` | No | — | > **projects full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` *** ## Styles ### get `styles.get` Get a Figma style by key **Risk:** `read` ```ts theme={null} await corsair.figma.api.styles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > style?: { > key: string, > file_key?: string, > node_id?: string, > style_type?: string, > name?: string, > description?: string > } > } > ``` *** ### getForTeam `styles.getForTeam` Get all styles for a Figma team **Risk:** `read` ```ts theme={null} await corsair.figma.api.styles.getForTeam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | Yes | — | | `page_size` | `number` | No | — | | `after` | `number` | No | — | | `before` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > styles?: { > key: string, > name?: string, > style_type?: string > }[] > } > ``` *** ## Users ### getCurrent `users.getCurrent` Get the currently authenticated Figma user **Risk:** `read` ```ts theme={null} await corsair.figma.api.users.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `handle` | `string` | No | — | | `img_url` | `string` | No | — | | `email` | `string` | No | — | *** ## Variables ### createModifyDelete `variables.createModifyDelete` Create, modify, or delete variables in a Figma file **Risk:** `write` ```ts theme={null} await corsair.figma.api.variables.createModifyDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | | `variables` | `any[]` | No | — | | `variableModes` | `any[]` | No | — | | `variableModeValues` | `any[]` | No | — | | `variableCollections` | `any[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `status` | `number` | No | — | | `error` | `boolean` | No | — | > **meta full type** > > ```ts theme={null} > { > tempIdToRealId?: { > } > } > ``` *** ### getLocal `variables.getLocal` Get local variables from a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.variables.getLocal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `status` | `number` | No | — | | `error` | `boolean` | No | — | > **meta full type** > > ```ts theme={null} > { > variables?: { > }, > variableCollections?: { > } > } > ``` *** ### getPublished `variables.getPublished` Get published variables from a Figma file **Risk:** `read` ```ts theme={null} await corsair.figma.api.variables.getPublished({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `status` | `number` | No | — | | `error` | `boolean` | No | — | > **meta full type** > > ```ts theme={null} > { > variables?: { > }, > variableCollections?: { > } > } > ``` *** ## Webhooks ### create `webhooks.create` Create a Figma webhook **Risk:** `write` ```ts theme={null} await corsair.figma.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `string` | Yes | — | | `endpoint` | `string` | Yes | — | | `passcode` | `string` | Yes | — | | `status` | `ACTIVE \| PAUSED` | No | — | | `context` | `string` | No | — | | `context_id` | `string` | No | — | | `team_id` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `ACTIVE \| PAUSED` | No | — | | `context` | `team \| project \| file` | No | — | | `team_id` | `string` | No | — | | `endpoint` | `string` | No | — | | `passcode` | `string` | No | — | | `client_id` | `string` | No | — | | `context_id` | `string` | No | — | | `event_type` | `string` | No | — | | `description` | `string` | No | — | *** ### delete `webhooks.delete` Delete a Figma webhook **Risk:** `destructive` ```ts theme={null} await corsair.figma.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `status` | `ACTIVE \| PAUSED` | No | — | | `context` | `team \| project \| file` | No | — | | `team_id` | `string` | No | — | | `endpoint` | `string` | No | — | | `passcode` | `string` | No | — | | `client_id` | `string` | No | — | | `context_id` | `string` | No | — | | `event_type` | `string` | No | — | | `description` | `string` | No | — | *** ### get `webhooks.get` Get a Figma webhook by ID **Risk:** `read` ```ts theme={null} await corsair.figma.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `ACTIVE \| PAUSED` | No | — | | `context` | `team \| project \| file` | No | — | | `team_id` | `string` | No | — | | `endpoint` | `string` | No | — | | `passcode` | `string` | No | — | | `client_id` | `string` | No | — | | `context_id` | `string` | No | — | | `event_type` | `string` | No | — | | `description` | `string` | No | — | *** ### getRequests `webhooks.getRequests` Get webhook request history **Risk:** `read` ```ts theme={null} await corsair.figma.api.webhooks.getRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | No | — | > **requests full type** > > ```ts theme={null} > { > id: string, > webhook_id: string, > status?: string, > created_at?: string, > error?: { > } > }[] > ``` *** ### list `webhooks.list` List Figma webhooks **Risk:** `read` ```ts theme={null} await corsair.figma.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `context` | `string` | No | — | | `context_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | No | — | > **webhooks full type** > > ```ts theme={null} > { > id: string, > status?: ACTIVE | PAUSED, > context?: team | project | file | null, > team_id?: string | null, > endpoint?: string, > passcode?: string, > client_id?: string | null, > context_id?: string | null, > event_type?: string, > description?: string | null > }[] > ``` *** ### update `webhooks.update` Update a Figma webhook **Risk:** `write` ```ts theme={null} await corsair.figma.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | | `event_type` | `string` | No | — | | `endpoint` | `string` | No | — | | `passcode` | `string` | No | — | | `status` | `ACTIVE \| PAUSED` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `ACTIVE \| PAUSED` | No | — | | `context` | `team \| project \| file` | No | — | | `team_id` | `string` | No | — | | `endpoint` | `string` | No | — | | `passcode` | `string` | No | — | | `client_id` | `string` | No | — | | `context_id` | `string` | No | — | | `event_type` | `string` | No | — | | `description` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/figma/database Figma local sync: searchable entities, `.search()` filters, and operators. The Figma plugin syncs data locally. Use `corsair.figma.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Comments Path: `figma.db.comments.search` ```ts theme={null} const rows = await corsair.figma.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `file_key` | `string` | equals, contains, startsWith, endsWith, in | | `order_id` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `resolved_at` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_handle` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Components Path: `figma.db.components.search` ```ts theme={null} const rows = await corsair.figma.db.components.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `file_key` | `string` | equals, contains, startsWith, endsWith, in | | `node_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnail_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## File Metadata Path: `figma.db.fileMetadata.search` ```ts theme={null} const rows = await corsair.figma.db.fileMetadata.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `last_modified` | `string` | equals, contains, startsWith, endsWith, in | | `editorType` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnail_url` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Versions Path: `figma.db.versions.search` ```ts theme={null} const rows = await corsair.figma.db.versions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `file_key` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_handle` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhook Configs Path: `figma.db.webhookConfigs.search` ```ts theme={null} const rows = await corsair.figma.db.webhookConfigs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `team_id` | `string` | equals, contains, startsWith, endsWith, in | | `endpoint` | `string` | equals, contains, startsWith, endsWith, in | | `passcode` | `string` | equals, contains, startsWith, endsWith, in | | `client_id` | `string` | equals, contains, startsWith, endsWith, in | | `context_id` | `string` | equals, contains, startsWith, endsWith, in | | `event_type` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/figma/get-credentials Step-by-step instructions for obtaining Figma API credentials. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Personal access token ## Personal Access Token Setup ### Step 1: Create a Personal Access Token 1. Log in to [figma.com](https://www.figma.com) 2. Click your profile icon → **Settings** 3. Scroll to the **Personal access tokens** section 4. Click **Generate new token** 5. Give it a name (e.g., "Corsair Integration") 6. Copy the token immediately — you won't be able to see it again 7. Store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=figma api_key=your-personal-access-token ``` ## Webhook Setup (Optional) Figma webhooks use a passcode for verification (not an HMAC secret). 1. Use the Figma API or Corsair to create a webhook (`corsair.figma.api.webhooks.create`) 2. Provide a `passcode` in the webhook creation request 3. Store it as the `webhook_signature`: ```bash theme={null} pnpm corsair setup --plugin=figma webhook_signature=your-webhook-passcode ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Personal Access Token | All API calls | Figma Settings → Personal access tokens | | Webhook Passcode | Webhook verification | Set when creating the webhook | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/figma/overview Collaborative design tool for UI mockups, prototypes, components, and design system files. Use **Figma** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 50 typed API operations * 5 synced entities (`comments`, `components`, `fileMetadata`, `versions`, `webhookConfigs`) for fast `.search()` / `.list()` * 6 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/figma ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/figma ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/figma ``` ```bash bun theme={null} bun add corsair @corsair-dev/figma ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { figma } from '@corsair-dev/figma'; export const corsair = createCorsair({ plugins: [ figma(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/figma/get-credentials). ```ts theme={null} figma() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'figma', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Get file metadata** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.figma.api.files.getMetadata({ file_key: 'abcDEF123' }); ``` **Add a comment** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.figma.api.comments.add({ file_key: 'abcDEF123', message: 'Hello from Corsair' }); ``` See the full list on the [API](/plugins/figma/api) page. ## Query synced data Search synced file metadata without hitting Figma. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.figma.db.fileMetadata.search({ data: {}, limit: 50, }); ``` Synced entities: `comments`, `components`, `fileMetadata`, `versions`, `webhookConfigs`. See [Database](/plugins/figma/database) for filters and operators. ## Webhooks Fires when a Figma file is updated. Do not use ping.ping. ```ts theme={null} figma({ webhookHooks: { files: { fileUpdate: { after: async (ctx, result) => { console.log('Figma file updated:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/figma/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/figma/api)** > > Every `figma.api.*` operation with input and output types. > **[Database](/plugins/figma/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/figma/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/figma/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/figma/webhooks Figma incoming webhooks: event paths, payloads, and response data. The Figma plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/figma/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `files` * `fileComment` (`files.fileComment`) * `fileDelete` (`files.fileDelete`) * `fileUpdate` (`files.fileUpdate`) * `fileVersionUpdate` (`files.fileVersionUpdate`) * `library` * `libraryPublish` (`library.libraryPublish`) * `ping` * `ping` (`ping.ping`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Files ### File Comment `files.fileComment` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} figma({ webhookHooks: { files: { fileComment: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### File Delete `files.fileDelete` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} figma({ webhookHooks: { files: { fileDelete: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### File Update `files.fileUpdate` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} figma({ webhookHooks: { files: { fileUpdate: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### File Version Update `files.fileVersionUpdate` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} figma({ webhookHooks: { files: { fileVersionUpdate: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Library ### Library Publish `library.libraryPublish` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} figma({ webhookHooks: { library: { libraryPublish: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Ping ### Ping `ping.ping` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} figma({ webhookHooks: { ping: { ping: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/filevine/api API reference for Filevine: every `filevine.api.*` operation with input and output types. Every `filevine.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Contacts ### attach `contacts.attach` Attach a contact to a project **Risk:** `write` ```ts theme={null} await corsair.filevine.api.contacts.attach({ projectId: 123, contactId: 456 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `contactId` | `number` | Yes | — | | `role` | `string` | No | e.g. Client, Opposing Party, Witness | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output:** *empty object* *** ### create `contacts.create` Create a contact **Risk:** `write` ```ts theme={null} await corsair.filevine.api.contacts.create({ firstName: 'John', organization: 'Acme' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `organization` | `string` | No | — | | `emails` | `string[]` | No | — | | `phones` | `string[]` | No | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `number` | Yes | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `fullName` | `string` | No | — | | `organization` | `string` | No | — | | `emails` | `string[]` | No | — | | `phones` | `string[]` | No | — | | `createdDate` | `string` | No | — | | `modifiedDate` | `string` | No | — | *** ### get `contacts.get` Get a contact by ID **Risk:** `read` ```ts theme={null} await corsair.filevine.api.contacts.get({ contactId: 456 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `number` | Yes | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `number` | Yes | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `fullName` | `string` | No | — | | `organization` | `string` | No | — | | `emails` | `string[]` | No | — | | `phones` | `string[]` | No | — | | `createdDate` | `string` | No | — | | `modifiedDate` | `string` | No | — | *** ### list `contacts.list` List contacts with pagination **Risk:** `read` ```ts theme={null} await corsair.filevine.api.contacts.list({ limit: 50 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `q` | `string` | No | Search query | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `hasMore` | `boolean` | No | — | > **items full type** > > ```ts theme={null} > { > contactId: number, > firstName?: string, > lastName?: string, > fullName?: string, > organization?: string, > emails?: string[], > phones?: string[], > createdDate?: string, > modifiedDate?: string > }[] > ``` *** ## Deadlines ### create `deadlines.create` Create a deadline on a project **Risk:** `write` ```ts theme={null} await corsair.filevine.api.deadlines.create({ projectId: 123, name: 'Filing', dueDate: '2026-12-01T00:00:00Z' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `name` | `string` | Yes | — | | `dueDate` | `string` | Yes | ISO 8601 date-time | | `assigneeId` | `number` | No | — | | `reminders` | `object[]` | No | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | > **reminders full type** > > ```ts theme={null} > { > triggerOffsetMinutes: number, > notifyUserIds?: number[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `deadlineId` | `number` | Yes | — | | `projectId` | `number` | No | — | | `name` | `string` | No | — | | `dueDate` | `string` | No | — | | `status` | `open \| completed \| missed` | No | — | | `assigneeId` | `number` | No | — | | `reminders` | `object[]` | No | — | > **reminders full type** > > ```ts theme={null} > { > triggerOffsetMinutes?: number, > notifyUserIds?: number[] > }[] > ``` *** ### list `deadlines.list` List deadlines for a project **Risk:** `read` ```ts theme={null} await corsair.filevine.api.deadlines.list({ projectId: 123, limit: 50 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `status` | `open \| completed \| missed` | No | — | | `from` | `string` | No | Filter from date (YYYY-MM-DD) | | `to` | `string` | No | Filter to date (YYYY-MM-DD) | | `offset` | `number` | No | Pagination offset | | `limit` | `number` | No | Page size, max 1000 | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `hasMore` | `boolean` | No | — | > **items full type** > > ```ts theme={null} > { > deadlineId: number, > projectId?: number, > name?: string, > dueDate?: string, > status?: open | completed | missed, > assigneeId?: number, > reminders?: { > triggerOffsetMinutes?: number, > notifyUserIds?: number[] > }[] > }[] > ``` *** ## Documents ### get `documents.get` Get document metadata by ID **Risk:** `read` ```ts theme={null} await corsair.filevine.api.documents.get({ documentId: 123 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `number` | Yes | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `number` | Yes | — | | `projectId` | `number` | No | — | | `folderId` | `number` | No | — | | `filename` | `string` | No | — | | `size` | `number` | No | — | | `contentType` | `string` | No | — | | `tags` | `string[]` | No | — | | `sharedToPortal` | `boolean` | No | — | | `version` | `number` | No | — | | `uploadedBy` | `number` | No | — | | `createdDate` | `string` | No | — | | `modifiedDate` | `string` | No | — | *** ### list `documents.list` List documents in a project **Risk:** `read` ```ts theme={null} await corsair.filevine.api.documents.list({ projectId: 123, limit: 50 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `folderId` | `number` | No | — | | `tag` | `string` | No | — | | `offset` | `number` | No | Pagination offset | | `limit` | `number` | No | Page size, max 1000 | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `hasMore` | `boolean` | No | — | > **items full type** > > ```ts theme={null} > { > documentId: number, > projectId?: number, > folderId?: number, > filename?: string, > size?: number, > contentType?: string, > tags?: string[], > sharedToPortal?: boolean, > version?: number, > uploadedBy?: number, > createdDate?: string, > modifiedDate?: string > }[] > ``` *** ### upload `documents.upload` Upload a document to a project **Risk:** `write` ```ts theme={null} await corsair.filevine.api.documents.upload({ projectId: 123, filename: 'contract.pdf', file: new Blob(['content']) }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `filename` | `string` | No | Filename override, else derived from file | | `folderId` | `number` | No | — | | `tags` | `string[]` | No | — | | `sharedToPortal` | `boolean` | No | — | | `file` | `string \| custom \| custom \| custom` | No | File content: string \| Uint8Array (incl. Buffer) \| ArrayBuffer \| Blob (see fileEncoding) | | `fileEncoding` | `base64 \| text` | No | How to interpret string file content — 'base64' decodes to bytes, 'text' (default) uploads literally | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `number` | Yes | — | | `projectId` | `number` | No | — | | `folderId` | `number` | No | — | | `filename` | `string` | No | — | | `size` | `number` | No | — | | `contentType` | `string` | No | — | | `tags` | `string[]` | No | — | | `sharedToPortal` | `boolean` | No | — | | `version` | `number` | No | — | | `uploadedBy` | `number` | No | — | | `createdDate` | `string` | No | — | | `modifiedDate` | `string` | No | — | *** ## Identity ### getAccessToken `identity.getAccessToken` Exchange PAT for bearer token **Risk:** `write` ```ts theme={null} await corsair.filevine.api.identity.getAccessToken({ token: 'PAT_xxx' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | Yes | Filevine Personal Access Token (PAT) | | `scope` | `string` | No | OAuth scope — defaults to fv.api.gateway.access tenant filevine.v2.api.\* openid email fv.auth.tenant.read | | `client_id` | `string` | No | — | | `client_secret` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `access_token` | `string` | Yes | — | | `token_type` | `string` | No | — | | `expires_in` | `number` | No | — | | `scope` | `string` | No | — | *** ### getUserOrgsWithToken `identity.getUserOrgsWithToken` Get user and orgs for token (POST /fv-app/v2/utils/GetUserOrgsWithToken) **Risk:** `read` ```ts theme={null} await corsair.filevine.api.identity.getUserOrgsWithToken({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `UserId` | `object` | No | — | | `FirstName` | `string` | No | — | | `LastName` | `string` | No | — | | `Email` | `string` | No | — | | `Orgs` | `object[]` | No | — | | `userId` | `number` | No | — | | `orgs` | `object[]` | No | — | > **UserId full type** > > ```ts theme={null} > { > Native?: number, > Partner?: string > } > ``` > **Orgs full type** > > ```ts theme={null} > { > OrgId?: number, > Name?: string > }[] > ``` > **orgs full type** > > ```ts theme={null} > { > orgId?: number, > name?: string > }[] > ``` *** ## Notes ### create `notes.create` Create a note on a project **Risk:** `write` ```ts theme={null} await corsair.filevine.api.notes.create({ projectId: 123, body: 'Hello' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `body` | `string` | Yes | Note body, supports @mentions and markdown | | `kind` | `note \| task \| portalMessage \| phoneCall \| text` | Yes | — | | `pinned` | `boolean` | No | — | | `attachedDocuments` | `number[]` | No | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `noteId` | `number` | Yes | — | | `projectId` | `number` | No | — | | `body` | `string` | No | — | | `kind` | `note \| task \| portalMessage \| phoneCall \| text` | No | — | | `pinned` | `boolean` | No | — | | `authorId` | `number` | No | — | | `mentions` | `number[]` | No | — | | `attachedDocuments` | `number[]` | No | — | | `createdDate` | `string` | No | — | | `modifiedDate` | `string` | No | — | *** ### list `notes.list` List notes for a project **Risk:** `read` ```ts theme={null} await corsair.filevine.api.notes.list({ projectId: 123, limit: 50 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `since` | `string` | No | ISO 8601, filter notes modified after this | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `hasMore` | `boolean` | No | — | > **items full type** > > ```ts theme={null} > { > noteId: number, > projectId?: number, > body?: string, > kind?: note | task | portalMessage | phoneCall | text, > pinned?: boolean, > authorId?: number, > mentions?: number[], > attachedDocuments?: number[], > createdDate?: string, > modifiedDate?: string > }[] > ``` *** ### update `notes.update` Update a note **Risk:** `write` ```ts theme={null} await corsair.filevine.api.notes.update({ noteId: 123, body: 'Updated' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `noteId` | `number` | Yes | — | | `body` | `string` | No | — | | `pinned` | `boolean` | No | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `noteId` | `number` | Yes | — | | `projectId` | `number` | No | — | | `body` | `string` | No | — | | `kind` | `note \| task \| portalMessage \| phoneCall \| text` | No | — | | `pinned` | `boolean` | No | — | | `authorId` | `number` | No | — | | `mentions` | `number[]` | No | — | | `attachedDocuments` | `number[]` | No | — | | `createdDate` | `string` | No | — | | `modifiedDate` | `string` | No | — | *** ## Projects ### create `projects.create` Create a new project **Risk:** `write` ```ts theme={null} await corsair.filevine.api.projects.create({ projectTypeId: 1, projectName: 'Test', clientId: 456 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectTypeId` | `number` | Yes | Project type ID | | `projectName` | `string` | Yes | Display name for the new project | | `clientId` | `number` | Yes | Primary client contact ID | | `phaseName` | `string` | No | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `projectName` | `string` | No | — | | `number` | `string` | No | — | | `projectTypeId` | `number` | No | — | | `clientId` | `number` | No | — | | `phaseName` | `string` | No | — | | `isArchived` | `boolean` | No | — | | `createdDate` | `string` | No | — | | `modifiedDate` | `string` | No | — | *** ### get `projects.get` Get a project by ID **Risk:** `read` ```ts theme={null} await corsair.filevine.api.projects.get({ projectId: 123 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | Filevine project ID | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `projectName` | `string` | No | — | | `number` | `string` | No | — | | `projectTypeId` | `number` | No | — | | `clientId` | `number` | No | — | | `phaseName` | `string` | No | — | | `isArchived` | `boolean` | No | — | | `createdDate` | `string` | No | — | | `modifiedDate` | `string` | No | — | *** ### list `projects.list` List projects with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.filevine.api.projects.list({ limit: 50 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | Pagination offset, default 0 | | `limit` | `number` | No | Page size, max 1000, default 50 | | `projectTypeId` | `number` | No | — | | `phaseName` | `string` | No | — | | `modifiedSince` | `string` | No | ISO 8601 date-time filter | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `hasMore` | `boolean` | No | — | | `totalCount` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > projectId: number, > projectName?: string, > number?: string, > projectTypeId?: number, > clientId?: number, > phaseName?: string, > isArchived?: boolean, > createdDate?: string, > modifiedDate?: string > }[] > ``` *** ### update `projects.update` Update a project **Risk:** `write` ```ts theme={null} await corsair.filevine.api.projects.update({ projectId: 123, phaseName: 'Discovery' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `projectName` | `string` | No | — | | `phaseName` | `string` | No | — | | `isArchived` | `boolean` | No | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `projectName` | `string` | No | — | | `number` | `string` | No | — | | `projectTypeId` | `number` | No | — | | `clientId` | `number` | No | — | | `phaseName` | `string` | No | — | | `isArchived` | `boolean` | No | — | | `createdDate` | `string` | No | — | | `modifiedDate` | `string` | No | — | *** ## Tasks ### create `tasks.create` Create a task on a project **Risk:** `write` ```ts theme={null} await corsair.filevine.api.tasks.create({ projectId: 123, title: 'Review', assigneeId: 456 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `title` | `string` | Yes | — | | `body` | `string` | No | — | | `assigneeId` | `number` | Yes | — | | `dueDate` | `string` | No | — | | `priority` | `low \| normal \| high \| urgent` | No | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `number` | Yes | — | | `projectId` | `number` | No | — | | `title` | `string` | No | — | | `body` | `string` | No | — | | `status` | `open \| inProgress \| completed \| cancelled` | No | — | | `priority` | `low \| normal \| high \| urgent` | No | — | | `dueDate` | `string` | No | — | | `assigneeId` | `number` | No | — | | `completedDate` | `string` | No | — | *** ### list `tasks.list` List tasks for a project **Risk:** `read` ```ts theme={null} await corsair.filevine.api.tasks.list({ projectId: 123, limit: 50 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `number` | Yes | — | | `assigneeId` | `number` | No | — | | `status` | `open \| inProgress \| completed \| cancelled` | No | — | | `offset` | `number` | No | Pagination offset | | `limit` | `number` | No | Page size, max 1000 | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `hasMore` | `boolean` | No | — | > **items full type** > > ```ts theme={null} > { > taskId: number, > projectId?: number, > title?: string, > body?: string, > status?: open | inProgress | completed | cancelled, > priority?: low | normal | high | urgent, > dueDate?: string, > assigneeId?: number, > completedDate?: string > }[] > ``` *** ### update `tasks.update` Update a task **Risk:** `write` ```ts theme={null} await corsair.filevine.api.tasks.update({ taskId: 123, status: 'completed' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `number` | Yes | — | | `status` | `open \| inProgress \| completed \| cancelled` | No | — | | `priority` | `low \| normal \| high \| urgent` | No | — | | `dueDate` | `string` | No | — | | `assigneeId` | `number` | No | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `number` | Yes | — | | `projectId` | `number` | No | — | | `title` | `string` | No | — | | `body` | `string` | No | — | | `status` | `open \| inProgress \| completed \| cancelled` | No | — | | `priority` | `low \| normal \| high \| urgent` | No | — | | `dueDate` | `string` | No | — | | `assigneeId` | `number` | No | — | | `completedDate` | `string` | No | — | *** ## Webhooks ### create `webhooks.create` Create a webhook subscription **Risk:** `write` ```ts theme={null} await corsair.filevine.api.webhooks.create({ name: 'Hook', endpoint: 'https://example.com/hook', events: ['project.created'], }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `endpoint` | `string` | Yes | — | | `events` | `string[]` | Yes | Dotted events e.g. project.created | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `endpoint` | `string` | No | — | | `signingKey` | `string` | No | — | | `events` | `string[]` | No | — | | `createdDate` | `string` | No | — | *** ### delete `webhooks.delete` Delete a webhook subscription \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.filevine.api.webhooks.delete({ subscriptionId: 'sub_123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `string` | Yes | — | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output:** *empty object* *** ### list `webhooks.list` List webhook subscriptions **Risk:** `read` ```ts theme={null} await corsair.filevine.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orgId` | `number` | No | Explicit Filevine org ID — must belong to the authenticated user | | `userId` | `number` | No | Explicit Filevine user ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > subscriptionId: string, > name?: string, > description?: string, > endpoint?: string, > signingKey?: string, > events?: string[], > createdDate?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/filevine/database Filevine local sync: searchable entities, `.search()` filters, and operators. The Filevine plugin syncs data locally. Use `corsair.filevine.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Contacts Path: `filevine.db.contacts.search` ```ts theme={null} const rows = await corsair.filevine.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `contactId` | `number` | equals, gt, gte, lt, lte, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `fullName` | `string` | equals, contains, startsWith, endsWith, in | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deadlines Path: `filevine.db.deadlines.search` ```ts theme={null} const rows = await corsair.filevine.db.deadlines.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `deadlineId` | `number` | equals, gt, gte, lt, lte, in | | `projectId` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `dueDate` | `string` | equals, contains, startsWith, endsWith, in | | `assigneeId` | `number` | equals, gt, gte, lt, lte, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Documents Path: `filevine.db.documents.search` ```ts theme={null} const rows = await corsair.filevine.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `documentId` | `number` | equals, gt, gte, lt, lte, in | | `projectId` | `number` | equals, gt, gte, lt, lte, in | | `folderId` | `number` | equals, gt, gte, lt, lte, in | | `filename` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `contentType` | `string` | equals, contains, startsWith, endsWith, in | | `sharedToPortal` | `boolean` | equals | | `version` | `number` | equals, gt, gte, lt, lte, in | | `uploadedBy` | `number` | equals, gt, gte, lt, lte, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Notes Path: `filevine.db.notes.search` ```ts theme={null} const rows = await corsair.filevine.db.notes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `noteId` | `number` | equals, gt, gte, lt, lte, in | | `projectId` | `number` | equals, gt, gte, lt, lte, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `pinned` | `boolean` | equals | | `authorId` | `number` | equals, gt, gte, lt, lte, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `filevine.db.projects.search` ```ts theme={null} const rows = await corsair.filevine.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `projectId` | `number` | equals, gt, gte, lt, lte, in | | `projectName` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `projectTypeId` | `number` | equals, gt, gte, lt, lte, in | | `clientId` | `number` | equals, gt, gte, lt, lte, in | | `phaseName` | `string` | equals, contains, startsWith, endsWith, in | | `isArchived` | `boolean` | equals | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Subscriptions Path: `filevine.db.subscriptions.search` ```ts theme={null} const rows = await corsair.filevine.db.subscriptions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `subscriptionId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `endpoint` | `string` | equals, contains, startsWith, endsWith, in | | `signingKey` | `string` | equals, contains, startsWith, endsWith, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `filevine.db.tasks.search` ```ts theme={null} const rows = await corsair.filevine.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `taskId` | `number` | equals, gt, gte, lt, lte, in | | `projectId` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `dueDate` | `string` | equals, contains, startsWith, endsWith, in | | `assigneeId` | `number` | equals, gt, gte, lt, lte, in | | `completedDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/filevine/overview Legal case management platform for projects, contacts, documents, tasks, and deadlines. Use **Filevine** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 24 typed API operations * 7 synced entities (`contacts`, `deadlines`, `documents`, `notes`, `projects`, `subscriptions`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/filevine ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/filevine ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/filevine ``` ```bash bun theme={null} bun add corsair @corsair-dev/filevine ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { filevine } from '@corsair-dev/filevine'; export const corsair = createCorsair({ plugins: [ filevine(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} filevine() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Filevine OAuth app. ```ts theme={null} filevine({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'filevine', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`contacts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.filevine.api.contacts.get({ contactId: 456 }); ``` **`contacts.attach`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.filevine.api.contacts.attach({ projectId: 123, contactId: 456 }); ``` See the full list on the [API](/plugins/filevine/api) page. ## Query synced data Synced entities support `tenant.filevine.db..search()` and `.list()`: `contacts`, `deadlines`, `documents`, `notes`, `projects`, `subscriptions`, `tasks`. See [Database](/plugins/filevine/database) for filters and operators. ## What's next > **[API reference](/plugins/filevine/api)** > > Every `filevine.api.*` operation with input and output types. > **[Database](/plugins/filevine/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/filloutforms/api API reference for Fillout: every `filloutforms.api.*` operation with input and output types. Every `filloutforms.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Databases ### create `databases.create` Create a Zite database with tables and fields **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.databases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `tables` | `object[]` | Yes | — | > **tables full type** > > ```ts theme={null} > { > name: string, > fields: { > type: single_line_text | long_text | email | url | phone_number | number | currency | percent | rating | duration | single_select | multiple_select | checkbox | date | datetime | attachments | linked_record | lookup | autonumber | source, > name: string, > template: { > } > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `tables` | `object[]` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | | `url` | `string` | Yes | — | | `workspaceId` | `string` | No | — | > **tables full type** > > ```ts theme={null} > { > id: string, > name: string, > order: number, > primaryFieldId: string, > fields: { > id: string, > name: string, > type: string, > template: { > }, > order: number > }[], > views: { > id: string, > name: string, > type: string, > config?: { > } > }[], > url: string > }[] > ``` *** ### delete `databases.delete` Permanently delete a Zite database **Risk:** `destructive` ```ts theme={null} await corsair.filloutforms.api.databases.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | **Output:** *empty object* *** ### get `databases.get` List Zite databases for the organization **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.databases.get({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > url?: string > }[] > ``` *** ### getById `databases.getById` Get a Zite database with tables, fields, and views **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.databases.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `tables` | `object[]` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | | `url` | `string` | Yes | — | | `workspaceId` | `string` | No | — | > **tables full type** > > ```ts theme={null} > { > id: string, > name: string, > order: number, > primaryFieldId: string, > fields: { > id: string, > name: string, > type: string, > template: { > }, > order: number > }[], > views: { > id: string, > name: string, > type: string, > config?: { > } > }[], > url: string > }[] > ``` *** ## Fields ### create `fields.create` Add a field to a Zite table **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.fields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `single_line_text \| long_text \| email \| url \| phone_number \| number \| currency \| percent \| rating \| duration \| single_select \| multiple_select \| checkbox \| date \| datetime \| attachments \| linked_record \| lookup \| autonumber \| source` | Yes | — | | `template` | `object` | No | — | > **template full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `string` | Yes | — | | `template` | `object` | Yes | — | | `order` | `number` | Yes | — | > **template full type** > > ```ts theme={null} > { > } > ``` *** ### delete `fields.delete` Permanently delete a Zite field **Risk:** `destructive` ```ts theme={null} await corsair.filloutforms.api.fields.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `fieldId` | `string` | Yes | — | **Output:** *empty object* *** ### update `fields.update` Update a Zite field name or template **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.fields.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `fieldId` | `string` | Yes | — | | `name` | `string` | No | — | | `template` | `object` | No | — | > **template full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `string` | Yes | — | | `template` | `object` | Yes | — | | `order` | `number` | Yes | — | > **template full type** > > ```ts theme={null} > { > } > ``` *** ## Forms ### getFormMetadata `forms.getFormMetadata` Get form metadata including questions and configuration **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.forms.getFormMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `questions` | `object[]` | Yes | — | | `calculations` | `object[]` | No | — | | `urlParameters` | `object[]` | No | — | | `scheduling` | `object[]` | No | — | | `payments` | `object[]` | No | — | | `quiz` | `object` | No | — | > **questions full type** > > ```ts theme={null} > { > id: string, > name: string, > type: string > }[] > ``` > **calculations full type** > > ```ts theme={null} > { > }[] > ``` > **urlParameters full type** > > ```ts theme={null} > { > }[] > ``` > **scheduling full type** > > ```ts theme={null} > { > }[] > ``` > **payments full type** > > ```ts theme={null} > { > }[] > ``` > **quiz full type** > > ```ts theme={null} > { > } > ``` *** ### getForms `forms.getForms` List all Fillout forms **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.forms.getForms({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > formId: string, > name: string > }[] > ``` *** ## Oauth ### authorize `oauth.authorize` Generate the Fillout OAuth authorization URL **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.oauth.authorize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `clientId` | `string` | Yes | — | | `redirectUri` | `string` | Yes | — | | `state` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `authorizationUrl` | `string` | Yes | — | *** ## Records ### create `records.create` Create a Zite record **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.records.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `record` | `object` | Yes | — | > **record full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | Yes | — | | `fields` | `object` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### delete `records.delete` Permanently delete a Zite record **Risk:** `destructive` ```ts theme={null} await corsair.filloutforms.api.records.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `recordId` | `string` | Yes | — | **Output:** *empty object* *** ### getById `records.getById` Get a Zite record by UUID **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.records.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `recordId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | Yes | — | | `fields` | `object` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### list `records.list` List Zite records with filter, sort, and pagination **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.records.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `filter` | `object` | No | — | | `sort` | `object[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` > **sort full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | | `total` | `number` | No | — | > **records full type** > > ```ts theme={null} > { > id: string, > data: { > }, > fields: { > }, > createdAt: string, > updatedAt: string > }[] > ``` *** ### update `records.update` Update fields on a Zite record **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.records.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `record` | `object` | Yes | — | > **record full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | Yes | — | | `fields` | `object` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **fields full type** > > ```ts theme={null} > { > } > ``` *** ## Submissions ### create `submissions.create` Create new form submissions **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.submissions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `submissions` | `object[]` | Yes | — | > **submissions full type** > > ```ts theme={null} > { > questions: { > id: string, > value: any > }[], > urlParameters?: { > id: string, > name: string, > value: string > }[], > submissionTime?: string, > lastUpdatedAt?: string, > scheduling?: { > }[], > payments?: { > }[], > login?: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `submissions` | `object[]` | Yes | — | > **submissions full type** > > ```ts theme={null} > { > submissionId: string, > submissionTime: string, > lastUpdatedAt?: string, > questions: { > id: string, > name: string, > type: string, > value: any > }[], > calculations?: { > id: string, > name: string, > type: number | text | duration, > value: string > }[], > urlParameters?: { > id: string, > name: string, > value: string > }[], > scheduling?: { > }[], > payments?: { > }[], > quiz?: { > }, > login?: { > } > }[] > ``` *** ### delete `submissions.delete` Delete a form submission by ID **Risk:** `destructive` ```ts theme={null} await corsair.filloutforms.api.submissions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `submissionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | *** ### getById `submissions.getById` Get a single submission by ID **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.submissions.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `submissionId` | `string` | Yes | — | | `includeEditLink` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `submission` | `object` | Yes | — | > **submission full type** > > ```ts theme={null} > { > submissionId: string, > submissionTime: string, > lastUpdatedAt?: string, > questions: { > id: string, > name: string, > type: string, > value: any > }[], > calculations?: { > id: string, > name: string, > type: number | text | duration, > value: string > }[], > urlParameters?: { > id: string, > name: string, > value: string > }[], > scheduling?: { > }[], > payments?: { > }[], > quiz?: { > }, > login?: { > } > } > ``` *** ### list `submissions.list` List form submissions with filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.submissions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `limit` | `number` | No | — | | `afterDate` | `string` | No | — | | `beforeDate` | `string` | No | — | | `offset` | `number` | No | — | | `status` | `finished \| in_progress` | No | — | | `includeEditLink` | `boolean` | No | — | | `includePreview` | `boolean` | No | — | | `sort` | `asc \| desc` | No | — | | `search` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `responses` | `object[]` | Yes | — | | `totalResponses` | `number` | Yes | — | | `pageCount` | `number` | Yes | — | > **responses full type** > > ```ts theme={null} > { > submissionId: string, > submissionTime: string, > lastUpdatedAt?: string, > questions: { > id: string, > name: string, > type: string, > value: any > }[], > calculations?: { > id: string, > name: string, > type: number | text | duration, > value: string > }[], > urlParameters?: { > id: string, > name: string, > value: string > }[], > scheduling?: { > }[], > payments?: { > }[], > quiz?: { > }, > login?: { > } > }[] > ``` *** ## Tables ### create `tables.create` Create a table in a Zite database **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.tables.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `fields` | `object[]` | Yes | — | > **fields full type** > > ```ts theme={null} > { > type: single_line_text | long_text | email | url | phone_number | number | currency | percent | rating | duration | single_select | multiple_select | checkbox | date | datetime | attachments | linked_record | lookup | autonumber | source, > name: string, > template: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `order` | `number` | Yes | — | | `primaryFieldId` | `string` | Yes | — | | `fields` | `object[]` | Yes | — | | `views` | `object[]` | Yes | — | | `url` | `string` | Yes | — | > **fields full type** > > ```ts theme={null} > { > id: string, > name: string, > type: string, > template: { > }, > order: number > }[] > ``` > **views full type** > > ```ts theme={null} > { > id: string, > name: string, > type: string, > config?: { > } > }[] > ``` *** ### delete `tables.delete` Permanently delete a Zite table **Risk:** `destructive` ```ts theme={null} await corsair.filloutforms.api.tables.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | **Output:** *empty object* *** ### update `tables.update` Update Zite table properties such as name **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.tables.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `order` | `number` | Yes | — | | `primaryFieldId` | `string` | Yes | — | | `fields` | `object[]` | Yes | — | | `views` | `object[]` | Yes | — | | `url` | `string` | Yes | — | > **fields full type** > > ```ts theme={null} > { > id: string, > name: string, > type: string, > template: { > }, > order: number > }[] > ``` > **views full type** > > ```ts theme={null} > { > id: string, > name: string, > type: string, > config?: { > } > }[] > ``` *** ## Token ### invalidate `token.invalidate` Invalidate/revoke an OAuth access token **Risk:** `destructive` ```ts theme={null} await corsair.filloutforms.api.token.invalidate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | Yes | — | **Output:** *empty object* *** ## Webhooks ### createDatabase `webhooks.createDatabase` Create a Zite database webhook **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.webhooks.createDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `url` | `string` | Yes | — | | `events` | `record.created \| record.updated \| record.deleted \| table.created \| table.updated \| table.deleted \| field.created \| field.updated \| field.deleted[]` | Yes | — | | `tableId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `secret` | `string` | Yes | — | *** ### createForm `webhooks.createForm` Create a Fillout form submission webhook **Risk:** `write` ```ts theme={null} await corsair.filloutforms.api.webhooks.createForm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | *** ### deleteDatabase `webhooks.deleteDatabase` Delete a Zite database webhook **Risk:** `destructive` ```ts theme={null} await corsair.filloutforms.api.webhooks.deleteDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | | `webhookId` | `string \| number` | Yes | — | **Output:** *empty object* *** ### listDatabase `webhooks.listDatabase` List Zite database webhooks **Risk:** `read` ```ts theme={null} await corsair.filloutforms.api.webhooks.listDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | Yes | — | > **webhooks full type** > > ```ts theme={null} > { > id: number, > url: string, > events: string[], > active: boolean, > tableIds?: string[] | null > }[] > ``` *** ### removeForm `webhooks.removeForm` Remove a Fillout form webhook **Risk:** `destructive` ```ts theme={null} await corsair.filloutforms.api.webhooks.removeForm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string \| number` | Yes | — | **Output:** *empty object* *** # Database Source: https://docs.corsair.dev/plugins/filloutforms/database Fillout local sync: searchable entities, `.search()` filters, and operators. The Fillout plugin syncs data locally. Use `corsair.filloutforms.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Databases Path: `filloutforms.db.databases.search` ```ts theme={null} const rows = await corsair.filloutforms.db.databases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Forms Path: `filloutforms.db.forms.search` ```ts theme={null} const rows = await corsair.filloutforms.db.forms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `formId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Records Path: `filloutforms.db.records.search` ```ts theme={null} const rows = await corsair.filloutforms.db.records.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Submissions Path: `filloutforms.db.submissions.search` ```ts theme={null} const rows = await corsair.filloutforms.db.submissions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `submissionId` | `string` | equals, contains, startsWith, endsWith, in | | `submissionTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastUpdatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `filloutforms.db.webhooks.search` ```ts theme={null} const rows = await corsair.filloutforms.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `formId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/filloutforms/overview Form builder for creating advanced surveys, quizzes, and data collection workflows. Use **Fillout** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 28 typed API operations * 5 synced entities (`databases`, `forms`, `records`, `submissions`, `webhooks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/filloutforms ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/filloutforms ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/filloutforms ``` ```bash bun theme={null} bun add corsair @corsair-dev/filloutforms ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { filloutforms } from '@corsair-dev/filloutforms'; export const corsair = createCorsair({ plugins: [ filloutforms(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} filloutforms() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Fillout OAuth app. ```ts theme={null} filloutforms({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'filloutforms', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`databases.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.filloutforms.api.databases.get({}); ``` **`databases.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.filloutforms.api.databases.create({}); ``` See the full list on the [API](/plugins/filloutforms/api) page. ## Query synced data Synced entities support `tenant.filloutforms.db..search()` and `.list()`: `databases`, `forms`, `records`, `submissions`, `webhooks`. See [Database](/plugins/filloutforms/database) for filters and operators. ## What's next > **[API reference](/plugins/filloutforms/api)** > > Every `filloutforms.api.*` operation with input and output types. > **[Database](/plugins/filloutforms/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/firecrawl/api API reference for Firecrawl: every `firecrawl.api.*` operation with input and output types. Every `firecrawl.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agent ### cancel `agent.cancel` Cancel an in-flight agent job **Risk:** `write` ```ts theme={null} await corsair.firecrawl.api.agent.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `agent.get` Get status for an agent job **Risk:** `read` ```ts theme={null} await corsair.firecrawl.api.agent.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `status` | `processing \| completed \| failed` | No | — | | `data` | `object` | No | — | | `model` | `spark-1-pro \| spark-1-mini` | No | — | | `error` | `string` | No | — | | `expiresAt` | `string` | No | — | | `creditsUsed` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### start `agent.start` Start an agentic extraction job **Risk:** `write` ```ts theme={null} await corsair.firecrawl.api.agent.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `urls` | `string[]` | No | — | | `schema` | `object` | No | — | | `maxCredits` | `number` | No | — | | `strictConstrainToURLs` | `boolean` | No | — | | `model` | `spark-1-mini \| spark-1-pro` | No | — | > **schema full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | No | — | *** ## Crawl ### cancel `crawl.cancel` Cancel an in-flight crawl job **Risk:** `write` ```ts theme={null} await corsair.firecrawl.api.crawl.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `status` | `cancelled` | No | — | *** ### get `crawl.get` Get status and results for a crawl job **Risk:** `read` ```ts theme={null} await corsair.firecrawl.api.crawl.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `status` | `string` | No | — | | `total` | `number` | No | — | | `completed` | `number` | No | — | | `creditsUsed` | `number` | No | — | | `expiresAt` | `string` | No | — | | `next` | `string` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > markdown?: string, > html?: string | null, > rawHtml?: string | null, > links?: string[], > screenshot?: string | null, > metadata?: { > title?: string | string[], > description?: string | string[], > language?: string | string[] | null, > keywords?: string | string[], > sourceURL?: string, > url?: string, > scrapeId?: string, > statusCode?: number, > contentType?: string, > error?: string | null, > ogLocaleAlternate?: string[], > concurrencyLimited?: boolean, > concurrencyQueueDurationMs?: number > } > }[] > ``` *** ### start `crawl.start` Start a recursive crawl from a base URL **Risk:** `write` ```ts theme={null} await corsair.firecrawl.api.crawl.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `prompt` | `string` | No | — | | `excludePaths` | `string[]` | No | — | | `includePaths` | `string[]` | No | — | | `maxDiscoveryDepth` | `number` | No | — | | `sitemap` | `skip \| include \| only` | No | — | | `ignoreQueryParameters` | `boolean` | No | — | | `regexOnFullURL` | `boolean` | No | — | | `limit` | `number` | No | — | | `crawlEntireDomain` | `boolean` | No | — | | `allowExternalLinks` | `boolean` | No | — | | `allowSubdomains` | `boolean` | No | — | | `delay` | `number` | No | — | | `maxConcurrency` | `number` | No | — | | `webhook` | `object` | No | — | | `scrapeOptions` | `object` | No | — | | `zeroDataRetention` | `boolean` | No | — | > **webhook full type** > > ```ts theme={null} > { > url: string, > headers?: { > }, > metadata?: { > }, > events?: completed | page | failed | started[] > } > ``` > **scrapeOptions full type** > > ```ts theme={null} > { > formats?: ( > markdown | summary | html | rawHtml | links | images | audio | { > type: markdown > } | { > type: summary > } | { > type: html > } | { > type: rawHtml > } | { > type: links > } | { > type: images > } | { > type: audio > } | { > type: screenshot, > fullPage?: boolean, > quality?: number, > viewport?: { > width: number, > height: number > } > } | { > type: json, > schema?: { > }, > prompt?: string > } | { > type: changeTracking, > modes?: git-diff | json[], > schema?: { > }, > prompt?: string, > tag?: string | null > } | { > type: branding > } > )[], > onlyMainContent?: boolean, > includeTags?: string[], > excludeTags?: string[], > maxAge?: number, > minAge?: number, > headers?: { > }, > waitFor?: number, > mobile?: boolean, > skipTlsVerification?: boolean, > timeout?: number, > parsers?: { > type: pdf, > mode?: fast | auto | ocr, > maxPages?: number > }[], > actions?: ( > { > type: wait, > milliseconds: number > } | { > type: wait, > selector: string > } | { > type: screenshot, > fullPage?: boolean, > quality?: number, > viewport?: { > width: number, > height: number > } > } | { > type: click, > selector: string, > all?: boolean > } | { > type: write, > text: string > } | { > type: press, > key: string > } | { > type: scroll, > direction?: up | down, > selector?: string > } | { > type: scrape > } | { > type: executeJavascript, > script: string > } | { > type: pdf, > format?: A0 | A1 | A2 | A3 | A4 | A5 | A6 | Letter | Legal | Tabloid | Ledger, > landscape?: boolean, > scale?: number > } > )[], > location?: { > country?: string, > languages?: string[] > }, > removeBase64Images?: boolean, > blockAds?: boolean, > proxy?: basic | enhanced | auto, > storeInCache?: boolean, > profile?: { > name: string, > saveChanges?: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | No | — | | `url` | `string` | No | — | *** ## Map ### run `map.run` Map all URLs discovered from a site **Risk:** `read` ```ts theme={null} await corsair.firecrawl.api.map.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `search` | `string` | No | — | | `sitemap` | `skip \| include \| only` | No | — | | `includeSubdomains` | `boolean` | No | — | | `ignoreQueryParameters` | `boolean` | No | — | | `ignoreCache` | `boolean` | No | — | | `limit` | `number` | No | — | | `timeout` | `number` | No | — | | `location` | `object` | No | — | > **location full type** > > ```ts theme={null} > { > country?: string, > languages?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `links` | `object[]` | No | — | > **links full type** > > ```ts theme={null} > { > url: string, > title?: string, > description?: string > }[] > ``` *** ## Scrape ### run `scrape.run` Scrape a single URL (markdown, JSON, etc.) **Risk:** `read` ```ts theme={null} await corsair.firecrawl.api.scrape.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `formats` | `object[]` | No | — | | `onlyMainContent` | `boolean` | No | — | | `includeTags` | `string[]` | No | — | | `excludeTags` | `string[]` | No | — | | `maxAge` | `number` | No | — | | `minAge` | `number` | No | — | | `headers` | `object` | No | — | | `waitFor` | `number` | No | — | | `mobile` | `boolean` | No | — | | `skipTlsVerification` | `boolean` | No | — | | `timeout` | `number` | No | — | | `parsers` | `object[]` | No | — | | `actions` | `object[]` | No | — | | `location` | `object` | No | — | | `removeBase64Images` | `boolean` | No | — | | `blockAds` | `boolean` | No | — | | `proxy` | `basic \| enhanced \| auto` | No | — | | `storeInCache` | `boolean` | No | — | | `profile` | `object` | No | — | | `zeroDataRetention` | `boolean` | No | — | > **formats full type** > > ```ts theme={null} > ( > markdown | summary | html | rawHtml | links | images | audio | { > type: markdown > } | { > type: summary > } | { > type: html > } | { > type: rawHtml > } | { > type: links > } | { > type: images > } | { > type: audio > } | { > type: screenshot, > fullPage?: boolean, > quality?: number, > viewport?: { > width: number, > height: number > } > } | { > type: json, > schema?: { > }, > prompt?: string > } | { > type: changeTracking, > modes?: git-diff | json[], > schema?: { > }, > prompt?: string, > tag?: string | null > } | { > type: branding > } > )[] > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` > **parsers full type** > > ```ts theme={null} > { > type: pdf, > mode?: fast | auto | ocr, > maxPages?: number > }[] > ``` > **actions full type** > > ```ts theme={null} > ( > { > type: wait, > milliseconds: number > } | { > type: wait, > selector: string > } | { > type: screenshot, > fullPage?: boolean, > quality?: number, > viewport?: { > width: number, > height: number > } > } | { > type: click, > selector: string, > all?: boolean > } | { > type: write, > text: string > } | { > type: press, > key: string > } | { > type: scroll, > direction?: up | down, > selector?: string > } | { > type: scrape > } | { > type: executeJavascript, > script: string > } | { > type: pdf, > format?: A0 | A1 | A2 | A3 | A4 | A5 | A6 | Letter | Legal | Tabloid | Ledger, > landscape?: boolean, > scale?: number > } > )[] > ``` > **location full type** > > ```ts theme={null} > { > country?: string, > languages?: string[] > } > ``` > **profile full type** > > ```ts theme={null} > { > name: string, > saveChanges?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > markdown?: string, > summary?: string | null, > html?: string | null, > rawHtml?: string | null, > screenshot?: string | null, > audio?: string | null, > links?: string[], > actions?: { > screenshots?: string[], > scrapes?: { > url?: string, > html?: string > }[], > javascriptReturns?: { > type?: string, > value?: any > }[], > pdfs?: string[] > } | null, > metadata?: { > title?: string | string[], > description?: string | string[], > language?: string | string[] | null, > keywords?: string | string[], > sourceURL?: string, > url?: string, > scrapeId?: string, > statusCode?: number, > contentType?: string, > error?: string | null, > ogLocaleAlternate?: string[], > concurrencyLimited?: boolean, > concurrencyQueueDurationMs?: number > }, > warning?: string | null, > changeTracking?: { > previousScrapeAt?: string | null, > changeStatus?: new | same | changed | removed, > visibility?: visible | hidden, > diff?: string | null, > json?: { > } | null > } | null, > branding?: { > } | null, > json?: any, > images?: { > }[] > } > ``` *** ## Search ### run `search.run` Search the web and retrieve page content **Risk:** `read` ```ts theme={null} await corsair.firecrawl.api.search.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `limit` | `number` | No | — | | `sources` | `object[]` | No | — | | `categories` | `object[]` | No | — | | `tbs` | `string` | No | — | | `location` | `string` | No | — | | `country` | `string` | No | — | | `timeout` | `number` | No | — | | `ignoreInvalidURLs` | `boolean` | No | — | | `enterprise` | `anon \| zdr[]` | No | — | | `scrapeOptions` | `object` | No | — | > **sources full type** > > ```ts theme={null} > ( > { > type: web, > tbs?: string, > location?: string > } | { > type: images > } | { > type: news > } > )[] > ``` > **categories full type** > > ```ts theme={null} > ( > { > type: github > } | { > type: research > } | { > type: pdf > } > )[] > ``` > **scrapeOptions full type** > > ```ts theme={null} > { > formats?: ( > markdown | summary | html | rawHtml | links | images | audio | { > type: markdown > } | { > type: summary > } | { > type: html > } | { > type: rawHtml > } | { > type: links > } | { > type: images > } | { > type: audio > } | { > type: screenshot, > fullPage?: boolean, > quality?: number, > viewport?: { > width: number, > height: number > } > } | { > type: json, > schema?: { > }, > prompt?: string > } | { > type: changeTracking, > modes?: git-diff | json[], > schema?: { > }, > prompt?: string, > tag?: string | null > } | { > type: branding > } > )[], > onlyMainContent?: boolean, > includeTags?: string[], > excludeTags?: string[], > maxAge?: number, > minAge?: number, > headers?: { > }, > waitFor?: number, > mobile?: boolean, > skipTlsVerification?: boolean, > timeout?: number, > parsers?: { > type: pdf, > mode?: fast | auto | ocr, > maxPages?: number > }[], > actions?: ( > { > type: wait, > milliseconds: number > } | { > type: wait, > selector: string > } | { > type: screenshot, > fullPage?: boolean, > quality?: number, > viewport?: { > width: number, > height: number > } > } | { > type: click, > selector: string, > all?: boolean > } | { > type: write, > text: string > } | { > type: press, > key: string > } | { > type: scroll, > direction?: up | down, > selector?: string > } | { > type: scrape > } | { > type: executeJavascript, > script: string > } | { > type: pdf, > format?: A0 | A1 | A2 | A3 | A4 | A5 | A6 | Letter | Legal | Tabloid | Ledger, > landscape?: boolean, > scale?: number > } > )[], > location?: { > country?: string, > languages?: string[] > }, > removeBase64Images?: boolean, > blockAds?: boolean, > proxy?: basic | enhanced | auto, > storeInCache?: boolean, > profile?: { > name: string, > saveChanges?: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | No | — | | `warning` | `string` | No | — | | `id` | `string` | No | — | | `creditsUsed` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > web?: { > title?: string, > description?: string, > url?: string, > markdown?: string | null, > html?: string | null, > rawHtml?: string | null, > links?: string[], > screenshot?: string | null, > audio?: string | null, > category?: string, > metadata?: { > title?: string | string[], > description?: string | string[], > language?: string | string[] | null, > keywords?: string | string[], > sourceURL?: string, > url?: string, > scrapeId?: string, > statusCode?: number, > contentType?: string, > error?: string | null, > ogLocaleAlternate?: string[], > concurrencyLimited?: boolean, > concurrencyQueueDurationMs?: number > } > }[], > images?: { > title?: string, > imageUrl?: string, > imageWidth?: number, > imageHeight?: number, > url?: string, > position?: number > }[], > news?: { > title?: string, > snippet?: string, > url?: string, > date?: string, > imageUrl?: string, > position?: number, > markdown?: string | null, > html?: string | null, > rawHtml?: string | null, > links?: string[], > screenshot?: string | null, > audio?: string | null, > metadata?: { > title?: string | string[], > description?: string | string[], > language?: string | string[] | null, > keywords?: string | string[], > sourceURL?: string, > url?: string, > scrapeId?: string, > statusCode?: number, > contentType?: string, > error?: string | null, > ogLocaleAlternate?: string[], > concurrencyLimited?: boolean, > concurrencyQueueDurationMs?: number > } > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/firecrawl/database Firecrawl local sync: searchable entities, `.search()` filters, and operators. The Firecrawl plugin syncs data locally. Use `corsair.firecrawl.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Jobs Path: `firecrawl.db.jobs.search` ```ts theme={null} const rows = await corsair.firecrawl.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `success` | `boolean` | equals | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scrapes Path: `firecrawl.db.scrapes.search` ```ts theme={null} const rows = await corsair.firecrawl.db.scrapes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `sourceURL` | `string` | equals, contains, startsWith, endsWith, in | | `success` | `boolean` | equals | | `markdown` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `html` | `string` | equals, contains, startsWith, endsWith, in | | `rawHtml` | `string` | equals, contains, startsWith, endsWith, in | | `screenshot` | `string` | equals, contains, startsWith, endsWith, in | | `audio` | `string` | equals, contains, startsWith, endsWith, in | | `warning` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Searches Path: `firecrawl.db.searches.search` ```ts theme={null} const rows = await corsair.firecrawl.db.searches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `success` | `boolean` | equals | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Site Maps Path: `firecrawl.db.siteMaps.search` ```ts theme={null} const rows = await corsair.firecrawl.db.siteMaps.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `baseUrl` | `string` | equals, contains, startsWith, endsWith, in | | `success` | `boolean` | equals | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/firecrawl/overview Web scraping API that crawls sites and returns clean markdown or structured page data. Use **Firecrawl** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 9 typed API operations * 4 synced entities (`jobs`, `scrapes`, `searches`, `siteMaps`) for fast `.search()` / `.list()` * 14 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/firecrawl ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/firecrawl ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/firecrawl ``` ```bash bun theme={null} bun add corsair @corsair-dev/firecrawl ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { firecrawl } from '@corsair-dev/firecrawl'; export const corsair = createCorsair({ plugins: [ firecrawl(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} firecrawl() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'firecrawl', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`agent.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.firecrawl.api.agent.get({}); ``` **`agent.cancel`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.firecrawl.api.agent.cancel({}); ``` See the full list on the [API](/plugins/firecrawl/api) page. ## Query synced data Synced entities support `tenant.firecrawl.db..search()` and `.list()`: `jobs`, `scrapes`, `searches`, `siteMaps`. See [Database](/plugins/firecrawl/database) for filters and operators. ## Webhooks This plugin registers **14** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/firecrawl/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/firecrawl/api)** > > Every `firecrawl.api.*` operation with input and output types. > **[Database](/plugins/firecrawl/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/firecrawl/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/firecrawl/webhooks Firecrawl incoming webhooks: event paths, payloads, and response data. The Firecrawl plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/firecrawl/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `agent` * `action` (`agent.action`) * `cancelled` (`agent.cancelled`) * `completed` (`agent.completed`) * `failed` (`agent.failed`) * `started` (`agent.started`) * `batchScrape` * `completed` (`batchScrape.completed`) * `page` (`batchScrape.page`) * `started` (`batchScrape.started`) * `crawl` * `completed` (`crawl.completed`) * `page` (`crawl.page`) * `started` (`crawl.started`) * `extract` * `completed` (`extract.completed`) * `failed` (`extract.failed`) * `started` (`extract.started`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Agent ### Action `agent.action` The agent executed a tool action **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `agent.action` | Yes | — | | `id` | `string` | Yes | — | | `data` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > creditsUsed?: number, > action?: string, > input?: { > } > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: agent.action, > id: string, > data: { > creditsUsed?: number, > action?: string, > input?: { > } > }[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { agent: { action: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Cancelled `agent.cancelled` An agent job was cancelled **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `agent.cancelled` | Yes | — | | `id` | `string` | Yes | — | | `data` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > creditsUsed?: number > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: agent.cancelled, > id: string, > data: { > creditsUsed?: number > }[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { agent: { cancelled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Completed `agent.completed` An agent job completed successfully **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `agent.completed` | Yes | — | | `id` | `string` | Yes | — | | `data` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > creditsUsed?: number, > data?: { > } > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: agent.completed, > id: string, > data: { > creditsUsed?: number, > data?: { > } > }[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { agent: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Failed `agent.failed` An agent job failed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `agent.failed` | Yes | — | | `id` | `string` | Yes | — | | `data` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > creditsUsed?: number > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: agent.failed, > id: string, > data: { > creditsUsed?: number > }[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { agent: { failed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Started `agent.started` An agent job started **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `agent.started` | Yes | — | | `id` | `string` | Yes | — | | `data` | `never[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: agent.started, > id: string, > data: never[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { agent: { started: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Batch Scrape ### Completed `batchScrape.completed` A batch scrape job completed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `batch_scrape.completed` | Yes | — | | `id` | `string` | Yes | — | | `data` | `never[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: batch_scrape.completed, > id: string, > data: never[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { batchScrape: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Page `batchScrape.page` A URL was scraped in a batch job **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `batch_scrape.page` | Yes | — | | `id` | `string` | Yes | — | | `data` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > markdown?: string, > html?: string | null, > rawHtml?: string | null, > links?: string[], > screenshot?: string | null, > metadata?: { > title?: string | string[], > description?: string | string[], > language?: string | string[] | null, > keywords?: string | string[], > sourceURL?: string, > url?: string, > scrapeId?: string, > statusCode?: number, > contentType?: string, > error?: string | null, > ogLocaleAlternate?: string[], > concurrencyLimited?: boolean, > concurrencyQueueDurationMs?: number > } > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: batch_scrape.page, > id: string, > data: { > markdown?: string, > html?: string | null, > rawHtml?: string | null, > links?: string[], > screenshot?: string | null, > metadata?: { > title?: string | string[], > description?: string | string[], > language?: string | string[] | null, > keywords?: string | string[], > sourceURL?: string, > url?: string, > scrapeId?: string, > statusCode?: number, > contentType?: string, > error?: string | null, > ogLocaleAlternate?: string[], > concurrencyLimited?: boolean, > concurrencyQueueDurationMs?: number > } > }[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { batchScrape: { page: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Started `batchScrape.started` A batch scrape job started **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `batch_scrape.started` | Yes | — | | `id` | `string` | Yes | — | | `data` | `never[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: batch_scrape.started, > id: string, > data: never[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { batchScrape: { started: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Crawl ### Completed `crawl.completed` A crawl job finished **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `crawl.completed` | Yes | — | | `id` | `string` | Yes | — | | `data` | `never[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: crawl.completed, > id: string, > data: never[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { crawl: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Page `crawl.page` A page was scraped during a crawl **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `crawl.page` | Yes | — | | `id` | `string` | Yes | — | | `data` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > markdown?: string, > html?: string | null, > rawHtml?: string | null, > links?: string[], > screenshot?: string | null, > metadata?: { > title?: string | string[], > description?: string | string[], > language?: string | string[] | null, > keywords?: string | string[], > sourceURL?: string, > url?: string, > scrapeId?: string, > statusCode?: number, > contentType?: string, > error?: string | null, > ogLocaleAlternate?: string[], > concurrencyLimited?: boolean, > concurrencyQueueDurationMs?: number > } > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: crawl.page, > id: string, > data: { > markdown?: string, > html?: string | null, > rawHtml?: string | null, > links?: string[], > screenshot?: string | null, > metadata?: { > title?: string | string[], > description?: string | string[], > language?: string | string[] | null, > keywords?: string | string[], > sourceURL?: string, > url?: string, > scrapeId?: string, > statusCode?: number, > contentType?: string, > error?: string | null, > ogLocaleAlternate?: string[], > concurrencyLimited?: boolean, > concurrencyQueueDurationMs?: number > } > }[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { crawl: { page: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Started `crawl.started` A crawl job started processing **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `crawl.started` | Yes | — | | `id` | `string` | Yes | — | | `data` | `never[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: crawl.started, > id: string, > data: never[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { crawl: { started: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Extract ### Completed `extract.completed` An extract job completed successfully **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `extract.completed` | Yes | — | | `id` | `string` | Yes | — | | `data` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > success: boolean, > data: { > }, > extractId: string, > llmUsage?: number, > totalUrlsScraped?: number, > sources?: { > } > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: extract.completed, > id: string, > data: { > success: boolean, > data: { > }, > extractId: string, > llmUsage?: number, > totalUrlsScraped?: number, > sources?: { > } > }[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { extract: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Failed `extract.failed` An extract job failed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `extract.failed` | Yes | — | | `id` | `string` | Yes | — | | `data` | `never[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: extract.failed, > id: string, > data: never[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { extract: { failed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Started `extract.started` An extract job started **Payload** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `type` | `extract.started` | Yes | — | | `id` | `string` | Yes | — | | `data` | `never[]` | Yes | — | | `metadata` | `object` | No | — | | `error` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean, > type: extract.started, > id: string, > data: never[], > metadata?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} firecrawl({ webhookHooks: { extract: { started: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/fireflies/api API reference for Fireflies.ai: every `fireflies.api.*` operation with input and output types. Every `fireflies.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Ai App ### getOutputs `aiApp.getOutputs` Get the outputs of an AI app for a transcript **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.aiApp.getOutputs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transcriptId` | `string` | No | — | | `appId` | `string` | No | — | | `limit` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `apps` | `object` | No | — | > **apps full type** > > ```ts theme={null} > { > outputs?: { > transcript_id?: string | null, > user_id?: string | null, > app_id?: string | null, > created_at?: number | null, > title?: string | null, > prompt?: string | null, > response?: string | null > }[] | null > } > ``` *** ## Ask Fred ### continueThread `askFred.continueThread` Continue an existing AskFred conversation thread **Risk:** `write` ```ts theme={null} await corsair.fireflies.api.askFred.continueThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `query` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `continueAskFredThread` | `object` | Yes | — | > **continueAskFredThread full type** > > ```ts theme={null} > { > message: { > id: string, > thread_id: string, > query: string, > answer: string, > suggested_queries?: string[] | null, > status?: string | null, > created_at?: string | null, > updated_at?: string | null > }, > cost?: number | null > } > ``` *** ### createThread `askFred.createThread` Create a new AskFred conversation thread **Risk:** `write` ```ts theme={null} await corsair.fireflies.api.askFred.createThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transcriptId` | `string` | No | — | | `query` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `createAskFredThread` | `object` | Yes | — | > **createAskFredThread full type** > > ```ts theme={null} > { > message: { > id: string, > thread_id: string, > query: string, > answer: string, > suggested_queries?: string[] | null, > status?: string | null, > created_at?: string | null, > updated_at?: string | null > }, > cost?: number | null > } > ``` *** ### deleteThread `askFred.deleteThread` Delete an AskFred conversation thread **Risk:** `destructive` ```ts theme={null} await corsair.fireflies.api.askFred.deleteThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleteAskFredThread` | `object` | Yes | — | > **deleteAskFredThread full type** > > ```ts theme={null} > { > id: string, > title: string, > transcript_id?: string | null, > user_id: string, > created_at: string, > messages?: { > id: string, > thread_id: string, > query: string, > answer: string, > suggested_queries?: string[] | null, > status?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] | null > } > ``` *** ### getThread `askFred.getThread` Get a single AskFred conversation thread by ID **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.askFred.getThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `askfred_thread` | `object` | No | — | > **askfred\_thread full type** > > ```ts theme={null} > { > id: string, > title: string, > transcript_id?: string | null, > user_id: string, > created_at: string, > messages?: { > id: string, > thread_id: string, > query: string, > answer: string, > suggested_queries?: string[] | null, > status?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] | null > } > ``` *** ### getThreads `askFred.getThreads` Get all AskFred conversation threads for a transcript **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.askFred.getThreads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transcriptId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `askfred_threads` | `object[]` | Yes | — | > **askfred\_threads full type** > > ```ts theme={null} > { > id: string, > title: string, > transcript_id?: string | null, > user_id: string, > created_at: string > }[] > ``` *** ## Audio ### upload `audio.upload` Upload an audio file for transcription **Risk:** `write` ```ts theme={null} await corsair.fireflies.api.audio.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `title` | `string` | No | — | | `webhook` | `string` | No | — | | `custom_language` | `string` | No | — | | `client_reference_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uploadAudio` | `object` | Yes | — | > **uploadAudio full type** > > ```ts theme={null} > { > success: boolean, > title: string, > message: string > } > ``` *** ## Transcripts ### get `transcripts.get` Get a single transcript by ID with full details **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.transcripts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transcriptId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `transcript` | `object` | No | — | > **transcript full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > date?: Date | null, > duration?: number | null, > host_email?: string | null, > organizer_email?: string | null, > calendar_id?: string | null, > transcript_url?: string | null, > meeting_link?: string | null, > video_url?: string | null, > audio_url?: string | null, > privacy?: string | null, > sentences?: { > index?: number | null, > speaker_id?: number | null, > speaker_name?: string | null, > raw_text?: string | null, > text?: string | null, > start_time?: number | null, > end_time?: number | null, > ai_filters?: { > task?: string | null, > pricing?: string | null, > metric?: string | null, > question?: string | null, > date_and_time?: string | null > } | null > }[] | null, > summary?: { > keywords?: string[] | null, > action_items?: string | null, > outline?: string | null, > shorthand_bullet?: string | null, > overview?: string | null, > bullet_gist?: string | null, > gist?: string | null, > short_summary?: string | null, > notes?: string | null, > short_overview?: string | null, > meeting_type?: string | null > } | null, > speakers?: { > id?: string | null, > name?: string | null > }[] | null, > meeting_attendees?: { > displayName?: string | null, > email?: string | null, > phoneNumber?: string | null, > name?: string | null, > location?: string | null > }[] | null > } > ``` *** ### getAnalytics `transcripts.getAnalytics` Get analytics data for a transcript **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.transcripts.getAnalytics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transcriptId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `transcript` | `object` | No | — | > **transcript full type** > > ```ts theme={null} > { > id: string, > analytics?: { > sentiments?: { > negative_pct?: number | null, > neutral_pct?: number | null, > positive_pct?: number | null > } | null, > categories?: { > questions?: number | null, > date_times?: number | null, > metrics?: number | null, > tasks?: number | null > } | null, > speakers?: { > }[] | null > } | null > } > ``` *** ### getAudioUrl `transcripts.getAudioUrl` Get the audio URL for a transcript **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.transcripts.getAudioUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transcriptId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `transcript` | `object` | No | — | > **transcript full type** > > ```ts theme={null} > { > id: string, > audio_url?: string | null > } > ``` *** ### getSummary `transcripts.getSummary` Get the AI-generated summary for a transcript **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.transcripts.getSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transcriptId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `transcript` | `object` | No | — | > **transcript full type** > > ```ts theme={null} > { > id: string, > summary?: { > keywords?: string[] | null, > action_items?: string | null, > outline?: string | null, > shorthand_bullet?: string | null, > overview?: string | null, > bullet_gist?: string | null, > gist?: string | null, > short_summary?: string | null, > notes?: string | null, > short_overview?: string | null, > meeting_type?: string | null > } | null > } > ``` *** ### getVideoUrl `transcripts.getVideoUrl` Get the video URL for a transcript **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.transcripts.getVideoUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `transcriptId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `transcript` | `object` | No | — | > **transcript full type** > > ```ts theme={null} > { > id: string, > video_url?: string | null > } > ``` *** ### list `transcripts.list` List transcripts with optional filters **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.transcripts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `fromDate` | `string` | No | — | | `toDate` | `string` | No | — | | `limit` | `number` | No | — | | `skip` | `number` | No | — | | `host_email` | `string` | No | — | | `participant_email` | `string` | No | — | | `mine` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `transcripts` | `object[]` | Yes | — | > **transcripts full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > date?: Date | null, > duration?: number | null, > host_email?: string | null, > organizer_email?: string | null, > calendar_id?: string | null, > transcript_url?: string | null, > meeting_link?: string | null, > video_url?: string | null, > audio_url?: string | null, > privacy?: string | null > }[] > ``` *** ## Users ### getCurrent `users.getCurrent` Get the current authenticated user **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.users.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > user_id: string, > email?: string | null, > name?: string | null, > num_transcripts?: number | null, > minutes_consumed?: number | null, > is_admin?: boolean | null, > integrations?: string[] | null > } > ``` *** ### list `users.list` List all users in the workspace **Risk:** `read` ```ts theme={null} await corsair.fireflies.api.users.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > user_id: string, > email?: string | null, > name?: string | null, > num_transcripts?: number | null, > minutes_consumed?: number | null, > is_admin?: boolean | null, > integrations?: string[] | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/fireflies/database Fireflies.ai local sync: searchable entities, `.search()` filters, and operators. The Fireflies.ai plugin syncs data locally. Use `corsair.fireflies.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Ask Fred Threads Path: `fireflies.db.askFredThreads.search` ```ts theme={null} const rows = await corsair.fireflies.db.askFredThreads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `transcript_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transcripts Path: `fireflies.db.transcripts.search` ```ts theme={null} const rows = await corsair.fireflies.db.transcripts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `date` | equals, before, after, between | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `host_email` | `string` | equals, contains, startsWith, endsWith, in | | `organizer_email` | `string` | equals, contains, startsWith, endsWith, in | | `calendar_id` | `string` | equals, contains, startsWith, endsWith, in | | `transcript_url` | `string` | equals, contains, startsWith, endsWith, in | | `meeting_link` | `string` | equals, contains, startsWith, endsWith, in | | `video_url` | `string` | equals, contains, startsWith, endsWith, in | | `audio_url` | `string` | equals, contains, startsWith, endsWith, in | | `privacy` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `fireflies.db.users.search` ```ts theme={null} const rows = await corsair.fireflies.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `num_transcripts` | `number` | equals, gt, gte, lt, lte, in | | `minutes_consumed` | `number` | equals, gt, gte, lt, lte, in | | `is_admin` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/fireflies/get-credentials Step-by-step instructions for obtaining Fireflies API credentials. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Fireflies API key ## API Key Setup ### Step 1: Get Your API Key 1. Log in to [app.fireflies.ai](https://app.fireflies.ai) 2. Click on your avatar → **Integrations** 3. Go to the **API Access** section 4. Copy your **API Key** 5. Store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=fireflies api_key=your-api-key ``` ## Webhook Setup (Optional) 1. In Fireflies, go to **Settings** → **Webhooks** 2. Add your endpoint URL 3. Copy the signing secret ```bash theme={null} pnpm corsair setup --plugin=fireflies webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Key | All API calls | Settings → Integrations → API Access | | Webhook Secret | Webhook verification | Settings → Webhooks | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/fireflies/overview AI meeting assistant for recording, transcribing, and summarizing calls and conversations. Use **Fireflies.ai** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 15 typed API operations * 3 synced entities (`askFredThreads`, `transcripts`, `users`) for fast `.search()` / `.list()` * 5 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/fireflies ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/fireflies ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/fireflies ``` ```bash bun theme={null} bun add corsair @corsair-dev/fireflies ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { fireflies } from '@corsair-dev/fireflies'; export const corsair = createCorsair({ plugins: [ fireflies(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/fireflies/get-credentials). ```ts theme={null} fireflies() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'fireflies', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`aiApp.getOutputs`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.fireflies.api.aiApp.getOutputs({}); ``` **`askFred.continueThread`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.fireflies.api.askFred.continueThread({}); ``` See the full list on the [API](/plugins/fireflies/api) page. ## Query synced data Synced entities support `tenant.fireflies.db..search()` and `.list()`: `askFredThreads`, `transcripts`, `users`. See [Database](/plugins/fireflies/database) for filters and operators. ## Webhooks This plugin registers **5** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/fireflies/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/fireflies/api)** > > Every `fireflies.api.*` operation with input and output types. > **[Database](/plugins/fireflies/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/fireflies/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/fireflies/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/fireflies/webhooks Fireflies.ai incoming webhooks: event paths, payloads, and response data. The Fireflies.ai plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/fireflies/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `meetings` * `inMeeting` (`meetings.inMeeting`) * `meetingDeleted` (`meetings.meetingDeleted`) * `newMeeting` (`meetings.newMeeting`) * `transcriptions` * `transcriptionComplete` (`transcriptions.transcriptionComplete`) * `transcriptProcessing` (`transcriptions.transcriptProcessing`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Meetings ### In Meeting `meetings.inMeeting` Fireflies bot has joined a meeting **Payload** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | | `clientReferenceId` | `string` | No | — | | `eventType` | `InMeeting` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > meetingId: string, > clientReferenceId?: string | null, > eventType: InMeeting > } > ``` **`webhookHooks` example** ```ts theme={null} fireflies({ webhookHooks: { meetings: { inMeeting: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Meeting Deleted `meetings.meetingDeleted` A meeting has been deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | | `clientReferenceId` | `string` | No | — | | `eventType` | `MeetingDeleted` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > meetingId: string, > clientReferenceId?: string | null, > eventType: MeetingDeleted > } > ``` **`webhookHooks` example** ```ts theme={null} fireflies({ webhookHooks: { meetings: { meetingDeleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### New Meeting `meetings.newMeeting` A new meeting has been detected **Payload** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | | `clientReferenceId` | `string` | No | — | | `eventType` | `NewMeeting` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > meetingId: string, > clientReferenceId?: string | null, > eventType: NewMeeting > } > ``` **`webhookHooks` example** ```ts theme={null} fireflies({ webhookHooks: { meetings: { newMeeting: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Transcriptions ### Transcription Complete `transcriptions.transcriptionComplete` Transcription is complete and available **Payload** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | | `clientReferenceId` | `string` | No | — | | `eventType` | `Transcription` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > meetingId: string, > clientReferenceId?: string | null, > eventType: Transcription > } > ``` **`webhookHooks` example** ```ts theme={null} fireflies({ webhookHooks: { transcriptions: { transcriptionComplete: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Transcript Processing `transcriptions.transcriptProcessing` Transcript is being processed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | | `clientReferenceId` | `string` | No | — | | `eventType` | `TranscriptProcessing` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > meetingId: string, > clientReferenceId?: string | null, > eventType: TranscriptProcessing > } > ``` **`webhookHooks` example** ```ts theme={null} fireflies({ webhookHooks: { transcriptions: { transcriptProcessing: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/fixer/api API reference for Fixer: every `fixer.api.*` operation with input and output types. Every `fixer.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Currencies ### getAll `currencies.getAll` Retrieve list of supported currency symbols and names **Risk:** `read` ```ts theme={null} await corsair.fixer.api.currencies.getAll({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `symbols` | `object` | Yes | — | > **symbols full type** > > ```ts theme={null} > { > } > ``` *** ## Rates ### convert `rates.convert` Convert amounts between two currencies using real-time or historical rates **Risk:** `read` ```ts theme={null} await corsair.fixer.api.rates.convert({ from: 'USD', to: 'EUR', amount: 100 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | Yes | — | | `to` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `query` | `object` | No | — | | `info` | `object` | No | — | | `date` | `string` | No | — | | `result` | `number` | Yes | — | > **query full type** > > ```ts theme={null} > { > from: string, > to: string, > amount: number > } > ``` > **info full type** > > ```ts theme={null} > { > timestamp?: number, > rate: number > } > ``` *** ### historical `rates.historical` Retrieve historical exchange rates for a specific date (YYYY-MM-DD) **Risk:** `read` ```ts theme={null} await corsair.fixer.api.rates.historical({ date: '2026-01-01', symbols: ['USD'], }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | Yes | — | | `base` | `string` | No | — | | `symbols` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `historical` | `boolean` | No | — | | `date` | `string` | No | — | | `base` | `string` | No | — | | `rates` | `object` | Yes | — | > **rates full type** > > ```ts theme={null} > { > } > ``` *** ### latest `rates.latest` Retrieve real-time exchange rates for all or specified currencies **Risk:** `read` ```ts theme={null} await corsair.fixer.api.rates.latest({ base: 'EUR', symbols: ['USD', 'GBP'], }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `base` | `string` | No | — | | `symbols` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `timestamp` | `number` | No | — | | `base` | `string` | No | — | | `date` | `string` | No | — | | `rates` | `object` | Yes | — | > **rates full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/fixer/database Fixer local sync: searchable entities, `.search()` filters, and operators. The Fixer plugin syncs data locally. Use `corsair.fixer.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Conversions Path: `fixer.db.conversions.search` ```ts theme={null} const rows = await corsair.fixer.db.conversions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `rate` | `number` | equals, gt, gte, lt, lte, in | | `result` | `number` | equals, gt, gte, lt, lte, in | | `timestamp` | `number` | equals, gt, gte, lt, lte, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Currencies Path: `fixer.db.currencies.search` ```ts theme={null} const rows = await corsair.fixer.db.currencies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Rates Path: `fixer.db.rates.search` ```ts theme={null} const rows = await corsair.fixer.db.rates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `base` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `timestamp` | `number` | equals, gt, gte, lt, lte, in | | `historical` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/fixer/overview Foreign exchange rates and currency conversion for 170 world currencies. Use **Fixer** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 3 synced entities (`conversions`, `currencies`, `rates`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/fixer ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/fixer ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/fixer ``` ```bash bun theme={null} bun add corsair @corsair-dev/fixer ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { fixer } from '@corsair-dev/fixer'; export const corsair = createCorsair({ plugins: [ fixer(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} fixer() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'fixer', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Latest rates** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.fixer.api.rates.latest({ base: 'EUR', symbols: ['USD', 'GBP'], }); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/fixer/api) reference.* See the full list on the [API](/plugins/fixer/api) page. ## Query synced data Synced entities support `tenant.fixer.db..search()` and `.list()`: `conversions`, `currencies`, `rates`. See [Database](/plugins/fixer/database) for filters and operators. ## What's next > **[API reference](/plugins/fixer/api)** > > Every `fixer.api.*` operation with input and output types. > **[Database](/plugins/fixer/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/flexisign/api API reference for Flexisign: every `flexisign.api.*` operation with input and output types. Every `flexisign.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## List ### templates `list.templates` List all available document templates in FlexiSign **Risk:** `read` ```ts theme={null} await corsair.flexisign.api.list.templates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `code` | `number` | Yes | — | | `data` | `object` | Yes | — | | `message` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > list: { > _id: string, > name: string > }[], > meta: { > total: number, > limit: number, > page: number, > pages: number, > previousPage?: number | null, > nextPage?: number | null > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/flexisign/database Flexisign local sync: searchable entities, `.search()` filters, and operators. The Flexisign plugin syncs data locally. Use `corsair.flexisign.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/flexisign/overview Flexisign plugin for Corsair Use **Flexisign** through Corsair: one client, typed API calls. **What you get:** * 1 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/flexisign ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/flexisign ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/flexisign ``` ```bash bun theme={null} bun add corsair @corsair-dev/flexisign ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { flexisign } from '@corsair-dev/flexisign'; export const corsair = createCorsair({ plugins: [ flexisign(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} flexisign() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'flexisign', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`list.templates`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.flexisign.api.list.templates({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/flexisign/api) reference.* See the full list on the [API](/plugins/flexisign/api) page. ## What's next > **[API reference](/plugins/flexisign/api)** > > Every `flexisign.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/flutterwave/api API reference for Flutterwave: every `flutterwave.api.*` operation with input and output types. Every `flutterwave.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Banks ### getBranches `banks.getBranches` Get branches for a bank. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.banks.getBranches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > branch_name?: string, > branch_code?: string > }[] > ``` *** ### getByCountry `banks.getByCountry` Get banks by country. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.banks.getByCountry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string \| number` | Yes | — | | `include_provider_type` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > code?: string, > name?: string > }[] > ``` *** ### resolveAccount `banks.resolveAccount` Resolve bank account details. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.banks.resolveAccount({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_number: string, > account_bank: string, > query?: { > }, > body?: { > } > } | { > query?: { > }, > body: { > account_number: string, > account_bank: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > account_number?: string, > account_name?: string > } > ``` *** ## Beneficiaries ### create `beneficiaries.create` Create a transfer beneficiary. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.beneficiaries.create({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > body: { > account_number: string, > account_bank: string, > beneficiary_name: string > }, > query?: { > } > } | { > account_number: string, > account_bank: string, > beneficiary_name: string, > query?: { > }, > body?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > account_number?: string, > bank_name?: string, > full_name?: string > } > ``` *** ### delete `beneficiaries.delete` Delete a beneficiary by ID. **Risk:** `destructive` ```ts theme={null} await corsair.flutterwave.api.beneficiaries.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number > } > ``` *** ### get `beneficiaries.get` Fetch a beneficiary by ID. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.beneficiaries.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > account_number?: string, > bank_name?: string, > full_name?: string > } > ``` *** ### list `beneficiaries.list` List all beneficiaries. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.beneficiaries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > account_number?: string, > bank_name?: string, > full_name?: string > }[] > ``` *** ## Bills ### getCategories `bills.getCategories` Get bill categories. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.bills.getCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > name?: string > }[] > ``` *** ### listBillers `bills.listBillers` List billers in a category. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.bills.listBillers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category` | `string \| number` | Yes | — | | `country` | `string` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > name?: string, > biller_code?: string > }[] > ``` *** ### listProducts `bills.listProducts` List biller products. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.bills.listProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `biller_code` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > item_code?: string, > name?: string, > amount?: string | number > }[] > ``` *** ### listRecurring `bills.listRecurring` List recurring bill payments. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.bills.listRecurring({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `any` | No | — | | `from` | `any` | No | — | | `to` | `any` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `reference` | `any` | No | — | | `category` | `any` | No | — | | `country` | `string` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > status?: string > }[] > ``` *** ### validateItem `bills.validateItem` Validate a bill item before payment. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.bills.validateItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_code` | `string \| number` | Yes | — | | `customer` | `object` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **customer full type** > > ```ts theme={null} > { > email: string, > name?: string, > phonenumber?: string > } | string > ``` > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > response_code?: string, > response_message?: string, > name?: string > } > ``` *** ## Bulk Tokenized Charges ### create `bulkTokenizedCharges.create` Create a bulk tokenized charge batch. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.bulkTokenizedCharges.create({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > title: string, > bulk_data: { > }[], > retry_strategy?: string, > query?: { > }, > body?: { > } > } | { > query?: { > }, > body: { > title: string, > bulk_data: { > }[] > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > status?: string > } > ``` *** ### get `bulkTokenizedCharges.get` Get status of bulk tokenized charges. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.bulkTokenizedCharges.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bulk_id` | `number` | Yes | — | | `query` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > status?: string, > pending?: number > } > ``` *** ## Bulk Virtual Accounts ### create `bulkVirtualAccounts.create` Create bulk virtual account numbers. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.bulkVirtualAccounts.create({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > body: { > batch_ref: string, > bulk_data: { > firstname: string, > lastname: string, > email: string, > bvn?: string, > nin?: string > }[], > is_permanent?: boolean > }, > query?: { > } > } | { > batch_ref: string, > bulk_data: { > firstname: string, > lastname: string, > email: string, > bvn?: string, > nin?: string > }[], > is_permanent?: boolean, > query?: { > }, > body?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > batch_id?: string, > response_code?: string > } > ``` *** ### get `bulkVirtualAccounts.get` Get details for a bulk virtual account batch. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.bulkVirtualAccounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch_id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > batch_id?: string, > status?: string > } > ``` *** ## Cards ### resolveBin `cards.resolveBin` Resolve card BIN details. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.cards.resolveBin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bin` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > issuing_country?: string, > bin?: string, > card_type?: string, > issuer?: string > } > ``` *** ## Chargebacks ### list `chargebacks.list` List chargebacks. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.chargebacks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `status` | `any` | No | — | | `from` | `any` | No | — | | `to` | `any` | No | — | | `flw_ref` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > amount?: string | number, > status?: string > }[] > ``` *** ## Charges ### initiateMobileMoneyTanzania `charges.initiateMobileMoneyTanzania` Initiate mobile money charge in Tanzania. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.charges.initiateMobileMoneyTanzania({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > type: string, > tx_ref: string, > amount: string | number, > currency: string, > email: string, > phone_number: string, > query?: { > }, > body?: { > } > } | { > type: string, > query?: { > }, > body: { > tx_ref: string, > amount: string | number, > currency: string, > email: string, > phone_number: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > tx_ref?: string, > flw_ref?: string, > status?: string, > amount?: string | number, > currency?: string > } > ``` *** ## Payment Links ### create `paymentLinks.create` Create a hosted payment link. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.paymentLinks.create({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > tx_ref: string, > amount: string | number, > customer: { > email: string, > name?: string, > phonenumber?: string > } | string, > currency?: string, > redirect_url?: string, > query?: { > }, > body?: { > } > } | { > query?: { > }, > body: { > tx_ref: string, > amount: string | number, > customer: { > email: string, > name?: string, > phonenumber?: string > } | string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > link?: string > } > ``` *** ### disable `paymentLinks.disable` Disable an existing payment link. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.paymentLinks.disable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > status?: string > } > ``` *** ## Payment Plans ### cancel `paymentPlans.cancel` Cancel a Flutterwave payment plan by ID. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.paymentPlans.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > amount?: string | number, > interval?: string, > status?: string > } > ``` *** ### create `paymentPlans.create` Create a payment plan. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.paymentPlans.create({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > amount: string | number, > name: string, > interval: string, > query?: { > }, > body?: { > } > } | { > query?: { > }, > body: { > amount: string | number, > name: string, > interval: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > amount?: string | number, > interval?: string, > status?: string > } > ``` *** ### get `paymentPlans.get` Get a payment plan by ID. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.paymentPlans.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > amount?: string | number, > interval?: string, > status?: string > } > ``` *** ### list `paymentPlans.list` List payment plans. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.paymentPlans.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `any` | No | — | | `to` | `any` | No | — | | `page` | `number` | No | — | | `amount` | `string \| number` | No | — | | `currency` | `string` | No | — | | `interval` | `string` | No | — | | `status` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > amount?: string | number, > interval?: string, > status?: string > }[] > ``` *** ### update `paymentPlans.update` Update a payment plan. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.paymentPlans.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > name?: string, > amount?: string | number, > interval?: string, > status?: string > } > ``` *** ## Payout Subaccounts ### list `payoutSubaccounts.list` List payout subaccounts. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.payoutSubaccounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `next_cursor` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > account_reference?: string > }[] > ``` *** ### listRefunds `payoutSubaccounts.listRefunds` List payout subaccount refunds. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.payoutSubaccounts.listRefunds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `from` | `any` | No | — | | `to` | `any` | No | — | | `reference` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > amount?: string | number, > status?: string, > tx_id?: string | number > }[] > ``` *** ## Refunds ### create `refunds.create` Create a refund for a transaction. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.refunds.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `amount` | `string \| number` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > amount?: string | number, > status?: string, > tx_id?: string | number > } > ``` *** ### get `refunds.get` Get refund details by ID. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.refunds.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > amount?: string | number, > status?: string, > tx_id?: string | number > } > ``` *** ### list `refunds.list` List refund transactions with filters. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.refunds.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `any` | No | — | | `to` | `any` | No | — | | `status` | `string` | No | — | | `currency` | `string` | No | — | | `flw_ref` | `any` | No | — | | `id` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > amount?: string | number, > status?: string, > tx_id?: string | number > }[] > ``` *** ## Settlements ### list `settlements.list` List settlements. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.settlements.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `from` | `any` | No | — | | `to` | `any` | No | — | | `subaccount_id` | `any` | No | — | | `disburse_ref` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > amount?: string | number, > status?: string > }[] > ``` *** ## Subaccounts ### create `subaccounts.create` Create a subaccount. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.subaccounts.create({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > account_bank: string, > account_number: string, > business_name: string, > split_value: number, > country: string, > business_mobile: string, > query?: { > }, > body?: { > } > } | { > query?: { > }, > body: { > account_bank: string, > account_number: string, > business_name: string, > split_value: number, > country: string, > business_mobile: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > account_number?: string, > business_name?: string, > split_value?: number > } > ``` *** ### delete `subaccounts.delete` Delete a subaccount by ID. **Risk:** `destructive` ```ts theme={null} await corsair.flutterwave.api.subaccounts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number > } > ``` *** ### get `subaccounts.get` Fetch a subaccount by ID. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.subaccounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > account_number?: string, > business_name?: string, > split_value?: number > } > ``` *** ### list `subaccounts.list` List all subaccounts. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.subaccounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_bank` | `string` | No | — | | `account_number` | `string` | No | — | | `bank_name` | `any` | No | — | | `page` | `number` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > account_number?: string, > business_name?: string, > split_value?: number > }[] > ``` *** ### update `subaccounts.update` Update a subaccount. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.subaccounts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `business_name` | `string` | No | — | | `split_value` | `number` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > account_number?: string, > business_name?: string, > split_value?: number > } > ``` *** ## Subscriptions ### list `subscriptions.list` Get all subscriptions, including cancelled. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.subscriptions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `transaction_id` | `any` | No | — | | `plan` | `any` | No | — | | `subscribed_from` | `any` | No | — | | `subscribed_to` | `any` | No | — | | `next_due_from` | `any` | No | — | | `next_due_to` | `any` | No | — | | `page` | `number` | No | — | | `status` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > status?: string, > customer?: any, > plan?: string | number > }[] > ``` *** ## Transactions ### generateReference `transactions.generateReference` Generate a unique transaction reference. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.transactions.generateReference({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prefix` | `string` | No | — | | `length` | `number` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > tx_ref?: string, > reference?: string > } > ``` *** ### get `transactions.get` Get a transaction by ID. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.transactions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > tx_ref?: string, > flw_ref?: string, > status?: string, > amount?: string | number, > currency?: string > } > ``` *** ### getFee `transactions.getFee` Get transaction fee estimate. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.transactions.getFee({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `string \| number` | Yes | — | | `currency` | `string` | Yes | — | | `payment_type` | `any` | No | — | | `card_first6digits` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > charge_amount?: string | number, > fee?: string | number, > merchant_fee?: string | number > } > ``` *** ### list `transactions.list` Retrieve all transactions. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.transactions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | No | — | | `to` | `string` | No | — | | `page` | `number` | No | — | | `status` | `any` | No | — | | `tx_ref` | `string` | No | — | | `customer_email` | `any` | No | — | | `currency` | `string` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > tx_ref?: string, > flw_ref?: string, > status?: string, > amount?: string | number, > currency?: string > }[] > ``` *** ### verifyByReference `transactions.verifyByReference` Verify a transaction by tx\_ref. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.transactions.verifyByReference({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tx_ref` | `string` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > tx_ref?: string, > flw_ref?: string, > status?: string, > amount?: string | number, > currency?: string > } > ``` *** ### viewTimeline `transactions.viewTimeline` View transaction timeline. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.transactions.viewTimeline({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > note?: string, > action?: string > }[] > ``` *** ## Transfers ### getFee `transfers.getFee` Get transfer fee estimate. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.transfers.getFee({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `string \| number` | Yes | — | | `currency` | `string` | Yes | — | | `type` | `string` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > fee?: string | number, > currency?: string > } > ``` *** ### getRates `transfers.getRates` Get transfer exchange rates. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.transfers.getRates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `string \| number` | Yes | — | | `destination_currency` | `string` | Yes | — | | `source_currency` | `string` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > rate?: string | number, > source?: any, > destination?: any > } > ``` *** ### list `transfers.list` List transfers. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.transfers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reference` | `any` | No | — | | `page` | `number` | No | — | | `status` | `any` | No | — | | `from` | `any` | No | — | | `to` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string | number, > amount?: string | number, > status?: string, > reference?: string > }[] > ``` *** ## Verification ### initiateBvn `verification.initiateBvn` Initiate BVN verification. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.verification.initiateBvn({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > bvn: string, > firstname: string, > lastname: string, > redirect_url?: string, > query?: { > }, > body?: { > } > } | { > query?: { > }, > body: { > bvn: string, > firstname: string, > lastname: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > url?: string, > reference?: string > } > ``` *** ## Virtual Accounts ### create `virtualAccounts.create` Create a virtual account number. **Risk:** `write` ```ts theme={null} await corsair.flutterwave.api.virtualAccounts.create({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > email: string, > firstname: string, > lastname: string, > tx_ref?: string, > amount?: string | number, > narration?: string, > query?: { > }, > body?: { > } > } | { > query?: { > }, > body: { > email: string, > firstname: string, > lastname: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > account_number?: string, > bank_name?: string, > order_ref?: string, > flw_ref?: string, > amount?: string | number > } > ``` *** ### get `virtualAccounts.get` Get virtual account number details by order reference. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.virtualAccounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `order_ref` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > account_number?: string, > bank_name?: string, > order_ref?: string, > flw_ref?: string, > amount?: string | number > } > ``` *** ## Wallets ### getBalanceByCurrency `wallets.getBalanceByCurrency` Get wallet balance by currency. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.wallets.getBalanceByCurrency({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `currency` | `string \| number` | Yes | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > currency?: string, > available_balance?: string | number > } > ``` *** ### getStatement `wallets.getStatement` Get wallet statement. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.wallets.getStatement({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | No | — | | `to` | `string` | No | — | | `currency` | `string` | No | — | | `type` | `string` | No | — | | `page` | `any` | No | — | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > type?: string, > amount?: string | number, > currency?: string, > created_at?: string > }[] > ``` *** ### listBalances `wallets.listBalances` Get wallet balances across currencies. **Risk:** `read` ```ts theme={null} await corsair.flutterwave.api.wallets.listBalances({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `message` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > currency?: string, > available_balance?: string | number > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/flutterwave/database Flutterwave local sync: searchable entities, `.search()` filters, and operators. The Flutterwave plugin syncs data locally. Use `corsair.flutterwave.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/flutterwave/overview Flutterwave plugin for Corsair Use **Flutterwave** through Corsair: one client, typed API calls. **What you get:** * 53 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/flutterwave ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/flutterwave ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/flutterwave ``` ```bash bun theme={null} bun add corsair @corsair-dev/flutterwave ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { flutterwave } from '@corsair-dev/flutterwave'; export const corsair = createCorsair({ plugins: [ flutterwave(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} flutterwave() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'flutterwave', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`banks.getBranches`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.flutterwave.api.banks.getBranches({}); ``` **`beneficiaries.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.flutterwave.api.beneficiaries.create({}); ``` See the full list on the [API](/plugins/flutterwave/api) page. ## What's next > **[API reference](/plugins/flutterwave/api)** > > Every `flutterwave.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/formbricks/api API reference for Formbricks: every `formbricks.api.*` operation with input and output types. Every `formbricks.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Action Classes ### create `actionClasses.create` Create an action class **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.actionClasses.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `type` | `code \| noCode` | Yes | — | | `key` | `string` | No | — | | `noCodeConfig` | `object` | No | — | > **noCodeConfig full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `type` | `string` | No | — | | `key` | `string` | No | — | | `workspaceId` | `string` | No | — | | `noCodeConfig` | `any` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### list `actionClasses.list` List the action classes that can trigger a survey **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.actionClasses.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > description?: string | null, > type?: string | null, > key?: string | null, > workspaceId?: string | null, > noCodeConfig?: any, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ## Client ### contactsState `client.contactsState` Read a respondent's state, creating the contact if the userId is new **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.client.contactsState({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `userId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `state` | `object` | No | — | > **state full type** > > ```ts theme={null} > { > data?: any, > expiresAt?: string | null > } > ``` *** ### createDisplay `client.createDisplay` Record that a survey was displayed to someone **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.client.createDisplay({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `surveyId` | `string` | Yes | — | | `userId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `surveyId` | `string` | No | — | | `contactId` | `string` | No | — | *** ### createUser `client.createUser` Create a client user **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.client.createUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `userId` | `string` | Yes | — | | `attributes` | `object` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `state` | `object` | No | — | > **state full type** > > ```ts theme={null} > { > data?: any, > expiresAt?: string | null > } > ``` *** ### environment `client.environment` Read the client environment bundle for a workspace **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.client.environment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | | `expiresAt` | `string` | No | — | *** ### identifyUser `client.identifyUser` Create or identify a client user **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.client.identifyUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `userId` | `string` | Yes | — | | `attributes` | `object` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `state` | `object` | No | — | > **state full type** > > ```ts theme={null} > { > data?: any, > expiresAt?: string | null > } > ``` *** ## Contact Attribute Keys ### create `contactAttributeKeys.create` Create a contact attribute key **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.contactAttributeKeys.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `key` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `key` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `type` | `string` | No | — | | `dataType` | `string` | No | — | | `isUnique` | `boolean` | No | — | | `workspaceId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### delete `contactAttributeKeys.delete` Delete a contact attribute key **Risk:** `destructive` ```ts theme={null} await corsair.formbricks.api.contactAttributeKeys.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactAttributeKeyId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### get `contactAttributeKeys.get` Get a single contact attribute key **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.contactAttributeKeys.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactAttributeKeyId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `key` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `type` | `string` | No | — | | `dataType` | `string` | No | — | | `isUnique` | `boolean` | No | — | | `workspaceId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### getClass `contactAttributeKeys.getClass` Get an attribute key under the catalog's former "attribute class" name - same route as contactAttributeKeys.get **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.contactAttributeKeys.getClass({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactAttributeKeyId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `key` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `type` | `string` | No | — | | `dataType` | `string` | No | — | | `isUnique` | `boolean` | No | — | | `workspaceId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### list `contactAttributeKeys.list` List the contact attribute keys a workspace defines **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.contactAttributeKeys.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > key?: string | null, > name?: string | null, > description?: string | null, > type?: string | null, > dataType?: string | null, > isUnique?: boolean | null, > workspaceId?: string | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### listClasses `contactAttributeKeys.listClasses` List attribute keys under the catalog's former "attribute class" name - same route as contactAttributeKeys.list **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.contactAttributeKeys.listClasses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > key?: string | null, > name?: string | null, > description?: string | null, > type?: string | null, > dataType?: string | null, > isUnique?: boolean | null, > workspaceId?: string | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### update `contactAttributeKeys.update` Update a contact attribute key's definition - not any contact's values **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.contactAttributeKeys.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactAttributeKeyId` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `key` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `type` | `string` | No | — | | `dataType` | `string` | No | — | | `isUnique` | `boolean` | No | — | | `workspaceId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ## Contact Attributes ### list `contactAttributes.list` List contact attribute values across contacts **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.contactAttributes.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > attributeKeyId?: string | null, > contactId?: string | null, > value?: string | null, > valueNumber?: number | null, > valueDate?: string | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ## Contacts ### create `contacts.create` Create a contact **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `attributes` | `object` | Yes | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `workspaceId` | `string` | No | — | | `attributes` | `any` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### delete `contacts.delete` Delete a contact, removing a respondent's identity **Risk:** `destructive` ```ts theme={null} await corsair.formbricks.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### get `contacts.get` Get a single contact **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `workspaceId` | `string` | No | — | | `attributes` | `any` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### getPerson `contacts.getPerson` Get a contact under the catalog's former "person" name - same route as contacts.get **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.contacts.getPerson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `workspaceId` | `string` | No | — | | `attributes` | `any` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### list `contacts.list` List the contacts in a workspace **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.contacts.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > workspaceId?: string | null, > attributes?: any, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### listPeople `contacts.listPeople` List contacts under the catalog's former "people" name - same route as contacts.list **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.contacts.listPeople({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > workspaceId?: string | null, > attributes?: any, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### updateAttributes `contacts.updateAttributes` Set a contact's attribute values by userId, creating the contact if it is new **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.contacts.updateAttributes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `userId` | `string` | Yes | — | | `attributes` | `object` | Yes | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `state` | `object` | No | — | > **state full type** > > ```ts theme={null} > { > data?: any, > expiresAt?: string | null > } > ``` *** ### uploadBulk `contacts.uploadBulk` Create many contacts in one request **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.contacts.uploadBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `contacts` | `object[]` | Yes | — | > **contacts full type** > > ```ts theme={null} > { > attributes: { > attributeKey: { > key: string, > name?: string > }, > value: string > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `message` | `string` | No | — | *** ## Health ### check `health.check` Check service health **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.health.check({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `main_database` | `any` | No | — | | `cache_database` | `any` | No | — | *** ### list `health.list` Read service health status **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.health.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `main_database` | `any` | No | — | | `cache_database` | `any` | No | — | *** ## Me ### get `me.get` Get the API key's identity, workspaces and organization **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.me.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | No | — | | `workspacePermissions` | `any[]` | No | — | | `environmentPermissions` | `any[]` | No | — | | `organizationAccess` | `any` | No | — | *** ### getAccountInfo `me.getAccountInfo` Get account information **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.me.getAccountInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `appSetupCompleted` | `boolean` | No | — | | `workspace` | `any` | No | — | | `project` | `any` | No | — | *** ### getManagement `me.getManagement` Get the v1 account payload, for a workspace-scoped key only **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.me.getManagement({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `appSetupCompleted` | `boolean` | No | — | | `workspace` | `any` | No | — | | `project` | `any` | No | — | *** ## Responses ### create `responses.create` Record a survey response **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.responses.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `surveyId` | `string` | Yes | — | | `data` | `object` | Yes | — | | `finished` | `boolean` | No | — | | `meta` | `object` | No | — | | `ttc` | `object` | No | — | | `language` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` > **ttc full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `surveyId` | `string` | No | — | | `finished` | `boolean` | No | — | | `endingId` | `string` | No | — | | `data` | `any` | No | — | | `meta` | `any` | No | — | | `ttc` | `any` | No | — | | `variables` | `any` | No | — | | `contactAttributes` | `any` | No | — | | `contact` | `any` | No | — | | `singleUseId` | `string` | No | — | | `language` | `string` | No | — | | `displayId` | `string` | No | — | | `tags` | `any[]` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### delete `responses.delete` Delete a survey response, erasing a respondent's submitted answers **Risk:** `destructive` ```ts theme={null} await corsair.formbricks.api.responses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### list `responses.list` List survey responses, optionally for one survey **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.responses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `surveyId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > surveyId?: string | null, > finished?: boolean | null, > endingId?: string | null, > data?: any, > meta?: any, > ttc?: any, > variables?: any, > contactAttributes?: any, > contact?: any, > singleUseId?: string | null, > language?: string | null, > displayId?: string | null, > tags?: any[] | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### update `responses.update` Update a survey response **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.responses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | | `data` | `object` | Yes | — | | `finished` | `boolean` | No | — | | `variables` | `object` | No | — | | `language` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **variables full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `surveyId` | `string` | No | — | | `finished` | `boolean` | No | — | | `endingId` | `string` | No | — | | `data` | `any` | No | — | | `meta` | `any` | No | — | | `ttc` | `any` | No | — | | `variables` | `any` | No | — | | `contactAttributes` | `any` | No | — | | `contact` | `any` | No | — | | `singleUseId` | `string` | No | — | | `language` | `string` | No | — | | `displayId` | `string` | No | — | | `tags` | `any[]` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ## Roles ### list `roles.list` List the organization roles a member can hold **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.roles.list({}); ``` **Input:** *empty object* **Output:** `string[]` *** ## Storage ### uploadPrivate `storage.uploadPrivate` Request an upload for a private respondent file **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.storage.uploadPrivate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `fileName` | `string` | Yes | — | | `fileType` | `string` | Yes | — | | `surveyId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `signedUrl` | `string` | No | — | | `presignedFields` | `any` | No | — | | `fileUrl` | `string` | No | — | *** ### uploadPublic `storage.uploadPublic` Request an upload for a public file **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.storage.uploadPublic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `fileName` | `string` | Yes | — | | `fileType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `signedUrl` | `string` | No | — | | `presignedFields` | `any` | No | — | | `fileUrl` | `string` | No | — | *** ## Surveys ### create `surveys.create` Create a survey **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.surveys.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `string` | No | — | | `questions` | `object[]` | No | — | | `welcomeCard` | `object` | No | — | | `endings` | `object[]` | No | — | | `status` | `string` | No | — | | `triggers` | `object[]` | No | — | > **questions full type** > > ```ts theme={null} > { > }[] > ``` > **welcomeCard full type** > > ```ts theme={null} > { > } > ``` > **endings full type** > > ```ts theme={null} > { > }[] > ``` > **triggers full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `workspaceId` | `string` | No | — | | `createdBy` | `string` | No | — | | `slug` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `publishOn` | `string` | No | — | | `closeOn` | `string` | No | — | | `archivedAt` | `string` | No | — | | `welcomeCard` | `any` | No | — | | `questions` | `any[]` | No | — | | `blocks` | `any` | No | — | | `endings` | `any[]` | No | — | | `hiddenFields` | `any` | No | — | | `variables` | `any[]` | No | — | | `styling` | `any` | No | — | | `languages` | `any[]` | No | — | | `surveyClosedMessage` | `any` | No | — | | `metadata` | `any` | No | — | | `displayOption` | `string` | No | — | | `recontactDays` | `number` | No | — | | `displayLimit` | `number` | No | — | | `displayPercentage` | `number` | No | — | | `autoClose` | `number` | No | — | | `delay` | `number` | No | — | | `autoComplete` | `number` | No | — | | `isVerifyEmailEnabled` | `boolean` | No | — | | `isSingleResponsePerEmailEnabled` | `boolean` | No | — | | `isBackButtonHidden` | `boolean` | No | — | | `isAutoProgressingEnabled` | `boolean` | No | — | | `isCaptureIpEnabled` | `boolean` | No | — | | `showLanguageSwitch` | `boolean` | No | — | | `redirectUrl` | `string` | No | — | | `pin` | `string` | No | — | | `singleUse` | `any` | No | — | | `recaptcha` | `any` | No | — | | `customHeadScripts` | `string` | No | — | | `customHeadScriptsMode` | `string` | No | — | | `workspaceOverwrites` | `any` | No | — | | `projectOverwrites` | `any` | No | — | | `triggers` | `any[]` | No | — | | `segment` | `any` | No | — | | `followUps` | `any[]` | No | — | *** ### delete `surveys.delete` Delete a survey and the responses collected against it **Risk:** `destructive` ```ts theme={null} await corsair.formbricks.api.surveys.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `surveyId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### list `surveys.list` List the surveys in a workspace **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.surveys.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > status?: string | null, > workspaceId?: string | null, > createdBy?: string | null, > slug?: string | null, > createdAt?: string | null, > updatedAt?: string | null, > publishOn?: string | null, > closeOn?: string | null, > archivedAt?: string | null, > welcomeCard?: any, > questions?: any[] | null, > blocks?: any, > endings?: any[] | null, > hiddenFields?: any, > variables?: any[] | null, > styling?: any, > languages?: any[] | null, > surveyClosedMessage?: any, > metadata?: any, > displayOption?: string | null, > recontactDays?: number | null, > displayLimit?: number | null, > displayPercentage?: number | null, > autoClose?: number | null, > delay?: number | null, > autoComplete?: number | null, > isVerifyEmailEnabled?: boolean | null, > isSingleResponsePerEmailEnabled?: boolean | null, > isBackButtonHidden?: boolean | null, > isAutoProgressingEnabled?: boolean | null, > isCaptureIpEnabled?: boolean | null, > showLanguageSwitch?: boolean | null, > redirectUrl?: string | null, > pin?: string | null, > singleUse?: any, > recaptcha?: any, > customHeadScripts?: string | null, > customHeadScriptsMode?: string | null, > workspaceOverwrites?: any, > projectOverwrites?: any, > triggers?: any[] | null, > segment?: any, > followUps?: any[] | null > }[] > ``` *** ### update `surveys.update` Update a survey **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.surveys.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `surveyId` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `questions` | `object[]` | No | — | | `welcomeCard` | `object` | No | — | | `endings` | `object[]` | No | — | | `triggers` | `object[]` | No | — | > **questions full type** > > ```ts theme={null} > { > }[] > ``` > **welcomeCard full type** > > ```ts theme={null} > { > } > ``` > **endings full type** > > ```ts theme={null} > { > }[] > ``` > **triggers full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `workspaceId` | `string` | No | — | | `createdBy` | `string` | No | — | | `slug` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `publishOn` | `string` | No | — | | `closeOn` | `string` | No | — | | `archivedAt` | `string` | No | — | | `welcomeCard` | `any` | No | — | | `questions` | `any[]` | No | — | | `blocks` | `any` | No | — | | `endings` | `any[]` | No | — | | `hiddenFields` | `any` | No | — | | `variables` | `any[]` | No | — | | `styling` | `any` | No | — | | `languages` | `any[]` | No | — | | `surveyClosedMessage` | `any` | No | — | | `metadata` | `any` | No | — | | `displayOption` | `string` | No | — | | `recontactDays` | `number` | No | — | | `displayLimit` | `number` | No | — | | `displayPercentage` | `number` | No | — | | `autoClose` | `number` | No | — | | `delay` | `number` | No | — | | `autoComplete` | `number` | No | — | | `isVerifyEmailEnabled` | `boolean` | No | — | | `isSingleResponsePerEmailEnabled` | `boolean` | No | — | | `isBackButtonHidden` | `boolean` | No | — | | `isAutoProgressingEnabled` | `boolean` | No | — | | `isCaptureIpEnabled` | `boolean` | No | — | | `showLanguageSwitch` | `boolean` | No | — | | `redirectUrl` | `string` | No | — | | `pin` | `string` | No | — | | `singleUse` | `any` | No | — | | `recaptcha` | `any` | No | — | | `customHeadScripts` | `string` | No | — | | `customHeadScriptsMode` | `string` | No | — | | `workspaceOverwrites` | `any` | No | — | | `projectOverwrites` | `any` | No | — | | `triggers` | `any[]` | No | — | | `segment` | `any` | No | — | | `followUps` | `any[]` | No | — | *** ## Teams ### delete `teams.delete` Delete a team, removing the workspace access it granted **Risk:** `destructive` ```ts theme={null} await corsair.formbricks.api.teams.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | | `teamId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### list `teams.list` List the teams in an organization **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `organizationId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > organizationId?: string | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### listWorkspaceTeams `teams.listWorkspaceTeams` List which teams have access to which workspace **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.teams.listWorkspaceTeams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `organizationId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > teamId?: string | null, > workspaceId?: string | null, > permission?: string | null, > projectId?: string | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ## Webhooks ### create `webhooks.create` Create a webhook and receive its signing secret **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | | `source` | `user \| zapier \| make \| n8n` | Yes | — | | `triggers` | `responseFinished \| responseCreated \| responseUpdated[]` | Yes | — | | `surveyIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `source` | `string` | No | — | | `workspaceId` | `string` | No | — | | `triggers` | `string[]` | No | — | | `surveyIds` | `string[]` | No | — | | `secret` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### delete `webhooks.delete` Delete a webhook, invalidating its signing secret **Risk:** `destructive` ```ts theme={null} await corsair.formbricks.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `string` | Yes | — | | `already_absent` | `boolean` | Yes | — | *** ### get `webhooks.get` Get a single webhook **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `source` | `string` | No | — | | `workspaceId` | `string` | No | — | | `triggers` | `string[]` | No | — | | `surveyIds` | `string[]` | No | — | | `secret` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### list `webhooks.list` List the webhooks on a workspace **Risk:** `read` ```ts theme={null} await corsair.formbricks.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > url?: string | null, > source?: string | null, > workspaceId?: string | null, > triggers?: string[] | null, > surveyIds?: string[] | null, > secret?: string | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### update `webhooks.update` Update a webhook **Risk:** `write` ```ts theme={null} await corsair.formbricks.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | | `workspaceId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | | `source` | `user \| zapier \| make \| n8n` | Yes | — | | `triggers` | `responseFinished \| responseCreated \| responseUpdated[]` | Yes | — | | `surveyIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `url` | `string` | No | — | | `source` | `string` | No | — | | `workspaceId` | `string` | No | — | | `triggers` | `string[]` | No | — | | `surveyIds` | `string[]` | No | — | | `secret` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/formbricks/database Formbricks local sync: searchable entities, `.search()` filters, and operators. The Formbricks plugin syncs data locally. Use `corsair.formbricks.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Action Classes Path: `formbricks.db.actionClasses.search` ```ts theme={null} const rows = await corsair.formbricks.db.actionClasses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contact Attribute Keys Path: `formbricks.db.contactAttributeKeys.search` ```ts theme={null} const rows = await corsair.formbricks.db.contactAttributeKeys.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `dataType` | `string` | equals, contains, startsWith, endsWith, in | | `isUnique` | `boolean` | equals | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Surveys Path: `formbricks.db.surveys.search` ```ts theme={null} const rows = await corsair.formbricks.db.surveys.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `createdBy` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `publishOn` | `string` | equals, contains, startsWith, endsWith, in | | `closeOn` | `string` | equals, contains, startsWith, endsWith, in | | `archivedAt` | `string` | equals, contains, startsWith, endsWith, in | | `displayOption` | `string` | equals, contains, startsWith, endsWith, in | | `recontactDays` | `number` | equals, gt, gte, lt, lte, in | | `displayLimit` | `number` | equals, gt, gte, lt, lte, in | | `displayPercentage` | `number` | equals, gt, gte, lt, lte, in | | `autoClose` | `number` | equals, gt, gte, lt, lte, in | | `delay` | `number` | equals, gt, gte, lt, lte, in | | `autoComplete` | `number` | equals, gt, gte, lt, lte, in | | `isVerifyEmailEnabled` | `boolean` | equals | | `isSingleResponsePerEmailEnabled` | `boolean` | equals | | `isBackButtonHidden` | `boolean` | equals | | `isAutoProgressingEnabled` | `boolean` | equals | | `isCaptureIpEnabled` | `boolean` | equals | | `showLanguageSwitch` | `boolean` | equals | | `redirectUrl` | `string` | equals, contains, startsWith, endsWith, in | | `pin` | `string` | equals, contains, startsWith, endsWith, in | | `customHeadScripts` | `string` | equals, contains, startsWith, endsWith, in | | `customHeadScriptsMode` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `formbricks.db.teams.search` ```ts theme={null} const rows = await corsair.formbricks.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `organizationId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `formbricks.db.webhooks.search` ```ts theme={null} const rows = await corsair.formbricks.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `secret` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/formbricks/overview Open-source experience management platform for in-app surveys and user feedback collection. Use **Formbricks** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 47 typed API operations * 5 synced entities (`actionClasses`, `contactAttributeKeys`, `surveys`, `teams`, `webhooks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/formbricks ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/formbricks ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/formbricks ``` ```bash bun theme={null} bun add corsair @corsair-dev/formbricks ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { formbricks } from '@corsair-dev/formbricks'; export const corsair = createCorsair({ plugins: [ formbricks(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} formbricks() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'formbricks', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`actionClasses.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.formbricks.api.actionClasses.list({}); ``` **`actionClasses.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.formbricks.api.actionClasses.create({}); ``` See the full list on the [API](/plugins/formbricks/api) page. ## Query synced data Synced entities support `tenant.formbricks.db..search()` and `.list()`: `actionClasses`, `contactAttributeKeys`, `surveys`, `teams`, `webhooks`. See [Database](/plugins/formbricks/database) for filters and operators. ## What's next > **[API reference](/plugins/formbricks/api)** > > Every `formbricks.api.*` operation with input and output types. > **[Database](/plugins/formbricks/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/fundable/api API reference for Fundable: every `fundable.api.*` operation with input and output types. Every `fundable.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Alerts ### configurations `alerts.configurations` Authenticated user's alert configurations **Risk:** `read` ```ts theme={null} await corsair.fundable.api.alerts.configurations({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > configurations: { > configuration_id: string, > configuration_name: string, > frequency: DAILY | WEEKLY | BIWEEKLY | MONTHLY, > description?: string, > filters: { > industries?: string[], > super_categories?: string[], > locations?: string[], > financing_types?: string[], > deal_size_min?: number | null, > deal_size_max?: number | null, > num_employees?: string[], > investors?: { > id?: string, > name?: string > }[], > companies?: { > id?: string, > name?: string > }[] > } > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### list `alerts.list` Saved alert matches with deals and reasoning in a date range **Risk:** `read` ```ts theme={null} await corsair.fundable.api.alerts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `alert_ids` | `string` | Yes | — | | `start_date` | `string` | Yes | — | | `end_date` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > alerts: { > alertId: string, > alertName: string, > alertFrequency: DAILY | WEEKLY | BIWEEKLY | MONTHLY, > totalDealCount: number, > deals: { > id: string, > company_id?: string, > company_name?: string, > company_guru_permalink?: string, > round_type?: string, > total_round_raised?: number, > date?: string, > company_website?: string | null, > company_linkedin?: string | null, > location?: { > city?: string | null, > state?: string | null, > country?: string | null, > region?: string | null > } | null, > deal_short_description?: string | null, > deal_long_description?: string | null, > reasoning?: string | null, > articles?: { > link?: string, > is_primary: boolean, > publishedDate?: string > }[] > }[] > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ## Companies ### deals `companies.deals` Get a company's complete funding history by identifier **Risk:** `read` ```ts theme={null} await corsair.fundable.api.companies.deals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `domain` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > deals: { > id: string, > round_type?: string | null, > extension?: boolean | null, > intermediate?: string | null, > pre?: boolean | null, > date?: string | null, > created_at?: string | null, > total_round_raised?: number | null, > deal_descriptions?: { > short_description?: string | null, > long_description?: string | null > } | null, > company_id?: string | null, > investor_ids?: string[], > angel_investor_ids?: string[], > financings?: { > id?: string | null, > type?: string | null, > size_usd?: number | null, > size_native?: number | null, > currency?: string | null > }[], > valuation?: { > type: string, > valuation_usd?: number | null, > valuation_native?: number | null, > valuation_currency?: string | null > } | null, > articles?: { > link?: string | null, > date?: string | null, > is_primary: boolean > }[] > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### get `companies.get` Get company details and recent funding by identifier **Risk:** `read` ```ts theme={null} await corsair.fundable.api.companies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `domain` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > company: { > id?: string | null, > name?: string | null, > legal_name?: string | null, > guru_permalink?: string | null, > domain?: string | null, > region?: string | null, > operating_status?: string | null, > founded_date?: string | null, > acquired?: boolean | null, > short_description?: string | null, > long_description?: string | null, > num_employees?: string | null, > linkedin?: string | null, > twitter?: string | null, > facebook?: string | null, > pitchbook?: string | null, > crunchbase?: string | null, > address?: string | null, > ipo_status?: string | null, > num_funding_rounds?: number | null, > num_investors?: number | null, > total_raised?: number | null, > latest_valuation_usd?: number | null, > latest_valuation_date?: string | null, > industries?: { > permalink?: string | null, > name?: string | null > }[], > location?: { > region?: { > name?: string | null, > permalink?: string | null > } | null, > country?: { > name?: string | null, > permalink?: string | null > } | null, > state?: { > name?: string | null, > permalink?: string | null > } | null, > city?: { > name?: string | null, > permalink?: string | null > } | null > } | null, > latest_deal?: { > id?: string | null, > type?: string | null, > total_round_raised?: number | null, > date?: string | null, > extension?: boolean | null, > pre?: boolean | null, > intermediate?: string | null, > description?: { > short_description?: string | null, > long_description?: string | null > } | null, > investors?: string[], > angel_investor_ids?: string[], > financings?: { > id?: string | null, > type?: string | null, > size_usd?: number | null, > size_native?: number | null, > currency?: string | null > }[], > articles?: { > link?: string | null, > date?: string | null, > is_primary: boolean > }[] > } | null, > all_investor_ids?: string[] | null, > similarity?: number | null > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### post `companies.post` Discover companies with metadata and full latest-deal details **Risk:** `read` ```ts theme={null} await corsair.fundable.api.companies.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifiers` | `object` | No | — | | `company` | `object` | No | — | | `latest_deal` | `object` | No | — | | `investors` | `object` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `sort_by` | `most_recent_raise \| oldest_raise \| most_recent_founded \| oldest_founded \| largest_valuation \| smallest_valuation \| largest_total_raise \| smallest_total_raise \| most_funding_rounds \| most_investors` | No | — | > **identifiers full type** > > ```ts theme={null} > { > ids?: string[], > domains?: string[], > linkedin_urls?: string[], > crunchbase_urls?: string[] > } > ``` > **company full type** > > ```ts theme={null} > { > search_query?: string, > min_relevance?: number, > locations?: string[], > industries?: string[], > super_categories?: string[], > employee_count?: 1-10 | 11-50 | 51-100 | 101-250 | 251-500 | 501-1000 | 1001-5000 | 5001-10000 | 10001+[], > ipo_status?: public | private[], > total_raised_min?: number, > total_raised_max?: number > } > ``` > **latest\_deal full type** > > ```ts theme={null} > { > financing_types?: { > type: SERIES_A | SERIES_B | SERIES_C | SERIES_D | SERIES_E | SERIES_F | SERIES_G | SERIES_H | SERIES_I | SERIES_J | SERIES_K | SERIES_L | SERIES_M | SEED | SAFE | CONVERTIBLE_NOTE | EQUITY | PREFERRED | SECONDARY_MARKET | DEBT_FINANCING | GRANT | NON_EQUITY_ASSISTANCE | CROWDFUNDING | INITIAL_COIN_OFFERING | FUNDING_ROUND, > pre?: boolean, > extension?: boolean > }[], > size_min?: number, > size_max?: number, > date_start?: string, > date_end?: string, > created_start?: string, > created_end?: string, > investor_ids?: string[] > } > ``` > **investors full type** > > ```ts theme={null} > { > investor_ids?: string[], > people_ids?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > companies: { > id?: string | null, > name?: string | null, > legal_name?: string | null, > guru_permalink?: string | null, > domain?: string | null, > region?: string | null, > operating_status?: string | null, > founded_date?: string | null, > acquired?: boolean | null, > short_description?: string | null, > long_description?: string | null, > num_employees?: string | null, > linkedin?: string | null, > twitter?: string | null, > facebook?: string | null, > pitchbook?: string | null, > crunchbase?: string | null, > address?: string | null, > ipo_status?: string | null, > num_funding_rounds?: number | null, > num_investors?: number | null, > total_raised?: number | null, > latest_valuation_usd?: number | null, > latest_valuation_date?: string | null, > industries?: { > permalink?: string | null, > name?: string | null > }[], > location?: { > region?: { > name?: string | null, > permalink?: string | null > } | null, > country?: { > name?: string | null, > permalink?: string | null > } | null, > state?: { > name?: string | null, > permalink?: string | null > } | null, > city?: { > name?: string | null, > permalink?: string | null > } | null > } | null, > latest_deal?: { > id?: string | null, > type?: string | null, > total_round_raised?: number | null, > date?: string | null, > extension?: boolean | null, > pre?: boolean | null, > intermediate?: string | null, > description?: { > short_description?: string | null, > long_description?: string | null > } | null, > investors?: string[], > angel_investor_ids?: string[], > financings?: { > id?: string | null, > type?: string | null, > size_usd?: number | null, > size_native?: number | null, > currency?: string | null > }[], > articles?: { > link?: string | null, > date?: string | null, > is_primary: boolean > }[] > } | null, > all_investor_ids?: string[] | null, > similarity?: number | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### search `companies.search` Fuzzy company lookup by name, domain, LinkedIn, or Crunchbase **Risk:** `read` ```ts theme={null} await corsair.fundable.api.companies.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `domain` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > companies: { > id: string, > guru_permalink?: string | null, > name: string, > short_description?: string | null, > relevance_score?: number, > domain?: string | null, > linkedin?: string | null, > crunchbase?: string | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ## Deals ### get `deals.get` Get a specific funding round by UUID **Risk:** `read` ```ts theme={null} await corsair.fundable.api.deals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > deal: { > id: string, > round_type?: string | null, > extension?: boolean | null, > intermediate?: string | null, > pre?: boolean | null, > date?: string | null, > created_at?: string | null, > total_round_raised?: number | null, > deal_descriptions?: { > short_description?: string | null, > long_description?: string | null > } | null, > company_id?: string | null, > investor_ids?: string[], > angel_investor_ids?: string[], > financings?: { > id?: string | null, > type?: string | null, > size_usd?: number | null, > size_native?: number | null, > currency?: string | null > }[], > valuation?: { > type: string, > valuation_usd?: number | null, > valuation_native?: number | null, > valuation_currency?: string | null > } | null, > articles?: { > link?: string | null, > date?: string | null, > is_primary: boolean > }[] > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### investors `deals.investors` Full investor lineup for a funding round (firms, angels, leads) **Risk:** `read` ```ts theme={null} await corsair.fundable.api.deals.investors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > investors: { > id: string, > name: string, > lead_investor?: boolean | null, > personnel?: { > id: string, > name?: string | null, > linkedin?: string | null, > crunchbase?: string | null, > twitter?: string | null > }[], > financing_type?: string | null, > domain?: string | null, > linkedin?: string | null, > crunchbase?: string | null > }[], > angel_investors: { > id: string, > name?: string | null, > financing_type?: string | null, > linkedin?: string | null, > crunchbase?: string | null, > twitter?: string | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### post `deals.post` Find funding rounds across complete company histories **Risk:** `read` ```ts theme={null} await corsair.fundable.api.deals.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifiers` | `object` | No | — | | `deal` | `object` | No | — | | `company` | `object` | No | — | | `investors` | `object` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `sort_by` | `most_recent_deal \| oldest_deal \| largest_raise \| smallest_raise` | No | — | > **identifiers full type** > > ```ts theme={null} > { > deal_ids?: string[] > } > ``` > **deal full type** > > ```ts theme={null} > { > financing_types?: { > type: SERIES_A | SERIES_B | SERIES_C | SERIES_D | SERIES_E | SERIES_F | SERIES_G | SERIES_H | SERIES_I | SERIES_J | SERIES_K | SERIES_L | SERIES_M | SEED | SAFE | CONVERTIBLE_NOTE | EQUITY | PREFERRED | SECONDARY_MARKET | DEBT_FINANCING | GRANT | NON_EQUITY_ASSISTANCE | CROWDFUNDING | INITIAL_COIN_OFFERING | FUNDING_ROUND, > pre?: boolean, > extension?: boolean > }[], > size_min?: number, > size_max?: number, > date_start?: string, > date_end?: string, > created_start?: string, > created_end?: string > } > ``` > **company full type** > > ```ts theme={null} > { > company_ids?: string[], > locations?: string[], > industries?: string[], > super_categories?: string[], > employee_count?: 1-10 | 11-50 | 51-100 | 101-250 | 251-500 | 501-1000 | 1001-5000 | 5001-10000 | 10001+[], > ipo_status?: public | private[], > total_raised_min?: number, > total_raised_max?: number > } > ``` > **investors full type** > > ```ts theme={null} > { > investor_ids?: string[], > people_ids?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > deals: { > id: string, > round_type?: string | null, > extension?: boolean | null, > intermediate?: string | null, > pre?: boolean | null, > date?: string | null, > created_at?: string | null, > total_round_raised?: number | null, > deal_descriptions?: { > short_description?: string | null, > long_description?: string | null > } | null, > company_id?: string | null, > investor_ids?: string[], > angel_investor_ids?: string[], > financings?: { > id?: string | null, > type?: string | null, > size_usd?: number | null, > size_native?: number | null, > currency?: string | null > }[], > valuation?: { > type: string, > valuation_usd?: number | null, > valuation_native?: number | null, > valuation_currency?: string | null > } | null, > articles?: { > link?: string | null, > date?: string | null, > is_primary: boolean > }[] > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ## Filters ### industries `filters.industries` Resolve industry and super-category labels to exact permalinks **Risk:** `read` ```ts theme={null} await corsair.fundable.api.filters.industries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `INDUSTRY \| SUPER_CATEGORY` | No | — | | `industry_type` | `INDUSTRY \| SUPER_CATEGORY` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > industries: { > permalink: string, > name: string, > industry_type?: INDUSTRY | SUPER_CATEGORY > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### locations `filters.locations` Resolve location labels to exact permalinks **Risk:** `read` ```ts theme={null} await corsair.fundable.api.filters.locations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `CITY \| STATE \| REGION \| COUNTRY` | No | — | | `location_type` | `CITY \| STATE \| REGION \| COUNTRY` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > locations: { > permalink: string, > name: string, > location_type?: CITY | STATE | REGION | COUNTRY > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ## Investors ### deals `investors.deals` Investor's complete deal history by identifier **Risk:** `read` ```ts theme={null} await corsair.fundable.api.investors.deals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `domain` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > deals: { > id: string, > round_type?: string | null, > extension?: boolean | null, > intermediate?: string | null, > pre?: boolean | null, > date?: string | null, > created_at?: string | null, > total_round_raised?: number | null, > deal_descriptions?: { > short_description?: string | null, > long_description?: string | null > } | null, > company_id?: string | null, > investor_ids?: string[], > angel_investor_ids?: string[], > financings?: { > id?: string | null, > type?: string | null, > size_usd?: number | null, > size_native?: number | null, > currency?: string | null > }[], > valuation?: { > type: string, > valuation_usd?: number | null, > valuation_native?: number | null, > valuation_currency?: string | null > } | null, > articles?: { > link?: string | null, > date?: string | null, > is_primary: boolean > }[] > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### get `investors.get` Investor profile, stats, and portfolio summary by identifier **Risk:** `read` ```ts theme={null} await corsair.fundable.api.investors.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `domain` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > investor: { > id: string, > name: string, > total_deal_count?: number, > lead_deal_count?: number, > deal_count_last_12_months?: number, > lead_deal_count_last_12_months?: number | null, > most_recent_deal_date?: string | null, > guru_permalink?: string, > domain?: string | null, > website?: string | null, > linkedin?: string | null, > pitchbook?: string | null, > crunchbase?: string | null, > description?: string | null, > legal_name?: string | null, > num_employees?: string | null, > investment_stage?: string | null, > contact_email?: string | null, > contact_phone?: string | null, > location?: { > region?: { > name?: string | null, > permalink?: string | null > } | null, > country?: { > name?: string | null, > permalink?: string | null > } | null, > state?: { > name?: string | null, > permalink?: string | null > } | null, > city?: { > name?: string | null, > permalink?: string | null > } | null > } | null, > top_industries?: { > name?: string | null, > permalink?: string | null, > count?: number | null > }[], > top_locations?: { > name?: string | null, > full_name?: string | null, > permalink?: string | null, > type?: string | null, > count?: number | null > }[], > top_round_types?: { > type?: string | null, > count?: number | null > }[], > filtered_deal_count?: number | null, > filtered_lead_count?: number | null > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### post `investors.post` Discover investor firms by attributes and investments **Risk:** `read` ```ts theme={null} await corsair.fundable.api.investors.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifiers` | `object` | No | — | | `investor` | `object` | No | — | | `company_investments` | `object` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `sort_by` | `most_recent_deal \| recent_deals \| deals_led_ltm \| total_deals \| matching_deals` | No | — | > **identifiers full type** > > ```ts theme={null} > { > ids?: string[], > domains?: string[], > linkedin_urls?: string[], > crunchbase_urls?: string[] > } > ``` > **investor full type** > > ```ts theme={null} > { > locations?: string[], > employee_count?: 1-10 | 11-50 | 51-100 | 101-250 | 251-500 | 501-1000 | 1001-5000 | 5001-10000 | 10001+[] > } > ``` > **company\_investments full type** > > ```ts theme={null} > { > company_ids?: string[], > search_query?: string, > min_relevance?: number, > locations?: string[], > industries?: string[], > super_categories?: string[], > employee_count?: 1-10 | 11-50 | 51-100 | 101-250 | 251-500 | 501-1000 | 1001-5000 | 5001-10000 | 10001+[], > ipo_status?: public | private[], > total_raised_min?: number, > total_raised_max?: number, > financing_types?: { > type: SERIES_A | SERIES_B | SERIES_C | SERIES_D | SERIES_E | SERIES_F | SERIES_G | SERIES_H | SERIES_I | SERIES_J | SERIES_K | SERIES_L | SERIES_M | SEED | SAFE | CONVERTIBLE_NOTE | EQUITY | PREFERRED | SECONDARY_MARKET | DEBT_FINANCING | GRANT | NON_EQUITY_ASSISTANCE | CROWDFUNDING | INITIAL_COIN_OFFERING | FUNDING_ROUND, > pre?: boolean, > extension?: boolean > }[], > deal_size_min?: number, > deal_size_max?: number, > deal_start_date?: string, > deal_end_date?: string, > only_lead_deals?: boolean, > min_matching_deals?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > investors: { > id: string, > name: string, > total_deal_count?: number, > lead_deal_count?: number, > deal_count_last_12_months?: number, > lead_deal_count_last_12_months?: number | null, > most_recent_deal_date?: string | null, > guru_permalink?: string, > domain?: string | null, > website?: string | null, > linkedin?: string | null, > pitchbook?: string | null, > crunchbase?: string | null, > description?: string | null, > legal_name?: string | null, > num_employees?: string | null, > investment_stage?: string | null, > contact_email?: string | null, > contact_phone?: string | null, > location?: { > region?: { > name?: string | null, > permalink?: string | null > } | null, > country?: { > name?: string | null, > permalink?: string | null > } | null, > state?: { > name?: string | null, > permalink?: string | null > } | null, > city?: { > name?: string | null, > permalink?: string | null > } | null > } | null, > top_industries?: { > name?: string | null, > permalink?: string | null, > count?: number | null > }[], > top_locations?: { > name?: string | null, > full_name?: string | null, > permalink?: string | null, > type?: string | null, > count?: number | null > }[], > top_round_types?: { > type?: string | null, > count?: number | null > }[], > filtered_deal_count?: number | null, > filtered_lead_count?: number | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### search `investors.search` Fuzzy investor lookup by name, domain, LinkedIn, or Crunchbase **Risk:** `read` ```ts theme={null} await corsair.fundable.api.investors.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `domain` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > investors: { > id: string, > guru_permalink?: string | null, > name: string, > description?: string | null, > image?: string | null, > relevance_score?: number, > domain?: string | null, > website?: string | null, > linkedin?: string | null, > crunchbase?: string | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ## People ### deals `people.deals` Deals a person participated in as an investor **Risk:** `read` ```ts theme={null} await corsair.fundable.api.people.deals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | | `twitter` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > deals: { > id: string, > round_type?: string | null, > extension?: boolean | null, > intermediate?: string | null, > pre?: boolean | null, > date?: string | null, > created_at?: string | null, > total_round_raised?: number | null, > deal_descriptions?: { > short_description?: string | null, > long_description?: string | null > } | null, > company_id?: string | null, > investor_ids?: string[], > angel_investor_ids?: string[], > financings?: { > id?: string | null, > type?: string | null, > size_usd?: number | null, > size_native?: number | null, > currency?: string | null > }[], > valuation?: { > type: string, > valuation_usd?: number | null, > valuation_native?: number | null, > valuation_currency?: string | null > } | null, > articles?: { > link?: string | null, > date?: string | null, > is_primary: boolean > }[] > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### email `people.email` Unlock a person's verified email address **Risk:** `write` ```ts theme={null} await corsair.fundable.api.people.email({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | | `twitter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > person_id: string, > email: string, > already_unlocked: boolean > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### get `people.get` Full person detail including employment and education by identifier **Risk:** `read` ```ts theme={null} await corsair.fundable.api.people.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | | `twitter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > person: { > id: string, > name?: string | null, > title?: string | null, > linkedin_url?: string | null, > crunchbase_url?: string | null, > twitter_url?: string | null, > location?: string | null, > city?: string | null, > country_code?: string | null, > about?: string | null, > is_founder: boolean, > current_company?: { > id?: string | null, > name?: string | null, > permalink?: string | null, > domain?: string | null > } | null, > employment_history: { > title?: string | null, > company_name?: string | null, > company_id?: string | null, > company_url?: string | null, > location?: string | null, > description?: string | null, > start_date?: string | null, > end_date?: string | null, > is_current?: boolean > }[], > education_history: { > school_name?: string | null, > school_id?: string | null, > school_url?: string | null, > degree?: string | null, > field_of_study?: string | null, > start_date?: string | null, > end_date?: string | null, > description?: string | null > }[], > is_investor: boolean, > is_angel: boolean, > has_led_deal: boolean, > investment_firms: { > id?: string | null, > name?: string | null, > permalink?: string | null, > domain?: string | null, > deal_count?: number | null, > last_deal_date?: string | null > }[], > investor_highlights?: { > total_deal_count?: number | null, > lead_deal_count?: number | null, > deal_count_last_12_months?: number | null, > lead_deal_count_last_12_months?: number | null, > most_recent_deal_date?: string | null, > top_industries?: { > name?: string | null, > permalink?: string | null, > count?: number | null > }[], > top_locations?: { > name?: string | null, > full_name?: string | null, > permalink?: string | null, > type?: string | null, > count?: number | null > }[], > top_round_types?: { > type?: string | null, > count?: number | null > }[] > } | null, > filtered_deal_count?: number | null, > filtered_lead_count?: number | null, > filtered_most_recent_date?: string | null > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### phone `people.phone` Unlock a person's verified phone number **Risk:** `write` ```ts theme={null} await corsair.fundable.api.people.phone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | | `twitter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > person_id: string, > phone: string, > already_unlocked: boolean > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### post `people.post` Discover founders, employees, angels, and lead investors **Risk:** `read` ```ts theme={null} await corsair.fundable.api.people.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `person_type` | `company \| investor \| any` | No | — | | `identifiers` | `object` | No | — | | `person` | `object` | No | — | | `company` | `object` | No | — | | `investor` | `object` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `sort_by` | `most_recent_deal_date \| total_raised \| latest_deal_size \| name \| total_deal_count \| deal_count_last_12_months \| lead_deal_count \| lead_deal_count_last_12_months \| filtered_deal_count` | No | — | > **identifiers full type** > > ```ts theme={null} > { > ids?: string[], > linkedin_urls?: string[], > crunchbase_urls?: string[], > twitter_urls?: string[] > } > ``` > **person full type** > > ```ts theme={null} > { > roles?: founder | ceo | key_person[], > contact_types?: linkedin | email | phone | twitter[], > job_titles?: string[], > education_schools?: string[], > linkedin_companies?: string[] > } > ``` > **company full type** > > ```ts theme={null} > { > search_query?: string, > min_relevance?: number, > ids?: string[], > locations?: string[], > industries?: string[], > super_categories?: string[], > employee_count?: 1-10 | 11-50 | 51-100 | 101-250 | 251-500 | 501-1000 | 1001-5000 | 5001-10000 | 10001+[], > ipo_status?: public | private | acquired | delisted[], > total_raised_min?: number, > total_raised_max?: number, > investor_people_ids?: string[], > latest_deal?: { > financing_types?: { > type: SERIES_A | SERIES_B | SERIES_C | SERIES_D | SERIES_E | SERIES_F | SERIES_G | SERIES_H | SERIES_I | SERIES_J | SERIES_K | SERIES_L | SERIES_M | SEED | SAFE | CONVERTIBLE_NOTE | EQUITY | PREFERRED | SECONDARY_MARKET | DEBT_FINANCING | GRANT | NON_EQUITY_ASSISTANCE | CROWDFUNDING | INITIAL_COIN_OFFERING | FUNDING_ROUND, > pre?: boolean, > extension?: boolean > }[], > size_min?: number, > size_max?: number, > date_start?: string, > date_end?: string, > investor_ids?: string[], > investor_locations?: string[] > } > } > ``` > **investor full type** > > ```ts theme={null} > { > ids?: string[], > domains?: string[], > linkedin_urls?: string[], > crunchbase_urls?: string[], > permalinks?: string[], > locations?: string[], > employee_count?: 1-10 | 11-50 | 51-100 | 101-250 | 251-500 | 501-1000 | 1001-5000 | 5001-10000 | 10001+[], > deals?: { > search_query?: string, > min_relevance?: number, > investment_type?: all | angel | institutional, > only_lead_deals?: boolean, > min_matching_deals?: number, > financing_types?: { > type: SERIES_A | SERIES_B | SERIES_C | SERIES_D | SERIES_E | SERIES_F | SERIES_G | SERIES_H | SERIES_I | SERIES_J | SERIES_K | SERIES_L | SERIES_M | SEED | SAFE | CONVERTIBLE_NOTE | EQUITY | PREFERRED | SECONDARY_MARKET | DEBT_FINANCING | GRANT | NON_EQUITY_ASSISTANCE | CROWDFUNDING | INITIAL_COIN_OFFERING | FUNDING_ROUND, > pre?: boolean, > extension?: boolean > }[], > size_min?: number, > size_max?: number, > date_start?: string, > date_end?: string, > industries?: string[], > super_categories?: string[], > portfolio_locations?: string[], > portfolio_employee_count?: 1-10 | 11-50 | 51-100 | 101-250 | 251-500 | 501-1000 | 1001-5000 | 5001-10000 | 10001+[], > ipo_status?: public | private[], > total_raised_min?: number, > total_raised_max?: number > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > people: { > id: string, > name?: string | null, > title?: string | null, > linkedin_url?: string | null, > crunchbase_url?: string | null, > twitter_url?: string | null, > location?: string | null, > city?: string | null, > country_code?: string | null, > about?: string | null, > is_founder: boolean, > current_company?: { > id?: string | null, > name?: string | null, > permalink?: string | null, > domain?: string | null > } | null, > employment_history: { > title?: string | null, > company_name?: string | null, > company_id?: string | null, > company_url?: string | null, > location?: string | null, > description?: string | null, > start_date?: string | null, > end_date?: string | null, > is_current?: boolean > }[], > education_history: { > school_name?: string | null, > school_id?: string | null, > school_url?: string | null, > degree?: string | null, > field_of_study?: string | null, > start_date?: string | null, > end_date?: string | null, > description?: string | null > }[], > is_investor: boolean, > is_angel: boolean, > has_led_deal: boolean, > investment_firms: { > id?: string | null, > name?: string | null, > permalink?: string | null, > domain?: string | null, > deal_count?: number | null, > last_deal_date?: string | null > }[], > investor_highlights?: { > total_deal_count?: number | null, > lead_deal_count?: number | null, > deal_count_last_12_months?: number | null, > lead_deal_count_last_12_months?: number | null, > most_recent_deal_date?: string | null, > top_industries?: { > name?: string | null, > permalink?: string | null, > count?: number | null > }[], > top_locations?: { > name?: string | null, > full_name?: string | null, > permalink?: string | null, > type?: string | null, > count?: number | null > }[], > top_round_types?: { > type?: string | null, > count?: number | null > }[] > } | null, > filtered_deal_count?: number | null, > filtered_lead_count?: number | null, > filtered_most_recent_date?: string | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** ### search `people.search` Fuzzy person lookup by name or identifier **Risk:** `read` ```ts theme={null} await corsair.fundable.api.people.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `id` | `string` | No | — | | `linkedin` | `string` | No | — | | `crunchbase` | `string` | No | — | | `twitter` | `string` | No | — | | `person_type` | `investor \| company` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > people: { > id: string, > name?: string | null, > linkedin_url?: string | null, > crunchbase_url?: string | null, > twitter_url?: string | null, > person_type?: investor | company > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total_count?: number, > page?: number, > page_size?: number, > credits_used?: number, > credit_source?: string | null, > monthly_credits_remaining?: number | null, > purchased_credits_remaining?: number | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/fundable/database Fundable local sync: searchable entities, `.search()` filters, and operators. The Fundable plugin syncs data locally. Use `corsair.fundable.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/fundable/overview Startup funding intelligence — companies, funding rounds, investors, founders and people search, plus alert polling. Use **Fundable** through Corsair: one client, typed API calls. **What you get:** * 21 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/fundable ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/fundable ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/fundable ``` ```bash bun theme={null} bun add corsair @corsair-dev/fundable ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { fundable } from '@corsair-dev/fundable'; export const corsair = createCorsair({ plugins: [ fundable(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} fundable() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'fundable', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`alerts.configurations`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.fundable.api.alerts.configurations({}); ``` **`people.email`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.fundable.api.people.email({}); ``` See the full list on the [API](/plugins/fundable/api) page. ## What's next > **[API reference](/plugins/fundable/api)** > > Every `fundable.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/gemini/api API reference for Gemini: every `gemini.api.*` operation with input and output types. Every `gemini.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Content ### countTokens `content.countTokens` Count tokens in text using Gemini tokenization, for cost estimation and input limit checks **Risk:** `read` ```ts theme={null} await corsair.gemini.api.content.countTokens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | Gemini model to count tokens against, e.g. gemini-2.5-flash, gemini-2.5-pro | | `contents` | `object[]` | Yes | The content to count tokens for | > **contents full type** > > ```ts theme={null} > { > role?: user | model, > parts: { > text?: string, > thought?: boolean, > inlineData?: { > mimeType: string, > data: string > } > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalTokens` | `number` | Yes | — | | `cachedContentTokenCount` | `number` | No | — | *** ### embedContent `content.embedContent` Generate a numerical vector embedding for text, for semantic search and similarity comparison **Risk:** `read` ```ts theme={null} await corsair.gemini.api.content.embedContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | Gemini embedding model, e.g. gemini-embedding-001 | | `content` | `object` | Yes | The content to embed | | `taskType` | `string` | No | Optional task type hint, e.g. SEMANTIC\_SIMILARITY, RETRIEVAL\_QUERY, RETRIEVAL\_DOCUMENT, CLASSIFICATION, CLUSTERING | | `title` | `string` | No | Optional title, used with RETRIEVAL\_DOCUMENT taskType | > **content full type** > > ```ts theme={null} > { > role?: user | model, > parts: { > text?: string, > thought?: boolean, > inlineData?: { > mimeType: string, > data: string > } > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `embedding` | `object` | Yes | — | > **embedding full type** > > ```ts theme={null} > { > values: number[] > } > ``` *** ### generateContent `content.generateContent` Generate text or speech audio from a prompt using a Gemini Flash/Pro model **Risk:** `read` ```ts theme={null} await corsair.gemini.api.content.generateContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | Gemini model to generate with, e.g. gemini-2.5-flash, gemini-2.5-pro | | `contents` | `object[]` | Yes | Conversation contents to generate a response for | | `stripFences` | `boolean` | No | Strip markdown code fences from the convenience text field | | `generationConfig` | `object` | No | — | | `safetySettings` | `object[]` | No | — | | `systemInstruction` | `object` | No | — | > **contents full type** > > ```ts theme={null} > { > role?: user | model, > parts: { > text?: string, > thought?: boolean, > inlineData?: { > mimeType: string, > data: string > } > }[] > }[] > ``` > **generationConfig full type** > > ```ts theme={null} > { > temperature?: number, > topP?: number, > topK?: number, > candidateCount?: number, > maxOutputTokens?: number, > stopSequences?: string[], > responseModalities?: TEXT | IMAGE | AUDIO[] > } > ``` > **safetySettings full type** > > ```ts theme={null} > { > category: string, > threshold: string > }[] > ``` > **systemInstruction full type** > > ```ts theme={null} > { > role?: user | model, > parts: { > text?: string, > thought?: boolean, > inlineData?: { > mimeType: string, > data: string > } > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `candidates` | `object[]` | No | — | | `usageMetadata` | `object` | No | — | | `text` | `string` | No | Convenience field: concatenated non-thought text from the first candidate | > **candidates full type** > > ```ts theme={null} > { > content?: { > role?: user | model, > parts: { > text?: string, > thought?: boolean, > inlineData?: { > mimeType: string, > data: string > } > }[] > }, > finishReason?: string, > index?: number, > safetyRatings?: any[] > }[] > ``` > **usageMetadata full type** > > ```ts theme={null} > { > promptTokenCount?: number, > candidatesTokenCount?: number, > totalTokenCount?: number, > cachedContentTokenCount?: number > } > ``` *** ## Images ### generateImage `images.generateImage` Generate a raster image (JPG/PNG/WebP) from a prompt using a Nano Banana image model **Risk:** `write` ```ts theme={null} await corsair.gemini.api.images.generateImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | Nano Banana image model, e.g. gemini-2.5-flash-image, gemini-3-pro-image-preview, gemini-2.0-flash-exp-image-generation | | `prompt` | `string` | Yes | Text prompt describing the image to generate | | `referenceImages` | `object[]` | No | Optional reference/input images for image editing or composition | | `generationConfig` | `object` | No | — | > **referenceImages full type** > > ```ts theme={null} > { > mimeType: string, > data: string > }[] > ``` > **generationConfig full type** > > ```ts theme={null} > { > temperature?: number, > topP?: number, > topK?: number, > candidateCount?: number, > maxOutputTokens?: number, > stopSequences?: string[], > responseModalities?: TEXT | IMAGE | AUDIO[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `images` | `object[]` | Yes | — | | `candidates` | `object[]` | No | — | | `usageMetadata` | `object` | No | — | > **images full type** > > ```ts theme={null} > { > mimeType: string, > contentBase64: string > }[] > ``` > **candidates full type** > > ```ts theme={null} > { > content?: { > role?: user | model, > parts: { > text?: string, > thought?: boolean, > inlineData?: { > mimeType: string, > data: string > } > }[] > }, > finishReason?: string, > index?: number, > safetyRatings?: any[] > }[] > ``` > **usageMetadata full type** > > ```ts theme={null} > { > promptTokenCount?: number, > candidatesTokenCount?: number, > totalTokenCount?: number, > cachedContentTokenCount?: number > } > ``` *** ## Models ### listModels `models.listModels` List available Gemini and Veo models and their capabilities/limits **Risk:** `read` ```ts theme={null} await corsair.gemini.api.models.listModels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `models` | `object[]` | Yes | — | | `nextPageToken` | `string` | No | — | > **models full type** > > ```ts theme={null} > { > name: string, > baseModelId?: string, > version?: string, > displayName?: string, > description?: string, > inputTokenLimit?: number, > outputTokenLimit?: number, > supportedGenerationMethods?: string[], > temperature?: number, > topP?: number, > topK?: number > }[] > ``` *** ## Videos ### generateVideos `videos.generateVideos` Generate a text-to-video clip using a Veo model; returns an operation name for status tracking **Risk:** `write` ```ts theme={null} await corsair.gemini.api.videos.generateVideos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | Veo video model, e.g. veo-2.0-generate-001 | | `prompt` | `string` | Yes | Text prompt describing the video to generate | | `image` | `object` | No | — | | `parameters` | `object` | No | — | > **image full type** > > ```ts theme={null} > { > bytesBase64Encoded: string, > mimeType: string > } > ``` > **parameters full type** > > ```ts theme={null} > { > aspectRatio?: string, > personGeneration?: string, > numberOfVideos?: number, > durationSeconds?: number, > negativePrompt?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `operationName` | `string` | Yes | Pass to GEMINI\_GET\_VIDEOS\_OPERATION or GEMINI\_WAIT\_FOR\_VIDEO | | `done` | `boolean` | No | — | *** ### getVideosOperation `videos.getVideosOperation` (Deprecated — use videos.waitForVideo) Check the status of a Veo video generation operation **Risk:** `read` ```ts theme={null} await corsair.gemini.api.videos.getVideosOperation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `operationName` | `string` | Yes | The operation name returned by GEMINI\_GENERATE\_VIDEOS | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `done` | `boolean` | No | — | | `metadata` | `any` | No | — | | `error` | `object` | No | — | | `response` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > code?: number, > message?: string > } > ``` > **response full type** > > ```ts theme={null} > { > generateVideoResponse?: { > generatedSamples?: { > video?: { > uri?: string > } > }[] > } > } > ``` *** ### waitForVideo `videos.waitForVideo` Poll a Veo video generation operation until it completes and return the generated video **Risk:** `write` ```ts theme={null} await corsair.gemini.api.videos.waitForVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `operationName` | `string` | Yes | The operation name returned by GEMINI\_GENERATE\_VIDEOS | | `pollIntervalMs` | `number` | Yes | Delay between status checks | | `timeoutMs` | `number` | Yes | Give up and return done=false after this long | **Output** | Name | Type | Required | Description | | - | - | - | - | | `operationName` | `string` | Yes | — | | `done` | `boolean` | Yes | — | | `data` | `object` | No | — | | `error` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > video_file?: { > mimeType: string, > contentBase64: string > } > } > ``` > **error full type** > > ```ts theme={null} > { > code?: number, > message?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/gemini/database Gemini local sync: searchable entities, `.search()` filters, and operators. The Gemini plugin syncs data locally. Use `corsair.gemini.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/gemini/overview Google multimodal AI API for text, image, and code generation with Gemini models. Use **Gemini** through Corsair: one client, typed API calls. **What you get:** * 8 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/gemini ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/gemini ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/gemini ``` ```bash bun theme={null} bun add corsair @corsair-dev/gemini ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { gemini } from '@corsair-dev/gemini'; export const corsair = createCorsair({ plugins: [ gemini(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} gemini() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'gemini', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`content.countTokens`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.gemini.api.content.countTokens({}); ``` **`images.generateImage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.gemini.api.images.generateImage({}); ``` See the full list on the [API](/plugins/gemini/api) page. ## What's next > **[API reference](/plugins/gemini/api)** > > Every `gemini.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/giphy/api API reference for GIPHY: every `giphy.api.*` operation with input and output types. Every `giphy.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Analytics ### register `analytics.register` Register a GIF view, click, or send via its analytics pingback URL **Risk:** `write` ```ts theme={null} await corsair.giphy.api.analytics.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pingback_url` | `string` | Yes | Tracking URL from a GIF analytics object (onload, onclick, or onsent) | | `customer_id` | `string` | Yes | Identifier assigned to a user in your platform | | `ts` | `number` | No | UNIX timestamp in milliseconds of when the action occurred. Default: now | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Categories ### getById `categories.getById` Get subcategories of a specific GIPHY category by ID **Risk:** `read` ```ts theme={null} await corsair.giphy.api.categories.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `string` | Yes | Category identifier (name\_encoded value from categories.list, e.g. "actions") | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > name: string, > name_encoded?: string, > subcategories?: { > name: string, > name_encoded?: string > }[], > gif?: { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### gifs `categories.gifs` Fetch GIFs associated with a specific GIPHY category **Risk:** `read` ```ts theme={null} await corsair.giphy.api.categories.gifs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `string` | Yes | Category identifier (name\_encoded value from categories.list, e.g. "actions") | | `limit` | `number` | No | The maximum number of objects to return. Default: 25 | | `offset` | `number` | No | Specifies the starting position of the results. Default: 0 | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### list `categories.list` List all categories and subcategories on GIPHY **Risk:** `read` ```ts theme={null} await corsair.giphy.api.categories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > name: string, > name_encoded?: string, > subcategories?: { > name: string, > name_encoded?: string > }[], > gif?: { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ## Channels ### search `channels.search` Search GIPHY channels matching a query term **Risk:** `read` ```ts theme={null} await corsair.giphy.api.channels.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Term to search through GIPHY channels | | `limit` | `number` | No | The maximum number of objects to return. Default: 25, maximum: 50 | | `offset` | `number` | No | Specifies the starting position of the results. Default: 0 | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > slug?: string, > display_name?: string, > content_type?: string, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ## Emoji ### get `emoji.get` Fetch animated emojis from GIPHY **Risk:** `read` ```ts theme={null} await corsair.giphy.api.emoji.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | The maximum number of objects to return. Default: 25 | | `offset` | `number` | No | Specifies the starting position of the results. Default: 0 | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### variations `emoji.variations` Get variations of a specific GIPHY emoji by ID **Risk:** `read` ```ts theme={null} await corsair.giphy.api.emoji.variations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gif_id` | `string` | Yes | GIPHY Emoji GIF ID to get variations for | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ## Gifs ### getById `gifs.getById` Get details and renditions of a specific GIF by ID **Risk:** `read` ```ts theme={null} await corsair.giphy.api.gifs.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gif_id` | `string` | Yes | GIPHY GIF ID | | `rating` | `g \| pg \| pg-13 \| r` | No | If the GIF rating exceeds this, the API returns an empty error response | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### getByIds `gifs.getByIds` Get details and renditions for multiple GIFs by their IDs **Risk:** `read` ```ts theme={null} await corsair.giphy.api.gifs.getByIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[] \| string` | Yes | Array of GIF IDs or comma-separated string | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### random `gifs.random` Fetch a random GIF from GIPHY optionally filtered by tag **Risk:** `read` ```ts theme={null} await corsair.giphy.api.gifs.random({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `string` | No | Filters results by specified tag | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `random_id` | `string` | No | Deprecated alias for customer\_id, kept for backwards compatibility | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### search `gifs.search` Search all GIPHY GIFs for a word or phrase **Risk:** `read` ```ts theme={null} await corsair.giphy.api.gifs.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Search query term or phrase | | `limit` | `number` | No | The maximum number of objects to return. Default: 25 | | `offset` | `number` | No | Specifies the starting position of the results. Default: 0 | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `lang` | `string` | No | Specify default language for regional content | | `random_id` | `string` | No | Deprecated alias for customer\_id, kept for backwards compatibility | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | | `channel_ids` | `string` | No | Filters results by specified channel IDs, separated by commas. Maximum: 5 | | `bundle` | `string` | No | Returns upload or clips data | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### translate `gifs.translate` Translate a word or phrase into a GIF using GIPHY translate endpoint **Risk:** `read` ```ts theme={null} await corsair.giphy.api.gifs.translate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `s` | `string` | Yes | Search term to translate into a GIF | | `weirdness` | `number` | No | Value from 0-10 on the weirdness scale | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### trending `gifs.trending` Fetch currently trending GIFs from GIPHY **Risk:** `read` ```ts theme={null} await corsair.giphy.api.gifs.trending({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | The maximum number of objects to return. Default: 25 | | `offset` | `number` | No | Specifies the starting position of the results. Default: 0 | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `random_id` | `string` | No | Deprecated alias for customer\_id, kept for backwards compatibility | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | | `bundle` | `string` | No | Returns upload or clips data | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### upload `gifs.upload` Upload an animated GIF or video to GIPHY from a file or a public URL **Risk:** `write` ```ts theme={null} await corsair.giphy.api.gifs.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_base64` | `string` | No | Animated GIF or video file content as base64. Required when source\_image\_url is omitted | | `file_name` | `string` | No | Filename for the multipart upload part. Default: upload.gif | | `source_image_url` | `string` | No | Public URL of the image or video to upload. Required when file\_base64 is omitted | | `tags` | `string` | No | Comma-delimited list of tags applied to the upload | | `source_post_url` | `string` | No | URL of the source of the asset | | `username` | `string` | No | Assigned username (approved production apps only) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ## Random Id ### get `randomId.get` Generate a privacy-safe random ID to use as customer\_id on other endpoints **Risk:** `read` ```ts theme={null} await corsair.giphy.api.randomId.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > random_id: string > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ## Stickers ### random `stickers.random` Fetch a random sticker from GIPHY optionally filtered by tag **Risk:** `read` ```ts theme={null} await corsair.giphy.api.stickers.random({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `string` | No | Filters results by specified tag | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### search `stickers.search` Search GIPHY animated stickers for a word or phrase **Risk:** `read` ```ts theme={null} await corsair.giphy.api.stickers.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Search query term or phrase | | `limit` | `number` | No | The maximum number of objects to return. Default: 25 | | `offset` | `number` | No | Specifies the starting position of the results. Default: 0 | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `lang` | `string` | No | Specify default language for regional content | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### translate `stickers.translate` Translate a word or phrase into a sticker **Risk:** `read` ```ts theme={null} await corsair.giphy.api.stickers.translate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `s` | `string` | Yes | Search term to translate into a sticker | | `weirdness` | `number` | No | Value from 0-10 on the weirdness scale | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### trending `stickers.trending` Fetch currently trending stickers from GIPHY **Risk:** `read` ```ts theme={null} await corsair.giphy.api.stickers.trending({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | The maximum number of objects to return. Default: 25 | | `offset` | `number` | No | Specifies the starting position of the results. Default: 0 | | `rating` | `g \| pg \| pg-13 \| r` | No | Filters results by specified rating | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > url?: string, > slug?: string, > bitly_gif_url?: string, > bitly_url?: string, > embed_url?: string, > username?: string, > source?: string, > title?: string, > rating?: string, > content_url?: string, > source_tld?: string, > source_post_url?: string, > is_sticker?: number, > import_datetime?: string, > trending_datetime?: string, > images?: { > }, > user?: { > avatar_url?: string, > banner_image?: string, > banner_url?: string, > profile_url?: string, > username?: string, > display_name?: string, > description?: string, > instagram_url?: string, > website_url?: string, > is_verified?: boolean > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total_count?: number, > count?: number, > offset?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ## Tags ### autocomplete `tags.autocomplete` Autocomplete a tag term on the GIPHY network **Risk:** `read` ```ts theme={null} await corsair.giphy.api.tags.autocomplete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Tag term to autocomplete | | `limit` | `number` | No | The maximum number of objects to return. Default: 5 | | `offset` | `number` | No | Specifies the starting position of the results. Default: 0 | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > name: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### related `tags.related` List tag terms related to the given tag on GIPHY **Risk:** `read` ```ts theme={null} await corsair.giphy.api.tags.related({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `term` | `string` | Yes | Tag term to find related tags for | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > name: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** ### trending `tags.trending` List the most popular trending search terms on GIPHY **Risk:** `read` ```ts theme={null} await corsair.giphy.api.tags.trending({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customer_id` | `string` | No | Identifier assigned to a user in your platform | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `string[]` | Yes | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > status?: number, > msg?: string, > response_id?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/giphy/database GIPHY local sync: searchable entities, `.search()` filters, and operators. The GIPHY plugin syncs data locally. Use `corsair.giphy.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Categories Path: `giphy.db.categories.search` ```ts theme={null} const rows = await corsair.giphy.db.categories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `nameEncoded` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Gifs Path: `giphy.db.gifs.search` ```ts theme={null} const rows = await corsair.giphy.db.gifs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `embedUrl` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `rating` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `importedAt` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/giphy/overview The world's largest library of animated GIFs, stickers, and emojis for apps and agents. Use **GIPHY** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 22 typed API operations * 2 synced entities (`categories`, `gifs`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/giphy ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/giphy ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/giphy ``` ```bash bun theme={null} bun add corsair @corsair-dev/giphy ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { giphy } from '@corsair-dev/giphy'; export const corsair = createCorsair({ plugins: [ giphy(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} giphy() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'giphy', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Search GIFs** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.giphy.api.gifs.search({ q: 'cats' }); ``` **`analytics.register`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.giphy.api.analytics.register({}); ``` See the full list on the [API](/plugins/giphy/api) page. ## Query synced data Synced entities support `tenant.giphy.db..search()` and `.list()`: `categories`, `gifs`. See [Database](/plugins/giphy/database) for filters and operators. ## What's next > **[API reference](/plugins/giphy/api)** > > Every `giphy.api.*` operation with input and output types. > **[Database](/plugins/giphy/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/github/api API reference for GitHub: every `github.api.*` operation with input and output types. Every `github.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Comments ### delete `comments.delete` Delete a comment **Risk:** `write` ```ts theme={null} await corsair.github.api.comments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `commentId` | `number` | Yes | — | **Output:** `void` *** ### get `comments.get` Get a specific comment **Risk:** `read` ```ts theme={null} await corsair.github.api.comments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `commentId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `issueUrl` | `string` | No | — | | `body` | `string` | No | — | | `authorAssociation` | `string` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | *** ### list `comments.list` List all comments in a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `sort` | `created \| updated` | No | — | | `direction` | `asc \| desc` | No | — | | `since` | `string` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > url?: string, > htmlUrl?: string, > issueUrl?: string, > body?: string, > authorAssociation?: string, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` *** ### listForIssue `comments.listForIssue` List comments on a specific issue or pull request **Risk:** `read` ```ts theme={null} await corsair.github.api.comments.listForIssue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `issueNumber` | `number` | Yes | — | | `since` | `string` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > url?: string, > htmlUrl?: string, > issueUrl?: string, > body?: string, > authorAssociation?: string, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` *** ### update `comments.update` Update a comment **Risk:** `write` ```ts theme={null} await corsair.github.api.comments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `commentId` | `number` | Yes | — | | `body` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `issueUrl` | `string` | No | — | | `body` | `string` | No | — | | `authorAssociation` | `string` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | *** ## Discussions ### get `discussions.get` Get a specific discussion **Risk:** `read` ```ts theme={null} await corsair.github.api.discussions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `discussionNumber` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `number` | `number` | Yes | — | | `title` | `string` | Yes | — | | `body` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `repositoryUrl` | `string` | No | — | | `state` | `string` | No | — | | `locked` | `boolean` | No | — | | `comments` | `number` | No | — | | `authorAssociation` | `string` | No | — | | `category` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `answerChosenAt` | `Date` | No | — | > **category full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > repositoryId?: number, > emoji?: string, > name: string, > description?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > slug?: string, > isAnswerable?: boolean > } > ``` *** ### list `discussions.list` List discussions in a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.discussions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > number: number, > title: string, > body?: string | null, > htmlUrl?: string, > repositoryUrl?: string, > state?: string, > locked?: boolean, > comments?: number, > authorAssociation?: string, > category?: { > id: number, > nodeId?: string, > repositoryId?: number, > emoji?: string, > name: string, > description?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > slug?: string, > isAnswerable?: boolean > }, > createdAt?: Date | null, > updatedAt?: Date | null, > answerChosenAt?: Date | null > }[] > ``` *** ## Events ### list `events.list` List public GitHub events **Risk:** `read` ```ts theme={null} await corsair.github.api.events.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: string, > actor?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > name: string, > url?: string > }, > org?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > payload?: { > }, > public?: boolean, > createdAt?: Date | null > }[] > ``` *** ### listForNetwork `events.listForNetwork` List public events for a repository network **Risk:** `read` ```ts theme={null} await corsair.github.api.events.listForNetwork({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: string, > actor?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > name: string, > url?: string > }, > org?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > payload?: { > }, > public?: boolean, > createdAt?: Date | null > }[] > ``` *** ### listForOrg `events.listForOrg` List public events for an organization **Risk:** `read` ```ts theme={null} await corsair.github.api.events.listForOrg({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: string, > actor?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > name: string, > url?: string > }, > org?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > payload?: { > }, > public?: boolean, > createdAt?: Date | null > }[] > ``` *** ### listForRepository `events.listForRepository` List events for a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.events.listForRepository({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: string, > actor?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > name: string, > url?: string > }, > org?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > payload?: { > }, > public?: boolean, > createdAt?: Date | null > }[] > ``` *** ### listForUser `events.listForUser` List events for a user **Risk:** `read` ```ts theme={null} await corsair.github.api.events.listForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: string, > actor?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > name: string, > url?: string > }, > org?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > payload?: { > }, > public?: boolean, > createdAt?: Date | null > }[] > ``` *** ### listForUserOrg `events.listForUserOrg` List organization events for a user **Risk:** `read` ```ts theme={null} await corsair.github.api.events.listForUserOrg({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `org` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: string, > actor?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > name: string, > url?: string > }, > org?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > payload?: { > }, > public?: boolean, > createdAt?: Date | null > }[] > ``` *** ### listPublicForUser `events.listPublicForUser` List public events for a user **Risk:** `read` ```ts theme={null} await corsair.github.api.events.listPublicForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: string, > actor?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > name: string, > url?: string > }, > org?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > payload?: { > }, > public?: boolean, > createdAt?: Date | null > }[] > ``` *** ### listPublicReceivedForUser `events.listPublicReceivedForUser` List public events received by a user **Risk:** `read` ```ts theme={null} await corsair.github.api.events.listPublicReceivedForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: string, > actor?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > name: string, > url?: string > }, > org?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > payload?: { > }, > public?: boolean, > createdAt?: Date | null > }[] > ``` *** ### listReceivedForUser `events.listReceivedForUser` List events received by a user **Risk:** `read` ```ts theme={null} await corsair.github.api.events.listReceivedForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type: string, > actor?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > name: string, > url?: string > }, > org?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > payload?: { > }, > public?: boolean, > createdAt?: Date | null > }[] > ``` *** ## Forks ### create `forks.create` Create a fork of a repository **Risk:** `write` ```ts theme={null} await corsair.github.api.forks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `organization` | `string` | No | — | | `name` | `string` | No | — | | `defaultBranchOnly` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `name` | `string` | Yes | — | | `fullName` | `string` | No | — | | `private` | `boolean` | No | — | | `htmlUrl` | `string` | No | — | | `description` | `string` | No | — | | `fork` | `boolean` | No | — | | `url` | `string` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `pushedAt` | `Date` | No | — | | `defaultBranch` | `string` | No | — | | `language` | `string` | No | — | | `stargazersCount` | `number` | No | — | | `watchersCount` | `number` | No | — | | `forksCount` | `number` | No | — | | `openIssuesCount` | `number` | No | — | | `archived` | `boolean` | No | — | | `disabled` | `boolean` | No | — | | `owner` | `object` | No | — | > **owner full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` *** ### list `forks.list` List forks of a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.forks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `sort` | `newest \| oldest \| stargazers \| watchers` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > name: string, > fullName?: string, > private?: boolean, > htmlUrl?: string, > description?: string | null, > fork?: boolean, > url?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > pushedAt?: Date | null, > defaultBranch?: string, > language?: string | null, > stargazersCount?: number, > watchersCount?: number, > forksCount?: number, > openIssuesCount?: number, > archived?: boolean, > disabled?: boolean, > owner?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > }[] > ``` *** ## Issues ### create `issues.create` Create a new issue **Risk:** `write` ```ts theme={null} await corsair.github.api.issues.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `title` | `string \| number` | Yes | — | | `body` | `string` | No | — | | `assignee` | `string` | No | — | | `milestone` | `string \| number` | No | — | | `labels` | `object[]` | No | — | | `assignees` | `string[]` | No | — | > **labels full type** > > ```ts theme={null} > ( > string | { > id?: number, > name?: string, > description?: string | null, > color?: string | null > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `url` | `string` | No | — | | `repositoryUrl` | `string` | No | — | | `labelsUrl` | `string` | No | — | | `commentsUrl` | `string` | No | — | | `eventsUrl` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `number` | `number` | Yes | — | | `state` | `string` | Yes | — | | `stateReason` | `completed \| reopened \| not_planned \| duplicate` | No | — | | `title` | `string` | Yes | — | | `body` | `string` | No | — | | `user` | `object` | No | — | | `labels` | `object[]` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `locked` | `boolean` | No | — | | `comments` | `number` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `closedAt` | `Date` | No | — | > **user full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **labels full type** > > ```ts theme={null} > ( > string | { > id?: number, > nodeId?: string, > url?: string, > name?: string, > description?: string | null, > color?: string | null, > default?: boolean > } > )[] > ``` > **assignee full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }[] > ``` *** ### createComment `issues.createComment` Post a comment on an issue **Risk:** `write` ```ts theme={null} await corsair.github.api.issues.createComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `issueNumber` | `number` | Yes | — | | `body` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `url` | `string` | No | — | | `body` | `string` | No | — | | `bodyText` | `string` | No | — | | `bodyHtml` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `user` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `issueUrl` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > login: string, > id: number, > nodeId?: string, > avatarUrl?: string > } > ``` *** ### get `issues.get` Get a specific issue **Risk:** `read` ```ts theme={null} await corsair.github.api.issues.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `issueNumber` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `url` | `string` | No | — | | `repositoryUrl` | `string` | No | — | | `labelsUrl` | `string` | No | — | | `commentsUrl` | `string` | No | — | | `eventsUrl` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `number` | `number` | Yes | — | | `state` | `string` | Yes | — | | `stateReason` | `completed \| reopened \| not_planned \| duplicate` | No | — | | `title` | `string` | Yes | — | | `body` | `string` | No | — | | `user` | `object` | No | — | | `labels` | `object[]` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `locked` | `boolean` | No | — | | `comments` | `number` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `closedAt` | `Date` | No | — | > **user full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **labels full type** > > ```ts theme={null} > ( > string | { > id?: number, > nodeId?: string, > url?: string, > name?: string, > description?: string | null, > color?: string | null, > default?: boolean > } > )[] > ``` > **assignee full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }[] > ``` *** ### list `issues.list` List issues in a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.issues.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `milestone` | `string` | No | — | | `state` | `open \| closed \| all` | No | — | | `assignee` | `string` | No | — | | `creator` | `string` | No | — | | `mentioned` | `string` | No | — | | `labels` | `string` | No | — | | `sort` | `created \| updated \| comments` | No | — | | `direction` | `asc \| desc` | No | — | | `since` | `string` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > url?: string, > repositoryUrl?: string, > labelsUrl?: string, > commentsUrl?: string, > eventsUrl?: string, > htmlUrl?: string, > number: number, > state: string, > stateReason?: completed | reopened | not_planned | duplicate | null, > title: string, > body?: string | null, > user?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } | null, > labels?: ( > string | { > id?: number, > nodeId?: string, > url?: string, > name?: string, > description?: string | null, > color?: string | null, > default?: boolean > } > )[], > assignee?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } | null, > assignees?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }[] | null, > locked?: boolean, > comments?: number, > createdAt?: Date | null, > updatedAt?: Date | null, > closedAt?: Date | null > }[] > ``` *** ### update `issues.update` Update an existing issue **Risk:** `write` ```ts theme={null} await corsair.github.api.issues.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `issueNumber` | `number` | Yes | — | | `title` | `string \| number` | No | — | | `body` | `string` | No | — | | `assignee` | `string` | No | — | | `state` | `open \| closed` | No | — | | `stateReason` | `completed \| not_planned \| duplicate \| reopened` | No | — | | `milestone` | `string \| number` | No | — | | `labels` | `object[]` | No | — | | `assignees` | `string[]` | No | — | > **labels full type** > > ```ts theme={null} > ( > string | { > id?: number, > name?: string, > description?: string | null, > color?: string | null > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `url` | `string` | No | — | | `repositoryUrl` | `string` | No | — | | `labelsUrl` | `string` | No | — | | `commentsUrl` | `string` | No | — | | `eventsUrl` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `number` | `number` | Yes | — | | `state` | `string` | Yes | — | | `stateReason` | `completed \| reopened \| not_planned \| duplicate` | No | — | | `title` | `string` | Yes | — | | `body` | `string` | No | — | | `user` | `object` | No | — | | `labels` | `object[]` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `locked` | `boolean` | No | — | | `comments` | `number` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `closedAt` | `Date` | No | — | > **user full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **labels full type** > > ```ts theme={null} > ( > string | { > id?: number, > nodeId?: string, > url?: string, > name?: string, > description?: string | null, > color?: string | null, > default?: boolean > } > )[] > ``` > **assignee full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }[] > ``` *** ## Pull Requests ### createReview `pullRequests.createReview` Submit a pull request review **Risk:** `write` ```ts theme={null} await corsair.github.api.pullRequests.createReview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `pullNumber` | `number` | Yes | — | | `commitId` | `string` | No | — | | `body` | `string` | No | — | | `event` | `APPROVE \| REQUEST_CHANGES \| COMMENT` | No | — | | `comments` | `object[]` | No | — | > **comments full type** > > ```ts theme={null} > { > path: string, > position?: number, > body: string, > line?: number, > side?: string, > startLine?: number, > startSide?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `user` | `object` | No | — | | `body` | `string` | No | — | | `state` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `pullRequestUrl` | `string` | No | — | | `submittedAt` | `Date` | No | — | | `commitId` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > login: string, > id: number > } > ``` *** ### get `pullRequests.get` Get a specific pull request **Risk:** `read` ```ts theme={null} await corsair.github.api.pullRequests.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `pullNumber` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `diffUrl` | `string` | No | — | | `patchUrl` | `string` | No | — | | `issueUrl` | `string` | No | — | | `number` | `number` | Yes | — | | `state` | `open \| closed` | Yes | — | | `locked` | `boolean` | No | — | | `title` | `string` | Yes | — | | `user` | `object` | No | — | | `body` | `string` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `closedAt` | `Date` | No | — | | `mergedAt` | `Date` | No | — | | `mergeCommitSha` | `string` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `labels` | `object[]` | No | — | | `milestone` | `object` | No | — | | `commitsUrl` | `string` | No | — | | `reviewCommentsUrl` | `string` | No | — | | `reviewCommentUrl` | `string` | No | — | | `commentsUrl` | `string` | No | — | | `statusesUrl` | `string` | No | — | | `head` | `object` | No | — | | `base` | `object` | No | — | | `authorAssociation` | `string` | No | — | | `draft` | `boolean` | No | — | | `merged` | `boolean` | No | — | | `mergeable` | `boolean` | No | — | | `comments` | `number` | No | — | | `reviewComments` | `number` | No | — | | `commits` | `number` | No | — | | `additions` | `number` | No | — | | `deletions` | `number` | No | — | | `changedFiles` | `number` | No | — | > **user full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }[] > ``` > **labels full type** > > ```ts theme={null} > { > id?: number, > nodeId?: string, > url?: string, > name?: string, > description?: string | null, > color?: string | null, > default?: boolean > }[] > ``` > **milestone full type** > > ```ts theme={null} > { > url?: string, > htmlUrl?: string, > labelsUrl?: string, > id?: number, > nodeId?: string, > number?: number, > state?: open | closed, > title?: string, > description?: string | null, > creator?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > openIssues?: number, > closedIssues?: number, > createdAt?: Date | null, > updatedAt?: Date | null, > closedAt?: Date | null, > dueOn?: Date | null > } > ``` > **head full type** > > ```ts theme={null} > { > label?: string, > ref?: string, > sha?: string, > user?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > nodeId?: string, > name: string, > fullName?: string, > private?: boolean, > htmlUrl?: string, > description?: string | null, > fork?: boolean, > url?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > pushedAt?: Date | null, > defaultBranch?: string, > language?: string | null, > stargazersCount?: number, > watchersCount?: number, > forksCount?: number, > openIssuesCount?: number, > archived?: boolean, > disabled?: boolean, > owner?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > } | null > } > ``` > **base full type** > > ```ts theme={null} > { > label?: string, > ref?: string, > sha?: string, > user?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > nodeId?: string, > name: string, > fullName?: string, > private?: boolean, > htmlUrl?: string, > description?: string | null, > fork?: boolean, > url?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > pushedAt?: Date | null, > defaultBranch?: string, > language?: string | null, > stargazersCount?: number, > watchersCount?: number, > forksCount?: number, > openIssuesCount?: number, > archived?: boolean, > disabled?: boolean, > owner?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > } > } > ``` *** ### list `pullRequests.list` List pull requests **Risk:** `read` ```ts theme={null} await corsair.github.api.pullRequests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `state` | `open \| closed \| all` | No | — | | `head` | `string` | No | — | | `base` | `string` | No | — | | `sort` | `created \| updated \| popularity \| long-running` | No | — | | `direction` | `asc \| desc` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > url: string, > id: number, > nodeId?: string, > htmlUrl?: string, > diffUrl?: string, > patchUrl?: string, > issueUrl?: string, > number: number, > state: open | closed, > locked?: boolean, > title: string, > user?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > body?: string | null, > createdAt?: Date | null, > updatedAt?: Date | null, > closedAt?: Date | null, > mergedAt?: Date | null, > mergeCommitSha?: string | null, > assignee?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } | null, > assignees?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }[] | null, > labels?: { > id?: number, > nodeId?: string, > url?: string, > name?: string, > description?: string | null, > color?: string | null, > default?: boolean > }[], > milestone?: { > url?: string, > htmlUrl?: string, > labelsUrl?: string, > id?: number, > nodeId?: string, > number?: number, > state?: open | closed, > title?: string, > description?: string | null, > creator?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > openIssues?: number, > closedIssues?: number, > createdAt?: Date | null, > updatedAt?: Date | null, > closedAt?: Date | null, > dueOn?: Date | null > } | null, > commitsUrl?: string, > reviewCommentsUrl?: string, > reviewCommentUrl?: string, > commentsUrl?: string, > statusesUrl?: string, > head?: { > label?: string, > ref?: string, > sha?: string, > user?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > nodeId?: string, > name: string, > fullName?: string, > private?: boolean, > htmlUrl?: string, > description?: string | null, > fork?: boolean, > url?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > pushedAt?: Date | null, > defaultBranch?: string, > language?: string | null, > stargazersCount?: number, > watchersCount?: number, > forksCount?: number, > openIssuesCount?: number, > archived?: boolean, > disabled?: boolean, > owner?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > } | null > }, > base?: { > label?: string, > ref?: string, > sha?: string, > user?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > repo?: { > id: number, > nodeId?: string, > name: string, > fullName?: string, > private?: boolean, > htmlUrl?: string, > description?: string | null, > fork?: boolean, > url?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > pushedAt?: Date | null, > defaultBranch?: string, > language?: string | null, > stargazersCount?: number, > watchersCount?: number, > forksCount?: number, > openIssuesCount?: number, > archived?: boolean, > disabled?: boolean, > owner?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > } > }, > authorAssociation?: string, > draft?: boolean, > merged?: boolean, > mergeable?: boolean | null, > comments?: number, > reviewComments?: number, > commits?: number, > additions?: number, > deletions?: number, > changedFiles?: number > }[] > ``` *** ### listReviews `pullRequests.listReviews` List reviews on a pull request **Risk:** `read` ```ts theme={null} await corsair.github.api.pullRequests.listReviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `pullNumber` | `number` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > user?: { > login: string, > id: number > }, > body?: string, > state?: string, > htmlUrl?: string, > pullRequestUrl?: string, > submittedAt?: Date | null, > commitId?: string | null > }[] > ``` *** ## Releases ### create `releases.create` Create a new release **Risk:** `write` ```ts theme={null} await corsair.github.api.releases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `tagName` | `string` | Yes | — | | `targetCommitish` | `string` | No | — | | `name` | `string` | No | — | | `body` | `string` | No | — | | `draft` | `boolean` | No | — | | `prerelease` | `boolean` | No | — | | `generateReleaseNotes` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `assetsUrl` | `string` | No | — | | `uploadUrl` | `string` | No | — | | `tarballUrl` | `string` | No | — | | `zipballUrl` | `string` | No | — | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `tagName` | `string` | No | — | | `targetCommitish` | `string` | No | — | | `name` | `string` | No | — | | `body` | `string` | No | — | | `draft` | `boolean` | No | — | | `prerelease` | `boolean` | No | — | | `createdAt` | `Date` | No | — | | `publishedAt` | `Date` | No | — | | `author` | `object` | No | — | | `assets` | `object[]` | No | — | > **author full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **assets full type** > > ```ts theme={null} > { > url: string, > browserDownloadUrl: string, > id: number, > nodeId: string, > name: string, > label?: string | null, > state: uploaded | open, > contentType: string, > size: number, > downloadCount: number, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` *** ### get `releases.get` Get a specific release **Risk:** `read` ```ts theme={null} await corsair.github.api.releases.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `releaseId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `assetsUrl` | `string` | No | — | | `uploadUrl` | `string` | No | — | | `tarballUrl` | `string` | No | — | | `zipballUrl` | `string` | No | — | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `tagName` | `string` | No | — | | `targetCommitish` | `string` | No | — | | `name` | `string` | No | — | | `body` | `string` | No | — | | `draft` | `boolean` | No | — | | `prerelease` | `boolean` | No | — | | `createdAt` | `Date` | No | — | | `publishedAt` | `Date` | No | — | | `author` | `object` | No | — | | `assets` | `object[]` | No | — | > **author full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **assets full type** > > ```ts theme={null} > { > url: string, > browserDownloadUrl: string, > id: number, > nodeId: string, > name: string, > label?: string | null, > state: uploaded | open, > contentType: string, > size: number, > downloadCount: number, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` *** ### list `releases.list` List releases in a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.releases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > url?: string, > htmlUrl?: string, > assetsUrl?: string, > uploadUrl?: string, > tarballUrl?: string | null, > zipballUrl?: string | null, > id: number, > nodeId?: string, > tagName?: string, > targetCommitish?: string, > name?: string | null, > body?: string | null, > draft?: boolean, > prerelease?: boolean, > createdAt?: Date | null, > publishedAt?: Date | null, > author?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > assets?: { > url: string, > browserDownloadUrl: string, > id: number, > nodeId: string, > name: string, > label?: string | null, > state: uploaded | open, > contentType: string, > size: number, > downloadCount: number, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > }[] > ``` *** ### update `releases.update` Update an existing release **Risk:** `write` ```ts theme={null} await corsair.github.api.releases.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `releaseId` | `number` | Yes | — | | `tagName` | `string` | No | — | | `targetCommitish` | `string` | No | — | | `name` | `string` | No | — | | `body` | `string` | No | — | | `draft` | `boolean` | No | — | | `prerelease` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `assetsUrl` | `string` | No | — | | `uploadUrl` | `string` | No | — | | `tarballUrl` | `string` | No | — | | `zipballUrl` | `string` | No | — | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `tagName` | `string` | No | — | | `targetCommitish` | `string` | No | — | | `name` | `string` | No | — | | `body` | `string` | No | — | | `draft` | `boolean` | No | — | | `prerelease` | `boolean` | No | — | | `createdAt` | `Date` | No | — | | `publishedAt` | `Date` | No | — | | `author` | `object` | No | — | | `assets` | `object[]` | No | — | > **author full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` > **assets full type** > > ```ts theme={null} > { > url: string, > browserDownloadUrl: string, > id: number, > nodeId: string, > name: string, > label?: string | null, > state: uploaded | open, > contentType: string, > size: number, > downloadCount: number, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` *** ## Repositories ### checkStarred `repositories.checkStarred` Check whether the authenticated user has starred a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.repositories.checkStarred({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `starred` | `boolean` | Yes | — | *** ### get `repositories.get` Get a specific repository **Risk:** `read` ```ts theme={null} await corsair.github.api.repositories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `name` | `string` | Yes | — | | `fullName` | `string` | No | — | | `private` | `boolean` | No | — | | `htmlUrl` | `string` | No | — | | `description` | `string` | No | — | | `fork` | `boolean` | No | — | | `url` | `string` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `pushedAt` | `Date` | No | — | | `defaultBranch` | `string` | No | — | | `language` | `string` | No | — | | `stargazersCount` | `number` | No | — | | `watchersCount` | `number` | No | — | | `forksCount` | `number` | No | — | | `openIssuesCount` | `number` | No | — | | `archived` | `boolean` | No | — | | `disabled` | `boolean` | No | — | | `owner` | `object` | No | — | > **owner full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > ``` *** ### getContent `repositories.getContent` Get file or directory content from a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.repositories.getContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `path` | `string` | Yes | — | | `ref` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > type: file, > encoding?: string, > size?: number, > name: string, > path?: string, > content?: string, > sha: string, > url?: string, > gitUrl?: string | null, > htmlUrl?: string | null, > downloadUrl?: string | null > } | { > type: dir, > name: string, > path?: string, > sha: string, > size?: number, > url?: string, > gitUrl?: string | null, > htmlUrl?: string | null, > downloadUrl?: string | null > } | { > type: file | dir | submodule | symlink, > size?: number, > name: string, > path?: string, > sha: string, > url?: string, > gitUrl?: string | null, > htmlUrl?: string | null, > downloadUrl?: string | null > }[] > ``` *** ### list `repositories.list` List repositories for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.github.api.repositories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | No | — | | `type` | `all \| owner \| public \| private \| member` | No | — | | `sort` | `created \| updated \| pushed \| full_name` | No | — | | `direction` | `asc \| desc` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > name: string, > fullName?: string, > private?: boolean, > htmlUrl?: string, > description?: string | null, > fork?: boolean, > url?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > pushedAt?: Date | null, > defaultBranch?: string, > language?: string | null, > stargazersCount?: number, > watchersCount?: number, > forksCount?: number, > openIssuesCount?: number, > archived?: boolean, > disabled?: boolean, > owner?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > }[] > ``` *** ### listBranches `repositories.listBranches` List branches in a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.repositories.listBranches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `protected` | `boolean` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name: string, > commit: { > sha: string, > url: string > }, > protected: boolean > }[] > ``` *** ### listCommits `repositories.listCommits` List commits in a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.repositories.listCommits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `sha` | `string` | No | — | | `path` | `string` | No | — | | `author` | `string` | No | — | | `committer` | `string` | No | — | | `since` | `string` | No | — | | `until` | `string` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > url?: string, > sha: string, > nodeId?: string, > htmlUrl?: string, > commentsUrl?: string, > commit: { > url?: string, > author?: { > name: string, > email: string, > date?: Date | null > } | null, > committer?: { > name: string, > email: string, > date?: Date | null > } | null, > message: string, > commentCount?: number, > tree?: { > sha: string, > url?: string > } > }, > author?: { > login: string, > id: number > } | null, > committer?: { > login: string, > id: number > } | null, > parents?: { > sha: string, > url?: string, > htmlUrl?: string > }[] > }[] > ``` *** ### listStargazers `repositories.listStargazers` List users who have starred a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.repositories.listStargazers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > starredAt: Date, > user: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > }[] > ``` *** ### listStarred `repositories.listStarred` List repositories starred by the authenticated user **Risk:** `read` ```ts theme={null} await corsair.github.api.repositories.listStarred({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `created \| updated` | No | — | | `direction` | `asc \| desc` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > name: string, > fullName?: string, > private?: boolean, > htmlUrl?: string, > description?: string | null, > fork?: boolean, > url?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > pushedAt?: Date | null, > defaultBranch?: string, > language?: string | null, > stargazersCount?: number, > watchersCount?: number, > forksCount?: number, > openIssuesCount?: number, > archived?: boolean, > disabled?: boolean, > owner?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > }[] > ``` *** ### star `repositories.star` Star a repository for the authenticated user **Risk:** `write` ```ts theme={null} await corsair.github.api.repositories.star({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | **Output:** `boolean` *** ### unstar `repositories.unstar` Unstar a repository for the authenticated user **Risk:** `write` ```ts theme={null} await corsair.github.api.repositories.unstar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | **Output:** `boolean` *** ## Search ### issues `search.issues` Search GitHub issues and pull requests **Risk:** `read` ```ts theme={null} await corsair.github.api.search.issues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `sort` | `comments \| reactions \| reactions-+1 \| reactions--1 \| reactions-smile \| reactions-thinking_face \| reactions-heart \| reactions-tada \| interactions \| created \| updated` | No | — | | `order` | `asc \| desc` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | | `advancedSearch` | `boolean` | No | — | | `searchType` | `semantic \| hybrid` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalCount` | `number` | Yes | — | | `incompleteResults` | `boolean` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > url?: string, > repositoryUrl?: string, > labelsUrl?: string, > commentsUrl?: string, > eventsUrl?: string, > htmlUrl?: string, > number: number, > state: string, > stateReason?: completed | reopened | not_planned | duplicate | null, > title: string, > body?: string | null, > user?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } | null, > labels?: ( > string | { > id?: number, > nodeId?: string, > url?: string, > name?: string, > description?: string | null, > color?: string | null, > default?: boolean > } > )[], > assignee?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } | null, > assignees?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }[] | null, > locked?: boolean, > comments?: number, > createdAt?: Date | null, > updatedAt?: Date | null, > closedAt?: Date | null, > score: number, > pullRequest?: { > url?: string, > htmlUrl?: string, > diffUrl?: string, > patchUrl?: string, > mergedAt?: Date | null > }, > repository?: { > id: number, > nodeId?: string, > name: string, > fullName?: string, > private?: boolean, > htmlUrl?: string, > description?: string | null, > fork?: boolean, > url?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > pushedAt?: Date | null, > defaultBranch?: string, > language?: string | null, > stargazersCount?: number, > watchersCount?: number, > forksCount?: number, > openIssuesCount?: number, > archived?: boolean, > disabled?: boolean, > owner?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > } > } > }[] > ``` *** ### repositories `search.repositories` Search GitHub repositories **Risk:** `read` ```ts theme={null} await corsair.github.api.search.repositories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `sort` | `stars \| forks \| help-wanted-issues \| updated` | No | — | | `order` | `asc \| desc` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalCount` | `number` | Yes | — | | `incompleteResults` | `boolean` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > name: string, > fullName?: string, > private?: boolean, > htmlUrl?: string, > description?: string | null, > fork?: boolean, > url?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > pushedAt?: Date | null, > defaultBranch?: string, > language?: string | null, > stargazersCount?: number, > watchersCount?: number, > forksCount?: number, > openIssuesCount?: number, > archived?: boolean, > disabled?: boolean, > owner?: { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }, > score: number, > watchers?: number > }[] > ``` *** ### users `search.users` Search GitHub users and organizations **Risk:** `read` ```ts theme={null} await corsair.github.api.search.users({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `sort` | `followers \| repositories \| joined` | No | — | | `order` | `asc \| desc` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalCount` | `number` | Yes | — | | `incompleteResults` | `boolean` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string, > score: number > }[] > ``` *** ## Users ### get `users.get` Get a user by username **Risk:** `read` ```ts theme={null} await corsair.github.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email` | `string` | No | — | | `login` | `string` | Yes | — | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `avatarUrl` | `string` | No | — | | `gravatarId` | `string` | No | — | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `followersUrl` | `string` | No | — | | `followingUrl` | `string` | No | — | | `gistsUrl` | `string` | No | — | | `starredUrl` | `string` | No | — | | `subscriptionsUrl` | `string` | No | — | | `organizationsUrl` | `string` | No | — | | `reposUrl` | `string` | No | — | | `eventsUrl` | `string` | No | — | | `receivedEventsUrl` | `string` | No | — | | `type` | `string` | No | — | | `siteAdmin` | `boolean` | No | — | | `starredAt` | `Date` | No | — | | `userViewType` | `string` | No | — | | `company` | `string` | No | — | | `blog` | `string` | No | — | | `location` | `string` | No | — | | `notificationEmail` | `string` | No | — | | `hireable` | `boolean` | No | — | | `bio` | `string` | No | — | | `twitterUsername` | `string` | No | — | | `publicRepos` | `number` | No | — | | `publicGists` | `number` | No | — | | `followers` | `number` | No | — | | `following` | `number` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `privateGists` | `number` | No | — | | `totalPrivateRepos` | `number` | No | — | | `ownedPrivateRepos` | `number` | No | — | | `diskUsage` | `number` | No | — | | `collaborators` | `number` | No | — | | `twoFactorAuthentication` | `boolean` | No | — | | `plan` | `object` | No | — | | `businessPlus` | `boolean` | No | — | | `ldapDn` | `string` | No | — | > **plan full type** > > ```ts theme={null} > { > collaborators?: number, > name?: string, > space?: number, > privateRepos?: number > } > ``` *** ### getAuthenticated `users.getAuthenticated` Get the authenticated user **Risk:** `read` ```ts theme={null} await corsair.github.api.users.getAuthenticated({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email` | `string` | No | — | | `login` | `string` | Yes | — | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `avatarUrl` | `string` | No | — | | `gravatarId` | `string` | No | — | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `followersUrl` | `string` | No | — | | `followingUrl` | `string` | No | — | | `gistsUrl` | `string` | No | — | | `starredUrl` | `string` | No | — | | `subscriptionsUrl` | `string` | No | — | | `organizationsUrl` | `string` | No | — | | `reposUrl` | `string` | No | — | | `eventsUrl` | `string` | No | — | | `receivedEventsUrl` | `string` | No | — | | `type` | `string` | No | — | | `siteAdmin` | `boolean` | No | — | | `starredAt` | `Date` | No | — | | `userViewType` | `string` | No | — | | `company` | `string` | No | — | | `blog` | `string` | No | — | | `location` | `string` | No | — | | `notificationEmail` | `string` | No | — | | `hireable` | `boolean` | No | — | | `bio` | `string` | No | — | | `twitterUsername` | `string` | No | — | | `publicRepos` | `number` | No | — | | `publicGists` | `number` | No | — | | `followers` | `number` | No | — | | `following` | `number` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `privateGists` | `number` | No | — | | `totalPrivateRepos` | `number` | No | — | | `ownedPrivateRepos` | `number` | No | — | | `diskUsage` | `number` | No | — | | `collaborators` | `number` | No | — | | `twoFactorAuthentication` | `boolean` | No | — | | `plan` | `object` | No | — | | `businessPlus` | `boolean` | No | — | | `ldapDn` | `string` | No | — | > **plan full type** > > ```ts theme={null} > { > collaborators?: number, > name?: string, > space?: number, > privateRepos?: number > } > ``` *** ### getById `users.getById` Get a user by account ID **Risk:** `read` ```ts theme={null} await corsair.github.api.users.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email` | `string` | No | — | | `login` | `string` | Yes | — | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `avatarUrl` | `string` | No | — | | `gravatarId` | `string` | No | — | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `followersUrl` | `string` | No | — | | `followingUrl` | `string` | No | — | | `gistsUrl` | `string` | No | — | | `starredUrl` | `string` | No | — | | `subscriptionsUrl` | `string` | No | — | | `organizationsUrl` | `string` | No | — | | `reposUrl` | `string` | No | — | | `eventsUrl` | `string` | No | — | | `receivedEventsUrl` | `string` | No | — | | `type` | `string` | No | — | | `siteAdmin` | `boolean` | No | — | | `starredAt` | `Date` | No | — | | `userViewType` | `string` | No | — | | `company` | `string` | No | — | | `blog` | `string` | No | — | | `location` | `string` | No | — | | `notificationEmail` | `string` | No | — | | `hireable` | `boolean` | No | — | | `bio` | `string` | No | — | | `twitterUsername` | `string` | No | — | | `publicRepos` | `number` | No | — | | `publicGists` | `number` | No | — | | `followers` | `number` | No | — | | `following` | `number` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `privateGists` | `number` | No | — | | `totalPrivateRepos` | `number` | No | — | | `ownedPrivateRepos` | `number` | No | — | | `diskUsage` | `number` | No | — | | `collaborators` | `number` | No | — | | `twoFactorAuthentication` | `boolean` | No | — | | `plan` | `object` | No | — | | `businessPlus` | `boolean` | No | — | | `ldapDn` | `string` | No | — | > **plan full type** > > ```ts theme={null} > { > collaborators?: number, > name?: string, > space?: number, > privateRepos?: number > } > ``` *** ### getHovercard `users.getHovercard` Get contextual hovercard information for a user **Risk:** `read` ```ts theme={null} await corsair.github.api.users.getHovercard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `subjectType` | `organization \| repository \| issue \| pull_request` | No | — | | `subjectId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contexts` | `object[]` | Yes | — | > **contexts full type** > > ```ts theme={null} > { > message: string, > octicon: string > }[] > ``` *** ### list `users.list` List all GitHub users **Risk:** `read` ```ts theme={null} await corsair.github.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `number` | No | — | | `perPage` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null, > login: string, > id: number, > nodeId?: string, > avatarUrl?: string, > gravatarId?: string | null, > url?: string, > htmlUrl?: string, > followersUrl?: string, > followingUrl?: string, > gistsUrl?: string, > starredUrl?: string, > subscriptionsUrl?: string, > organizationsUrl?: string, > reposUrl?: string, > eventsUrl?: string, > receivedEventsUrl?: string, > type?: string, > siteAdmin?: boolean, > starredAt?: Date | null, > userViewType?: string > }[] > ``` *** ### update `users.update` Update the authenticated user profile **Risk:** `write` ```ts theme={null} await corsair.github.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email` | `string` | No | — | | `blog` | `string` | No | — | | `twitterUsername` | `string` | No | — | | `company` | `string` | No | — | | `location` | `string` | No | — | | `hireable` | `boolean` | No | — | | `bio` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email` | `string` | No | — | | `login` | `string` | Yes | — | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `avatarUrl` | `string` | No | — | | `gravatarId` | `string` | No | — | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `followersUrl` | `string` | No | — | | `followingUrl` | `string` | No | — | | `gistsUrl` | `string` | No | — | | `starredUrl` | `string` | No | — | | `subscriptionsUrl` | `string` | No | — | | `organizationsUrl` | `string` | No | — | | `reposUrl` | `string` | No | — | | `eventsUrl` | `string` | No | — | | `receivedEventsUrl` | `string` | No | — | | `type` | `string` | No | — | | `siteAdmin` | `boolean` | No | — | | `starredAt` | `Date` | No | — | | `userViewType` | `string` | No | — | | `company` | `string` | No | — | | `blog` | `string` | No | — | | `location` | `string` | No | — | | `notificationEmail` | `string` | No | — | | `hireable` | `boolean` | No | — | | `bio` | `string` | No | — | | `twitterUsername` | `string` | No | — | | `publicRepos` | `number` | No | — | | `publicGists` | `number` | No | — | | `followers` | `number` | No | — | | `following` | `number` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `privateGists` | `number` | No | — | | `totalPrivateRepos` | `number` | No | — | | `ownedPrivateRepos` | `number` | No | — | | `diskUsage` | `number` | No | — | | `collaborators` | `number` | No | — | | `twoFactorAuthentication` | `boolean` | No | — | | `plan` | `object` | No | — | | `businessPlus` | `boolean` | No | — | | `ldapDn` | `string` | No | — | > **plan full type** > > ```ts theme={null} > { > collaborators?: number, > name?: string, > space?: number, > privateRepos?: number > } > ``` *** ## Workflows ### get `workflows.get` Get a specific workflow **Risk:** `read` ```ts theme={null} await corsair.github.api.workflows.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `workflowId` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `nodeId` | `string` | No | — | | `name` | `string` | Yes | — | | `path` | `string` | Yes | — | | `state` | `active \| deleted \| disabled_fork \| disabled_inactivity \| disabled_manually` | Yes | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `url` | `string` | No | — | | `htmlUrl` | `string` | No | — | | `badgeUrl` | `string` | No | — | | `deletedAt` | `Date` | No | — | *** ### list `workflows.list` List workflows in a repository **Risk:** `read` ```ts theme={null} await corsair.github.api.workflows.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalCount` | `number` | No | — | | `workflows` | `object[]` | No | — | > **workflows full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > name: string, > path: string, > state: active | deleted | disabled_fork | disabled_inactivity | disabled_manually, > createdAt?: Date | null, > updatedAt?: Date | null, > url?: string, > htmlUrl?: string, > badgeUrl?: string, > deletedAt?: Date | null > }[] > ``` *** ### listRuns `workflows.listRuns` List workflow runs **Risk:** `read` ```ts theme={null} await corsair.github.api.workflows.listRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `repo` | `string` | Yes | — | | `actor` | `string` | No | — | | `branch` | `string` | No | — | | `event` | `string` | No | — | | `status` | `completed \| action_required \| cancelled \| failure \| neutral \| skipped \| stale \| success \| timed_out \| in_progress \| queued \| requested \| waiting \| pending` | No | — | | `perPage` | `number` | No | — | | `page` | `number` | No | — | | `created` | `string` | No | — | | `excludePullRequests` | `boolean` | No | — | | `checkSuiteId` | `number` | No | — | | `headSha` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalCount` | `number` | No | — | | `workflowRuns` | `object[]` | No | — | > **workflowRuns full type** > > ```ts theme={null} > { > id: number, > nodeId?: string, > name?: string | null, > headBranch?: string | null, > headSha?: string, > path?: string, > runNumber?: number, > runAttempt?: number, > event?: string, > status?: string | null, > conclusion?: string | null, > workflowId?: number, > url?: string, > htmlUrl?: string, > createdAt?: Date | null, > updatedAt?: Date | null, > displayTitle?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/github/database GitHub local sync: searchable entities, `.search()` filters, and operators. The GitHub plugin syncs data locally. Use `corsair.github.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Branches Path: `github.db.branches.search` ```ts theme={null} const rows = await corsair.github.db.branches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `repositoryId` | `number` | equals, gt, gte, lt, lte, in | | `repositoryFullName` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `sha` | `string` | equals, contains, startsWith, endsWith, in | | `protected` | `boolean` | equals | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Comments Path: `github.db.comments.search` ```ts theme={null} const rows = await corsair.github.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `nodeId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `htmlUrl` | `string` | equals, contains, startsWith, endsWith, in | | `issueUrl` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `authorAssociation` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Discussions Path: `github.db.discussions.search` ```ts theme={null} const rows = await corsair.github.db.discussions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `nodeId` | `string` | equals, contains, startsWith, endsWith, in | | `htmlUrl` | `string` | equals, contains, startsWith, endsWith, in | | `repositoryUrl` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `locked` | `boolean` | equals | | `comments` | `number` | equals, gt, gte, lt, lte, in | | `authorAssociation` | `string` | equals, contains, startsWith, endsWith, in | | `categoryId` | `number` | equals, gt, gte, lt, lte, in | | `categoryName` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `answerChosenAt` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Events Path: `github.db.events.search` ```ts theme={null} const rows = await corsair.github.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Forks Path: `github.db.forks.search` ```ts theme={null} const rows = await corsair.github.db.forks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `nodeId` | `string` | equals, contains, startsWith, endsWith, in | | `fullName` | `string` | equals, contains, startsWith, endsWith, in | | `htmlUrl` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `fork` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `sourceRepoId` | `number` | equals, gt, gte, lt, lte, in | | `sourceRepoFullName` | `string` | equals, contains, startsWith, endsWith, in | | `defaultBranch` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `pushedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Issues Path: `github.db.issues.search` ```ts theme={null} const rows = await corsair.github.db.issues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `nodeId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `repositoryUrl` | `string` | equals, contains, startsWith, endsWith, in | | `labelsUrl` | `string` | equals, contains, startsWith, endsWith, in | | `commentsUrl` | `string` | equals, contains, startsWith, endsWith, in | | `eventsUrl` | `string` | equals, contains, startsWith, endsWith, in | | `htmlUrl` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `number` | equals, gt, gte, lt, lte, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `locked` | `boolean` | equals | | `comments` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `closedAt` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pull Requests Path: `github.db.pullRequests.search` ```ts theme={null} const rows = await corsair.github.db.pullRequests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `nodeId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `htmlUrl` | `string` | equals, contains, startsWith, endsWith, in | | `diffUrl` | `string` | equals, contains, startsWith, endsWith, in | | `patchUrl` | `string` | equals, contains, startsWith, endsWith, in | | `issueUrl` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `number` | equals, gt, gte, lt, lte, in | | `locked` | `boolean` | equals | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `closedAt` | `date` | equals, before, after, between | | `mergedAt` | `date` | equals, before, after, between | | `mergeCommitSha` | `string` | equals, contains, startsWith, endsWith, in | | `draft` | `boolean` | equals | | `merged` | `boolean` | equals | | `mergeable` | `boolean` | equals | | `comments` | `number` | equals, gt, gte, lt, lte, in | | `reviewComments` | `number` | equals, gt, gte, lt, lte, in | | `commits` | `number` | equals, gt, gte, lt, lte, in | | `additions` | `number` | equals, gt, gte, lt, lte, in | | `deletions` | `number` | equals, gt, gte, lt, lte, in | | `changedFiles` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Releases Path: `github.db.releases.search` ```ts theme={null} const rows = await corsair.github.db.releases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `nodeId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `htmlUrl` | `string` | equals, contains, startsWith, endsWith, in | | `assetsUrl` | `string` | equals, contains, startsWith, endsWith, in | | `uploadUrl` | `string` | equals, contains, startsWith, endsWith, in | | `tarballUrl` | `string` | equals, contains, startsWith, endsWith, in | | `zipballUrl` | `string` | equals, contains, startsWith, endsWith, in | | `tagName` | `string` | equals, contains, startsWith, endsWith, in | | `targetCommitish` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `draft` | `boolean` | equals | | `prerelease` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | | `publishedAt` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Repositories Path: `github.db.repositories.search` ```ts theme={null} const rows = await corsair.github.db.repositories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `nodeId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `fullName` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `htmlUrl` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `fork` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `pushedAt` | `date` | equals, before, after, between | | `defaultBranch` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `stargazersCount` | `number` | equals, gt, gte, lt, lte, in | | `watchersCount` | `number` | equals, gt, gte, lt, lte, in | | `forksCount` | `number` | equals, gt, gte, lt, lte, in | | `openIssuesCount` | `number` | equals, gt, gte, lt, lte, in | | `archived` | `boolean` | equals | | `disabled` | `boolean` | equals | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `github.db.users.search` ```ts theme={null} const rows = await corsair.github.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workflows Path: `github.db.workflows.search` ```ts theme={null} const rows = await corsair.github.db.workflows.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `nodeId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `htmlUrl` | `string` | equals, contains, startsWith, endsWith, in | | `badgeUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `deletedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/github/get-credentials Step-by-step instructions for obtaining GitHub Personal Access Tokens, OAuth credentials, and webhook secrets. This guide walks you through obtaining all required credentials for the GitHub plugin. ## Authentication Methods The GitHub plugin supports both API key (Personal Access Token) and OAuth 2.0 authentication methods. * **[`api_key`](/concepts/api-key)** - Personal Access Token authentication * **[`oauth_2`](/concepts/oauth)** - OAuth App authentication ## API Key Authentication (Personal Access Token) ### Step 1: Create Personal Access Token 1. Go to [GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)](https://github.com/settings/tokens) 2. Click **Generate new token** → **Generate new token (classic)** 3. Give your token a descriptive name 4. Set an expiration (or select "No expiration" for long-lived tokens) 5. Select the required scopes: * `repo` - Full control of private repositories * `read:org` - Read org and team membership * `read:user` - Read user profile data * `workflow` - Update GitHub Action workflows * Add any other scopes your application needs 6. Click **Generate token** 7. **Important**: Copy the token immediately - you won't be able to see it again 8. Store the token securely **Storing Credentials:** Store the token with the Corsair CLI: ```bash theme={null} pnpm corsair setup --plugin=github api_key=your-personal-access-token ``` Verify it was saved: ```bash theme={null} pnpm corsair auth --plugin=github --credentials ``` ## OAuth 2.0 Authentication ### Step 1: Register OAuth App 1. Go to [GitHub Settings → Developer settings → OAuth Apps](https://github.com/settings/developers) 2. Click **New OAuth App** 3. Fill in the application details: * **Application name**: Your app name * **Homepage URL**: Your application URL * **Authorization callback URL**: Your OAuth callback URL (e.g., `https://yourapp.com/auth/github/callback`) 4. Click **Register application** ### Step 2: Get Client Credentials 1. After registration, you'll see your **Client ID** 2. Click **Generate a new client secret** 3. Copy the **Client ID** and **Client Secret** 4. Store these securely **Storing Credentials:** Store your OAuth app credentials, then start the flow: ```bash theme={null} pnpm corsair setup --plugin=github client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=github ``` The CLI prints an authorization URL — open it in a browser. Once you approve, tokens are saved automatically. To verify credentials were stored: ```bash theme={null} pnpm corsair auth --plugin=github --credentials ``` ## Webhook Secret ### Step 1: Create Webhook 1. Go to your repository on GitHub 2. Navigate to **Settings** → **Webhooks** 3. Click **Add webhook** 4. Configure the webhook: * **Payload URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`) * **Content type**: `application/json` * **Secret**: Generate a random secret string (save this) * **Events**: Select the events you want to receive: * Pull requests * Pushes * Issues * Stars * Releases 5. Click **Add webhook** ### Step 2: Store Webhook Secret Copy the secret you generated and store it using the CLI: ```bash theme={null} pnpm corsair setup --plugin=github webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Personal Access Token | API Key auth | Settings → Developer settings → Personal access tokens | | Client ID | OAuth 2.0 | Settings → Developer settings → OAuth Apps | | Client Secret | OAuth 2.0 | Settings → Developer settings → OAuth Apps | | Webhook Secret | Webhooks | Repository Settings → Webhooks → Secret | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/github/overview Code hosting platform for repositories, issues, pull requests, and developer workflows. Use **GitHub** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 53 typed API operations * 11 synced entities (`branches`, `comments`, `discussions`, `events`, `forks`, `issues`, and 5 more) for fast `.search()` / `.list()` * 100 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/github ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/github ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/github ``` ```bash bun theme={null} bun add corsair @corsair-dev/github ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; export const corsair = createCorsair({ plugins: [ github({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **GitHub** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/github/get-credentials). ```ts theme={null} github({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. Provider walkthrough: [Get Credentials](/plugins/github/get-credentials). ```ts theme={null} github() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your GitHub OAuth app. Provider walkthrough: [Get Credentials](/plugins/github/get-credentials). ```ts theme={null} github({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'github', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List repositories** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.github.api.repositories.list({}); ``` **Create an issue** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.github.api.issues.create({ owner: 'octocat', repo: 'hello-world', title: 'Found a bug' }); ``` See the full list on the [API](/plugins/github/api) page. ## Query synced data Search synced repositories without hitting GitHub. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.github.db.repositories.search({ data: {}, limit: 50, }); ``` Synced entities: `branches`, `comments`, `discussions`, `events`, `forks`, `issues`, `pullRequests`, `releases`, `repositories`, `users`, `workflows`. See [Database](/plugins/github/database) for filters and operators. ## Webhooks Fires when a GitHub issue is opened. ```ts theme={null} github({ webhookHooks: { issue: { opened: { after: async (ctx, result) => { console.log('GitHub issue opened:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/github/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/github/api)** > > Every `github.api.*` operation with input and output types. > **[Database](/plugins/github/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/github/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/github/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/github/webhooks GitHub incoming webhooks: event paths, payloads, and response data. The GitHub plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/github/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `branch` * `created` (`branch.created`) * `deleted` (`branch.deleted`) * `checkRun` * `completed` (`checkRun.completed`) * `created` (`checkRun.created`) * `rerequested` (`checkRun.rerequested`) * `checkSuite` * `completed` (`checkSuite.completed`) * `requested` (`checkSuite.requested`) * `comment` * `created` (`comment.created`) * `deleted` (`comment.deleted`) * `edited` (`comment.edited`) * `dependabotAlert` * `autoDismissed` (`dependabotAlert.autoDismissed`) * `autoReopened` (`dependabotAlert.autoReopened`) * `created` (`dependabotAlert.created`) * `dismissed` (`dependabotAlert.dismissed`) * `fixed` (`dependabotAlert.fixed`) * `reopened` (`dependabotAlert.reopened`) * `deployment` * `created` (`deployment.created`) * `deploymentStatus` * `created` (`deploymentStatus.created`) * `discussion` * `answered` (`discussion.answered`) * `closed` (`discussion.closed`) * `created` (`discussion.created`) * `deleted` (`discussion.deleted`) * `edited` (`discussion.edited`) * `reopened` (`discussion.reopened`) * `discussionComment` * `created` (`discussionComment.created`) * `deleted` (`discussionComment.deleted`) * `edited` (`discussionComment.edited`) * `fork` * `forked` (`fork.forked`) * `issue` * `assigned` (`issue.assigned`) * `closed` (`issue.closed`) * `deleted` (`issue.deleted`) * `edited` (`issue.edited`) * `labeled` (`issue.labeled`) * `locked` (`issue.locked`) * `opened` (`issue.opened`) * `pinned` (`issue.pinned`) * `reopened` (`issue.reopened`) * `transferred` (`issue.transferred`) * `unassigned` (`issue.unassigned`) * `unlabeled` (`issue.unlabeled`) * `unlocked` (`issue.unlocked`) * `unpinned` (`issue.unpinned`) * `label` * `created` (`label.created`) * `deleted` (`label.deleted`) * `edited` (`label.edited`) * `member` * `added` (`member.added`) * `removed` (`member.removed`) * `membership` * `added` (`membership.added`) * `removed` (`membership.removed`) * `milestone` * `closed` (`milestone.closed`) * `created` (`milestone.created`) * `deleted` (`milestone.deleted`) * `edited` (`milestone.edited`) * `opened` (`milestone.opened`) * `pullRequest` * `closed` (`pullRequest.closed`) * `convertedToDraft` (`pullRequest.convertedToDraft`) * `labeled` (`pullRequest.labeled`) * `opened` (`pullRequest.opened`) * `readyForReview` (`pullRequest.readyForReview`) * `reopened` (`pullRequest.reopened`) * `reviewRequested` (`pullRequest.reviewRequested`) * `synchronize` (`pullRequest.synchronize`) * `unlabeled` (`pullRequest.unlabeled`) * `pullRequestReview` * `dismissed` (`pullRequestReview.dismissed`) * `edited` (`pullRequestReview.edited`) * `submitted` (`pullRequestReview.submitted`) * `pullRequestReviewComment` * `created` (`pullRequestReviewComment.created`) * `deleted` (`pullRequestReviewComment.deleted`) * `edited` (`pullRequestReviewComment.edited`) * `pullRequestReviewThread` * `resolved` (`pullRequestReviewThread.resolved`) * `unresolved` (`pullRequestReviewThread.unresolved`) * `push` (`push`) * `release` * `created` (`release.created`) * `deleted` (`release.deleted`) * `edited` (`release.edited`) * `prereleased` (`release.prereleased`) * `published` (`release.published`) * `released` (`release.released`) * `unpublished` (`release.unpublished`) * `repository` * `archived` (`repository.archived`) * `created` (`repository.created`) * `deleted` (`repository.deleted`) * `privatized` (`repository.privatized`) * `publicized` (`repository.publicized`) * `renamed` (`repository.renamed`) * `transferred` (`repository.transferred`) * `unarchived` (`repository.unarchived`) * `star` * `created` (`star.created`) * `deleted` (`star.deleted`) * `tag` * `created` (`tag.created`) * `deleted` (`tag.deleted`) * `watch` * `started` (`watch.started`) * `workflowDispatch` * `dispatched` (`workflowDispatch.dispatched`) * `workflowJob` * `completed` (`workflowJob.completed`) * `inProgress` (`workflowJob.inProgress`) * `queued` (`workflowJob.queued`) * `waiting` (`workflowJob.waiting`) * `workflowRun` * `completed` (`workflowRun.completed`) * `inProgress` (`workflowRun.inProgress`) * `requested` (`workflowRun.requested`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Branch ### Created `branch.created` A branch was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `ref_type` | `branch` | Yes | — | | `master_branch` | `string` | Yes | — | | `description` | `string` | No | — | | `pusher_type` | `string` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > ref: string, > ref_type: branch, > master_branch: string, > description?: string | null, > pusher_type: string, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { branch: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `branch.deleted` A branch was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `ref_type` | `branch` | Yes | — | | `pusher_type` | `string` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > ref: string, > ref_type: branch, > pusher_type: string, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { branch: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Check Run ### Completed `checkRun.completed` A check run completed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `completed` | Yes | — | | `check_run` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **check\_run full type** > > ```ts theme={null} > { > id: number, > node_id: string, > head_sha: string, > external_id?: string | null, > url: string, > html_url?: string | null, > details_url?: string | null, > status: queued | in_progress | completed, > conclusion?: string | null, > started_at?: string | null, > completed_at?: string | null, > name: string, > check_suite?: { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string > } | null, > app?: any | null, > pull_requests: any[] > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: completed, > check_run: { > id: number, > node_id: string, > head_sha: string, > external_id?: string | null, > url: string, > html_url?: string | null, > details_url?: string | null, > status: queued | in_progress | completed, > conclusion?: string | null, > started_at?: string | null, > completed_at?: string | null, > name: string, > check_suite?: { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string > } | null, > app?: any | null, > pull_requests: any[] > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { checkRun: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `checkRun.created` A check run was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `check_run` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **check\_run full type** > > ```ts theme={null} > { > id: number, > node_id: string, > head_sha: string, > external_id?: string | null, > url: string, > html_url?: string | null, > details_url?: string | null, > status: queued | in_progress | completed, > conclusion?: string | null, > started_at?: string | null, > completed_at?: string | null, > name: string, > check_suite?: { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string > } | null, > app?: any | null, > pull_requests: any[] > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > check_run: { > id: number, > node_id: string, > head_sha: string, > external_id?: string | null, > url: string, > html_url?: string | null, > details_url?: string | null, > status: queued | in_progress | completed, > conclusion?: string | null, > started_at?: string | null, > completed_at?: string | null, > name: string, > check_suite?: { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string > } | null, > app?: any | null, > pull_requests: any[] > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { checkRun: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Rerequested `checkRun.rerequested` A check run was re-requested **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `rerequested` | Yes | — | | `check_run` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **check\_run full type** > > ```ts theme={null} > { > id: number, > node_id: string, > head_sha: string, > external_id?: string | null, > url: string, > html_url?: string | null, > details_url?: string | null, > status: queued | in_progress | completed, > conclusion?: string | null, > started_at?: string | null, > completed_at?: string | null, > name: string, > check_suite?: { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string > } | null, > app?: any | null, > pull_requests: any[] > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: rerequested, > check_run: { > id: number, > node_id: string, > head_sha: string, > external_id?: string | null, > url: string, > html_url?: string | null, > details_url?: string | null, > status: queued | in_progress | completed, > conclusion?: string | null, > started_at?: string | null, > completed_at?: string | null, > name: string, > check_suite?: { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string > } | null, > app?: any | null, > pull_requests: any[] > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { checkRun: { rerequested: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Check Suite ### Completed `checkSuite.completed` A check suite completed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `completed` | Yes | — | | `check_suite` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **check\_suite full type** > > ```ts theme={null} > { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string, > before?: string | null, > after?: string | null, > pull_requests: any[], > created_at: string, > updated_at: string, > app?: any | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: completed, > check_suite: { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string, > before?: string | null, > after?: string | null, > pull_requests: any[], > created_at: string, > updated_at: string, > app?: any | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { checkSuite: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Requested `checkSuite.requested` A check suite was requested **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `requested` | Yes | — | | `check_suite` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **check\_suite full type** > > ```ts theme={null} > { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string, > before?: string | null, > after?: string | null, > pull_requests: any[], > created_at: string, > updated_at: string, > app?: any | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: requested, > check_suite: { > id: number, > node_id: string, > head_branch?: string | null, > head_sha: string, > status?: string | null, > conclusion?: string | null, > url: string, > before?: string | null, > after?: string | null, > pull_requests: any[], > created_at: string, > updated_at: string, > app?: any | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { checkSuite: { requested: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Comment ### Created `comment.created` A comment was added to an issue or pull request **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `issue` | `object` | Yes | — | | `comment` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **comment full type** > > ```ts theme={null} > { > url: string, > html_url: string, > issue_url: string, > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > author_association: string, > body: string > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > comment: { > url: string, > html_url: string, > issue_url: string, > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > author_association: string, > body: string > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { comment: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `comment.deleted` A comment on an issue or pull request was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `issue` | `object` | Yes | — | | `comment` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **comment full type** > > ```ts theme={null} > { > url: string, > html_url: string, > issue_url: string, > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > author_association: string, > body: string > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > comment: { > url: string, > html_url: string, > issue_url: string, > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > author_association: string, > body: string > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { comment: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Edited `comment.edited` A comment on an issue or pull request was edited **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `edited` | Yes | — | | `issue` | `object` | Yes | — | | `comment` | `object` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **comment full type** > > ```ts theme={null} > { > url: string, > html_url: string, > issue_url: string, > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > author_association: string, > body: string > } > ``` > **changes full type** > > ```ts theme={null} > { > body?: { > from: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: edited, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > comment: { > url: string, > html_url: string, > issue_url: string, > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > author_association: string, > body: string > }, > changes?: { > body?: { > from: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { comment: { edited: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Dependabot Alert ### Auto Dismissed `dependabotAlert.autoDismissed` A Dependabot alert was auto-dismissed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `auto_dismissed` | Yes | — | | `alert` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **alert full type** > > ```ts theme={null} > { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: auto_dismissed, > alert: { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { dependabotAlert: { autoDismissed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Auto Reopened `dependabotAlert.autoReopened` A Dependabot alert was auto-reopened **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `auto_reopened` | Yes | — | | `alert` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **alert full type** > > ```ts theme={null} > { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: auto_reopened, > alert: { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { dependabotAlert: { autoReopened: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `dependabotAlert.created` A Dependabot alert was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `alert` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **alert full type** > > ```ts theme={null} > { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > alert: { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { dependabotAlert: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Dismissed `dependabotAlert.dismissed` A Dependabot alert was dismissed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `dismissed` | Yes | — | | `alert` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **alert full type** > > ```ts theme={null} > { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: dismissed, > alert: { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { dependabotAlert: { dismissed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Fixed `dependabotAlert.fixed` A Dependabot alert was fixed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `fixed` | Yes | — | | `alert` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **alert full type** > > ```ts theme={null} > { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: fixed, > alert: { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { dependabotAlert: { fixed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Reopened `dependabotAlert.reopened` A Dependabot alert was reopened **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `reopened` | Yes | — | | `alert` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **alert full type** > > ```ts theme={null} > { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: reopened, > alert: { > number: number, > state: string, > dependency: { > package: { > ecosystem: string, > name: string > }, > manifest_path: string, > scope?: string | null > }, > security_advisory: { > ghsa_id: string, > cve_id?: string | null, > summary: string, > description: string, > severity: string, > identifiers: { > value: string, > type: string > }[], > references: { > url: string > }[], > published_at: string, > updated_at: string, > withdrawn_at?: string | null > }, > security_vulnerability: { > package: { > ecosystem: string, > name: string > }, > severity: string, > vulnerable_version_range: string, > first_patched_version?: { > identifier: string > } | null > }, > url: string, > html_url: string, > created_at: string, > updated_at: string, > dismissed_at?: string | null, > dismissed_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > dismissed_reason?: string | null, > dismissed_comment?: string | null, > fixed_at?: string | null, > auto_dismissed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { dependabotAlert: { reopened: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Deployment ### Created `deployment.created` A deployment was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `deployment` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **deployment full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > sha: string, > ref: string, > task: string, > environment: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > created_at: string, > updated_at: string, > statuses_url: string, > repository_url: string, > performed_via_github_app?: any | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > deployment: { > url: string, > id: number, > node_id: string, > sha: string, > ref: string, > task: string, > environment: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > created_at: string, > updated_at: string, > statuses_url: string, > repository_url: string, > performed_via_github_app?: any | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { deployment: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Deployment Status ### Created `deploymentStatus.created` A deployment status was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `deployment` | `object` | Yes | — | | `deployment_status` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **deployment full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > sha: string, > ref: string, > task: string, > environment: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > created_at: string, > updated_at: string, > statuses_url: string, > repository_url: string, > performed_via_github_app?: any | null > } > ``` > **deployment\_status full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > state: error | failure | inactive | in_progress | queued | pending | success | waiting, > creator: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > description?: string | null, > environment?: string, > target_url?: string | null, > created_at: string, > updated_at: string, > deployment_url: string, > repository_url: string > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > deployment: { > url: string, > id: number, > node_id: string, > sha: string, > ref: string, > task: string, > environment: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > created_at: string, > updated_at: string, > statuses_url: string, > repository_url: string, > performed_via_github_app?: any | null > }, > deployment_status: { > url: string, > id: number, > node_id: string, > state: error | failure | inactive | in_progress | queued | pending | success | waiting, > creator: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > description?: string | null, > environment?: string, > target_url?: string | null, > created_at: string, > updated_at: string, > deployment_url: string, > repository_url: string > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { deploymentStatus: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Discussion ### Answered `discussion.answered` A discussion was answered **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `answered` | Yes | — | | `discussion` | `object` | Yes | — | | `answer` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **discussion full type** > > ```ts theme={null} > { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > } > ``` > **answer full type** > > ```ts theme={null} > { > id: number, > node_id: string, > html_url: string, > parent_id?: number | null, > child_comment_count: number, > repository_url: string, > discussion_id: number, > author_association: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > body: string > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: answered, > discussion: { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > }, > answer: { > id: number, > node_id: string, > html_url: string, > parent_id?: number | null, > child_comment_count: number, > repository_url: string, > discussion_id: number, > author_association: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > body: string > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { discussion: { answered: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Closed `discussion.closed` A discussion was closed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `closed` | Yes | — | | `discussion` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **discussion full type** > > ```ts theme={null} > { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: closed, > discussion: { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { discussion: { closed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `discussion.created` A discussion was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `discussion` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **discussion full type** > > ```ts theme={null} > { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > discussion: { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { discussion: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `discussion.deleted` A discussion was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `discussion` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **discussion full type** > > ```ts theme={null} > { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > discussion: { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { discussion: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Edited `discussion.edited` A discussion was edited **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `edited` | Yes | — | | `discussion` | `object` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **discussion full type** > > ```ts theme={null} > { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > } > ``` > **changes full type** > > ```ts theme={null} > { > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: edited, > discussion: { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > }, > changes?: { > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { discussion: { edited: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Reopened `discussion.reopened` A discussion was reopened **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `reopened` | Yes | — | | `discussion` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **discussion full type** > > ```ts theme={null} > { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: reopened, > discussion: { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { discussion: { reopened: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Discussion Comment ### Created `discussionComment.created` A discussion comment was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `discussion` | `object` | Yes | — | | `comment` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **discussion full type** > > ```ts theme={null} > { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > } > ``` > **comment full type** > > ```ts theme={null} > { > id: number, > node_id: string, > html_url: string, > parent_id?: number | null, > child_comment_count: number, > repository_url: string, > discussion_id: number, > author_association: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > body: string > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > discussion: { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > }, > comment: { > id: number, > node_id: string, > html_url: string, > parent_id?: number | null, > child_comment_count: number, > repository_url: string, > discussion_id: number, > author_association: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > body: string > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { discussionComment: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `discussionComment.deleted` A discussion comment was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `discussion` | `object` | Yes | — | | `comment` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **discussion full type** > > ```ts theme={null} > { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > } > ``` > **comment full type** > > ```ts theme={null} > { > id: number, > node_id: string, > html_url: string, > parent_id?: number | null, > child_comment_count: number, > repository_url: string, > discussion_id: number, > author_association: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > body: string > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > discussion: { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > }, > comment: { > id: number, > node_id: string, > html_url: string, > parent_id?: number | null, > child_comment_count: number, > repository_url: string, > discussion_id: number, > author_association: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > body: string > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { discussionComment: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Edited `discussionComment.edited` A discussion comment was edited **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `edited` | Yes | — | | `discussion` | `object` | Yes | — | | `comment` | `object` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **discussion full type** > > ```ts theme={null} > { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > } > ``` > **comment full type** > > ```ts theme={null} > { > id: number, > node_id: string, > html_url: string, > parent_id?: number | null, > child_comment_count: number, > repository_url: string, > discussion_id: number, > author_association: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > body: string > } > ``` > **changes full type** > > ```ts theme={null} > { > body?: { > from: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: edited, > discussion: { > repository_url: string, > category: { > id: number, > node_id: string, > repository_id: number, > emoji: string, > name: string, > description: string, > created_at: string, > updated_at: string, > slug: string, > is_answerable: boolean > }, > answer_html_url?: string | null, > answer_chosen_at?: string | null, > answer_chosen_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > state: string, > locked: boolean, > comments: number, > created_at: string, > updated_at: string, > author_association: string, > active_lock_reason?: string | null, > body?: string | null > }, > comment: { > id: number, > node_id: string, > html_url: string, > parent_id?: number | null, > child_comment_count: number, > repository_url: string, > discussion_id: number, > author_association: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > created_at: string, > updated_at: string, > body: string > }, > changes?: { > body?: { > from: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { discussionComment: { edited: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Fork ### Forked `fork.forked` A repository was forked **Payload** | Name | Type | Required | Description | | - | - | - | - | | `forkee` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **forkee full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > forkee: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { fork: { forked: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Issue ### Assigned `issue.assigned` An issue was assigned **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `assigned` | Yes | — | | `issue` | `object` | Yes | — | | `assignee` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **assignee full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: assigned, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { assigned: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Closed `issue.closed` An issue was closed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `closed` | Yes | — | | `issue` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: closed, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { closed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `issue.deleted` An issue was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `issue` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Edited `issue.edited` An issue was edited **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `edited` | Yes | — | | `issue` | `object` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **changes full type** > > ```ts theme={null} > { > title?: { > from: string > }, > body?: { > from: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: edited, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > changes?: { > title?: { > from: string > }, > body?: { > from: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { edited: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Labeled `issue.labeled` A label was added to an issue **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `labeled` | Yes | — | | `issue` | `object` | Yes | — | | `label` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **label full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: labeled, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > label?: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { labeled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Locked `issue.locked` An issue was locked **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `locked` | Yes | — | | `issue` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: true, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: locked, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: true, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { locked: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Opened `issue.opened` An issue was opened **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `opened` | Yes | — | | `issue` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: opened, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { opened: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Pinned `issue.pinned` An issue was pinned **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `pinned` | Yes | — | | `issue` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: pinned, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { pinned: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Reopened `issue.reopened` An issue was reopened **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `reopened` | Yes | — | | `issue` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: reopened, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { reopened: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Transferred `issue.transferred` An issue was transferred to another repository **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `transferred` | Yes | — | | `issue` | `object` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **changes full type** > > ```ts theme={null} > { > new_issue?: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > new_repository?: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: transferred, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > changes?: { > new_issue?: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > new_repository?: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { transferred: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unassigned `issue.unassigned` An issue was unassigned **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `unassigned` | Yes | — | | `issue` | `object` | Yes | — | | `assignee` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **assignee full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: unassigned, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { unassigned: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unlabeled `issue.unlabeled` A label was removed from an issue **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `unlabeled` | Yes | — | | `issue` | `object` | Yes | — | | `label` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **label full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: unlabeled, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > label?: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { unlabeled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unlocked `issue.unlocked` An issue was unlocked **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `unlocked` | Yes | — | | `issue` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: false, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: unlocked, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: false, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { unlocked: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unpinned `issue.unpinned` An issue was unpinned **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `unpinned` | Yes | — | | `issue` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: unpinned, > issue: { > url: string, > repository_url: string, > html_url: string, > id: number, > node_id: string, > number: number, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > labels: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }[], > state: open | closed, > locked: boolean, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > milestone?: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } | null, > comments: number, > created_at: string, > updated_at: string, > closed_at?: string | null, > body?: string | null, > active_lock_reason?: string | null, > draft?: boolean, > pull_request?: { > url: string, > html_url: string, > diff_url: string, > patch_url: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { issue: { unpinned: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Label ### Created `label.created` A label was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `label` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **label full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > label: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { label: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `label.deleted` A label was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `label` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **label full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > label: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { label: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Edited `label.edited` A label was edited **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `edited` | Yes | — | | `label` | `object` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **label full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > } > ``` > **changes full type** > > ```ts theme={null} > { > name?: { > from: string > }, > color?: { > from: string > }, > description?: { > from: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: edited, > label: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }, > changes?: { > name?: { > from: string > }, > color?: { > from: string > }, > description?: { > from: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { label: { edited: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Member ### Added `member.added` A collaborator was added to a repository **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `added` | Yes | — | | `member` | `object` | No | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **member full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **changes full type** > > ```ts theme={null} > { > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: added, > member?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > changes?: { > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { member: { added: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Removed `member.removed` A collaborator was removed from a repository **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `removed` | Yes | — | | `member` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **member full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: removed, > member?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { member: { removed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Membership ### Added `membership.added` A user was added to a team **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `added` | Yes | — | | `scope` | `string` | Yes | — | | `member` | `object` | No | — | | `team` | `object` | Yes | — | | `organization` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | > **member full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **team full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > html_url: string, > name: string, > slug: string, > description?: string | null, > privacy: string, > permission: string, > members_url: string, > repositories_url: string, > parent?: any | null > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: added, > scope: string, > member?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > team: { > id: number, > node_id: string, > url: string, > html_url: string, > name: string, > slug: string, > description?: string | null, > privacy: string, > permission: string, > members_url: string, > repositories_url: string, > parent?: any | null > }, > organization: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { membership: { added: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Removed `membership.removed` A user was removed from a team **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `removed` | Yes | — | | `scope` | `string` | Yes | — | | `member` | `object` | No | — | | `team` | `object` | Yes | — | | `organization` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | > **member full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **team full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > html_url: string, > name: string, > slug: string, > description?: string | null, > privacy: string, > permission: string, > members_url: string, > repositories_url: string, > parent?: any | null > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: removed, > scope: string, > member?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > team: { > id: number, > node_id: string, > url: string, > html_url: string, > name: string, > slug: string, > description?: string | null, > privacy: string, > permission: string, > members_url: string, > repositories_url: string, > parent?: any | null > }, > organization: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { membership: { removed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Milestone ### Closed `milestone.closed` A milestone was closed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `closed` | Yes | — | | `milestone` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **milestone full type** > > ```ts theme={null} > { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: closed, > milestone: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { milestone: { closed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `milestone.created` A milestone was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `milestone` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **milestone full type** > > ```ts theme={null} > { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > milestone: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { milestone: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `milestone.deleted` A milestone was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `milestone` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **milestone full type** > > ```ts theme={null} > { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > milestone: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { milestone: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Edited `milestone.edited` A milestone was edited **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `edited` | Yes | — | | `milestone` | `object` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **milestone full type** > > ```ts theme={null} > { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } > ``` > **changes full type** > > ```ts theme={null} > { > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: edited, > milestone: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > }, > changes?: { > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { milestone: { edited: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Opened `milestone.opened` A milestone was opened **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `opened` | Yes | — | | `milestone` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **milestone full type** > > ```ts theme={null} > { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: opened, > milestone: { > url: string, > html_url: string, > labels_url: string, > id: number, > node_id: string, > number: number, > title: string, > description?: string | null, > creator?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > open_issues: number, > closed_issues: number, > state: open | closed, > created_at: string, > updated_at: string, > due_on?: string | null, > closed_at?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { milestone: { opened: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Pull Request ### Closed `pullRequest.closed` A pull request was closed or merged **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `closed` | Yes | — | | `number` | `number` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at: string, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged: boolean, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: closed, > number: number, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at: string, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged: boolean, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequest: { closed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Converted To Draft `pullRequest.convertedToDraft` A pull request was converted to a draft **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `converted_to_draft` | Yes | — | | `number` | `number` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: converted_to_draft, > number: number, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequest: { convertedToDraft: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Labeled `pullRequest.labeled` A label was added to a pull request **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `labeled` | Yes | — | | `number` | `number` | Yes | — | | `pull_request` | `object` | Yes | — | | `label` | `object` | No | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **label full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: labeled, > number: number, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > label?: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequest: { labeled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Opened `pullRequest.opened` A pull request was opened **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `opened` | Yes | — | | `number` | `number` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at: null, > merged_at: null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason: null, > merged_by: null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: opened, > number: number, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at: null, > merged_at: null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason: null, > merged_by: null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequest: { opened: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Ready For Review `pullRequest.readyForReview` A draft pull request was marked as ready for review **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `ready_for_review` | Yes | — | | `number` | `number` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: ready_for_review, > number: number, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequest: { readyForReview: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Reopened `pullRequest.reopened` A pull request was reopened **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `reopened` | Yes | — | | `number` | `number` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: reopened, > number: number, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequest: { reopened: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Review Requested `pullRequest.reviewRequested` A review was requested on a pull request **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `review_requested` | Yes | — | | `number` | `number` | Yes | — | | `pull_request` | `object` | Yes | — | | `requested_reviewer` | `object` | No | — | | `requested_team` | `object` | No | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **requested\_reviewer full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **requested\_team full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > html_url: string, > name: string, > slug: string, > description?: string | null, > privacy: string, > permission: string, > members_url: string, > repositories_url: string, > parent?: any | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: review_requested, > number: number, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > requested_reviewer?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > requested_team?: { > id: number, > node_id: string, > url: string, > html_url: string, > name: string, > slug: string, > description?: string | null, > privacy: string, > permission: string, > members_url: string, > repositories_url: string, > parent?: any | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequest: { reviewRequested: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Synchronize `pullRequest.synchronize` New commits were pushed to a pull request **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `synchronize` | Yes | — | | `number` | `number` | Yes | — | | `before` | `string` | Yes | — | | `after` | `string` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: synchronize, > number: number, > before: string, > after: string, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequest: { synchronize: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unlabeled `pullRequest.unlabeled` A label was removed from a pull request **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `unlabeled` | Yes | — | | `number` | `number` | Yes | — | | `pull_request` | `object` | Yes | — | | `label` | `object` | No | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **label full type** > > ```ts theme={null} > { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: unlabeled, > number: number, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > label?: { > id: number, > node_id: string, > url: string, > name: string, > color: string, > default: boolean, > description?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequest: { unlabeled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Pull Request Review ### Dismissed `pullRequestReview.dismissed` A pull request review was dismissed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `dismissed` | Yes | — | | `review` | `object` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **review full type** > > ```ts theme={null} > { > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > commit_id: string, > submitted_at?: string | null, > state: string, > html_url: string, > pull_request_url: string, > author_association: string > } > ``` > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: dismissed, > review: { > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > commit_id: string, > submitted_at?: string | null, > state: string, > html_url: string, > pull_request_url: string, > author_association: string > }, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequestReview: { dismissed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Edited `pullRequestReview.edited` A pull request review was edited **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `edited` | Yes | — | | `review` | `object` | Yes | — | | `pull_request` | `object` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **review full type** > > ```ts theme={null} > { > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > commit_id: string, > submitted_at?: string | null, > state: string, > html_url: string, > pull_request_url: string, > author_association: string > } > ``` > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **changes full type** > > ```ts theme={null} > { > body?: { > from: string > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: edited, > review: { > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > commit_id: string, > submitted_at?: string | null, > state: string, > html_url: string, > pull_request_url: string, > author_association: string > }, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > changes?: { > body?: { > from: string > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequestReview: { edited: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Submitted `pullRequestReview.submitted` A pull request review was submitted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `submitted` | Yes | — | | `review` | `object` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **review full type** > > ```ts theme={null} > { > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > commit_id: string, > submitted_at?: string | null, > state: string, > html_url: string, > pull_request_url: string, > author_association: string > } > ``` > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: submitted, > review: { > id: number, > node_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > commit_id: string, > submitted_at?: string | null, > state: string, > html_url: string, > pull_request_url: string, > author_association: string > }, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequestReview: { submitted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Pull Request Review Comment ### Created `pullRequestReviewComment.created` A comment on a pull request diff was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `comment` | `object` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **comment full type** > > ```ts theme={null} > { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > } > ``` > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > comment: { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > }, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequestReviewComment: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `pullRequestReviewComment.deleted` A comment on a pull request diff was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `comment` | `object` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **comment full type** > > ```ts theme={null} > { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > } > ``` > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > comment: { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > }, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequestReviewComment: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Edited `pullRequestReviewComment.edited` A comment on a pull request diff was edited **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `edited` | Yes | — | | `comment` | `object` | Yes | — | | `changes` | `object` | No | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **comment full type** > > ```ts theme={null} > { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > } > ``` > **changes full type** > > ```ts theme={null} > { > body?: { > from: string > } > } > ``` > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: edited, > comment: { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > }, > changes?: { > body?: { > from: string > } > }, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequestReviewComment: { edited: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Pull Request Review Thread ### Resolved `pullRequestReviewThread.resolved` A pull request review thread was resolved **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `resolved` | Yes | — | | `thread` | `object` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **thread full type** > > ```ts theme={null} > { > node_id: string, > comments: { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > }[] > } > ``` > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: resolved, > thread: { > node_id: string, > comments: { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > }[] > }, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequestReviewThread: { resolved: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unresolved `pullRequestReviewThread.unresolved` A pull request review thread was unresolved **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `unresolved` | Yes | — | | `thread` | `object` | Yes | — | | `pull_request` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | | `sender` | `object` | Yes | — | > **thread full type** > > ```ts theme={null} > { > node_id: string, > comments: { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > }[] > } > ``` > **pull\_request full type** > > ```ts theme={null} > { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: unresolved, > thread: { > node_id: string, > comments: { > url: string, > pull_request_review_id?: number | null, > id: number, > node_id: string, > diff_hunk: string, > path: string, > position?: number | null, > original_position?: number | null, > commit_id: string, > original_commit_id: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body: string, > created_at: string, > updated_at: string, > html_url: string, > pull_request_url: string, > author_association: string > }[] > }, > pull_request: { > url: string, > id: number, > node_id: string, > html_url: string, > diff_url: string, > patch_url: string, > issue_url: string, > number: number, > state: open | closed, > locked: boolean, > title: string, > user: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > created_at: string, > updated_at: string, > closed_at?: string | null, > merged_at?: string | null, > merge_commit_sha?: string | null, > assignee?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > assignees: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }[], > draft?: boolean, > merged?: boolean | null, > mergeable?: boolean | null, > comments: number, > review_comments: number, > commits: number, > additions: number, > deletions: number, > changed_files: number, > active_lock_reason?: string | null, > merged_by?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { pullRequestReviewThread: { unresolved: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Push ### Push `push` Commits were pushed to a branch **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `before` | `string` | Yes | — | | `after` | `string` | Yes | — | | `created` | `boolean` | Yes | — | | `deleted` | `boolean` | Yes | — | | `forced` | `boolean` | Yes | — | | `base_ref` | `string` | No | — | | `compare` | `string` | Yes | — | | `commits` | `object[]` | Yes | — | | `head_commit` | `object` | No | — | | `repository` | `object` | Yes | — | | `pusher` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **commits full type** > > ```ts theme={null} > { > id: string, > tree_id: string, > distinct: boolean, > message: string, > timestamp: string, > url: string, > author: { > name: string, > email?: string | null, > username?: string, > date?: string > }, > committer: { > name: string, > email?: string | null, > username?: string, > date?: string > }, > added: string[], > modified: string[], > removed: string[] > }[] > ``` > **head\_commit full type** > > ```ts theme={null} > { > id: string, > tree_id: string, > distinct: boolean, > message: string, > timestamp: string, > url: string, > author: { > name: string, > email?: string | null, > username?: string, > date?: string > }, > committer: { > name: string, > email?: string | null, > username?: string, > date?: string > }, > added: string[], > modified: string[], > removed: string[] > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **pusher full type** > > ```ts theme={null} > { > name: string, > email?: string | null, > username?: string, > date?: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > ref: string, > before: string, > after: string, > created: boolean, > deleted: boolean, > forced: boolean, > base_ref?: string | null, > compare: string, > commits: { > id: string, > tree_id: string, > distinct: boolean, > message: string, > timestamp: string, > url: string, > author: { > name: string, > email?: string | null, > username?: string, > date?: string > }, > committer: { > name: string, > email?: string | null, > username?: string, > date?: string > }, > added: string[], > modified: string[], > removed: string[] > }[], > head_commit?: { > id: string, > tree_id: string, > distinct: boolean, > message: string, > timestamp: string, > url: string, > author: { > name: string, > email?: string | null, > username?: string, > date?: string > }, > committer: { > name: string, > email?: string | null, > username?: string, > date?: string > }, > added: string[], > modified: string[], > removed: string[] > } | null, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > pusher: { > name: string, > email?: string | null, > username?: string, > date?: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { push: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Release ### Created `release.created` A release draft was saved **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `release` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **release full type** > > ```ts theme={null} > { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > release: { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { release: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `release.deleted` A release was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `release` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **release full type** > > ```ts theme={null} > { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > release: { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { release: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Edited `release.edited` A release was edited **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `edited` | Yes | — | | `release` | `object` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **release full type** > > ```ts theme={null} > { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > } > ``` > **changes full type** > > ```ts theme={null} > { > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: edited, > release: { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > }, > changes?: { > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { release: { edited: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Prereleased `release.prereleased` A pre-release was published **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `prereleased` | Yes | — | | `release` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **release full type** > > ```ts theme={null} > { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: prereleased, > release: { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { release: { prereleased: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Published `release.published` A release was published **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `published` | Yes | — | | `release` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **release full type** > > ```ts theme={null} > { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: published, > release: { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { release: { published: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Released `release.released` A release was released **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `released` | Yes | — | | `release` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **release full type** > > ```ts theme={null} > { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: released, > release: { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { release: { released: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unpublished `release.unpublished` A release was unpublished **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `unpublished` | Yes | — | | `release` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **release full type** > > ```ts theme={null} > { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: unpublished, > release: { > url: string, > assets_url: string, > upload_url: string, > html_url: string, > id: number, > node_id: string, > tag_name: string, > target_commitish: string, > name?: string | null, > draft: boolean, > prerelease: boolean, > created_at: string, > published_at?: string | null, > author: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > body?: string | null, > tarball_url?: string | null, > zipball_url?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { release: { unpublished: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Repository ### Archived `repository.archived` A repository was archived **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `archived` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: archived, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { repository: { archived: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `repository.created` A repository was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { repository: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `repository.deleted` A repository was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { repository: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Privatized `repository.privatized` A repository was made private **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `privatized` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: privatized, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { repository: { privatized: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Publicized `repository.publicized` A repository was made public **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `publicized` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: publicized, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { repository: { publicized: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Renamed `repository.renamed` A repository was renamed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `renamed` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **changes full type** > > ```ts theme={null} > { > repository?: { > name: { > from: string > } > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: renamed, > changes?: { > repository?: { > name: { > from: string > } > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { repository: { renamed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Transferred `repository.transferred` A repository was transferred **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `transferred` | Yes | — | | `changes` | `object` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **changes full type** > > ```ts theme={null} > { > owner?: { > from: { > user?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > } > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: transferred, > changes?: { > owner?: { > from: { > user?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > } > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { repository: { transferred: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unarchived `repository.unarchived` A repository was unarchived **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `unarchived` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: unarchived, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { repository: { unarchived: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Star ### Created `star.created` A repository was starred **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `starred_at` | `string` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `organization` | `object` | No | — | | `installation` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > starred_at: string, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > installation?: { > id: number, > node_id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { star: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `star.deleted` A star was removed from a repository **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `starred_at` | `null` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `organization` | `object` | No | — | | `installation` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > starred_at: null, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > }, > installation?: { > id: number, > node_id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { star: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Tag ### Created `tag.created` A tag was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `ref_type` | `tag` | Yes | — | | `master_branch` | `string` | Yes | — | | `description` | `string` | No | — | | `pusher_type` | `string` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > ref: string, > ref_type: tag, > master_branch: string, > description?: string | null, > pusher_type: string, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { tag: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `tag.deleted` A tag was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `ref_type` | `tag` | Yes | — | | `pusher_type` | `string` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > ref: string, > ref_type: tag, > pusher_type: string, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { tag: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Watch ### Started `watch.started` A user started watching a repository **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `started` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: started, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { watch: { started: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Workflow Dispatch ### Dispatched `workflowDispatch.dispatched` A workflow was manually triggered **Payload** | Name | Type | Required | Description | | - | - | - | - | | `inputs` | `object` | No | — | | `ref` | `string` | Yes | — | | `workflow` | `string` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **inputs full type** > > ```ts theme={null} > { > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > inputs?: { > } | null, > ref: string, > workflow: string, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { workflowDispatch: { dispatched: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Workflow Job ### Completed `workflowJob.completed` A workflow job completed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `completed` | Yes | — | | `workflow_job` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **workflow\_job full type** > > ```ts theme={null} > { > id: number, > run_id: number, > run_url: string, > node_id: string, > head_sha: string, > url: string, > html_url: string, > status: queued | in_progress | completed | waiting, > conclusion?: string | null, > started_at: string, > completed_at?: string | null, > name: string, > steps: { > name: string, > status: string, > conclusion?: string | null, > number: number, > started_at?: string | null, > completed_at?: string | null > }[], > runner_id?: number | null, > runner_name?: string | null, > runner_group_id?: number | null, > runner_group_name?: string | null, > workflow_name?: string | null, > head_branch?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: completed, > workflow_job: { > id: number, > run_id: number, > run_url: string, > node_id: string, > head_sha: string, > url: string, > html_url: string, > status: queued | in_progress | completed | waiting, > conclusion?: string | null, > started_at: string, > completed_at?: string | null, > name: string, > steps: { > name: string, > status: string, > conclusion?: string | null, > number: number, > started_at?: string | null, > completed_at?: string | null > }[], > runner_id?: number | null, > runner_name?: string | null, > runner_group_id?: number | null, > runner_group_name?: string | null, > workflow_name?: string | null, > head_branch?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { workflowJob: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### In Progress `workflowJob.inProgress` A workflow job started **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `in_progress` | Yes | — | | `workflow_job` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **workflow\_job full type** > > ```ts theme={null} > { > id: number, > run_id: number, > run_url: string, > node_id: string, > head_sha: string, > url: string, > html_url: string, > status: queued | in_progress | completed | waiting, > conclusion?: string | null, > started_at: string, > completed_at?: string | null, > name: string, > steps: { > name: string, > status: string, > conclusion?: string | null, > number: number, > started_at?: string | null, > completed_at?: string | null > }[], > runner_id?: number | null, > runner_name?: string | null, > runner_group_id?: number | null, > runner_group_name?: string | null, > workflow_name?: string | null, > head_branch?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: in_progress, > workflow_job: { > id: number, > run_id: number, > run_url: string, > node_id: string, > head_sha: string, > url: string, > html_url: string, > status: queued | in_progress | completed | waiting, > conclusion?: string | null, > started_at: string, > completed_at?: string | null, > name: string, > steps: { > name: string, > status: string, > conclusion?: string | null, > number: number, > started_at?: string | null, > completed_at?: string | null > }[], > runner_id?: number | null, > runner_name?: string | null, > runner_group_id?: number | null, > runner_group_name?: string | null, > workflow_name?: string | null, > head_branch?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { workflowJob: { inProgress: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Queued `workflowJob.queued` A workflow job was queued **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `queued` | Yes | — | | `workflow_job` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **workflow\_job full type** > > ```ts theme={null} > { > id: number, > run_id: number, > run_url: string, > node_id: string, > head_sha: string, > url: string, > html_url: string, > status: queued | in_progress | completed | waiting, > conclusion?: string | null, > started_at: string, > completed_at?: string | null, > name: string, > steps: { > name: string, > status: string, > conclusion?: string | null, > number: number, > started_at?: string | null, > completed_at?: string | null > }[], > runner_id?: number | null, > runner_name?: string | null, > runner_group_id?: number | null, > runner_group_name?: string | null, > workflow_name?: string | null, > head_branch?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: queued, > workflow_job: { > id: number, > run_id: number, > run_url: string, > node_id: string, > head_sha: string, > url: string, > html_url: string, > status: queued | in_progress | completed | waiting, > conclusion?: string | null, > started_at: string, > completed_at?: string | null, > name: string, > steps: { > name: string, > status: string, > conclusion?: string | null, > number: number, > started_at?: string | null, > completed_at?: string | null > }[], > runner_id?: number | null, > runner_name?: string | null, > runner_group_id?: number | null, > runner_group_name?: string | null, > workflow_name?: string | null, > head_branch?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { workflowJob: { queued: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Waiting `workflowJob.waiting` A workflow job is waiting for approval **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `waiting` | Yes | — | | `workflow_job` | `object` | Yes | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **workflow\_job full type** > > ```ts theme={null} > { > id: number, > run_id: number, > run_url: string, > node_id: string, > head_sha: string, > url: string, > html_url: string, > status: queued | in_progress | completed | waiting, > conclusion?: string | null, > started_at: string, > completed_at?: string | null, > name: string, > steps: { > name: string, > status: string, > conclusion?: string | null, > number: number, > started_at?: string | null, > completed_at?: string | null > }[], > runner_id?: number | null, > runner_name?: string | null, > runner_group_id?: number | null, > runner_group_name?: string | null, > workflow_name?: string | null, > head_branch?: string | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: waiting, > workflow_job: { > id: number, > run_id: number, > run_url: string, > node_id: string, > head_sha: string, > url: string, > html_url: string, > status: queued | in_progress | completed | waiting, > conclusion?: string | null, > started_at: string, > completed_at?: string | null, > name: string, > steps: { > name: string, > status: string, > conclusion?: string | null, > number: number, > started_at?: string | null, > completed_at?: string | null > }[], > runner_id?: number | null, > runner_name?: string | null, > runner_group_id?: number | null, > runner_group_name?: string | null, > workflow_name?: string | null, > head_branch?: string | null > }, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { workflowJob: { waiting: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Workflow Run ### Completed `workflowRun.completed` A workflow run completed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `completed` | Yes | — | | `workflow_run` | `object` | Yes | — | | `workflow` | `any` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **workflow\_run full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > node_id: string, > head_branch?: string | null, > head_sha: string, > run_number: number, > event: string, > status?: string | null, > conclusion?: string | null, > workflow_id: number, > url: string, > html_url: string, > pull_requests: any[], > created_at: string, > updated_at: string, > run_attempt?: number, > run_started_at?: string, > triggering_actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: completed, > workflow_run: { > id: number, > name?: string | null, > node_id: string, > head_branch?: string | null, > head_sha: string, > run_number: number, > event: string, > status?: string | null, > conclusion?: string | null, > workflow_id: number, > url: string, > html_url: string, > pull_requests: any[], > created_at: string, > updated_at: string, > run_attempt?: number, > run_started_at?: string, > triggering_actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > workflow?: any | null, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { workflowRun: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### In Progress `workflowRun.inProgress` A workflow run started **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `in_progress` | Yes | — | | `workflow_run` | `object` | Yes | — | | `workflow` | `any` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **workflow\_run full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > node_id: string, > head_branch?: string | null, > head_sha: string, > run_number: number, > event: string, > status?: string | null, > conclusion?: string | null, > workflow_id: number, > url: string, > html_url: string, > pull_requests: any[], > created_at: string, > updated_at: string, > run_attempt?: number, > run_started_at?: string, > triggering_actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: in_progress, > workflow_run: { > id: number, > name?: string | null, > node_id: string, > head_branch?: string | null, > head_sha: string, > run_number: number, > event: string, > status?: string | null, > conclusion?: string | null, > workflow_id: number, > url: string, > html_url: string, > pull_requests: any[], > created_at: string, > updated_at: string, > run_attempt?: number, > run_started_at?: string, > triggering_actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > workflow?: any | null, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { workflowRun: { inProgress: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Requested `workflowRun.requested` A workflow run was requested **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `requested` | Yes | — | | `workflow_run` | `object` | Yes | — | | `workflow` | `any` | No | — | | `repository` | `object` | Yes | — | | `sender` | `object` | Yes | — | | `installation` | `object` | No | — | | `organization` | `object` | No | — | > **workflow\_run full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > node_id: string, > head_branch?: string | null, > head_sha: string, > run_number: number, > event: string, > status?: string | null, > conclusion?: string | null, > workflow_id: number, > url: string, > html_url: string, > pull_requests: any[], > created_at: string, > updated_at: string, > run_attempt?: number, > run_started_at?: string, > triggering_actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > } > ``` > **repository full type** > > ```ts theme={null} > { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > } > ``` > **sender full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } > ``` > **installation full type** > > ```ts theme={null} > { > id: number, > node_id: string > } > ``` > **organization full type** > > ```ts theme={null} > { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: requested, > workflow_run: { > id: number, > name?: string | null, > node_id: string, > head_branch?: string | null, > head_sha: string, > run_number: number, > event: string, > status?: string | null, > conclusion?: string | null, > workflow_id: number, > url: string, > html_url: string, > pull_requests: any[], > created_at: string, > updated_at: string, > run_attempt?: number, > run_started_at?: string, > triggering_actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null, > actor?: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > } | null > }, > workflow?: any | null, > repository: { > id: number, > node_id: string, > name: string, > full_name: string, > private: boolean, > owner: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > html_url: string, > description?: string | null, > fork: boolean, > url: string, > created_at: number | string, > updated_at: string, > pushed_at?: number | string | null, > default_branch: string > }, > sender: { > login: string, > id: number, > node_id: string, > name?: string, > email?: string | null, > avatar_url: string, > gravatar_id: string, > url: string, > html_url: string, > followers_url: string, > following_url: string, > gists_url: string, > starred_url: string, > subscriptions_url: string, > organizations_url: string, > repos_url: string, > events_url: string, > received_events_url: string, > type: Bot | User | Organization, > site_admin: boolean > }, > installation?: { > id: number, > node_id: string > }, > organization?: { > login: string, > id: number, > node_id: string, > url: string, > html_url?: string, > repos_url: string, > events_url: string, > hooks_url: string, > issues_url: string, > members_url: string, > public_members_url: string, > avatar_url: string, > description?: string | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} github({ webhookHooks: { workflowRun: { requested: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/gitlab/api API reference for GitLab: every `gitlab.api.*` operation with input and output types. Every `gitlab.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Branches ### create `branches.create` Create a new branch **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.branches.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `branch` | `string` | Yes | — | | `ref` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `merged` | `boolean` | No | — | | `protected` | `boolean` | No | — | | `default` | `boolean` | No | — | | `developers_can_push` | `boolean` | No | — | | `developers_can_merge` | `boolean` | No | — | | `can_push` | `boolean` | No | — | | `web_url` | `string` | No | — | | `commit` | `object` | No | — | > **commit full type** > > ```ts theme={null} > { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > } > ``` *** ### delete `branches.delete` Delete a branch **Risk:** `destructive` ```ts theme={null} await corsair.gitlab.api.branches.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `branch` | `string` | Yes | — | **Output:** *empty object* *** ### get `branches.get` Get a specific branch **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.branches.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `branch` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `merged` | `boolean` | No | — | | `protected` | `boolean` | No | — | | `default` | `boolean` | No | — | | `developers_can_push` | `boolean` | No | — | | `developers_can_merge` | `boolean` | No | — | | `can_push` | `boolean` | No | — | | `web_url` | `string` | No | — | | `commit` | `object` | No | — | > **commit full type** > > ```ts theme={null} > { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > } > ``` *** ### list `branches.list` List branches in a repository **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.branches.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `search` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name: string, > merged?: boolean, > protected?: boolean, > default?: boolean, > developers_can_push?: boolean, > developers_can_merge?: boolean, > can_push?: boolean, > web_url?: string, > commit?: { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > } > }[] > ``` *** ## Commits ### get `commits.get` Get a specific commit **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.commits.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `sha` | `string` | Yes | — | | `stats` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `short_id` | `string` | No | — | | `title` | `string` | No | — | | `message` | `string` | No | — | | `author_name` | `string` | No | — | | `author_email` | `string` | No | — | | `authored_date` | `string` | No | — | | `committed_date` | `string` | No | — | | `committer_name` | `string` | No | — | | `committer_email` | `string` | No | — | | `parent_ids` | `string[]` | No | — | | `web_url` | `string` | No | — | | `stats` | `object` | No | — | > **stats full type** > > ```ts theme={null} > { > additions?: number, > deletions?: number, > total?: number > } > ``` *** ### getDiff `commits.getDiff` Get the diff of a commit **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.commits.getDiff({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `sha` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > old_path: string, > new_path: string, > a_mode?: string, > b_mode?: string, > diff: string, > new_file?: boolean, > renamed_file?: boolean, > deleted_file?: boolean > }[] > ``` *** ### list `commits.list` List commits in a repository **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.commits.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `ref_name` | `string` | No | — | | `since` | `string` | No | — | | `until` | `string` | No | — | | `path` | `string` | No | — | | `all` | `boolean` | No | — | | `with_stats` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > }[] > ``` *** ## Groups ### create `groups.create` Create a new group **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.groups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `path` | `string` | Yes | — | | `description` | `string` | No | — | | `visibility` | `public \| internal \| private` | No | — | | `parent_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `full_path` | `string` | No | — | | `full_name` | `string` | No | — | | `description` | `string` | No | — | | `visibility` | `string` | No | — | | `parent_id` | `number` | No | — | | `web_url` | `string` | No | — | | `created_at` | `string` | No | — | | `avatar_url` | `string` | No | — | *** ### delete `groups.delete` Delete a group \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.gitlab.api.groups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number \| string` | Yes | — | **Output:** *empty object* *** ### get `groups.get` Get a specific group **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.groups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number \| string` | Yes | — | | `with_projects` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `full_path` | `string` | No | — | | `full_name` | `string` | No | — | | `description` | `string` | No | — | | `visibility` | `string` | No | — | | `parent_id` | `number` | No | — | | `web_url` | `string` | No | — | | `created_at` | `string` | No | — | | `avatar_url` | `string` | No | — | *** ### list `groups.list` List groups **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.groups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search` | `string` | No | — | | `owned` | `boolean` | No | — | | `top_level_only` | `boolean` | No | — | | `statistics` | `boolean` | No | — | | `order_by` | `string` | No | — | | `sort` | `asc \| desc` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > path?: string, > full_path?: string, > full_name?: string, > description?: string | null, > visibility?: string, > parent_id?: number | null, > web_url?: string, > created_at?: string, > avatar_url?: string | null > }[] > ``` *** ### listProjects `groups.listProjects` List projects in a group **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.groups.listProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `group_id` | `number \| string` | Yes | — | | `search` | `string` | No | — | | `archived` | `boolean` | No | — | | `visibility` | `public \| internal \| private` | No | — | | `order_by` | `string` | No | — | | `sort` | `asc \| desc` | No | — | | `simple` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > path?: string, > path_with_namespace?: string, > description?: string | null, > default_branch?: string | null, > visibility?: string, > ssh_url_to_repo?: string, > http_url_to_repo?: string, > web_url?: string, > archived?: boolean, > created_at?: string, > last_activity_at?: string, > creator_id?: number, > namespace?: { > id: number, > name?: string, > path?: string, > kind?: string, > full_path?: string, > web_url?: string > }, > owner?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }, > star_count?: number, > forks_count?: number, > open_issues_count?: number, > topics?: string[], > empty_repo?: boolean > }[] > ``` *** ### update `groups.update` Update a group **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.groups.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `path` | `string` | No | — | | `description` | `string` | No | — | | `visibility` | `public \| internal \| private` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `full_path` | `string` | No | — | | `full_name` | `string` | No | — | | `description` | `string` | No | — | | `visibility` | `string` | No | — | | `parent_id` | `number` | No | — | | `web_url` | `string` | No | — | | `created_at` | `string` | No | — | | `avatar_url` | `string` | No | — | *** ## Issues ### create `issues.create` Create a new issue **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.issues.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | | `milestone_id` | `number` | No | — | | `labels` | `string` | No | — | | `due_date` | `string` | No | — | | `confidential` | `boolean` | No | — | | `weight` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `closed_at` | `string` | No | — | | `closed_by` | `object` | No | — | | `author` | `object` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `labels` | `string[]` | No | — | | `milestone` | `object` | No | — | | `web_url` | `string` | No | — | | `confidential` | `boolean` | No | — | | `due_date` | `string` | No | — | | `weight` | `number` | No | — | | `references` | `object` | No | — | > **closed\_by full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **milestone full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > } > ``` > **references full type** > > ```ts theme={null} > { > short?: string, > relative?: string, > full?: string > } > ``` *** ### createNote `issues.createNote` Add a comment to an issue **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.issues.createNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `issue_iid` | `number` | Yes | — | | `body` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `string` | Yes | — | | `author` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `system` | `boolean` | No | — | | `noteable_id` | `number` | No | — | | `noteable_type` | `string` | No | — | | `noteable_iid` | `number` | No | — | | `resolvable` | `boolean` | No | — | > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ### delete `issues.delete` Delete an issue \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.gitlab.api.issues.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `issue_iid` | `number` | Yes | — | **Output:** *empty object* *** ### get `issues.get` Get a specific issue **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.issues.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `issue_iid` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `closed_at` | `string` | No | — | | `closed_by` | `object` | No | — | | `author` | `object` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `labels` | `string[]` | No | — | | `milestone` | `object` | No | — | | `web_url` | `string` | No | — | | `confidential` | `boolean` | No | — | | `due_date` | `string` | No | — | | `weight` | `number` | No | — | | `references` | `object` | No | — | > **closed\_by full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **milestone full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > } > ``` > **references full type** > > ```ts theme={null} > { > short?: string, > relative?: string, > full?: string > } > ``` *** ### list `issues.list` List issues in a project **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.issues.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `state` | `opened \| closed \| all` | No | — | | `labels` | `string` | No | — | | `milestone` | `string` | No | — | | `search` | `string` | No | — | | `assignee_id` | `number` | No | — | | `author_id` | `number` | No | — | | `order_by` | `string` | No | — | | `sort` | `asc \| desc` | No | — | | `confidential` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > iid: number, > project_id: number, > title: string, > description?: string | null, > state?: string, > created_at?: string, > updated_at?: string, > closed_at?: string | null, > closed_by?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } | null, > author?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }, > assignee?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } | null, > assignees?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[], > labels?: string[], > milestone?: { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > } | null, > web_url?: string, > confidential?: boolean, > due_date?: string | null, > weight?: number | null, > references?: { > short?: string, > relative?: string, > full?: string > } > }[] > ``` *** ### listNotes `issues.listNotes` List comments on an issue **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.issues.listNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `issue_iid` | `number` | Yes | — | | `order_by` | `created_at \| updated_at` | No | — | | `sort` | `asc \| desc` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > body: string, > author?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }, > created_at?: string, > updated_at?: string, > system?: boolean, > noteable_id?: number, > noteable_type?: string, > noteable_iid?: number, > resolvable?: boolean > }[] > ``` *** ### update `issues.update` Update an existing issue **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.issues.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `issue_iid` | `number` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `assignee_ids` | `number[]` | No | — | | `milestone_id` | `number` | No | — | | `labels` | `string` | No | — | | `state_event` | `close \| reopen` | No | — | | `due_date` | `string` | No | — | | `confidential` | `boolean` | No | — | | `weight` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `closed_at` | `string` | No | — | | `closed_by` | `object` | No | — | | `author` | `object` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `labels` | `string[]` | No | — | | `milestone` | `object` | No | — | | `web_url` | `string` | No | — | | `confidential` | `boolean` | No | — | | `due_date` | `string` | No | — | | `weight` | `number` | No | — | | `references` | `object` | No | — | > **closed\_by full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **milestone full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > } > ``` > **references full type** > > ```ts theme={null} > { > short?: string, > relative?: string, > full?: string > } > ``` *** ## Labels ### create `labels.create` Create a new label **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.labels.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | Yes | — | | `description` | `string` | No | — | | `priority` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `text_color` | `string` | No | — | | `description` | `string` | No | — | | `open_issues_count` | `number` | No | — | | `closed_issues_count` | `number` | No | — | | `open_merge_requests_count` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `is_project_label` | `boolean` | No | — | *** ### delete `labels.delete` Delete a label **Risk:** `destructive` ```ts theme={null} await corsair.gitlab.api.labels.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `label_id` | `number` | Yes | — | **Output:** *empty object* *** ### list `labels.list` List labels in a project **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.labels.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `search` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > color?: string, > text_color?: string, > description?: string | null, > open_issues_count?: number, > closed_issues_count?: number, > open_merge_requests_count?: number, > subscribed?: boolean, > is_project_label?: boolean > }[] > ``` *** ### update `labels.update` Update a label **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.labels.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `label_id` | `number` | Yes | — | | `new_name` | `string` | No | — | | `color` | `string` | No | — | | `description` | `string` | No | — | | `priority` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `text_color` | `string` | No | — | | `description` | `string` | No | — | | `open_issues_count` | `number` | No | — | | `closed_issues_count` | `number` | No | — | | `open_merge_requests_count` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `is_project_label` | `boolean` | No | — | *** ## Merge Requests ### approve `mergeRequests.approve` Approve a merge request **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.mergeRequests.approve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `merge_request_iid` | `number` | Yes | — | | `sha` | `string` | No | — | **Output:** *empty object* *** ### create `mergeRequests.create` Create a new merge request **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.mergeRequests.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `source_branch` | `string` | Yes | — | | `target_branch` | `string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `assignee_id` | `number` | No | — | | `assignee_ids` | `number[]` | No | — | | `reviewer_ids` | `number[]` | No | — | | `labels` | `string` | No | — | | `milestone_id` | `number` | No | — | | `remove_source_branch` | `boolean` | No | — | | `squash` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `source_branch` | `string` | No | — | | `target_branch` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `merged_at` | `string` | No | — | | `closed_at` | `string` | No | — | | `merged_by` | `object` | No | — | | `author` | `object` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `reviewers` | `object[]` | No | — | | `labels` | `string[]` | No | — | | `milestone` | `object` | No | — | | `merge_commit_sha` | `string` | No | — | | `sha` | `string` | No | — | | `web_url` | `string` | No | — | | `detailed_merge_status` | `string` | No | — | | `has_conflicts` | `boolean` | No | — | | `draft` | `boolean` | No | — | | `changes_count` | `string` | No | — | | `references` | `object` | No | — | > **merged\_by full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **reviewers full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **milestone full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > } > ``` > **references full type** > > ```ts theme={null} > { > short?: string, > relative?: string, > full?: string > } > ``` *** ### createNote `mergeRequests.createNote` Add a comment to a merge request **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.mergeRequests.createNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `merge_request_iid` | `number` | Yes | — | | `body` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `body` | `string` | Yes | — | | `author` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `system` | `boolean` | No | — | | `noteable_id` | `number` | No | — | | `noteable_type` | `string` | No | — | | `noteable_iid` | `number` | No | — | | `resolvable` | `boolean` | No | — | > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ### delete `mergeRequests.delete` Delete a merge request \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.gitlab.api.mergeRequests.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `merge_request_iid` | `number` | Yes | — | **Output:** *empty object* *** ### get `mergeRequests.get` Get a specific merge request **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.mergeRequests.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `merge_request_iid` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `source_branch` | `string` | No | — | | `target_branch` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `merged_at` | `string` | No | — | | `closed_at` | `string` | No | — | | `merged_by` | `object` | No | — | | `author` | `object` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `reviewers` | `object[]` | No | — | | `labels` | `string[]` | No | — | | `milestone` | `object` | No | — | | `merge_commit_sha` | `string` | No | — | | `sha` | `string` | No | — | | `web_url` | `string` | No | — | | `detailed_merge_status` | `string` | No | — | | `has_conflicts` | `boolean` | No | — | | `draft` | `boolean` | No | — | | `changes_count` | `string` | No | — | | `references` | `object` | No | — | > **merged\_by full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **reviewers full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **milestone full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > } > ``` > **references full type** > > ```ts theme={null} > { > short?: string, > relative?: string, > full?: string > } > ``` *** ### list `mergeRequests.list` List merge requests in a project **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.mergeRequests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `state` | `opened \| closed \| merged \| all` | No | — | | `labels` | `string` | No | — | | `milestone` | `string` | No | — | | `search` | `string` | No | — | | `author_id` | `number` | No | — | | `assignee_id` | `number` | No | — | | `reviewer_id` | `number` | No | — | | `source_branch` | `string` | No | — | | `target_branch` | `string` | No | — | | `order_by` | `string` | No | — | | `sort` | `asc \| desc` | No | — | | `scope` | `created_by_me \| assigned_to_me \| all` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > iid: number, > project_id: number, > title: string, > description?: string | null, > state?: string, > source_branch?: string, > target_branch?: string, > created_at?: string, > updated_at?: string, > merged_at?: string | null, > closed_at?: string | null, > merged_by?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } | null, > author?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }, > assignee?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } | null, > assignees?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[], > reviewers?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[], > labels?: string[], > milestone?: { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > } | null, > merge_commit_sha?: string | null, > sha?: string, > web_url?: string, > detailed_merge_status?: string, > has_conflicts?: boolean, > draft?: boolean, > changes_count?: string | null, > references?: { > short?: string, > relative?: string, > full?: string > } > }[] > ``` *** ### listNotes `mergeRequests.listNotes` List comments on a merge request **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.mergeRequests.listNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `merge_request_iid` | `number` | Yes | — | | `order_by` | `created_at \| updated_at` | No | — | | `sort` | `asc \| desc` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > body: string, > author?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }, > created_at?: string, > updated_at?: string, > system?: boolean, > noteable_id?: number, > noteable_type?: string, > noteable_iid?: number, > resolvable?: boolean > }[] > ``` *** ### merge `mergeRequests.merge` Merge a merge request **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.mergeRequests.merge({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `merge_request_iid` | `number` | Yes | — | | `merge_commit_message` | `string` | No | — | | `squash_commit_message` | `string` | No | — | | `squash` | `boolean` | No | — | | `should_remove_source_branch` | `boolean` | No | — | | `merge_when_pipeline_succeeds` | `boolean` | No | — | | `sha` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `source_branch` | `string` | No | — | | `target_branch` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `merged_at` | `string` | No | — | | `closed_at` | `string` | No | — | | `merged_by` | `object` | No | — | | `author` | `object` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `reviewers` | `object[]` | No | — | | `labels` | `string[]` | No | — | | `milestone` | `object` | No | — | | `merge_commit_sha` | `string` | No | — | | `sha` | `string` | No | — | | `web_url` | `string` | No | — | | `detailed_merge_status` | `string` | No | — | | `has_conflicts` | `boolean` | No | — | | `draft` | `boolean` | No | — | | `changes_count` | `string` | No | — | | `references` | `object` | No | — | > **merged\_by full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **reviewers full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **milestone full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > } > ``` > **references full type** > > ```ts theme={null} > { > short?: string, > relative?: string, > full?: string > } > ``` *** ### update `mergeRequests.update` Update a merge request **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.mergeRequests.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `merge_request_iid` | `number` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `assignee_id` | `number` | No | — | | `assignee_ids` | `number[]` | No | — | | `reviewer_ids` | `number[]` | No | — | | `labels` | `string` | No | — | | `milestone_id` | `number` | No | — | | `state_event` | `close \| reopen` | No | — | | `remove_source_branch` | `boolean` | No | — | | `squash` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `source_branch` | `string` | No | — | | `target_branch` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `merged_at` | `string` | No | — | | `closed_at` | `string` | No | — | | `merged_by` | `object` | No | — | | `author` | `object` | No | — | | `assignee` | `object` | No | — | | `assignees` | `object[]` | No | — | | `reviewers` | `object[]` | No | — | | `labels` | `string[]` | No | — | | `milestone` | `object` | No | — | | `merge_commit_sha` | `string` | No | — | | `sha` | `string` | No | — | | `web_url` | `string` | No | — | | `detailed_merge_status` | `string` | No | — | | `has_conflicts` | `boolean` | No | — | | `draft` | `boolean` | No | — | | `changes_count` | `string` | No | — | | `references` | `object` | No | — | > **merged\_by full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **assignees full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **reviewers full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` > **milestone full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > } > ``` > **references full type** > > ```ts theme={null} > { > short?: string, > relative?: string, > full?: string > } > ``` *** ## Milestones ### create `milestones.create` Create a new milestone **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.milestones.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `due_date` | `string` | No | — | | `start_date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | No | — | | `project_id` | `number` | No | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `due_date` | `string` | No | — | | `start_date` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `web_url` | `string` | No | — | *** ### delete `milestones.delete` Delete a milestone **Risk:** `destructive` ```ts theme={null} await corsair.gitlab.api.milestones.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `milestone_id` | `number` | Yes | — | **Output:** *empty object* *** ### get `milestones.get` Get a specific milestone **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.milestones.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `milestone_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | No | — | | `project_id` | `number` | No | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `due_date` | `string` | No | — | | `start_date` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `web_url` | `string` | No | — | *** ### list `milestones.list` List milestones in a project **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.milestones.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `state` | `active \| closed` | No | — | | `search` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > iid?: number, > project_id?: number, > title: string, > description?: string | null, > state?: string, > due_date?: string | null, > start_date?: string | null, > created_at?: string, > updated_at?: string, > web_url?: string > }[] > ``` *** ### update `milestones.update` Update a milestone **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.milestones.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `milestone_id` | `number` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `due_date` | `string` | No | — | | `start_date` | `string` | No | — | | `state_event` | `close \| activate` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | No | — | | `project_id` | `number` | No | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `state` | `string` | No | — | | `due_date` | `string` | No | — | | `start_date` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `web_url` | `string` | No | — | *** ## Pipelines ### cancel `pipelines.cancel` Cancel a running pipeline **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.pipelines.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `pipeline_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | No | — | | `project_id` | `number` | No | — | | `status` | `string` | No | — | | `source` | `string` | No | — | | `ref` | `string` | No | — | | `sha` | `string` | No | — | | `web_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `started_at` | `string` | No | — | | `finished_at` | `string` | No | — | | `name` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ### create `pipelines.create` Create a new pipeline **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.pipelines.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `ref` | `string` | Yes | — | | `variables` | `object[]` | No | — | > **variables full type** > > ```ts theme={null} > { > key: string, > value: string, > variable_type?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | No | — | | `project_id` | `number` | No | — | | `status` | `string` | No | — | | `source` | `string` | No | — | | `ref` | `string` | No | — | | `sha` | `string` | No | — | | `web_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `started_at` | `string` | No | — | | `finished_at` | `string` | No | — | | `name` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ### delete `pipelines.delete` Delete a pipeline **Risk:** `destructive` ```ts theme={null} await corsair.gitlab.api.pipelines.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `pipeline_id` | `number` | Yes | — | **Output:** *empty object* *** ### get `pipelines.get` Get a specific pipeline **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.pipelines.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `pipeline_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | No | — | | `project_id` | `number` | No | — | | `status` | `string` | No | — | | `source` | `string` | No | — | | `ref` | `string` | No | — | | `sha` | `string` | No | — | | `web_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `started_at` | `string` | No | — | | `finished_at` | `string` | No | — | | `name` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ### list `pipelines.list` List pipelines for a project **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.pipelines.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `status` | `string` | No | — | | `ref` | `string` | No | — | | `sha` | `string` | No | — | | `source` | `string` | No | — | | `order_by` | `string` | No | — | | `sort` | `asc \| desc` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > iid?: number, > project_id?: number, > status?: string, > source?: string, > ref?: string, > sha?: string, > web_url?: string, > created_at?: string, > updated_at?: string, > started_at?: string | null, > finished_at?: string | null, > name?: string | null, > user?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > }[] > ``` *** ### listJobs `pipelines.listJobs` List jobs in a pipeline **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.pipelines.listJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `pipeline_id` | `number` | Yes | — | | `scope` | `string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string, > status?: string, > stage?: string, > ref?: string, > created_at?: string, > started_at?: string | null, > finished_at?: string | null, > duration?: number | null, > web_url?: string, > pipeline?: { > id: number, > status?: string > } > }[] > ``` *** ### retry `pipelines.retry` Retry a failed pipeline **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.pipelines.retry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `pipeline_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `iid` | `number` | No | — | | `project_id` | `number` | No | — | | `status` | `string` | No | — | | `source` | `string` | No | — | | `ref` | `string` | No | — | | `sha` | `string` | No | — | | `web_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `started_at` | `string` | No | — | | `finished_at` | `string` | No | — | | `name` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ## Projects ### create `projects.create` Create a new project **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `namespace_id` | `number` | No | — | | `description` | `string` | No | — | | `visibility` | `public \| internal \| private` | No | — | | `initialize_with_readme` | `boolean` | No | — | | `default_branch` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `path_with_namespace` | `string` | No | — | | `description` | `string` | No | — | | `default_branch` | `string` | No | — | | `visibility` | `string` | No | — | | `ssh_url_to_repo` | `string` | No | — | | `http_url_to_repo` | `string` | No | — | | `web_url` | `string` | No | — | | `archived` | `boolean` | No | — | | `created_at` | `string` | No | — | | `last_activity_at` | `string` | No | — | | `creator_id` | `number` | No | — | | `namespace` | `object` | No | — | | `owner` | `object` | No | — | | `star_count` | `number` | No | — | | `forks_count` | `number` | No | — | | `open_issues_count` | `number` | No | — | | `topics` | `string[]` | No | — | | `empty_repo` | `boolean` | No | — | > **namespace full type** > > ```ts theme={null} > { > id: number, > name?: string, > path?: string, > kind?: string, > full_path?: string, > web_url?: string > } > ``` > **owner full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ### delete `projects.delete` Delete a project \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.gitlab.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | **Output:** *empty object* *** ### fork `projects.fork` Fork a project **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.projects.fork({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `namespace_id` | `number` | No | — | | `namespace_path` | `string` | No | — | | `name` | `string` | No | — | | `path` | `string` | No | — | | `visibility` | `public \| internal \| private` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `path_with_namespace` | `string` | No | — | | `description` | `string` | No | — | | `default_branch` | `string` | No | — | | `visibility` | `string` | No | — | | `ssh_url_to_repo` | `string` | No | — | | `http_url_to_repo` | `string` | No | — | | `web_url` | `string` | No | — | | `archived` | `boolean` | No | — | | `created_at` | `string` | No | — | | `last_activity_at` | `string` | No | — | | `creator_id` | `number` | No | — | | `namespace` | `object` | No | — | | `owner` | `object` | No | — | | `star_count` | `number` | No | — | | `forks_count` | `number` | No | — | | `open_issues_count` | `number` | No | — | | `topics` | `string[]` | No | — | | `empty_repo` | `boolean` | No | — | > **namespace full type** > > ```ts theme={null} > { > id: number, > name?: string, > path?: string, > kind?: string, > full_path?: string, > web_url?: string > } > ``` > **owner full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ### get `projects.get` Get a specific project **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `statistics` | `boolean` | No | — | | `license` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `path_with_namespace` | `string` | No | — | | `description` | `string` | No | — | | `default_branch` | `string` | No | — | | `visibility` | `string` | No | — | | `ssh_url_to_repo` | `string` | No | — | | `http_url_to_repo` | `string` | No | — | | `web_url` | `string` | No | — | | `archived` | `boolean` | No | — | | `created_at` | `string` | No | — | | `last_activity_at` | `string` | No | — | | `creator_id` | `number` | No | — | | `namespace` | `object` | No | — | | `owner` | `object` | No | — | | `star_count` | `number` | No | — | | `forks_count` | `number` | No | — | | `open_issues_count` | `number` | No | — | | `topics` | `string[]` | No | — | | `empty_repo` | `boolean` | No | — | > **namespace full type** > > ```ts theme={null} > { > id: number, > name?: string, > path?: string, > kind?: string, > full_path?: string, > web_url?: string > } > ``` > **owner full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ### list `projects.list` List projects **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search` | `string` | No | — | | `owned` | `boolean` | No | — | | `membership` | `boolean` | No | — | | `starred` | `boolean` | No | — | | `archived` | `boolean` | No | — | | `visibility` | `public \| internal \| private` | No | — | | `order_by` | `string` | No | — | | `sort` | `asc \| desc` | No | — | | `simple` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > path?: string, > path_with_namespace?: string, > description?: string | null, > default_branch?: string | null, > visibility?: string, > ssh_url_to_repo?: string, > http_url_to_repo?: string, > web_url?: string, > archived?: boolean, > created_at?: string, > last_activity_at?: string, > creator_id?: number, > namespace?: { > id: number, > name?: string, > path?: string, > kind?: string, > full_path?: string, > web_url?: string > }, > owner?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }, > star_count?: number, > forks_count?: number, > open_issues_count?: number, > topics?: string[], > empty_repo?: boolean > }[] > ``` *** ### update `projects.update` Update an existing project **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `visibility` | `public \| internal \| private` | No | — | | `default_branch` | `string` | No | — | | `archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `path` | `string` | No | — | | `path_with_namespace` | `string` | No | — | | `description` | `string` | No | — | | `default_branch` | `string` | No | — | | `visibility` | `string` | No | — | | `ssh_url_to_repo` | `string` | No | — | | `http_url_to_repo` | `string` | No | — | | `web_url` | `string` | No | — | | `archived` | `boolean` | No | — | | `created_at` | `string` | No | — | | `last_activity_at` | `string` | No | — | | `creator_id` | `number` | No | — | | `namespace` | `object` | No | — | | `owner` | `object` | No | — | | `star_count` | `number` | No | — | | `forks_count` | `number` | No | — | | `open_issues_count` | `number` | No | — | | `topics` | `string[]` | No | — | | `empty_repo` | `boolean` | No | — | > **namespace full type** > > ```ts theme={null} > { > id: number, > name?: string, > path?: string, > kind?: string, > full_path?: string, > web_url?: string > } > ``` > **owner full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` *** ## Releases ### create `releases.create` Create a new release **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.releases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `tag_name` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `ref` | `string` | No | — | | `released_at` | `string` | No | — | | `milestones` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tag_name` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `released_at` | `string` | No | — | | `upcoming_release` | `boolean` | No | — | | `author` | `object` | No | — | | `commit` | `object` | No | — | | `milestones` | `object[]` | No | — | > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **commit full type** > > ```ts theme={null} > { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > } > ``` > **milestones full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > }[] > ``` *** ### delete `releases.delete` Delete a release **Risk:** `destructive` ```ts theme={null} await corsair.gitlab.api.releases.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `tag_name` | `string` | Yes | — | **Output:** *empty object* *** ### get `releases.get` Get a specific release **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.releases.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `tag_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tag_name` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `released_at` | `string` | No | — | | `upcoming_release` | `boolean` | No | — | | `author` | `object` | No | — | | `commit` | `object` | No | — | | `milestones` | `object[]` | No | — | > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **commit full type** > > ```ts theme={null} > { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > } > ``` > **milestones full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > }[] > ``` *** ### list `releases.list` List releases in a project **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.releases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `order_by` | `string` | No | — | | `sort` | `asc \| desc` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > tag_name: string, > name?: string | null, > description?: string | null, > created_at?: string, > released_at?: string, > upcoming_release?: boolean, > author?: { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }, > commit?: { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > }, > milestones?: { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > }[] > }[] > ``` *** ### update `releases.update` Update a release **Risk:** `write` ```ts theme={null} await corsair.gitlab.api.releases.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `tag_name` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `released_at` | `string` | No | — | | `milestones` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tag_name` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `released_at` | `string` | No | — | | `upcoming_release` | `boolean` | No | — | | `author` | `object` | No | — | | `commit` | `object` | No | — | | `milestones` | `object[]` | No | — | > **author full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > } > ``` > **commit full type** > > ```ts theme={null} > { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > } > ``` > **milestones full type** > > ```ts theme={null} > { > id: number, > iid?: number, > title: string, > state?: string, > due_date?: string | null > }[] > ``` *** ## Repository ### compare `repository.compare` Compare branches, tags, or commits **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.repository.compare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `from` | `string` | Yes | — | | `to` | `string` | Yes | — | | `straight` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `commit` | `object` | No | — | | `commits` | `object[]` | No | — | | `diffs` | `object[]` | No | — | | `compare_timeout` | `boolean` | No | — | | `compare_same_ref` | `boolean` | No | — | > **commit full type** > > ```ts theme={null} > { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > } > ``` > **commits full type** > > ```ts theme={null} > { > id: string, > short_id?: string, > title?: string, > message?: string, > author_name?: string, > author_email?: string, > authored_date?: string, > committed_date?: string, > committer_name?: string, > committer_email?: string, > parent_ids?: string[], > web_url?: string > }[] > ``` > **diffs full type** > > ```ts theme={null} > { > old_path: string, > new_path: string, > a_mode?: string, > b_mode?: string, > diff: string, > new_file?: boolean, > renamed_file?: boolean, > deleted_file?: boolean > }[] > ``` *** ### getFile `repository.getFile` Get a file from the repository **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.repository.getFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number \| string` | Yes | — | | `file_path` | `string` | Yes | — | | `ref` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_name` | `string` | Yes | — | | `file_path` | `string` | Yes | — | | `size` | `number` | No | — | | `encoding` | `string` | No | — | | `content` | `string` | No | — | | `content_sha256` | `string` | No | — | | `ref` | `string` | No | — | | `blob_id` | `string` | No | — | | `commit_id` | `string` | No | — | | `last_commit_id` | `string` | No | — | *** ### getTree `repository.getTree` List repository tree (files and directories) **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.repository.getTree({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `project_id` | `number \| string` | Yes | — | | `path` | `string` | No | — | | `ref` | `string` | No | — | | `recursive` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > type: string, > path: string, > mode?: string > }[] > ``` *** ## Users ### getCurrentUser `users.getCurrentUser` Get the authenticated user **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.users.getCurrentUser({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `username` | `string` | Yes | — | | `name` | `string` | No | — | | `state` | `string` | No | — | | `avatar_url` | `string` | No | — | | `web_url` | `string` | No | — | | `email` | `string` | No | — | | `bio` | `string` | No | — | | `location` | `string` | No | — | | `created_at` | `string` | No | — | | `is_admin` | `boolean` | No | — | | `bot` | `boolean` | No | — | | `two_factor_enabled` | `boolean` | No | — | *** ### getUser `users.getUser` Get a specific user by ID **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.users.getUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `username` | `string` | Yes | — | | `name` | `string` | No | — | | `state` | `string` | No | — | | `avatar_url` | `string` | No | — | | `web_url` | `string` | No | — | *** ### list `users.list` List users **Risk:** `read` ```ts theme={null} await corsair.gitlab.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search` | `string` | No | — | | `username` | `string` | No | — | | `active` | `boolean` | No | — | | `blocked` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > username: string, > name?: string | null, > state?: string, > avatar_url?: string | null, > web_url?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/gitlab/database GitLab local sync: searchable entities, `.search()` filters, and operators. The GitLab plugin syncs data locally. Use `corsair.gitlab.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Branches Path: `gitlab.db.branches.search` ```ts theme={null} const rows = await corsair.gitlab.db.branches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `merged` | `boolean` | equals | | `protected` | `boolean` | equals | | `default` | `boolean` | equals | | `developers_can_push` | `boolean` | equals | | `developers_can_merge` | `boolean` | equals | | `can_push` | `boolean` | equals | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Commits Path: `gitlab.db.commits.search` ```ts theme={null} const rows = await corsair.gitlab.db.commits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `short_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `author_name` | `string` | equals, contains, startsWith, endsWith, in | | `author_email` | `string` | equals, contains, startsWith, endsWith, in | | `authored_date` | `string` | equals, contains, startsWith, endsWith, in | | `committed_date` | `string` | equals, contains, startsWith, endsWith, in | | `committer_name` | `string` | equals, contains, startsWith, endsWith, in | | `committer_email` | `string` | equals, contains, startsWith, endsWith, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Groups Path: `gitlab.db.groups.search` ```ts theme={null} const rows = await corsair.gitlab.db.groups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `full_path` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `number` | equals, gt, gte, lt, lte, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Issues Path: `gitlab.db.issues.search` ```ts theme={null} const rows = await corsair.gitlab.db.issues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `iid` | `number` | equals, gt, gte, lt, lte, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `closed_at` | `string` | equals, contains, startsWith, endsWith, in | | `milestone_id` | `number` | equals, gt, gte, lt, lte, in | | `author_id` | `number` | equals, gt, gte, lt, lte, in | | `assignee_id` | `number` | equals, gt, gte, lt, lte, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | | `confidential` | `boolean` | equals | | `due_date` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Labels Path: `gitlab.db.labels.search` ```ts theme={null} const rows = await corsair.gitlab.db.labels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `text_color` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `open_issues_count` | `number` | equals, gt, gte, lt, lte, in | | `closed_issues_count` | `number` | equals, gt, gte, lt, lte, in | | `subscribed` | `boolean` | equals | | `is_project_label` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Merge Requests Path: `gitlab.db.mergeRequests.search` ```ts theme={null} const rows = await corsair.gitlab.db.mergeRequests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `iid` | `number` | equals, gt, gte, lt, lte, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `source_branch` | `string` | equals, contains, startsWith, endsWith, in | | `target_branch` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `merged_at` | `string` | equals, contains, startsWith, endsWith, in | | `closed_at` | `string` | equals, contains, startsWith, endsWith, in | | `merge_commit_sha` | `string` | equals, contains, startsWith, endsWith, in | | `sha` | `string` | equals, contains, startsWith, endsWith, in | | `author_id` | `number` | equals, gt, gte, lt, lte, in | | `assignee_id` | `number` | equals, gt, gte, lt, lte, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | | `has_conflicts` | `boolean` | equals | | `draft` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Milestones Path: `gitlab.db.milestones.search` ```ts theme={null} const rows = await corsair.gitlab.db.milestones.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `iid` | `number` | equals, gt, gte, lt, lte, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `due_date` | `string` | equals, contains, startsWith, endsWith, in | | `start_date` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pipelines Path: `gitlab.db.pipelines.search` ```ts theme={null} const rows = await corsair.gitlab.db.pipelines.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `iid` | `number` | equals, gt, gte, lt, lte, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `ref` | `string` | equals, contains, startsWith, endsWith, in | | `sha` | `string` | equals, contains, startsWith, endsWith, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `started_at` | `string` | equals, contains, startsWith, endsWith, in | | `finished_at` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `gitlab.db.projects.search` ```ts theme={null} const rows = await corsair.gitlab.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `path_with_namespace` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `default_branch` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `ssh_url_to_repo` | `string` | equals, contains, startsWith, endsWith, in | | `http_url_to_repo` | `string` | equals, contains, startsWith, endsWith, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | | `archived` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_activity_at` | `string` | equals, contains, startsWith, endsWith, in | | `creator_id` | `number` | equals, gt, gte, lt, lte, in | | `namespace_id` | `number` | equals, gt, gte, lt, lte, in | | `star_count` | `number` | equals, gt, gte, lt, lte, in | | `forks_count` | `number` | equals, gt, gte, lt, lte, in | | `open_issues_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Releases Path: `gitlab.db.releases.search` ```ts theme={null} const rows = await corsair.gitlab.db.releases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `tag_name` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `released_at` | `string` | equals, contains, startsWith, endsWith, in | | `upcoming_release` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `gitlab.db.users.search` ```ts theme={null} const rows = await corsair.gitlab.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `web_url` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `bio` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `is_admin` | `boolean` | equals | | `bot` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/gitlab/overview DevOps platform for Git repos, CI/CD pipelines, issues, and complete software delivery. Use **GitLab** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 62 typed API operations * 11 synced entities (`branches`, `commits`, `groups`, `issues`, `labels`, `mergeRequests`, and 5 more) for fast `.search()` / `.list()` * 5 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/gitlab ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/gitlab ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/gitlab ``` ```bash bun theme={null} bun add corsair @corsair-dev/gitlab ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { gitlab } from '@corsair-dev/gitlab'; export const corsair = createCorsair({ plugins: [ gitlab({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **GitLab** — your tenants connect through Hub when they sign in. ```ts theme={null} gitlab({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. ```ts theme={null} gitlab() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your GitLab OAuth app. ```ts theme={null} gitlab({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'gitlab', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`branches.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.gitlab.api.branches.get({}); ``` **`branches.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.gitlab.api.branches.create({}); ``` See the full list on the [API](/plugins/gitlab/api) page. ## Query synced data Synced entities support `tenant.gitlab.db..search()` and `.list()`: `branches`, `commits`, `groups`, `issues`, `labels`, `mergeRequests`, `milestones`, `pipelines`, `projects`, `releases`, `users`. See [Database](/plugins/gitlab/database) for filters and operators. ## Webhooks This plugin registers **5** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/gitlab/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/gitlab/api)** > > Every `gitlab.api.*` operation with input and output types. > **[Database](/plugins/gitlab/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/gitlab/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/gitlab/webhooks GitLab incoming webhooks: event paths, payloads, and response data. The GitLab plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/gitlab/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `issue` (`issue`) * `mergeRequest` (`mergeRequest`) * `note` (`note`) * `pipeline` (`pipeline`) * `push` (`push`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Issue ### Issue `issue` An issue event from GitLab (open, update, close) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `object_kind` | `issue` | Yes | — | | `event_type` | `string` | No | — | | `user` | `object` | No | — | | `project` | `object` | No | — | | `object_attributes` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id?: number, > name?: string, > username?: string, > avatar_url?: string > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string > } > ``` > **object\_attributes full type** > > ```ts theme={null} > { > id?: number, > iid?: number, > title?: string, > state?: string, > action?: string, > url?: string, > description?: string | null, > confidential?: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > object_kind: issue, > event_type?: string, > user?: { > id?: number, > name?: string, > username?: string, > avatar_url?: string > }, > project?: { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string > }, > object_attributes?: { > id?: number, > iid?: number, > title?: string, > state?: string, > action?: string, > url?: string, > description?: string | null, > confidential?: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} gitlab({ webhookHooks: { issue: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Merge Request ### Merge Request `mergeRequest` A merge request event from GitLab (open, update, merge, close) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `object_kind` | `merge_request` | Yes | — | | `event_type` | `string` | No | — | | `user` | `object` | No | — | | `project` | `object` | No | — | | `object_attributes` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id?: number, > name?: string, > username?: string, > avatar_url?: string > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string > } > ``` > **object\_attributes full type** > > ```ts theme={null} > { > id?: number, > iid?: number, > title?: string, > state?: string, > source_branch?: string, > target_branch?: string, > action?: string, > url?: string, > description?: string | null, > merge_status?: string, > draft?: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > object_kind: merge_request, > event_type?: string, > user?: { > id?: number, > name?: string, > username?: string, > avatar_url?: string > }, > project?: { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string > }, > object_attributes?: { > id?: number, > iid?: number, > title?: string, > state?: string, > source_branch?: string, > target_branch?: string, > action?: string, > url?: string, > description?: string | null, > merge_status?: string, > draft?: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} gitlab({ webhookHooks: { mergeRequest: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Note ### Note `note` A comment event from GitLab (new comments on issues, MRs, commits) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `object_kind` | `note` | Yes | — | | `event_type` | `string` | No | — | | `user` | `object` | No | — | | `project` | `object` | No | — | | `object_attributes` | `object` | No | — | | `issue` | `object` | No | — | | `merge_request` | `object` | No | — | | `commit` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id?: number, > name?: string, > username?: string, > avatar_url?: string > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string > } > ``` > **object\_attributes full type** > > ```ts theme={null} > { > id?: number, > note?: string, > noteable_type?: string, > noteable_id?: number, > url?: string, > action?: string > } > ``` > **issue full type** > > ```ts theme={null} > { > id?: number, > iid?: number, > title?: string > } > ``` > **merge\_request full type** > > ```ts theme={null} > { > id?: number, > iid?: number, > title?: string > } > ``` > **commit full type** > > ```ts theme={null} > { > id?: string, > message?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > object_kind: note, > event_type?: string, > user?: { > id?: number, > name?: string, > username?: string, > avatar_url?: string > }, > project?: { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string > }, > object_attributes?: { > id?: number, > note?: string, > noteable_type?: string, > noteable_id?: number, > url?: string, > action?: string > }, > issue?: { > id?: number, > iid?: number, > title?: string > }, > merge_request?: { > id?: number, > iid?: number, > title?: string > }, > commit?: { > id?: string, > message?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} gitlab({ webhookHooks: { note: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Pipeline ### Pipeline `pipeline` A pipeline event from GitLab (status change) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `object_kind` | `pipeline` | Yes | — | | `object_attributes` | `object` | No | — | | `user` | `object` | No | — | | `project` | `object` | No | — | | `builds` | `object[]` | No | — | > **object\_attributes full type** > > ```ts theme={null} > { > id?: number, > iid?: number, > ref?: string, > status?: string, > source?: string, > created_at?: string, > finished_at?: string | null, > duration?: number | null > } > ``` > **user full type** > > ```ts theme={null} > { > id?: number, > name?: string, > username?: string, > avatar_url?: string > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string > } > ``` > **builds full type** > > ```ts theme={null} > { > id?: number, > stage?: string, > name?: string, > status?: string > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > object_kind: pipeline, > object_attributes?: { > id?: number, > iid?: number, > ref?: string, > status?: string, > source?: string, > created_at?: string, > finished_at?: string | null, > duration?: number | null > }, > user?: { > id?: number, > name?: string, > username?: string, > avatar_url?: string > }, > project?: { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string > }, > builds?: { > id?: number, > stage?: string, > name?: string, > status?: string > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} gitlab({ webhookHooks: { pipeline: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Push ### Push `push` A push event from GitLab (git push to repository) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `object_kind` | `push` | Yes | — | | `event_name` | `string` | No | — | | `before` | `string` | No | — | | `after` | `string` | No | — | | `ref` | `string` | No | — | | `checkout_sha` | `string` | No | — | | `user_id` | `number` | No | — | | `user_name` | `string` | No | — | | `user_username` | `string` | No | — | | `user_avatar` | `string` | No | — | | `project_id` | `number` | No | — | | `project` | `object` | No | — | | `commits` | `object[]` | No | — | | `total_commits_count` | `number` | No | — | > **project full type** > > ```ts theme={null} > { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string, > default_branch?: string > } > ``` > **commits full type** > > ```ts theme={null} > { > id: string, > message?: string, > title?: string, > timestamp?: string, > url?: string, > author?: { > name?: string, > email?: string > }, > added?: string[], > modified?: string[], > removed?: string[] > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > object_kind: push, > event_name?: string, > before?: string, > after?: string, > ref?: string, > checkout_sha?: string | null, > user_id?: number, > user_name?: string, > user_username?: string, > user_avatar?: string, > project_id?: number, > project?: { > id?: number, > name?: string, > web_url?: string, > path_with_namespace?: string, > default_branch?: string > }, > commits?: { > id: string, > message?: string, > title?: string, > timestamp?: string, > url?: string, > author?: { > name?: string, > email?: string > }, > added?: string[], > modified?: string[], > removed?: string[] > }[], > total_commits_count?: number > } > ``` **`webhookHooks` example** ```ts theme={null} gitlab({ webhookHooks: { push: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/gladia/api API reference for Gladia: every `gladia.api.*` operation with input and output types. Every `gladia.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Live ### deleteSession `live.deleteSession` Permanently delete a live transcription session **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.gladia.api.live.deleteSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > undefined | { > message: string > } > ``` *** ### getTranscriptionResult `live.getTranscriptionResult` Retrieve a live transcription session result **Risk:** `read` ```ts theme={null} await corsair.gladia.api.live.getTranscriptionResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `request_id` | `string` | No | — | | `version` | `number` | No | — | | `status` | `queued \| processing \| done \| error` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `kind` | `live \| pre-recorded` | No | — | | `custom_metadata` | `object` | No | — | | `error_code` | `number` | No | — | | `file` | `object` | No | — | | `request_params` | `object` | No | — | | `result` | `any` | No | — | | `post_session_metadata` | `object` | No | — | > **custom\_metadata full type** > > ```ts theme={null} > { > } > ``` > **file full type** > > ```ts theme={null} > { > id?: string, > filename?: string, > extension?: string, > size?: number, > audio_duration?: number, > number_of_channels?: number, > source?: string > } > ``` > **request\_params full type** > > ```ts theme={null} > { > } > ``` > **post\_session\_metadata full type** > > ```ts theme={null} > { > } > ``` *** ### initiateTranscriptionSession `live.initiateTranscriptionSession` Create a live transcription session and return its WebSocket URL **Risk:** `write` ```ts theme={null} await corsair.gladia.api.live.initiateTranscriptionSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `region` | `us-west \| eu-west` | No | — | | `encoding` | `wav/pcm \| wav/alaw \| wav/ulaw` | No | — | | `bit_depth` | `8 \| 16 \| 24 \| 32` | No | — | | `sample_rate` | `8000 \| 16000 \| 32000 \| 44100 \| 48000` | No | — | | `channels` | `number` | No | — | | `custom_metadata` | `object` | No | — | | `model` | `string` | No | — | | `endpointing` | `number` | No | — | | `maximum_duration_without_endpointing` | `number` | No | — | | `language_config` | `object` | No | — | | `pre_processing` | `object` | No | — | | `realtime_processing` | `object` | No | — | | `post_processing` | `object` | No | — | | `messages_config` | `object` | No | — | | `callback` | `boolean` | No | — | | `callback_config` | `object` | No | — | > **custom\_metadata full type** > > ```ts theme={null} > { > } > ``` > **language\_config full type** > > ```ts theme={null} > { > } > ``` > **pre\_processing full type** > > ```ts theme={null} > { > } > ``` > **realtime\_processing full type** > > ```ts theme={null} > { > } > ``` > **post\_processing full type** > > ```ts theme={null} > { > } > ``` > **messages\_config full type** > > ```ts theme={null} > { > } > ``` > **callback\_config full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `url` | `string` | Yes | — | *** ### listTranscriptionJobs `live.listTranscriptionJobs` List live transcription jobs with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.gladia.api.live.listTranscriptionJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `date` | `string` | No | — | | `before_date` | `string` | No | — | | `after_date` | `string` | No | — | | `status` | `queued \| processing \| done \| error[]` | No | — | | `custom_metadata` | `object` | No | — | > **custom\_metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `first` | `string` | Yes | — | | `current` | `string` | Yes | — | | `next` | `string` | No | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > request_id?: string, > version?: number, > status?: queued | processing | done | error, > created_at?: string, > completed_at?: string | null, > kind?: live | pre-recorded, > custom_metadata?: { > }, > error_code?: number | null, > file?: { > id?: string, > filename?: string, > extension?: string, > size?: number, > audio_duration?: number, > number_of_channels?: number, > source?: string > } | null, > request_params?: { > } | null, > result?: any, > post_session_metadata?: { > } > }[] > ``` *** ## Pre Recorded ### deleteJob `preRecorded.deleteJob` Permanently delete a pre-recorded transcription job **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.gladia.api.preRecorded.deleteJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > undefined | { > message: string > } > ``` *** ### getJob `preRecorded.getJob` Retrieve a pre-recorded transcription job and result **Risk:** `read` ```ts theme={null} await corsair.gladia.api.preRecorded.getJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `request_id` | `string` | No | — | | `version` | `number` | No | — | | `status` | `queued \| processing \| done \| error` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `kind` | `live \| pre-recorded` | No | — | | `custom_metadata` | `object` | No | — | | `error_code` | `number` | No | — | | `file` | `object` | No | — | | `request_params` | `object` | No | — | | `result` | `any` | No | — | | `post_session_metadata` | `object` | No | — | > **custom\_metadata full type** > > ```ts theme={null} > { > } > ``` > **file full type** > > ```ts theme={null} > { > id?: string, > filename?: string, > extension?: string, > size?: number, > audio_duration?: number, > number_of_channels?: number, > source?: string > } > ``` > **request\_params full type** > > ```ts theme={null} > { > } > ``` > **post\_session\_metadata full type** > > ```ts theme={null} > { > } > ``` *** ### initiateTranscription `preRecorded.initiateTranscription` Start a pre-recorded transcription job **Risk:** `write` ```ts theme={null} await corsair.gladia.api.preRecorded.initiateTranscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audio_url` | `string` | Yes | — | | `custom_vocabulary` | `boolean` | No | — | | `custom_vocabulary_config` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback` | `boolean` | No | — | | `callback_config` | `object` | No | — | | `subtitles` | `boolean` | No | — | | `subtitles_config` | `object` | No | — | | `diarization` | `boolean` | No | — | | `diarization_config` | `object` | No | — | | `translation` | `boolean` | No | — | | `translation_config` | `object` | No | — | | `summarization` | `boolean` | No | — | | `summarization_config` | `object` | No | — | | `named_entity_recognition` | `boolean` | No | — | | `custom_spelling` | `boolean` | No | — | | `custom_spelling_config` | `object` | No | — | | `sentiment_analysis` | `boolean` | No | — | | `audio_to_llm` | `boolean` | No | — | | `audio_to_llm_config` | `object` | No | — | | `pii_redaction` | `boolean` | No | — | | `pii_redaction_config` | `object` | No | — | | `custom_metadata` | `object` | No | — | | `sentences` | `boolean` | No | — | | `punctuation_enhanced` | `boolean` | No | — | | `language_config` | `object` | No | — | | `model` | `string` | No | — | > **custom\_vocabulary\_config full type** > > ```ts theme={null} > { > } > ``` > **callback\_config full type** > > ```ts theme={null} > { > } > ``` > **subtitles\_config full type** > > ```ts theme={null} > { > } > ``` > **diarization\_config full type** > > ```ts theme={null} > { > } > ``` > **translation\_config full type** > > ```ts theme={null} > { > } > ``` > **summarization\_config full type** > > ```ts theme={null} > { > } > ``` > **custom\_spelling\_config full type** > > ```ts theme={null} > { > } > ``` > **audio\_to\_llm\_config full type** > > ```ts theme={null} > { > } > ``` > **pii\_redaction\_config full type** > > ```ts theme={null} > { > } > ``` > **custom\_metadata full type** > > ```ts theme={null} > { > } > ``` > **language\_config full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `result_url` | `string` | Yes | — | *** ### listJobs `preRecorded.listJobs` List pre-recorded transcription jobs with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.gladia.api.preRecorded.listJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `date` | `string` | No | — | | `before_date` | `string` | No | — | | `after_date` | `string` | No | — | | `status` | `queued \| processing \| done \| error[]` | No | — | | `custom_metadata` | `object` | No | — | > **custom\_metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `first` | `string` | Yes | — | | `current` | `string` | Yes | — | | `next` | `string` | No | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > request_id?: string, > version?: number, > status?: queued | processing | done | error, > created_at?: string, > completed_at?: string | null, > kind?: live | pre-recorded, > custom_metadata?: { > }, > error_code?: number | null, > file?: { > id?: string, > filename?: string, > extension?: string, > size?: number, > audio_duration?: number, > number_of_channels?: number, > source?: string > } | null, > request_params?: { > } | null, > result?: any, > post_session_metadata?: { > } > }[] > ``` *** ## Upload ### audioVideoFile `upload.audioVideoFile` Upload an audio or video file for a pre-recorded job **Risk:** `write` ```ts theme={null} await corsair.gladia.api.upload.audioVideoFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audio` | `custom` | Yes | — | | `filename` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `audio_url` | `string` | Yes | — | | `audio_metadata` | `object` | Yes | — | > **audio\_metadata full type** > > ```ts theme={null} > { > id?: string, > filename?: string, > extension?: string, > size?: number, > audio_duration?: number, > number_of_channels?: number, > source?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/gladia/database Gladia local sync: searchable entities, `.search()` filters, and operators. The Gladia plugin syncs data locally. Use `corsair.gladia.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/gladia/overview Gladia plugin for Corsair Use **Gladia** through Corsair: one client, typed API calls. **What you get:** * 9 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/gladia ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/gladia ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/gladia ``` ```bash bun theme={null} bun add corsair @corsair-dev/gladia ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { gladia } from '@corsair-dev/gladia'; export const corsair = createCorsair({ plugins: [ gladia(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} gladia() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'gladia', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`live.getTranscriptionResult`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.gladia.api.live.getTranscriptionResult({}); ``` **`live.deleteSession`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.gladia.api.live.deleteSession({}); ``` See the full list on the [API](/plugins/gladia/api) page. ## What's next > **[API reference](/plugins/gladia/api)** > > Every `gladia.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/gmail/api API reference for Gmail: every `gmail.api.*` operation with input and output types. Every `gmail.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Drafts ### create `drafts.create` Create a new draft **Risk:** `write` ```ts theme={null} await corsair.gmail.api.drafts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `draft` | `object` | No | Draft payload. message.raw must be a base64url-encoded RFC 2822 email, not plain text. | > **draft full type** > > ```ts theme={null} > { > message?: { > raw?: string, > threadId?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `message` | `object` | No | — | > **message full type** > > ```ts theme={null} > { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > } > ``` *** ### delete `drafts.delete` Delete a draft **Risk:** `destructive` ```ts theme={null} await corsair.gmail.api.drafts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | **Output:** `void` *** ### get `drafts.get` Get a specific draft **Risk:** `read` ```ts theme={null} await corsair.gmail.api.drafts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | | `format` | `minimal \| full \| raw \| metadata` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `message` | `object` | No | — | > **message full type** > > ```ts theme={null} > { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > } > ``` *** ### list `drafts.list` List drafts in the mailbox **Risk:** `read` ```ts theme={null} await corsair.gmail.api.drafts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | | `q` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `drafts` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | | `resultSizeEstimate` | `number` | No | — | > **drafts full type** > > ```ts theme={null} > { > id?: string, > message?: { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > } > }[] > ``` *** ### send `drafts.send` Send a draft as an email **Risk:** `write` ```ts theme={null} await corsair.gmail.api.drafts.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | No | — | | `message` | `object` | No | Optional message body when sending without a draft id. raw must be base64url-encoded RFC 2822, not plain text. | > **message full type** > > ```ts theme={null} > { > raw?: string, > threadId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `threadId` | `string` | No | — | | `labelIds` | `string[]` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `internalDate` | `string \| number \| Date` | No | — | | `sizeEstimate` | `number` | No | — | | `payload` | `object` | No | — | | `raw` | `string` | No | Full RFC 2822 message in base64url encoding (when format=raw). Not plain text — decode base64url before reading headers/body. | > **payload full type** > > ```ts theme={null} > { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > } > ``` *** ### update `drafts.update` Update an existing draft **Risk:** `write` ```ts theme={null} await corsair.gmail.api.drafts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | | `draft` | `object` | No | Updated draft payload. message.raw must be a base64url-encoded RFC 2822 email, not plain text. | > **draft full type** > > ```ts theme={null} > { > message?: { > raw?: string, > threadId?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `message` | `object` | No | — | > **message full type** > > ```ts theme={null} > { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > } > ``` *** ## Labels ### create `labels.create` Create a new label **Risk:** `write` ```ts theme={null} await corsair.gmail.api.labels.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `label` | `object` | Yes | — | > **label full type** > > ```ts theme={null} > { > name?: string, > messageListVisibility?: show | hide, > labelListVisibility?: labelShow | labelShowIfUnread | labelHide, > color?: { > textColor?: string, > backgroundColor?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `messageListVisibility` | `show \| hide` | No | — | | `labelListVisibility` | `labelShow \| labelShowIfUnread \| labelHide` | No | — | | `type` | `system \| user` | No | — | | `messagesTotal` | `number` | No | — | | `messagesUnread` | `number` | No | — | | `threadsTotal` | `number` | No | — | | `threadsUnread` | `number` | No | — | | `color` | `object` | No | — | > **color full type** > > ```ts theme={null} > { > textColor?: string, > backgroundColor?: string > } > ``` *** ### delete `labels.delete` Delete a label **Risk:** `destructive` ```ts theme={null} await corsair.gmail.api.labels.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | **Output:** `void` *** ### get `labels.get` Get a specific label **Risk:** `read` ```ts theme={null} await corsair.gmail.api.labels.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `messageListVisibility` | `show \| hide` | No | — | | `labelListVisibility` | `labelShow \| labelShowIfUnread \| labelHide` | No | — | | `type` | `system \| user` | No | — | | `messagesTotal` | `number` | No | — | | `messagesUnread` | `number` | No | — | | `threadsTotal` | `number` | No | — | | `threadsUnread` | `number` | No | — | | `color` | `object` | No | — | > **color full type** > > ```ts theme={null} > { > textColor?: string, > backgroundColor?: string > } > ``` *** ### list `labels.list` List all labels in the mailbox **Risk:** `read` ```ts theme={null} await corsair.gmail.api.labels.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `labels` | `object[]` | No | — | > **labels full type** > > ```ts theme={null} > { > id?: string, > name?: string, > messageListVisibility?: show | hide, > labelListVisibility?: labelShow | labelShowIfUnread | labelHide, > type?: system | user, > messagesTotal?: number, > messagesUnread?: number, > threadsTotal?: number, > threadsUnread?: number, > color?: { > textColor?: string, > backgroundColor?: string > } > }[] > ``` *** ### update `labels.update` Update an existing label **Risk:** `write` ```ts theme={null} await corsair.gmail.api.labels.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | | `label` | `object` | Yes | — | > **label full type** > > ```ts theme={null} > { > name?: string, > messageListVisibility?: show | hide, > labelListVisibility?: labelShow | labelShowIfUnread | labelHide, > color?: { > textColor?: string, > backgroundColor?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `messageListVisibility` | `show \| hide` | No | — | | `labelListVisibility` | `labelShow \| labelShowIfUnread \| labelHide` | No | — | | `type` | `system \| user` | No | — | | `messagesTotal` | `number` | No | — | | `messagesUnread` | `number` | No | — | | `threadsTotal` | `number` | No | — | | `threadsUnread` | `number` | No | — | | `color` | `object` | No | — | > **color full type** > > ```ts theme={null} > { > textColor?: string, > backgroundColor?: string > } > ``` *** ## Messages ### batchModify `messages.batchModify` Add or remove labels from multiple messages in bulk **Risk:** `write` ```ts theme={null} await corsair.gmail.api.messages.batchModify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `ids` | `string[]` | No | — | | `addLabelIds` | `string[]` | No | — | | `removeLabelIds` | `string[]` | No | — | **Output:** `void` *** ### get `messages.get` Get a specific message **Risk:** `read` ```ts theme={null} await corsair.gmail.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | | `format` | `minimal \| full \| raw \| metadata` | No | — | | `metadataHeaders` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `threadId` | `string` | No | — | | `labelIds` | `string[]` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `internalDate` | `string \| number \| Date` | No | — | | `sizeEstimate` | `number` | No | — | | `payload` | `object` | No | — | | `raw` | `string` | No | Full RFC 2822 message in base64url encoding (when format=raw). Not plain text — decode base64url before reading headers/body. | > **payload full type** > > ```ts theme={null} > { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > } > ``` *** ### list `messages.list` List messages in a mailbox **Risk:** `read` ```ts theme={null} await corsair.gmail.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `q` | `string` | No | — | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | | `labelIds` | `string[]` | No | — | | `includeSpamTrash` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | | `resultSizeEstimate` | `number` | No | — | > **messages full type** > > ```ts theme={null} > { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > }[] > ``` *** ### modify `messages.modify` Add or remove labels from a message **Risk:** `write` ```ts theme={null} await corsair.gmail.api.messages.modify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | | `addLabelIds` | `string[]` | No | — | | `removeLabelIds` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `threadId` | `string` | No | — | | `labelIds` | `string[]` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `internalDate` | `string \| number \| Date` | No | — | | `sizeEstimate` | `number` | No | — | | `payload` | `object` | No | — | | `raw` | `string` | No | Full RFC 2822 message in base64url encoding (when format=raw). Not plain text — decode base64url before reading headers/body. | > **payload full type** > > ```ts theme={null} > { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > } > ``` *** ### send `messages.send` Send an email to one or more recipients **Risk:** `write` ```ts theme={null} await corsair.gmail.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `raw` | `string` | Yes | Base64url-encoded RFC 2822 email — do NOT pass plain email text. Build the MIME message (From, To, Subject, Content-Type headers, blank line, body; lines separated by \r\n), then base64url-encode: standard base64, replace + with -, / with \_, remove trailing =. | | `threadId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `threadId` | `string` | No | — | | `labelIds` | `string[]` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `internalDate` | `string \| number \| Date` | No | — | | `sizeEstimate` | `number` | No | — | | `payload` | `object` | No | — | | `raw` | `string` | No | Full RFC 2822 message in base64url encoding (when format=raw). Not plain text — decode base64url before reading headers/body. | > **payload full type** > > ```ts theme={null} > { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > } > ``` *** ### trash `messages.trash` Move a message to the trash **Risk:** `write` ```ts theme={null} await corsair.gmail.api.messages.trash({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `threadId` | `string` | No | — | | `labelIds` | `string[]` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `internalDate` | `string \| number \| Date` | No | — | | `sizeEstimate` | `number` | No | — | | `payload` | `object` | No | — | | `raw` | `string` | No | Full RFC 2822 message in base64url encoding (when format=raw). Not plain text — decode base64url before reading headers/body. | > **payload full type** > > ```ts theme={null} > { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > } > ``` *** ### untrash `messages.untrash` Restore a message from the trash **Risk:** `write` ```ts theme={null} await corsair.gmail.api.messages.untrash({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `threadId` | `string` | No | — | | `labelIds` | `string[]` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `internalDate` | `string \| number \| Date` | No | — | | `sizeEstimate` | `number` | No | — | | `payload` | `object` | No | — | | `raw` | `string` | No | Full RFC 2822 message in base64url encoding (when format=raw). Not plain text — decode base64url before reading headers/body. | > **payload full type** > > ```ts theme={null} > { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > } > ``` *** ## Threads ### get `threads.get` Get a specific thread **Risk:** `read` ```ts theme={null} await corsair.gmail.api.threads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | | `format` | `minimal \| full \| metadata` | No | — | | `metadataHeaders` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > }[] > ``` *** ### list `threads.list` List threads in the mailbox **Risk:** `read` ```ts theme={null} await corsair.gmail.api.threads.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `q` | `string` | No | — | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | | `labelIds` | `string[]` | No | — | | `includeSpamTrash` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `threads` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | | `resultSizeEstimate` | `number` | No | — | > **threads full type** > > ```ts theme={null} > { > id?: string, > snippet?: string, > historyId?: string, > messages?: { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > }[] > }[] > ``` *** ### modify `threads.modify` Add or remove labels from a thread **Risk:** `write` ```ts theme={null} await corsair.gmail.api.threads.modify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | | `addLabelIds` | `string[]` | No | — | | `removeLabelIds` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > }[] > ``` *** ### trash `threads.trash` Move a thread to the trash **Risk:** `write` ```ts theme={null} await corsair.gmail.api.threads.trash({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > }[] > ``` *** ### untrash `threads.untrash` Restore a thread from the trash **Risk:** `write` ```ts theme={null} await corsair.gmail.api.threads.untrash({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `snippet` | `string` | No | — | | `historyId` | `string` | No | — | | `messages` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > { > id?: string, > threadId?: string, > labelIds?: string[], > snippet?: string, > historyId?: string, > internalDate?: string | number | Date | null, > sizeEstimate?: number, > payload?: { > partId?: string, > mimeType?: string, > filename?: string, > headers?: { > name?: string, > value?: string > }[], > body?: { > attachmentId?: string, > size?: number, > data?: string > }, > parts: lazy > }, > raw?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/gmail/database Gmail local sync: searchable entities, `.search()` filters, and operators. The Gmail plugin syncs data locally. Use `corsair.gmail.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Drafts Path: `gmail.db.drafts.search` ```ts theme={null} const rows = await corsair.gmail.db.drafts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `messageId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Labels Path: `gmail.db.labels.search` ```ts theme={null} const rows = await corsair.gmail.db.labels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `messagesTotal` | `number` | equals, gt, gte, lt, lte, in | | `messagesUnread` | `number` | equals, gt, gte, lt, lte, in | | `threadsTotal` | `number` | equals, gt, gte, lt, lte, in | | `threadsUnread` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `gmail.db.messages.search` ```ts theme={null} const rows = await corsair.gmail.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `threadId` | `string` | equals, contains, startsWith, endsWith, in | | `snippet` | `string` | equals, contains, startsWith, endsWith, in | | `historyId` | `string` | equals, contains, startsWith, endsWith, in | | `internalDate` | `string` | equals, contains, startsWith, endsWith, in | | `sizeEstimate` | `number` | equals, gt, gte, lt, lte, in | | `raw` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Threads Path: `gmail.db.threads.search` ```ts theme={null} const rows = await corsair.gmail.db.threads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `snippet` | `string` | equals, contains, startsWith, endsWith, in | | `historyId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/gmail/get-credentials Step-by-step instructions for obtaining Gmail OAuth 2.0 credentials. This guide walks you through obtaining all required credentials for the Gmail plugin. ## Authentication Method The Gmail plugin uses OAuth 2.0 authentication exclusively. * **[`oauth_2`](/concepts/oauth)** (default) - OAuth 2.0 authentication ## OAuth 2.0 Setup ### Step 1: Create Google Cloud Project 1. Go to [Google Cloud Console](https://console.cloud.google.com/) 2. Click **Select a project** → **New Project** 3. Enter a project name and click **Create** 4. Wait for the project to be created and select it ### Step 2: Enable Gmail API 1. In the Google Cloud Console, go to **APIs & Services** → **Library** 2. Search for "Gmail API" 3. Click on **Gmail API** 4. Click **Enable** ### Step 3: Create OAuth 2.0 Credentials 1. Go to **APIs & Services** → **Credentials** 2. Click **Create Credentials** → **OAuth client ID** 3. If prompted, configure the OAuth consent screen: * Choose **External** (unless you have a Google Workspace) * Fill in the required information: * App name * User support email * Developer contact information * Add scopes: * `https://www.googleapis.com/auth/gmail.modify` * Add test users (for testing) * Click **Save and Continue** through all steps 4. Back in **Credentials**, click **Create Credentials** → **OAuth client ID** 5. Select **Web application** 6. Configure: * **Name**: Your application name * **Authorized redirect URIs**: Add your callback URL (e.g., `https://yourapp.com/auth/gmail/callback`) 7. Click **Create** 8. Copy the **Client ID** and **Client Secret** 9. Store these securely **Storing Credentials:** The preferred method is to store OAuth credentials in the database using the keys API: ```ts theme={null} await corsair.withTenant('default').keys.gmail.setClientId('your-client-id'); await corsair.withTenant('default').keys.gmail.setClientSecret('your-client-secret'); await corsair.withTenant('default').gmail.keys.setAccessToken('your-access-token'); await corsair.withTenant('default').gmail.keys.setRefreshToken('your-refresh-token'); ``` Alternatively, you can provide credentials directly in the plugin configuration: ```ts corsair.ts theme={null} gmail({ authType: "oauth_2", credentials: { clientId: process.env.GMAIL_CLIENT_ID, clientSecret: process.env.GMAIL_CLIENT_SECRET, accessToken: process.env.GMAIL_ACCESS_TOKEN, refreshToken: process.env.GMAIL_REFRESH_TOKEN, }, }) ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials | | Client Secret | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials | | Access Token | OAuth 2.0 | Obtained automatically after OAuth flow | | Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/gmail/overview Google email service for sending, reading, organizing messages, labels, and inbox automation. Use **Gmail** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 23 typed API operations * 4 synced entities (`drafts`, `labels`, `messages`, `threads`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/gmail ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/gmail ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/gmail ``` ```bash bun theme={null} bun add corsair @corsair-dev/gmail ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { gmail } from '@corsair-dev/gmail'; export const corsair = createCorsair({ plugins: [ gmail(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Gmail OAuth app. Provider walkthrough: [Get Credentials](/plugins/gmail/get-credentials). ```ts theme={null} gmail() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'gmail', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List messages** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.gmail.api.messages.list({}); ``` **Send an email** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.gmail.api.messages.send({ raw: 'RnJvbTogbWVAZXhhbXBsZS5jb20NClRvOiB0ZWFtbWF0ZUBleGFtcGxlLmNvbQ0KU3ViamVjdDogSGVsbG8gZnJvbSBDb3JzYWlyDQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9dXRmLTgNCg0KSGVsbG8gZnJvbSBDb3JzYWly' }); ``` See the full list on the [API](/plugins/gmail/api) page. ## Query synced data Search synced messages without hitting Gmail. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.gmail.db.messages.search({ data: {}, limit: 50, }); ``` Synced entities: `drafts`, `labels`, `messages`, `threads`. See [Database](/plugins/gmail/database) for filters and operators. ## Webhooks Fires when a Gmail message is received, deleted, or has its labels changed. ```ts theme={null} gmail({ webhookHooks: { messageChanged: { after: async (ctx, result) => { console.log('Gmail event:', result.data); } }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/gmail/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/gmail/api)** > > Every `gmail.api.*` operation with input and output types. > **[Database](/plugins/gmail/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/gmail/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/gmail/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/gmail/webhooks Gmail incoming webhooks: event paths, payloads, and response data. The Gmail plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/gmail/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `messageChanged` (`messageChanged`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Message Changed ### Message Changed `messageChanged` A Gmail message was received, deleted, or had its labels changed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | No | — | | `subscription` | `string` | No | — | | `event` | `any` | No | — | > **message full type** > > ```ts theme={null} > { > data?: string, > attributes?: { > }, > messageId?: string, > publishTime?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: messageReceived, > emailAddress: string, > historyId: string, > message: custom > } | { > type: messageDeleted, > emailAddress: string, > historyId: string, > message: custom > } | { > type: messageLabelChanged, > emailAddress: string, > historyId: string, > message: custom, > labelsAdded?: string[], > labelsRemoved?: string[] > } > ``` **`webhookHooks` example** ```ts theme={null} gmail({ webhookHooks: { messageChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/googleaddressvalidation/api API reference for Google Address Validation: every `googleaddressvalidation.api.*` operation with input and output types. Every `googleaddressvalidation.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Address ### provideFeedback `address.provideFeedback` Report the outcome of a previous address validation sequence back to Google **Risk:** `write` ```ts theme={null} await corsair.googleaddressvalidation.api.address.provideFeedback({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conclusion` | `VALIDATED_VERSION_USED \| USER_VERSION_USED \| UNVALIDATED_VERSION_USED \| UNUSED` | Yes | — | | `responseId` | `string` | Yes | — | **Output:** *empty object* *** ### validate `address.validate` Validate a postal address and get standardized results **Risk:** `read` ```ts theme={null} await corsair.googleaddressvalidation.api.address.validate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `address` | `object` | Yes | — | | `previousResponseId` | `string` | No | — | | `enableUspsCass` | `boolean` | No | — | | `languageOptions` | `object` | No | — | | `sessionToken` | `string` | No | — | > **address full type** > > ```ts theme={null} > { > revision?: 0, > regionCode?: string, > languageCode?: string, > postalCode?: string, > sortingCode?: string, > administrativeArea?: string, > locality?: string, > sublocality?: string, > addressLines: string[], > recipients?: string[], > organization?: string > } > ``` > **languageOptions full type** > > ```ts theme={null} > { > returnEnglishLatinAddress?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `object` | Yes | — | | `responseId` | `string` | Yes | — | > **result full type** > > ```ts theme={null} > { > verdict?: { > inputGranularity?: GRANULARITY_UNSPECIFIED | SUB_PREMISE | PREMISE | PREMISE_PROXIMITY | BLOCK | ROUTE | OTHER, > validationGranularity?: GRANULARITY_UNSPECIFIED | SUB_PREMISE | PREMISE | PREMISE_PROXIMITY | BLOCK | ROUTE | OTHER, > geocodeGranularity?: GRANULARITY_UNSPECIFIED | SUB_PREMISE | PREMISE | PREMISE_PROXIMITY | BLOCK | ROUTE | OTHER, > addressComplete?: boolean, > hasUnconfirmedComponents?: boolean, > hasInferredComponents?: boolean, > hasReplacedComponents?: boolean, > hasSpellCorrectedComponents?: boolean, > possibleNextAction?: POSSIBLE_NEXT_ACTION_UNSPECIFIED | FIX | CONFIRM_ADD_SUBPREMISES | CONFIRM | ACCEPT > }, > address?: { > formattedAddress?: string, > postalAddress?: { > revision?: 0, > regionCode?: string, > languageCode?: string, > postalCode?: string, > sortingCode?: string, > administrativeArea?: string, > locality?: string, > sublocality?: string, > addressLines?: string[], > recipients?: string[], > organization?: string > }, > addressComponents?: { > componentName?: { > text?: string, > languageCode?: string > }, > componentType?: string, > confirmationLevel?: CONFIRMATION_LEVEL_UNSPECIFIED | CONFIRMED | UNCONFIRMED_BUT_PLAUSIBLE | UNCONFIRMED_AND_SUSPICIOUS, > inferred?: boolean, > spellCorrected?: boolean, > replaced?: boolean, > unexpected?: boolean > }[], > missingComponentTypes?: string[], > unconfirmedComponentTypes?: string[], > unresolvedTokens?: string[] > }, > geocode?: { > location?: { > latitude?: number, > longitude?: number > }, > plusCode?: { > globalCode?: string, > compoundCode?: string > }, > bounds?: { > low?: { > latitude?: number, > longitude?: number > }, > high?: { > latitude?: number, > longitude?: number > } > }, > featureSizeMeters?: number, > placeId?: string, > placeTypes?: string[] > }, > metadata?: { > business?: boolean, > poBox?: boolean, > residential?: boolean > }, > uspsData?: { > standardizedAddress?: { > firstAddressLine?: string, > firm?: string, > secondAddressLine?: string, > urbanization?: string, > cityStateZipAddressLine?: string, > city?: string, > state?: string, > zipCode?: string, > zipCodeExtension?: string > }, > deliveryPointCode?: string, > deliveryPointCheckDigit?: string, > dpvConfirmation?: string, > dpvFootnote?: string, > dpvCmra?: string, > dpvVacant?: string, > dpvNoStat?: string, > dpvNoStatReasonCode?: number, > dpvDrop?: string, > dpvThrowback?: string, > dpvNonDeliveryDays?: string, > dpvNonDeliveryDaysValues?: number, > dpvNoSecureLocation?: string, > dpvPbsa?: string, > dpvDoorNotAccessible?: string, > dpvEnhancedDeliveryCode?: string, > carrierRoute?: string, > carrierRouteIndicator?: string, > ewsNoMatch?: boolean, > postOfficeCity?: string, > postOfficeState?: string, > abbreviatedCity?: string, > fipsCountyCode?: string, > county?: string, > elotNumber?: string, > elotFlag?: string, > lacsLinkReturnCode?: string, > lacsLinkIndicator?: string, > poBoxOnlyPostalCode?: boolean, > suitelinkFootnote?: string, > pmbDesignator?: string, > pmbNumber?: string, > addressRecordType?: string, > defaultAddress?: boolean, > errorMessage?: string, > cassProcessed?: boolean > }, > englishLatinAddress?: { > formattedAddress?: string, > postalAddress?: { > revision?: 0, > regionCode?: string, > languageCode?: string, > postalCode?: string, > sortingCode?: string, > administrativeArea?: string, > locality?: string, > sublocality?: string, > addressLines?: string[], > recipients?: string[], > organization?: string > }, > addressComponents?: { > componentName?: { > text?: string, > languageCode?: string > }, > componentType?: string, > confirmationLevel?: CONFIRMATION_LEVEL_UNSPECIFIED | CONFIRMED | UNCONFIRMED_BUT_PLAUSIBLE | UNCONFIRMED_AND_SUSPICIOUS, > inferred?: boolean, > spellCorrected?: boolean, > replaced?: boolean, > unexpected?: boolean > }[], > missingComponentTypes?: string[], > unconfirmedComponentTypes?: string[], > unresolvedTokens?: string[] > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/googleaddressvalidation/database Google Address Validation local sync: searchable entities, `.search()` filters, and operators. The Google Address Validation plugin syncs data locally. Use `corsair.googleaddressvalidation.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/googleaddressvalidation/overview Google API for validating, standardizing, and geocoding postal addresses worldwide. Use **Google Address Validation** through Corsair: one client, typed API calls. **What you get:** * 2 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googleaddressvalidation ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googleaddressvalidation ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googleaddressvalidation ``` ```bash bun theme={null} bun add corsair @corsair-dev/googleaddressvalidation ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googleaddressvalidation } from '@corsair-dev/googleaddressvalidation'; export const corsair = createCorsair({ plugins: [ googleaddressvalidation(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} googleaddressvalidation() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googleaddressvalidation', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`address.validate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googleaddressvalidation.api.address.validate({}); ``` **`address.provideFeedback`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googleaddressvalidation.api.address.provideFeedback({}); ``` See the full list on the [API](/plugins/googleaddressvalidation/api) page. ## What's next > **[API reference](/plugins/googleaddressvalidation/api)** > > Every `googleaddressvalidation.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/googleanalytics/api API reference for Google Analytics: every `googleanalytics.api.*` operation with input and output types. Every `googleanalytics.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### get `accounts.get` Lookup a single Google Analytics account **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.accounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `displayName` | `string` | No | — | | `regionCode` | `string` | No | — | | `countryCode` | `string` | No | — | | `createTime` | `string` | No | — | | `updateTime` | `string` | No | — | | `createdAt` | `Date` | No | — | *** ### getDataSharingSettings `accounts.getDataSharingSettings` Get data sharing settings for an account **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.accounts.getDataSharingSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `accounts.list` List accounts accessible to the caller \[DEPRECATED: use accounts.listV1Beta] **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.accounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accounts` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **accounts full type** > > ```ts theme={null} > { > }[] > ``` *** ### listSummaries `accounts.listSummaries` List summaries of all accessible accounts and their properties **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.accounts.listSummaries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountSummaries` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **accountSummaries full type** > > ```ts theme={null} > { > }[] > ``` *** ### listV1Beta `accounts.listV1Beta` List accounts accessible to the caller (v1beta) **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.accounts.listV1Beta({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accounts` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **accounts full type** > > ```ts theme={null} > { > }[] > ``` *** ### provisionAccountTicket `accounts.provisionAccountTicket` Request a ticket for creating a Google Analytics account **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.accounts.provisionAccountTicket({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `any` | No | — | | `redirectUri` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Audience Exports ### create `audienceExports.create` Create an audience export for later retrieval of users **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.audienceExports.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `audienceExport` | `any` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `audienceExports.get` Get metadata about an audience export **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.audienceExports.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `audienceExports.list` List audience exports on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.audienceExports.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `audienceExports` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **audienceExports full type** > > ```ts theme={null} > { > }[] > ``` *** ### query `audienceExports.query` Retrieve user rows from an audience export **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.audienceExports.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Audience Lists ### create `audienceLists.create` Create an audience list for later retrieval of users **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.audienceLists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `audienceList` | `any` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `audienceLists.get` Get metadata about an audience list **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.audienceLists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `audienceLists.list` List audience lists on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.audienceLists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `audienceLists` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **audienceLists full type** > > ```ts theme={null} > { > }[] > ``` *** ### query `audienceLists.query` Retrieve user rows from an audience list **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.audienceLists.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `returnAllRows` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Audiences ### get `audiences.get` Lookup a single audience configuration **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.audiences.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `audiences.list` List audiences on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.audiences.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `audiences` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **audiences full type** > > ```ts theme={null} > { > }[] > ``` *** ## Calculated Metrics ### list `calculatedMetrics.list` List calculated metrics on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.calculatedMetrics.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `calculatedMetrics` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **calculatedMetrics full type** > > ```ts theme={null} > { > }[] > ``` *** ## Channel Groups ### list `channelGroups.list` List channel groups on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.channelGroups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `channelGroups` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **channelGroups full type** > > ```ts theme={null} > { > }[] > ``` *** ## Conversion Events ### list `conversionEvents.list` List conversion events \[DEPRECATED: use keyEvents.list] **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.conversionEvents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `conversionEvents` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **conversionEvents full type** > > ```ts theme={null} > { > }[] > ``` *** ## Custom Dimensions ### archive `customDimensions.archive` Archive a custom dimension on a property \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googleanalytics.api.customDimensions.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### create `customDimensions.create` Create a custom dimension on a property **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.customDimensions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `customDimension` | `any` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `customDimensions.get` Lookup a single custom dimension **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.customDimensions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `customDimensions.list` List custom dimensions on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.customDimensions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `customDimensions` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **customDimensions full type** > > ```ts theme={null} > { > }[] > ``` *** ## Custom Metrics ### create `customMetrics.create` Create a custom metric on a property **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.customMetrics.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `customMetric` | `any` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `customMetrics.list` List custom metrics on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.customMetrics.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `customMetrics` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **customMetrics full type** > > ```ts theme={null} > { > }[] > ``` *** ## Data Streams ### list `dataStreams.list` List data streams on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.dataStreams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dataStreams` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **dataStreams full type** > > ```ts theme={null} > { > }[] > ``` *** ### listEventCreateRules `dataStreams.listEventCreateRules` List event create rules on a web data stream **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.dataStreams.listEventCreateRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `eventCreateRules` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **eventCreateRules full type** > > ```ts theme={null} > { > }[] > ``` *** ### listMeasurementProtocolSecrets `dataStreams.listMeasurementProtocolSecrets` List measurement protocol secrets under a data stream **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.dataStreams.listMeasurementProtocolSecrets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `measurementProtocolSecrets` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **measurementProtocolSecrets full type** > > ```ts theme={null} > { > }[] > ``` *** ### listSKAdNetworkConversionValueSchemas `dataStreams.listSKAdNetworkConversionValueSchemas` List SKAdNetwork conversion value schemas on an iOS data stream **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.dataStreams.listSKAdNetworkConversionValueSchemas({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sKAdNetworkConversionValueSchemas` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **sKAdNetworkConversionValueSchemas full type** > > ```ts theme={null} > { > }[] > ``` *** ## Expanded Data Sets ### create `expandedDataSets.create` Create an expanded data set on a property **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.expandedDataSets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `expandedDataSet` | `any` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `expandedDataSets.list` List expanded data sets on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.expandedDataSets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `expandedDataSets` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **expandedDataSets full type** > > ```ts theme={null} > { > }[] > ``` *** ## Key Events ### get `keyEvents.get` Lookup a single key event (conversion) **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.keyEvents.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `keyEvents.list` List key events on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.keyEvents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `keyEvents` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **keyEvents full type** > > ```ts theme={null} > { > }[] > ``` *** ## Links ### listAdSense `links.listAdSense` List AdSense links on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.links.listAdSense({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `adSenseLinks` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **adSenseLinks full type** > > ```ts theme={null} > { > }[] > ``` *** ### listBigQuery `links.listBigQuery` List BigQuery links on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.links.listBigQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bigqueryLinks` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **bigqueryLinks full type** > > ```ts theme={null} > { > }[] > ``` *** ### listDV360Advertiser `links.listDV360Advertiser` List Display & Video 360 advertiser links on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.links.listDV360Advertiser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `displayVideo360AdvertiserLinks` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **displayVideo360AdvertiserLinks full type** > > ```ts theme={null} > { > }[] > ``` *** ### listDV360Proposals `links.listDV360Proposals` List Display & Video 360 advertiser link proposals on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.links.listDV360Proposals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `displayVideo360AdvertiserLinkProposals` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **displayVideo360AdvertiserLinkProposals full type** > > ```ts theme={null} > { > }[] > ``` *** ### listFirebase `links.listFirebase` List Firebase links on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.links.listFirebase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `firebaseLinks` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **firebaseLinks full type** > > ```ts theme={null} > { > }[] > ``` *** ### listGoogleAds `links.listGoogleAds` List Google Ads links on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.links.listGoogleAds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `googleAdsLinks` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **googleAdsLinks full type** > > ```ts theme={null} > { > }[] > ``` *** ### listSearchAds360 `links.listSearchAds360` List Search Ads 360 links on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.links.listSearchAds360({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `searchAds360Links` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **searchAds360Links full type** > > ```ts theme={null} > { > }[] > ``` *** ## Measurement Protocol ### sendEvents `measurementProtocol.sendEvents` Send events to GA4 via the Measurement Protocol. Requires the stream api\_secret (not the OAuth token) plus measurementId (web) or firebaseAppId (app) **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.measurementProtocol.sendEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiSecret` | `string` | Yes | — | | `measurementId` | `string` | No | — | | `firebaseAppId` | `string` | No | — | | `clientId` | `string` | No | — | | `appInstanceId` | `string` | No | — | | `userId` | `string` | No | — | | `timestampMicros` | `number` | No | — | | `userProperties` | `object` | No | — | | `consent` | `any` | No | — | | `events` | `object[]` | Yes | — | > **userProperties full type** > > ```ts theme={null} > { > } > ``` > **events full type** > > ```ts theme={null} > { > name: string, > params?: any > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### validateEvents `measurementProtocol.validateEvents` Validate Measurement Protocol events against the debug endpoint before sending. Requires the stream api\_secret **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.measurementProtocol.validateEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiSecret` | `string` | Yes | — | | `measurementId` | `string` | No | — | | `firebaseAppId` | `string` | No | — | | `clientId` | `string` | No | — | | `appInstanceId` | `string` | No | — | | `userId` | `string` | No | — | | `timestampMicros` | `number` | No | — | | `userProperties` | `object` | No | — | | `consent` | `any` | No | — | | `events` | `object[]` | Yes | — | > **userProperties full type** > > ```ts theme={null} > { > } > ``` > **events full type** > > ```ts theme={null} > { > name: string, > params?: any > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Properties ### createRollup `properties.createRollup` Create a roll-up property aggregating multiple properties **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.properties.createRollup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rollupProperty` | `any` | No | — | | `sourceProperties` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `properties.get` Lookup a single GA4 property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.properties.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `parent` | `string` | No | — | | `displayName` | `string` | No | — | | `propertyType` | `string` | No | — | | `timeZone` | `string` | No | — | | `currencyCode` | `string` | No | — | | `industryCategory` | `string` | No | — | | `account` | `string` | No | — | | `createTime` | `string` | No | — | | `updateTime` | `string` | No | — | | `createdAt` | `Date` | No | — | *** ### getAttributionSettings `properties.getAttributionSettings` Get attribution settings for a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.properties.getAttributionSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getDataRetentionSettings `properties.getDataRetentionSettings` Get data retention settings for a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.properties.getDataRetentionSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getGoogleSignalsSettings `properties.getGoogleSignalsSettings` Get Google Signals settings for a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.properties.getGoogleSignalsSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPropertyQuotasSnapshot `properties.getPropertyQuotasSnapshot` Get a snapshot of property quota usage by category **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.properties.getPropertyQuotasSnapshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `properties.list` List child properties under an account \[DEPRECATED: use properties.listFiltered] **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.properties.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `filter` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `properties` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > }[] > ``` *** ### listFiltered `properties.listFiltered` List GA4 properties matching a filter **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.properties.listFiltered({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `filter` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `properties` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > }[] > ``` *** ### update `properties.update` Update a GA4 property **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.properties.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `property` | `object` | Yes | — | | `updateMask` | `string` | No | — | > **property full type** > > ```ts theme={null} > { > name: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Recurring Audience Lists ### create `recurringAudienceLists.create` Create a recurring audience list that refreshes daily **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.recurringAudienceLists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `recurringAudienceList` | `any` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `recurringAudienceLists.get` Get metadata about a recurring audience list **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.recurringAudienceLists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `recurringAudienceLists.list` List recurring audience lists on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.recurringAudienceLists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `recurringAudienceLists` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **recurringAudienceLists full type** > > ```ts theme={null} > { > }[] > ``` *** ## Reporting Data ### listAnnotations `reportingData.listAnnotations` List reporting data annotations on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reportingData.listAnnotations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `reportingDataAnnotations` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **reportingDataAnnotations full type** > > ```ts theme={null} > { > }[] > ``` *** ### listSubpropertyEventFilters `reportingData.listSubpropertyEventFilters` List subproperty event filters on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reportingData.listSubpropertyEventFilters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subpropertyEventFilters` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **subpropertyEventFilters full type** > > ```ts theme={null} > { > }[] > ``` *** ### listSubpropertySyncConfigs `reportingData.listSubpropertySyncConfigs` List subproperty sync configs on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reportingData.listSubpropertySyncConfigs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subpropertySyncConfigs` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **subpropertySyncConfigs full type** > > ```ts theme={null} > { > }[] > ``` *** ## Reports ### batchRun `reports.batchRun` Run multiple reports in a single batch request **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reports.batchRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `property` | `string` | Yes | — | | `requests` | `object[]` | No | — | > **requests full type** > > ```ts theme={null} > { > dateRanges?: { > startDate?: string, > endDate?: string, > name?: string > }[], > dimensions?: { > name: string, > dimensionExpression?: any > }[], > metrics?: { > name?: string, > expression?: string, > invisible?: boolean > }[], > dimensionFilter?: any, > metricFilter?: any, > orderBys?: any[], > limit?: number, > offset?: number, > metricAggregations?: string[], > currencyCode?: string, > keepEmptyRows?: boolean, > returnPropertyQuota?: boolean > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### batchRunPivot `reports.batchRunPivot` Run multiple pivot reports in a single batch request **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reports.batchRunPivot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `property` | `string` | Yes | — | | `requests` | `any[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### checkCompatibility `reports.checkCompatibility` List dimensions and metrics compatible with a report request **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reports.checkCompatibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `property` | `string` | Yes | — | | `dateRanges` | `object[]` | No | — | | `dimensions` | `object[]` | No | — | | `metrics` | `object[]` | No | — | | `dimensionFilter` | `any` | No | — | | `metricFilter` | `any` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `orderBys` | `any[]` | No | — | | `returnPropertyQuota` | `boolean` | No | — | > **dateRanges full type** > > ```ts theme={null} > { > startDate?: string, > endDate?: string, > name?: string > }[] > ``` > **dimensions full type** > > ```ts theme={null} > { > name: string, > dimensionExpression?: any > }[] > ``` > **metrics full type** > > ```ts theme={null} > { > name?: string, > expression?: string, > invisible?: boolean > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMetadata `reports.getMetadata` Get metadata for available dimensions and metrics. Use apiNames from here in report requests **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reports.getMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### run `reports.run` Run a customized GA4 report. Derive dimension/metric apiNames from reports.getMetadata **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reports.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dateRanges` | `object[]` | No | — | | `dimensions` | `object[]` | No | — | | `metrics` | `object[]` | No | — | | `dimensionFilter` | `any` | No | — | | `metricFilter` | `any` | No | — | | `orderBys` | `any[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `metricAggregations` | `string[]` | No | — | | `currencyCode` | `string` | No | — | | `keepEmptyRows` | `boolean` | No | — | | `returnPropertyQuota` | `boolean` | No | — | | `property` | `string` | Yes | — | > **dateRanges full type** > > ```ts theme={null} > { > startDate?: string, > endDate?: string, > name?: string > }[] > ``` > **dimensions full type** > > ```ts theme={null} > { > name: string, > dimensionExpression?: any > }[] > ``` > **metrics full type** > > ```ts theme={null} > { > name?: string, > expression?: string, > invisible?: boolean > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### runFunnel `reports.runFunnel` Run a customized funnel report **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reports.runFunnel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `property` | `string` | Yes | — | | `funnel` | `any` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### runPivot `reports.runPivot` Run a customized pivot report **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reports.runPivot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `property` | `string` | Yes | — | | `dateRanges` | `object[]` | No | — | | `dimensions` | `object[]` | No | — | | `metrics` | `object[]` | No | — | | `pivots` | `any[]` | No | — | | `dimensionFilter` | `any` | No | — | | `metricFilter` | `any` | No | — | | `orderBys` | `any[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `returnPropertyQuota` | `boolean` | No | — | > **dateRanges full type** > > ```ts theme={null} > { > startDate?: string, > endDate?: string, > name?: string > }[] > ``` > **dimensions full type** > > ```ts theme={null} > { > name: string, > dimensionExpression?: any > }[] > ``` > **metrics full type** > > ```ts theme={null} > { > name?: string, > expression?: string, > invisible?: boolean > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### runRealtime `reports.runRealtime` Run a realtime report (last 30-60 minutes) **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reports.runRealtime({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `property` | `string` | Yes | — | | `dimensions` | `object[]` | No | — | | `metrics` | `object[]` | No | — | | `dimensionFilter` | `any` | No | — | | `metricFilter` | `any` | No | — | | `orderBys` | `any[]` | No | — | | `limit` | `number` | No | — | | `metricAggregations` | `string[]` | No | — | | `returnPropertyQuota` | `boolean` | No | — | | `minuteRanges` | `any[]` | No | — | > **dimensions full type** > > ```ts theme={null} > { > name: string, > dimensionExpression?: any > }[] > ``` > **metrics full type** > > ```ts theme={null} > { > name?: string, > expression?: string, > invisible?: boolean > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Report Tasks ### create `reportTasks.create` Create an asynchronous report task **Risk:** `write` ```ts theme={null} await corsair.googleanalytics.api.reportTasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `reportTask` | `any` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `reportTasks.get` Get metadata about a report task **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reportTasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `reportTasks.list` List report tasks on a property **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reportTasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `parent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `reportTasks` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **reportTasks full type** > > ```ts theme={null} > { > }[] > ``` *** ### query `reportTasks.query` Retrieve a report task content (only when ACTIVE) **Risk:** `read` ```ts theme={null} await corsair.googleanalytics.api.reportTasks.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/googleanalytics/database Google Analytics local sync: searchable entities, `.search()` filters, and operators. The Google Analytics plugin syncs data locally. Use `corsair.googleanalytics.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `googleanalytics.db.accounts.search` ```ts theme={null} const rows = await corsair.googleanalytics.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `regionCode` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `createTime` | `string` | equals, contains, startsWith, endsWith, in | | `updateTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Properties Path: `googleanalytics.db.properties.search` ```ts theme={null} const rows = await corsair.googleanalytics.db.properties.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `parent` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `propertyType` | `string` | equals, contains, startsWith, endsWith, in | | `timeZone` | `string` | equals, contains, startsWith, endsWith, in | | `currencyCode` | `string` | equals, contains, startsWith, endsWith, in | | `industryCategory` | `string` | equals, contains, startsWith, endsWith, in | | `account` | `string` | equals, contains, startsWith, endsWith, in | | `createTime` | `string` | equals, contains, startsWith, endsWith, in | | `updateTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/googleanalytics/overview Google Analytics 4 plugin for Corsair Use **Google Analytics** through Corsair: one client, typed API calls, local DB sync. GA4 Admin API, Data API, and Measurement Protocol. Listing measurement protocol secrets returns stream api\_secret values and counts as a write. **What you get:** * 69 typed API operations * 2 synced entities (`accounts`, `properties`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googleanalytics ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googleanalytics ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googleanalytics ``` ```bash bun theme={null} bun add corsair @corsair-dev/googleanalytics ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googleanalytics } from '@corsair-dev/googleanalytics'; export const corsair = createCorsair({ plugins: [ googleanalytics(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Google Analytics OAuth app. ```ts theme={null} googleanalytics() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googleanalytics', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googleanalytics.api.accounts.get({}); ``` **`accounts.provisionAccountTicket`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googleanalytics.api.accounts.provisionAccountTicket({}); ``` See the full list on the [API](/plugins/googleanalytics/api) page. ## Query synced data Synced entities support `tenant.googleanalytics.db..search()` and `.list()`: `accounts`, `properties`. See [Database](/plugins/googleanalytics/database) for filters and operators. ## What's next > **[API reference](/plugins/googleanalytics/api)** > > Every `googleanalytics.api.*` operation with input and output types. > **[Database](/plugins/googleanalytics/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/googlebigquery/api API reference for Google BigQuery: every `googlebigquery.api.*` operation with input and output types. Every `googlebigquery.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Analytics Hub ### createDataExchange `analyticsHub.createDataExchange` Create a new data exchange **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.analyticsHub.createDataExchange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `dataExchangeId` | `string` | Yes | — | | `displayName` | `string` | Yes | — | | `description` | `string` | No | — | | `primaryContact` | `string` | No | — | | `documentation` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `primaryContact` | `string` | No | — | | `documentation` | `string` | No | — | | `listingCount` | `number` | No | — | *** ### createListing `analyticsHub.createListing` Create a new listing (shareable dataset) in a data exchange **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.analyticsHub.createListing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `dataExchangeId` | `string` | Yes | — | | `listingId` | `string` | Yes | — | | `displayName` | `string` | Yes | — | | `description` | `string` | No | — | | `primaryContact` | `string` | No | — | | `bigqueryDataset` | `object` | No | — | > **bigqueryDataset full type** > > ```ts theme={null} > { > dataset?: string, > selectedResources?: { > table?: string, > view?: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `primaryContact` | `string` | No | — | | `documentation` | `string` | No | — | | `state` | `STATE_UNSPECIFIED \| ACTIVE` | No | — | | `categories` | `string[]` | No | — | | `bigqueryDataset` | `object` | No | — | > **bigqueryDataset full type** > > ```ts theme={null} > { > dataset?: string, > selectedResources?: { > table?: string, > view?: string > }[] > } > ``` *** ### createQueryTemplate `analyticsHub.createQueryTemplate` Create a new query template in a data exchange **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.analyticsHub.createQueryTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `dataExchangeId` | `string` | Yes | — | | `displayName` | `string` | Yes | — | | `query` | `string` | Yes | — | | `description` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listDataexchangesListings `analyticsHub.listDataexchangesListings` List data exchanges in a location **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.analyticsHub.listDataexchangesListings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dataExchanges` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **dataExchanges full type** > > ```ts theme={null} > { > name?: string, > displayName?: string, > description?: string, > primaryContact?: string, > documentation?: string, > listingCount?: number > }[] > ``` *** ### listListings `analyticsHub.listListings` List listings in a data exchange **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.analyticsHub.listListings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `dataExchangeId` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `listings` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **listings full type** > > ```ts theme={null} > { > name?: string, > displayName?: string, > description?: string, > primaryContact?: string, > documentation?: string, > state?: STATE_UNSPECIFIED | ACTIVE, > categories?: string[], > bigqueryDataset?: { > dataset?: string, > selectedResources?: { > table?: string, > view?: string > }[] > } > }[] > ``` *** ### listOrganizationDataExchanges `analyticsHub.listOrganizationDataExchanges` List data exchanges across an organization **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.analyticsHub.listOrganizationDataExchanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dataExchanges` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **dataExchanges full type** > > ```ts theme={null} > { > name?: string, > displayName?: string, > description?: string, > primaryContact?: string, > documentation?: string, > listingCount?: number > }[] > ``` *** ### listQueryTemplates `analyticsHub.listQueryTemplates` List query templates in a data exchange **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.analyticsHub.listQueryTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `dataExchangeId` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `queryTemplates` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **queryTemplates full type** > > ```ts theme={null} > { > }[] > ``` *** ## Connections ### create `connections.create` Create a new external data source connection **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.connections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `connectionId` | `string` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `cloudSql` | `object` | No | — | | `cloudResource` | `object` | No | — | | `aws` | `object` | No | — | | `azure` | `object` | No | — | > **cloudSql full type** > > ```ts theme={null} > { > instanceId?: string, > database?: string, > type?: DATABASE_TYPE_UNSPECIFIED | POSTGRES | MYSQL, > credential?: { > username?: string, > password?: string > } > } > ``` > **cloudResource full type** > > ```ts theme={null} > { > serviceAccountId?: string > } > ``` > **aws full type** > > ```ts theme={null} > { > crossAccountRole?: { > iamRoleId?: string > }, > accessRole?: { > iamRoleId?: string > } > } > ``` > **azure full type** > > ```ts theme={null} > { > application?: string, > clientId?: string, > objectId?: string, > customerTenantId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `hasCredential` | `boolean` | No | — | | `cloudSql` | `object` | No | — | | `cloudResource` | `object` | No | — | | `aws` | `object` | No | — | | `azure` | `object` | No | — | > **cloudSql full type** > > ```ts theme={null} > { > instanceId?: string, > database?: string, > type?: DATABASE_TYPE_UNSPECIFIED | POSTGRES | MYSQL, > credential?: { > username?: string, > password?: string > } > } > ``` > **cloudResource full type** > > ```ts theme={null} > { > serviceAccountId?: string > } > ``` > **aws full type** > > ```ts theme={null} > { > crossAccountRole?: { > iamRoleId?: string > }, > accessRole?: { > iamRoleId?: string > } > } > ``` > **azure full type** > > ```ts theme={null} > { > application?: string, > clientId?: string, > objectId?: string, > customerTenantId?: string > } > ``` *** ### listBigQueryConnections `connections.listBigQueryConnections` List BigQuery connections across all locations **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.connections.listBigQueryConnections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | No | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `connections` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **connections full type** > > ```ts theme={null} > { > name?: string, > friendlyName?: string, > description?: string, > creationTime?: string, > lastModifiedTime?: string, > hasCredential?: boolean, > cloudSql?: { > instanceId?: string, > database?: string, > type?: DATABASE_TYPE_UNSPECIFIED | POSTGRES | MYSQL, > credential?: { > username?: string, > password?: string > } > }, > cloudResource?: { > serviceAccountId?: string > }, > aws?: { > crossAccountRole?: { > iamRoleId?: string > }, > accessRole?: { > iamRoleId?: string > } > }, > azure?: { > application?: string, > clientId?: string, > objectId?: string, > customerTenantId?: string > } > }[] > ``` *** ### listLocationsConnections `connections.listLocationsConnections` List BigQuery connections in a specific location **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.connections.listLocationsConnections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `connections` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **connections full type** > > ```ts theme={null} > { > name?: string, > friendlyName?: string, > description?: string, > creationTime?: string, > lastModifiedTime?: string, > hasCredential?: boolean, > cloudSql?: { > instanceId?: string, > database?: string, > type?: DATABASE_TYPE_UNSPECIFIED | POSTGRES | MYSQL, > credential?: { > username?: string, > password?: string > } > }, > cloudResource?: { > serviceAccountId?: string > }, > aws?: { > crossAccountRole?: { > iamRoleId?: string > }, > accessRole?: { > iamRoleId?: string > } > }, > azure?: { > application?: string, > clientId?: string, > objectId?: string, > customerTenantId?: string > } > }[] > ``` *** ### update `connections.update` Update an existing connection **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.connections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `connectionId` | `string` | Yes | — | | `updateMask` | `string` | No | — | | `connection` | `object` | Yes | — | > **connection full type** > > ```ts theme={null} > { > name?: string, > friendlyName?: string, > description?: string, > creationTime?: string, > lastModifiedTime?: string, > hasCredential?: boolean, > cloudSql?: { > instanceId?: string, > database?: string, > type?: DATABASE_TYPE_UNSPECIFIED | POSTGRES | MYSQL, > credential?: { > username?: string, > password?: string > } > }, > cloudResource?: { > serviceAccountId?: string > }, > aws?: { > crossAccountRole?: { > iamRoleId?: string > }, > accessRole?: { > iamRoleId?: string > } > }, > azure?: { > application?: string, > clientId?: string, > objectId?: string, > customerTenantId?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `hasCredential` | `boolean` | No | — | | `cloudSql` | `object` | No | — | | `cloudResource` | `object` | No | — | | `aws` | `object` | No | — | | `azure` | `object` | No | — | > **cloudSql full type** > > ```ts theme={null} > { > instanceId?: string, > database?: string, > type?: DATABASE_TYPE_UNSPECIFIED | POSTGRES | MYSQL, > credential?: { > username?: string, > password?: string > } > } > ``` > **cloudResource full type** > > ```ts theme={null} > { > serviceAccountId?: string > } > ``` > **aws full type** > > ```ts theme={null} > { > crossAccountRole?: { > iamRoleId?: string > }, > accessRole?: { > iamRoleId?: string > } > } > ``` > **azure full type** > > ```ts theme={null} > { > application?: string, > clientId?: string, > objectId?: string, > customerTenantId?: string > } > ``` *** ## Datasets ### create `datasets.create` Create a new dataset **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.datasets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `location` | `string` | No | — | | `labels` | `object` | No | — | | `defaultTableExpirationMs` | `string` | No | — | | `defaultPartitionExpirationMs` | `string` | No | — | | `access` | `object[]` | No | — | > **datasetReference full type** > > ```ts theme={null} > { > datasetId: string, > projectId?: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **access full type** > > ```ts theme={null} > { > role?: string, > userByEmail?: string, > groupByEmail?: string, > domain?: string, > specialGroup?: string, > iamMember?: string, > view?: { > projectId?: string, > datasetId: string, > tableId: string > }, > routine?: { > projectId?: string, > datasetId: string, > routineId: string > }, > dataset?: { > dataset: { > datasetId: string, > projectId?: string > }, > targetTypes?: string[] > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `selfLink` | `string` | No | — | | `datasetReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `defaultTableExpirationMs` | `string` | No | — | | `defaultPartitionExpirationMs` | `string` | No | — | | `labels` | `object` | No | — | | `access` | `object[]` | No | — | | `location` | `string` | No | — | | `maxTimeTravelHours` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | > **datasetReference full type** > > ```ts theme={null} > { > datasetId: string, > projectId?: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **access full type** > > ```ts theme={null} > { > role?: string, > userByEmail?: string, > groupByEmail?: string, > domain?: string, > specialGroup?: string, > iamMember?: string, > view?: { > projectId?: string, > datasetId: string, > tableId: string > }, > routine?: { > projectId?: string, > datasetId: string, > routineId: string > }, > dataset?: { > dataset: { > datasetId: string, > projectId?: string > }, > targetTypes?: string[] > } > }[] > ``` *** ### delete `datasets.delete` Permanently delete a dataset \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googlebigquery.api.datasets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `deleteContents` | `boolean` | No | — | **Output:** `void` *** ### get `datasets.get` Get a dataset by ID **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.datasets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `datasetView` | `FULL \| METADATA \| ACL` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `selfLink` | `string` | No | — | | `datasetReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `defaultTableExpirationMs` | `string` | No | — | | `defaultPartitionExpirationMs` | `string` | No | — | | `labels` | `object` | No | — | | `access` | `object[]` | No | — | | `location` | `string` | No | — | | `maxTimeTravelHours` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | > **datasetReference full type** > > ```ts theme={null} > { > datasetId: string, > projectId?: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **access full type** > > ```ts theme={null} > { > role?: string, > userByEmail?: string, > groupByEmail?: string, > domain?: string, > specialGroup?: string, > iamMember?: string, > view?: { > projectId?: string, > datasetId: string, > tableId: string > }, > routine?: { > projectId?: string, > datasetId: string, > routineId: string > }, > dataset?: { > dataset: { > datasetId: string, > projectId?: string > }, > targetTypes?: string[] > } > }[] > ``` *** ### list `datasets.list` List datasets in a project **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.datasets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `all` | `boolean` | No | — | | `filter` | `string` | No | — | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `datasets` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **datasets full type** > > ```ts theme={null} > { > kind?: string, > id?: string, > datasetReference: { > datasetId: string, > projectId?: string > }, > labels?: { > }, > friendlyName?: string, > location?: string > }[] > ``` *** ### patch `datasets.patch` Partially update a dataset **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.datasets.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `dataset` | `object` | Yes | — | > **dataset full type** > > ```ts theme={null} > { > id?: string, > kind?: string, > etag?: string, > selfLink?: string, > datasetReference?: { > datasetId: string, > projectId?: string > }, > friendlyName?: string, > description?: string, > defaultTableExpirationMs?: string, > defaultPartitionExpirationMs?: string, > labels?: { > }, > access?: { > role?: string, > userByEmail?: string, > groupByEmail?: string, > domain?: string, > specialGroup?: string, > iamMember?: string, > view?: { > projectId?: string, > datasetId: string, > tableId: string > }, > routine?: { > projectId?: string, > datasetId: string, > routineId: string > }, > dataset?: { > dataset: { > datasetId: string, > projectId?: string > }, > targetTypes?: string[] > } > }[], > location?: string, > maxTimeTravelHours?: string, > creationTime?: string, > lastModifiedTime?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `selfLink` | `string` | No | — | | `datasetReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `defaultTableExpirationMs` | `string` | No | — | | `defaultPartitionExpirationMs` | `string` | No | — | | `labels` | `object` | No | — | | `access` | `object[]` | No | — | | `location` | `string` | No | — | | `maxTimeTravelHours` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | > **datasetReference full type** > > ```ts theme={null} > { > datasetId: string, > projectId?: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **access full type** > > ```ts theme={null} > { > role?: string, > userByEmail?: string, > groupByEmail?: string, > domain?: string, > specialGroup?: string, > iamMember?: string, > view?: { > projectId?: string, > datasetId: string, > tableId: string > }, > routine?: { > projectId?: string, > datasetId: string, > routineId: string > }, > dataset?: { > dataset: { > datasetId: string, > projectId?: string > }, > targetTypes?: string[] > } > }[] > ``` *** ### undelete `datasets.undelete` Restore a recently deleted dataset **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.datasets.undelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `deletionTime` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `selfLink` | `string` | No | — | | `datasetReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `defaultTableExpirationMs` | `string` | No | — | | `defaultPartitionExpirationMs` | `string` | No | — | | `labels` | `object` | No | — | | `access` | `object[]` | No | — | | `location` | `string` | No | — | | `maxTimeTravelHours` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | > **datasetReference full type** > > ```ts theme={null} > { > datasetId: string, > projectId?: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **access full type** > > ```ts theme={null} > { > role?: string, > userByEmail?: string, > groupByEmail?: string, > domain?: string, > specialGroup?: string, > iamMember?: string, > view?: { > projectId?: string, > datasetId: string, > tableId: string > }, > routine?: { > projectId?: string, > datasetId: string, > routineId: string > }, > dataset?: { > dataset: { > datasetId: string, > projectId?: string > }, > targetTypes?: string[] > } > }[] > ``` *** ### update `datasets.update` Replace a dataset (full update) **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.datasets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `dataset` | `object` | Yes | — | > **dataset full type** > > ```ts theme={null} > { > id?: string, > kind?: string, > etag?: string, > selfLink?: string, > datasetReference: { > datasetId: string, > projectId?: string > }, > friendlyName?: string, > description?: string, > defaultTableExpirationMs?: string, > defaultPartitionExpirationMs?: string, > labels?: { > }, > access?: { > role?: string, > userByEmail?: string, > groupByEmail?: string, > domain?: string, > specialGroup?: string, > iamMember?: string, > view?: { > projectId?: string, > datasetId: string, > tableId: string > }, > routine?: { > projectId?: string, > datasetId: string, > routineId: string > }, > dataset?: { > dataset: { > datasetId: string, > projectId?: string > }, > targetTypes?: string[] > } > }[], > location?: string, > maxTimeTravelHours?: string, > creationTime?: string, > lastModifiedTime?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `selfLink` | `string` | No | — | | `datasetReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `defaultTableExpirationMs` | `string` | No | — | | `defaultPartitionExpirationMs` | `string` | No | — | | `labels` | `object` | No | — | | `access` | `object[]` | No | — | | `location` | `string` | No | — | | `maxTimeTravelHours` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | > **datasetReference full type** > > ```ts theme={null} > { > datasetId: string, > projectId?: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **access full type** > > ```ts theme={null} > { > role?: string, > userByEmail?: string, > groupByEmail?: string, > domain?: string, > specialGroup?: string, > iamMember?: string, > view?: { > projectId?: string, > datasetId: string, > tableId: string > }, > routine?: { > projectId?: string, > datasetId: string, > routineId: string > }, > dataset?: { > dataset: { > datasetId: string, > projectId?: string > }, > targetTypes?: string[] > } > }[] > ``` *** ## Iam ### createLocationsDatapolicies `iam.createLocationsDatapolicies` Create a column-level security / data masking policy **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.iam.createLocationsDatapolicies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `dataPolicyId` | `string` | Yes | — | | `policyTag` | `string` | No | — | | `dataPolicyType` | `DATA_POLICY_TYPE_UNSPECIFIED \| COLUMN_LEVEL_SECURITY_POLICY \| DATA_MASKING_POLICY` | No | — | | `dataMaskingPolicy` | `object` | No | — | > **dataMaskingPolicy full type** > > ```ts theme={null} > { > predefinedExpression?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `dataPolicyId` | `string` | No | — | | `policyTag` | `string` | No | — | | `dataPolicyType` | `DATA_POLICY_TYPE_UNSPECIFIED \| COLUMN_LEVEL_SECURITY_POLICY \| DATA_MASKING_POLICY` | No | — | | `dataMaskingPolicy` | `object` | No | — | > **dataMaskingPolicy full type** > > ```ts theme={null} > { > predefinedExpression?: string > } > ``` *** ### getConnectionIamPolicy `iam.getConnectionIamPolicy` Get a connection's IAM policy **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.iam.getConnectionIamPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `connectionId` | `string` | Yes | — | | `requestedPolicyVersion` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `number` | No | — | | `bindings` | `object[]` | No | — | | `etag` | `string` | No | — | > **bindings full type** > > ```ts theme={null} > { > role?: string, > members?: string[], > condition?: { > expression?: string, > title?: string, > description?: string, > location?: string > } > }[] > ``` *** ### getRoutineIamPolicy `iam.getRoutineIamPolicy` Get a routine's IAM policy **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.iam.getRoutineIamPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `routineId` | `string` | Yes | — | | `requestedPolicyVersion` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `number` | No | — | | `bindings` | `object[]` | No | — | | `etag` | `string` | No | — | > **bindings full type** > > ```ts theme={null} > { > role?: string, > members?: string[], > condition?: { > expression?: string, > title?: string, > description?: string, > location?: string > } > }[] > ``` *** ### getServiceAccount `iam.getServiceAccount` Get the project's BigQuery service account email **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.iam.getServiceAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `email` | `string` | No | — | *** ### getTableIamPolicy `iam.getTableIamPolicy` Get a table's IAM policy **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.iam.getTableIamPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `requestedPolicyVersion` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `number` | No | — | | `bindings` | `object[]` | No | — | | `etag` | `string` | No | — | > **bindings full type** > > ```ts theme={null} > { > role?: string, > members?: string[], > condition?: { > expression?: string, > title?: string, > description?: string, > location?: string > } > }[] > ``` *** ### listLocationsDatapolicies `iam.listLocationsDatapolicies` List data policies in a location **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.iam.listLocationsDatapolicies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dataPolicies` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **dataPolicies full type** > > ```ts theme={null} > { > name?: string, > dataPolicyId?: string, > policyTag?: string, > dataPolicyType?: DATA_POLICY_TYPE_UNSPECIFIED | COLUMN_LEVEL_SECURITY_POLICY | DATA_MASKING_POLICY, > dataMaskingPolicy?: { > predefinedExpression?: string > } > }[] > ``` *** ### listRowAccessPolicies `iam.listRowAccessPolicies` List a table's row-level access policies **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.iam.listRowAccessPolicies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rowAccessPolicies` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **rowAccessPolicies full type** > > ```ts theme={null} > { > etag?: string, > rowAccessPolicyReference?: { > projectId?: string, > datasetId?: string, > tableId?: string, > policyId?: string > }, > filterPredicate?: string, > creationTime?: string, > lastModifiedTime?: string > }[] > ``` *** ### setRoutineIamPolicy `iam.setRoutineIamPolicy` Replace a routine's IAM policy **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.iam.setRoutineIamPolicy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `routineId` | `string` | Yes | — | | `policy` | `object` | Yes | — | | `updateMask` | `string` | No | — | > **policy full type** > > ```ts theme={null} > { > version?: number, > bindings?: { > role?: string, > members?: string[], > condition?: { > expression?: string, > title?: string, > description?: string, > location?: string > } > }[], > etag?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `number` | No | — | | `bindings` | `object[]` | No | — | | `etag` | `string` | No | — | > **bindings full type** > > ```ts theme={null} > { > role?: string, > members?: string[], > condition?: { > expression?: string, > title?: string, > description?: string, > location?: string > } > }[] > ``` *** ### testRoutineIamPermissions `iam.testRoutineIamPermissions` Test which permissions the caller has on a routine **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.iam.testRoutineIamPermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `routineId` | `string` | Yes | — | | `permissions` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `permissions` | `string[]` | No | — | *** ## Ml ### deleteModel `ml.deleteModel` Permanently delete a model \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googlebigquery.api.ml.deleteModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `modelId` | `string` | Yes | — | **Output:** `void` *** ### getBigqueryModel `ml.getBigqueryModel` Get a BigQuery ML model by ID **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.ml.getBigqueryModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `modelId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `modelReference` | `object` | Yes | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `description` | `string` | No | — | | `friendlyName` | `string` | No | — | | `labels` | `object` | No | — | | `expirationTime` | `string` | No | — | | `location` | `string` | No | — | | `modelType` | `string` | No | — | | `featureColumns` | `object[]` | No | — | | `labelColumns` | `object[]` | No | — | | `trainingRuns` | `object[]` | No | — | > **modelReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > modelId: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **featureColumns full type** > > ```ts theme={null} > { > name?: string, > type?: { > } > }[] > ``` > **labelColumns full type** > > ```ts theme={null} > { > name?: string, > type?: { > } > }[] > ``` > **trainingRuns full type** > > ```ts theme={null} > { > }[] > ``` *** ### listLocations `ml.listLocations` List available BigQuery locations for a project **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.ml.listLocations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `locations` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **locations full type** > > ```ts theme={null} > { > name?: string, > locationId?: string, > displayName?: string > }[] > ``` *** ### listModels `ml.listModels` List BigQuery ML models in a dataset **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.ml.listModels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `models` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **models full type** > > ```ts theme={null} > { > etag?: string, > modelReference: { > projectId?: string, > datasetId: string, > modelId: string > }, > creationTime?: string, > lastModifiedTime?: string, > description?: string, > friendlyName?: string, > labels?: { > }, > expirationTime?: string, > location?: string, > modelType?: string, > featureColumns?: { > name?: string, > type?: { > } > }[], > labelColumns?: { > name?: string, > type?: { > } > }[], > trainingRuns?: { > }[] > }[] > ``` *** ### listProjects `ml.listProjects` List projects visible to the caller **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.ml.listProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `projects` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | | `totalItems` | `number` | No | — | > **projects full type** > > ```ts theme={null} > { > kind?: string, > id?: string, > numericId?: string, > projectReference?: { > projectId?: string > }, > friendlyName?: string > }[] > ``` *** ### patchModel `ml.patchModel` Partially update a model's metadata **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.ml.patchModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `modelId` | `string` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `labels` | `object` | No | — | | `expirationTime` | `string` | No | — | > **labels full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `modelReference` | `object` | Yes | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `description` | `string` | No | — | | `friendlyName` | `string` | No | — | | `labels` | `object` | No | — | | `expirationTime` | `string` | No | — | | `location` | `string` | No | — | | `modelType` | `string` | No | — | | `featureColumns` | `object[]` | No | — | | `labelColumns` | `object[]` | No | — | | `trainingRuns` | `object[]` | No | — | > **modelReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > modelId: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **featureColumns full type** > > ```ts theme={null} > { > name?: string, > type?: { > } > }[] > ``` > **labelColumns full type** > > ```ts theme={null} > { > name?: string, > type?: { > } > }[] > ``` > **trainingRuns full type** > > ```ts theme={null} > { > }[] > ``` *** ## Queries ### cancelJob `queries.cancelJob` Request cancellation of a running job **Risk:** `destructive` ```ts theme={null} await corsair.googlebigquery.api.queries.cancelJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `jobId` | `string` | Yes | — | | `location` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `job` | `object` | No | — | > **job full type** > > ```ts theme={null} > { > id?: string, > kind?: string, > selfLink?: string, > etag?: string, > jobReference?: { > projectId?: string, > jobId?: string, > location?: string > }, > configuration?: { > jobType?: QUERY | LOAD | EXTRACT | COPY, > query?: { > query: string, > destinationTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > defaultDataset?: { > datasetId: string, > projectId?: string > }, > priority?: INTERACTIVE | BATCH, > useLegacySql?: boolean, > useQueryCache?: boolean, > maximumBytesBilled?: string, > queryParameters?: { > name?: string, > parameterType: { > type: string, > arrayType?: any, > structTypes?: any[] > }, > parameterValue: { > value?: any, > arrayValues?: any[], > structValues?: { > } > } > }[], > parameterMode?: POSITIONAL | NAMED > }, > load?: { > sourceUris?: string[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > sourceFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET | ORC | DATASTORE_BACKUP, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > skipLeadingRows?: number, > autodetect?: boolean, > fieldDelimiter?: string, > encoding?: UTF-8 | ISO-8859-1 > }, > extract?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > destinationUris?: string[], > destinationFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET, > compression?: NONE | GZIP | DEFLATE | SNAPPY, > fieldDelimiter?: string > }, > copy?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > sourceTables?: { > projectId?: string, > datasetId: string, > tableId: string > }[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY > }, > dryRun?: boolean, > jobTimeoutMs?: string, > labels?: { > } > }, > status?: { > state?: PENDING | RUNNING | DONE, > errorResult?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }, > errors?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }[] > }, > statistics?: { > }, > user_email?: string > } > ``` *** ### deleteJobMetadata `queries.deleteJobMetadata` Delete a job's metadata **Risk:** `destructive` ```ts theme={null} await corsair.googlebigquery.api.queries.deleteJobMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `jobId` | `string` | Yes | — | | `location` | `string` | No | — | **Output:** `void` *** ### getJob `queries.getJob` Get a job by ID **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.queries.getJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `jobId` | `string` | Yes | — | | `location` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `selfLink` | `string` | No | — | | `etag` | `string` | No | — | | `jobReference` | `object` | No | — | | `configuration` | `object` | No | — | | `status` | `object` | No | — | | `statistics` | `object` | No | — | | `user_email` | `string` | No | — | > **jobReference full type** > > ```ts theme={null} > { > projectId?: string, > jobId?: string, > location?: string > } > ``` > **configuration full type** > > ```ts theme={null} > { > jobType?: QUERY | LOAD | EXTRACT | COPY, > query?: { > query: string, > destinationTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > defaultDataset?: { > datasetId: string, > projectId?: string > }, > priority?: INTERACTIVE | BATCH, > useLegacySql?: boolean, > useQueryCache?: boolean, > maximumBytesBilled?: string, > queryParameters?: { > name?: string, > parameterType: { > type: string, > arrayType?: any, > structTypes?: any[] > }, > parameterValue: { > value?: any, > arrayValues?: any[], > structValues?: { > } > } > }[], > parameterMode?: POSITIONAL | NAMED > }, > load?: { > sourceUris?: string[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > sourceFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET | ORC | DATASTORE_BACKUP, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > skipLeadingRows?: number, > autodetect?: boolean, > fieldDelimiter?: string, > encoding?: UTF-8 | ISO-8859-1 > }, > extract?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > destinationUris?: string[], > destinationFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET, > compression?: NONE | GZIP | DEFLATE | SNAPPY, > fieldDelimiter?: string > }, > copy?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > sourceTables?: { > projectId?: string, > datasetId: string, > tableId: string > }[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY > }, > dryRun?: boolean, > jobTimeoutMs?: string, > labels?: { > } > } > ``` > **status full type** > > ```ts theme={null} > { > state?: PENDING | RUNNING | DONE, > errorResult?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }, > errors?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }[] > } > ``` > **statistics full type** > > ```ts theme={null} > { > } > ``` *** ### getQueryResults `queries.getQueryResults` Fetch additional pages of results for a running/completed query job **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.queries.getQueryResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `jobId` | `string` | Yes | — | | `startIndex` | `string` | No | — | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | | `timeoutMs` | `number` | No | — | | `location` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `schema` | `object` | No | — | | `jobReference` | `object` | No | — | | `totalRows` | `string` | No | — | | `pageToken` | `string` | No | — | | `rows` | `object[]` | No | — | | `totalBytesProcessed` | `string` | No | — | | `jobComplete` | `boolean` | No | — | | `errors` | `object[]` | No | — | | `cacheHit` | `boolean` | No | — | | `numDmlAffectedRows` | `string` | No | — | | `etag` | `string` | No | — | > **schema full type** > > ```ts theme={null} > { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > } > ``` > **jobReference full type** > > ```ts theme={null} > { > projectId?: string, > jobId?: string, > location?: string > } > ``` > **rows full type** > > ```ts theme={null} > { > f?: { > v: any > }[] > }[] > ``` > **errors full type** > > ```ts theme={null} > { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }[] > ``` *** ### insertAll `queries.insertAll` Stream rows into a table (supports insertId-based deduplication) **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.queries.insertAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `rows` | `object[]` | Yes | — | | `skipInvalidRows` | `boolean` | No | — | | `ignoreUnknownValues` | `boolean` | No | — | | `templateSuffix` | `string` | No | — | > **rows full type** > > ```ts theme={null} > { > insertId?: string, > json: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `insertErrors` | `object[]` | No | — | > **insertErrors full type** > > ```ts theme={null} > { > index?: number, > errors?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }[] > }[] > ``` *** ### insertJob `queries.insertJob` Start a query, load, extract, or copy job (supports dry-run) **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.queries.insertJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `jobReference` | `object` | No | — | | `configuration` | `object` | Yes | — | > **jobReference full type** > > ```ts theme={null} > { > projectId?: string, > jobId?: string, > location?: string > } > ``` > **configuration full type** > > ```ts theme={null} > { > jobType?: QUERY | LOAD | EXTRACT | COPY, > query?: { > query: string, > destinationTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > defaultDataset?: { > datasetId: string, > projectId?: string > }, > priority?: INTERACTIVE | BATCH, > useLegacySql?: boolean, > useQueryCache?: boolean, > maximumBytesBilled?: string, > queryParameters?: { > name?: string, > parameterType: { > type: string, > arrayType?: any, > structTypes?: any[] > }, > parameterValue: { > value?: any, > arrayValues?: any[], > structValues?: { > } > } > }[], > parameterMode?: POSITIONAL | NAMED > }, > load?: { > sourceUris?: string[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > sourceFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET | ORC | DATASTORE_BACKUP, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > skipLeadingRows?: number, > autodetect?: boolean, > fieldDelimiter?: string, > encoding?: UTF-8 | ISO-8859-1 > }, > extract?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > destinationUris?: string[], > destinationFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET, > compression?: NONE | GZIP | DEFLATE | SNAPPY, > fieldDelimiter?: string > }, > copy?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > sourceTables?: { > projectId?: string, > datasetId: string, > tableId: string > }[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY > }, > dryRun?: boolean, > jobTimeoutMs?: string, > labels?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `selfLink` | `string` | No | — | | `etag` | `string` | No | — | | `jobReference` | `object` | No | — | | `configuration` | `object` | No | — | | `status` | `object` | No | — | | `statistics` | `object` | No | — | | `user_email` | `string` | No | — | > **jobReference full type** > > ```ts theme={null} > { > projectId?: string, > jobId?: string, > location?: string > } > ``` > **configuration full type** > > ```ts theme={null} > { > jobType?: QUERY | LOAD | EXTRACT | COPY, > query?: { > query: string, > destinationTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > defaultDataset?: { > datasetId: string, > projectId?: string > }, > priority?: INTERACTIVE | BATCH, > useLegacySql?: boolean, > useQueryCache?: boolean, > maximumBytesBilled?: string, > queryParameters?: { > name?: string, > parameterType: { > type: string, > arrayType?: any, > structTypes?: any[] > }, > parameterValue: { > value?: any, > arrayValues?: any[], > structValues?: { > } > } > }[], > parameterMode?: POSITIONAL | NAMED > }, > load?: { > sourceUris?: string[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > sourceFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET | ORC | DATASTORE_BACKUP, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > skipLeadingRows?: number, > autodetect?: boolean, > fieldDelimiter?: string, > encoding?: UTF-8 | ISO-8859-1 > }, > extract?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > destinationUris?: string[], > destinationFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET, > compression?: NONE | GZIP | DEFLATE | SNAPPY, > fieldDelimiter?: string > }, > copy?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > sourceTables?: { > projectId?: string, > datasetId: string, > tableId: string > }[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY > }, > dryRun?: boolean, > jobTimeoutMs?: string, > labels?: { > } > } > ``` > **status full type** > > ```ts theme={null} > { > state?: PENDING | RUNNING | DONE, > errorResult?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }, > errors?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }[] > } > ``` > **statistics full type** > > ```ts theme={null} > { > } > ``` *** ### insertJobWithUpload `queries.insertJobWithUpload` Start a load job that uploads an inline file as the data source **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.queries.insertJobWithUpload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `jobReference` | `object` | No | — | | `configuration` | `object` | Yes | — | | `fileContent` | `string` | Yes | — | | `fileName` | `string` | No | — | | `contentType` | `string` | No | — | > **jobReference full type** > > ```ts theme={null} > { > projectId?: string, > jobId?: string, > location?: string > } > ``` > **configuration full type** > > ```ts theme={null} > { > jobType?: QUERY | LOAD | EXTRACT | COPY, > query?: { > query: string, > destinationTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > defaultDataset?: { > datasetId: string, > projectId?: string > }, > priority?: INTERACTIVE | BATCH, > useLegacySql?: boolean, > useQueryCache?: boolean, > maximumBytesBilled?: string, > queryParameters?: { > name?: string, > parameterType: { > type: string, > arrayType?: any, > structTypes?: any[] > }, > parameterValue: { > value?: any, > arrayValues?: any[], > structValues?: { > } > } > }[], > parameterMode?: POSITIONAL | NAMED > }, > load?: { > sourceUris?: string[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > sourceFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET | ORC | DATASTORE_BACKUP, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > skipLeadingRows?: number, > autodetect?: boolean, > fieldDelimiter?: string, > encoding?: UTF-8 | ISO-8859-1 > }, > extract?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > destinationUris?: string[], > destinationFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET, > compression?: NONE | GZIP | DEFLATE | SNAPPY, > fieldDelimiter?: string > }, > copy?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > sourceTables?: { > projectId?: string, > datasetId: string, > tableId: string > }[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY > }, > dryRun?: boolean, > jobTimeoutMs?: string, > labels?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `selfLink` | `string` | No | — | | `etag` | `string` | No | — | | `jobReference` | `object` | No | — | | `configuration` | `object` | No | — | | `status` | `object` | No | — | | `statistics` | `object` | No | — | | `user_email` | `string` | No | — | > **jobReference full type** > > ```ts theme={null} > { > projectId?: string, > jobId?: string, > location?: string > } > ``` > **configuration full type** > > ```ts theme={null} > { > jobType?: QUERY | LOAD | EXTRACT | COPY, > query?: { > query: string, > destinationTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > defaultDataset?: { > datasetId: string, > projectId?: string > }, > priority?: INTERACTIVE | BATCH, > useLegacySql?: boolean, > useQueryCache?: boolean, > maximumBytesBilled?: string, > queryParameters?: { > name?: string, > parameterType: { > type: string, > arrayType?: any, > structTypes?: any[] > }, > parameterValue: { > value?: any, > arrayValues?: any[], > structValues?: { > } > } > }[], > parameterMode?: POSITIONAL | NAMED > }, > load?: { > sourceUris?: string[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > sourceFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET | ORC | DATASTORE_BACKUP, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > skipLeadingRows?: number, > autodetect?: boolean, > fieldDelimiter?: string, > encoding?: UTF-8 | ISO-8859-1 > }, > extract?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > destinationUris?: string[], > destinationFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET, > compression?: NONE | GZIP | DEFLATE | SNAPPY, > fieldDelimiter?: string > }, > copy?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > sourceTables?: { > projectId?: string, > datasetId: string, > tableId: string > }[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY > }, > dryRun?: boolean, > jobTimeoutMs?: string, > labels?: { > } > } > ``` > **status full type** > > ```ts theme={null} > { > state?: PENDING | RUNNING | DONE, > errorResult?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }, > errors?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }[] > } > ``` > **statistics full type** > > ```ts theme={null} > { > } > ``` *** ### listJobs `queries.listJobs` List jobs for a project **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.queries.listJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `allUsers` | `boolean` | No | — | | `maxResults` | `number` | No | — | | `minCreationTime` | `string` | No | — | | `maxCreationTime` | `string` | No | — | | `pageToken` | `string` | No | — | | `projection` | `full \| minimal` | No | — | | `stateFilter` | `done \| pending \| running[]` | No | — | | `parentJobId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `jobs` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **jobs full type** > > ```ts theme={null} > { > id?: string, > kind?: string, > selfLink?: string, > etag?: string, > jobReference?: { > projectId?: string, > jobId?: string, > location?: string > }, > configuration?: { > jobType?: QUERY | LOAD | EXTRACT | COPY, > query?: { > query: string, > destinationTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > defaultDataset?: { > datasetId: string, > projectId?: string > }, > priority?: INTERACTIVE | BATCH, > useLegacySql?: boolean, > useQueryCache?: boolean, > maximumBytesBilled?: string, > queryParameters?: { > name?: string, > parameterType: { > type: string, > arrayType?: any, > structTypes?: any[] > }, > parameterValue: { > value?: any, > arrayValues?: any[], > structValues?: { > } > } > }[], > parameterMode?: POSITIONAL | NAMED > }, > load?: { > sourceUris?: string[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > sourceFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET | ORC | DATASTORE_BACKUP, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY, > skipLeadingRows?: number, > autodetect?: boolean, > fieldDelimiter?: string, > encoding?: UTF-8 | ISO-8859-1 > }, > extract?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > destinationUris?: string[], > destinationFormat?: CSV | NEWLINE_DELIMITED_JSON | AVRO | PARQUET, > compression?: NONE | GZIP | DEFLATE | SNAPPY, > fieldDelimiter?: string > }, > copy?: { > sourceTable?: { > projectId?: string, > datasetId: string, > tableId: string > }, > sourceTables?: { > projectId?: string, > datasetId: string, > tableId: string > }[], > destinationTable: { > projectId?: string, > datasetId: string, > tableId: string > }, > createDisposition?: CREATE_IF_NEEDED | CREATE_NEVER, > writeDisposition?: WRITE_TRUNCATE | WRITE_APPEND | WRITE_EMPTY > }, > dryRun?: boolean, > jobTimeoutMs?: string, > labels?: { > } > }, > status?: { > state?: PENDING | RUNNING | DONE, > errorResult?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }, > errors?: { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }[] > }, > statistics?: { > }, > user_email?: string > }[] > ``` *** ### query `queries.query` Run a SQL query and return inline results **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.queries.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `query` | `string` | Yes | — | | `maxResults` | `number` | No | — | | `defaultDataset` | `object` | No | — | | `timeoutMs` | `number` | No | — | | `dryRun` | `boolean` | No | — | | `useQueryCache` | `boolean` | No | — | | `useLegacySql` | `boolean` | No | — | | `parameterMode` | `POSITIONAL \| NAMED` | No | — | | `queryParameters` | `object[]` | No | — | | `location` | `string` | No | — | | `maximumBytesBilled` | `string` | No | — | | `requestId` | `string` | No | — | > **defaultDataset full type** > > ```ts theme={null} > { > datasetId: string, > projectId?: string > } > ``` > **queryParameters full type** > > ```ts theme={null} > { > name?: string, > parameterType: { > type: string, > arrayType?: any, > structTypes?: any[] > }, > parameterValue: { > value?: any, > arrayValues?: any[], > structValues?: { > } > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `schema` | `object` | No | — | | `jobReference` | `object` | No | — | | `totalRows` | `string` | No | — | | `pageToken` | `string` | No | — | | `rows` | `object[]` | No | — | | `totalBytesProcessed` | `string` | No | — | | `jobComplete` | `boolean` | No | — | | `errors` | `object[]` | No | — | | `cacheHit` | `boolean` | No | — | | `numDmlAffectedRows` | `string` | No | — | > **schema full type** > > ```ts theme={null} > { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > } > ``` > **jobReference full type** > > ```ts theme={null} > { > projectId?: string, > jobId?: string, > location?: string > } > ``` > **rows full type** > > ```ts theme={null} > { > f?: { > v: any > }[] > }[] > ``` > **errors full type** > > ```ts theme={null} > { > reason?: string, > location?: string, > debugInfo?: string, > message?: string > }[] > ``` *** ## Reservations ### create `reservations.create` Create a new slot reservation (has billing impact) **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.reservations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `reservationId` | `string` | Yes | — | | `slotCapacity` | `string` | No | — | | `ignoreIdleSlots` | `boolean` | No | — | | `edition` | `EDITION_UNSPECIFIED \| STANDARD \| ENTERPRISE \| ENTERPRISE_PLUS` | No | — | | `autoscale` | `object` | No | — | > **autoscale full type** > > ```ts theme={null} > { > currentSlots?: string, > maxSlots?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `slotCapacity` | `string` | No | — | | `ignoreIdleSlots` | `boolean` | No | — | | `creationTime` | `string` | No | — | | `updateTime` | `string` | No | — | | `concurrency` | `string` | No | — | | `edition` | `EDITION_UNSPECIFIED \| STANDARD \| ENTERPRISE \| ENTERPRISE_PLUS` | No | — | | `autoscale` | `object` | No | — | > **autoscale full type** > > ```ts theme={null} > { > currentSlots?: string, > maxSlots?: string > } > ``` *** ### createAssignment `reservations.createAssignment` Assign a project/folder/org to a reservation **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.reservations.createAssignment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `reservationId` | `string` | Yes | — | | `assignee` | `string` | Yes | — | | `jobType` | `JOB_TYPE_UNSPECIFIED \| PIPELINE \| QUERY \| ML_EXTERNAL \| BACKGROUND \| CONTINUOUS` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `assignee` | `string` | No | — | | `jobType` | `JOB_TYPE_UNSPECIFIED \| PIPELINE \| QUERY \| ML_EXTERNAL \| BACKGROUND \| CONTINUOUS` | No | — | | `state` | `STATE_UNSPECIFIED \| PENDING \| ACTIVE` | No | — | *** ### createCapacityCommitment `reservations.createCapacityCommitment` Purchase a new capacity commitment (has billing impact) **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.reservations.createCapacityCommitment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `slotCount` | `string` | Yes | — | | `plan` | `COMMITMENT_PLAN_UNSPECIFIED \| FLEX \| FLEX_FLAT_RATE \| MONTHLY \| ANNUAL \| THREE_YEAR` | Yes | — | | `renewalPlan` | `COMMITMENT_PLAN_UNSPECIFIED \| FLEX \| FLEX_FLAT_RATE \| MONTHLY \| ANNUAL \| THREE_YEAR \| NONE` | No | — | | `enforceSingleAdminProjectPerOrg` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `slotCount` | `string` | No | — | | `plan` | `COMMITMENT_PLAN_UNSPECIFIED \| FLEX \| FLEX_FLAT_RATE \| MONTHLY \| ANNUAL \| THREE_YEAR` | No | — | | `state` | `STATE_UNSPECIFIED \| PENDING \| ACTIVE \| FAILED` | No | — | | `commitmentEndTime` | `string` | No | — | | `renewalPlan` | `COMMITMENT_PLAN_UNSPECIFIED \| FLEX \| FLEX_FLAT_RATE \| MONTHLY \| ANNUAL \| THREE_YEAR \| NONE` | No | — | *** ### list `reservations.list` List slot reservations in a location **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.reservations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `reservations` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **reservations full type** > > ```ts theme={null} > { > name?: string, > slotCapacity?: string, > ignoreIdleSlots?: boolean, > creationTime?: string, > updateTime?: string, > concurrency?: string, > edition?: EDITION_UNSPECIFIED | STANDARD | ENTERPRISE | ENTERPRISE_PLUS, > autoscale?: { > currentSlots?: string, > maxSlots?: string > } > }[] > ``` *** ### listAssignments `reservations.listAssignments` List a reservation's assignments **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.reservations.listAssignments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `reservationId` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `assignments` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **assignments full type** > > ```ts theme={null} > { > name?: string, > assignee?: string, > jobType?: JOB_TYPE_UNSPECIFIED | PIPELINE | QUERY | ML_EXTERNAL | BACKGROUND | CONTINUOUS, > state?: STATE_UNSPECIFIED | PENDING | ACTIVE > }[] > ``` *** ### listCapacityCommitments `reservations.listCapacityCommitments` List capacity commitments in a location **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.reservations.listCapacityCommitments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `capacityCommitments` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **capacityCommitments full type** > > ```ts theme={null} > { > name?: string, > slotCount?: string, > plan?: COMMITMENT_PLAN_UNSPECIFIED | FLEX | FLEX_FLAT_RATE | MONTHLY | ANNUAL | THREE_YEAR, > state?: STATE_UNSPECIFIED | PENDING | ACTIVE | FAILED, > commitmentEndTime?: string, > renewalPlan?: COMMITMENT_PLAN_UNSPECIFIED | FLEX | FLEX_FLAT_RATE | MONTHLY | ANNUAL | THREE_YEAR | NONE > }[] > ``` *** ### listGroups `reservations.listGroups` List reservation groups in a location **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.reservations.listGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `reservationGroups` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **reservationGroups full type** > > ```ts theme={null} > { > name?: string > }[] > ``` *** ### searchAllAssignments `reservations.searchAllAssignments` Search assignments across a location **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.reservations.searchAllAssignments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `location` | `string` | Yes | — | | `query` | `string` | No | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `assignments` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **assignments full type** > > ```ts theme={null} > { > name?: string, > assignee?: string, > jobType?: JOB_TYPE_UNSPECIFIED | PIPELINE | QUERY | ML_EXTERNAL | BACKGROUND | CONTINUOUS, > state?: STATE_UNSPECIFIED | PENDING | ACTIVE > }[] > ``` *** ## Routines ### create `routines.create` Create a new routine (UDF or stored procedure) **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.routines.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `routineReference` | `object` | Yes | — | | `routineType` | `SCALAR_FUNCTION \| PROCEDURE \| TABLE_VALUED_FUNCTION \| AGGREGATE_FUNCTION` | Yes | — | | `definitionBody` | `string` | Yes | — | | `language` | `SQL \| JAVASCRIPT \| PYTHON \| JAVA \| SCALA` | No | — | | `arguments` | `object[]` | No | — | | `returnType` | `object` | No | — | | `description` | `string` | No | — | | `determinismLevel` | `DETERMINISM_LEVEL_UNSPECIFIED \| DETERMINISTIC \| NOT_DETERMINISTIC` | No | — | > **routineReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > routineId: string > } > ``` > **arguments full type** > > ```ts theme={null} > { > name?: string, > argumentKind?: FIXED_TYPE | ANY_TYPE, > mode?: IN | OUT | INOUT, > dataType?: { > } > }[] > ``` > **returnType full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `routineReference` | `object` | Yes | — | | `routineType` | `SCALAR_FUNCTION \| PROCEDURE \| TABLE_VALUED_FUNCTION \| AGGREGATE_FUNCTION` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `language` | `SQL \| JAVASCRIPT \| PYTHON \| JAVA \| SCALA` | No | — | | `arguments` | `object[]` | No | — | | `returnType` | `object` | No | — | | `importedLibraries` | `string[]` | No | — | | `definitionBody` | `string` | No | — | | `description` | `string` | No | — | | `determinismLevel` | `DETERMINISM_LEVEL_UNSPECIFIED \| DETERMINISTIC \| NOT_DETERMINISTIC` | No | — | > **routineReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > routineId: string > } > ``` > **arguments full type** > > ```ts theme={null} > { > name?: string, > argumentKind?: FIXED_TYPE | ANY_TYPE, > mode?: IN | OUT | INOUT, > dataType?: { > } > }[] > ``` > **returnType full type** > > ```ts theme={null} > { > } > ``` *** ### delete `routines.delete` Permanently delete a routine \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googlebigquery.api.routines.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `routineId` | `string` | Yes | — | **Output:** `void` *** ### get `routines.get` Get a routine by ID **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.routines.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `routineId` | `string` | Yes | — | | `readMask` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `routineReference` | `object` | Yes | — | | `routineType` | `SCALAR_FUNCTION \| PROCEDURE \| TABLE_VALUED_FUNCTION \| AGGREGATE_FUNCTION` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `language` | `SQL \| JAVASCRIPT \| PYTHON \| JAVA \| SCALA` | No | — | | `arguments` | `object[]` | No | — | | `returnType` | `object` | No | — | | `importedLibraries` | `string[]` | No | — | | `definitionBody` | `string` | No | — | | `description` | `string` | No | — | | `determinismLevel` | `DETERMINISM_LEVEL_UNSPECIFIED \| DETERMINISTIC \| NOT_DETERMINISTIC` | No | — | > **routineReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > routineId: string > } > ``` > **arguments full type** > > ```ts theme={null} > { > name?: string, > argumentKind?: FIXED_TYPE | ANY_TYPE, > mode?: IN | OUT | INOUT, > dataType?: { > } > }[] > ``` > **returnType full type** > > ```ts theme={null} > { > } > ``` *** ### list `routines.list` List routines (UDFs/stored procedures) in a dataset **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.routines.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | | `filter` | `string` | No | — | | `readMask` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `routines` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **routines full type** > > ```ts theme={null} > { > etag?: string, > routineReference: { > projectId?: string, > datasetId: string, > routineId: string > }, > routineType?: SCALAR_FUNCTION | PROCEDURE | TABLE_VALUED_FUNCTION | AGGREGATE_FUNCTION, > creationTime?: string, > lastModifiedTime?: string, > language?: SQL | JAVASCRIPT | PYTHON | JAVA | SCALA, > arguments?: { > name?: string, > argumentKind?: FIXED_TYPE | ANY_TYPE, > mode?: IN | OUT | INOUT, > dataType?: { > } > }[], > returnType?: { > }, > importedLibraries?: string[], > definitionBody?: string, > description?: string, > determinismLevel?: DETERMINISM_LEVEL_UNSPECIFIED | DETERMINISTIC | NOT_DETERMINISTIC > }[] > ``` *** ### update `routines.update` Replace a routine (full update) **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.routines.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `routineId` | `string` | Yes | — | | `routine` | `object` | Yes | — | > **routine full type** > > ```ts theme={null} > { > etag?: string, > routineReference: { > projectId?: string, > datasetId: string, > routineId: string > }, > routineType?: SCALAR_FUNCTION | PROCEDURE | TABLE_VALUED_FUNCTION | AGGREGATE_FUNCTION, > creationTime?: string, > lastModifiedTime?: string, > language?: SQL | JAVASCRIPT | PYTHON | JAVA | SCALA, > arguments?: { > name?: string, > argumentKind?: FIXED_TYPE | ANY_TYPE, > mode?: IN | OUT | INOUT, > dataType?: { > } > }[], > returnType?: { > }, > importedLibraries?: string[], > definitionBody?: string, > description?: string, > determinismLevel?: DETERMINISM_LEVEL_UNSPECIFIED | DETERMINISTIC | NOT_DETERMINISTIC > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `routineReference` | `object` | Yes | — | | `routineType` | `SCALAR_FUNCTION \| PROCEDURE \| TABLE_VALUED_FUNCTION \| AGGREGATE_FUNCTION` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `language` | `SQL \| JAVASCRIPT \| PYTHON \| JAVA \| SCALA` | No | — | | `arguments` | `object[]` | No | — | | `returnType` | `object` | No | — | | `importedLibraries` | `string[]` | No | — | | `definitionBody` | `string` | No | — | | `description` | `string` | No | — | | `determinismLevel` | `DETERMINISM_LEVEL_UNSPECIFIED \| DETERMINISTIC \| NOT_DETERMINISTIC` | No | — | > **routineReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > routineId: string > } > ``` > **arguments full type** > > ```ts theme={null} > { > name?: string, > argumentKind?: FIXED_TYPE | ANY_TYPE, > mode?: IN | OUT | INOUT, > dataType?: { > } > }[] > ``` > **returnType full type** > > ```ts theme={null} > { > } > ``` *** ## Tables ### create `tables.create` Create a new table or view **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.tables.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `tableReference` | `object` | Yes | — | | `schema` | `object` | No | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `labels` | `object` | No | — | | `timePartitioning` | `object` | No | — | | `clustering` | `object` | No | — | | `view` | `object` | No | — | | `externalDataConfiguration` | `object` | No | — | > **tableReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > tableId: string > } > ``` > **schema full type** > > ```ts theme={null} > { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **timePartitioning full type** > > ```ts theme={null} > { > type?: DAY | HOUR | MONTH | YEAR, > expirationMs?: string, > field?: string > } > ``` > **clustering full type** > > ```ts theme={null} > { > fields?: string[] > } > ``` > **view full type** > > ```ts theme={null} > { > query?: string, > useLegacySql?: boolean > } > ``` > **externalDataConfiguration full type** > > ```ts theme={null} > { > sourceUris?: string[], > sourceFormat?: string, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > autodetect?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `selfLink` | `string` | No | — | | `tableReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `labels` | `object` | No | — | | `schema` | `object` | No | — | | `timePartitioning` | `object` | No | — | | `clustering` | `object` | No | — | | `view` | `object` | No | — | | `externalDataConfiguration` | `object` | No | — | | `type` | `string` | No | — | | `location` | `string` | No | — | | `numRows` | `string` | No | — | | `numBytes` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `expirationTime` | `string` | No | — | > **tableReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > tableId: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **schema full type** > > ```ts theme={null} > { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > } > ``` > **timePartitioning full type** > > ```ts theme={null} > { > type?: DAY | HOUR | MONTH | YEAR, > expirationMs?: string, > field?: string > } > ``` > **clustering full type** > > ```ts theme={null} > { > fields?: string[] > } > ``` > **view full type** > > ```ts theme={null} > { > query?: string, > useLegacySql?: boolean > } > ``` > **externalDataConfiguration full type** > > ```ts theme={null} > { > sourceUris?: string[], > sourceFormat?: string, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > autodetect?: boolean > } > ``` *** ### delete `tables.delete` Permanently delete a table \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googlebigquery.api.tables.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | **Output:** `void` *** ### getSchema `tables.getSchema` Get a table's schema and metadata **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.tables.getSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `selectedFields` | `string` | No | — | | `view` | `TABLE_METADATA_VIEW_UNSPECIFIED \| BASIC \| STORAGE_STATS \| FULL` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `selfLink` | `string` | No | — | | `tableReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `labels` | `object` | No | — | | `schema` | `object` | No | — | | `timePartitioning` | `object` | No | — | | `clustering` | `object` | No | — | | `view` | `object` | No | — | | `externalDataConfiguration` | `object` | No | — | | `type` | `string` | No | — | | `location` | `string` | No | — | | `numRows` | `string` | No | — | | `numBytes` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `expirationTime` | `string` | No | — | > **tableReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > tableId: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **schema full type** > > ```ts theme={null} > { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > } > ``` > **timePartitioning full type** > > ```ts theme={null} > { > type?: DAY | HOUR | MONTH | YEAR, > expirationMs?: string, > field?: string > } > ``` > **clustering full type** > > ```ts theme={null} > { > fields?: string[] > } > ``` > **view full type** > > ```ts theme={null} > { > query?: string, > useLegacySql?: boolean > } > ``` > **externalDataConfiguration full type** > > ```ts theme={null} > { > sourceUris?: string[], > sourceFormat?: string, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > autodetect?: boolean > } > ``` *** ### list `tables.list` List tables in a dataset **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.tables.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `tables` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | | `totalItems` | `number` | No | — | > **tables full type** > > ```ts theme={null} > { > kind?: string, > id?: string, > tableReference: { > projectId?: string, > datasetId: string, > tableId: string > }, > friendlyName?: string, > type?: string, > creationTime?: string, > expirationTime?: string, > labels?: { > }, > view?: { > query?: string, > useLegacySql?: boolean > } > }[] > ``` *** ### listTableData `tables.listTableData` List a table's row data **Risk:** `read` ```ts theme={null} await corsair.googlebigquery.api.tables.listTableData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | | `startIndex` | `string` | No | — | | `selectedFields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `totalRows` | `string` | No | — | | `pageToken` | `string` | No | — | | `rows` | `object[]` | No | — | > **rows full type** > > ```ts theme={null} > { > f?: { > v: any > }[] > }[] > ``` *** ### patch `tables.patch` Partially update a table **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.tables.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `table` | `object` | Yes | — | > **table full type** > > ```ts theme={null} > { > id?: string, > kind?: string, > etag?: string, > selfLink?: string, > tableReference?: { > projectId?: string, > datasetId: string, > tableId: string > }, > friendlyName?: string, > description?: string, > labels?: { > }, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > timePartitioning?: { > type?: DAY | HOUR | MONTH | YEAR, > expirationMs?: string, > field?: string > }, > clustering?: { > fields?: string[] > }, > view?: { > query?: string, > useLegacySql?: boolean > }, > externalDataConfiguration?: { > sourceUris?: string[], > sourceFormat?: string, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > autodetect?: boolean > }, > type?: string, > location?: string, > numRows?: string, > numBytes?: string, > creationTime?: string, > lastModifiedTime?: string, > expirationTime?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `selfLink` | `string` | No | — | | `tableReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `labels` | `object` | No | — | | `schema` | `object` | No | — | | `timePartitioning` | `object` | No | — | | `clustering` | `object` | No | — | | `view` | `object` | No | — | | `externalDataConfiguration` | `object` | No | — | | `type` | `string` | No | — | | `location` | `string` | No | — | | `numRows` | `string` | No | — | | `numBytes` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `expirationTime` | `string` | No | — | > **tableReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > tableId: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **schema full type** > > ```ts theme={null} > { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > } > ``` > **timePartitioning full type** > > ```ts theme={null} > { > type?: DAY | HOUR | MONTH | YEAR, > expirationMs?: string, > field?: string > } > ``` > **clustering full type** > > ```ts theme={null} > { > fields?: string[] > } > ``` > **view full type** > > ```ts theme={null} > { > query?: string, > useLegacySql?: boolean > } > ``` > **externalDataConfiguration full type** > > ```ts theme={null} > { > sourceUris?: string[], > sourceFormat?: string, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > autodetect?: boolean > } > ``` *** ### update `tables.update` Replace a table (full update) **Risk:** `write` ```ts theme={null} await corsair.googlebigquery.api.tables.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `datasetId` | `string` | Yes | — | | `tableId` | `string` | Yes | — | | `table` | `object` | Yes | — | > **table full type** > > ```ts theme={null} > { > id?: string, > kind?: string, > etag?: string, > selfLink?: string, > tableReference: { > projectId?: string, > datasetId: string, > tableId: string > }, > friendlyName?: string, > description?: string, > labels?: { > }, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > timePartitioning?: { > type?: DAY | HOUR | MONTH | YEAR, > expirationMs?: string, > field?: string > }, > clustering?: { > fields?: string[] > }, > view?: { > query?: string, > useLegacySql?: boolean > }, > externalDataConfiguration?: { > sourceUris?: string[], > sourceFormat?: string, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > autodetect?: boolean > }, > type?: string, > location?: string, > numRows?: string, > numBytes?: string, > creationTime?: string, > lastModifiedTime?: string, > expirationTime?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `selfLink` | `string` | No | — | | `tableReference` | `object` | Yes | — | | `friendlyName` | `string` | No | — | | `description` | `string` | No | — | | `labels` | `object` | No | — | | `schema` | `object` | No | — | | `timePartitioning` | `object` | No | — | | `clustering` | `object` | No | — | | `view` | `object` | No | — | | `externalDataConfiguration` | `object` | No | — | | `type` | `string` | No | — | | `location` | `string` | No | — | | `numRows` | `string` | No | — | | `numBytes` | `string` | No | — | | `creationTime` | `string` | No | — | | `lastModifiedTime` | `string` | No | — | | `expirationTime` | `string` | No | — | > **tableReference full type** > > ```ts theme={null} > { > projectId?: string, > datasetId: string, > tableId: string > } > ``` > **labels full type** > > ```ts theme={null} > { > } > ``` > **schema full type** > > ```ts theme={null} > { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > } > ``` > **timePartitioning full type** > > ```ts theme={null} > { > type?: DAY | HOUR | MONTH | YEAR, > expirationMs?: string, > field?: string > } > ``` > **clustering full type** > > ```ts theme={null} > { > fields?: string[] > } > ``` > **view full type** > > ```ts theme={null} > { > query?: string, > useLegacySql?: boolean > } > ``` > **externalDataConfiguration full type** > > ```ts theme={null} > { > sourceUris?: string[], > sourceFormat?: string, > schema?: { > fields?: { > name: string, > type: string, > mode?: string, > description?: string, > fields?: lazy > }[] > }, > autodetect?: boolean > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/googlebigquery/database Google BigQuery local sync: searchable entities, `.search()` filters, and operators. The Google BigQuery plugin syncs data locally. Use `corsair.googlebigquery.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Datasets Path: `googlebigquery.db.datasets.search` ```ts theme={null} const rows = await corsair.googlebigquery.db.datasets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `friendlyName` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `creationTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedTime` | `string` | equals, contains, startsWith, endsWith, in | | `selfLink` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `googlebigquery.db.jobs.search` ```ts theme={null} const rows = await corsair.googlebigquery.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `kind` | `string` | equals, contains, startsWith, endsWith, in | | `selfLink` | `string` | equals, contains, startsWith, endsWith, in | | `user_email` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Models Path: `googlebigquery.db.models.search` ```ts theme={null} const rows = await corsair.googlebigquery.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `modelType` | `string` | equals, contains, startsWith, endsWith, in | | `friendlyName` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `creationTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Routines Path: `googlebigquery.db.routines.search` ```ts theme={null} const rows = await corsair.googlebigquery.db.routines.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `routineType` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `definitionBody` | `string` | equals, contains, startsWith, endsWith, in | | `creationTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tables Path: `googlebigquery.db.tables.search` ```ts theme={null} const rows = await corsair.googlebigquery.db.tables.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `friendlyName` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `numRows` | `string` | equals, contains, startsWith, endsWith, in | | `numBytes` | `string` | equals, contains, startsWith, endsWith, in | | `creationTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedTime` | `string` | equals, contains, startsWith, endsWith, in | | `expirationTime` | `string` | equals, contains, startsWith, endsWith, in | | `selfLink` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/googlebigquery/overview Serverless data warehouse for running SQL analytics on massive datasets at scale. Use **Google BigQuery** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 62 typed API operations * 5 synced entities (`datasets`, `jobs`, `models`, `routines`, `tables`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googlebigquery ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googlebigquery ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googlebigquery ``` ```bash bun theme={null} bun add corsair @corsair-dev/googlebigquery ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googlebigquery } from '@corsair-dev/googlebigquery'; export const corsair = createCorsair({ plugins: [ googlebigquery(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Google BigQuery OAuth app. ```ts theme={null} googlebigquery() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googlebigquery', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`analyticsHub.listDataexchangesListings`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlebigquery.api.analyticsHub.listDataexchangesListings({}); ``` **`analyticsHub.createDataExchange`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlebigquery.api.analyticsHub.createDataExchange({}); ``` See the full list on the [API](/plugins/googlebigquery/api) page. ## Query synced data Synced entities support `tenant.googlebigquery.db..search()` and `.list()`: `datasets`, `jobs`, `models`, `routines`, `tables`. See [Database](/plugins/googlebigquery/database) for filters and operators. ## What's next > **[API reference](/plugins/googlebigquery/api)** > > Every `googlebigquery.api.*` operation with input and output types. > **[Database](/plugins/googlebigquery/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/googlecalendar/api API reference for Google Calendar: every `googlecalendar.api.*` operation with input and output types. Every `googlecalendar.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Calendar ### getAvailability `calendar.getAvailability` Get free/busy availability for a calendar **Risk:** `read` ```ts theme={null} await corsair.googlecalendar.api.calendar.getAvailability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timeMin` | `string` | Yes | — | | `timeMax` | `string` | Yes | — | | `timeZone` | `string` | No | — | | `groupExpansionMax` | `number` | No | — | | `calendarExpansionMax` | `number` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `calendars` | `object` | No | — | | `groups` | `object` | No | — | | `timeMin` | `string` | No | — | | `timeMax` | `string` | No | — | > **calendars full type** > > ```ts theme={null} > { > } > ``` > **groups full type** > > ```ts theme={null} > { > } > ``` *** ## Events ### create `events.create` Create a new calendar event **Risk:** `write` ```ts theme={null} await corsair.googlecalendar.api.events.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `calendarId` | `string` | No | Calendar ID. Defaults to "primary". | | `event` | `object` | Yes | Event body. Provide at minimum "summary", "start", and "end". | | `sendUpdates` | `all \| externalOnly \| none` | No | — | | `sendNotifications` | `boolean` | No | — | | `conferenceDataVersion` | `number` | No | — | | `maxAttendees` | `number` | No | — | | `supportsAttachments` | `boolean` | No | — | > **event full type** > > ```ts theme={null} > { > summary?: string, > description?: string, > location?: string, > start?: { > date?: string, > dateTime?: string, > timeZone?: string > }, > end?: { > date?: string, > dateTime?: string, > timeZone?: string > }, > attendees?: { > id?: string, > email?: string, > displayName?: string, > organizer?: boolean, > self?: boolean, > resource?: boolean, > optional?: boolean, > responseStatus?: needsAction | declined | tentative | accepted, > comment?: string, > additionalGuests?: number > }[], > recurrence?: string[], > colorId?: string, > transparency?: opaque | transparent, > visibility?: default | public | private | confidential, > eventType?: default | outOfOffice | focusTime | workingLocation | birthday | fromGmail, > status?: confirmed | tentative | cancelled, > reminders?: { > useDefault?: boolean, > overrides?: { > method?: email | popup, > minutes?: number > }[] > }, > guestsCanModify?: boolean, > guestsCanInviteOthers?: boolean, > guestsCanSeeOtherGuests?: boolean, > anyoneCanAddSelf?: boolean, > sequence?: number, > originalStartTime?: { > date?: string, > dateTime?: string, > timeZone?: string > }, > recurringEventId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `status` | `confirmed \| tentative \| cancelled` | No | — | | `htmlLink` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `location` | `string` | No | — | | `colorId` | `string` | No | — | | `creator` | `object` | No | — | | `organizer` | `object` | No | — | | `start` | `object` | No | — | | `end` | `object` | No | — | | `endTimeUnspecified` | `boolean` | No | — | | `recurrence` | `string[]` | No | — | | `recurringEventId` | `string` | No | — | | `originalStartTime` | `object` | No | — | | `transparency` | `opaque \| transparent` | No | — | | `visibility` | `default \| public \| private \| confidential` | No | — | | `iCalUID` | `string` | No | — | | `sequence` | `number` | No | — | | `attendees` | `object[]` | No | — | | `attendeesOmitted` | `boolean` | No | — | | `hangoutLink` | `string` | No | — | | `reminders` | `object` | No | — | | `anyoneCanAddSelf` | `boolean` | No | — | | `guestsCanInviteOthers` | `boolean` | No | — | | `guestsCanModify` | `boolean` | No | — | | `guestsCanSeeOtherGuests` | `boolean` | No | — | | `privateCopy` | `boolean` | No | — | | `locked` | `boolean` | No | — | | `conferenceData` | `object` | No | — | | `attachments` | `object[]` | No | — | | `source` | `object` | No | — | | `gadget` | `object` | No | — | | `eventType` | `default \| outOfOffice \| focusTime \| workingLocation \| birthday \| fromGmail` | No | — | > **creator full type** > > ```ts theme={null} > { > id?: string, > email?: string, > displayName?: string, > self?: boolean > } > ``` > **organizer full type** > > ```ts theme={null} > { > id?: string, > email?: string, > displayName?: string, > self?: boolean > } > ``` > **start full type** > > ```ts theme={null} > { > date?: string, > dateTime?: string, > timeZone?: string > } > ``` > **end full type** > > ```ts theme={null} > { > date?: string, > dateTime?: string, > timeZone?: string > } > ``` > **originalStartTime full type** > > ```ts theme={null} > { > date?: string, > dateTime?: string, > timeZone?: string > } > ``` > **attendees full type** > > ```ts theme={null} > { > id?: string, > email?: string, > displayName?: string, > organizer?: boolean, > self?: boolean, > resource?: boolean, > optional?: boolean, > responseStatus?: needsAction | declined | tentative | accepted, > comment?: string, > additionalGuests?: number > }[] > ``` > **reminders full type** > > ```ts theme={null} > { > useDefault?: boolean, > overrides?: { > method?: email | popup, > minutes?: number > }[] > } > ``` > **conferenceData full type** > > ```ts theme={null} > { > createRequest?: { > requestId?: string, > conferenceSolutionKey?: { > type?: string > }, > status?: { > statusCode?: string > } > }, > entryPoints?: { > entryPointType?: string, > uri?: string, > label?: string, > pin?: string, > accessCode?: string, > meetingCode?: string, > passcode?: string, > password?: string > }[], > conferenceSolution?: { > key?: { > type?: string > }, > name?: string, > iconUri?: string > }, > conferenceId?: string, > signature?: string, > notes?: string > } > ``` > **attachments full type** > > ```ts theme={null} > { > fileUrl?: string, > title?: string, > mimeType?: string, > iconLink?: string, > fileId?: string > }[] > ``` > **source full type** > > ```ts theme={null} > { > url?: string, > title?: string > } > ``` > **gadget full type** > > ```ts theme={null} > { > type?: string, > title?: string, > link?: string, > iconLink?: string, > width?: number, > height?: number, > display?: string, > preferences?: { > } > } > ``` *** ### delete `events.delete` Delete a calendar event **Risk:** `destructive` ```ts theme={null} await corsair.googlecalendar.api.events.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `calendarId` | `string` | No | — | | `id` | `string` | Yes | — | | `sendUpdates` | `all \| externalOnly \| none` | No | — | | `sendNotifications` | `boolean` | No | — | **Output:** `void` *** ### get `events.get` Get a specific calendar event **Risk:** `read` ```ts theme={null} await corsair.googlecalendar.api.events.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `calendarId` | `string` | No | — | | `id` | `string` | Yes | — | | `timeZone` | `string` | No | — | | `maxAttendees` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `status` | `confirmed \| tentative \| cancelled` | No | — | | `htmlLink` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `location` | `string` | No | — | | `colorId` | `string` | No | — | | `creator` | `object` | No | — | | `organizer` | `object` | No | — | | `start` | `object` | No | — | | `end` | `object` | No | — | | `endTimeUnspecified` | `boolean` | No | — | | `recurrence` | `string[]` | No | — | | `recurringEventId` | `string` | No | — | | `originalStartTime` | `object` | No | — | | `transparency` | `opaque \| transparent` | No | — | | `visibility` | `default \| public \| private \| confidential` | No | — | | `iCalUID` | `string` | No | — | | `sequence` | `number` | No | — | | `attendees` | `object[]` | No | — | | `attendeesOmitted` | `boolean` | No | — | | `hangoutLink` | `string` | No | — | | `reminders` | `object` | No | — | | `anyoneCanAddSelf` | `boolean` | No | — | | `guestsCanInviteOthers` | `boolean` | No | — | | `guestsCanModify` | `boolean` | No | — | | `guestsCanSeeOtherGuests` | `boolean` | No | — | | `privateCopy` | `boolean` | No | — | | `locked` | `boolean` | No | — | | `conferenceData` | `object` | No | — | | `attachments` | `object[]` | No | — | | `source` | `object` | No | — | | `gadget` | `object` | No | — | | `eventType` | `default \| outOfOffice \| focusTime \| workingLocation \| birthday \| fromGmail` | No | — | > **creator full type** > > ```ts theme={null} > { > id?: string, > email?: string, > displayName?: string, > self?: boolean > } > ``` > **organizer full type** > > ```ts theme={null} > { > id?: string, > email?: string, > displayName?: string, > self?: boolean > } > ``` > **start full type** > > ```ts theme={null} > { > date?: string, > dateTime?: string, > timeZone?: string > } > ``` > **end full type** > > ```ts theme={null} > { > date?: string, > dateTime?: string, > timeZone?: string > } > ``` > **originalStartTime full type** > > ```ts theme={null} > { > date?: string, > dateTime?: string, > timeZone?: string > } > ``` > **attendees full type** > > ```ts theme={null} > { > id?: string, > email?: string, > displayName?: string, > organizer?: boolean, > self?: boolean, > resource?: boolean, > optional?: boolean, > responseStatus?: needsAction | declined | tentative | accepted, > comment?: string, > additionalGuests?: number > }[] > ``` > **reminders full type** > > ```ts theme={null} > { > useDefault?: boolean, > overrides?: { > method?: email | popup, > minutes?: number > }[] > } > ``` > **conferenceData full type** > > ```ts theme={null} > { > createRequest?: { > requestId?: string, > conferenceSolutionKey?: { > type?: string > }, > status?: { > statusCode?: string > } > }, > entryPoints?: { > entryPointType?: string, > uri?: string, > label?: string, > pin?: string, > accessCode?: string, > meetingCode?: string, > passcode?: string, > password?: string > }[], > conferenceSolution?: { > key?: { > type?: string > }, > name?: string, > iconUri?: string > }, > conferenceId?: string, > signature?: string, > notes?: string > } > ``` > **attachments full type** > > ```ts theme={null} > { > fileUrl?: string, > title?: string, > mimeType?: string, > iconLink?: string, > fileId?: string > }[] > ``` > **source full type** > > ```ts theme={null} > { > url?: string, > title?: string > } > ``` > **gadget full type** > > ```ts theme={null} > { > type?: string, > title?: string, > link?: string, > iconLink?: string, > width?: number, > height?: number, > display?: string, > preferences?: { > } > } > ``` *** ### getMany `events.getMany` List calendar events **Risk:** `read` ```ts theme={null} await corsair.googlecalendar.api.events.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `calendarId` | `string` | No | — | | `timeMin` | `string` | No | — | | `timeMax` | `string` | No | — | | `timeZone` | `string` | No | — | | `updatedMin` | `string` | No | — | | `singleEvents` | `boolean` | No | — | | `maxResults` | `number` | No | — | | `pageToken` | `string` | No | — | | `q` | `string` | No | — | | `orderBy` | `startTime \| updated` | No | — | | `iCalUID` | `string` | No | — | | `showDeleted` | `boolean` | No | — | | `showHiddenInvitations` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `etag` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `updated` | `string` | No | — | | `timeZone` | `string` | No | — | | `accessRole` | `string` | No | — | | `defaultReminders` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | | `nextSyncToken` | `string` | No | — | | `items` | `object[]` | No | — | > **defaultReminders full type** > > ```ts theme={null} > { > method?: email | popup, > minutes?: number > }[] > ``` > **items full type** > > ```ts theme={null} > { > id?: string, > status?: confirmed | tentative | cancelled, > htmlLink?: string, > created?: string, > updated?: string, > summary?: string, > description?: string, > location?: string, > colorId?: string, > creator?: { > id?: string, > email?: string, > displayName?: string, > self?: boolean > }, > organizer?: { > id?: string, > email?: string, > displayName?: string, > self?: boolean > }, > start?: { > date?: string, > dateTime?: string, > timeZone?: string > }, > end?: { > date?: string, > dateTime?: string, > timeZone?: string > }, > endTimeUnspecified?: boolean, > recurrence?: string[], > recurringEventId?: string, > originalStartTime?: { > date?: string, > dateTime?: string, > timeZone?: string > }, > transparency?: opaque | transparent, > visibility?: default | public | private | confidential, > iCalUID?: string, > sequence?: number, > attendees?: { > id?: string, > email?: string, > displayName?: string, > organizer?: boolean, > self?: boolean, > resource?: boolean, > optional?: boolean, > responseStatus?: needsAction | declined | tentative | accepted, > comment?: string, > additionalGuests?: number > }[], > attendeesOmitted?: boolean, > hangoutLink?: string, > reminders?: { > useDefault?: boolean, > overrides?: { > method?: email | popup, > minutes?: number > }[] > }, > anyoneCanAddSelf?: boolean, > guestsCanInviteOthers?: boolean, > guestsCanModify?: boolean, > guestsCanSeeOtherGuests?: boolean, > privateCopy?: boolean, > locked?: boolean, > conferenceData?: { > createRequest?: { > requestId?: string, > conferenceSolutionKey?: { > type?: string > }, > status?: { > statusCode?: string > } > }, > entryPoints?: { > entryPointType?: string, > uri?: string, > label?: string, > pin?: string, > accessCode?: string, > meetingCode?: string, > passcode?: string, > password?: string > }[], > conferenceSolution?: { > key?: { > type?: string > }, > name?: string, > iconUri?: string > }, > conferenceId?: string, > signature?: string, > notes?: string > }, > attachments?: { > fileUrl?: string, > title?: string, > mimeType?: string, > iconLink?: string, > fileId?: string > }[], > source?: { > url?: string, > title?: string > }, > gadget?: { > type?: string, > title?: string, > link?: string, > iconLink?: string, > width?: number, > height?: number, > display?: string, > preferences?: { > } > }, > eventType?: default | outOfOffice | focusTime | workingLocation | birthday | fromGmail > }[] > ``` *** ### update `events.update` Update an existing calendar event **Risk:** `write` ```ts theme={null} await corsair.googlecalendar.api.events.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `calendarId` | `string` | No | Calendar ID. Defaults to "primary". | | `id` | `string` | Yes | Event ID to update | | `event` | `object` | Yes | Updated event fields | | `sendUpdates` | `all \| externalOnly \| none` | No | — | | `sendNotifications` | `boolean` | No | — | | `conferenceDataVersion` | `number` | No | — | | `maxAttendees` | `number` | No | — | | `supportsAttachments` | `boolean` | No | — | > **event full type** > > ```ts theme={null} > { > summary?: string, > description?: string, > location?: string, > start?: { > date?: string, > dateTime?: string, > timeZone?: string > }, > end?: { > date?: string, > dateTime?: string, > timeZone?: string > }, > attendees?: { > id?: string, > email?: string, > displayName?: string, > organizer?: boolean, > self?: boolean, > resource?: boolean, > optional?: boolean, > responseStatus?: needsAction | declined | tentative | accepted, > comment?: string, > additionalGuests?: number > }[], > recurrence?: string[], > colorId?: string, > transparency?: opaque | transparent, > visibility?: default | public | private | confidential, > eventType?: default | outOfOffice | focusTime | workingLocation | birthday | fromGmail, > status?: confirmed | tentative | cancelled, > reminders?: { > useDefault?: boolean, > overrides?: { > method?: email | popup, > minutes?: number > }[] > }, > guestsCanModify?: boolean, > guestsCanInviteOthers?: boolean, > guestsCanSeeOtherGuests?: boolean, > anyoneCanAddSelf?: boolean, > sequence?: number, > originalStartTime?: { > date?: string, > dateTime?: string, > timeZone?: string > }, > recurringEventId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `status` | `confirmed \| tentative \| cancelled` | No | — | | `htmlLink` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `location` | `string` | No | — | | `colorId` | `string` | No | — | | `creator` | `object` | No | — | | `organizer` | `object` | No | — | | `start` | `object` | No | — | | `end` | `object` | No | — | | `endTimeUnspecified` | `boolean` | No | — | | `recurrence` | `string[]` | No | — | | `recurringEventId` | `string` | No | — | | `originalStartTime` | `object` | No | — | | `transparency` | `opaque \| transparent` | No | — | | `visibility` | `default \| public \| private \| confidential` | No | — | | `iCalUID` | `string` | No | — | | `sequence` | `number` | No | — | | `attendees` | `object[]` | No | — | | `attendeesOmitted` | `boolean` | No | — | | `hangoutLink` | `string` | No | — | | `reminders` | `object` | No | — | | `anyoneCanAddSelf` | `boolean` | No | — | | `guestsCanInviteOthers` | `boolean` | No | — | | `guestsCanModify` | `boolean` | No | — | | `guestsCanSeeOtherGuests` | `boolean` | No | — | | `privateCopy` | `boolean` | No | — | | `locked` | `boolean` | No | — | | `conferenceData` | `object` | No | — | | `attachments` | `object[]` | No | — | | `source` | `object` | No | — | | `gadget` | `object` | No | — | | `eventType` | `default \| outOfOffice \| focusTime \| workingLocation \| birthday \| fromGmail` | No | — | > **creator full type** > > ```ts theme={null} > { > id?: string, > email?: string, > displayName?: string, > self?: boolean > } > ``` > **organizer full type** > > ```ts theme={null} > { > id?: string, > email?: string, > displayName?: string, > self?: boolean > } > ``` > **start full type** > > ```ts theme={null} > { > date?: string, > dateTime?: string, > timeZone?: string > } > ``` > **end full type** > > ```ts theme={null} > { > date?: string, > dateTime?: string, > timeZone?: string > } > ``` > **originalStartTime full type** > > ```ts theme={null} > { > date?: string, > dateTime?: string, > timeZone?: string > } > ``` > **attendees full type** > > ```ts theme={null} > { > id?: string, > email?: string, > displayName?: string, > organizer?: boolean, > self?: boolean, > resource?: boolean, > optional?: boolean, > responseStatus?: needsAction | declined | tentative | accepted, > comment?: string, > additionalGuests?: number > }[] > ``` > **reminders full type** > > ```ts theme={null} > { > useDefault?: boolean, > overrides?: { > method?: email | popup, > minutes?: number > }[] > } > ``` > **conferenceData full type** > > ```ts theme={null} > { > createRequest?: { > requestId?: string, > conferenceSolutionKey?: { > type?: string > }, > status?: { > statusCode?: string > } > }, > entryPoints?: { > entryPointType?: string, > uri?: string, > label?: string, > pin?: string, > accessCode?: string, > meetingCode?: string, > passcode?: string, > password?: string > }[], > conferenceSolution?: { > key?: { > type?: string > }, > name?: string, > iconUri?: string > }, > conferenceId?: string, > signature?: string, > notes?: string > } > ``` > **attachments full type** > > ```ts theme={null} > { > fileUrl?: string, > title?: string, > mimeType?: string, > iconLink?: string, > fileId?: string > }[] > ``` > **source full type** > > ```ts theme={null} > { > url?: string, > title?: string > } > ``` > **gadget full type** > > ```ts theme={null} > { > type?: string, > title?: string, > link?: string, > iconLink?: string, > width?: number, > height?: number, > display?: string, > preferences?: { > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/googlecalendar/database Google Calendar local sync: searchable entities, `.search()` filters, and operators. The Google Calendar plugin syncs data locally. Use `corsair.googlecalendar.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Calendars Path: `googlecalendar.db.calendars.search` ```ts theme={null} const rows = await corsair.googlecalendar.db.calendars.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `timeZone` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Events Path: `googlecalendar.db.events.search` ```ts theme={null} const rows = await corsair.googlecalendar.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `htmlLink` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `colorId` | `string` | equals, contains, startsWith, endsWith, in | | `endTimeUnspecified` | `boolean` | equals | | `recurringEventId` | `string` | equals, contains, startsWith, endsWith, in | | `iCalUID` | `string` | equals, contains, startsWith, endsWith, in | | `sequence` | `number` | equals, gt, gte, lt, lte, in | | `attendeesOmitted` | `boolean` | equals | | `hangoutLink` | `string` | equals, contains, startsWith, endsWith, in | | `anyoneCanAddSelf` | `boolean` | equals | | `guestsCanInviteOthers` | `boolean` | equals | | `guestsCanModify` | `boolean` | equals | | `guestsCanSeeOtherGuests` | `boolean` | equals | | `privateCopy` | `boolean` | equals | | `locked` | `boolean` | equals | | `calendarId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/googlecalendar/get-credentials Step-by-step instructions for obtaining Google Calendar OAuth 2.0 credentials. This guide walks you through obtaining all required credentials for the Google Calendar plugin. ## Authentication Method The Google Calendar plugin uses OAuth 2.0 authentication exclusively. * **[`oauth_2`](/concepts/oauth)** (default) - OAuth 2.0 authentication ## OAuth 2.0 Setup ### Step 1: Create Google Cloud Project 1. Go to [Google Cloud Console](https://console.cloud.google.com/) 2. Click **Select a project** → **New Project** 3. Enter a project name and click **Create** 4. Wait for the project to be created and select it ### Step 2: Enable Google Calendar API 1. In the Google Cloud Console, go to **APIs & Services** → **Library** 2. Search for "Google Calendar API" 3. Click on **Google Calendar API** 4. Click **Enable** ### Step 3: Create OAuth 2.0 Credentials 1. Go to **APIs & Services** → **Credentials** 2. Click **Create Credentials** → **OAuth client ID** 3. If prompted, configure the OAuth consent screen: * Choose **External** (unless you have a Google Workspace) * Fill in the required information: * App name * User support email * Developer contact information * Add scopes: * `https://www.googleapis.com/auth/calendar.events` * `https://www.googleapis.com/auth/calendar.freebusy` * Add test users (for testing) * Click **Save and Continue** through all steps 4. Select **Web application** 5. Configure: * **Name**: Your application name * **Authorized redirect URIs**: Add your callback URL (e.g., `https://yourapp.com/auth/googlecalendar/callback`) 6. Click **Create** 7. Copy the **Client ID** and **Client Secret** 8. Store these securely **Storing Credentials:** Store your OAuth app credentials, then start the flow: ```bash theme={null} pnpm corsair setup --plugin=googlecalendar client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=googlecalendar ``` The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically. To verify credentials were stored: ```bash theme={null} pnpm corsair auth --plugin=googlecalendar --credentials ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials | | Client Secret | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials | | Access Token | OAuth 2.0 | Obtained automatically after OAuth flow | | Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/googlecalendar/overview Scheduling service for creating events, managing calendars, and checking availability. Use **Google Calendar** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 6 typed API operations * 2 synced entities (`calendars`, `events`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googlecalendar ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googlecalendar ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googlecalendar ``` ```bash bun theme={null} bun add corsair @corsair-dev/googlecalendar ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googlecalendar } from '@corsair-dev/googlecalendar'; export const corsair = createCorsair({ plugins: [ googlecalendar(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Google Calendar OAuth app. Provider walkthrough: [Get Credentials](/plugins/googlecalendar/get-credentials). ```ts theme={null} googlecalendar() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googlecalendar', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Get availability** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlecalendar.api.calendar.getAvailability({ timeMin: '2026-01-01T00:00:00Z', timeMax: '2026-01-07T23:59:59Z', items: [{ id: 'primary' }], }); ``` **Create an event** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlecalendar.api.events.create({ event: { summary: 'Team Sync', start: { dateTime: '2026-01-02T10:00:00Z' }, end: { dateTime: '2026-01-02T11:00:00Z' }, }, }); ``` See the full list on the [API](/plugins/googlecalendar/api) page. ## Query synced data Search synced events without hitting Google Calendar. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.googlecalendar.db.events.search({ data: {}, limit: 50, }); ``` Synced entities: `calendars`, `events`. See [Database](/plugins/googlecalendar/database) for filters and operators. ## Webhooks Fires when a Google Calendar event is created, updated, or deleted. ```ts theme={null} googlecalendar({ webhookHooks: { onEventChanged: { after: async (ctx, result) => { console.log('Google Calendar event changed:', result.data); } }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/googlecalendar/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/googlecalendar/api)** > > Every `googlecalendar.api.*` operation with input and output types. > **[Database](/plugins/googlecalendar/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/googlecalendar/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/googlecalendar/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/googlecalendar/webhooks Google Calendar incoming webhooks: event paths, payloads, and response data. The Google Calendar plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/googlecalendar/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `onEventChanged` (`onEventChanged`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## On Event Changed ### On Event Changed `onEventChanged` A Google Calendar event was created, updated, or deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | No | — | | `subscription` | `string` | No | — | | `event` | `any` | No | — | > **message full type** > > ```ts theme={null} > { > data?: string, > attributes?: { > }, > messageId?: string, > publishTime?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: eventCreated, > calendarId: string, > event: custom, > timestamp: string > } | { > type: eventUpdated, > calendarId: string, > event: custom, > timestamp: string > } | { > type: eventDeleted, > calendarId: string, > eventId: string, > timestamp: string > } > ``` **`webhookHooks` example** ```ts theme={null} googlecalendar({ webhookHooks: { onEventChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/googlecloudvision/api API reference for Google Cloud Vision: every `googlecloudvision.api.*` operation with input and output types. Every `googlecloudvision.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Files ### annotate `files.annotate` Annotate Files **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.files.annotate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | > **requests full type** > > ```ts theme={null} > { > inputConfig: { > gcsSource?: { > uri: string > }, > content?: string, > mimeType: string > }, > features: { > type: string, > maxResults?: number, > model?: string > }[], > imageContext?: { > }, > pages?: number[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `responses` | `object[]` | Yes | — | > **responses full type** > > ```ts theme={null} > { > }[] > ``` *** ### asyncBatchAnnotate `files.asyncBatchAnnotate` Annotate Files Async **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.files.asyncBatchAnnotate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | > **requests full type** > > ```ts theme={null} > { > inputConfig: { > gcsSource: { > uri: string > }, > mimeType: string > }, > features: { > type: string, > maxResults?: number, > model?: string > }[], > imageContext?: { > }, > outputConfig: { > gcsDestination: { > uri: string > }, > batchSize?: number > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `metadata` | `object` | No | — | | `done` | `boolean` | No | — | | `error` | `object` | No | — | | `response` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code: number, > message: string > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` *** ## Images ### annotate `images.annotate` Annotate Images **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.images.annotate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | > **requests full type** > > ```ts theme={null} > { > image: { > content?: string, > source?: { > gcsImageUri?: string, > imageUri?: string > } > }, > features: { > type: string, > maxResults?: number, > model?: string > }[], > imageContext?: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `responses` | `object[]` | Yes | — | > **responses full type** > > ```ts theme={null} > { > }[] > ``` *** ### asyncBatchAnnotate `images.asyncBatchAnnotate` Annotate Images Async **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.images.asyncBatchAnnotate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | | `outputConfig` | `object` | Yes | — | > **requests full type** > > ```ts theme={null} > { > image: { > source: { > gcsImageUri: string > } > }, > features: { > type: string, > maxResults?: number, > model?: string > }[], > imageContext?: { > } > }[] > ``` > **outputConfig full type** > > ```ts theme={null} > { > gcsDestination: { > uri: string > }, > batchSize?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `metadata` | `object` | No | — | | `done` | `boolean` | No | — | | `error` | `object` | No | — | | `response` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code: number, > message: string > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` *** ### locationAnnotate `images.locationAnnotate` Annotate Location Images **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.images.locationAnnotate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `requests` | `object[]` | Yes | — | > **requests full type** > > ```ts theme={null} > { > image: { > content?: string, > source?: { > gcsImageUri?: string, > imageUri?: string > } > }, > features: { > type: string, > maxResults?: number, > model?: string > }[], > imageContext?: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `responses` | `object[]` | Yes | — | > **responses full type** > > ```ts theme={null} > { > }[] > ``` *** ## Locations ### list `locations.list` List Locations **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.locations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `filter` | `string` | No | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `locations` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **locations full type** > > ```ts theme={null} > { > name: string, > locationId: string, > displayName?: string, > labels?: { > } > }[] > ``` *** ## Operations ### cancel `operations.cancel` Cancel Operation **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.operations.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** *empty object* *** ### delete `operations.delete` Delete Operation **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.operations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** *empty object* *** ### get `operations.get` Get Operation **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.operations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `metadata` | `object` | No | — | | `done` | `boolean` | No | — | | `error` | `object` | No | — | | `response` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code: number, > message: string > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` *** ### list `operations.list` List Operations **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.operations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `filter` | `string` | No | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `operations` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **operations full type** > > ```ts theme={null} > { > name: string, > metadata?: { > }, > done?: boolean, > error?: { > code: number, > message: string > }, > response?: { > } > }[] > ``` *** ## Products ### create `products.create` Create Product **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.products.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `productId` | `string` | No | — | | `product` | `object` | Yes | — | > **product full type** > > ```ts theme={null} > { > name?: string, > displayName: string, > description?: string, > productCategory: string, > productLabels?: { > key: string, > value: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `displayName` | `string` | Yes | — | | `description` | `string` | No | — | | `productCategory` | `string` | Yes | — | | `productLabels` | `object[]` | No | — | > **productLabels full type** > > ```ts theme={null} > { > key: string, > value: string > }[] > ``` *** ### delete `products.delete` Delete Product **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.products.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** *empty object* *** ### get `products.get` Get Product **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.products.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `displayName` | `string` | Yes | — | | `description` | `string` | No | — | | `productCategory` | `string` | Yes | — | | `productLabels` | `object[]` | No | — | > **productLabels full type** > > ```ts theme={null} > { > key: string, > value: string > }[] > ``` *** ### list `products.list` List Products **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.products.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `products` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **products full type** > > ```ts theme={null} > { > name?: string, > displayName: string, > description?: string, > productCategory: string, > productLabels?: { > key: string, > value: string > }[] > }[] > ``` *** ### purge `products.purge` Purge Products **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googlecloudvision.api.products.purge({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `productSetPurgeConfig` | `object` | No | — | | `deleteOrphanProducts` | `boolean` | No | — | | `force` | `true` | Yes | — | > **productSetPurgeConfig full type** > > ```ts theme={null} > { > productSetId: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `metadata` | `object` | No | — | | `done` | `boolean` | No | — | | `error` | `object` | No | — | | `response` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code: number, > message: string > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` *** ### update `products.update` Update Product **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.products.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `product` | `object` | Yes | — | | `updateMask` | `string` | No | — | > **product full type** > > ```ts theme={null} > { > name?: string, > displayName: string, > description?: string, > productCategory: string, > productLabels?: { > key: string, > value: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `displayName` | `string` | Yes | — | | `description` | `string` | No | — | | `productCategory` | `string` | Yes | — | | `productLabels` | `object[]` | No | — | > **productLabels full type** > > ```ts theme={null} > { > key: string, > value: string > }[] > ``` *** ## Product Sets ### addProduct `productSets.addProduct` Add Product to Set **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.productSets.addProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `product` | `string` | Yes | — | **Output:** *empty object* *** ### create `productSets.create` Create Product Set **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.productSets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `productSetId` | `string` | No | — | | `productSet` | `object` | Yes | — | > **productSet full type** > > ```ts theme={null} > { > name?: string, > displayName: string, > indexTime?: string, > indexError?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `displayName` | `string` | Yes | — | | `indexTime` | `string` | No | — | | `indexError` | `object` | No | — | > **indexError full type** > > ```ts theme={null} > { > } > ``` *** ### delete `productSets.delete` Delete Product Set **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.productSets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** *empty object* *** ### get `productSets.get` Get Product Set **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.productSets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `displayName` | `string` | Yes | — | | `indexTime` | `string` | No | — | | `indexError` | `object` | No | — | > **indexError full type** > > ```ts theme={null} > { > } > ``` *** ### import `productSets.import` Import Product Sets **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.productSets.import({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `inputConfig` | `object` | Yes | — | > **inputConfig full type** > > ```ts theme={null} > { > gcsSource: { > csvFileUri: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `metadata` | `object` | No | — | | `done` | `boolean` | No | — | | `error` | `object` | No | — | | `response` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code: number, > message: string > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` *** ### list `productSets.list` List Product Sets **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.productSets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `productSets` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **productSets full type** > > ```ts theme={null} > { > name?: string, > displayName: string, > indexTime?: string, > indexError?: { > } > }[] > ``` *** ### listProducts `productSets.listProducts` List Products in Set **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.productSets.listProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `products` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **products full type** > > ```ts theme={null} > { > }[] > ``` *** ### removeProduct `productSets.removeProduct` Remove Product from Set **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.productSets.removeProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `product` | `string` | Yes | — | **Output:** *empty object* *** ### update `productSets.update` Update Product Set **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.productSets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `productSet` | `object` | Yes | — | | `updateMask` | `string` | No | — | > **productSet full type** > > ```ts theme={null} > { > name?: string, > displayName: string, > indexTime?: string, > indexError?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `displayName` | `string` | Yes | — | | `indexTime` | `string` | No | — | | `indexError` | `object` | No | — | > **indexError full type** > > ```ts theme={null} > { > } > ``` *** ## Reference Images ### create `referenceImages.create` Create Reference Image **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.referenceImages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `referenceImageId` | `string` | No | — | | `referenceImage` | `object` | Yes | — | > **referenceImage full type** > > ```ts theme={null} > { > name?: string, > uri: string, > boundingPolys?: { > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `uri` | `string` | Yes | — | | `boundingPolys` | `object[]` | No | — | > **boundingPolys full type** > > ```ts theme={null} > { > }[] > ``` *** ### delete `referenceImages.delete` Delete Reference Image **Risk:** `write` ```ts theme={null} await corsair.googlecloudvision.api.referenceImages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** *empty object* *** ### get `referenceImages.get` Get Reference Image **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.referenceImages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `uri` | `string` | Yes | — | | `boundingPolys` | `object[]` | No | — | > **boundingPolys full type** > > ```ts theme={null} > { > }[] > ``` *** ### list `referenceImages.list` List Reference Images **Risk:** `read` ```ts theme={null} await corsair.googlecloudvision.api.referenceImages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `referenceImages` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | | `pageSize` | `number` | No | — | > **referenceImages full type** > > ```ts theme={null} > { > name?: string, > uri: string, > boundingPolys?: { > }[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/googlecloudvision/database Google Cloud Vision local sync: searchable entities, `.search()` filters, and operators. The Google Cloud Vision plugin syncs data locally. Use `corsair.googlecloudvision.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/googlecloudvision/overview Image analysis API for labeling, OCR, face detection, and visual content understanding. Use **Google Cloud Vision** through Corsair: one client, typed API calls. **What you get:** * 29 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googlecloudvision ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googlecloudvision ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googlecloudvision ``` ```bash bun theme={null} bun add corsair @corsair-dev/googlecloudvision ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googlecloudvision } from '@corsair-dev/googlecloudvision'; export const corsair = createCorsair({ plugins: [ googlecloudvision(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} googlecloudvision() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Google Cloud Vision OAuth app. ```ts theme={null} googlecloudvision({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googlecloudvision', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`files.annotate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlecloudvision.api.files.annotate({}); ``` **`files.asyncBatchAnnotate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlecloudvision.api.files.asyncBatchAnnotate({}); ``` See the full list on the [API](/plugins/googlecloudvision/api) page. ## What's next > **[API reference](/plugins/googlecloudvision/api)** > > Every `googlecloudvision.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/googledocs/api API reference for Google Docs: every `googledocs.api.*` operation with input and output types. Every `googledocs.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Documents ### copyDocument `documents.copyDocument` Copy an existing Google Doc **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.documents.copyDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `name` | `string` | No | — | | `parents` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `mimeType` | `string` | No | — | | `parents` | `string[]` | No | — | | `trashed` | `boolean` | No | — | | `createdTime` | `string` | No | — | | `modifiedTime` | `string` | No | — | | `webViewLink` | `string` | No | — | | `size` | `string` | No | — | | `owners` | `any[]` | No | — | *** ### createBlankDocument `documents.createBlankDocument` Create a blank Google Doc \[DEPRECATED: prefer documents.createDocument] **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.documents.createBlankDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `title` | `string` | No | — | | `revisionId` | `string` | No | — | | `body` | `any` | No | — | | `headers` | `any` | No | — | | `footers` | `any` | No | — | | `footnotes` | `any` | No | — | | `inlineObjects` | `any` | No | — | | `positionedObjects` | `any` | No | — | | `namedRanges` | `any` | No | — | | `lists` | `any` | No | — | | `documentStyle` | `any` | No | — | | `suggestionsViewMode` | `string` | No | — | | `tabs` | `any` | No | — | *** ### createDocument `documents.createDocument` Create a Google Doc with an optional title and initial text **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.documents.createDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `title` | `string` | No | — | | `revisionId` | `string` | No | — | | `body` | `any` | No | — | | `headers` | `any` | No | — | | `footers` | `any` | No | — | | `footnotes` | `any` | No | — | | `inlineObjects` | `any` | No | — | | `positionedObjects` | `any` | No | — | | `namedRanges` | `any` | No | — | | `lists` | `any` | No | — | | `documentStyle` | `any` | No | — | | `suggestionsViewMode` | `string` | No | — | | `tabs` | `any` | No | — | *** ### createDocumentMarkdown `documents.createDocumentMarkdown` Create a Google Doc initialized from Markdown text **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.documents.createDocumentMarkdown({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `markdown` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `title` | `string` | No | — | | `revisionId` | `string` | No | — | | `body` | `any` | No | — | | `headers` | `any` | No | — | | `footers` | `any` | No | — | | `footnotes` | `any` | No | — | | `inlineObjects` | `any` | No | — | | `positionedObjects` | `any` | No | — | | `namedRanges` | `any` | No | — | | `lists` | `any` | No | — | | `documentStyle` | `any` | No | — | | `suggestionsViewMode` | `string` | No | — | | `tabs` | `any` | No | — | *** ### exportDocumentAsPdf `documents.exportDocumentAsPdf` Export a Google Doc as PDF (Drive enforces a 10MB limit) **Risk:** `read` ```ts theme={null} await corsair.googledocs.api.documents.exportDocumentAsPdf({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `mimeType` | `string` | Yes | — | | `data` | `string` | Yes | — | *** ### getDocument `documents.getDocument` Retrieve a Google Doc by id (set includeTabsContent for multi-tab documents) **Risk:** `read` ```ts theme={null} await corsair.googledocs.api.documents.getDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `includeTabsContent` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `title` | `string` | No | — | | `revisionId` | `string` | No | — | | `body` | `any` | No | — | | `headers` | `any` | No | — | | `footers` | `any` | No | — | | `footnotes` | `any` | No | — | | `inlineObjects` | `any` | No | — | | `positionedObjects` | `any` | No | — | | `namedRanges` | `any` | No | — | | `lists` | `any` | No | — | | `documentStyle` | `any` | No | — | | `suggestionsViewMode` | `string` | No | — | | `tabs` | `any` | No | — | *** ### getDocumentPlaintext `documents.getDocumentPlaintext` Retrieve a Google Doc as plain text; optional tabId, tabTitle, or tabIndex for a specific tab **Risk:** `read` ```ts theme={null} await corsair.googledocs.api.documents.getDocumentPlaintext({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `includeTabsContent` | `boolean` | No | — | | `tabId` | `string` | No | — | | `tabTitle` | `string` | No | — | | `tabIndex` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `title` | `string` | No | — | | `text` | `string` | Yes | — | | `wordCount` | `number` | Yes | — | | `tabId` | `string` | No | — | | `tabTitle` | `string` | No | — | *** ### listDocumentTabs `documents.listDocumentTabs` List tab id, title, and hierarchy for a Google Doc (includes nested tabs) **Risk:** `read` ```ts theme={null} await corsair.googledocs.api.documents.listDocumentTabs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `title` | `string` | No | — | | `tabs` | `object[]` | Yes | — | > **tabs full type** > > ```ts theme={null} > { > tabId: string, > title?: string, > index?: number, > parentTabId?: string, > nestingLevel?: number > }[] > ``` *** ### listSpreadsheetCharts `documents.listSpreadsheetCharts` List charts in a Google Sheets spreadsheet for embedding **Risk:** `read` ```ts theme={null} await corsair.googledocs.api.documents.listSpreadsheetCharts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `sheets` | `any[]` | No | — | *** ### searchDocuments `documents.searchDocuments` Search Google Docs by name, content, or date filters **Risk:** `read` ```ts theme={null} await corsair.googledocs.api.documents.searchDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `orderBy` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `incompleteSearch` | `boolean` | No | — | | `files` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > id?: string, > name?: string, > mimeType?: string, > parents?: string[], > trashed?: boolean, > createdTime?: string, > modifiedTime?: string, > webViewLink?: string, > size?: string, > owners?: any[] > }[] > ``` *** ### updateDocumentBatch `documents.updateDocumentBatch` Apply batchUpdate edits \[DEPRECATED: prefer documents.updateExistingDocument] **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.documents.updateDocumentBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `requests` | `object[]` | Yes | — | | `writeControl` | `object` | No | — | > **requests full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### updateDocumentMarkdown `documents.updateDocumentMarkdown` Replace a Google Doc content with Markdown text **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.documents.updateDocumentMarkdown({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `markdown` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### updateDocumentSectionMarkdown `documents.updateDocumentSectionMarkdown` Replace a section of a Google Doc with Markdown text **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.documents.updateDocumentSectionMarkdown({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `markdown` | `string` | Yes | — | | `startIndex` | `number` | Yes | — | | `endIndex` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### updateDocumentStyle `documents.updateDocumentStyle` Update the page size, margins, and global document style **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.documents.updateDocumentStyle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `documentStyle` | `object` | Yes | — | | `fields` | `string` | Yes | — | > **documentStyle full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### updateExistingDocument `documents.updateExistingDocument` Apply batchUpdate edits (insert/delete/format) to a Google Doc **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.documents.updateExistingDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `requests` | `object[]` | Yes | — | | `writeControl` | `object` | No | — | > **requests full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ## Sheets ### readValues `sheets.readValues` Read cell values from a spreadsheet (Sheets API via spreadsheets.readonly) **Risk:** `read` ```ts theme={null} await corsair.googledocs.api.sheets.readValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | | `sheetName` | `string` | No | — | | `range` | `string` | No | A1 notation range (e.g. "Sheet1!A1:D10"). When omitted, defaults to sheetName!A:Z or Sheet1!A:Z. | | `valueRenderOption` | `FORMATTED_VALUE \| UNFORMATTED_VALUE \| FORMULA` | No | — | | `dateTimeRenderOption` | `SERIAL_NUMBER \| FORMATTED_STRING` | No | — | | `majorDimension` | `ROWS \| COLUMNS` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `range` | `string` | No | — | | `majorDimension` | `ROWS \| COLUMNS \| DIMENSION_UNSPECIFIED` | No | — | | `values` | `(string \| number \| boolean \| null)[][]` | No | — | *** ## Structure ### createFooter `structure.createFooter` Create a footer **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.structure.createFooter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `type` | `DEFAULT \| FIRST_PAGE \| EVEN_PAGE` | No | — | | `sectionBreakLocation` | `object` | No | — | > **sectionBreakLocation full type** > > ```ts theme={null} > { > index: number, > segmentId?: string, > tabId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### createFootnote `structure.createFootnote` Create a footnote **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.structure.createFootnote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `location` | `object` | No | — | | `endOfSegmentLocation` | `object` | No | — | > **location full type** > > ```ts theme={null} > { > index: number, > segmentId?: string, > tabId?: string > } > ``` > **endOfSegmentLocation full type** > > ```ts theme={null} > { > segmentId?: string, > tabId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### createHeader `structure.createHeader` Create a header **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.structure.createHeader({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `type` | `DEFAULT \| FIRST_PAGE \| EVEN_PAGE` | No | — | | `sectionBreakLocation` | `object` | No | — | > **sectionBreakLocation full type** > > ```ts theme={null} > { > index: number, > segmentId?: string, > tabId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### createNamedRange `structure.createNamedRange` Create a named range **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.structure.createNamedRange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `startIndex` | `number` | Yes | — | | `endIndex` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### createParagraphBullets `structure.createParagraphBullets` Add bullets to a range of paragraphs **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.structure.createParagraphBullets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `startIndex` | `number` | Yes | — | | `endIndex` | `number` | Yes | — | | `bulletPreset` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### deleteFooter `structure.deleteFooter` Delete a footer **Risk:** `destructive` ```ts theme={null} await corsair.googledocs.api.structure.deleteFooter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `footerId` | `string` | Yes | — | | `type` | `DEFAULT \| FIRST_PAGE \| EVEN_PAGE` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### deleteHeader `structure.deleteHeader` Delete a header **Risk:** `destructive` ```ts theme={null} await corsair.googledocs.api.structure.deleteHeader({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `headerId` | `string` | Yes | — | | `type` | `DEFAULT \| FIRST_PAGE \| EVEN_PAGE` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### deleteNamedRange `structure.deleteNamedRange` Delete a named range by id or name **Risk:** `destructive` ```ts theme={null} await corsair.googledocs.api.structure.deleteNamedRange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `namedRangeId` | `string` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### deleteParagraphBullets `structure.deleteParagraphBullets` Remove bullets from a range of paragraphs **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.structure.deleteParagraphBullets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `startIndex` | `number` | Yes | — | | `endIndex` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ## Tables ### deleteTableColumn `tables.deleteTableColumn` Delete a column from a table **Risk:** `destructive` ```ts theme={null} await corsair.googledocs.api.tables.deleteTableColumn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `tableCellLocation` | `object` | Yes | — | > **tableCellLocation full type** > > ```ts theme={null} > { > tableStartLocation: { > index: number, > segmentId?: string, > tabId?: string > }, > rowIndex: number, > columnIndex: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### deleteTableRow `tables.deleteTableRow` Delete a row from a table **Risk:** `destructive` ```ts theme={null} await corsair.googledocs.api.tables.deleteTableRow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `tableCellLocation` | `object` | Yes | — | > **tableCellLocation full type** > > ```ts theme={null} > { > tableStartLocation: { > index: number, > segmentId?: string, > tabId?: string > }, > rowIndex: number, > columnIndex: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### insertTable `tables.insertTable` Insert a table into a Google Doc **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.tables.insertTable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `rows` | `number` | Yes | — | | `columns` | `number` | Yes | — | | `insertionIndex` | `number` | No | — | | `appendToEnd` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### insertTableColumn `tables.insertTableColumn` Insert a column into a table **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.tables.insertTableColumn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `tableCellLocation` | `object` | Yes | — | | `insertRight` | `boolean` | No | — | > **tableCellLocation full type** > > ```ts theme={null} > { > tableStartLocation: { > index: number, > segmentId?: string, > tabId?: string > }, > rowIndex: number, > columnIndex: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### unmergeTableCells `tables.unmergeTableCells` Unmerge previously merged table cells **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.tables.unmergeTableCells({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `tableRange` | `object` | Yes | — | > **tableRange full type** > > ```ts theme={null} > { > tableCellLocation: { > tableStartLocation: { > index: number, > segmentId?: string, > tabId?: string > }, > rowIndex: number, > columnIndex: number > }, > rowSpan: number, > columnSpan: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### updateTableRowStyle `tables.updateTableRowStyle` Update the style of table rows **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.tables.updateTableRowStyle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `tableStartLocation` | `object` | Yes | — | | `rowIndices` | `number[]` | Yes | — | | `tableRowStyle` | `object` | No | — | | `fields` | `string` | No | — | > **tableStartLocation full type** > > ```ts theme={null} > { > index: number, > segmentId?: string, > tabId?: string > } > ``` > **tableRowStyle full type** > > ```ts theme={null} > { > minRowHeight?: { > magnitude?: number, > unit?: string > }, > tableHeader?: boolean, > preventOverflow?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ## Text ### deleteContentRange `text.deleteContentRange` Delete a content range from a Google Doc **Risk:** `destructive` ```ts theme={null} await corsair.googledocs.api.text.deleteContentRange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `startIndex` | `number` | Yes | — | | `endIndex` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### insertInlineImage `text.insertInlineImage` Insert an inline image from a URI into a Google Doc **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.text.insertInlineImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `uri` | `string` | Yes | — | | `insertionIndex` | `number` | No | — | | `appendToEnd` | `boolean` | No | — | | `size` | `object` | No | — | > **size full type** > > ```ts theme={null} > { > height?: { > magnitude?: number, > unit?: string > }, > width?: { > magnitude?: number, > unit?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### insertPageBreak `text.insertPageBreak` Start a new page at a location in a Google Doc **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.text.insertPageBreak({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `insertionIndex` | `number` | No | — | | `appendToEnd` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### insertText `text.insertText` Insert text at a location or append to the end of a Google Doc **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.text.insertText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `text` | `string` | Yes | — | | `insertionIndex` | `number` | No | — | | `appendToEnd` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### replaceAllText `text.replaceAllText` Replace all occurrences of a string in a Google Doc **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.text.replaceAllText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `find` | `string` | Yes | — | | `replace` | `string` | Yes | — | | `matchCase` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** ### replaceImage `text.replaceImage` Replace an existing image in a Google Doc **Risk:** `write` ```ts theme={null} await corsair.googledocs.api.text.replaceImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | Yes | — | | `imageObjectId` | `string` | Yes | — | | `uri` | `string` | Yes | — | | `imageReplaceMethod` | `CENTER_CROP` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | > **replies full type** > > ```ts theme={null} > { > }[] > ``` > **writeControl full type** > > ```ts theme={null} > { > requiredRevisionId?: string, > targetRevisionId?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/googledocs/database Google Docs local sync: searchable entities, `.search()` filters, and operators. The Google Docs plugin syncs data locally. Use `corsair.googledocs.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Documents Path: `googledocs.db.documents.search` ```ts theme={null} const rows = await corsair.googledocs.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `documentId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `revisionId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedTime` | `string` | equals, contains, startsWith, endsWith, in | | `wordCount` | `number` | equals, gt, gte, lt, lte, in | | `headerCount` | `number` | equals, gt, gte, lt, lte, in | | `footerCount` | `number` | equals, gt, gte, lt, lte, in | | `footnoteCount` | `number` | equals, gt, gte, lt, lte, in | | `tableCount` | `number` | equals, gt, gte, lt, lte, in | | `imageCount` | `number` | equals, gt, gte, lt, lte, in | | `hasPlaceholder` | `boolean` | equals | | `hasKeyword` | `boolean` | equals | | `hasSearchMatch` | `boolean` | equals | | `filePath` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/googledocs/overview Online document editor for creating, sharing, and collaborating on text documents. Use **Google Docs** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. Google Docs exposes document creation and editing, text operations, structure (headers, footers, footnotes, named ranges, bullets), tables, images, styling, and batch updates for serverless document workflows. Use Corsair permissions for destructive actions such as deleting content ranges, headers, footers, named ranges, table rows, or table columns. **What you get:** * 37 typed API operations * 1 synced entity (`documents`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googledocs ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googledocs ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googledocs ``` ```bash bun theme={null} bun add corsair @corsair-dev/googledocs ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googledocs } from '@corsair-dev/googledocs'; export const corsair = createCorsair({ plugins: [ googledocs(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Google Docs OAuth app. ```ts theme={null} googledocs() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googledocs', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`documents.exportDocumentAsPdf`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googledocs.api.documents.exportDocumentAsPdf({}); ``` **`documents.copyDocument`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googledocs.api.documents.copyDocument({}); ``` See the full list on the [API](/plugins/googledocs/api) page. ## Query synced data Synced entities support `tenant.googledocs.db..search()` and `.list()`: `documents`. See [Database](/plugins/googledocs/database) for filters and operators. ## Webhooks This plugin registers **1** webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/googledocs/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/googledocs/api)** > > Every `googledocs.api.*` operation with input and output types. > **[Database](/plugins/googledocs/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/googledocs/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/googledocs/webhooks Google Docs incoming webhooks: event paths, payloads, and response data. The Google Docs plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/googledocs/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `docChanged` (`docChanged`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Doc Changed ### Doc Changed `docChanged` A Google Doc was created, updated, deleted, or matched a content trigger **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | No | — | | `subscription` | `string` | No | — | | `event` | `any` | No | — | > **message full type** > > ```ts theme={null} > { > data?: string, > attributes?: { > }, > messageId?: string, > publishTime?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: documentCreated | documentAdded | documentUpdated | documentDeleted | documentStructureChanged | keywordDetected | documentWordCountThreshold | documentPlaceholderFilled | documentSearchUpdate | folderCreated, > documentId?: string, > title?: string, > changeType?: created | updated | deleted | trashed, > matchedValue?: string, > wordCount?: number, > structure?: { > headers: number, > footers: number, > footnotes: number, > tables: number, > images: number, > positionedObjects: number, > namedRanges: number > }, > document?: custom > } > ``` **`webhookHooks` example** ```ts theme={null} googledocs({ webhookHooks: { docChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/googledrive/api API reference for Google Drive: every `googledrive.api.*` operation with input and output types. Every `googledrive.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Files ### copy `files.copy` Copy a file in Google Drive **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.files.copy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `name` | `string` | No | — | | `parents` | `string[]` | No | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `mimeType` | `string` | No | — | | `description` | `string` | No | — | | `starred` | `boolean` | No | — | | `trashed` | `boolean` | No | — | | `explicitlyTrashed` | `boolean` | No | — | | `parents` | `string[]` | No | — | | `properties` | `object` | No | — | | `appProperties` | `object` | No | — | | `spaces` | `string[]` | No | — | | `version` | `string` | No | — | | `webViewLink` | `string` | No | — | | `webContentLink` | `string` | No | — | | `iconLink` | `string` | No | — | | `hasThumbnail` | `boolean` | No | — | | `thumbnailLink` | `string` | No | — | | `thumbnailVersion` | `string` | No | — | | `viewedByMe` | `boolean` | No | — | | `viewedByMeTime` | `string` | No | — | | `createdTime` | `string` | No | — | | `modifiedTime` | `string` | No | — | | `modifiedByMeTime` | `string` | No | — | | `modifiedByMe` | `boolean` | No | — | | `shared` | `boolean` | No | — | | `ownedByMe` | `boolean` | No | — | | `permissionIds` | `string[]` | No | — | | `hasAugmentedPermissions` | `boolean` | No | — | | `folderColorRgb` | `string` | No | — | | `originalFilename` | `string` | No | — | | `fullFileExtension` | `string` | No | — | | `fileExtension` | `string` | No | — | | `md5Checksum` | `string` | No | — | | `size` | `string` | No | — | | `quotaBytesUsed` | `string` | No | — | | `headRevisionId` | `string` | No | — | | `isAppAuthorized` | `boolean` | No | — | | `resourceKey` | `string` | No | — | | `sha1Checksum` | `string` | No | — | | `sha256Checksum` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **appProperties full type** > > ```ts theme={null} > { > } > ``` *** ### createFromText `files.createFromText` Create a new Drive file from text content **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.files.createFromText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `mimeType` | `string` | No | — | | `parents` | `string[]` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `mimeType` | `string` | No | — | | `description` | `string` | No | — | | `starred` | `boolean` | No | — | | `trashed` | `boolean` | No | — | | `explicitlyTrashed` | `boolean` | No | — | | `parents` | `string[]` | No | — | | `properties` | `object` | No | — | | `appProperties` | `object` | No | — | | `spaces` | `string[]` | No | — | | `version` | `string` | No | — | | `webViewLink` | `string` | No | — | | `webContentLink` | `string` | No | — | | `iconLink` | `string` | No | — | | `hasThumbnail` | `boolean` | No | — | | `thumbnailLink` | `string` | No | — | | `thumbnailVersion` | `string` | No | — | | `viewedByMe` | `boolean` | No | — | | `viewedByMeTime` | `string` | No | — | | `createdTime` | `string` | No | — | | `modifiedTime` | `string` | No | — | | `modifiedByMeTime` | `string` | No | — | | `modifiedByMe` | `boolean` | No | — | | `shared` | `boolean` | No | — | | `ownedByMe` | `boolean` | No | — | | `permissionIds` | `string[]` | No | — | | `hasAugmentedPermissions` | `boolean` | No | — | | `folderColorRgb` | `string` | No | — | | `originalFilename` | `string` | No | — | | `fullFileExtension` | `string` | No | — | | `fileExtension` | `string` | No | — | | `md5Checksum` | `string` | No | — | | `size` | `string` | No | — | | `quotaBytesUsed` | `string` | No | — | | `headRevisionId` | `string` | No | — | | `isAppAuthorized` | `boolean` | No | — | | `resourceKey` | `string` | No | — | | `sha1Checksum` | `string` | No | — | | `sha256Checksum` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **appProperties full type** > > ```ts theme={null} > { > } > ``` *** ### delete `files.delete` Permanently delete a file \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googledrive.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | **Output:** `void` *** ### download `files.download` Download the content of a file **Risk:** `read` ```ts theme={null} await corsair.googledrive.api.files.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `acknowledgeAbuse` | `boolean` | No | — | **Output:** `any` *** ### get `files.get` Get metadata for a specific file **Risk:** `read` ```ts theme={null} await corsair.googledrive.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `acknowledgeAbuse` | `boolean` | No | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | | `includePermissionsForView` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `mimeType` | `string` | No | — | | `description` | `string` | No | — | | `starred` | `boolean` | No | — | | `trashed` | `boolean` | No | — | | `explicitlyTrashed` | `boolean` | No | — | | `parents` | `string[]` | No | — | | `properties` | `object` | No | — | | `appProperties` | `object` | No | — | | `spaces` | `string[]` | No | — | | `version` | `string` | No | — | | `webViewLink` | `string` | No | — | | `webContentLink` | `string` | No | — | | `iconLink` | `string` | No | — | | `hasThumbnail` | `boolean` | No | — | | `thumbnailLink` | `string` | No | — | | `thumbnailVersion` | `string` | No | — | | `viewedByMe` | `boolean` | No | — | | `viewedByMeTime` | `string` | No | — | | `createdTime` | `string` | No | — | | `modifiedTime` | `string` | No | — | | `modifiedByMeTime` | `string` | No | — | | `modifiedByMe` | `boolean` | No | — | | `shared` | `boolean` | No | — | | `ownedByMe` | `boolean` | No | — | | `permissionIds` | `string[]` | No | — | | `hasAugmentedPermissions` | `boolean` | No | — | | `folderColorRgb` | `string` | No | — | | `originalFilename` | `string` | No | — | | `fullFileExtension` | `string` | No | — | | `fileExtension` | `string` | No | — | | `md5Checksum` | `string` | No | — | | `size` | `string` | No | — | | `quotaBytesUsed` | `string` | No | — | | `headRevisionId` | `string` | No | — | | `isAppAuthorized` | `boolean` | No | — | | `resourceKey` | `string` | No | — | | `sha1Checksum` | `string` | No | — | | `sha256Checksum` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **appProperties full type** > > ```ts theme={null} > { > } > ``` *** ### list `files.list` List files in Google Drive **Risk:** `read` ```ts theme={null} await corsair.googledrive.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `spaces` | `string` | No | — | | `corpora` | `string` | No | — | | `driveId` | `string` | No | — | | `includeItemsFromAllDrives` | `boolean` | No | — | | `includePermissionsForView` | `string` | No | — | | `orderBy` | `string` | No | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | | `teamDriveId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `incompleteSearch` | `boolean` | No | — | | `files` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > id?: string, > name?: string, > mimeType?: string, > description?: string, > starred?: boolean, > trashed?: boolean, > explicitlyTrashed?: boolean, > parents?: string[], > properties?: { > }, > appProperties?: { > }, > spaces?: string[], > version?: string, > webViewLink?: string, > webContentLink?: string, > iconLink?: string, > hasThumbnail?: boolean, > thumbnailLink?: string, > thumbnailVersion?: string, > viewedByMe?: boolean, > viewedByMeTime?: string, > createdTime?: string, > modifiedTime?: string, > modifiedByMeTime?: string, > modifiedByMe?: boolean, > shared?: boolean, > ownedByMe?: boolean, > permissionIds?: string[], > hasAugmentedPermissions?: boolean, > folderColorRgb?: string, > originalFilename?: string, > fullFileExtension?: string, > fileExtension?: string, > md5Checksum?: string, > size?: string, > quotaBytesUsed?: string, > headRevisionId?: string, > isAppAuthorized?: boolean, > resourceKey?: string, > sha1Checksum?: string, > sha256Checksum?: string > }[] > ``` *** ### move `files.move` Move a file to a different folder **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.files.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `addParents` | `string` | No | — | | `removeParents` | `string` | No | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `mimeType` | `string` | No | — | | `description` | `string` | No | — | | `starred` | `boolean` | No | — | | `trashed` | `boolean` | No | — | | `explicitlyTrashed` | `boolean` | No | — | | `parents` | `string[]` | No | — | | `properties` | `object` | No | — | | `appProperties` | `object` | No | — | | `spaces` | `string[]` | No | — | | `version` | `string` | No | — | | `webViewLink` | `string` | No | — | | `webContentLink` | `string` | No | — | | `iconLink` | `string` | No | — | | `hasThumbnail` | `boolean` | No | — | | `thumbnailLink` | `string` | No | — | | `thumbnailVersion` | `string` | No | — | | `viewedByMe` | `boolean` | No | — | | `viewedByMeTime` | `string` | No | — | | `createdTime` | `string` | No | — | | `modifiedTime` | `string` | No | — | | `modifiedByMeTime` | `string` | No | — | | `modifiedByMe` | `boolean` | No | — | | `shared` | `boolean` | No | — | | `ownedByMe` | `boolean` | No | — | | `permissionIds` | `string[]` | No | — | | `hasAugmentedPermissions` | `boolean` | No | — | | `folderColorRgb` | `string` | No | — | | `originalFilename` | `string` | No | — | | `fullFileExtension` | `string` | No | — | | `fileExtension` | `string` | No | — | | `md5Checksum` | `string` | No | — | | `size` | `string` | No | — | | `quotaBytesUsed` | `string` | No | — | | `headRevisionId` | `string` | No | — | | `isAppAuthorized` | `boolean` | No | — | | `resourceKey` | `string` | No | — | | `sha1Checksum` | `string` | No | — | | `sha256Checksum` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **appProperties full type** > > ```ts theme={null} > { > } > ``` *** ### share `files.share` Share a file by granting permissions to users **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.files.share({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `type` | `user \| group \| domain \| anyone` | No | — | | `role` | `owner \| organizer \| fileOrganizer \| writer \| commenter \| reader` | No | — | | `emailAddress` | `string` | No | — | | `domain` | `string` | No | — | | `allowFileDiscovery` | `boolean` | No | — | | `expirationTime` | `string` | No | — | | `sendNotificationEmail` | `boolean` | No | — | | `emailMessage` | `string` | No | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | | `moveToNewOwnersRoot` | `boolean` | No | — | | `transferOwnership` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `type` | `user \| group \| domain \| anyone` | No | — | | `emailAddress` | `string` | No | — | | `domain` | `string` | No | — | | `role` | `owner \| organizer \| fileOrganizer \| writer \| commenter \| reader` | No | — | | `allowFileDiscovery` | `boolean` | No | — | | `displayName` | `string` | No | — | | `photoLink` | `string` | No | — | | `expirationTime` | `string` | No | — | | `deleted` | `boolean` | No | — | | `view` | `user \| domain` | No | — | | `pendingOwner` | `boolean` | No | — | *** ### update `files.update` Update the content or metadata of a file **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.files.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `starred` | `boolean` | No | — | | `trashed` | `boolean` | No | — | | `parents` | `string[]` | No | — | | `addParents` | `string` | No | — | | `removeParents` | `string` | No | — | | `properties` | `object` | No | — | | `appProperties` | `object` | No | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **appProperties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `mimeType` | `string` | No | — | | `description` | `string` | No | — | | `starred` | `boolean` | No | — | | `trashed` | `boolean` | No | — | | `explicitlyTrashed` | `boolean` | No | — | | `parents` | `string[]` | No | — | | `properties` | `object` | No | — | | `appProperties` | `object` | No | — | | `spaces` | `string[]` | No | — | | `version` | `string` | No | — | | `webViewLink` | `string` | No | — | | `webContentLink` | `string` | No | — | | `iconLink` | `string` | No | — | | `hasThumbnail` | `boolean` | No | — | | `thumbnailLink` | `string` | No | — | | `thumbnailVersion` | `string` | No | — | | `viewedByMe` | `boolean` | No | — | | `viewedByMeTime` | `string` | No | — | | `createdTime` | `string` | No | — | | `modifiedTime` | `string` | No | — | | `modifiedByMeTime` | `string` | No | — | | `modifiedByMe` | `boolean` | No | — | | `shared` | `boolean` | No | — | | `ownedByMe` | `boolean` | No | — | | `permissionIds` | `string[]` | No | — | | `hasAugmentedPermissions` | `boolean` | No | — | | `folderColorRgb` | `string` | No | — | | `originalFilename` | `string` | No | — | | `fullFileExtension` | `string` | No | — | | `fileExtension` | `string` | No | — | | `md5Checksum` | `string` | No | — | | `size` | `string` | No | — | | `quotaBytesUsed` | `string` | No | — | | `headRevisionId` | `string` | No | — | | `isAppAuthorized` | `boolean` | No | — | | `resourceKey` | `string` | No | — | | `sha1Checksum` | `string` | No | — | | `sha256Checksum` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **appProperties full type** > > ```ts theme={null} > { > } > ``` *** ### upload `files.upload` Upload a file to Google Drive **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `mimeType` | `string` | No | — | | `parents` | `string[]` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `mimeType` | `string` | No | — | | `description` | `string` | No | — | | `starred` | `boolean` | No | — | | `trashed` | `boolean` | No | — | | `explicitlyTrashed` | `boolean` | No | — | | `parents` | `string[]` | No | — | | `properties` | `object` | No | — | | `appProperties` | `object` | No | — | | `spaces` | `string[]` | No | — | | `version` | `string` | No | — | | `webViewLink` | `string` | No | — | | `webContentLink` | `string` | No | — | | `iconLink` | `string` | No | — | | `hasThumbnail` | `boolean` | No | — | | `thumbnailLink` | `string` | No | — | | `thumbnailVersion` | `string` | No | — | | `viewedByMe` | `boolean` | No | — | | `viewedByMeTime` | `string` | No | — | | `createdTime` | `string` | No | — | | `modifiedTime` | `string` | No | — | | `modifiedByMeTime` | `string` | No | — | | `modifiedByMe` | `boolean` | No | — | | `shared` | `boolean` | No | — | | `ownedByMe` | `boolean` | No | — | | `permissionIds` | `string[]` | No | — | | `hasAugmentedPermissions` | `boolean` | No | — | | `folderColorRgb` | `string` | No | — | | `originalFilename` | `string` | No | — | | `fullFileExtension` | `string` | No | — | | `fileExtension` | `string` | No | — | | `md5Checksum` | `string` | No | — | | `size` | `string` | No | — | | `quotaBytesUsed` | `string` | No | — | | `headRevisionId` | `string` | No | — | | `isAppAuthorized` | `boolean` | No | — | | `resourceKey` | `string` | No | — | | `sha1Checksum` | `string` | No | — | | `sha256Checksum` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **appProperties full type** > > ```ts theme={null} > { > } > ``` *** ## Folders ### create `folders.create` Create a new folder **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `parents` | `string[]` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `mimeType` | `string` | No | — | | `description` | `string` | No | — | | `starred` | `boolean` | No | — | | `trashed` | `boolean` | No | — | | `explicitlyTrashed` | `boolean` | No | — | | `parents` | `string[]` | No | — | | `properties` | `object` | No | — | | `appProperties` | `object` | No | — | | `spaces` | `string[]` | No | — | | `version` | `string` | No | — | | `webViewLink` | `string` | No | — | | `webContentLink` | `string` | No | — | | `iconLink` | `string` | No | — | | `hasThumbnail` | `boolean` | No | — | | `thumbnailLink` | `string` | No | — | | `thumbnailVersion` | `string` | No | — | | `viewedByMe` | `boolean` | No | — | | `viewedByMeTime` | `string` | No | — | | `createdTime` | `string` | No | — | | `modifiedTime` | `string` | No | — | | `modifiedByMeTime` | `string` | No | — | | `modifiedByMe` | `boolean` | No | — | | `shared` | `boolean` | No | — | | `ownedByMe` | `boolean` | No | — | | `permissionIds` | `string[]` | No | — | | `hasAugmentedPermissions` | `boolean` | No | — | | `folderColorRgb` | `string` | No | — | | `originalFilename` | `string` | No | — | | `fullFileExtension` | `string` | No | — | | `fileExtension` | `string` | No | — | | `md5Checksum` | `string` | No | — | | `size` | `string` | No | — | | `quotaBytesUsed` | `string` | No | — | | `headRevisionId` | `string` | No | — | | `isAppAuthorized` | `boolean` | No | — | | `resourceKey` | `string` | No | — | | `sha1Checksum` | `string` | No | — | | `sha256Checksum` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **appProperties full type** > > ```ts theme={null} > { > } > ``` *** ### delete `folders.delete` Permanently delete a folder and its contents \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googledrive.api.folders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | **Output:** `void` *** ### get `folders.get` Get metadata for a specific folder **Risk:** `read` ```ts theme={null} await corsair.googledrive.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | | `includePermissionsForView` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `mimeType` | `string` | No | — | | `description` | `string` | No | — | | `starred` | `boolean` | No | — | | `trashed` | `boolean` | No | — | | `explicitlyTrashed` | `boolean` | No | — | | `parents` | `string[]` | No | — | | `properties` | `object` | No | — | | `appProperties` | `object` | No | — | | `spaces` | `string[]` | No | — | | `version` | `string` | No | — | | `webViewLink` | `string` | No | — | | `webContentLink` | `string` | No | — | | `iconLink` | `string` | No | — | | `hasThumbnail` | `boolean` | No | — | | `thumbnailLink` | `string` | No | — | | `thumbnailVersion` | `string` | No | — | | `viewedByMe` | `boolean` | No | — | | `viewedByMeTime` | `string` | No | — | | `createdTime` | `string` | No | — | | `modifiedTime` | `string` | No | — | | `modifiedByMeTime` | `string` | No | — | | `modifiedByMe` | `boolean` | No | — | | `shared` | `boolean` | No | — | | `ownedByMe` | `boolean` | No | — | | `permissionIds` | `string[]` | No | — | | `hasAugmentedPermissions` | `boolean` | No | — | | `folderColorRgb` | `string` | No | — | | `originalFilename` | `string` | No | — | | `fullFileExtension` | `string` | No | — | | `fileExtension` | `string` | No | — | | `md5Checksum` | `string` | No | — | | `size` | `string` | No | — | | `quotaBytesUsed` | `string` | No | — | | `headRevisionId` | `string` | No | — | | `isAppAuthorized` | `boolean` | No | — | | `resourceKey` | `string` | No | — | | `sha1Checksum` | `string` | No | — | | `sha256Checksum` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **appProperties full type** > > ```ts theme={null} > { > } > ``` *** ### list `folders.list` List folders in Google Drive **Risk:** `read` ```ts theme={null} await corsair.googledrive.api.folders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `spaces` | `string` | No | — | | `corpora` | `string` | No | — | | `driveId` | `string` | No | — | | `includeItemsFromAllDrives` | `boolean` | No | — | | `includePermissionsForView` | `string` | No | — | | `orderBy` | `string` | No | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | | `teamDriveId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `incompleteSearch` | `boolean` | No | — | | `files` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > id?: string, > name?: string, > mimeType?: string, > description?: string, > starred?: boolean, > trashed?: boolean, > explicitlyTrashed?: boolean, > parents?: string[], > properties?: { > }, > appProperties?: { > }, > spaces?: string[], > version?: string, > webViewLink?: string, > webContentLink?: string, > iconLink?: string, > hasThumbnail?: boolean, > thumbnailLink?: string, > thumbnailVersion?: string, > viewedByMe?: boolean, > viewedByMeTime?: string, > createdTime?: string, > modifiedTime?: string, > modifiedByMeTime?: string, > modifiedByMe?: boolean, > shared?: boolean, > ownedByMe?: boolean, > permissionIds?: string[], > hasAugmentedPermissions?: boolean, > folderColorRgb?: string, > originalFilename?: string, > fullFileExtension?: string, > fileExtension?: string, > md5Checksum?: string, > size?: string, > quotaBytesUsed?: string, > headRevisionId?: string, > isAppAuthorized?: boolean, > resourceKey?: string, > sha1Checksum?: string, > sha256Checksum?: string > }[] > ``` *** ### share `folders.share` Share a folder by granting permissions to users **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.folders.share({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | | `type` | `user \| group \| domain \| anyone` | No | — | | `role` | `owner \| organizer \| fileOrganizer \| writer \| commenter \| reader` | No | — | | `emailAddress` | `string` | No | — | | `domain` | `string` | No | — | | `allowFileDiscovery` | `boolean` | No | — | | `expirationTime` | `string` | No | — | | `sendNotificationEmail` | `boolean` | No | — | | `emailMessage` | `string` | No | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | | `moveToNewOwnersRoot` | `boolean` | No | — | | `transferOwnership` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `type` | `user \| group \| domain \| anyone` | No | — | | `emailAddress` | `string` | No | — | | `domain` | `string` | No | — | | `role` | `owner \| organizer \| fileOrganizer \| writer \| commenter \| reader` | No | — | | `allowFileDiscovery` | `boolean` | No | — | | `displayName` | `string` | No | — | | `photoLink` | `string` | No | — | | `expirationTime` | `string` | No | — | | `deleted` | `boolean` | No | — | | `view` | `user \| domain` | No | — | | `pendingOwner` | `boolean` | No | — | *** ## Search ### filesAndFolders `search.filesAndFolders` Search for files and folders in Google Drive **Risk:** `read` ```ts theme={null} await corsair.googledrive.api.search.filesAndFolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `spaces` | `string` | No | — | | `corpora` | `string` | No | — | | `driveId` | `string` | No | — | | `includeItemsFromAllDrives` | `boolean` | No | — | | `includePermissionsForView` | `string` | No | — | | `orderBy` | `string` | No | — | | `supportsAllDrives` | `boolean` | No | — | | `supportsTeamDrives` | `boolean` | No | — | | `teamDriveId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `incompleteSearch` | `boolean` | No | — | | `files` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > id?: string, > name?: string, > mimeType?: string, > description?: string, > starred?: boolean, > trashed?: boolean, > explicitlyTrashed?: boolean, > parents?: string[], > properties?: { > }, > appProperties?: { > }, > spaces?: string[], > version?: string, > webViewLink?: string, > webContentLink?: string, > iconLink?: string, > hasThumbnail?: boolean, > thumbnailLink?: string, > thumbnailVersion?: string, > viewedByMe?: boolean, > viewedByMeTime?: string, > createdTime?: string, > modifiedTime?: string, > modifiedByMeTime?: string, > modifiedByMe?: boolean, > shared?: boolean, > ownedByMe?: boolean, > permissionIds?: string[], > hasAugmentedPermissions?: boolean, > folderColorRgb?: string, > originalFilename?: string, > fullFileExtension?: string, > fileExtension?: string, > md5Checksum?: string, > size?: string, > quotaBytesUsed?: string, > headRevisionId?: string, > isAppAuthorized?: boolean, > resourceKey?: string, > sha1Checksum?: string, > sha256Checksum?: string > }[] > ``` *** ## Shared Drives ### create `sharedDrives.create` Create a new shared drive **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.sharedDrives.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `requestId` | `string` | No | — | | `themeId` | `string` | No | — | | `colorRgb` | `string` | No | — | | `restrictions` | `object` | No | — | > **restrictions full type** > > ```ts theme={null} > { > adminManagedRestrictions?: boolean, > copyRequiresWriterPermission?: boolean, > domainUsersOnly?: boolean, > driveMembersOnly?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `id` | `string` | No | — | | `name` | `string` | No | — | | `themeId` | `string` | No | — | | `colorRgb` | `string` | No | — | | `createdTime` | `string` | No | — | | `hidden` | `boolean` | No | — | *** ### delete `sharedDrives.delete` Permanently delete a shared drive \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googledrive.api.sharedDrives.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `driveId` | `string` | Yes | — | **Output:** `void` *** ### get `sharedDrives.get` Get info about a shared drive **Risk:** `read` ```ts theme={null} await corsair.googledrive.api.sharedDrives.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `driveId` | `string` | Yes | — | | `useDomainAdminAccess` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `id` | `string` | No | — | | `name` | `string` | No | — | | `themeId` | `string` | No | — | | `colorRgb` | `string` | No | — | | `createdTime` | `string` | No | — | | `hidden` | `boolean` | No | — | *** ### list `sharedDrives.list` List shared drives **Risk:** `read` ```ts theme={null} await corsair.googledrive.api.sharedDrives.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `q` | `string` | No | — | | `useDomainAdminAccess` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `drives` | `object[]` | No | — | > **drives full type** > > ```ts theme={null} > { > kind?: string, > id?: string, > name?: string, > themeId?: string, > colorRgb?: string, > createdTime?: string, > hidden?: boolean > }[] > ``` *** ### update `sharedDrives.update` Update a shared drive **Risk:** `write` ```ts theme={null} await corsair.googledrive.api.sharedDrives.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `driveId` | `string` | Yes | — | | `name` | `string` | No | — | | `themeId` | `string` | No | — | | `colorRgb` | `string` | No | — | | `restrictions` | `object` | No | — | | `useDomainAdminAccess` | `boolean` | No | — | > **restrictions full type** > > ```ts theme={null} > { > adminManagedRestrictions?: boolean, > copyRequiresWriterPermission?: boolean, > domainUsersOnly?: boolean, > driveMembersOnly?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `id` | `string` | No | — | | `name` | `string` | No | — | | `themeId` | `string` | No | — | | `colorRgb` | `string` | No | — | | `createdTime` | `string` | No | — | | `hidden` | `boolean` | No | — | *** ## Storage ### getQuota `storage.getQuota` Get the user's Google Drive storage quota and usage **Risk:** `read` ```ts theme={null} await corsair.googledrive.api.storage.getQuota({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `string` | No | — | | `usage` | `string` | Yes | — | | `usageInDrive` | `string` | Yes | — | | `usageInDriveTrash` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/googledrive/database Google Drive local sync: searchable entities, `.search()` filters, and operators. The Google Drive plugin syncs data locally. Use `corsair.googledrive.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Files Path: `googledrive.db.files.search` ```ts theme={null} const rows = await corsair.googledrive.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `mimeType` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `starred` | `boolean` | equals | | `trashed` | `boolean` | equals | | `explicitlyTrashed` | `boolean` | equals | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `webViewLink` | `string` | equals, contains, startsWith, endsWith, in | | `webContentLink` | `string` | equals, contains, startsWith, endsWith, in | | `iconLink` | `string` | equals, contains, startsWith, endsWith, in | | `hasThumbnail` | `boolean` | equals | | `thumbnailLink` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnailVersion` | `string` | equals, contains, startsWith, endsWith, in | | `viewedByMe` | `boolean` | equals | | `viewedByMeTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedTime` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedByMeTime` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedByMe` | `boolean` | equals | | `shared` | `boolean` | equals | | `ownedByMe` | `boolean` | equals | | `viewersCanCopyContent` | `boolean` | equals | | `copyRequiresWriterPermission` | `boolean` | equals | | `writersCanShare` | `boolean` | equals | | `hasAugmentedPermissions` | `boolean` | equals | | `folderColorRgb` | `string` | equals, contains, startsWith, endsWith, in | | `originalFilename` | `string` | equals, contains, startsWith, endsWith, in | | `fullFileExtension` | `string` | equals, contains, startsWith, endsWith, in | | `fileExtension` | `string` | equals, contains, startsWith, endsWith, in | | `md5Checksum` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `string` | equals, contains, startsWith, endsWith, in | | `quotaBytesUsed` | `string` | equals, contains, startsWith, endsWith, in | | `headRevisionId` | `string` | equals, contains, startsWith, endsWith, in | | `isAppAuthorized` | `boolean` | equals | | `resourceKey` | `string` | equals, contains, startsWith, endsWith, in | | `sha1Checksum` | `string` | equals, contains, startsWith, endsWith, in | | `sha256Checksum` | `string` | equals, contains, startsWith, endsWith, in | | `filePath` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Folders Path: `googledrive.db.folders.search` ```ts theme={null} const rows = await corsair.googledrive.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `mimeType` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `starred` | `boolean` | equals | | `trashed` | `boolean` | equals | | `explicitlyTrashed` | `boolean` | equals | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `webViewLink` | `string` | equals, contains, startsWith, endsWith, in | | `webContentLink` | `string` | equals, contains, startsWith, endsWith, in | | `iconLink` | `string` | equals, contains, startsWith, endsWith, in | | `hasThumbnail` | `boolean` | equals | | `thumbnailLink` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnailVersion` | `string` | equals, contains, startsWith, endsWith, in | | `viewedByMe` | `boolean` | equals | | `viewedByMeTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedTime` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedByMeTime` | `string` | equals, contains, startsWith, endsWith, in | | `modifiedByMe` | `boolean` | equals | | `shared` | `boolean` | equals | | `ownedByMe` | `boolean` | equals | | `viewersCanCopyContent` | `boolean` | equals | | `copyRequiresWriterPermission` | `boolean` | equals | | `writersCanShare` | `boolean` | equals | | `hasAugmentedPermissions` | `boolean` | equals | | `folderColorRgb` | `string` | equals, contains, startsWith, endsWith, in | | `filePath` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Shared Drives Path: `googledrive.db.sharedDrives.search` ```ts theme={null} const rows = await corsair.googledrive.db.sharedDrives.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `themeId` | `string` | equals, contains, startsWith, endsWith, in | | `colorRgb` | `string` | equals, contains, startsWith, endsWith, in | | `createdTime` | `string` | equals, contains, startsWith, endsWith, in | | `hidden` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/googledrive/get-credentials Step-by-step instructions for obtaining Google Drive OAuth 2.0 credentials. This guide walks you through obtaining all required credentials for the Google Drive plugin. ## Authentication Method The Google Drive plugin uses OAuth 2.0 authentication exclusively. * **[`oauth_2`](/concepts/oauth)** (default) - OAuth 2.0 authentication ## OAuth 2.0 Setup ### Step 1: Create Google Cloud Project 1. Go to [Google Cloud Console](https://console.cloud.google.com/) 2. Click **Select a project** → **New Project** 3. Enter a project name and click **Create** 4. Wait for the project to be created and select it ### Step 2: Enable Google Drive API 1. In the Google Cloud Console, go to **APIs & Services** → **Library** 2. Search for "Google Drive API" 3. Click on **Google Drive API** 4. Click **Enable** ### Step 3: Create OAuth 2.0 Credentials 1. Go to **APIs & Services** → **Credentials** 2. Click **Create Credentials** → **OAuth client ID** 3. If prompted, configure the OAuth consent screen: * Choose **External** (unless you have a Google Workspace) * Fill in the required information: * App name * User support email * Developer contact information * Add scopes: * `https://www.googleapis.com/auth/drive` * Add test users (for testing) * Click **Save and Continue** through all steps 4. Select **Web application** 5. Configure: * **Name**: Your application name * **Authorized redirect URIs**: Add your callback URL (e.g., `https://yourapp.com/auth/googledrive/callback`) 6. Click **Create** 7. Copy the **Client ID** and **Client Secret** 8. Store these securely **Storing Credentials:** Store your OAuth app credentials, then start the flow: ```bash theme={null} pnpm corsair setup --plugin=googledrive client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=googledrive ``` The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically. To verify credentials were stored: ```bash theme={null} pnpm corsair auth --plugin=googledrive --credentials ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials | | Client Secret | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials | | Access Token | OAuth 2.0 | Obtained automatically after OAuth flow | | Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/googledrive/overview Cloud file storage for uploading, organizing, sharing, and syncing documents online. Use **Google Drive** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 22 typed API operations * 3 synced entities (`files`, `folders`, `sharedDrives`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googledrive ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googledrive ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googledrive ``` ```bash bun theme={null} bun add corsair @corsair-dev/googledrive ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googledrive } from '@corsair-dev/googledrive'; export const corsair = createCorsair({ plugins: [ googledrive(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Google Drive OAuth app. Provider walkthrough: [Get Credentials](/plugins/googledrive/get-credentials). ```ts theme={null} googledrive() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googledrive', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List files** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googledrive.api.files.list({}); ``` **Create a file** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googledrive.api.files.createFromText({ name: 'hello.txt', content: 'Hello from Corsair' }); ``` See the full list on the [API](/plugins/googledrive/api) page. ## Query synced data Search synced files without hitting Drive. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.googledrive.db.files.search({ data: { trashed: false }, limit: 50, }); ``` Synced entities: `files`, `folders`, `sharedDrives`. See [Database](/plugins/googledrive/database) for filters and operators. ## Webhooks Fires when a file or folder is created, updated, or deleted. ```ts theme={null} googledrive({ webhookHooks: { driveChanged: { after: async (ctx, result) => { console.log('Drive change:', result.data?.changeType, result.data?.fileId ?? result.data?.folderId); } }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/googledrive/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/googledrive/api)** > > Every `googledrive.api.*` operation with input and output types. > **[Database](/plugins/googledrive/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/googledrive/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/googledrive/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/googledrive/webhooks Google Drive incoming webhooks: event paths, payloads, and response data. The Google Drive plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/googledrive/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `driveChanged` (`driveChanged`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Drive Changed ### Drive Changed `driveChanged` A file or folder in Google Drive was created, updated, or deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | No | — | | `subscription` | `string` | No | — | | `event` | `any` | No | — | > **message full type** > > ```ts theme={null} > { > data?: string, > attributes?: { > }, > messageId?: string, > publishTime?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: fileChanged | folderChanged, > fileId?: string, > folderId?: string, > changeType: created | updated | deleted | trashed | untrashed, > file?: custom, > folder?: custom, > filePath?: string, > change?: custom, > binaryData?: string | null, > allFiles: { > file: custom, > filePath: string, > change: custom, > changeType: created | updated | deleted | trashed | untrashed, > binaryData?: string | null > }[], > allFolders: { > folder: custom, > filePath: string, > change: custom, > changeType: created | updated | deleted | trashed | untrashed > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} googledrive({ webhookHooks: { driveChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/googlemaps/api API reference for Google Maps: every `googlemaps.api.*` operation with input and output types. Every `googlemaps.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Aerial ### lookupAerialVideo `aerial.lookupAerialVideo` Tool to look up an aerial view video by address or video ID. Returns video metadata including state and URIs for playback. Use when you need to retrieve a previously rendered aerial video or check the status of a video render request. Note that receiving a video is a billable event. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.aerial.lookupAerialVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | No | US postal address. | | `videoId` | `string` | No | Video ID. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `state` | `string` | No | PROCESSING, ACTIVE, FAILED. | | `uris` | `object` | No | — | > **uris full type** > > ```ts theme={null} > { > } > ``` *** ### renderAerialVideo `aerial.renderAerialVideo` Starts rendering an aerial view video for a US postal address. Returns a video ID that can be used with lookupVideo to retrieve the video once rendering completes. Rendering typically takes up to a few hours. **Risk:** `write` ```ts theme={null} await corsair.googlemaps.api.aerial.renderAerialVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | Yes | US postal address to render aerial view video for. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `state` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > videoId: string > } > ``` *** ## Geocoding ### geocodeAddress `geocoding.geocodeAddress` DEPRECATED: Legacy API to convert street addresses into geographic coordinates (latitude and longitude). This API works best with API key authentication. For OAuth connections without an API key, use geocoding.geocodeAddressWithQuery or geocoding.geocodingApi instead. Use when you need to geocode an address or location to get its precise latitude/longitude coordinates. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.geocoding.geocodeAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | Yes | Street address to geocode. | | `bounds` | `string` | No | Bounding box bias. | | `language` | `string` | No | Language code. | | `region` | `string` | No | Region code. | | `key` | `string` | No | API key override. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `status` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### geocodeAddressWithQuery `geocoding.geocodeAddressWithQuery` Tool to map addresses to geographic coordinates with query parameter. Use when you need to convert a textual address into latitude/longitude coordinates using the modern v4beta API. Results may match multiple places — always verify formattedAddress, region, and addressComponents in the response before using returned coordinates. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.geocoding.geocodeAddressWithQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | Yes | Address to geocode or validate. | | `regionCode` | `string` | No | Two-character region code. | | `locality` | `string` | No | Locality/City. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `places` | `object[]` | No | — | > **places full type** > > ```ts theme={null} > { > }[] > ``` *** ### geocodeDestinations `geocoding.geocodeDestinations` Tool to perform destination lookup and return detailed destination information including primary place, containing places, sub-destinations, landmarks, entrances, and navigation points. Use when you need comprehensive destination data for an address, place ID, or geographic coordinates. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.geocoding.geocodeDestinations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | No | Street address query. | | `placeId` | `string` | No | Place ID query. | | `latlng` | `string` | No | Latitude,longitude query. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `status` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### geocodePlace `geocoding.geocodePlace` Tool to perform geocode lookup using a place identifier to retrieve address and coordinates. Use when you need to get detailed geographic information for a specific Google Place ID. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.geocoding.geocodePlace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place_id` | `string` | Yes | Google Place ID. | | `language` | `string` | No | Language code. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `status` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### geocodingApi `geocoding.geocodingApi` Convert addresses into geographic coordinates (latitude and longitude) and vice versa (reverse geocoding), or get an address for a Place ID. Uses the Geocoding API v4 (v4beta) which supports OAuth2 authentication. Exactly one of address, latlng, or place\_id must be provided per request; omitting all three or mixing incompatible combinations yields no useful results. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.geocoding.geocodingApi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | No | Street address to geocode. | | `latlng` | `string` | No | Coordinates for reverse geocoding. | | `place_id` | `string` | No | Place ID. | | `language` | `string` | No | Language. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `status` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### reverseGeocodeLocation `geocoding.reverseGeocodeLocation` Tool to convert geographic coordinates (latitude and longitude) to human-readable addresses using reverse geocoding. Use when you need to find the address or place name for a given set of coordinates. A single coordinate pair may return multiple results; verify formattedAddress, region, and addressComponents before committing to a result. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.geocoding.reverseGeocodeLocation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `latlng` | `string` | Yes | Latitude and longitude string (e.g. "37.422,-122.084"). | | `language` | `string` | No | Language code. | | `result_type` | `string` | No | Filter by result types. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `status` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ## Geolocation ### geolocate `geolocation.geolocate` Tool to determine location based on cell towers and WiFi access points. Use when you need to find the geographic location of a device using network infrastructure data. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.geolocation.geolocate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `homeMobileCountryCode` | `number` | No | MCC for home network. | | `homeMobileNetworkCode` | `number` | No | MNC for home network. | | `radioType` | `string` | No | lte, gsm, cdma, wcdma. | | `carrier` | `string` | No | Carrier name. | | `cellTowers` | `object[]` | No | Cell tower objects. | | `wifiAccessPoints` | `object[]` | No | WiFi access point objects. | > **cellTowers full type** > > ```ts theme={null} > { > }[] > ``` > **wifiAccessPoints full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `location` | `object` | Yes | — | | `accuracy` | `number` | Yes | — | > **location full type** > > ```ts theme={null} > { > lat: number, > lng: number > } > ``` *** ## Places ### autocomplete `places.autocomplete` Returns place and query predictions for text input. Use when implementing as-you-type autocomplete functionality for place searches. Returns up to five predictions ordered by relevance. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.places.autocomplete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string` | Yes | Text query to get predictions for. | | `locationBias` | `object` | No | Location bias area. | | `includedPrimaryTypes` | `string[]` | No | Primary place types. | | `languageCode` | `string` | No | Language code. | | `regionCode` | `string` | No | Region code. | > **locationBias full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | No | — | > **suggestions full type** > > ```ts theme={null} > { > }[] > ``` *** ### getPlaceDetails `places.getPlaceDetails` Retrieves comprehensive details for a place using its resource name (places/ format). Use when you need detailed information about a specific place. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.places.getPlaceDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place_id` | `string` | Yes | Place ID (or resource name places/). | | `fields` | `string` | No | Field mask for response fields. | | `languageCode` | `string` | No | Language code. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `formattedAddress` | `string` | No | — | | `location` | `object` | No | — | | `rating` | `number` | No | — | | `types` | `string[]` | No | — | > **location full type** > > ```ts theme={null} > { > } > ``` *** ### getPlacePhoto `places.getPlacePhoto` Retrieves high quality photographic content from the Google Maps Places database. Use when you need to download a place photo using a photo\_reference obtained from Place Details, Nearby Search, or Text Search requests. Images are scaled proportionally to fit within specified dimensions. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.places.getPlacePhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `photo_reference` | `string` | Yes | Photo reference identifier. | | `maxwidth` | `number` | No | Max width in pixels. | | `maxheight` | `number` | No | Max height in pixels. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `photoUrl` | `string` | Yes | Public photo URL or image resource link. | *** ### nearbySearch `places.nearbySearch` Searches for places (e.g., restaurants, parks) within a specified circular area, with options to filter by place types and customize the returned fields and number of results. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.places.nearbySearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `includedTypes` | `string[]` | No | Included place types. | | `excludedTypes` | `string[]` | No | Excluded place types. | | `maxResultCount` | `number` | No | Max results (1-20). | | `locationRestriction` | `object` | Yes | Center circle restriction. | > **locationRestriction full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `places` | `object[]` | No | — | > **places full type** > > ```ts theme={null} > { > }[] > ``` *** ### textSearch `places.textSearch` Searches for places on Google Maps using a textual query (e.g., "restaurants in London", "Eiffel Tower"). Results may include CLOSED\_PERMANENTLY or TEMPORARILY\_CLOSED places — filter by businessStatus=OPERATIONAL. Include city/region and business type in textQuery to avoid empty or irrelevant results. Deduplicate using id or formattedAddress, not name alone. Throttle to \~1 req/s; OVER\_QUERY\_LIMIT (HTTP 429) requires exponential backoff. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.places.textSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `textQuery` | `string` | Yes | Text search query string. | | `includedType` | `string` | No | Primary place type filter. | | `locationBias` | `object` | No | Location bias circle or rectangle. | | `minRating` | `number` | No | Minimum place rating filter. | | `openNow` | `boolean` | No | Filter currently open places. | | `maxResultCount` | `number` | No | Max result count. | > **locationBias full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `places` | `object[]` | No | — | > **places full type** > > ```ts theme={null} > { > }[] > ``` *** ## Routes ### computeRouteMatrix `routes.computeRouteMatrix` Calculates travel distance and duration matrix between multiple origins and destinations using the modern Routes API; supports OAuth2 authentication and various travel modes. Matrix is capped at 625 elements (e.g., 25×25); chunk larger sets to avoid RESOURCE\_EXHAUSTED errors. Response elements may be returned out of input order — always use originIndex and destinationIndex to map results. Only use elements where condition='ROUTE\_EXISTS'; the matrix may be incomplete. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.routes.computeRouteMatrix({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `origins` | `object[]` | Yes | List of origin waypoints. | | `destinations` | `object[]` | Yes | List of destination waypoints. | | `travelMode` | `string` | No | DRIVE, BICYCLE, WALK, TWO\_WHEELER, TRANSIT. | | `routingPreference` | `string` | No | TRAFFIC\_UNAWARE, TRAFFIC\_AWARE, TRAFFIC\_AWARE\_OPTIMAL. | | `departureTime` | `string` | No | Departure timestamp. | > **origins full type** > > ```ts theme={null} > { > }[] > ``` > **destinations full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `originIndex` | `number` | No | — | | `destinationIndex` | `number` | No | — | | `status` | `object` | No | — | | `condition` | `string` | No | — | | `distanceMeters` | `number` | No | — | | `duration` | `string` | No | — | > **status full type** > > ```ts theme={null} > { > } > ``` *** ### distanceMatrix `routes.distanceMatrix` DEPRECATED: Legacy API that calculates travel distance and time for a matrix of origins and destinations. This API only works with API keys (no OAuth2 support). Use the modern 'Compute Route Matrix' action instead, which supports OAuth2 authentication. Supports different modes of transportation and options like departure/arrival times. Capped at 100 elements per request (elements = origins × destinations count); split large sets into batches. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.routes.distanceMatrix({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `origins` | `string \| string[]` | Yes | Origins addresses or coordinates. | | `destinations` | `string \| string[]` | Yes | Destinations addresses or coordinates. | | `mode` | `string` | No | driving, walking, bicycling, transit. | | `units` | `string` | No | metric, imperial. | | `departure_time` | `string` | No | Departure time. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `origin_addresses` | `string[]` | No | — | | `destination_addresses` | `string[]` | No | — | | `rows` | `object[]` | No | — | | `status` | `string` | No | — | > **rows full type** > > ```ts theme={null} > { > }[] > ``` *** ### getDirection `routes.getDirection` Fetches detailed directions between an origin and a destination, supporting intermediate waypoints and various travel modes. Automatically uses the modern Routes API with OAuth2 when available, falling back to legacy API with API key if provided. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.routes.getDirection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `origin` | `string` | Yes | Origin location address or lat,lng. | | `destination` | `string` | Yes | Destination location address or lat,lng. | | `mode` | `string` | No | driving, walking, bicycling, transit. | | `waypoints` | `string \| string[]` | No | Intermediate waypoints. | | `avoid` | `string` | No | tolls, highways, ferries. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `routes` | `object[]` | No | — | | `status` | `string` | No | — | > **routes full type** > > ```ts theme={null} > { > }[] > ``` *** ### getRoute `routes.getRoute` Calculates one or more routes between two specified locations. Uses various travel modes and preferences; addresses must be resolvable by Google Maps. Response duration is a string with 's' suffix (e.g., "4557s"); parse before displaying. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.routes.getRoute({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `origin` | `object` | Yes | Origin waypoint object. | | `destination` | `object` | Yes | Destination waypoint object. | | `travelMode` | `string` | No | DRIVE, BICYCLE, WALK, TWO\_WHEELER, TRANSIT. | | `routingPreference` | `string` | No | TRAFFIC\_UNAWARE, TRAFFIC\_AWARE. | > **origin full type** > > ```ts theme={null} > { > } > ``` > **destination full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `routes` | `object[]` | No | — | > **routes full type** > > ```ts theme={null} > { > }[] > ``` *** ## Tiles ### createTilesSession `tiles.createTilesSession` Tool to create a session token required for accessing 2D Tiles and Street View imagery. Use when you need to initialize tile-based map rendering or street view display. The session token is valid for approximately two weeks and must be included in all subsequent tile requests. Each call consumes quota — cache and reuse the returned token across all tile requests within its validity window rather than creating a new session per request. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.tiles.createTilesSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mapType` | `string` | Yes | roadmap, satellite, terrain, or streetview. | | `language` | `string` | No | BCP-47 language tag. | | `region` | `string` | No | ccTLD two-character region code. | | `imageFormat` | `string` | No | png, jpeg, webp. | | `scale` | `string` | No | scale factor. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `session` | `string` | Yes | Session token for subsequent tile requests. | | `expiry` | `string` | No | Expiration timestamp. | | `tileWidth` | `number` | No | — | | `tileHeight` | `number` | No | — | | `imageFormat` | `string` | No | — | *** ### embedMap `tiles.embedMap` Tool to generate an embeddable Google Map URL and HTML iframe code. Use when you need to display a map (place, view, directions, street view, search) on a webpage without JavaScript. Note: This API only works with API keys (no OAuth2 support). It generates embed URLs and does not make direct API calls. Generated embed URLs are publicly accessible; avoid passing sensitive or internal location queries. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.tiles.embedMap({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mode` | `place \| view \| directions \| streetview \| search` | Yes | Map embed mode. | | `q` | `string` | No | Location or search query. | | `origin` | `string` | No | Origin for directions mode. | | `destination` | `string` | No | Destination for directions mode. | | `center` | `string` | No | Center lat,lng. | | `zoom` | `number` | No | Zoom level. | | `maptype` | `string` | No | roadmap or satellite. | | `location` | `string` | No | Lat,lng location for streetview mode. | | `pano` | `string` | No | Panorama ID for streetview mode. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `embedUrl` | `string` | Yes | Embeddable map URL. | | `iframeHtml` | `string` | Yes | HTML iframe code snippet for embedding. | *** ### get2dTile `tiles.get2dTile` Tool to retrieve a 2D map tile image at specified coordinates for building custom map visualizations. Use when you need to download individual map tile images for roadmap, satellite, or terrain views. Requires a valid session token from the createSession endpoint. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.tiles.get2dTile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session` | `string` | Yes | Valid session token from CreateTilesSession. | | `z` | `number` | Yes | Zoom level. | | `x` | `number` | Yes | X coordinate. | | `y` | `number` | Yes | Y coordinate. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tileUrl` | `string` | Yes | URL to fetch 2D tile image. | | `content` | `string` | No | Base64 tile data if requested. | *** ### get3dTilesRoot `tiles.get3dTilesRoot` Tool to retrieve the 3D Tiles tileset root configuration for photorealistic 3D map rendering. Use when you need to initialize a 3D renderer with Google's photorealistic tiles following the OGC 3D Tiles specification. The Map Tiles API is billable per request; cache the root response client-side and avoid repeated calls. **Risk:** `read` ```ts theme={null} await corsair.googlemaps.api.tiles.get3dTilesRoot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | No | Optional API key override. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `asset` | `object` | No | — | | `geometricError` | `number` | No | — | | `root` | `object` | No | — | > **asset full type** > > ```ts theme={null} > { > } > ``` > **root full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/googlemaps/database Google Maps local sync: searchable entities, `.search()` filters, and operators. The Google Maps plugin syncs data locally. Use `corsair.googlemaps.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/googlemaps/overview Mapping platform for geocoding, directions, places search, and location-based services. Use **Google Maps** through Corsair: one client, typed API calls. **What you get:** * 22 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googlemaps ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googlemaps ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googlemaps ``` ```bash bun theme={null} bun add corsair @corsair-dev/googlemaps ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googlemaps } from '@corsair-dev/googlemaps'; export const corsair = createCorsair({ plugins: [ googlemaps(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} googlemaps() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Google Maps OAuth app. ```ts theme={null} googlemaps({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googlemaps', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`aerial.lookupAerialVideo`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlemaps.api.aerial.lookupAerialVideo({}); ``` **`aerial.renderAerialVideo`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlemaps.api.aerial.renderAerialVideo({}); ``` See the full list on the [API](/plugins/googlemaps/api) page. ## What's next > **[API reference](/plugins/googlemaps/api)** > > Every `googlemaps.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/googlemeet/api API reference for Google Meet: every `googlemeet.api.*` operation with input and output types. Every `googlemeet.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Conference Records ### get `conferenceRecords.get` Get a conference record **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.conferenceRecords.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `space` | `string` | No | — | | `fixedExternalMeetingId` | `string` | No | — | | `startTime` | `string` | No | — | | `endTime` | `string` | No | — | | `expireTime` | `string` | No | — | *** ### list `conferenceRecords.list` List conference records **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.conferenceRecords.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `conferenceRecords` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **conferenceRecords full type** > > ```ts theme={null} > { > name?: string, > space?: string, > fixedExternalMeetingId?: string, > startTime?: string, > endTime?: string, > expireTime?: string > }[] > ``` *** ## Participants ### get `participants.get` Get a participant **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.participants.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `signedInUser` | `object` | No | — | | `anonymousUser` | `object` | No | — | | `phoneUser` | `object` | No | — | | `startTime` | `string` | No | — | | `endTime` | `string` | No | — | > **signedInUser full type** > > ```ts theme={null} > { > user?: string, > displayName?: string > } > ``` > **anonymousUser full type** > > ```ts theme={null} > { > displayName?: string > } > ``` > **phoneUser full type** > > ```ts theme={null} > { > displayName?: string > } > ``` *** ### list `participants.list` List participants **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.participants.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `participants` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **participants full type** > > ```ts theme={null} > { > name?: string, > signedInUser?: { > user?: string, > displayName?: string > }, > anonymousUser?: { > displayName?: string > }, > phoneUser?: { > displayName?: string > }, > startTime?: string, > endTime?: string > }[] > ``` *** ## Participant Sessions ### get `participantSessions.get` Get a participant session **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.participantSessions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `startTime` | `string` | No | — | | `endTime` | `string` | No | — | *** ### list `participantSessions.list` List participant sessions **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.participantSessions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `participantSessions` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **participantSessions full type** > > ```ts theme={null} > { > name?: string, > startTime?: string, > endTime?: string > }[] > ``` *** ## Recordings ### get `recordings.get` Get a recording **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.recordings.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `startTime` | `string` | No | — | | `endTime` | `string` | No | — | | `state` | `STATE_UNSPECIFIED \| STARTED \| ENDED \| FILE_GENERATED` | No | — | | `driveDestination` | `object` | No | — | > **driveDestination full type** > > ```ts theme={null} > { > file?: string, > exportUri?: string > } > ``` *** ### list `recordings.list` List recordings **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.recordings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `recordings` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **recordings full type** > > ```ts theme={null} > { > name?: string, > startTime?: string, > endTime?: string, > state?: STATE_UNSPECIFIED | STARTED | ENDED | FILE_GENERATED, > driveDestination?: { > file?: string, > exportUri?: string > } > }[] > ``` *** ## Smart Notes ### get `smartNotes.get` Get smart notes **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.smartNotes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `startTime` | `string` | No | — | | `endTime` | `string` | No | — | | `state` | `STATE_UNSPECIFIED \| STARTED \| ENDED \| FILE_GENERATED` | No | — | | `docsDestination` | `object` | No | — | > **docsDestination full type** > > ```ts theme={null} > { > document?: string, > exportUri?: string > } > ``` *** ### list `smartNotes.list` List smart notes **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.smartNotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `smartNotes` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **smartNotes full type** > > ```ts theme={null} > { > name?: string, > startTime?: string, > endTime?: string, > state?: STATE_UNSPECIFIED | STARTED | ENDED | FILE_GENERATED, > docsDestination?: { > document?: string, > exportUri?: string > } > }[] > ``` *** ## Spaces ### create `spaces.create` Create a new meeting space **Risk:** `write` ```ts theme={null} await corsair.googlemeet.api.spaces.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `space` | `object` | No | — | | `requestId` | `string` | No | — | > **space full type** > > ```ts theme={null} > { > config?: { > accessType?: ACCESS_TYPE_UNSPECIFIED | OPEN | TRUSTED | RESTRICTED, > entryPointAccess?: ENTRY_POINT_ACCESS_UNSPECIFIED | CREATOR_APP_ONLY | ALL, > moderation?: MODERATION_UNSPECIFIED | OFF | ON, > moderationRestrictions?: { > chatRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > reactionRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > presentRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > defaultJoinAsViewerType?: DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED | ON | OFF > }, > attendanceReportGenerationType?: ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED | DO_NOT_GENERATE | GENERATE_REPORT, > artifactConfig?: { > recordingConfig?: { > autoRecordingGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > transcriptionConfig?: { > autoTranscriptionGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > smartNotesConfig?: { > autoSmartNotesGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > } > } > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `meetingUri` | `string` | No | — | | `meetingCode` | `string` | No | — | | `config` | `object` | No | — | | `activeConference` | `object` | No | — | | `phoneAccess` | `object[]` | No | — | | `gatewaySipAccess` | `object[]` | No | — | > **config full type** > > ```ts theme={null} > { > accessType?: ACCESS_TYPE_UNSPECIFIED | OPEN | TRUSTED | RESTRICTED, > entryPointAccess?: ENTRY_POINT_ACCESS_UNSPECIFIED | CREATOR_APP_ONLY | ALL, > moderation?: MODERATION_UNSPECIFIED | OFF | ON, > moderationRestrictions?: { > chatRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > reactionRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > presentRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > defaultJoinAsViewerType?: DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED | ON | OFF > }, > attendanceReportGenerationType?: ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED | DO_NOT_GENERATE | GENERATE_REPORT, > artifactConfig?: { > recordingConfig?: { > autoRecordingGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > transcriptionConfig?: { > autoTranscriptionGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > smartNotesConfig?: { > autoSmartNotesGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > } > } > } > ``` > **activeConference full type** > > ```ts theme={null} > { > conferenceRecord?: string > } > ``` > **phoneAccess full type** > > ```ts theme={null} > { > languageCode?: string, > phoneNumber?: string, > pin?: string, > regionCode?: string > }[] > ``` > **gatewaySipAccess full type** > > ```ts theme={null} > { > uri?: string, > sipAccessCode?: string > }[] > ``` *** ### endActiveConference `spaces.endActiveConference` End an active conference **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googlemeet.api.spaces.endActiveConference({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `void` *** ### get `spaces.get` Get a meeting space **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.spaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `meetingUri` | `string` | No | — | | `meetingCode` | `string` | No | — | | `config` | `object` | No | — | | `activeConference` | `object` | No | — | | `phoneAccess` | `object[]` | No | — | | `gatewaySipAccess` | `object[]` | No | — | > **config full type** > > ```ts theme={null} > { > accessType?: ACCESS_TYPE_UNSPECIFIED | OPEN | TRUSTED | RESTRICTED, > entryPointAccess?: ENTRY_POINT_ACCESS_UNSPECIFIED | CREATOR_APP_ONLY | ALL, > moderation?: MODERATION_UNSPECIFIED | OFF | ON, > moderationRestrictions?: { > chatRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > reactionRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > presentRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > defaultJoinAsViewerType?: DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED | ON | OFF > }, > attendanceReportGenerationType?: ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED | DO_NOT_GENERATE | GENERATE_REPORT, > artifactConfig?: { > recordingConfig?: { > autoRecordingGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > transcriptionConfig?: { > autoTranscriptionGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > smartNotesConfig?: { > autoSmartNotesGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > } > } > } > ``` > **activeConference full type** > > ```ts theme={null} > { > conferenceRecord?: string > } > ``` > **phoneAccess full type** > > ```ts theme={null} > { > languageCode?: string, > phoneNumber?: string, > pin?: string, > regionCode?: string > }[] > ``` > **gatewaySipAccess full type** > > ```ts theme={null} > { > uri?: string, > sipAccessCode?: string > }[] > ``` *** ### patch `spaces.patch` Update a meeting space **Risk:** `write` ```ts theme={null} await corsair.googlemeet.api.spaces.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `updateMask` | `string` | No | — | | `space` | `object` | No | — | > **space full type** > > ```ts theme={null} > { > config?: { > accessType?: ACCESS_TYPE_UNSPECIFIED | OPEN | TRUSTED | RESTRICTED, > entryPointAccess?: ENTRY_POINT_ACCESS_UNSPECIFIED | CREATOR_APP_ONLY | ALL, > moderation?: MODERATION_UNSPECIFIED | OFF | ON, > moderationRestrictions?: { > chatRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > reactionRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > presentRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > defaultJoinAsViewerType?: DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED | ON | OFF > }, > attendanceReportGenerationType?: ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED | DO_NOT_GENERATE | GENERATE_REPORT, > artifactConfig?: { > recordingConfig?: { > autoRecordingGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > transcriptionConfig?: { > autoTranscriptionGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > smartNotesConfig?: { > autoSmartNotesGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > } > } > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `meetingUri` | `string` | No | — | | `meetingCode` | `string` | No | — | | `config` | `object` | No | — | | `activeConference` | `object` | No | — | | `phoneAccess` | `object[]` | No | — | | `gatewaySipAccess` | `object[]` | No | — | > **config full type** > > ```ts theme={null} > { > accessType?: ACCESS_TYPE_UNSPECIFIED | OPEN | TRUSTED | RESTRICTED, > entryPointAccess?: ENTRY_POINT_ACCESS_UNSPECIFIED | CREATOR_APP_ONLY | ALL, > moderation?: MODERATION_UNSPECIFIED | OFF | ON, > moderationRestrictions?: { > chatRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > reactionRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > presentRestriction?: RESTRICTION_TYPE_UNSPECIFIED | HOSTS_ONLY | NO_RESTRICTION, > defaultJoinAsViewerType?: DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED | ON | OFF > }, > attendanceReportGenerationType?: ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED | DO_NOT_GENERATE | GENERATE_REPORT, > artifactConfig?: { > recordingConfig?: { > autoRecordingGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > transcriptionConfig?: { > autoTranscriptionGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > }, > smartNotesConfig?: { > autoSmartNotesGeneration?: AUTO_GENERATION_TYPE_UNSPECIFIED | ON | OFF > } > } > } > ``` > **activeConference full type** > > ```ts theme={null} > { > conferenceRecord?: string > } > ``` > **phoneAccess full type** > > ```ts theme={null} > { > languageCode?: string, > phoneNumber?: string, > pin?: string, > regionCode?: string > }[] > ``` > **gatewaySipAccess full type** > > ```ts theme={null} > { > uri?: string, > sipAccessCode?: string > }[] > ``` *** ## Transcript Entries ### get `transcriptEntries.get` Get a transcript entry **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.transcriptEntries.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `participant` | `string` | No | — | | `text` | `string` | No | — | | `languageCode` | `string` | No | — | | `startTime` | `string` | No | — | | `endTime` | `string` | No | — | *** ### list `transcriptEntries.list` List transcript entries **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.transcriptEntries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `transcriptEntries` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **transcriptEntries full type** > > ```ts theme={null} > { > name?: string, > participant?: string, > text?: string, > languageCode?: string, > startTime?: string, > endTime?: string > }[] > ``` *** ## Transcripts ### get `transcripts.get` Get a transcript **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.transcripts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `startTime` | `string` | No | — | | `endTime` | `string` | No | — | | `state` | `STATE_UNSPECIFIED \| STARTED \| ENDED \| FILE_GENERATED` | No | — | | `docsDestination` | `object` | No | — | > **docsDestination full type** > > ```ts theme={null} > { > document?: string, > exportUri?: string > } > ``` *** ### list `transcripts.list` List transcripts **Risk:** `read` ```ts theme={null} await corsair.googlemeet.api.transcripts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `transcripts` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **transcripts full type** > > ```ts theme={null} > { > name?: string, > startTime?: string, > endTime?: string, > state?: STATE_UNSPECIFIED | STARTED | ENDED | FILE_GENERATED, > docsDestination?: { > document?: string, > exportUri?: string > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/googlemeet/database Google Meet local sync: searchable entities, `.search()` filters, and operators. The Google Meet plugin syncs data locally. Use `corsair.googlemeet.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Conference Records Path: `googlemeet.db.conferenceRecords.search` ```ts theme={null} const rows = await corsair.googlemeet.db.conferenceRecords.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `space` | `string` | equals, contains, startsWith, endsWith, in | | `fixedExternalMeetingId` | `string` | equals, contains, startsWith, endsWith, in | | `startTime` | `string` | equals, contains, startsWith, endsWith, in | | `endTime` | `string` | equals, contains, startsWith, endsWith, in | | `expireTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Participants Path: `googlemeet.db.participants.search` ```ts theme={null} const rows = await corsair.googlemeet.db.participants.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `startTime` | `string` | equals, contains, startsWith, endsWith, in | | `endTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Recordings Path: `googlemeet.db.recordings.search` ```ts theme={null} const rows = await corsair.googlemeet.db.recordings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `startTime` | `string` | equals, contains, startsWith, endsWith, in | | `endTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Smart Notes Path: `googlemeet.db.smartNotes.search` ```ts theme={null} const rows = await corsair.googlemeet.db.smartNotes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `startTime` | `string` | equals, contains, startsWith, endsWith, in | | `endTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Spaces Path: `googlemeet.db.spaces.search` ```ts theme={null} const rows = await corsair.googlemeet.db.spaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `meetingUri` | `string` | equals, contains, startsWith, endsWith, in | | `meetingCode` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transcripts Path: `googlemeet.db.transcripts.search` ```ts theme={null} const rows = await corsair.googlemeet.db.transcripts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `startTime` | `string` | equals, contains, startsWith, endsWith, in | | `endTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/googlemeet/overview Video conferencing service for scheduling and managing online meetings and calls. Use **Google Meet** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 18 typed API operations * 6 synced entities (`conferenceRecords`, `participants`, `recordings`, `smartNotes`, `spaces`, `transcripts`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googlemeet ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googlemeet ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googlemeet ``` ```bash bun theme={null} bun add corsair @corsair-dev/googlemeet ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googlemeet } from '@corsair-dev/googlemeet'; export const corsair = createCorsair({ plugins: [ googlemeet(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Google Meet OAuth app. ```ts theme={null} googlemeet() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googlemeet', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`conferenceRecords.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlemeet.api.conferenceRecords.get({}); ``` **`spaces.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlemeet.api.spaces.create({}); ``` See the full list on the [API](/plugins/googlemeet/api) page. ## Query synced data Synced entities support `tenant.googlemeet.db..search()` and `.list()`: `conferenceRecords`, `participants`, `recordings`, `smartNotes`, `spaces`, `transcripts`. See [Database](/plugins/googlemeet/database) for filters and operators. ## What's next > **[API reference](/plugins/googlemeet/api)** > > Every `googlemeet.api.*` operation with input and output types. > **[Database](/plugins/googlemeet/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/googlesheets/api API reference for Google Sheets: every `googlesheets.api.*` operation with input and output types. Every `googlesheets.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Sheets ### appendOrUpdateRow `sheets.appendOrUpdateRow` Append a new row or update an existing one **Risk:** `write` ```ts theme={null} await corsair.googlesheets.api.sheets.appendOrUpdateRow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | | `sheetName` | `string` | No | — | | `keyColumn` | `string` | No | Column letter (e.g. "A"), not a header name (e.g. "Company Name") | | `keyValue` | `string \| number` | No | — | | `values` | `(string \| number \| boolean \| null)[]` | No | — | | `valueInputOption` | `RAW \| USER_ENTERED` | No | — | | `insertDataOption` | `OVERWRITE \| INSERT_ROWS` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `totalUpdatedRows` | `number` | No | — | | `totalUpdatedColumns` | `number` | No | — | | `totalUpdatedCells` | `number` | No | — | | `totalUpdatedSheets` | `number` | No | — | | `responses` | `object[]` | No | — | > **responses full type** > > ```ts theme={null} > { > range?: string, > majorDimension?: ROWS | COLUMNS | DIMENSION_UNSPECIFIED, > values?: ( > string | number | boolean | null > )[][] > }[] > ``` *** ### appendRow `sheets.appendRow` Append a new row to a sheet **Risk:** `write` ```ts theme={null} await corsair.googlesheets.api.sheets.appendRow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | | `sheetName` | `string` | No | — | | `range` | `string` | No | — | | `values` | `(string \| number \| boolean \| null)[]` | No | — | | `valueInputOption` | `RAW \| USER_ENTERED` | No | — | | `insertDataOption` | `OVERWRITE \| INSERT_ROWS` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `totalUpdatedRows` | `number` | No | — | | `totalUpdatedColumns` | `number` | No | — | | `totalUpdatedCells` | `number` | No | — | | `totalUpdatedSheets` | `number` | No | — | | `responses` | `object[]` | No | — | > **responses full type** > > ```ts theme={null} > { > range?: string, > majorDimension?: ROWS | COLUMNS | DIMENSION_UNSPECIFIED, > values?: ( > string | number | boolean | null > )[][] > }[] > ``` *** ### clearSheet `sheets.clearSheet` Clear all data from a sheet **Risk:** `destructive` ```ts theme={null} await corsair.googlesheets.api.sheets.clearSheet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | | `sheetName` | `string` | No | — | | `range` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `clearedRange` | `string` | No | — | *** ### createSheet `sheets.createSheet` Add a new sheet tab to a spreadsheet **Risk:** `write` ```ts theme={null} await corsair.googlesheets.api.sheets.createSheet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | | `title` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `replies` | `any[]` | No | — | | `updatedSpreadsheet` | `object` | No | — | > **updatedSpreadsheet full type** > > ```ts theme={null} > { > spreadsheetId?: string, > properties?: { > title?: string, > locale?: string, > autoRecalc?: ON_CHANGE | ON_UPDATE | HOUR | MINUTE, > timeZone?: string > }, > spreadsheetUrl?: string > } > ``` *** ### deleteRowsOrColumns `sheets.deleteRowsOrColumns` Delete rows or columns from a sheet **Risk:** `destructive` ```ts theme={null} await corsair.googlesheets.api.sheets.deleteRowsOrColumns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | | `sheetId` | `number` | Yes | — | | `dimension` | `ROWS \| COLUMNS` | No | — | | `startIndex` | `number` | No | — | | `endIndex` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `replies` | `any[]` | No | — | | `updatedSpreadsheet` | `object` | No | — | > **updatedSpreadsheet full type** > > ```ts theme={null} > { > spreadsheetId?: string, > properties?: { > title?: string, > locale?: string, > autoRecalc?: ON_CHANGE | ON_UPDATE | HOUR | MINUTE, > timeZone?: string > }, > spreadsheetUrl?: string > } > ``` *** ### deleteSheet `sheets.deleteSheet` Delete a sheet tab and all its data \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googlesheets.api.sheets.deleteSheet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | | `sheetId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `replies` | `any[]` | No | — | | `updatedSpreadsheet` | `object` | No | — | > **updatedSpreadsheet full type** > > ```ts theme={null} > { > spreadsheetId?: string, > properties?: { > title?: string, > locale?: string, > autoRecalc?: ON_CHANGE | ON_UPDATE | HOUR | MINUTE, > timeZone?: string > }, > spreadsheetUrl?: string > } > ``` *** ### getRows `sheets.getRows` Read rows from a sheet **Risk:** `read` ```ts theme={null} await corsair.googlesheets.api.sheets.getRows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | | `sheetName` | `string` | No | — | | `range` | `string` | No | — | | `valueRenderOption` | `FORMATTED_VALUE \| UNFORMATTED_VALUE \| FORMULA` | No | — | | `dateTimeRenderOption` | `SERIAL_NUMBER \| FORMATTED_STRING` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `range` | `string` | No | — | | `majorDimension` | `ROWS \| COLUMNS \| DIMENSION_UNSPECIFIED` | No | — | | `values` | `(string \| number \| boolean \| null)[][]` | No | — | *** ### listSheetsInSpreadsheet `sheets.listSheetsInSpreadsheet` List all sheet tabs in a spreadsheet **Risk:** `read` ```ts theme={null} await corsair.googlesheets.api.sheets.listSheetsInSpreadsheet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `sheets` | `object[]` | No | — | > **sheets full type** > > ```ts theme={null} > { > sheetId?: number, > title?: string, > index?: number, > sheetType?: GRID | OBJECT | DATA_SOURCE, > hidden?: boolean > }[] > ``` *** ### updateRow `sheets.updateRow` Update an existing row in a sheet **Risk:** `write` ```ts theme={null} await corsair.googlesheets.api.sheets.updateRow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | | `sheetName` | `string` | No | — | | `range` | `string` | No | — | | `rowIndex` | `number` | No | — | | `values` | `(string \| number \| boolean \| null)[]` | No | — | | `valueInputOption` | `RAW \| USER_ENTERED` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `totalUpdatedRows` | `number` | No | — | | `totalUpdatedColumns` | `number` | No | — | | `totalUpdatedCells` | `number` | No | — | | `totalUpdatedSheets` | `number` | No | — | | `responses` | `object[]` | No | — | > **responses full type** > > ```ts theme={null} > { > range?: string, > majorDimension?: ROWS | COLUMNS | DIMENSION_UNSPECIFIED, > values?: ( > string | number | boolean | null > )[][] > }[] > ``` *** ## Spreadsheets ### create `spreadsheets.create` Create a new spreadsheet **Risk:** `write` ```ts theme={null} await corsair.googlesheets.api.spreadsheets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `properties` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > title?: string, > locale?: string, > timeZone?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `properties` | `object` | No | — | | `spreadsheetUrl` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > title?: string, > locale?: string, > autoRecalc?: ON_CHANGE | ON_UPDATE | HOUR | MINUTE, > timeZone?: string > } > ``` *** ### delete `spreadsheets.delete` Permanently delete a spreadsheet \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.googlesheets.api.spreadsheets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | Yes | — | **Output:** `void` *** ### list `spreadsheets.list` List all spreadsheets in Google Drive **Risk:** `read` ```ts theme={null} await corsair.googlesheets.api.spreadsheets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | | `query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `files` | `object[]` | No | — | | `nextPageToken` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > id?: string, > name?: string, > createdTime?: string, > modifiedTime?: string, > webViewLink?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/googlesheets/database Google Sheets local sync: searchable entities, `.search()` filters, and operators. The Google Sheets plugin syncs data locally. Use `corsair.googlesheets.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Rows Path: `googlesheets.db.rows.search` ```ts theme={null} const rows = await corsair.googlesheets.db.rows.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `rowId` | `string` | equals, contains, startsWith, endsWith, in | | `spreadsheetId` | `string` | equals, contains, startsWith, endsWith, in | | `sheetName` | `string` | equals, contains, startsWith, endsWith, in | | `range` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sheets Path: `googlesheets.db.sheets.search` ```ts theme={null} const rows = await corsair.googlesheets.db.sheets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `sheetId` | `string` | equals, contains, startsWith, endsWith, in | | `spreadsheetId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `index` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Spreadsheets Path: `googlesheets.db.spreadsheets.search` ```ts theme={null} const rows = await corsair.googlesheets.db.spreadsheets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `spreadsheetId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `spreadsheetUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/googlesheets/get-credentials Step-by-step instructions for obtaining Google Sheets OAuth 2.0 credentials. This guide walks you through obtaining all required credentials for the Google Sheets plugin. ## Authentication Method The Google Sheets plugin uses OAuth 2.0 authentication exclusively. * **[`oauth_2`](/concepts/oauth)** (default) - OAuth 2.0 authentication ## OAuth 2.0 Setup ### Step 1: Create Google Cloud Project 1. Go to [Google Cloud Console](https://console.cloud.google.com/) 2. Click **Select a project** → **New Project** 3. Enter a project name and click **Create** 4. Wait for the project to be created and select it ### Step 2: Enable Google Sheets API 1. In the Google Cloud Console, go to **APIs & Services** → **Library** 2. Search for "Google Sheets API" 3. Click on **Google Sheets API** 4. Click **Enable** ### Step 3: Create OAuth 2.0 Credentials 1. Go to **APIs & Services** → **Credentials** 2. Click **Create Credentials** → **OAuth client ID** 3. If prompted, configure the OAuth consent screen: * Choose **External** (unless you have a Google Workspace) * Fill in the required information: * App name * User support email * Developer contact information * Add scopes: * `https://www.googleapis.com/auth/spreadsheets` * `https://www.googleapis.com/auth/drive` * Add test users (for testing) * Click **Save and Continue** through all steps 4. Select **Web application** 5. Configure: * **Name**: Your application name * **Authorized redirect URIs**: Add your callback URL (e.g., `https://yourapp.com/auth/googlesheets/callback`) 6. Click **Create** 7. Copy the **Client ID** and **Client Secret** 8. Store these securely **Storing Credentials:** Store your OAuth app credentials, then start the flow: ```bash theme={null} pnpm corsair setup --plugin=googlesheets client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=googlesheets ``` The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically. To verify credentials were stored: ```bash theme={null} pnpm corsair auth --plugin=googlesheets --credentials ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials | | Client Secret | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials | | Access Token | OAuth 2.0 | Obtained automatically after OAuth flow | | Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/googlesheets/overview Web-based spreadsheets for managing, visualizing, and analyzing data collaboratively online. Use **Google Sheets** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 12 typed API operations * 3 synced entities (`rows`, `sheets`, `spreadsheets`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/googlesheets ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/googlesheets ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/googlesheets ``` ```bash bun theme={null} bun add corsair @corsair-dev/googlesheets ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { googlesheets } from '@corsair-dev/googlesheets'; export const corsair = createCorsair({ plugins: [ googlesheets(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Google Sheets OAuth app. Provider walkthrough: [Get Credentials](/plugins/googlesheets/get-credentials). ```ts theme={null} googlesheets() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'googlesheets', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Get rows** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlesheets.api.sheets.getRows({ spreadsheetId: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms', sheetName: 'Class Data' }); ``` **Append a row** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.googlesheets.api.sheets.appendRow({ spreadsheetId: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms', sheetName: 'Class Data', values: ['Hello', 'from Corsair'], }); ``` See the full list on the [API](/plugins/googlesheets/api) page. ## Query synced data Search synced rows without hitting Sheets. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.googlesheets.db.rows.search({ data: { spreadsheetId: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms' }, limit: 50, }); ``` Synced entities: `rows`, `sheets`, `spreadsheets`. See [Database](/plugins/googlesheets/database) for filters and operators. ## Webhooks Fires when a range of cells is updated. ```ts theme={null} googlesheets({ webhookHooks: { rangeUpdated: { after: async (ctx, result) => { console.log('Sheet range updated:', result.data?.spreadsheetId, result.data?.sheetName, result.data?.range); } }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/googlesheets/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/googlesheets/api)** > > Every `googlesheets.api.*` operation with input and output types. > **[Database](/plugins/googlesheets/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/googlesheets/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/googlesheets/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/googlesheets/webhooks Google Sheets incoming webhooks: event paths, payloads, and response data. The Google Sheets plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/googlesheets/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `rangeUpdated` (`rangeUpdated`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Range Updated ### Range Updated `rangeUpdated` A range of cells in a Google Sheet was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `spreadsheetId` | `string` | No | — | | `sheetName` | `string` | No | — | | `range` | `string` | No | — | | `values` | `(string \| number \| boolean \| null)[]` | No | — | | `eventType` | `rangeUpdated` | No | — | | `timestamp` | `string` | No | — | | `event` | `any` | No | — | > **Response data full type** > > ```ts theme={null} > { > eventType: rangeUpdated, > spreadsheetId: string, > sheetName: string, > range: string, > values: ( > string | number | boolean | null > )[], > timestamp: string > } > ``` **`webhookHooks` example** ```ts theme={null} googlesheets({ webhookHooks: { rangeUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/grafana/api API reference for Grafana: every `grafana.api.*` operation with input and output types. Every `grafana.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Dashboards ### queryPublic `dashboards.queryPublic` Query a panel on a public Grafana dashboard **Risk:** `read` ```ts theme={null} await corsair.grafana.api.dashboards.queryPublic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `access_token` | `string` | Yes | — | | `panel_id` | `number` | Yes | — | | `from` | `string` | Yes | — | | `to` | `string` | Yes | — | | `intervalMs` | `number` | No | — | | `maxDataPoints` | `number` | No | — | | `base_url_override` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > status_code: number, > message?: string, > results?: { > } > } > ``` *** ## Health ### get `health.get` Check Grafana server health and database connectivity **Risk:** `read` ```ts theme={null} await corsair.grafana.api.health.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > version?: string, > commit?: string, > database?: string, > enterpriseCommit?: string > } > ``` *** ## Jwks ### retrieve `jwks.retrieve` Retrieve JWKS public keys for token verification **Risk:** `read` ```ts theme={null} await corsair.grafana.api.jwks.retrieve({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > keys?: { > Key?: any, > Use?: string, > KeyID?: string, > Algorithm?: string, > Certificates?: string[], > CertificatesURL?: string, > CertificateThumbprintSHA1?: number[], > CertificateThumbprintSHA256?: number[] > }[] > } > ``` *** ## Logs ### createOtlp `logs.createOtlp` Send OTLP v1 logs to Grafana Loki for ingestion **Risk:** `write` ```ts theme={null} await corsair.grafana.api.logs.createOtlp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `resourceLogs` | `object[]` | Yes | — | > **resourceLogs full type** > > ```ts theme={null} > { > resource?: { > attributes?: { > key?: string, > value?: { > stringValue?: string, > intValue?: number, > boolValue?: boolean, > doubleValue?: number, > bytesValue?: string, > arrayValue?: { > values?: any[] > }, > kvlistValue?: { > values?: any[] > } > } > }[], > droppedAttributesCount?: number > }, > scopeLogs?: { > scope?: { > name?: string, > version?: string, > attributes?: { > key?: string, > value?: { > stringValue?: string, > intValue?: number, > boolValue?: boolean, > doubleValue?: number, > bytesValue?: string, > arrayValue?: { > values?: any[] > }, > kvlistValue?: { > values?: any[] > } > } > }[] > }, > logRecords?: { > timeUnixNano?: string, > severityNumber?: number, > severityText?: string, > body?: { > stringValue?: string, > intValue?: number, > boolValue?: boolean, > doubleValue?: number, > bytesValue?: string, > arrayValue?: { > values?: any[] > }, > kvlistValue?: { > values?: any[] > } > }, > attributes?: { > key?: string, > value?: { > stringValue?: string, > intValue?: number, > boolValue?: boolean, > doubleValue?: number, > bytesValue?: string, > arrayValue?: { > values?: any[] > }, > kvlistValue?: { > values?: any[] > } > } > }[], > flags?: number, > traceId?: string, > spanId?: string, > droppedAttributesCount?: number > }[] > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > success: boolean, > status_code: number, > message: string > } > ``` *** ## Ring ### getDistributorHaTracker `ring.getDistributorHaTracker` Get distributor HA tracker ring status **Risk:** `read` ```ts theme={null} await corsair.grafana.api.ring.getDistributorHaTracker({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > html_content: string, > status_code: number > } > ``` *** ### getIndexGateway `ring.getIndexGateway` Get index gateway hash ring status **Risk:** `read` ```ts theme={null} await corsair.grafana.api.ring.getIndexGateway({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > content: string, > content_type: string > } > ``` *** ### getOverridesExporter `ring.getOverridesExporter` Get overrides-exporter hash ring status **Risk:** `read` ```ts theme={null} await corsair.grafana.api.ring.getOverridesExporter({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > html_content: string > } > ``` *** ### getRuler `ring.getRuler` Get ruler ring status from Grafana Mimir **Risk:** `read` ```ts theme={null} await corsair.grafana.api.ring.getRuler({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > content: string, > content_type: string > } > ``` *** ## Saml ### postAcs `saml.postAcs` Process a SAML Assertion Consumer Service authentication response **Risk:** `write` ```ts theme={null} await corsair.grafana.api.saml.postAcs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `saml_response` | `string` | Yes | — | | `relay_state` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > status_code: number, > message: string, > location?: string > } > ``` *** ## Status ### get `status.get` Check Grafana Enterprise license availability **Risk:** `read` ```ts theme={null} await corsair.grafana.api.status.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > license_available: boolean > } > ``` *** ## Store Gateway ### getTenants `storeGateway.getTenants` List tenants with blocks in the store-gateway storage **Risk:** `read` ```ts theme={null} await corsair.grafana.api.storeGateway.getTenants({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `error` | `string` | No | — | | `successful` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > content: string, > content_type?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/grafana/database Grafana local sync: searchable entities, `.search()` filters, and operators. The Grafana plugin syncs data locally. Use `corsair.grafana.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Dashboard Queries Path: `grafana.db.dashboardQueries.search` ```ts theme={null} const rows = await corsair.grafana.db.dashboardQueries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `accessToken` | `string` | equals, contains, startsWith, endsWith, in | | `panelId` | `number` | equals, gt, gte, lt, lte, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | | `intervalMs` | `number` | equals, gt, gte, lt, lte, in | | `maxDataPoints` | `number` | equals, gt, gte, lt, lte, in | | `queriedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Health Status Path: `grafana.db.healthStatus.search` ```ts theme={null} const rows = await corsair.grafana.db.healthStatus.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `commit` | `string` | equals, contains, startsWith, endsWith, in | | `database` | `string` | equals, contains, startsWith, endsWith, in | | `enterpriseCommit` | `string` | equals, contains, startsWith, endsWith, in | | `licenseAvailable` | `boolean` | equals | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jwks Keys Path: `grafana.db.jwksKeys.search` ```ts theme={null} const rows = await corsair.grafana.db.jwksKeys.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `use` | `string` | equals, contains, startsWith, endsWith, in | | `algorithm` | `string` | equals, contains, startsWith, endsWith, in | | `certificatesUrl` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Logs Path: `grafana.db.logs.search` ```ts theme={null} const rows = await corsair.grafana.db.logs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `timeUnixNano` | `string` | equals, contains, startsWith, endsWith, in | | `severityText` | `string` | equals, contains, startsWith, endsWith, in | | `severityNumber` | `number` | equals, gt, gte, lt, lte, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `traceId` | `string` | equals, contains, startsWith, endsWith, in | | `spanId` | `string` | equals, contains, startsWith, endsWith, in | | `flags` | `number` | equals, gt, gte, lt, lte, in | | `scope` | `string` | equals, contains, startsWith, endsWith, in | | `scopeVersion` | `string` | equals, contains, startsWith, endsWith, in | | `droppedAttributesCount` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Ring Status Path: `grafana.db.ringStatus.search` ```ts theme={null} const rows = await corsair.grafana.db.ringStatus.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `contentType` | `string` | equals, contains, startsWith, endsWith, in | | `statusCode` | `number` | equals, gt, gte, lt, lte, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Saml Sessions Path: `grafana.db.samlSessions.search` ```ts theme={null} const rows = await corsair.grafana.db.samlSessions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `statusCode` | `number` | equals, gt, gte, lt, lte, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `successful` | `boolean` | equals | | `processedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/grafana/overview Observability platform for dashboards, metrics visualization, and monitoring alert management. Use **Grafana** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 11 typed API operations * 6 synced entities (`dashboardQueries`, `healthStatus`, `jwksKeys`, `logs`, `ringStatus`, `samlSessions`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/grafana ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/grafana ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/grafana ``` ```bash bun theme={null} bun add corsair @corsair-dev/grafana ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { grafana } from '@corsair-dev/grafana'; export const corsair = createCorsair({ plugins: [ grafana(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} grafana() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'grafana', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`dashboards.queryPublic`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.grafana.api.dashboards.queryPublic({}); ``` **`logs.createOtlp`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.grafana.api.logs.createOtlp({}); ``` See the full list on the [API](/plugins/grafana/api) page. ## Query synced data Synced entities support `tenant.grafana.db..search()` and `.list()`: `dashboardQueries`, `healthStatus`, `jwksKeys`, `logs`, `ringStatus`, `samlSessions`. See [Database](/plugins/grafana/database) for filters and operators. ## What's next > **[API reference](/plugins/grafana/api)** > > Every `grafana.api.*` operation with input and output types. > **[Database](/plugins/grafana/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/griptape/api API reference for Griptape: every `griptape.api.*` operation with input and output types. Every `griptape.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Assistant ### create `assistant.create` Create an assistant **Risk:** `write` ```ts theme={null} await corsair.griptape.api.assistant.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `assistant.delete` Delete an assistant **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.assistant.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | **Output:** `any` *** ### get `assistant.get` Get an assistant **Risk:** `read` ```ts theme={null} await corsair.griptape.api.assistant.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `created_by` | `string` | Yes | — | | `description` | `string` | Yes | — | | `input` | `string` | No | — | | `knowledge_base_ids` | `string[]` | Yes | — | | `model` | `string` | No | — | | `name` | `string` | Yes | — | | `organization_id` | `string` | Yes | — | | `retriever_ids` | `string[]` | Yes | — | | `ruleset_ids` | `string[]` | Yes | — | | `structure_ids` | `string[]` | Yes | — | | `tool_ids` | `string[]` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### list `assistant.list` List assistants **Risk:** `read` ```ts theme={null} await corsair.griptape.api.assistant.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `assistants` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **assistants full type** > > ```ts theme={null} > { > assistant_id: string, > created_at: string, > created_by: string, > description: string, > input?: string, > knowledge_base_ids: string[], > model?: string, > name: string, > organization_id: string, > retriever_ids: string[], > ruleset_ids: string[], > structure_ids: string[], > tool_ids: string[], > updated_at: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `assistant.update` Update an assistant **Risk:** `write` ```ts theme={null} await corsair.griptape.api.assistant.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Assistant Run ### cancel `assistantRun.cancel` Cancel an assistant run **Risk:** `write` ```ts theme={null} await corsair.griptape.api.assistantRun.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_run_id` | `string` | Yes | — | **Output:** *empty object* *** ### create `assistantRun.create` Create an assistant run **Risk:** `write` ```ts theme={null} await corsair.griptape.api.assistantRun.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | | `additional_knowledge_base_ids` | `string[]` | No | — | | `additional_retriever_ids` | `string[]` | No | — | | `additional_ruleset_ids` | `string[]` | No | — | | `additional_structure_ids` | `string[]` | No | — | | `additional_tool_ids` | `string[]` | No | — | | `args` | `string[]` | No | — | | `input` | `string` | No | — | | `knowledge_base_ids` | `string[]` | No | — | | `model` | `string` | No | — | | `new_thread` | `boolean` | No | — | | `retriever_ids` | `string[]` | No | — | | `ruleset_ids` | `string[]` | No | — | | `stream` | `boolean` | No | — | | `structure_ids` | `string[]` | No | — | | `thread_id` | `string` | No | — | | `tool_ids` | `string[]` | No | — | **Output:** *empty object* *** ### events `assistantRun.events` List events for an assistant run **Risk:** `read` ```ts theme={null} await corsair.griptape.api.assistantRun.events({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_run_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### get `assistantRun.get` Retrieve an assistant run **Risk:** `read` ```ts theme={null} await corsair.griptape.api.assistantRun.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_run_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `assistantRun.list` List runs for an assistant **Risk:** `read` ```ts theme={null} await corsair.griptape.api.assistantRun.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ## Billing ### managementUrl `billing.managementUrl` Get the billing management URL **Risk:** `read` ```ts theme={null} await corsair.griptape.api.billing.managementUrl({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Bucket ### assetUrl `bucket.assetUrl` Get a signed bucket asset URL **Risk:** `read` ```ts theme={null} await corsair.griptape.api.bucket.assetUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `bucket_id` | `string` | Yes | — | | `name` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### create `bucket.create` Create a bucket **Risk:** `write` ```ts theme={null} await corsair.griptape.api.bucket.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### createAsset `bucket.createAsset` Create a bucket asset **Risk:** `write` ```ts theme={null} await corsair.griptape.api.bucket.createAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `bucket_id` | `string` | Yes | — | | `name` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `bucket.delete` Delete a bucket **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.bucket.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucket_id` | `string` | Yes | — | **Output:** `any` *** ### deleteAsset `bucket.deleteAsset` Delete a bucket asset **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.bucket.deleteAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucket_id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output:** `any` *** ### get `bucket.get` Get a bucket **Risk:** `read` ```ts theme={null} await corsair.griptape.api.bucket.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucket_id` | `string` | Yes | — | **Output:** *empty object* *** ### getAsset `bucket.getAsset` Get a bucket asset **Risk:** `read` ```ts theme={null} await corsair.griptape.api.bucket.getAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucket_id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output:** *empty object* *** ### list `bucket.list` List buckets **Risk:** `read` ```ts theme={null} await corsair.griptape.api.bucket.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listAssets `bucket.listAssets` List assets in a bucket **Risk:** `read` ```ts theme={null} await corsair.griptape.api.bucket.listAssets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bucket_id` | `string` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `postfix` | `string` | No | — | | `prefix` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `bucket.update` Update a bucket **Risk:** `write` ```ts theme={null} await corsair.griptape.api.bucket.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `bucket_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Config ### get `config.get` Get Cloud configuration **Risk:** `read` ```ts theme={null} await corsair.griptape.api.config.get({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Connection ### list `connection.list` List connections **Risk:** `read` ```ts theme={null} await corsair.griptape.api.connection.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ## Credits ### balance `credits.balance` Get the credits balance **Risk:** `read` ```ts theme={null} await corsair.griptape.api.credits.balance({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Data Connector ### create `dataConnector.create` Create a data connector **Risk:** `write` ```ts theme={null} await corsair.griptape.api.dataConnector.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### createJob `dataConnector.createJob` Create a data connector job **Risk:** `write` ```ts theme={null} await corsair.griptape.api.dataConnector.createJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `data_connector_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `dataConnector.delete` Delete a data connector **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.dataConnector.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_connector_id` | `string` | Yes | — | **Output:** `any` *** ### get `dataConnector.get` Get a data connector **Risk:** `read` ```ts theme={null} await corsair.griptape.api.dataConnector.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_connector_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `dataConnector.list` List data connectors **Risk:** `read` ```ts theme={null} await corsair.griptape.api.dataConnector.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `dataConnector.update` Update a data connector **Risk:** `write` ```ts theme={null} await corsair.griptape.api.dataConnector.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `data_connector_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Data Job ### cancel `dataJob.cancel` Cancel a data job **Risk:** `write` ```ts theme={null} await corsair.griptape.api.dataJob.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_job_id` | `string` | Yes | — | **Output:** *empty object* *** ### get `dataJob.get` Get a data job **Risk:** `read` ```ts theme={null} await corsair.griptape.api.dataJob.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_job_id` | `string` | Yes | — | **Output:** *empty object* *** ## Export Job ### create `exportJob.create` Create an export job **Risk:** `write` ```ts theme={null} await corsair.griptape.api.exportJob.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `exportJob.get` Get an export job **Risk:** `read` ```ts theme={null} await corsair.griptape.api.exportJob.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `export_job_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `exportJob.list` List export jobs **Risk:** `read` ```ts theme={null} await corsair.griptape.api.exportJob.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ## Function ### create `function.create` Create a function **Risk:** `write` ```ts theme={null} await corsair.griptape.api.function.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### createDeployment `function.createDeployment` Create a function deployment **Risk:** `write` ```ts theme={null} await corsair.griptape.api.function.createDeployment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `function_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `function.delete` Delete a function **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.function.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `function_id` | `string` | Yes | — | **Output:** `any` *** ### get `function.get` Get a function **Risk:** `read` ```ts theme={null} await corsair.griptape.api.function.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `function_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `function.list` List functions **Risk:** `read` ```ts theme={null} await corsair.griptape.api.function.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listDeployments `function.listDeployments` List deployments for a function **Risk:** `read` ```ts theme={null} await corsair.griptape.api.function.listDeployments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `function_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `function.update` Update a function **Risk:** `write` ```ts theme={null} await corsair.griptape.api.function.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `function_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Import Job ### create `importJob.create` Create an import job **Risk:** `write` ```ts theme={null} await corsair.griptape.api.importJob.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `importJob.get` Get an import job **Risk:** `read` ```ts theme={null} await corsair.griptape.api.importJob.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `import_job_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `importJob.list` List import jobs **Risk:** `read` ```ts theme={null} await corsair.griptape.api.importJob.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ## Integration ### create `integration.create` Create an integration **Risk:** `write` ```ts theme={null} await corsair.griptape.api.integration.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `integration.delete` Delete an integration **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.integration.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `integration_id` | `string` | Yes | — | **Output:** `any` *** ### get `integration.get` Get an integration **Risk:** `read` ```ts theme={null} await corsair.griptape.api.integration.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `integration_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `integration.list` List integrations **Risk:** `read` ```ts theme={null} await corsair.griptape.api.integration.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `integration.update` Update an integration **Risk:** `write` ```ts theme={null} await corsair.griptape.api.integration.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `integration_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Knowledge Base ### create `knowledgeBase.create` Create a knowledge base **Risk:** `write` ```ts theme={null} await corsair.griptape.api.knowledgeBase.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### createJob `knowledgeBase.createJob` Create a knowledge base ingestion job **Risk:** `write` ```ts theme={null} await corsair.griptape.api.knowledgeBase.createJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `knowledge_base_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `knowledgeBase.delete` Delete a knowledge base **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.knowledgeBase.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | **Output:** `any` *** ### get `knowledgeBase.get` Get a knowledge base **Risk:** `read` ```ts theme={null} await corsair.griptape.api.knowledgeBase.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | **Output:** *empty object* *** ### getJob `knowledgeBase.getJob` Get a knowledge base job **Risk:** `read` ```ts theme={null} await corsair.griptape.api.knowledgeBase.getJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_job_id` | `string` | Yes | — | **Output:** *empty object* *** ### getSearch `knowledgeBase.getSearch` Get a knowledge base search **Risk:** `read` ```ts theme={null} await corsair.griptape.api.knowledgeBase.getSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_search_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `knowledgeBase.list` List knowledge bases **Risk:** `read` ```ts theme={null} await corsair.griptape.api.knowledgeBase.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listJobs `knowledgeBase.listJobs` List knowledge base jobs **Risk:** `read` ```ts theme={null} await corsair.griptape.api.knowledgeBase.listJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listQueries `knowledgeBase.listQueries` List queries for a knowledge base **Risk:** `read` ```ts theme={null} await corsair.griptape.api.knowledgeBase.listQueries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listSearches `knowledgeBase.listSearches` List searches for a knowledge base **Risk:** `read` ```ts theme={null} await corsair.griptape.api.knowledgeBase.listSearches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### query `knowledgeBase.query` Semantic search against a knowledge base **Risk:** `read` ```ts theme={null} await corsair.griptape.api.knowledgeBase.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | | `query` | `string` | Yes | — | | `query_args` | `any` | No | — | **Output:** *empty object* *** ### search `knowledgeBase.search` Search a knowledge base with a synthesized answer **Risk:** `read` ```ts theme={null} await corsair.griptape.api.knowledgeBase.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | | `query` | `string` | Yes | — | | `query_args` | `any` | No | — | **Output:** *empty object* *** ### update `knowledgeBase.update` Update a knowledge base **Risk:** `write` ```ts theme={null} await corsair.griptape.api.knowledgeBase.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `knowledge_base_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Library ### create `library.create` Create a library **Risk:** `write` ```ts theme={null} await corsair.griptape.api.library.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `library.delete` Delete a library **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.library.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `library_id` | `string` | Yes | — | **Output:** `any` *** ### get `library.get` Get a library **Risk:** `read` ```ts theme={null} await corsair.griptape.api.library.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `library_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `library.list` List libraries **Risk:** `read` ```ts theme={null} await corsair.griptape.api.library.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `library.update` Update a library **Risk:** `write` ```ts theme={null} await corsair.griptape.api.library.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `library_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Message ### delete `message.delete` Delete a message **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.message.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | **Output:** `any` *** ### get `message.get` Get a message **Risk:** `read` ```ts theme={null} await corsair.griptape.api.message.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | **Output:** *empty object* *** ### update `message.update` Update a message **Risk:** `write` ```ts theme={null} await corsair.griptape.api.message.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `message_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Model ### create `model.create` Create a model configuration **Risk:** `write` ```ts theme={null} await corsair.griptape.api.model.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### createAuthConfig `model.createAuthConfig` Create a model auth config **Risk:** `write` ```ts theme={null} await corsair.griptape.api.model.createAuthConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `model.delete` Delete a model configuration **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.model.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_config_id` | `string` | Yes | — | **Output:** `any` *** ### deleteAuthConfig `model.deleteAuthConfig` Delete a model auth config **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.model.deleteAuthConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `auth_config_id` | `string` | Yes | — | **Output:** `any` *** ### get `model.get` Get a model configuration **Risk:** `read` ```ts theme={null} await corsair.griptape.api.model.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_config_id` | `string` | Yes | — | **Output:** *empty object* *** ### getAuthConfig `model.getAuthConfig` Get a model auth config **Risk:** `read` ```ts theme={null} await corsair.griptape.api.model.getAuthConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `auth_config_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `model.list` List models **Risk:** `read` ```ts theme={null} await corsair.griptape.api.model.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listAuthConfigs `model.listAuthConfigs` List model auth configs **Risk:** `read` ```ts theme={null} await corsair.griptape.api.model.listAuthConfigs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `model.update` Update a model configuration **Risk:** `write` ```ts theme={null} await corsair.griptape.api.model.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `model_config_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### updateAuthConfig `model.updateAuthConfig` Update a model auth config **Risk:** `write` ```ts theme={null} await corsair.griptape.api.model.updateAuthConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `auth_config_id` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Organization ### createApiKey `organization.createApiKey` Create an organization API key **Risk:** `write` ```ts theme={null} await corsair.griptape.api.organization.createApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `organization_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `organization.get` Get an organization **Risk:** `read` ```ts theme={null} await corsair.griptape.api.organization.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `organization.list` List organizations **Risk:** `read` ```ts theme={null} await corsair.griptape.api.organization.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listApiKeys `organization.listApiKeys` List API keys for an organization **Risk:** `read` ```ts theme={null} await corsair.griptape.api.organization.listApiKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `organization.update` Update an organization **Risk:** `write` ```ts theme={null} await corsair.griptape.api.organization.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `organization_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Retriever ### create `retriever.create` Create a retriever **Risk:** `write` ```ts theme={null} await corsair.griptape.api.retriever.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `retriever.get` Get a retriever **Risk:** `read` ```ts theme={null} await corsair.griptape.api.retriever.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `retriever_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `retriever.list` List retrievers **Risk:** `read` ```ts theme={null} await corsair.griptape.api.retriever.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### query `retriever.query` Query a retriever **Risk:** `read` ```ts theme={null} await corsair.griptape.api.retriever.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `retriever_components_query_args` | `any` | No | — | | `retriever_id` | `string` | Yes | — | **Output:** *empty object* *** ### update `retriever.update` Update a retriever **Risk:** `write` ```ts theme={null} await corsair.griptape.api.retriever.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `retriever_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Retriever Component ### create `retrieverComponent.create` Create a retriever component **Risk:** `write` ```ts theme={null} await corsair.griptape.api.retrieverComponent.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### get `retrieverComponent.get` Get a retriever component **Risk:** `read` ```ts theme={null} await corsair.griptape.api.retrieverComponent.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `retriever_component_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `retrieverComponent.list` List retriever components **Risk:** `read` ```ts theme={null} await corsair.griptape.api.retrieverComponent.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `retrieverComponent.update` Update a retriever component **Risk:** `write` ```ts theme={null} await corsair.griptape.api.retrieverComponent.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `retriever_component_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Rule ### create `rule.create` Create a rule **Risk:** `write` ```ts theme={null} await corsair.griptape.api.rule.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `rule.delete` Delete a rule **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.rule.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `string` | Yes | — | **Output:** `any` *** ### get `rule.get` Get a rule **Risk:** `read` ```ts theme={null} await corsair.griptape.api.rule.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `rule.list` List rules **Risk:** `read` ```ts theme={null} await corsair.griptape.api.rule.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `rule.update` Update a rule **Risk:** `write` ```ts theme={null} await corsair.griptape.api.rule.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `rule_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Ruleset ### create `ruleset.create` Create a ruleset **Risk:** `write` ```ts theme={null} await corsair.griptape.api.ruleset.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `ruleset.delete` Delete a ruleset **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.ruleset.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ruleset_id` | `string` | Yes | — | **Output:** `any` *** ### get `ruleset.get` Get a ruleset **Risk:** `read` ```ts theme={null} await corsair.griptape.api.ruleset.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ruleset_id` | `string` | Yes | — | **Output:** *empty object* *** ### getByAlias `ruleset.getByAlias` Get a ruleset by alias **Risk:** `read` ```ts theme={null} await corsair.griptape.api.ruleset.getByAlias({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `alias` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `ruleset.update` Update a ruleset **Risk:** `write` ```ts theme={null} await corsair.griptape.api.ruleset.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `ruleset_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Secret ### create `secret.create` Create a secret **Risk:** `write` ```ts theme={null} await corsair.griptape.api.secret.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `secret.delete` Delete a secret **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.secret.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `secret_id` | `string` | Yes | — | **Output:** `any` *** ### get `secret.get` Get a secret **Risk:** `read` ```ts theme={null} await corsair.griptape.api.secret.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `secret_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `secret.list` List secrets **Risk:** `read` ```ts theme={null} await corsair.griptape.api.secret.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `secret.update` Update a secret **Risk:** `write` ```ts theme={null} await corsair.griptape.api.secret.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `secret_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Structure ### create `structure.create` Create a structure **Risk:** `write` ```ts theme={null} await corsair.griptape.api.structure.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### createDeployment `structure.createDeployment` Create a structure deployment **Risk:** `write` ```ts theme={null} await corsair.griptape.api.structure.createDeployment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `structure_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### dashboard `structure.dashboard` Get structure dashboard metrics **Risk:** `read` ```ts theme={null} await corsair.griptape.api.structure.dashboard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `end_time` | `string` | No | — | | `period` | `string` | No | — | | `start_time` | `string` | No | — | | `structure_ids` | `string[]` | No | — | **Output:** *empty object* *** ### delete `structure.delete` Delete a structure **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.structure.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `structure_id` | `string` | Yes | — | **Output:** `any` *** ### get `structure.get` Get a structure **Risk:** `read` ```ts theme={null} await corsair.griptape.api.structure.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `structure_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `structure.list` List structures **Risk:** `read` ```ts theme={null} await corsair.griptape.api.structure.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listDeployments `structure.listDeployments` List deployments for a structure **Risk:** `read` ```ts theme={null} await corsair.griptape.api.structure.listDeployments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `structure_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listRuns `structure.listRuns` List runs for a structure **Risk:** `read` ```ts theme={null} await corsair.griptape.api.structure.listRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `structure_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `structure.update` Update a structure **Risk:** `write` ```ts theme={null} await corsair.griptape.api.structure.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `structure_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Thread ### create `thread.create` Create a thread **Risk:** `write` ```ts theme={null} await corsair.griptape.api.thread.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `thread.delete` Delete a thread **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.thread.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `thread_id` | `string` | Yes | — | **Output:** `any` *** ### get `thread.get` Get a thread **Risk:** `read` ```ts theme={null} await corsair.griptape.api.thread.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `thread_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `thread.list` List threads **Risk:** `read` ```ts theme={null} await corsair.griptape.api.thread.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `alias` | `string` | No | — | | `created_by` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `starts_with` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `thread.update` Update a thread **Risk:** `write` ```ts theme={null} await corsair.griptape.api.thread.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `thread_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Thread Message ### create `threadMessage.create` Create a message in a thread **Risk:** `write` ```ts theme={null} await corsair.griptape.api.threadMessage.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string` | Yes | — | | `metadata` | `object` | No | — | | `output` | `string` | Yes | — | | `thread_id` | `string` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### list `threadMessage.list` List messages in a thread **Risk:** `read` ```ts theme={null} await corsair.griptape.api.threadMessage.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `thread_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ## Tool ### create `tool.create` Create a tool **Risk:** `write` ```ts theme={null} await corsair.griptape.api.tool.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### createDeployment `tool.createDeployment` Create a tool deployment **Risk:** `write` ```ts theme={null} await corsair.griptape.api.tool.createDeployment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `tool_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ### delete `tool.delete` Delete a tool **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.tool.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tool_id` | `string` | Yes | — | **Output:** `any` *** ### deploymentStatus `tool.deploymentStatus` Get a tool deployment status **Risk:** `read` ```ts theme={null} await corsair.griptape.api.tool.deploymentStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deployment_id` | `string` | Yes | — | **Output:** *empty object* *** ### get `tool.get` Get a tool **Risk:** `read` ```ts theme={null} await corsair.griptape.api.tool.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tool_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `tool.list` List tools **Risk:** `read` ```ts theme={null} await corsair.griptape.api.tool.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listDeployments `tool.listDeployments` List deployments for a tool **Risk:** `read` ```ts theme={null} await corsair.griptape.api.tool.listDeployments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tool_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### listRuns `tool.listRuns` List runs for a tool **Risk:** `read` ```ts theme={null} await corsair.griptape.api.tool.listRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tool_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** ### update `tool.update` Update a tool **Risk:** `write` ```ts theme={null} await corsair.griptape.api.tool.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `body` | `object` | No | — | | `tool_id` | `string` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Usage ### get `usage.get` Get usage statistics **Risk:** `read` ```ts theme={null} await corsair.griptape.api.usage.get({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## User ### deleteApiKey `user.deleteApiKey` Delete an API key **Risk:** `destructive` ```ts theme={null} await corsair.griptape.api.user.deleteApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_key_id` | `string` | Yes | — | **Output:** `any` *** ### get `user.get` Get a user **Risk:** `read` ```ts theme={null} await corsair.griptape.api.user.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | **Output:** *empty object* *** ### getApiKey `user.getApiKey` Get an API key **Risk:** `read` ```ts theme={null} await corsair.griptape.api.user.getApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `api_key_id` | `string` | Yes | — | **Output:** *empty object* *** ### list `user.list` List users **Risk:** `read` ```ts theme={null} await corsair.griptape.api.user.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | No | — | > **pagination full type** > > ```ts theme={null} > { > next_page?: number, > page_number: number, > page_size: number, > previous_page?: number, > total_count: number, > total_pages: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/griptape/database Griptape local sync: searchable entities, `.search()` filters, and operators. The Griptape plugin syncs data locally. Use `corsair.griptape.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/griptape/overview Griptape plugin for Corsair Use **Griptape** through Corsair: one client, typed API calls. **What you get:** * 140 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/griptape ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/griptape ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/griptape ``` ```bash bun theme={null} bun add corsair @corsair-dev/griptape ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { griptape } from '@corsair-dev/griptape'; export const corsair = createCorsair({ plugins: [ griptape(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} griptape() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'griptape', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`assistant.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.griptape.api.assistant.get({}); ``` **`assistant.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.griptape.api.assistant.create({}); ``` See the full list on the [API](/plugins/griptape/api) page. ## What's next > **[API reference](/plugins/griptape/api)** > > Every `griptape.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/groqcloud/api API reference for Groq: every `groqcloud.api.*` operation with input and output types. Every `groqcloud.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Audio ### createTranscription `audio.createTranscription` Transcribe an audio file into text **Risk:** `write` ```ts theme={null} await corsair.groqcloud.api.audio.createTranscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom` | No | The audio data to transcribe | | `fileName` | `string` | No | File name for the uploaded audio; required with `file` | | `url` | `string` | No | Publicly reachable URL of the audio to transcribe | | `model` | `string` | Yes | The ID of the model to use | | `language` | `string` | No | The language of the input audio | | `prompt` | `string` | No | An optional text to guide the model | | `response_format` | `json \| text \| verbose_json` | No | Transcript output format. Groq accepts only json, text and verbose\_json — srt and vtt are rejected with HTTP 400. | | `temperature` | `number` | No | The sampling temperature | **Output** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | The transcribed text | *** ### createTranslation `audio.createTranslation` Translate an audio recording into English text **Risk:** `write` ```ts theme={null} await corsair.groqcloud.api.audio.createTranslation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom` | No | The audio data to translate | | `fileName` | `string` | No | File name for the uploaded audio; required with `file` | | `url` | `string` | No | Publicly reachable URL of the audio to translate | | `model` | `string` | Yes | The ID of the model to use | | `prompt` | `string` | No | An optional text to guide the model | | `response_format` | `json \| text \| verbose_json` | No | Transcript output format. Groq accepts only json, text and verbose\_json — srt and vtt are rejected with HTTP 400. | | `temperature` | `number` | No | The sampling temperature | **Output** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | The translated text | *** ### listVoices `audio.listVoices` Retrieve available TTS voices for Groq PlayAI models **Risk:** `read` ```ts theme={null} await corsair.groqcloud.api.audio.listVoices({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `english` | `string[]` | Yes | List of English TTS voices | | `arabic` | `string[]` | Yes | List of Arabic TTS voices | *** ## Chat ### createCompletion `chat.createCompletion` Generate a chat completion from a list of messages **Risk:** `write` ```ts theme={null} await corsair.groqcloud.api.chat.createCompletion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | The ID of the model to use | | `messages` | `object[]` | Yes | A list of messages comprising the conversation so far | | `temperature` | `number` | No | Sampling temperature | | `max_completion_tokens` | `number` | No | The maximum number of tokens to generate | | `top_p` | `number` | No | Nucleus sampling parameter | | `stop` | `string \| string[]` | No | Up to 4 sequences where the API will stop generating further tokens | | `stream` | `false` | No | Streaming is not supported by this plugin. The shared transport buffers text/event-stream as plain text, so a streamed call would return a raw SSE string rather than the completion object this operation promises. | | `response_format` | `object` | No | Response format object | | `tools` | `any[]` | No | A list of tools the model may call | | `tool_choice` | `any` | No | Controls which tool is called by the model | > **messages full type** > > ```ts theme={null} > { > role: system | user | assistant | tool, > content: string | any[], > name?: string, > tool_call_id?: string > }[] > ``` > **response\_format full type** > > ```ts theme={null} > { > type: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | | `choices` | `object[]` | Yes | — | | `usage` | `any` | No | — | > **choices full type** > > ```ts theme={null} > { > index: number, > message: { > role: system | user | assistant | tool, > content: string | any[], > name?: string, > tool_call_id?: string > }, > finish_reason?: string | null > }[] > ``` *** ### createResponse `chat.createResponse` Create a model response for the given input (Responses API) **Risk:** `write` ```ts theme={null} await corsair.groqcloud.api.chat.createResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | The ID of the model to use | | `input` | `string \| any[]` | Yes | The input for the model response | | `instructions` | `string` | No | Optional instructions to guide the response | | `max_output_tokens` | `number` | No | Maximum number of output tokens | | `tools` | `any[]` | No | A list of tools | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | Yes | — | | `model` | `string` | Yes | — | | `status` | `string` | No | — | | `created_at` | `number` | No | — | | `output` | `object[]` | Yes | Ordered output items; the reply is the `message` item | | `text` | `object` | No | Requested output format, echoed back — not the reply | | `usage` | `object` | No | — | | `error` | `any` | No | — | | `incomplete_details` | `any` | No | — | > **output full type** > > ```ts theme={null} > { > type: string, > id?: string, > status?: string, > role?: string, > content?: { > type: string, > text?: string > }[] > }[] > ``` > **text full type** > > ```ts theme={null} > { > format: { > type: string > } > } > ``` > **usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > total_tokens?: number > } > ``` *** ## Models ### listModels `models.listModels` Retrieve currently available Groq models **Risk:** `read` ```ts theme={null} await corsair.groqcloud.api.models.listModels({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: string, > created?: number, > owned_by?: string, > active?: boolean, > name?: string, > context_window?: number, > context_length?: number, > max_completion_tokens?: number, > max_output_length?: number, > hugging_face_id?: string | null, > input_modalities?: string[], > output_modalities?: string[], > supported_features?: string[], > supported_sampling_parameters?: string[], > public_apps?: any | null, > pricing?: { > } | null > }[] > ``` *** ### retrieveModel `models.retrieveModel` Retrieve detailed metadata for a specific model **Risk:** `read` ```ts theme={null} await corsair.groqcloud.api.models.retrieveModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | The ID of the model to use for this request | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | Yes | — | | `created` | `number` | No | — | | `owned_by` | `string` | No | — | | `active` | `boolean` | No | — | | `name` | `string` | No | — | | `context_window` | `number` | No | — | | `context_length` | `number` | No | — | | `max_completion_tokens` | `number` | No | — | | `max_output_length` | `number` | No | — | | `hugging_face_id` | `string` | No | — | | `input_modalities` | `string[]` | No | — | | `output_modalities` | `string[]` | No | — | | `supported_features` | `string[]` | No | — | | `supported_sampling_parameters` | `string[]` | No | — | | `public_apps` | `any` | No | — | | `pricing` | `object` | No | — | > **pricing full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/groqcloud/database Groq local sync: searchable entities, `.search()` filters, and operators. The Groq plugin syncs data locally. Use `corsair.groqcloud.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Models Path: `groqcloud.db.models.search` ```ts theme={null} const rows = await corsair.groqcloud.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `object` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `owned_by` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `context_window` | `number` | equals, gt, gte, lt, lte, in | | `context_length` | `number` | equals, gt, gte, lt, lte, in | | `max_completion_tokens` | `number` | equals, gt, gte, lt, lte, in | | `max_output_length` | `number` | equals, gt, gte, lt, lte, in | | `hugging_face_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/groqcloud/overview Fast AI inference API for low-latency LLM chat completions and language model hosting. Use **Groq** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 7 typed API operations * 1 synced entity (`models`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/groqcloud ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/groqcloud ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/groqcloud ``` ```bash bun theme={null} bun add corsair @corsair-dev/groqcloud ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { groqcloud } from '@corsair-dev/groqcloud'; export const corsair = createCorsair({ plugins: [ groqcloud(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} groqcloud() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'groqcloud', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`audio.listVoices`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.groqcloud.api.audio.listVoices({}); ``` **`audio.createTranscription`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.groqcloud.api.audio.createTranscription({}); ``` See the full list on the [API](/plugins/groqcloud/api) page. ## Query synced data Synced entities support `tenant.groqcloud.db..search()` and `.list()`: `models`. See [Database](/plugins/groqcloud/database) for filters and operators. ## What's next > **[API reference](/plugins/groqcloud/api)** > > Every `groqcloud.api.*` operation with input and output types. > **[Database](/plugins/groqcloud/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/habitica/api API reference for Habitica: every `habitica.api.*` operation with input and output types. Every `habitica.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Auth ### login `auth.login` Exchange a password for an API token **Risk:** `read` ```ts theme={null} await corsair.habitica.api.auth.login({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `password` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `apiToken` | `string` | No | — | | `newUser` | `boolean` | No | — | | `username` | `string` | No | — | *** ### register `auth.register` Register a new Habitica account and mint its credential **Risk:** `write` ```ts theme={null} await corsair.habitica.api.auth.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `email` | `string` | Yes | — | | `password` | `string` | Yes | — | | `confirmPassword` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `apiToken` | `string` | No | — | | `newUser` | `boolean` | No | — | | `username` | `string` | No | — | *** ### social `auth.social` Authenticate through a social provider **Risk:** `read` ```ts theme={null} await corsair.habitica.api.auth.social({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `facebook \| google \| apple` | Yes | — | | `authResponse` | `object` | Yes | — | > **authResponse full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `apiToken` | `string` | No | — | | `newUser` | `boolean` | No | — | | `username` | `string` | No | — | *** ## Challenges ### clone `challenges.clone` Duplicate a challenge **Risk:** `write` ```ts theme={null} await corsair.habitica.api.challenges.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `challengeId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `shortName` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `official` | `boolean` | No | — | | `prize` | `number` | No | — | | `memberCount` | `number` | No | — | | `leader` | `object` | No | — | | `group` | `object` | No | — | | `tasksOrder` | `object` | No | — | | `categories` | `object[]` | No | — | | `flags` | `object` | No | — | | `flagCount` | `number` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **leader full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null, > name?: string | null, > type?: string | null, > privacy?: string | null, > summary?: string | null, > leader?: string | null, > categories?: { > }[] | null > } > ``` > **tasksOrder full type** > > ```ts theme={null} > { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` > **flags full type** > > ```ts theme={null} > { > } > ``` *** ### create `challenges.create` Create a challenge in a group **Risk:** `write` ```ts theme={null} await corsair.habitica.api.challenges.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `shortName` | `string` | Yes | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `prize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `shortName` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `official` | `boolean` | No | — | | `prize` | `number` | No | — | | `memberCount` | `number` | No | — | | `leader` | `object` | No | — | | `group` | `object` | No | — | | `tasksOrder` | `object` | No | — | | `categories` | `object[]` | No | — | | `flags` | `object` | No | — | | `flagCount` | `number` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **leader full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null, > name?: string | null, > type?: string | null, > privacy?: string | null, > summary?: string | null, > leader?: string | null, > categories?: { > }[] | null > } > ``` > **tasksOrder full type** > > ```ts theme={null} > { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` > **flags full type** > > ```ts theme={null} > { > } > ``` *** ### delete `challenges.delete` Permanently delete a challenge and its tasks **Risk:** `destructive` ```ts theme={null} await corsair.habitica.api.challenges.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `challengeId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### exportCsv `challenges.exportCsv` Export a challenge as CSV **Risk:** `read` ```ts theme={null} await corsair.habitica.api.challenges.exportCsv({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `challengeId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `body` | `string` | Yes | — | | `contentType` | `string` | Yes | — | *** ### get `challenges.get` Retrieve a challenge **Risk:** `read` ```ts theme={null} await corsair.habitica.api.challenges.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `challengeId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `shortName` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `official` | `boolean` | No | — | | `prize` | `number` | No | — | | `memberCount` | `number` | No | — | | `leader` | `object` | No | — | | `group` | `object` | No | — | | `tasksOrder` | `object` | No | — | | `categories` | `object[]` | No | — | | `flags` | `object` | No | — | | `flagCount` | `number` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **leader full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null, > name?: string | null, > type?: string | null, > privacy?: string | null, > summary?: string | null, > leader?: string | null, > categories?: { > }[] | null > } > ``` > **tasksOrder full type** > > ```ts theme={null} > { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` > **flags full type** > > ```ts theme={null} > { > } > ``` *** ### join `challenges.join` Join a challenge **Risk:** `write` ```ts theme={null} await corsair.habitica.api.challenges.join({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `challengeId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `shortName` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `official` | `boolean` | No | — | | `prize` | `number` | No | — | | `memberCount` | `number` | No | — | | `leader` | `object` | No | — | | `group` | `object` | No | — | | `tasksOrder` | `object` | No | — | | `categories` | `object[]` | No | — | | `flags` | `object` | No | — | | `flagCount` | `number` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **leader full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null, > name?: string | null, > type?: string | null, > privacy?: string | null, > summary?: string | null, > leader?: string | null, > categories?: { > }[] | null > } > ``` > **tasksOrder full type** > > ```ts theme={null} > { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` > **flags full type** > > ```ts theme={null} > { > } > ``` *** ### leave `challenges.leave` Leave a challenge **Risk:** `write` ```ts theme={null} await corsair.habitica.api.challenges.leave({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `challengeId` | `string` | Yes | — | | `keep` | `keep-all \| remove-all` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listByGroup `challenges.listByGroup` List a group's challenges **Risk:** `read` ```ts theme={null} await corsair.habitica.api.challenges.listByGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > _id?: string | null, > name?: string | null, > shortName?: string | null, > summary?: string | null, > description?: string | null, > official?: boolean | null, > prize?: number | null, > memberCount?: number | null, > leader?: { > id?: string | null, > _id?: string | null > } | null, > group?: { > id?: string | null, > _id?: string | null, > name?: string | null, > type?: string | null, > privacy?: string | null, > summary?: string | null, > leader?: string | null, > categories?: { > }[] | null > } | null, > tasksOrder?: { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } | null, > categories?: { > }[] | null, > flags?: { > } | null, > flagCount?: number | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### listForUser `challenges.listForUser` List the challenges the account takes part in **Risk:** `read` ```ts theme={null} await corsair.habitica.api.challenges.listForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | Yes | — | | `member` | `boolean` | No | — | | `owned` | `owned \| not_owned` | No | — | | `search` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > _id?: string | null, > name?: string | null, > shortName?: string | null, > summary?: string | null, > description?: string | null, > official?: boolean | null, > prize?: number | null, > memberCount?: number | null, > leader?: { > id?: string | null, > _id?: string | null > } | null, > group?: { > id?: string | null, > _id?: string | null, > name?: string | null, > type?: string | null, > privacy?: string | null, > summary?: string | null, > leader?: string | null, > categories?: { > }[] | null > } | null, > tasksOrder?: { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } | null, > categories?: { > }[] | null, > flags?: { > } | null, > flagCount?: number | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ## Chat ### deleteMessage `chat.deleteMessage` Permanently delete a chat message **Risk:** `destructive` ```ts theme={null} await corsair.habitica.api.chat.deleteMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `chatId` | `string` | Yes | — | | `previousMsg` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `chat.list` Read a group's chat messages **Risk:** `read` ```ts theme={null} await corsair.habitica.api.chat.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null, > timestamp?: string | number | null > }[] > ``` *** ### markSeen `chat.markSeen` Mark a group's chat as read **Risk:** `write` ```ts theme={null} await corsair.habitica.api.chat.markSeen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Content ### dismissNews `content.dismissNews` Dismiss the current announcement **Risk:** `write` ```ts theme={null} await corsair.habitica.api.content.dismissNews({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `content.get` Fetch the whole game content catalogue **Risk:** `read` ```ts theme={null} await corsair.habitica.api.content.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getByType `content.getByType` Fetch the content catalogue with named categories EXCLUDED **Risk:** `read` ```ts theme={null} await corsair.habitica.api.content.getByType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter` | `string` | No | — | | `language` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### marketGear `content.marketGear` List gear for sale in the market **Risk:** `read` ```ts theme={null} await corsair.habitica.api.content.marketGear({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### modelPaths `content.modelPaths` List a model's field paths and types **Risk:** `read` ```ts theme={null} await corsair.habitica.api.content.modelPaths({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `user \| tag \| challenge \| group \| habit \| daily \| todo \| reward` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### news `content.news` Read the latest Bailey announcement **Risk:** `read` ```ts theme={null} await corsair.habitica.api.content.news({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### status `content.status` Check that the Habitica API is up **Risk:** `read` ```ts theme={null} await corsair.habitica.api.content.status({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### timeTravelers `content.timeTravelers` List the Time Travellers shop stock **Risk:** `read` ```ts theme={null} await corsair.habitica.api.content.timeTravelers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### validateCoupon `content.validateCoupon` Check whether a coupon code is valid **Risk:** `read` ```ts theme={null} await corsair.habitica.api.content.validateCoupon({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### worldState `content.worldState` Read world events and the world boss **Risk:** `read` ```ts theme={null} await corsair.habitica.api.content.worldState({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Exports ### history `exports.history` Export task history as CSV **Risk:** `read` ```ts theme={null} await corsair.habitica.api.exports.history({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `body` | `string` | Yes | — | | `contentType` | `string` | Yes | — | *** ### inbox `exports.inbox` Export the inbox as HTML **Risk:** `read` ```ts theme={null} await corsair.habitica.api.exports.inbox({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `body` | `string` | Yes | — | | `contentType` | `string` | Yes | — | *** ### userData `exports.userData` Export the whole account as JSON (contains the account email) **Risk:** `read` ```ts theme={null} await corsair.habitica.api.exports.userData({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Groups ### create `groups.create` Create a party or guild **Risk:** `write` ```ts theme={null} await corsair.habitica.api.groups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `party \| guild` | Yes | — | | `privacy` | `private \| public` | No | — | | `description` | `string` | No | — | | `summary` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `privacy` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `leader` | `object` | No | — | | `memberCount` | `number` | No | — | | `challengeCount` | `number` | No | — | | `balance` | `number` | No | — | | `managers` | `object` | No | — | | `categories` | `object[]` | No | — | | `quest` | `object` | No | — | | `leaderOnly` | `object` | No | — | | `tasksOrder` | `object` | No | — | | `purchased` | `object` | No | — | | `cron` | `object` | No | — | | `bannedWordsAllowed` | `boolean` | No | — | | `chatLimitCount` | `number` | No | — | | `logo` | `string` | No | — | | `leaderMessage` | `string` | No | — | | `chat` | `any[]` | No | — | | `archive` | `object` | No | — | > **leader full type** > > ```ts theme={null} > string | { > } > ``` > **managers full type** > > ```ts theme={null} > { > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` > **quest full type** > > ```ts theme={null} > { > key?: string | null, > active?: boolean | null, > leader?: string | null, > progress?: { > hp?: number | null, > collect?: { > } | null, > rage?: number | null > } | null, > members?: { > } | null, > extra?: { > } | null > } > ``` > **leaderOnly full type** > > ```ts theme={null} > { > challenges?: boolean | null, > getGems?: boolean | null > } > ``` > **tasksOrder full type** > > ```ts theme={null} > { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } > ``` > **purchased full type** > > ```ts theme={null} > { > } > ``` > **cron full type** > > ```ts theme={null} > { > lastProcessed?: string | null > } > ``` > **archive full type** > > ```ts theme={null} > string | { > } > ``` *** ### get `groups.get` Retrieve a group by id **Risk:** `read` ```ts theme={null} await corsair.habitica.api.groups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `privacy` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `leader` | `object` | No | — | | `memberCount` | `number` | No | — | | `challengeCount` | `number` | No | — | | `balance` | `number` | No | — | | `managers` | `object` | No | — | | `categories` | `object[]` | No | — | | `quest` | `object` | No | — | | `leaderOnly` | `object` | No | — | | `tasksOrder` | `object` | No | — | | `purchased` | `object` | No | — | | `cron` | `object` | No | — | | `bannedWordsAllowed` | `boolean` | No | — | | `chatLimitCount` | `number` | No | — | | `logo` | `string` | No | — | | `leaderMessage` | `string` | No | — | | `chat` | `any[]` | No | — | | `archive` | `object` | No | — | > **leader full type** > > ```ts theme={null} > string | { > } > ``` > **managers full type** > > ```ts theme={null} > { > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` > **quest full type** > > ```ts theme={null} > { > key?: string | null, > active?: boolean | null, > leader?: string | null, > progress?: { > hp?: number | null, > collect?: { > } | null, > rage?: number | null > } | null, > members?: { > } | null, > extra?: { > } | null > } > ``` > **leaderOnly full type** > > ```ts theme={null} > { > challenges?: boolean | null, > getGems?: boolean | null > } > ``` > **tasksOrder full type** > > ```ts theme={null} > { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } > ``` > **purchased full type** > > ```ts theme={null} > { > } > ``` > **cron full type** > > ```ts theme={null} > { > lastProcessed?: string | null > } > ``` > **archive full type** > > ```ts theme={null} > string | { > } > ``` *** ### getParty `groups.getParty` Retrieve the account's party **Risk:** `read` ```ts theme={null} await corsair.habitica.api.groups.getParty({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `privacy` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `leader` | `object` | No | — | | `memberCount` | `number` | No | — | | `challengeCount` | `number` | No | — | | `balance` | `number` | No | — | | `managers` | `object` | No | — | | `categories` | `object[]` | No | — | | `quest` | `object` | No | — | | `leaderOnly` | `object` | No | — | | `tasksOrder` | `object` | No | — | | `purchased` | `object` | No | — | | `cron` | `object` | No | — | | `bannedWordsAllowed` | `boolean` | No | — | | `chatLimitCount` | `number` | No | — | | `logo` | `string` | No | — | | `leaderMessage` | `string` | No | — | | `chat` | `any[]` | No | — | | `archive` | `object` | No | — | > **leader full type** > > ```ts theme={null} > string | { > } > ``` > **managers full type** > > ```ts theme={null} > { > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` > **quest full type** > > ```ts theme={null} > { > key?: string | null, > active?: boolean | null, > leader?: string | null, > progress?: { > hp?: number | null, > collect?: { > } | null, > rage?: number | null > } | null, > members?: { > } | null, > extra?: { > } | null > } > ``` > **leaderOnly full type** > > ```ts theme={null} > { > challenges?: boolean | null, > getGems?: boolean | null > } > ``` > **tasksOrder full type** > > ```ts theme={null} > { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } > ``` > **purchased full type** > > ```ts theme={null} > { > } > ``` > **cron full type** > > ```ts theme={null} > { > lastProcessed?: string | null > } > ``` > **archive full type** > > ```ts theme={null} > string | { > } > ``` *** ### getTavern `groups.getTavern` Retrieve the Tavern **Risk:** `read` ```ts theme={null} await corsair.habitica.api.groups.getTavern({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `privacy` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `leader` | `object` | No | — | | `memberCount` | `number` | No | — | | `challengeCount` | `number` | No | — | | `balance` | `number` | No | — | | `managers` | `object` | No | — | | `categories` | `object[]` | No | — | | `quest` | `object` | No | — | | `leaderOnly` | `object` | No | — | | `tasksOrder` | `object` | No | — | | `purchased` | `object` | No | — | | `cron` | `object` | No | — | | `bannedWordsAllowed` | `boolean` | No | — | | `chatLimitCount` | `number` | No | — | | `logo` | `string` | No | — | | `leaderMessage` | `string` | No | — | | `chat` | `any[]` | No | — | | `archive` | `object` | No | — | > **leader full type** > > ```ts theme={null} > string | { > } > ``` > **managers full type** > > ```ts theme={null} > { > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` > **quest full type** > > ```ts theme={null} > { > key?: string | null, > active?: boolean | null, > leader?: string | null, > progress?: { > hp?: number | null, > collect?: { > } | null, > rage?: number | null > } | null, > members?: { > } | null, > extra?: { > } | null > } > ``` > **leaderOnly full type** > > ```ts theme={null} > { > challenges?: boolean | null, > getGems?: boolean | null > } > ``` > **tasksOrder full type** > > ```ts theme={null} > { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } > ``` > **purchased full type** > > ```ts theme={null} > { > } > ``` > **cron full type** > > ```ts theme={null} > { > lastProcessed?: string | null > } > ``` > **archive full type** > > ```ts theme={null} > string | { > } > ``` *** ### invite `groups.invite` Invite people to a group **Risk:** `write` ```ts theme={null} await corsair.habitica.api.groups.invite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `uuids` | `string[]` | No | — | | `emails` | `object[]` | No | — | | `usernames` | `string[]` | No | — | > **emails full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### inviteToQuest `groups.inviteToQuest` Invite the party to a quest **Risk:** `write` ```ts theme={null} await corsair.habitica.api.groups.inviteToQuest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `questKey` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### leave `groups.leave` Leave a group **Risk:** `write` ```ts theme={null} await corsair.habitica.api.groups.leave({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `keep` | `keep-all \| remove-all` | No | — | | `keepChallenges` | `remain-in-challenges \| leave-challenges` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `groups.list` List groups by type **Risk:** `read` ```ts theme={null} await corsair.habitica.api.groups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `paginate` | `boolean` | No | — | | `page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > _id?: string | null, > name?: string | null, > type?: string | null, > privacy?: string | null, > summary?: string | null, > description?: string | null, > leader?: string | { > } | null, > memberCount?: number | null, > challengeCount?: number | null, > balance?: number | null, > managers?: { > } | null, > categories?: { > }[] | null, > quest?: { > key?: string | null, > active?: boolean | null, > leader?: string | null, > progress?: { > hp?: number | null, > collect?: { > } | null, > rage?: number | null > } | null, > members?: { > } | null, > extra?: { > } | null > } | null, > leaderOnly?: { > challenges?: boolean | null, > getGems?: boolean | null > } | null, > tasksOrder?: { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } | null, > purchased?: { > } | null, > cron?: { > lastProcessed?: string | null > } | null, > bannedWordsAllowed?: boolean | null, > chatLimitCount?: number | null, > logo?: string | null, > leaderMessage?: string | null, > chat?: any[] | null, > archive?: string | { > } | null > }[] > ``` *** ### listMembers `groups.listMembers` List a group's members **Risk:** `read` ```ts theme={null} await corsair.habitica.api.groups.listMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `lastId` | `string` | No | — | | `limit` | `number` | No | — | | `includeAllPublicFields` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string | null, > _id?: string | null, > auth?: { > } | null, > profile?: { > } | null > }[] > ``` *** ### removeMember `groups.removeMember` Remove a member from the party **Risk:** `write` ```ts theme={null} await corsair.habitica.api.groups.removeMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `memberId` | `string` | Yes | — | | `message` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### update `groups.update` Update a group's properties **Risk:** `write` ```ts theme={null} await corsair.habitica.api.groups.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `summary` | `string` | No | — | | `privacy` | `private \| public` | No | — | | `leader` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `privacy` | `string` | No | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `leader` | `object` | No | — | | `memberCount` | `number` | No | — | | `challengeCount` | `number` | No | — | | `balance` | `number` | No | — | | `managers` | `object` | No | — | | `categories` | `object[]` | No | — | | `quest` | `object` | No | — | | `leaderOnly` | `object` | No | — | | `tasksOrder` | `object` | No | — | | `purchased` | `object` | No | — | | `cron` | `object` | No | — | | `bannedWordsAllowed` | `boolean` | No | — | | `chatLimitCount` | `number` | No | — | | `logo` | `string` | No | — | | `leaderMessage` | `string` | No | — | | `chat` | `any[]` | No | — | | `archive` | `object` | No | — | > **leader full type** > > ```ts theme={null} > string | { > } > ``` > **managers full type** > > ```ts theme={null} > { > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` > **quest full type** > > ```ts theme={null} > { > key?: string | null, > active?: boolean | null, > leader?: string | null, > progress?: { > hp?: number | null, > collect?: { > } | null, > rage?: number | null > } | null, > members?: { > } | null, > extra?: { > } | null > } > ``` > **leaderOnly full type** > > ```ts theme={null} > { > challenges?: boolean | null, > getGems?: boolean | null > } > ``` > **tasksOrder full type** > > ```ts theme={null} > { > habits?: string[] | null, > dailys?: string[] | null, > todos?: string[] | null, > rewards?: string[] | null > } > ``` > **purchased full type** > > ```ts theme={null} > { > } > ``` > **cron full type** > > ```ts theme={null} > { > lastProcessed?: string | null > } > ``` > **archive full type** > > ```ts theme={null} > string | { > } > ``` *** ## Tags ### create `tags.create` Create a tag **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `challenge` | `boolean` | No | — | | `group` | `string` | No | — | *** ### delete `tags.delete` Permanently delete a tag **Risk:** `destructive` ```ts theme={null} await corsair.habitica.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tagId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `tags.list` List every tag on the account **Risk:** `read` ```ts theme={null} await corsair.habitica.api.tags.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > challenge?: boolean | null, > group?: string | null > }[] > ``` *** ### update `tags.update` Rename a tag **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tagId` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `challenge` | `boolean` | No | — | | `group` | `string` | No | — | *** ## Tasks ### addTag `tasks.addTag` Apply an existing tag to a task **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tasks.addTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `tagId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `type` | `string` | No | — | | `text` | `string` | No | — | | `notes` | `string` | No | — | | `alias` | `string` | No | — | | `tags` | `string[]` | No | — | | `value` | `number` | No | — | | `priority` | `number` | No | — | | `attribute` | `string` | No | — | | `userId` | `string` | No | — | | `challenge` | `object` | No | — | | `group` | `object` | No | — | | `reminders` | `object[]` | No | — | | `byHabitica` | `boolean` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `up` | `boolean` | No | — | | `down` | `boolean` | No | — | | `counterUp` | `number` | No | — | | `counterDown` | `number` | No | — | | `frequency` | `string` | No | — | | `history` | `object[]` | No | — | | `checklist` | `object[]` | No | — | | `collapseChecklist` | `boolean` | No | — | | `completed` | `boolean` | No | — | | `streak` | `number` | No | — | | `repeat` | `object` | No | — | | `everyX` | `number` | No | — | | `startDate` | `string` | No | — | | `daysOfMonth` | `number[]` | No | — | | `weeksOfMonth` | `number[]` | No | — | | `isDue` | `boolean` | No | — | | `nextDue` | `string[]` | No | — | | `yesterDaily` | `boolean` | No | — | | `date` | `string` | No | — | | `dateCompleted` | `string` | No | — | > **challenge full type** > > ```ts theme={null} > { > shortName?: string | null, > id?: string | null, > taskId?: string | null, > broken?: string | null, > winner?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > assignedDate?: string | null, > assigningUsername?: string | null, > assignedUsers?: string[] | null, > assignedUsersDetail?: { > } | null, > taskId?: string | null, > managerNotes?: string | null, > completedBy?: { > userId?: string | null, > date?: string | null > } | null, > approval?: { > required?: boolean | null, > approved?: boolean | null, > requested?: boolean | null > } | null > } > ``` > **reminders full type** > > ```ts theme={null} > { > id?: string | null, > startDate?: string | null, > time?: string | null > }[] > ``` > **history full type** > > ```ts theme={null} > { > date?: number | null, > value?: number | null, > scoredUp?: number | null, > scoredDown?: number | null, > isDue?: boolean | null, > completed?: boolean | null > }[] > ``` > **checklist full type** > > ```ts theme={null} > { > id?: string | null, > text?: string | null, > completed?: boolean | null, > linkId?: string | null > }[] > ``` > **repeat full type** > > ```ts theme={null} > { > m?: boolean | null, > t?: boolean | null, > w?: boolean | null, > th?: boolean | null, > f?: boolean | null, > s?: boolean | null, > su?: boolean | null > } > ``` *** ### create `tasks.create` Create a habit, daily, todo or reward **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `type` | `habit \| daily \| todo \| reward` | Yes | — | | `notes` | `string` | No | — | | `tags` | `string[]` | No | — | | `priority` | `number` | No | — | | `attribute` | `str \| int \| con \| per` | No | — | | `checklist` | `object[]` | No | — | | `collapseChecklist` | `boolean` | No | — | | `up` | `boolean` | No | — | | `down` | `boolean` | No | — | | `date` | `string` | No | — | | `frequency` | `daily \| weekly \| monthly \| yearly` | No | — | | `repeat` | `object` | No | — | | `everyX` | `number` | No | — | | `startDate` | `string` | No | — | | `value` | `number` | No | — | | `reminders` | `object[]` | No | — | > **checklist full type** > > ```ts theme={null} > { > text: string, > completed?: boolean > }[] > ``` > **repeat full type** > > ```ts theme={null} > { > } > ``` > **reminders full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `type` | `string` | No | — | | `text` | `string` | No | — | | `notes` | `string` | No | — | | `alias` | `string` | No | — | | `tags` | `string[]` | No | — | | `value` | `number` | No | — | | `priority` | `number` | No | — | | `attribute` | `string` | No | — | | `userId` | `string` | No | — | | `challenge` | `object` | No | — | | `group` | `object` | No | — | | `reminders` | `object[]` | No | — | | `byHabitica` | `boolean` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `up` | `boolean` | No | — | | `down` | `boolean` | No | — | | `counterUp` | `number` | No | — | | `counterDown` | `number` | No | — | | `frequency` | `string` | No | — | | `history` | `object[]` | No | — | | `checklist` | `object[]` | No | — | | `collapseChecklist` | `boolean` | No | — | | `completed` | `boolean` | No | — | | `streak` | `number` | No | — | | `repeat` | `object` | No | — | | `everyX` | `number` | No | — | | `startDate` | `string` | No | — | | `daysOfMonth` | `number[]` | No | — | | `weeksOfMonth` | `number[]` | No | — | | `isDue` | `boolean` | No | — | | `nextDue` | `string[]` | No | — | | `yesterDaily` | `boolean` | No | — | | `date` | `string` | No | — | | `dateCompleted` | `string` | No | — | > **challenge full type** > > ```ts theme={null} > { > shortName?: string | null, > id?: string | null, > taskId?: string | null, > broken?: string | null, > winner?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > assignedDate?: string | null, > assigningUsername?: string | null, > assignedUsers?: string[] | null, > assignedUsersDetail?: { > } | null, > taskId?: string | null, > managerNotes?: string | null, > completedBy?: { > userId?: string | null, > date?: string | null > } | null, > approval?: { > required?: boolean | null, > approved?: boolean | null, > requested?: boolean | null > } | null > } > ``` > **reminders full type** > > ```ts theme={null} > { > id?: string | null, > startDate?: string | null, > time?: string | null > }[] > ``` > **history full type** > > ```ts theme={null} > { > date?: number | null, > value?: number | null, > scoredUp?: number | null, > scoredDown?: number | null, > isDue?: boolean | null, > completed?: boolean | null > }[] > ``` > **checklist full type** > > ```ts theme={null} > { > id?: string | null, > text?: string | null, > completed?: boolean | null, > linkId?: string | null > }[] > ``` > **repeat full type** > > ```ts theme={null} > { > m?: boolean | null, > t?: boolean | null, > w?: boolean | null, > th?: boolean | null, > f?: boolean | null, > s?: boolean | null, > su?: boolean | null > } > ``` *** ### createChallengeTask `tasks.createChallengeTask` Add a task to a challenge **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tasks.createChallengeTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `challengeId` | `string` | Yes | — | | `text` | `string` | Yes | — | | `type` | `habit \| daily \| todo \| reward` | Yes | — | | `notes` | `string` | No | — | | `priority` | `number` | No | — | | `attribute` | `str \| int \| con \| per` | No | — | | `checklist` | `object[]` | No | — | | `up` | `boolean` | No | — | | `down` | `boolean` | No | — | | `date` | `string` | No | — | | `value` | `number` | No | — | > **checklist full type** > > ```ts theme={null} > { > text: string, > completed?: boolean > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > _id?: string | null, > type?: string | null, > text?: string | null, > notes?: string | null, > alias?: string | null, > tags?: string[] | null, > value?: number | null, > priority?: number | null, > attribute?: string | null, > userId?: string | null, > challenge?: { > shortName?: string | null, > id?: string | null, > taskId?: string | null, > broken?: string | null, > winner?: string | null > } | null, > group?: { > id?: string | null, > assignedDate?: string | null, > assigningUsername?: string | null, > assignedUsers?: string[] | null, > assignedUsersDetail?: { > } | null, > taskId?: string | null, > managerNotes?: string | null, > completedBy?: { > userId?: string | null, > date?: string | null > } | null, > approval?: { > required?: boolean | null, > approved?: boolean | null, > requested?: boolean | null > } | null > } | null, > reminders?: { > id?: string | null, > startDate?: string | null, > time?: string | null > }[] | null, > byHabitica?: boolean | null, > createdAt?: string | null, > updatedAt?: string | null, > up?: boolean | null, > down?: boolean | null, > counterUp?: number | null, > counterDown?: number | null, > frequency?: string | null, > history?: { > date?: number | null, > value?: number | null, > scoredUp?: number | null, > scoredDown?: number | null, > isDue?: boolean | null, > completed?: boolean | null > }[] | null, > checklist?: { > id?: string | null, > text?: string | null, > completed?: boolean | null, > linkId?: string | null > }[] | null, > collapseChecklist?: boolean | null, > completed?: boolean | null, > streak?: number | null, > repeat?: { > m?: boolean | null, > t?: boolean | null, > w?: boolean | null, > th?: boolean | null, > f?: boolean | null, > s?: boolean | null, > su?: boolean | null > } | null, > everyX?: number | null, > startDate?: string | null, > daysOfMonth?: number[] | null, > weeksOfMonth?: number[] | null, > isDue?: boolean | null, > nextDue?: string[] | null, > yesterDaily?: boolean | null, > date?: string | null, > dateCompleted?: string | null > }[] > ``` *** ### delete `tasks.delete` Permanently delete a task **Risk:** `destructive` ```ts theme={null} await corsair.habitica.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteChecklistItem `tasks.deleteChecklistItem` Remove a checklist item from a task **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tasks.deleteChecklistItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `itemId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `type` | `string` | No | — | | `text` | `string` | No | — | | `notes` | `string` | No | — | | `alias` | `string` | No | — | | `tags` | `string[]` | No | — | | `value` | `number` | No | — | | `priority` | `number` | No | — | | `attribute` | `string` | No | — | | `userId` | `string` | No | — | | `challenge` | `object` | No | — | | `group` | `object` | No | — | | `reminders` | `object[]` | No | — | | `byHabitica` | `boolean` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `up` | `boolean` | No | — | | `down` | `boolean` | No | — | | `counterUp` | `number` | No | — | | `counterDown` | `number` | No | — | | `frequency` | `string` | No | — | | `history` | `object[]` | No | — | | `checklist` | `object[]` | No | — | | `collapseChecklist` | `boolean` | No | — | | `completed` | `boolean` | No | — | | `streak` | `number` | No | — | | `repeat` | `object` | No | — | | `everyX` | `number` | No | — | | `startDate` | `string` | No | — | | `daysOfMonth` | `number[]` | No | — | | `weeksOfMonth` | `number[]` | No | — | | `isDue` | `boolean` | No | — | | `nextDue` | `string[]` | No | — | | `yesterDaily` | `boolean` | No | — | | `date` | `string` | No | — | | `dateCompleted` | `string` | No | — | > **challenge full type** > > ```ts theme={null} > { > shortName?: string | null, > id?: string | null, > taskId?: string | null, > broken?: string | null, > winner?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > assignedDate?: string | null, > assigningUsername?: string | null, > assignedUsers?: string[] | null, > assignedUsersDetail?: { > } | null, > taskId?: string | null, > managerNotes?: string | null, > completedBy?: { > userId?: string | null, > date?: string | null > } | null, > approval?: { > required?: boolean | null, > approved?: boolean | null, > requested?: boolean | null > } | null > } > ``` > **reminders full type** > > ```ts theme={null} > { > id?: string | null, > startDate?: string | null, > time?: string | null > }[] > ``` > **history full type** > > ```ts theme={null} > { > date?: number | null, > value?: number | null, > scoredUp?: number | null, > scoredDown?: number | null, > isDue?: boolean | null, > completed?: boolean | null > }[] > ``` > **checklist full type** > > ```ts theme={null} > { > id?: string | null, > text?: string | null, > completed?: boolean | null, > linkId?: string | null > }[] > ``` > **repeat full type** > > ```ts theme={null} > { > m?: boolean | null, > t?: boolean | null, > w?: boolean | null, > th?: boolean | null, > f?: boolean | null, > s?: boolean | null, > su?: boolean | null > } > ``` *** ### get `tasks.get` Retrieve any task by id **Risk:** `read` ```ts theme={null} await corsair.habitica.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `type` | `string` | No | — | | `text` | `string` | No | — | | `notes` | `string` | No | — | | `alias` | `string` | No | — | | `tags` | `string[]` | No | — | | `value` | `number` | No | — | | `priority` | `number` | No | — | | `attribute` | `string` | No | — | | `userId` | `string` | No | — | | `challenge` | `object` | No | — | | `group` | `object` | No | — | | `reminders` | `object[]` | No | — | | `byHabitica` | `boolean` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `up` | `boolean` | No | — | | `down` | `boolean` | No | — | | `counterUp` | `number` | No | — | | `counterDown` | `number` | No | — | | `frequency` | `string` | No | — | | `history` | `object[]` | No | — | | `checklist` | `object[]` | No | — | | `collapseChecklist` | `boolean` | No | — | | `completed` | `boolean` | No | — | | `streak` | `number` | No | — | | `repeat` | `object` | No | — | | `everyX` | `number` | No | — | | `startDate` | `string` | No | — | | `daysOfMonth` | `number[]` | No | — | | `weeksOfMonth` | `number[]` | No | — | | `isDue` | `boolean` | No | — | | `nextDue` | `string[]` | No | — | | `yesterDaily` | `boolean` | No | — | | `date` | `string` | No | — | | `dateCompleted` | `string` | No | — | > **challenge full type** > > ```ts theme={null} > { > shortName?: string | null, > id?: string | null, > taskId?: string | null, > broken?: string | null, > winner?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > assignedDate?: string | null, > assigningUsername?: string | null, > assignedUsers?: string[] | null, > assignedUsersDetail?: { > } | null, > taskId?: string | null, > managerNotes?: string | null, > completedBy?: { > userId?: string | null, > date?: string | null > } | null, > approval?: { > required?: boolean | null, > approved?: boolean | null, > requested?: boolean | null > } | null > } > ``` > **reminders full type** > > ```ts theme={null} > { > id?: string | null, > startDate?: string | null, > time?: string | null > }[] > ``` > **history full type** > > ```ts theme={null} > { > date?: number | null, > value?: number | null, > scoredUp?: number | null, > scoredDown?: number | null, > isDue?: boolean | null, > completed?: boolean | null > }[] > ``` > **checklist full type** > > ```ts theme={null} > { > id?: string | null, > text?: string | null, > completed?: boolean | null, > linkId?: string | null > }[] > ``` > **repeat full type** > > ```ts theme={null} > { > m?: boolean | null, > t?: boolean | null, > w?: boolean | null, > th?: boolean | null, > f?: boolean | null, > s?: boolean | null, > su?: boolean | null > } > ``` *** ### list `tasks.list` List the account's tasks **Risk:** `read` ```ts theme={null} await corsair.habitica.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `habits \| dailys \| todos \| rewards \| completedTodos \| _allCompletedTodos` | No | — | | `dueDate` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > _id?: string | null, > type?: string | null, > text?: string | null, > notes?: string | null, > alias?: string | null, > tags?: string[] | null, > value?: number | null, > priority?: number | null, > attribute?: string | null, > userId?: string | null, > challenge?: { > shortName?: string | null, > id?: string | null, > taskId?: string | null, > broken?: string | null, > winner?: string | null > } | null, > group?: { > id?: string | null, > assignedDate?: string | null, > assigningUsername?: string | null, > assignedUsers?: string[] | null, > assignedUsersDetail?: { > } | null, > taskId?: string | null, > managerNotes?: string | null, > completedBy?: { > userId?: string | null, > date?: string | null > } | null, > approval?: { > required?: boolean | null, > approved?: boolean | null, > requested?: boolean | null > } | null > } | null, > reminders?: { > id?: string | null, > startDate?: string | null, > time?: string | null > }[] | null, > byHabitica?: boolean | null, > createdAt?: string | null, > updatedAt?: string | null, > up?: boolean | null, > down?: boolean | null, > counterUp?: number | null, > counterDown?: number | null, > frequency?: string | null, > history?: { > date?: number | null, > value?: number | null, > scoredUp?: number | null, > scoredDown?: number | null, > isDue?: boolean | null, > completed?: boolean | null > }[] | null, > checklist?: { > id?: string | null, > text?: string | null, > completed?: boolean | null, > linkId?: string | null > }[] | null, > collapseChecklist?: boolean | null, > completed?: boolean | null, > streak?: number | null, > repeat?: { > m?: boolean | null, > t?: boolean | null, > w?: boolean | null, > th?: boolean | null, > f?: boolean | null, > s?: boolean | null, > su?: boolean | null > } | null, > everyX?: number | null, > startDate?: string | null, > daysOfMonth?: number[] | null, > weeksOfMonth?: number[] | null, > isDue?: boolean | null, > nextDue?: string[] | null, > yesterDaily?: boolean | null, > date?: string | null, > dateCompleted?: string | null > }[] > ``` *** ### listChallengeTasks `tasks.listChallengeTasks` List a challenge's tasks **Risk:** `read` ```ts theme={null} await corsair.habitica.api.tasks.listChallengeTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `challengeId` | `string` | Yes | — | | `type` | `habits \| dailys \| todos \| rewards` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > _id?: string | null, > type?: string | null, > text?: string | null, > notes?: string | null, > alias?: string | null, > tags?: string[] | null, > value?: number | null, > priority?: number | null, > attribute?: string | null, > userId?: string | null, > challenge?: { > shortName?: string | null, > id?: string | null, > taskId?: string | null, > broken?: string | null, > winner?: string | null > } | null, > group?: { > id?: string | null, > assignedDate?: string | null, > assigningUsername?: string | null, > assignedUsers?: string[] | null, > assignedUsersDetail?: { > } | null, > taskId?: string | null, > managerNotes?: string | null, > completedBy?: { > userId?: string | null, > date?: string | null > } | null, > approval?: { > required?: boolean | null, > approved?: boolean | null, > requested?: boolean | null > } | null > } | null, > reminders?: { > id?: string | null, > startDate?: string | null, > time?: string | null > }[] | null, > byHabitica?: boolean | null, > createdAt?: string | null, > updatedAt?: string | null, > up?: boolean | null, > down?: boolean | null, > counterUp?: number | null, > counterDown?: number | null, > frequency?: string | null, > history?: { > date?: number | null, > value?: number | null, > scoredUp?: number | null, > scoredDown?: number | null, > isDue?: boolean | null, > completed?: boolean | null > }[] | null, > checklist?: { > id?: string | null, > text?: string | null, > completed?: boolean | null, > linkId?: string | null > }[] | null, > collapseChecklist?: boolean | null, > completed?: boolean | null, > streak?: number | null, > repeat?: { > m?: boolean | null, > t?: boolean | null, > w?: boolean | null, > th?: boolean | null, > f?: boolean | null, > s?: boolean | null, > su?: boolean | null > } | null, > everyX?: number | null, > startDate?: string | null, > daysOfMonth?: number[] | null, > weeksOfMonth?: number[] | null, > isDue?: boolean | null, > nextDue?: string[] | null, > yesterDaily?: boolean | null, > date?: string | null, > dateCompleted?: string | null > }[] > ``` *** ### move `tasks.move` Move a task to a position in its list **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tasks.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `position` | `number` | Yes | — | **Output:** `string[]` *** ### score `tasks.score` Score a task up or down **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tasks.score({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `direction` | `up \| down` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `delta` | `number` | No | — | | `_tmp` | `object` | No | — | | `hp` | `number` | No | — | | `mp` | `number` | No | — | | `exp` | `number` | No | — | | `gp` | `number` | No | — | | `lvl` | `number` | No | — | | `class` | `string` | No | — | | `points` | `number` | No | — | | `str` | `number` | No | — | | `con` | `number` | No | — | | `int` | `number` | No | — | | `per` | `number` | No | — | | `buffs` | `object` | No | — | | `training` | `object` | No | — | > **\_tmp full type** > > ```ts theme={null} > { > } > ``` > **buffs full type** > > ```ts theme={null} > { > } > ``` > **training full type** > > ```ts theme={null} > { > } > ``` *** ### unlinkAllChallengeTasks `tasks.unlinkAllChallengeTasks` Unlink every task of a challenge, optionally deleting members' copies **Risk:** `destructive` ```ts theme={null} await corsair.habitica.api.tasks.unlinkAllChallengeTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `challengeId` | `string` | Yes | — | | `keep` | `keep-all \| remove-all` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### update `tasks.update` Update a task **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `text` | `string` | No | — | | `notes` | `string` | No | — | | `tags` | `string[]` | No | — | | `priority` | `number` | No | — | | `attribute` | `str \| int \| con \| per` | No | — | | `collapseChecklist` | `boolean` | No | — | | `checklist` | `object[]` | No | — | | `up` | `boolean` | No | — | | `down` | `boolean` | No | — | | `date` | `string` | No | — | | `frequency` | `daily \| weekly \| monthly \| yearly` | No | — | | `repeat` | `object` | No | — | | `everyX` | `number` | No | — | | `startDate` | `string` | No | — | | `value` | `number` | No | — | | `reminders` | `object[]` | No | — | > **checklist full type** > > ```ts theme={null} > { > text: string, > completed?: boolean > }[] > ``` > **repeat full type** > > ```ts theme={null} > { > } > ``` > **reminders full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `type` | `string` | No | — | | `text` | `string` | No | — | | `notes` | `string` | No | — | | `alias` | `string` | No | — | | `tags` | `string[]` | No | — | | `value` | `number` | No | — | | `priority` | `number` | No | — | | `attribute` | `string` | No | — | | `userId` | `string` | No | — | | `challenge` | `object` | No | — | | `group` | `object` | No | — | | `reminders` | `object[]` | No | — | | `byHabitica` | `boolean` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `up` | `boolean` | No | — | | `down` | `boolean` | No | — | | `counterUp` | `number` | No | — | | `counterDown` | `number` | No | — | | `frequency` | `string` | No | — | | `history` | `object[]` | No | — | | `checklist` | `object[]` | No | — | | `collapseChecklist` | `boolean` | No | — | | `completed` | `boolean` | No | — | | `streak` | `number` | No | — | | `repeat` | `object` | No | — | | `everyX` | `number` | No | — | | `startDate` | `string` | No | — | | `daysOfMonth` | `number[]` | No | — | | `weeksOfMonth` | `number[]` | No | — | | `isDue` | `boolean` | No | — | | `nextDue` | `string[]` | No | — | | `yesterDaily` | `boolean` | No | — | | `date` | `string` | No | — | | `dateCompleted` | `string` | No | — | > **challenge full type** > > ```ts theme={null} > { > shortName?: string | null, > id?: string | null, > taskId?: string | null, > broken?: string | null, > winner?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > assignedDate?: string | null, > assigningUsername?: string | null, > assignedUsers?: string[] | null, > assignedUsersDetail?: { > } | null, > taskId?: string | null, > managerNotes?: string | null, > completedBy?: { > userId?: string | null, > date?: string | null > } | null, > approval?: { > required?: boolean | null, > approved?: boolean | null, > requested?: boolean | null > } | null > } > ``` > **reminders full type** > > ```ts theme={null} > { > id?: string | null, > startDate?: string | null, > time?: string | null > }[] > ``` > **history full type** > > ```ts theme={null} > { > date?: number | null, > value?: number | null, > scoredUp?: number | null, > scoredDown?: number | null, > isDue?: boolean | null, > completed?: boolean | null > }[] > ``` > **checklist full type** > > ```ts theme={null} > { > id?: string | null, > text?: string | null, > completed?: boolean | null, > linkId?: string | null > }[] > ``` > **repeat full type** > > ```ts theme={null} > { > m?: boolean | null, > t?: boolean | null, > w?: boolean | null, > th?: boolean | null, > f?: boolean | null, > s?: boolean | null, > su?: boolean | null > } > ``` *** ### updateChecklistItem `tasks.updateChecklistItem` Update a checklist item's text **Risk:** `write` ```ts theme={null} await corsair.habitica.api.tasks.updateChecklistItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `itemId` | `string` | Yes | — | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `_id` | `string` | No | — | | `type` | `string` | No | — | | `text` | `string` | No | — | | `notes` | `string` | No | — | | `alias` | `string` | No | — | | `tags` | `string[]` | No | — | | `value` | `number` | No | — | | `priority` | `number` | No | — | | `attribute` | `string` | No | — | | `userId` | `string` | No | — | | `challenge` | `object` | No | — | | `group` | `object` | No | — | | `reminders` | `object[]` | No | — | | `byHabitica` | `boolean` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `up` | `boolean` | No | — | | `down` | `boolean` | No | — | | `counterUp` | `number` | No | — | | `counterDown` | `number` | No | — | | `frequency` | `string` | No | — | | `history` | `object[]` | No | — | | `checklist` | `object[]` | No | — | | `collapseChecklist` | `boolean` | No | — | | `completed` | `boolean` | No | — | | `streak` | `number` | No | — | | `repeat` | `object` | No | — | | `everyX` | `number` | No | — | | `startDate` | `string` | No | — | | `daysOfMonth` | `number[]` | No | — | | `weeksOfMonth` | `number[]` | No | — | | `isDue` | `boolean` | No | — | | `nextDue` | `string[]` | No | — | | `yesterDaily` | `boolean` | No | — | | `date` | `string` | No | — | | `dateCompleted` | `string` | No | — | > **challenge full type** > > ```ts theme={null} > { > shortName?: string | null, > id?: string | null, > taskId?: string | null, > broken?: string | null, > winner?: string | null > } > ``` > **group full type** > > ```ts theme={null} > { > id?: string | null, > assignedDate?: string | null, > assigningUsername?: string | null, > assignedUsers?: string[] | null, > assignedUsersDetail?: { > } | null, > taskId?: string | null, > managerNotes?: string | null, > completedBy?: { > userId?: string | null, > date?: string | null > } | null, > approval?: { > required?: boolean | null, > approved?: boolean | null, > requested?: boolean | null > } | null > } > ``` > **reminders full type** > > ```ts theme={null} > { > id?: string | null, > startDate?: string | null, > time?: string | null > }[] > ``` > **history full type** > > ```ts theme={null} > { > date?: number | null, > value?: number | null, > scoredUp?: number | null, > scoredDown?: number | null, > isDue?: boolean | null, > completed?: boolean | null > }[] > ``` > **checklist full type** > > ```ts theme={null} > { > id?: string | null, > text?: string | null, > completed?: boolean | null, > linkId?: string | null > }[] > ``` > **repeat full type** > > ```ts theme={null} > { > m?: boolean | null, > t?: boolean | null, > w?: boolean | null, > th?: boolean | null, > f?: boolean | null, > s?: boolean | null, > su?: boolean | null > } > ``` *** ## User ### addPushDevice `user.addPushDevice` Register a push-notification device **Risk:** `write` ```ts theme={null} await corsair.habitica.api.user.addPushDevice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `regId` | `string` | Yes | — | | `type` | `android \| ios` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### deleteMessage `user.deleteMessage` Permanently delete an inbox message **Risk:** `destructive` ```ts theme={null} await corsair.habitica.api.user.deleteMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deletePushDevice `user.deletePushDevice` Unregister a push-notification device **Risk:** `write` ```ts theme={null} await corsair.habitica.api.user.deletePushDevice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `regId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### equip `user.equip` Equip or unequip gear, a pet, a mount or a costume **Risk:** `write` ```ts theme={null} await corsair.habitica.api.user.equip({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `equipped \| costume \| pet \| mount \| background` | Yes | — | | `key` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `user.get` Read the account's user document **Risk:** `read` ```ts theme={null} await corsair.habitica.api.user.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userFields` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### markNotificationSeen `user.markNotificationSeen` Mark one notification as seen **Risk:** `write` ```ts theme={null} await corsair.habitica.api.user.markNotificationSeen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `notificationId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### markNotificationsSeen `user.markNotificationsSeen` Mark several notifications as seen **Risk:** `write` ```ts theme={null} await corsair.habitica.api.user.markNotificationsSeen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `notificationIds` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### movePinnedItem `user.movePinnedItem` Reorder a pinned reward **Risk:** `write` ```ts theme={null} await corsair.habitica.api.user.movePinnedItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path` | `string` | Yes | — | | `position` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### readCard `user.readCard` Mark a received card as read **Risk:** `write` ```ts theme={null} await corsair.habitica.api.user.readCard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardType` | `birthday \| greeting \| nye \| thankyou \| valentine` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### reset `user.reset` Reset the account, deleting every task and returning to level 1 **Risk:** `destructive` ```ts theme={null} await corsair.habitica.api.user.reset({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### update `user.update` Update user fields by dot path **Risk:** `write` ```ts theme={null} await corsair.habitica.api.user.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `updates` | `object` | Yes | — | > **updates full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Webhooks ### create `webhooks.create` Register an outbound webhook **Risk:** `write` ```ts theme={null} await corsair.habitica.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `label` | `string` | No | — | | `enabled` | `boolean` | No | — | | `type` | `taskActivity \| groupChatReceived \| userActivity \| questActivity` | No | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | No | — | | `label` | `string` | No | — | | `url` | `string` | No | — | | `enabled` | `boolean` | No | — | | `failures` | `number` | No | — | | `lastFailureAt` | `string` | No | — | | `options` | `object` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **options full type** > > ```ts theme={null} > { > created?: boolean | null, > updated?: boolean | null, > deleted?: boolean | null, > scored?: boolean | null, > checklistScored?: boolean | null, > groupId?: string | null, > petHatched?: boolean | null, > mountRaised?: boolean | null, > leveledUp?: boolean | null, > questStarted?: boolean | null, > questFinished?: boolean | null, > questInvited?: boolean | null > } > ``` *** ### list `webhooks.list` List the account's outbound webhooks **Risk:** `read` ```ts theme={null} await corsair.habitica.api.webhooks.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type?: string | null, > label?: string | null, > url?: string | null, > enabled?: boolean | null, > failures?: number | null, > lastFailureAt?: string | null, > options?: { > created?: boolean | null, > updated?: boolean | null, > deleted?: boolean | null, > scored?: boolean | null, > checklistScored?: boolean | null, > groupId?: string | null, > petHatched?: boolean | null, > mountRaised?: boolean | null, > leveledUp?: boolean | null, > questStarted?: boolean | null, > questFinished?: boolean | null, > questInvited?: boolean | null > } | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ### subscribe `webhooks.subscribe` Enable an existing webhook **Risk:** `write` ```ts theme={null} await corsair.habitica.api.webhooks.subscribe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | No | — | | `label` | `string` | No | — | | `url` | `string` | No | — | | `enabled` | `boolean` | No | — | | `failures` | `number` | No | — | | `lastFailureAt` | `string` | No | — | | `options` | `object` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **options full type** > > ```ts theme={null} > { > created?: boolean | null, > updated?: boolean | null, > deleted?: boolean | null, > scored?: boolean | null, > checklistScored?: boolean | null, > groupId?: string | null, > petHatched?: boolean | null, > mountRaised?: boolean | null, > leveledUp?: boolean | null, > questStarted?: boolean | null, > questFinished?: boolean | null, > questInvited?: boolean | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/habitica/database Habitica local sync: searchable entities, `.search()` filters, and operators. The Habitica plugin syncs data locally. Use `corsair.habitica.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Challenges Path: `habitica.db.challenges.search` ```ts theme={null} const rows = await corsair.habitica.db.challenges.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `shortName` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `official` | `boolean` | equals | | `prize` | `number` | equals, gt, gte, lt, lte, in | | `memberCount` | `number` | equals, gt, gte, lt, lte, in | | `flagCount` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Groups Path: `habitica.db.groups.search` ```ts theme={null} const rows = await corsair.habitica.db.groups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `privacy` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `memberCount` | `number` | equals, gt, gte, lt, lte, in | | `challengeCount` | `number` | equals, gt, gte, lt, lte, in | | `balance` | `number` | equals, gt, gte, lt, lte, in | | `bannedWordsAllowed` | `boolean` | equals | | `chatLimitCount` | `number` | equals, gt, gte, lt, lte, in | | `logo` | `string` | equals, contains, startsWith, endsWith, in | | `leaderMessage` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `habitica.db.tags.search` ```ts theme={null} const rows = await corsair.habitica.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `challenge` | `boolean` | equals | | `group` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `habitica.db.tasks.search` ```ts theme={null} const rows = await corsair.habitica.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `number` | equals, gt, gte, lt, lte, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `attribute` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `byHabitica` | `boolean` | equals | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `up` | `boolean` | equals | | `down` | `boolean` | equals | | `counterUp` | `number` | equals, gt, gte, lt, lte, in | | `counterDown` | `number` | equals, gt, gte, lt, lte, in | | `frequency` | `string` | equals, contains, startsWith, endsWith, in | | `collapseChecklist` | `boolean` | equals | | `completed` | `boolean` | equals | | `streak` | `number` | equals, gt, gte, lt, lte, in | | `everyX` | `number` | equals, gt, gte, lt, lte, in | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `isDue` | `boolean` | equals | | `yesterDaily` | `boolean` | equals | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `dateCompleted` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `habitica.db.webhooks.search` ```ts theme={null} const rows = await corsair.habitica.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `enabled` | `boolean` | equals | | `failures` | `number` | equals, gt, gte, lt, lte, in | | `lastFailureAt` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/habitica/overview Gamified habit tracker that turns tasks and goals into a role-playing game experience. Use **Habitica** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 70 typed API operations * 5 synced entities (`challenges`, `groups`, `tags`, `tasks`, `webhooks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/habitica ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/habitica ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/habitica ``` ```bash bun theme={null} bun add corsair @corsair-dev/habitica ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { habitica } from '@corsair-dev/habitica'; export const corsair = createCorsair({ plugins: [ habitica(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} habitica() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'habitica', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`auth.login`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.habitica.api.auth.login({}); ``` **`auth.register`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.habitica.api.auth.register({}); ``` See the full list on the [API](/plugins/habitica/api) page. ## Query synced data Synced entities support `tenant.habitica.db..search()` and `.list()`: `challenges`, `groups`, `tags`, `tasks`, `webhooks`. See [Database](/plugins/habitica/database) for filters and operators. ## What's next > **[API reference](/plugins/habitica/api)** > > Every `habitica.api.*` operation with input and output types. > **[Database](/plugins/habitica/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/hackernews/api API reference for Hacker News: every `hackernews.api.*` operation with input and output types. Every `hackernews.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Items ### get `items.get` Get a HackerNews item by numeric ID **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.items.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `type` | `job \| story \| comment \| poll \| pollopt` | Yes | — | | `by` | `string` | No | — | | `title` | `string` | No | — | | `url` | `string` | No | — | | `text` | `string` | No | — | | `score` | `number` | No | — | | `time` | `number` | No | — | | `descendants` | `number` | No | — | | `parent` | `number` | No | — | | `poll` | `number` | No | — | | `kids` | `number[]` | No | — | | `parts` | `number[]` | No | — | | `dead` | `boolean` | No | — | | `deleted` | `boolean` | No | — | *** ### getMaxId `items.getMaxId` Get the current maximum item ID **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.items.getMaxId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `print` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `max_item_id` | `number` | Yes | — | *** ### getWithId `items.getWithId` Get a HackerNews item with nested comments **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.items.getWithId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `max_depth` | `number` | No | — | | `max_children` | `number` | No | — | | `truncate_text` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `found` | `boolean` | Yes | — | | `item` | `object` | No | — | | `error_message` | `string` | No | — | > **item full type** > > ```ts theme={null} > { > id: number, > type?: string, > author?: string, > title?: string | null, > url?: string | null, > text?: string | null, > points?: number | null, > parent_id?: number | null, > story_id?: number | null, > created_at?: string, > created_at_i?: number, > options?: number[], > children?: { > }[], > children_shown?: number, > max_depth_reached?: boolean, > children_truncated?: boolean, > total_children_count?: number > } > ``` *** ## Search ### getFrontpage `search.getFrontpage` Get current HackerNews frontpage posts **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.search.getFrontpage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `min_points` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `total_hits` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > objectID?: string, > title?: string, > url?: string | null, > author?: string, > points?: number | null, > story_id?: number | null, > created_at?: string, > num_comments?: number | null, > story_text?: string | null > }[] > ``` *** ### getLatest `search.getLatest` Get latest HackerNews posts **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.search.getLatest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `string[]` | No | — | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hits` | `object[]` | Yes | — | | `nbHits` | `number` | Yes | — | | `page` | `number` | Yes | — | | `nbPages` | `number` | Yes | — | | `hitsPerPage` | `number` | Yes | — | > **hits full type** > > ```ts theme={null} > { > objectID?: string, > title?: string, > url?: string | null, > author?: string, > points?: number | null, > story_id?: number | null, > story_url?: string | null, > story_title?: string | null, > comment_text?: string | null, > story_text?: string | null, > created_at?: string, > created_at_i?: number, > num_comments?: number | null, > _tags?: string[] > }[] > ``` *** ### getTodays `search.getTodays` Get today's HackerNews posts **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.search.getTodays({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `min_points` | `number` | No | — | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hits` | `object[]` | Yes | — | | `nbHits` | `number` | Yes | — | | `page` | `number` | Yes | — | | `nbPages` | `number` | Yes | — | | `hitsPerPage` | `number` | Yes | — | > **hits full type** > > ```ts theme={null} > { > objectID?: string, > title?: string, > url?: string | null, > author?: string, > points?: number | null, > story_id?: number | null, > created_at?: string, > num_comments?: number | null > }[] > ``` *** ### posts `search.posts` Full-text search HackerNews posts **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.search.posts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `tags` | `string[]` | No | — | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hits` | `object[]` | Yes | — | | `nbHits` | `number` | Yes | — | | `page` | `number` | Yes | — | | `nbPages` | `number` | Yes | — | | `hitsPerPage` | `number` | Yes | — | | `query` | `string` | Yes | — | > **hits full type** > > ```ts theme={null} > { > objectID?: string, > title?: string, > url?: string | null, > author?: string, > points?: number | null, > story_id?: number | null, > story_url?: string | null, > story_title?: string | null, > comment_text?: string | null, > story_text?: string | null, > created_at?: string, > created_at_i?: number, > num_comments?: number | null, > _tags?: string[] > }[] > ``` *** ## Stories ### getAsk `stories.getAsk` Get Ask HN story IDs **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.stories.getAsk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `print` | `pretty` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `story_ids` | `number[]` | Yes | — | *** ### getBest `stories.getBest` Get best HackerNews story IDs **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.stories.getBest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `print` | `pretty` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `story_ids` | `number[]` | Yes | — | | `count` | `number` | Yes | — | *** ### getJobs `stories.getJobs` Get HackerNews job story IDs **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.stories.getJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `print` | `pretty` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_story_ids` | `number[]` | Yes | — | *** ### getNew `stories.getNew` Get newest HackerNews story IDs **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.stories.getNew({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `print` | `pretty` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `story_ids` | `number[]` | Yes | — | *** ### getShow `stories.getShow` Get Show HN story IDs **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.stories.getShow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `print` | `pretty` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `story_ids` | `number[]` | Yes | — | *** ### getTop `stories.getTop` Get top HackerNews story IDs **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.stories.getTop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `print` | `pretty` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `story_ids` | `number[]` | Yes | — | | `count` | `number` | Yes | — | *** ## Updates ### get `updates.get` Get recently changed HackerNews items and profiles **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.updates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `print` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `number[]` | Yes | — | | `profiles` | `string[]` | Yes | — | *** ## Users ### get `users.get` Get a HackerNews user profile via Algolia **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `karma` | `number` | Yes | — | | `about` | `string` | No | — | *** ### getByUsername `users.getByUsername` Get a HackerNews user profile via Firebase **Risk:** `read` ```ts theme={null} await corsair.hackernews.api.users.getByUsername({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `karma` | `number` | Yes | — | | `created` | `number` | Yes | — | | `about` | `string` | No | — | | `submitted` | `number[]` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/hackernews/database Hacker News local sync: searchable entities, `.search()` filters, and operators. The Hacker News plugin syncs data locally. Use `corsair.hackernews.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Items Path: `hackernews.db.items.search` ```ts theme={null} const rows = await corsair.hackernews.db.items.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `by` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `time` | `number` | equals, gt, gte, lt, lte, in | | `descendants` | `number` | equals, gt, gte, lt, lte, in | | `parent` | `number` | equals, gt, gte, lt, lte, in | | `poll` | `number` | equals, gt, gte, lt, lte, in | | `dead` | `boolean` | equals | | `deleted` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `hackernews.db.users.search` ```ts theme={null} const rows = await corsair.hackernews.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `karma` | `number` | equals, gt, gte, lt, lte, in | | `about` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/hackernews/get-credentials Hacker News is a public API — no credentials required. The Hacker News API is publicly accessible and does not require authentication for read operations. No credentials are needed to use the Hacker News plugin. Simply install the plugin and start using it: ```bash theme={null} pnpm install @corsair-dev/hackernews ``` ```ts corsair.ts theme={null} import { hackernews } from "@corsair-dev/hackernews"; export const corsair = createCorsair({ plugins: [hackernews()], // ... }); ``` For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/hackernews/overview Tech news community API for stories, comments, jobs, and startup discussion content. Use **Hacker News** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 16 typed API operations * 2 synced entities (`items`, `users`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/hackernews ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/hackernews ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/hackernews ``` ```bash bun theme={null} bun add corsair @corsair-dev/hackernews ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { hackernews } from '@corsair-dev/hackernews'; export const corsair = createCorsair({ plugins: [ hackernews(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/hackernews/get-credentials). ```ts theme={null} hackernews() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'hackernews', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`items.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hackernews.api.items.get({}); ``` **`updates.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hackernews.api.updates.get({}); ``` See the full list on the [API](/plugins/hackernews/api) page. ## Query synced data Synced entities support `tenant.hackernews.db..search()` and `.list()`: `items`, `users`. See [Database](/plugins/hackernews/database) for filters and operators. ## What's next > **[API reference](/plugins/hackernews/api)** > > Every `hackernews.api.*` operation with input and output types. > **[Database](/plugins/hackernews/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/hackernews/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/harvest/api API reference for Harvest: every `harvest.api.*` operation with input and output types. Every `harvest.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Clients ### create `clients.create` Create a client **Risk:** `write` ```ts theme={null} await corsair.harvest.api.clients.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `is_active` | `boolean` | No | — | | `address` | `string` | No | — | | `currency` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `is_active` | `boolean` | No | — | | `address` | `string` | No | — | | `statement_key` | `string` | No | — | | `currency` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### delete `clients.delete` Delete a client **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.clients.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### get `clients.get` Get a client by id **Risk:** `read` ```ts theme={null} await corsair.harvest.api.clients.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `is_active` | `boolean` | No | — | | `address` | `string` | No | — | | `statement_key` | `string` | No | — | | `currency` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### list `clients.list` List clients **Risk:** `read` ```ts theme={null} await corsair.harvest.api.clients.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `is_active` | `boolean` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `clients` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **clients full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > is_active?: boolean | null, > address?: string | null, > statement_key?: string | null, > currency?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### update `clients.update` Update a client **Risk:** `write` ```ts theme={null} await corsair.harvest.api.clients.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | — | | `name` | `string` | No | — | | `is_active` | `boolean` | No | — | | `address` | `string` | No | — | | `currency` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `is_active` | `boolean` | No | — | | `address` | `string` | No | — | | `statement_key` | `string` | No | — | | `currency` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ## Company ### get `company.get` Get company settings **Risk:** `read` ```ts theme={null} await corsair.harvest.api.company.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `full_domain` | `string` | Yes | — | | `base_uri` | `string` | No | — | | `name` | `string` | No | — | | `is_active` | `boolean` | No | — | | `week_start_day` | `string` | No | — | | `wants_timestamp_timers` | `boolean` | No | — | | `time_format` | `string` | No | — | | `date_format` | `string` | No | — | | `plan_type` | `string` | No | — | | `clock` | `string` | No | — | | `currency_code_display` | `string` | No | — | | `currency_symbol_display` | `string` | No | — | | `decimal_symbol` | `string` | No | — | | `thousands_separator` | `string` | No | — | | `color_scheme` | `string` | No | — | | `weekly_capacity` | `number` | No | — | | `expense_feature` | `boolean` | No | — | | `invoice_feature` | `boolean` | No | — | | `estimate_feature` | `boolean` | No | — | | `approval_feature` | `boolean` | No | — | | `team_feature` | `boolean` | No | — | | `currency` | `string` | No | — | | `saml_sign_in_required` | `boolean` | No | — | | `day_entry_notes_required` | `boolean` | No | — | *** ### update `company.update` Update the writable company settings **Risk:** `write` ```ts theme={null} await corsair.harvest.api.company.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `wants_timestamp_timers` | `boolean` | No | — | | `weekly_capacity` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `full_domain` | `string` | Yes | — | | `base_uri` | `string` | No | — | | `name` | `string` | No | — | | `is_active` | `boolean` | No | — | | `week_start_day` | `string` | No | — | | `wants_timestamp_timers` | `boolean` | No | — | | `time_format` | `string` | No | — | | `date_format` | `string` | No | — | | `plan_type` | `string` | No | — | | `clock` | `string` | No | — | | `currency_code_display` | `string` | No | — | | `currency_symbol_display` | `string` | No | — | | `decimal_symbol` | `string` | No | — | | `thousands_separator` | `string` | No | — | | `color_scheme` | `string` | No | — | | `weekly_capacity` | `number` | No | — | | `expense_feature` | `boolean` | No | — | | `invoice_feature` | `boolean` | No | — | | `estimate_feature` | `boolean` | No | — | | `approval_feature` | `boolean` | No | — | | `team_feature` | `boolean` | No | — | | `currency` | `string` | No | — | | `saml_sign_in_required` | `boolean` | No | — | | `day_entry_notes_required` | `boolean` | No | — | *** ## Contacts ### create `contacts.create` Create a client contact **Risk:** `write` ```ts theme={null} await corsair.harvest.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | — | | `first_name` | `string` | Yes | — | | `last_name` | `string` | No | — | | `title` | `string` | No | — | | `email` | `string` | No | — | | `phone_office` | `string` | No | — | | `phone_mobile` | `string` | No | — | | `fax` | `string` | No | — | | `invoice_recipient_status` | `none \| recipient \| cc \| bcc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `title` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `phone_office` | `string` | No | — | | `phone_mobile` | `string` | No | — | | `fax` | `string` | No | — | | `invoice_recipient_status` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### delete `contacts.delete` Delete a client contact **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### list `contacts.list` List client contacts **Risk:** `read` ```ts theme={null} await corsair.harvest.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **contacts full type** > > ```ts theme={null} > { > id: number, > client?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > title?: string | null, > first_name?: string | null, > last_name?: string | null, > email?: string | null, > phone_office?: string | null, > phone_mobile?: string | null, > fax?: string | null, > invoice_recipient_status?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### update `contacts.update` Update a client contact **Risk:** `write` ```ts theme={null} await corsair.harvest.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `title` | `string` | No | — | | `email` | `string` | No | — | | `phone_office` | `string` | No | — | | `phone_mobile` | `string` | No | — | | `fax` | `string` | No | — | | `invoice_recipient_status` | `none \| recipient \| cc \| bcc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `title` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `phone_office` | `string` | No | — | | `phone_mobile` | `string` | No | — | | `fax` | `string` | No | — | | `invoice_recipient_status` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ## Estimates ### create `estimates.create` Create a draft estimate **Risk:** `write` ```ts theme={null} await corsair.harvest.api.estimates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `currency` | `string` | No | — | | `issue_date` | `string` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `discount` | `number` | No | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > id?: number, > kind: string, > description?: string, > quantity?: number, > unit_price: number, > taxed?: boolean, > taxed2?: boolean, > project_id?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `line_items` | `object[]` | No | — | | `creator` | `object` | No | — | | `client_key` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `amount` | `number` | No | — | | `tax` | `number` | No | — | | `tax_amount` | `number` | No | — | | `tax2` | `number` | No | — | | `tax2_amount` | `number` | No | — | | `discount` | `number` | No | — | | `discount_amount` | `number` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `currency` | `string` | No | — | | `state` | `string` | No | — | | `issue_date` | `string` | No | — | | `sent_at` | `string` | No | — | | `accepted_at` | `string` | No | — | | `declined_at` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: number | null, > kind?: string | null, > description?: string | null, > quantity?: number | null, > unit_price?: number | null, > amount?: number | null, > taxed?: boolean | null, > taxed2?: boolean | null, > project?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null > }[] > ``` > **creator full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### createItemCategory `estimates.createItemCategory` Create an estimate item category **Risk:** `write` ```ts theme={null} await corsair.harvest.api.estimates.createItemCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### createMessage `estimates.createMessage` Create an estimate message; event\_type "send" emails the client **Risk:** `write` ```ts theme={null} await corsair.harvest.api.estimates.createMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `estimate_id` | `number` | Yes | — | | `event_type` | `send \| accept \| decline \| re-open` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `send_me_a_copy` | `boolean` | No | — | | `recipients` | `object[]` | No | — | > **recipients full type** > > ```ts theme={null} > { > name?: string, > email: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `sent_by` | `string` | No | — | | `sent_by_email` | `string` | No | — | | `sent_from` | `string` | No | — | | `sent_from_email` | `string` | No | — | | `send_me_a_copy` | `boolean` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `event_type` | `string` | No | — | | `recipients` | `object[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **recipients full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null > }[] > ``` *** ### delete `estimates.delete` Delete an estimate **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.estimates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `estimate_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### deleteMessage `estimates.deleteMessage` Delete an estimate message **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.estimates.deleteMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `estimate_id` | `number` | Yes | — | | `message_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### get `estimates.get` Get an estimate by id **Risk:** `read` ```ts theme={null} await corsair.harvest.api.estimates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `estimate_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `line_items` | `object[]` | No | — | | `creator` | `object` | No | — | | `client_key` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `amount` | `number` | No | — | | `tax` | `number` | No | — | | `tax_amount` | `number` | No | — | | `tax2` | `number` | No | — | | `tax2_amount` | `number` | No | — | | `discount` | `number` | No | — | | `discount_amount` | `number` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `currency` | `string` | No | — | | `state` | `string` | No | — | | `issue_date` | `string` | No | — | | `sent_at` | `string` | No | — | | `accepted_at` | `string` | No | — | | `declined_at` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: number | null, > kind?: string | null, > description?: string | null, > quantity?: number | null, > unit_price?: number | null, > amount?: number | null, > taxed?: boolean | null, > taxed2?: boolean | null, > project?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null > }[] > ``` > **creator full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### listMessages `estimates.listMessages` List the messages recorded against an estimate **Risk:** `read` ```ts theme={null} await corsair.harvest.api.estimates.listMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `estimate_id` | `number` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `estimate_messages` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **estimate\_messages full type** > > ```ts theme={null} > { > id?: number | null, > sent_by?: string | null, > sent_by_email?: string | null, > sent_from?: string | null, > sent_from_email?: string | null, > send_me_a_copy?: boolean | null, > subject?: string | null, > body?: string | null, > event_type?: string | null, > recipients?: { > name?: string | null, > email?: string | null > }[] | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### update `estimates.update` Update an estimate **Risk:** `write` ```ts theme={null} await corsair.harvest.api.estimates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `estimate_id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `currency` | `string` | No | — | | `issue_date` | `string` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `discount` | `number` | No | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > id?: number, > kind: string, > description?: string, > quantity?: number, > unit_price: number, > taxed?: boolean, > taxed2?: boolean, > project_id?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `line_items` | `object[]` | No | — | | `creator` | `object` | No | — | | `client_key` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `amount` | `number` | No | — | | `tax` | `number` | No | — | | `tax_amount` | `number` | No | — | | `tax2` | `number` | No | — | | `tax2_amount` | `number` | No | — | | `discount` | `number` | No | — | | `discount_amount` | `number` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `currency` | `string` | No | — | | `state` | `string` | No | — | | `issue_date` | `string` | No | — | | `sent_at` | `string` | No | — | | `accepted_at` | `string` | No | — | | `declined_at` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: number | null, > kind?: string | null, > description?: string | null, > quantity?: number | null, > unit_price?: number | null, > amount?: number | null, > taxed?: boolean | null, > taxed2?: boolean | null, > project?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null > }[] > ``` > **creator full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### updateItemCategory `estimates.updateItemCategory` Rename an estimate item category **Risk:** `write` ```ts theme={null} await corsair.harvest.api.estimates.updateItemCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `estimate_item_category_id` | `number` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ## Expenses ### create `expenses.create` Record an expense against a project **Risk:** `write` ```ts theme={null} await corsair.harvest.api.expenses.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | — | | `expense_category_id` | `number` | Yes | — | | `spent_date` | `string` | Yes | — | | `user_id` | `number` | No | — | | `units` | `number` | No | — | | `total_cost` | `number` | No | — | | `notes` | `string` | No | — | | `billable` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `spent_date` | `string` | No | — | | `notes` | `string` | No | — | | `total_cost` | `number` | No | — | | `units` | `number` | No | — | | `billable` | `boolean` | No | — | | `receipt` | `object` | No | — | | `approval_status` | `string` | No | — | | `is_closed` | `boolean` | No | — | | `is_locked` | `boolean` | No | — | | `is_explicitly_locked` | `boolean` | No | — | | `is_billed` | `boolean` | No | — | | `locked_reason` | `string` | No | — | | `reimbursement` | `boolean` | No | — | | `user` | `object` | No | — | | `client` | `object` | No | — | | `project` | `object` | No | — | | `expense_category` | `object` | No | — | | `user_assignment` | `object` | No | — | | `invoice` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **receipt full type** > > ```ts theme={null} > { > url?: string | null, > file_name?: string | null, > file_size?: number | null, > content_type?: string | null > } > ``` > **user full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **expense\_category full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **user\_assignment full type** > > ```ts theme={null} > { > id?: number | null, > is_project_manager?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > use_default_rates?: boolean | null, > created_at?: string | null, > updated_at?: string | null > } > ``` > **invoice full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### listCategories `expenses.listCategories` List expense categories **Risk:** `read` ```ts theme={null} await corsair.harvest.api.expenses.listCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `is_active` | `boolean` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `expense_categories` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **expense\_categories full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > unit_name?: string | null, > unit_price?: number | null, > is_active?: boolean | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### update `expenses.update` Update an expense **Risk:** `write` ```ts theme={null} await corsair.harvest.api.expenses.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `expense_id` | `number` | Yes | — | | `project_id` | `number` | No | — | | `expense_category_id` | `number` | No | — | | `spent_date` | `string` | No | — | | `units` | `number` | No | — | | `total_cost` | `number` | No | — | | `notes` | `string` | No | — | | `billable` | `boolean` | No | — | | `delete_receipt` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `spent_date` | `string` | No | — | | `notes` | `string` | No | — | | `total_cost` | `number` | No | — | | `units` | `number` | No | — | | `billable` | `boolean` | No | — | | `receipt` | `object` | No | — | | `approval_status` | `string` | No | — | | `is_closed` | `boolean` | No | — | | `is_locked` | `boolean` | No | — | | `is_explicitly_locked` | `boolean` | No | — | | `is_billed` | `boolean` | No | — | | `locked_reason` | `string` | No | — | | `reimbursement` | `boolean` | No | — | | `user` | `object` | No | — | | `client` | `object` | No | — | | `project` | `object` | No | — | | `expense_category` | `object` | No | — | | `user_assignment` | `object` | No | — | | `invoice` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **receipt full type** > > ```ts theme={null} > { > url?: string | null, > file_name?: string | null, > file_size?: number | null, > content_type?: string | null > } > ``` > **user full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **expense\_category full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **user\_assignment full type** > > ```ts theme={null} > { > id?: number | null, > is_project_manager?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > use_default_rates?: boolean | null, > created_at?: string | null, > updated_at?: string | null > } > ``` > **invoice full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ## Invoices ### create `invoices.create` Create a draft invoice **Risk:** `write` ```ts theme={null} await corsair.harvest.api.invoices.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | — | | `retainer_id` | `number` | No | — | | `estimate_id` | `number` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `currency` | `string` | No | — | | `issue_date` | `string` | No | — | | `due_date` | `string` | No | — | | `payment_term` | `string` | No | — | | `payment_options` | `ach \| credit_card \| paypal[]` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `discount` | `number` | No | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > id?: number, > kind: string, > description?: string, > quantity?: number, > unit_price: number, > taxed?: boolean, > taxed2?: boolean, > project_id?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `line_items` | `object[]` | No | — | | `estimate` | `object` | No | — | | `retainer` | `object` | No | — | | `creator` | `object` | No | — | | `client_key` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `amount` | `number` | No | — | | `due_amount` | `number` | No | — | | `tax` | `number` | No | — | | `tax_amount` | `number` | No | — | | `tax2` | `number` | No | — | | `tax2_amount` | `number` | No | — | | `discount` | `number` | No | — | | `discount_amount` | `number` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `currency` | `string` | No | — | | `state` | `string` | No | — | | `period_start` | `string` | No | — | | `period_end` | `string` | No | — | | `issue_date` | `string` | No | — | | `due_date` | `string` | No | — | | `payment_term` | `string` | No | — | | `payment_options` | `string[]` | No | — | | `sent_at` | `string` | No | — | | `paid_at` | `string` | No | — | | `paid_date` | `string` | No | — | | `closed_at` | `string` | No | — | | `recurring_invoice_id` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: number | null, > kind?: string | null, > description?: string | null, > quantity?: number | null, > unit_price?: number | null, > amount?: number | null, > taxed?: boolean | null, > taxed2?: boolean | null, > project?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null > }[] > ``` > **estimate full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **retainer full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **creator full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### createItemCategory `invoices.createItemCategory` Create an invoice item category **Risk:** `write` ```ts theme={null} await corsair.harvest.api.invoices.createItemCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `use_as_service` | `boolean` | No | — | | `use_as_expense` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### createMessage `invoices.createMessage` Create an invoice message; event\_type "send" emails the client **Risk:** `write` ```ts theme={null} await corsair.harvest.api.invoices.createMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | | `event_type` | `send \| close \| re-open \| draft` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `include_link_to_client_invoice` | `boolean` | No | — | | `attach_pdf` | `boolean` | No | — | | `send_me_a_copy` | `boolean` | No | — | | `thank_you` | `boolean` | No | — | | `recipients` | `object[]` | No | — | > **recipients full type** > > ```ts theme={null} > { > name?: string, > email: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `sent_by` | `string` | No | — | | `sent_by_email` | `string` | No | — | | `sent_from` | `string` | No | — | | `sent_from_email` | `string` | No | — | | `include_link_to_client_invoice` | `boolean` | No | — | | `send_me_a_copy` | `boolean` | No | — | | `thank_you` | `boolean` | No | — | | `reminder` | `boolean` | No | — | | `send_reminder_on` | `string` | No | — | | `attach_pdf` | `boolean` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `event_type` | `string` | No | — | | `recipients` | `object[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **recipients full type** > > ```ts theme={null} > { > name?: string | null, > email?: string | null > }[] > ``` *** ### createPayment `invoices.createPayment` Record a payment against an invoice **Risk:** `write` ```ts theme={null} await corsair.harvest.api.invoices.createPayment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | | `amount` | `number` | Yes | — | | `paid_at` | `string` | No | — | | `paid_date` | `string` | No | — | | `notes` | `string` | No | — | | `send_thank_you` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `amount` | `number` | No | — | | `paid_at` | `string` | No | — | | `paid_date` | `string` | No | — | | `recorded_by` | `string` | No | — | | `recorded_by_email` | `string` | No | — | | `notes` | `string` | No | — | | `transaction_id` | `string` | No | — | | `payment_gateway` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **payment\_gateway full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### delete `invoices.delete` Delete an invoice **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.invoices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### deleteItemCategory `invoices.deleteItemCategory` Delete an unused invoice item category **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.invoices.deleteItemCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_item_category_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### deleteMessage `invoices.deleteMessage` Delete an invoice message **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.invoices.deleteMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | | `message_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### deletePayment `invoices.deletePayment` Delete a recorded payment **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.invoices.deletePayment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | | `payment_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### get `invoices.get` Get an invoice by id **Risk:** `read` ```ts theme={null} await corsair.harvest.api.invoices.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `line_items` | `object[]` | No | — | | `estimate` | `object` | No | — | | `retainer` | `object` | No | — | | `creator` | `object` | No | — | | `client_key` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `amount` | `number` | No | — | | `due_amount` | `number` | No | — | | `tax` | `number` | No | — | | `tax_amount` | `number` | No | — | | `tax2` | `number` | No | — | | `tax2_amount` | `number` | No | — | | `discount` | `number` | No | — | | `discount_amount` | `number` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `currency` | `string` | No | — | | `state` | `string` | No | — | | `period_start` | `string` | No | — | | `period_end` | `string` | No | — | | `issue_date` | `string` | No | — | | `due_date` | `string` | No | — | | `payment_term` | `string` | No | — | | `payment_options` | `string[]` | No | — | | `sent_at` | `string` | No | — | | `paid_at` | `string` | No | — | | `paid_date` | `string` | No | — | | `closed_at` | `string` | No | — | | `recurring_invoice_id` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: number | null, > kind?: string | null, > description?: string | null, > quantity?: number | null, > unit_price?: number | null, > amount?: number | null, > taxed?: boolean | null, > taxed2?: boolean | null, > project?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null > }[] > ``` > **estimate full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **retainer full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **creator full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### list `invoices.list` List invoices **Risk:** `read` ```ts theme={null} await corsair.harvest.api.invoices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | | `state` | `draft \| open \| paid \| closed` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `invoices` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **invoices full type** > > ```ts theme={null} > { > id: number, > client?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > line_items?: { > id?: number | null, > kind?: string | null, > description?: string | null, > quantity?: number | null, > unit_price?: number | null, > amount?: number | null, > taxed?: boolean | null, > taxed2?: boolean | null, > project?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null > }[] | null, > estimate?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > retainer?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > creator?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > client_key?: string | null, > number?: string | null, > purchase_order?: string | null, > amount?: number | null, > due_amount?: number | null, > tax?: number | null, > tax_amount?: number | null, > tax2?: number | null, > tax2_amount?: number | null, > discount?: number | null, > discount_amount?: number | null, > subject?: string | null, > notes?: string | null, > currency?: string | null, > state?: string | null, > period_start?: string | null, > period_end?: string | null, > issue_date?: string | null, > due_date?: string | null, > payment_term?: string | null, > payment_options?: string[] | null, > sent_at?: string | null, > paid_at?: string | null, > paid_date?: string | null, > closed_at?: string | null, > recurring_invoice_id?: number | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### listItemCategories `invoices.listItemCategories` List invoice item categories **Risk:** `read` ```ts theme={null} await corsair.harvest.api.invoices.listItemCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `invoice_item_categories` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **invoice\_item\_categories full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > use_as_service?: boolean | null, > use_as_expense?: boolean | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### listMessages `invoices.listMessages` List the messages recorded against an invoice **Risk:** `read` ```ts theme={null} await corsair.harvest.api.invoices.listMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `invoice_messages` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **invoice\_messages full type** > > ```ts theme={null} > { > id?: number | null, > sent_by?: string | null, > sent_by_email?: string | null, > sent_from?: string | null, > sent_from_email?: string | null, > include_link_to_client_invoice?: boolean | null, > send_me_a_copy?: boolean | null, > thank_you?: boolean | null, > reminder?: boolean | null, > send_reminder_on?: string | null, > attach_pdf?: boolean | null, > subject?: string | null, > body?: string | null, > event_type?: string | null, > recipients?: { > name?: string | null, > email?: string | null > }[] | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### listPayments `invoices.listPayments` List payments recorded against an invoice **Risk:** `read` ```ts theme={null} await corsair.harvest.api.invoices.listPayments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `invoice_payments` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **invoice\_payments full type** > > ```ts theme={null} > { > id?: number | null, > amount?: number | null, > paid_at?: string | null, > paid_date?: string | null, > recorded_by?: string | null, > recorded_by_email?: string | null, > notes?: string | null, > transaction_id?: string | null, > payment_gateway?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### update `invoices.update` Update an invoice **Risk:** `write` ```ts theme={null} await corsair.harvest.api.invoices.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `retainer_id` | `number` | No | — | | `estimate_id` | `number` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `currency` | `string` | No | — | | `issue_date` | `string` | No | — | | `due_date` | `string` | No | — | | `payment_term` | `string` | No | — | | `payment_options` | `ach \| credit_card \| paypal[]` | No | — | | `tax` | `number` | No | — | | `tax2` | `number` | No | — | | `discount` | `number` | No | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > id?: number, > kind: string, > description?: string, > quantity?: number, > unit_price: number, > taxed?: boolean, > taxed2?: boolean, > project_id?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `line_items` | `object[]` | No | — | | `estimate` | `object` | No | — | | `retainer` | `object` | No | — | | `creator` | `object` | No | — | | `client_key` | `string` | No | — | | `number` | `string` | No | — | | `purchase_order` | `string` | No | — | | `amount` | `number` | No | — | | `due_amount` | `number` | No | — | | `tax` | `number` | No | — | | `tax_amount` | `number` | No | — | | `tax2` | `number` | No | — | | `tax2_amount` | `number` | No | — | | `discount` | `number` | No | — | | `discount_amount` | `number` | No | — | | `subject` | `string` | No | — | | `notes` | `string` | No | — | | `currency` | `string` | No | — | | `state` | `string` | No | — | | `period_start` | `string` | No | — | | `period_end` | `string` | No | — | | `issue_date` | `string` | No | — | | `due_date` | `string` | No | — | | `payment_term` | `string` | No | — | | `payment_options` | `string[]` | No | — | | `sent_at` | `string` | No | — | | `paid_at` | `string` | No | — | | `paid_date` | `string` | No | — | | `closed_at` | `string` | No | — | | `recurring_invoice_id` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: number | null, > kind?: string | null, > description?: string | null, > quantity?: number | null, > unit_price?: number | null, > amount?: number | null, > taxed?: boolean | null, > taxed2?: boolean | null, > project?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null > }[] > ``` > **estimate full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **retainer full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **creator full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ## Projects ### create `projects.create` Create a project **Risk:** `write` ```ts theme={null} await corsair.harvest.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `client_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `is_billable` | `boolean` | Yes | — | | `bill_by` | `Project \| Tasks \| People \| none` | Yes | — | | `budget_by` | `project \| project_cost \| task \| task_fees \| person \| none` | Yes | — | | `code` | `string` | No | — | | `is_active` | `boolean` | No | — | | `is_fixed_fee` | `boolean` | No | — | | `hourly_rate` | `number` | No | — | | `budget` | `number` | No | — | | `budget_is_monthly` | `boolean` | No | — | | `notify_when_over_budget` | `boolean` | No | — | | `over_budget_notification_percentage` | `number` | No | — | | `show_budget_to_all` | `boolean` | No | — | | `cost_budget` | `number` | No | — | | `cost_budget_include_expenses` | `boolean` | No | — | | `fee` | `number` | No | — | | `notes` | `string` | No | — | | `starts_on` | `string` | No | — | | `ends_on` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `name` | `string` | No | — | | `code` | `string` | No | — | | `is_active` | `boolean` | No | — | | `is_billable` | `boolean` | No | — | | `is_fixed_fee` | `boolean` | No | — | | `bill_by` | `string` | No | — | | `hourly_rate` | `number` | No | — | | `budget_by` | `string` | No | — | | `budget_is_monthly` | `boolean` | No | — | | `budget` | `number` | No | — | | `cost_budget` | `number` | No | — | | `cost_budget_include_expenses` | `boolean` | No | — | | `notify_when_over_budget` | `boolean` | No | — | | `over_budget_notification_percentage` | `number` | No | — | | `over_budget_notification_date` | `string` | No | — | | `show_budget_to_all` | `boolean` | No | — | | `fee` | `number` | No | — | | `notes` | `string` | No | — | | `starts_on` | `string` | No | — | | `ends_on` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `currency` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### delete `projects.delete` Delete a project and its time entries and expenses **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### get `projects.get` Get a project by id **Risk:** `read` ```ts theme={null} await corsair.harvest.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `name` | `string` | No | — | | `code` | `string` | No | — | | `is_active` | `boolean` | No | — | | `is_billable` | `boolean` | No | — | | `is_fixed_fee` | `boolean` | No | — | | `bill_by` | `string` | No | — | | `hourly_rate` | `number` | No | — | | `budget_by` | `string` | No | — | | `budget_is_monthly` | `boolean` | No | — | | `budget` | `number` | No | — | | `cost_budget` | `number` | No | — | | `cost_budget_include_expenses` | `boolean` | No | — | | `notify_when_over_budget` | `boolean` | No | — | | `over_budget_notification_percentage` | `number` | No | — | | `over_budget_notification_date` | `string` | No | — | | `show_budget_to_all` | `boolean` | No | — | | `fee` | `number` | No | — | | `notes` | `string` | No | — | | `starts_on` | `string` | No | — | | `ends_on` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `currency` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ### list `projects.list` List projects **Risk:** `read` ```ts theme={null} await corsair.harvest.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `is_active` | `boolean` | No | — | | `client_id` | `number` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projects` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **projects full type** > > ```ts theme={null} > { > id: number, > client?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > name?: string | null, > code?: string | null, > is_active?: boolean | null, > is_billable?: boolean | null, > is_fixed_fee?: boolean | null, > bill_by?: string | null, > hourly_rate?: number | null, > budget_by?: string | null, > budget_is_monthly?: boolean | null, > budget?: number | null, > cost_budget?: number | null, > cost_budget_include_expenses?: boolean | null, > notify_when_over_budget?: boolean | null, > over_budget_notification_percentage?: number | null, > over_budget_notification_date?: string | null, > show_budget_to_all?: boolean | null, > fee?: number | null, > notes?: string | null, > starts_on?: string | null, > ends_on?: string | null, > created_at?: string | null, > updated_at?: string | null, > currency?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### update `projects.update` Update a project **Risk:** `write` ```ts theme={null} await corsair.harvest.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | — | | `client_id` | `number` | No | — | | `name` | `string` | No | — | | `code` | `string` | No | — | | `is_active` | `boolean` | No | — | | `is_billable` | `boolean` | No | — | | `is_fixed_fee` | `boolean` | No | — | | `bill_by` | `Project \| Tasks \| People \| none` | No | — | | `budget_by` | `project \| project_cost \| task \| task_fees \| person \| none` | No | — | | `hourly_rate` | `number` | No | — | | `budget` | `number` | No | — | | `budget_is_monthly` | `boolean` | No | — | | `notify_when_over_budget` | `boolean` | No | — | | `over_budget_notification_percentage` | `number` | No | — | | `show_budget_to_all` | `boolean` | No | — | | `cost_budget` | `number` | No | — | | `cost_budget_include_expenses` | `boolean` | No | — | | `fee` | `number` | No | — | | `notes` | `string` | No | — | | `starts_on` | `string` | No | — | | `ends_on` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `client` | `object` | No | — | | `name` | `string` | No | — | | `code` | `string` | No | — | | `is_active` | `boolean` | No | — | | `is_billable` | `boolean` | No | — | | `is_fixed_fee` | `boolean` | No | — | | `bill_by` | `string` | No | — | | `hourly_rate` | `number` | No | — | | `budget_by` | `string` | No | — | | `budget_is_monthly` | `boolean` | No | — | | `budget` | `number` | No | — | | `cost_budget` | `number` | No | — | | `cost_budget_include_expenses` | `boolean` | No | — | | `notify_when_over_budget` | `boolean` | No | — | | `over_budget_notification_percentage` | `number` | No | — | | `over_budget_notification_date` | `string` | No | — | | `show_budget_to_all` | `boolean` | No | — | | `fee` | `number` | No | — | | `notes` | `string` | No | — | | `starts_on` | `string` | No | — | | `ends_on` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `currency` | `string` | No | — | > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` *** ## Tasks ### create `tasks.create` Create a task **Risk:** `write` ```ts theme={null} await corsair.harvest.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `billable_by_default` | `boolean` | No | — | | `default_hourly_rate` | `number` | No | — | | `is_default` | `boolean` | No | — | | `is_active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `billable_by_default` | `boolean` | No | — | | `default_hourly_rate` | `number` | No | — | | `is_default` | `boolean` | No | — | | `is_active` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### delete `tasks.delete` Delete a task **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### get `tasks.get` Get a task by id **Risk:** `read` ```ts theme={null} await corsair.harvest.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `billable_by_default` | `boolean` | No | — | | `default_hourly_rate` | `number` | No | — | | `is_default` | `boolean` | No | — | | `is_active` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### list `tasks.list` List tasks **Risk:** `read` ```ts theme={null} await corsair.harvest.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `is_active` | `boolean` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tasks` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **tasks full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > billable_by_default?: boolean | null, > default_hourly_rate?: number | null, > is_default?: boolean | null, > is_active?: boolean | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### update `tasks.update` Update a task **Risk:** `write` ```ts theme={null} await corsair.harvest.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `number` | Yes | — | | `name` | `string` | No | — | | `billable_by_default` | `boolean` | No | — | | `default_hourly_rate` | `number` | No | — | | `is_default` | `boolean` | No | — | | `is_active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `billable_by_default` | `boolean` | No | — | | `default_hourly_rate` | `number` | No | — | | `is_default` | `boolean` | No | — | | `is_active` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ## Time Entries ### create `timeEntries.create` Log time against a project and task **Risk:** `write` ```ts theme={null} await corsair.harvest.api.timeEntries.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | — | | `task_id` | `number` | Yes | — | | `spent_date` | `string` | Yes | — | | `user_id` | `number` | No | — | | `hours` | `number` | No | — | | `started_time` | `string` | No | — | | `ended_time` | `string` | No | — | | `notes` | `string` | No | — | | `external_reference` | `object` | No | — | > **external\_reference full type** > > ```ts theme={null} > { > id?: string, > group_id?: string, > account_id?: string, > permalink?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `spent_date` | `string` | No | — | | `hours` | `number` | No | — | | `hours_without_timer` | `number` | No | — | | `rounded_hours` | `number` | No | — | | `notes` | `string` | No | — | | `is_locked` | `boolean` | No | — | | `is_explicitly_locked` | `boolean` | No | — | | `locked_reason` | `string` | No | — | | `approval_status` | `string` | No | — | | `is_closed` | `boolean` | No | — | | `is_billed` | `boolean` | No | — | | `timer_started_at` | `string` | No | — | | `started_time` | `string` | No | — | | `ended_time` | `string` | No | — | | `is_running` | `boolean` | No | — | | `billable` | `boolean` | No | — | | `budgeted` | `boolean` | No | — | | `billable_rate` | `number` | No | — | | `cost_rate` | `number` | No | — | | `user` | `object` | No | — | | `client` | `object` | No | — | | `project` | `object` | No | — | | `task` | `object` | No | — | | `user_assignment` | `object` | No | — | | `task_assignment` | `object` | No | — | | `invoice` | `object` | No | — | | `external_reference` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **task full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **user\_assignment full type** > > ```ts theme={null} > { > id?: number | null, > is_project_manager?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > use_default_rates?: boolean | null, > created_at?: string | null, > updated_at?: string | null > } > ``` > **task\_assignment full type** > > ```ts theme={null} > { > id?: number | null, > billable?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > created_at?: string | null, > updated_at?: string | null > } > ``` > **invoice full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **external\_reference full type** > > ```ts theme={null} > { > id?: string | null, > group_id?: string | null, > account_id?: string | null, > permalink?: string | null, > service?: string | null, > service_icon_url?: string | null > } > ``` *** ### delete `timeEntries.delete` Delete a time entry **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.timeEntries.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `time_entry_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### get `timeEntries.get` Get a time entry by id **Risk:** `read` ```ts theme={null} await corsair.harvest.api.timeEntries.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `time_entry_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `spent_date` | `string` | No | — | | `hours` | `number` | No | — | | `hours_without_timer` | `number` | No | — | | `rounded_hours` | `number` | No | — | | `notes` | `string` | No | — | | `is_locked` | `boolean` | No | — | | `is_explicitly_locked` | `boolean` | No | — | | `locked_reason` | `string` | No | — | | `approval_status` | `string` | No | — | | `is_closed` | `boolean` | No | — | | `is_billed` | `boolean` | No | — | | `timer_started_at` | `string` | No | — | | `started_time` | `string` | No | — | | `ended_time` | `string` | No | — | | `is_running` | `boolean` | No | — | | `billable` | `boolean` | No | — | | `budgeted` | `boolean` | No | — | | `billable_rate` | `number` | No | — | | `cost_rate` | `number` | No | — | | `user` | `object` | No | — | | `client` | `object` | No | — | | `project` | `object` | No | — | | `task` | `object` | No | — | | `user_assignment` | `object` | No | — | | `task_assignment` | `object` | No | — | | `invoice` | `object` | No | — | | `external_reference` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **task full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **user\_assignment full type** > > ```ts theme={null} > { > id?: number | null, > is_project_manager?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > use_default_rates?: boolean | null, > created_at?: string | null, > updated_at?: string | null > } > ``` > **task\_assignment full type** > > ```ts theme={null} > { > id?: number | null, > billable?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > created_at?: string | null, > updated_at?: string | null > } > ``` > **invoice full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **external\_reference full type** > > ```ts theme={null} > { > id?: string | null, > group_id?: string | null, > account_id?: string | null, > permalink?: string | null, > service?: string | null, > service_icon_url?: string | null > } > ``` *** ### list `timeEntries.list` List time entries **Risk:** `read` ```ts theme={null} await corsair.harvest.api.timeEntries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | No | — | | `client_id` | `number` | No | — | | `project_id` | `number` | No | — | | `task_id` | `number` | No | — | | `external_reference_id` | `string` | No | — | | `is_billed` | `boolean` | No | — | | `is_running` | `boolean` | No | — | | `approval_status` | `unsubmitted \| submitted \| approved` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `time_entries` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **time\_entries full type** > > ```ts theme={null} > { > id: number, > spent_date?: string | null, > hours?: number | null, > hours_without_timer?: number | null, > rounded_hours?: number | null, > notes?: string | null, > is_locked?: boolean | null, > is_explicitly_locked?: boolean | null, > locked_reason?: string | null, > approval_status?: string | null, > is_closed?: boolean | null, > is_billed?: boolean | null, > timer_started_at?: string | null, > started_time?: string | null, > ended_time?: string | null, > is_running?: boolean | null, > billable?: boolean | null, > budgeted?: boolean | null, > billable_rate?: number | null, > cost_rate?: number | null, > user?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > client?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > project?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > task?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > user_assignment?: { > id?: number | null, > is_project_manager?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > use_default_rates?: boolean | null, > created_at?: string | null, > updated_at?: string | null > } | null, > task_assignment?: { > id?: number | null, > billable?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > created_at?: string | null, > updated_at?: string | null > } | null, > invoice?: { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } | null, > external_reference?: { > id?: string | null, > group_id?: string | null, > account_id?: string | null, > permalink?: string | null, > service?: string | null, > service_icon_url?: string | null > } | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### update `timeEntries.update` Update a time entry **Risk:** `write` ```ts theme={null} await corsair.harvest.api.timeEntries.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `time_entry_id` | `number` | Yes | — | | `project_id` | `number` | No | — | | `task_id` | `number` | No | — | | `spent_date` | `string` | No | — | | `hours` | `number` | No | — | | `started_time` | `string` | No | — | | `ended_time` | `string` | No | — | | `notes` | `string` | No | — | | `external_reference` | `object` | No | — | > **external\_reference full type** > > ```ts theme={null} > { > id?: string, > group_id?: string, > account_id?: string, > permalink?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `spent_date` | `string` | No | — | | `hours` | `number` | No | — | | `hours_without_timer` | `number` | No | — | | `rounded_hours` | `number` | No | — | | `notes` | `string` | No | — | | `is_locked` | `boolean` | No | — | | `is_explicitly_locked` | `boolean` | No | — | | `locked_reason` | `string` | No | — | | `approval_status` | `string` | No | — | | `is_closed` | `boolean` | No | — | | `is_billed` | `boolean` | No | — | | `timer_started_at` | `string` | No | — | | `started_time` | `string` | No | — | | `ended_time` | `string` | No | — | | `is_running` | `boolean` | No | — | | `billable` | `boolean` | No | — | | `budgeted` | `boolean` | No | — | | `billable_rate` | `number` | No | — | | `cost_rate` | `number` | No | — | | `user` | `object` | No | — | | `client` | `object` | No | — | | `project` | `object` | No | — | | `task` | `object` | No | — | | `user_assignment` | `object` | No | — | | `task_assignment` | `object` | No | — | | `invoice` | `object` | No | — | | `external_reference` | `object` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **user full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **client full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **project full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **task full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **user\_assignment full type** > > ```ts theme={null} > { > id?: number | null, > is_project_manager?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > use_default_rates?: boolean | null, > created_at?: string | null, > updated_at?: string | null > } > ``` > **task\_assignment full type** > > ```ts theme={null} > { > id?: number | null, > billable?: boolean | null, > is_active?: boolean | null, > budget?: number | null, > hourly_rate?: number | null, > created_at?: string | null, > updated_at?: string | null > } > ``` > **invoice full type** > > ```ts theme={null} > { > id?: number | null, > name?: string | null, > code?: string | null, > currency?: string | null > } > ``` > **external\_reference full type** > > ```ts theme={null} > { > id?: string | null, > group_id?: string | null, > account_id?: string | null, > permalink?: string | null, > service?: string | null, > service_icon_url?: string | null > } > ``` *** ## Users ### create `users.create` Create a team member and email them an invitation **Risk:** `write` ```ts theme={null} await corsair.harvest.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `email` | `string` | Yes | — | | `timezone` | `string` | No | — | | `is_contractor` | `boolean` | No | — | | `is_active` | `boolean` | No | — | | `weekly_capacity` | `number` | No | — | | `default_hourly_rate` | `number` | No | — | | `cost_rate` | `number` | No | — | | `has_access_to_all_future_projects` | `boolean` | No | — | | `saml_exempt` | `boolean` | No | — | | `roles` | `string[]` | No | — | | `access_roles` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `telephone` | `string` | No | — | | `timezone` | `string` | No | — | | `has_access_to_all_future_projects` | `boolean` | No | — | | `is_contractor` | `boolean` | No | — | | `is_active` | `boolean` | No | — | | `saml_exempt` | `boolean` | No | — | | `weekly_capacity` | `number` | No | — | | `default_hourly_rate` | `number` | No | — | | `cost_rate` | `number` | No | — | | `roles` | `string[]` | No | — | | `access_roles` | `string[]` | No | — | | `avatar_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `employee_id` | `string` | No | — | | `calendar_integration_enabled` | `boolean` | No | — | | `calendar_integration_source` | `string` | No | — | | `can_create_projects` | `boolean` | No | — | | `permissions_claims` | `string[]` | No | — | *** ### delete `users.delete` Delete a team member **Risk:** `destructive` ```ts theme={null} await corsair.harvest.api.users.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `id` | `number` | No | — | *** ### get `users.get` Get a team member by id **Risk:** `read` ```ts theme={null} await corsair.harvest.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `telephone` | `string` | No | — | | `timezone` | `string` | No | — | | `has_access_to_all_future_projects` | `boolean` | No | — | | `is_contractor` | `boolean` | No | — | | `is_active` | `boolean` | No | — | | `saml_exempt` | `boolean` | No | — | | `weekly_capacity` | `number` | No | — | | `default_hourly_rate` | `number` | No | — | | `cost_rate` | `number` | No | — | | `roles` | `string[]` | No | — | | `access_roles` | `string[]` | No | — | | `avatar_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `employee_id` | `string` | No | — | | `calendar_integration_enabled` | `boolean` | No | — | | `calendar_integration_source` | `string` | No | — | | `can_create_projects` | `boolean` | No | — | | `permissions_claims` | `string[]` | No | — | *** ### list `users.list` List team members **Risk:** `read` ```ts theme={null} await corsair.harvest.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `is_active` | `boolean` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `updated_since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | | `per_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `total_entries` | `number` | No | — | | `next_page` | `number` | No | — | | `previous_page` | `number` | No | — | | `page` | `number` | No | — | | `links` | `object` | No | — | > **users full type** > > ```ts theme={null} > { > id: number, > first_name?: string | null, > last_name?: string | null, > email?: string | null, > telephone?: string | null, > timezone?: string | null, > has_access_to_all_future_projects?: boolean | null, > is_contractor?: boolean | null, > is_active?: boolean | null, > saml_exempt?: boolean | null, > weekly_capacity?: number | null, > default_hourly_rate?: number | null, > cost_rate?: number | null, > roles?: string[] | null, > access_roles?: string[] | null, > avatar_url?: string | null, > created_at?: string | null, > updated_at?: string | null, > employee_id?: string | null, > calendar_integration_enabled?: boolean | null, > calendar_integration_source?: string | null, > can_create_projects?: boolean | null, > permissions_claims?: string[] | null > }[] > ``` > **links full type** > > ```ts theme={null} > { > first?: string | null, > next?: string | null, > previous?: string | null, > last?: string | null > } > ``` *** ### update `users.update` Update a team member **Risk:** `write` ```ts theme={null} await corsair.harvest.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `timezone` | `string` | No | — | | `is_contractor` | `boolean` | No | — | | `is_active` | `boolean` | No | — | | `weekly_capacity` | `number` | No | — | | `default_hourly_rate` | `number` | No | — | | `cost_rate` | `number` | No | — | | `has_access_to_all_future_projects` | `boolean` | No | — | | `saml_exempt` | `boolean` | No | — | | `roles` | `string[]` | No | — | | `access_roles` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `telephone` | `string` | No | — | | `timezone` | `string` | No | — | | `has_access_to_all_future_projects` | `boolean` | No | — | | `is_contractor` | `boolean` | No | — | | `is_active` | `boolean` | No | — | | `saml_exempt` | `boolean` | No | — | | `weekly_capacity` | `number` | No | — | | `default_hourly_rate` | `number` | No | — | | `cost_rate` | `number` | No | — | | `roles` | `string[]` | No | — | | `access_roles` | `string[]` | No | — | | `avatar_url` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `employee_id` | `string` | No | — | | `calendar_integration_enabled` | `boolean` | No | — | | `calendar_integration_source` | `string` | No | — | | `can_create_projects` | `boolean` | No | — | | `permissions_claims` | `string[]` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/harvest/database Harvest local sync: searchable entities, `.search()` filters, and operators. The Harvest plugin syncs data locally. Use `corsair.harvest.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Clients Path: `harvest.db.clients.search` ```ts theme={null} const rows = await corsair.harvest.db.clients.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `is_active` | `boolean` | equals | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `statement_key` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Company Path: `harvest.db.company.search` ```ts theme={null} const rows = await corsair.harvest.db.company.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `full_domain` | `string` | equals, contains, startsWith, endsWith, in | | `base_uri` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `is_active` | `boolean` | equals | | `week_start_day` | `string` | equals, contains, startsWith, endsWith, in | | `wants_timestamp_timers` | `boolean` | equals | | `time_format` | `string` | equals, contains, startsWith, endsWith, in | | `date_format` | `string` | equals, contains, startsWith, endsWith, in | | `plan_type` | `string` | equals, contains, startsWith, endsWith, in | | `clock` | `string` | equals, contains, startsWith, endsWith, in | | `currency_code_display` | `string` | equals, contains, startsWith, endsWith, in | | `currency_symbol_display` | `string` | equals, contains, startsWith, endsWith, in | | `decimal_symbol` | `string` | equals, contains, startsWith, endsWith, in | | `thousands_separator` | `string` | equals, contains, startsWith, endsWith, in | | `color_scheme` | `string` | equals, contains, startsWith, endsWith, in | | `weekly_capacity` | `number` | equals, gt, gte, lt, lte, in | | `expense_feature` | `boolean` | equals | | `invoice_feature` | `boolean` | equals | | `estimate_feature` | `boolean` | equals | | `approval_feature` | `boolean` | equals | | `team_feature` | `boolean` | equals | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `saml_sign_in_required` | `boolean` | equals | | `day_entry_notes_required` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `harvest.db.contacts.search` ```ts theme={null} const rows = await corsair.harvest.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone_office` | `string` | equals, contains, startsWith, endsWith, in | | `phone_mobile` | `string` | equals, contains, startsWith, endsWith, in | | `fax` | `string` | equals, contains, startsWith, endsWith, in | | `invoice_recipient_status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Estimates Path: `harvest.db.estimates.search` ```ts theme={null} const rows = await corsair.harvest.db.estimates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `client_key` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `purchase_order` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `tax` | `number` | equals, gt, gte, lt, lte, in | | `tax_amount` | `number` | equals, gt, gte, lt, lte, in | | `tax2` | `number` | equals, gt, gte, lt, lte, in | | `tax2_amount` | `number` | equals, gt, gte, lt, lte, in | | `discount` | `number` | equals, gt, gte, lt, lte, in | | `discount_amount` | `number` | equals, gt, gte, lt, lte, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `issue_date` | `string` | equals, contains, startsWith, endsWith, in | | `sent_at` | `string` | equals, contains, startsWith, endsWith, in | | `accepted_at` | `string` | equals, contains, startsWith, endsWith, in | | `declined_at` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Expense Categories Path: `harvest.db.expenseCategories.search` ```ts theme={null} const rows = await corsair.harvest.db.expenseCategories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `unit_name` | `string` | equals, contains, startsWith, endsWith, in | | `unit_price` | `number` | equals, gt, gte, lt, lte, in | | `is_active` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invoice Item Categories Path: `harvest.db.invoiceItemCategories.search` ```ts theme={null} const rows = await corsair.harvest.db.invoiceItemCategories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `use_as_service` | `boolean` | equals | | `use_as_expense` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invoices Path: `harvest.db.invoices.search` ```ts theme={null} const rows = await corsair.harvest.db.invoices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `client_key` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `purchase_order` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `due_amount` | `number` | equals, gt, gte, lt, lte, in | | `tax` | `number` | equals, gt, gte, lt, lte, in | | `tax_amount` | `number` | equals, gt, gte, lt, lte, in | | `tax2` | `number` | equals, gt, gte, lt, lte, in | | `tax2_amount` | `number` | equals, gt, gte, lt, lte, in | | `discount` | `number` | equals, gt, gte, lt, lte, in | | `discount_amount` | `number` | equals, gt, gte, lt, lte, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `period_start` | `string` | equals, contains, startsWith, endsWith, in | | `period_end` | `string` | equals, contains, startsWith, endsWith, in | | `issue_date` | `string` | equals, contains, startsWith, endsWith, in | | `due_date` | `string` | equals, contains, startsWith, endsWith, in | | `payment_term` | `string` | equals, contains, startsWith, endsWith, in | | `sent_at` | `string` | equals, contains, startsWith, endsWith, in | | `paid_at` | `string` | equals, contains, startsWith, endsWith, in | | `paid_date` | `string` | equals, contains, startsWith, endsWith, in | | `closed_at` | `string` | equals, contains, startsWith, endsWith, in | | `recurring_invoice_id` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `harvest.db.projects.search` ```ts theme={null} const rows = await corsair.harvest.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `is_active` | `boolean` | equals | | `is_billable` | `boolean` | equals | | `is_fixed_fee` | `boolean` | equals | | `bill_by` | `string` | equals, contains, startsWith, endsWith, in | | `hourly_rate` | `number` | equals, gt, gte, lt, lte, in | | `budget_by` | `string` | equals, contains, startsWith, endsWith, in | | `budget_is_monthly` | `boolean` | equals | | `budget` | `number` | equals, gt, gte, lt, lte, in | | `cost_budget` | `number` | equals, gt, gte, lt, lte, in | | `cost_budget_include_expenses` | `boolean` | equals | | `notify_when_over_budget` | `boolean` | equals | | `over_budget_notification_percentage` | `number` | equals, gt, gte, lt, lte, in | | `over_budget_notification_date` | `string` | equals, contains, startsWith, endsWith, in | | `show_budget_to_all` | `boolean` | equals | | `fee` | `number` | equals, gt, gte, lt, lte, in | | `notes` | `string` | equals, contains, startsWith, endsWith, in | | `starts_on` | `string` | equals, contains, startsWith, endsWith, in | | `ends_on` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `harvest.db.tasks.search` ```ts theme={null} const rows = await corsair.harvest.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `billable_by_default` | `boolean` | equals | | `default_hourly_rate` | `number` | equals, gt, gte, lt, lte, in | | `is_default` | `boolean` | equals | | `is_active` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `harvest.db.users.search` ```ts theme={null} const rows = await corsair.harvest.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `telephone` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `has_access_to_all_future_projects` | `boolean` | equals | | `is_contractor` | `boolean` | equals | | `is_active` | `boolean` | equals | | `saml_exempt` | `boolean` | equals | | `weekly_capacity` | `number` | equals, gt, gte, lt, lte, in | | `default_hourly_rate` | `number` | equals, gt, gte, lt, lte, in | | `cost_rate` | `number` | equals, gt, gte, lt, lte, in | | `avatar_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `employee_id` | `string` | equals, contains, startsWith, endsWith, in | | `calendar_integration_enabled` | `boolean` | equals | | `calendar_integration_source` | `string` | equals, contains, startsWith, endsWith, in | | `can_create_projects` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/harvest/overview Time tracking and invoicing software for agencies, freelancers, and project billing. Use **Harvest** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 57 typed API operations * 10 synced entities (`clients`, `company`, `contacts`, `estimates`, `expenseCategories`, `invoiceItemCategories`, and 4 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/harvest ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/harvest ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/harvest ``` ```bash bun theme={null} bun add corsair @corsair-dev/harvest ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { harvest } from '@corsair-dev/harvest'; export const corsair = createCorsair({ plugins: [ harvest(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Harvest OAuth app. ```ts theme={null} harvest() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'harvest', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`clients.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.harvest.api.clients.get({}); ``` **`clients.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.harvest.api.clients.create({}); ``` See the full list on the [API](/plugins/harvest/api) page. ## Query synced data Synced entities support `tenant.harvest.db..search()` and `.list()`: `clients`, `company`, `contacts`, `estimates`, `expenseCategories`, `invoiceItemCategories`, `invoices`, `projects`, `tasks`, `users`. See [Database](/plugins/harvest/database) for filters and operators. ## What's next > **[API reference](/plugins/harvest/api)** > > Every `harvest.api.*` operation with input and output types. > **[Database](/plugins/harvest/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/hashnode/api API reference for Hashnode: every `hashnode.api.*` operation with input and output types. Every `hashnode.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Comments ### list `comments.list` List comments on a post **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `postId` | `string` | Yes | — | | `first` | `number` | Yes | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `post` | `object` | Yes | — | > **post full type** > > ```ts theme={null} > { > comments: { > edges: { > node: { > id: string, > content: { > html?: string, > markdown?: string, > text?: string > }, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > totalReactions: number, > dateAdded: string > }, > cursor: string > }[], > pageInfo: { > hasNextPage: boolean, > endCursor?: string | null > } > } > } > ``` *** ## Drafts ### create `drafts.create` Create a new draft **Risk:** `write` ```ts theme={null} await corsair.hashnode.api.drafts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `publicationId` | `string` | Yes | — | | `title` | `string` | No | — | | `subtitle` | `string` | No | — | | `contentMarkdown` | `string` | No | — | | `slug` | `string` | No | — | | `tags` | `object[]` | No | — | | `seriesId` | `string` | No | — | | `disableComments` | `boolean` | No | — | | `originalArticleURL` | `string` | No | — | | `publishedAt` | `string` | No | — | | `settings` | `object` | No | — | | `metaTags` | `object` | No | — | | `coverImageOptions` | `object` | No | — | | `publishAs` | `string` | No | — | | `coAuthors` | `string[]` | No | — | > **tags full type** > > ```ts theme={null} > { > slug: string, > name?: string > }[] > ``` > **settings full type** > > ```ts theme={null} > { > enableTableOfContent?: boolean, > delist?: boolean, > activateNewsletter?: boolean, > slugOverridden?: boolean > } > ``` > **metaTags full type** > > ```ts theme={null} > { > title?: string, > description?: string, > image?: string > } > ``` > **coverImageOptions full type** > > ```ts theme={null} > { > coverImageURL?: string, > coverImageAttribution?: string, > coverImagePhotographer?: string, > isCoverAttributionHidden?: boolean, > stickCoverToBottom?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `createDraft` | `object` | Yes | — | > **createDraft full type** > > ```ts theme={null} > { > draft: { > id: string, > title?: string | null, > subtitle?: string | null, > slug?: string | null, > content?: { > markdown?: string, > html?: string, > text?: string > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > coverImage?: { > url?: string | null, > attribution?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > publication?: { > id: string, > title: string > } | null, > series?: { > id: string, > name: string, > slug: string > } | null, > updatedAt: string, > scheduledDate?: string | null, > readTimeInMinutes?: number, > isSubmittedForReview?: boolean > } > } > ``` *** ### delete `drafts.delete` Delete a draft \[DESTRUCTIVE - IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hashnode.api.drafts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `draftId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleteDraft` | `object` | Yes | — | > **deleteDraft full type** > > ```ts theme={null} > { > draft?: { > id: string > } | null > } > ``` *** ### get `drafts.get` Get a draft by ID **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.drafts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `draft` | `object` | No | — | > **draft full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > subtitle?: string | null, > slug?: string | null, > content?: { > markdown?: string, > html?: string, > text?: string > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > coverImage?: { > url?: string | null, > attribution?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > publication?: { > id: string, > title: string > } | null, > series?: { > id: string, > name: string, > slug: string > } | null, > updatedAt: string, > scheduledDate?: string | null, > readTimeInMinutes?: number, > isSubmittedForReview?: boolean > } > ``` *** ### publish `drafts.publish` Publish a draft as a post **Risk:** `write` ```ts theme={null} await corsair.hashnode.api.drafts.publish({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `draftId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `publishDraft` | `object` | Yes | — | > **publishDraft full type** > > ```ts theme={null} > { > post: { > id: string, > title: string, > subtitle?: string | null, > slug: string, > brief: string, > url: string, > coverImage?: { > url?: string | null, > isPortrait?: boolean, > attribution?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > publication?: { > id: string, > title: string, > url?: string | null, > displayTitle?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > publishedAt: string, > updatedAt?: string | null, > readTimeInMinutes: number, > reactionCount: number, > responseCount: number, > replyCount?: number, > series?: { > id: string, > name: string, > slug: string > } | null, > featured?: boolean > } > } > ``` *** ### update `drafts.update` Update an existing draft **Risk:** `write` ```ts theme={null} await corsair.hashnode.api.drafts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `draftId` | `string` | Yes | — | | `title` | `string` | No | — | | `subtitle` | `string` | No | — | | `contentMarkdown` | `string` | No | — | | `slug` | `string` | No | — | | `tags` | `object[]` | No | — | | `seriesId` | `string` | No | — | | `disableComments` | `boolean` | No | — | | `originalArticleURL` | `string` | No | — | | `publishedAt` | `string` | No | — | | `settings` | `object` | No | — | | `metaTags` | `object` | No | — | | `coverImageOptions` | `object` | No | — | | `publishAs` | `string` | No | — | | `coAuthors` | `string[]` | No | — | > **tags full type** > > ```ts theme={null} > { > slug: string, > name?: string > }[] > ``` > **settings full type** > > ```ts theme={null} > { > enableTableOfContent?: boolean, > delist?: boolean, > activateNewsletter?: boolean, > slugOverridden?: boolean > } > ``` > **metaTags full type** > > ```ts theme={null} > { > title?: string, > description?: string, > image?: string > } > ``` > **coverImageOptions full type** > > ```ts theme={null} > { > coverImageURL?: string, > coverImageAttribution?: string, > coverImagePhotographer?: string, > isCoverAttributionHidden?: boolean, > stickCoverToBottom?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `updateDraft` | `object` | Yes | — | > **updateDraft full type** > > ```ts theme={null} > { > draft: { > id: string, > title?: string | null, > subtitle?: string | null, > slug?: string | null, > content?: { > markdown?: string, > html?: string, > text?: string > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > coverImage?: { > url?: string | null, > attribution?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > publication?: { > id: string, > title: string > } | null, > series?: { > id: string, > name: string, > slug: string > } | null, > updatedAt: string, > scheduledDate?: string | null, > readTimeInMinutes?: number, > isSubmittedForReview?: boolean > } > } > ``` *** ## Feed ### list `feed.list` Get the global feed of posts **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.feed.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | Yes | — | | `after` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > tags?: string[], > excludeTags?: string[], > publications?: string[], > excludePublications?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `feed` | `object` | Yes | — | > **feed full type** > > ```ts theme={null} > { > edges: { > node: { > id: string, > title: string, > subtitle?: string | null, > slug: string, > brief: string, > url: string, > coverImage?: { > url?: string | null, > isPortrait?: boolean, > attribution?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > publication?: { > id: string, > title: string, > url?: string | null, > displayTitle?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > publishedAt: string, > updatedAt?: string | null, > readTimeInMinutes: number, > reactionCount: number, > responseCount: number, > replyCount?: number, > series?: { > id: string, > name: string, > slug: string > } | null, > featured?: boolean > }, > cursor: string > }[], > pageInfo: { > hasNextPage: boolean, > endCursor?: string | null > } > } > ``` *** ## Images ### createUploadURL `images.createUploadURL` Create a presigned image upload URL **Risk:** `write` ```ts theme={null} await corsair.hashnode.api.images.createUploadURL({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `createImageUploadURL` | `object` | Yes | — | > **createImageUploadURL full type** > > ```ts theme={null} > { > presignedPost: { > url: string, > fields: { > } > } > } > ``` *** ## Me ### me `me` Get the current authenticated user **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.me({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `me` | `object` | Yes | — | > **me full type** > > ```ts theme={null} > { > id: string, > name: string, > username: string, > email: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } > ``` *** ## Pages ### get `pages.get` Get a static page by slug **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.pages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `publication` | `object` | Yes | — | > **publication full type** > > ```ts theme={null} > { > staticPage?: { > id: string, > title: string, > slug: string, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > hidden?: boolean, > ogMetaData?: { > image?: string | null > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null > } | null > } > ``` *** ### list `pages.list` List static pages in a publication **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.pages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `first` | `number` | Yes | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `publication` | `object` | Yes | — | > **publication full type** > > ```ts theme={null} > { > staticPages: { > edges: { > node: { > id: string, > title: string, > slug: string, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > hidden?: boolean, > ogMetaData?: { > image?: string | null > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null > }, > cursor: string > }[], > pageInfo: { > hasNextPage: boolean, > endCursor?: string | null > } > } > } > ``` *** ## Posts ### get `posts.get` Get a single post by ID **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.posts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `post` | `object` | No | — | > **post full type** > > ```ts theme={null} > { > id: string, > title: string, > subtitle?: string | null, > slug: string, > brief: string, > url: string, > coverImage?: { > url?: string | null, > isPortrait?: boolean, > attribution?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > publication?: { > id: string, > title: string, > url?: string | null, > displayTitle?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > publishedAt: string, > updatedAt?: string | null, > readTimeInMinutes: number, > reactionCount: number, > responseCount: number, > replyCount?: number, > series?: { > id: string, > name: string, > slug: string > } | null, > featured?: boolean > } > ``` *** ### getBySlug `posts.getBySlug` Get a post by publication host and slug **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.posts.getBySlug({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `publication` | `object` | Yes | — | > **publication full type** > > ```ts theme={null} > { > post?: { > id: string, > title: string, > subtitle?: string | null, > slug: string, > brief: string, > url: string, > coverImage?: { > url?: string | null, > isPortrait?: boolean, > attribution?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > publication?: { > id: string, > title: string, > url?: string | null, > displayTitle?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > publishedAt: string, > updatedAt?: string | null, > readTimeInMinutes: number, > reactionCount: number, > responseCount: number, > replyCount?: number, > series?: { > id: string, > name: string, > slug: string > } | null, > featured?: boolean > } | null > } > ``` *** ### list `posts.list` List posts in a publication **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.posts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `first` | `number` | Yes | — | | `after` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > tagSlugs?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `publication` | `object` | Yes | — | > **publication full type** > > ```ts theme={null} > { > posts: { > edges: { > node: { > id: string, > title: string, > subtitle?: string | null, > slug: string, > brief: string, > url: string, > coverImage?: { > url?: string | null, > isPortrait?: boolean, > attribution?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > publication?: { > id: string, > title: string, > url?: string | null, > displayTitle?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > publishedAt: string, > updatedAt?: string | null, > readTimeInMinutes: number, > reactionCount: number, > responseCount: number, > replyCount?: number, > series?: { > id: string, > name: string, > slug: string > } | null, > featured?: boolean > }, > cursor: string > }[], > pageInfo: { > hasNextPage: boolean, > endCursor?: string | null > }, > totalDocuments?: number > } > } > ``` *** ### publish `posts.publish` Publish a new post **Risk:** `write` ```ts theme={null} await corsair.hashnode.api.posts.publish({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `publicationId` | `string` | Yes | — | | `contentMarkdown` | `string` | Yes | — | | `subtitle` | `string` | No | — | | `slug` | `string` | No | — | | `coverImage` | `string` | No | — | | `tags` | `object[]` | No | — | | `originalArticleURL` | `string` | No | — | | `metaTitle` | `string` | No | — | | `metaDescription` | `string` | No | — | | `ogImage` | `string` | No | — | | `disableComments` | `boolean` | No | — | | `isDelisted` | `boolean` | No | — | | `enableToc` | `boolean` | No | — | | `publishAs` | `string` | No | — | | `coAuthors` | `string[]` | No | — | | `seriesId` | `string` | No | — | | `publishedAt` | `string` | No | — | > **tags full type** > > ```ts theme={null} > { > slug: string, > name?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `publishPost` | `object` | Yes | — | > **publishPost full type** > > ```ts theme={null} > { > post: { > id: string, > title: string, > subtitle?: string | null, > slug: string, > brief: string, > url: string, > coverImage?: { > url?: string | null, > isPortrait?: boolean, > attribution?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > publication?: { > id: string, > title: string, > url?: string | null, > displayTitle?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > publishedAt: string, > updatedAt?: string | null, > readTimeInMinutes: number, > reactionCount: number, > responseCount: number, > replyCount?: number, > series?: { > id: string, > name: string, > slug: string > } | null, > featured?: boolean > } > } > ``` *** ### search `posts.search` Search posts within a publication **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.posts.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | Yes | — | | `after` | `string` | No | — | | `sortBy` | `DATE_PUBLISHED_ASC \| DATE_PUBLISHED_DESC` | No | — | | `filter` | `object` | Yes | — | > **filter full type** > > ```ts theme={null} > { > query?: string, > publicationId: string, > deletedOnly?: boolean, > authorIds?: string[], > tagIds?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `searchPostsOfPublication` | `object` | Yes | — | > **searchPostsOfPublication full type** > > ```ts theme={null} > { > edges: { > node: { > id: string, > title: string, > subtitle?: string | null, > slug: string, > brief: string, > url: string, > coverImage?: { > url?: string | null, > isPortrait?: boolean, > attribution?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > publication?: { > id: string, > title: string, > url?: string | null, > displayTitle?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > publishedAt: string, > updatedAt?: string | null, > readTimeInMinutes: number, > reactionCount: number, > responseCount: number, > replyCount?: number, > series?: { > id: string, > name: string, > slug: string > } | null, > featured?: boolean > }, > cursor: string > }[], > pageInfo: { > hasNextPage: boolean, > endCursor?: string | null > } > } > ``` *** ### update `posts.update` Update an existing post **Risk:** `write` ```ts theme={null} await corsair.hashnode.api.posts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `subtitle` | `string` | No | — | | `contentMarkdown` | `string` | No | — | | `slug` | `string` | No | — | | `coverImage` | `string` | No | — | | `tags` | `object[]` | No | — | | `originalArticleURL` | `string` | No | — | | `metaTitle` | `string` | No | — | | `metaDescription` | `string` | No | — | | `ogImage` | `string` | No | — | | `disableComments` | `boolean` | No | — | | `isDelisted` | `boolean` | No | — | | `enableToc` | `boolean` | No | — | | `publishAs` | `string` | No | — | | `coAuthors` | `string[]` | No | — | | `seriesId` | `string` | No | — | | `publishedAt` | `string` | No | — | > **tags full type** > > ```ts theme={null} > { > slug: string, > name?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `updatePost` | `object` | Yes | — | > **updatePost full type** > > ```ts theme={null} > { > post: { > id: string, > title: string, > subtitle?: string | null, > slug: string, > brief: string, > url: string, > coverImage?: { > url?: string | null, > isPortrait?: boolean, > attribution?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > publication?: { > id: string, > title: string, > url?: string | null, > displayTitle?: string | null > } | null, > tags?: { > id: string, > name: string, > slug: string > }[] | null, > content?: { > html?: string, > markdown?: string, > text?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > publishedAt: string, > updatedAt?: string | null, > readTimeInMinutes: number, > reactionCount: number, > responseCount: number, > replyCount?: number, > series?: { > id: string, > name: string, > slug: string > } | null, > featured?: boolean > } > } > ``` *** ## Publications ### get `publications.get` Get a publication by host **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.publications.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `publication` | `object` | No | — | > **publication full type** > > ```ts theme={null} > { > id: string, > title: string, > displayTitle?: string | null, > url?: string | null, > favicon?: string | null, > about?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > isTeam?: boolean, > links?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > followersCount?: number | null > } > ``` *** ### list `publications.list` List publications for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.publications.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | Yes | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `me` | `object` | Yes | — | > **me full type** > > ```ts theme={null} > { > publications: { > edges: { > node: { > id: string, > title: string, > displayTitle?: string | null, > url?: string | null, > favicon?: string | null, > about?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > seo?: { > title?: string | null, > description?: string | null > } | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null, > ogMetaData?: { > image?: string | null > } | null, > isTeam?: boolean, > links?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > followersCount?: number | null > }, > cursor: string > }[], > pageInfo: { > hasNextPage: boolean, > endCursor?: string | null > } > } > } > ``` *** ## Series ### get `series.get` Get a series by slug **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.series.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `series` | `object` | No | — | > **series full type** > > ```ts theme={null} > { > id: string, > name: string, > slug: string, > description?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > coverImage?: string | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null > } > ``` *** ### list `series.list` List series in a publication **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.series.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `first` | `number` | Yes | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `publication` | `object` | Yes | — | > **publication full type** > > ```ts theme={null} > { > seriesList: { > edges: { > node: { > id: string, > name: string, > slug: string, > description?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > coverImage?: string | null, > author?: { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } | null > }, > cursor: string > }[], > pageInfo: { > hasNextPage: boolean, > endCursor?: string | null > } > } > } > ``` *** ## Tags ### get `tags.get` Get a tag by slug **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.tags.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `object` | No | — | > **tag full type** > > ```ts theme={null} > { > id: string, > name: string, > slug: string, > tagline?: string | null, > logo?: string | null, > postsCount?: number, > followersCount?: number > } > ``` *** ## Users ### get `users.get` Get a user by username **Risk:** `read` ```ts theme={null} await corsair.hashnode.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: string, > name: string, > username: string, > profilePicture?: string | null, > coverImage?: string | null, > bio?: { > text?: string | null, > html?: string, > markdown?: string > } | null, > socialMediaLinks?: { > twitter?: string | null, > github?: string | null, > linkedin?: string | null, > website?: string | null > } | null, > location?: string | null, > dateJoined?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/hashnode/database Hashnode local sync: searchable entities, `.search()` filters, and operators. The Hashnode plugin syncs data locally. Use `corsair.hashnode.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/hashnode/overview Developer blogging platform for publishing articles, newsletters, and technical content. Use **Hashnode** through Corsair: one client, typed API calls. **What you get:** * 23 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/hashnode ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/hashnode ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/hashnode ``` ```bash bun theme={null} bun add corsair @corsair-dev/hashnode ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { hashnode } from '@corsair-dev/hashnode'; export const corsair = createCorsair({ plugins: [ hashnode(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} hashnode() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'hashnode', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`comments.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hashnode.api.comments.list({}); ``` **`drafts.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hashnode.api.drafts.create({}); ``` See the full list on the [API](/plugins/hashnode/api) page. ## What's next > **[API reference](/plugins/hashnode/api)** > > Every `hashnode.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Database Source: https://docs.corsair.dev/plugins/here/database HERE local sync: searchable entities, `.search()` filters, and operators. The HERE plugin syncs data locally. Use `corsair.here.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Addresses Path: `here.db.addresses.search` ```ts theme={null} const rows = await corsair.here.db.addresses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `countryName` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `stateCode` | `string` | equals, contains, startsWith, endsWith, in | | `county` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `district` | `string` | equals, contains, startsWith, endsWith, in | | `street` | `string` | equals, contains, startsWith, endsWith, in | | `postalCode` | `string` | equals, contains, startsWith, endsWith, in | | `houseNumber` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Places Path: `here.db.places.search` ```ts theme={null} const rows = await corsair.here.db.places.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `resultType` | `string` | equals, contains, startsWith, endsWith, in | | `distance` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Positions Path: `here.db.positions.search` ```ts theme={null} const rows = await corsair.here.db.positions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `lat` | `number` | equals, gt, gte, lt, lte, in | | `lng` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Routes Path: `here.db.routes.search` ```ts theme={null} const rows = await corsair.here.db.routes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Traffic Results Path: `here.db.trafficResults.search` ```ts theme={null} const rows = await corsair.here.db.trafficResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Weather Places Path: `here.db.weatherPlaces.search` ```ts theme={null} const rows = await corsair.here.db.weatherPlaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `countryCode` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/here/overview Location platform for maps, routing, geocoding, and fleet tracking services worldwide. Use **HERE** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 28 typed API operations * 6 synced entities (`addresses`, `places`, `positions`, `routes`, `trafficResults`, `weatherPlaces`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/here ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/here ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/here ``` ```bash bun theme={null} bun add corsair @corsair-dev/here ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { here } from '@corsair-dev/here'; export const corsair = createCorsair({ plugins: [ here(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} here() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'here', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`maps.coordinatesToTileIndices`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.here.api.maps.coordinatesToTileIndices({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/here/api) reference.* See the full list on the [API](/plugins/here/api) page. ## Query synced data Synced entities support `tenant.here.db..search()` and `.list()`: `addresses`, `places`, `positions`, `routes`, `trafficResults`, `weatherPlaces`. See [Database](/plugins/here/database) for filters and operators. ## What's next > **[API reference](/plugins/here/api)** > > Every `here.api.*` operation with input and output types. > **[Database](/plugins/here/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/heygen/api API reference for HeyGen: every `heygen.api.*` operation with input and output types. Every `heygen.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Ai Clipping ### create `aiClipping.create` Create an AI clipping job that turns a long video into short highlight clips **Risk:** `write` ```ts theme={null} await corsair.heygen.api.aiClipping.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video` | `object` | Yes | — | | `title` | `string` | No | — | | `input_language` | `string` | No | — | | `output_settings` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_id` | `string` | No | — | > **video full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } > ``` > **output\_settings full type** > > ```ts theme={null} > { > duration_types: 30 | 60 | 180 | long[], > aspect_ratio?: landscape | portrait | square, > captions?: boolean, > caption_style?: string, > prompt?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ai_clipping_id: string > } > ``` *** ### delete `aiClipping.delete` Soft-delete an AI clipping job and its clips **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.aiClipping.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### get `aiClipping.get` Retrieve the status and generated clips of an AI clipping job **Risk:** `read` ```ts theme={null} await corsair.heygen.api.aiClipping.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > status: pending | running | completed | failed | cancelled, > input_language?: string | null, > source_duration?: number | null, > clips?: { > id: string, > status: pending | completed | failed, > duration_seconds?: number | null, > aspect_ratio?: landscape | portrait | square | null, > title?: string | null, > virality_score?: number | null, > thumbnail_url?: string | null, > video_url?: string | null, > failure_message?: string | null > }[], > progress?: number, > callback_id?: string | null, > created_at?: number | null, > failure_message?: string | null > } > ``` *** ### list `aiClipping.list` Retrieve a cursor-paginated list of AI clipping jobs **Risk:** `read` ```ts theme={null} await corsair.heygen.api.aiClipping.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > status: pending | running | completed | failed | cancelled, > input_language?: string | null, > source_duration?: number | null, > clips?: { > id: string, > status: pending | completed | failed, > duration_seconds?: number | null, > aspect_ratio?: landscape | portrait | square | null, > title?: string | null, > virality_score?: number | null, > thumbnail_url?: string | null, > video_url?: string | null, > failure_message?: string | null > }[], > progress?: number, > callback_id?: string | null, > created_at?: number | null, > failure_message?: string | null > }[] > ``` *** ## Assets ### completeUpload `assets.completeUpload` Finalize a presigned direct-upload session into a usable asset **Risk:** `write` ```ts theme={null} await corsair.heygen.api.assets.completeUpload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | | `checksum_sha256` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > asset_id: string, > url: string, > mime_type: string, > size_bytes: number, > status: string > } > ``` *** ### createFolder `assets.createFolder` Create a new folder to organize videos and assets **Risk:** `write` ```ts theme={null} await corsair.heygen.api.assets.createFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `parent_folder_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > folder_id: string > } > ``` *** ### createUploadSession `assets.createUploadSession` Create a presigned direct-upload session for a large asset **Risk:** `write` ```ts theme={null} await corsair.heygen.api.assets.createUploadSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | Yes | — | | `content_type` | `string` | Yes | — | | `size_bytes` | `number` | Yes | — | | `checksum_sha256` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > asset_id: string, > upload_url: string, > upload_headers: { > }, > expires_in_seconds: number, > max_bytes: number, > status: pending_upload > } > ``` *** ### deleteAsset `assets.deleteAsset` Permanently delete a specific media asset by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.assets.deleteAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### deleteAssetV3 `assets.deleteAssetV3` Permanently delete an asset via the v3 API **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.assets.deleteAssetV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### getAsset `assets.getAsset` Retrieve metadata for an asset via the v3 API **Risk:** `read` ```ts theme={null} await corsair.heygen.api.assets.getAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `asset_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > type: string, > owner: string, > space_id: string, > folder_id?: string | null, > uploaded_at: number, > url?: string | null > } > ``` *** ### getTemplate `assets.getTemplate` Retrieve structure, placeholders, and avatar settings of a specific template **Risk:** `read` ```ts theme={null} await corsair.heygen.api.assets.getTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > template_id?: string > } > ``` *** ### listAssets `assets.listAssets` Retrieve a paginated list of assets with type/folder filtering **Risk:** `read` ```ts theme={null} await corsair.heygen.api.assets.listAssets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_type` | `string` | No | — | | `folder_id` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > assets: { > }[] > } > ``` *** ### listAssets2 `assets.listAssets2` Retrieve a list of uploaded assets with cursor/page pagination **Risk:** `read` ```ts theme={null} await corsair.heygen.api.assets.listAssets2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > assets: { > }[], > next_cursor?: string > } > ``` *** ### listFolders `assets.listFolders` Retrieve a paginated list of folders in the account **Risk:** `read` ```ts theme={null} await corsair.heygen.api.assets.listFolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > folders: { > }[] > } > ``` *** ### listTemplates `assets.listTemplates` Retrieve a list of pre-designed avatar templates **Risk:** `read` ```ts theme={null} await corsair.heygen.api.assets.listTemplates({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > templates: { > }[] > } > ``` *** ### restoreFolder `assets.restoreFolder` Recover a previously trashed folder **Risk:** `write` ```ts theme={null} await corsair.heygen.api.assets.restoreFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### trashFolder `assets.trashFolder` Soft-delete a folder by moving it to trash (recoverable via restoreFolder) **Risk:** `write` ```ts theme={null} await corsair.heygen.api.assets.trashFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### updateFolder `assets.updateFolder` Rename an existing folder by ID **Risk:** `write` ```ts theme={null} await corsair.heygen.api.assets.updateFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### uploadAsset `assets.uploadAsset` Upload an image, video, or audio file asset to the platform **Risk:** `write` ```ts theme={null} await corsair.heygen.api.assets.uploadAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileBase64` | `string` | Yes | — | | `contentType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > url?: string > } > ``` *** ### uploadAssetV3 `assets.uploadAssetV3` Upload an image, video, audio, or PDF asset via the v3 API **Risk:** `write` ```ts theme={null} await corsair.heygen.api.assets.uploadAssetV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileBase64` | `string` | Yes | — | | `contentType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > asset_id: string, > url: string, > mime_type: string, > size_bytes: number > } > ``` *** ## Audio ### search `audio.search` Search HeyGen's library of background music and sound effects **Risk:** `read` ```ts theme={null} await corsair.heygen.api.audio.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `type` | `music \| sound_effects` | No | — | | `limit` | `number` | No | — | | `min_score` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ## Avatar Realtime ### appendText `avatarRealtime.appendText` Append streamed text to an active text\_stream avatar realtime session **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatarRealtime.appendText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `stream_id` | `string` | Yes | — | | `delta` | `string` | Yes | — | | `final` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > ok?: boolean, > buffered_bytes: number > } > ``` *** ### cancelSession `avatarRealtime.cancelSession` Cancel an active avatar realtime streaming session **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatarRealtime.cancelSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `stream_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > stream_id: string, > cancelled: boolean > } > ``` *** ### createSession `avatarRealtime.createSession` Create a low-latency HLS streaming session with an interactive avatar **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatarRealtime.createSession({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > type: tts, > avatar_id: string, > text: string, > voice_id: string > } | { > type: audio, > avatar_id: string, > audio: { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } | { > type: base64, > media_type: string, > data: string > } > } | { > type: text_stream, > avatar_id: string, > voice_id: string, > text: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > stream_id: string > } > ``` *** ### getSession `avatarRealtime.getSession` Retrieve the status and playback URL of an avatar realtime session **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatarRealtime.getSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `stream_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > stream_id: string, > status: pending | streaming | completed | error, > hls_url?: string | null, > error_message?: string | null, > end_reason?: final_marker | idle_timeout | null > } > ``` *** ## Avatars ### addLooks `avatars.addLooks` Add up to 4 image look variations to an existing photo avatar group **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatars.addLooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | | `image_keys` | `string[]` | Yes | — | | `name` | `string` | No | — | | `generation_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > generation_id?: string > } > ``` *** ### addMotion `avatars.addMotion` Animate a still photo avatar into a moving lifelike motion avatar **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatars.addMotion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string > } > ``` *** ### checkLookStatus `avatars.checkLookStatus` Monitor the generation status/progress of photo avatar looks **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.checkLookStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `generation_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > generation_id?: string, > status?: string, > image_url_list?: string[] > } > ``` *** ### create `avatars.create` Create a new avatar from a prompt, digital twin video, or photo **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatars.create({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > type: prompt, > name: string, > prompt: string, > reference_images?: ( > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } | { > type: base64, > media_type: string, > data: string > } > )[], > avatar_group_id?: string | null, > avatar_id?: string | null > } | { > type: digital_twin, > name: string, > file: { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } | { > type: base64, > media_type: string, > data: string > }, > avatar_group_id?: string | null > } | { > type: photo, > name: string, > file: { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } | { > type: base64, > media_type: string, > data: string > }, > avatar_group_id?: string | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > avatar_item?: { > id: string, > name: string, > avatar_type: studio_avatar | digital_twin | photo_avatar, > group_id?: string | null, > preview_image_url?: string | null, > preview_video_url?: string | null, > gender?: string | null, > tags?: string[] | null, > default_voice_id?: string | null, > supported_api_engines?: string[] | null, > image_width?: number | null, > image_height?: number | null, > preferred_orientation?: portrait | landscape | square | null, > status?: processing | pending_consent | failed | completed | null, > error?: { > code: string, > message: string > } | null > } | null, > avatar_group?: { > id: string, > name: string, > created_at: number, > looks_count: number, > preview_image_url?: string | null, > preview_video_url?: string | null, > gender?: string | null, > default_voice_id?: string | null, > consent_status?: string | null, > status?: processing | pending_consent | failed | completed | null, > error?: { > code: string, > message: string > } | null > } | null > } > ``` *** ### createConsent `avatars.createConsent` Start the consent verification flow required for a custom avatar group **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatars.createConsent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | | `reroute_url` | `string` | No | — | | `consent_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > avatar_group: { > id: string, > name: string, > created_at: number, > looks_count: number, > preview_image_url?: string | null, > preview_video_url?: string | null, > gender?: string | null, > default_voice_id?: string | null, > consent_status?: string | null, > status?: processing | pending_consent | failed | completed | null, > error?: { > code: string, > message: string > } | null > }, > url: string > } > ``` *** ### createPhotoGroup `avatars.createPhotoGroup` Create an avatar group for AI-generated and user-uploaded photos **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatars.createPhotoGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `image_key` | `string` | Yes | — | | `generation_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > image_url?: string, > name?: string, > status?: string > } > ``` *** ### deleteGroup `avatars.deleteGroup` Permanently delete an avatar group by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.avatars.deleteGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### deleteLook `avatars.deleteLook` Permanently delete a photo avatar or digital twin look **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.avatars.deleteLook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `look_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### deletePhoto `avatars.deletePhoto` Delete a photo avatar by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.avatars.deletePhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### deletePhotoGroup `avatars.deletePhotoGroup` Delete a photo avatar group by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.avatars.deletePhotoGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### deleteTalkingPhoto `avatars.deleteTalkingPhoto` Permanently delete a specific talking photo resource **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.avatars.deleteTalkingPhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `talking_photo_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### generatePhotos `avatars.generatePhotos` Generate AI avatar photos based on text prompts and attributes **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatars.generatePhotos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `age` | `string` | Yes | — | | `gender` | `string` | Yes | — | | `ethnicity` | `string` | Yes | — | | `orientation` | `string` | Yes | — | | `pose` | `string` | Yes | — | | `style` | `string` | Yes | — | | `appearance` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > generation_id: string > } > ``` *** ### getDetails `avatars.getDetails` Retrieve comprehensive details, display properties, and preview media for an avatar **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `avatar_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > avatar_id?: string > } > ``` *** ### getGroup `avatars.getGroup` Retrieve details for a specific avatar group **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.getGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > created_at: number, > looks_count: number, > preview_image_url?: string | null, > preview_video_url?: string | null, > gender?: string | null, > default_voice_id?: string | null, > consent_status?: string | null, > status?: processing | pending_consent | failed | completed | null, > error?: { > code: string, > message: string > } | null > } > ``` *** ### getLook `avatars.getLook` Retrieve details for a specific avatar look **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.getLook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `look_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > avatar_type: studio_avatar | digital_twin | photo_avatar, > group_id?: string | null, > preview_image_url?: string | null, > preview_video_url?: string | null, > gender?: string | null, > tags?: string[] | null, > default_voice_id?: string | null, > supported_api_engines?: string[] | null, > image_width?: number | null, > image_height?: number | null, > preferred_orientation?: portrait | landscape | square | null, > status?: processing | pending_consent | failed | completed | null, > error?: { > code: string, > message: string > } | null > } > ``` *** ### getPhotoDetails `avatars.getPhotoDetails` Retrieve comprehensive metadata and configuration for a photo avatar/look **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.getPhotoDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string > } > ``` *** ### getTrainingStatus `avatars.getTrainingStatus` Monitor the training progress of a photo avatar training job **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.getTrainingStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > status: string > } > ``` *** ### list `avatars.list` Retrieve a list of available public and private avatars with pagination **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownership` | `public \| private` | No | — | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### listGroupAvatars `avatars.listGroupAvatars` Retrieve all avatars within a specific avatar group **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.listGroupAvatars({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > avatar_list: { > }[] > } > ``` *** ### listGroups `avatars.listGroups` Retrieve a list of all avatar groups in the account **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.listGroups({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > avatar_group_list: { > }[] > } > ``` *** ### listLooks `avatars.listLooks` Retrieve a paginated list of avatar looks (outfits, poses, styles) **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.listLooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | No | — | | `avatar_type` | `studio_avatar \| digital_twin \| photo_avatar` | No | — | | `ownership` | `public \| private` | No | — | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > avatar_type: studio_avatar | digital_twin | photo_avatar, > group_id?: string | null, > preview_image_url?: string | null, > preview_video_url?: string | null, > gender?: string | null, > tags?: string[] | null, > default_voice_id?: string | null, > supported_api_engines?: string[] | null, > image_width?: number | null, > image_height?: number | null, > preferred_orientation?: portrait | landscape | square | null, > status?: processing | pending_consent | failed | completed | null, > error?: { > code: string, > message: string > } | null > }[] > ``` *** ### listTalkingPhotos `avatars.listTalkingPhotos` Retrieve a list of existing interactive talking photo projects **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.listTalkingPhotos({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### searchPublicGroups `avatars.searchPublicGroups` Search public avatar groups with filters and pagination **Risk:** `read` ```ts theme={null} await corsair.heygen.api.avatars.searchPublicGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyword` | `string` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > avatar_group_list: { > }[] > } > ``` *** ### updateLook `avatars.updateLook` Rename a photo avatar or digital twin look **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatars.updateLook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `look_id` | `string` | Yes | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > avatar_type: studio_avatar | digital_twin | photo_avatar, > group_id?: string | null, > preview_image_url?: string | null, > preview_video_url?: string | null, > gender?: string | null, > tags?: string[] | null, > default_voice_id?: string | null, > supported_api_engines?: string[] | null, > image_width?: number | null, > image_height?: number | null, > preferred_orientation?: portrait | landscape | square | null, > status?: processing | pending_consent | failed | completed | null, > error?: { > code: string, > message: string > } | null > } > ``` *** ### uploadTalkingPhoto `avatars.uploadTalkingPhoto` Create an interactive talking photo from an uploaded JPEG/PNG binary image **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatars.uploadTalkingPhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageBase64` | `string` | Yes | — | | `contentType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > talking_photo_id: string > } > ``` *** ### upscale `avatars.upscale` Enhance the resolution and quality of an existing motion avatar **Risk:** `write` ```ts theme={null} await corsair.heygen.api.avatars.upscale({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string > } > ``` *** ## Brand ### listGlossaries `brand.listGlossaries` Retrieve a paginated list of brand glossaries for custom term translation **Risk:** `read` ```ts theme={null} await corsair.heygen.api.brand.listGlossaries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > brand_glossary_id: string, > name: string, > created_at: string, > updated_at: string > }[] > ``` *** ### listKits `brand.listKits` Retrieve a paginated list of brand kits (logos, colors, fonts) **Risk:** `read` ```ts theme={null} await corsair.heygen.api.brand.listKits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > brand_kit_id: string, > name: string, > logo_url?: string | null, > colors?: string[] > }[] > ``` *** ## Hyperframes ### create `hyperframes.create` Create a HyperFrames cloud render from an HTML/motion-graphics project **Risk:** `write` ```ts theme={null} await corsair.heygen.api.hyperframes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `object` | Yes | — | | `fps` | `number` | No | — | | `quality` | `draft \| standard \| high` | No | — | | `format` | `mp4 \| webm \| mov` | No | — | | `resolution` | `1080p \| 4k` | No | — | | `aspect_ratio` | `16:9 \| 9:16 \| 1:1` | No | — | | `composition` | `string` | No | — | | `variables` | `object` | No | — | | `title` | `string` | No | — | | `callback_id` | `string` | No | — | | `callback_url` | `string` | No | — | > **project full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } | { > type: base64, > media_type: string, > data: string > } > ``` > **variables full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > render_id: string > } > ``` *** ### delete `hyperframes.delete` Permanently delete a HyperFrames render **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.hyperframes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `render_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > render_id: string > } > ``` *** ### get `hyperframes.get` Retrieve the status and details of a HyperFrames render **Risk:** `read` ```ts theme={null} await corsair.heygen.api.hyperframes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `render_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > render_id: string, > status: queued | rendering | completed | failed, > format: mp4 | webm | mov, > title?: string | null, > callback_id?: string | null, > video_url?: string | null, > thumbnail_url?: string | null, > duration?: number | null, > fps?: number | null, > quality?: draft | standard | high | null, > resolution?: 1080p | 4k | null, > aspect_ratio?: 16:9 | 9:16 | 1:1 | null, > composition?: string | null, > created_at?: number | null, > completed_at?: number | null, > failure_message?: string | null > } > ``` *** ### list `hyperframes.list` Retrieve a cursor-paginated list of HyperFrames renders **Risk:** `read` ```ts theme={null} await corsair.heygen.api.hyperframes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > render_id: string, > status: queued | rendering | completed | failed, > format: mp4 | webm | mov, > title?: string | null, > callback_id?: string | null, > video_url?: string | null, > thumbnail_url?: string | null, > duration?: number | null, > fps?: number | null, > quality?: draft | standard | high | null, > resolution?: 1080p | 4k | null, > aspect_ratio?: 16:9 | 9:16 | 1:1 | null, > composition?: string | null, > created_at?: number | null, > completed_at?: number | null, > failure_message?: string | null > }[] > ``` *** ## Knowledge Bases ### create `knowledgeBases.create` Create a knowledge base with a custom name, opening line, and prompt for interactive sessions **Risk:** `write` ```ts theme={null} await corsair.heygen.api.knowledgeBases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `opening` | `string` | No | — | | `prompt` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > knowledge_base_id: string > } > ``` *** ### delete `knowledgeBases.delete` Permanently remove a knowledge base by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.knowledgeBases.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### list `knowledgeBases.list` Retrieve a list of all existing knowledge bases **Risk:** `read` ```ts theme={null} await corsair.heygen.api.knowledgeBases.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > list: { > }[] > } > ``` *** ### update `knowledgeBases.update` Modify the opening line, prompt, or name of an existing knowledge base **Risk:** `write` ```ts theme={null} await corsair.heygen.api.knowledgeBases.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | | `name` | `string` | No | — | | `opening` | `string` | No | — | | `prompt` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ## Lipsync ### create `lipsync.create` Create a lipsync job that syncs a video to a separate audio track **Risk:** `write` ```ts theme={null} await corsair.heygen.api.lipsync.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video` | `object` | Yes | — | | `audio` | `object` | Yes | — | | `title` | `string` | No | — | | `mode` | `speed \| precision` | No | — | | `callback_url` | `string` | No | — | | `callback_id` | `string` | No | — | | `enable_caption` | `boolean` | No | — | | `keep_the_same_format` | `boolean` | No | — | | `enable_dynamic_duration` | `boolean` | No | — | | `disable_music_track` | `boolean` | No | — | | `enable_speech_enhancement` | `boolean` | No | — | | `enable_watermark` | `boolean` | No | — | | `start_time` | `number` | No | — | | `end_time` | `number` | No | — | | `fps_mode` | `vfr \| cfr \| passthrough` | No | — | | `folder_id` | `string` | No | — | > **video full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } > ``` > **audio full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > lipsync_id: string > } > ``` *** ### delete `lipsync.delete` Permanently delete a lipsync job and its output **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.lipsync.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lipsync_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### get `lipsync.get` Retrieve the status and details of a lipsync job **Risk:** `read` ```ts theme={null} await corsair.heygen.api.lipsync.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lipsync_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > status: pending | running | completed | failed, > duration?: number | null, > video_url?: string | null, > caption_url?: string | null, > callback_id?: string | null, > created_at?: number | null, > failure_message?: string | null > } > ``` *** ### list `lipsync.list` Retrieve a cursor-paginated list of lipsync jobs **Risk:** `read` ```ts theme={null} await corsair.heygen.api.lipsync.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > status: pending | running | completed | failed, > duration?: number | null, > video_url?: string | null, > caption_url?: string | null, > callback_id?: string | null, > created_at?: number | null, > failure_message?: string | null > }[] > ``` *** ### update `lipsync.update` Update the display title of a lipsync job **Risk:** `write` ```ts theme={null} await corsair.heygen.api.lipsync.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lipsync_id` | `string` | Yes | — | | `title` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > status: pending | running | completed | failed, > duration?: number | null, > video_url?: string | null, > caption_url?: string | null, > callback_id?: string | null, > created_at?: number | null, > failure_message?: string | null > } > ``` *** ## Proofread ### create `proofread.create` Create a proofread session for reviewing a video translation before rendering **Risk:** `write` ```ts theme={null} await corsair.heygen.api.proofread.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video` | `object` | Yes | — | | `output_languages` | `string[]` | Yes | — | | `title` | `string` | Yes | — | | `brand_voice_id` | `string` | No | — | | `brand_glossary_id` | `string` | No | — | | `speaker_num` | `number` | No | — | | `folder_id` | `string` | No | — | | `enable_video_stretching` | `boolean` | No | — | | `disable_music_track` | `boolean` | No | — | | `enable_speech_enhancement` | `boolean` | No | — | | `srt` | `object` | No | — | | `mode` | `speed \| precision` | No | — | | `keep_the_same_format` | `boolean` | No | — | > **video full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } > ``` > **srt full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > proofread_ids: string[], > status: processing | completed | failed > } > ``` *** ### downloadSrt `proofread.downloadSrt` Retrieve presigned download URLs for a proofread session's SRT files **Risk:** `read` ```ts theme={null} await corsair.heygen.api.proofread.downloadSrt({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `proofread_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > srt_url: string, > original_srt_url?: string | null > } > ``` *** ### generateVideo `proofread.generateVideo` Render the final translated video from a completed proofread session **Risk:** `write` ```ts theme={null} await corsair.heygen.api.proofread.generateVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `proofread_id` | `string` | Yes | — | | `captions` | `boolean` | No | — | | `translate_audio_only` | `boolean` | No | — | | `callback_id` | `string` | No | — | | `callback_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > video_translation_id: string, > status: processing | completed | failed > } > ``` *** ### get `proofread.get` Retrieve the status and details of a proofread session **Risk:** `read` ```ts theme={null} await corsair.heygen.api.proofread.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `proofread_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > status: processing | completed | failed, > title?: string | null, > output_language?: string | null, > input_language?: string | null, > submitted_for_review?: boolean | null, > created_at?: number | null, > failure_message?: string | null > } > ``` *** ### uploadSrt `proofread.uploadSrt` Replace a proofread session's subtitles with an edited SRT file **Risk:** `write` ```ts theme={null} await corsair.heygen.api.proofread.uploadSrt({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `proofread_id` | `string` | Yes | — | | `srt` | `object` | Yes | — | > **srt full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > status: processing | completed | failed, > title?: string | null, > output_language?: string | null, > input_language?: string | null, > submitted_for_review?: boolean | null, > created_at?: number | null, > failure_message?: string | null > } > ``` *** ## Streaming ### createToken `streaming.createToken` Generate a time-limited authentication token for streaming sessions **Risk:** `write` ```ts theme={null} await corsair.heygen.api.streaming.createToken({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > token: string > } > ``` *** ### ice `streaming.ice` Submit ICE candidate information for WebRTC peer-to-peer negotiation **Risk:** `write` ```ts theme={null} await corsair.heygen.api.streaming.ice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `candidate` | `object` | Yes | — | > **candidate full type** > > ```ts theme={null} > { > candidate: string, > sdpMLineIndex?: string | number, > sdpMid?: string, > usernameFragment?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### interrupt `streaming.interrupt` Abruptly interrupt an avatar's ongoing action/speech for instant control **Risk:** `write` ```ts theme={null} await corsair.heygen.api.streaming.interrupt({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### keepAlive `streaming.keepAlive` Reset the idle timeout counter for an active streaming session **Risk:** `write` ```ts theme={null} await corsair.heygen.api.streaming.keepAlive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### list `streaming.list` Retrieve a list of active or available streaming sessions **Risk:** `read` ```ts theme={null} await corsair.heygen.api.streaming.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > sessions: { > }[] > } > ``` *** ### listAvatars `streaming.listAvatars` Retrieve a list of public and custom interactive avatars available for streaming **Risk:** `read` ```ts theme={null} await corsair.heygen.api.streaming.listAvatars({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### listSessionHistory `streaming.listSessionHistory` Retrieve a paginated history and metadata of past streaming sessions **Risk:** `read` ```ts theme={null} await corsair.heygen.api.streaming.listSessionHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > sessions: { > }[] > } > ``` *** ### new `streaming.new` Initiate a streaming session with specified quality settings **Risk:** `write` ```ts theme={null} await corsair.heygen.api.streaming.new({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `quality` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > session_id: string, > sdp?: any > } > ``` *** ### newSession `streaming.newSession` Initiate a streaming session with an Interactive Avatar to get a WebSocket URL, session ID, and token **Risk:** `write` ```ts theme={null} await corsair.heygen.api.streaming.newSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `quality` | `string` | No | — | | `avatar_id` | `string` | No | — | | `voice` | `object` | No | — | | `knowledge_base_id` | `string` | No | — | | `version` | `string` | No | — | > **voice full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > session_id: string, > sdp?: any, > access_token?: string, > url?: string, > ice_servers?: any, > session_duration_limit?: number > } > ``` *** ### start `streaming.start` Establish a WebRTC SDP offer connection for real-time video/audio streaming **Risk:** `write` ```ts theme={null} await corsair.heygen.api.streaming.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `sdp` | `object` | Yes | — | > **sdp full type** > > ```ts theme={null} > { > type: string, > sdp: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > sdp?: any > } > ``` *** ### stop `streaming.stop` Terminate an active WebRTC streaming session and free resources **Risk:** `write` ```ts theme={null} await corsair.heygen.api.streaming.stop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### task `streaming.task` Send a real-time text speaking task to an active streaming avatar **Risk:** `write` ```ts theme={null} await corsair.heygen.api.streaming.task({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `text` | `string` | Yes | — | | `task_type` | `talk \| repeat` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > duration_ms?: number > } > ``` *** ## Video Agents ### createSession `videoAgents.createSession` Create a video agent session that generates a video from a text prompt **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videoAgents.createSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `mode` | `generate \| chat` | No | — | | `avatar_id` | `string` | No | — | | `voice_id` | `string` | No | — | | `style_id` | `string` | No | — | | `brand_kit_id` | `string` | No | — | | `orientation` | `landscape \| portrait` | No | — | | `files` | `object[]` | No | — | | `callback_url` | `string` | No | — | | `callback_id` | `string` | No | — | | `incognito_mode` | `boolean` | No | — | > **files full type** > > ```ts theme={null} > ( > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } | { > type: base64, > media_type: string, > data: string > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > session_id: string, > status: generating | thinking | completed | failed, > video_id?: string | null, > created_at: number > } > ``` *** ### getResource `videoAgents.getResource` Retrieve a specific resource generated within a video agent session **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videoAgents.getResource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `resource_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > resource_id: string, > resource_type: string, > source_type?: string | null, > url?: string | null, > thumbnail_url?: string | null, > preview_url?: string | null, > created_at?: number | null, > metadata?: { > } | null > } > ``` *** ### getSession `videoAgents.getSession` Retrieve the status, progress, and chat history of a video agent session **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videoAgents.getSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > session_id: string, > status: thinking | waiting_for_input | reviewing | generating | completed | failed, > progress?: number, > title?: string | null, > video_id?: string | null, > created_at: number, > messages: { > role: string, > content: string, > type: text | resource | error, > created_at?: number | null, > resource_ids?: string[] | null > }[] > } > ``` *** ### listSessions `videoAgents.listSessions` Retrieve a paginated list of video agent sessions **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videoAgents.listSessions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > session_id: string, > title?: string | null, > created_at: number > }[] > ``` *** ### listStyles `videoAgents.listStyles` Retrieve a paginated list of available video agent styles **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videoAgents.listStyles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `string` | No | — | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > style_id: string, > name: string, > thumbnail_url?: string | null, > preview_video_url?: string | null, > tags?: string[] | null, > aspect_ratio?: string | null > }[] > ``` *** ### listVideos `videoAgents.listVideos` Retrieve the videos generated within a video agent session **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videoAgents.listVideos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > status: pending | processing | completed | failed > }[] > ``` *** ### sendMessage `videoAgents.sendMessage` Send a chat message or revision request to an active video agent session **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videoAgents.sendMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `message` | `string` | Yes | — | | `avatar_id` | `string` | No | — | | `voice_id` | `string` | No | — | | `brand_kit_id` | `string` | No | — | | `files` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > ( > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } | { > type: base64, > media_type: string, > data: string > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > session_id: string, > run_id: string, > title?: string | null > } > ``` *** ### stopSession `videoAgents.stopSession` Stop an in-progress video agent session **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videoAgents.stopSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > session_id: string > } > ``` *** ## Videos ### createWebm `videos.createWebm` Create a WebM format video with transparent background featuring studio avatars **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videos.createWebm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `avatar_id` | `string` | Yes | — | | `avatar_style` | `string` | No | — | | `input_text` | `string` | No | — | | `input_audio` | `string` | No | — | | `voice_id` | `string` | No | — | | `background_color` | `string` | No | — | | `title` | `string` | No | — | | `callback_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > video_id: string > } > ``` *** ### delete `videos.delete` Delete a generated or translated video by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.videos.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### deleteV3 `videos.deleteV3` Permanently delete a video and its associated files via the v3 API **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.videos.deleteV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > deleted?: boolean > } > ``` *** ### generate `videos.generate` Generate a customized avatar video with voices and character configs **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videos.generate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `avatar \| image \| cinematic_avatar` | Yes | — | | `title` | `string` | No | — | | `resolution` | `string` | No | — | | `aspect_ratio` | `string` | No | — | | `callback_url` | `string` | No | — | | `callback_id` | `string` | No | — | | `folder_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > video_id: string, > status?: string, > output_format?: mp4 | webm > } > ``` *** ### getSharableUrl `videos.getSharableUrl` Generate a public, shareable URL for a video without authentication requirements **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videos.getSharableUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > share_url: string > } > ``` *** ### getStatus `videos.getStatus` Retrieve asynchronous video processing status and time-limited download URLs **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videos.getStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > title?: string | null, > status: pending | processing | completed | failed, > created_at?: number | null, > completed_at?: number | null, > video_url?: string | null, > thumbnail_url?: string | null, > gif_url?: string | null, > captioned_video_url?: string | null, > subtitle_url?: string | null, > duration?: number | null, > folder_id?: string | null, > output_language?: string | null, > failure_code?: string | null, > failure_message?: string | null, > video_page_url?: string | null > } > ``` *** ### list `videos.list` Retrieve a paginated list of videos associated with the account **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videos.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > videos: { > }[], > token?: string > } > ``` *** ### listV3 `videos.listV3` Retrieve a cursor-paginated list of videos via the v3 API **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videos.listV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | | `folder_id` | `string` | No | — | | `title` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > status: pending | processing | completed | failed > }[] > ``` *** ### personalizedAddContact `videos.personalizedAddContact` Add recipient contacts (name/email) to a personalized video project **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videos.personalizedAddContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `variables_list` | `object[]` | Yes | — | > **variables\_list full type** > > ```ts theme={null} > { > email?: string, > first_name?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### personalizedProjectDetail `videos.personalizedProjectDetail` Retrieve details, status, and metadata for a personalized video project **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videos.personalizedProjectDetail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > project_id?: string, > status?: string > } > ``` *** ### templateGenerate `videos.templateGenerate` Generate a customized video from a pre-existing template using variable definitions **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videos.templateGenerate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | | `title` | `string` | No | — | | `caption` | `boolean` | No | — | | `test` | `boolean` | No | — | | `dimension` | `object` | No | — | | `folder_id` | `string` | No | — | | `variables` | `object` | No | — | > **dimension full type** > > ```ts theme={null} > { > width: number, > height: number > } > ``` > **variables full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > video_id: string > } > ``` *** ### translate `videos.translate` Translate video content or audio tracks across 77+ languages **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videos.translate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video` | `object` | Yes | — | | `output_languages` | `string[]` | Yes | — | | `title` | `string` | No | — | | `audio` | `object` | No | — | | `input_language` | `string` | No | — | | `translate_audio_only` | `boolean` | No | — | | `speaker_num` | `number` | No | — | | `mode` | `speed \| precision` | No | — | | `callback_url` | `string` | No | — | | `callback_id` | `string` | No | — | | `enable_caption` | `boolean` | No | — | | `folder_id` | `string` | No | — | > **video full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } > ``` > **audio full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > video_translation_ids: string[] > } > ``` *** ### translateStatus `videos.translateStatus` Retrieve current progress/status of a video translation job **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videos.translateStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_translate_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > status: pending | running | completed | failed, > title?: string | null, > output_language?: string | null, > input_language?: string | null, > duration?: number | null, > translate_audio_only?: boolean | null, > video_url?: string | null, > audio_url?: string | null, > srt_caption_url?: string | null, > vtt_caption_url?: string | null, > callback_id?: string | null, > created_at?: number | null, > failure_message?: string | null > } > ``` *** ### translateTargetLanguages `videos.translateTargetLanguages` Retrieve the list of all supported target languages for video translation **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videos.translateTargetLanguages({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > languages: string[] > } > ``` *** ## Video Translations ### delete `videoTranslations.delete` Permanently delete a video translation and its associated files **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.videoTranslations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_translation_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### list `videoTranslations.list` Retrieve a cursor-paginated list of video translation jobs **Risk:** `read` ```ts theme={null} await corsair.heygen.api.videoTranslations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > status: pending | running | completed | failed, > title?: string | null, > output_language?: string | null, > input_language?: string | null, > duration?: number | null, > translate_audio_only?: boolean | null, > video_url?: string | null, > audio_url?: string | null, > srt_caption_url?: string | null, > vtt_caption_url?: string | null, > callback_id?: string | null, > created_at?: number | null, > failure_message?: string | null > }[] > ``` *** ### update `videoTranslations.update` Update the display title of a video translation job **Risk:** `write` ```ts theme={null} await corsair.heygen.api.videoTranslations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_translation_id` | `string` | Yes | — | | `title` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > status: pending | running | completed | failed, > title?: string | null, > output_language?: string | null, > input_language?: string | null, > duration?: number | null, > translate_audio_only?: boolean | null, > video_url?: string | null, > audio_url?: string | null, > srt_caption_url?: string | null, > vtt_caption_url?: string | null, > callback_id?: string | null, > created_at?: number | null, > failure_message?: string | null > } > ``` *** ## Voices ### clone `voices.clone` Clone a custom voice from a reference audio sample **Risk:** `write` ```ts theme={null} await corsair.heygen.api.voices.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `audio` | `object` | Yes | — | | `voice_name` | `string` | Yes | — | | `language` | `string` | No | — | | `remove_background_noise` | `boolean` | No | — | > **audio full type** > > ```ts theme={null} > { > type: url, > url: string > } | { > type: asset_id, > asset_id: string > } | { > type: base64, > media_type: string, > data: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > voice_clone_id: string > } > ``` *** ### deleteV3 `voices.deleteV3` Permanently delete a voice via the v3 API **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.voices.deleteV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `voice_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > voice_id: string > } > ``` *** ### design `voices.design` Generate up to 3 candidate synthetic voices from a text description **Risk:** `write` ```ts theme={null} await corsair.heygen.api.voices.design({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `gender` | `string` | No | — | | `locale` | `string` | No | — | | `seed` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > voices: { > voice_id: string, > name?: string | null, > language?: string | null, > gender?: string | null, > preview_audio_url?: string | null, > support_pause?: boolean, > support_locale?: boolean, > type?: public | private > }[], > seed: number > } > ``` *** ### generatePreview `voices.generatePreview` Generate a short audio preview clip (Enterprise Beta) **Risk:** `write` ```ts theme={null} await corsair.heygen.api.voices.generatePreview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `voice_id` | `string` | Yes | — | | `text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > audio_url?: string > } > ``` *** ### generateSpeech `voices.generateSpeech` Generate a speech audio file from text input using the Starfish TTS model **Risk:** `write` ```ts theme={null} await corsair.heygen.api.voices.generateSpeech({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `voice_id` | `string` | Yes | — | | `speed` | `number` | No | — | | `pitch` | `number` | No | — | | `locale` | `string` | No | — | | `input_type` | `text \| ssml` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > audio_url?: string, > duration?: number > } > ``` *** ### generateSpeechV3 `voices.generateSpeechV3` Generate a speech audio file from text via the v3 Starfish TTS engine **Risk:** `write` ```ts theme={null} await corsair.heygen.api.voices.generateSpeechV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `voice_id` | `string` | Yes | — | | `input_type` | `text \| ssml` | No | — | | `speed` | `number` | No | — | | `language` | `string` | No | — | | `locale` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > audio_url: string, > duration: number, > request_id?: string | null, > word_timestamps?: { > word: string, > start: number, > end: number > }[] | null > } > ``` *** ### getV3 `voices.getV3` Retrieve the status and details of a voice via the v3 API **Risk:** `read` ```ts theme={null} await corsair.heygen.api.voices.getV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `voice_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > voice_id: string, > name?: string | null, > language?: string | null, > gender?: string | null, > preview_audio_url?: string | null, > status?: processing | complete | failed | null, > failure_message?: string | null, > support_pause?: boolean, > support_interactive_avatar?: boolean, > created_at?: number | null > } > ``` *** ### listBrandVoices `voices.listBrandVoices` Retrieve brand glossaries maintaining consistent terminology/pronunciation **Risk:** `read` ```ts theme={null} await corsair.heygen.api.voices.listBrandVoices({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > brand_voices: { > }[] > } > ``` *** ### listLocales `voices.listLocales` Retrieve available locales/dialects for multilingual voices **Risk:** `read` ```ts theme={null} await corsair.heygen.api.voices.listLocales({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > locales: { > }[] > } > ``` *** ### listTts `voices.listTts` Retrieve public and custom voices compatible with the Starfish model **Risk:** `read` ```ts theme={null} await corsair.heygen.api.voices.listTts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `string` | No | — | | `gender` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > voices: { > }[] > } > ``` *** ### listV1 `voices.listV1` Retrieve a metadata list of all available studio voices **Risk:** `read` ```ts theme={null} await corsair.heygen.api.voices.listV1({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > voices: { > }[] > } > ``` *** ### listV2 `voices.listV2` Retrieve a comprehensive list of available voice models and characteristics **Risk:** `read` ```ts theme={null} await corsair.heygen.api.voices.listV2({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > voices: { > }[] > } > ``` *** ### listV3 `voices.listV3` Retrieve a cursor-paginated list of voices via the v3 API **Risk:** `read` ```ts theme={null} await corsair.heygen.api.voices.listV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `public \| private` | No | — | | `engine` | `string` | No | — | | `language` | `string` | No | — | | `gender` | `male \| female` | No | — | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > voice_id: string, > name?: string | null, > language?: string | null, > gender?: string | null, > preview_audio_url?: string | null, > support_pause?: boolean, > support_locale?: boolean, > type?: public | private > }[] > ``` *** ## Webhooks Quota ### addEndpoint `webhooksQuota.addEndpoint` Configure a new webhook URL to receive notifications for specified events **Risk:** `write` ```ts theme={null} await corsair.heygen.api.webhooksQuota.addEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `events` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > endpoint_id: string > } > ``` *** ### addEndpointV3 `webhooksQuota.addEndpointV3` Register a new v3 webhook endpoint URL to receive event notifications **Risk:** `write` ```ts theme={null} await corsair.heygen.api.webhooksQuota.addEndpointV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `events` | `string[]` | No | — | | `entity_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > endpoint_id: string, > url: string, > events?: string[] | null, > status: string, > created_at: string, > secret?: string | null > } > ``` *** ### deleteEndpoint `webhooksQuota.deleteEndpoint` Permanently delete a webhook endpoint configuration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.webhooksQuota.deleteEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `endpoint_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### deleteEndpointV3 `webhooksQuota.deleteEndpointV3` Permanently delete a v3 webhook endpoint configuration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.heygen.api.webhooksQuota.deleteEndpointV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `endpoint_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### getCurrentUser `webhooksQuota.getCurrentUser` Retrieve the authenticated user profile, quotas, and subscription details **Risk:** `read` ```ts theme={null} await corsair.heygen.api.webhooksQuota.getCurrentUser({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > username: string, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > billing_type?: wallet | subscription | usage_based | null, > wallet?: { > }, > subscription?: { > }, > usage_based?: { > } > } > ``` *** ### listEndpoints `webhooksQuota.listEndpoints` Retrieve a list of configured webhook endpoints and status **Risk:** `read` ```ts theme={null} await corsair.heygen.api.webhooksQuota.listEndpoints({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### listEndpointsV3 `webhooksQuota.listEndpointsV3` Retrieve a paginated list of configured v3 webhook endpoints **Risk:** `read` ```ts theme={null} await corsair.heygen.api.webhooksQuota.listEndpointsV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > endpoint_id: string, > url: string, > events?: string[] | null, > status: string, > created_at: string, > secret?: string | null > }[] > ``` *** ### listEvents `webhooksQuota.listEvents` Retrieve a paginated log of delivered v3 webhook events **Risk:** `read` ```ts theme={null} await corsair.heygen.api.webhooksQuota.listEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_type` | `string` | No | — | | `entity_id` | `string` | No | — | | `limit` | `number` | No | — | | `token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > event_id: string, > event_type: string, > event_data: { > }, > created_at: string > }[] > ``` *** ### listEventTypes `webhooksQuota.listEventTypes` Retrieve a complete list of supported webhook event types **Risk:** `read` ```ts theme={null} await corsair.heygen.api.webhooksQuota.listEventTypes({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### listEventTypesV3 `webhooksQuota.listEventTypesV3` Retrieve all available v3 webhook event types with descriptions **Risk:** `read` ```ts theme={null} await corsair.heygen.api.webhooksQuota.listEventTypesV3({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > event_type: string, > description: string > }[] > ``` *** ### remainingQuota `webhooksQuota.remainingQuota` Retrieve the current remaining API credit quota and available resources **Risk:** `read` ```ts theme={null} await corsair.heygen.api.webhooksQuota.remainingQuota({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > remaining_quota?: number > } > ``` *** ### rotateSecret `webhooksQuota.rotateSecret` Rotate the signing secret for a v3 webhook endpoint **Risk:** `write` ```ts theme={null} await corsair.heygen.api.webhooksQuota.rotateSecret({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `endpoint_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > endpoint_id: string, > secret: string > } > ``` *** ### updateEndpoint `webhooksQuota.updateEndpoint` Modify the URL or subscribed events of an existing webhook endpoint **Risk:** `write` ```ts theme={null} await corsair.heygen.api.webhooksQuota.updateEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `endpoint_id` | `string` | Yes | — | | `url` | `string` | No | — | | `events` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `any` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### updateEndpointV3 `webhooksQuota.updateEndpointV3` Modify the URL or subscribed events of an existing v3 webhook endpoint **Risk:** `write` ```ts theme={null} await corsair.heygen.api.webhooksQuota.updateEndpointV3({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `endpoint_id` | `string` | Yes | — | | `url` | `string` | No | — | | `events` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > endpoint_id: string, > url: string, > events?: string[] | null, > status: string, > created_at: string, > secret?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/heygen/database HeyGen local sync: searchable entities, `.search()` filters, and operators. The HeyGen plugin syncs data locally. Use `corsair.heygen.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/heygen/overview AI video platform for creating avatar videos, translations, and personalized video content. Use **HeyGen** through Corsair: one client, typed API calls. **What you get:** * 135 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/heygen ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/heygen ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/heygen ``` ```bash bun theme={null} bun add corsair @corsair-dev/heygen ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { heygen } from '@corsair-dev/heygen'; export const corsair = createCorsair({ plugins: [ heygen(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} heygen() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'heygen', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`aiClipping.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.heygen.api.aiClipping.get({}); ``` **`aiClipping.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.heygen.api.aiClipping.create({}); ``` See the full list on the [API](/plugins/heygen/api) page. ## What's next > **[API reference](/plugins/heygen/api)** > > Every `heygen.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/hookdeck/api API reference for Hookdeck: every `hookdeck.api.*` operation with input and output types. Every `hookdeck.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Connections ### create `connections.create` Create a new connection **Risk:** `write` ```ts theme={null} await corsair.hookdeck.api.connections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `source_id` | `string` | No | — | | `destination_id` | `string` | No | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > type: string, > count?: number, > interval?: number, > strategy?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `team_id` | `string` | Yes | — | | `name` | `string` | No | — | | `full_name` | `string` | Yes | — | | `disabled_at` | `string` | No | — | | `paused_at` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > type: string, > count?: number, > interval?: number, > strategy?: string > }[] > ``` *** ### delete `connections.delete` Delete a connection **Risk:** `write` ```ts theme={null} await corsair.hookdeck.api.connections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `connections.get` Get a connection by ID **Risk:** `read` ```ts theme={null} await corsair.hookdeck.api.connections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `team_id` | `string` | Yes | — | | `name` | `string` | No | — | | `full_name` | `string` | Yes | — | | `disabled_at` | `string` | No | — | | `paused_at` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > type: string, > count?: number, > interval?: number, > strategy?: string > }[] > ``` *** ### list `connections.list` List all connections **Risk:** `read` ```ts theme={null} await corsair.hookdeck.api.connections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `next` | `string` | No | — | | `prev` | `string` | No | — | | `order_by` | `string` | No | — | | `dir` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `models` | `object[]` | Yes | — | | `count` | `number` | Yes | — | | `pagination` | `object` | No | — | > **models full type** > > ```ts theme={null} > { > id: string, > team_id: string, > name?: string | null, > full_name: string, > disabled_at?: string | null, > paused_at?: string | null, > created_at: string, > updated_at: string, > rules?: { > type: string, > count?: number, > interval?: number, > strategy?: string > }[] > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > order_by: string, > dir: asc | desc, > limit: number, > next?: string, > prev?: string > } > ``` *** ### update `connections.update` Update an existing connection **Risk:** `write` ```ts theme={null} await corsair.hookdeck.api.connections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > type: string, > count?: number, > interval?: number, > strategy?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `team_id` | `string` | Yes | — | | `name` | `string` | No | — | | `full_name` | `string` | Yes | — | | `disabled_at` | `string` | No | — | | `paused_at` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | | `rules` | `object[]` | No | — | > **rules full type** > > ```ts theme={null} > { > type: string, > count?: number, > interval?: number, > strategy?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/hookdeck/database Hookdeck local sync: searchable entities, `.search()` filters, and operators. The Hookdeck plugin syncs data locally. Use `corsair.hookdeck.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/hookdeck/overview Hookdeck plugin for Corsair Use **Hookdeck** through Corsair: one client, typed API calls. **What you get:** * 5 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/hookdeck ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/hookdeck ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/hookdeck ``` ```bash bun theme={null} bun add corsair @corsair-dev/hookdeck ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { hookdeck } from '@corsair-dev/hookdeck'; export const corsair = createCorsair({ plugins: [ hookdeck(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} hookdeck() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'hookdeck', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`connections.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hookdeck.api.connections.get({}); ``` **`connections.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hookdeck.api.connections.create({}); ``` See the full list on the [API](/plugins/hookdeck/api) page. ## What's next > **[API reference](/plugins/hookdeck/api)** > > Every `hookdeck.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/htmltoimage/api API reference for HTML to Image: every `htmltoimage.api.*` operation with input and output types. Every `htmltoimage.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### checkUsage `account.checkUsage` Check account usage and remaining credits **Risk:** `read` ```ts theme={null} await corsair.htmltoimage.api.account.checkUsage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `plan` | `string` | No | — | | `plan_name` | `string` | No | — | | `active` | `boolean` | Yes | — | | `free_plan` | `boolean` | Yes | — | | `credits_remaining` | `number` | Yes | — | | `credits_reset_at` | `string` | No | — | *** ## Html ### convertToImage `html.convertToImage` Convert HTML or a public URL into an image **Risk:** `write` ```ts theme={null} await corsair.htmltoimage.api.html.convertToImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `css` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `fullpage` | `boolean` | No | — | | `dpi` | `number` | No | — | | `format` | `png \| pdf` | No | — | | `scale_to_fit` | `boolean` | No | — | | `ms_delay` | `number` | No | — | | `webhook_url` | `string` | No | — | | `wait_for_selector` | `string` | No | — | | `html` | `string` | No | — | | `url` | `string` | No | — | | `selector` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `id` | `string` | Yes | — | | `url` | `string` | No | — | | `credits_remaining` | `number` | No | — | | `expires_at` | `string` | No | — | | `status` | `processing` | No | — | | `message` | `string` | No | — | *** ## Image ### getImage `image.getImage` Retrieve a generated image **Risk:** `read` ```ts theme={null} await corsair.htmltoimage.api.image.getImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/htmltoimage/database HTML to Image local sync: searchable entities, `.search()` filters, and operators. The HTML to Image plugin syncs data locally. Use `corsair.htmltoimage.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `htmltoimage.db.accounts.search` ```ts theme={null} const rows = await corsair.htmltoimage.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `plan` | `string` | equals, contains, startsWith, endsWith, in | | `plan_name` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `free_plan` | `boolean` | equals | | `credits_remaining` | `number` | equals, gt, gte, lt, lte, in | | `credits_reset_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Renders Path: `htmltoimage.db.renders.search` ```ts theme={null} const rows = await corsair.htmltoimage.db.renders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `credits_remaining` | `number` | equals, gt, gte, lt, lte, in | | `expires_at` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/htmltoimage/overview Screenshot API for converting HTML, URLs, and templates into PNG or JPEG images. Use **HTML to Image** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 3 typed API operations * 2 synced entities (`accounts`, `renders`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/htmltoimage ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/htmltoimage ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/htmltoimage ``` ```bash bun theme={null} bun add corsair @corsair-dev/htmltoimage ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { htmltoimage } from '@corsair-dev/htmltoimage'; export const corsair = createCorsair({ plugins: [ htmltoimage(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} htmltoimage() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'htmltoimage', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.checkUsage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.htmltoimage.api.account.checkUsage({}); ``` **`html.convertToImage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.htmltoimage.api.html.convertToImage({}); ``` See the full list on the [API](/plugins/htmltoimage/api) page. ## Query synced data Synced entities support `tenant.htmltoimage.db..search()` and `.list()`: `accounts`, `renders`. See [Database](/plugins/htmltoimage/database) for filters and operators. ## What's next > **[API reference](/plugins/htmltoimage/api)** > > Every `htmltoimage.api.*` operation with input and output types. > **[Database](/plugins/htmltoimage/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/hubspot/api API reference for HubSpot: every `hubspot.api.*` operation with input and output types. Every `hubspot.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Companies ### create `companies.create` Create a new company **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.companies.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `properties` | `object` | No | — | | `associations` | `object[]` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > to: { > id: string > }, > types: { > associationCategory: string, > associationTypeId: number > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ### delete `companies.delete` Permanently delete a company \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hubspot.api.companies.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companyId` | `string` | Yes | — | **Output:** `void` *** ### get `companies.get` Get a specific company **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.companies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companyId` | `string` | Yes | — | | `properties` | `string[]` | No | — | | `propertiesWithHistory` | `string[]` | No | — | | `associations` | `string[]` | No | — | | `archived` | `boolean` | No | — | | `idProperty` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ### getMany `companies.getMany` Get multiple companies **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.companies.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `properties` | `string[]` | No | — | | `propertiesWithHistory` | `string[]` | No | — | | `associations` | `string[]` | No | — | | `archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### getRecentlyCreated `companies.getRecentlyCreated` List recently created companies **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.companies.getRecentlyCreated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `after` | `string` | No | — | | `since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### getRecentlyUpdated `companies.getRecentlyUpdated` List recently updated companies **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.companies.getRecentlyUpdated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `after` | `string` | No | — | | `since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### searchByDomain `companies.searchByDomain` Search companies by domain name **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.companies.searchByDomain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `properties` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### update `companies.update` Update an existing company **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.companies.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companyId` | `string` | Yes | — | | `properties` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ## Contact Lists ### addContact `contactLists.addContact` Add a contact to a static contact list **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.contactLists.addContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `emails` | `string[]` | No | — | | `vids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `updated` | `number[]` | No | — | | `discarded` | `number[]` | No | — | | `invalidVids` | `number[]` | No | — | | `invalidEmails` | `string[]` | No | — | *** ### removeContact `contactLists.removeContact` Remove a contact from a static contact list **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.contactLists.removeContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `emails` | `string[]` | No | — | | `vids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `updated` | `number[]` | No | — | | `discarded` | `number[]` | No | — | | `invalidVids` | `number[]` | No | — | | `invalidEmails` | `string[]` | No | — | *** ## Contacts ### create `contacts.create` Create a new contact **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `properties` | `object` | No | — | | `associations` | `object[]` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > to: { > id: string > }, > types: { > associationCategory: string, > associationTypeId: number > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ### delete `contacts.delete` Permanently delete a contact \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hubspot.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | **Output:** `void` *** ### get `contacts.get` Get a specific contact **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | | `properties` | `string[]` | No | — | | `propertiesWithHistory` | `string[]` | No | — | | `associations` | `string[]` | No | — | | `archived` | `boolean` | No | — | | `idProperty` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ### getMany `contacts.getMany` Get multiple contacts **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.contacts.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `properties` | `string[]` | No | — | | `propertiesWithHistory` | `string[]` | No | — | | `associations` | `string[]` | No | — | | `archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### getRecentlyCreated `contacts.getRecentlyCreated` List recently created contacts **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.contacts.getRecentlyCreated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `after` | `string` | No | — | | `since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### getRecentlyUpdated `contacts.getRecentlyUpdated` List recently updated contacts **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.contacts.getRecentlyUpdated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `after` | `string` | No | — | | `since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### search `contacts.search` Search contacts **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.contacts.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `sorts` | `object[]` | No | — | | `properties` | `string[]` | No | — | | `filterGroups` | `object[]` | No | — | > **sorts full type** > > ```ts theme={null} > { > propertyName: string, > direction: ASCENDING | DESCENDING > }[] > ``` > **filterGroups full type** > > ```ts theme={null} > { > filters: { > operator: BETWEEN | CONTAINS_TOKEN | EQ | GT | GTE | HAS_PROPERTY | IN | LT | LTE | NEQ | NOT_CONTAINS_TOKEN | NOT_HAS_PROPERTY | NOT_IN, > propertyName: string, > highValue?: string, > value?: string, > values?: string[] > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### update `contacts.update` Update an existing contact **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | | `properties` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ## Deals ### create `deals.create` Create a new deal **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.deals.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `properties` | `object` | No | — | | `associations` | `object[]` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > to: { > id: string > }, > types: { > associationCategory: string, > associationTypeId: number > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ### delete `deals.delete` Permanently delete a deal \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hubspot.api.deals.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dealId` | `string` | Yes | — | **Output:** `void` *** ### get `deals.get` Get a specific deal **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.deals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dealId` | `string` | Yes | — | | `properties` | `string[]` | No | — | | `propertiesWithHistory` | `string[]` | No | — | | `associations` | `string[]` | No | — | | `archived` | `boolean` | No | — | | `idProperty` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ### getMany `deals.getMany` Get multiple deals **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.deals.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `properties` | `string[]` | No | — | | `propertiesWithHistory` | `string[]` | No | — | | `associations` | `string[]` | No | — | | `archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### getRecentlyCreated `deals.getRecentlyCreated` List recently created deals **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.deals.getRecentlyCreated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `after` | `string` | No | — | | `since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### getRecentlyUpdated `deals.getRecentlyUpdated` List recently updated deals **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.deals.getRecentlyUpdated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `after` | `string` | No | — | | `since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### search `deals.search` Search deals **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.deals.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `sorts` | `object[]` | No | — | | `properties` | `string[]` | No | — | | `filterGroups` | `object[]` | No | — | > **sorts full type** > > ```ts theme={null} > { > propertyName: string, > direction: ASCENDING | DESCENDING > }[] > ``` > **filterGroups full type** > > ```ts theme={null} > { > filters: { > operator: BETWEEN | CONTAINS_TOKEN | EQ | GT | GTE | HAS_PROPERTY | IN | LT | LTE | NEQ | NOT_CONTAINS_TOKEN | NOT_HAS_PROPERTY | NOT_IN, > propertyName: string, > highValue?: string, > value?: string, > values?: string[] > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### update `deals.update` Update an existing deal **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.deals.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dealId` | `string` | Yes | — | | `properties` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ## Engagements ### create `engagements.create` Create a new engagement **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.engagements.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `engagement` | `object` | Yes | — | | `associations` | `object` | No | — | | `metadata` | `object` | No | — | > **engagement full type** > > ```ts theme={null} > { > active?: boolean, > type: string, > timestamp?: number > } > ``` > **associations full type** > > ```ts theme={null} > { > contactIds?: number[], > companyIds?: number[], > dealIds?: number[], > ownerIds?: number[] > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `engagement` | `object` | No | — | | `associations` | `object` | No | — | | `metadata` | `object` | No | — | > **engagement full type** > > ```ts theme={null} > { > id?: number, > portalId?: number, > active?: boolean, > createdAt?: number, > lastUpdated?: number, > createdBy?: number, > modifiedBy?: number, > ownerId?: number, > type?: string, > timestamp?: number > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `engagements.delete` Permanently delete an engagement \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hubspot.api.engagements.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `engagementId` | `string` | Yes | — | **Output:** `void` *** ### get `engagements.get` Get a specific engagement **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.engagements.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `engagementId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `engagement` | `object` | No | — | | `associations` | `object` | No | — | | `metadata` | `object` | No | — | > **engagement full type** > > ```ts theme={null} > { > id?: number, > portalId?: number, > active?: boolean, > createdAt?: number, > lastUpdated?: number, > createdBy?: number, > modifiedBy?: number, > ownerId?: number, > type?: string, > timestamp?: number > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### getMany `engagements.getMany` Get multiple engagements **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.engagements.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > engagement?: { > id?: number, > portalId?: number, > active?: boolean, > createdAt?: number, > lastUpdated?: number, > createdBy?: number, > modifiedBy?: number, > ownerId?: number, > type?: string, > timestamp?: number > }, > associations?: { > }, > metadata?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ## Tickets ### create `tickets.create` Create a new support ticket **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.tickets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `properties` | `object` | No | — | | `associations` | `object[]` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > to: { > id: string > }, > types: { > associationCategory: string, > associationTypeId: number > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ### delete `tickets.delete` Permanently delete a ticket \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hubspot.api.tickets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticketId` | `string` | Yes | — | **Output:** `void` *** ### get `tickets.get` Get a specific ticket **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.tickets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticketId` | `string` | Yes | — | | `properties` | `string[]` | No | — | | `propertiesWithHistory` | `string[]` | No | — | | `associations` | `string[]` | No | — | | `archived` | `boolean` | No | — | | `idProperty` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** ### getMany `tickets.getMany` Get multiple tickets **Risk:** `read` ```ts theme={null} await corsair.hubspot.api.tickets.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `properties` | `string[]` | No | — | | `propertiesWithHistory` | `string[]` | No | — | | `associations` | `string[]` | No | — | | `archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `paging` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id: string, > properties?: { > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archived?: boolean, > associations?: { > } > }[] > ``` > **paging full type** > > ```ts theme={null} > { > next?: { > after: string > }, > prev?: { > before: string > } > } > ``` *** ### update `tickets.update` Update an existing ticket **Risk:** `write` ```ts theme={null} await corsair.hubspot.api.tickets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticketId` | `string` | Yes | — | | `properties` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `properties` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archived` | `boolean` | No | — | | `associations` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **associations full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/hubspot/database HubSpot local sync: searchable entities, `.search()` filters, and operators. The HubSpot plugin syncs data locally. Use `corsair.hubspot.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Companies Path: `hubspot.db.companies.search` ```ts theme={null} const rows = await corsair.hubspot.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `archived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `hubspot.db.contacts.search` ```ts theme={null} const rows = await corsair.hubspot.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `archived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deals Path: `hubspot.db.deals.search` ```ts theme={null} const rows = await corsair.hubspot.db.deals.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `archived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Engagements Path: `hubspot.db.engagements.search` ```ts theme={null} const rows = await corsair.hubspot.db.engagements.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tickets Path: `hubspot.db.tickets.search` ```ts theme={null} const rows = await corsair.hubspot.db.tickets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `archived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/hubspot/get-credentials Step-by-step instructions for obtaining HubSpot API keys, OAuth credentials, and webhook secrets. This guide walks you through obtaining all required credentials for the HubSpot plugin. ## Authentication Methods The HubSpot plugin supports both API key and OAuth 2.0 authentication methods. * **[`api_key`](/concepts/api-key)** - Private App API key authentication * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 authentication ## API Key Authentication (Private App) ### Step 1: Create Private App 1. Go to HubSpot Settings 2. Navigate to **Integrations** → **Private Apps** 3. Click **Create a private app** 4. Enter an app name 5. Click **Create app** ### Step 2: Configure Scopes 1. In your private app settings, go to **Scopes** tab 2. Select the required scopes: * `crm.objects.contacts.read` * `crm.objects.contacts.write` * `crm.objects.companies.read` * `crm.objects.companies.write` * `crm.objects.deals.read` * `crm.objects.deals.write` * `crm.objects.tickets.read` * `crm.objects.tickets.write` * `engagements.read` * `engagements.write` * Add any other scopes your application needs 3. Click **Save** ### Step 3: Get API Key 1. Go to the **Overview** tab 2. Under **API key**, click **Show** to reveal the key 3. Copy the API key 4. Store it securely **Storing Credentials:** Store the API key with the Corsair CLI: ```bash theme={null} pnpm corsair setup --plugin=hubspot api_key=your-api-key ``` Verify it was saved: ```bash theme={null} pnpm corsair auth --plugin=hubspot --credentials ``` ## OAuth 2.0 Authentication ### Step 1: Create App 1. Go to [HubSpot Developer Portal](https://developers.hubspot.com/) 2. Click **Create app** 3. Enter your app name and click **Create app** ### Step 2: Configure OAuth Settings 1. In your app settings, go to **Auth** tab 2. Under **Redirect URLs**, click **Add** 3. Add your OAuth redirect URL (e.g., `https://yourapp.com/auth/hubspot/callback`) 4. Click **Save** ### Step 3: Get Client Credentials 1. In the **Auth** tab, you'll see your **Client ID** 2. Click **Show** next to **Client Secret** to reveal it 3. Copy the **Client ID** and **Client Secret** 4. Store these securely **Storing Credentials:** Store your OAuth app credentials, then start the flow: ```bash theme={null} pnpm corsair setup --plugin=hubspot client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=hubspot ``` The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically. ## Webhook Secret ### Step 1: Create Webhook Subscription 1. Go to [HubSpot Settings](https://app.hubspot.com/settings) 2. Navigate to **Integrations** → **Private Apps** 3. Select your private app (or create one if needed) 4. Go to **Webhooks** tab 5. Click **Create subscription** 6. Configure: * **Event type**: Select from: * Contact created/updated/deleted * Company created/updated/deleted * Deal created/updated/deleted * Ticket created/updated/deleted * **Webhook URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`) 7. Click **Save** 8. If a webhook secret is provided, copy it and store securely **Storing Credentials:** Store the webhook secret with the CLI: ```bash theme={null} pnpm corsair setup --plugin=hubspot webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Key | API Key auth | Settings → Integrations → Private Apps → Overview | | Client ID | OAuth 2.0 | Developer Portal → App Settings → Auth | | Client Secret | OAuth 2.0 | Developer Portal → App Settings → Auth | | Webhook Secret | Webhooks | Settings → Integrations → Private Apps → Webhooks | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/hubspot/overview CRM and marketing platform for contacts, deals, tickets, email, and sales automation. Use **HubSpot** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 35 typed API operations * 5 synced entities (`companies`, `contacts`, `deals`, `engagements`, `tickets`) for fast `.search()` / `.list()` * 12 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/hubspot ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/hubspot ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/hubspot ``` ```bash bun theme={null} bun add corsair @corsair-dev/hubspot ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { hubspot } from '@corsair-dev/hubspot'; export const corsair = createCorsair({ plugins: [ hubspot({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **HubSpot** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/hubspot/get-credentials). ```ts theme={null} hubspot({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. Provider walkthrough: [Get Credentials](/plugins/hubspot/get-credentials). ```ts theme={null} hubspot() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your HubSpot OAuth app. Provider walkthrough: [Get Credentials](/plugins/hubspot/get-credentials). ```ts theme={null} hubspot({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'hubspot', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Get contacts** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hubspot.api.contacts.getMany({}); ``` **Create a contact** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hubspot.api.contacts.create({}); ``` See the full list on the [API](/plugins/hubspot/api) page. ## Query synced data Search synced contacts without hitting HubSpot. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.hubspot.db.contacts.search({ data: {}, limit: 50, }); ``` Synced entities: `companies`, `contacts`, `deals`, `engagements`, `tickets`. See [Database](/plugins/hubspot/database) for filters and operators. ## Webhooks Fires when a new contact is created in HubSpot. ```ts theme={null} hubspot({ webhookHooks: { contactCreated: { after: async (ctx, result) => { console.log('HubSpot contact created:', result.data); } }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/hubspot/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/hubspot/api)** > > Every `hubspot.api.*` operation with input and output types. > **[Database](/plugins/hubspot/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/hubspot/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/hubspot/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/hubspot/webhooks HubSpot incoming webhooks: event paths, payloads, and response data. The HubSpot plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/hubspot/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `companyCreated` (`companyCreated`) * `companyDeleted` (`companyDeleted`) * `companyUpdated` (`companyUpdated`) * `contactCreated` (`contactCreated`) * `contactDeleted` (`contactDeleted`) * `contactUpdated` (`contactUpdated`) * `dealCreated` (`dealCreated`) * `dealDeleted` (`dealDeleted`) * `dealUpdated` (`dealUpdated`) * `ticketCreated` (`ticketCreated`) * `ticketDeleted` (`ticketDeleted`) * `ticketUpdated` (`ticketUpdated`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Company Created ### Company Created `companyCreated` A new company was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `company.creation` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | No | — | | `propertyValue` | `string` | No | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { companyCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Company Deleted ### Company Deleted `companyDeleted` A company was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `company.deletion` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | No | — | | `propertyValue` | `string` | No | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { companyDeleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Company Updated ### Company Updated `companyUpdated` A company property was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `company.propertyChange` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | Yes | — | | `propertyValue` | `string` | Yes | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { companyUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Contact Created ### Contact Created `contactCreated` A new contact was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `contact.creation` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | No | — | | `propertyValue` | `string` | No | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { contactCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Contact Deleted ### Contact Deleted `contactDeleted` A contact was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `contact.deletion` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | No | — | | `propertyValue` | `string` | No | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { contactDeleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Contact Updated ### Contact Updated `contactUpdated` A contact property was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `contact.propertyChange` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | Yes | — | | `propertyValue` | `string` | Yes | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { contactUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Deal Created ### Deal Created `dealCreated` A new deal was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `deal.creation` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | No | — | | `propertyValue` | `string` | No | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { dealCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Deal Deleted ### Deal Deleted `dealDeleted` A deal was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `deal.deletion` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | No | — | | `propertyValue` | `string` | No | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { dealDeleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Deal Updated ### Deal Updated `dealUpdated` A deal property was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `deal.propertyChange` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | Yes | — | | `propertyValue` | `string` | Yes | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { dealUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Ticket Created ### Ticket Created `ticketCreated` A new support ticket was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `ticket.creation` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | No | — | | `propertyValue` | `string` | No | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { ticketCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Ticket Deleted ### Ticket Deleted `ticketDeleted` A support ticket was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `ticket.deletion` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | No | — | | `propertyValue` | `string` | No | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { ticketDeleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Ticket Updated ### Ticket Updated `ticketUpdated` A support ticket property was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `number` | Yes | — | | `portalId` | `number` | Yes | — | | `occurredAt` | `number` | Yes | — | | `subscriptionType` | `ticket.propertyChange` | Yes | — | | `attemptNumber` | `number` | Yes | — | | `objectId` | `number` | Yes | — | | `propertyName` | `string` | Yes | — | | `propertyValue` | `string` | Yes | — | | `changeSource` | `string` | No | — | | `eventId` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} hubspot({ webhookHooks: { ticketUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/huggingface/api API reference for Hugging Face: every `huggingface.api.*` operation with input and output types. Every `huggingface.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### deleteNotifications `account.deleteNotifications` Delete notifications by discussion ids or filters **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.account.deleteNotifications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `discussionIds` | `string[]` | No | — | | `applyToAll` | `boolean` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getWhoami `account.getWhoami` Get authenticated Hugging Face user info **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.account.getWhoami({}); ``` **Input:** *empty object* **Output:** `any` *** ### listNotifications `account.listNotifications` List notifications for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.account.listNotifications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `read` | `boolean` | No | — | | `type` | `string` | No | — | | `page` | `number` | No | — | **Output:** `any` *** ## Collections ### create `collections.create` Create a new collection **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.collections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `namespace` | `string` | Yes | — | | `description` | `string` | No | — | | `private` | `boolean` | No | — | **Output:** `any` *** ### list `collections.list` List collections on the Hub **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.collections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | No | — | | `item` | `string` | No | — | | `sort` | `string` | No | — | | `limit` | `number` | No | — | | `p` | `number` | No | — | | `q` | `string` | No | — | **Output:** `any` *** ## Datasets ### checkUploadMethod `datasets.checkUploadMethod` Check LFS vs regular upload method for dataset files **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.checkUploadMethod({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `files` | `object[]` | Yes | — | | `gitAttributes` | `string` | No | — | | `gitIgnore` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > path: string, > size: number, > sample: string > }[] > ``` **Output:** `any` *** ### checkValidity `datasets.checkValidity` Check whether a dataset is valid on the Hub viewer **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.checkValidity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | No | — | | `split` | `string` | No | — | **Output:** `any` *** ### createBranch `datasets.createBranch` Create a branch on a dataset **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.datasets.createBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `branch` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `startingPoint` | `string` | No | — | | `emptyBranch` | `boolean` | No | — | | `overwrite` | `boolean` | No | — | **Output:** `any` *** ### createCommit `datasets.createCommit` Create a commit on a dataset (Hub NDJSON/JSON: files, deletedEntries, lfsFiles) **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.datasets.createCommit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `summary` | `string` | Yes | — | | `description` | `string` | No | — | | `parentCommit` | `string` | No | — | | `createPr` | `boolean` | No | — | | `hotReload` | `boolean` | No | — | | `format` | `json \| ndjson` | No | — | | `files` | `object[]` | No | — | | `deletedEntries` | `object[]` | No | — | | `lfsFiles` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > path: string, > content?: string, > encoding?: utf-8 | base64, > oldPath?: string > }[] > ``` > **deletedEntries full type** > > ```ts theme={null} > { > path: string > }[] > ``` > **lfsFiles full type** > > ```ts theme={null} > { > path: string, > oid?: string, > algo?: sha256, > size?: number, > oldPath?: string > }[] > ``` **Output:** `any` *** ### createSqlConsoleEmbed `datasets.createSqlConsoleEmbed` Create a SQL Console embed for a dataset **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.datasets.createSqlConsoleEmbed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `repoType` | `dataset` | Yes | — | | `title` | `string` | No | — | | `sql` | `string` | Yes | — | | `private` | `boolean` | No | — | **Output:** `any` *** ### createTag `datasets.createTag` Create a tag on a dataset **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.datasets.createTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `tag` | `string` | Yes | — | | `message` | `string` | No | — | **Output:** `any` *** ### deleteBranch `datasets.deleteBranch` Delete a branch on a dataset **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.datasets.deleteBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `branch` | `string` | Yes | — | **Output:** `any` *** ### deleteTag `datasets.deleteTag` Delete a tag on a dataset **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.datasets.deleteTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output:** `any` *** ### filterRows `datasets.filterRows` Filter dataset rows with SQL-like where clause **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.filterRows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | Yes | — | | `split` | `string` | Yes | — | | `where` | `string` | Yes | — | | `orderby` | `string` | No | — | | `offset` | `number` | No | — | | `length` | `number` | No | — | **Output:** `any` *** ### get `datasets.get` Get dataset repository info **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | No | — | | `full` | `boolean` | No | — | **Output:** `any` *** ### getCompare `datasets.getCompare` Compare two revisions of a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getCompare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `compare` | `string` | Yes | e.g. main...other or sha1...sha2 | **Output:** `any` *** ### getCroissant `datasets.getCroissant` Get Croissant JSON-LD metadata for a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getCroissant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | No | — | | `split` | `string` | No | — | **Output:** `any` *** ### getFirstRows `datasets.getFirstRows` Get first \~100 rows of a dataset split **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getFirstRows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | Yes | — | | `split` | `string` | Yes | — | **Output:** `any` *** ### getInfo `datasets.getInfo` Get dataset info (features, splits, citation) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | No | — | | `split` | `string` | No | — | **Output:** `any` *** ### getJwt `datasets.getJwt` Get JWT for a dataset repo **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getJwt({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `write` | `boolean` | No | — | | `expireAt` | `number` | No | — | **Output:** `any` *** ### getLeaderboard `datasets.getLeaderboard` Get evaluation leaderboard for a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getLeaderboard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | namespace/repo | **Output:** `any` *** ### getNotebook `datasets.getNotebook` Get notebook URL from a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getNotebook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | **Output:** `any` *** ### getResolve `datasets.getResolve` Resolve a file from a dataset (follows redirects / XET info) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getResolve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | | `xetFileInfo` | `boolean` | No | — | **Output:** `any` *** ### getResolveCache `datasets.getResolveCache` Resolve a file from dataset cache **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getResolveCache({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | | `xetFileInfo` | `boolean` | No | — | **Output:** `any` *** ### getRows `datasets.getRows` Get a slice of dataset rows (offset/length) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getRows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | Yes | — | | `split` | `string` | Yes | — | | `offset` | `number` | Yes | — | | `length` | `number` | Yes | — | **Output:** `any` *** ### getScan `datasets.getScan` Get security scan status for a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getScan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | namespace/repo | **Output:** `any` *** ### getSize `datasets.getSize` Get dataset size (rows and bytes) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getSize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | No | — | | `split` | `string` | No | — | **Output:** `any` *** ### getStatistics `datasets.getStatistics` Get statistics for a dataset split **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | Yes | — | | `split` | `string` | Yes | — | **Output:** `any` *** ### getTagsByType `datasets.getTagsByType` Get dataset tags grouped by type **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getTagsByType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | **Output:** `any` *** ### getTreeSize `datasets.getTreeSize` Get repository tree size for a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getTreeSize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | **Output:** `any` *** ### getXetReadToken `datasets.getXetReadToken` Get XET read token for a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.getXetReadToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | **Output:** `any` *** ### handleAccessRequest `datasets.handleAccessRequest` Accept/reject gated dataset access request **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.datasets.handleAccessRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `user` | `string` | No | — | | `userId` | `string` | No | — | | `status` | `accepted \| rejected \| pending` | Yes | — | **Output:** `any` *** ### list `datasets.list` List datasets on the Hub **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `author` | `string` | No | — | | `filter` | `string` | No | — | | `sort` | `string` | No | — | | `direction` | `-1 \| 1 \| string` | No | — | | `limit` | `number` | No | — | | `p` | `number` | No | — | | `full` | `boolean` | No | — | | `config` | `boolean` | No | — | **Output:** `any` *** ### listAccessRequests `datasets.listAccessRequests` List access requests for a gated dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.listAccessRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `status` | `pending \| accepted \| rejected` | Yes | — | **Output:** `any` *** ### listCommits `datasets.listCommits` List commits for a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.listCommits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `limit` | `number` | No | — | | `p` | `number` | No | — | **Output:** `any` *** ### listParquetFiles `datasets.listParquetFiles` List Parquet files for a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.listParquetFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | No | — | | `split` | `string` | No | — | **Output:** `any` *** ### listPathsInfo `datasets.listPathsInfo` List path metadata in a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.listPathsInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `paths` | `string[]` | Yes | — | | `expand` | `boolean` | No | — | **Output:** `any` *** ### listRefs `datasets.listRefs` List refs (branches/tags) for a dataset **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.listRefs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `includePullRequests` | `boolean` | No | — | **Output:** `any` *** ### listSplits `datasets.listSplits` List dataset configurations and splits **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.listSplits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | No | — | | `split` | `string` | No | — | **Output:** `any` *** ### search `datasets.search` Full-text search within a dataset split **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.datasets.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `string` | Yes | — | | `config` | `string` | Yes | — | | `split` | `string` | Yes | — | | `query` | `string` | Yes | — | | `offset` | `number` | No | — | | `length` | `number` | No | — | **Output:** `any` *** ### squashCommits `datasets.squashCommits` Squash all commits in a dataset ref (irreversible) **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.datasets.squashCommits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `message` | `string` | Yes | — | **Output:** `any` *** ### updateSettings `datasets.updateSettings` Update settings for a dataset repository **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.datasets.updateSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `private` | `boolean` | No | — | | `gated` | `boolean \| string` | No | — | | `discussionsDisabled` | `boolean` | No | — | | `extra` | `object` | No | — | > **extra full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSqlConsoleEmbed `datasets.updateSqlConsoleEmbed` Update a SQL Console embed **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.datasets.updateSqlConsoleEmbed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `repoType` | `dataset` | Yes | — | | `embedId` | `string` | Yes | — | | `title` | `string` | No | — | | `sql` | `string` | No | — | | `private` | `boolean` | No | — | **Output:** `any` *** ## Discussions ### changeStatus `discussions.changeStatus` Open or close a discussion **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.discussions.changeStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `discussionNum` | `number` | Yes | — | | `status` | `open \| closed` | Yes | — | **Output:** `any` *** ### create `discussions.create` Create a discussion on a repository **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.discussions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `pullRequest` | `boolean` | No | — | **Output:** `any` *** ### createComment `discussions.createComment` Comment on a discussion **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.discussions.createComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `discussionNum` | `number` | Yes | — | | `comment` | `string` | Yes | — | **Output:** `any` *** ### delete `discussions.delete` Delete a discussion **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.discussions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `discussionNum` | `number` | Yes | — | **Output:** `any` *** ### get `discussions.get` Get discussion details **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.discussions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `discussionNum` | `number` | Yes | — | **Output:** `any` *** ### list `discussions.list` List discussions for a repository **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.discussions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `status` | `open \| closed \| all` | No | — | | `type` | `discussion \| pull_request` | No | — | | `p` | `number` | No | — | **Output:** `any` *** ### pin `discussions.pin` Pin or unpin a discussion **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.discussions.pin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `discussionNum` | `number` | Yes | — | | `pinned` | `boolean` | Yes | — | **Output:** `any` *** ### updateTitle `discussions.updateTitle` Update discussion title **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.discussions.updateTitle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `discussionNum` | `number` | Yes | — | | `title` | `string` | Yes | — | **Output:** `any` *** ## Docs ### list `docs.list` List available Hugging Face documentation **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.docs.list({}); ``` **Input:** *empty object* **Output:** `any` *** ### search `docs.search` Search Hugging Face documentation **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.docs.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `product` | `string` | No | — | **Output:** `any` *** ## Endpoints ### deleteNetworkCidr `endpoints.deleteNetworkCidr` Delete a network CIDR list entry for Inference Endpoints **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.endpoints.deleteNetworkCidr({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `cidr` | `string` | Yes | — | **Output:** `any` *** ### list `endpoints.list` List Inference Endpoints for a namespace **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.endpoints.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `namespace` | `string` | Yes | — | | `name` | `string` | No | — | **Output:** `any` *** ### listVendors `endpoints.listVendors` List cloud provider vendors for Inference Endpoints **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.endpoints.listVendors({}); ``` **Input:** *empty object* **Output:** `any` *** ## Inference ### chatCompletion `inference.chatCompletion` Generate chat completion via Inference Providers (OpenAI-compatible) **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.inference.chatCompletion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `temperature` | `number` | No | — | | `maxTokens` | `number` | No | — | | `extra` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` > **extra full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### embeddings `inference.embeddings` Generate text embeddings via Inference Providers **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.inference.embeddings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `string \| string[]` | Yes | — | | `extra` | `object` | No | — | > **extra full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Jobs ### getHardware `jobs.getHardware` List available Jobs hardware **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.jobs.getHardware({}); ``` **Input:** *empty object* **Output:** `any` *** ## Models ### checkUploadMethod `models.checkUploadMethod` Check LFS vs regular upload method for model files **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.checkUploadMethod({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `files` | `object[]` | Yes | — | | `gitAttributes` | `string` | No | — | | `gitIgnore` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > path: string, > size: number, > sample: string > }[] > ``` **Output:** `any` *** ### createBranch `models.createBranch` Create a branch on a model **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.models.createBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `branch` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `startingPoint` | `string` | No | — | | `emptyBranch` | `boolean` | No | — | | `overwrite` | `boolean` | No | — | **Output:** `any` *** ### createCommit `models.createCommit` Create a commit on a model (Hub NDJSON/JSON: files, deletedEntries, lfsFiles) **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.models.createCommit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `summary` | `string` | Yes | — | | `description` | `string` | No | — | | `parentCommit` | `string` | No | — | | `createPr` | `boolean` | No | — | | `hotReload` | `boolean` | No | — | | `format` | `json \| ndjson` | No | — | | `files` | `object[]` | No | — | | `deletedEntries` | `object[]` | No | — | | `lfsFiles` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > path: string, > content?: string, > encoding?: utf-8 | base64, > oldPath?: string > }[] > ``` > **deletedEntries full type** > > ```ts theme={null} > { > path: string > }[] > ``` > **lfsFiles full type** > > ```ts theme={null} > { > path: string, > oid?: string, > algo?: sha256, > size?: number, > oldPath?: string > }[] > ``` **Output:** `any` *** ### createTag `models.createTag` Create a tag on a model **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.models.createTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `tag` | `string` | Yes | — | | `message` | `string` | No | — | **Output:** `any` *** ### deleteBranch `models.deleteBranch` Delete a branch on a model **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.models.deleteBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `branch` | `string` | Yes | — | **Output:** `any` *** ### deleteTag `models.deleteTag` Delete a tag on a model **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.models.deleteTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output:** `any` *** ### get `models.get` Get model repository info **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | No | — | | `full` | `boolean` | No | — | **Output:** `any` *** ### getCompare `models.getCompare` Compare two revisions of a model **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.getCompare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `compare` | `string` | Yes | e.g. main...other or sha1...sha2 | **Output:** `any` *** ### getJwt `models.getJwt` Get JWT for a model repo **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.getJwt({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `write` | `boolean` | No | — | | `expireAt` | `number` | No | — | **Output:** `any` *** ### getNotebook `models.getNotebook` Get notebook URL from a model **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.getNotebook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | **Output:** `any` *** ### getResolve `models.getResolve` Resolve a file from a model (follows redirects / XET info) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.getResolve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | | `xetFileInfo` | `boolean` | No | — | **Output:** `any` *** ### getResolveCache `models.getResolveCache` Resolve a file from model cache **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.getResolveCache({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | | `xetFileInfo` | `boolean` | No | — | **Output:** `any` *** ### getScan `models.getScan` Get security scan status for a model **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.getScan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | namespace/repo | **Output:** `any` *** ### getTagsByType `models.getTagsByType` Get model tags grouped by type **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.getTagsByType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | **Output:** `any` *** ### getTreeSize `models.getTreeSize` Get repository tree size for a model **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.getTreeSize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | **Output:** `any` *** ### getXetReadToken `models.getXetReadToken` Get XET read token for a model **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.getXetReadToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | **Output:** `any` *** ### list `models.list` List models on the Hub **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `author` | `string` | No | — | | `filter` | `string` | No | — | | `sort` | `string` | No | — | | `direction` | `-1 \| 1 \| string` | No | — | | `limit` | `number` | No | — | | `p` | `number` | No | — | | `full` | `boolean` | No | — | | `config` | `boolean` | No | — | **Output:** `any` *** ### listCommits `models.listCommits` List commits for a model **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.listCommits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `limit` | `number` | No | — | | `p` | `number` | No | — | **Output:** `any` *** ### listPathsInfo `models.listPathsInfo` List path metadata in a model **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.listPathsInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `paths` | `string[]` | Yes | — | | `expand` | `boolean` | No | — | **Output:** `any` *** ### listRefs `models.listRefs` List refs (branches/tags) for a model **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.models.listRefs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `includePullRequests` | `boolean` | No | — | **Output:** `any` *** ### updateSettings `models.updateSettings` Update settings for a model repository **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.models.updateSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `private` | `boolean` | No | — | | `gated` | `boolean \| string` | No | — | | `discussionsDisabled` | `boolean` | No | — | | `extra` | `object` | No | — | > **extra full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Organizations ### getAvatar `organizations.getAvatar` Get organization avatar **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.organizations.getAvatar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `any` *** ### getMembers `organizations.getMembers` List organization members **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.organizations.getMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `search` | `string` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output:** `any` *** ### getSocials `organizations.getSocials` Get organization social handles **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.organizations.getSocials({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `any` *** ## Papers ### claimAuthorship `papers.claimAuthorship` Claim authorship of a paper **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.papers.claimAuthorship({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `paperId` | `string` | Yes | — | | `extra` | `object` | No | — | > **extra full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createComment `papers.createComment` Comment on a paper **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.papers.createComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `paperId` | `string` | Yes | — | | `comment` | `string` | Yes | — | **Output:** `any` *** ### createCommentReply `papers.createCommentReply` Reply to a paper comment **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.papers.createCommentReply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `paperId` | `string` | Yes | — | | `commentId` | `string` | Yes | — | | `comment` | `string` | Yes | — | **Output:** `any` *** ### createIndex `papers.createIndex` Index an arXiv paper by id **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.papers.createIndex({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `paperId` | `string` | Yes | — | **Output:** `any` *** ### getDaily `papers.getDaily` Get daily papers **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.papers.getDaily({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `date` | `string` | No | — | **Output:** `any` *** ### search `papers.search` Search papers (hybrid semantic/full-text) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.papers.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `limit` | `number` | No | — | **Output:** `any` *** ## Repos ### create `repos.create` Create a model, dataset, or Space repository **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.repos.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `model \| dataset \| space` | Yes | — | | `private` | `boolean` | No | — | | `sdk` | `string` | No | — | | `hardware` | `string` | No | — | | `organization` | `string` | No | — | | `extra` | `object` | No | — | > **extra full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getResolve `repos.getResolve` Resolve a file in any repository type **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.repos.getResolve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | | `xetFileInfo` | `boolean` | No | — | **Output:** `any` *** ### listFiles `repos.listFiles` List repository file tree with pagination **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.repos.listFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | | `recursive` | `boolean` | No | — | | `expand` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `any` *** ### requestAccess `repos.requestAccess` Request access to a gated repository **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.repos.requestAccess({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoType` | `model \| dataset \| space` | Yes | — | | `repoId` | `string` | Yes | — | | `fields` | `object` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Settings ### createWebhook `settings.createWebhook` Create a settings webhook **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.settings.createWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `watched` | `object[]` | No | — | | `domains` | `string[]` | No | — | | `secret` | `string` | No | — | | `extra` | `object` | No | — | > **watched full type** > > ```ts theme={null} > { > }[] > ``` > **extra full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteWebhook `settings.deleteWebhook` Delete a settings webhook **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.settings.deleteWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | **Output:** `any` *** ### getBillingUsageV2 `settings.getBillingUsageV2` Get billing usage for a custom date range (unix timestamps) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.settings.getBillingUsageV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | **Output:** `any` *** ### getJobsUsage `settings.getJobsUsage` Get Jobs usage and billing for current subscription period **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.settings.getJobsUsage({}); ``` **Input:** *empty object* **Output:** `any` *** ### getLiveBillingUsage `settings.getLiveBillingUsage` Get live billing usage stream snapshot **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.settings.getLiveBillingUsage({}); ``` **Input:** *empty object* **Output:** `any` *** ### getMcp `settings.getMcp` Get MCP tools configuration for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.settings.getMcp({}); ``` **Input:** *empty object* **Output:** `any` *** ### getWebhook `settings.getWebhook` Get a webhook by id **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.settings.getWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | **Output:** `any` *** ### listWebhooks `settings.listWebhooks` List all webhooks in settings **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.settings.listWebhooks({}); ``` **Input:** *empty object* **Output:** `any` *** ### updateNotifications `settings.updateNotifications` Update notification settings for the authenticated user **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.settings.updateNotifications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `notifications` | `object` | Yes | — | > **notifications full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateWatch `settings.updateWatch` Update watch settings (orgs/users/repos to follow) **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.settings.updateWatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `add` | `object[]` | No | — | | `remove` | `object[]` | No | — | > **add full type** > > ```ts theme={null} > { > }[] > ``` > **remove full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `any` *** ### updateWebhook `settings.updateWebhook` Update an existing settings webhook **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.settings.updateWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | | `url` | `string` | No | — | | `watched` | `object[]` | No | — | | `domains` | `string[]` | No | — | | `extra` | `object` | No | — | > **watched full type** > > ```ts theme={null} > { > }[] > ``` > **extra full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateWebhookStatus `settings.updateWebhookStatus` Enable or disable a webhook (action: enable|disable) **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.settings.updateWebhookStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | | `action` | `enable \| disable` | Yes | — | **Output:** `any` *** ## Spaces ### checkUploadMethod `spaces.checkUploadMethod` Check LFS vs regular upload method for space files **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.checkUploadMethod({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `files` | `object[]` | Yes | — | | `gitAttributes` | `string` | No | — | | `gitIgnore` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > path: string, > size: number, > sample: string > }[] > ``` **Output:** `any` *** ### createBranch `spaces.createBranch` Create a branch on a space **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.spaces.createBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `branch` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `startingPoint` | `string` | No | — | | `emptyBranch` | `boolean` | No | — | | `overwrite` | `boolean` | No | — | **Output:** `any` *** ### createCommit `spaces.createCommit` Create a commit on a space (Hub NDJSON/JSON: files, deletedEntries, lfsFiles) **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.spaces.createCommit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `summary` | `string` | Yes | — | | `description` | `string` | No | — | | `parentCommit` | `string` | No | — | | `createPr` | `boolean` | No | — | | `hotReload` | `boolean` | No | — | | `format` | `json \| ndjson` | No | — | | `files` | `object[]` | No | — | | `deletedEntries` | `object[]` | No | — | | `lfsFiles` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > path: string, > content?: string, > encoding?: utf-8 | base64, > oldPath?: string > }[] > ``` > **deletedEntries full type** > > ```ts theme={null} > { > path: string > }[] > ``` > **lfsFiles full type** > > ```ts theme={null} > { > path: string, > oid?: string, > algo?: sha256, > size?: number, > oldPath?: string > }[] > ``` **Output:** `any` *** ### createSecret `spaces.createSecret` Create or update a Space secret **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.spaces.createSecret({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `key` | `string` | Yes | — | | `value` | `string` | Yes | — | | `description` | `string` | No | — | **Output:** `any` *** ### createTag `spaces.createTag` Create a tag on a space **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.spaces.createTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `tag` | `string` | Yes | — | | `message` | `string` | No | — | **Output:** `any` *** ### createVariable `spaces.createVariable` Create or update a Space variable **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.spaces.createVariable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `key` | `string` | Yes | — | | `value` | `string` | Yes | — | | `description` | `string` | No | — | **Output:** `any` *** ### deleteBranch `spaces.deleteBranch` Delete a branch on a space **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.spaces.deleteBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `branch` | `string` | Yes | — | **Output:** `any` *** ### deleteSecret `spaces.deleteSecret` Delete a Space secret **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.spaces.deleteSecret({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output:** `any` *** ### deleteTag `spaces.deleteTag` Delete a tag on a space **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.spaces.deleteTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output:** `any` *** ### deleteVariable `spaces.deleteVariable` Delete a Space variable **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.spaces.deleteVariable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output:** `any` *** ### get `spaces.get` Get space repository info **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | No | — | | `full` | `boolean` | No | — | **Output:** `any` *** ### getCompare `spaces.getCompare` Compare two revisions of a space **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getCompare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `compare` | `string` | Yes | e.g. main...other or sha1...sha2 | **Output:** `any` *** ### getEvents `spaces.getEvents` Stream Space status events (SSE snapshot) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | namespace/repo | **Output:** `any` *** ### getJwt `spaces.getJwt` Get JWT for a space repo **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getJwt({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `write` | `boolean` | No | — | | `expireAt` | `number` | No | — | **Output:** `any` *** ### getMetrics `spaces.getMetrics` Get live Space metrics (SSE snapshot) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getMetrics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | namespace/repo | **Output:** `any` *** ### getNotebook `spaces.getNotebook` Get notebook URL from a space **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getNotebook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | **Output:** `any` *** ### getResolve `spaces.getResolve` Resolve a file from a space (follows redirects / XET info) **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getResolve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | | `xetFileInfo` | `boolean` | No | — | **Output:** `any` *** ### getResolveCache `spaces.getResolveCache` Resolve a file from space cache **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getResolveCache({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | | `xetFileInfo` | `boolean` | No | — | **Output:** `any` *** ### getScan `spaces.getScan` Get security scan status for a space **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getScan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | namespace/repo | **Output:** `any` *** ### getTreeSize `spaces.getTreeSize` Get repository tree size for a space **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getTreeSize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `path` | `string` | Yes | — | **Output:** `any` *** ### getXetReadToken `spaces.getXetReadToken` Get XET read token for a space **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.getXetReadToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | **Output:** `any` *** ### getXetWriteToken `spaces.getXetWriteToken` Get XET write token for a Space **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.spaces.getXetWriteToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | **Output:** `any` *** ### list `spaces.list` List spaces on the Hub **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `author` | `string` | No | — | | `filter` | `string` | No | — | | `sort` | `string` | No | — | | `direction` | `-1 \| 1 \| string` | No | — | | `limit` | `number` | No | — | | `p` | `number` | No | — | | `full` | `boolean` | No | — | | `config` | `boolean` | No | — | **Output:** `any` *** ### listCommits `spaces.listCommits` List commits for a space **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.listCommits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `limit` | `number` | No | — | | `p` | `number` | No | — | **Output:** `any` *** ### listHardware `spaces.listHardware` List available Space hardware configurations **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.listHardware({}); ``` **Input:** *empty object* **Output:** `any` *** ### listLfsFiles `spaces.listLfsFiles` List LFS files in a Space **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.listLfsFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `any` *** ### listPathsInfo `spaces.listPathsInfo` List path metadata in a space **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.listPathsInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `paths` | `string[]` | Yes | — | | `expand` | `boolean` | No | — | **Output:** `any` *** ### listRefs `spaces.listRefs` List refs (branches/tags) for a space **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.spaces.listRefs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `includePullRequests` | `boolean` | No | — | **Output:** `any` *** ### squashCommits `spaces.squashCommits` Squash all commits in a Space ref (irreversible) **Risk:** `destructive` ```ts theme={null} await corsair.huggingface.api.spaces.squashCommits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `revision` | `string` | Yes | — | | `message` | `string` | Yes | — | **Output:** `any` *** ### updateSettings `spaces.updateSettings` Update settings for a space repository **Risk:** `write` ```ts theme={null} await corsair.huggingface.api.spaces.updateSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoId` | `string` | Yes | — | | `private` | `boolean` | No | — | | `gated` | `boolean \| string` | No | — | | `discussionsDisabled` | `boolean` | No | — | | `extra` | `object` | No | — | > **extra full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Trending ### get `trending.get` Get trending repositories **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.trending.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `model \| dataset \| space` | No | — | | `limit` | `number` | No | — | **Output:** `any` *** ## Users ### getAvatar `users.getAvatar` Get user avatar URL **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.users.getAvatar({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output:** `any` *** ### getOverview `users.getOverview` Get user profile overview **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.users.getOverview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output:** `any` *** ### getSocials `users.getSocials` Get user social handles **Risk:** `read` ```ts theme={null} await corsair.huggingface.api.users.getSocials({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/huggingface/database Hugging Face local sync: searchable entities, `.search()` filters, and operators. The Hugging Face plugin syncs data locally. Use `corsair.huggingface.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Collections Path: `huggingface.db.collections.search` ```ts theme={null} const rows = await corsair.huggingface.db.collections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `lastUpdated` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `theme` | `string` | equals, contains, startsWith, endsWith, in | | `upvotes` | `number` | equals, gt, gte, lt, lte, in | | `isUpvotedByUser` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Datasets Path: `huggingface.db.datasets.search` ```ts theme={null} const rows = await corsair.huggingface.db.datasets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `sha` | `string` | equals, contains, startsWith, endsWith, in | | `lastModified` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `disabled` | `boolean` | equals | | `downloads` | `number` | equals, gt, gte, lt, lte, in | | `likes` | `number` | equals, gt, gte, lt, lte, in | | `trendingScore` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `citation` | `string` | equals, contains, startsWith, endsWith, in | | `paperswithcode_id` | `string` | equals, contains, startsWith, endsWith, in | | `usedStorage` | `number` | equals, gt, gte, lt, lte, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Discussions Path: `huggingface.db.discussions.search` ```ts theme={null} const rows = await corsair.huggingface.db.discussions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `num` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `isPullRequest` | `boolean` | equals | | `pinned` | `boolean` | equals | | `numComments` | `number` | equals, gt, gte, lt, lte, in | | `numReactionUsers` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Models Path: `huggingface.db.models.search` ```ts theme={null} const rows = await corsair.huggingface.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `modelId` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `sha` | `string` | equals, contains, startsWith, endsWith, in | | `lastModified` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `disabled` | `boolean` | equals | | `downloads` | `number` | equals, gt, gte, lt, lte, in | | `likes` | `number` | equals, gt, gte, lt, lte, in | | `trendingScore` | `number` | equals, gt, gte, lt, lte, in | | `pipeline_tag` | `string` | equals, contains, startsWith, endsWith, in | | `library_name` | `string` | equals, contains, startsWith, endsWith, in | | `usedStorage` | `number` | equals, gt, gte, lt, lte, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Papers Path: `huggingface.db.papers.search` ```ts theme={null} const rows = await corsair.huggingface.db.papers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `publishedAt` | `string` | equals, contains, startsWith, endsWith, in | | `upvotes` | `number` | equals, gt, gte, lt, lte, in | | `ai_summary` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Spaces Path: `huggingface.db.spaces.search` ```ts theme={null} const rows = await corsair.huggingface.db.spaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `sha` | `string` | equals, contains, startsWith, endsWith, in | | `lastModified` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `disabled` | `boolean` | equals | | `likes` | `number` | equals, gt, gte, lt, lte, in | | `trendingScore` | `number` | equals, gt, gte, lt, lte, in | | `sdk` | `string` | equals, contains, startsWith, endsWith, in | | `subdomain` | `string` | equals, contains, startsWith, endsWith, in | | `host` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `usedStorage` | `number` | equals, gt, gte, lt, lte, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/huggingface/overview AI community hub for models, datasets, inference APIs, and machine learning deployments. Use **Hugging Face** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 139 typed API operations * 6 synced entities (`collections`, `datasets`, `discussions`, `models`, `papers`, `spaces`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/huggingface ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/huggingface ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/huggingface ``` ```bash bun theme={null} bun add corsair @corsair-dev/huggingface ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { huggingface } from '@corsair-dev/huggingface'; export const corsair = createCorsair({ plugins: [ huggingface(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} huggingface() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Hugging Face OAuth app. ```ts theme={null} huggingface({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'huggingface', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getWhoami`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.huggingface.api.account.getWhoami({}); ``` **`account.deleteNotifications`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.huggingface.api.account.deleteNotifications({}); ``` See the full list on the [API](/plugins/huggingface/api) page. ## Query synced data Synced entities support `tenant.huggingface.db..search()` and `.list()`: `collections`, `datasets`, `discussions`, `models`, `papers`, `spaces`. See [Database](/plugins/huggingface/database) for filters and operators. ## What's next > **[API reference](/plugins/huggingface/api)** > > Every `huggingface.api.*` operation with input and output types. > **[Database](/plugins/huggingface/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/humanitix/api API reference for Humanitix: every `humanitix.api.*` operation with input and output types. Every `humanitix.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Events ### get `events.get` Retrieve detailed information about a specific Humanitix event by eventId. **Risk:** `read` ```ts theme={null} await corsair.humanitix.api.events.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `eventId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | Yes | — | | `userId` | `string` | No | — | | `organiserId` | `string` | No | — | | `currency` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `sharingDescription` | `string` | No | — | | `slug` | `string` | No | — | | `url` | `string` | No | — | | `tagIds` | `string[]` | No | — | | `category` | `string` | No | — | | `classification` | `object` | No | — | | `public` | `boolean` | No | — | | `published` | `boolean` | No | — | | `suspendSales` | `boolean` | No | — | | `markedAsSoldOut` | `boolean` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `timezone` | `string` | No | — | | `totalCapacity` | `number` | No | — | | `ticketTypes` | `object[]` | No | — | | `pricing` | `object` | No | — | | `publishedAt` | `string` | No | — | | `eventLocation` | `object` | No | — | | `dates` | `object[]` | No | — | | `keywords` | `string[]` | No | — | | `location` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **classification full type** > > ```ts theme={null} > string | { > category?: string, > subcategory?: string, > type?: string > } > ``` > **ticketTypes full type** > > ```ts theme={null} > { > _id?: string, > name?: string, > price?: number, > quantity?: number, > description?: string, > disabled?: boolean, > deleted?: boolean, > isDonation?: boolean > }[] > ``` > **pricing full type** > > ```ts theme={null} > { > minimumPrice?: number, > maximumPrice?: number > } > ``` > **eventLocation full type** > > ```ts theme={null} > { > type?: string, > venueName?: string, > address?: string, > latLng?: number[], > city?: string, > region?: string, > country?: string, > onlineUrl?: string, > mapUrl?: string > } > ``` > **dates full type** > > ```ts theme={null} > { > _id?: string, > startDate?: string, > endDate?: string, > scheduleId?: string, > disabled?: boolean, > deleted?: boolean > }[] > ``` *** ### list `events.list` Retrieve a paginated list of Humanitix events (page, pageSize, inFutureOnly, since, overrideLocation). **Risk:** `read` ```ts theme={null} await corsair.humanitix.api.events.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `inFutureOnly` | `boolean` | No | — | | `since` | `string` | No | — | | `overrideLocation` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | Yes | — | | `page` | `number` | Yes | — | | `pageSize` | `number` | Yes | — | | `events` | `object[]` | Yes | — | > **events full type** > > ```ts theme={null} > { > _id: string, > userId?: string, > organiserId?: string, > currency?: string, > name?: string, > description?: string, > sharingDescription?: string, > slug?: string, > url?: string, > tagIds?: string[], > category?: string, > classification?: string | { > category?: string, > subcategory?: string, > type?: string > }, > public?: boolean, > published?: boolean, > suspendSales?: boolean, > markedAsSoldOut?: boolean, > startDate?: string, > endDate?: string, > timezone?: string, > totalCapacity?: number, > ticketTypes?: { > _id?: string, > name?: string, > price?: number, > quantity?: number, > description?: string, > disabled?: boolean, > deleted?: boolean, > isDonation?: boolean > }[], > pricing?: { > minimumPrice?: number, > maximumPrice?: number > }, > publishedAt?: string, > eventLocation?: { > type?: string, > venueName?: string, > address?: string, > latLng?: number[], > city?: string, > region?: string, > country?: string, > onlineUrl?: string, > mapUrl?: string > }, > dates?: { > _id?: string, > startDate?: string, > endDate?: string, > scheduleId?: string, > disabled?: boolean, > deleted?: boolean > }[], > keywords?: string[], > location?: string, > createdAt?: string, > updatedAt?: string > }[] > ``` *** ## Tags ### list `tags.list` Retrieve a paginated list of Humanitix tags (page, pageSize). **Risk:** `read` ```ts theme={null} await corsair.humanitix.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | Yes | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | Yes | — | | `page` | `number` | Yes | — | | `pageSize` | `number` | Yes | — | | `tags` | `object[]` | Yes | — | > **tags full type** > > ```ts theme={null} > { > _id: string, > name?: string, > userId?: string, > location?: string, > createdAt?: string, > updatedAt?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/humanitix/database Humanitix local sync: searchable entities, `.search()` filters, and operators. The Humanitix plugin syncs data locally. Use `corsair.humanitix.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Events Path: `humanitix.db.events.search` ```ts theme={null} const rows = await corsair.humanitix.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `organiserId` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `sharingDescription` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `public` | `boolean` | equals | | `published` | `boolean` | equals | | `suspendSales` | `boolean` | equals | | `markedAsSoldOut` | `boolean` | equals | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `endDate` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `totalCapacity` | `number` | equals, gt, gte, lt, lte, in | | `publishedAt` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `humanitix.db.tags.search` ```ts theme={null} const rows = await corsair.humanitix.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/humanitix/overview Humanitix plugin for Corsair Use **Humanitix** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 3 typed API operations * 2 synced entities (`events`, `tags`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/humanitix ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/humanitix ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/humanitix ``` ```bash bun theme={null} bun add corsair @corsair-dev/humanitix ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { humanitix } from '@corsair-dev/humanitix'; export const corsair = createCorsair({ plugins: [ humanitix(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} humanitix() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'humanitix', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`events.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.humanitix.api.events.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/humanitix/api) reference.* See the full list on the [API](/plugins/humanitix/api) page. ## Query synced data Synced entities support `tenant.humanitix.db..search()` and `.list()`: `events`, `tags`. See [Database](/plugins/humanitix/database) for filters and operators. ## What's next > **[API reference](/plugins/humanitix/api)** > > Every `humanitix.api.*` operation with input and output types. > **[Database](/plugins/humanitix/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/hunterio/api API reference for Hunter.io: every `hunterio.api.*` operation with input and output types. Every `hunterio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get the Hunter.io account profile **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > first_name?: string | null, > last_name?: string | null, > email?: string, > plan_name?: string, > plan_level?: number, > reset_date?: string, > team_id?: number, > requests?: { > credits?: { > used?: number, > available?: number, > remaining?: number, > over_quota?: number > }, > searches?: { > used?: number, > available?: number, > remaining?: number, > over_quota?: number > }, > verifications?: { > used?: number, > available?: number, > remaining?: number, > over_quota?: number > } > }, > calls?: { > _deprecation_notice?: string, > used?: number, > available?: number > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `account.update` Update the Hunter.io account profile **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.account.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | **Output:** `undefined` *** ## Account Stats ### get `accountStats.get` Get global account statistics and credit usage **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.accountStats.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `any` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Api Keys ### create `apiKeys.create` Create a new API key **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.apiKeys.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string | null, > token?: string, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `apiKeys.delete` Delete an API key permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.apiKeys.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### list `apiKeys.list` List the API keys on the account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.apiKeys.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string | null, > token?: string, > created_at?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `apiKeys.replace` Replace an API key definition **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.apiKeys.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string | null, > token?: string, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `apiKeys.update` Update an API key **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.apiKeys.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string | null, > token?: string, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Companies ### bulkCopy `companies.bulkCopy` Copy companies to another company list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companies.bulkCopy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target_company_list_id` | `number \| string` | Yes | — | | `company_ids` | `number[]` | No | — | | `company_list_id` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > target_company_list_id?: number, > companies_count?: number, > status?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### bulkDelete `companies.bulkDelete` Delete companies in bulk permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.companies.bulkDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_ids` | `number[]` | No | — | | `company_list_id` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > requested_count?: number, > deleted_count?: number, > status?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### bulkMove `companies.bulkMove` Move companies to another company list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companies.bulkMove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_list_id` | `number \| string` | Yes | — | | `target_company_list_id` | `number \| string` | Yes | — | | `company_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > source_company_list_id?: number, > target_company_list_id?: number, > companies_count?: number, > status?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### bulkTag `companies.bulkTag` Assign a tag to companies in bulk **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companies.bulkTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_ids` | `number[]` | No | — | | `company_list_id` | `number \| string` | No | — | | `tag_id` | `number \| string` | No | — | | `tag_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > tag?: { > id?: number, > name?: string, > color?: string | null, > created_at?: string > }, > companies_count?: number, > status?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### create `companies.create` Add a company to the account from a domain **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companies.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > domain?: string | null, > leads_count?: number, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `companies.delete` Delete a company permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.companies.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `companies.get` Get a company **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.companies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > domain?: string | null, > leads_count?: number, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `companies.list` List companies with filters **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.companies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `sort` | `company_name \| website \| company_size \| company_type \| leads_count \| created_at \| updated_at \| last_exported_at \| last_funding_date` | No | — | | `direction` | `asc \| desc` | No | — | | `query` | `string` | No | — | | `company_name` | `string` | No | — | | `website` | `string` | No | — | | `company_size` | `string` | No | — | | `company_type` | `string` | No | — | | `industry` | `string` | No | — | | `technology` | `string` | No | — | | `keywords` | `string` | No | — | | `source` | `string` | No | — | | `tags` | `string` | No | — | | `company_list_ids` | `string` | No | — | | `leads_count` | `string` | No | — | | `location` | `string` | No | — | | `country` | `string` | No | — | | `founded_year` | `string` | No | — | | `funding_series` | `string` | No | — | | `funding_amount` | `string` | No | — | | `last_funding_date` | `string` | No | — | | `location_country_included` | `string` | No | — | | `location_country_excluded` | `string` | No | — | | `location_state_included` | `string` | No | — | | `location_state_excluded` | `string` | No | — | | `location_city_included` | `string` | No | — | | `location_city_excluded` | `string` | No | — | | `location_continent_included` | `string` | No | — | | `location_continent_excluded` | `string` | No | — | | `location_business_region_included` | `string` | No | — | | `location_business_region_excluded` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > companies: { > id?: number, > domain?: string | null, > leads_count?: number, > created_at?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### tag `companies.tag` Assign a tag to a company **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companies.tag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `tag_id` | `number \| string` | No | — | | `tag_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### untag `companies.untag` Remove a tag from a company \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.hunterio.api.companies.untag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `tag_id` | `number \| string` | Yes | — | **Output:** `undefined` *** ## Company List Folders ### create `companyListFolders.create` Create a company list folder **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyListFolders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > company_lists_count?: number, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `companyListFolders.delete` Delete a company list folder permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.companyListFolders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `companyListFolders.get` Get a company list folder **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.companyListFolders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > company_lists_count?: number, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `companyListFolders.list` List the company list folders **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.companyListFolders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > folders: { > id?: number, > name?: string, > color?: string | null, > company_lists_count?: number, > created_at?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `companyListFolders.replace` Replace a company list folder **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyListFolders.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | **Output:** `undefined` *** ### update `companyListFolders.update` Update a company list folder **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyListFolders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | **Output:** `undefined` *** ## Company Lists ### addCompany `companyLists.addCompany` Add a company to a company list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyLists.addCompany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_list_id` | `number \| string` | Yes | — | | `company_id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > domain?: string | null, > leads_count?: number, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### create `companyLists.create` Create a company list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyLists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `type` | `static \| dynamic` | No | — | | `filters` | `any` | No | — | | `company_list_folder_id` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > type?: string, > companies_count?: number, > company_list_folder_id?: number | null, > created_at?: string, > filters?: any > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `companyLists.delete` Delete a company list permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.companyLists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status?: string, > data?: any, > meta?: { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > } | undefined > ``` *** ### favorite `companyLists.favorite` Mark a company list as favorite **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyLists.favorite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > favorited?: boolean > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### get `companyLists.get` Get a company list and its companies **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.companyLists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > type?: string, > companies_count?: number, > company_list_folder_id?: number | null, > created_at?: string, > filters?: any, > companies?: { > id?: number, > domain?: string | null, > leads_count?: number, > created_at?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `companyLists.list` List the company lists on the account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.companyLists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > company_lists: { > id?: number, > name?: string, > type?: string, > companies_count?: number, > company_list_folder_id?: number | null, > created_at?: string, > filters?: any > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### removeCompany `companyLists.removeCompany` Remove a company from a company list \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.hunterio.api.companyLists.removeCompany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_list_id` | `number \| string` | Yes | — | | `company_id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### replace `companyLists.replace` Replace a company list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyLists.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `type` | `static \| dynamic` | No | — | | `filters` | `any` | No | — | | `company_list_folder_id` | `number \| string` | No | — | **Output:** `undefined` *** ### unfavorite `companyLists.unfavorite` Remove the favorite mark from a company list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyLists.unfavorite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > favorited?: boolean > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `companyLists.update` Update a company list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyLists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `type` | `static \| dynamic` | No | — | | `filters` | `any` | No | — | | `company_list_folder_id` | `number \| string` | No | — | **Output:** `undefined` *** ## Company Tags ### create `companyTags.create` Create a company tag **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyTags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `companyTags.delete` Delete a company tag permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.companyTags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `companyTags.get` Get a company tag **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.companyTags.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `companyTags.list` List the company tags on the account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.companyTags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > tags: { > id?: number, > name?: string, > color?: string | null, > created_at?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `companyTags.replace` Replace a company tag **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyTags.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `companyTags.update` Update a company tag **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.companyTags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Connected Apps ### get `connectedApps.get` Get a connected app **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.connectedApps.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > provider?: string, > name?: string, > category?: string, > provider_email?: string | null, > connected_at?: string, > updated_at?: string, > attribute_mappings?: { > target_field?: string, > source_field?: string, > direction?: string, > conflict_policy?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `connectedApps.list` List the connected apps on the account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.connectedApps.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > provider?: string, > name?: string, > category?: string, > provider_email?: string | null, > connected_at?: string, > updated_at?: string, > attribute_mappings?: { > target_field?: string, > source_field?: string, > direction?: string, > conflict_policy?: string > }[] > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### push `connectedApps.push` Push leads to a connected app **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.connectedApps.push({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `lead_ids` | `number[]` | No | — | | `leads_list_id` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > connected_app_id?: number, > provider?: string, > leads_count?: number, > status?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Custom Attributes ### create `customAttributes.create` Create a custom attribute **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.customAttributes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > label?: string, > slug?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `customAttributes.delete` Delete a custom attribute permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.customAttributes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `customAttributes.get` Get a custom attribute **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.customAttributes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > label?: string, > slug?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `customAttributes.list` List the custom attributes on the account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.customAttributes.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > leads_custom_attributes: { > id?: number, > label?: string, > slug?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `customAttributes.replace` Replace a custom attribute **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.customAttributes.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `label` | `string` | Yes | — | **Output:** `undefined` *** ### update `customAttributes.update` Update a custom attribute **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.customAttributes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `label` | `string` | Yes | — | **Output:** `undefined` *** ## Discover ### companies `discover.companies` Discover companies matching the given filters **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.discover.companies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `organization` | `object` | No | — | | `headquarters_location` | `object` | No | — | | `industry` | `object` | No | — | | `headcount` | `1-10 \| 11-50 \| 51-200 \| 201-500 \| 501-1000 \| 1001-5000 \| 5001-10000 \| 10001+[]` | No | — | | `company_type` | `object` | No | — | | `keywords` | `object` | No | — | | `year_founded` | `object` | No | — | | `technology` | `object` | No | — | | `funding` | `object` | No | — | | `job_openings` | `object` | No | — | | `similar_to` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | > **organization full type** > > ```ts theme={null} > { > domain?: string[], > name?: string[] > } > ``` > **headquarters\_location full type** > > ```ts theme={null} > { > include?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[], > exclude?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[] > } > ``` > **industry full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[] > } > ``` > **company\_type full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[] > } > ``` > **keywords full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[], > match?: all | any > } > ``` > **year\_founded full type** > > ```ts theme={null} > { > include?: number[], > exclude?: number[], > from?: number, > to?: number > } > ``` > **technology full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[], > match?: all | any > } > ``` > **funding full type** > > ```ts theme={null} > { > series?: pre_seed | seed | pre_series_a | series_a | pre_series_b | series_b | pre_series_c | series_c+ | other[], > amount?: { > from?: number, > to?: number > }, > date?: { > from?: string, > to?: string > }, > received?: boolean > } > ``` > **job\_openings full type** > > ```ts theme={null} > { > hiring?: boolean, > department?: string[], > job_title?: { > include?: string[], > exclude?: string[] > }, > posted_date?: last7d | last30d | last90d, > open_roles?: { > from?: number, > to?: number > }, > include_closed_roles?: boolean > } > ``` > **similar\_to full type** > > ```ts theme={null} > { > domain?: string, > organization?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > domain?: string, > organization?: string, > emails_count?: { > personal?: number, > generic?: number, > total?: number > }, > already_saved?: boolean, > city?: string | null, > state?: string | null, > country?: string | null, > company_type?: string | null, > headcount?: string | null, > industry?: string | null, > keywords?: string[], > description?: string | null, > year_founded?: number | null, > socials?: { > facebook?: string | null, > instagram?: string | null, > twitter?: string | null, > youtube?: string | null > }, > technologies?: string[], > technology_details?: { > category?: string, > category_label?: string, > name?: string, > slug?: string, > website?: string | null > }[] > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any, > filters?: any, > permalink?: string > } > ``` *** ### people `discover.people` Discover people matching the given filters **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.discover.people({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `organization` | `object` | No | — | | `headquarters_location` | `object` | No | — | | `industry` | `object` | No | — | | `headcount` | `1-10 \| 11-50 \| 51-200 \| 201-500 \| 501-1000 \| 1001-5000 \| 5001-10000 \| 10001+[]` | No | — | | `company_type` | `object` | No | — | | `keywords` | `object` | No | — | | `year_founded` | `object` | No | — | | `technology` | `object` | No | — | | `funding` | `object` | No | — | | `job_openings` | `object` | No | — | | `similar_to` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | > **organization full type** > > ```ts theme={null} > { > domain?: string[], > name?: string[] > } > ``` > **headquarters\_location full type** > > ```ts theme={null} > { > include?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[], > exclude?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[] > } > ``` > **industry full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[] > } > ``` > **company\_type full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[] > } > ``` > **keywords full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[], > match?: all | any > } > ``` > **year\_founded full type** > > ```ts theme={null} > { > include?: number[], > exclude?: number[], > from?: number, > to?: number > } > ``` > **technology full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[], > match?: all | any > } > ``` > **funding full type** > > ```ts theme={null} > { > series?: pre_seed | seed | pre_series_a | series_a | pre_series_b | series_b | pre_series_c | series_c+ | other[], > amount?: { > from?: number, > to?: number > }, > date?: { > from?: string, > to?: string > }, > received?: boolean > } > ``` > **job\_openings full type** > > ```ts theme={null} > { > hiring?: boolean, > department?: string[], > job_title?: { > include?: string[], > exclude?: string[] > }, > posted_date?: last7d | last30d | last90d, > open_roles?: { > from?: number, > to?: number > }, > include_closed_roles?: boolean > } > ``` > **similar\_to full type** > > ```ts theme={null} > { > domain?: string, > organization?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > domain?: string, > organization?: string, > emails_count?: { > personal?: number, > generic?: number, > total?: number > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any, > filters?: any, > permalink?: string, > total_emails?: { > personal?: number, > generic?: number, > total?: number > } > } > ``` *** ### peoplePost `discover.peoplePost` Discover people with nested filters (POST form) **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.discover.peoplePost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `organization` | `object` | No | — | | `headquarters_location` | `object` | No | — | | `industry` | `object` | No | — | | `headcount` | `1-10 \| 11-50 \| 51-200 \| 201-500 \| 501-1000 \| 1001-5000 \| 5001-10000 \| 10001+[]` | No | — | | `company_type` | `object` | No | — | | `keywords` | `object` | No | — | | `year_founded` | `object` | No | — | | `technology` | `object` | No | — | | `funding` | `object` | No | — | | `job_openings` | `object` | No | — | | `similar_to` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | > **organization full type** > > ```ts theme={null} > { > domain?: string[], > name?: string[] > } > ``` > **headquarters\_location full type** > > ```ts theme={null} > { > include?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[], > exclude?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[] > } > ``` > **industry full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[] > } > ``` > **company\_type full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[] > } > ``` > **keywords full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[], > match?: all | any > } > ``` > **year\_founded full type** > > ```ts theme={null} > { > include?: number[], > exclude?: number[], > from?: number, > to?: number > } > ``` > **technology full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[], > match?: all | any > } > ``` > **funding full type** > > ```ts theme={null} > { > series?: pre_seed | seed | pre_series_a | series_a | pre_series_b | series_b | pre_series_c | series_c+ | other[], > amount?: { > from?: number, > to?: number > }, > date?: { > from?: string, > to?: string > }, > received?: boolean > } > ``` > **job\_openings full type** > > ```ts theme={null} > { > hiring?: boolean, > department?: string[], > job_title?: { > include?: string[], > exclude?: string[] > }, > posted_date?: last7d | last30d | last90d, > open_roles?: { > from?: number, > to?: number > }, > include_closed_roles?: boolean > } > ``` > **similar\_to full type** > > ```ts theme={null} > { > domain?: string, > organization?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > domain?: string, > organization?: string, > emails_count?: { > personal?: number, > generic?: number, > total?: number > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any, > filters?: any, > permalink?: string, > total_emails?: { > personal?: number, > generic?: number, > total?: number > } > } > ``` *** ## Discover Views ### create `discoverViews.create` Save the current discover filters as a view **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.discoverViews.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > filters?: { > }, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `discoverViews.delete` Delete a saved discover view permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.discoverViews.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `discoverViews.get` Get a saved discover view **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.discoverViews.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > filters?: { > }, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `discoverViews.list` List saved discover views **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.discoverViews.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > filters?: { > }, > created_at?: string, > updated_at?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Domain Count ### get `domainCount.get` Count the email addresses available for a domain **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.domainCount.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `organization` | `object` | No | — | | `headquarters_location` | `object` | No | — | | `industry` | `object` | No | — | | `headcount` | `1-10 \| 11-50 \| 51-200 \| 201-500 \| 501-1000 \| 1001-5000 \| 5001-10000 \| 10001+[]` | No | — | | `company_type` | `object` | No | — | | `keywords` | `object` | No | — | | `year_founded` | `object` | No | — | | `technology` | `object` | No | — | | `funding` | `object` | No | — | | `job_openings` | `object` | No | — | | `similar_to` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | > **organization full type** > > ```ts theme={null} > { > domain?: string[], > name?: string[] > } > ``` > **headquarters\_location full type** > > ```ts theme={null} > { > include?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[], > exclude?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[] > } > ``` > **industry full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[] > } > ``` > **company\_type full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[] > } > ``` > **keywords full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[], > match?: all | any > } > ``` > **year\_founded full type** > > ```ts theme={null} > { > include?: number[], > exclude?: number[], > from?: number, > to?: number > } > ``` > **technology full type** > > ```ts theme={null} > { > include?: string[], > exclude?: string[], > match?: all | any > } > ``` > **funding full type** > > ```ts theme={null} > { > series?: pre_seed | seed | pre_series_a | series_a | pre_series_b | series_b | pre_series_c | series_c+ | other[], > amount?: { > from?: number, > to?: number > }, > date?: { > from?: string, > to?: string > }, > received?: boolean > } > ``` > **job\_openings full type** > > ```ts theme={null} > { > hiring?: boolean, > department?: string[], > job_title?: { > include?: string[], > exclude?: string[] > }, > posted_date?: last7d | last30d | last90d, > open_roles?: { > from?: number, > to?: number > }, > include_closed_roles?: boolean > } > ``` > **similar\_to full type** > > ```ts theme={null} > { > domain?: string, > organization?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > total?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Domain Finder ### find `domainFinder.find` Find the domain of a company by name **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.domainFinder.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company` | `string` | Yes | — | | `limit` | `number` | No | — | | `perfect_match` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > domain?: string, > company_name?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### findPost `domainFinder.findPost` Find the domain of a company by name (POST form) **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.domainFinder.findPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company` | `string` | Yes | — | | `limit` | `number` | No | — | | `perfect_match` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > domain?: string, > company_name?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Domain Search ### search `domainSearch.search` List the email addresses found for a domain **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.domainSearch.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `company` | `string` | No | — | | `type` | `personal \| generic` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `department` | `string` | No | — | | `seniority` | `string` | No | — | | `job_titles` | `string` | No | — | | `decision_maker` | `boolean` | No | — | | `required_field` | `string` | No | — | | `verification_status` | `string` | No | — | | `source_type` | `found \| generated` | No | — | | `saved_leads` | `boolean` | No | — | | `aggregations` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > domain?: string, > disposable?: boolean, > webmail?: boolean, > accept_all?: boolean, > pattern?: string | null, > organization?: string | null, > linked_domains?: string[], > emails?: { > value?: string, > type?: string, > confidence?: number, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > position_raw?: string | null, > seniority?: string | null, > department?: string | null, > decision_maker?: boolean, > linkedin?: string | null, > twitter?: string | null, > phone_number?: string | null, > source_type?: string, > verification?: { > date?: string | null, > status?: string | null > } | null, > sources?: { > domain?: string, > uri?: string, > extracted_on?: string | null, > last_seen_on?: string | null, > still_on_page?: boolean > }[] > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any, > results_approximate?: boolean, > aggregations?: any > } > ``` *** ### searchPost `domainSearch.searchPost` List the email addresses found for a domain (POST form) **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.domainSearch.searchPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `company` | `string` | No | — | | `type` | `personal \| generic` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `department` | `string` | No | — | | `seniority` | `string` | No | — | | `job_titles` | `string` | No | — | | `decision_maker` | `boolean` | No | — | | `required_field` | `string` | No | — | | `verification_status` | `string` | No | — | | `source_type` | `found \| generated` | No | — | | `saved_leads` | `boolean` | No | — | | `aggregations` | `boolean` | No | — | | `location` | `object` | No | — | > **location full type** > > ```ts theme={null} > { > include?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[], > exclude?: { > continent?: string, > business_region?: string, > country?: string, > state?: string, > city?: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > domain?: string, > disposable?: boolean, > webmail?: boolean, > accept_all?: boolean, > pattern?: string | null, > organization?: string | null, > linked_domains?: string[], > emails?: { > value?: string, > type?: string, > confidence?: number, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > position_raw?: string | null, > seniority?: string | null, > department?: string | null, > decision_maker?: boolean, > linkedin?: string | null, > twitter?: string | null, > phone_number?: string | null, > source_type?: string, > verification?: { > date?: string | null, > status?: string | null > } | null, > sources?: { > domain?: string, > uri?: string, > extracted_on?: string | null, > last_seen_on?: string | null, > still_on_page?: boolean > }[] > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any, > results_approximate?: boolean, > aggregations?: any > } > ``` *** ## Domains Suggestion ### get `domainsSuggestion.get` Suggest similar company domains **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.domainsSuggestion.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `any` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Email Accounts ### capacities `emailAccounts.capacities` Get the sending capacities of all email accounts **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailAccounts.capacities({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string | null, > sent?: number, > daily_limit?: number, > scheduled?: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### get `emailAccounts.get` Get a connected email account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailAccounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > sending_status?: string, > daily_limit?: number, > provider?: string, > sender_name?: string | null, > default_account?: boolean, > signature?: string | null, > profile_picture_url?: string | null, > custom_tracking_domain?: string | null, > sending_schedule?: { > days?: number[], > start_time?: string, > end_time?: string, > time_zone?: string > }, > warmup?: { > enabled?: boolean, > status?: string | null, > end_date?: string | null > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### healthReport `emailAccounts.healthReport` Get the deliverability health report of an email account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailAccounts.healthReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > score?: number | null, > status?: string | null, > domain?: string | null, > domain_score?: number | null, > checked_at?: string | null, > issues?: { > disconnected?: boolean, > no_recent_sending_activity?: boolean, > no_inbox_protection?: boolean > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `emailAccounts.list` List the connected email accounts **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailAccounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > sending_status?: string, > daily_limit?: number, > provider?: string, > sender_name?: string | null, > default_account?: boolean, > signature?: string | null, > profile_picture_url?: string | null, > custom_tracking_domain?: string | null, > sending_schedule?: { > days?: number[], > start_time?: string, > end_time?: string, > time_zone?: string > }, > warmup?: { > enabled?: boolean, > status?: string | null, > end_date?: string | null > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `emailAccounts.replace` Replace email account settings **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.emailAccounts.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `daily_limit` | `number` | No | — | | `sender_name` | `string` | No | — | | `signature` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `default_account` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > sending_status?: string, > daily_limit?: number, > provider?: string, > sender_name?: string | null, > default_account?: boolean, > signature?: string | null, > profile_picture_url?: string | null, > custom_tracking_domain?: string | null, > sending_schedule?: { > days?: number[], > start_time?: string, > end_time?: string, > time_zone?: string > }, > warmup?: { > enabled?: boolean, > status?: string | null, > end_date?: string | null > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### sequences `emailAccounts.sequences` List the sequences using an email account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailAccounts.sequences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_account_id` | `number \| string` | Yes | — | | `include_archived` | `boolean` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > status?: string, > recipients_allocated?: number, > emails_scheduled?: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `emailAccounts.update` Update email account settings **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.emailAccounts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `daily_limit` | `number` | No | — | | `sender_name` | `string` | No | — | | `signature` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `default_account` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > sending_status?: string, > daily_limit?: number, > provider?: string, > sender_name?: string | null, > default_account?: boolean, > signature?: string | null, > profile_picture_url?: string | null, > custom_tracking_domain?: string | null, > sending_schedule?: { > days?: number[], > start_time?: string, > end_time?: string, > time_zone?: string > }, > warmup?: { > enabled?: boolean, > status?: string | null, > end_date?: string | null > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### usage `emailAccounts.usage` Get sending usage and limits of an email account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailAccounts.usage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > sent_today?: number, > sent_last_7_days?: { > date?: string, > count?: number, > capacity?: number > }[], > daily_limit?: number, > scheduled?: number, > available?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### warmupReport `emailAccounts.warmupReport` Get the warmup report of an email account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailAccounts.warmupReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > state?: string, > progress?: { > percent?: number, > end_date?: string, > current_limit?: number, > target_limit?: number > }, > metrics?: { > emails_sent?: number, > interactions?: number, > in_spam?: number > } | null, > chart_data?: { > date?: string, > sent?: number, > scheduled?: number > }[], > billing_cycle?: string | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Email Count ### get `emailCount.get` Count the email addresses found for a domain **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailCount.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `company` | `string` | No | — | | `type` | `personal \| generic` | No | — | | `include_job_titles` | `boolean \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > total?: number, > personal_emails?: number, > generic_emails?: number, > department?: { > }, > seniority?: { > }, > job_titles?: { > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Email Finder ### find `emailFinder.find` Find the most likely email of a person **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailFinder.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `company` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `full_name` | `string` | No | — | | `linkedin_handle` | `string` | No | — | | `max_duration` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > email?: string | null, > score?: number | null, > domain?: string, > company?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > linkedin_url?: string | null, > twitter?: string | null, > phone_number?: string | null, > accept_all?: boolean, > source_type?: string, > sources?: { > domain?: string, > uri?: string, > extracted_on?: string | null, > last_seen_on?: string | null, > still_on_page?: boolean > }[], > verification?: { > date?: string | null, > status?: string | null, > id?: number | null > } | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### findFound `emailFinder.findFound` Check whether an email was already found for a person **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailFinder.findFound({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `company` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `full_name` | `string` | No | — | | `linkedin_handle` | `string` | No | — | | `max_duration` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > email?: string | null, > score?: number | null, > domain?: string, > company?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > linkedin_url?: string | null, > twitter?: string | null, > phone_number?: string | null, > accept_all?: boolean, > source_type?: string, > sources?: { > domain?: string, > uri?: string, > extracted_on?: string | null, > last_seen_on?: string | null, > still_on_page?: boolean > }[], > verification?: { > date?: string | null, > status?: string | null, > id?: number | null > } | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### findFoundPost `emailFinder.findFoundPost` Check whether an email was already found (POST form) **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailFinder.findFoundPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `company` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `full_name` | `string` | No | — | | `linkedin_handle` | `string` | No | — | | `max_duration` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > email?: string | null, > score?: number | null, > domain?: string, > company?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > linkedin_url?: string | null, > twitter?: string | null, > phone_number?: string | null, > accept_all?: boolean, > source_type?: string, > sources?: { > domain?: string, > uri?: string, > extracted_on?: string | null, > last_seen_on?: string | null, > still_on_page?: boolean > }[], > verification?: { > date?: string | null, > status?: string | null, > id?: number | null > } | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Email Insight ### get `emailInsight.get` Get insight data for an email address **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailInsight.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > email?: string, > gibberish?: boolean, > pattern?: boolean, > mx_records?: boolean, > disposable?: boolean, > webmail?: boolean, > webmail_allowed?: boolean | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Email Verifier ### verify `emailVerifier.verify` Verify the deliverability of an email address **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.emailVerifier.verify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `domain_metadata` | `boolean \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > status?: string, > result?: string, > score?: number | null, > email?: string, > regexp?: boolean, > gibberish?: boolean, > disposable?: boolean, > webmail?: boolean, > mx_records?: boolean, > smtp_server?: string | null, > smtp_check?: boolean, > accept_all?: boolean, > block?: boolean, > verification?: { > date?: string | null, > status?: string | null, > id?: number | null > } | null, > sources?: { > domain?: string, > uri?: string, > extracted_on?: string | null, > last_seen_on?: string | null, > still_on_page?: boolean > }[], > _deprecation_notice?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any, > company_name?: string | null, > domain?: string | null, > following_domain?: boolean, > webmail?: boolean > } > ``` *** ## Enrichment ### combined `enrichment.combined` Enrich a person and their company together **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.enrichment.combined({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `linkedin_handle` | `string` | No | — | | `clearbit_format` | `boolean \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status?: string, > data: { > person?: { > id?: string | null, > name?: { > fullName?: string | null, > givenName?: string | null, > familyName?: string | null > } | null, > email?: string | null, > location?: string | null, > timeZone?: string | null, > utcOffset?: number | null, > geo?: { > city?: string | null, > country?: string | null, > countryCode?: string | null, > lat?: number | null, > lng?: number | null, > state?: string | null, > stateCode?: string | null > } | null, > bio?: string | null, > site?: string | null, > avatar?: string | null, > employment?: { > domain?: string | null, > name?: string | null, > role?: string | null, > seniority?: string | null, > subRole?: string | null, > title?: string | null > } | null, > facebook?: { > handle?: string | null > } | null, > linkedin?: { > handle?: string | null > } | null, > googleplus?: { > handle?: string | null > } | null, > twitter?: { > handle?: string | null, > avatar?: string | null, > bio?: string | null, > followers?: number | null, > following?: number | null, > location?: string | null, > site?: string | null, > statuses?: number | null, > favorites?: number | null, > id?: number | null > } | null, > github?: { > handle?: string | null, > avatar?: string | null, > blog?: string | null, > company?: string | null, > followers?: number | null, > following?: number | null, > id?: number | null > } | null, > gravatar?: { > handle?: string | null, > avatar?: string | null, > avatars?: any[], > urls?: any[] > } | null, > fuzzy?: boolean, > emailProvider?: boolean, > phone?: string | null, > indexedAt?: string | null, > activeAt?: string | null, > inactiveAt?: string | null > }, > company?: { > id?: string | null, > name?: string | null, > legalName?: string | null, > domain?: string | null, > domainAliases?: string[], > site?: { > emailAddresses?: string[], > phoneNumbers?: string[] > } | null, > category?: { > sector?: string | null, > industryGroup?: string | null, > industry?: string | null, > subIndustry?: string | null, > sicCode?: string | null, > sic4Codes?: string[], > naicsCode?: string | null, > naics6Codes?: string[], > naics6Codes2022?: string[], > gicsCode?: string | null > } | null, > tags?: string[], > description?: string | null, > foundedYear?: number | null, > location?: string | null, > timeZone?: string | null, > utcOffset?: number | null, > geo?: { > } | null, > logo?: string | null, > facebook?: { > handle?: string | null, > likes?: number | null > } | null, > linkedin?: { > handle?: string | null > } | null, > twitter?: { > handle?: string | null > } | null, > crunchbase?: { > handle?: string | null > } | null, > youtube?: { > handle?: string | null > } | null, > instagram?: { > handle?: string | null > } | null, > emailProvider?: boolean, > type?: string | null, > companyType?: string | null, > ticker?: string | null, > identifiers?: { > usEIN?: string | null > } | null, > phone?: string | null, > metrics?: { > employees?: number | null, > employeesCount?: number | null, > alexaGlobalRank?: number | null, > alexaUsRank?: number | null, > annualRevenue?: number | null, > estimatedAnnualRevenue?: string | null, > marketCap?: string | null, > raised?: number | null, > fiscalYearEnd?: number | null, > trafficRank?: string | null > } | null, > indexedAt?: string | null, > tech?: string[], > techCategories?: string[], > fundingRounds?: { > amount?: number | null, > date?: string | null, > investors?: string[], > type?: string | null > }[], > parent?: { > domain?: string | null > } | null, > ultimateParent?: { > domain?: string | null > } | null, > alreadySaved?: boolean, > emailsCount?: number > } > }, > meta?: { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > } | { > person?: { > id?: string | null, > name?: { > fullName?: string | null, > givenName?: string | null, > familyName?: string | null > } | null, > email?: string | null, > location?: string | null, > timeZone?: string | null, > utcOffset?: number | null, > geo?: { > city?: string | null, > country?: string | null, > countryCode?: string | null, > lat?: number | null, > lng?: number | null, > state?: string | null, > stateCode?: string | null > } | null, > bio?: string | null, > site?: string | null, > avatar?: string | null, > employment?: { > domain?: string | null, > name?: string | null, > role?: string | null, > seniority?: string | null, > subRole?: string | null, > title?: string | null > } | null, > facebook?: { > handle?: string | null > } | null, > linkedin?: { > handle?: string | null > } | null, > googleplus?: { > handle?: string | null > } | null, > twitter?: { > handle?: string | null, > avatar?: string | null, > bio?: string | null, > followers?: number | null, > following?: number | null, > location?: string | null, > site?: string | null, > statuses?: number | null, > favorites?: number | null, > id?: number | null > } | null, > github?: { > handle?: string | null, > avatar?: string | null, > blog?: string | null, > company?: string | null, > followers?: number | null, > following?: number | null, > id?: number | null > } | null, > gravatar?: { > handle?: string | null, > avatar?: string | null, > avatars?: any[], > urls?: any[] > } | null, > fuzzy?: boolean, > emailProvider?: boolean, > phone?: string | null, > indexedAt?: string | null, > activeAt?: string | null, > inactiveAt?: string | null > }, > company?: { > id?: string | null, > name?: string | null, > legalName?: string | null, > domain?: string | null, > domainAliases?: string[], > site?: { > emailAddresses?: string[], > phoneNumbers?: string[] > } | null, > category?: { > sector?: string | null, > industryGroup?: string | null, > industry?: string | null, > subIndustry?: string | null, > sicCode?: string | null, > sic4Codes?: string[], > naicsCode?: string | null, > naics6Codes?: string[], > naics6Codes2022?: string[], > gicsCode?: string | null > } | null, > tags?: string[], > description?: string | null, > foundedYear?: number | null, > location?: string | null, > timeZone?: string | null, > utcOffset?: number | null, > geo?: { > } | null, > logo?: string | null, > facebook?: { > handle?: string | null, > likes?: number | null > } | null, > linkedin?: { > handle?: string | null > } | null, > twitter?: { > handle?: string | null > } | null, > crunchbase?: { > handle?: string | null > } | null, > youtube?: { > handle?: string | null > } | null, > instagram?: { > handle?: string | null > } | null, > emailProvider?: boolean, > type?: string | null, > companyType?: string | null, > ticker?: string | null, > identifiers?: { > usEIN?: string | null > } | null, > phone?: string | null, > metrics?: { > employees?: number | null, > employeesCount?: number | null, > alexaGlobalRank?: number | null, > alexaUsRank?: number | null, > annualRevenue?: number | null, > estimatedAnnualRevenue?: string | null, > marketCap?: string | null, > raised?: number | null, > fiscalYearEnd?: number | null, > trafficRank?: string | null > } | null, > indexedAt?: string | null, > tech?: string[], > techCategories?: string[], > fundingRounds?: { > amount?: number | null, > date?: string | null, > investors?: string[], > type?: string | null > }[], > parent?: { > domain?: string | null > } | null, > ultimateParent?: { > domain?: string | null > } | null, > alreadySaved?: boolean, > emailsCount?: number > } > } > ``` *** ### company `enrichment.company` Enrich a company profile from a domain or name **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.enrichment.company({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `clearbit_format` | `boolean \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status?: string, > data: { > id?: string | null, > name?: string | null, > legalName?: string | null, > domain?: string | null, > domainAliases?: string[], > site?: { > emailAddresses?: string[], > phoneNumbers?: string[] > } | null, > category?: { > sector?: string | null, > industryGroup?: string | null, > industry?: string | null, > subIndustry?: string | null, > sicCode?: string | null, > sic4Codes?: string[], > naicsCode?: string | null, > naics6Codes?: string[], > naics6Codes2022?: string[], > gicsCode?: string | null > } | null, > tags?: string[], > description?: string | null, > foundedYear?: number | null, > location?: string | null, > timeZone?: string | null, > utcOffset?: number | null, > geo?: { > } | null, > logo?: string | null, > facebook?: { > handle?: string | null, > likes?: number | null > } | null, > linkedin?: { > handle?: string | null > } | null, > twitter?: { > handle?: string | null > } | null, > crunchbase?: { > handle?: string | null > } | null, > youtube?: { > handle?: string | null > } | null, > instagram?: { > handle?: string | null > } | null, > emailProvider?: boolean, > type?: string | null, > companyType?: string | null, > ticker?: string | null, > identifiers?: { > usEIN?: string | null > } | null, > phone?: string | null, > metrics?: { > employees?: number | null, > employeesCount?: number | null, > alexaGlobalRank?: number | null, > alexaUsRank?: number | null, > annualRevenue?: number | null, > estimatedAnnualRevenue?: string | null, > marketCap?: string | null, > raised?: number | null, > fiscalYearEnd?: number | null, > trafficRank?: string | null > } | null, > indexedAt?: string | null, > tech?: string[], > techCategories?: string[], > fundingRounds?: { > amount?: number | null, > date?: string | null, > investors?: string[], > type?: string | null > }[], > parent?: { > domain?: string | null > } | null, > ultimateParent?: { > domain?: string | null > } | null, > alreadySaved?: boolean, > emailsCount?: number > }, > meta?: { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > } | { > id?: string | null, > name?: string | null, > legalName?: string | null, > domain?: string | null, > domainAliases?: string[], > site?: { > emailAddresses?: string[], > phoneNumbers?: string[] > } | null, > category?: { > sector?: string | null, > industryGroup?: string | null, > industry?: string | null, > subIndustry?: string | null, > sicCode?: string | null, > sic4Codes?: string[], > naicsCode?: string | null, > naics6Codes?: string[], > naics6Codes2022?: string[], > gicsCode?: string | null > } | null, > tags?: string[], > description?: string | null, > foundedYear?: number | null, > location?: string | null, > timeZone?: string | null, > utcOffset?: number | null, > geo?: { > } | null, > logo?: string | null, > facebook?: { > handle?: string | null, > likes?: number | null > } | null, > linkedin?: { > handle?: string | null > } | null, > twitter?: { > handle?: string | null > } | null, > crunchbase?: { > handle?: string | null > } | null, > youtube?: { > handle?: string | null > } | null, > instagram?: { > handle?: string | null > } | null, > emailProvider?: boolean, > type?: string | null, > companyType?: string | null, > ticker?: string | null, > identifiers?: { > usEIN?: string | null > } | null, > phone?: string | null, > metrics?: { > employees?: number | null, > employeesCount?: number | null, > alexaGlobalRank?: number | null, > alexaUsRank?: number | null, > annualRevenue?: number | null, > estimatedAnnualRevenue?: string | null, > marketCap?: string | null, > raised?: number | null, > fiscalYearEnd?: number | null, > trafficRank?: string | null > } | null, > indexedAt?: string | null, > tech?: string[], > techCategories?: string[], > fundingRounds?: { > amount?: number | null, > date?: string | null, > investors?: string[], > type?: string | null > }[], > parent?: { > domain?: string | null > } | null, > ultimateParent?: { > domain?: string | null > } | null, > alreadySaved?: boolean, > emailsCount?: number > } > ``` *** ### person `enrichment.person` Enrich a person profile from an email or name **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.enrichment.person({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `linkedin_handle` | `string` | No | — | | `clearbit_format` | `boolean \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status?: string, > data: { > id?: string | null, > name?: { > fullName?: string | null, > givenName?: string | null, > familyName?: string | null > } | null, > email?: string | null, > location?: string | null, > timeZone?: string | null, > utcOffset?: number | null, > geo?: { > city?: string | null, > country?: string | null, > countryCode?: string | null, > lat?: number | null, > lng?: number | null, > state?: string | null, > stateCode?: string | null > } | null, > bio?: string | null, > site?: string | null, > avatar?: string | null, > employment?: { > domain?: string | null, > name?: string | null, > role?: string | null, > seniority?: string | null, > subRole?: string | null, > title?: string | null > } | null, > facebook?: { > handle?: string | null > } | null, > linkedin?: { > handle?: string | null > } | null, > googleplus?: { > handle?: string | null > } | null, > twitter?: { > handle?: string | null, > avatar?: string | null, > bio?: string | null, > followers?: number | null, > following?: number | null, > location?: string | null, > site?: string | null, > statuses?: number | null, > favorites?: number | null, > id?: number | null > } | null, > github?: { > handle?: string | null, > avatar?: string | null, > blog?: string | null, > company?: string | null, > followers?: number | null, > following?: number | null, > id?: number | null > } | null, > gravatar?: { > handle?: string | null, > avatar?: string | null, > avatars?: any[], > urls?: any[] > } | null, > fuzzy?: boolean, > emailProvider?: boolean, > phone?: string | null, > indexedAt?: string | null, > activeAt?: string | null, > inactiveAt?: string | null > }, > meta?: { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > } | { > id?: string | null, > name?: { > fullName?: string | null, > givenName?: string | null, > familyName?: string | null > } | null, > email?: string | null, > location?: string | null, > timeZone?: string | null, > utcOffset?: number | null, > geo?: { > city?: string | null, > country?: string | null, > countryCode?: string | null, > lat?: number | null, > lng?: number | null, > state?: string | null, > stateCode?: string | null > } | null, > bio?: string | null, > site?: string | null, > avatar?: string | null, > employment?: { > domain?: string | null, > name?: string | null, > role?: string | null, > seniority?: string | null, > subRole?: string | null, > title?: string | null > } | null, > facebook?: { > handle?: string | null > } | null, > linkedin?: { > handle?: string | null > } | null, > googleplus?: { > handle?: string | null > } | null, > twitter?: { > handle?: string | null, > avatar?: string | null, > bio?: string | null, > followers?: number | null, > following?: number | null, > location?: string | null, > site?: string | null, > statuses?: number | null, > favorites?: number | null, > id?: number | null > } | null, > github?: { > handle?: string | null, > avatar?: string | null, > blog?: string | null, > company?: string | null, > followers?: number | null, > following?: number | null, > id?: number | null > } | null, > gravatar?: { > handle?: string | null, > avatar?: string | null, > avatars?: any[], > urls?: any[] > } | null, > fuzzy?: boolean, > emailProvider?: boolean, > phone?: string | null, > indexedAt?: string | null, > activeAt?: string | null, > inactiveAt?: string | null > } > ``` *** ## Feedback ### create `feedback.create` Send product feedback to Hunter **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.feedback.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `feedback_type` | `missing_endpoint \| incorrect_documentation \| unexpected_response \| bug \| data_quality \| confusing_behavior \| feature_request \| other` | Yes | — | | `summary` | `string` | Yes | — | | `details` | `string` | Yes | — | | `endpoint` | `string` | No | — | | `expected` | `string` | No | — | | `actual` | `string` | No | — | | `request_example` | `string` | No | — | | `response_example` | `string` | No | — | | `severity` | `low \| medium \| high \| blocking` | No | — | | `agent` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > status?: string, > feedback_type?: string, > severity?: string, > message?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Leads ### bulkDelete `leads.bulkDelete` Delete leads in bulk permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.leads.bulkDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_ids` | `number[]` | No | — | | `leads_list_id` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `any` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### bulkExist `leads.bulkExist` Check which of the given emails exist as leads **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.leads.bulkExist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > email: string, > id?: number | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### bulkMove `leads.bulkMove` Move leads to another leads list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leads.bulkMove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leads_list_id` | `number \| string` | Yes | — | | `target_leads_list_id` | `number \| string` | Yes | — | | `lead_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > source_leads_list_id?: number, > target_leads_list_id?: number, > leads_count?: number, > status?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### bulkUpsert `leads.bulkUpsert` Create or update up to 100 leads in a single call **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leads.bulkUpsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leads_list_id` | `number \| string` | No | — | | `leads_list_name` | `string` | No | — | | `leads` | `object[]` | Yes | — | > **leads full type** > > ```ts theme={null} > { > email?: string, > first_name?: string, > last_name?: string, > position?: string, > company?: string, > company_industry?: string, > company_size?: string, > confidence_score?: number, > website?: string, > country_code?: string, > department?: string, > linkedin_url?: string, > phone_number?: string, > twitter?: string, > notes?: string, > source?: string, > leads_list_id?: number | string, > leads_list_ids?: ( > number | string > )[], > leads_list_name?: string, > custom_attributes?: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > index?: number, > email?: string | null, > status?: string, > lead?: { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > company?: string | null, > company_industry?: string | null, > company_size?: string | null, > confidence_score?: number | null, > website?: string | null, > country_code?: string | null, > source?: string | null, > department?: string | null, > linkedin_url?: string | null, > phone_number?: string | null, > twitter?: string | null, > sync_status?: string | null, > notes?: string | null, > sending_status?: string | null, > last_activity_at?: string | null, > last_contacted_at?: string | null, > verification?: { > date?: string | null, > status?: string | null > } | null, > leads_list?: { > id?: number, > name?: string, > leads_count?: number > } | null, > leads_lists?: { > id?: number, > name?: string, > leads_count?: number > }[], > custom_attributes?: { > }, > created_at?: string | null, > created_by?: number | null > } | null, > errors?: any[] > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any, > created?: number, > updated?: number, > failed?: number > } > ``` *** ### create `leads.create` Create a lead **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `position` | `string` | No | — | | `company` | `string` | No | — | | `company_industry` | `string` | No | — | | `company_size` | `string` | No | — | | `confidence_score` | `number` | No | — | | `website` | `string` | No | — | | `country_code` | `string` | No | — | | `department` | `string` | No | — | | `linkedin_url` | `string` | No | — | | `phone_number` | `string` | No | — | | `twitter` | `string` | No | — | | `notes` | `string` | No | — | | `source` | `string` | No | — | | `leads_list_id` | `number \| string` | No | — | | `leads_list_ids` | `(number \| string)[]` | No | — | | `leads_list_name` | `string` | No | — | | `custom_attributes` | `object` | No | — | | `company_type` | `string` | No | — | | `lead_country_code` | `string` | No | — | | `lead_city` | `string` | No | — | | `lead_state` | `string` | No | — | > **custom\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > company?: string | null, > company_industry?: string | null, > company_size?: string | null, > confidence_score?: number | null, > website?: string | null, > country_code?: string | null, > source?: string | null, > department?: string | null, > linkedin_url?: string | null, > phone_number?: string | null, > twitter?: string | null, > sync_status?: string | null, > notes?: string | null, > sending_status?: string | null, > last_activity_at?: string | null, > last_contacted_at?: string | null, > verification?: { > date?: string | null, > status?: string | null > } | null, > leads_list?: { > id?: number, > name?: string, > leads_count?: number > } | null, > leads_lists?: { > id?: number, > name?: string, > leads_count?: number > }[], > custom_attributes?: { > }, > created_at?: string | null, > created_by?: number | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `leads.delete` Delete a lead permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.leads.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### enrich `leads.enrich` Enrich a lead with data found by Hunter **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leads.enrich({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > company?: string | null, > company_industry?: string | null, > company_size?: string | null, > confidence_score?: number | null, > website?: string | null, > country_code?: string | null, > source?: string | null, > department?: string | null, > linkedin_url?: string | null, > phone_number?: string | null, > twitter?: string | null, > sync_status?: string | null, > notes?: string | null, > sending_status?: string | null, > last_activity_at?: string | null, > last_contacted_at?: string | null, > verification?: { > date?: string | null, > status?: string | null > } | null, > leads_list?: { > id?: number, > name?: string, > leads_count?: number > } | null, > leads_lists?: { > id?: number, > name?: string, > leads_count?: number > }[], > custom_attributes?: { > }, > created_at?: string | null, > created_by?: number | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### exist `leads.exist` Check whether an email exists as a lead **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.leads.exist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number | null, > leads_list_id?: number | null, > leads_list_name?: string | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### get `leads.get` Get a lead **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.leads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > company?: string | null, > company_industry?: string | null, > company_size?: string | null, > confidence_score?: number | null, > website?: string | null, > country_code?: string | null, > source?: string | null, > department?: string | null, > linkedin_url?: string | null, > phone_number?: string | null, > twitter?: string | null, > sync_status?: string | null, > notes?: string | null, > sending_status?: string | null, > last_activity_at?: string | null, > last_contacted_at?: string | null, > verification?: { > date?: string | null, > status?: string | null > } | null, > leads_list?: { > id?: number, > name?: string, > leads_count?: number > } | null, > leads_lists?: { > id?: number, > name?: string, > leads_count?: number > }[], > custom_attributes?: { > }, > created_at?: string | null, > created_by?: number | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### importCsv `leads.importCsv` Create a CSV import job for leads **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leads.importCsv({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `csv_data` | `string` | Yes | — | | `leads_list_id` | `number \| string` | No | — | | `file_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `any` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `leads.list` List leads with filters **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.leads.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leads_list_id` | `number \| string` | No | — | | `email` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `position` | `string \| string[]` | No | — | | `company` | `string` | No | — | | `industry` | `string` | No | — | | `website` | `string` | No | — | | `country_code` | `string` | No | — | | `company_size` | `string` | No | — | | `source` | `string` | No | — | | `twitter` | `string` | No | — | | `linkedin_url` | `string` | No | — | | `phone_number` | `string` | No | — | | `sync_status` | `pending \| error \| success` | No | — | | `sending_status` | `clicked \| opened \| sent \| pending \| error \| bounced \| unsubscribed \| replied \| ~[]` | No | — | | `verification_status` | `accept_all \| disposable \| invalid \| unknown \| valid \| webmail \| pending[]` | No | — | | `last_activity_at` | `object` | No | — | | `last_contacted_at` | `object` | No | — | | `last_exported_at` | `object` | No | — | | `created_at` | `object` | No | — | | `updated_at` | `object` | No | — | | `verification_date` | `object` | No | — | | `department` | `executive \| it \| finance \| management \| sales \| legal \| support \| hr \| marketing \| communication \| education \| design \| health \| operations[]` | No | — | | `tags` | `number[]` | No | — | | `sequence_ids` | `number[] \| * \| ~` | No | — | | `campaign_ids` | `number[] \| * \| ~` | No | — | | `user_id` | `number[]` | No | — | | `confidence_score` | `object` | No | — | | `custom_attributes` | `object` | No | — | | `query` | `string` | No | — | | `location` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | > **last\_activity\_at full type** > > ```ts theme={null} > * | ~ | last1h | today | this_week | last7d | last30d | current_year | { > from?: string, > to?: string > } > ``` > **last\_contacted\_at full type** > > ```ts theme={null} > * | ~ | last1h | today | this_week | last7d | last30d | current_year | { > from?: string, > to?: string > } > ``` > **last\_exported\_at full type** > > ```ts theme={null} > * | ~ | last1h | today | this_week | last7d | last30d | current_year | { > from?: string, > to?: string > } > ``` > **created\_at full type** > > ```ts theme={null} > * | ~ | last1h | today | this_week | last7d | last30d | current_year | { > from?: string, > to?: string > } > ``` > **updated\_at full type** > > ```ts theme={null} > * | ~ | last1h | today | this_week | last7d | last30d | current_year | { > from?: string, > to?: string > } > ``` > **verification\_date full type** > > ```ts theme={null} > * | ~ | last1h | today | this_week | last7d | last30d | current_year | { > from?: string, > to?: string > } > ``` > **confidence\_score full type** > > ```ts theme={null} > * | ~ | { > from?: number, > to?: number > } > ``` > **custom\_attributes full type** > > ```ts theme={null} > { > } > ``` > **location full type** > > ```ts theme={null} > { > country?: { > include?: string[], > exclude?: string[] > }, > state?: { > include?: string[], > exclude?: string[] > }, > city?: { > include?: string[], > exclude?: string[] > }, > continent?: { > include?: string[], > exclude?: string[] > }, > business_region?: { > include?: string[], > exclude?: string[] > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > leads: { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > company?: string | null, > company_industry?: string | null, > company_size?: string | null, > confidence_score?: number | null, > website?: string | null, > country_code?: string | null, > source?: string | null, > department?: string | null, > linkedin_url?: string | null, > phone_number?: string | null, > twitter?: string | null, > sync_status?: string | null, > notes?: string | null, > sending_status?: string | null, > last_activity_at?: string | null, > last_contacted_at?: string | null, > verification?: { > date?: string | null, > status?: string | null > } | null, > leads_list?: { > id?: number, > name?: string, > leads_count?: number > } | null, > leads_lists?: { > id?: number, > name?: string, > leads_count?: number > }[], > custom_attributes?: { > }, > created_at?: string | null, > created_by?: number | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `leads.replace` Replace a lead **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leads.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `email` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `position` | `string` | No | — | | `company` | `string` | No | — | | `company_industry` | `string` | No | — | | `company_size` | `string` | No | — | | `confidence_score` | `number` | No | — | | `website` | `string` | No | — | | `country_code` | `string` | No | — | | `department` | `string` | No | — | | `linkedin_url` | `string` | No | — | | `phone_number` | `string` | No | — | | `twitter` | `string` | No | — | | `notes` | `string` | No | — | | `source` | `string` | No | — | | `leads_list_id` | `number \| string` | No | — | | `leads_list_ids` | `(number \| string)[]` | No | — | | `leads_list_name` | `string` | No | — | | `custom_attributes` | `object` | No | — | | `company_type` | `string` | No | — | | `lead_country_code` | `string` | No | — | | `lead_city` | `string` | No | — | | `lead_state` | `string` | No | — | > **custom\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output:** `undefined` *** ### update `leads.update` Update a lead **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leads.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `email` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `position` | `string` | No | — | | `company` | `string` | No | — | | `company_industry` | `string` | No | — | | `company_size` | `string` | No | — | | `confidence_score` | `number` | No | — | | `website` | `string` | No | — | | `country_code` | `string` | No | — | | `department` | `string` | No | — | | `linkedin_url` | `string` | No | — | | `phone_number` | `string` | No | — | | `twitter` | `string` | No | — | | `notes` | `string` | No | — | | `source` | `string` | No | — | | `leads_list_id` | `number \| string` | No | — | | `leads_list_ids` | `(number \| string)[]` | No | — | | `leads_list_name` | `string` | No | — | | `custom_attributes` | `object` | No | — | | `company_type` | `string` | No | — | | `lead_country_code` | `string` | No | — | | `lead_city` | `string` | No | — | | `lead_state` | `string` | No | — | > **custom\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output:** `undefined` *** ### upsert `leads.upsert` Create or update a lead **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leads.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `position` | `string` | No | — | | `company` | `string` | No | — | | `company_industry` | `string` | No | — | | `company_size` | `string` | No | — | | `confidence_score` | `number` | No | — | | `website` | `string` | No | — | | `country_code` | `string` | No | — | | `department` | `string` | No | — | | `linkedin_url` | `string` | No | — | | `phone_number` | `string` | No | — | | `twitter` | `string` | No | — | | `notes` | `string` | No | — | | `source` | `string` | No | — | | `leads_list_id` | `number \| string` | No | — | | `leads_list_ids` | `(number \| string)[]` | No | — | | `leads_list_name` | `string` | No | — | | `custom_attributes` | `object` | No | — | > **custom\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > company?: string | null, > company_industry?: string | null, > company_size?: string | null, > confidence_score?: number | null, > website?: string | null, > country_code?: string | null, > source?: string | null, > department?: string | null, > linkedin_url?: string | null, > phone_number?: string | null, > twitter?: string | null, > sync_status?: string | null, > notes?: string | null, > sending_status?: string | null, > last_activity_at?: string | null, > last_contacted_at?: string | null, > verification?: { > date?: string | null, > status?: string | null > } | null, > leads_list?: { > id?: number, > name?: string, > leads_count?: number > } | null, > leads_lists?: { > id?: number, > name?: string, > leads_count?: number > }[], > custom_attributes?: { > }, > created_at?: string | null, > created_by?: number | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Leads List Folders ### create `leadsListFolders.create` Create a leads list folder **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leadsListFolders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `color` | `374151 \| 3489F9 \| 10B981 \| F5BA0B \| EF4444 \| 7C3AED \| F97316 \| E5E7EB \| B4D9F7 \| BAE6B0 \| FDE68A \| FBD0D0 \| D4C4F8 \| FFD79B` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string, > leads_lists_count?: number, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `leadsListFolders.delete` Delete a leads list folder permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.leadsListFolders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `leadsListFolders.get` Get a leads list folder **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.leadsListFolders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string, > leads_lists_count?: number, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `leadsListFolders.list` List the leads list folders **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.leadsListFolders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > folders: { > id?: number, > name?: string, > color?: string, > leads_lists_count?: number, > created_at?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `leadsListFolders.replace` Replace a leads list folder **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leadsListFolders.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `color` | `374151 \| 3489F9 \| 10B981 \| F5BA0B \| EF4444 \| 7C3AED \| F97316 \| E5E7EB \| B4D9F7 \| BAE6B0 \| FDE68A \| FBD0D0 \| D4C4F8 \| FFD79B` | No | — | **Output:** `undefined` *** ### update `leadsListFolders.update` Update a leads list folder **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leadsListFolders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `color` | `374151 \| 3489F9 \| 10B981 \| F5BA0B \| EF4444 \| 7C3AED \| F97316 \| E5E7EB \| B4D9F7 \| BAE6B0 \| FDE68A \| FBD0D0 \| D4C4F8 \| FFD79B` | No | — | **Output:** `undefined` *** ## Leads Lists ### create `leadsLists.create` Create a leads list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leadsLists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `leads_list_folder_id` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > leads_count?: number, > type?: string, > created_at?: string, > leads_list_folder_id?: number | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `leadsLists.delete` Delete a leads list permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.leadsLists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > status?: string, > data?: any, > meta?: { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > } | undefined > ``` *** ### favorite `leadsLists.favorite` Mark a leads list as favorite **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leadsLists.favorite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > favorited?: boolean > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### get `leadsLists.get` Get a leads list and its leads **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.leadsLists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > leads_count?: number, > type?: string, > created_at?: string, > leads_list_folder_id?: number | null, > leads?: { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > company?: string | null, > company_industry?: string | null, > company_size?: string | null, > confidence_score?: number | null, > website?: string | null, > country_code?: string | null, > source?: string | null, > department?: string | null, > linkedin_url?: string | null, > phone_number?: string | null, > twitter?: string | null, > sync_status?: string | null, > notes?: string | null, > sending_status?: string | null, > last_activity_at?: string | null, > last_contacted_at?: string | null, > verification?: { > date?: string | null, > status?: string | null > } | null, > leads_list?: { > id?: number, > name?: string, > leads_count?: number > } | null, > leads_lists?: { > id?: number, > name?: string, > leads_count?: number > }[], > custom_attributes?: { > }, > created_at?: string | null, > created_by?: number | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `leadsLists.list` List the leads lists on the account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.leadsLists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > leads_lists: { > id?: number, > name?: string, > leads_count?: number, > type?: string, > created_at?: string, > leads_list_folder_id?: number | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### merge `leadsLists.merge` Merge a leads list into another list \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.hunterio.api.leadsLists.merge({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### replace `leadsLists.replace` Replace a leads list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leadsLists.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | Yes | — | | `leads_list_folder_id` | `number \| string` | No | — | **Output:** `undefined` *** ### unfavorite `leadsLists.unfavorite` Remove the favorite mark from a leads list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leadsLists.unfavorite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > favorited?: boolean > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `leadsLists.update` Update a leads list **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leadsLists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | Yes | — | | `leads_list_folder_id` | `number \| string` | No | — | **Output:** `undefined` *** ## Lead Tags ### attach `leadTags.attach` Attach a tag to a lead **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.leadTags.attach({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `tag_id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > tags: { > id?: number, > name?: string, > color?: string | null, > created_at?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### detach `leadTags.detach` Detach a tag from a lead \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.hunterio.api.leadTags.detach({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `tag_id` | `number \| string` | Yes | — | **Output:** `undefined` *** ## Lookalikes ### list `lookalikes.list` Find companies similar to a seed company **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.lookalikes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_list_id` | `number \| string` | No | — | | `domain` | `string` | No | — | | `country` | `string` | No | — | | `size` | `string[]` | No | — | | `industry` | `string[]` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > company_name?: string | null, > domain?: string, > industry?: string | null, > size?: string | null, > country?: string | null, > similarity_score?: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Messages ### list `messages.list` List messages sent or received **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| string[]` | No | — | | `direction` | `outgoing \| incoming` | No | — | | `read` | `boolean` | No | — | | `replied` | `boolean` | No | — | | `bounced` | `boolean` | No | — | | `unsubscribed` | `boolean` | No | — | | `out_of_office` | `boolean` | No | — | | `lead_id` | `number \| string` | No | — | | `sequence_id` | `number \| string` | No | — | | `campaign_id` | `number \| string` | No | — | | `email_account_id` | `number \| string` | No | — | | `sent_after` | `string` | No | — | | `sent_before` | `string` | No | — | | `received_after` | `string` | No | — | | `received_before` | `string` | No | — | | `q` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > messages: { > id?: number, > status?: string, > message_id?: string | null, > thread_id?: string | null, > to?: string | null, > subject?: string | null, > body?: string | null, > manually_edited?: boolean, > opens?: number, > clicks?: number, > bounced?: boolean, > replied?: boolean, > last_activity_at?: string | null, > sent_at?: string | null, > lead?: { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null > } | null, > campaign?: { > id?: number, > name?: string, > recipients_count?: number, > started?: boolean, > archived?: boolean, > paused?: boolean, > last_email_sent_at?: string | null > } | null, > owner?: { > id?: number, > email?: string > } | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### send `messages.send` Send a message from a connected email account **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email_account_id` | `number \| string` | Yes | — | | `lead_id` | `number \| string` | No | — | | `to` | `string` | No | — | | `subject` | `string` | Yes | — | | `body` | `string` | Yes | — | | `message_format` | `text \| html` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > status?: string, > message_id?: string | null, > thread_id?: string | null, > to?: string | null, > subject?: string | null, > body?: string | null, > manually_edited?: boolean, > opens?: number, > clicks?: number, > bounced?: boolean, > replied?: boolean, > last_activity_at?: string | null, > sent_at?: string | null, > lead?: { > id?: number, > email?: string | null, > first_name?: string | null, > last_name?: string | null > } | null, > campaign?: { > id?: number, > name?: string, > recipients_count?: number, > started?: boolean, > archived?: boolean, > paused?: boolean, > last_email_sent_at?: string | null > } | null, > owner?: { > id?: number, > email?: string > } | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Message Templates ### create `messageTemplates.create` Create a message template **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.messageTemplates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `subject` | `string` | No | — | | `body` | `string` | Yes | — | | `message_format` | `text \| html` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > subject?: string | null, > body?: string | null, > message_format?: string | null, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `messageTemplates.delete` Delete a message template permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.messageTemplates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `messageTemplates.get` Get a message template **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.messageTemplates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > subject?: string | null, > body?: string | null, > message_format?: string | null, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `messageTemplates.list` List message templates **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.messageTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > message_templates: { > id?: number, > name?: string, > subject?: string | null, > body?: string | null, > message_format?: string | null, > created_at?: string, > updated_at?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `messageTemplates.replace` Replace a message template **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.messageTemplates.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `message_format` | `text \| html` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > subject?: string | null, > body?: string | null, > message_format?: string | null, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `messageTemplates.update` Update a message template **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.messageTemplates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `message_format` | `text \| html` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > subject?: string | null, > body?: string | null, > message_format?: string | null, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Multi Domain Search ### reveal `multiDomainSearch.reveal` Reveal the verified email addresses of a multi-domain search **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.multiDomainSearch.reveal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `handles` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `any` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### search `multiDomainSearch.search` Find email addresses across multiple domains **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.multiDomainSearch.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `company_name` | `string` | No | — | | `company_type` | `string` | No | — | | `industry` | `string` | No | — | | `headcount` | `string` | No | — | | `founded_year` | `string` | No | — | | `location` | `string` | No | — | | `technology` | `string` | No | — | | `department` | `string` | No | — | | `seniority` | `string` | No | — | | `job_title` | `string` | No | — | | `type` | `string` | No | — | | `verification_status` | `string` | No | — | | `provenance` | `string` | No | — | | `min_confidence` | `number` | No | — | | `required_field` | `string` | No | — | | `decision_maker` | `boolean` | No | — | | `exclude_already_saved` | `boolean` | No | — | | `per_domain` | `boolean` | No | — | | `search_after` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > name?: string | null, > position?: string | null, > department?: string | null, > seniority?: string | null, > type?: string, > decision_maker?: boolean, > domain?: string, > company_name?: string | null, > full_name_exists?: boolean, > phone_number_exists?: boolean, > linkedin_exists?: boolean, > verification?: { > date?: string | null, > status?: string | null > }, > reveal_handle?: string, > provenance?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any, > next_search_after?: string | null, > per_domain?: { > domain?: string, > emails?: number > }[] > } > ``` *** ## Sequence Follow Ups ### create `sequenceFollowUps.create` Add a follow-up step to a sequence **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequenceFollowUps.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequence_id` | `number \| string` | Yes | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `wait_days` | `number` | No | — | | `step` | `number` | No | — | | `variant` | `B` | No | — | | `message_format` | `text \| html` | No | — | | `message_template_id` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > follow_up: { > id?: number, > campaign_id?: number, > step?: number, > wait_days?: number, > message_format?: string | null, > messages_sent?: number, > subject?: string | null, > body?: string | null, > variant?: string | null > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `sequenceFollowUps.delete` Delete the last follow-up step permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.sequenceFollowUps.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequence_id` | `number \| string` | Yes | — | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `sequenceFollowUps.get` Get a follow-up step **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.sequenceFollowUps.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequence_id` | `number \| string` | Yes | — | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > campaign_id?: number, > step?: number, > wait_days?: number, > message_format?: string | null, > messages_sent?: number, > subject?: string | null, > body?: string | null, > variant?: string | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `sequenceFollowUps.list` List the follow-up steps of a sequence **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.sequenceFollowUps.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequence_id` | `number \| string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > follow_ups: { > id?: number, > campaign_id?: number, > step?: number, > wait_days?: number, > message_format?: string | null, > messages_sent?: number, > subject?: string | null, > body?: string | null, > variant?: string | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `sequenceFollowUps.replace` Replace a follow-up step **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequenceFollowUps.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequence_id` | `number \| string` | Yes | — | | `id` | `number \| string` | Yes | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `wait_days` | `number` | No | — | | `message_format` | `text \| html` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > campaign_id?: number, > step?: number, > wait_days?: number, > message_format?: string | null, > messages_sent?: number, > subject?: string | null, > body?: string | null, > variant?: string | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `sequenceFollowUps.update` Update a follow-up step **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequenceFollowUps.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequence_id` | `number \| string` | Yes | — | | `id` | `number \| string` | Yes | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `wait_days` | `number` | No | — | | `message_format` | `text \| html` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > campaign_id?: number, > step?: number, > wait_days?: number, > message_format?: string | null, > messages_sent?: number, > subject?: string | null, > body?: string | null, > variant?: string | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Sequence Recipients ### add `sequenceRecipients.add` Add recipients to a sequence **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequenceRecipients.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `emails` | `string \| string[]` | No | — | | `lead_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > recipients_added?: number, > skipped_recipients?: { > email?: string, > reason?: string > }[] | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `sequenceRecipients.list` List the recipients of a sequence **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.sequenceRecipients.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > recipients: { > email?: string | null, > first_name?: string | null, > last_name?: string | null, > position?: string | null, > company?: string | null, > website?: string | null, > sending_status?: string, > sending_status_comment?: string | null, > lead_id?: number | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### remove `sequenceRecipients.remove` Remove recipients from a sequence and cancel their messages \[DESTRUCTIVE] **Risk:** `destructive` ```ts theme={null} await corsair.hunterio.api.sequenceRecipients.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `emails` | `string \| string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > recipients_removed?: string[], > recipients_canceled?: string[], > messages_canceled?: number, > skipped_recipients?: { > email?: string, > reason?: string > }[] | null > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Sequences ### archive `sequences.archive` Archive a sequence **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequences.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > message?: string, > recipients_count?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### create `sequences.create` Create a sequence draft **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequences.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `email_account_ids` | `number[]` | No | — | | `schedule_time_start` | `string` | No | — | | `schedule_time_end` | `string` | No | — | | `schedule_days` | `number[]` | No | — | | `add_unsubscribe_link` | `boolean` | No | — | | `tracked` | `boolean` | No | — | | `tracked_links` | `boolean` | No | — | | `ai_assistant_enabled` | `boolean` | No | — | | `bcc_recipient` | `string` | No | — | | `start_at` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > status?: draft | planned | active | paused | completed | archived | preparing | error, > recipients_count?: number, > editable?: boolean, > started?: boolean, > paused?: boolean, > archived?: boolean, > schedule?: { > start_at?: string | null, > time_start?: string, > time_end?: string, > days?: number[] > }, > settings?: { > tracked?: boolean, > tracked_links?: boolean, > add_unsubscribe_link?: boolean, > ai_assistant_enabled?: boolean, > bcc_recipient?: string | null > }, > ab_testing?: { > enabled?: boolean, > variant_a_percentage?: number | null, > variant_b_percentage?: number | null, > winner_variant?: string | null, > winner_selected_at?: string | null > }, > email_account_ids?: number[], > follow_ups?: { > unique_steps_count?: number, > steps?: number[] > }, > owner?: { > id?: number, > email?: string > } | null, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `sequences.delete` Delete a sequence draft permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.sequences.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `sequences.get` Get a sequence **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.sequences.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > status?: draft | planned | active | paused | completed | archived | preparing | error, > recipients_count?: number, > editable?: boolean, > started?: boolean, > paused?: boolean, > archived?: boolean, > schedule?: { > start_at?: string | null, > time_start?: string, > time_end?: string, > days?: number[] > }, > settings?: { > tracked?: boolean, > tracked_links?: boolean, > add_unsubscribe_link?: boolean, > ai_assistant_enabled?: boolean, > bcc_recipient?: string | null > }, > ab_testing?: { > enabled?: boolean, > variant_a_percentage?: number | null, > variant_b_percentage?: number | null, > winner_variant?: string | null, > winner_selected_at?: string | null > }, > email_account_ids?: number[], > follow_ups?: { > unique_steps_count?: number, > steps?: number[] > }, > owner?: { > id?: number, > email?: string > } | null, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `sequences.list` List sequences **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.sequences.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `started` | `boolean` | No | — | | `archived` | `boolean` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > sequences: { > id?: number, > name?: string, > status?: draft | planned | active | paused | completed | archived | preparing | error, > recipients_count?: number, > editable?: boolean, > started?: boolean, > paused?: boolean, > archived?: boolean, > schedule?: { > start_at?: string | null, > time_start?: string, > time_end?: string, > days?: number[] > }, > settings?: { > tracked?: boolean, > tracked_links?: boolean, > add_unsubscribe_link?: boolean, > ai_assistant_enabled?: boolean, > bcc_recipient?: string | null > }, > ab_testing?: { > enabled?: boolean, > variant_a_percentage?: number | null, > variant_b_percentage?: number | null, > winner_variant?: string | null, > winner_selected_at?: string | null > }, > email_account_ids?: number[], > follow_ups?: { > unique_steps_count?: number, > steps?: number[] > }, > owner?: { > id?: number, > email?: string > } | null, > created_at?: string, > updated_at?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### pause `sequences.pause` Pause an active sequence **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequences.pause({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > message?: string, > recipients_count?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `sequences.replace` Replace a sequence **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequences.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email_account_ids` | `number[]` | No | — | | `schedule_time_start` | `string` | No | — | | `schedule_time_end` | `string` | No | — | | `schedule_days` | `number[]` | No | — | | `add_unsubscribe_link` | `boolean` | No | — | | `tracked` | `boolean` | No | — | | `tracked_links` | `boolean` | No | — | | `ai_assistant_enabled` | `boolean` | No | — | | `bcc_recipient` | `string` | No | — | | `start_at` | `string` | No | — | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > status?: draft | planned | active | paused | completed | archived | preparing | error, > recipients_count?: number, > editable?: boolean, > started?: boolean, > paused?: boolean, > archived?: boolean, > schedule?: { > start_at?: string | null, > time_start?: string, > time_end?: string, > days?: number[] > }, > settings?: { > tracked?: boolean, > tracked_links?: boolean, > add_unsubscribe_link?: boolean, > ai_assistant_enabled?: boolean, > bcc_recipient?: string | null > }, > ab_testing?: { > enabled?: boolean, > variant_a_percentage?: number | null, > variant_b_percentage?: number | null, > winner_variant?: string | null, > winner_selected_at?: string | null > }, > email_account_ids?: number[], > follow_ups?: { > unique_steps_count?: number, > steps?: number[] > }, > owner?: { > id?: number, > email?: string > } | null, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### resume `sequences.resume` Resume a paused sequence **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequences.resume({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > message?: string, > recipients_count?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### start `sequences.start` Start a sequence **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequences.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > message?: string, > recipients_count?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### test `sequences.test` Send test emails for every step of a sequence **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequences.test({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `any` | No | — | | `meta` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `sequences.update` Update a sequence **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.sequences.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email_account_ids` | `number[]` | No | — | | `schedule_time_start` | `string` | No | — | | `schedule_time_end` | `string` | No | — | | `schedule_days` | `number[]` | No | — | | `add_unsubscribe_link` | `boolean` | No | — | | `tracked` | `boolean` | No | — | | `tracked_links` | `boolean` | No | — | | `ai_assistant_enabled` | `boolean` | No | — | | `bcc_recipient` | `string` | No | — | | `start_at` | `string` | No | — | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > status?: draft | planned | active | paused | completed | archived | preparing | error, > recipients_count?: number, > editable?: boolean, > started?: boolean, > paused?: boolean, > archived?: boolean, > schedule?: { > start_at?: string | null, > time_start?: string, > time_end?: string, > days?: number[] > }, > settings?: { > tracked?: boolean, > tracked_links?: boolean, > add_unsubscribe_link?: boolean, > ai_assistant_enabled?: boolean, > bcc_recipient?: string | null > }, > ab_testing?: { > enabled?: boolean, > variant_a_percentage?: number | null, > variant_b_percentage?: number | null, > winner_variant?: string | null, > winner_selected_at?: string | null > }, > email_account_ids?: number[], > follow_ups?: { > unique_steps_count?: number, > steps?: number[] > }, > owner?: { > id?: number, > email?: string > } | null, > created_at?: string, > updated_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Sequence Stats ### get `sequenceStats.get` Get performance statistics for a sequence **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.sequenceStats.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > recipients_count?: number, > sent?: number, > delivered?: number, > opened?: number, > clicked?: number, > replied?: number, > bounced?: number, > unsubscribed_recipients?: number, > open_rate?: number | null, > click_rate?: number | null, > reply_rate?: number | null, > bounce_rate?: number | null, > unsubscribed_recipients_rate?: number | null, > follow_ups?: { > id?: number, > step?: number, > variant?: string | null, > messages_sent?: number, > delivered?: number, > opened?: number, > clicked?: number, > replied?: number, > bounced?: number, > unsubscribed?: number, > open_rate?: number | null, > click_rate?: number | null, > reply_rate?: number | null, > bounce_rate?: number | null, > unsubscribe_rate?: number | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Tags ### create `tags.create` Create a lead tag **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.tags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `tags.delete` Delete a lead tag permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `tags.get` Get a lead tag **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.tags.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `tags.list` List the lead tags on the account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > tags: { > id?: number, > name?: string, > color?: string | null, > created_at?: string > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `tags.replace` Replace a lead tag **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.tags.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `tags.update` Update a lead tag **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.tags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > color?: string | null, > created_at?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Team Members ### list `teamMembers.list` List the team members on the account **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.teamMembers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > email?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Usage ### get `usage.get` Get account usage and plan limits **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.usage.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `show_overage_requests` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > reset_date?: string, > requests?: { > credits?: { > used?: number, > available?: number, > remaining?: number, > over_quota?: number > }, > searches?: { > used?: number, > available?: number, > remaining?: number, > over_quota?: number > }, > verifications?: { > used?: number, > available?: number, > remaining?: number, > over_quota?: number > } > } > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### history `usage.history` Get the daily API usage history for this billing period **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.usage.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `user_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > type?: string, > product?: string, > source?: string, > credits?: number, > free?: boolean, > made_at?: string, > made_by?: { > id?: number, > first_name?: string | null, > last_name?: string | null, > api_key_name?: string | null > }, > request?: { > url?: string, > ip?: string | null, > user_agent?: string | null, > filters?: any, > bulk_search_id?: number | null, > bulk_finder_id?: number | null > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ## Webhooks ### create `webhooks.create` Create a webhook **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target_url` | `string` | Yes | — | | `event` | `lead.created \| message.sent \| message.read \| message.clicked \| message.replied \| export.completed \| import.completed \| sequence.paused \| sequence.resumed` | Yes | — | | `filter_on` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > target_url?: string, > event?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### delete `webhooks.delete` Delete a webhook permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### deleteLegacy `webhooks.deleteLegacy` Delete a webhook permanently via the legacy endpoint \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.hunterio.api.webhooks.deleteLegacy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output:** `undefined` *** ### get `webhooks.get` Get a webhook **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > target_url?: string, > event?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### list `webhooks.list` List the configured webhooks **Risk:** `read` ```ts theme={null} await corsair.hunterio.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > target_url?: string, > event?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### replace `webhooks.replace` Replace a webhook **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.webhooks.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `target_url` | `string` | No | — | | `event` | `lead.created \| message.sent \| message.read \| message.clicked \| message.replied \| export.completed \| import.completed \| sequence.paused \| sequence.resumed` | No | — | | `filter_on` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > target_url?: string, > event?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** ### update `webhooks.update` Update a webhook **Risk:** `write` ```ts theme={null} await corsair.hunterio.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number \| string` | Yes | — | | `target_url` | `string` | No | — | | `event` | `lead.created \| message.sent \| message.read \| message.clicked \| message.replied \| export.completed \| import.completed \| sequence.paused \| sequence.resumed` | No | — | | `filter_on` | `number \| string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > target_url?: string, > event?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > limit?: number, > offset?: number, > results?: number, > params?: any > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/hunterio/database Hunter.io local sync: searchable entities, `.search()` filters, and operators. The Hunter.io plugin syncs data locally. Use `corsair.hunterio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/hunterio/overview Email finder, verifier, and outreach platform for prospecting, enrichment, and cold-email sequences. Use **Hunter.io** through Corsair: one client, typed API calls. **What you get:** * 160 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/hunterio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/hunterio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/hunterio ``` ```bash bun theme={null} bun add corsair @corsair-dev/hunterio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { hunterio } from '@corsair-dev/hunterio'; export const corsair = createCorsair({ plugins: [ hunterio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} hunterio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'hunterio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hunterio.api.account.get({}); ``` **`account.update`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.hunterio.api.account.update({}); ``` See the full list on the [API](/plugins/hunterio/api) page. ## What's next > **[API reference](/plugins/hunterio/api)** > > Every `hunterio.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/imagior/api API reference for Imagior: every `imagior.api.*` operation with input and output types. Every `imagior.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Retrieve the authenticated Imagior account details and remaining credits **Risk:** `read` ```ts theme={null} await corsair.imagior.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `success` | Yes | — | | `name` | `string` | Yes | — | | `email` | `string` | Yes | — | | `statusCode` | `number` | Yes | — | | `usage` | `object` | Yes | — | | `requestCompletionTime` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | > **usage full type** > > ```ts theme={null} > { > remainingCredits: number > } > ``` *** ## Templates ### list `templates.list` List all design templates owned by the authenticated Imagior account **Risk:** `read` ```ts theme={null} await corsair.imagior.api.templates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort` | `createdAt \| updatedAt` | No | — | | `order` | `asc \| desc` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > createdAt: string, > updatedAt: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/imagior/database Imagior local sync: searchable entities, `.search()` filters, and operators. The Imagior plugin syncs data locally. Use `corsair.imagior.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/imagior/overview Template-based image generation API for retrieving account details and design templates. Use **Imagior** through Corsair: one client, typed API calls. **What you get:** * 2 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/imagior ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/imagior ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/imagior ``` ```bash bun theme={null} bun add corsair @corsair-dev/imagior ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { imagior } from '@corsair-dev/imagior'; export const corsair = createCorsair({ plugins: [ imagior(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} imagior() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'imagior', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.imagior.api.account.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/imagior/api) reference.* See the full list on the [API](/plugins/imagior/api) page. ## What's next > **[API reference](/plugins/imagior/api)** > > Every `imagior.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/imejisio/api API reference for Imejisio: every `imejisio.api.*` operation with input and output types. Every `imejisio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Designs ### render `designs.render` Render an Imejis template design into image/PDF bytes or a stored URL **Risk:** `write` ```ts theme={null} await corsair.imejisio.api.designs.render({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `designId` | `string` | Yes | The design render code from the design render URL | | `format` | `png \| jpeg \| webp \| pdf` | Yes | Output format. Defaults to jpeg per the Imejis OpenAPI spec | | `quality` | `number` | No | JPEG quality from 1 to 100 (only affects jpeg output) | | `delivery` | `stream \| hosted \| signed` | Yes | Delivery mode: stream (raw bytes normalized to base64), hosted (public URL), or signed (expiring URL) | | `expiresIn` | `number` | No | Signed delivery only: link lifetime in minutes (default 60, maximum 7 days = 10080) | | `overrides` | `object` | No | Key-value overrides for dynamic design template fields | > **overrides full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > delivery: stream, > format: png | jpeg | webp | pdf, > contentType: string, > base64: string > } | { > success?: boolean, > delivery: hosted, > url: string, > format?: png | jpeg | webp | pdf, > file?: { > } > } | { > success?: boolean, > delivery: signed, > url: string, > expiresAt?: string, > format?: png | jpeg | webp | pdf, > file?: { > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/imejisio/database Imejisio local sync: searchable entities, `.search()` filters, and operators. The Imejisio plugin syncs data locally. Use `corsair.imejisio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Renders Path: `imejisio.db.renders.search` ```ts theme={null} const rows = await corsair.imejisio.db.renders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `designId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `expiresAt` | `string` | equals, contains, startsWith, endsWith, in | | `renderedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/imejisio/overview Imejisio plugin for Corsair Use **Imejisio** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 1 typed API operations * 1 synced entity (`renders`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/imejisio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/imejisio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/imejisio ``` ```bash bun theme={null} bun add corsair @corsair-dev/imejisio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { imejisio } from '@corsair-dev/imejisio'; export const corsair = createCorsair({ plugins: [ imejisio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} imejisio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'imejisio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Read** *No read-style endpoint inferred; pick any operation from the [API](/plugins/imejisio/api) reference.* **`designs.render`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.imejisio.api.designs.render({}); ``` See the full list on the [API](/plugins/imejisio/api) page. ## Query synced data Synced entities support `tenant.imejisio.db..search()` and `.list()`: `renders`. See [Database](/plugins/imejisio/database) for filters and operators. ## What's next > **[API reference](/plugins/imejisio/api)** > > Every `imejisio.api.*` operation with input and output types. > **[Database](/plugins/imejisio/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/imgbb/api API reference for ImgBB: every `imgbb.api.*` operation with input and output types. Every `imgbb.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Auth ### getApiKey `auth.getApiKey` Confirm an ImgBB API key is configured for this account and return a masked preview of it **Risk:** `read` ```ts theme={null} await corsair.imgbb.api.auth.getApiKey({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `configured` | `boolean` | Yes | Whether an ImgBB API key is configured for this account | | `keyPreview` | `string` | Yes | Last 4 characters of the configured key, for identification only | *** ## Images ### upload `images.upload` Upload an image to ImgBB and return the hosted image URLs and metadata **Risk:** `write` ```ts theme={null} await corsair.imgbb.api.images.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image` | `string \| custom \| custom \| custom` | Yes | Base64-encoded image data, image URL, or binary data (Blob, File, Buffer, Uint8Array) up to 32 MB per the ImgBB API | | `name` | `string` | No | Optional display name for the file | | `expiration` | `number` | No | Optional auto-delete window in seconds (60-15552000). Omit to keep the image indefinitely. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `url_viewer` | `string` | No | — | | `url` | `string` | Yes | — | | `display_url` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `size` | `number` | No | — | | `time` | `number` | No | — | | `expiration` | `number` | No | — | | `image` | `object` | No | — | | `thumb` | `object` | No | — | | `medium` | `object` | No | — | | `delete_url` | `string` | No | — | > **image full type** > > ```ts theme={null} > { > filename?: string, > name?: string, > mime?: string, > extension?: string, > url: string > } > ``` > **thumb full type** > > ```ts theme={null} > { > filename?: string, > name?: string, > mime?: string, > extension?: string, > url: string > } > ``` > **medium full type** > > ```ts theme={null} > { > filename?: string, > name?: string, > mime?: string, > extension?: string, > url: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/imgbb/database ImgBB local sync: searchable entities, `.search()` filters, and operators. The ImgBB plugin syncs data locally. Use `corsair.imgbb.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Images Path: `imgbb.db.images.search` ```ts theme={null} const rows = await corsair.imgbb.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `url_viewer` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `display_url` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `number` | equals, gt, gte, lt, lte, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `time` | `number` | equals, gt, gte, lt, lte, in | | `expiration` | `number` | equals, gt, gte, lt, lte, in | | `delete_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/imgbb/overview Free image hosting service for uploading, storing, and sharing images via direct links. Use **ImgBB** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 2 typed API operations * 1 synced entity (`images`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/imgbb ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/imgbb ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/imgbb ``` ```bash bun theme={null} bun add corsair @corsair-dev/imgbb ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { imgbb } from '@corsair-dev/imgbb'; export const corsair = createCorsair({ plugins: [ imgbb(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} imgbb() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'imgbb', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`auth.getApiKey`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.imgbb.api.auth.getApiKey({}); ``` **`images.upload`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.imgbb.api.images.upload({}); ``` See the full list on the [API](/plugins/imgbb/api) page. ## Query synced data Synced entities support `tenant.imgbb.db..search()` and `.list()`: `images`. See [Database](/plugins/imgbb/database) for filters and operators. ## What's next > **[API reference](/plugins/imgbb/api)** > > Every `imgbb.api.*` operation with input and output types. > **[Database](/plugins/imgbb/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/insightoai/api API reference for Insighto AI: every `insightoai.api.*` operation with input and output types. Every `insightoai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agency ### createAgency `agency.createAgency` Create a new agency with organization-specific branding and config **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.agency.createAgency({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_id` | `string` | Yes | — | | `domain` | `object` | No | — | | `branding` | `object` | No | — | | `user_auth` | `object` | No | — | | `billing_plan` | `object` | No | — | > **domain full type** > > ```ts theme={null} > { > } > ``` > **branding full type** > > ```ts theme={null} > { > } > ``` > **user\_auth full type** > > ```ts theme={null} > { > } > ``` > **billing\_plan full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAgencyBillingPlan `agency.getAgencyBillingPlan` View an agency billing plan limits for bots, queries, words, and voice seconds **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.agency.getAgencyBillingPlan({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `billing_plan_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAgencyBrandingById `agency.getAgencyBrandingById` Retrieve the branding configuration for an agency **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.agency.getAgencyBrandingById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agency_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAgentList `agency.getAgentList` Fetch a paginated list of team agents/users **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.agency.getAgentList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | Yes | — | | `size` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPricingForUser `agency.getPricingForUser` Retrieve pricing tier information for LLM, voice, or transcription services **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.agency.getPricingForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `llm_model_id` | `string` | No | — | | `voice_stt_id` | `string` | No | — | | `voice_tts_id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### retrieveUserMonthlyUsagesAggregation `agency.retrieveUserMonthlyUsagesAggregation` Retrieve monthly aggregated usage analytics **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.agency.retrieveUserMonthlyUsagesAggregation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateUserProfile `agency.updateUserProfile` Modify user account details, contact information, or billing settings **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.agency.updateUserProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Assistants ### addIntentToAssistant `assistants.addIntentToAssistant` Link an existing conversational intent to an assistant **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.assistants.addIntentToAssistant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | | `intent_id` | `string` | Yes | — | | `attributes` | `object` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createIntent `assistants.createIntent` Create a new custom conversational intent **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.assistants.createIntent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `is_active` | `boolean` | No | — | | `attributes` | `object` | No | — | | `description` | `string` | No | — | | `intent_type` | `string` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createPrompt `assistants.createPrompt` Create a new customizable AI prompt template with variable support **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.assistants.createPrompt({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `owner_type` | `string` | No | — | | `description` | `string` | No | — | | `prompt_template` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteAssistantById `assistants.deleteAssistantById` Permanently remove an assistant from the system **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.assistants.deleteAssistantById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deletePromptById `assistants.deletePromptById` Permanently delete a prompt template by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.assistants.deletePromptById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAssistantById `assistants.getAssistantById` Retrieve comprehensive details and configuration of a specific assistant **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.assistants.getAssistantById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getIntentById `assistants.getIntentById` Retrieve details of a specific intent by ID **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.assistants.getIntentById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `intent_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPromptById `assistants.getPromptById` Retrieve details of a specific prompt template by ID **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.assistants.getPromptById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### readIntentsList `assistants.readIntentsList` Retrieve a paginated list of all configured intents **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.assistants.readIntentsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Contacts ### createContactCustomField `contacts.createContactCustomField` Create a custom metadata field for contacts **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.contacts.createContactCustomField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org_id` | `string` | No | — | | `custom_field_name` | `string` | Yes | — | | `custom_field_type` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteContactsInBulk `contacts.deleteContactsInBulk` Delete multiple contacts simultaneously by UUIDs **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.contacts.deleteContactsInBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_ids` | `string[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getContactById `contacts.getContactById` Retrieve a comprehensive profile of a specific contact **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.contacts.getContactById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListOfContacts `contacts.getListOfContacts` Fetch a paginated list of contacts **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.contacts.getListOfContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### readCampaignContactList `contacts.readCampaignContactList` Fetch all contacts enrolled in a specific campaign **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.contacts.readCampaignContactList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | | `campaign_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### readContactCustomFieldList `contacts.readContactCustomFieldList` Retrieve definitions of all contact custom fields **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.contacts.readContactCustomFieldList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### readContactSyncLogList `contacts.readContactSyncLogList` Retrieve audit history and logs of contact synchronization operations **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.contacts.readContactSyncLogList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### sendMessagesToContacts `contacts.sendMessagesToContacts` Send bulk broadcast messages to contacts via connected WhatsApp or SMS **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.contacts.sendMessagesToContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `widget_id` | `string` | Yes | — | | `contact_ids` | `string[]` | Yes | — | | `start_new_conversation` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### upsertContactByEmailOrPhoneNumber `contacts.upsertContactByEmailOrPhoneNumber` Create or update a contact using email or phone number **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.contacts.upsertContactByEmailOrPhoneNumber({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `first_name` | `string` | Yes | — | | `last_name` | `string` | Yes | — | | `phone_number` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Datasources ### createTag `datasources.createTag` Create a custom tag for categorizing contacts and conversations **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.datasources.createTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `attributes` | `object` | No | — | | `color_code` | `string` | Yes | — | | `description` | `string` | Yes | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteLinkedAssistantDatasource `datasources.deleteLinkedAssistantDatasource` Unlink and remove a data source from an assistant's knowledge base **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.datasources.deleteLinkedAssistantDatasource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistant_id` | `string` | Yes | — | | `datasource_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteLinkTagEntityById `datasources.deleteLinkTagEntityById` Remove a specific tag association from an entity **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.datasources.deleteLinkTagEntityById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `link_tag_entity_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteTagById `datasources.deleteTagById` Permanently remove a tag by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.datasources.deleteTagById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getDatasourceById `datasources.getDatasourceById` Retrieve comprehensive details of a specific knowledge base data source **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.datasources.getDatasourceById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `datasource_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListOfDatasources `datasources.getListOfDatasources` Discover all available knowledge base data sources (text, URLs, files) **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.datasources.getListOfDatasources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListOfDataSourcesLinkedToAssistantId `datasources.getListOfDataSourcesLinkedToAssistantId` List all data sources linked to an assistant **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.datasources.getListOfDataSourcesLinkedToAssistantId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | | `assistant_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### readTagList `datasources.readTagList` Fetch a paginated list of all available tags **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.datasources.readTagList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Forms ### createForm `forms.createForm` Create a conversational AI-driven or traditional data capture form **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.forms.createForm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `fields` | `object[]` | No | — | | `org_id` | `string` | No | — | | `form_type` | `natural \| simple` | Yes | — | | `attributes` | `object` | No | — | | `webhook_id` | `string` | No | — | | `trigger_tools` | `string[]` | No | — | | `contact_mapping` | `object` | No | — | | `trigger_instructions` | `string` | Yes | — | > **fields full type** > > ```ts theme={null} > { > }[] > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` > **contact\_mapping full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteBulkFormsByIds `forms.deleteBulkFormsByIds` Delete multiple forms in a single bulk operation **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.forms.deleteBulkFormsByIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_ids` | `string[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteFormById `forms.deleteFormById` Permanently remove a form by unique ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.forms.deleteFormById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCapturedFormByFormId `forms.getCapturedFormByFormId` Fetch captured user form submissions with pagination **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.forms.getCapturedFormByFormId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | | `form_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Providers ### createProvider `providers.createProvider` Configure an AI provider (OpenAI, ElevenLabs, Azure Speech, Cartesia, PlayHT) **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.providers.createProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `org_id` | `string` | No | — | | `status` | `boolean` | No | — | | `attributes` | `object` | No | — | | `provider_key` | `string` | Yes | — | | `provider_name` | `openai \| elevenlabs \| azure_speech \| cartesia \| playht` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteProviderById `providers.deleteProviderById` Permanently delete an AI provider configuration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.providers.deleteProviderById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `provider_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getProviderById `providers.getProviderById` Retrieve configuration details of an AI provider **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.providers.getProviderById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `provider_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSpeechtotextList `providers.getSpeechtotextList` Fetch a paginated list of available speech-to-text voice configurations **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.providers.getSpeechtotextList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### retrieveListOfUserCustomVoice `providers.retrieveListOfUserCustomVoice` Retrieve a paginated list of custom user voice models **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.providers.retrieveListOfUserCustomVoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Tools ### createToolfunction `tools.createToolfunction` Register a new tool function (SDK, CURL, or query index) for assistant workflows **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.tools.createToolfunction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `details` | `object` | No | — | | `tool_id` | `string` | No | — | | `is_enabled` | `boolean` | No | — | | `description` | `string` | Yes | — | | `tool_function_type` | `sdk \| curl \| query_index` | Yes | — | > **details full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteToolById `tools.deleteToolById` Remove an entire tool integration by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.tools.deleteToolById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tool_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteToolfunctionById `tools.deleteToolfunctionById` Remove a tool function from the system **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.tools.deleteToolfunctionById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `toolfunction_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### readToolFunctionInvokeLogList `tools.readToolFunctionInvokeLogList` Inspect execution history and audit logs of tool function calls **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.tools.readToolFunctionInvokeLogList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | | `conversation_id` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### readToolToolfunctionList `tools.readToolToolfunctionList` Fetch all tool functions associated with a specific tool ID **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.tools.readToolToolfunctionList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | | `tool_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### retrieveLinkedToolAndUser `tools.retrieveLinkedToolAndUser` Retrieve linked tool and user associations **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.tools.retrieveLinkedToolAndUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | | `tool_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateLinkToolUser `tools.updateLinkToolUser` Modify properties of a linked tool user integration **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.tools.updateLinkToolUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `link_tool_user_id` | `string` | Yes | — | | `name` | `string` | No | — | | `org_id` | `string` | No | — | | `tool_id` | `string` | No | — | | `attributes` | `object` | No | — | | `credentials` | `object` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` > **credentials full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateToolById `tools.updateToolById` Modify general properties and enabled status of a tool **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.tools.updateToolById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tool_id` | `string` | Yes | — | | `sdk` | `object` | No | — | | `name` | `string` | No | — | | `org_id` | `string` | No | — | | `enabled` | `boolean` | No | — | | `base_url` | `string` | No | — | | `category` | `string` | No | — | | `logo_url` | `string` | No | — | | `tool_type` | `string` | No | — | | `attributes` | `object` | No | — | | `description` | `string` | No | — | | `tool_provider` | `string` | No | — | | `authentication` | `object` | No | — | > **sdk full type** > > ```ts theme={null} > { > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` > **authentication full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateToolfunctionById `tools.updateToolfunctionById` Modify the name, type, or enabled status of an existing tool function **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.tools.updateToolfunctionById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `toolfunction_id` | `string` | Yes | — | | `name` | `string` | No | — | | `details` | `object` | No | — | | `tool_id` | `string` | No | — | | `is_enabled` | `boolean` | No | — | | `description` | `string` | No | — | | `tool_function_type` | `sdk \| curl \| query_index` | No | — | > **details full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Webhooks Telephony ### createWebhook `webhooksTelephony.createWebhook` Configure an outbound webhook URL for event notifications **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.webhooksTelephony.createWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `enabled` | `boolean` | No | — | | `endpoint` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteTwilioAuthById `webhooksTelephony.deleteTwilioAuthById` Remove a Twilio authentication integration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.webhooksTelephony.deleteTwilioAuthById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `twilio_auth_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteUserwhatsappById `webhooksTelephony.deleteUserwhatsappById` Remove a WhatsApp Business connection **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.webhooksTelephony.deleteUserwhatsappById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userwhatsapp_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteWebhookById `webhooksTelephony.deleteWebhookById` Permanently remove an outbound webhook configuration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.webhooksTelephony.deleteWebhookById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### readTwilioAuthList `webhooksTelephony.readTwilioAuthList` Retrieve all configured Twilio authentication integrations **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.webhooksTelephony.readTwilioAuthList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### retrieveWebhookLog `webhooksTelephony.retrieveWebhookLog` Inspect delivery status and debug logs for a specific webhook **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.webhooksTelephony.retrieveWebhookLog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | | `webhook_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateTwilioAuthById `webhooksTelephony.updateTwilioAuthById` Modify Twilio auth credentials or telephony settings **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.webhooksTelephony.updateTwilioAuthById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `twilio_auth_id` | `string` | Yes | — | | `name` | `string` | No | — | | `twilio_auth_token` | `string` | No | — | | `twilio_account_sid` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateUserwhatsappById `webhooksTelephony.updateUserwhatsappById` Modify WhatsApp Business API settings for a user **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.webhooksTelephony.updateUserwhatsappById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userwhatsapp_id` | `string` | Yes | — | | `phone_number_id` | `string` | No | — | | `phone_business_id` | `string` | No | — | | `facebook_app_secret` | `string` | No | — | | `whatsapp_access_token` | `string` | No | — | | `whatsapp_phone_number` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateWebhookById `webhooksTelephony.updateWebhookById` Modify the endpoint URL, name, or enabled status of an outbound webhook **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.webhooksTelephony.updateWebhookById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | | `name` | `string` | No | — | | `enabled` | `boolean` | No | — | | `endpoint` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Widgets ### createWidget `widgets.createWidget` Create a new chat/voice widget for web or mobile embedding **Risk:** `write` ```ts theme={null} await corsair.insightoai.api.widgets.createWidget({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `org_id` | `string` | No | — | | `attributes` | `object` | No | — | | `bubble_text` | `string` | No | — | | `description` | `string` | No | — | | `widget_type` | `web_chat \| web_voice \| whatsapp \| sms \| messenger \| instagram \| telegram \| ghl_chat \| ghl_missed_call \| embedded_form \| popup \| inline \| floating_bubble \| voice_widget \| custom` | Yes | — | | `assistant_id` | `string` | No | — | | `bubble_color` | `string` | No | — | | `display_name` | `string` | No | — | | `header_color` | `string` | No | — | | `style_params` | `object` | No | — | | `intro_message` | `string` | No | — | | `action_buttons` | `object[]` | Yes | — | | `bot_icon_color` | `string` | No | — | | `ice_break_color` | `string` | No | — | | `remove_branding` | `boolean` | No | — | | `bot_message_color` | `string` | No | — | | `header_text_color` | `string` | No | — | | `user_message_color` | `string` | No | — | | `action_buttons_color` | `string` | No | — | | `textbox_default_text` | `string` | No | — | | `user_opening_messages` | `string[]` | Yes | — | | `bot_text_message_color` | `string` | No | — | | `user_text_message_color` | `string` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` > **style\_params full type** > > ```ts theme={null} > { > } > ``` > **action\_buttons full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteWidgetById `widgets.deleteWidgetById` Permanently remove a widget by ID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.insightoai.api.widgets.deleteWidgetById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListOfConversations `widgets.getListOfConversations` Retrieve filtered conversation metadata across date ranges **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.widgets.getListOfConversations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | | `date_to` | `string` | Yes | — | | `date_from` | `string` | Yes | — | | `intent_id` | `string` | No | — | | `assistant_id` | `string` | No | — | | `includes_voice` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListOfWidgetsLinkedToAssistantId `widgets.getListOfWidgetsLinkedToAssistantId` Discover all widgets associated with a specific assistant **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.widgets.getListOfWidgetsLinkedToAssistantId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | | `assistant_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getWidgetById `widgets.getWidgetById` Retrieve widget configuration and visual styling attributes **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.widgets.getWidgetById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `widget_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listChannels `widgets.listChannels` Retrieve all available communication channels and configurations **Risk:** `read` ```ts theme={null} await corsair.insightoai.api.widgets.listChannels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/insightoai/database Insighto AI local sync: searchable entities, `.search()` filters, and operators. The Insighto AI plugin syncs data locally. Use `corsair.insightoai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/insightoai/overview Conversational analytics platform for AI chatbots with voice and customer insight tools. Use **Insighto AI** through Corsair: one client, typed API calls. **What you get:** * 66 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/insightoai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/insightoai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/insightoai ``` ```bash bun theme={null} bun add corsair @corsair-dev/insightoai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { insightoai } from '@corsair-dev/insightoai'; export const corsair = createCorsair({ plugins: [ insightoai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} insightoai() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Insighto AI OAuth app. ```ts theme={null} insightoai({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'insightoai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`agency.getAgencyBillingPlan`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.insightoai.api.agency.getAgencyBillingPlan({}); ``` **`agency.createAgency`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.insightoai.api.agency.createAgency({}); ``` See the full list on the [API](/plugins/insightoai/api) page. ## What's next > **[API reference](/plugins/insightoai/api)** > > Every `insightoai.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/instagram/api API reference for Instagram: every `instagram.api.*` operation with input and output types. Every `instagram.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Carousel ### post `carousel.post` create a carousel container for publishing on instagram. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.carousel.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram professional account that will publish the carousel post. | | `children` | `string[]` | Yes | An array of media container IDs that will be included in the carousel. A carousel must contain at least two media items. | | `media_type` | `string` | Yes | The type of media container to create. For carousel posts, this is typically set to CAROUSEL. | | `caption` | `string` | No | Optional caption text that will be displayed with the carousel post. | | `share_to_feed` | `boolean` | No | Whether the carousel post should be shared to the Instagram profile feed. | | `collaborators` | `string[]` | No | Optional list of Instagram User IDs to invite as collaborators on the carousel post. | | `location_id` | `string` | No | Optional Facebook Location ID to associate a location with the carousel post. | | `product_tags` | `object[]` | No | Optional list of Instagram Shopping products to tag in the carousel. | > **product\_tags full type** > > ```ts theme={null} > { > product_id: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The media container ID that can be used to check processing status or publish the media. | *** ## Comments ### get `comments.get` get details about a specific comment on an instagram media object. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.comments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | The Instagram Comment ID of the comment whose details should be retrieved. | | `q` | `string` | No | Optional search query or filter used when retrieving comment details. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique Instagram Comment ID. | | `text` | `string` | No | The text content of the comment. | | `hidden` | `boolean` | No | Indicates whether the comment is hidden from public view. | | `like_count` | `number` | No | The total number of likes received by the comment. | | `legacy_instagram_comment_id` | `string` | No | The legacy Instagram comment identifier, if available. | | `timestamp` | `string` | No | The ISO 8601 timestamp indicating when the comment was created. | | `parent_id` | `string` | No | The ID of the parent comment if this comment is a reply. | | `from` | `object` | No | Information about the user who created the comment. | | `media` | `object` | No | Information about the media on which the comment was posted. | | `user` | `string` | No | The ID of the Instagram user associated with the comment. | | `username` | `string` | No | The Instagram username of the comment author. | | `replies` | `object[]` | No | The list of replies associated with this comment. | > **from full type** > > ```ts theme={null} > { > id: string, > username: string > } > ``` > **media full type** > > ```ts theme={null} > { > id: string, > media_product_type?: string > } > ``` > **replies full type** > > ```ts theme={null} > { > id: string, > text?: string, > timestamp?: string > }[] > ``` *** ### getReplies `comments.getReplies` get comment replies. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.comments.getReplies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | The Instagram Comment ID. | | `fields` | `string` | No | Optional fields to query. | | `after` | `string` | No | Cursor for the next page of results. | | `before` | `string` | No | Cursor for the previous page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | The replies. | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > text?: string, > timestamp?: string, > username?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string > } > ``` *** ### list `comments.list` list comments on an instagram media object. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_id` | `string` | Yes | The Instagram Media ID of the post, Reel, video, or carousel whose comments should be retrieved. | | `q` | `string` | No | Optional search query used to filter comments by text, username, or other supported criteria. | | `after` | `string` | No | Cursor for the next page of results. | | `before` | `string` | No | Cursor for the previous page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | The list of comments associated with the requested Instagram media. | > **data full type** > > ```ts theme={null} > { > id: string, > text?: string, > timestamp?: string, > username?: string > }[] > ``` *** ### remove `comments.remove` delete a comment on an instagram media object. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.comments.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | The Instagram Comment ID of the comment that should be permanently deleted. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates whether the comment update operation completed successfully. | *** ### reply `comments.reply` reply to a comment on an instagram media object. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.comments.reply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | The Instagram Comment ID of the comment that should receive a reply. | | `message` | `string` | Yes | The text content of the reply to post in response to the specified comment. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique ID of the newly created reply comment. | *** ### send `comments.send` send a comment on an instagram media object. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.comments.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_id` | `string` | Yes | The Instagram Media ID of the post, Reel, video, Story, or carousel on which the comment will be created. | | `message` | `string` | Yes | The text content of the comment to post on the specified Instagram media. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique ID of the newly created Instagram comment. | *** ### update `comments.update` update a comment on an instagram media object. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.comments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `comment_id` | `string` | Yes | The Instagram Comment ID of the comment to update. | | `hide` | `boolean` | Yes | Whether the comment should be hidden. Set to true to hide the comment or false to unhide it. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Indicates whether the comment update operation completed successfully. | *** ## Conversations ### get `conversations.get` get messages in a conversation on instagram messaging. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.conversations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversation_id` | `string` | Yes | The Instagram conversation or message thread ID whose messages should be retrieved. | | `page_id` | `string` | Yes | The Facebook Page ID connected to the Instagram professional account that owns the conversation. | | `q` | `string` | No | Optional search query used to filter messages within the conversation. | | `after` | `string` | No | Cursor for the next page of results. | | `before` | `string` | No | Cursor for the previous page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | The list of messages contained within the specified conversation. | > **data full type** > > ```ts theme={null} > { > id: string, > message?: string, > created_time?: string, > from?: { > id?: string, > username?: string > }, > attachments?: { > data?: { > id?: string, > mime_type?: string, > name?: string, > image_data?: { > }, > video_data?: { > }, > file_url?: string > }[] > } > }[] > ``` *** ### getConversation `conversations.getConversation` get conversation details. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.conversations.getConversation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | The Facebook Page ID. | | `conversation_id` | `string` | Yes | The DM conversation ID. | | `fields` | `string` | No | Optional fields to query. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The DM conversation ID. | | `updated_time` | `string` | No | Last updated timestamp. | | `message_count` | `number` | No | Total message count. | | `unread_count` | `number` | No | Unread message count. | *** ### list `conversations.list` list conversations on instagram messaging. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.conversations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | The Facebook Page ID connected to the Instagram professional account whose conversations should be retrieved. | | `q` | `string` | No | Optional search query used to filter conversations by participant, message content, or other supported criteria. | | `after` | `string` | No | Cursor for the next page of results. | | `before` | `string` | No | Cursor for the previous page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | The list of Instagram conversations associated with the connected account. | > **data full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Image ### post `image.post` create an image container for publishing on instagram. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.image.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram professional account that will publish the image. | | `image_url` | `string` | Yes | A publicly accessible URL of the image to be uploaded to Instagram. | | `caption` | `string` | No | Optional caption text that will be displayed with the Instagram post. | | `alt_text` | `string` | No | Optional accessibility description of the image for screen readers. | | `is_carousel_item` | `boolean` | No | Set to true if this image will be added as an item in a carousel post rather than published as a standalone post. | | `location_id` | `string` | No | Optional Facebook Location ID to associate a location with the Instagram post. | | `user_tags` | `object[]` | No | Optional list of Instagram users to tag in the image along with their positions. | | `product_tags` | `object[]` | No | Optional list of products to tag in the image for Instagram Shopping. | > **user\_tags full type** > > ```ts theme={null} > { > username: string, > x: number, > y: number > }[] > ``` > **product\_tags full type** > > ```ts theme={null} > { > product_id: string, > x: number, > y: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The media container ID that can be used to check processing status or publish the media. | *** ### story `image.story` create an image story container for publishing on instagram. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.image.story({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram professional account that will publish the Story. | | `image_url` | `string` | Yes | A publicly accessible URL of the image to be uploaded as an Instagram Story. | | `user_tags` | `string[]` | No | Optional list of Instagram usernames or user IDs to mention or tag in the Story. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The media container ID that can be used to check processing status or publish the media. | *** ## Media ### children `media.children` get children media. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.media.children({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_id` | `string` | Yes | The Instagram Media ID (parent carousel/album). | | `fields` | `string` | No | Optional fields to query. | | `after` | `string` | No | Cursor for the next page of results. | | `before` | `string` | No | Cursor for the previous page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | Media children items. | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > media_type?: IMAGE | VIDEO, > media_url?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string > } > ``` *** ### get `media.get` get details about a specific media object. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.media.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_id` | `string` | Yes | The Instagram Media ID of the post, reel, story, carousel, or video to retrieve. | | `q` | `string` | No | Optional search query or filter used when retrieving media-related information. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique Instagram Media ID. | | `caption` | `string` | No | The caption text associated with the media. | | `media_type` | `IMAGE \| VIDEO \| CAROUSEL_ALBUM` | No | The type of Instagram media, such as IMAGE, VIDEO, REELS, STORY, or CAROUSEL\_ALBUM. | | `media_url` | `string` | No | The URL of the media asset. May be null or unavailable for certain media types. | | `thumbnail_url` | `string` | No | The URL of the media thumbnail image, typically available for videos and reels. | | `permalink` | `string` | No | The permanent public URL to view the media on Instagram. | | `timestamp` | `string` | No | The ISO 8601 timestamp indicating when the media was created. | | `username` | `string` | No | The Instagram username that published the media. | | `like_count` | `number` | Yes | The total number of likes received by the media. | | `comments_count` | `number` | Yes | The total number of comments on the media. | | `is_comment_enabled` | `boolean` | No | Indicates whether commenting is enabled for the media. | | `children` | `object` | No | Carousel child media items. Present only for carousel posts. | | `createdAt` | `Date` | No | The date and time when this record was created in the local system. | | `updatedAt` | `Date` | No | The date and time when this record was last updated in the local system. | > **children full type** > > ```ts theme={null} > { > data: { > id: string, > media_type: IMAGE | VIDEO, > media_url: string > }[] > } > ``` *** ### insights `media.insights` get insights for a specific media object. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.media.insights({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_id` | `string` | Yes | The Instagram Media ID of the post, Reel, Story, video, or carousel whose insights should be retrieved. | | `type` | `IMAGE \| VIDEO \| REELS \| STORY \| CAROUSEL_ALBUM` | Yes | The type of Instagram media for which insights are being requested. | | `metric` | `string` | No | Optional insight metric to retrieve, such as impressions, reach, engagement, saved, likes, comments, shares, plays, or other supported Instagram insight metrics. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | A collection of insight metrics and values returned for the requested Instagram media. | > **data full type** > > ```ts theme={null} > { > name: string, > period?: string, > title?: string, > description?: string, > id?: string, > values?: { > value: number | string | { > }, > end_time?: string > }[] > }[] > ``` *** ### list `media.list` list media objects on the instagram account. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.media.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram professional account or createro account whose media should be retrieved. | | `q` | `string` | No | Optional search keyword or filter to narrow the media results. | | `after` | `string` | No | Cursor for the next page of results. | | `before` | `string` | No | Cursor for the previous page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | The list of Instagram media objects returned by the request. | | `paging` | `object` | No | Pagination information used to navigate through additional pages of media results. | > **data full type** > > ```ts theme={null} > { > id: string, > caption?: string, > media_type?: IMAGE | VIDEO | CAROUSEL_ALBUM, > media_url?: string | null, > thumbnail_url?: string | null, > permalink?: string, > timestamp?: string, > username?: string, > like_count: number, > comments_count: number, > is_comment_enabled?: boolean, > children?: { > data: { > id: string, > media_type: IMAGE | VIDEO, > media_url: string > }[] > }, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string > } > ``` *** ### status `media.status` get the status of a media container. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.media.status({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `container_id` | `string` | Yes | The Instagram media container ID whose processing status should be retrieved. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The Instagram media container ID whose status was requested. | | `status_code` | `IN_PROGRESS \| FINISHED \| ERROR \| EXPIRED \| PUBLISHED` | Yes | The current processing status of the media container. IN\_PROGRESS indicates processing is ongoing, FINISHED indicates the media is ready to publish, PUBLISHED indicates it was already published, ERROR indicates processing failed, and EXPIRED indicates the container is no longer valid. | *** ## Messages ### get `messages.get` get details about a specific message on instagram messaging. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | The Facebook Page ID connected to the Instagram professional account that owns the message. | | `message_id` | `string` | Yes | The unique ID of the Instagram Direct Message to retrieve. | | `q` | `string` | Yes | A search query or filter string used when retrieving message details. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique identifier of the message. | | `message` | `string` | No | The text content of the message. | | `created_time` | `string` | No | The timestamp indicating when the message was created. | | `from` | `object` | No | Information about the user who sent the message. | | `attachments` | `object` | No | Attachment data associated with the message, such as images, videos, files, or other media. | > **from full type** > > ```ts theme={null} > { > id?: string, > username?: string > } > ``` > **attachments full type** > > ```ts theme={null} > { > data?: { > id?: string, > mime_type?: string, > name?: string, > image_data?: { > }, > video_data?: { > }, > file_url?: string > }[] > } > ``` *** ### markSeen `messages.markSeen` mark messages as seen. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.messages.markSeen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | The Facebook Page ID. | | `recipient_id` | `string` | Yes | The recipient user ID to mark messages as seen. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | Whether action succeeded. | *** ### send `messages.send` send a message in instagram messaging. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | The Facebook Page ID connected to the Instagram professional account that will send the message. | | `recipient` | `string` | Yes | The recipient Instagram-scoped user ID (IGSID) or Messenger user ID that will receive the message. | | `message` | `object` | Yes | The message content, including text, attachments, and optional quick replies. | | `messaging_type` | `RESPONSE \| UPDATE \| MESSAGE_TAG` | No | The type of message being sent. Determines how Meta categorizes and delivers the message. | | `tag` | `string` | No | Required for certain MESSAGE\_TAG messages. Specifies the approved message tag used for the message. | > **message full type** > > ```ts theme={null} > { > text?: string, > attachment?: { > type: image | video | audio | file | template, > payload: { > } > }, > attachments?: { > type: image | video | audio | file | template, > payload: { > } > }[], > quick_replies?: { > content_type: text, > title: string, > payload: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `recipient_id` | `string` | Yes | The ID of the user who received the message. | | `message_id` | `string` | Yes | The unique identifier of the message that was sent. | | `timestamp` | `number` | No | The Unix timestamp indicating when the message was sent. | *** ### sendImage `messages.sendImage` send image via DM. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.messages.sendImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | The Facebook Page ID. | | `recipient_id` | `string` | Yes | The recipient ID. | | `image_url` | `string` | Yes | The URL of the image to send via DM. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | The message ID. | *** ## Messenger ### deleteProfile `messenger.deleteProfile` delete messenger profile. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.messenger.deleteProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | The Facebook Page ID. | | `fields` | `persistent_menu \| ice_breakers[]` | No | The Instagram Messenger Profile fields to delete. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | Yes | The API status response, typically "success". | *** ### getProfile `messenger.getProfile` get messenger profile. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.messenger.getProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | The Facebook Page ID. | | `fields` | `persistent_menu \| ice_breakers[]` | No | Instagram Messenger Profile fields to query. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | Messenger Profile options. | > **data full type** > > ```ts theme={null} > { > persistent_menu?: { > locale: string, > composer_input_disabled?: boolean, > call_to_actions?: { > type: string, > title: string, > url?: string, > payload?: string > }[] > }[], > ice_breakers?: { > question: string, > payload: string > }[] > }[] > ``` *** ### updateProfile `messenger.updateProfile` update messenger profile. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.messenger.updateProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | The Facebook Page ID. | | `persistent_menu` | `object[]` | No | Persistent menu configuration. | | `ice_breakers` | `object[]` | No | Ice breaker configuration. | > **persistent\_menu full type** > > ```ts theme={null} > { > locale: string, > composer_input_disabled?: boolean, > call_to_actions?: { > type: string, > title: string, > url?: string, > payload?: string > }[] > }[] > ``` > **ice\_breakers full type** > > ```ts theme={null} > { > question: string, > payload: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `string` | Yes | The API response result, typically "success". | *** ## Profile ### contentPublishingLimit `profile.contentPublishingLimit` get user content publishing limit. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.profile.contentPublishingLimit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (Instagram Business Account ID). | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > quota_usage?: number, > config?: { > quota_total: number, > quota_duration: number > } > }[] > ``` *** ### get `profile.get` read the user instagram profile. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.profile.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram account. | | `q` | `string` | No | Optional search query or keyword used to filter related Instagram user data. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `ig_id` | `number` | No | — | | `username` | `string` | No | — | | `name` | `string` | No | — | | `biography` | `string` | No | — | | `profile_picture_url` | `string` | No | — | | `followers_count` | `number` | Yes | — | | `follows_count` | `number` | Yes | — | | `media_count` | `number` | Yes | — | | `website` | `string` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | *** ### insights `profile.insights` get insights for the instagram business account. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.profile.insights({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram professional account whose insights should be retrieved. | | `metric` | `string` | Yes | One or more Instagram insight metrics to retrieve, such as impressions, reach, profile\_views, follower\_count, accounts\_engaged, or other supported account-level metrics. | | `period` | `string` | Yes | The aggregation period for the requested metrics, such as day, week, days\_28, lifetime, or other supported periods. | | `timeframe` | `string` | No | Required for demographics-related metrics. Specifies how far back Instagram should look when calculating the requested data. | | `metric_type` | `string` | No | Optional metric category or calculation type used when requesting specific insight metrics. | | `breakdown` | `string` | No | Optional dimension by which to break down the results, such as age, gender, country, city, or other supported demographic categories. | | `since` | `string` | No | Optional start date or timestamp for the insights query. Results will include data from this point onward. | | `until` | `string` | No | Optional end date or timestamp for the insights query. Results will include data up to this point. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | A collection of insight metrics and values returned for the requested Instagram media. | > **data full type** > > ```ts theme={null} > { > name: string, > period?: string, > title?: string, > description?: string, > id?: string, > values?: { > value: number | string | { > }, > end_time?: string > }[] > }[] > ``` *** ### liveMedia `profile.liveMedia` get user live media. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.profile.liveMedia({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID. | | `fields` | `string` | No | Optional fields to query. | | `after` | `string` | No | Cursor for the next page of results. | | `before` | `string` | No | Cursor for the previous page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | Live media items. | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > caption?: string, > media_type?: IMAGE | VIDEO | CAROUSEL_ALBUM, > media_url?: string | null, > thumbnail_url?: string | null, > permalink?: string, > timestamp?: string, > username?: string, > like_count: number, > comments_count: number, > is_comment_enabled?: boolean, > children?: { > data: { > id: string, > media_type: IMAGE | VIDEO, > media_url: string > }[] > }, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string > } > ``` *** ### replyMentions `profile.replyMentions` reply to mentions. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.profile.replyMentions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mention_id` | `string` | Yes | The mention ID (media or comment ID). | | `message` | `string` | Yes | The text of the reply. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The created comment reply ID. | *** ### stories `profile.stories` get user stories. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.profile.stories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID. | | `fields` | `string` | No | Optional fields to query. | | `after` | `string` | No | Cursor for the next page of results. | | `before` | `string` | No | Cursor for the previous page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | Stories list. | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > caption?: string, > media_type?: IMAGE | VIDEO | CAROUSEL_ALBUM, > media_url?: string | null, > thumbnail_url?: string | null, > permalink?: string, > timestamp?: string, > username?: string, > like_count: number, > comments_count: number, > is_comment_enabled?: boolean, > children?: { > data: { > id: string, > media_type: IMAGE | VIDEO, > media_url: string > }[] > }, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string > } > ``` *** ### tags `profile.tags` get user tags. **Risk:** `read` ```ts theme={null} await corsair.instagram.api.profile.tags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID. | | `fields` | `string` | No | Optional fields to query. | | `after` | `string` | No | Cursor for the next page of results. | | `before` | `string` | No | Cursor for the previous page of results. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | Tagged media list. | | `paging` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > caption?: string, > media_type?: IMAGE | VIDEO | CAROUSEL_ALBUM, > media_url?: string | null, > thumbnail_url?: string | null, > permalink?: string, > timestamp?: string, > username?: string, > like_count: number, > comments_count: number, > is_comment_enabled?: boolean, > children?: { > data: { > id: string, > media_type: IMAGE | VIDEO, > media_url: string > }[] > }, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` > **paging full type** > > ```ts theme={null} > { > cursors?: { > before?: string, > after?: string > }, > next?: string > } > ``` *** ## Publish ### publish\_media `publish.publish_media` publish media on instagram. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.publish.publish_media({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram professional account that will publish the media. | | `creation_id` | `string` | Yes | The media container ID returned by a previous media container creation request. This container will be published to Instagram. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The media container ID that can be used to check processing status or publish the media. | *** ## Reel ### post `reel.post` create a reel container for publishing on instagram. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.reel.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram professional account that will publish the Reel. | | `video_url` | `string` | Yes | A publicly accessible URL of the video file to be uploaded as an Instagram Reel. | | `media_type` | `string` | Yes | The type of media container to create. For Reels, this is typically set to REELS. | | `caption` | `string` | No | Optional caption text that will accompany the Reel when published. | | `share_to_feed` | `boolean` | No | Whether the Reel should also be shared to the Instagram profile feed in addition to the Reels tab. | | `collaborators` | `string[]` | No | Optional list of Instagram User IDs to invite as collaborators on the Reel. | | `cover_url` | `string` | No | Optional publicly accessible URL of a custom cover image to use as the Reel thumbnail. | | `audio_name` | `string` | No | Optional name of the audio track associated with the Reel. | | `thumb_offset` | `number` | No | Optional timestamp offset in milliseconds used to generate the Reel thumbnail from the video. | | `location_id` | `string` | No | Optional Facebook Location ID to associate a location with the Reel. | | `user_tags` | `object[]` | No | Optional list of Instagram users to tag in the Reel. | | `trial_params` | `any` | No | Optional experimental or trial parameters supported by the Instagram API. | > **user\_tags full type** > > ```ts theme={null} > { > username: string, > x: number, > y: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The media container ID that can be used to check processing status or publish the media. | *** ## Video ### container `video.container` create a video carousel container for publishing on instagram. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.video.container({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram professional account that will publish the video. | | `video_url` | `string` | Yes | A publicly accessible URL of the video to be uploaded to Instagram. | | `caption` | `string` | No | Optional caption text that will be displayed with the video post. | | `alt_text` | `string` | No | Optional accessibility description of the video for screen readers. | | `location_id` | `string` | No | Optional Facebook Location ID to associate a location with the video post. | | `user_tags` | `object[]` | No | Optional list of Instagram users to tag in the video along with their positions. | | `product_tags` | `object[]` | No | Optional list of Instagram Shopping products to tag in the video. | > **user\_tags full type** > > ```ts theme={null} > { > username: string, > x: number, > y: number > }[] > ``` > **product\_tags full type** > > ```ts theme={null} > { > product_id: string, > x: number, > y: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The media container ID that can be used to check processing status or publish the media. | *** ### story `video.story` create a video story container for publishing on instagram. **Risk:** `write` ```ts theme={null} await corsair.instagram.api.video.story({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ig_id` | `string` | Yes | The Instagram User ID (IG User ID) of the Instagram professional account that will publish the Story. | | `video_url` | `string` | Yes | A publicly accessible URL of the video to be uploaded as an Instagram Story. | | `user_tags` | `string[]` | No | Optional list of Instagram usernames or user IDs to mention or tag in the Story. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The media container ID that can be used to check processing status or publish the media. | *** # Database Source: https://docs.corsair.dev/plugins/instagram/database Instagram local sync: searchable entities, `.search()` filters, and operators. The Instagram plugin syncs data locally. Use `corsair.instagram.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Comments Path: `instagram.db.comments.search` ```ts theme={null} const rows = await corsair.instagram.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Conversations Path: `instagram.db.conversations.search` ```ts theme={null} const rows = await corsair.instagram.db.conversations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `conversationId` | `string` | equals, contains, startsWith, endsWith, in | | `pageId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Media Path: `instagram.db.media.search` ```ts theme={null} const rows = await corsair.instagram.db.media.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `media_url` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `caption` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `instagram.db.messages.search` ```ts theme={null} const rows = await corsair.instagram.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `messageId` | `string` | equals, contains, startsWith, endsWith, in | | `conversationId` | `string` | equals, contains, startsWith, endsWith, in | | `senderId` | `string` | equals, contains, startsWith, endsWith, in | | `recipient` | `string` | equals, contains, startsWith, endsWith, in | | `senderName` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `instagram.db.users.search` ```ts theme={null} const rows = await corsair.instagram.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ig_id` | `number` | equals, gt, gte, lt, lte, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `biography` | `string` | equals, contains, startsWith, endsWith, in | | `profile_picture_url` | `string` | equals, contains, startsWith, endsWith, in | | `followers_count` | `number` | equals, gt, gte, lt, lte, in | | `follows_count` | `number` | equals, gt, gte, lt, lte, in | | `media_count` | `number` | equals, gt, gte, lt, lte, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/instagram/overview Social media platform for photos, reels, stories, and business content publishing via Meta APIs. Use **Instagram** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 36 typed API operations * 5 synced entities (`comments`, `conversations`, `media`, `messages`, `users`) for fast `.search()` / `.list()` * 3 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/instagram ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/instagram ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/instagram ``` ```bash bun theme={null} bun add corsair @corsair-dev/instagram ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { instagram } from '@corsair-dev/instagram'; export const corsair = createCorsair({ plugins: [ instagram(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Instagram OAuth app. ```ts theme={null} instagram() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'instagram', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`comments.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.instagram.api.comments.get({}); ``` **`carousel.post`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.instagram.api.carousel.post({}); ``` See the full list on the [API](/plugins/instagram/api) page. ## Query synced data Synced entities support `tenant.instagram.db..search()` and `.list()`: `comments`, `conversations`, `media`, `messages`, `users`. See [Database](/plugins/instagram/database) for filters and operators. ## Webhooks This plugin registers **3** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/instagram/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/instagram/api)** > > Every `instagram.api.*` operation with input and output types. > **[Database](/plugins/instagram/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/instagram/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/instagram/webhooks Instagram incoming webhooks: event paths, payloads, and response data. The Instagram plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/instagram/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `comments` (`comments`) * `messageReceived` (`messageReceived`) * `url_verification` (`url_verification`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Comments ### Comments `comments` Represents an Instagram comment webhook event containing information about a comment, including the commenter, media, comment text, and related metadata. **Payload** | Name | Type | Required | Description | | - | - | - | - | | `object` | `instagram` | Yes | — | | `entry` | `object[]` | Yes | — | > **entry full type** > > ```ts theme={null} > { > id: string, > time: number, > changes: { > field: comments, > value: { > from: { > id: string, > username: string > }, > comment_id?: string, > parent_id?: string, > text?: string, > media: { > id: string, > ad_id?: string, > ad_title?: string, > original_media_id?: string, > media_product_type?: string > } > } > }[] > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > text?: string, > timestamp?: string, > username?: string, > type: comments > } > ``` **`webhookHooks` example** ```ts theme={null} instagram({ webhookHooks: { comments: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Message Received ### Message Received `messageReceived` A Instagram message was received, sent or seen **Payload** | Name | Type | Required | Description | | - | - | - | - | | `object` | `instagram` | Yes | — | | `entry` | `object[]` | Yes | — | > **entry full type** > > ```ts theme={null} > { > id: string, > time: number, > messaging: { > sender: { > id: string > }, > recipient: { > id: string > }, > timestamp: number, > message?: { > mid?: string, > text?: string, > is_echo?: boolean > }, > reaction?: { > mid: string, > action: string, > reaction: string, > emoji: string > } > }[] > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > type: messageReceived, > accountId?: string, > senderId?: string, > recipientId?: string, > messageId: string, > text?: string, > timestamp?: number, > isEcho: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} instagram({ webhookHooks: { messageReceived: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Url Verification ### Url Verification `url_verification` Represents a webhook URL verification challenge from Meta. Used to verify that the webhook endpoint is owned and controlled by the application. **Payload** | Name | Type | Required | Description | | - | - | - | - | | `mode` | `subscribe` | Yes | — | | `verify_token` | `string` | Yes | — | | `challenge` | `string` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > type: url_verification, > challenge: string > } > ``` **`webhookHooks` example** ```ts theme={null} instagram({ webhookHooks: { url_verification: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/intercom/api API reference for Intercom: every `intercom.api.*` operation with input and output types. Every `intercom.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Admins ### get `admins.get` Retrieve a single admin **Risk:** `read` ```ts theme={null} await corsair.intercom.api.admins.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `away_mode_enabled` | `boolean` | No | — | | `away_mode_reassign` | `boolean` | No | — | | `has_inbox_seat` | `boolean` | No | — | | `team_ids` | `number[]` | No | — | | `avatar` | `string` | No | — | *** ### identify `admins.identify` Identify the currently authorised admin **Risk:** `read` ```ts theme={null} await corsair.intercom.api.admins.identify({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `away_mode_enabled` | `boolean` | No | — | | `away_mode_reassign` | `boolean` | No | — | | `has_inbox_seat` | `boolean` | No | — | | `team_ids` | `number[]` | No | — | | `avatar` | `string` | No | — | *** ### list `admins.list` List all admins in the workspace **Risk:** `read` ```ts theme={null} await corsair.intercom.api.admins.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `admins` | `object[]` | Yes | — | > **admins full type** > > ```ts theme={null} > { > type?: string, > id: string, > name?: string, > email?: string, > away_mode_enabled?: boolean, > away_mode_reassign?: boolean, > has_inbox_seat?: boolean, > team_ids?: number[], > avatar?: string > }[] > ``` *** ### listActivityLogs `admins.listActivityLogs` List all admin activity logs **Risk:** `read` ```ts theme={null} await corsair.intercom.api.admins.listActivityLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `created_at_after` | `string` | Yes | — | | `created_at_before` | `string` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `pages` | `object` | No | — | | `activity_logs` | `object[]` | Yes | — | > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` > **activity\_logs full type** > > ```ts theme={null} > { > id: string, > performed_by?: { > type?: string, > id?: string, > email?: string > }, > metadata?: { > }, > created_at?: number, > activity_type?: string, > activity_description?: string > }[] > ``` *** ### setAway `admins.setAway` Set an admin as away **Risk:** `write` ```ts theme={null} await corsair.intercom.api.admins.setAway({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `away_mode_enabled` | `boolean` | Yes | — | | `away_mode_reassign` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `away_mode_enabled` | `boolean` | No | — | | `away_mode_reassign` | `boolean` | No | — | | `has_inbox_seat` | `boolean` | No | — | | `team_ids` | `number[]` | No | — | | `avatar` | `string` | No | — | *** ## Articles ### create `articles.create` Create a new article **Risk:** `write` ```ts theme={null} await corsair.intercom.api.articles.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `author_id` | `number` | Yes | — | | `body` | `string` | No | — | | `description` | `string` | No | — | | `state` | `draft \| published` | No | — | | `parent_id` | `number` | No | — | | `parent_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `body` | `string` | No | — | | `author_id` | `number` | No | — | | `state` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `url` | `string` | No | — | *** ### delete `articles.delete` Delete an article **Risk:** `destructive` ```ts theme={null} await corsair.intercom.api.articles.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `deleted` | `boolean` | No | — | *** ### get `articles.get` Retrieve a single article **Risk:** `read` ```ts theme={null} await corsair.intercom.api.articles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `body` | `string` | No | — | | `author_id` | `number` | No | — | | `state` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `url` | `string` | No | — | *** ### list `articles.list` List all articles **Risk:** `read` ```ts theme={null} await corsair.intercom.api.articles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `state` | `draft \| published` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > title?: string, > description?: string | null, > body?: string | null, > author_id?: number, > state?: string, > created_at?: number, > updated_at?: number, > url?: string | null > }[] > ``` > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` *** ### search `articles.search` Search for articles **Risk:** `read` ```ts theme={null} await corsair.intercom.api.articles.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phrase` | `string` | Yes | — | | `help_center_id` | `number` | No | — | | `state` | `draft \| published` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > title?: string, > description?: string | null, > body?: string | null, > author_id?: number, > state?: string, > created_at?: number, > updated_at?: number, > url?: string | null > }[] > ``` > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` *** ### update `articles.update` Update an existing article **Risk:** `write` ```ts theme={null} await corsair.intercom.api.articles.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `author_id` | `number` | No | — | | `body` | `string` | No | — | | `description` | `string` | No | — | | `state` | `draft \| published` | No | — | | `parent_id` | `number` | No | — | | `parent_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `body` | `string` | No | — | | `author_id` | `number` | No | — | | `state` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `url` | `string` | No | — | *** ## Collections ### create `collections.create` Create a new collection **Risk:** `write` ```ts theme={null} await corsair.intercom.api.collections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `help_center_id` | `number` | No | — | | `parent_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `url` | `string` | No | — | | `icon` | `string` | No | — | | `order` | `number` | No | — | | `help_center_id` | `number` | No | — | *** ### delete `collections.delete` Delete a collection **Risk:** `destructive` ```ts theme={null} await corsair.intercom.api.collections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `deleted` | `boolean` | No | — | *** ### get `collections.get` Retrieve a single collection **Risk:** `read` ```ts theme={null} await corsair.intercom.api.collections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `url` | `string` | No | — | | `icon` | `string` | No | — | | `order` | `number` | No | — | | `help_center_id` | `number` | No | — | *** ### list `collections.list` List all collections **Risk:** `read` ```ts theme={null} await corsair.intercom.api.collections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `help_center_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > name?: string, > description?: string | null, > created_at?: number, > updated_at?: number, > url?: string | null, > icon?: string | null, > order?: number, > help_center_id?: number | null > }[] > ``` > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` *** ### update `collections.update` Update a collection **Risk:** `write` ```ts theme={null} await corsair.intercom.api.collections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `order` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `url` | `string` | No | — | | `icon` | `string` | No | — | | `order` | `number` | No | — | | `help_center_id` | `number` | No | — | *** ## Companies ### createOrUpdate `companies.createOrUpdate` Create or update a company **Risk:** `write` ```ts theme={null} await corsair.intercom.api.companies.createOrUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_id` | `string` | No | — | | `name` | `string` | No | — | | `remote_created_at` | `number` | No | — | | `plan` | `string` | No | — | | `size` | `number` | No | — | | `website` | `string` | No | — | | `industry` | `string` | No | — | | `monthly_spend` | `number` | No | — | | `custom_attributes` | `object` | No | — | > **custom\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `company_id` | `string` | No | — | | `name` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `monthly_spend` | `number` | No | — | | `session_count` | `number` | No | — | | `user_count` | `number` | No | — | | `size` | `number` | No | — | | `website` | `string` | No | — | | `industry` | `string` | No | — | *** ### delete `companies.delete` Delete a company **Risk:** `destructive` ```ts theme={null} await corsair.intercom.api.companies.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `deleted` | `boolean` | No | — | *** ### get `companies.get` Retrieve a company by Intercom ID **Risk:** `read` ```ts theme={null} await corsair.intercom.api.companies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `company_id` | `string` | No | — | | `name` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `monthly_spend` | `number` | No | — | | `session_count` | `number` | No | — | | `user_count` | `number` | No | — | | `size` | `number` | No | — | | `website` | `string` | No | — | | `industry` | `string` | No | — | *** ### list `companies.list` List all companies **Risk:** `read` ```ts theme={null} await corsair.intercom.api.companies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `order` | `string` | No | — | | `tag_id` | `string` | No | — | | `segment_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > company_id?: string, > name?: string, > created_at?: number, > updated_at?: number, > monthly_spend?: number, > session_count?: number, > user_count?: number, > size?: number | null, > website?: string | null, > industry?: string | null > }[] > ``` > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` *** ### listAttachedContacts `companies.listAttachedContacts` List contacts attached to a company **Risk:** `read` ```ts theme={null} await corsair.intercom.api.companies.listAttachedContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > external_id?: string | null, > user_id?: string | null, > email?: string, > name?: string | null, > phone?: string | null, > role?: string, > created_at?: number, > updated_at?: number, > last_seen_at?: number | null, > unsubscribed_from_emails?: boolean > }[] > ``` > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` *** ### listAttachedSegments `companies.listAttachedSegments` List segments attached to a company **Risk:** `read` ```ts theme={null} await corsair.intercom.api.companies.listAttachedSegments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > name?: string, > created_at?: number, > updated_at?: number, > person_type?: string > }[] > ``` *** ### retrieve `companies.retrieve` Retrieve a company by company\_id or name **Risk:** `read` ```ts theme={null} await corsair.intercom.api.companies.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `company_id` | `string` | No | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `company_id` | `string` | No | — | | `name` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `monthly_spend` | `number` | No | — | | `session_count` | `number` | No | — | | `user_count` | `number` | No | — | | `size` | `number` | No | — | | `website` | `string` | No | — | | `industry` | `string` | No | — | *** ### scroll `companies.scroll` Scroll over all companies for large datasets **Risk:** `read` ```ts theme={null} await corsair.intercom.api.companies.scroll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scroll_param` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | | `scroll_param` | `string` | No | — | | `pages` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > company_id?: string, > name?: string, > created_at?: number, > updated_at?: number, > monthly_spend?: number, > session_count?: number, > user_count?: number, > size?: number | null, > website?: string | null, > industry?: string | null > }[] > ``` > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` *** ## Contacts ### addSubscription `contacts.addSubscription` Add a subscription to a contact **Risk:** `write` ```ts theme={null} await corsair.intercom.api.contacts.addSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `id` | `string` | Yes | — | | `consent_type` | `opt_in \| opt_out` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `state` | `string` | No | — | | `consent_type` | `string` | No | — | | `default_translation` | `object` | No | — | > **default\_translation full type** > > ```ts theme={null} > { > name?: string, > description?: string, > locale?: string > } > ``` *** ### addTag `contacts.addTag` Add a tag to a contact **Risk:** `write` ```ts theme={null} await corsair.intercom.api.contacts.addTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `tag_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `name` | `string` | No | — | *** ### attachToCompany `contacts.attachToCompany` Attach a contact to a company **Risk:** `write` ```ts theme={null} await corsair.intercom.api.contacts.attachToCompany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `company_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `company_id` | `string` | No | — | | `name` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `monthly_spend` | `number` | No | — | | `session_count` | `number` | No | — | | `user_count` | `number` | No | — | | `size` | `number` | No | — | | `website` | `string` | No | — | | `industry` | `string` | No | — | *** ### createNote `contacts.createNote` Create a note for a contact **Risk:** `write` ```ts theme={null} await corsair.intercom.api.contacts.createNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `body` | `string` | Yes | — | | `admin_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `body` | `string` | No | — | | `author` | `object` | No | — | | `contact` | `object` | No | — | | `created_at` | `number` | No | — | > **author full type** > > ```ts theme={null} > { > type?: string, > id?: string, > name?: string > } > ``` > **contact full type** > > ```ts theme={null} > { > type?: string, > id?: string > } > ``` *** ### delete `contacts.delete` Delete a contact **Risk:** `destructive` ```ts theme={null} await corsair.intercom.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `deleted` | `boolean` | No | — | *** ### detachFromCompany `contacts.detachFromCompany` Detach a contact from a company **Risk:** `write` ```ts theme={null} await corsair.intercom.api.contacts.detachFromCompany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `company_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `company_id` | `string` | No | — | | `name` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `monthly_spend` | `number` | No | — | | `session_count` | `number` | No | — | | `user_count` | `number` | No | — | | `size` | `number` | No | — | | `website` | `string` | No | — | | `industry` | `string` | No | — | *** ### get `contacts.get` Get a single contact by ID **Risk:** `read` ```ts theme={null} await corsair.intercom.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `external_id` | `string` | No | — | | `user_id` | `string` | No | — | | `email` | `string` | No | — | | `name` | `string` | No | — | | `phone` | `string` | No | — | | `role` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `last_seen_at` | `number` | No | — | | `unsubscribed_from_emails` | `boolean` | No | — | *** ### list `contacts.list` List all contacts **Risk:** `read` ```ts theme={null} await corsair.intercom.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `starting_after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > external_id?: string | null, > user_id?: string | null, > email?: string, > name?: string | null, > phone?: string | null, > role?: string, > created_at?: number, > updated_at?: number, > last_seen_at?: number | null, > unsubscribed_from_emails?: boolean > }[] > ``` > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` *** ### listAttachedCompanies `contacts.listAttachedCompanies` List companies attached to a contact **Risk:** `read` ```ts theme={null} await corsair.intercom.api.contacts.listAttachedCompanies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > company_id?: string, > name?: string, > created_at?: number, > updated_at?: number, > monthly_spend?: number, > session_count?: number, > user_count?: number, > size?: number | null, > website?: string | null, > industry?: string | null > }[] > ``` > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` *** ### listAttachedSegments `contacts.listAttachedSegments` List segments attached to a contact **Risk:** `read` ```ts theme={null} await corsair.intercom.api.contacts.listAttachedSegments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > name?: string, > created_at?: number, > updated_at?: number, > person_type?: string > }[] > ``` *** ### listNotes `contacts.listNotes` List all notes for a contact **Risk:** `read` ```ts theme={null} await corsair.intercom.api.contacts.listNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > body?: string, > author?: { > type?: string, > id?: string, > name?: string > }, > contact?: { > type?: string, > id?: string > }, > created_at?: number > }[] > ``` > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` *** ### listSubscriptions `contacts.listSubscriptions` List subscription types for a contact **Risk:** `read` ```ts theme={null} await corsair.intercom.api.contacts.listSubscriptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > state?: string, > consent_type?: string, > default_translation?: { > name?: string, > description?: string, > locale?: string > } > }[] > ``` *** ### listTags `contacts.listTags` List all tags attached to a contact **Risk:** `read` ```ts theme={null} await corsair.intercom.api.contacts.listTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: string, > name?: string > }[] > ``` *** ### merge `contacts.merge` Merge a lead into a user contact **Risk:** `write` ```ts theme={null} await corsair.intercom.api.contacts.merge({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `external_id` | `string` | No | — | | `user_id` | `string` | No | — | | `email` | `string` | No | — | | `name` | `string` | No | — | | `phone` | `string` | No | — | | `role` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `last_seen_at` | `number` | No | — | | `unsubscribed_from_emails` | `boolean` | No | — | *** ### removeSubscription `contacts.removeSubscription` Remove a subscription from a contact **Risk:** `write` ```ts theme={null} await corsair.intercom.api.contacts.removeSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `subscription_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `state` | `string` | No | — | | `consent_type` | `string` | No | — | | `default_translation` | `object` | No | — | > **default\_translation full type** > > ```ts theme={null} > { > name?: string, > description?: string, > locale?: string > } > ``` *** ### removeTag `contacts.removeTag` Remove a tag from a contact **Risk:** `write` ```ts theme={null} await corsair.intercom.api.contacts.removeTag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `tag_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `name` | `string` | No | — | *** ### update `contacts.update` Update an existing contact **Risk:** `write` ```ts theme={null} await corsair.intercom.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | No | — | | `name` | `string` | No | — | | `phone` | `string` | No | — | | `role` | `user \| lead` | No | — | | `external_id` | `string` | No | — | | `unsubscribed_from_emails` | `boolean` | No | — | | `custom_attributes` | `object` | No | — | > **custom\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `external_id` | `string` | No | — | | `user_id` | `string` | No | — | | `email` | `string` | No | — | | `name` | `string` | No | — | | `phone` | `string` | No | — | | `role` | `string` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `last_seen_at` | `number` | No | — | | `unsubscribed_from_emails` | `boolean` | No | — | *** ## Conversations ### assign `conversations.assign` Assign a conversation to an admin or team **Risk:** `write` ```ts theme={null} await corsair.intercom.api.conversations.assign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `admin_id` | `string` | Yes | — | | `assignee_id` | `string` | Yes | — | | `type` | `admin \| team` | No | — | | `message_type` | `assignment` | No | — | | `body` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `waiting_since` | `number` | No | — | | `snoozed_until` | `number` | No | — | | `state` | `string` | No | — | | `read` | `boolean` | No | — | | `priority` | `string` | No | — | | `assignee` | `object` | No | — | | `source` | `object` | No | — | | `conversation_parts` | `object` | No | — | > **assignee full type** > > ```ts theme={null} > { > type?: string, > id?: number | null > } > ``` > **source full type** > > ```ts theme={null} > { > type?: string, > id?: string, > subject?: string | null, > body?: string | null, > author?: { > type?: string, > id?: string > } > } > ``` > **conversation\_parts full type** > > ```ts theme={null} > { > type?: string, > conversation_parts?: { > type?: string, > id?: string, > part_type?: string, > body?: string | null, > created_at?: number, > updated_at?: number, > author?: { > type?: string, > id?: string, > name?: string | null > } > }[], > total_count?: number > } > ``` *** ### close `conversations.close` Close a conversation **Risk:** `write` ```ts theme={null} await corsair.intercom.api.conversations.close({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `admin_id` | `string` | Yes | — | | `message_type` | `close` | No | — | | `body` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `waiting_since` | `number` | No | — | | `snoozed_until` | `number` | No | — | | `state` | `string` | No | — | | `read` | `boolean` | No | — | | `priority` | `string` | No | — | | `assignee` | `object` | No | — | | `source` | `object` | No | — | | `conversation_parts` | `object` | No | — | > **assignee full type** > > ```ts theme={null} > { > type?: string, > id?: number | null > } > ``` > **source full type** > > ```ts theme={null} > { > type?: string, > id?: string, > subject?: string | null, > body?: string | null, > author?: { > type?: string, > id?: string > } > } > ``` > **conversation\_parts full type** > > ```ts theme={null} > { > type?: string, > conversation_parts?: { > type?: string, > id?: string, > part_type?: string, > body?: string | null, > created_at?: number, > updated_at?: number, > author?: { > type?: string, > id?: string, > name?: string | null > } > }[], > total_count?: number > } > ``` *** ### create `conversations.create` Create a new conversation **Risk:** `write` ```ts theme={null} await corsair.intercom.api.conversations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `object` | Yes | — | | `body` | `string` | Yes | — | > **from full type** > > ```ts theme={null} > { > type: user | lead | contact, > id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `waiting_since` | `number` | No | — | | `snoozed_until` | `number` | No | — | | `state` | `string` | No | — | | `read` | `boolean` | No | — | | `priority` | `string` | No | — | | `assignee` | `object` | No | — | | `source` | `object` | No | — | | `conversation_parts` | `object` | No | — | > **assignee full type** > > ```ts theme={null} > { > type?: string, > id?: number | null > } > ``` > **source full type** > > ```ts theme={null} > { > type?: string, > id?: string, > subject?: string | null, > body?: string | null, > author?: { > type?: string, > id?: string > } > } > ``` > **conversation\_parts full type** > > ```ts theme={null} > { > type?: string, > conversation_parts?: { > type?: string, > id?: string, > part_type?: string, > body?: string | null, > created_at?: number, > updated_at?: number, > author?: { > type?: string, > id?: string, > name?: string | null > } > }[], > total_count?: number > } > ``` *** ### get `conversations.get` Get a conversation by ID with all messages and details **Risk:** `read` ```ts theme={null} await corsair.intercom.api.conversations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `display_as` | `plaintext \| html` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `waiting_since` | `number` | No | — | | `snoozed_until` | `number` | No | — | | `state` | `string` | No | — | | `read` | `boolean` | No | — | | `priority` | `string` | No | — | | `assignee` | `object` | No | — | | `source` | `object` | No | — | | `conversation_parts` | `object` | No | — | > **assignee full type** > > ```ts theme={null} > { > type?: string, > id?: number | null > } > ``` > **source full type** > > ```ts theme={null} > { > type?: string, > id?: string, > subject?: string | null, > body?: string | null, > author?: { > type?: string, > id?: string > } > } > ``` > **conversation\_parts full type** > > ```ts theme={null} > { > type?: string, > conversation_parts?: { > type?: string, > id?: string, > part_type?: string, > body?: string | null, > created_at?: number, > updated_at?: number, > author?: { > type?: string, > id?: string, > name?: string | null > } > }[], > total_count?: number > } > ``` *** ### list `conversations.list` List conversations with filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.intercom.api.conversations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `sort` | `string` | No | — | | `order` | `asc \| desc` | No | — | | `starting_after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | | `conversations` | `object[]` | Yes | — | > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` > **conversations full type** > > ```ts theme={null} > { > type?: string, > id: string, > created_at?: number, > updated_at?: number, > waiting_since?: number | null, > snoozed_until?: number | null, > state?: string, > read?: boolean, > priority?: string, > assignee?: { > type?: string, > id?: number | null > }, > source?: { > type?: string, > id?: string, > subject?: string | null, > body?: string | null, > author?: { > type?: string, > id?: string > } > }, > conversation_parts?: { > type?: string, > conversation_parts?: { > type?: string, > id?: string, > part_type?: string, > body?: string | null, > created_at?: number, > updated_at?: number, > author?: { > type?: string, > id?: string, > name?: string | null > } > }[], > total_count?: number > } > }[] > ``` *** ### reopen `conversations.reopen` Reopen a closed conversation **Risk:** `write` ```ts theme={null} await corsair.intercom.api.conversations.reopen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `admin_id` | `string` | Yes | — | | `message_type` | `open` | No | — | | `body` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `waiting_since` | `number` | No | — | | `snoozed_until` | `number` | No | — | | `state` | `string` | No | — | | `read` | `boolean` | No | — | | `priority` | `string` | No | — | | `assignee` | `object` | No | — | | `source` | `object` | No | — | | `conversation_parts` | `object` | No | — | > **assignee full type** > > ```ts theme={null} > { > type?: string, > id?: number | null > } > ``` > **source full type** > > ```ts theme={null} > { > type?: string, > id?: string, > subject?: string | null, > body?: string | null, > author?: { > type?: string, > id?: string > } > } > ``` > **conversation\_parts full type** > > ```ts theme={null} > { > type?: string, > conversation_parts?: { > type?: string, > id?: string, > part_type?: string, > body?: string | null, > created_at?: number, > updated_at?: number, > author?: { > type?: string, > id?: string, > name?: string | null > } > }[], > total_count?: number > } > ``` *** ### reply `conversations.reply` Send a reply to a conversation **Risk:** `write` ```ts theme={null} await corsair.intercom.api.conversations.reply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `admin_id` | `string` | No | — | | `intercom_user_id` | `string` | No | — | | `message_type` | `comment \| note` | No | — | | `type` | `admin \| user` | Yes | — | | `body` | `string` | Yes | — | | `attachment_urls` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `waiting_since` | `number` | No | — | | `snoozed_until` | `number` | No | — | | `state` | `string` | No | — | | `read` | `boolean` | No | — | | `priority` | `string` | No | — | | `assignee` | `object` | No | — | | `source` | `object` | No | — | | `conversation_parts` | `object` | No | — | > **assignee full type** > > ```ts theme={null} > { > type?: string, > id?: number | null > } > ``` > **source full type** > > ```ts theme={null} > { > type?: string, > id?: string, > subject?: string | null, > body?: string | null, > author?: { > type?: string, > id?: string > } > } > ``` > **conversation\_parts full type** > > ```ts theme={null} > { > type?: string, > conversation_parts?: { > type?: string, > id?: string, > part_type?: string, > body?: string | null, > created_at?: number, > updated_at?: number, > author?: { > type?: string, > id?: string, > name?: string | null > } > }[], > total_count?: number > } > ``` *** ### search `conversations.search` Search conversations using query string **Risk:** `read` ```ts theme={null} await corsair.intercom.api.conversations.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `sort` | `object` | No | — | | `pagination` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > field?: string, > operator?: string, > value?: string > } > ``` > **sort full type** > > ```ts theme={null} > { > field?: string, > order?: ascending | descending > } > ``` > **pagination full type** > > ```ts theme={null} > { > per_page?: number, > starting_after?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `pages` | `object` | No | — | | `total_count` | `number` | No | — | | `conversations` | `object[]` | Yes | — | > **pages full type** > > ```ts theme={null} > { > type?: string, > page?: number, > per_page?: number, > total_pages?: number, > next?: string | null > } > ``` > **conversations full type** > > ```ts theme={null} > { > type?: string, > id: string, > created_at?: number, > updated_at?: number, > waiting_since?: number | null, > snoozed_until?: number | null, > state?: string, > read?: boolean, > priority?: string, > assignee?: { > type?: string, > id?: number | null > }, > source?: { > type?: string, > id?: string, > subject?: string | null, > body?: string | null, > author?: { > type?: string, > id?: string > } > }, > conversation_parts?: { > type?: string, > conversation_parts?: { > type?: string, > id?: string, > part_type?: string, > body?: string | null, > created_at?: number, > updated_at?: number, > author?: { > type?: string, > id?: string, > name?: string | null > } > }[], > total_count?: number > } > }[] > ``` *** ## Help Centers ### get `helpCenters.get` Retrieve a single help center **Risk:** `read` ```ts theme={null} await corsair.intercom.api.helpCenters.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `id` | `number` | Yes | — | | `workspace_id` | `string` | No | — | | `identifier` | `string` | No | — | | `website_turned_on` | `boolean` | No | — | | `display_name` | `string` | No | — | *** ### list `helpCenters.list` List all help centers **Risk:** `read` ```ts theme={null} await corsair.intercom.api.helpCenters.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > id: number, > workspace_id?: string, > identifier?: string, > website_turned_on?: boolean, > display_name?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/intercom/database Intercom local sync: searchable entities, `.search()` filters, and operators. The Intercom plugin syncs data locally. Use `corsair.intercom.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Admins Path: `intercom.db.admins.search` ```ts theme={null} const rows = await corsair.intercom.db.admins.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `away_mode_enabled` | `boolean` | equals | | `away_mode_reassign` | `boolean` | equals | | `has_inbox_seat` | `boolean` | equals | | `avatar` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Articles Path: `intercom.db.articles.search` ```ts theme={null} const rows = await corsair.intercom.db.articles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `author_id` | `number` | equals, gt, gte, lt, lte, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `updated_at` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `number` | equals, gt, gte, lt, lte, in | | `parent_type` | `string` | equals, contains, startsWith, endsWith, in | | `default_locale` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Companies Path: `intercom.db.companies.search` ```ts theme={null} const rows = await corsair.intercom.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `company_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `updated_at` | `number` | equals, gt, gte, lt, lte, in | | `remote_created_at` | `number` | equals, gt, gte, lt, lte, in | | `last_request_at` | `number` | equals, gt, gte, lt, lte, in | | `monthly_spend` | `number` | equals, gt, gte, lt, lte, in | | `session_count` | `number` | equals, gt, gte, lt, lte, in | | `user_count` | `number` | equals, gt, gte, lt, lte, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `industry` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `intercom.db.contacts.search` ```ts theme={null} const rows = await corsair.intercom.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `external_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `updated_at` | `number` | equals, gt, gte, lt, lte, in | | `last_seen_at` | `number` | equals, gt, gte, lt, lte, in | | `last_replied_at` | `number` | equals, gt, gte, lt, lte, in | | `signed_up_at` | `number` | equals, gt, gte, lt, lte, in | | `unsubscribed_from_emails` | `boolean` | equals | | `has_hard_bounced` | `boolean` | equals | | `marked_email_as_spam` | `boolean` | equals | | `browser` | `string` | equals, contains, startsWith, endsWith, in | | `browser_language` | `string` | equals, contains, startsWith, endsWith, in | | `os` | `string` | equals, contains, startsWith, endsWith, in | | `owner_id` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Conversations Path: `intercom.db.conversations.search` ```ts theme={null} const rows = await corsair.intercom.db.conversations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `updated_at` | `number` | equals, gt, gte, lt, lte, in | | `waiting_since` | `number` | equals, gt, gte, lt, lte, in | | `snoozed_until` | `number` | equals, gt, gte, lt, lte, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `read` | `boolean` | equals | | `priority` | `string` | equals, contains, startsWith, endsWith, in | | `admin_assignee_id` | `number` | equals, gt, gte, lt, lte, in | | `team_assignee_id` | `string` | equals, contains, startsWith, endsWith, in | | `contact_id` | `string` | equals, contains, startsWith, endsWith, in | | `source_type` | `string` | equals, contains, startsWith, endsWith, in | | `source_subject` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/intercom/get-credentials Step-by-step instructions for obtaining Intercom API credentials. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Intercom access token ## Access Token Setup ### Step 1: Create an Intercom App 1. Log in to [app.intercom.com](https://app.intercom.com) 2. Go to **Settings** → **Integrations** → **Developer Hub** 3. Click **New App** 4. Enter your app name and select your workspace ### Step 2: Get Your Access Token 1. In your app settings, go to the **Authentication** tab 2. Copy your **Access Token** 3. Store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=intercom api_key=your-access-token ``` ## Webhook Setup (Optional) ### Step 1: Configure Webhooks 1. In your app settings, go to **Webhooks** 2. Add your webhook endpoint URL 3. Select the events you want to receive 4. The webhook secret is your app's **Client Secret** (found in Basic Info) **Storing the webhook secret:** ```bash theme={null} pnpm corsair setup --plugin=intercom webhook_signature=your-client-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Access Token | API calls | Developer Hub → App → Authentication | | Client Secret | Webhook verification | Developer Hub → App → Basic Info | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/intercom/overview Customer messaging platform for support chat, product tours, and user engagement. Use **Intercom** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 51 typed API operations * 5 synced entities (`admins`, `articles`, `companies`, `contacts`, `conversations`) for fast `.search()` / `.list()` * 7 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/intercom ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/intercom ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/intercom ``` ```bash bun theme={null} bun add corsair @corsair-dev/intercom ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { intercom } from '@corsair-dev/intercom'; export const corsair = createCorsair({ plugins: [ intercom(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/intercom/get-credentials). ```ts theme={null} intercom() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'intercom', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`admins.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.intercom.api.admins.get({}); ``` **`admins.setAway`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.intercom.api.admins.setAway({}); ``` See the full list on the [API](/plugins/intercom/api) page. ## Query synced data Synced entities support `tenant.intercom.db..search()` and `.list()`: `admins`, `articles`, `companies`, `contacts`, `conversations`. See [Database](/plugins/intercom/database) for filters and operators. ## Webhooks This plugin registers **7** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/intercom/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/intercom/api)** > > Every `intercom.api.*` operation with input and output types. > **[Database](/plugins/intercom/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/intercom/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/intercom/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/intercom/webhooks Intercom incoming webhooks: event paths, payloads, and response data. The Intercom plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/intercom/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `contacts` * `created` (`contacts.created`) * `deleted` (`contacts.deleted`) * `tagCreated` (`contacts.tagCreated`) * `conversations` * `assigned` (`conversations.assigned`) * `closed` (`conversations.closed`) * `created` (`conversations.created`) * `ping` (`ping`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Contacts ### Created `contacts.created` A new contact was created in Intercom **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `topic` | `string` | Yes | — | | `id` | `string` | No | — | | `app_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `first_sent_at` | `number` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > item: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > email?: string, > name?: string, > role?: string, > created_at?: number > } > ``` **`webhookHooks` example** ```ts theme={null} intercom({ webhookHooks: { contacts: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `contacts.deleted` A contact was deleted from Intercom **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `topic` | `string` | Yes | — | | `id` | `string` | No | — | | `app_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `first_sent_at` | `number` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > item: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > deleted?: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} intercom({ webhookHooks: { contacts: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Tag Created `contacts.tagCreated` A tag was added to a contact **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `topic` | `string` | Yes | — | | `id` | `string` | No | — | | `app_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `first_sent_at` | `number` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > item: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > tag_id?: string, > contact_id?: string > } > ``` **`webhookHooks` example** ```ts theme={null} intercom({ webhookHooks: { contacts: { tagCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Conversations ### Assigned `conversations.assigned` A conversation was assigned to an admin or team **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `topic` | `string` | Yes | — | | `id` | `string` | No | — | | `app_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `first_sent_at` | `number` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > item: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > assignee?: { > type?: string, > id?: number | null > } > } > ``` **`webhookHooks` example** ```ts theme={null} intercom({ webhookHooks: { conversations: { assigned: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Closed `conversations.closed` A conversation was closed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `topic` | `string` | Yes | — | | `id` | `string` | No | — | | `app_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `first_sent_at` | `number` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > item: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > state?: string > } > ``` **`webhookHooks` example** ```ts theme={null} intercom({ webhookHooks: { conversations: { closed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `conversations.created` A new conversation was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `topic` | `string` | Yes | — | | `id` | `string` | No | — | | `app_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `first_sent_at` | `number` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > item: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > created_at?: number, > state?: string > } > ``` **`webhookHooks` example** ```ts theme={null} intercom({ webhookHooks: { conversations: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Ping ### Ping `ping` Initial ping sent by Intercom when a webhook URL is first registered **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `topic` | `string` | Yes | — | | `id` | `string` | No | — | | `app_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `first_sent_at` | `number` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > type?: string, > item: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: ping, > message: string > } > ``` **`webhookHooks` example** ```ts theme={null} intercom({ webhookHooks: { ping: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/jigsawstack/api API reference for JigsawStack: every `jigsawstack.api.*` operation with input and output types. Every `jigsawstack.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Ai ### imageGeneration `ai.imageGeneration` Generate an image from a text prompt **Risk:** `write` ```ts theme={null} await corsair.jigsawstack.api.ai.imageGeneration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `aspect_ratio` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `steps` | `number` | No | — | | `output_format` | `png \| svg` | No | — | | `return_type` | `url \| binary \| base64` | No | — | | `url` | `string` | No | — | | `file_store_key` | `string` | No | — | | `advance_config` | `object` | No | — | > **advance\_config full type** > > ```ts theme={null} > { > negative_prompt?: string, > guidance?: number, > seed?: number > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > success: boolean, > content_type: string, > base64: string > } | { > success: boolean, > _usage?: { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > }, > log_id?: string, > url?: string, > base64?: string > } > ``` *** ### prediction `ai.prediction` Forecast a time series from dated values **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.ai.prediction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `object[]` | Yes | — | | `steps` | `number` | No | — | > **dataset full type** > > ```ts theme={null} > { > value: number | string, > date: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `prediction` | `object[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` > **prediction full type** > > ```ts theme={null} > { > value?: number | string, > date?: string > }[] > ``` *** ### sentiment `ai.sentiment` Analyze sentiment and emotion in text **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.ai.sentiment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `sentiment` | `object` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` > **sentiment full type** > > ```ts theme={null} > { > emotion?: string, > sentiment?: string, > score?: number, > sentences?: { > text?: string, > emotion?: string, > sentiment?: string, > score?: number > }[] > } > ``` *** ### summary `ai.summary` Summarize text or a PDF as a paragraph or bullet points **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.ai.summary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | — | | `url` | `string` | No | — | | `file_store_key` | `string` | No | — | | `type` | `text \| points` | No | — | | `max_points` | `number` | No | — | | `max_characters` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `summary` | `string \| string[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ### translate `ai.translate` Translate text into a target language **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.ai.translate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string \| string[]` | Yes | — | | `target_language` | `string` | Yes | — | | `current_language` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `translated_text` | `string \| string[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ## Audio ### createVoiceClone `audio.createVoiceClone` Clone a voice from an audio sample for later TTS **Risk:** `write` ```ts theme={null} await corsair.jigsawstack.api.audio.createVoiceClone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `url` | `string` | No | — | | `file_store_key` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `voice_id` | `string` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ### speechToText `audio.speechToText` Transcribe audio or video to text **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.audio.speechToText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `file_store_key` | `string` | No | — | | `language` | `string` | No | — | | `translate` | `boolean` | No | — | | `by_speaker` | `boolean` | No | — | | `webhook_url` | `string` | No | — | | `batch_size` | `number` | No | — | | `chunk_duration` | `number` | No | — | | `word_timestamps` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `text` | `string` | No | — | | `chunks` | `any[]` | No | — | | `status` | `string` | No | — | | `id` | `string` | No | — | | `language_detected` | `any` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ### textToSpeech `audio.textToSpeech` Convert text to speech audio **Risk:** `write` ```ts theme={null} await corsair.jigsawstack.api.audio.textToSpeech({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `accent` | `string` | No | — | | `voice_clone_id` | `string` | No | — | | `speaker_clone_url` | `string` | No | — | | `speaker_clone_file_store_key` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `content_type` | `string` | Yes | — | | `base64` | `string` | Yes | — | *** ## Classification ### classify `classification.classify` Classify text or images with custom labels **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.classification.classify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dataset` | `object[]` | Yes | — | | `labels` | `object[]` | Yes | — | | `multiple_labels` | `boolean` | No | — | > **dataset full type** > > ```ts theme={null} > { > type: text | image, > value: string > }[] > ``` > **labels full type** > > ```ts theme={null} > { > key?: string, > type: text | image, > value: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `predictions` | `(string \| string[])[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ## Embedding ### createV2 `embedding.createV2` Create v2 embeddings from text, image, audio, or PDF **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.embedding.createV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | — | | `url` | `string` | No | — | | `file_store_key` | `string` | No | — | | `type` | `text \| text-other \| image \| audio \| pdf` | Yes | — | | `token_overflow_mode` | `truncate \| error` | No | — | | `dimensions` | `number` | No | — | | `instruction` | `string` | No | — | | `query` | `boolean` | No | — | | `speaker_fingerprint` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `embeddings` | `number[][]` | No | — | | `chunks` | `any` | No | — | | `speaker_embeddings` | `number[][]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ## Prompt Engine ### create `promptEngine.create` Create a reusable Prompt Engine template **Risk:** `write` ```ts theme={null} await corsair.jigsawstack.api.promptEngine.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `name` | `string` | No | — | | `return_prompt` | `any` | No | — | | `inputs` | `object[]` | No | — | | `use_internet` | `boolean` | No | — | | `optimize_prompt` | `boolean` | No | — | | `prompt_guard` | `defamation \| specialized_advice \| privacy \| intellectual_property \| indiscriminate_weapons \| hate \| sexual_content \| elections \| code_interpreter_abuse[]` | No | — | > **inputs full type** > > ```ts theme={null} > { > key: string, > optional?: boolean, > initial_value?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `prompt_engine_id` | `string` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ### list `promptEngine.list` List Prompt Engine templates **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.promptEngine.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `prompt_engines` | `any[]` | No | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `has_more` | `boolean` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ### run `promptEngine.run` Run a stored Prompt Engine by id **Risk:** `write` ```ts theme={null} await corsair.jigsawstack.api.promptEngine.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `input_values` | `object` | No | — | | `stream` | `boolean` | No | — | > **input\_values full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `result` | `any` | No | — | | `message` | `string` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ## Validate ### nsfw `validate.nsfw` Detect NSFW content in an image **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.validate.nsfw({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `file_store_key` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `nsfw` | `boolean` | No | — | | `nudity` | `boolean` | No | — | | `gore` | `boolean` | No | — | | `nsfw_score` | `number` | No | — | | `nudity_score` | `number` | No | — | | `gore_score` | `number` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ### profanity `validate.profanity` Check text for profanity and return a cleaned copy **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.validate.profanity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `censor_replacement` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `message` | `string` | No | — | | `clean_text` | `string` | No | — | | `profanities_found` | `boolean` | No | — | | `profanities` | `object[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` > **profanities full type** > > ```ts theme={null} > { > profanity?: string | null, > startIndex?: number, > endIndex?: number > }[] > ``` *** ### spamCheck `validate.spamCheck` Score text for spam likelihood **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.validate.spamCheck({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string \| string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `check` | `object[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` > **check full type** > > ```ts theme={null} > { > is_spam?: boolean, > score?: number > } | { > is_spam?: boolean, > score?: number > }[] > ``` *** ### spellCheck `validate.spellCheck` Detect and auto-correct spelling mistakes **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.validate.spellCheck({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `language_code` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `misspellings_found` | `boolean` | No | — | | `auto_correct_text` | `string` | No | — | | `misspellings` | `object[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` > **misspellings full type** > > ```ts theme={null} > { > word?: string | null, > startIndex?: number, > endIndex?: number, > expected?: string[], > auto_corrected?: boolean > }[] > ``` *** ## Vision ### detectObjects `vision.detectObjects` Detect objects and GUI elements in an image **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.vision.detectObjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `file_store_key` | `string` | No | — | | `prompts` | `string[]` | No | — | | `enhance_prompts` | `boolean` | No | — | | `features` | `object \| gui[]` | No | — | | `annotated_image` | `boolean` | No | — | | `return_type` | `url \| base64` | No | — | | `return_masks` | `boolean` | No | — | | `return_tags` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `annotated_image` | `string` | No | — | | `gui_elements` | `any[]` | No | — | | `objects` | `any[]` | No | — | | `tags` | `string[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ### vocr `vision.vocr` Extract text and fields from an image or PDF **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.vision.vocr({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `file_store_key` | `string` | No | — | | `prompt` | `object` | No | — | | `page_range` | `number[]` | No | — | | `fine_grained` | `boolean` | No | — | | `return_bounds` | `boolean` | No | — | > **prompt full type** > > ```ts theme={null} > string | string[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `context` | `any` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `tags` | `string[]` | No | — | | `has_text` | `boolean` | No | — | | `sections` | `any[]` | No | — | | `total_pages` | `number` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ## Web ### htmlToAny `web.htmlToAny` Convert HTML or a URL to PNG, JPEG, WEBP, or PDF **Risk:** `write` ```ts theme={null} await corsair.jigsawstack.api.web.htmlToAny({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `html` | `string` | No | — | | `url` | `string` | No | — | | `type` | `pdf \| png \| jpeg \| webp` | No | — | | `full_page` | `boolean` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `return_type` | `url \| binary \| base64` | No | — | | `quality` | `number` | No | — | | `is_mobile` | `boolean` | No | — | | `dark_mode` | `boolean` | No | — | | `size_preset` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > success: boolean, > content_type: string, > base64: string > } | { > success: boolean, > _usage?: { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > }, > log_id?: string, > url?: string, > base64?: string > } > ``` *** ### scrape `web.scrape` Scrape a page into structured data with AI prompts **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.web.scrape({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `html` | `string` | No | — | | `element_prompts` | `object` | No | — | | `selectors` | `string[]` | No | — | | `root_element_selector` | `string` | No | — | | `scroll` | `boolean` | No | — | | `page_position` | `number` | No | — | | `features` | `meta \| link[]` | No | — | > **element\_prompts full type** > > ```ts theme={null} > string[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `data` | `any[]` | No | — | | `page_position` | `number` | No | — | | `page_position_length` | `number` | No | — | | `meta` | `any` | No | — | | `link` | `any[]` | No | — | | `selectors` | `object` | No | — | | `context` | `any` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` > **selectors full type** > > ```ts theme={null} > { > } > ``` *** ### search `web.search` Search the web with optional AI overview **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.web.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `spell_check` | `boolean` | No | — | | `max_results` | `number` | No | — | | `safe_search` | `strict \| moderate \| off` | No | — | | `ai_overview` | `boolean` | No | — | | `auto_scrape` | `boolean` | No | — | | `country_code` | `string` | No | — | | `byo_urls` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `query` | `string` | No | — | | `ai_overview` | `string` | No | — | | `spell_fixed` | `boolean` | No | — | | `is_safe` | `boolean` | No | — | | `results` | `any[]` | No | — | | `image_urls` | `string[]` | No | — | | `links` | `string[]` | No | — | | `geo_results` | `any[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** ### searchSuggestions `web.searchSuggestions` Get search autocomplete suggestions for a query **Risk:** `read` ```ts theme={null} await corsair.jigsawstack.api.web.searchSuggestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `_usage` | `object` | No | — | | `log_id` | `string` | No | — | | `suggestions` | `string[]` | No | — | > **\_usage full type** > > ```ts theme={null} > { > input_tokens?: number, > output_tokens?: number, > inference_time_tokens?: number, > total_tokens?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/jigsawstack/database JigsawStack local sync: searchable entities, `.search()` filters, and operators. The JigsawStack plugin syncs data locally. Use `corsair.jigsawstack.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Prompts Path: `jigsawstack.db.prompts.search` ```ts theme={null} const rows = await corsair.jigsawstack.db.prompts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `prompt` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Summaries Path: `jigsawstack.db.summaries.search` ```ts theme={null} const rows = await corsair.jigsawstack.db.summaries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transcriptions Path: `jigsawstack.db.transcriptions.search` ```ts theme={null} const rows = await corsair.jigsawstack.db.transcriptions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/jigsawstack/overview AI utility API collection for OCR, translation, sentiment, and common ML microservices. Use **JigsawStack** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 23 typed API operations * 3 synced entities (`prompts`, `summaries`, `transcriptions`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/jigsawstack ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/jigsawstack ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/jigsawstack ``` ```bash bun theme={null} bun add corsair @corsair-dev/jigsawstack ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { jigsawstack } from '@corsair-dev/jigsawstack'; export const corsair = createCorsair({ plugins: [ jigsawstack(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} jigsawstack() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'jigsawstack', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`ai.prediction`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.jigsawstack.api.ai.prediction({}); ``` **`ai.imageGeneration`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.jigsawstack.api.ai.imageGeneration({}); ``` See the full list on the [API](/plugins/jigsawstack/api) page. ## Query synced data Synced entities support `tenant.jigsawstack.db..search()` and `.list()`: `prompts`, `summaries`, `transcriptions`. See [Database](/plugins/jigsawstack/database) for filters and operators. ## What's next > **[API reference](/plugins/jigsawstack/api)** > > Every `jigsawstack.api.*` operation with input and output types. > **[Database](/plugins/jigsawstack/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/jira/api API reference for Jira: every `jira.api.*` operation with input and output types. Every `jira.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Comments ### add `comments.add` Add a comment to a Jira issue **Risk:** `write` ```ts theme={null} await corsair.jira.api.comments.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `comment` | `string` | Yes | — | | `visibility_type` | `string` | No | — | | `visibility_value` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `self` | `string` | No | — | | `author` | `object` | No | — | | `created` | `string` | No | — | > **author full type** > > ```ts theme={null} > { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > } > ``` *** ### delete `comments.delete` Delete a comment from a Jira issue **Risk:** `destructive` ```ts theme={null} await corsair.jira.api.comments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `comment_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `comments.get` Get a specific comment on a Jira issue **Risk:** `read` ```ts theme={null} await corsair.jira.api.comments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `comment_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `self` | `string` | No | — | | `author` | `object` | No | — | | `body` | `any` | No | — | | `renderedBody` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | > **author full type** > > ```ts theme={null} > { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > } > ``` *** ### list `comments.list` List all comments on a Jira issue **Risk:** `read` ```ts theme={null} await corsair.jira.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `start_at` | `number` | No | — | | `max_results` | `number` | No | — | | `order_by` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `startAt` | `number` | No | — | | `maxResults` | `number` | No | — | | `comments` | `object[]` | No | — | > **comments full type** > > ```ts theme={null} > { > id?: string, > self?: string, > author?: { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > }, > body?: any, > renderedBody?: string, > created?: string, > updated?: string > }[] > ``` *** ### update `comments.update` Update a comment on a Jira issue **Risk:** `write` ```ts theme={null} await corsair.jira.api.comments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `comment_id` | `string` | Yes | — | | `comment` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `self` | `string` | No | — | | `author` | `object` | No | — | | `body` | `any` | No | — | | `renderedBody` | `string` | No | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | > **author full type** > > ```ts theme={null} > { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > } > ``` *** ## Groups ### create `groups.create` Create a new Jira group **Risk:** `write` ```ts theme={null} await corsair.jira.api.groups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `string` | No | — | | `name` | `string` | No | — | | `self` | `string` | No | — | *** ### getAll `groups.getAll` Get all Jira groups **Risk:** `read` ```ts theme={null} await corsair.jira.api.groups.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_at` | `number` | No | — | | `max_results` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `header` | `string` | No | — | | `groups` | `object[]` | No | — | > **groups full type** > > ```ts theme={null} > { > groupId?: string, > name?: string, > html?: string > }[] > ``` *** ## Issues ### addAttachment `issues.addAttachment` Add an attachment to a Jira issue **Risk:** `write` ```ts theme={null} await corsair.jira.api.issues.addAttachment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `file_name` | `string` | Yes | — | | `file_content` | `string` | No | — | | `file_url` | `string` | No | — | | `mime_type` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > self?: string, > filename?: string, > mimeType?: string, > size?: number, > content?: string, > created?: string > }[] > ``` *** ### addWatcher `issues.addWatcher` Add a watcher to a Jira issue **Risk:** `write` ```ts theme={null} await corsair.jira.api.issues.addWatcher({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `account_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### assign `issues.assign` Assign a Jira issue to a user **Risk:** `write` ```ts theme={null} await corsair.jira.api.issues.assign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `account_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### bulkCreate `issues.bulkCreate` Bulk create multiple Jira issues **Risk:** `write` ```ts theme={null} await corsair.jira.api.issues.bulkCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issues` | `object[]` | Yes | — | > **issues full type** > > ```ts theme={null} > { > project_key: string, > summary: string, > issue_type?: string, > description?: string, > assignee?: string, > priority?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `issues` | `object[]` | No | — | | `errors` | `any[]` | No | — | > **issues full type** > > ```ts theme={null} > { > id?: string, > key?: string, > self?: string > }[] > ``` *** ### bulkFetch `issues.bulkFetch` Bulk fetch multiple Jira issues by ID or key **Risk:** `read` ```ts theme={null} await corsair.jira.api.issues.bulkFetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_ids_or_keys` | `string[]` | Yes | — | | `fields` | `string[]` | No | — | | `expand` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `issues` | `object[]` | No | — | | `issueErrors` | `any[]` | No | — | > **issues full type** > > ```ts theme={null} > { > id: string, > key?: string, > self?: string, > fields?: { > summary?: string, > description?: any, > status?: { > id?: string, > name?: string, > statusCategory?: { > id?: number, > key?: string, > name?: string > } > }, > assignee?: { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > } | null, > reporter?: { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > }, > priority?: { > id?: string, > name?: string, > iconUrl?: string > } | null, > issuetype?: { > id?: string, > name?: string, > description?: string, > subtask?: boolean > }, > project?: { > id?: string, > key?: string, > name?: string > }, > labels?: string[], > created?: string, > updated?: string, > comment?: { > total?: number, > comments?: any[] > } > } > }[] > ``` *** ### create `issues.create` Create a new Jira issue **Risk:** `write` ```ts theme={null} await corsair.jira.api.issues.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_key` | `string` | Yes | — | | `summary` | `string` | Yes | — | | `issue_type` | `string` | No | — | | `description` | `string` | No | — | | `assignee` | `string` | No | — | | `priority` | `string` | No | — | | `labels` | `string[]` | No | — | | `due_date` | `string` | No | — | | `parent` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `key` | `string` | No | — | | `self` | `string` | No | — | *** ### delete `issues.delete` Delete a Jira issue **Risk:** `destructive` ```ts theme={null} await corsair.jira.api.issues.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `delete_subtasks` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | *** ### edit `issues.edit` Edit an existing Jira issue **Risk:** `write` ```ts theme={null} await corsair.jira.api.issues.edit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | | `assignee` | `string` | No | — | | `priority` | `string` | No | — | | `labels` | `string[]` | No | — | | `due_date` | `string` | No | — | | `notify_users` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `issue_key` | `string` | No | — | *** ### get `issues.get` Get a Jira issue by ID or key **Risk:** `read` ```ts theme={null} await corsair.jira.api.issues.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `fields` | `string` | No | — | | `expand` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `key` | `string` | No | — | | `self` | `string` | No | — | | `fields` | `object` | No | — | > **fields full type** > > ```ts theme={null} > { > summary?: string, > description?: any, > status?: { > id?: string, > name?: string, > statusCategory?: { > id?: number, > key?: string, > name?: string > } > }, > assignee?: { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > } | null, > reporter?: { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > }, > priority?: { > id?: string, > name?: string, > iconUrl?: string > } | null, > issuetype?: { > id?: string, > name?: string, > description?: string, > subtask?: boolean > }, > project?: { > id?: string, > key?: string, > name?: string > }, > labels?: string[], > created?: string, > updated?: string, > comment?: { > total?: number, > comments?: any[] > } > } > ``` *** ### getTransitions `issues.getTransitions` Get available transitions for a Jira issue **Risk:** `read` ```ts theme={null} await corsair.jira.api.issues.getTransitions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `transitions` | `object[]` | No | — | > **transitions full type** > > ```ts theme={null} > { > id?: string, > name?: string, > to?: { > id?: string, > name?: string, > statusCategory?: { > id?: number, > key?: string, > name?: string > } > } > }[] > ``` *** ### linkIssues `issues.linkIssues` Link two Jira issues together **Risk:** `write` ```ts theme={null} await corsair.jira.api.issues.linkIssues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `link_type` | `string` | Yes | — | | `inward_issue_key` | `string` | Yes | — | | `outward_issue_key` | `string` | Yes | — | | `comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### removeWatcher `issues.removeWatcher` Remove a watcher from a Jira issue **Risk:** `write` ```ts theme={null} await corsair.jira.api.issues.removeWatcher({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `account_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### search `issues.search` Search issues using JQL **Risk:** `read` ```ts theme={null} await corsair.jira.api.issues.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jql` | `string` | Yes | — | | `next_page_token` | `string` | No | — | | `max_results` | `number` | No | — | | `fields` | `string` | No | — | | `expand` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `startAt` | `number` | No | — | | `maxResults` | `number` | No | — | | `nextPageToken` | `string` | No | — | | `isLast` | `boolean` | No | — | | `issues` | `object[]` | No | — | > **issues full type** > > ```ts theme={null} > { > id: string, > key?: string, > self?: string, > fields?: { > summary?: string, > description?: any, > status?: { > id?: string, > name?: string, > statusCategory?: { > id?: number, > key?: string, > name?: string > } > }, > assignee?: { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > } | null, > reporter?: { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > }, > priority?: { > id?: string, > name?: string, > iconUrl?: string > } | null, > issuetype?: { > id?: string, > name?: string, > description?: string, > subtask?: boolean > }, > project?: { > id?: string, > key?: string, > name?: string > }, > labels?: string[], > created?: string, > updated?: string, > comment?: { > total?: number, > comments?: any[] > } > } > }[] > ``` *** ### transition `issues.transition` Transition a Jira issue to a new status **Risk:** `write` ```ts theme={null} await corsair.jira.api.issues.transition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issue_id_or_key` | `string` | Yes | — | | `transition_id` | `string` | Yes | — | | `comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Projects ### create `projects.create` Create a new Jira project **Risk:** `write` ```ts theme={null} await corsair.jira.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | | `name` | `string` | Yes | — | | `project_type_key` | `string` | No | — | | `description` | `string` | No | — | | `lead_account_id` | `string` | No | — | | `assignee_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | No | — | | `key` | `string` | No | — | | `self` | `string` | No | — | *** ### get `projects.get` Get a Jira project by ID or key **Risk:** `read` ```ts theme={null} await corsair.jira.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id_or_key` | `string` | Yes | — | | `expand` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `key` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `projectTypeKey` | `string` | No | — | | `lead` | `object` | No | — | | `self` | `string` | No | — | > **lead full type** > > ```ts theme={null} > { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > } > ``` *** ### getRoles `projects.getRoles` Get project roles for a Jira project **Risk:** `read` ```ts theme={null} await corsair.jira.api.projects.getRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id_or_key` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `projects.list` List Jira projects **Risk:** `read` ```ts theme={null} await corsair.jira.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `order_by` | `string` | No | — | | `start_at` | `number` | No | — | | `max_results` | `number` | No | — | | `expand` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `startAt` | `number` | No | — | | `maxResults` | `number` | No | — | | `isLast` | `boolean` | No | — | | `values` | `object[]` | No | — | > **values full type** > > ```ts theme={null} > { > id?: string, > key?: string, > name?: string, > description?: string, > projectTypeKey?: string, > lead?: { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > }, > self?: string > }[] > ``` *** ## Sprints ### create `sprints.create` Create a new sprint on a Jira board **Risk:** `write` ```ts theme={null} await corsair.jira.api.sprints.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `origin_board_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `goal` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `state` | `string` | No | — | | `goal` | `string` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `completeDate` | `string` | No | — | | `createdDate` | `string` | No | — | | `originBoardId` | `number` | No | — | | `self` | `string` | No | — | *** ### list `sprints.list` List sprints for a Jira board **Risk:** `read` ```ts theme={null} await corsair.jira.api.sprints.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `number` | Yes | — | | `state` | `string` | No | — | | `start_at` | `number` | No | — | | `max_results` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `startAt` | `number` | No | — | | `isLast` | `boolean` | No | — | | `values` | `object[]` | No | — | > **values full type** > > ```ts theme={null} > { > id?: number, > name?: string, > state?: string, > goal?: string, > startDate?: string, > endDate?: string, > completeDate?: string, > createdDate?: string, > originBoardId?: number, > self?: string > }[] > ``` *** ### listBoards `sprints.listBoards` List Jira boards **Risk:** `read` ```ts theme={null} await corsair.jira.api.sprints.listBoards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_key_or_id` | `string` | No | — | | `type` | `string` | No | — | | `name` | `string` | No | — | | `start_at` | `number` | No | — | | `max_results` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `startAt` | `number` | No | — | | `isLast` | `boolean` | No | — | | `total` | `number` | No | — | | `values` | `object[]` | No | — | > **values full type** > > ```ts theme={null} > { > id?: number, > name?: string, > type?: string, > self?: string, > location?: { > projectId?: number, > projectKey?: string, > projectName?: string > } > }[] > ``` *** ### moveIssues `sprints.moveIssues` Move issues to a sprint **Risk:** `write` ```ts theme={null} await corsair.jira.api.sprints.moveIssues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sprint_id` | `number` | Yes | — | | `issue_keys` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Users ### find `users.find` Search for Jira users **Risk:** `read` ```ts theme={null} await corsair.jira.api.users.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `account_id` | `string` | No | — | | `start_at` | `number` | No | — | | `max_results` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > }[] > ``` *** ### getAll `users.getAll` Get all Jira users **Risk:** `read` ```ts theme={null} await corsair.jira.api.users.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_at` | `number` | No | — | | `max_results` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > accountId?: string, > displayName?: string, > emailAddress?: string, > active?: boolean, > avatarUrls?: { > } > }[] > ``` *** ### getCurrent `users.getCurrent` Get the currently authenticated Jira user **Risk:** `read` ```ts theme={null} await corsair.jira.api.users.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | Yes | — | | `displayName` | `string` | No | — | | `emailAddress` | `string` | No | — | | `active` | `boolean` | No | — | | `avatarUrls` | `object` | No | — | | `timeZone` | `string` | No | — | | `locale` | `string` | No | — | > **avatarUrls full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/jira/database Jira local sync: searchable entities, `.search()` filters, and operators. The Jira plugin syncs data locally. Use `corsair.jira.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Boards Path: `jira.db.boards.search` ```ts theme={null} const rows = await corsair.jira.db.boards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `number` | equals, gt, gte, lt, lte, in | | `projectKey` | `string` | equals, contains, startsWith, endsWith, in | | `projectName` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Comments Path: `jira.db.comments.search` ```ts theme={null} const rows = await corsair.jira.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `issueKey` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `authorAccountId` | `string` | equals, contains, startsWith, endsWith, in | | `authorDisplayName` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Issues Path: `jira.db.issues.search` ```ts theme={null} const rows = await corsair.jira.db.issues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `assigneeAccountId` | `string` | equals, contains, startsWith, endsWith, in | | `assigneeDisplayName` | `string` | equals, contains, startsWith, endsWith, in | | `reporterAccountId` | `string` | equals, contains, startsWith, endsWith, in | | `reporterDisplayName` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `string` | equals, contains, startsWith, endsWith, in | | `issueType` | `string` | equals, contains, startsWith, endsWith, in | | `projectKey` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `updated` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `jira.db.projects.search` ```ts theme={null} const rows = await corsair.jira.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `projectTypeKey` | `string` | equals, contains, startsWith, endsWith, in | | `leadAccountId` | `string` | equals, contains, startsWith, endsWith, in | | `leadDisplayName` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sprints Path: `jira.db.sprints.search` ```ts theme={null} const rows = await corsair.jira.db.sprints.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `goal` | `string` | equals, contains, startsWith, endsWith, in | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `endDate` | `string` | equals, contains, startsWith, endsWith, in | | `originBoardId` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `jira.db.users.search` ```ts theme={null} const rows = await corsair.jira.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `accountId` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `emailAddress` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `timeZone` | `string` | equals, contains, startsWith, endsWith, in | | `locale` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/jira/get-credentials Step-by-step instructions for obtaining Jira API credentials. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Atlassian API token ## API Token Setup ### Step 1: Create an API Token 1. Log in to [id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens) 2. Click **Create API token** 3. Give it a label (e.g., "Corsair Integration") 4. Click **Create** 5. Copy the token immediately — you won't be able to see it again 6. Store it securely The Jira plugin uses your email + API token for authentication (Basic Auth). Store the token as the `api_key`: **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=jira api_key=your-api-token ``` > [!NOTE] > > Your Jira cloud URL (e.g., `https://yourcompany.atlassian.net`) and email address may also be required in your plugin configuration depending on your setup. ## Webhook Setup (Optional) 1. In Jira, go to **Settings** → **System** → **WebHooks** 2. Click **Create a WebHook** 3. Enter your endpoint URL and select the events you want 4. Copy the secret if provided ```bash theme={null} pnpm corsair setup --plugin=jira webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Token | All API calls | Atlassian Account → Security → API Tokens | | Webhook Secret | Webhook verification | Jira Settings → System → WebHooks | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/jira/overview Issue and project tracking tool for agile sprints, bugs, epics, and team workflows. Use **Jira** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 32 typed API operations * 6 synced entities (`boards`, `comments`, `issues`, `projects`, `sprints`, `users`) for fast `.search()` / `.list()` * 3 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/jira ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/jira ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/jira ``` ```bash bun theme={null} bun add corsair @corsair-dev/jira ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { jira } from '@corsair-dev/jira'; export const corsair = createCorsair({ plugins: [ jira(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/jira/get-credentials). ```ts theme={null} jira() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'jira', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`comments.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.jira.api.comments.get({}); ``` **`comments.add`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.jira.api.comments.add({}); ``` See the full list on the [API](/plugins/jira/api) page. ## Query synced data Synced entities support `tenant.jira.db..search()` and `.list()`: `boards`, `comments`, `issues`, `projects`, `sprints`, `users`. See [Database](/plugins/jira/database) for filters and operators. ## Webhooks This plugin registers **3** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/jira/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/jira/api)** > > Every `jira.api.*` operation with input and output types. > **[Database](/plugins/jira/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/jira/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/jira/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/jira/webhooks Jira incoming webhooks: event paths, payloads, and response data. The Jira plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/jira/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `issues` * `newIssue` (`issues.newIssue`) * `updatedIssue` (`issues.updatedIssue`) * `projects` * `newProject` (`projects.newProject`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Issues ### New Issue `issues.newIssue` Triggered when a new issue is created in Jira **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookEvent` | `jira:issue_created` | Yes | — | | `timestamp` | `number` | No | — | | `issue` | `object` | No | — | | `user` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > id?: string, > key?: string, > self?: string, > fields?: { > summary?: string, > status?: { > id?: string, > name?: string, > statusCategory?: { > key?: string, > name?: string > } > }, > assignee?: { > accountId?: string, > displayName?: string, > emailAddress?: string > } | null, > reporter?: { > accountId?: string, > displayName?: string, > emailAddress?: string > }, > priority?: { > id?: string, > name?: string > } | null, > issuetype?: { > id?: string, > name?: string, > subtask?: boolean > }, > project?: { > id?: string, > key?: string, > name?: string > }, > labels?: string[], > created?: string, > updated?: string > } > } > ``` > **user full type** > > ```ts theme={null} > { > accountId?: string, > displayName?: string, > emailAddress?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookEvent: jira:issue_created, > timestamp?: number, > issue?: { > id?: string, > key?: string, > self?: string, > fields?: { > summary?: string, > status?: { > id?: string, > name?: string, > statusCategory?: { > key?: string, > name?: string > } > }, > assignee?: { > accountId?: string, > displayName?: string, > emailAddress?: string > } | null, > reporter?: { > accountId?: string, > displayName?: string, > emailAddress?: string > }, > priority?: { > id?: string, > name?: string > } | null, > issuetype?: { > id?: string, > name?: string, > subtask?: boolean > }, > project?: { > id?: string, > key?: string, > name?: string > }, > labels?: string[], > created?: string, > updated?: string > } > }, > user?: { > accountId?: string, > displayName?: string, > emailAddress?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} jira({ webhookHooks: { issues: { newIssue: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated Issue `issues.updatedIssue` Triggered when an issue is updated in Jira **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookEvent` | `jira:issue_updated` | Yes | — | | `timestamp` | `number` | No | — | | `issue` | `object` | No | — | | `user` | `object` | No | — | | `changelog` | `object` | No | — | > **issue full type** > > ```ts theme={null} > { > id?: string, > key?: string, > self?: string, > fields?: { > summary?: string, > status?: { > id?: string, > name?: string, > statusCategory?: { > key?: string, > name?: string > } > }, > assignee?: { > accountId?: string, > displayName?: string, > emailAddress?: string > } | null, > reporter?: { > accountId?: string, > displayName?: string, > emailAddress?: string > }, > priority?: { > id?: string, > name?: string > } | null, > issuetype?: { > id?: string, > name?: string, > subtask?: boolean > }, > project?: { > id?: string, > key?: string, > name?: string > }, > labels?: string[], > updated?: string > } > } > ``` > **user full type** > > ```ts theme={null} > { > accountId?: string, > displayName?: string, > emailAddress?: string > } > ``` > **changelog full type** > > ```ts theme={null} > { > id?: string, > items?: { > field?: string, > fieldtype?: string, > from?: string | null, > fromString?: string | null, > to?: string | null, > toString?: string | null > }[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookEvent: jira:issue_updated, > timestamp?: number, > issue?: { > id?: string, > key?: string, > self?: string, > fields?: { > summary?: string, > status?: { > id?: string, > name?: string, > statusCategory?: { > key?: string, > name?: string > } > }, > assignee?: { > accountId?: string, > displayName?: string, > emailAddress?: string > } | null, > reporter?: { > accountId?: string, > displayName?: string, > emailAddress?: string > }, > priority?: { > id?: string, > name?: string > } | null, > issuetype?: { > id?: string, > name?: string, > subtask?: boolean > }, > project?: { > id?: string, > key?: string, > name?: string > }, > labels?: string[], > updated?: string > } > }, > user?: { > accountId?: string, > displayName?: string, > emailAddress?: string > }, > changelog?: { > id?: string, > items?: { > field?: string, > fieldtype?: string, > from?: string | null, > fromString?: string | null, > to?: string | null, > toString?: string | null > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} jira({ webhookHooks: { issues: { updatedIssue: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Projects ### New Project `projects.newProject` Triggered when a new project is created in Jira **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookEvent` | `project_created` | Yes | — | | `timestamp` | `number` | No | — | | `project` | `object` | No | — | > **project full type** > > ```ts theme={null} > { > id?: string, > key?: string, > name?: string, > description?: string, > projectTypeKey?: string, > lead?: { > accountId?: string, > displayName?: string, > emailAddress?: string > }, > self?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > webhookEvent: project_created, > timestamp?: number, > project?: { > id?: string, > key?: string, > name?: string, > description?: string, > projectTypeKey?: string, > lead?: { > accountId?: string, > displayName?: string, > emailAddress?: string > }, > self?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} jira({ webhookHooks: { projects: { newProject: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/kaggle/api API reference for Kaggle: every `kaggle.api.*` operation with input and output types. Every `kaggle.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Competitions ### downloadFile `competitions.downloadFile` Download a single competition data file (rules acceptance required) **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.competitions.downloadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fileName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `size` | `number` | Yes | — | | `dataBase64` | `string` | Yes | — | | `fileName` | `string` | No | — | *** ### downloadFiles `competitions.downloadFiles` Download all competition data files as a zip (rules acceptance required) **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.competitions.downloadFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `size` | `number` | Yes | — | | `dataBase64` | `string` | Yes | — | | `fileName` | `string` | No | — | *** ### downloadLeaderboard `competitions.downloadLeaderboard` Download the competition leaderboard as a zip/CSV (base64) **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.competitions.downloadLeaderboard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `size` | `number` | Yes | — | | `dataBase64` | `string` | Yes | — | | `fileName` | `string` | No | — | *** ### generateSubmissionUrl `competitions.generateSubmissionUrl` Generate a pre-signed URL and token for uploading a competition submission file **Risk:** `write` ```ts theme={null} await corsair.kaggle.api.competitions.generateSubmissionUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `competitionName` | `string` | Yes | — | | `contentLength` | `number` | Yes | — | | `lastModifiedEpochSeconds` | `number` | Yes | — | | `fileName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `competitions.list` List Kaggle competitions with category, group, sort, and search filters **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.competitions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group` | `string` | No | — | | `category` | `string` | No | — | | `sortBy` | `string` | No | — | | `page` | `number` | No | — | | `search` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > results?: { > }[], > data?: { > }[], > list?: { > }[], > totalResults?: number, > nextPageToken?: string > } | { > } > ``` *** ### listFiles `competitions.listFiles` List data files available for a Kaggle competition **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.competitions.listFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `pageToken` | `string` | No | — | | `pageSize` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > results?: { > }[], > data?: { > }[], > list?: { > }[], > totalResults?: number, > nextPageToken?: string > } | { > } > ``` *** ### submit `competitions.submit` Finalize a competition submission using a previously uploaded blob file token **Risk:** `write` ```ts theme={null} await corsair.kaggle.api.competitions.submit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `blobFileTokens` | `string` | Yes | — | | `submissionDescription` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### viewLeaderboard `competitions.viewLeaderboard` View competition leaderboard rankings and scores **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.competitions.viewLeaderboard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Datasets ### create `datasets.create` Create a new Kaggle dataset (requires prior file upload tokens and owner username in id) **Risk:** `write` ```ts theme={null} await corsair.kaggle.api.datasets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `title` | `string` | Yes | — | | `subtitle` | `string` | No | — | | `description` | `string` | No | — | | `isPrivate` | `boolean` | No | — | | `licenseName` | `string` | No | — | | `files` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createVersion `datasets.createVersion` Create a new version of an existing Kaggle dataset after uploading updated files **Risk:** `write` ```ts theme={null} await corsair.kaggle.api.datasets.createVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `datasetSlug` | `string` | Yes | — | | `versionNotes` | `string` | No | — | | `files` | `object[]` | No | — | > **files full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### download `datasets.download` Download all files from a Kaggle dataset as a zip (returned as base64) **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.datasets.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `datasetSlug` | `string` | Yes | — | | `datasetVersionNumber` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `size` | `number` | Yes | — | | `dataBase64` | `string` | Yes | — | | `fileName` | `string` | No | — | *** ### downloadFile `datasets.downloadFile` Download a single file from a Kaggle dataset (returned as base64) **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.datasets.downloadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `datasetSlug` | `string` | Yes | — | | `fileName` | `string` | Yes | — | | `datasetVersionNumber` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `size` | `number` | Yes | — | | `dataBase64` | `string` | Yes | — | | `fileName` | `string` | No | — | *** ### getMetadata `datasets.getMetadata` Get metadata for a Kaggle dataset including title, licenses, and tags **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.datasets.getMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `datasetSlug` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getStatus `datasets.getStatus` Check processing status after dataset create/version (404 expected when already published) **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.datasets.getStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `datasetSlug` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `datasets.list` List Kaggle datasets with optional search, owner, size, and pagination filters **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.datasets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `user` | `string` | No | — | | `sortBy` | `string` | No | — | | `size` | `string` | No | — | | `fileType` | `string` | No | — | | `licenseName` | `string` | No | — | | `tagIds` | `string` | No | — | | `page` | `number` | No | — | | `maxSize` | `number` | No | — | | `minSize` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > results?: { > }[], > data?: { > }[], > list?: { > }[], > totalResults?: number, > nextPageToken?: string > } | { > } > ``` *** ### listFiles `datasets.listFiles` List files in a Kaggle dataset with optional version and pagination **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.datasets.listFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `datasetSlug` | `string` | Yes | — | | `datasetVersionNumber` | `number` | No | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > results?: { > }[], > data?: { > }[], > list?: { > }[], > totalResults?: number, > nextPageToken?: string > } | { > } > ``` *** ## Kernels ### downloadOutput `kernels.downloadOutput` Download kernel session output files as base64 (fetches signed GCS URLs from GET /kernels/output) **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.kernels.downloadOutput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `kernelSlug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `files` | `object[]` | Yes | — | | `log` | `string` | No | — | | `nextPageToken` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > contentType: string, > size: number, > dataBase64: string, > fileName?: string > }[] > ``` *** ### getStatus `kernels.getStatus` Get execution status of a Kaggle kernel **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.kernels.getStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `kernelSlug` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `kernels.list` List Kaggle kernels (notebooks/scripts) with filters and pagination **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.kernels.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `search` | `string` | No | — | | `group` | `string` | No | — | | `user` | `string` | No | — | | `language` | `string` | No | — | | `kernelType` | `string` | No | — | | `outputType` | `string` | No | — | | `sortBy` | `string` | No | — | | `dataset` | `string` | No | — | | `competition` | `string` | No | — | | `parentKernel` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > results?: { > }[], > data?: { > }[], > list?: { > }[], > totalResults?: number, > nextPageToken?: string > } | { > } > ``` *** ### listOutputFiles `kernels.listOutputFiles` List output files produced by a kernel run **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.kernels.listOutputFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `kernelSlug` | `string` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > results?: { > }[], > data?: { > }[], > list?: { > }[], > totalResults?: number, > nextPageToken?: string > } | { > } > ``` *** ### pull `kernels.pull` Pull kernel source code and optional metadata from Kaggle **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.kernels.pull({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `kernelSlug` | `string` | Yes | — | | `metadata` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Models ### get `models.get` Get details for a Kaggle model **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.models.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `modelSlug` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getInstance `models.getInstance` Get details for a Kaggle model instance (framework variation) **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.models.getInstance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `modelSlug` | `string` | Yes | — | | `framework` | `string` | Yes | — | | `instanceSlug` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `models.list` List Kaggle models with optional owner, search, and pagination **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.models.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `owner` | `string` | No | — | | `sortBy` | `string` | No | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > results?: { > }[], > data?: { > }[], > list?: { > }[], > totalResults?: number, > nextPageToken?: string > } | { > } > ``` *** ### listInstanceVersionFiles `models.listInstanceVersionFiles` List files for a specific version of a model instance/variation **Risk:** `read` ```ts theme={null} await corsair.kaggle.api.models.listInstanceVersionFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ownerSlug` | `string` | Yes | — | | `modelSlug` | `string` | Yes | — | | `framework` | `string` | Yes | — | | `instanceSlug` | `string` | Yes | — | | `versionNumber` | `number` | Yes | — | | `pageSize` | `number` | No | — | | `pageToken` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > results?: { > }[], > data?: { > }[], > list?: { > }[], > totalResults?: number, > nextPageToken?: string > } | { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/kaggle/database Kaggle local sync: searchable entities, `.search()` filters, and operators. The Kaggle plugin syncs data locally. Use `corsair.kaggle.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Competitions Path: `kaggle.db.competitions.search` ```ts theme={null} const rows = await corsair.kaggle.db.competitions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ref` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Datasets Path: `kaggle.db.datasets.search` ```ts theme={null} const rows = await corsair.kaggle.db.datasets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ref` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Kernels Path: `kaggle.db.kernels.search` ```ts theme={null} const rows = await corsair.kaggle.db.kernels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ref` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Models Path: `kaggle.db.models.search` ```ts theme={null} const rows = await corsair.kaggle.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ref` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/kaggle/overview Data science platform for datasets, notebooks, competitions, and machine learning models. Use **Kaggle** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 25 typed API operations * 4 synced entities (`competitions`, `datasets`, `kernels`, `models`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/kaggle ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/kaggle ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/kaggle ``` ```bash bun theme={null} bun add corsair @corsair-dev/kaggle ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { kaggle } from '@corsair-dev/kaggle'; export const corsair = createCorsair({ plugins: [ kaggle(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} kaggle() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'kaggle', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`competitions.downloadFile`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.kaggle.api.competitions.downloadFile({}); ``` **`competitions.generateSubmissionUrl`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.kaggle.api.competitions.generateSubmissionUrl({}); ``` See the full list on the [API](/plugins/kaggle/api) page. ## Query synced data Synced entities support `tenant.kaggle.db..search()` and `.list()`: `competitions`, `datasets`, `kernels`, `models`. See [Database](/plugins/kaggle/database) for filters and operators. ## What's next > **[API reference](/plugins/kaggle/api)** > > Every `kaggle.api.*` operation with input and output types. > **[Database](/plugins/kaggle/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/keenable/api API reference for Keenable: every `keenable.api.*` operation with input and output types. Every `keenable.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Fetch ### get `fetch.get` Fetch a page as markdown by URL, optionally extracting with a prompt **Risk:** `read` ```ts theme={null} await corsair.keenable.api.fetch.get({ url: 'https://example.com', max_chars: 20000 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `max_chars` | `number` | No | — | | `live` | `boolean` | No | — | | `prompt` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `author` | `string` | No | — | | `published_at` | `string \| number` | No | — | | `content` | `string` | Yes | — | *** ## Search ### post `search.post` Search the web and return ranked results (realtime or pro mode) **Risk:** `read` ```ts theme={null} await corsair.keenable.api.search.post({ query: 'typescript best practices', max_results: 5, published_after: '30d' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `mode` | `realtime \| pro` | No | — | | `site` | `string` | No | — | | `acquired_after` | `string` | No | — | | `acquired_before` | `string` | No | — | | `published_after` | `string` | No | — | | `published_before` | `string` | No | — | | `query_time` | `string` | No | — | | `snippet_max_length` | `number` | No | — | | `max_results` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `mode` | `string` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > title: string, > url: string, > description?: string, > snippet?: string, > published_at?: string, > acquired_at?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/keenable/database Keenable local sync: searchable entities, `.search()` filters, and operators. The Keenable plugin syncs data locally. Use `corsair.keenable.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/keenable/overview Web search and page-fetch API for AI agents, with realtime and deep retrieval modes. Use **Keenable** through Corsair: one client, typed API calls. **What you get:** * 2 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/keenable ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/keenable ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/keenable ``` ```bash bun theme={null} bun add corsair @corsair-dev/keenable ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { keenable } from '@corsair-dev/keenable'; export const corsair = createCorsair({ plugins: [ keenable(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} keenable() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'keenable', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Search the web** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.keenable.api.search.post({ query: 'typescript best practices', max_results: 5 }); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/keenable/api) reference.* See the full list on the [API](/plugins/keenable/api) page. ## What's next > **[API reference](/plugins/keenable/api)** > > Every `keenable.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/kibana/api API reference for Kibana: every `kibana.api.*` operation with input and output types. Every `kibana.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Alerting ### createRule `alerting.createRule` Create a new alerting rule in Kibana **Risk:** `write` ```ts theme={null} await corsair.kibana.api.alerting.createRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `object` | Yes | — | > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `consumer` | `string` | No | — | *** ### deleteRule `alerting.deleteRule` Delete an alerting rule by ID **Risk:** `destructive` ```ts theme={null} await corsair.kibana.api.alerting.deleteRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listRules `alerting.listRules` List alerting rules with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.kibana.api.alerting.listRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search` | `string` | No | — | | `filter` | `string` | No | — | | `sort_field` | `string` | No | — | | `sort_order` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### listRuleTypes `alerting.listRuleTypes` List available alerting rule types **Risk:** `read` ```ts theme={null} await corsair.kibana.api.alerting.listRuleTypes({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `rule_types` | `object[]` | No | — | > **rule\_types full type** > > ```ts theme={null} > { > }[] > ``` *** ## Cases ### create `cases.create` Create a new case in Kibana **Risk:** `write` ```ts theme={null} await corsair.kibana.api.cases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `description` | `string` | Yes | — | | `owner` | `cases \| observability \| securitySolution` | Yes | — | | `connector` | `object` | Yes | — | | `settings` | `object` | Yes | — | | `tags` | `string[]` | Yes | — | | `body` | `object` | No | — | > **connector full type** > > ```ts theme={null} > { > } > ``` > **settings full type** > > ```ts theme={null} > { > syncAlerts: boolean, > extractObservables?: boolean > } > ``` > **body full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | | `status` | `string` | No | — | *** ### list `cases.list` Find and list cases with filters **Risk:** `read` ```ts theme={null} await corsair.kibana.api.cases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `search` | `string` | No | — | | `status` | `string` | No | — | | `severity` | `string` | No | — | | `assignees` | `string \| string[]` | No | — | | `tags` | `string \| string[]` | No | — | | `sortField` | `string` | No | — | | `sortOrder` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `cases` | `object[]` | No | — | > **cases full type** > > ```ts theme={null} > { > }[] > ``` *** ## Connectors ### create `connectors.create` Create a new connector in Kibana **Risk:** `write` ```ts theme={null} await corsair.kibana.api.connectors.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `connector_type_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `config` | `object` | No | — | | `secrets` | `object` | No | — | > **config full type** > > ```ts theme={null} > { > } > ``` > **secrets full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `connector_type_id` | `string` | No | — | | `name` | `string` | No | — | *** ### delete `connectors.delete` Delete a connector by ID **Risk:** `destructive` ```ts theme={null} await corsair.kibana.api.connectors.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `connectors.get` Retrieve a connector by ID **Risk:** `read` ```ts theme={null} await corsair.kibana.api.connectors.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `connector_type_id` | `string` | No | — | | `name` | `string` | No | — | *** ### list `connectors.list` List all connectors in Kibana **Risk:** `read` ```ts theme={null} await corsair.kibana.api.connectors.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### listTypes `connectors.listTypes` List available connector (action) types **Risk:** `read` ```ts theme={null} await corsair.kibana.api.connectors.listTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `feature_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `connector_types` | `object[]` | No | — | > **connector\_types full type** > > ```ts theme={null} > { > }[] > ``` *** ## Dashboards ### create `dashboards.create` Create a new dashboard in Kibana **Risk:** `write` ```ts theme={null} await corsair.kibana.api.dashboards.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `panels` | `object[]` | No | — | | `dashboard_id` | `string` | No | — | > **panels full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | *** ### delete `dashboards.delete` Delete a dashboard by ID **Risk:** `destructive` ```ts theme={null} await corsair.kibana.api.dashboards.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### get `dashboards.get` Retrieve a dashboard by ID **Risk:** `read` ```ts theme={null} await corsair.kibana.api.dashboards.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | *** ### search `dashboards.search` Search dashboards in Kibana **Risk:** `read` ```ts theme={null} await corsair.kibana.api.dashboards.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > page?: number, > per_page?: number > } > ``` *** ### upsert `dashboards.upsert` Create or update a dashboard by ID **Risk:** `write` ```ts theme={null} await corsair.kibana.api.dashboards.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `panels` | `object[]` | No | — | > **panels full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | *** ## Data Views ### create `dataViews.create` Create a new data view in Kibana **Risk:** `write` ```ts theme={null} await corsair.kibana.api.dataViews.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `name` | `string` | No | — | | `id` | `string` | No | — | | `timeFieldName` | `string` | No | — | | `override` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data_view` | `object` | No | — | > **data\_view full type** > > ```ts theme={null} > { > id?: string, > title?: string > } > ``` *** ### get `dataViews.get` Retrieve data view details by ID **Risk:** `read` ```ts theme={null} await corsair.kibana.api.dataViews.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data_view` | `object` | Yes | — | > **data\_view full type** > > ```ts theme={null} > { > id: string, > title: string, > name?: string, > timeFieldName?: string, > sourceFilters?: { > }[] > } > ``` *** ### list `dataViews.list` List all data views in Kibana **Risk:** `read` ```ts theme={null} await corsair.kibana.api.dataViews.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data_view` | `object[]` | No | — | > **data\_view full type** > > ```ts theme={null} > { > }[] > ``` *** ## Detection ### findAlerts `detection.findAlerts` Find and aggregate detection alerts **Risk:** `read` ```ts theme={null} await corsair.kibana.api.detection.findAlerts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `aggs` | `object` | No | — | | `size` | `number` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **aggs full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `hits` | `object` | No | — | | `aggregations` | `object` | No | — | | `took` | `number` | No | — | | `timed_out` | `boolean` | No | — | > **hits full type** > > ```ts theme={null} > { > } > ``` > **aggregations full type** > > ```ts theme={null} > { > } > ``` *** ### findRules `detection.findRules` Find detection engine rules with filters **Risk:** `read` ```ts theme={null} await corsair.kibana.api.detection.findRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `filter` | `string` | No | — | | `sort_field` | `string` | No | — | | `sort_order` | `string` | No | — | | `fields` | `string \| string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ## Fleet ### agentPoliciesList `fleet.agentPoliciesList` List Fleet agent policies with pagination **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.agentPoliciesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `kuery` | `string` | No | — | | `full` | `boolean` | No | — | | `withAgentCount` | `boolean` | No | — | | `showUpgradeable` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `total` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` *** ### agentsSetup `fleet.agentsSetup` Check Fleet agents setup status **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.agentsSetup({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `isReady` | `boolean` | No | — | *** ### agentsVersions `fleet.agentsVersions` List available Fleet agent versions **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.agentsVersions({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `string[]` | No | — | *** ### checkPermissions `fleet.checkPermissions` Check permissions for the Fleet API **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.checkPermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fleetServerSetup` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `error` | `string` | No | — | *** ### enrollmentKeyGet `fleet.enrollmentKeyGet` Retrieve a Fleet enrollment API key by ID **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.enrollmentKeyGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `item` | `object` | No | — | > **item full type** > > ```ts theme={null} > { > } > ``` *** ### enrollmentKeysList `fleet.enrollmentKeysList` List Fleet enrollment API keys **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.enrollmentKeysList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `kuery` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `total` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` *** ### epmCategories `fleet.epmCategories` List Fleet EPM package categories **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.epmCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prerelease` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object[]` | No | — | > **response full type** > > ```ts theme={null} > { > }[] > ``` *** ### epmDataStreams `fleet.epmDataStreams` List Fleet EPM data streams **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.epmDataStreams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `datasetQuery` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data_streams` | `object[]` | No | — | > **data\_streams full type** > > ```ts theme={null} > { > }[] > ``` *** ### epmPackageDetails `fleet.epmPackageDetails` Retrieve details of a Fleet EPM package version **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.epmPackageDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pkgName` | `string` | Yes | — | | `pkgVersion` | `string` | Yes | — | | `full` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > } > ``` *** ### epmPackageFile `fleet.epmPackageFile` Retrieve a file from a Fleet EPM package **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.epmPackageFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pkgName` | `string` | Yes | — | | `pkgVersion` | `string` | Yes | — | | `filePath` | `string` | Yes | — | **Output:** *empty object* *** ### epmPackagesInstalled `fleet.epmPackagesInstalled` List installed Fleet EPM packages **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.epmPackagesInstalled({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nameQuery` | `string` | No | — | | `perPage` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object[]` | No | — | > **response full type** > > ```ts theme={null} > { > }[] > ``` *** ### epmPackagesLimited `fleet.epmPackagesLimited` List Fleet EPM package names only **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.epmPackagesLimited({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `string[]` | No | — | *** ### epmPackagesList `fleet.epmPackagesList` List available Fleet EPM packages **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.epmPackagesList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object[]` | No | — | > **response full type** > > ```ts theme={null} > { > }[] > ``` *** ### epmPackageStats `fleet.epmPackageStats` Retrieve usage statistics for a Fleet package **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.epmPackageStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pkgName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > } > ``` *** ### outputDelete `fleet.outputDelete` Delete a Fleet output by ID **Risk:** `destructive` ```ts theme={null} await corsair.kibana.api.fleet.outputDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `outputId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### packagePoliciesList `fleet.packagePoliciesList` List Fleet package policies with pagination **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.packagePoliciesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `perPage` | `number` | No | — | | `kuery` | `string` | No | — | | `withAgentCount` | `boolean` | No | — | | `showUpgradeable` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `total` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` *** ### proxyDelete `fleet.proxyDelete` Delete a Fleet proxy by ID **Risk:** `destructive` ```ts theme={null} await corsair.kibana.api.fleet.proxyDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `itemId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### serverHostGet `fleet.serverHostGet` Retrieve a Fleet Server host by ID **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.serverHostGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `itemId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `item` | `object` | No | — | > **item full type** > > ```ts theme={null} > { > } > ``` *** ### serverHostsList `fleet.serverHostsList` List Fleet Server hosts **Risk:** `read` ```ts theme={null} await corsair.kibana.api.fleet.serverHostsList({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` *** ## Index ### listIndices `index.listIndices` List indices via Index Management (not in the official OpenAPI spec; disabled on serverless, works where Index Management UI is enabled) **Risk:** `read` ```ts theme={null} await corsair.kibana.api.index.listIndices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `index` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `indices` | `object[]` | No | — | > **indices full type** > > ```ts theme={null} > { > }[] > ``` *** ## Lists ### delete `lists.delete` Delete a value list by ID **Risk:** `destructive` ```ts theme={null} await corsair.kibana.api.lists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `deleteReferences` | `boolean` | No | — | | `ignoreReferences` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Metrics ### get `metrics.get` Retrieve Elasticsearch node metrics **Risk:** `read` ```ts theme={null} await corsair.kibana.api.metrics.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `node_id` | `string` | No | — | | `metric` | `string \| string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nodes` | `object` | No | — | > **nodes full type** > > ```ts theme={null} > { > } > ``` *** ## Osquery ### deleteSavedQuery `osquery.deleteSavedQuery` Delete an Osquery saved query by ID **Risk:** `destructive` ```ts theme={null} await corsair.kibana.api.osquery.deleteSavedQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Reporting ### listJobs `reporting.listJobs` List Kibana reporting jobs (legacy stateful-only API; not in the official OpenAPI spec, 404 on serverless) **Risk:** `read` ```ts theme={null} await corsair.kibana.api.reporting.listJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `jobs` | `object[]` | No | — | | `total` | `number` | No | — | > **jobs full type** > > ```ts theme={null} > { > }[] > ``` *** ## Saved Objects ### create `savedObjects.create` Create a new saved object in Kibana **Risk:** `write` ```ts theme={null} await corsair.kibana.api.savedObjects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `id` | `string` | No | — | | `attributes` | `object` | Yes | — | | `references` | `object[]` | No | — | | `overwrite` | `boolean` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` > **references full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | Yes | — | | `attributes` | `object` | Yes | — | | `references` | `object[]` | No | — | | `updated_at` | `string` | No | — | | `version` | `string` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` > **references full type** > > ```ts theme={null} > { > }[] > ``` *** ### delete `savedObjects.delete` Delete a saved object by type and ID **Risk:** `destructive` ```ts theme={null} await corsair.kibana.api.savedObjects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### find `savedObjects.find` Find saved objects matching search query or type filters **Risk:** `read` ```ts theme={null} await corsair.kibana.api.savedObjects.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string \| string[]` | Yes | — | | `search` | `string` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `sort_field` | `string` | No | — | | `has_reference` | `object` | No | — | > **has\_reference full type** > > ```ts theme={null} > { > type: string, > id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | Yes | — | | `saved_objects` | `object[]` | Yes | — | > **saved\_objects full type** > > ```ts theme={null} > { > id: string, > type: string, > attributes: { > }, > references?: { > }[], > updated_at?: string, > version?: string > }[] > ``` *** ### get `savedObjects.get` Retrieve a specific saved object by type and ID **Risk:** `read` ```ts theme={null} await corsair.kibana.api.savedObjects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | Yes | — | | `attributes` | `object` | Yes | — | | `references` | `object[]` | No | — | | `updated_at` | `string` | No | — | | `version` | `string` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` > **references full type** > > ```ts theme={null} > { > }[] > ``` *** ### update `savedObjects.update` Update attributes of an existing saved object by type and ID **Risk:** `write` ```ts theme={null} await corsair.kibana.api.savedObjects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `id` | `string` | Yes | — | | `attributes` | `object` | Yes | — | | `references` | `object[]` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` > **references full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | Yes | — | | `attributes` | `object` | Yes | — | | `references` | `object[]` | No | — | | `updated_at` | `string` | No | — | | `version` | `string` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` > **references full type** > > ```ts theme={null} > { > }[] > ``` *** ## Security ### entitiesList `security.entitiesList` List Entity Store entities **Risk:** `read` ```ts theme={null} await corsair.kibana.api.security.entitiesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter` | `string` | No | — | | `filterQuery` | `string` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `size` | `number` | No | — | | `searchAfter` | `string` | No | — | | `source` | `string \| string[]` | No | — | | `fields` | `string \| string[]` | No | — | | `sort_field` | `string` | No | — | | `sort_order` | `string` | No | — | | `entity_types` | `string \| string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | No | — | | `total` | `number` | No | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### entityStoreEngines `security.entityStoreEngines` Retrieve Entity Store engines (derived from the entity-store status response; no separate engines endpoint exists in the spec) **Risk:** `read` ```ts theme={null} await corsair.kibana.api.security.entityStoreEngines({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `engines` | `object[]` | No | — | > **engines full type** > > ```ts theme={null} > { > }[] > ``` *** ### entityStoreStatus `security.entityStoreStatus` Retrieve Entity Store status **Risk:** `read` ```ts theme={null} await corsair.kibana.api.security.entityStoreStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_components` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `engines` | `object[]` | No | — | > **engines full type** > > ```ts theme={null} > { > }[] > ``` *** ### listEndpointItems `security.listEndpointItems` List Endpoint exception list items **Risk:** `read` ```ts theme={null} await corsair.kibana.api.security.listEndpointItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `filter` | `string` | No | — | | `sort_field` | `string` | No | — | | `sort_order` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `total` | `number` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ## Status ### get `status.get` Retrieve health and version status of the Kibana instance **Risk:** `read` ```ts theme={null} await corsair.kibana.api.status.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `version` | `object` | No | — | | `status` | `object` | No | — | > **version full type** > > ```ts theme={null} > { > number?: string, > build_hash?: string, > build_number?: number, > build_snapshot?: boolean > } > ``` > **status full type** > > ```ts theme={null} > { > overall?: { > state?: string, > title?: string, > nickname?: string > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/kibana/database Kibana local sync: searchable entities, `.search()` filters, and operators. The Kibana plugin syncs data locally. Use `corsair.kibana.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Data Views Path: `kibana.db.dataViews.search` ```ts theme={null} const rows = await corsair.kibana.db.dataViews.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `timeFieldName` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Saved Objects Path: `kibana.db.savedObjects.search` ```ts theme={null} const rows = await corsair.kibana.db.savedObjects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Spaces Path: `kibana.db.spaces.search` ```ts theme={null} const rows = await corsair.kibana.db.spaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `initials` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/kibana/overview Kibana plugin for Corsair Use **Kibana** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 55 typed API operations * 3 synced entities (`dataViews`, `savedObjects`, `spaces`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/kibana ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/kibana ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/kibana ``` ```bash bun theme={null} bun add corsair @corsair-dev/kibana ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { kibana } from '@corsair-dev/kibana'; export const corsair = createCorsair({ plugins: [ kibana(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} kibana() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'kibana', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`alerting.listRules`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.kibana.api.alerting.listRules({}); ``` **`alerting.createRule`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.kibana.api.alerting.createRule({}); ``` See the full list on the [API](/plugins/kibana/api) page. ## Query synced data Synced entities support `tenant.kibana.db..search()` and `.list()`: `dataViews`, `savedObjects`, `spaces`. See [Database](/plugins/kibana/database) for filters and operators. ## What's next > **[API reference](/plugins/kibana/api)** > > Every `kibana.api.*` operation with input and output types. > **[Database](/plugins/kibana/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/kling/api API reference for Kling: every `kling.api.*` operation with input and output types. Every `kling.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Image Generation ### create `imageGeneration.create` Create a text-to-image or image-to-image task **Risk:** `write` ```ts theme={null} await corsair.kling.api.imageGeneration.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_name` | `kling-v2-1 \| kling-v3` | No | — | | `prompt` | `string` | Yes | — | | `negative_prompt` | `string` | No | — | | `image` | `string` | No | — | | `image_reference` | `subject \| face` | No | — | | `image_fidelity` | `number` | No | — | | `human_fidelity` | `number` | No | — | | `element_list` | `object[]` | No | — | | `resolution` | `1k \| 2k` | No | — | | `n` | `number` | No | — | | `aspect_ratio` | `16:9 \| 9:16 \| 1:1 \| 4:3 \| 3:4 \| 3:2 \| 2:3 \| 21:9` | No | — | | `watermark_info` | `object` | No | — | | `callback_url` | `string` | No | — | | `external_task_id` | `string` | No | — | > **element\_list full type** > > ```ts theme={null} > { > element_id: number > }[] > ``` > **watermark\_info full type** > > ```ts theme={null} > { > enabled: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `imageGeneration.get` Fetch an image generation task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.imageGeneration.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > } > ``` *** ### list `imageGeneration.list` List image generation tasks by page **Risk:** `read` ```ts theme={null} await corsair.kling.api.imageGeneration.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageNum` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ## Image To Video ### create `imageToVideo.create` Create an image-to-video generation task **Risk:** `write` ```ts theme={null} await corsair.kling.api.imageToVideo.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `kling-2.5-turbo \| kling-2.6 \| kling-3.0 \| kling-3.0-turbo` | Yes | — | | `contents` | `object[]` | Yes | — | | `settings` | `object` | No | — | | `options` | `object` | No | — | > **contents full type** > > ```ts theme={null} > { > type: string, > text?: string, > url?: string, > id?: string, > voice_id?: string, > element_id?: string > }[] > ``` > **settings full type** > > ```ts theme={null} > { > resolution?: string, > aspect_ratio?: string, > duration?: number, > audio?: string, > multi_shot?: boolean > } > ``` > **options full type** > > ```ts theme={null} > { > callback_url?: string, > external_task_id?: string, > watermark_info?: { > enabled: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `imageToVideo.get` Fetch an image-to-video task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.imageToVideo.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ### list `imageToVideo.list` List image-to-video and other video tasks by cursor **Risk:** `read` ```ts theme={null} await corsair.kling.api.imageToVideo.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `string \| number` | No | — | | `end_time` | `string \| number` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `filters` | `object[]` | No | — | > **filters full type** > > ```ts theme={null} > { > key: status | product_type, > values: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > result: { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[], > count?: number, > next_cursor?: string, > has_more?: boolean > } > ``` *** ## Lip Sync ### create `lipSync.create` Create a lip-sync task for a detected face **Risk:** `write` ```ts theme={null} await corsair.kling.api.lipSync.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `face_choose` | `object[]` | Yes | — | | `watermark_info` | `object` | No | — | | `callback_url` | `string` | No | — | | `external_task_id` | `string` | No | — | > **face\_choose full type** > > ```ts theme={null} > { > face_id: string, > audio_id?: string, > sound_file?: string, > sound_start_time: number, > sound_end_time: number, > sound_insert_time: number, > sound_volume?: number, > original_audio_volume?: number > }[] > ``` > **watermark\_info full type** > > ```ts theme={null} > { > enabled: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### detectFace `lipSync.detectFace` Identify faces in a video for lip-sync processing **Risk:** `write` ```ts theme={null} await corsair.kling.api.lipSync.detectFace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | No | — | | `video_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > session_id: string, > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > face_data?: { > face_id?: string, > face_image?: string, > start_time?: number, > end_time?: number > }[] > } > ``` *** ### get `lipSync.get` Fetch a lip-sync task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.lipSync.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > } > ``` *** ### list `lipSync.list` List lip-sync tasks by page **Risk:** `read` ```ts theme={null} await corsair.kling.api.lipSync.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageNum` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ## Motion Control ### create `motionControl.create` Create a motion-control task from a motion reference **Risk:** `write` ```ts theme={null} await corsair.kling.api.motionControl.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `kling-2.6 \| kling-3.0` | Yes | — | | `contents` | `object[]` | Yes | — | | `settings` | `object` | Yes | — | | `options` | `object` | No | — | > **contents full type** > > ```ts theme={null} > { > type: string, > text?: string, > url?: string, > id?: string, > voice_id?: string, > element_id?: string > }[] > ``` > **settings full type** > > ```ts theme={null} > { > character_orientation: image | video, > resolution?: string, > aspect_ratio?: string, > duration?: number, > audio?: string, > multi_shot?: boolean > } > ``` > **options full type** > > ```ts theme={null} > { > callback_url?: string, > external_task_id?: string, > watermark_info?: { > enabled: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `motionControl.get` Fetch a motion-control task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.motionControl.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ### list `motionControl.list` List motion-control and other video tasks by cursor **Risk:** `read` ```ts theme={null} await corsair.kling.api.motionControl.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `string \| number` | No | — | | `end_time` | `string \| number` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `filters` | `object[]` | No | — | > **filters full type** > > ```ts theme={null} > { > key: status | product_type, > values: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > result: { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[], > count?: number, > next_cursor?: string, > has_more?: boolean > } > ``` *** ## Multi Image To Image ### create `multiImageToImage.create` Create a multi-image (subject, scene, style) task **Risk:** `write` ```ts theme={null} await corsair.kling.api.multiImageToImage.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_name` | `kling-v2-1` | No | — | | `prompt` | `string` | No | — | | `subject_image_list` | `object[]` | Yes | — | | `scene_image` | `string` | No | — | | `style_image` | `string` | No | — | | `n` | `number` | No | — | | `aspect_ratio` | `16:9 \| 9:16 \| 1:1 \| 4:3 \| 3:4 \| 3:2 \| 2:3 \| 21:9` | No | — | | `watermark_info` | `object` | No | — | | `callback_url` | `string` | No | — | | `external_task_id` | `string` | No | — | > **subject\_image\_list full type** > > ```ts theme={null} > { > subject_image: string > }[] > ``` > **watermark\_info full type** > > ```ts theme={null} > { > enabled: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `multiImageToImage.get` Fetch a multi-image task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.multiImageToImage.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > } > ``` *** ### list `multiImageToImage.list` List multi-image tasks by page **Risk:** `read` ```ts theme={null} await corsair.kling.api.multiImageToImage.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageNum` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ## Omni Image ### create `omniImage.create` Create an omni-image generation task **Risk:** `write` ```ts theme={null} await corsair.kling.api.omniImage.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_name` | `kling-image-o1 \| kling-v3-omni` | No | — | | `prompt` | `string` | Yes | — | | `image_list` | `object[]` | No | — | | `element_list` | `object[]` | No | — | | `resolution` | `1k \| 2k \| 4k` | No | — | | `result_type` | `single \| series` | No | — | | `n` | `number` | No | — | | `series_amount` | `number \| auto` | No | — | | `aspect_ratio` | `16:9 \| 9:16 \| 1:1 \| 4:3 \| 3:4 \| 3:2 \| 2:3 \| 21:9 \| auto` | No | — | | `watermark_info` | `object` | No | — | | `callback_url` | `string` | No | — | | `external_task_id` | `string` | No | — | > **image\_list full type** > > ```ts theme={null} > { > image: string > }[] > ``` > **element\_list full type** > > ```ts theme={null} > { > element_id: number > }[] > ``` > **watermark\_info full type** > > ```ts theme={null} > { > enabled: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `omniImage.get` Fetch an omni-image task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.omniImage.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > } > ``` *** ### list `omniImage.list` List omni-image tasks by page **Risk:** `read` ```ts theme={null} await corsair.kling.api.omniImage.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageNum` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ## Omni Video ### create `omniVideo.create` Create an omni-video generation task **Risk:** `write` ```ts theme={null} await corsair.kling.api.omniVideo.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `kling-3.0-omni \| kling-o1` | Yes | — | | `contents` | `object[]` | Yes | — | | `settings` | `object` | No | — | | `options` | `object` | No | — | > **contents full type** > > ```ts theme={null} > { > type: string, > text?: string, > url?: string, > id?: string, > voice_id?: string, > element_id?: string > }[] > ``` > **settings full type** > > ```ts theme={null} > { > resolution?: string, > aspect_ratio?: string, > duration?: number, > audio?: string, > multi_shot?: boolean > } > ``` > **options full type** > > ```ts theme={null} > { > callback_url?: string, > external_task_id?: string, > watermark_info?: { > enabled: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `omniVideo.get` Fetch an omni-video task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.omniVideo.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ### list `omniVideo.list` List omni-video and other video tasks by cursor **Risk:** `read` ```ts theme={null} await corsair.kling.api.omniVideo.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `string \| number` | No | — | | `end_time` | `string \| number` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `filters` | `object[]` | No | — | > **filters full type** > > ```ts theme={null} > { > key: status | product_type, > values: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > result: { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[], > count?: number, > next_cursor?: string, > has_more?: boolean > } > ``` *** ## Outpainting ### create `outpainting.create` Create an image outpainting (expand) task **Risk:** `write` ```ts theme={null} await corsair.kling.api.outpainting.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image` | `string` | Yes | — | | `up_expansion_ratio` | `number` | Yes | — | | `down_expansion_ratio` | `number` | Yes | — | | `left_expansion_ratio` | `number` | Yes | — | | `right_expansion_ratio` | `number` | Yes | — | | `prompt` | `string` | No | — | | `n` | `number` | No | — | | `watermark_info` | `object` | No | — | | `callback_url` | `string` | No | — | | `external_task_id` | `string` | No | — | > **watermark\_info full type** > > ```ts theme={null} > { > enabled: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `outpainting.get` Fetch an outpainting task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.outpainting.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > } > ``` *** ### list `outpainting.list` List outpainting tasks by page **Risk:** `read` ```ts theme={null} await corsair.kling.api.outpainting.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageNum` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ## Text To Video ### create `textToVideo.create` Create a text-to-video generation task **Risk:** `write` ```ts theme={null} await corsair.kling.api.textToVideo.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `kling-2.5-turbo \| kling-2.6 \| kling-3.0 \| kling-3.0-turbo` | Yes | — | | `prompt` | `string` | Yes | — | | `settings` | `object` | No | — | | `options` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > resolution?: string, > aspect_ratio?: string, > duration?: number, > audio?: string, > multi_shot?: boolean > } > ``` > **options full type** > > ```ts theme={null} > { > callback_url?: string, > external_task_id?: string, > watermark_info?: { > enabled: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `textToVideo.get` Fetch a text-to-video task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.textToVideo.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ### list `textToVideo.list` List text-to-video and other video tasks by cursor **Risk:** `read` ```ts theme={null} await corsair.kling.api.textToVideo.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `string \| number` | No | — | | `end_time` | `string \| number` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `filters` | `object[]` | No | — | > **filters full type** > > ```ts theme={null} > { > key: status | product_type, > values: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > result: { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[], > count?: number, > next_cursor?: string, > has_more?: boolean > } > ``` *** ## Video Effects ### create `videoEffects.create` Create a video effect task from a scene template **Risk:** `write` ```ts theme={null} await corsair.kling.api.videoEffects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effect_scene` | `string` | Yes | — | | `input` | `object` | Yes | — | | `callback_url` | `string` | No | — | | `external_task_id` | `string` | No | — | > **input full type** > > ```ts theme={null} > { > image?: string, > images?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `videoEffects.get` Fetch a video effect task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.videoEffects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > } > ``` *** ### list `videoEffects.list` List video effect tasks by page **Risk:** `read` ```ts theme={null} await corsair.kling.api.videoEffects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageNum` | `number` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ## Virtual Try On ### create `virtualTryOn.create` Create a virtual try-on task for a product and person **Risk:** `write` ```ts theme={null} await corsair.kling.api.virtualTryOn.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contents` | `object[]` | Yes | — | | `settings` | `object` | No | — | | `options` | `object` | No | — | > **contents full type** > > ```ts theme={null} > { > type: product_image | person_image, > url: string > }[] > ``` > **settings full type** > > ```ts theme={null} > { > keep_face?: boolean, > keep_pose?: boolean, > keep_background?: boolean > } > ``` > **options full type** > > ```ts theme={null} > { > callback_url?: string, > external_task_id?: string, > watermark?: { > enabled: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > task_info?: { > external_task_id?: string > } > } > ``` *** ### get `virtualTryOn.get` Fetch a virtual try-on task by id **Risk:** `read` ```ts theme={null} await corsair.kling.api.virtualTryOn.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[] > ``` *** ### list `virtualTryOn.list` List virtual try-on tasks by cursor **Risk:** `read` ```ts theme={null} await corsair.kling.api.virtualTryOn.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `string \| number` | No | — | | `end_time` | `string \| number` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `filters` | `object[]` | No | — | > **filters full type** > > ```ts theme={null} > { > key: status, > values: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `message` | `string` | No | — | | `request_id` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > result: { > id?: string, > task_id?: string, > status?: string, > task_status?: string, > message?: string, > task_status_msg?: string, > create_time?: number, > update_time?: number, > created_at?: number, > updated_at?: number, > external_id?: string, > outputs?: { > type: string, > id?: string, > url?: string, > watermark_url?: string, > duration?: string, > group_id?: string, > mp3_url?: string, > wav_url?: string, > mp3_duration?: string, > wav_duration?: string, > name?: string, > owned_by?: string, > status?: string > }[], > billing?: { > charge_type?: string, > cash_type?: string, > amount?: string, > currency?: string, > package_type?: string, > list_price?: string > }[], > final_unit_deduction?: string, > final_balance_deduction?: { > quota?: string, > list_price?: string > }, > watermark_info?: { > enabled: boolean > }, > task_info?: { > external_task_id?: string > }, > task_result?: { > images?: { > index?: number, > url?: string, > watermark_url?: string > }[], > videos?: { > id?: string, > url?: string, > watermark_url?: string, > duration?: string > }[] > } > }[], > count?: number, > next_cursor?: string, > has_more?: boolean > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/kling/database Kling local sync: searchable entities, `.search()` filters, and operators. The Kling plugin syncs data locally. Use `corsair.kling.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/kling/overview AI image and video generation from the Kling AI open platform. Use **Kling** through Corsair: one client, typed API calls. **What you get:** * 34 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/kling ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/kling ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/kling ``` ```bash bun theme={null} bun add corsair @corsair-dev/kling ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { kling } from '@corsair-dev/kling'; export const corsair = createCorsair({ plugins: [ kling(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} kling() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'kling', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`imageGeneration.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.kling.api.imageGeneration.get({}); ``` **`imageGeneration.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.kling.api.imageGeneration.create({}); ``` See the full list on the [API](/plugins/kling/api) page. ## What's next > **[API reference](/plugins/kling/api)** > > Every `kling.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/leexi/api API reference for Leexi: every `leexi.api.*` operation with input and output types. Every `leexi.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Calls ### get `calls.get` Get a specific call including topics and transcripts with paragraph and word-level timestamps **Risk:** `read` ```ts theme={null} await corsair.leexi.api.calls.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > title?: string | null, > description?: string | null, > created_at?: string | null, > updated_at?: string | null, > performed_at?: string | null, > duration?: number | null, > direction?: string | null, > is_video?: boolean, > locale?: string | null, > source?: string | null, > source_id?: string | null, > visible?: boolean, > leexi_url?: string | null, > recording_url?: string | null, > transcript_url?: string | null, > simple_transcript?: string | null, > summary?: string | null, > custom_fields?: { > } | null, > customer_email_addresses?: string[], > customer_phone_numbers?: string[], > audio_archived_at?: string | null, > video_archived_at?: string | null, > transcript_archived_at?: string | null, > completions_archived_at?: string | null, > owner?: { > uuid: string, > name?: string | null, > email?: string | null > } | null, > participating_users?: { > uuid: string, > name?: string | null, > email?: string | null > }[], > customers?: { > uuid: string, > name?: string | null, > email?: string | null, > phone_number?: string | null > }[], > speakers?: { > uuid: string, > name?: string | null, > index?: number, > is_user?: boolean, > email_address?: string | null, > phone_number?: string | null, > duration?: number | null, > longest_monologue?: number | null > }[], > chapters?: { > uuid: string, > index?: number, > title?: string | null, > text?: string | null, > start_time?: number | null > }[], > prompts?: { > uuid: string, > category?: string | null, > title?: string | null, > completions?: string[] > }[], > tasks?: { > uuid: string, > subject?: string | null, > description?: string | null, > done?: boolean, > active?: boolean, > created_at?: string | null, > updated_at?: string | null, > speaker?: { > uuid: string, > name?: string | null, > index?: number, > is_user?: boolean, > email_address?: string | null, > phone_number?: string | null, > duration?: number | null, > longest_monologue?: number | null > } | null, > last_editor?: { > uuid: string, > name?: string | null, > email?: string | null > } | null > }[], > conversation_type?: { > uuid: string, > slug?: string | null, > active?: boolean > } | null, > tags?: { > uuid: string, > name?: string | null, > color?: string | null > }[], > transcript?: { > speaker_index?: number | null, > start_time?: number | null, > end_time?: number | null, > items?: { > content: string, > start_time: number, > end_time: number > }[] > }[], > call_topics?: { > uuid: string, > topic_name?: string | null, > keyphrase?: string | null, > start_time?: number | null, > end_time?: number | null, > speaker?: { > uuid: string, > name?: string | null, > index?: number, > is_user?: boolean, > email_address?: string | null, > phone_number?: string | null, > duration?: number | null, > longest_monologue?: number | null > } | null, > created_at?: string | null, > updated_at?: string | null > }[], > call_ai_topics?: { > uuid: string, > ai_topics?: { > uuid: string, > name?: string | null, > color?: string | null > }[], > sentence?: string | null, > start_time?: number | null, > end_time?: number | null, > speaker?: { > uuid: string, > name?: string | null, > index?: number | null, > is_user?: boolean, > email_address?: string | null, > phone_number?: string | null > } | null, > created_at?: string | null, > updated_at?: string | null > }[], > deal?: { > } | null, > meeting_event?: { > } | null, > feedbacks?: { > }[], > scorecards?: { > }[] > } > ``` *** ### list `calls.list` List call records with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.leexi.api.calls.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `items` | `number` | No | — | | `order` | `created_at desc \| created_at asc \| performed_at desc \| performed_at asc \| updated_at desc \| updated_at asc` | No | — | | `date_filter` | `created_at \| performed_at \| updated_at` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `source` | `string` | No | — | | `source_id` | `string[]` | No | — | | `owner_uuid` | `string[]` | No | — | | `participating_user_uuid` | `string[]` | No | — | | `conversation_type_uuid` | `string` | No | — | | `customer_phone_number` | `string[]` | No | — | | `customer_email_address` | `string[]` | No | — | | `with_simple_transcript` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > title?: string | null, > description?: string | null, > created_at?: string | null, > updated_at?: string | null, > performed_at?: string | null, > duration?: number | null, > direction?: string | null, > is_video?: boolean, > locale?: string | null, > source?: string | null, > source_id?: string | null, > visible?: boolean, > leexi_url?: string | null, > recording_url?: string | null, > transcript_url?: string | null, > simple_transcript?: string | null, > summary?: string | null, > custom_fields?: { > } | null, > customer_email_addresses?: string[], > customer_phone_numbers?: string[], > audio_archived_at?: string | null, > video_archived_at?: string | null, > transcript_archived_at?: string | null, > completions_archived_at?: string | null, > owner?: { > uuid: string, > name?: string | null, > email?: string | null > } | null, > participating_users?: { > uuid: string, > name?: string | null, > email?: string | null > }[], > customers?: { > uuid: string, > name?: string | null, > email?: string | null, > phone_number?: string | null > }[], > speakers?: { > uuid: string, > name?: string | null, > index?: number, > is_user?: boolean, > email_address?: string | null, > phone_number?: string | null, > duration?: number | null, > longest_monologue?: number | null > }[], > chapters?: { > uuid: string, > index?: number, > title?: string | null, > text?: string | null, > start_time?: number | null > }[], > prompts?: { > uuid: string, > category?: string | null, > title?: string | null, > completions?: string[] > }[], > tasks?: { > uuid: string, > subject?: string | null, > description?: string | null, > done?: boolean, > active?: boolean, > created_at?: string | null, > updated_at?: string | null, > speaker?: { > uuid: string, > name?: string | null, > index?: number, > is_user?: boolean, > email_address?: string | null, > phone_number?: string | null, > duration?: number | null, > longest_monologue?: number | null > } | null, > last_editor?: { > uuid: string, > name?: string | null, > email?: string | null > } | null > }[], > conversation_type?: { > uuid: string, > slug?: string | null, > active?: boolean > } | null, > tags?: { > uuid: string, > name?: string | null, > color?: string | null > }[] > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > page: number, > items: number, > count: number, > pages?: number > } > ``` *** ### requestPresignedUrl `calls.requestPresignedUrl` Generate a presigned upload URL for a call recording (expires after 3 days if unused) **Risk:** `write` ```ts theme={null} await corsair.leexi.api.calls.requestPresignedUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `extension` | `.mp4 \| .mkv \| .avi \| .webm \| .mov \| .wmv \| .mpg \| .mpeg \| .m4v \| .mp3 \| .wav \| .aac \| .flac \| .ogg \| .m4a \| .wma \| .opus \| .aiff \| .alac \| .amr \| .ape \| .dts \| .ac3 \| .mid \| .mp2 \| .mpc \| .ra \| .tta \| .vox` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > url: string, > recording_s3_key: string, > headers: { > } > } > ``` *** ## Meeting Events ### create `meetingEvents.create` Create a new meeting event in Leexi with timing, participants, and recording preferences **Risk:** `write` ```ts theme={null} await corsair.leexi.api.meetingEvents.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `meeting_url` | `string` | Yes | — | | `user_uuid` | `string` | Yes | — | | `start_time` | `string` | Yes | — | | `end_time` | `string` | Yes | — | | `owned` | `boolean` | Yes | — | | `internal` | `boolean` | Yes | — | | `to_record` | `boolean` | Yes | — | | `organizer` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `attendees` | `string[]` | No | — | | `direction` | `inbound \| outbound` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > meeting_url?: string | null, > start_time?: string | null, > end_time?: string | null, > owned?: boolean, > internal?: boolean, > to_record?: boolean, > created_at?: string | null, > updated_at?: string | null, > active?: boolean, > bot_scheduled?: boolean, > bot_running?: boolean, > origin?: string | null > } > ``` *** ### delete `meetingEvents.delete` Permanently delete a meeting event by UUID **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.leexi.api.meetingEvents.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### get `meetingEvents.get` Get a specific meeting event by UUID **Risk:** `read` ```ts theme={null} await corsair.leexi.api.meetingEvents.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > title?: string | null, > organizer?: { > email: string > } | null, > attendees?: { > email: string > }[], > meeting_url?: string | null, > meeting_provider?: string | null, > internal?: boolean, > direction?: string | null, > start_time?: string | null, > end_time?: string | null, > description?: string | null, > owned?: boolean, > to_record?: boolean, > bot_scheduled?: boolean, > bot_running?: boolean, > bot_runs?: { > uuid: string, > start_time?: string | null, > end_time?: string | null, > recording_start_time?: string | null, > end_reason?: string | null > }[], > origin?: string | null, > created_at?: string | null, > updated_at?: string | null, > recording_notified?: boolean, > active?: boolean, > integration_user?: { > uuid: string, > name?: string | null, > email?: string | null, > active?: boolean, > user?: { > uuid: string, > name?: string | null, > email?: string | null > } | null, > integration?: { > uuid: string, > name?: string | null, > slug?: string | null, > category?: string | null, > active?: boolean, > url?: string | null, > logo?: string | null > } | null, > calls?: { > uuid: string, > source?: string | null, > source_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > performed_at?: string | null, > locale?: string | null, > duration?: number | null, > direction?: string | null, > is_video?: boolean, > visible?: boolean, > recording_url?: string | null, > transcript_url?: string | null, > leexi_url?: string | null > }[] > } | null > } > ``` *** ### list `meetingEvents.list` List meeting events in the Leexi workspace with pagination **Risk:** `read` ```ts theme={null} await corsair.leexi.api.meetingEvents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `items` | `number` | No | — | | `order` | `created_at desc \| created_at asc \| start_time desc \| start_time asc \| end_time desc \| end_time asc` | No | — | | `origin` | `calendar \| manual \| api` | No | — | | `date_filter` | `start_time \| end_time` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > title?: string | null, > organizer?: { > email: string > } | null, > attendees?: { > email: string > }[], > meeting_url?: string | null, > meeting_provider?: string | null, > internal?: boolean, > direction?: string | null, > start_time?: string | null, > end_time?: string | null, > description?: string | null, > owned?: boolean, > to_record?: boolean, > bot_scheduled?: boolean, > bot_running?: boolean, > bot_runs?: { > uuid: string, > start_time?: string | null, > end_time?: string | null, > recording_start_time?: string | null, > end_reason?: string | null > }[], > origin?: string | null, > created_at?: string | null, > updated_at?: string | null, > recording_notified?: boolean, > active?: boolean > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > page: number, > items: number, > count: number, > pages?: number > } > ``` *** ## Teams ### list `teams.list` List teams in the Leexi workspace with pagination **Risk:** `read` ```ts theme={null} await corsair.leexi.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `items` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > name?: string | null, > active?: boolean, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > page: number, > items: number, > count: number, > pages?: number > } > ``` *** ## Users ### list `users.list` List users in the Leexi workspace with pagination **Risk:** `read` ```ts theme={null} await corsair.leexi.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `items` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > uuid: string, > name?: string | null, > email?: string | null, > active?: boolean, > license?: string | null, > roles?: string[], > team?: { > uuid: string, > name?: string | null, > active?: boolean > } | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > page: number, > items: number, > count: number, > pages?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/leexi/database Leexi local sync: searchable entities, `.search()` filters, and operators. The Leexi plugin syncs data locally. Use `corsair.leexi.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/leexi/overview AI notetaker for calls and meetings — transcribe, analyse, and summarize conversations. Use **Leexi** through Corsair: one client, typed API calls. **What you get:** * 9 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/leexi ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/leexi ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/leexi ``` ```bash bun theme={null} bun add corsair @corsair-dev/leexi ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { leexi } from '@corsair-dev/leexi'; export const corsair = createCorsair({ plugins: [ leexi(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} leexi() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'leexi', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List calls** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.leexi.api.calls.list({}); ``` **Request a presigned upload URL** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.leexi.api.calls.requestPresignedUrl({}); ``` See the full list on the [API](/plugins/leexi/api) page. ## What's next > **[API reference](/plugins/leexi/api)** > > Every `leexi.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/linear/api API reference for Linear: every `linear.api.*` operation with input and output types. Every `linear.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Comments ### create `comments.create` Post a comment on an issue **Risk:** `write` ```ts theme={null} await corsair.linear.api.comments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issueId` | `string` | Yes | — | | `body` | `string` | Yes | — | | `parentId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `string` | Yes | — | | `issue` | `object` | Yes | — | | `user` | `object` | Yes | — | | `parent` | `object` | No | — | | `editedAt` | `Date` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archivedAt` | `Date` | No | — | > **issue full type** > > ```ts theme={null} > { > id: string > } > ``` > **user full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` > **parent full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### delete `comments.delete` Delete a comment **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.linear.api.comments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `boolean` *** ### list `comments.list` List comments on an issue **Risk:** `read` ```ts theme={null} await corsair.linear.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issueId` | `string` | Yes | — | | `first` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nodes` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | > **nodes full type** > > ```ts theme={null} > { > id: string, > body: string, > issue: { > id: string, > title: string, > description?: string | null, > priority: 0 | 1 | 2 | 3 | 4, > estimate?: number | null, > sortOrder: number, > number: number, > identifier: string, > url: string, > state: { > id: string, > name: string, > type: backlog | unstarted | started | completed | canceled, > color: string, > position: number, > description?: string | null, > team: { > id: string, > name: string, > key: string, > description?: string | null, > icon?: string | null, > color?: string | null, > private: boolean, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null > }, > createdAt?: Date | null, > updatedAt?: Date | null > }, > team: { > id: string, > name: string, > key: string, > description?: string | null, > icon?: string | null, > color?: string | null, > private: boolean, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null > }, > assignee?: { > id: string, > name: string, > email?: string | null, > displayName: string, > avatarUrl?: string | null, > active: boolean, > admin: boolean, > createdAt?: Date | null, > updatedAt?: Date | null > } | null, > creator: { > id: string, > name: string, > email?: string | null, > displayName: string, > avatarUrl?: string | null, > active: boolean, > admin: boolean, > createdAt?: Date | null, > updatedAt?: Date | null > }, > project?: { > id: string, > name: string, > description?: string | null, > icon?: string | null, > color?: string | null, > state: backlog | planned | started | paused | completed | canceled, > priority: number, > sortOrder: number, > startDate?: Date | null, > targetDate?: Date | null, > completedAt?: Date | null, > canceledAt?: Date | null, > lead?: { > id: string, > name: string, > email?: string | null, > displayName: string, > avatarUrl?: string | null, > active: boolean, > admin: boolean, > createdAt?: Date | null, > updatedAt?: Date | null > } | null, > teams: { > id: string, > name: string, > key: string, > description?: string | null, > icon?: string | null, > color?: string | null, > private: boolean, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null > }[], > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null > } | null, > cycle?: { > id: string, > number: number, > name?: string | null, > description?: string | null, > startsAt?: Date | null, > endsAt?: Date | null, > completedAt?: Date | null, > team: { > id: string, > name: string, > key: string, > description?: string | null, > icon?: string | null, > color?: string | null, > private: boolean, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null > }, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null > } | null, > labels: { > id: string, > name: string, > description?: string | null, > color: string, > team?: { > id: string, > name: string, > key: string, > description?: string | null, > icon?: string | null, > color?: string | null, > private: boolean, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null > } | null, > createdAt?: Date | null, > updatedAt?: Date | null, > parent: lazy > }[], > subscribers: { > id: string, > name: string, > email?: string | null, > displayName: string, > avatarUrl?: string | null, > active: boolean, > admin: boolean, > createdAt?: Date | null, > updatedAt?: Date | null > }[], > dueDate?: Date | null, > startedAt?: Date | null, > completedAt?: Date | null, > canceledAt?: Date | null, > triagedAt?: Date | null, > snoozedUntilAt?: Date | null, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null, > parent: lazy > }, > user: { > id: string, > name: string, > email?: string | null, > displayName: string, > avatarUrl?: string | null, > active: boolean, > admin: boolean, > createdAt?: Date | null, > updatedAt?: Date | null > }, > editedAt?: Date | null, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null, > parent: lazy > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ### update `comments.update` Update a comment **Risk:** `write` ```ts theme={null} await corsair.linear.api.comments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `input` | `object` | Yes | — | > **input full type** > > ```ts theme={null} > { > body?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `body` | `string` | Yes | — | | `issue` | `object` | Yes | — | | `user` | `object` | Yes | — | | `parent` | `object` | No | — | | `editedAt` | `Date` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archivedAt` | `Date` | No | — | > **issue full type** > > ```ts theme={null} > { > id: string > } > ``` > **user full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` > **parent full type** > > ```ts theme={null} > { > id: string > } > ``` *** ## Issues ### create `issues.create` Create a new issue **Risk:** `write` ```ts theme={null} await corsair.linear.api.issues.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `teamId` | `string` | Yes | — | | `assigneeId` | `string` | No | — | | `priority` | `0 \| 1 \| 2 \| 3 \| 4` | No | — | | `estimate` | `number` | No | — | | `stateId` | `string` | No | — | | `projectId` | `string` | No | — | | `cycleId` | `string` | No | — | | `parentId` | `string` | No | — | | `labelIds` | `string[]` | No | — | | `subscriberIds` | `string[]` | No | — | | `dueDate` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `priority` | `0 \| 1 \| 2 \| 3 \| 4` | No | — | | `estimate` | `number` | No | — | | `sortOrder` | `number` | No | — | | `number` | `number` | No | — | | `identifier` | `string` | No | — | | `url` | `string` | No | — | | `state` | `object` | No | — | | `team` | `object` | No | — | | `assignee` | `object` | No | — | | `creator` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | > **state full type** > > ```ts theme={null} > { > id: string, > name: string, > type: backlog | unstarted | started | completed | canceled, > color?: string, > position?: number > } > ``` > **team full type** > > ```ts theme={null} > { > id: string, > name: string, > key: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` > **creator full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` *** ### delete `issues.delete` Permanently delete an issue \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.linear.api.issues.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `boolean` *** ### get `issues.get` Get a specific issue **Risk:** `read` ```ts theme={null} await corsair.linear.api.issues.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `priority` | `0 \| 1 \| 2 \| 3 \| 4` | Yes | — | | `estimate` | `number` | No | — | | `sortOrder` | `number` | Yes | — | | `number` | `number` | Yes | — | | `identifier` | `string` | Yes | — | | `url` | `string` | Yes | — | | `state` | `object` | Yes | — | | `team` | `object` | Yes | — | | `assignee` | `object` | No | — | | `creator` | `object` | Yes | — | | `project` | `object` | No | — | | `cycle` | `object` | No | — | | `labels` | `object` | No | — | | `subscribers` | `object` | No | — | | `dueDate` | `Date` | No | — | | `startedAt` | `Date` | No | — | | `completedAt` | `Date` | No | — | | `canceledAt` | `Date` | No | — | | `triagedAt` | `Date` | No | — | | `snoozedUntilAt` | `Date` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archivedAt` | `Date` | No | — | | `parent` | `lazy` | Yes | — | > **state full type** > > ```ts theme={null} > { > id: string, > name: string, > type: backlog | unstarted | started | completed | canceled, > color?: string, > position?: number > } > ``` > **team full type** > > ```ts theme={null} > { > id: string, > name: string, > key: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` > **creator full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` > **project full type** > > ```ts theme={null} > { > id: string, > name: string, > state: backlog | planned | started | paused | completed | canceled > } > ``` > **cycle full type** > > ```ts theme={null} > { > id: string, > number: number, > name?: string | null > } > ``` > **labels full type** > > ```ts theme={null} > { > nodes: { > id: string, > name: string, > color: string > }[] > } > ``` > **subscribers full type** > > ```ts theme={null} > { > nodes: { > id: string, > name: string, > displayName: string, > email?: string | null > }[] > } > ``` *** ### list `issues.list` List issues in a team **Risk:** `read` ```ts theme={null} await corsair.linear.api.issues.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | No | — | | `first` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nodes` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | > **nodes full type** > > ```ts theme={null} > { > id: string, > title: string, > description?: string | null, > priority: 0 | 1 | 2 | 3 | 4, > estimate?: number | null, > sortOrder: number, > number: number, > identifier: string, > url: string, > state: { > id: string, > name: string, > type: backlog | unstarted | started | completed | canceled, > color?: string, > position?: number > }, > team: { > id: string, > name: string, > key: string > }, > assignee?: { > id: string, > name: string, > displayName: string, > email?: string | null > } | null, > creator: { > id: string, > name: string, > displayName: string, > email?: string | null > }, > project?: { > id: string, > name: string, > state: backlog | planned | started | paused | completed | canceled > } | null, > cycle?: { > id: string, > number: number, > name?: string | null > } | null, > labels?: { > nodes: { > id: string, > name: string, > color: string > }[] > } | null, > subscribers?: { > nodes: { > id: string, > name: string, > displayName: string, > email?: string | null > }[] > } | null, > dueDate?: Date | null, > startedAt?: Date | null, > completedAt?: Date | null, > canceledAt?: Date | null, > triagedAt?: Date | null, > snoozedUntilAt?: Date | null, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null, > parent: lazy > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ### update `issues.update` Update an existing issue **Risk:** `write` ```ts theme={null} await corsair.linear.api.issues.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `input` | `object` | Yes | — | > **input full type** > > ```ts theme={null} > { > title?: string, > description?: string, > assigneeId?: string, > priority?: 0 | 1 | 2 | 3 | 4, > estimate?: number, > stateId?: string, > projectId?: string, > cycleId?: string, > parentId?: string, > labelIds?: string[], > subscriberIds?: string[], > dueDate?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `priority` | `0 \| 1 \| 2 \| 3 \| 4` | No | — | | `estimate` | `number` | No | — | | `sortOrder` | `number` | No | — | | `number` | `number` | No | — | | `identifier` | `string` | No | — | | `url` | `string` | No | — | | `state` | `object` | No | — | | `team` | `object` | No | — | | `assignee` | `object` | No | — | | `creator` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | > **state full type** > > ```ts theme={null} > { > id: string, > name: string, > type: backlog | unstarted | started | completed | canceled, > color?: string, > position?: number > } > ``` > **team full type** > > ```ts theme={null} > { > id: string, > name: string, > key: string > } > ``` > **assignee full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` > **creator full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` *** ## Projects ### create `projects.create` Create a new project **Risk:** `write` ```ts theme={null} await corsair.linear.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `icon` | `string` | No | — | | `color` | `string` | No | — | | `teamIds` | `string[]` | Yes | — | | `leadId` | `string` | No | — | | `state` | `planned \| started \| paused \| completed \| canceled` | No | — | | `priority` | `number` | No | — | | `startDate` | `string` | No | — | | `targetDate` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `icon` | `string` | No | — | | `color` | `string` | No | — | | `state` | `backlog \| planned \| started \| paused \| completed \| canceled` | Yes | — | | `priority` | `number` | Yes | — | | `sortOrder` | `number` | No | — | | `startDate` | `Date` | No | — | | `targetDate` | `Date` | No | — | | `completedAt` | `Date` | No | — | | `canceledAt` | `Date` | No | — | | `lead` | `object` | No | — | | `teams` | `object` | Yes | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archivedAt` | `Date` | No | — | > **lead full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` > **teams full type** > > ```ts theme={null} > { > nodes: { > id: string, > name: string, > key: string > }[] > } > ``` *** ### delete `projects.delete` Permanently delete a project \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.linear.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `boolean` *** ### get `projects.get` Get a specific project **Risk:** `read` ```ts theme={null} await corsair.linear.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `icon` | `string` | No | — | | `color` | `string` | No | — | | `state` | `backlog \| planned \| started \| paused \| completed \| canceled` | Yes | — | | `priority` | `number` | Yes | — | | `sortOrder` | `number` | Yes | — | | `startDate` | `Date` | No | — | | `targetDate` | `Date` | No | — | | `completedAt` | `Date` | No | — | | `canceledAt` | `Date` | No | — | | `lead` | `object` | No | — | | `teams` | `object` | Yes | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | > **lead full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` > **teams full type** > > ```ts theme={null} > { > nodes: { > id: string, > name: string, > key: string > }[] > } > ``` *** ### list `projects.list` List projects in a team **Risk:** `read` ```ts theme={null} await corsair.linear.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nodes` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | > **nodes full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > icon?: string | null, > color?: string | null, > state: backlog | planned | started | paused | completed | canceled, > priority: number, > sortOrder: number, > startDate?: Date | null, > targetDate?: Date | null, > completedAt?: Date | null, > canceledAt?: Date | null, > lead?: { > id: string, > name: string, > displayName: string, > email?: string | null > } | null, > teams: { > nodes: { > id: string, > name: string, > key: string > }[] > }, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ### update `projects.update` Update an existing project **Risk:** `write` ```ts theme={null} await corsair.linear.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `input` | `object` | Yes | — | > **input full type** > > ```ts theme={null} > { > name?: string, > description?: string, > icon?: string, > color?: string, > teamIds?: string[], > leadId?: string, > state?: planned | started | paused | completed | canceled, > priority?: number, > startDate?: string, > targetDate?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `icon` | `string` | No | — | | `color` | `string` | No | — | | `state` | `backlog \| planned \| started \| paused \| completed \| canceled` | Yes | — | | `priority` | `number` | Yes | — | | `sortOrder` | `number` | No | — | | `startDate` | `Date` | No | — | | `targetDate` | `Date` | No | — | | `completedAt` | `Date` | No | — | | `canceledAt` | `Date` | No | — | | `lead` | `object` | No | — | | `teams` | `object` | No | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archivedAt` | `Date` | No | — | > **lead full type** > > ```ts theme={null} > { > id: string, > name: string, > displayName: string, > email?: string | null > } > ``` > **teams full type** > > ```ts theme={null} > { > nodes: { > id: string, > name: string, > key: string > }[] > } > ``` *** ## Teams ### get `teams.get` Get a specific team **Risk:** `read` ```ts theme={null} await corsair.linear.api.teams.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `key` | `string` | Yes | — | | `description` | `string` | No | — | | `icon` | `string` | No | — | | `color` | `string` | No | — | | `private` | `boolean` | Yes | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | | `archivedAt` | `Date` | No | — | *** ### list `teams.list` List teams in the workspace **Risk:** `read` ```ts theme={null} await corsair.linear.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nodes` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | > **nodes full type** > > ```ts theme={null} > { > id: string, > name: string, > key: string, > description?: string | null, > icon?: string | null, > color?: string | null, > private: boolean, > createdAt?: Date | null, > updatedAt?: Date | null, > archivedAt?: Date | null > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ## Users ### get `users.get` Get a specific user **Risk:** `read` ```ts theme={null} await corsair.linear.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `email` | `string` | No | — | | `displayName` | `string` | Yes | — | | `avatarUrl` | `string` | No | — | | `active` | `boolean` | Yes | — | | `admin` | `boolean` | Yes | — | | `createdAt` | `Date` | No | — | | `updatedAt` | `Date` | No | — | *** ### list `users.list` List users in the workspace **Risk:** `read` ```ts theme={null} await corsair.linear.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `nodes` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | > **nodes full type** > > ```ts theme={null} > { > id: string, > name: string, > email?: string | null, > displayName: string, > avatarUrl?: string | null, > active: boolean, > admin: boolean, > createdAt?: Date | null, > updatedAt?: Date | null > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/linear/database Linear local sync: searchable entities, `.search()` filters, and operators. The Linear plugin syncs data locally. Use `corsair.linear.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Comments Path: `linear.db.comments.search` ```ts theme={null} const rows = await corsair.linear.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `issueId` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `parentId` | `string` | equals, contains, startsWith, endsWith, in | | `editedAt` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `archivedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Issues Path: `linear.db.issues.search` ```ts theme={null} const rows = await corsair.linear.db.issues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `estimate` | `number` | equals, gt, gte, lt, lte, in | | `sortOrder` | `number` | equals, gt, gte, lt, lte, in | | `number` | `number` | equals, gt, gte, lt, lte, in | | `identifier` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `stateId` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | | `assigneeId` | `string` | equals, contains, startsWith, endsWith, in | | `creatorId` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `cycleId` | `string` | equals, contains, startsWith, endsWith, in | | `parentId` | `string` | equals, contains, startsWith, endsWith, in | | `dueDate` | `date` | equals, before, after, between | | `startedAt` | `date` | equals, before, after, between | | `completedAt` | `date` | equals, before, after, between | | `canceledAt` | `date` | equals, before, after, between | | `triagedAt` | `date` | equals, before, after, between | | `snoozedUntilAt` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `archivedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `linear.db.projects.search` ```ts theme={null} const rows = await corsair.linear.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `sortOrder` | `number` | equals, gt, gte, lt, lte, in | | `startDate` | `date` | equals, before, after, between | | `targetDate` | `date` | equals, before, after, between | | `completedAt` | `date` | equals, before, after, between | | `canceledAt` | `date` | equals, before, after, between | | `leadId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `archivedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `linear.db.teams.search` ```ts theme={null} const rows = await corsair.linear.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | | `archivedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `linear.db.users.search` ```ts theme={null} const rows = await corsair.linear.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `avatarUrl` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `admin` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/linear/get-credentials Step-by-step instructions for obtaining Linear API keys and webhook secrets. This guide walks you through obtaining all required credentials for the Linear plugin. ## Authentication Method The Linear plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) - Personal API key authentication ## API Key Setup ### Step 1: Generate API Key 1. Go to [Linear Settings → API](https://linear.app/settings/api) 2. Navigate to the **API** section 3. Under **Personal API keys**, click **Create API key** 4. Give your key a name (e.g., "Corsair Integration") 5. Copy the API key immediately 6. **Important**: Store the key securely - you won't be able to see it again **Storing Credentials:** Store the API key with the Corsair CLI: ```bash theme={null} pnpm corsair setup --plugin=linear api_key=your-api-key ``` Verify it was saved: ```bash theme={null} pnpm corsair auth --plugin=linear --credentials ``` ## Webhook Secret ### Step 1: Create Webhook 1. Go to [Linear Settings → API](https://linear.app/settings/api) 2. Navigate to **Webhooks** section 3. Click **Create Webhook** 4. Configure: * **Label**: Your webhook name * **URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`) * **Resource types**: Select: * Issues * Comments * Projects 5. Click **Create Webhook** 6. After creation, copy the **Signing Secret** shown 7. Store it securely **Storing Credentials:** Store the webhook secret with the CLI: ```bash theme={null} pnpm corsair setup --plugin=linear webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Key | API Key auth | Settings → API → Personal API keys | | Webhook Secret | Webhooks | Settings → API → Webhooks → Signing Secret | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/linear/overview Issue tracking tool for software teams managing projects, cycles, and product roadmaps. Use **Linear** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 18 typed API operations * 5 synced entities (`comments`, `issues`, `projects`, `teams`, `users`) for fast `.search()` / `.list()` * 9 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/linear ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/linear ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/linear ``` ```bash bun theme={null} bun add corsair @corsair-dev/linear ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { linear } from '@corsair-dev/linear'; export const corsair = createCorsair({ plugins: [ linear({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Linear** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/linear/get-credentials). ```ts theme={null} linear({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. Provider walkthrough: [Get Credentials](/plugins/linear/get-credentials). ```ts theme={null} linear() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Linear OAuth app. Provider walkthrough: [Get Credentials](/plugins/linear/get-credentials). ```ts theme={null} linear({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'linear', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List issues** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.linear.api.issues.list({}); ``` **Create an issue** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.linear.api.issues.create({ title: 'Fix bug in login flow', teamId: 'team_123' }); ``` See the full list on the [API](/plugins/linear/api) page. ## Query synced data Search synced issues without hitting Linear. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.linear.db.issues.search({ data: {}, limit: 50, }); ``` Synced entities: `comments`, `issues`, `projects`, `teams`, `users`. See [Database](/plugins/linear/database) for filters and operators. ## Webhooks Fires when a new issue is created in Linear. ```ts theme={null} linear({ webhookHooks: { issues: { create: { after: async (ctx, result) => { console.log('Linear issue created:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/linear/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/linear/api)** > > Every `linear.api.*` operation with input and output types. > **[Database](/plugins/linear/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/linear/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/linear/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/linear/webhooks Linear incoming webhooks: event paths, payloads, and response data. The Linear plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/linear/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `comments` * `create` (`comments.create`) * `remove` (`comments.remove`) * `update` (`comments.update`) * `issues` * `create` (`issues.create`) * `remove` (`issues.remove`) * `update` (`issues.update`) * `projects` * `create` (`projects.create`) * `remove` (`projects.remove`) * `update` (`projects.update`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Comments ### Create `comments.create` A comment was added to an issue **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `create` | Yes | — | | `type` | `Comment` | Yes | — | | `data` | `object` | Yes | — | | `url` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > body: string, > editedAt?: string, > createdAt: string, > updatedAt: string, > issueId: string, > userId: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: create, > type: Comment, > data: { > id: string, > body: string, > editedAt?: string, > createdAt: string, > updatedAt: string, > issueId: string, > userId: string > }, > url: string, > createdAt: string, > organizationId: string, > webhookId: string > } > ``` **`webhookHooks` example** ```ts theme={null} linear({ webhookHooks: { comments: { create: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Remove `comments.remove` A comment was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `remove` | Yes | — | | `type` | `Comment` | Yes | — | | `data` | `object` | Yes | — | | `url` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > body: string, > editedAt?: string, > createdAt: string, > updatedAt: string, > issueId: string, > userId: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: remove, > type: Comment, > data: { > id: string, > body: string, > editedAt?: string, > createdAt: string, > updatedAt: string, > issueId: string, > userId: string > }, > url: string, > createdAt: string, > organizationId: string, > webhookId: string > } > ``` **`webhookHooks` example** ```ts theme={null} linear({ webhookHooks: { comments: { remove: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Update `comments.update` A comment was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `update` | Yes | — | | `type` | `Comment` | Yes | — | | `data` | `object` | Yes | — | | `updatedFrom` | `object` | No | — | | `url` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > body: string, > editedAt?: string, > createdAt: string, > updatedAt: string, > issueId: string, > userId: string > } > ``` > **updatedFrom full type** > > ```ts theme={null} > { > id?: string, > body?: string, > editedAt?: string, > createdAt?: string, > updatedAt?: string, > issueId?: string, > userId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: update, > type: Comment, > data: { > id: string, > body: string, > editedAt?: string, > createdAt: string, > updatedAt: string, > issueId: string, > userId: string > }, > updatedFrom?: { > id?: string, > body?: string, > editedAt?: string, > createdAt?: string, > updatedAt?: string, > issueId?: string, > userId?: string > }, > url: string, > createdAt: string, > organizationId: string, > webhookId: string > } > ``` **`webhookHooks` example** ```ts theme={null} linear({ webhookHooks: { comments: { update: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Issues ### Create `issues.create` A new issue was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `create` | Yes | — | | `type` | `Issue` | Yes | — | | `data` | `object` | Yes | — | | `url` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > identifier: string, > title: string, > description?: string, > priority: 0 | 1 | 2 | 3 | 4, > estimate?: number, > sortOrder: number, > startedAt?: string, > completedAt?: string, > canceledAt?: string, > autoArchivedAt?: string, > autoClosedAt?: string, > dueDate?: string, > trashed?: boolean, > snoozedUntilAt?: string, > previousIdentifiers: string[], > createdAt: string, > updatedAt: string, > branchName: string, > customerTicketCount: number, > stateId: string, > teamId: string, > creatorId: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: create, > type: Issue, > data: { > id: string, > identifier: string, > title: string, > description?: string, > priority: 0 | 1 | 2 | 3 | 4, > estimate?: number, > sortOrder: number, > startedAt?: string, > completedAt?: string, > canceledAt?: string, > autoArchivedAt?: string, > autoClosedAt?: string, > dueDate?: string, > trashed?: boolean, > snoozedUntilAt?: string, > previousIdentifiers: string[], > createdAt: string, > updatedAt: string, > branchName: string, > customerTicketCount: number, > stateId: string, > teamId: string, > creatorId: string > }, > url: string, > createdAt: string, > organizationId: string, > webhookId: string > } > ``` **`webhookHooks` example** ```ts theme={null} linear({ webhookHooks: { issues: { create: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Remove `issues.remove` An issue was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `remove` | Yes | — | | `type` | `Issue` | Yes | — | | `data` | `object` | Yes | — | | `url` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > identifier: string, > title: string, > description?: string, > priority: 0 | 1 | 2 | 3 | 4, > estimate?: number, > sortOrder: number, > startedAt?: string, > completedAt?: string, > canceledAt?: string, > autoArchivedAt?: string, > autoClosedAt?: string, > dueDate?: string, > trashed?: boolean, > snoozedUntilAt?: string, > previousIdentifiers: string[], > createdAt: string, > updatedAt: string, > branchName: string, > customerTicketCount: number, > stateId: string, > teamId: string, > creatorId: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: remove, > type: Issue, > data: { > id: string, > identifier: string, > title: string, > description?: string, > priority: 0 | 1 | 2 | 3 | 4, > estimate?: number, > sortOrder: number, > startedAt?: string, > completedAt?: string, > canceledAt?: string, > autoArchivedAt?: string, > autoClosedAt?: string, > dueDate?: string, > trashed?: boolean, > snoozedUntilAt?: string, > previousIdentifiers: string[], > createdAt: string, > updatedAt: string, > branchName: string, > customerTicketCount: number, > stateId: string, > teamId: string, > creatorId: string > }, > url: string, > createdAt: string, > organizationId: string, > webhookId: string > } > ``` **`webhookHooks` example** ```ts theme={null} linear({ webhookHooks: { issues: { remove: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Update `issues.update` An issue was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `update` | Yes | — | | `type` | `Issue` | Yes | — | | `data` | `object` | Yes | — | | `updatedFrom` | `object` | No | — | | `url` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > identifier: string, > title: string, > description?: string, > priority: 0 | 1 | 2 | 3 | 4, > estimate?: number, > sortOrder: number, > startedAt?: string, > completedAt?: string, > canceledAt?: string, > autoArchivedAt?: string, > autoClosedAt?: string, > dueDate?: string, > trashed?: boolean, > snoozedUntilAt?: string, > previousIdentifiers: string[], > createdAt: string, > updatedAt: string, > branchName: string, > customerTicketCount: number, > stateId: string, > teamId: string, > creatorId: string > } > ``` > **updatedFrom full type** > > ```ts theme={null} > { > id?: string, > identifier?: string, > title?: string, > description?: string, > priority?: 0 | 1 | 2 | 3 | 4, > estimate?: number, > sortOrder?: number, > startedAt?: string, > completedAt?: string, > canceledAt?: string, > autoArchivedAt?: string, > autoClosedAt?: string, > dueDate?: string, > trashed?: boolean, > snoozedUntilAt?: string, > previousIdentifiers?: string[], > createdAt?: string, > updatedAt?: string, > branchName?: string, > customerTicketCount?: number, > stateId?: string, > teamId?: string, > creatorId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: update, > type: Issue, > data: { > id: string, > identifier: string, > title: string, > description?: string, > priority: 0 | 1 | 2 | 3 | 4, > estimate?: number, > sortOrder: number, > startedAt?: string, > completedAt?: string, > canceledAt?: string, > autoArchivedAt?: string, > autoClosedAt?: string, > dueDate?: string, > trashed?: boolean, > snoozedUntilAt?: string, > previousIdentifiers: string[], > createdAt: string, > updatedAt: string, > branchName: string, > customerTicketCount: number, > stateId: string, > teamId: string, > creatorId: string > }, > updatedFrom?: { > id?: string, > identifier?: string, > title?: string, > description?: string, > priority?: 0 | 1 | 2 | 3 | 4, > estimate?: number, > sortOrder?: number, > startedAt?: string, > completedAt?: string, > canceledAt?: string, > autoArchivedAt?: string, > autoClosedAt?: string, > dueDate?: string, > trashed?: boolean, > snoozedUntilAt?: string, > previousIdentifiers?: string[], > createdAt?: string, > updatedAt?: string, > branchName?: string, > customerTicketCount?: number, > stateId?: string, > teamId?: string, > creatorId?: string > }, > url: string, > createdAt: string, > organizationId: string, > webhookId: string > } > ``` **`webhookHooks` example** ```ts theme={null} linear({ webhookHooks: { issues: { update: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Projects ### Create `projects.create` A new project was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `create` | Yes | — | | `type` | `Project` | Yes | — | | `data` | `object` | Yes | — | | `url` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > icon?: string, > color?: string, > priority: 0 | 1 | 2 | 3 | 4, > sortOrder: number, > state: planned | started | paused | completed | canceled, > progress: number, > url: string, > startDate?: string, > targetDate?: string, > completedAt?: string, > canceledAt?: string, > startedAt?: string, > completedScopeHistory: number[], > inProgressScopeHistory: number[], > scope: number, > createdAt: string, > updatedAt: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: create, > type: Project, > data: { > id: string, > name: string, > description?: string, > icon?: string, > color?: string, > priority: 0 | 1 | 2 | 3 | 4, > sortOrder: number, > state: planned | started | paused | completed | canceled, > progress: number, > url: string, > startDate?: string, > targetDate?: string, > completedAt?: string, > canceledAt?: string, > startedAt?: string, > completedScopeHistory: number[], > inProgressScopeHistory: number[], > scope: number, > createdAt: string, > updatedAt: string > }, > url: string, > createdAt: string, > organizationId: string, > webhookId: string > } > ``` **`webhookHooks` example** ```ts theme={null} linear({ webhookHooks: { projects: { create: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Remove `projects.remove` A project was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `remove` | Yes | — | | `type` | `Project` | Yes | — | | `data` | `object` | Yes | — | | `url` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > icon?: string, > color?: string, > priority: 0 | 1 | 2 | 3 | 4, > sortOrder: number, > state: planned | started | paused | completed | canceled, > progress: number, > url: string, > startDate?: string, > targetDate?: string, > completedAt?: string, > canceledAt?: string, > startedAt?: string, > completedScopeHistory: number[], > inProgressScopeHistory: number[], > scope: number, > createdAt: string, > updatedAt: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: remove, > type: Project, > data: { > id: string, > name: string, > description?: string, > icon?: string, > color?: string, > priority: 0 | 1 | 2 | 3 | 4, > sortOrder: number, > state: planned | started | paused | completed | canceled, > progress: number, > url: string, > startDate?: string, > targetDate?: string, > completedAt?: string, > canceledAt?: string, > startedAt?: string, > completedScopeHistory: number[], > inProgressScopeHistory: number[], > scope: number, > createdAt: string, > updatedAt: string > }, > url: string, > createdAt: string, > organizationId: string, > webhookId: string > } > ``` **`webhookHooks` example** ```ts theme={null} linear({ webhookHooks: { projects: { remove: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Update `projects.update` A project was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `update` | Yes | — | | `type` | `Project` | Yes | — | | `data` | `object` | Yes | — | | `updatedFrom` | `object` | No | — | | `url` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `organizationId` | `string` | Yes | — | | `webhookId` | `string` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > icon?: string, > color?: string, > priority: 0 | 1 | 2 | 3 | 4, > sortOrder: number, > state: planned | started | paused | completed | canceled, > progress: number, > url: string, > startDate?: string, > targetDate?: string, > completedAt?: string, > canceledAt?: string, > startedAt?: string, > completedScopeHistory: number[], > inProgressScopeHistory: number[], > scope: number, > createdAt: string, > updatedAt: string > } > ``` > **updatedFrom full type** > > ```ts theme={null} > { > id?: string, > name?: string, > description?: string, > icon?: string, > color?: string, > priority?: 0 | 1 | 2 | 3 | 4, > sortOrder?: number, > state?: planned | started | paused | completed | canceled, > progress?: number, > url?: string, > startDate?: string, > targetDate?: string, > completedAt?: string, > canceledAt?: string, > startedAt?: string, > completedScopeHistory?: number[], > inProgressScopeHistory?: number[], > scope?: number, > createdAt?: string, > updatedAt?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: update, > type: Project, > data: { > id: string, > name: string, > description?: string, > icon?: string, > color?: string, > priority: 0 | 1 | 2 | 3 | 4, > sortOrder: number, > state: planned | started | paused | completed | canceled, > progress: number, > url: string, > startDate?: string, > targetDate?: string, > completedAt?: string, > canceledAt?: string, > startedAt?: string, > completedScopeHistory: number[], > inProgressScopeHistory: number[], > scope: number, > createdAt: string, > updatedAt: string > }, > updatedFrom?: { > id?: string, > name?: string, > description?: string, > icon?: string, > color?: string, > priority?: 0 | 1 | 2 | 3 | 4, > sortOrder?: number, > state?: planned | started | paused | completed | canceled, > progress?: number, > url?: string, > startDate?: string, > targetDate?: string, > completedAt?: string, > canceledAt?: string, > startedAt?: string, > completedScopeHistory?: number[], > inProgressScopeHistory?: number[], > scope?: number, > createdAt?: string, > updatedAt?: string > }, > url: string, > createdAt: string, > organizationId: string, > webhookId: string > } > ``` **`webhookHooks` example** ```ts theme={null} linear({ webhookHooks: { projects: { update: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # Database Source: https://docs.corsair.dev/plugins/linkedin/database LinkedIn local sync: searchable entities, `.search()` filters, and operators. The LinkedIn plugin syncs data locally. Use `corsair.linkedin.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Users Path: `linkedin.db.users.search` ```ts theme={null} const rows = await corsair.linkedin.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `sub` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `given_name` | `string` | equals, contains, startsWith, endsWith, in | | `family_name` | `string` | equals, contains, startsWith, endsWith, in | | `picture` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `locale` | `string` | equals, contains, startsWith, endsWith, in | | `headline` | `string` | equals, contains, startsWith, endsWith, in | | `vanityName` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/linkedin/overview Professional network for profiles, company pages, posts, and B2B social marketing. Use **LinkedIn** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 22 typed API operations * 1 synced entity (`users`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/linkedin ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/linkedin ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/linkedin ``` ```bash bun theme={null} bun add corsair @corsair-dev/linkedin ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { linkedin } from '@corsair-dev/linkedin'; export const corsair = createCorsair({ plugins: [ linkedin(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your LinkedIn OAuth app. ```ts theme={null} linkedin() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'linkedin', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`ads.getAudienceCounts`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.linkedin.api.ads.getAudienceCounts({}); ``` **`comments.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.linkedin.api.comments.create({}); ``` See the full list on the [API](/plugins/linkedin/api) page. ## Query synced data Synced entities support `tenant.linkedin.db..search()` and `.list()`: `users`. See [Database](/plugins/linkedin/database) for filters and operators. ## What's next > **[API reference](/plugins/linkedin/api)** > > Every `linkedin.api.*` operation with input and output types. > **[Database](/plugins/linkedin/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/litescrape/api API reference for LiteScrape: every `litescrape.api.*` operation with input and output types. Every `litescrape.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Apple App Store ### product `appleAppStore.product` Get an Apple App Store product page with version history and privacy labels (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.appleAppStore.product({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | — | | `type` | `app` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `version_history` | `object[]` | No | — | | `ratings_and_reviews` | `object` | No | — | | `privacy` | `object` | No | — | | `information` | `object` | No | — | | `iphone_screenshots` | `object[]` | No | — | | `ipad_screenshots` | `object[]` | No | — | | `featured_in` | `object[]` | No | — | | `more_by_this_developer` | `object[]` | No | — | | `you_may_also_like` | `object[]` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **version\_history full type** > > ```ts theme={null} > { > }[] > ``` > **ratings\_and\_reviews full type** > > ```ts theme={null} > { > } > ``` > **privacy full type** > > ```ts theme={null} > { > } > ``` > **information full type** > > ```ts theme={null} > { > } > ``` > **iphone\_screenshots full type** > > ```ts theme={null} > { > }[] > ``` > **ipad\_screenshots full type** > > ```ts theme={null} > { > }[] > ``` > **featured\_in full type** > > ```ts theme={null} > { > }[] > ``` > **more\_by\_this\_developer full type** > > ```ts theme={null} > { > }[] > ``` > **you\_may\_also\_like full type** > > ```ts theme={null} > { > }[] > ``` *** ### reviews `appleAppStore.reviews` Get Apple App Store reviews, newest or most helpful first (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.appleAppStore.reviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | — | | `sort` | `mostrecent \| mosthelpful` | No | — | | `country` | `string` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `reviews` | `object[]` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **reviews full type** > > ```ts theme={null} > { > position?: number, > rating?: number, > title?: string, > snippet?: string, > text?: string, > date?: string, > author?: string, > reviewer?: string, > likes?: number > }[] > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ### search `appleAppStore.search` Search the Apple App Store for apps with developer, price and rating (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.appleAppStore.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `term` | `string` | Yes | — | | `num` | `number` | No | — | | `disallow_explicit` | `boolean` | No | — | | `property` | `developer` | No | — | | `category_id` | `string` | No | — | | `device` | `mobile \| tablet \| desktop` | No | — | | `country` | `string` | No | — | | `lang` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `organic_results` | `object[]` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **organic\_results full type** > > ```ts theme={null} > { > }[] > ``` *** ## Apple Maps ### places `appleMaps.places` Get Apple Maps places by MUID with address, hours and ratings **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.appleMaps.places({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `muid` | `string` | Yes | — | | `locale` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `place_results` | `object[]` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **place\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` *** ### reviews `appleMaps.reviews` Get Apple Maps rating summary and written reviews by MUID **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.appleMaps.reviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `muid` | `string` | Yes | — | | `locale` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `place_info` | `object` | No | — | | `rating_summary` | `object` | No | — | | `ratings` | `object[]` | No | — | | `reviews` | `object[]` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **place\_info full type** > > ```ts theme={null} > { > } > ``` > **rating\_summary full type** > > ```ts theme={null} > { > } > ``` > **ratings full type** > > ```ts theme={null} > { > }[] > ``` > **reviews full type** > > ```ts theme={null} > { > position?: number, > rating?: number, > title?: string, > snippet?: string, > text?: string, > date?: string, > author?: string, > reviewer?: string, > likes?: number > }[] > ``` *** ## Bing ### maps `bing.maps` Get Bing Maps listings by query or one place by ID **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.bing.maps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `place_id` | `string` | No | — | | `cp` | `string` | No | — | | `setlang` | `string` | No | — | | `first` | `number` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `local_results` | `object[]` | No | — | | `place_results` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **local\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` > **place\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > } > ``` *** ### search `bing.search` Search Bing for organic results, knowledge cards and rich modules **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.bing.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `filters` | `string` | No | — | | `location` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `mkt` | `string` | No | — | | `cc` | `string` | No | — | | `first` | `number` | No | — | | `safeSearch` | `off \| moderate \| strict` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `organic_results` | `object[]` | No | — | | `knowledge_graph` | `object` | No | — | | `knowledge_graph_list` | `object[]` | No | — | | `pagination` | `object` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **organic\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > snippet?: string, > displayed_link?: string, > source?: string, > date?: string > }[] > ``` > **knowledge\_graph full type** > > ```ts theme={null} > { > title?: string, > type?: string, > kgmid?: string, > description?: string > } > ``` > **knowledge\_graph\_list full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ## Duckduckgo ### maps `duckduckgo.maps` Get DuckDuckGo Maps places within a bounding box **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.duckduckgo.maps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `bbox` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `strict_bbox` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `local_results` | `object[]` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **local\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` *** ### search `duckduckgo.search` Search DuckDuckGo for organic results with region and safe-search controls **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.duckduckgo.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `kl` | `string` | No | — | | `safe` | `1 \| -1 \| -2` | No | — | | `df` | `string` | No | — | | `start` | `number` | No | — | | `m` | `number` | No | — | | `search_assist` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `organic_results` | `object[]` | No | — | | `pagination` | `object` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **organic\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > snippet?: string, > displayed_link?: string, > source?: string, > date?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ## Google ### ads `google.ads` Get Google text, local and shopping ads plus the rest of the results page (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.google.ads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | Yes | — | | `hl` | `string` | No | — | | `safe` | `active \| off` | No | — | | `nfpr` | `0 \| 1` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `ads` | `object[]` | No | — | | `local_ads` | `object[]` | No | — | | `shopping_results` | `object[]` | No | — | | `organic_results` | `object[]` | No | — | | `related_questions` | `object[]` | No | — | | `related_searches` | `object[]` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **ads full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > description?: string > }[] > ``` > **local\_ads full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > description?: string > }[] > ``` > **shopping\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > price?: string, > merchant?: string, > rating?: number, > reviews?: number, > thumbnail?: string > }[] > ``` > **organic\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > snippet?: string, > displayed_link?: string, > source?: string, > date?: string > }[] > ``` > **related\_questions full type** > > ```ts theme={null} > { > }[] > ``` > **related\_searches full type** > > ```ts theme={null} > { > title?: string, > value?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** ### aiMode `google.aiMode` Ask Google AI Mode a question and get text blocks with cited references **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.google.aiMode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `uule` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `continuable` | `boolean` | No | — | | `subsequent_request_token` | `string` | No | — | | `image_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `text_blocks` | `object[]` | No | — | | `references` | `object[]` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **text\_blocks full type** > > ```ts theme={null} > { > type?: string, > text?: string > }[] > ``` > **references full type** > > ```ts theme={null} > { > title?: string, > link?: string, > snippet?: string > }[] > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ### aiOverview `google.aiOverview` Get Google's AI Overview for a query as text blocks and cited references **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.google.aiOverview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `ludocid` | `string` | No | — | | `kgmid` | `string` | No | — | | `location` | `string` | No | — | | `uule` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `radius` | `number` | No | — | | `lsig` | `string` | No | — | | `si` | `string` | No | — | | `ibp` | `string` | No | — | | `uds` | `string` | No | — | | `color_scheme` | `light \| dark` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | | `cr` | `string` | No | — | | `lr` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `tbs` | `string` | No | — | | `safe` | `active \| off` | No | — | | `nfpr` | `0 \| 1` | No | — | | `filter` | `0 \| 1` | No | — | | `pws` | `0 \| 1` | No | — | | `peek_pws` | `0 \| 1` | No | — | | `tbm` | `string` | No | — | | `start` | `number` | No | — | | `num` | `number` | No | — | | `as_dt` | `i \| e` | No | — | | `as_epq` | `string` | No | — | | `as_eq` | `string` | No | — | | `as_lq` | `string` | No | — | | `as_nlo` | `number` | No | — | | `as_nhi` | `number` | No | — | | `as_oq` | `string` | No | — | | `as_q` | `string` | No | — | | `as_qdr` | `string` | No | — | | `as_rq` | `string` | No | — | | `as_sitesearch` | `string` | No | — | | `oq` | `string` | No | — | | `gs_lp` | `string` | No | — | | `sclient` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `ai_overview` | `object` | No | — | | `pagination` | `object` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **ai\_overview full type** > > ```ts theme={null} > { > text_blocks?: { > }[], > references?: { > }[] > } > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ### local `google.local` Get Google local results with rating, reviews, category, address and place IDs **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.google.local({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `ludocid` | `string` | No | — | | `tbs` | `string` | No | — | | `start` | `number` | No | — | | `location` | `string` | No | — | | `uule` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `local_results` | `object[]` | No | — | | `local_map` | `object` | No | — | | `discover_more_places` | `object[]` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **local\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` > **local\_map full type** > > ```ts theme={null} > { > } > ``` > **discover\_more\_places full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** ### search `google.search` Search Google for organic results, Knowledge Graph, related searches and the AI Overview **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.google.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fast_mode` | `boolean` | No | — | | `q` | `string` | No | — | | `ludocid` | `string` | No | — | | `kgmid` | `string` | No | — | | `location` | `string` | No | — | | `uule` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `radius` | `number` | No | — | | `lsig` | `string` | No | — | | `si` | `string` | No | — | | `ibp` | `string` | No | — | | `uds` | `string` | No | — | | `color_scheme` | `light \| dark` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | | `cr` | `string` | No | — | | `lr` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `tbs` | `string` | No | — | | `safe` | `active \| off` | No | — | | `nfpr` | `0 \| 1` | No | — | | `filter` | `0 \| 1` | No | — | | `pws` | `0 \| 1` | No | — | | `peek_pws` | `0 \| 1` | No | — | | `tbm` | `string` | No | — | | `start` | `number` | No | — | | `num` | `number` | No | — | | `as_dt` | `i \| e` | No | — | | `as_epq` | `string` | No | — | | `as_eq` | `string` | No | — | | `as_lq` | `string` | No | — | | `as_nlo` | `number` | No | — | | `as_nhi` | `number` | No | — | | `as_oq` | `string` | No | — | | `as_q` | `string` | No | — | | `as_qdr` | `string` | No | — | | `as_rq` | `string` | No | — | | `as_sitesearch` | `string` | No | — | | `oq` | `string` | No | — | | `gs_lp` | `string` | No | — | | `sclient` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `organic_results` | `object[]` | No | — | | `knowledge_graph` | `object` | No | — | | `ai_overview` | `object` | No | — | | `related_questions` | `object[]` | No | — | | `related_searches` | `object[]` | No | — | | `shopping_results` | `object[]` | No | — | | `immersive_products` | `object[]` | No | — | | `perspectives` | `object[]` | No | — | | `pagination` | `object` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **organic\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > snippet?: string, > displayed_link?: string, > source?: string, > date?: string > }[] > ``` > **knowledge\_graph full type** > > ```ts theme={null} > { > title?: string, > type?: string, > kgmid?: string, > description?: string > } > ``` > **ai\_overview full type** > > ```ts theme={null} > { > text_blocks?: { > }[], > references?: { > }[] > } > ``` > **related\_questions full type** > > ```ts theme={null} > { > }[] > ``` > **related\_searches full type** > > ```ts theme={null} > { > title?: string, > value?: string > }[] > ``` > **shopping\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > price?: string, > merchant?: string, > rating?: number, > reviews?: number, > thumbnail?: string > }[] > ``` > **immersive\_products full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > price?: string, > merchant?: string, > rating?: number, > reviews?: number, > thumbnail?: string > }[] > ``` > **perspectives full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ### shopping `google.shopping` Get Google Shopping products with price, merchant, rating and delivery **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.google.shopping({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `shoprs` | `string` | No | — | | `start` | `number` | No | — | | `num` | `number` | No | — | | `min_price` | `number` | No | — | | `max_price` | `number` | No | — | | `sort_by` | `1 \| 2 \| 3` | No | — | | `on_sale` | `boolean` | No | — | | `free_shipping` | `boolean` | No | — | | `small_business` | `boolean` | No | — | | `location` | `string` | No | — | | `uule` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `shopping_results` | `object[]` | No | — | | `categorized_shopping_results` | `object[]` | No | — | | `filters` | `object[]` | No | — | | `carousel_filters` | `object[]` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **shopping\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > price?: string, > merchant?: string, > rating?: number, > reviews?: number, > thumbnail?: string > }[] > ``` > **categorized\_shopping\_results full type** > > ```ts theme={null} > { > }[] > ``` > **filters full type** > > ```ts theme={null} > { > title?: string, > value?: string > }[] > ``` > **carousel\_filters full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** ### shoppingProduct `google.shoppingProduct` Get one Google Shopping product page with every merchant offer and specification **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.google.shoppingProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `gpcid` | `string` | No | — | | `headline_offer_docid` | `string` | No | — | | `image_docid` | `string` | No | — | | `prds` | `string` | No | — | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `uule` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `product_result` | `object` | No | — | | `offers` | `object[]` | No | — | | `related_products` | `object[]` | No | — | | `product_reviews` | `object[]` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **product\_result full type** > > ```ts theme={null} > { > } > ``` > **offers full type** > > ```ts theme={null} > { > }[] > ``` > **related\_products full type** > > ```ts theme={null} > { > }[] > ``` > **product\_reviews full type** > > ```ts theme={null} > { > position?: number, > rating?: number, > title?: string, > snippet?: string, > text?: string, > date?: string, > author?: string, > reviewer?: string, > likes?: number > }[] > ``` *** ## Google Maps ### contributorReviews `googleMaps.contributorReviews` Get the public review history for one Google Maps contributor **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googleMaps.contributorReviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contributor_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `contributor` | `object` | No | — | | `reviews` | `object[]` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **contributor full type** > > ```ts theme={null} > { > } > ``` > **reviews full type** > > ```ts theme={null} > { > position?: number, > rating?: number, > title?: string, > snippet?: string, > text?: string, > date?: string, > author?: string, > reviewer?: string, > likes?: number > }[] > ``` *** ### photoMeta `googleMaps.photoMeta` Get the place, contributor and date of a Google Maps photo **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googleMaps.photoMeta({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_id` | `string` | Yes | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `place_info` | `object` | No | — | | `contributor` | `object` | No | — | | `photo` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **place\_info full type** > > ```ts theme={null} > { > } > ``` > **contributor full type** > > ```ts theme={null} > { > } > ``` > **photo full type** > > ```ts theme={null} > { > } > ``` *** ### popularTimes `googleMaps.popularTimes` See how busy a Google Maps place is right now **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googleMaps.popularTimes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place_id` | `string` | Yes | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `popular_times` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **popular\_times full type** > > ```ts theme={null} > { > } > ``` *** ### posts `googleMaps.posts` Read the posts published by a Google Maps business **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googleMaps.posts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_id` | `string` | Yes | — | | `next_page_token` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `posts` | `object[]` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **posts full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** ### reviews `googleMaps.reviews` Get Google Maps reviews with rating, text, author, date and likes **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googleMaps.reviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place_id` | `string` | No | — | | `data_id` | `string` | No | — | | `sort_by` | `qualityScore \| newestFirst \| ratingHigh \| ratingLow` | No | — | | `topic_id` | `string` | No | — | | `query` | `string` | No | — | | `num` | `number` | No | — | | `next_page_token` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `source_metadata` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `place_info` | `object` | No | — | | `reviews` | `object[]` | No | — | | `topics` | `object[]` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **place\_info full type** > > ```ts theme={null} > { > } > ``` > **reviews full type** > > ```ts theme={null} > { > position?: number, > rating?: number, > title?: string, > snippet?: string, > text?: string, > date?: string, > author?: string, > reviewer?: string, > likes?: number > }[] > ``` > **topics full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** ### search `googleMaps.search` Get Google Maps places by query or one place by ID **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googleMaps.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `type` | `search \| place` | No | — | | `place_id` | `string` | No | — | | `data_cid` | `string` | No | — | | `data` | `string` | No | — | | `ll` | `string` | No | — | | `location` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `z` | `number` | No | — | | `m` | `number` | No | — | | `nearby` | `boolean` | No | — | | `min_price` | `number` | No | — | | `max_price` | `number` | No | — | | `min_rating` | `2.0 \| 2.5 \| 3.0 \| 3.5 \| 4.0 \| 4.5` | No | — | | `open_state` | `now \| 24h` | No | — | | `open_on_day` | `mon \| tue \| wed \| thu \| fri \| sat \| sun` | No | — | | `open_at_hour` | `number` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `google_domain` | `string` | No | — | | `start` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `local_results` | `object[]` | No | — | | `place_results` | `object` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **local\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` > **place\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > } > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** ## Google Play ### apps `googlePlay.apps` Search and browse Google Play apps with charts, categories and storefronts (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googlePlay.apps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `apps_category` | `string` | No | — | | `store_device` | `phone \| tablet \| tv \| chromebook \| watch \| car` | No | — | | `age` | `AGE_RANGE1 \| AGE_RANGE2 \| AGE_RANGE3` | No | — | | `chart` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `next_page_token` | `string` | No | — | | `section_page_token` | `string` | No | — | | `see_more_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `organic_results` | `object[]` | No | — | | `app_highlight` | `object` | No | — | | `items_highlight` | `object` | No | — | | `charts` | `object[]` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **organic\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` > **app\_highlight full type** > > ```ts theme={null} > { > } > ``` > **items\_highlight full type** > > ```ts theme={null} > { > } > ``` > **charts full type** > > ```ts theme={null} > { > }[] > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ### books `googlePlay.books` Browse Google Play ebooks and audiobooks with categories and charts (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googlePlay.books({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `books_category` | `string` | No | — | | `age` | `AGE_RANGE1 \| AGE_RANGE2 \| AGE_RANGE3` | No | — | | `price` | `1 \| 2` | No | — | | `chart` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `next_page_token` | `string` | No | — | | `section_page_token` | `string` | No | — | | `see_more_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `organic_results` | `object[]` | No | — | | `charts` | `object[]` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **organic\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > price?: string, > merchant?: string, > rating?: number, > reviews?: number, > thumbnail?: string > }[] > ``` > **charts full type** > > ```ts theme={null} > { > }[] > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ### games `googlePlay.games` Browse Google Play games by category, chart and device (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googlePlay.games({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `games_category` | `string` | No | — | | `store_device` | `phone \| tablet \| tv \| chromebook \| watch \| windows` | No | — | | `chart` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `next_page_token` | `string` | No | — | | `section_page_token` | `string` | No | — | | `see_more_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `organic_results` | `object[]` | No | — | | `items_highlight` | `object` | No | — | | `charts` | `object[]` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **organic\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` > **items\_highlight full type** > > ```ts theme={null} > { > } > ``` > **charts full type** > > ```ts theme={null} > { > }[] > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ### movies `googlePlay.movies` Browse Google Play movies, shows and episodes with categories and charts (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googlePlay.movies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `movies_category` | `string` | No | — | | `age` | `AGE_RANGE1 \| AGE_RANGE2 \| AGE_RANGE3` | No | — | | `chart` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `next_page_token` | `string` | No | — | | `section_page_token` | `string` | No | — | | `see_more_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `organic_results` | `object[]` | No | — | | `charts` | `object[]` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **organic\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > link?: string, > price?: string, > merchant?: string, > rating?: number, > reviews?: number, > thumbnail?: string > }[] > ``` > **charts full type** > > ```ts theme={null} > { > }[] > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ### product `googlePlay.product` Get a Google Play product page with ratings, permissions, media and reviews (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googlePlay.product({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | — | | `store` | `apps \| books \| audiobooks \| movies \| tv` | No | — | | `season_id` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `product_info` | `object` | No | — | | `about_this_app` | `object` | No | — | | `ratings` | `object` | No | — | | `reviews` | `object[]` | No | — | | `media` | `object` | No | — | | `permissions` | `object[]` | No | — | | `data_safety` | `object` | No | — | | `developer_contact` | `object` | No | — | | `similar_results` | `object[]` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **product\_info full type** > > ```ts theme={null} > { > } > ``` > **about\_this\_app full type** > > ```ts theme={null} > { > } > ``` > **ratings full type** > > ```ts theme={null} > { > } > ``` > **reviews full type** > > ```ts theme={null} > { > position?: number, > rating?: number, > title?: string, > snippet?: string, > text?: string, > date?: string, > author?: string, > reviewer?: string, > likes?: number > }[] > ``` > **media full type** > > ```ts theme={null} > { > } > ``` > **permissions full type** > > ```ts theme={null} > { > }[] > ``` > **data\_safety full type** > > ```ts theme={null} > { > } > ``` > **developer\_contact full type** > > ```ts theme={null} > { > } > ``` > **similar\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` *** ### reviews `googlePlay.reviews` Get Google Play reviews filtered by rating and platform (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.googlePlay.reviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | — | | `store` | `apps \| books \| audiobooks \| movies \| tv` | No | — | | `num` | `number` | No | — | | `platform` | `phone \| tablet \| watch \| chromebook \| tv` | No | — | | `rating` | `number` | No | — | | `sort_by` | `1 \| 2 \| 3` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `next_page_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `reviews` | `object[]` | No | — | | `litescrape_pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **reviews full type** > > ```ts theme={null} > { > position?: number, > rating?: number, > title?: string, > snippet?: string, > text?: string, > date?: string, > author?: string, > reviewer?: string, > likes?: number > }[] > ``` > **litescrape\_pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string > } > ``` *** ## Keys ### status `keys.status` Get LiteScrape key status, remaining calls and concurrency limit **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.keys.status({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `remaining_calls` | `number` | Yes | — | | `concurrency_limit` | `number` | Yes | — | | `status` | `string` | Yes | — | | `zdr_enabled` | `boolean` | No | — | | `zdr_available` | `boolean` | No | — | *** ## Tripadvisor ### place `tripadvisor.place` Get Tripadvisor place details by place ID **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.tripadvisor.place({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place_id` | `number` | Yes | — | | `tripadvisor_domain` | `string` | No | — | | `locale` | `string` | No | — | | `currency` | `string` | No | — | | `geo_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `place_results` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **place\_results full type** > > ```ts theme={null} > { > } > ``` *** ### reviews `tripadvisor.reviews` Get Tripadvisor reviews sorted by recency or relevance **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.tripadvisor.reviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place_id` | `number` | Yes | — | | `tripadvisor_domain` | `string` | No | — | | `locale` | `string` | No | — | | `start` | `number` | No | — | | `num` | `number` | No | — | | `sort_by` | `recent \| relevance` | No | — | | `translate` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `sort` | `object` | No | — | | `reviews` | `object[]` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **sort full type** > > ```ts theme={null} > { > } > ``` > **reviews full type** > > ```ts theme={null} > { > position?: number, > rating?: number, > title?: string, > snippet?: string, > text?: string, > date?: string, > author?: string, > reviewer?: string, > likes?: number > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** ### search `tripadvisor.search` Search Tripadvisor hotels, restaurants and attractions **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.tripadvisor.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `tripadvisor_domain` | `string` | No | — | | `locale` | `string` | No | — | | `geo_id` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `place_type` | `all \| accommodation \| attraction \| attraction_product \| eatery \| geo` | No | — | | `start` | `number` | No | — | | `num` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `search_results` | `object[]` | No | — | | `map_previews` | `object[]` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **search\_results full type** > > ```ts theme={null} > { > }[] > ``` > **map\_previews full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** ## Web ### fetch `web.fetch` Render a public web page and return it as Markdown, HTML or text (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.web.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `respond_with` | `markdown \| html \| text` | No | — | | `target_selector` | `string` | No | — | | `remove_selector` | `string` | No | — | | `retain_links` | `none \| all \| text \| gpt-oss` | No | — | | `retain_images` | `none \| all \| alt` | No | — | | `with_iframe` | `true \| false \| quoted` | No | — | | `with_shadow_dom` | `boolean` | No | — | | `respond_timing` | `html \| visible-content \| mutation-idle \| resource-idle \| media-idle \| network-idle` | No | — | | `wait_for_selector` | `string` | No | — | | `page_timeout` | `number` | No | — | | `timeout` | `number` | No | — | | `locale` | `string` | No | — | | `user_agent` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `content` | `string` | No | — | | `html` | `string` | No | — | | `text` | `string` | No | — | *** ### screenshot `web.screenshot` Capture a web page screenshot as a PNG download URL (Alpha) **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.web.screenshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `full_page` | `boolean` | No | — | | `respond_timing` | `html \| visible-content \| mutation-idle \| resource-idle \| media-idle \| network-idle` | No | — | | `wait_for_selector` | `string` | No | — | | `page_timeout` | `number` | No | — | | `timeout` | `number` | No | — | | `locale` | `string` | No | — | | `user_agent` | `string` | No | — | | `referer` | `string` | No | — | | `remove_overlay` | `boolean` | No | — | | `detach_invisibles` | `boolean` | No | — | | `assert_status_code` | `number` | No | — | | `robots_txt` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `screenshot_url` | `string` | Yes | — | | `full_page` | `boolean` | No | — | *** ## Yelp ### reviews `yelp.reviews` Get Yelp reviews with rating, text, reviewer and owner replies **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.yelp.reviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `place_id` | `string` | Yes | — | | `yelp_domain` | `string` | No | — | | `hl` | `string` | No | — | | `sortby` | `relevance_desc \| date_desc \| date_asc \| rating_desc \| rating_asc \| elites_desc` | No | — | | `rating` | `string` | No | — | | `start` | `number` | No | — | | `num` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `reviews` | `object[]` | No | — | | `review_languages` | `object[]` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **reviews full type** > > ```ts theme={null} > { > position?: number, > rating?: number, > title?: string, > snippet?: string, > text?: string, > date?: string, > author?: string, > reviewer?: string, > likes?: number > }[] > ``` > **review\_languages full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** ### search `yelp.search` Search Yelp businesses with rating, reviews, categories and filters **Risk:** `read` ```ts theme={null} await corsair.litescrape.api.yelp.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `find_desc` | `string` | No | — | | `find_loc` | `string` | Yes | — | | `yelp_domain` | `string` | No | — | | `l` | `string` | No | — | | `cflt` | `string` | No | — | | `sortby` | `recommended \| rating \| review_count` | No | — | | `attrs` | `string` | No | — | | `start` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | No | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `organic_results` | `object[]` | No | — | | `ads_results` | `object[]` | No | — | | `filters` | `object[]` | No | — | | `related_links` | `object[]` | No | — | | `pagination` | `object` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id?: string, > status?: string, > total_time_taken?: number, > google_url?: string, > bing_url?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` > **organic\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` > **ads\_results full type** > > ```ts theme={null} > { > position?: number, > title?: string, > place_id?: string, > data_id?: string, > type?: string, > address?: string, > phone?: string, > website?: string, > rating?: number, > reviews?: number > }[] > ``` > **filters full type** > > ```ts theme={null} > { > title?: string, > value?: string > }[] > ``` > **related\_links full type** > > ```ts theme={null} > { > title?: string, > link?: string, > snippet?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > next?: string, > next_page_token?: string, > page?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/litescrape/database LiteScrape local sync: searchable entities, `.search()` filters, and operators. The LiteScrape plugin syncs data locally. Use `corsair.litescrape.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/litescrape/overview Search, maps, reviews and web-data scraping API (Google, Bing, DuckDuckGo, Apple, Yelp, Tripadvisor and app stores). Use **LiteScrape** through Corsair: one client, typed API calls. **What you get:** * 36 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/litescrape ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/litescrape ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/litescrape ``` ```bash bun theme={null} bun add corsair @corsair-dev/litescrape ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { litescrape } from '@corsair-dev/litescrape'; export const corsair = createCorsair({ plugins: [ litescrape(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} litescrape() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'litescrape', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`appleAppStore.product`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.litescrape.api.appleAppStore.product({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/litescrape/api) reference.* See the full list on the [API](/plugins/litescrape/api) page. ## What's next > **[API reference](/plugins/litescrape/api)** > > Every `litescrape.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/loyverse/api API reference for Loyverse: every `loyverse.api.*` operation with input and output types. Every `loyverse.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Categories ### delete `categories.delete` Delete a category **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.categories.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### get `categories.get` Get a single category **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.categories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `category_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `created_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ### list `categories.list` List categories **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.categories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `categories_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `categories` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **categories full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > color?: string | null, > created_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### upsert `categories.upsert` Create or update a category **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.categories.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `created_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ## Customers ### delete `customers.delete` Delete a customer permanently **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.customers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customer_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### get `customers.get` Get a single customer **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.customers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customer_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `address` | `string` | No | — | | `city` | `string` | No | — | | `region` | `string` | No | — | | `postal_code` | `string` | No | — | | `country_code` | `string` | No | — | | `customer_code` | `string` | No | — | | `note` | `string` | No | — | | `first_visit` | `string` | No | — | | `last_visit` | `string` | No | — | | `total_visits` | `number` | No | — | | `total_spent` | `number` | No | — | | `total_points` | `number` | No | — | | `permanent_deletion_at` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ### list `customers.list` List customers **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.customers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `customer_ids` | `string[]` | No | — | | `email` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `customers` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **customers full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > email?: string | null, > phone_number?: string | null, > address?: string | null, > city?: string | null, > region?: string | null, > postal_code?: string | null, > country_code?: string | null, > customer_code?: string | null, > note?: string | null, > first_visit?: string | null, > last_visit?: string | null, > total_visits?: number | null, > total_spent?: number | null, > total_points?: number | null, > permanent_deletion_at?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### upsert `customers.upsert` Create or update a customer **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.customers.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `address` | `string` | No | — | | `city` | `string` | No | — | | `region` | `string` | No | — | | `postal_code` | `string` | No | — | | `country_code` | `string` | No | — | | `customer_code` | `string` | No | — | | `note` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `address` | `string` | No | — | | `city` | `string` | No | — | | `region` | `string` | No | — | | `postal_code` | `string` | No | — | | `country_code` | `string` | No | — | | `customer_code` | `string` | No | — | | `note` | `string` | No | — | | `first_visit` | `string` | No | — | | `last_visit` | `string` | No | — | | `total_visits` | `number` | No | — | | `total_spent` | `number` | No | — | | `total_points` | `number` | No | — | | `permanent_deletion_at` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ## Discounts ### delete `discounts.delete` Delete a discount **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.discounts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `discount_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### get `discounts.get` Get a single discount **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.discounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `discount_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | No | — | | `name` | `string` | No | — | | `discount_amount` | `number` | No | — | | `discount_percent` | `number` | No | — | | `stores` | `string[]` | No | — | | `restricted_access` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ### list `discounts.list` List discounts **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.discounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `discounts` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **discounts full type** > > ```ts theme={null} > { > id: string, > type?: string | null, > name?: string | null, > discount_amount?: number | null, > discount_percent?: number | null, > stores?: string[] | null, > restricted_access?: boolean | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### listFiltered `discounts.listFiltered` List discounts filtered by id, timestamp range or deleted status **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.discounts.listFiltered({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `discount_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `discounts` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **discounts full type** > > ```ts theme={null} > { > id: string, > type?: string | null, > name?: string | null, > discount_amount?: number | null, > discount_percent?: number | null, > stores?: string[] | null, > restricted_access?: boolean | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### upsert `discounts.upsert` Create or update a discount **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.discounts.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `type` | `FIXED_PERCENT \| FIXED_AMOUNT \| VARIABLE_PERCENT \| VARIABLE_AMOUNT \| DISCOUNT_BY_POINTS` | Yes | — | | `discount_amount` | `number` | No | — | | `discount_percent` | `number` | No | — | | `stores` | `string[]` | No | — | | `restricted_access` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | No | — | | `name` | `string` | No | — | | `discount_amount` | `number` | No | — | | `discount_percent` | `number` | No | — | | `stores` | `string[]` | No | — | | `restricted_access` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ## Employees ### get `employees.get` Get a single employee **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.employees.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `employee_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `stores` | `string[]` | No | — | | `is_owner` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ### list `employees.list` List employees **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.employees.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `employee_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `employees` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **employees full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > email?: string | null, > phone_number?: string | null, > stores?: string[] | null, > is_owner?: boolean | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ## Inventory ### list `inventory.list` List inventory levels **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.inventory.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `store_ids` | `string[]` | No | — | | `variant_ids` | `string[]` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `inventory_levels` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **inventory\_levels full type** > > ```ts theme={null} > { > variant_id?: string | null, > store_id?: string | null, > in_stock?: number | null, > updated_at?: string | null > }[] > ``` *** ### update `inventory.update` Set inventory levels for item variants **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.inventory.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inventory_levels` | `object[]` | Yes | — | > **inventory\_levels full type** > > ```ts theme={null} > { > variant_id: string, > store_id: string, > stock_after: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `inventory_levels` | `object[]` | Yes | — | > **inventory\_levels full type** > > ```ts theme={null} > { > variant_id?: string | null, > store_id?: string | null, > in_stock?: number | null, > updated_at?: string | null > }[] > ``` *** ## Items ### delete `items.delete` Delete an item **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.items.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### deleteImage `items.deleteImage` Delete an item's image **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.items.deleteImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `item_id` | `string` | Yes | — | *** ### get `items.get` Get a single item **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.items.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `handle` | `string` | No | — | | `item_name` | `string` | No | — | | `description` | `string` | No | — | | `reference_id` | `string` | No | — | | `category_id` | `string` | No | — | | `track_stock` | `boolean` | No | — | | `sold_by_weight` | `boolean` | No | — | | `is_composite` | `boolean` | No | — | | `use_production` | `boolean` | No | — | | `components` | `object[]` | No | — | | `primary_supplier_id` | `string` | No | — | | `tax_ids` | `string[]` | No | — | | `modifier_ids` | `string[]` | No | — | | `form` | `string` | No | — | | `color` | `string` | No | — | | `image_url` | `string` | No | — | | `option1_name` | `string` | No | — | | `option2_name` | `string` | No | — | | `option3_name` | `string` | No | — | | `variants` | `object[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | > **components full type** > > ```ts theme={null} > { > variant_id?: string | null, > quantity?: number | null > }[] > ``` > **variants full type** > > ```ts theme={null} > { > variant_id: string, > item_id?: string | null, > sku?: string | null, > reference_variant_id?: string | null, > option1_value?: string | null, > option2_value?: string | null, > option3_value?: string | null, > barcode?: string | null, > cost?: number | null, > purchase_cost?: number | null, > default_pricing_type?: string | null, > default_price?: number | null, > stores?: { > store_id?: string | null, > pricing_type?: string | null, > price?: number | null, > available_for_sale?: boolean | null, > optimal_stock?: number | null, > low_stock?: number | null > }[] | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### list `items.list` List items **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.items.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `items_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > handle?: string | null, > item_name?: string | null, > description?: string | null, > reference_id?: string | null, > category_id?: string | null, > track_stock?: boolean | null, > sold_by_weight?: boolean | null, > is_composite?: boolean | null, > use_production?: boolean | null, > components?: { > variant_id?: string | null, > quantity?: number | null > }[] | null, > primary_supplier_id?: string | null, > tax_ids?: string[] | null, > modifier_ids?: string[] | null, > form?: string | null, > color?: string | null, > image_url?: string | null, > option1_name?: string | null, > option2_name?: string | null, > option3_name?: string | null, > variants?: { > variant_id: string, > item_id?: string | null, > sku?: string | null, > reference_variant_id?: string | null, > option1_value?: string | null, > option2_value?: string | null, > option3_value?: string | null, > barcode?: string | null, > cost?: number | null, > purchase_cost?: number | null, > default_pricing_type?: string | null, > default_price?: number | null, > stores?: { > store_id?: string | null, > pricing_type?: string | null, > price?: number | null, > available_for_sale?: boolean | null, > optimal_stock?: number | null, > low_stock?: number | null > }[] | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### uploadImage `items.uploadImage` Upload an item's image **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.items.uploadImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `image_base64` | `string` | Yes | — | | `media_type` | `image/png \| image/jpeg` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `item_id` | `string` | Yes | — | *** ### upsert `items.upsert` Create or update an item **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.items.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `item_name` | `string` | Yes | — | | `description` | `string` | No | — | | `reference_id` | `string` | No | — | | `category_id` | `string` | No | — | | `track_stock` | `boolean` | No | — | | `sold_by_weight` | `boolean` | No | — | | `is_composite` | `boolean` | No | — | | `use_production` | `boolean` | No | — | | `components` | `object[]` | No | — | | `primary_supplier_id` | `string` | No | — | | `tax_ids` | `string[]` | No | — | | `modifier_ids` | `string[]` | No | — | | `form` | `SQUARE \| CIRCLE \| SUN \| OCTAGON` | No | — | | `color` | `GREY \| RED \| PINK \| ORANGE \| YELLOW \| GREEN \| BLUE \| PURPLE` | No | — | | `option1_name` | `string` | No | — | | `option2_name` | `string` | No | — | | `option3_name` | `string` | No | — | | `variants` | `object[]` | No | — | > **components full type** > > ```ts theme={null} > { > variant_id: string, > quantity: number > }[] > ``` > **variants full type** > > ```ts theme={null} > { > variant_id?: string, > sku?: string, > reference_variant_id?: string | null, > option1_value?: string | null, > option2_value?: string | null, > option3_value?: string | null, > barcode?: string | null, > cost?: number, > purchase_cost?: number | null, > default_pricing_type?: FIXED | VARIABLE, > default_price?: number | null, > stores?: { > store_id: string, > pricing_type?: FIXED | VARIABLE, > price?: number, > available_for_sale?: boolean, > optimal_stock?: number | null, > low_stock?: number | null > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `handle` | `string` | No | — | | `item_name` | `string` | No | — | | `description` | `string` | No | — | | `reference_id` | `string` | No | — | | `category_id` | `string` | No | — | | `track_stock` | `boolean` | No | — | | `sold_by_weight` | `boolean` | No | — | | `is_composite` | `boolean` | No | — | | `use_production` | `boolean` | No | — | | `components` | `object[]` | No | — | | `primary_supplier_id` | `string` | No | — | | `tax_ids` | `string[]` | No | — | | `modifier_ids` | `string[]` | No | — | | `form` | `string` | No | — | | `color` | `string` | No | — | | `image_url` | `string` | No | — | | `option1_name` | `string` | No | — | | `option2_name` | `string` | No | — | | `option3_name` | `string` | No | — | | `variants` | `object[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | > **components full type** > > ```ts theme={null} > { > variant_id?: string | null, > quantity?: number | null > }[] > ``` > **variants full type** > > ```ts theme={null} > { > variant_id: string, > item_id?: string | null, > sku?: string | null, > reference_variant_id?: string | null, > option1_value?: string | null, > option2_value?: string | null, > option3_value?: string | null, > barcode?: string | null, > cost?: number | null, > purchase_cost?: number | null, > default_pricing_type?: string | null, > default_price?: number | null, > stores?: { > store_id?: string | null, > pricing_type?: string | null, > price?: number | null, > available_for_sale?: boolean | null, > optimal_stock?: number | null, > low_stock?: number | null > }[] | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ## Merchant ### get `merchant.get` Get merchant information **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.merchant.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `business_name` | `string` | No | — | | `email` | `string` | No | — | | `country` | `string` | No | — | | `currency` | `object` | No | — | | `created_at` | `string` | No | — | > **currency full type** > > ```ts theme={null} > { > code?: string | null, > decimal_places?: number | null > } > ``` *** ## Modifiers ### delete `modifiers.delete` Delete a modifier **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.modifiers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `modifier_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### get `modifiers.get` Get a single modifier **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.modifiers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `modifier_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `position` | `number` | No | — | | `stores` | `string[]` | No | — | | `modifier_options` | `object[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | > **modifier\_options full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > price?: number | null, > position?: number | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### list `modifiers.list` List modifiers **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.modifiers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `modifier_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `modifiers` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **modifiers full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > position?: number | null, > stores?: string[] | null, > modifier_options?: { > id?: string | null, > name?: string | null, > price?: number | null, > position?: number | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### upsert `modifiers.upsert` Create or update a modifier **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.modifiers.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `position` | `number` | No | — | | `stores` | `string[]` | No | — | | `modifier_options` | `object[]` | Yes | — | > **modifier\_options full type** > > ```ts theme={null} > { > id?: string, > name: string, > price?: number, > position?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `position` | `number` | No | — | | `stores` | `string[]` | No | — | | `modifier_options` | `object[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | > **modifier\_options full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > price?: number | null, > position?: number | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ## Oidc ### discovery `oidc.discovery` Get the OpenID Connect discovery document **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.oidc.discovery({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `issuer` | `string` | No | — | | `authorization_endpoint` | `string` | No | — | | `token_endpoint` | `string` | No | — | | `userinfo_endpoint` | `string` | No | — | | `jwks_uri` | `string` | No | — | | `scopes_supported` | `string[]` | No | — | | `response_types_supported` | `string[]` | No | — | *** ### jwks `oidc.jwks` Get the JSON Web Key Set **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.oidc.jwks({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `keys` | `any[]` | Yes | — | *** ## Payment Types ### get `paymentTypes.get` Get a single payment type **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.paymentTypes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `payment_type_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `stores` | `string[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ### list `paymentTypes.list` List payment types **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.paymentTypes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `payment_type_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `payment_types` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **payment\_types full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > stores?: string[] | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ## Pos Devices ### delete `posDevices.delete` Delete a POS device **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.posDevices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pos_device_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### get `posDevices.get` Get a single POS device **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.posDevices.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pos_device_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `store_id` | `string` | No | — | | `activated` | `boolean` | No | — | | `deleted_at` | `string` | No | — | *** ### list `posDevices.list` List POS devices **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.posDevices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `store_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pos_devices` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **pos\_devices full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > store_id?: string | null, > activated?: boolean | null, > deleted_at?: string | null > }[] > ``` *** ### upsert `posDevices.upsert` Create or update a POS device **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.posDevices.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `store_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `store_id` | `string` | No | — | | `activated` | `boolean` | No | — | | `deleted_at` | `string` | No | — | *** ## Receipts ### create `receipts.create` Record a sale, which cannot be withdrawn once created **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.receipts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `store_id` | `string` | Yes | — | | `employee_id` | `string` | No | — | | `customer_id` | `string` | No | — | | `order` | `string` | No | — | | `source` | `string` | No | — | | `receipt_date` | `string` | No | — | | `note` | `string` | No | — | | `dining_option` | `string` | No | — | | `total_discounts` | `object[]` | No | — | | `line_items` | `object[]` | Yes | — | | `payments` | `object[]` | Yes | — | > **total\_discounts full type** > > ```ts theme={null} > { > id: string > }[] > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: string, > variant_id: string, > quantity: number, > price?: number, > cost?: number, > line_note?: string, > line_taxes?: { > id: string > }[], > line_discounts?: { > id: string > }[], > line_modifiers?: { > modifier_option_id: string, > price?: number > }[] > }[] > ``` > **payments full type** > > ```ts theme={null} > { > payment_type_id: string, > money_amount: number, > paid_at?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_number` | `string` | No | — | | `receipt_type` | `string` | No | — | | `refund_for` | `string` | No | — | | `order` | `string` | No | — | | `note` | `string` | No | — | | `receipt_date` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `cancelled_at` | `string` | No | — | | `source` | `string` | No | — | | `total_money` | `number` | No | — | | `total_tax` | `number` | No | — | | `total_discount` | `number` | No | — | | `points_earned` | `number` | No | — | | `points_deducted` | `number` | No | — | | `points_balance` | `number` | No | — | | `tip` | `number` | No | — | | `surcharge` | `number` | No | — | | `customer_id` | `string` | No | — | | `employee_id` | `string` | No | — | | `store_id` | `string` | No | — | | `pos_device_id` | `string` | No | — | | `dining_option` | `string` | No | — | | `total_discounts` | `object[]` | No | — | | `total_taxes` | `object[]` | No | — | | `line_items` | `object[]` | No | — | | `payments` | `object[]` | No | — | > **total\_discounts full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > rate?: number | null, > money_amount?: number | null > }[] > ``` > **total\_taxes full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > rate?: number | null, > money_amount?: number | null > }[] > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: string | null, > item_id?: string | null, > variant_id?: string | null, > item_name?: string | null, > variant_name?: string | null, > sku?: string | null, > quantity?: number | null, > price?: number | null, > gross_total_money?: number | null, > total_money?: number | null, > cost?: number | null, > cost_total?: number | null, > line_note?: string | null, > total_discount?: number | null, > line_taxes?: { > id?: string | null, > name?: string | null, > type?: string | null, > rate?: number | null, > money_amount?: number | null > }[] | null, > line_discounts?: { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > money_amount?: number | null > }[] | null, > line_modifiers?: { > id?: string | null, > modifier_option_id?: string | null, > name?: string | null, > option?: string | null, > price?: number | null, > money_amount?: number | null > }[] | null > }[] > ``` > **payments full type** > > ```ts theme={null} > { > payment_type_id?: string | null, > name?: string | null, > type?: string | null, > money_amount?: number | null, > paid_at?: string | null, > payment_details?: { > authorization_code?: string | null, > reference_id?: string | null, > entry_method?: string | null, > card_company?: string | null, > card_number?: string | null > } | null > }[] > ``` *** ### get `receipts.get` Get a single receipt **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.receipts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_number` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_number` | `string` | No | — | | `receipt_type` | `string` | No | — | | `refund_for` | `string` | No | — | | `order` | `string` | No | — | | `note` | `string` | No | — | | `receipt_date` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `cancelled_at` | `string` | No | — | | `source` | `string` | No | — | | `total_money` | `number` | No | — | | `total_tax` | `number` | No | — | | `total_discount` | `number` | No | — | | `points_earned` | `number` | No | — | | `points_deducted` | `number` | No | — | | `points_balance` | `number` | No | — | | `tip` | `number` | No | — | | `surcharge` | `number` | No | — | | `customer_id` | `string` | No | — | | `employee_id` | `string` | No | — | | `store_id` | `string` | No | — | | `pos_device_id` | `string` | No | — | | `dining_option` | `string` | No | — | | `total_discounts` | `object[]` | No | — | | `total_taxes` | `object[]` | No | — | | `line_items` | `object[]` | No | — | | `payments` | `object[]` | No | — | > **total\_discounts full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > rate?: number | null, > money_amount?: number | null > }[] > ``` > **total\_taxes full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > rate?: number | null, > money_amount?: number | null > }[] > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: string | null, > item_id?: string | null, > variant_id?: string | null, > item_name?: string | null, > variant_name?: string | null, > sku?: string | null, > quantity?: number | null, > price?: number | null, > gross_total_money?: number | null, > total_money?: number | null, > cost?: number | null, > cost_total?: number | null, > line_note?: string | null, > total_discount?: number | null, > line_taxes?: { > id?: string | null, > name?: string | null, > type?: string | null, > rate?: number | null, > money_amount?: number | null > }[] | null, > line_discounts?: { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > money_amount?: number | null > }[] | null, > line_modifiers?: { > id?: string | null, > modifier_option_id?: string | null, > name?: string | null, > option?: string | null, > price?: number | null, > money_amount?: number | null > }[] | null > }[] > ``` > **payments full type** > > ```ts theme={null} > { > payment_type_id?: string | null, > name?: string | null, > type?: string | null, > money_amount?: number | null, > paid_at?: string | null, > payment_details?: { > authorization_code?: string | null, > reference_id?: string | null, > entry_method?: string | null, > card_company?: string | null, > card_number?: string | null > } | null > }[] > ``` *** ### list `receipts.list` List receipts **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.receipts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `receipt_numbers` | `string[]` | No | — | | `since_receipt_number` | `string` | No | — | | `before_receipt_number` | `string` | No | — | | `store_id` | `string` | No | — | | `order` | `string` | No | — | | `source` | `string` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipts` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **receipts full type** > > ```ts theme={null} > { > receipt_number?: string | null, > receipt_type?: string | null, > refund_for?: string | null, > order?: string | null, > note?: string | null, > receipt_date?: string | null, > created_at?: string | null, > updated_at?: string | null, > cancelled_at?: string | null, > source?: string | null, > total_money?: number | null, > total_tax?: number | null, > total_discount?: number | null, > points_earned?: number | null, > points_deducted?: number | null, > points_balance?: number | null, > tip?: number | null, > surcharge?: number | null, > customer_id?: string | null, > employee_id?: string | null, > store_id?: string | null, > pos_device_id?: string | null, > dining_option?: string | null, > total_discounts?: { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > rate?: number | null, > money_amount?: number | null > }[] | null, > total_taxes?: { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > rate?: number | null, > money_amount?: number | null > }[] | null, > line_items?: { > id?: string | null, > item_id?: string | null, > variant_id?: string | null, > item_name?: string | null, > variant_name?: string | null, > sku?: string | null, > quantity?: number | null, > price?: number | null, > gross_total_money?: number | null, > total_money?: number | null, > cost?: number | null, > cost_total?: number | null, > line_note?: string | null, > total_discount?: number | null, > line_taxes?: { > id?: string | null, > name?: string | null, > type?: string | null, > rate?: number | null, > money_amount?: number | null > }[] | null, > line_discounts?: { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > money_amount?: number | null > }[] | null, > line_modifiers?: { > id?: string | null, > modifier_option_id?: string | null, > name?: string | null, > option?: string | null, > price?: number | null, > money_amount?: number | null > }[] | null > }[] | null, > payments?: { > payment_type_id?: string | null, > name?: string | null, > type?: string | null, > money_amount?: number | null, > paid_at?: string | null, > payment_details?: { > authorization_code?: string | null, > reference_id?: string | null, > entry_method?: string | null, > card_company?: string | null, > card_number?: string | null > } | null > }[] | null > }[] > ``` *** ### refund `receipts.refund` Refund a receipt, which returns money to the customer **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.receipts.refund({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `receipt_number` | `string` | Yes | — | | `store_id` | `string` | Yes | — | | `employee_id` | `string` | No | — | | `note` | `string` | No | — | | `line_items` | `object[]` | Yes | — | | `payments` | `object[]` | Yes | — | > **line\_items full type** > > ```ts theme={null} > { > id: string, > variant_id?: string, > quantity: number, > price?: number > }[] > ``` > **payments full type** > > ```ts theme={null} > { > payment_type_id: string, > money_amount: number, > paid_at?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `receipt_number` | `string` | No | — | | `receipt_type` | `string` | No | — | | `refund_for` | `string` | No | — | | `order` | `string` | No | — | | `note` | `string` | No | — | | `receipt_date` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `cancelled_at` | `string` | No | — | | `source` | `string` | No | — | | `total_money` | `number` | No | — | | `total_tax` | `number` | No | — | | `total_discount` | `number` | No | — | | `points_earned` | `number` | No | — | | `points_deducted` | `number` | No | — | | `points_balance` | `number` | No | — | | `tip` | `number` | No | — | | `surcharge` | `number` | No | — | | `customer_id` | `string` | No | — | | `employee_id` | `string` | No | — | | `store_id` | `string` | No | — | | `pos_device_id` | `string` | No | — | | `dining_option` | `string` | No | — | | `total_discounts` | `object[]` | No | — | | `total_taxes` | `object[]` | No | — | | `line_items` | `object[]` | No | — | | `payments` | `object[]` | No | — | > **total\_discounts full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > rate?: number | null, > money_amount?: number | null > }[] > ``` > **total\_taxes full type** > > ```ts theme={null} > { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > rate?: number | null, > money_amount?: number | null > }[] > ``` > **line\_items full type** > > ```ts theme={null} > { > id?: string | null, > item_id?: string | null, > variant_id?: string | null, > item_name?: string | null, > variant_name?: string | null, > sku?: string | null, > quantity?: number | null, > price?: number | null, > gross_total_money?: number | null, > total_money?: number | null, > cost?: number | null, > cost_total?: number | null, > line_note?: string | null, > total_discount?: number | null, > line_taxes?: { > id?: string | null, > name?: string | null, > type?: string | null, > rate?: number | null, > money_amount?: number | null > }[] | null, > line_discounts?: { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > money_amount?: number | null > }[] | null, > line_modifiers?: { > id?: string | null, > modifier_option_id?: string | null, > name?: string | null, > option?: string | null, > price?: number | null, > money_amount?: number | null > }[] | null > }[] > ``` > **payments full type** > > ```ts theme={null} > { > payment_type_id?: string | null, > name?: string | null, > type?: string | null, > money_amount?: number | null, > paid_at?: string | null, > payment_details?: { > authorization_code?: string | null, > reference_id?: string | null, > entry_method?: string | null, > card_company?: string | null, > card_number?: string | null > } | null > }[] > ``` *** ## Shifts ### list `shifts.list` List shifts **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.shifts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `store_ids` | `string[]` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `shifts` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **shifts full type** > > ```ts theme={null} > { > id?: string | null, > store_id?: string | null, > pos_device_id?: string | null, > opened_at?: string | null, > closed_at?: string | null, > opened_by_employee_id?: string | null, > closed_by_employee_id?: string | null, > starting_cash?: number | null, > cash_payments?: number | null, > cash_refunds?: number | null, > paid_in?: number | null, > paid_out?: number | null, > expected_cash?: number | null, > actual_cash?: number | null, > gross_sales?: number | null, > refunds?: number | null, > discounts?: number | null, > net_sales?: number | null, > tip?: number | null, > surcharge?: number | null, > taxes?: { > id?: string | null, > name?: string | null, > type?: string | null, > percentage?: number | null, > rate?: number | null, > money_amount?: number | null > }[] | null, > payments?: { > payment_type_id?: string | null, > name?: string | null, > type?: string | null, > money_amount?: number | null, > paid_at?: string | null, > payment_details?: { > authorization_code?: string | null, > reference_id?: string | null, > entry_method?: string | null, > card_company?: string | null, > card_number?: string | null > } | null > }[] | null > }[] > ``` *** ## Stores ### get `stores.get` Get a single store **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.stores.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `store_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `address` | `string` | No | — | | `city` | `string` | No | — | | `region` | `string` | No | — | | `state` | `string` | No | — | | `postal_code` | `string` | No | — | | `country_code` | `string` | No | — | | `country` | `string` | No | — | | `phone_number` | `string` | No | — | | `description` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ### list `stores.list` List stores **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.stores.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `store_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `stores` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **stores full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > address?: string | null, > city?: string | null, > region?: string | null, > state?: string | null, > postal_code?: string | null, > country_code?: string | null, > country?: string | null, > phone_number?: string | null, > description?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ## Suppliers ### delete `suppliers.delete` Delete a supplier **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.suppliers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `supplier_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### get `suppliers.get` Get a single supplier **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.suppliers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `supplier_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `contact` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `address_1` | `string` | No | — | | `address_2` | `string` | No | — | | `city` | `string` | No | — | | `region` | `string` | No | — | | `postal_code` | `string` | No | — | | `country_code` | `string` | No | — | | `website` | `string` | No | — | | `note` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ### list `suppliers.list` List suppliers **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.suppliers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `suppliers_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suppliers` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **suppliers full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > contact?: string | null, > email?: string | null, > phone_number?: string | null, > address_1?: string | null, > address_2?: string | null, > city?: string | null, > region?: string | null, > postal_code?: string | null, > country_code?: string | null, > website?: string | null, > note?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### upsert `suppliers.upsert` Create or update a supplier **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.suppliers.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `contact` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `address_1` | `string` | No | — | | `address_2` | `string` | No | — | | `city` | `string` | No | — | | `region` | `string` | No | — | | `postal_code` | `string` | No | — | | `country_code` | `string` | No | — | | `website` | `string` | No | — | | `note` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `contact` | `string` | No | — | | `email` | `string` | No | — | | `phone_number` | `string` | No | — | | `address_1` | `string` | No | — | | `address_2` | `string` | No | — | | `city` | `string` | No | — | | `region` | `string` | No | — | | `postal_code` | `string` | No | — | | `country_code` | `string` | No | — | | `website` | `string` | No | — | | `note` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ## Taxes ### delete `taxes.delete` Delete a tax **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.taxes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tax_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### get `taxes.get` Get a single tax **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.taxes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tax_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `rate` | `number` | No | — | | `stores` | `string[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ### list `taxes.list` List taxes **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.taxes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `tax_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taxes` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **taxes full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > type?: string | null, > rate?: number | null, > stores?: string[] | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### upsert `taxes.upsert` Create or update a tax **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.taxes.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `type` | `INCLUDED \| ADDED` | Yes | — | | `rate` | `number` | Yes | — | | `stores` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `string` | No | — | | `rate` | `number` | No | — | | `stores` | `string[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ## Variants ### delete `variants.delete` Delete an item variant **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.variants.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `variant_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### get `variants.get` Get a single variant **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.variants.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `variant_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `variant_id` | `string` | Yes | — | | `item_id` | `string` | No | — | | `sku` | `string` | No | — | | `reference_variant_id` | `string` | No | — | | `option1_value` | `string` | No | — | | `option2_value` | `string` | No | — | | `option3_value` | `string` | No | — | | `barcode` | `string` | No | — | | `cost` | `number` | No | — | | `purchase_cost` | `number` | No | — | | `default_pricing_type` | `string` | No | — | | `default_price` | `number` | No | — | | `stores` | `object[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | > **stores full type** > > ```ts theme={null} > { > store_id?: string | null, > pricing_type?: string | null, > price?: number | null, > available_for_sale?: boolean | null, > optimal_stock?: number | null, > low_stock?: number | null > }[] > ``` *** ### list `variants.list` List item variants **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.variants.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `show_deleted` | `boolean` | No | — | | `created_at_min` | `string` | No | — | | `created_at_max` | `string` | No | — | | `updated_at_min` | `string` | No | — | | `updated_at_max` | `string` | No | — | | `variants_ids` | `string[]` | No | — | | `items_ids` | `string[]` | No | — | | `sku` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `variants` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **variants full type** > > ```ts theme={null} > { > variant_id: string, > item_id?: string | null, > sku?: string | null, > reference_variant_id?: string | null, > option1_value?: string | null, > option2_value?: string | null, > option3_value?: string | null, > barcode?: string | null, > cost?: number | null, > purchase_cost?: number | null, > default_pricing_type?: string | null, > default_price?: number | null, > stores?: { > store_id?: string | null, > pricing_type?: string | null, > price?: number | null, > available_for_sale?: boolean | null, > optimal_stock?: number | null, > low_stock?: number | null > }[] | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### upsert `variants.upsert` Create or update an item variant **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.variants.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `variant_id` | `string` | No | — | | `item_id` | `string` | No | — | | `sku` | `string` | No | — | | `reference_variant_id` | `string` | No | — | | `option1_value` | `string` | No | — | | `option2_value` | `string` | No | — | | `option3_value` | `string` | No | — | | `barcode` | `string` | No | — | | `cost` | `number` | No | — | | `purchase_cost` | `number` | No | — | | `default_pricing_type` | `FIXED \| VARIABLE` | No | — | | `default_price` | `number` | No | — | | `stores` | `object[]` | No | — | > **stores full type** > > ```ts theme={null} > { > store_id: string, > pricing_type?: FIXED | VARIABLE, > price?: number, > available_for_sale?: boolean, > optimal_stock?: number | null, > low_stock?: number | null > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `variant_id` | `string` | Yes | — | | `item_id` | `string` | No | — | | `sku` | `string` | No | — | | `reference_variant_id` | `string` | No | — | | `option1_value` | `string` | No | — | | `option2_value` | `string` | No | — | | `option3_value` | `string` | No | — | | `barcode` | `string` | No | — | | `cost` | `number` | No | — | | `purchase_cost` | `number` | No | — | | `default_pricing_type` | `string` | No | — | | `default_price` | `number` | No | — | | `stores` | `object[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | > **stores full type** > > ```ts theme={null} > { > store_id?: string | null, > pricing_type?: string | null, > price?: number | null, > available_for_sale?: boolean | null, > optimal_stock?: number | null, > low_stock?: number | null > }[] > ``` *** ## Webhooks ### delete `webhooks.delete` Delete a webhook subscription **Risk:** `destructive` ```ts theme={null} await corsair.loyverse.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted_object_ids` | `string[]` | No | — | *** ### get `webhooks.get` Get a single webhook subscription **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `merchant_id` | `string` | No | — | | `url` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** ### list `webhooks.list` List webhook subscriptions **Risk:** `read` ```ts theme={null} await corsair.loyverse.api.webhooks.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **webhooks full type** > > ```ts theme={null} > { > id?: string | null, > merchant_id?: string | null, > url?: string | null, > type?: string | null, > status?: string | null, > created_at?: string | null, > updated_at?: string | null, > deleted_at?: string | null > }[] > ``` *** ### upsert `webhooks.upsert` Create or update a webhook subscription **Risk:** `write` ```ts theme={null} await corsair.loyverse.api.webhooks.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `url` | `string` | Yes | — | | `type` | `inventory_levels.update \| items.update \| customers.update \| receipts.update \| shifts.create` | Yes | — | | `status` | `ENABLED \| DISABLED` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `merchant_id` | `string` | No | — | | `url` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `deleted_at` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/loyverse/database Loyverse local sync: searchable entities, `.search()` filters, and operators. The Loyverse plugin syncs data locally. Use `corsair.loyverse.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Categories Path: `loyverse.db.categories.search` ```ts theme={null} const rows = await corsair.loyverse.db.categories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Customers Path: `loyverse.db.customers.search` ```ts theme={null} const rows = await corsair.loyverse.db.customers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `postal_code` | `string` | equals, contains, startsWith, endsWith, in | | `country_code` | `string` | equals, contains, startsWith, endsWith, in | | `customer_code` | `string` | equals, contains, startsWith, endsWith, in | | `note` | `string` | equals, contains, startsWith, endsWith, in | | `first_visit` | `string` | equals, contains, startsWith, endsWith, in | | `last_visit` | `string` | equals, contains, startsWith, endsWith, in | | `total_visits` | `number` | equals, gt, gte, lt, lte, in | | `total_spent` | `number` | equals, gt, gte, lt, lte, in | | `total_points` | `number` | equals, gt, gte, lt, lte, in | | `permanent_deletion_at` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Discounts Path: `loyverse.db.discounts.search` ```ts theme={null} const rows = await corsair.loyverse.db.discounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `discount_amount` | `number` | equals, gt, gte, lt, lte, in | | `discount_percent` | `number` | equals, gt, gte, lt, lte, in | | `restricted_access` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Employees Path: `loyverse.db.employees.search` ```ts theme={null} const rows = await corsair.loyverse.db.employees.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `is_owner` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Items Path: `loyverse.db.items.search` ```ts theme={null} const rows = await corsair.loyverse.db.items.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `handle` | `string` | equals, contains, startsWith, endsWith, in | | `item_name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `reference_id` | `string` | equals, contains, startsWith, endsWith, in | | `category_id` | `string` | equals, contains, startsWith, endsWith, in | | `track_stock` | `boolean` | equals | | `sold_by_weight` | `boolean` | equals | | `is_composite` | `boolean` | equals | | `use_production` | `boolean` | equals | | `primary_supplier_id` | `string` | equals, contains, startsWith, endsWith, in | | `form` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `image_url` | `string` | equals, contains, startsWith, endsWith, in | | `option1_name` | `string` | equals, contains, startsWith, endsWith, in | | `option2_name` | `string` | equals, contains, startsWith, endsWith, in | | `option3_name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Merchant Path: `loyverse.db.merchant.search` ```ts theme={null} const rows = await corsair.loyverse.db.merchant.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `business_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Modifiers Path: `loyverse.db.modifiers.search` ```ts theme={null} const rows = await corsair.loyverse.db.modifiers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `position` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payment Types Path: `loyverse.db.paymentTypes.search` ```ts theme={null} const rows = await corsair.loyverse.db.paymentTypes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pos Devices Path: `loyverse.db.posDevices.search` ```ts theme={null} const rows = await corsair.loyverse.db.posDevices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `store_id` | `string` | equals, contains, startsWith, endsWith, in | | `activated` | `boolean` | equals | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Stores Path: `loyverse.db.stores.search` ```ts theme={null} const rows = await corsair.loyverse.db.stores.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `postal_code` | `string` | equals, contains, startsWith, endsWith, in | | `country_code` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Suppliers Path: `loyverse.db.suppliers.search` ```ts theme={null} const rows = await corsair.loyverse.db.suppliers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `contact` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `address_1` | `string` | equals, contains, startsWith, endsWith, in | | `address_2` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `postal_code` | `string` | equals, contains, startsWith, endsWith, in | | `country_code` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `note` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Taxes Path: `loyverse.db.taxes.search` ```ts theme={null} const rows = await corsair.loyverse.db.taxes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `rate` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Variants Path: `loyverse.db.variants.search` ```ts theme={null} const rows = await corsair.loyverse.db.variants.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `variant_id` | `string` | equals, contains, startsWith, endsWith, in | | `item_id` | `string` | equals, contains, startsWith, endsWith, in | | `sku` | `string` | equals, contains, startsWith, endsWith, in | | `reference_variant_id` | `string` | equals, contains, startsWith, endsWith, in | | `option1_value` | `string` | equals, contains, startsWith, endsWith, in | | `option2_value` | `string` | equals, contains, startsWith, endsWith, in | | `option3_value` | `string` | equals, contains, startsWith, endsWith, in | | `barcode` | `string` | equals, contains, startsWith, endsWith, in | | `cost` | `number` | equals, gt, gte, lt, lte, in | | `purchase_cost` | `number` | equals, gt, gte, lt, lte, in | | `default_pricing_type` | `string` | equals, contains, startsWith, endsWith, in | | `default_price` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `deleted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/loyverse/overview Point-of-sale system for retail stores, inventory, receipts, and customer loyalty programs. Use **Loyverse** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 59 typed API operations * 13 synced entities (`categories`, `customers`, `discounts`, `employees`, `items`, `merchant`, and 7 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/loyverse ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/loyverse ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/loyverse ``` ```bash bun theme={null} bun add corsair @corsair-dev/loyverse ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { loyverse } from '@corsair-dev/loyverse'; export const corsair = createCorsair({ plugins: [ loyverse(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Loyverse OAuth app. ```ts theme={null} loyverse() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'loyverse', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`categories.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.loyverse.api.categories.get({}); ``` **`categories.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.loyverse.api.categories.delete({}); ``` See the full list on the [API](/plugins/loyverse/api) page. ## Query synced data Synced entities support `tenant.loyverse.db..search()` and `.list()`: `categories`, `customers`, `discounts`, `employees`, `items`, `merchant`, `modifiers`, `paymentTypes`, `posDevices`, `stores`, `suppliers`, `taxes`, `variants`. See [Database](/plugins/loyverse/database) for filters and operators. ## What's next > **[API reference](/plugins/loyverse/api)** > > Every `loyverse.api.*` operation with input and output types. > **[Database](/plugins/loyverse/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/magichour/api API reference for Magic Hour: every `magichour.api.*` operation with input and output types. Every `magichour.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get the account's credit balance and subscription details **Risk:** `read` ```ts theme={null} await corsair.magichour.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | No | — | | `tier` | `free \| creator \| pro \| business` | Yes | — | | `credits` | `number` | Yes | — | | `subscription` | `object` | No | — | > **subscription full type** > > ```ts theme={null} > { > name?: string | null, > status: active | past_due, > price: { > amount: number, > currency: string > }, > discount?: { > percent_off?: number | null, > amount_off?: number | null > } | null, > billing_interval?: month | year | | null, > current_period_end?: string | null, > cancel_at_period_end: boolean > } > ``` *** ## Audio ### voiceCloner `audio.voiceCloner` Clone a voice from an audio sample and generate speech **Risk:** `write` ```ts theme={null} await corsair.magichour.api.audio.voiceCloner({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `assets` | `object` | Yes | — | | `style` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > audio_file_path: string > } > ``` > **style full type** > > ```ts theme={null} > { > prompt: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### voiceGenerator `audio.voiceGenerator` Generate speech audio from text using a preset voice **Risk:** `write` ```ts theme={null} await corsair.magichour.api.audio.voiceGenerator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `style` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > prompt: string, > voice_name: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ## Audio Projects ### delete `audioProjects.delete` Permanently delete rendered audio file(s) \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.magichour.api.audioProjects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `void` *** ### getDetails `audioProjects.getDetails` Check the progress, status, and downloads of an audio project **Risk:** `read` ```ts theme={null} await corsair.magichour.api.audioProjects.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `draft \| queued \| rendering \| complete \| error \| canceled` | Yes | — | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `enabled` | `boolean` | Yes | — | | `credits_charged` | `number` | Yes | — | | `downloads` | `object[]` | No | — | | `error` | `object` | No | — | > **downloads full type** > > ```ts theme={null} > { > url: string, > expires_at: string > }[] > ``` > **error full type** > > ```ts theme={null} > { > message: string, > code: string > } > ``` *** ## Face Detection ### detect `faceDetection.detect` Detect faces in an image or video **Risk:** `write` ```ts theme={null} await corsair.magichour.api.faceDetection.detect({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `confidence_score` | `number` | No | — | | `assets` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > target_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### getDetails `faceDetection.getDetails` Get the details and detected faces of a face detection task **Risk:** `read` ```ts theme={null} await corsair.magichour.api.faceDetection.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | | `status` | `queued \| rendering \| complete \| error` | Yes | — | | `faces` | `object[]` | Yes | — | > **faces full type** > > ```ts theme={null} > { > path: string, > url: string > }[] > ``` *** ## Files ### generateUploadUrls `files.generateUploadUrls` Generate pre-signed URLs for uploading video, audio, or image assets **Risk:** `write` ```ts theme={null} await corsair.magichour.api.files.generateUploadUrls({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > type: video | audio | image, > extension: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > upload_url: string, > expires_at: string, > file_path: string > }[] > ``` *** ### savedItemsList `files.savedItemsList` List saved items (characters, references, voices, moodboards, brand kits) **Risk:** `read` ```ts theme={null} await corsair.magichour.api.files.savedItemsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `character \| reference \| voice \| moodboard \| brand_kit` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > type: character | reference | voice | moodboard | brand_kit, > name?: string | null, > assets: { > file_path: string, > media_kind: IMAGE | VIDEO | AUDIO, > is_primary: boolean, > url: string, > url_expires_at: string > }[] > }[] > ``` *** ## Image Projects ### delete `imageProjects.delete` Permanently delete rendered image(s) \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.magichour.api.imageProjects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `void` *** ### getDetails `imageProjects.getDetails` Check the progress, status, and downloads of an image project **Risk:** `read` ```ts theme={null} await corsair.magichour.api.imageProjects.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `draft \| queued \| rendering \| complete \| error \| canceled` | Yes | — | | `image_count` | `number` | Yes | — | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `enabled` | `boolean` | Yes | — | | `credits_charged` | `number` | Yes | — | | `downloads` | `object[]` | No | — | | `error` | `object` | No | — | > **downloads full type** > > ```ts theme={null} > { > url: string, > expires_at: string > }[] > ``` > **error full type** > > ```ts theme={null} > { > message: string, > code: string > } > ``` *** ## Images ### backgroundRemover `images.backgroundRemover` Remove or replace an image background **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.backgroundRemover({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `assets` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > image_file_path: string, > background_image_file_path?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### bodySwap `images.bodySwap` Place a person into a scene image **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.bodySwap({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `resolution` | `640px \| 1k \| 2k \| 4k` | Yes | — | | `assets` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > person_file_path: string, > scene_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### clothesChanger `images.clothesChanger` Change outfits in a photo using a garment reference **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.clothesChanger({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `assets` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > person_file_path: string, > garment_file_path: string, > garment_type?: entire_outfit | upper_body | lower_body | dresses > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### faceEditor `images.faceEditor` Edit facial features of an image **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.faceEditor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `assets` | `object` | Yes | — | | `style` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > image_file_path: string > } > ``` > **style full type** > > ```ts theme={null} > { > enhance_face?: boolean, > eyebrow_direction?: number, > eye_gaze_horizontal?: number, > eye_gaze_vertical?: number, > eye_open_ratio?: number, > lip_open_ratio?: number, > head_roll?: number, > mouth_grim?: number, > mouth_pout?: number, > mouth_purse?: number, > mouth_smile?: number, > mouth_position_horizontal?: number, > mouth_position_vertical?: number, > head_pitch?: number, > head_yaw?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### faceSwapPhoto `images.faceSwapPhoto` Swap faces in a photo **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.faceSwapPhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `assets` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > face_swap_mode?: all-faces | individual-faces, > source_file_path?: string, > face_mappings?: { > original_face: string, > new_face: string > }[], > target_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### gifGenerator `images.gifGenerator` Generate an animated GIF from a prompt **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.gifGenerator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `style` | `object` | Yes | — | | `output_format` | `gif \| mp4 \| webm` | No | — | > **style full type** > > ```ts theme={null} > { > prompt: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### headshotGenerator `images.headshotGenerator` Generate a professional headshot from a photo **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.headshotGenerator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `style` | `object` | No | — | | `assets` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > prompt?: string > } > ``` > **assets full type** > > ```ts theme={null} > { > image_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### headSwap `images.headSwap` Swap a head onto a body image **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.headSwap({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `max_resolution` | `number` | No | — | | `assets` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > body_file_path: string, > head_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### imageEditor `images.imageEditor` Edit an image with a prompt-driven AI model **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.imageEditor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `image_count` | `1 \| 4 \| 9 \| 16` | No | — | | `model` | `string` | No | — | | `aspect_ratio` | `auto \| 16:9 \| 9:16 \| 4:3 \| 3:2 \| 1:1 \| 4:5 \| 2:3` | No | — | | `resolution` | `auto \| 640px \| 1k \| 2k \| 4k` | No | — | | `style` | `object` | Yes | — | | `assets` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > prompt: string > } > ``` > **assets full type** > > ```ts theme={null} > { > image_file_paths?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### imageGenerator `images.imageGenerator` Generate images from a text prompt **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.imageGenerator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `image_count` | `number` | Yes | — | | `model` | `string` | No | — | | `aspect_ratio` | `1:1 \| 16:9 \| 9:16` | No | — | | `resolution` | `auto \| 640px \| 1k \| 2k \| 4k` | No | — | | `style` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > prompt: string, > tool?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### imageUpscaler `images.imageUpscaler` Upscale an image 2x or 4x with AI **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.imageUpscaler({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `scale_factor` | `2 \| 4` | Yes | — | | `style` | `object` | No | — | | `assets` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > mode?: pro | preserve | balanced | creative, > prompt?: string > } > ``` > **assets full type** > > ```ts theme={null} > { > image_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### memeGenerator `images.memeGenerator` Generate a meme from a topic and template **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.memeGenerator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `style` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > topic: string, > template: string, > searchWeb?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### photoColorizer `images.photoColorizer` Colorize a black-and-white photo **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.photoColorizer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `assets` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > image_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### qrCodeGenerator `images.qrCodeGenerator` Generate an artistic QR code **Risk:** `write` ```ts theme={null} await corsair.magichour.api.images.qrCodeGenerator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `content` | `string` | Yes | — | | `style` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > art_style: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ## Video Projects ### delete `videoProjects.delete` Permanently delete a rendered video \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.magichour.api.videoProjects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `void` *** ### getDetails `videoProjects.getDetails` Check the progress, status, and downloads of a video project **Risk:** `read` ```ts theme={null} await corsair.magichour.api.videoProjects.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `draft \| queued \| rendering \| complete \| error \| canceled` | Yes | — | | `type` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `width` | `number` | Yes | — | | `height` | `number` | Yes | — | | `enabled` | `boolean` | Yes | — | | `start_seconds` | `number` | Yes | — | | `end_seconds` | `number` | Yes | — | | `credits_charged` | `number` | Yes | — | | `fps` | `number` | Yes | — | | `error` | `object` | No | — | | `downloads` | `object[]` | No | — | > **error full type** > > ```ts theme={null} > { > message: string, > code: string > } > ``` > **downloads full type** > > ```ts theme={null} > { > url: string, > expires_at: string > }[] > ``` *** ## Videos ### animation `videos.animation` Create a stylized animation video from an image and audio **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.animation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `fps` | `number` | Yes | — | | `end_seconds` | `number` | Yes | — | | `height` | `number` | Yes | — | | `width` | `number` | Yes | — | | `style` | `object` | Yes | — | | `assets` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > art_style: string, > art_style_custom?: string, > camera_effect: string, > prompt_type: custom | use_lyrics | ai_choose, > prompt?: string, > transition_speed: number > } > ``` > **assets full type** > > ```ts theme={null} > { > audio_source: none | file | youtube, > audio_file_path?: string, > youtube_url?: string, > image_file_path?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### audioToVideo `videos.audioToVideo` Create a video from an audio track **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.audioToVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `start_seconds` | `number` | No | — | | `end_seconds` | `number` | Yes | — | | `resolution` | `480p \| 720p \| 1080p` | No | — | | `assets` | `object` | Yes | — | | `style` | `object` | No | — | > **assets full type** > > ```ts theme={null} > { > audio_file_path: string, > image_file_path?: string > } > ``` > **style full type** > > ```ts theme={null} > { > prompt?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### autoSubtitleGenerator `videos.autoSubtitleGenerator` Generate styled subtitles for a video **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.autoSubtitleGenerator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `start_seconds` | `number` | Yes | — | | `end_seconds` | `number` | Yes | — | | `assets` | `object` | Yes | — | | `style` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > video_file_path: string > } > ``` > **style full type** > > ```ts theme={null} > { > template?: karaoke | cinematic | minimalist | highlight, > custom_config?: { > font?: string, > font_size?: number, > font_style?: string, > text_color?: string, > highlighted_text_color?: string, > stroke_color?: string, > stroke_width?: number, > vertical_position?: string, > horizontal_position?: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### characterReplace `videos.characterReplace` Replace or animate a character in a video **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.characterReplace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `start_seconds` | `number` | No | — | | `end_seconds` | `number` | Yes | — | | `model` | `wan-animate \| kling-3.0` | No | — | | `resolution` | `480p \| 720p \| 1080p` | No | — | | `assets` | `object` | Yes | — | | `style` | `object` | No | — | > **assets full type** > > ```ts theme={null} > { > video_file_path: string, > image_file_path: string > } > ``` > **style full type** > > ```ts theme={null} > { > mode?: replace | animate, > selection_mode?: auto | point, > points?: { > position_x: number, > position_y: number, > time_seconds: number > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### faceSwap `videos.faceSwap` Swap faces in a video using a reference face image **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.faceSwap({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `start_seconds` | `number` | Yes | — | | `end_seconds` | `number` | Yes | — | | `style` | `object` | No | — | | `assets` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > version?: v1 | v2 | default > } > ``` > **assets full type** > > ```ts theme={null} > { > face_swap_mode?: all-faces | individual-faces, > image_file_path?: string, > face_mappings?: { > original_face: string, > new_face: string > }[], > video_source: file | youtube, > video_file_path?: string, > youtube_url?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### imageToVideo `videos.imageToVideo` Animate a still image into a video **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.imageToVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `end_seconds` | `number` | Yes | — | | `model` | `string` | No | — | | `resolution` | `360p \| 480p \| 720p \| 1080p \| 4k` | No | — | | `audio` | `boolean` | No | — | | `style` | `object` | No | — | | `assets` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > prompt?: string > } > ``` > **assets full type** > > ```ts theme={null} > { > image_file_path: string, > end_image_file_path?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### lipSync `videos.lipSync` Sync a video's lip movement to an audio track **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.lipSync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `start_seconds` | `number` | Yes | — | | `end_seconds` | `number` | Yes | — | | `max_fps_limit` | `number` | No | — | | `assets` | `object` | Yes | — | | `style` | `object` | No | — | > **assets full type** > > ```ts theme={null} > { > audio_file_path: string, > video_source: file | youtube, > video_file_path?: string, > youtube_url?: string > } > ``` > **style full type** > > ```ts theme={null} > { > generation_mode?: lite | standard | pro > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### talkingPhoto `videos.talkingPhoto` Create a talking photo video from an image and an audio file **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.talkingPhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `start_seconds` | `number` | Yes | — | | `end_seconds` | `number` | Yes | — | | `assets` | `object` | Yes | — | | `style` | `object` | No | — | | `resolution` | `480p \| 720p` | No | — | > **assets full type** > > ```ts theme={null} > { > image_file_path: string, > audio_file_path: string > } > ``` > **style full type** > > ```ts theme={null} > { > generation_mode?: realistic | prompted | pro | standard | stable | expressive, > prompt?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### textToVideo `videos.textToVideo` Generate a video from a text prompt **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.textToVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `end_seconds` | `number` | Yes | — | | `aspect_ratio` | `16:9 \| 9:16 \| 1:1` | No | — | | `resolution` | `360p \| 480p \| 720p \| 1080p \| 4k` | No | — | | `model` | `string` | No | — | | `audio` | `boolean` | No | — | | `style` | `object` | Yes | — | | `references` | `object[]` | No | — | > **style full type** > > ```ts theme={null} > { > prompt: string > } > ``` > **references full type** > > ```ts theme={null} > { > name: string, > file_path: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### ugcAd `videos.ugcAd` Create a spoken UGC ad video from an image and a script **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.ugcAd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assets` | `object` | Yes | — | | `script` | `string` | Yes | — | | `end_seconds` | `number` | Yes | — | | `model` | `kling-3.0 \| ltx-2.5 \| veo3.1` | No | — | | `resolution` | `480p \| 720p \| 1080p` | No | — | > **assets full type** > > ```ts theme={null} > { > image_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### videoEditor `videos.videoEditor` Edit a video with a prompt-driven AI model **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.videoEditor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `start_seconds` | `number` | No | — | | `end_seconds` | `number` | Yes | — | | `model` | `gemini-omni-1.1 \| gemini-omni \| ltx-2.5 \| ltx-2.3` | No | — | | `resolution` | `480p \| 720p \| 1080p` | No | — | | `style` | `object` | Yes | — | | `assets` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > prompt: string > } > ``` > **assets full type** > > ```ts theme={null} > { > video_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### videoToVideo `videos.videoToVideo` Restyle an existing video with a new art style **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.videoToVideo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `start_seconds` | `number` | Yes | — | | `end_seconds` | `number` | Yes | — | | `fps_resolution` | `FULL \| HALF` | No | — | | `style` | `object` | Yes | — | | `assets` | `object` | Yes | — | > **style full type** > > ```ts theme={null} > { > art_style: string, > version?: v1 | v2 | default, > prompt_type?: default | custom | append_default, > prompt?: string | null, > model?: Dreamshaper | Absolute Reality | Flat 2D Anime | Soft Anime | Kaywaii | Western Anime | 3D Anime | default > } > ``` > **assets full type** > > ```ts theme={null} > { > video_source: file | youtube, > video_file_path?: string, > youtube_url?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** ### videoTranslator `videos.videoTranslator` Translate the speech in a video into another language **Risk:** `write` ```ts theme={null} await corsair.magichour.api.videos.videoTranslator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `start_seconds` | `number` | No | — | | `end_seconds` | `number` | Yes | — | | `target_language` | `string` | Yes | — | | `resolution` | `480p \| 720p \| 1080p` | No | — | | `assets` | `object` | Yes | — | > **assets full type** > > ```ts theme={null} > { > video_file_path: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `credits_charged` | `number` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/magichour/database Magic Hour local sync: searchable entities, `.search()` filters, and operators. The Magic Hour plugin syncs data locally. Use `corsair.magichour.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/magichour/overview AI video, image, and audio generation with async project polling and pre-signed uploads. Use **Magic Hour** through Corsair: one client, typed API calls. **What you get:** * 40 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/magichour ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/magichour ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/magichour ``` ```bash bun theme={null} bun add corsair @corsair-dev/magichour ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { magichour } from '@corsair-dev/magichour'; export const corsair = createCorsair({ plugins: [ magichour(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} magichour() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'magichour', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.magichour.api.account.get({}); ``` **`audio.voiceCloner`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.magichour.api.audio.voiceCloner({}); ``` See the full list on the [API](/plugins/magichour/api) page. ## What's next > **[API reference](/plugins/magichour/api)** > > Every `magichour.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/mailboxlayer/api API reference for MailboxLayer: every `mailboxlayer.api.*` operation with input and output types. Every `mailboxlayer.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Email ### check `email.check` Validate whether an email address is correctly formatted, has valid MX records, and is deliverable via SMTP **Risk:** `read` ```ts theme={null} await corsair.mailboxlayer.api.email.check({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | The email address to validate and verify | | `smtp` | `boolean` | No | Whether to run a real-time SMTP check (default true). Set to false for a faster format/MX-only check. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `did_you_mean` | `string` | Yes | — | | `user` | `string` | Yes | — | | `domain` | `string` | Yes | — | | `format_valid` | `boolean` | Yes | — | | `mx_found` | `boolean` | Yes | — | | `smtp_check` | `boolean` | Yes | — | | `catch_all` | `boolean` | No | — | | `role` | `boolean` | Yes | — | | `disposable` | `boolean` | Yes | — | | `free` | `boolean` | Yes | — | | `score` | `number` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/mailboxlayer/database MailboxLayer local sync: searchable entities, `.search()` filters, and operators. The MailboxLayer plugin syncs data locally. Use `corsair.mailboxlayer.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Email Checks Path: `mailboxlayer.db.emailChecks.search` ```ts theme={null} const rows = await corsair.mailboxlayer.db.emailChecks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `didYouMean` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `formatValid` | `boolean` | equals | | `mxFound` | `boolean` | equals | | `smtpCheck` | `boolean` | equals | | `catchAll` | `boolean` | equals | | `role` | `boolean` | equals | | `disposable` | `boolean` | equals | | `free` | `boolean` | equals | | `score` | `number` | equals, gt, gte, lt, lte, in | | `checkedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/mailboxlayer/overview Email verification API for checking address validity, format, and deliverability scores. Use **MailboxLayer** through Corsair: one client, typed API calls, local DB sync. This plugin only ever calls mailboxlayer over HTTPS, since every request carries your `access_key` and the email address being checked as query parameters. mailboxlayer's free-tier plans reject HTTPS entirely (API error 105, `https_access_restricted`) and only work over plain HTTP, so this plugin requires a paid mailboxlayer plan. **What you get:** * 1 typed API operations * 1 synced entity (`emailChecks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/mailboxlayer ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/mailboxlayer ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/mailboxlayer ``` ```bash bun theme={null} bun add corsair @corsair-dev/mailboxlayer ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { mailboxlayer } from '@corsair-dev/mailboxlayer'; export const corsair = createCorsair({ plugins: [ mailboxlayer(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} mailboxlayer() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'mailboxlayer', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`email.check`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.mailboxlayer.api.email.check({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/mailboxlayer/api) reference.* See the full list on the [API](/plugins/mailboxlayer/api) page. ## Query synced data Synced entities support `tenant.mailboxlayer.db..search()` and `.list()`: `emailChecks`. See [Database](/plugins/mailboxlayer/database) for filters and operators. ## What's next > **[API reference](/plugins/mailboxlayer/api)** > > Every `mailboxlayer.api.*` operation with input and output types. > **[Database](/plugins/mailboxlayer/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/mailcheck/api API reference for Mailcheck: every `mailcheck.api.*` operation with input and output types. Every `mailcheck.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Domain ### validate `domain.validate` Check a domain for MX records, disposable providers, and catch-all mail **Risk:** `read` ```ts theme={null} await corsair.mailcheck.api.domain.validate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `mxExists` | `boolean` | Yes | — | | `isNotDisposable` | `boolean` | Yes | — | | `isNotSmtpCatchAll` | `boolean` | Yes | — | *** ## Email ### verify `email.verify` Verify an email for syntax, MX records, and SMTP validity **Risk:** `read` ```ts theme={null} await corsair.mailcheck.api.email.verify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `trustRate` | `number` | Yes | — | | `mxExists` | `boolean` | Yes | — | | `smtpExists` | `boolean` | Yes | — | | `isNotDisposable` | `boolean` | Yes | — | | `isNotSmtpCatchAll` | `boolean` | Yes | — | | `gravatar` | `object` | No | — | > **gravatar full type** > > ```ts theme={null} > { > entries?: { > profileUrl?: string, > preferredUsername?: string, > accounts?: { > domain: string > }[] > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/mailcheck/database Mailcheck local sync: searchable entities, `.search()` filters, and operators. The Mailcheck plugin syncs data locally. Use `corsair.mailcheck.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/mailcheck/overview Mailcheck plugin for Corsair Use **Mailcheck** through Corsair: one client, typed API calls. **What you get:** * 2 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/mailcheck ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/mailcheck ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/mailcheck ``` ```bash bun theme={null} bun add corsair @corsair-dev/mailcheck ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { mailcheck } from '@corsair-dev/mailcheck'; export const corsair = createCorsair({ plugins: [ mailcheck(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} mailcheck() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'mailcheck', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`domain.validate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.mailcheck.api.domain.validate({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/mailcheck/api) reference.* See the full list on the [API](/plugins/mailcheck/api) page. ## What's next > **[API reference](/plugins/mailcheck/api)** > > Every `mailcheck.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/mailchimp/api API reference for Mailchimp: every `mailchimp.api.*` operation with input and output types. Every `mailchimp.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### ping `account.ping` Health-check the API. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.account.ping({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `health_status` | `string` | Yes | — | *** ### root `account.root` Get account and API root information. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.account.root({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `string[]` | No | — | | `exclude_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `account_id` | `string` | Yes | — | *** ## Campaigns ### create `campaigns.create` Create a campaign. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.campaigns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `regular \| plaintext \| absplit \| rss \| variate` | Yes | — | | `recipients` | `object` | No | — | | `settings` | `object` | No | — | > **recipients full type** > > ```ts theme={null} > { > list_id: string, > segment_opts?: { > } > } > ``` > **settings full type** > > ```ts theme={null} > { > subject_line?: string, > preview_text?: string, > title?: string, > from_name?: string, > reply_to?: string, > to_name?: string, > folder_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `campaigns.get` Get a campaign. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.campaigns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### getContent `campaigns.getContent` Get campaign content. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.campaigns.getContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `plain_text` | `string` | No | — | | `html` | `string` | No | — | *** ### list `campaigns.list` List campaigns. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.campaigns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `regular \| plaintext \| absplit \| rss \| variate` | No | — | | `status` | `save \| paused \| schedule \| sending \| sent` | No | — | | `count` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `exclude_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaigns` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **campaigns full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### remove `campaigns.remove` Delete a campaign. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.campaigns.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | **Output:** `any` *** ### schedule `campaigns.schedule` Schedule a campaign. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.campaigns.schedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | | `schedule_time` | `string` | Yes | — | | `timewarp` | `boolean` | No | — | | `batch_delivery` | `object` | No | — | > **batch\_delivery full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### send `campaigns.send` Send a campaign to its audience. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.campaigns.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | **Output:** `any` *** ### sendTest `campaigns.sendTest` Send a test email. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.campaigns.sendTest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | | `test_emails` | `string[]` | Yes | — | | `send_type` | `html \| plaintext` | Yes | — | **Output:** `any` *** ### setContent `campaigns.setContent` Set campaign content. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.campaigns.setContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | | `html` | `string` | No | — | | `plain_text` | `string` | No | — | | `template` | `object` | No | — | > **template full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `plain_text` | `string` | No | — | | `html` | `string` | No | — | *** ### unschedule `campaigns.unschedule` Unschedule a campaign. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.campaigns.unschedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | **Output:** `any` *** ### update `campaigns.update` Update campaign settings. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.campaigns.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | | `recipients` | `object` | No | — | | `settings` | `object` | No | — | > **recipients full type** > > ```ts theme={null} > { > list_id: string, > segment_opts?: { > } > } > ``` > **settings full type** > > ```ts theme={null} > { > subject_line?: string, > preview_text?: string, > title?: string, > from_name?: string, > reply_to?: string, > to_name?: string, > folder_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Interest Categories ### create `interestCategories.create` Create an interest category. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.interestCategories.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `type` | `checkboxes \| dropdown \| radio \| hidden` | Yes | — | | `display_order` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### get `interestCategories.get` Get an interest category. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.interestCategories.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `interest_category_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### list `interestCategories.list` List interest categories (groups). **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.interestCategories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `count` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `categories` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **categories full type** > > ```ts theme={null} > { > id: string, > title: string, > list_id?: string > }[] > ``` *** ### remove `interestCategories.remove` Delete an interest category. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.interestCategories.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `interest_category_id` | `string` | Yes | — | **Output:** `any` *** ### update `interestCategories.update` Update an interest category. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.interestCategories.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `interest_category_id` | `string` | Yes | — | | `title` | `string` | No | — | | `type` | `checkboxes \| dropdown \| radio \| hidden` | No | — | | `display_order` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ## Interests ### create `interests.create` Create an interest. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.interests.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `interest_category_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `display_order` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### get `interests.get` Get an interest. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.interests.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `interest_category_id` | `string` | Yes | — | | `interest_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### list `interests.list` List interests in a category. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.interests.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `interest_category_id` | `string` | Yes | — | | `count` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `interests` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **interests full type** > > ```ts theme={null} > { > id: string, > name: string, > list_id?: string > }[] > ``` *** ### remove `interests.remove` Delete an interest. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.interests.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `interest_category_id` | `string` | Yes | — | | `interest_id` | `string` | Yes | — | **Output:** `any` *** ### update `interests.update` Update an interest. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.interests.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `interest_category_id` | `string` | Yes | — | | `interest_id` | `string` | Yes | — | | `name` | `string` | No | — | | `display_order` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ## Lists ### create `lists.create` Create an audience. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.lists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `contact` | `object` | Yes | — | | `permission_reminder` | `string` | Yes | — | | `campaign_defaults` | `object` | Yes | — | | `email_type_option` | `boolean` | Yes | — | | `use_archive_bar` | `boolean` | No | — | | `double_optin` | `boolean` | No | — | | `marketing_permissions` | `boolean` | No | — | > **contact full type** > > ```ts theme={null} > { > company: string, > address1: string, > address2?: string, > city: string, > state: string, > zip: string, > country: string, > phone?: string > } > ``` > **campaign\_defaults full type** > > ```ts theme={null} > { > from_name: string, > from_email: string, > subject: string, > language: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `web_id` | `number` | No | — | *** ### get `lists.get` Get an audience by id. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.lists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `fields` | `string[]` | No | — | | `exclude_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `web_id` | `number` | No | — | *** ### list `lists.list` List all audiences. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.lists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `exclude_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lists` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **lists full type** > > ```ts theme={null} > { > id: string, > name: string, > web_id?: number > }[] > ``` *** ### remove `lists.remove` Delete an audience. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.lists.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | **Output:** `any` *** ### update `lists.update` Update audience settings. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.lists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `name` | `string` | No | — | | `contact` | `object` | No | — | | `permission_reminder` | `string` | No | — | | `campaign_defaults` | `object` | No | — | | `email_type_option` | `boolean` | No | — | > **contact full type** > > ```ts theme={null} > { > company: string, > address1: string, > address2?: string, > city: string, > state: string, > zip: string, > country: string, > phone?: string > } > ``` > **campaign\_defaults full type** > > ```ts theme={null} > { > from_name: string, > from_email: string, > subject: string, > language: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `web_id` | `number` | No | — | *** ## Members ### add `members.add` Add a new member. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.members.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `email_address` | `string` | Yes | — | | `status` | `subscribed \| unsubscribed \| cleaned \| pending \| transactional` | Yes | — | | `email_type` | `html \| text` | No | — | | `merge_fields` | `object` | No | — | | `interests` | `object` | No | — | | `tags` | `string[]` | No | — | > **merge\_fields full type** > > ```ts theme={null} > { > } > ``` > **interests full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email_address` | `string` | Yes | — | | `status` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### archive `members.archive` Archive a member. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.members.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `subscriber_hash` | `string` | Yes | — | **Output:** `any` *** ### get `members.get` Get a member. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.members.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `subscriber_hash` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email_address` | `string` | Yes | — | | `status` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### list `members.list` List members of an audience. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.members.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `status` | `subscribed \| unsubscribed \| cleaned \| pending \| transactional` | No | — | | `count` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `exclude_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `members` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **members full type** > > ```ts theme={null} > { > id: string, > email_address: string, > status: string, > list_id?: string > }[] > ``` *** ### listTags `members.listTags` List a member's tags. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.members.listTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `subscriber_hash` | `string` | Yes | — | | `count` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **tags full type** > > ```ts theme={null} > { > name: string > }[] > ``` *** ### remove `members.remove` Permanently delete a member. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.members.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `subscriber_hash` | `string` | Yes | — | **Output:** `any` *** ### search `members.search` Search members. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.members.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `list_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `exact_matches` | `any` | Yes | — | | `full_search` | `any` | Yes | — | *** ### update `members.update` Update a member. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.members.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `subscriber_hash` | `string` | Yes | — | | `email_address` | `string` | No | — | | `status` | `subscribed \| unsubscribed \| cleaned \| pending \| transactional` | No | — | | `merge_fields` | `object` | No | — | | `interests` | `object` | No | — | > **merge\_fields full type** > > ```ts theme={null} > { > } > ``` > **interests full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email_address` | `string` | Yes | — | | `status` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### updateTags `members.updateTags` Add or remove a member's tags. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.members.updateTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `subscriber_hash` | `string` | Yes | — | | `tags` | `object[]` | Yes | — | > **tags full type** > > ```ts theme={null} > { > name: string, > status: active | inactive > }[] > ``` **Output:** `any` *** ### upsert `members.upsert` Add or update a member (idempotent). **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.members.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `email_address` | `string` | Yes | — | | `status_if_new` | `subscribed \| unsubscribed \| cleaned \| pending \| transactional` | No | — | | `status` | `subscribed \| unsubscribed \| cleaned \| pending \| transactional` | No | — | | `email_type` | `html \| text` | No | — | | `merge_fields` | `object` | No | — | | `interests` | `object` | No | — | | `tags` | `string[]` | No | — | > **merge\_fields full type** > > ```ts theme={null} > { > } > ``` > **interests full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email_address` | `string` | Yes | — | | `status` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ## Merge Fields ### create `mergeFields.create` Create a merge field. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.mergeFields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `text \| number \| address \| phone \| date \| url \| imageurl \| radio \| dropdown \| birthday \| zip` | Yes | — | | `tag` | `string` | No | — | | `required` | `boolean` | No | — | | `default_value` | `string` | No | — | | `public` | `boolean` | No | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `merge_id` | `number` | Yes | — | | `tag` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### get `mergeFields.get` Get a merge field. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.mergeFields.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `merge_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `merge_id` | `number` | Yes | — | | `tag` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### list `mergeFields.list` List merge fields. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.mergeFields.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `count` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `merge_fields` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **merge\_fields full type** > > ```ts theme={null} > { > merge_id: number, > tag: string, > name: string > }[] > ``` *** ### remove `mergeFields.remove` Delete a merge field. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.mergeFields.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `merge_id` | `number` | Yes | — | **Output:** `any` *** ### update `mergeFields.update` Update a merge field. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.mergeFields.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `merge_id` | `number` | Yes | — | | `name` | `string` | No | — | | `required` | `boolean` | No | — | | `default_value` | `string` | No | — | | `public` | `boolean` | No | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `merge_id` | `number` | Yes | — | | `tag` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ## Segments ### addMember `segments.addMember` Add a member to a segment. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.segments.addMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `segment_id` | `number` | Yes | — | | `email_address` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email_address` | `string` | Yes | — | | `status` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### create `segments.create` Create a segment. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.segments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `static_segment` | `string[]` | No | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### get `segments.get` Get a segment. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.segments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `segment_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ### list `segments.list` List segments. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.segments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `count` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segments` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **segments full type** > > ```ts theme={null} > { > id: number, > name: string, > list_id?: string > }[] > ``` *** ### listMembers `segments.listMembers` List members in a segment. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.segments.listMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `segment_id` | `number` | Yes | — | | `count` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `members` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **members full type** > > ```ts theme={null} > { > id: string, > email_address: string, > status: string, > list_id?: string > }[] > ``` *** ### remove `segments.remove` Delete a segment. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.segments.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `segment_id` | `number` | Yes | — | **Output:** `any` *** ### removeMember `segments.removeMember` Remove a member from a segment. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.segments.removeMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `segment_id` | `number` | Yes | — | | `subscriber_hash` | `string` | Yes | — | **Output:** `any` *** ### update `segments.update` Update a segment. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.segments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `segment_id` | `number` | Yes | — | | `name` | `string` | No | — | | `static_segment` | `string[]` | No | — | | `options` | `object` | No | — | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `list_id` | `string` | No | — | *** ## Webhooks ### create `webhooks.create` Create a webhook. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `events` | `object` | No | — | | `sources` | `object` | No | — | > **events full type** > > ```ts theme={null} > { > subscribe?: boolean, > unsubscribe?: boolean, > profile?: boolean, > cleaned?: boolean, > upemail?: boolean, > campaign?: boolean > } > ``` > **sources full type** > > ```ts theme={null} > { > user?: boolean, > admin?: boolean, > api?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `url` | `string` | Yes | — | *** ### get `webhooks.get` Get a webhook. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.webhooks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `webhook_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `url` | `string` | Yes | — | *** ### list `webhooks.list` List list webhooks. **Risk:** `read` ```ts theme={null} await corsair.mailchimp.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | Yes | — | | `total_items` | `number` | No | — | > **webhooks full type** > > ```ts theme={null} > { > id: string, > url: string > }[] > ``` *** ### remove `webhooks.remove` Delete a webhook. **Risk:** `destructive` ```ts theme={null} await corsair.mailchimp.api.webhooks.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `webhook_id` | `string` | Yes | — | **Output:** `any` *** ### update `webhooks.update` Update a webhook. **Risk:** `write` ```ts theme={null} await corsair.mailchimp.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `webhook_id` | `string` | Yes | — | | `url` | `string` | No | — | | `events` | `object` | No | — | | `sources` | `object` | No | — | > **events full type** > > ```ts theme={null} > { > subscribe?: boolean, > unsubscribe?: boolean, > profile?: boolean, > cleaned?: boolean, > upemail?: boolean, > campaign?: boolean > } > ``` > **sources full type** > > ```ts theme={null} > { > user?: boolean, > admin?: boolean, > api?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `url` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/mailchimp/database Mailchimp local sync: searchable entities, `.search()` filters, and operators. The Mailchimp plugin syncs data locally. Use `corsair.mailchimp.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Campaigns Path: `mailchimp.db.campaigns.search` ```ts theme={null} const rows = await corsair.mailchimp.db.campaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `web_id` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `create_time` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `mailchimp.db.lists.search` ```ts theme={null} const rows = await corsair.mailchimp.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `web_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `date_created` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Members Path: `mailchimp.db.members.search` ```ts theme={null} const rows = await corsair.mailchimp.db.members.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `list_id` | `string` | equals, contains, startsWith, endsWith, in | | `email_address` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_changed` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/mailchimp/overview Email marketing platform for audiences, campaigns, automations, and audience analytics. Use **Mailchimp** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 56 typed API operations * 3 synced entities (`campaigns`, `lists`, `members`) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/mailchimp ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/mailchimp ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/mailchimp ``` ```bash bun theme={null} bun add corsair @corsair-dev/mailchimp ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { mailchimp } from '@corsair-dev/mailchimp'; export const corsair = createCorsair({ plugins: [ mailchimp(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Mailchimp OAuth app. ```ts theme={null} mailchimp() ``` More: [OAuth 2.0](/concepts/oauth) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. ```ts theme={null} mailchimp({ authType: 'api_key', }) ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'mailchimp', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.ping`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.mailchimp.api.account.ping({}); ``` **`campaigns.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.mailchimp.api.campaigns.create({}); ``` See the full list on the [API](/plugins/mailchimp/api) page. ## Query synced data Synced entities support `tenant.mailchimp.db..search()` and `.list()`: `campaigns`, `lists`, `members`. See [Database](/plugins/mailchimp/database) for filters and operators. ## Webhooks This plugin registers **4** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/mailchimp/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/mailchimp/api)** > > Every `mailchimp.api.*` operation with input and output types. > **[Database](/plugins/mailchimp/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/mailchimp/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/mailchimp/webhooks Mailchimp incoming webhooks: event paths, payloads, and response data. The Mailchimp plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/mailchimp/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `campaign` (`campaign`) * `profile` (`profile`) * `subscribe` (`subscribe`) * `unsubscribe` (`unsubscribe`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Campaign ### Campaign `campaign` Fired when a campaign is sent. **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `campaign` | Yes | — | | `created_at` | `string` | No | — | | `fired_at` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > list_id?: string, > subject?: string, > status?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: campaign, > created_at?: string, > fired_at?: string, > data: { > id?: string, > list_id?: string, > subject?: string, > status?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} mailchimp({ webhookHooks: { campaign: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Profile ### Profile `profile` Fired when a subscriber updates their profile. **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `profile` | Yes | — | | `created_at` | `string` | No | — | | `fired_at` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > list_id?: string, > email?: string, > merges?: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: profile, > created_at?: string, > fired_at?: string, > data: { > id?: string, > list_id?: string, > email?: string, > merges?: { > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} mailchimp({ webhookHooks: { profile: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Subscribe ### Subscribe `subscribe` Fired when a subscriber joins a list. **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `subscribe` | Yes | — | | `created_at` | `string` | No | — | | `fired_at` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > list_id?: string, > email?: string, > merges?: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: subscribe, > created_at?: string, > fired_at?: string, > data: { > id?: string, > list_id?: string, > email?: string, > merges?: { > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} mailchimp({ webhookHooks: { subscribe: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Unsubscribe ### Unsubscribe `unsubscribe` Fired when a subscriber leaves a list. **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `unsubscribe` | Yes | — | | `created_at` | `string` | No | — | | `fired_at` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > list_id?: string, > email?: string, > merges?: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: unsubscribe, > created_at?: string, > fired_at?: string, > data: { > id?: string, > list_id?: string, > email?: string, > merges?: { > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} mailchimp({ webhookHooks: { unsubscribe: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/mailtrap/api API reference for Mailtrap: every `mailtrap.api.*` operation with input and output types. Every `mailtrap.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getBillingUsage `account.getBillingUsage` Get billing usage against the account's testing/sending/marketing plan limits **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.account.getBillingUsage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `billing` | `object` | No | — | | `testing` | `object` | No | — | | `sending` | `object` | No | — | | `marketing` | `object` | No | — | > **billing full type** > > ```ts theme={null} > { > cycle_start?: string | null, > cycle_end?: string | null > } > ``` > **testing full type** > > ```ts theme={null} > { > plan?: { > name?: string | null > } | null, > usage?: { > sent_messages_count?: { > current?: number | null, > limit?: number | null > } | null, > forwarded_messages_count?: { > current?: number | null, > limit?: number | null > } | null > } | null > } > ``` > **sending full type** > > ```ts theme={null} > { > plan?: { > name?: string | null > } | null, > usage?: { > sent_messages_count?: { > current?: number | null, > limit?: number | null > } | null > } | null > } > ``` > **marketing full type** > > ```ts theme={null} > { > plan?: { > name?: string | null > } | null, > usage?: { > sent_messages_count?: { > current?: number | null, > limit?: number | null > } | null > } | null > } > ``` *** ### getPermissionResources `account.getPermissionResources` Get every resource (inboxes, projects, domains, billing, account) the token has admin access to, nested by hierarchy **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.account.getPermissionResources({}); ``` **Input:** *empty object* **Output:** `lazy[]` *** ### listAccounts `account.listAccounts` List Mailtrap accounts the token can access **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.account.listAccounts({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > access_levels?: number[] | null > }[] > ``` *** ## Contact Fields ### create `contactFields.create` Create a custom contact field **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.contactFields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `merge_tag` | `string` | Yes | — | | `data_type` | `text \| number \| boolean \| date` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `merge_tag` | `string` | No | — | | `data_type` | `text \| number \| boolean \| date` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | *** ### delete `contactFields.delete` Permanently delete a custom contact field, dropping its stored values off every contact **Risk:** `destructive` ```ts theme={null} await corsair.mailtrap.api.contactFields.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field_id` | `number` | Yes | — | **Output:** *empty object* *** ### get `contactFields.get` Get a custom contact field by id **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.contactFields.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `merge_tag` | `string` | No | — | | `data_type` | `text \| number \| boolean \| date` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | *** ### list `contactFields.list` List custom contact fields **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.contactFields.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > merge_tag?: string | null, > data_type?: text | number | boolean | date | null, > created_at?: number | null, > updated_at?: number | null > }[] > ``` *** ### update `contactFields.update` Update a custom contact field **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.contactFields.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field_id` | `number` | Yes | — | | `name` | `string` | No | — | | `merge_tag` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `merge_tag` | `string` | No | — | | `data_type` | `text \| number \| boolean \| date` | No | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | *** ## Contact Lists ### create `contactLists.create` Create a contact list **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.contactLists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | *** ### delete `contactLists.delete` Permanently delete a contact list **Risk:** `destructive` ```ts theme={null} await corsair.mailtrap.api.contactLists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | **Output:** *empty object* *** ### get `contactLists.get` Get a contact list by id **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.contactLists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | *** ### list `contactLists.list` List contact lists **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.contactLists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string > }[] > ``` *** ### update `contactLists.update` Rename a contact list **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.contactLists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `number` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | *** ## Contacts ### create `contacts.create` Create a contact **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `fields` | `object` | No | — | | `list_ids` | `number[]` | No | — | | `unsubscribed` | `boolean` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `list_ids` | `number[]` | No | — | | `status` | `subscribed \| unsubscribed` | No | — | | `fields` | `object` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### createEvent `contacts.createEvent` Record a custom event against a contact **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.contacts.createEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `name` | `string` | Yes | — | | `params` | `object` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | No | — | | `contact_email` | `string` | No | — | | `name` | `string` | No | — | | `params` | `object` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` *** ### createExport `contacts.createExport` Start an async export of contacts matching a filter **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.contacts.createExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filters` | `object[]` | Yes | — | > **filters full type** > > ```ts theme={null} > { > name: string, > operator: equal | not_equal | contains | not_contains | is_empty | is_not_empty, > value: string | number | boolean | string[] | number[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `started \| created \| finished` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `url` | `string` | No | — | *** ### delete `contacts.delete` Permanently delete a contact **Risk:** `destructive` ```ts theme={null} await corsair.mailtrap.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | **Output:** *empty object* *** ### get `contacts.get` Get a contact by id or email **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `list_ids` | `number[]` | No | — | | `status` | `subscribed \| unsubscribed` | No | — | | `fields` | `object` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### getExport `contacts.getExport` Get the status/download URL of a contact export job **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.contacts.getExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `export_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `started \| created \| finished` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `url` | `string` | No | — | *** ### getImport `contacts.getImport` Get the status of a contact import job **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.contacts.getImport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `import_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `created \| started \| finished \| failed` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `created_contacts_count` | `number` | No | — | | `updated_contacts_count` | `number` | No | — | | `contacts_over_limit_count` | `number` | No | — | *** ### import `contacts.import` Bulk-import contacts, upserting by email **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.contacts.import({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | Yes | — | > **contacts full type** > > ```ts theme={null} > { > email: string, > fields?: { > }, > list_ids_included?: number[], > list_ids_excluded?: number[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `status` | `created \| started \| finished \| failed` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `created_contacts_count` | `number` | No | — | | `updated_contacts_count` | `number` | No | — | | `contacts_over_limit_count` | `number` | No | — | *** ### update `contacts.update` Update a contact by id or email **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `string` | Yes | — | | `email` | `string` | No | — | | `fields` | `object` | No | — | | `list_ids` | `number[]` | No | — | | `unsubscribed` | `boolean` | No | — | | `list_ids_included` | `number[]` | No | — | | `list_ids_excluded` | `number[]` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | Yes | — | | `created_at` | `number` | No | — | | `updated_at` | `number` | No | — | | `list_ids` | `number[]` | No | — | | `status` | `subscribed \| unsubscribed` | No | — | | `fields` | `object` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` *** ## Email Templates ### create `emailTemplates.create` Create an email template **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.emailTemplates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `subject` | `string` | Yes | — | | `category` | `string` | Yes | — | | `body_html` | `string` | Yes | — | | `body_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `uuid` | `string` | No | — | | `name` | `string` | Yes | — | | `subject` | `string` | No | — | | `category` | `string` | No | — | | `body_html` | `string` | No | — | | `body_text` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### delete `emailTemplates.delete` Permanently delete an email template **Risk:** `destructive` ```ts theme={null} await corsair.mailtrap.api.emailTemplates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | **Output:** *empty object* *** ### get `emailTemplates.get` Get an email template by id **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.emailTemplates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `uuid` | `string` | No | — | | `name` | `string` | Yes | — | | `subject` | `string` | No | — | | `category` | `string` | No | — | | `body_html` | `string` | No | — | | `body_text` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### list `emailTemplates.list` List email templates **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.emailTemplates.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > uuid?: string | null, > name: string, > subject?: string | null, > category?: string | null, > body_html?: string | null, > body_text?: string | null, > created_at?: string | null, > updated_at?: string | null > }[] > ``` *** ### update `emailTemplates.update` Update an email template **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.emailTemplates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `number` | Yes | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `category` | `string` | No | — | | `body_html` | `string` | No | — | | `body_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `uuid` | `string` | No | — | | `name` | `string` | Yes | — | | `subject` | `string` | No | — | | `category` | `string` | No | — | | `body_html` | `string` | No | — | | `body_text` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ## Inboxes ### clean `inboxes.clean` Delete every message in a sandbox inbox **Risk:** `destructive` ```ts theme={null} await corsair.mailtrap.api.inboxes.clean({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `username` | `string` | No | — | | `password` | `string` | No | — | | `max_size` | `number` | No | — | | `status` | `string` | No | — | | `email_username` | `string` | No | — | | `email_username_enabled` | `boolean` | No | — | | `sent_messages_count` | `number` | No | — | | `forwarded_messages_count` | `number` | No | — | | `used` | `boolean` | No | — | | `forward_from_email_address` | `string` | No | — | | `project_id` | `number` | No | — | | `domain` | `string` | No | — | | `pop3_domain` | `string` | No | — | | `email_domain` | `string` | No | — | | `api_domain` | `string` | No | — | | `smtp_ports` | `number[]` | No | — | | `pop3_ports` | `number[]` | No | — | | `emails_count` | `number` | No | — | | `emails_unread_count` | `number` | No | — | | `last_message_sent_at` | `string` | No | — | | `max_message_size` | `number` | No | — | | `permissions` | `object` | No | — | > **permissions full type** > > ```ts theme={null} > { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } > ``` *** ### get `inboxes.get` Get an inbox's attributes, including its SMTP credentials **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.inboxes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `username` | `string` | No | — | | `password` | `string` | No | — | | `max_size` | `number` | No | — | | `status` | `string` | No | — | | `email_username` | `string` | No | — | | `email_username_enabled` | `boolean` | No | — | | `sent_messages_count` | `number` | No | — | | `forwarded_messages_count` | `number` | No | — | | `used` | `boolean` | No | — | | `forward_from_email_address` | `string` | No | — | | `project_id` | `number` | No | — | | `domain` | `string` | No | — | | `pop3_domain` | `string` | No | — | | `email_domain` | `string` | No | — | | `api_domain` | `string` | No | — | | `smtp_ports` | `number[]` | No | — | | `pop3_ports` | `number[]` | No | — | | `emails_count` | `number` | No | — | | `emails_unread_count` | `number` | No | — | | `last_message_sent_at` | `string` | No | — | | `max_message_size` | `number` | No | — | | `permissions` | `object` | No | — | > **permissions full type** > > ```ts theme={null} > { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } > ``` *** ### list `inboxes.list` List sandbox inboxes **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.inboxes.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > username?: string | null, > password?: string | null, > max_size?: number | null, > status?: string | null, > email_username?: string | null, > email_username_enabled?: boolean | null, > sent_messages_count?: number | null, > forwarded_messages_count?: number | null, > used?: boolean | null, > forward_from_email_address?: string | null, > project_id?: number | null, > domain?: string | null, > pop3_domain?: string | null, > email_domain?: string | null, > api_domain?: string | null, > smtp_ports?: number[] | null, > pop3_ports?: number[] | null, > emails_count?: number | null, > emails_unread_count?: number | null, > last_message_sent_at?: string | null, > max_message_size?: number | null, > permissions?: { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } | null > }[] > ``` *** ### markAsRead `inboxes.markAsRead` Mark every message in a sandbox inbox as read **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.inboxes.markAsRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `username` | `string` | No | — | | `password` | `string` | No | — | | `max_size` | `number` | No | — | | `status` | `string` | No | — | | `email_username` | `string` | No | — | | `email_username_enabled` | `boolean` | No | — | | `sent_messages_count` | `number` | No | — | | `forwarded_messages_count` | `number` | No | — | | `used` | `boolean` | No | — | | `forward_from_email_address` | `string` | No | — | | `project_id` | `number` | No | — | | `domain` | `string` | No | — | | `pop3_domain` | `string` | No | — | | `email_domain` | `string` | No | — | | `api_domain` | `string` | No | — | | `smtp_ports` | `number[]` | No | — | | `pop3_ports` | `number[]` | No | — | | `emails_count` | `number` | No | — | | `emails_unread_count` | `number` | No | — | | `last_message_sent_at` | `string` | No | — | | `max_message_size` | `number` | No | — | | `permissions` | `object` | No | — | > **permissions full type** > > ```ts theme={null} > { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } > ``` *** ### resetCredentials `inboxes.resetCredentials` Reset an inbox's SMTP credentials, invalidating the previous ones **Risk:** `destructive` ```ts theme={null} await corsair.mailtrap.api.inboxes.resetCredentials({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `username` | `string` | No | — | | `password` | `string` | No | — | | `max_size` | `number` | No | — | | `status` | `string` | No | — | | `email_username` | `string` | No | — | | `email_username_enabled` | `boolean` | No | — | | `sent_messages_count` | `number` | No | — | | `forwarded_messages_count` | `number` | No | — | | `used` | `boolean` | No | — | | `forward_from_email_address` | `string` | No | — | | `project_id` | `number` | No | — | | `domain` | `string` | No | — | | `pop3_domain` | `string` | No | — | | `email_domain` | `string` | No | — | | `api_domain` | `string` | No | — | | `smtp_ports` | `number[]` | No | — | | `pop3_ports` | `number[]` | No | — | | `emails_count` | `number` | No | — | | `emails_unread_count` | `number` | No | — | | `last_message_sent_at` | `string` | No | — | | `max_message_size` | `number` | No | — | | `permissions` | `object` | No | — | > **permissions full type** > > ```ts theme={null} > { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } > ``` *** ### update `inboxes.update` Update an inbox's name and/or email username **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.inboxes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `number` | Yes | — | | `name` | `string` | No | — | | `email_username` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `username` | `string` | No | — | | `password` | `string` | No | — | | `max_size` | `number` | No | — | | `status` | `string` | No | — | | `email_username` | `string` | No | — | | `email_username_enabled` | `boolean` | No | — | | `sent_messages_count` | `number` | No | — | | `forwarded_messages_count` | `number` | No | — | | `used` | `boolean` | No | — | | `forward_from_email_address` | `string` | No | — | | `project_id` | `number` | No | — | | `domain` | `string` | No | — | | `pop3_domain` | `string` | No | — | | `email_domain` | `string` | No | — | | `api_domain` | `string` | No | — | | `smtp_ports` | `number[]` | No | — | | `pop3_ports` | `number[]` | No | — | | `emails_count` | `number` | No | — | | `emails_unread_count` | `number` | No | — | | `last_message_sent_at` | `string` | No | — | | `max_message_size` | `number` | No | — | | `permissions` | `object` | No | — | > **permissions full type** > > ```ts theme={null} > { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } > ``` *** ## Messages ### getHtml `messages.getHtml` Get the formatted HTML body of a message **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.messages.getHtml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `number` | Yes | — | | `message_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `html` | `string` | Yes | — | *** ### list `messages.list` List messages in a sandbox inbox **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inbox_id` | `number` | Yes | — | | `last_id` | `number` | No | — | | `page` | `number` | No | — | | `search` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > inbox_id?: number | null, > subject?: string | null, > sent_at?: string | null, > from_email?: string | null, > from_name?: string | null, > to_email?: string | null, > to_name?: string | null, > email_size?: number | null, > is_read?: boolean | null, > created_at?: string | null, > updated_at?: string | null, > html_body_size?: number | null, > text_body_size?: number | null, > human_size?: string | null, > html_path?: string | null, > txt_path?: string | null, > raw_path?: string | null, > download_path?: string | null, > html_source_path?: string | null > }[] > ``` *** ## Projects ### delete `projects.delete` Permanently delete a project and every inbox in it **Risk:** `destructive` ```ts theme={null} await corsair.mailtrap.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | *** ### get `projects.get` Get a project and its inboxes by id **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `share_links` | `object` | No | — | | `inboxes` | `object[]` | No | — | | `permissions` | `object` | No | — | > **share\_links full type** > > ```ts theme={null} > { > admin?: string | null, > viewer?: string | null > } > ``` > **inboxes full type** > > ```ts theme={null} > { > id: number, > name: string, > username?: string | null, > password?: string | null, > max_size?: number | null, > status?: string | null, > email_username?: string | null, > email_username_enabled?: boolean | null, > sent_messages_count?: number | null, > forwarded_messages_count?: number | null, > used?: boolean | null, > forward_from_email_address?: string | null, > project_id?: number | null, > domain?: string | null, > pop3_domain?: string | null, > email_domain?: string | null, > api_domain?: string | null, > smtp_ports?: number[] | null, > pop3_ports?: number[] | null, > emails_count?: number | null, > emails_unread_count?: number | null, > last_message_sent_at?: string | null, > max_message_size?: number | null, > permissions?: { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } | null > }[] > ``` > **permissions full type** > > ```ts theme={null} > { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } > ``` *** ### list `projects.list` List projects and their sandbox inboxes **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.projects.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > share_links?: { > admin?: string | null, > viewer?: string | null > } | null, > inboxes?: { > id: number, > name: string, > username?: string | null, > password?: string | null, > max_size?: number | null, > status?: string | null, > email_username?: string | null, > email_username_enabled?: boolean | null, > sent_messages_count?: number | null, > forwarded_messages_count?: number | null, > used?: boolean | null, > forward_from_email_address?: string | null, > project_id?: number | null, > domain?: string | null, > pop3_domain?: string | null, > email_domain?: string | null, > api_domain?: string | null, > smtp_ports?: number[] | null, > pop3_ports?: number[] | null, > emails_count?: number | null, > emails_unread_count?: number | null, > last_message_sent_at?: string | null, > max_message_size?: number | null, > permissions?: { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } | null > }[] | null, > permissions?: { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } | null > }[] > ``` *** ### update `projects.update` Rename a project **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `number` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `share_links` | `object` | No | — | | `inboxes` | `object[]` | No | — | | `permissions` | `object` | No | — | > **share\_links full type** > > ```ts theme={null} > { > admin?: string | null, > viewer?: string | null > } > ``` > **inboxes full type** > > ```ts theme={null} > { > id: number, > name: string, > username?: string | null, > password?: string | null, > max_size?: number | null, > status?: string | null, > email_username?: string | null, > email_username_enabled?: boolean | null, > sent_messages_count?: number | null, > forwarded_messages_count?: number | null, > used?: boolean | null, > forward_from_email_address?: string | null, > project_id?: number | null, > domain?: string | null, > pop3_domain?: string | null, > email_domain?: string | null, > api_domain?: string | null, > smtp_ports?: number[] | null, > pop3_ports?: number[] | null, > emails_count?: number | null, > emails_unread_count?: number | null, > last_message_sent_at?: string | null, > max_message_size?: number | null, > permissions?: { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } | null > }[] > ``` > **permissions full type** > > ```ts theme={null} > { > can_read?: boolean | null, > can_update?: boolean | null, > can_destroy?: boolean | null, > can_leave?: boolean | null > } > ``` *** ## Sending Domains ### create `sendingDomains.create` Register a sending domain for DNS verification **Risk:** `write` ```ts theme={null} await corsair.mailtrap.api.sendingDomains.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `domain_name` | `string` | Yes | — | | `demo` | `boolean` | No | — | | `inbound_enabled` | `boolean` | No | — | | `inbound_verified` | `boolean` | No | — | | `open_tracking_enabled` | `boolean` | No | — | | `click_tracking_enabled` | `boolean` | No | — | | `auto_unsubscribe_link_enabled` | `boolean` | No | — | | `custom_domain_tracking_enabled` | `boolean` | No | — | | `health_alerts_enabled` | `boolean` | No | — | | `critical_alerts_enabled` | `boolean` | No | — | | `alert_recipient_email` | `string` | No | — | | `dns_records` | `object[]` | No | — | > **dns\_records full type** > > ```ts theme={null} > { > key?: string | null, > domain?: string | null, > name?: string | null, > type?: string | null, > value?: string | null, > status?: string | null, > actual?: string | null > }[] > ``` *** ### delete `sendingDomains.delete` Permanently remove a sending domain **Risk:** `destructive` ```ts theme={null} await corsair.mailtrap.api.sendingDomains.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain_id` | `number` | Yes | — | **Output:** *empty object* *** ### get `sendingDomains.get` Get a sending domain by id, including its DNS records **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.sendingDomains.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `domain_name` | `string` | Yes | — | | `demo` | `boolean` | No | — | | `inbound_enabled` | `boolean` | No | — | | `inbound_verified` | `boolean` | No | — | | `open_tracking_enabled` | `boolean` | No | — | | `click_tracking_enabled` | `boolean` | No | — | | `auto_unsubscribe_link_enabled` | `boolean` | No | — | | `custom_domain_tracking_enabled` | `boolean` | No | — | | `health_alerts_enabled` | `boolean` | No | — | | `critical_alerts_enabled` | `boolean` | No | — | | `alert_recipient_email` | `string` | No | — | | `dns_records` | `object[]` | No | — | > **dns\_records full type** > > ```ts theme={null} > { > key?: string | null, > domain?: string | null, > name?: string | null, > type?: string | null, > value?: string | null, > status?: string | null, > actual?: string | null > }[] > ``` *** ### list `sendingDomains.list` List sending domains **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.sendingDomains.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > domain_name: string, > demo?: boolean | null, > inbound_enabled?: boolean | null, > inbound_verified?: boolean | null, > open_tracking_enabled?: boolean | null, > click_tracking_enabled?: boolean | null, > auto_unsubscribe_link_enabled?: boolean | null, > custom_domain_tracking_enabled?: boolean | null, > health_alerts_enabled?: boolean | null, > critical_alerts_enabled?: boolean | null, > alert_recipient_email?: string | null, > dns_records?: { > key?: string | null, > domain?: string | null, > name?: string | null, > type?: string | null, > value?: string | null, > status?: string | null, > actual?: string | null > }[] | null > }[] > ``` *** ## Stats ### byCategories `stats.byCategories` Get sending stats broken down by category **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.stats.byCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | Yes | — | | `sending_domain_ids` | `number[]` | No | — | | `sending_streams` | `string[]` | No | — | | `categories` | `string[]` | No | — | | `email_service_providers` | `string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > category?: string | null, > stats: { > delivery_count?: number | null, > delivery_rate?: number | null, > bounce_count?: number | null, > bounce_rate?: number | null, > open_count?: number | null, > open_rate?: number | null, > click_count?: number | null, > click_rate?: number | null, > spam_count?: number | null, > spam_rate?: number | null > } > }[] > ``` *** ### byDate `stats.byDate` Get sending stats broken down by day **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.stats.byDate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | Yes | — | | `sending_domain_ids` | `number[]` | No | — | | `sending_streams` | `string[]` | No | — | | `categories` | `string[]` | No | — | | `email_service_providers` | `string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > date?: string | null, > stats: { > delivery_count?: number | null, > delivery_rate?: number | null, > bounce_count?: number | null, > bounce_rate?: number | null, > open_count?: number | null, > open_rate?: number | null, > click_count?: number | null, > click_rate?: number | null, > spam_count?: number | null, > spam_rate?: number | null > } > }[] > ``` *** ### byDomains `stats.byDomains` Get sending stats broken down by sending domain **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.stats.byDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | Yes | — | | `sending_domain_ids` | `number[]` | No | — | | `sending_streams` | `string[]` | No | — | | `categories` | `string[]` | No | — | | `email_service_providers` | `string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > sending_domain_id?: number | null, > stats: { > delivery_count?: number | null, > delivery_rate?: number | null, > bounce_count?: number | null, > bounce_rate?: number | null, > open_count?: number | null, > open_rate?: number | null, > click_count?: number | null, > click_rate?: number | null, > spam_count?: number | null, > spam_rate?: number | null > } > }[] > ``` *** ### byEsp `stats.byEsp` Get sending stats broken down by recipient email service provider **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.stats.byEsp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | Yes | — | | `sending_domain_ids` | `number[]` | No | — | | `sending_streams` | `string[]` | No | — | | `categories` | `string[]` | No | — | | `email_service_providers` | `string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > email_service_provider?: string | null, > stats: { > delivery_count?: number | null, > delivery_rate?: number | null, > bounce_count?: number | null, > bounce_rate?: number | null, > open_count?: number | null, > open_rate?: number | null, > click_count?: number | null, > click_rate?: number | null, > spam_count?: number | null, > spam_rate?: number | null > } > }[] > ``` *** ### get `stats.get` Get aggregated sending stats for a date range **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.stats.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | Yes | — | | `sending_domain_ids` | `number[]` | No | — | | `sending_streams` | `string[]` | No | — | | `categories` | `string[]` | No | — | | `email_service_providers` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `delivery_count` | `number` | No | — | | `delivery_rate` | `number` | No | — | | `bounce_count` | `number` | No | — | | `bounce_rate` | `number` | No | — | | `open_count` | `number` | No | — | | `open_rate` | `number` | No | — | | `click_count` | `number` | No | — | | `click_rate` | `number` | No | — | | `spam_count` | `number` | No | — | | `spam_rate` | `number` | No | — | *** ## Suppressions ### list `suppressions.list` List (and optionally search) suppressed email addresses **Risk:** `read` ```ts theme={null} await corsair.mailtrap.api.suppressions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > type?: hard bounce | spam complaint | unsubscription | manual import | null, > created_at?: string | null, > email: string, > sending_stream?: transactional | bulk | null, > domain_name?: string | null, > message_bounce_category?: string | null, > message_category?: string | null, > message_client_ip?: string | null, > message_created_at?: string | null, > message_outgoing_ip?: string | null, > message_recipient_mx_name?: string | null, > message_sender_email?: string | null, > message_subject?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/mailtrap/database Mailtrap local sync: searchable entities, `.search()` filters, and operators. The Mailtrap plugin syncs data locally. Use `corsair.mailtrap.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Contact Fields Path: `mailtrap.db.contactFields.search` ```ts theme={null} const rows = await corsair.mailtrap.db.contactFields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `merge_tag` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contact Lists Path: `mailtrap.db.contactLists.search` ```ts theme={null} const rows = await corsair.mailtrap.db.contactLists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `mailtrap.db.contacts.search` ```ts theme={null} const rows = await corsair.mailtrap.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Email Templates Path: `mailtrap.db.emailTemplates.search` ```ts theme={null} const rows = await corsair.mailtrap.db.emailTemplates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `body_html` | `string` | equals, contains, startsWith, endsWith, in | | `body_text` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Inboxes Path: `mailtrap.db.inboxes.search` ```ts theme={null} const rows = await corsair.mailtrap.db.inboxes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `email_username` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `number` | equals, gt, gte, lt, lte, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `sent_messages_count` | `number` | equals, gt, gte, lt, lte, in | | `emails_count` | `number` | equals, gt, gte, lt, lte, in | | `emails_unread_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `mailtrap.db.projects.search` ```ts theme={null} const rows = await corsair.mailtrap.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sending Domains Path: `mailtrap.db.sendingDomains.search` ```ts theme={null} const rows = await corsair.mailtrap.db.sendingDomains.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `domain_name` | `string` | equals, contains, startsWith, endsWith, in | | `demo` | `boolean` | equals | | `inbound_enabled` | `boolean` | equals | | `inbound_verified` | `boolean` | equals | | `open_tracking_enabled` | `boolean` | equals | | `click_tracking_enabled` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/mailtrap/overview Email testing and delivery platform for safe staging inboxes and transactional sending. Use **Mailtrap** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 49 typed API operations * 7 synced entities (`contactFields`, `contactLists`, `contacts`, `emailTemplates`, `inboxes`, `projects`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/mailtrap ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/mailtrap ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/mailtrap ``` ```bash bun theme={null} bun add corsair @corsair-dev/mailtrap ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { mailtrap } from '@corsair-dev/mailtrap'; export const corsair = createCorsair({ plugins: [ mailtrap(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} mailtrap() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'mailtrap', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getBillingUsage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.mailtrap.api.account.getBillingUsage({}); ``` **`contactFields.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.mailtrap.api.contactFields.create({}); ``` See the full list on the [API](/plugins/mailtrap/api) page. ## Query synced data Synced entities support `tenant.mailtrap.db..search()` and `.list()`: `contactFields`, `contactLists`, `contacts`, `emailTemplates`, `inboxes`, `projects`, `sendingDomains`. See [Database](/plugins/mailtrap/database) for filters and operators. ## What's next > **[API reference](/plugins/mailtrap/api)** > > Every `mailtrap.api.*` operation with input and output types. > **[Database](/plugins/mailtrap/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/marketstack/api API reference for Marketstack: every `marketstack.api.*` operation with input and output types. Every `marketstack.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Currencies ### list `currencies.list` List all currencies supported by the Marketstack API **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.currencies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Maximum number of results to return (default 100, max 1000) | | `offset` | `number` | No | Number of results to skip, for pagination (default 0) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | Yes | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > limit: number, > offset: number, > count: number, > total: number > } > ``` > **data full type** > > ```ts theme={null} > { > code: string, > symbol?: string, > name?: string, > symbol_native?: string > }[] > ``` *** ## Dividends ### get `dividends.get` Retrieve historical dividend amounts and payment dates for one or more tickers **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.dividends.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbols` | `string[]` | Yes | Ticker symbols to fetch, e.g. \["AAPL", "MSFT"] (max 100) | | `dateFrom` | `string` | No | Only return dividends on or after this date (YYYY-MM-DD) | | `dateTo` | `string` | No | Only return dividends on or before this date (YYYY-MM-DD) | | `limit` | `number` | No | Maximum number of results to return (default 100, max 1000) | | `offset` | `number` | No | Number of results to skip, for pagination (default 0) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | Yes | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > limit: number, > offset: number, > count: number, > total: number > } > ``` > **data full type** > > ```ts theme={null} > { > symbol: string, > date: string, > dividend: number, > payment_date?: string | null, > record_date?: string | null, > declaration_date?: string | null, > distr_freq?: string | null > }[] > ``` *** ## Eod ### get `eod.get` Retrieve end-of-day (EOD) OHLCV data for one or more ticker symbols **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.eod.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbols` | `string[]` | Yes | Ticker symbols to fetch, e.g. \["AAPL", "MSFT"] (max 100) | | `exchange` | `string` | No | Filter by stock exchange MIC | | `sort` | `ASC \| DESC` | No | Sort order by date (default DESC) | | `dateFrom` | `string` | No | Only return data on or after this date (YYYY-MM-DD) | | `dateTo` | `string` | No | Only return data on or before this date (YYYY-MM-DD) | | `limit` | `number` | No | Maximum number of results to return (default 100, max 1000) | | `offset` | `number` | No | Number of results to skip, for pagination (default 0) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | Yes | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > limit: number, > offset: number, > count: number, > total: number > } > ``` > **data full type** > > ```ts theme={null} > { > open?: number | null, > high?: number | null, > low?: number | null, > close?: number | null, > volume?: number | null, > adj_high?: number | null, > adj_low?: number | null, > adj_close?: number | null, > adj_open?: number | null, > adj_volume?: number | null, > split_factor?: number | null, > dividend?: number | null, > name?: string, > exchange_code?: string, > asset_type?: string, > price_currency?: string, > symbol: string, > exchange?: string, > date: string > }[] > ``` *** ## Exchanges ### get `exchanges.get` Retrieve exchange details by MIC, including location, status, and operational fields **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.exchanges.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mic` | `string` | Yes | Market Identifier Code of the exchange, e.g. "XNAS" | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `acronym` | `string` | No | — | | `mic` | `string` | Yes | — | | `country` | `string` | No | — | | `country_code` | `string` | No | — | | `city` | `string` | No | — | | `website` | `string` | No | — | | `operating_mic` | `string` | No | — | | `oprt_sgmt` | `string` | No | — | | `legal_entity_name` | `string` | No | — | | `exchange_lei` | `string` | No | — | | `market_category_code` | `string` | No | — | | `exchange_status` | `string` | No | — | | `date_creation` | `object` | No | — | | `date_last_update` | `object` | No | — | | `date_last_validation` | `object` | No | — | | `date_expiry` | `object` | No | — | | `comments` | `string` | No | — | > **date\_creation full type** > > ```ts theme={null} > string | { > date?: string, > timezone_type?: number, > timezone?: string > } > ``` > **date\_last\_update full type** > > ```ts theme={null} > string | { > date?: string, > timezone_type?: number, > timezone?: string > } > ``` > **date\_last\_validation full type** > > ```ts theme={null} > string | { > date?: string, > timezone_type?: number, > timezone?: string > } > ``` > **date\_expiry full type** > > ```ts theme={null} > string | { > date?: string, > timezone_type?: number, > timezone?: string > } > ``` *** ### list `exchanges.list` List or search the stock exchanges supported by Marketstack **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.exchanges.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Search exchanges by name, acronym, or MIC | | `limit` | `number` | No | Maximum number of results to return (default 100, max 1000) | | `offset` | `number` | No | Number of results to skip, for pagination (default 0) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | Yes | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > limit: number, > offset: number, > count: number, > total: number > } > ``` > **data full type** > > ```ts theme={null} > { > name?: string, > acronym?: string | null, > mic: string, > country?: string | null, > country_code?: string | null, > city?: string | null, > website?: string | null, > operating_mic?: string, > oprt_sgmt?: string, > legal_entity_name?: string, > exchange_lei?: string, > market_category_code?: string, > exchange_status?: string, > date_creation?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > date_last_update?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > date_last_validation?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > date_expiry?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > comments?: string | null > }[] > ``` *** ## Splits ### get `splits.get` Retrieve historical stock split data for one or more ticker symbols **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.splits.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbols` | `string[]` | Yes | Ticker symbols to fetch, e.g. \["AAPL", "MSFT"] (max 100) | | `dateFrom` | `string` | No | Only return splits on or after this date (YYYY-MM-DD) | | `dateTo` | `string` | No | Only return splits on or before this date (YYYY-MM-DD) | | `limit` | `number` | No | Maximum number of results to return (default 100, max 1000) | | `offset` | `number` | No | Number of results to skip, for pagination (default 0) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | Yes | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > limit: number, > offset: number, > count: number, > total: number > } > ``` > **data full type** > > ```ts theme={null} > { > symbol: string, > date: string, > split_factor: number, > stock_split?: string | null > }[] > ``` *** ## Tickers ### get `tickers.get` Retrieve detailed ticker information including exchange, sector, and industry **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.tickers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | Ticker symbol, e.g. "AAPL" | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `symbol` | `string` | Yes | — | | `has_intraday` | `boolean` | No | — | | `has_eod` | `boolean` | No | — | | `country` | `string` | No | — | | `cik` | `string` | No | — | | `isin` | `string` | No | — | | `cusip` | `string` | No | — | | `ein_employer_id` | `string` | No | — | | `lei` | `string` | No | — | | `series_id` | `string` | No | — | | `item_type` | `string` | No | — | | `sector` | `string` | No | — | | `industry` | `string` | No | — | | `sic_code` | `string` | No | — | | `sic_name` | `string` | No | — | | `stock_exchange` | `object` | No | — | > **stock\_exchange full type** > > ```ts theme={null} > { > name?: string, > acronym?: string | null, > mic?: string, > country?: string | null, > country_code?: string | null, > city?: string | null, > website?: string | null, > operating_mic?: string, > oprt_sgmt?: string, > legal_entity_name?: string, > exchange_lei?: string, > market_category_code?: string, > exchange_status?: string, > date_creation?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > date_last_update?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > date_last_validation?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > date_expiry?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > comments?: string | null > } > ``` *** ### getEod `tickers.getEod` Retrieve historical end-of-day (EOD) price data for a specific ticker symbol **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.tickers.getEod({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | Ticker symbol, e.g. "AAPL" | | `sort` | `ASC \| DESC` | No | Sort order by date (default DESC) | | `dateFrom` | `string` | No | Only return data on or after this date (YYYY-MM-DD) | | `dateTo` | `string` | No | Only return data on or before this date (YYYY-MM-DD) | | `limit` | `number` | No | Maximum number of results to return (default 100, max 1000) | | `offset` | `number` | No | Number of results to skip, for pagination (default 0) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | Yes | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > limit: number, > offset: number, > count: number, > total: number > } > ``` > **data full type** > > ```ts theme={null} > { > open?: number | null, > high?: number | null, > low?: number | null, > close?: number | null, > volume?: number | null, > adj_high?: number | null, > adj_low?: number | null, > adj_close?: number | null, > adj_open?: number | null, > adj_volume?: number | null, > split_factor?: number | null, > dividend?: number | null, > name?: string, > exchange_code?: string, > asset_type?: string, > price_currency?: string, > symbol: string, > exchange?: string, > date: string > }[] > ``` *** ### getEodLatest `tickers.getEodLatest` Retrieve the most recent end-of-day (EOD) data available for a specific ticker symbol **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.tickers.getEodLatest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | Ticker symbol, e.g. "AAPL" | **Output** | Name | Type | Required | Description | | - | - | - | - | | `open` | `number` | No | — | | `high` | `number` | No | — | | `low` | `number` | No | — | | `close` | `number` | No | — | | `volume` | `number` | No | — | | `adj_high` | `number` | No | — | | `adj_low` | `number` | No | — | | `adj_close` | `number` | No | — | | `adj_open` | `number` | No | — | | `adj_volume` | `number` | No | — | | `split_factor` | `number` | No | — | | `dividend` | `number` | No | — | | `name` | `string` | No | — | | `exchange_code` | `string` | No | — | | `asset_type` | `string` | No | — | | `price_currency` | `string` | No | — | | `symbol` | `string` | Yes | — | | `exchange` | `string` | No | — | | `date` | `string` | Yes | — | *** ### list `tickers.list` List or search the stock tickers supported by Marketstack **Risk:** `read` ```ts theme={null} await corsair.marketstack.api.tickers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | Search tickers by name or symbol, e.g. "Apple" | | `exchange` | `string` | No | Filter by stock exchange MIC | | `limit` | `number` | No | Maximum number of results to return (default 100, max 1000) | | `offset` | `number` | No | Number of results to skip, for pagination (default 0) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pagination` | `object` | Yes | — | | `data` | `object[]` | Yes | — | > **pagination full type** > > ```ts theme={null} > { > limit: number, > offset: number, > count: number, > total: number > } > ``` > **data full type** > > ```ts theme={null} > { > name?: string, > symbol: string, > has_intraday?: boolean, > has_eod?: boolean, > country?: string | null, > cik?: string, > isin?: string, > cusip?: string, > ein_employer_id?: string, > lei?: string, > series_id?: string, > item_type?: string, > sector?: string, > industry?: string, > sic_code?: string, > sic_name?: string, > stock_exchange?: { > name?: string, > acronym?: string | null, > mic?: string, > country?: string | null, > country_code?: string | null, > city?: string | null, > website?: string | null, > operating_mic?: string, > oprt_sgmt?: string, > legal_entity_name?: string, > exchange_lei?: string, > market_category_code?: string, > exchange_status?: string, > date_creation?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > date_last_update?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > date_last_validation?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > date_expiry?: string | { > date?: string, > timezone_type?: number, > timezone?: string > } | null, > comments?: string | null > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/marketstack/database Marketstack local sync: searchable entities, `.search()` filters, and operators. The Marketstack plugin syncs data locally. Use `corsair.marketstack.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Currencies Path: `marketstack.db.currencies.search` ```ts theme={null} const rows = await corsair.marketstack.db.currencies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `symbol_native` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Dividends Path: `marketstack.db.dividends.search` ```ts theme={null} const rows = await corsair.marketstack.db.dividends.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `dividend` | `number` | equals, gt, gte, lt, lte, in | | `payment_date` | `string` | equals, contains, startsWith, endsWith, in | | `record_date` | `string` | equals, contains, startsWith, endsWith, in | | `declaration_date` | `string` | equals, contains, startsWith, endsWith, in | | `distr_freq` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Eod Bars Path: `marketstack.db.eodBars.search` ```ts theme={null} const rows = await corsair.marketstack.db.eodBars.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `open` | `number` | equals, gt, gte, lt, lte, in | | `high` | `number` | equals, gt, gte, lt, lte, in | | `low` | `number` | equals, gt, gte, lt, lte, in | | `close` | `number` | equals, gt, gte, lt, lte, in | | `volume` | `number` | equals, gt, gte, lt, lte, in | | `adj_high` | `number` | equals, gt, gte, lt, lte, in | | `adj_low` | `number` | equals, gt, gte, lt, lte, in | | `adj_close` | `number` | equals, gt, gte, lt, lte, in | | `adj_open` | `number` | equals, gt, gte, lt, lte, in | | `adj_volume` | `number` | equals, gt, gte, lt, lte, in | | `split_factor` | `number` | equals, gt, gte, lt, lte, in | | `dividend` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `exchange_code` | `string` | equals, contains, startsWith, endsWith, in | | `asset_type` | `string` | equals, contains, startsWith, endsWith, in | | `price_currency` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `exchange` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Exchanges Path: `marketstack.db.exchanges.search` ```ts theme={null} const rows = await corsair.marketstack.db.exchanges.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `acronym` | `string` | equals, contains, startsWith, endsWith, in | | `mic` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `country_code` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `operating_mic` | `string` | equals, contains, startsWith, endsWith, in | | `oprt_sgmt` | `string` | equals, contains, startsWith, endsWith, in | | `legal_entity_name` | `string` | equals, contains, startsWith, endsWith, in | | `exchange_lei` | `string` | equals, contains, startsWith, endsWith, in | | `market_category_code` | `string` | equals, contains, startsWith, endsWith, in | | `exchange_status` | `string` | equals, contains, startsWith, endsWith, in | | `comments` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Splits Path: `marketstack.db.splits.search` ```ts theme={null} const rows = await corsair.marketstack.db.splits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `split_factor` | `number` | equals, gt, gte, lt, lte, in | | `stock_split` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tickers Path: `marketstack.db.tickers.search` ```ts theme={null} const rows = await corsair.marketstack.db.tickers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `has_intraday` | `boolean` | equals | | `has_eod` | `boolean` | equals | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `cik` | `string` | equals, contains, startsWith, endsWith, in | | `isin` | `string` | equals, contains, startsWith, endsWith, in | | `cusip` | `string` | equals, contains, startsWith, endsWith, in | | `ein_employer_id` | `string` | equals, contains, startsWith, endsWith, in | | `lei` | `string` | equals, contains, startsWith, endsWith, in | | `series_id` | `string` | equals, contains, startsWith, endsWith, in | | `item_type` | `string` | equals, contains, startsWith, endsWith, in | | `sector` | `string` | equals, contains, startsWith, endsWith, in | | `industry` | `string` | equals, contains, startsWith, endsWith, in | | `sic_code` | `string` | equals, contains, startsWith, endsWith, in | | `sic_name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/marketstack/overview Stock market data API for real-time and historical end-of-day exchange prices worldwide. Use **Marketstack** through Corsair: one client, typed API calls, local DB sync. This plugin calls Marketstack's v2 API over HTTPS (`https://api.marketstack.com/v2`), since every request carries your `access_key` as a query parameter. HTTPS is available on every Marketstack plan, including free — no paid plan is required. **What you get:** * 10 typed API operations * 6 synced entities (`currencies`, `dividends`, `eodBars`, `exchanges`, `splits`, `tickers`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/marketstack ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/marketstack ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/marketstack ``` ```bash bun theme={null} bun add corsair @corsair-dev/marketstack ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { marketstack } from '@corsair-dev/marketstack'; export const corsair = createCorsair({ plugins: [ marketstack(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} marketstack() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'marketstack', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`currencies.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.marketstack.api.currencies.list({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/marketstack/api) reference.* See the full list on the [API](/plugins/marketstack/api) page. ## Query synced data Synced entities support `tenant.marketstack.db..search()` and `.list()`: `currencies`, `dividends`, `eodBars`, `exchanges`, `splits`, `tickers`. See [Database](/plugins/marketstack/database) for filters and operators. ## What's next > **[API reference](/plugins/marketstack/api)** > > Every `marketstack.api.*` operation with input and output types. > **[Database](/plugins/marketstack/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/merriamwebsterdict/api API reference for Merriam-Webster: every `merriamwebsterdict.api.*` operation with input and output types. Every `merriamwebsterdict.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Words ### get `words.get` Look up a word in Merriam-Webster (collegiate / sd2 / sd3 / sd4), returning definitions, part of speech, pronunciation, etymology, and audio — or spelling suggestions when no entry matches **Risk:** `read` ```ts theme={null} await corsair.merriamwebsterdict.api.words.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `word` | `string` | Yes | The word to look up | **Output** | Name | Type | Required | Description | | - | - | - | - | | `found` | `boolean` | Yes | — | | `entries` | `object[]` | Yes | — | | `suggestions` | `string[]` | Yes | Spelling suggestions when no entry matched | > **entries full type** > > ```ts theme={null} > { > id: string, > headword: string, > partOfSpeech?: string, > pronunciation?: string, > audioUrl?: string, > shortDefinitions: string[], > etymology?: string[], > stems: string[], > offensive: boolean > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/merriamwebsterdict/database Merriam-Webster local sync: searchable entities, `.search()` filters, and operators. The Merriam-Webster plugin syncs data locally. Use `corsair.merriamwebsterdict.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Entries Path: `merriamwebsterdict.db.entries.search` ```ts theme={null} const rows = await corsair.merriamwebsterdict.db.entries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `src` | `string` | equals, contains, startsWith, endsWith, in | | `section` | `string` | equals, contains, startsWith, endsWith, in | | `offensive` | `boolean` | equals | | `hw` | `string` | equals, contains, startsWith, endsWith, in | | `fl` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `mw` | `string` | equals, contains, startsWith, endsWith, in | | `audioUrl` | `string` | equals, contains, startsWith, endsWith, in | | `captured_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/merriamwebsterdict/overview Dictionary API for definitions, thesaurus entries, and English language reference data. Use **Merriam-Webster** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 1 typed API operations * 1 synced entity (`entries`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/merriamwebsterdict ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/merriamwebsterdict ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/merriamwebsterdict ``` ```bash bun theme={null} bun add corsair @corsair-dev/merriamwebsterdict ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { merriamwebsterdict } from '@corsair-dev/merriamwebsterdict'; export const corsair = createCorsair({ plugins: [ merriamwebsterdict(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} merriamwebsterdict() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'merriamwebsterdict', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`words.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.merriamwebsterdict.api.words.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/merriamwebsterdict/api) reference.* See the full list on the [API](/plugins/merriamwebsterdict/api) page. ## Query synced data Synced entities support `tenant.merriamwebsterdict.db..search()` and `.list()`: `entries`. See [Database](/plugins/merriamwebsterdict/database) for filters and operators. ## What's next > **[API reference](/plugins/merriamwebsterdict/api)** > > Every `merriamwebsterdict.api.*` operation with input and output types. > **[Database](/plugins/merriamwebsterdict/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/minimax/api API reference for MiniMax: every `minimax.api.*` operation with input and output types. Every `minimax.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chat ### completion `chat.completion` Create a chat completion with a MiniMax text model **Risk:** `read` ```ts theme={null} await corsair.minimax.api.chat.completion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `MiniMax-M3.1-Flash-Preview \| MiniMax-M3 \| MiniMax-M2.7 \| MiniMax-M2.7-highspeed \| MiniMax-M2.5 \| MiniMax-M2.5-highspeed \| MiniMax-M2.1 \| MiniMax-M2` | Yes | — | | `messages` | `object[]` | Yes | — | | `max_completion_tokens` | `number` | No | — | | `max_tokens` | `number` | No | — | | `temperature` | `number` | No | — | | `top_p` | `number` | No | — | | `tool_choice` | `none \| auto` | No | — | | `tools` | `object[]` | No | — | | `response_format` | `object` | No | — | | `mask_sensitive_info` | `boolean` | No | — | | `stream` | `false` | No | — | > **messages full type** > > ```ts theme={null} > { > role: system | user | assistant | tool, > name?: string, > content?: string | { > type?: string > }[] | null, > tool_calls?: { > type?: string > }[] > }[] > ``` > **tools full type** > > ```ts theme={null} > { > type: string, > function: { > name: string, > description?: string, > parameters?: { > } > } > }[] > ``` > **response\_format full type** > > ```ts theme={null} > { > type: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `choices` | `object[]` | No | — | | `created` | `number` | No | — | | `model` | `string` | No | — | | `object` | `chat.completion \| chat.completion.chunk` | No | — | | `usage` | `object` | No | — | | `base_resp` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > finish_reason?: string, > index?: number, > message?: { > role: system | user | assistant | tool, > name?: string, > content?: string | { > type?: string > }[] | null, > tool_calls?: { > type?: string > }[] > } > }[] > ``` > **usage full type** > > ```ts theme={null} > { > total_tokens?: number > } > ``` > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### createResponse `chat.createResponse` Create a model response via the Responses API **Risk:** `read` ```ts theme={null} await corsair.minimax.api.chat.createResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `object[]` | Yes | — | | `instructions` | `string` | No | — | | `max_output_tokens` | `number` | No | — | | `temperature` | `number` | No | — | | `top_p` | `number` | No | — | | `service_tier` | `standard \| priority` | No | — | | `tools` | `object[]` | No | — | | `tool_choice` | `none \| auto` | No | — | | `metadata` | `object` | No | — | | `prompt_cache_key` | `string` | No | — | | `text` | `object` | No | — | | `reasoning` | `object` | No | — | | `stream` | `false` | No | — | > **input full type** > > ```ts theme={null} > string | { > type?: message | function_call | function_call_output | reasoning, > role?: user | assistant | system | developer | tool, > content?: string | { > type?: string > }[], > call_id?: string, > name?: string, > arguments?: string, > output?: string | { > type?: string > }[], > summary?: { > }[] > }[] > ``` > **tools full type** > > ```ts theme={null} > { > type: string > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **text full type** > > ```ts theme={null} > { > format?: { > } > } > ``` > **reasoning full type** > > ```ts theme={null} > { > effort?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `object` | `string` | No | — | | `created_at` | `number` | No | — | | `model` | `string` | No | — | | `status` | `completed \| incomplete \| failed` | No | — | | `output` | `object[]` | No | — | | `output_text` | `string` | No | — | | `usage` | `object` | No | — | | `error` | `object` | No | — | | `incomplete_details` | `object` | No | — | | `parallel_tool_calls` | `boolean` | No | — | | `store` | `boolean` | No | — | | `truncation` | `string` | No | — | > **output full type** > > ```ts theme={null} > { > type?: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code?: string, > message?: string > } > ``` > **incomplete\_details full type** > > ```ts theme={null} > { > reason?: string > } > ``` *** ### estimateInputTokens `chat.estimateInputTokens` Estimate the input token count of a request **Risk:** `read` ```ts theme={null} await corsair.minimax.api.chat.estimateInputTokens({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `object[]` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | No | — | | `tool_choice` | `none \| auto` | No | — | | `text` | `object` | No | — | | `reasoning` | `object` | No | — | | `stream` | `false` | No | — | > **input full type** > > ```ts theme={null} > string | { > type?: message | function_call | function_call_output | reasoning, > role?: user | assistant | system | developer | tool, > content?: string | { > type?: string > }[], > call_id?: string, > name?: string, > arguments?: string, > output?: string | { > type?: string > }[], > summary?: { > }[] > }[] > ``` > **tools full type** > > ```ts theme={null} > { > type: string > }[] > ``` > **text full type** > > ```ts theme={null} > { > format?: { > } > } > ``` > **reasoning full type** > > ```ts theme={null} > { > effort?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `response.input_tokens` | Yes | — | | `input_tokens` | `number` | Yes | — | *** ## Files ### delete `files.delete` Delete an uploaded file permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.minimax.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `number` | Yes | — | | `purpose` | `voice_clone \| prompt_audio \| t2a_async \| t2a_async_input \| video_generation` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `number` | No | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### list `files.list` List uploaded files for a purpose **Risk:** `read` ```ts theme={null} await corsair.minimax.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `purpose` | `voice_clone \| prompt_audio \| t2a_async_input \| video_generation_input` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `files` | `object[]` | Yes | — | | `base_resp` | `object` | No | — | > **files full type** > > ```ts theme={null} > { > file_id?: number, > bytes?: number, > created_at?: number, > filename?: string, > purpose?: string, > download_url?: string > }[] > ``` > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### retrieve `files.retrieve` Retrieve the metadata of an uploaded file **Risk:** `read` ```ts theme={null} await corsair.minimax.api.files.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | Yes | — | | `base_resp` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > file_id?: number, > bytes?: number, > created_at?: number, > filename?: string, > purpose?: string, > download_url?: string > } > ``` > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ## Image ### generate `image.generate` Generate images from a prompt, optionally with a subject reference **Risk:** `write` ```ts theme={null} await corsair.minimax.api.image.generate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `image-01 \| image-01-live` | Yes | — | | `prompt` | `string` | Yes | — | | `subject_reference` | `object[]` | No | — | | `aspect_ratio` | `1:1 \| 16:9 \| 4:3 \| 3:2 \| 2:3 \| 3:4 \| 9:16 \| 21:9` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `response_format` | `url \| base64` | No | — | | `seed` | `number` | No | — | | `n` | `number` | No | — | | `prompt_optimizer` | `boolean` | No | — | > **subject\_reference full type** > > ```ts theme={null} > { > type: character, > image_file: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `metadata` | `object` | No | — | | `id` | `string` | No | — | | `base_resp` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > image_urls?: string[], > image_base64?: string[] > } > ``` > **metadata full type** > > ```ts theme={null} > { > success_count?: number, > failed_count?: number > } > ``` > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ## Models ### list `models.list` List available models (OpenAI-compatible) **Risk:** `read` ```ts theme={null} await corsair.minimax.api.models.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object?: string, > created?: number, > owned_by?: string > }[] > ``` *** ### listAnthropic `models.listAnthropic` List available models (Anthropic-compatible) **Risk:** `read` ```ts theme={null} await corsair.minimax.api.models.listAnthropic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after_id` | `string` | No | — | | `before_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `has_more` | `boolean` | No | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > created_at?: string, > display_name?: string, > type?: string > }[] > ``` *** ### retrieve `models.retrieve` Retrieve a model (OpenAI-compatible) **Risk:** `read` ```ts theme={null} await corsair.minimax.api.models.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `owned_by` | `string` | No | — | *** ### retrieveAnthropic `models.retrieveAnthropic` Retrieve a model (Anthropic-compatible) **Risk:** `read` ```ts theme={null} await corsair.minimax.api.models.retrieveAnthropic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `display_name` | `string` | No | — | | `type` | `string` | No | — | *** ## Music ### coverPreprocess `music.coverPreprocess` Preprocess reference audio for two-step music cover generation **Risk:** `write` ```ts theme={null} await corsair.minimax.api.music.coverPreprocess({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `music-cover` | Yes | — | | `audio_url` | `string` | No | — | | `audio_base64` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cover_feature_id` | `string` | No | — | | `formatted_lyrics` | `string` | No | — | | `structure_result` | `string` | No | — | | `audio_duration` | `number` | No | — | | `trace_id` | `string` | No | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### generate `music.generate` Generate a song from a prompt and lyrics **Risk:** `write` ```ts theme={null} await corsair.minimax.api.music.generate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `music-3.0 \| music-2.6 \| music-cover \| music-3.0-free \| music-2.6-free \| music-cover-free` | Yes | — | | `prompt` | `string` | No | — | | `lyrics` | `string` | No | — | | `output_format` | `url \| hex` | No | — | | `audio_setting` | `object` | No | — | | `lyrics_optimizer` | `boolean` | No | — | | `is_instrumental` | `boolean` | No | — | | `audio_url` | `string` | No | — | | `audio_base64` | `string` | No | — | | `cover_feature_id` | `string` | No | — | > **audio\_setting full type** > > ```ts theme={null} > { > sample_rate?: number, > bitrate?: number, > format?: mp3 | wav | pcm > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `base_resp` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > status?: number, > audio?: string > } > ``` > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### generateLyrics `music.generateLyrics` Generate or edit song lyrics **Risk:** `write` ```ts theme={null} await corsair.minimax.api.music.generateLyrics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mode` | `write_full_song \| edit` | Yes | — | | `prompt` | `string` | No | — | | `lyrics` | `string` | No | — | | `title` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `song_title` | `string` | No | — | | `style_tags` | `string` | No | — | | `lyrics` | `string` | No | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ## Speech ### createAsyncTask `speech.createAsyncTask` Create an asynchronous long-text speech synthesis task **Risk:** `write` ```ts theme={null} await corsair.minimax.api.speech.createAsyncTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `speech-2.8-hd \| speech-2.8-turbo \| speech-2.6-hd \| speech-2.6-turbo \| speech-02-hd \| speech-02-turbo \| speech-01-hd \| speech-01-turbo` | Yes | — | | `text` | `string` | No | — | | `text_file_id` | `number` | No | — | | `voice_setting` | `object` | Yes | — | | `audio_setting` | `object` | No | — | | `pronunciation_dict` | `object` | No | — | | `language_boost` | `Chinese \| Chinese,Yue \| English \| Arabic \| Russian \| Spanish \| French \| Portuguese \| German \| Turkish \| Dutch \| Ukrainian \| Vietnamese \| Indonesian \| Japanese \| Italian \| Korean \| Thai \| Polish \| Romanian \| Greek \| Czech \| Finnish \| Hindi \| Bulgarian \| Danish \| Hebrew \| Malay \| Persian \| Slovak \| Swedish \| Croatian \| Filipino \| Hungarian \| Norwegian \| Slovenian \| Catalan \| Nynorsk \| Tamil \| Afrikaans \| auto` | No | — | | `voice_modify` | `object` | No | — | > **voice\_setting full type** > > ```ts theme={null} > { > voice_id: string, > speed?: number, > vol?: number, > pitch?: number, > emotion?: happy | sad | angry | fearful | disgusted | surprised | calm | fluent | whisper, > english_normalization?: boolean, > latex_read?: boolean > } > ``` > **audio\_setting full type** > > ```ts theme={null} > { > audio_sample_rate?: number, > bitrate?: number, > format?: mp3 | pcm | flac | wav | pcmu_raw | pcmu_wav | opus, > channel?: number > } > ``` > **pronunciation\_dict full type** > > ```ts theme={null} > { > tone?: string[] > } > ``` > **voice\_modify full type** > > ```ts theme={null} > { > pitch?: number, > intensity?: number, > timbre?: number, > sound_effects?: spacious_echo | auditorium_echo | lofi_telephone | robotic > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `file_id` | `number` | No | — | | `task_token` | `string` | No | — | | `usage_characters` | `number` | No | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### queryAsyncTask `speech.queryAsyncTask` Query the status of an asynchronous speech synthesis task **Risk:** `read` ```ts theme={null} await corsair.minimax.api.speech.queryAsyncTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string \| number` | No | — | | `status` | `success \| failed \| expired \| processing \| Success \| Failed \| Expired \| Processing` | Yes | — | | `file_id` | `number` | No | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### t2a `speech.t2a` Synthesize speech from text (synchronous T2A) **Risk:** `write` ```ts theme={null} await corsair.minimax.api.speech.t2a({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `speech-2.8-hd \| speech-2.8-turbo \| speech-2.6-hd \| speech-2.6-turbo \| speech-02-hd \| speech-02-turbo \| speech-01-hd \| speech-01-turbo` | Yes | — | | `text` | `string` | Yes | — | | `voice_setting` | `object` | No | — | | `audio_setting` | `object` | No | — | | `pronunciation_dict` | `object` | No | — | | `timbre_weights` | `object[]` | No | — | | `language_boost` | `Chinese \| Chinese,Yue \| English \| Arabic \| Russian \| Spanish \| French \| Portuguese \| German \| Turkish \| Dutch \| Ukrainian \| Vietnamese \| Indonesian \| Japanese \| Italian \| Korean \| Thai \| Polish \| Romanian \| Greek \| Czech \| Finnish \| Hindi \| Bulgarian \| Danish \| Hebrew \| Malay \| Persian \| Slovak \| Swedish \| Croatian \| Filipino \| Hungarian \| Norwegian \| Slovenian \| Catalan \| Nynorsk \| Tamil \| Afrikaans \| auto` | No | — | | `text_normalization_mode` | `basic \| quality` | No | — | | `voice_modify` | `object` | No | — | | `subtitle_enable` | `boolean` | No | — | | `subtitle_type` | `sentence \| word \| word_streaming` | No | — | | `output_format` | `url \| hex` | No | — | > **voice\_setting full type** > > ```ts theme={null} > { > voice_id: string, > speed?: number, > vol?: number, > pitch?: number, > emotion?: happy | sad | angry | fearful | disgusted | surprised | calm | fluent | whisper, > text_normalization?: boolean, > latex_read?: boolean > } > ``` > **audio\_setting full type** > > ```ts theme={null} > { > sample_rate?: number, > bitrate?: number, > format?: mp3 | pcm | flac | wav | pcmu_raw | pcmu_wav | opus, > channel?: number, > force_cbr?: boolean > } > ``` > **pronunciation\_dict full type** > > ```ts theme={null} > { > tone?: string[] > } > ``` > **timbre\_weights full type** > > ```ts theme={null} > { > voice_id: string, > weight: number > }[] > ``` > **voice\_modify full type** > > ```ts theme={null} > { > pitch?: number, > intensity?: number, > timbre?: number, > sound_effects?: spacious_echo | auditorium_echo | lofi_telephone | robotic > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `trace_id` | `string` | No | — | | `extra_info` | `object` | No | — | | `base_resp` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > audio?: string, > status?: number, > subtitle_file?: string, > subtitle?: string, > subtitles?: { > }[] > } > ``` > **extra\_info full type** > > ```ts theme={null} > { > audio_length?: number, > audio_sample_rate?: number, > audio_size?: number, > bitrate?: number, > audio_format?: string, > audio_channel?: number, > usage_characters?: number, > word_count?: number > } > ``` > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ## Video ### cancelOrDeleteV2 `video.cancelOrDeleteV2` Cancel a queued task or delete a finished task record permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.minimax.api.video.cancelOrDeleteV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | No | — | | `action` | `cancelled \| deleted` | No | — | | `status` | `cancelled \| deleted` | No | — | *** ### contextIr `video.contextIr` Create an H3-Context-IR task that enriches a video prompt **Risk:** `write` ```ts theme={null} await corsair.minimax.api.video.contextIr({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `MiniMax-H3` | Yes | — | | `content` | `object[]` | Yes | — | | `duration` | `number` | Yes | — | | `ratio` | `adaptive \| 21:9 \| 16:9 \| 4:3 \| 1:1 \| 3:4 \| 9:16` | No | — | | `callback_url` | `string` | No | — | > **content full type** > > ```ts theme={null} > { > type: text | image_url | video_url | audio_url, > text?: string, > image_url?: { > url: string > }, > video_url?: { > url: string > }, > audio_url?: { > url: string > }, > role?: first_frame | last_frame | reference_image | reference_video | reference_audio > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | *** ### generate `video.generate` Create a Hailuo video generation task (text, image, first/last frame or subject reference) **Risk:** `write` ```ts theme={null} await corsair.minimax.api.video.generate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `MiniMax-Hailuo-2.3 \| MiniMax-Hailuo-2.3-Fast \| MiniMax-Hailuo-02 \| T2V-01-Director \| T2V-01 \| I2V-01-Director \| I2V-01-live \| I2V-01 \| S2V-01` | Yes | — | | `prompt` | `string` | No | — | | `first_frame_image` | `string` | No | — | | `last_frame_image` | `string` | No | — | | `subject_reference` | `object[]` | No | — | | `prompt_optimizer` | `boolean` | No | — | | `fast_pretreatment` | `boolean` | No | — | | `duration` | `number` | No | — | | `resolution` | `512P \| 720P \| 768P \| 1080P` | No | — | | `callback_url` | `string` | No | — | > **subject\_reference full type** > > ```ts theme={null} > { > type: character, > image: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### generateV2 `video.generateV2` Create an H3 multimodal video generation task **Risk:** `write` ```ts theme={null} await corsair.minimax.api.video.generateV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `MiniMax-H3 \| MiniMax-H3-Max` | Yes | — | | `content` | `object[]` | Yes | — | | `resolution` | `480P \| 768P \| 2K` | Yes | — | | `duration` | `number` | Yes | — | | `ratio` | `adaptive \| 21:9 \| 16:9 \| 4:3 \| 1:1 \| 3:4 \| 9:16` | No | — | | `extra` | `object` | No | — | | `callback_url` | `string` | No | — | > **content full type** > > ```ts theme={null} > { > type: text | image_url | video_url | audio_url, > text?: string, > image_url?: { > url: string > }, > video_url?: { > url: string > }, > audio_url?: { > url: string > }, > role?: first_frame | last_frame | reference_image | reference_video | reference_audio > }[] > ``` > **extra full type** > > ```ts theme={null} > { > prompt_expansion_mode?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | *** ### listV2 `video.listV2` List H3 video tasks from the last 7 days **Risk:** `read` ```ts theme={null} await corsair.minimax.api.video.listV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageNum` | `number` | No | — | | `pageSize` | `number` | No | — | | `status` | `queued \| running \| succeeded \| failed \| cancelled` | No | — | | `taskIds` | `string[]` | No | — | | `model` | `string` | No | — | | `taskType` | `generation \| h3_context_ir \| regeneration` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `total` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > model?: string, > status?: queued | running | succeeded | failed | cancelled, > error?: { > code?: string, > message?: string > }, > created_at?: number, > updated_at?: number, > content?: { > url?: string, > prompt?: string > }, > resolution?: string, > duration?: number, > usage?: { > }, > ratio?: string, > task_type?: generation | h3_context_ir | regeneration, > modality?: video | text > }[] > ``` *** ### query `video.query` Query a Hailuo video generation task **Risk:** `read` ```ts theme={null} await corsair.minimax.api.video.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | No | — | | `status` | `Preparing \| Queueing \| Processing \| Success \| Fail` | No | — | | `file_id` | `string` | No | — | | `video_width` | `number` | No | — | | `video_height` | `number` | No | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### queryV2 `video.queryV2` Query an H3 video task by id **Risk:** `read` ```ts theme={null} await corsair.minimax.api.video.queryV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task` | `object` | Yes | — | > **task full type** > > ```ts theme={null} > { > id?: string, > model?: string, > status?: queued | running | succeeded | failed | cancelled, > error?: { > code?: string, > message?: string > }, > created_at?: number, > updated_at?: number, > content?: { > url?: string, > prompt?: string > }, > resolution?: string, > duration?: number, > usage?: { > }, > ratio?: string, > task_type?: generation | h3_context_ir | regeneration, > modality?: video | text > } > ``` *** ### regenerate `video.regenerate` Create a 2K video regeneration task **Risk:** `write` ```ts theme={null} await corsair.minimax.api.video.regenerate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `MiniMax-H3` | Yes | — | | `source_task_id` | `string` | No | — | | `content` | `object[]` | No | — | | `resolution` | `2K` | Yes | — | | `callback_url` | `string` | No | — | | `aigc_watermark` | `boolean` | No | — | > **content full type** > > ```ts theme={null} > { > type: text | image_url | video_url | audio_url, > text?: string, > image_url?: { > url: string > }, > video_url?: { > url: string > }, > audio_url?: { > url: string > }, > role?: base_video | first_frame | last_frame | reference_image | reference_video | reference_audio > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | *** ### templateGenerate `video.templateGenerate` Create a Video Agent task from a template **Risk:** `write` ```ts theme={null} await corsair.minimax.api.video.templateGenerate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template_id` | `string` | Yes | — | | `text_inputs` | `object[]` | No | — | | `media_inputs` | `object[]` | No | — | | `callback_url` | `string` | No | — | > **text\_inputs full type** > > ```ts theme={null} > { > value: string > }[] > ``` > **media\_inputs full type** > > ```ts theme={null} > { > value: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### templateQuery `video.templateQuery` Query a Video Agent template generation task **Risk:** `read` ```ts theme={null} await corsair.minimax.api.video.templateQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | No | — | | `status` | `Preparing \| Queueing \| Processing \| Success \| Fail` | No | — | | `video_url` | `string` | No | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ## Voice ### clone `voice.clone` Clone a voice from uploaded audio **Risk:** `write` ```ts theme={null} await corsair.minimax.api.voice.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `number` | Yes | — | | `voice_id` | `string` | Yes | — | | `clone_prompt` | `object` | No | — | | `text` | `string` | No | — | | `model` | `speech-2.8-hd \| speech-2.8-turbo \| speech-2.6-hd \| speech-2.6-turbo \| speech-02-hd \| speech-02-turbo \| speech-01-hd \| speech-01-turbo` | No | — | | `language_boost` | `Chinese \| Chinese,Yue \| English \| Arabic \| Russian \| Spanish \| French \| Portuguese \| German \| Turkish \| Dutch \| Ukrainian \| Vietnamese \| Indonesian \| Japanese \| Italian \| Korean \| Thai \| Polish \| Romanian \| Greek \| Czech \| Finnish \| Hindi \| Bulgarian \| Danish \| Hebrew \| Malay \| Persian \| Slovak \| Swedish \| Croatian \| Filipino \| Hungarian \| Norwegian \| Slovenian \| Catalan \| Nynorsk \| Tamil \| Afrikaans \| auto` | No | — | | `text_validation` | `string` | No | — | | `accuracy` | `number` | No | — | | `need_noise_reduction` | `boolean` | No | — | | `need_volume_normalization` | `boolean` | No | — | | `aigc_watermark` | `boolean` | No | — | > **clone\_prompt full type** > > ```ts theme={null} > { > prompt_audio: number, > prompt_text: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `demo_audio` | `string` | No | — | | `input_sensitive` | `object` | No | — | | `extra_info` | `object` | No | — | | `base_resp` | `object` | No | — | > **input\_sensitive full type** > > ```ts theme={null} > { > type?: number > } > ``` > **extra\_info full type** > > ```ts theme={null} > { > } > ``` > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### delete `voice.delete` Delete a generated voice permanently \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.minimax.api.voice.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `voice_type` | `voice_cloning \| voice_generation` | Yes | — | | `voice_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `voice_id` | `string` | No | — | | `created_time` | `string` | No | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### design `voice.design` Design a custom voice from a description **Risk:** `write` ```ts theme={null} await corsair.minimax.api.voice.design({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `preview_text` | `string` | Yes | — | | `voice_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `voice_id` | `string` | Yes | — | | `trial_audio` | `string` | No | — | | `base_resp` | `object` | No | — | > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** ### list `voice.list` List system, cloned and generated voices **Risk:** `read` ```ts theme={null} await corsair.minimax.api.voice.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `voice_type` | `system \| voice_cloning \| voice_generation \| all` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `system_voice` | `object[]` | No | — | | `voice_cloning` | `object[]` | No | — | | `voice_generation` | `object[]` | No | — | | `base_resp` | `object` | No | — | > **system\_voice full type** > > ```ts theme={null} > { > voice_id: string, > voice_name?: string, > description?: string[], > created_time?: string > }[] > ``` > **voice\_cloning full type** > > ```ts theme={null} > { > voice_id: string, > voice_name?: string, > description?: string[], > created_time?: string > }[] > ``` > **voice\_generation full type** > > ```ts theme={null} > { > voice_id: string, > voice_name?: string, > description?: string[], > created_time?: string > }[] > ``` > **base\_resp full type** > > ```ts theme={null} > { > status_code: number, > status_msg?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/minimax/database MiniMax local sync: searchable entities, `.search()` filters, and operators. The MiniMax plugin syncs data locally. Use `corsair.minimax.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/minimax/overview MiniMax AI platform: chat, speech, voice, music, image and video generation. Use **MiniMax** through Corsair: one client, typed API calls. **What you get:** * 31 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/minimax ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/minimax ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/minimax ``` ```bash bun theme={null} bun add corsair @corsair-dev/minimax ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { minimax } from '@corsair-dev/minimax'; export const corsair = createCorsair({ plugins: [ minimax(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} minimax() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'minimax', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`chat.completion`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.minimax.api.chat.completion({}); ``` **`files.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.minimax.api.files.delete({}); ``` See the full list on the [API](/plugins/minimax/api) page. ## What's next > **[API reference](/plugins/minimax/api)** > > Every `minimax.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/monday/api API reference for Monday.com: every `monday.api.*` operation with input and output types. Every `monday.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Boards ### archive `boards.archive` Archive a board **Risk:** `write` ```ts theme={null} await corsair.monday.api.boards.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `archive_board` | `object` | Yes | — | > **archive\_board full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### create `boards.create` Create a new board **Risk:** `write` ```ts theme={null} await corsair.monday.api.boards.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_name` | `string` | Yes | — | | `board_kind` | `public \| private \| share` | No | — | | `workspace_id` | `number` | No | — | | `template_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `create_board` | `object` | Yes | — | > **create\_board full type** > > ```ts theme={null} > { > id: string, > name?: string > } > ``` *** ### delete `boards.delete` Permanently delete a board **Risk:** `destructive` ```ts theme={null} await corsair.monday.api.boards.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `delete_board` | `object` | Yes | — | > **delete\_board full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### duplicate `boards.duplicate` Duplicate a board **Risk:** `write` ```ts theme={null} await corsair.monday.api.boards.duplicate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `duplicate_type` | `duplicate_board_with_structure \| duplicate_board_with_pulses \| duplicate_board_with_pulses_and_updates` | No | — | | `board_name` | `string` | No | — | | `workspace_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `duplicate_board` | `object` | Yes | — | > **duplicate\_board full type** > > ```ts theme={null} > { > board: { > id: string > } > } > ``` *** ### get `boards.get` Get a board by ID with groups and columns **Risk:** `read` ```ts theme={null} await corsair.monday.api.boards.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `boards` | `object[]` | Yes | — | > **boards full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > board_kind?: string, > state?: string, > workspace_id?: string | number | null, > groups?: { > id: string, > title: string, > color?: string, > position?: string, > archived?: boolean > }[], > columns?: { > id: string, > title: string, > type?: string, > settings_str?: string, > description?: string | null > }[] > }[] > ``` *** ### list `boards.list` List all boards **Risk:** `read` ```ts theme={null} await corsair.monday.api.boards.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `page` | `number` | No | — | | `workspace_ids` | `number[]` | No | — | | `board_kind` | `public \| private \| share` | No | — | | `state` | `active \| archived \| deleted \| all` | No | — | | `order_by` | `created_at \| used_at` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `boards` | `object[]` | Yes | — | > **boards full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > board_kind?: string, > state?: string, > workspace_id?: string | number | null > }[] > ``` *** ### update `boards.update` Update a board attribute **Risk:** `write` ```ts theme={null} await corsair.monday.api.boards.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `board_attribute` | `name \| description \| communication` | Yes | — | | `new_value` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `update_board` | `object` | Yes | — | > **update\_board full type** > > ```ts theme={null} > { > id: string > } > ``` *** ## Columns ### changeValue `columns.changeValue` Change a column value on an item **Risk:** `write` ```ts theme={null} await corsair.monday.api.columns.changeValue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `item_id` | `string` | Yes | — | | `column_id` | `string` | Yes | — | | `value` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `change_column_value` | `object` | Yes | — | > **change\_column\_value full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### create `columns.create` Create a new column in a board **Risk:** `write` ```ts theme={null} await corsair.monday.api.columns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `column_type` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `create_column` | `object` | Yes | — | > **create\_column full type** > > ```ts theme={null} > { > id: string, > title?: string > } > ``` *** ### list `columns.list` List all columns in a board **Risk:** `read` ```ts theme={null} await corsair.monday.api.columns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `boards` | `object[]` | Yes | — | > **boards full type** > > ```ts theme={null} > { > columns: { > id: string, > title: string, > type?: string, > settings_str?: string, > description?: string | null > }[] > }[] > ``` *** ## Groups ### create `groups.create` Create a new group in a board **Risk:** `write` ```ts theme={null} await corsair.monday.api.groups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `group_name` | `string` | Yes | — | | `position` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `create_group` | `object` | Yes | — | > **create\_group full type** > > ```ts theme={null} > { > id: string, > title?: string > } > ``` *** ### delete `groups.delete` Delete a group from a board **Risk:** `destructive` ```ts theme={null} await corsair.monday.api.groups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `delete_group` | `object` | Yes | — | > **delete\_group full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### list `groups.list` List all groups in a board **Risk:** `read` ```ts theme={null} await corsair.monday.api.groups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `boards` | `object[]` | Yes | — | > **boards full type** > > ```ts theme={null} > { > groups: { > id: string, > title: string, > color?: string, > position?: string, > archived?: boolean > }[] > }[] > ``` *** ### update `groups.update` Update a group attribute **Risk:** `write` ```ts theme={null} await corsair.monday.api.groups.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `group_id` | `string` | Yes | — | | `group_attribute` | `title \| color \| position \| relative_position_before \| relative_position_after` | Yes | — | | `new_value` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `update_group` | `object` | Yes | — | > **update\_group full type** > > ```ts theme={null} > { > id: string > } > ``` *** ## Items ### archive `items.archive` Archive an item **Risk:** `write` ```ts theme={null} await corsair.monday.api.items.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `archive_item` | `object` | Yes | — | > **archive\_item full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### create `items.create` Create a new item in a board **Risk:** `write` ```ts theme={null} await corsair.monday.api.items.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `item_name` | `string` | Yes | — | | `group_id` | `string` | No | — | | `column_values` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `create_item` | `object` | Yes | — | > **create\_item full type** > > ```ts theme={null} > { > id: string, > name?: string > } > ``` *** ### delete `items.delete` Permanently delete an item **Risk:** `destructive` ```ts theme={null} await corsair.monday.api.items.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `delete_item` | `object` | Yes | — | > **delete\_item full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### get `items.get` Get an item by ID with column values **Risk:** `read` ```ts theme={null} await corsair.monday.api.items.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > name: string, > state?: string, > created_at?: string | null, > creator_id?: string | null, > board?: { > id: string > }, > group?: { > id: string, > title?: string > }, > column_values?: { > id: string, > title?: string, > text?: string | null, > value?: string | null, > type?: string > }[] > }[] > ``` *** ### list `items.list` List items in a board **Risk:** `read` ```ts theme={null} await corsair.monday.api.items.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `boards` | `object[]` | Yes | — | > **boards full type** > > ```ts theme={null} > { > items_page: { > cursor?: string | null, > items: { > id: string, > name: string, > state?: string, > created_at?: string | null, > creator_id?: string | null, > board?: { > id: string > }, > group?: { > id: string, > title?: string > }, > column_values?: { > id: string, > title?: string, > text?: string | null, > value?: string | null, > type?: string > }[] > }[] > } > }[] > ``` *** ### move `items.move` Move an item to a different group **Risk:** `write` ```ts theme={null} await corsair.monday.api.items.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `move_item_to_group` | `object` | Yes | — | > **move\_item\_to\_group full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### update `items.update` Update a column value on an item **Risk:** `write` ```ts theme={null} await corsair.monday.api.items.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `item_id` | `string` | Yes | — | | `column_id` | `string` | Yes | — | | `value` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `change_column_value` | `object` | Yes | — | > **change\_column\_value full type** > > ```ts theme={null} > { > id: string > } > ``` *** ## Updates ### create `updates.create` Create an update (comment) on an item **Risk:** `write` ```ts theme={null} await corsair.monday.api.updates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `body` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `create_update` | `object` | Yes | — | > **create\_update full type** > > ```ts theme={null} > { > id: string, > body?: string > } > ``` *** ### delete `updates.delete` Delete an update (comment) **Risk:** `destructive` ```ts theme={null} await corsair.monday.api.updates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `update_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `delete_update` | `object` | Yes | — | > **delete\_update full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### list `updates.list` List updates (comments) on an item **Risk:** `read` ```ts theme={null} await corsair.monday.api.updates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > updates: { > id: string, > body?: string, > text_body?: string | null, > created_at?: string | null, > creator?: { > id: string, > name?: string > }, > replies?: { > id: string, > body?: string > }[] > }[] > }[] > ``` *** ## Users ### get `users.get` Get a user by ID **Risk:** `read` ```ts theme={null} await corsair.monday.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > id: string, > name?: string, > email?: string, > photo_thumb?: string | null, > title?: string | null, > is_admin?: boolean, > is_guest?: boolean > }[] > ``` *** ### list `users.list` List all users in the account **Risk:** `read` ```ts theme={null} await corsair.monday.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `page` | `number` | No | — | | `kind` | `all \| non_guests \| guests \| non_pending` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > id: string, > name?: string, > email?: string, > photo_thumb?: string | null, > title?: string | null, > is_admin?: boolean, > is_guest?: boolean > }[] > ``` *** ## Webhooks ### create `webhooks.create` Subscribe to a board event via webhook **Risk:** `write` ```ts theme={null} await corsair.monday.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `event` | `change_column_value \| change_specific_column_value \| change_status_column_value \| create_item \| create_update \| delete_update \| item_archived \| item_deleted \| item_moved_to_board \| item_restored \| when_date_arrived` | Yes | — | | `config` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `create_webhook` | `object` | Yes | — | > **create\_webhook full type** > > ```ts theme={null} > { > id: string, > board_id?: string, > event?: string > } > ``` *** ### delete `webhooks.delete` Unsubscribe a webhook by ID **Risk:** `destructive` ```ts theme={null} await corsair.monday.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `delete_webhook` | `object` | Yes | — | > **delete\_webhook full type** > > ```ts theme={null} > { > id: string, > board_id?: string > } > ``` *** ### list `webhooks.list` List all webhooks for a board **Risk:** `read` ```ts theme={null} await corsair.monday.api.webhooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `board_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | Yes | — | > **webhooks full type** > > ```ts theme={null} > { > id: string, > board_id?: string, > event?: string > }[] > ``` *** ## Workspaces ### list `workspaces.list` List all workspaces **Risk:** `read` ```ts theme={null} await corsair.monday.api.workspaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `page` | `number` | No | — | | `kind` | `open \| closed` | No | — | | `state` | `active \| deleted \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `workspaces` | `object[]` | Yes | — | > **workspaces full type** > > ```ts theme={null} > { > id: string, > name: string, > kind?: string, > description?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/monday/database Monday.com local sync: searchable entities, `.search()` filters, and operators. The Monday.com plugin syncs data locally. Use `corsair.monday.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Boards Path: `monday.db.boards.search` ```ts theme={null} const rows = await corsair.monday.db.boards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `board_kind` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Items Path: `monday.db.items.search` ```ts theme={null} const rows = await corsair.monday.db.items.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `board_id` | `string` | equals, contains, startsWith, endsWith, in | | `group_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `creator_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Updates Path: `monday.db.updates.search` ```ts theme={null} const rows = await corsair.monday.db.updates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `text_body` | `string` | equals, contains, startsWith, endsWith, in | | `item_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `creator_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `monday.db.users.search` ```ts theme={null} const rows = await corsair.monday.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `photo_thumb` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `is_admin` | `boolean` | equals | | `is_guest` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/monday/get-credentials Step-by-step instructions for obtaining Monday.com API credentials. This guide walks you through obtaining credentials for the Monday.com plugin. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Personal API token ## API Token Setup ### Step 1: Get Your Personal API Token 1. Log in to [Monday.com](https://monday.com) 2. Click on your avatar in the top-right corner 3. Go to **Administration** → **API** 4. Copy your **Personal API Token v2** 5. Store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=monday api_key=your-api-token ``` Verify it was saved: ```bash theme={null} pnpm corsair auth --plugin=monday --credentials ``` ## Webhook Setup (Optional) ### Step 1: Create a Webhook 1. In your Monday.com board, click the **Integrations** button 2. Search for **Webhooks** and select it 3. Configure the event type and your endpoint URL 4. Copy the webhook secret if provided **Storing the webhook secret:** ```bash theme={null} pnpm corsair setup --plugin=monday webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Personal API Token | API calls | Profile → Administration → API | | Webhook Secret | Webhook verification | Board Integrations → Webhooks | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/monday/overview Work operating system for boards, workflows, automations, and cross-team project tracking. Use **Monday.com** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 30 typed API operations * 4 synced entities (`boards`, `items`, `updates`, `users`) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/monday ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/monday ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/monday ``` ```bash bun theme={null} bun add corsair @corsair-dev/monday ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { monday } from '@corsair-dev/monday'; export const corsair = createCorsair({ plugins: [ monday(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/monday/get-credentials). ```ts theme={null} monday() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'monday', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`boards.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.monday.api.boards.get({}); ``` **`boards.archive`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.monday.api.boards.archive({}); ``` See the full list on the [API](/plugins/monday/api) page. ## Query synced data Synced entities support `tenant.monday.db..search()` and `.list()`: `boards`, `items`, `updates`, `users`. See [Database](/plugins/monday/database) for filters and operators. ## Webhooks This plugin registers **4** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/monday/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/monday/api)** > > Every `monday.api.*` operation with input and output types. > **[Database](/plugins/monday/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/monday/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/monday/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/monday/webhooks Monday.com incoming webhooks: event paths, payloads, and response data. The Monday.com plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/monday/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `columns` * `columnValueChanged` (`columns.columnValueChanged`) * `items` * `itemCreated` (`items.itemCreated`) * `status` * `statusChanged` (`status.statusChanged`) * `verification` * `challenge` (`verification.challenge`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Columns ### Column Value Changed `columns.columnValueChanged` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} monday({ webhookHooks: { columns: { columnValueChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Items ### Item Created `items.itemCreated` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} monday({ webhookHooks: { items: { itemCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Status ### Status Changed `status.statusChanged` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} monday({ webhookHooks: { status: { statusChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Verification ### Challenge `verification.challenge` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} monday({ webhookHooks: { verification: { challenge: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/mrscraper/api API reference for MrScraper: every `mrscraper.api.*` operation with input and output types. Every `mrscraper.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get the subscription account and token usage **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > tokenLimit?: number, > tokenUsage?: number, > stripeSubscriptionId?: string | null, > userId?: string, > stripeStatus?: string | null, > quantity?: number, > endsAt?: string | null, > isEnterprise?: boolean, > rateLimit?: number, > rateTtl?: number, > isAutoRenew?: boolean, > user?: { > id?: string, > name?: string | null, > email?: string, > latestApiToken?: string | null, > isVerified?: boolean > } > } > ``` *** ## Analytics ### proxyBandwidth `analytics.proxyBandwidth` Get proxy bandwidth usage for the account **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.analytics.proxyBandwidth({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `startDate` | `string` | Yes | — | | `endDate` | `string` | Yes | — | | `timezone` | `string` | No | — | | `region` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > username: string, > total_bandwidth_usage?: number | string > }[] > ``` *** ### statuses `analytics.statuses` Get per-domain request status analytics **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.analytics.statuses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `startDate` | `string` | Yes | — | | `endDate` | `string` | Yes | — | | `action` | `string` | No | — | | `apiTokenName` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > countAll?: number | string, > successRate?: number | string, > reqPerMinute?: number | string, > avgLatency?: number | string, > data: { > key: string, > value: number | string > }[] > } > ``` *** ## Results ### get `results.get` Get a scrape result by id **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.results.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > userId?: string, > scraperId?: string, > type?: string, > url?: string | null, > status?: string, > error?: string | null, > tokenUsage?: number, > runtime?: number | string | null, > data?: any, > htmlPath?: string | null, > htmlContent?: string | null, > recordingPath?: string | null, > screenshotPath?: string | null, > dataPath?: string | null, > curl?: string | null, > html?: string | null, > markdown?: string | null, > screenshot?: string | null > }[] > ``` *** ### list `results.list` List scrape results with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.results.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `sortField` | `string` | No | — | | `sortOrder` | `ASC \| DESC` | No | — | | `sort` | `string` | No | — | | `search` | `string` | No | — | | `dateRangeColumn` | `string` | No | — | | `startAt` | `string` | No | — | | `endAt` | `string` | No | — | | `filters` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > scraperId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > userId?: string, > scraperId?: string, > type?: string, > url?: string | null, > status?: string, > error?: string | null, > tokenUsage?: number, > runtime?: number | string | null, > data?: any, > htmlPath?: string | null, > htmlContent?: string | null, > recordingPath?: string | null, > screenshotPath?: string | null, > dataPath?: string | null, > curl?: string | null, > html?: string | null, > markdown?: string | null, > screenshot?: string | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > page?: number, > pageSize?: number, > total?: number, > totalPage?: number > } > ``` *** ## Scrape ### fetch `scrape.fetch` Fetch a page and return its rendered HTML **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.scrape.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `html` | `boolean` | No | — | | `super` | `boolean` | No | — | | `browserRendering` | `boolean` | No | — | | `waitUntil` | `domcontentloaded \| load \| networkidle0 \| networkidle2` | No | — | | `timeout` | `number` | No | — | | `blockResources` | `boolean` | No | — | | `waitForSelector` | `string` | No | — | | `returnCookie` | `boolean` | No | — | | `geoCode` | `string` | No | — | | `proxyCountry` | `string` | No | — | **Output:** `string` *** ### json `scrape.json` Scrape a page and extract structured JSON with an agent **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.scrape.json({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `prompt` | `string` | No | — | | `agent` | `general \| map \| listing` | No | — | | `tokenCap` | `number` | No | — | | `maxRetries` | `number` | No | — | | `html` | `boolean` | No | — | | `browserRendering` | `boolean` | No | — | | `waitUntil` | `domcontentloaded \| load \| networkidle0 \| networkidle2` | No | — | | `timeout` | `number` | No | — | | `screenshot` | `full \| top` | No | — | | `super` | `boolean` | No | — | | `geoCode` | `string` | No | — | | `proxyCountry` | `string` | No | — | | `saveResult` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `data` | `any` | No | — | | `extractions` | `object` | No | — | | `error` | `string` | No | — | | `runtime` | `number \| string` | No | — | | `token_usage` | `number` | No | — | | `screenshots` | `string[]` | No | — | | `recording_path` | `string` | No | — | | `data_path` | `string` | No | — | | `html_path` | `string` | No | — | | `residential_proxy_usage` | `object` | No | — | | `listen_network_data` | `any` | No | — | | `html` | `string` | No | — | | `markdown` | `string` | No | — | | `screenshot` | `string` | No | — | > **extractions full type** > > ```ts theme={null} > string | { > } > ``` > **residential\_proxy\_usage full type** > > ```ts theme={null} > { > received?: number, > sent?: number, > total?: number > } > ``` *** ### listing `scrape.listing` Scrape paginated listing pages and extract their items **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.scrape.listing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `prompt` | `string` | No | — | | `agent` | `general \| map \| listing` | No | — | | `maxPages` | `number` | No | — | | `super` | `boolean` | No | — | | `browserRendering` | `boolean` | No | — | | `waitUntil` | `domcontentloaded \| load \| networkidle0 \| networkidle2` | No | — | | `timeout` | `number` | No | — | | `screenshot` | `full \| top` | No | — | | `geoCode` | `string` | No | — | | `proxyCountry` | `string` | No | — | | `saveResult` | `boolean` | No | — | | `tokenCap` | `number` | No | — | | `maxRetries` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `data` | `any` | No | — | | `extractions` | `object` | No | — | | `error` | `string` | No | — | | `runtime` | `number \| string` | No | — | | `token_usage` | `number` | No | — | | `screenshots` | `string[]` | No | — | | `recording_path` | `string` | No | — | | `data_path` | `string` | No | — | | `html_path` | `string` | No | — | | `residential_proxy_usage` | `object` | No | — | | `listen_network_data` | `any` | No | — | | `html` | `string` | No | — | | `markdown` | `string` | No | — | | `screenshot` | `string` | No | — | > **extractions full type** > > ```ts theme={null} > string | { > } > ``` > **residential\_proxy\_usage full type** > > ```ts theme={null} > { > received?: number, > sent?: number, > total?: number > } > ``` *** ### markdown `scrape.markdown` Scrape a page and return its content as Markdown **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.scrape.markdown({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `tokenCap` | `number` | No | — | | `maxRetries` | `number` | No | — | | `super` | `boolean` | No | — | | `browserRendering` | `boolean` | No | — | | `waitUntil` | `domcontentloaded \| load \| networkidle0 \| networkidle2` | No | — | | `timeout` | `number` | No | — | | `screenshot` | `full \| top` | No | — | | `geoCode` | `string` | No | — | | `proxyCountry` | `string` | No | — | | `blockResources` | `boolean` | No | — | | `waitForSelector` | `string` | No | — | | `action` | `string` | No | — | | `proxy` | `string` | No | — | | `returnCookie` | `boolean` | No | — | | `saveResult` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `data` | `any` | No | — | | `extractions` | `object` | No | — | | `error` | `string` | No | — | | `runtime` | `number \| string` | No | — | | `token_usage` | `number` | No | — | | `screenshots` | `string[]` | No | — | | `recording_path` | `string` | No | — | | `data_path` | `string` | No | — | | `html_path` | `string` | No | — | | `residential_proxy_usage` | `object` | No | — | | `listen_network_data` | `any` | No | — | | `html` | `string` | No | — | | `markdown` | `string` | No | — | | `screenshot` | `string` | No | — | > **extractions full type** > > ```ts theme={null} > string | { > } > ``` > **residential\_proxy\_usage full type** > > ```ts theme={null} > { > received?: number, > sent?: number, > total?: number > } > ``` *** ### screenshot `scrape.screenshot` Scrape a page and capture a screenshot **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.scrape.screenshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `screenshot` | `full \| top` | No | — | | `record` | `boolean` | No | — | | `browserRendering` | `boolean` | No | — | | `waitUntil` | `domcontentloaded \| load \| networkidle0 \| networkidle2` | No | — | | `timeout` | `number` | No | — | | `html` | `boolean` | No | — | | `markdown` | `boolean` | No | — | | `super` | `boolean` | No | — | | `geoCode` | `string` | No | — | | `proxyCountry` | `string` | No | — | | `saveResult` | `boolean` | No | — | | `blockResources` | `boolean` | No | — | | `waitForSelector` | `string` | No | — | | `action` | `string` | No | — | | `proxy` | `string` | No | — | | `returnCookie` | `boolean` | No | — | | `tokenCap` | `number` | No | — | | `maxRetries` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `data` | `any` | No | — | | `extractions` | `object` | No | — | | `error` | `string` | No | — | | `runtime` | `number \| string` | No | — | | `token_usage` | `number` | No | — | | `screenshots` | `string[]` | No | — | | `recording_path` | `string` | No | — | | `data_path` | `string` | No | — | | `html_path` | `string` | No | — | | `residential_proxy_usage` | `object` | No | — | | `listen_network_data` | `any` | No | — | | `html` | `string` | No | — | | `markdown` | `string` | No | — | | `screenshot` | `string` | No | — | > **extractions full type** > > ```ts theme={null} > string | { > } > ``` > **residential\_proxy\_usage full type** > > ```ts theme={null} > { > received?: number, > sent?: number, > total?: number > } > ``` *** ### sitemap `scrape.sitemap` Discover a site sitemap and map its URLs **Risk:** `read` ```ts theme={null} await corsair.mrscraper.api.scrape.sitemap({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `agent` | `general \| map \| listing` | No | — | | `maxDepth` | `number` | No | — | | `maxPages` | `number` | No | — | | `limit` | `number` | No | — | | `includePatterns` | `string[]` | No | — | | `excludePatterns` | `string[]` | No | — | | `browserRendering` | `boolean` | No | — | | `waitUntil` | `domcontentloaded \| load \| networkidle0 \| networkidle2` | No | — | | `timeout` | `number` | No | — | | `screenshot` | `full \| top` | No | — | | `super` | `boolean` | No | — | | `geoCode` | `string` | No | — | | `proxyCountry` | `string` | No | — | | `saveResult` | `boolean` | No | — | | `tokenCap` | `number` | No | — | | `maxRetries` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | Yes | — | | `data` | `any` | No | — | | `extractions` | `object` | No | — | | `error` | `string` | No | — | | `runtime` | `number \| string` | No | — | | `token_usage` | `number` | No | — | | `screenshots` | `string[]` | No | — | | `recording_path` | `string` | No | — | | `data_path` | `string` | No | — | | `html_path` | `string` | No | — | | `residential_proxy_usage` | `object` | No | — | | `listen_network_data` | `any` | No | — | | `html` | `string` | No | — | | `markdown` | `string` | No | — | | `screenshot` | `string` | No | — | > **extractions full type** > > ```ts theme={null} > string | { > } > ``` > **residential\_proxy\_usage full type** > > ```ts theme={null} > { > received?: number, > sent?: number, > total?: number > } > ``` *** ## Scrapers ### aiInit `scrapers.aiInit` Start an AI scraper chat and return starter scrape code **Risk:** `write` ```ts theme={null} await corsair.mrscraper.api.scrapers.aiInit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `prompt` | `string` | No | — | | `message` | `string` | No | — | | `agent` | `general \| map \| listing` | No | — | | `proxyCountry` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > userId?: string, > scraperId?: string, > type?: string, > url?: string | null, > status?: string, > error?: string | null, > tokenUsage?: number, > runtime?: number | string | null, > data?: any, > htmlPath?: string | null, > htmlContent?: string | null, > recordingPath?: string | null, > screenshotPath?: string | null, > dataPath?: string | null, > curl?: string | null, > html?: string | null, > markdown?: string | null, > screenshot?: string | null > } > ``` *** ### aiRerun `scrapers.aiRerun` Re-run an AI scraper against a URL **Risk:** `write` ```ts theme={null} await corsair.mrscraper.api.scrapers.aiRerun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scraperId` | `string` | Yes | — | | `url` | `string` | Yes | — | | `maxDepth` | `number` | No | — | | `maxPages` | `number` | No | — | | `limit` | `number` | No | — | | `includePatterns` | `string \| string[]` | No | — | | `excludePatterns` | `string \| string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > userId?: string, > scraperId?: string, > type?: string, > url?: string | null, > status?: string, > error?: string | null, > tokenUsage?: number, > runtime?: number | string | null, > data?: any, > htmlPath?: string | null, > htmlContent?: string | null, > recordingPath?: string | null, > screenshotPath?: string | null, > dataPath?: string | null, > curl?: string | null, > html?: string | null, > markdown?: string | null, > screenshot?: string | null > } > ``` *** ### aiRerunBulk `scrapers.aiRerunBulk` Re-run an AI scraper against multiple URLs **Risk:** `write` ```ts theme={null} await corsair.mrscraper.api.scrapers.aiRerunBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scraperId` | `string` | Yes | — | | `urls` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > userId?: string, > scraperId?: string, > type?: string, > url?: string | null, > status?: string, > error?: string | null, > tokenUsage?: number, > runtime?: number | string | null, > data?: { > mergedData?: any[], > urlDetails?: { > url: string, > status?: string, > error?: string | null > }[], > summary?: { > totalUrls?: number, > successfulUrls?: number, > failedUrls?: number, > scrapedCount?: number, > totalTokenUsage?: number, > estimatedFinishAt?: string | null > } > }, > htmlPath?: string | null, > htmlContent?: string | null, > recordingPath?: string | null, > screenshotPath?: string | null, > dataPath?: string | null, > curl?: string | null, > html?: string | null, > markdown?: string | null, > screenshot?: string | null > } > ``` *** ### cancelBulkByResult `scrapers.cancelBulkByResult` Cancel a queued bulk run by its result id **Risk:** `write` ```ts theme={null} await corsair.mrscraper.api.scrapers.cancelBulkByResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `resultId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bulkUrls?: string[], > canceledUrls?: string[] > } > ``` *** ### cancelBulkByScraper `scrapers.cancelBulkByScraper` Cancel every queued bulk URL for a scraper **Risk:** `write` ```ts theme={null} await corsair.mrscraper.api.scrapers.cancelBulkByScraper({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scraperId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > bulkUrls?: string[], > canceledUrls?: string[] > } > ``` *** ### manualHeal `scrapers.manualHeal` Heal a broken manual scraper workflow **Risk:** `write` ```ts theme={null} await corsair.mrscraper.api.scrapers.manualHeal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scraperId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > success: boolean, > scraperId?: string, > workflowUpdated?: boolean > } > ``` *** ### manualRerun `scrapers.manualRerun` Re-run a manual scraper against a URL **Risk:** `write` ```ts theme={null} await corsair.mrscraper.api.scrapers.manualRerun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scraperId` | `string` | Yes | — | | `url` | `string` | Yes | — | | `workflow` | `any[]` | No | — | | `record` | `boolean` | No | — | | `paginator` | `object` | No | — | > **paginator full type** > > ```ts theme={null} > { > type?: string, > max_page?: number, > enabled?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > userId?: string, > scraperId?: string, > type?: string, > url?: string | null, > status?: string, > error?: string | null, > tokenUsage?: number, > runtime?: number | string | null, > data?: any, > htmlPath?: string | null, > htmlContent?: string | null, > recordingPath?: string | null, > screenshotPath?: string | null, > dataPath?: string | null, > curl?: string | null, > html?: string | null, > markdown?: string | null, > screenshot?: string | null > } > ``` *** ### manualRerunBulk `scrapers.manualRerunBulk` Re-run a manual scraper against multiple URLs **Risk:** `write` ```ts theme={null} await corsair.mrscraper.api.scrapers.manualRerunBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scraperId` | `string` | Yes | — | | `urls` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > userId?: string, > scraperId?: string, > type?: string, > url?: string | null, > status?: string, > error?: string | null, > tokenUsage?: number, > runtime?: number | string | null, > data?: { > mergedData?: any[], > urlDetails?: { > url: string, > status?: string, > error?: string | null > }[], > summary?: { > totalUrls?: number, > successfulUrls?: number, > failedUrls?: number, > scrapedCount?: number, > totalTokenUsage?: number, > estimatedFinishAt?: string | null > } > }, > htmlPath?: string | null, > htmlContent?: string | null, > recordingPath?: string | null, > screenshotPath?: string | null, > dataPath?: string | null, > curl?: string | null, > html?: string | null, > markdown?: string | null, > screenshot?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/mrscraper/database MrScraper local sync: searchable entities, `.search()` filters, and operators. The MrScraper plugin syncs data locally. Use `corsair.mrscraper.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/mrscraper/overview Web scraping and AI extraction across account, scraper, result and analytics APIs, plus synchronous scrape operations. Use **MrScraper** through Corsair: one client, typed API calls. **What you get:** * 19 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/mrscraper ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/mrscraper ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/mrscraper ``` ```bash bun theme={null} bun add corsair @corsair-dev/mrscraper ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { mrscraper } from '@corsair-dev/mrscraper'; export const corsair = createCorsair({ plugins: [ mrscraper(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} mrscraper() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'mrscraper', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.mrscraper.api.account.get({}); ``` **`scrapers.aiInit`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.mrscraper.api.scrapers.aiInit({}); ``` See the full list on the [API](/plugins/mrscraper/api) page. ## What's next > **[API reference](/plugins/mrscraper/api)** > > Every `mrscraper.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/neon/api API reference for Neon: every `neon.api.*` operation with input and output types. Every `neon.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Api Keys ### createApiKey `apiKeys.createApiKey` Create API key **Risk:** `write` ```ts theme={null} await corsair.neon.api.apiKeys.createApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listApiKeys `apiKeys.listApiKeys` List API keys **Risk:** `read` ```ts theme={null} await corsair.neon.api.apiKeys.listApiKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### revokeApiKey `apiKeys.revokeApiKey` Revoke API key **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.neon.api.apiKeys.revokeApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | Yes | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Auth ### createBranchNeonAuthNewUser `auth.createBranchNeonAuthNewUser` Create new auth user **Risk:** `write` ```ts theme={null} await corsair.neon.api.auth.createBranchNeonAuthNewUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createNeonAuth `auth.createNeonAuth` Enable Neon Auth for the branch **Risk:** `write` ```ts theme={null} await corsair.neon.api.auth.createNeonAuth({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createNeonAuthProviderSDKKeys `auth.createNeonAuthProviderSDKKeys` Create Auth Provider SDK keys **Risk:** `write` ```ts theme={null} await corsair.neon.api.auth.createNeonAuthProviderSDKKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteBranchNeonAuthOauthProvider `auth.deleteBranchNeonAuthOauthProvider` Delete OAuth provider **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.auth.deleteBranchNeonAuthOauthProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | Yes | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteBranchNeonAuthTrustedDomain `auth.deleteBranchNeonAuthTrustedDomain` Delete domain from redirect\_uri whitelist **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.auth.deleteBranchNeonAuthTrustedDomain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteBranchNeonAuthUser `auth.deleteBranchNeonAuthUser` Delete auth user **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.neon.api.auth.deleteBranchNeonAuthUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | Yes | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteNeonAuthDomainFromRedirectURIWhitelist `auth.deleteNeonAuthDomainFromRedirectURIWhitelist` Delete trusted redirect URI domain (deprecated project-level route) **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.auth.deleteNeonAuthDomainFromRedirectURIWhitelist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### disableNeonAuth `auth.disableNeonAuth` Disable Neon Auth for the branch **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.auth.disableNeonAuth({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAuthDetails `auth.getAuthDetails` Retrieve details about the current API credentials **Risk:** `read` ```ts theme={null} await corsair.neon.api.auth.getAuthDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getNeonAuthAllowLocalhost `auth.getNeonAuthAllowLocalhost` Retrieve localhost allow setting **Risk:** `read` ```ts theme={null} await corsair.neon.api.auth.getNeonAuthAllowLocalhost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getNeonAuthEmailProvider `auth.getNeonAuthEmailProvider` Retrieve email provider configuration **Risk:** `read` ```ts theme={null} await corsair.neon.api.auth.getNeonAuthEmailProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listBranchNeonAuthOauthProviders `auth.listBranchNeonAuthOauthProviders` List OAuth providers for the branch **Risk:** `read` ```ts theme={null} await corsair.neon.api.auth.listBranchNeonAuthOauthProviders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listBranchNeonAuthTrustedDomains `auth.listBranchNeonAuthTrustedDomains` List domains in redirect\_uri whitelist **Risk:** `read` ```ts theme={null} await corsair.neon.api.auth.listBranchNeonAuthTrustedDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listNeonAuthOauthProviders `auth.listNeonAuthOauthProviders` List OAuth providers (deprecated project-level route) **Risk:** `read` ```ts theme={null} await corsair.neon.api.auth.listNeonAuthOauthProviders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### sendNeonAuthTestEmail `auth.sendNeonAuthTestEmail` Send test email **Risk:** `write` ```ts theme={null} await corsair.neon.api.auth.sendNeonAuthTestEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateNeonAuthAllowLocalhost `auth.updateNeonAuthAllowLocalhost` Update localhost allow setting **Risk:** `write` ```ts theme={null} await corsair.neon.api.auth.updateNeonAuthAllowLocalhost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateNeonAuthEmailProvider `auth.updateNeonAuthEmailProvider` Update email provider configuration **Risk:** `write` ```ts theme={null} await corsair.neon.api.auth.updateNeonAuthEmailProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateNeonAuthOauthProvider `auth.updateNeonAuthOauthProvider` Update OAuth provider (deprecated project-level route) **Risk:** `write` ```ts theme={null} await corsair.neon.api.auth.updateNeonAuthOauthProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | Yes | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Branches ### countProjectBranches `branches.countProjectBranches` Retrieve number of branches **Risk:** `read` ```ts theme={null} await corsair.neon.api.branches.countProjectBranches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createProjectBranch `branches.createProjectBranch` Create branch **Risk:** `write` ```ts theme={null} await corsair.neon.api.branches.createProjectBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createProjectBranchAnonymized `branches.createProjectBranchAnonymized` Create anonymized branch **Risk:** `write` ```ts theme={null} await corsair.neon.api.branches.createProjectBranchAnonymized({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProjectBranch `branches.deleteProjectBranch` Delete branch **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.branches.deleteProjectBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### finalizeRestoreBranch `branches.finalizeRestoreBranch` Finalize branch restore from snapshot **Risk:** `write` ```ts theme={null} await corsair.neon.api.branches.finalizeRestoreBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAnonymizedBranchStatus `branches.getAnonymizedBranchStatus` Retrieve anonymized branch status **Risk:** `read` ```ts theme={null} await corsair.neon.api.branches.getAnonymizedBranchStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getMaskingRules `branches.getMaskingRules` Retrieve masking rules **Risk:** `read` ```ts theme={null} await corsair.neon.api.branches.getMaskingRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectBranch `branches.getProjectBranch` Retrieve branch details **Risk:** `read` ```ts theme={null} await corsair.neon.api.branches.getProjectBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectBranchSchema `branches.getProjectBranchSchema` Retrieve database schema **Risk:** `read` ```ts theme={null} await corsair.neon.api.branches.getProjectBranchSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectBranchSchemaComparison `branches.getProjectBranchSchemaComparison` Compare database schema **Risk:** `read` ```ts theme={null} await corsair.neon.api.branches.getProjectBranchSchemaComparison({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProjectBranchEndpoints `branches.listProjectBranchEndpoints` List compute endpoints for the branch **Risk:** `read` ```ts theme={null} await corsair.neon.api.branches.listProjectBranchEndpoints({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProjectBranches `branches.listProjectBranches` List branches **Risk:** `read` ```ts theme={null} await corsair.neon.api.branches.listProjectBranches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### restoreProjectBranch `branches.restoreProjectBranch` Restore branch to a historical state **Risk:** `write` ```ts theme={null} await corsair.neon.api.branches.restoreProjectBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### setDefaultProjectBranch `branches.setDefaultProjectBranch` Set branch as default **Risk:** `write` ```ts theme={null} await corsair.neon.api.branches.setDefaultProjectBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### startAnonymization `branches.startAnonymization` Start anonymization **Risk:** `write` ```ts theme={null} await corsair.neon.api.branches.startAnonymization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateMaskingRules `branches.updateMaskingRules` Update masking rules **Risk:** `write` ```ts theme={null} await corsair.neon.api.branches.updateMaskingRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectBranch `branches.updateProjectBranch` Update branch **Risk:** `write` ```ts theme={null} await corsair.neon.api.branches.updateProjectBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Compute Endpoints ### createProjectEndpoint `computeEndpoints.createProjectEndpoint` Create compute endpoint **Risk:** `write` ```ts theme={null} await corsair.neon.api.computeEndpoints.createProjectEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProjectEndpoint `computeEndpoints.deleteProjectEndpoint` Delete compute endpoint **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.computeEndpoints.deleteProjectEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | Yes | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectEndpoint `computeEndpoints.getProjectEndpoint` Retrieve compute endpoint details **Risk:** `read` ```ts theme={null} await corsair.neon.api.computeEndpoints.getProjectEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | Yes | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProjectEndpoints `computeEndpoints.listProjectEndpoints` List compute endpoints **Risk:** `read` ```ts theme={null} await corsair.neon.api.computeEndpoints.listProjectEndpoints({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### restartProjectEndpoint `computeEndpoints.restartProjectEndpoint` Restart compute endpoint **Risk:** `write` ```ts theme={null} await corsair.neon.api.computeEndpoints.restartProjectEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | Yes | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### startProjectEndpoint `computeEndpoints.startProjectEndpoint` Start compute endpoint **Risk:** `write` ```ts theme={null} await corsair.neon.api.computeEndpoints.startProjectEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | Yes | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### suspendProjectEndpoint `computeEndpoints.suspendProjectEndpoint` Suspend compute endpoint **Risk:** `write` ```ts theme={null} await corsair.neon.api.computeEndpoints.suspendProjectEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | Yes | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectEndpoint `computeEndpoints.updateProjectEndpoint` Update compute endpoint **Risk:** `write` ```ts theme={null} await corsair.neon.api.computeEndpoints.updateProjectEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | Yes | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Consumption ### getConsumptionHistoryPerAccount `consumption.getConsumptionHistoryPerAccount` Retrieve account consumption metrics (legacy, deprecated) **Risk:** `read` ```ts theme={null} await corsair.neon.api.consumption.getConsumptionHistoryPerAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getConsumptionHistoryPerProject `consumption.getConsumptionHistoryPerProject` Retrieve project consumption metrics (legacy plans) **Risk:** `read` ```ts theme={null} await corsair.neon.api.consumption.getConsumptionHistoryPerProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Data Api ### createProjectBranchDataAPI `dataApi.createProjectBranchDataAPI` Create Neon Data API **Risk:** `write` ```ts theme={null} await corsair.neon.api.dataApi.createProjectBranchDataAPI({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | Yes | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProjectBranchDataAPI `dataApi.deleteProjectBranchDataAPI` Delete Neon Data API **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.dataApi.deleteProjectBranchDataAPI({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | Yes | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectBranchDataAPI `dataApi.getProjectBranchDataAPI` Retrieve Neon Data API configuration **Risk:** `read` ```ts theme={null} await corsair.neon.api.dataApi.getProjectBranchDataAPI({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | Yes | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectBranchDataAPI `dataApi.updateProjectBranchDataAPI` Update Neon Data API **Risk:** `write` ```ts theme={null} await corsair.neon.api.dataApi.updateProjectBranchDataAPI({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | Yes | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Databases ### createProjectBranchDatabase `databases.createProjectBranchDatabase` Create database **Risk:** `write` ```ts theme={null} await corsair.neon.api.databases.createProjectBranchDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProjectBranchDatabase `databases.deleteProjectBranchDatabase` Delete database **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.databases.deleteProjectBranchDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | Yes | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectBranchDatabase `databases.getProjectBranchDatabase` Retrieve database details **Risk:** `read` ```ts theme={null} await corsair.neon.api.databases.getProjectBranchDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | Yes | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProjectBranchDatabases `databases.listProjectBranchDatabases` List databases **Risk:** `read` ```ts theme={null} await corsair.neon.api.databases.listProjectBranchDatabases({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectBranchDatabase `databases.updateProjectBranchDatabase` Update database **Risk:** `write` ```ts theme={null} await corsair.neon.api.databases.updateProjectBranchDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | Yes | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Organizations ### createOrganizationInvitations `organizations.createOrganizationInvitations` Create organization invitations **Risk:** `write` ```ts theme={null} await corsair.neon.api.organizations.createOrganizationInvitations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createOrgApiKey `organizations.createOrgApiKey` Create organization API key **Risk:** `write` ```ts theme={null} await corsair.neon.api.organizations.createOrgApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrganization `organizations.getOrganization` Retrieve organization details **Risk:** `read` ```ts theme={null} await corsair.neon.api.organizations.getOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrganizationInvitations `organizations.getOrganizationInvitations` List organization invitations **Risk:** `read` ```ts theme={null} await corsair.neon.api.organizations.getOrganizationInvitations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrganizationMember `organizations.getOrganizationMember` Retrieve organization member details **Risk:** `read` ```ts theme={null} await corsair.neon.api.organizations.getOrganizationMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | Yes | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrganizationMembers `organizations.getOrganizationMembers` List organization members **Risk:** `read` ```ts theme={null} await corsair.neon.api.organizations.getOrganizationMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listOrgApiKeys `organizations.listOrgApiKeys` List organization API keys **Risk:** `read` ```ts theme={null} await corsair.neon.api.organizations.listOrgApiKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### removeOrganizationMember `organizations.removeOrganizationMember` Remove organization member **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.organizations.removeOrganizationMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | Yes | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### revokeOrgApiKey `organizations.revokeOrgApiKey` Revoke organization API key **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.neon.api.organizations.revokeOrgApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | Yes | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### transferProjectsFromOrgToOrg `organizations.transferProjectsFromOrgToOrg` Transfer projects between organizations **Risk:** `write` ```ts theme={null} await corsair.neon.api.organizations.transferProjectsFromOrgToOrg({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | Yes | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### transferProjectsFromUserToOrg `organizations.transferProjectsFromUserToOrg` Transfer projects from personal account to organization (deprecated) **Risk:** `write` ```ts theme={null} await corsair.neon.api.organizations.transferProjectsFromUserToOrg({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateOrganizationMember `organizations.updateOrganizationMember` Update role for organization member **Risk:** `write` ```ts theme={null} await corsair.neon.api.organizations.updateOrganizationMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | Yes | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Projects ### acceptProjectTransferRequest `projects.acceptProjectTransferRequest` Accept a project transfer request **Risk:** `write` ```ts theme={null} await corsair.neon.api.projects.acceptProjectTransferRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | Yes | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### addProjectJWKS `projects.addProjectJWKS` Add JWKS URL **Risk:** `write` ```ts theme={null} await corsair.neon.api.projects.addProjectJWKS({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createProject `projects.createProject` Create project **Risk:** `write` ```ts theme={null} await corsair.neon.api.projects.createProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createProjectTransferRequest `projects.createProjectTransferRequest` Create a project transfer request **Risk:** `write` ```ts theme={null} await corsair.neon.api.projects.createProjectTransferRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProject `projects.deleteProject` Delete project **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.neon.api.projects.deleteProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProjectJWKS `projects.deleteProjectJWKS` Delete JWKS URL **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.projects.deleteProjectJWKS({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | Yes | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAvailablePreloadLibraries `projects.getAvailablePreloadLibraries` List available shared preload libraries **Risk:** `read` ```ts theme={null} await corsair.neon.api.projects.getAvailablePreloadLibraries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getConnectionURI `projects.getConnectionURI` Retrieve database connection URI **Risk:** `read` ```ts theme={null} await corsair.neon.api.projects.getConnectionURI({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProject `projects.getProject` Retrieve project details **Risk:** `read` ```ts theme={null} await corsair.neon.api.projects.getProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectJWKS `projects.getProjectJWKS` List JWKS URLs **Risk:** `read` ```ts theme={null} await corsair.neon.api.projects.getProjectJWKS({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectOperation `projects.getProjectOperation` Retrieve operation details **Risk:** `read` ```ts theme={null} await corsair.neon.api.projects.getProjectOperation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | Yes | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### grantPermissionToProject `projects.grantPermissionToProject` Grant project access **Risk:** `write` ```ts theme={null} await corsair.neon.api.projects.grantPermissionToProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProjectOperations `projects.listProjectOperations` List operations **Risk:** `read` ```ts theme={null} await corsair.neon.api.projects.listProjectOperations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProjectPermissions `projects.listProjectPermissions` List project access **Risk:** `read` ```ts theme={null} await corsair.neon.api.projects.listProjectPermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProjects `projects.listProjects` List projects **Risk:** `read` ```ts theme={null} await corsair.neon.api.projects.listProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listSharedProjects `projects.listSharedProjects` List shared projects **Risk:** `read` ```ts theme={null} await corsair.neon.api.projects.listSharedProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### revokePermissionFromProject `projects.revokePermissionFromProject` Revoke project access **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.projects.revokePermissionFromProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | Yes | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProject `projects.updateProject` Update project **Risk:** `write` ```ts theme={null} await corsair.neon.api.projects.updateProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Regions ### getActiveRegions `regions.getActiveRegions` List supported regions **Risk:** `read` ```ts theme={null} await corsair.neon.api.regions.getActiveRegions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Roles ### createProjectBranchRole `roles.createProjectBranchRole` Create role **Risk:** `write` ```ts theme={null} await corsair.neon.api.roles.createProjectBranchRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProjectBranchRole `roles.deleteProjectBranchRole` Delete role **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.roles.deleteProjectBranchRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | Yes | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectBranchRole `roles.getProjectBranchRole` Retrieve role details **Risk:** `read` ```ts theme={null} await corsair.neon.api.roles.getProjectBranchRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | Yes | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectBranchRolePassword `roles.getProjectBranchRolePassword` Retrieve role password **Risk:** `read` ```ts theme={null} await corsair.neon.api.roles.getProjectBranchRolePassword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | Yes | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProjectBranchRoles `roles.listProjectBranchRoles` List roles **Risk:** `read` ```ts theme={null} await corsair.neon.api.roles.listProjectBranchRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### resetProjectBranchRolePassword `roles.resetProjectBranchRolePassword` Reset role password **Risk:** `write` ```ts theme={null} await corsair.neon.api.roles.resetProjectBranchRolePassword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | Yes | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Snapshots ### createSnapshot `snapshots.createSnapshot` Create snapshot **Risk:** `write` ```ts theme={null} await corsair.neon.api.snapshots.createSnapshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteSnapshot `snapshots.deleteSnapshot` Delete snapshot **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.neon.api.snapshots.deleteSnapshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSnapshotSchedule `snapshots.getSnapshotSchedule` Retrieve backup schedule **Risk:** `read` ```ts theme={null} await corsair.neon.api.snapshots.getSnapshotSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | Yes | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listSnapshots `snapshots.listSnapshots` List project snapshots **Risk:** `read` ```ts theme={null} await corsair.neon.api.snapshots.listSnapshots({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### restoreSnapshot `snapshots.restoreSnapshot` Restore snapshot **Risk:** `write` ```ts theme={null} await corsair.neon.api.snapshots.restoreSnapshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSnapshot `snapshots.updateSnapshot` Update snapshot **Risk:** `write` ```ts theme={null} await corsair.neon.api.snapshots.updateSnapshot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Users ### getCurrentUserInfo `users.getCurrentUserInfo` Retrieve current user details **Risk:** `read` ```ts theme={null} await corsair.neon.api.users.getCurrentUserInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCurrentUserOrganizations `users.getCurrentUserOrganizations` List organizations for the current user **Risk:** `read` ```ts theme={null} await corsair.neon.api.users.getCurrentUserOrganizations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Vpc ### assignOrganizationVPCEndpoint `vpc.assignOrganizationVPCEndpoint` Assign or update VPC endpoint **Risk:** `write` ```ts theme={null} await corsair.neon.api.vpc.assignOrganizationVPCEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | Yes | — | | `vpc_endpoint_id` | `string` | Yes | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### assignProjectVPCEndpoint `vpc.assignProjectVPCEndpoint` Set VPC endpoint restriction **Risk:** `write` ```ts theme={null} await corsair.neon.api.vpc.assignProjectVPCEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | Yes | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteOrganizationVPCEndpoint `vpc.deleteOrganizationVPCEndpoint` Delete VPC endpoint **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.neon.api.vpc.deleteOrganizationVPCEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | Yes | — | | `vpc_endpoint_id` | `string` | Yes | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProjectVPCEndpoint `vpc.deleteProjectVPCEndpoint` Delete VPC endpoint restriction **Risk:** `destructive` ```ts theme={null} await corsair.neon.api.vpc.deleteProjectVPCEndpoint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | Yes | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrganizationVPCEndpointDetails `vpc.getOrganizationVPCEndpointDetails` Retrieve VPC endpoint details **Risk:** `read` ```ts theme={null} await corsair.neon.api.vpc.getOrganizationVPCEndpointDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | Yes | — | | `vpc_endpoint_id` | `string` | Yes | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listOrganizationVPCEndpoints `vpc.listOrganizationVPCEndpoints` List VPC endpoints **Risk:** `read` ```ts theme={null} await corsair.neon.api.vpc.listOrganizationVPCEndpoints({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | Yes | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listOrganizationVPCEndpointsAllRegions `vpc.listOrganizationVPCEndpointsAllRegions` List VPC endpoints across all regions **Risk:** `read` ```ts theme={null} await corsair.neon.api.vpc.listOrganizationVPCEndpointsAllRegions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | Yes | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listProjectVPCEndpoints `vpc.listProjectVPCEndpoints` List VPC endpoint restrictions **Risk:** `read` ```ts theme={null} await corsair.neon.api.vpc.listProjectVPCEndpoints({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `branch_id` | `string` | No | — | | `database_name` | `string` | No | — | | `role_name` | `string` | No | — | | `endpoint_id` | `string` | No | — | | `operation_id` | `string` | No | — | | `permission_id` | `string` | No | — | | `request_id` | `string` | No | — | | `jwks_id` | `string` | No | — | | `key_id` | `string` | No | — | | `org_id` | `string` | No | — | | `member_id` | `string` | No | — | | `oauth_provider_id` | `string` | No | — | | `auth_user_id` | `string` | No | — | | `source_org_id` | `string` | No | — | | `region_id` | `string` | No | — | | `vpc_endpoint_id` | `string` | No | — | | `snapshot_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/neon/database Neon local sync: searchable entities, `.search()` filters, and operators. The Neon plugin syncs data locally. Use `corsair.neon.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Api Keys Path: `neon.db.apiKeys.search` ```ts theme={null} const rows = await corsair.neon.db.apiKeys.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_used_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Branches Path: `neon.db.branches.search` ```ts theme={null} const rows = await corsair.neon.db.branches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `default` | `boolean` | equals | | `current_state` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Compute Endpoints Path: `neon.db.computeEndpoints.search` ```ts theme={null} const rows = await corsair.neon.db.computeEndpoints.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `branch_id` | `string` | equals, contains, startsWith, endsWith, in | | `host` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `current_state` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Databases Path: `neon.db.databases.search` ```ts theme={null} const rows = await corsair.neon.db.databases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `branch_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `owner_name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `neon.db.organizations.search` ```ts theme={null} const rows = await corsair.neon.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `handle` | `string` | equals, contains, startsWith, endsWith, in | | `plan` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `neon.db.projects.search` ```ts theme={null} const rows = await corsair.neon.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `org_id` | `string` | equals, contains, startsWith, endsWith, in | | `region_id` | `string` | equals, contains, startsWith, endsWith, in | | `pg_version` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Roles Path: `neon.db.roles.search` ```ts theme={null} const rows = await corsair.neon.db.roles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `branch_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `protected` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Snapshots Path: `neon.db.snapshots.search` ```ts theme={null} const rows = await corsair.neon.db.snapshots.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/neon/overview Serverless Postgres platform for branching databases, scaling, and modern app backends. Use **Neon** through Corsair: one client, typed API calls, local DB sync. Neon exposes project, branch, database, role, compute endpoint, auth, organization, and infrastructure workflows for serverless Postgres. Use Corsair permissions for destructive actions such as deleting projects, dropping branches or databases, revoking API keys, or removing VPC endpoints. **What you get:** * 110 typed API operations * 8 synced entities (`apiKeys`, `branches`, `computeEndpoints`, `databases`, `organizations`, `projects`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/neon ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/neon ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/neon ``` ```bash bun theme={null} bun add corsair @corsair-dev/neon ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { neon } from '@corsair-dev/neon'; export const corsair = createCorsair({ plugins: [ neon(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} neon() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'neon', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`apiKeys.listApiKeys`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.neon.api.apiKeys.listApiKeys({}); ``` **`apiKeys.createApiKey`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.neon.api.apiKeys.createApiKey({}); ``` See the full list on the [API](/plugins/neon/api) page. ## Query synced data Synced entities support `tenant.neon.db..search()` and `.list()`: `apiKeys`, `branches`, `computeEndpoints`, `databases`, `organizations`, `projects`, `roles`, `snapshots`. See [Database](/plugins/neon/database) for filters and operators. ## What's next > **[API reference](/plugins/neon/api)** > > Every `neon.api.*` operation with input and output types. > **[Database](/plugins/neon/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/nextdns/api API reference for NextDNS: every `nextdns.api.*` operation with input and output types. Every `nextdns.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Allowlist ### add `allowlist.add` Allow a domain **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.allowlist.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | | `active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### delete `allowlist.delete` Remove a domain from the allowlist **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.allowlist.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `allowlist.get` List allowed domains **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.allowlist.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` *** ### replace `allowlist.replace` Replace the entire allowlist **Risk:** `destructive` ```ts theme={null} await corsair.nextdns.api.allowlist.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `domains` | `object[]` | Yes | — | > **domains full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` *** ### update `allowlist.update` Toggle an allowlist entry active/inactive **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.allowlist.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | | `active` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Analytics ### destinations `analytics.destinations` Get query-destination analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.destinations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `type` | `countries \| gafam` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### devices `analytics.devices` Get per-device analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.devices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### dnssec `analytics.dnssec` Get DNSSEC validation analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.dnssec({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### domains `analytics.domains` Get per-domain analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.domains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### encryption `analytics.encryption` Get encrypted-vs-plain DNS analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.encryption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### ips `analytics.ips` Get per-client-IP analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.ips({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### ipVersions `analytics.ipVersions` Get IPv4/IPv6 distribution analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.ipVersions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### protocols `analytics.protocols` Get DNS protocol distribution analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.protocols({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### queryTypes `analytics.queryTypes` Get DNS query-type analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.queryTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### reasons `analytics.reasons` Get blocking-reason analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.reasons({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ### status `analytics.status` Get query-status analytics **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.analytics.status({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ## Auth ### login `auth.login` Verify the API key is valid **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.auth.login({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `valid` | `boolean` | Yes | — | | `profileCount` | `number` | Yes | — | *** ## Denylist ### add `denylist.add` Block a domain **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.denylist.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | | `active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### list `denylist.list` List blocked domains **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.denylist.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` *** ### remove `denylist.remove` Unblock a domain **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.denylist.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### replace `denylist.replace` Replace the entire denylist **Risk:** `destructive` ```ts theme={null} await corsair.nextdns.api.denylist.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `domains` | `object[]` | Yes | — | > **domains full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` *** ### update `denylist.update` Toggle a denylist entry active/inactive **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.denylist.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | | `active` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Logs ### clear `logs.clear` Clear all stored query logs - cannot be undone **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.nextdns.api.logs.clear({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cleared` | `boolean` | Yes | — | *** ### download `logs.download` Download the CSV log export **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.logs.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output:** `string` *** ### get `logs.get` Get raw or filtered DNS query logs **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.logs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `raw` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **meta full type** > > ```ts theme={null} > { > pagination?: { > cursor?: string | null > } > } > ``` *** ## Parental Control ### addCategory `parentalControl.addCategory` Block or allow a content category **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.parentalControl.addCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `porn \| gambling \| piracy \| dating \| social-networks` | Yes | — | | `active` | `boolean` | No | — | | `recreation` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### addService `parentalControl.addService` Block or allow a specific service **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.parentalControl.addService({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | | `active` | `boolean` | No | — | | `recreation` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteCategory `parentalControl.deleteCategory` Remove a content category restriction **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.parentalControl.deleteCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `porn \| gambling \| piracy \| dating \| social-networks` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteService `parentalControl.deleteService` Remove a service restriction **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.parentalControl.deleteService({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `parentalControl.get` Get parental control settings **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.parentalControl.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `services` | `object[]` | No | — | | `categories` | `object[]` | No | — | | `recreation` | `object` | No | — | | `safeSearch` | `boolean` | No | — | | `youtubeRestrictedMode` | `boolean` | No | — | | `blockBypass` | `boolean` | No | — | > **services full type** > > ```ts theme={null} > { > id: string, > active?: boolean, > recreation?: boolean > }[] > ``` > **categories full type** > > ```ts theme={null} > { > id: string, > active?: boolean, > recreation?: boolean > }[] > ``` > **recreation full type** > > ```ts theme={null} > { > times?: { > } | null, > timezone?: string | null > } > ``` *** ### getCategories `parentalControl.getCategories` Get blocked/allowed content categories **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.parentalControl.getCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > active?: boolean, > recreation?: boolean > }[] > ``` *** ### getServices `parentalControl.getServices` Get blocked/allowed services **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.parentalControl.getServices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > active?: boolean, > recreation?: boolean > }[] > ``` *** ### replaceCategories `parentalControl.replaceCategories` Replace the entire set of category restrictions **Risk:** `destructive` ```ts theme={null} await corsair.nextdns.api.parentalControl.replaceCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `categories` | `object[]` | Yes | — | > **categories full type** > > ```ts theme={null} > { > id: porn | gambling | piracy | dating | social-networks, > active?: boolean, > recreation?: boolean > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > active?: boolean, > recreation?: boolean > }[] > ``` *** ### replaceServices `parentalControl.replaceServices` Replace the entire set of service restrictions **Risk:** `destructive` ```ts theme={null} await corsair.nextdns.api.parentalControl.replaceServices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `services` | `object[]` | Yes | — | > **services full type** > > ```ts theme={null} > { > id: string, > active?: boolean, > recreation?: boolean > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > active?: boolean, > recreation?: boolean > }[] > ``` *** ### update `parentalControl.update` Update safe search, YouTube restricted mode, or bypass blocking **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.parentalControl.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `safeSearch` | `boolean` | No | — | | `youtubeRestrictedMode` | `boolean` | No | — | | `blockBypass` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `services` | `object[]` | No | — | | `categories` | `object[]` | No | — | | `recreation` | `object` | No | — | | `safeSearch` | `boolean` | No | — | | `youtubeRestrictedMode` | `boolean` | No | — | | `blockBypass` | `boolean` | No | — | > **services full type** > > ```ts theme={null} > { > id: string, > active?: boolean, > recreation?: boolean > }[] > ``` > **categories full type** > > ```ts theme={null} > { > id: string, > active?: boolean, > recreation?: boolean > }[] > ``` > **recreation full type** > > ```ts theme={null} > { > times?: { > } | null, > timezone?: string | null > } > ``` *** ### updateCategory `parentalControl.updateCategory` Toggle a content category restriction **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.parentalControl.updateCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `porn \| gambling \| piracy \| dating \| social-networks` | Yes | — | | `active` | `boolean` | No | — | | `recreation` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### updateService `parentalControl.updateService` Toggle a service restriction **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.parentalControl.updateService({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | | `active` | `boolean` | No | — | | `recreation` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Privacy ### addBlocklist `privacy.addBlocklist` Enable an additional privacy blocklist **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.privacy.addBlocklist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### addNative `privacy.addNative` Block a native tracking service from a specific vendor **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.privacy.addNative({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteBlocklist `privacy.deleteBlocklist` Remove a privacy blocklist **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.privacy.deleteBlocklist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteNative `privacy.deleteNative` Unblock a native tracking service **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.privacy.deleteNative({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `privacy.get` Get privacy settings **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.privacy.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `blocklists` | `object[]` | No | — | | `natives` | `object[]` | No | — | | `disguisedTrackers` | `boolean` | No | — | | `allowAffiliate` | `boolean` | No | — | > **blocklists full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > website?: string | null, > description?: string | null, > entries?: number | null, > updatedOn?: string | null > }[] > ``` > **natives full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### replaceBlocklists `privacy.replaceBlocklists` Replace the entire set of enabled privacy blocklists **Risk:** `destructive` ```ts theme={null} await corsair.nextdns.api.privacy.replaceBlocklists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `ids` | `string[]` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > website?: string | null, > description?: string | null, > entries?: number | null, > updatedOn?: string | null > }[] > ``` *** ### replaceNatives `privacy.replaceNatives` Replace the entire set of blocked native trackers **Risk:** `destructive` ```ts theme={null} await corsair.nextdns.api.privacy.replaceNatives({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `ids` | `string[]` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `privacy.update` Update disguised-tracker and affiliate-link settings **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.privacy.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `disguisedTrackers` | `boolean` | No | — | | `allowAffiliate` | `boolean` | No | — | | `blocklists` | `object[]` | No | — | | `natives` | `object[]` | No | — | > **blocklists full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > website?: string | null, > description?: string | null, > entries?: number | null, > updatedOn?: string | null > }[] > ``` > **natives full type** > > ```ts theme={null} > { > id: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `blocklists` | `object[]` | No | — | | `natives` | `object[]` | No | — | | `disguisedTrackers` | `boolean` | No | — | | `allowAffiliate` | `boolean` | No | — | > **blocklists full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > website?: string | null, > description?: string | null, > entries?: number | null, > updatedOn?: string | null > }[] > ``` > **natives full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Profiles ### create `profiles.create` Create a new profile **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.profiles.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `security` | `object` | No | — | | `privacy` | `object` | No | — | | `parentalControl` | `object` | No | — | | `settings` | `object` | No | — | | `denylist` | `object[]` | No | — | | `allowlist` | `object[]` | No | — | | `rewrites` | `object[]` | No | — | > **security full type** > > ```ts theme={null} > { > threatIntelligenceFeeds?: boolean, > aiThreatDetection?: boolean, > googleSafeBrowsing?: boolean, > cryptojacking?: boolean, > dnsRebinding?: boolean, > idnHomographs?: boolean, > typosquatting?: boolean, > dga?: boolean, > nrd?: boolean, > ddns?: boolean, > parking?: boolean, > csam?: boolean, > tlds?: { > id: string > }[] > } > ``` > **privacy full type** > > ```ts theme={null} > { > blocklists?: { > id: string, > name?: string | null, > website?: string | null, > description?: string | null, > entries?: number | null, > updatedOn?: string | null > }[], > natives?: { > id: string > }[], > disguisedTrackers?: boolean, > allowAffiliate?: boolean > } > ``` > **parentalControl full type** > > ```ts theme={null} > { > services?: { > id: string, > active?: boolean, > recreation?: boolean > }[], > categories?: { > id: string, > active?: boolean, > recreation?: boolean > }[], > recreation?: { > times?: { > } | null, > timezone?: string | null > }, > safeSearch?: boolean, > youtubeRestrictedMode?: boolean, > blockBypass?: boolean > } > ``` > **settings full type** > > ```ts theme={null} > { > logs?: { > enabled?: boolean, > drop?: { > ip?: boolean, > domain?: boolean > }, > retention?: number | null, > location?: string | null > }, > blockPage?: { > enabled?: boolean > }, > performance?: { > ecs?: boolean, > cacheBoost?: boolean, > cnameFlattening?: boolean > }, > web3?: boolean > } > ``` > **denylist full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` > **allowlist full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` > **rewrites full type** > > ```ts theme={null} > { > id?: string, > name: string, > type?: string, > content: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fingerprint` | `string` | No | — | | `role` | `string` | No | — | | `name` | `string` | Yes | — | *** ### delete `profiles.delete` Delete a profile - cannot be undone **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.nextdns.api.profiles.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `profiles.get` Get full profile details including nested settings and lists **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.profiles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `fingerprint` | `string` | No | — | | `security` | `object` | No | — | | `privacy` | `object` | No | — | | `parentalControl` | `object` | No | — | | `settings` | `object` | No | — | | `setup` | `object` | No | — | | `denylist` | `object[]` | No | — | | `allowlist` | `object[]` | No | — | | `rewrites` | `object[]` | No | — | > **security full type** > > ```ts theme={null} > { > threatIntelligenceFeeds?: boolean, > aiThreatDetection?: boolean, > googleSafeBrowsing?: boolean, > cryptojacking?: boolean, > dnsRebinding?: boolean, > idnHomographs?: boolean, > typosquatting?: boolean, > dga?: boolean, > nrd?: boolean, > ddns?: boolean, > parking?: boolean, > csam?: boolean, > tlds?: { > id: string > }[] > } > ``` > **privacy full type** > > ```ts theme={null} > { > blocklists?: { > id: string, > name?: string | null, > website?: string | null, > description?: string | null, > entries?: number | null, > updatedOn?: string | null > }[], > natives?: { > id: string > }[], > disguisedTrackers?: boolean, > allowAffiliate?: boolean > } > ``` > **parentalControl full type** > > ```ts theme={null} > { > services?: { > id: string, > active?: boolean, > recreation?: boolean > }[], > categories?: { > id: string, > active?: boolean, > recreation?: boolean > }[], > recreation?: { > times?: { > } | null, > timezone?: string | null > }, > safeSearch?: boolean, > youtubeRestrictedMode?: boolean, > blockBypass?: boolean > } > ``` > **settings full type** > > ```ts theme={null} > { > logs?: { > enabled?: boolean, > drop?: { > ip?: boolean, > domain?: boolean > }, > retention?: number | null, > location?: string | null > }, > blockPage?: { > enabled?: boolean > }, > performance?: { > ecs?: boolean, > cacheBoost?: boolean, > cnameFlattening?: boolean > }, > web3?: boolean > } > ``` > **setup full type** > > ```ts theme={null} > { > ipv4?: string[], > ipv6?: string[], > linkedIp?: { > servers?: string[], > ip?: string | null, > ddns?: string | null, > updateToken?: string > } | null, > dnscrypt?: string | null > } > ``` > **denylist full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` > **allowlist full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` > **rewrites full type** > > ```ts theme={null} > { > id?: string, > name: string, > type?: string, > content: string > }[] > ``` *** ### list `profiles.list` List every profile the API key can see **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.profiles.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > fingerprint?: string | null, > role?: string | null, > name: string > }[] > ``` *** ### rename `profiles.rename` Rename a profile **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.profiles.rename({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### update `profiles.update` Partially update a profile **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.profiles.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `name` | `string` | No | — | | `security` | `object` | No | — | | `privacy` | `object` | No | — | | `parentalControl` | `object` | No | — | | `settings` | `object` | No | — | | `denylist` | `object[]` | No | — | | `allowlist` | `object[]` | No | — | | `rewrites` | `object[]` | No | — | > **security full type** > > ```ts theme={null} > { > threatIntelligenceFeeds?: boolean, > aiThreatDetection?: boolean, > googleSafeBrowsing?: boolean, > cryptojacking?: boolean, > dnsRebinding?: boolean, > idnHomographs?: boolean, > typosquatting?: boolean, > dga?: boolean, > nrd?: boolean, > ddns?: boolean, > parking?: boolean, > csam?: boolean, > tlds?: { > id: string > }[] > } > ``` > **privacy full type** > > ```ts theme={null} > { > blocklists?: { > id: string, > name?: string | null, > website?: string | null, > description?: string | null, > entries?: number | null, > updatedOn?: string | null > }[], > natives?: { > id: string > }[], > disguisedTrackers?: boolean, > allowAffiliate?: boolean > } > ``` > **parentalControl full type** > > ```ts theme={null} > { > services?: { > id: string, > active?: boolean, > recreation?: boolean > }[], > categories?: { > id: string, > active?: boolean, > recreation?: boolean > }[], > recreation?: { > times?: { > } | null, > timezone?: string | null > }, > safeSearch?: boolean, > youtubeRestrictedMode?: boolean, > blockBypass?: boolean > } > ``` > **settings full type** > > ```ts theme={null} > { > logs?: { > enabled?: boolean, > drop?: { > ip?: boolean, > domain?: boolean > }, > retention?: number | null, > location?: string | null > }, > blockPage?: { > enabled?: boolean > }, > performance?: { > ecs?: boolean, > cacheBoost?: boolean, > cnameFlattening?: boolean > }, > web3?: boolean > } > ``` > **denylist full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` > **allowlist full type** > > ```ts theme={null} > { > id: string, > active?: boolean > }[] > ``` > **rewrites full type** > > ```ts theme={null} > { > id?: string, > name: string, > type?: string, > content: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Rewrites ### add `rewrites.add` Add a DNS rewrite rule **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.rewrites.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `type` | `string` | No | — | | `content` | `string` | Yes | — | *** ### delete `rewrites.delete` Delete a DNS rewrite rule **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.rewrites.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `rewrites.get` List DNS rewrite rules **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.rewrites.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > name: string, > type?: string, > content: string > }[] > ``` *** ## Security ### addBlockedTld `security.addBlockedTld` Add a top-level domain to the security blocklist **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.security.addBlockedTld({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `security.get` Get security settings **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.security.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `threatIntelligenceFeeds` | `boolean` | No | — | | `aiThreatDetection` | `boolean` | No | — | | `googleSafeBrowsing` | `boolean` | No | — | | `cryptojacking` | `boolean` | No | — | | `dnsRebinding` | `boolean` | No | — | | `idnHomographs` | `boolean` | No | — | | `typosquatting` | `boolean` | No | — | | `dga` | `boolean` | No | — | | `nrd` | `boolean` | No | — | | `ddns` | `boolean` | No | — | | `parking` | `boolean` | No | — | | `csam` | `boolean` | No | — | | `tlds` | `object[]` | No | — | > **tlds full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### getTlds `security.getTlds` Get blocked top-level domains **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.security.getTlds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### removeBlockedTld `security.removeBlockedTld` Remove a top-level domain from the security blocklist **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.security.removeBlockedTld({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### replaceTlds `security.replaceTlds` Replace the entire blocked-TLD list **Risk:** `destructive` ```ts theme={null} await corsair.nextdns.api.security.replaceTlds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `tlds` | `string[]` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### update `security.update` Update multiple security settings in one call **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.security.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `threatIntelligenceFeeds` | `boolean` | No | — | | `aiThreatDetection` | `boolean` | No | — | | `googleSafeBrowsing` | `boolean` | No | — | | `cryptojacking` | `boolean` | No | — | | `dnsRebinding` | `boolean` | No | — | | `idnHomographs` | `boolean` | No | — | | `typosquatting` | `boolean` | No | — | | `dga` | `boolean` | No | — | | `nrd` | `boolean` | No | — | | `ddns` | `boolean` | No | — | | `parking` | `boolean` | No | — | | `csam` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `threatIntelligenceFeeds` | `boolean` | No | — | | `aiThreatDetection` | `boolean` | No | — | | `googleSafeBrowsing` | `boolean` | No | — | | `cryptojacking` | `boolean` | No | — | | `dnsRebinding` | `boolean` | No | — | | `idnHomographs` | `boolean` | No | — | | `typosquatting` | `boolean` | No | — | | `dga` | `boolean` | No | — | | `nrd` | `boolean` | No | — | | `ddns` | `boolean` | No | — | | `parking` | `boolean` | No | — | | `csam` | `boolean` | No | — | | `tlds` | `object[]` | No | — | > **tlds full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Settings ### get `settings.get` Get all settings for a profile **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.settings.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `logs` | `object` | No | — | | `blockPage` | `object` | No | — | | `performance` | `object` | No | — | | `web3` | `boolean` | No | — | > **logs full type** > > ```ts theme={null} > { > enabled?: boolean, > drop?: { > ip?: boolean, > domain?: boolean > }, > retention?: number | null, > location?: string | null > } > ``` > **blockPage full type** > > ```ts theme={null} > { > enabled?: boolean > } > ``` > **performance full type** > > ```ts theme={null} > { > ecs?: boolean, > cacheBoost?: boolean, > cnameFlattening?: boolean > } > ``` *** ### getBlockPage `settings.getBlockPage` Get block page settings **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.settings.getBlockPage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | No | — | *** ### getLogs `settings.getLogs` Get logging settings **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.settings.getLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | No | — | | `drop` | `object` | No | — | | `retention` | `number` | No | — | | `location` | `string` | No | — | > **drop full type** > > ```ts theme={null} > { > ip?: boolean, > domain?: boolean > } > ``` *** ### getPerformance `settings.getPerformance` Get performance settings (ECS, cache boost, CNAME flattening) **Risk:** `read` ```ts theme={null} await corsair.nextdns.api.settings.getPerformance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecs` | `boolean` | No | — | | `cacheBoost` | `boolean` | No | — | | `cnameFlattening` | `boolean` | No | — | *** ### logClientIps `settings.logClientIps` Enable or disable logging of client IPs **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.settings.logClientIps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `enabled` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | No | — | | `drop` | `object` | No | — | | `retention` | `number` | No | — | | `location` | `string` | No | — | > **drop full type** > > ```ts theme={null} > { > ip?: boolean, > domain?: boolean > } > ``` *** ### logDomains `settings.logDomains` Enable or disable logging of queried domains **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.settings.logDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `enabled` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | No | — | | `drop` | `object` | No | — | | `retention` | `number` | No | — | | `location` | `string` | No | — | > **drop full type** > > ```ts theme={null} > { > ip?: boolean, > domain?: boolean > } > ``` *** ### update `settings.update` Update multiple settings categories in one call **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.settings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `logs` | `object` | No | — | | `blockPage` | `object` | No | — | | `performance` | `object` | No | — | | `web3` | `boolean` | No | — | > **logs full type** > > ```ts theme={null} > { > enabled?: boolean, > drop?: { > ip?: boolean, > domain?: boolean > }, > retention?: number | null, > location?: string | null > } > ``` > **blockPage full type** > > ```ts theme={null} > { > enabled?: boolean > } > ``` > **performance full type** > > ```ts theme={null} > { > ecs?: boolean, > cacheBoost?: boolean, > cnameFlattening?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `logs` | `object` | No | — | | `blockPage` | `object` | No | — | | `performance` | `object` | No | — | | `web3` | `boolean` | No | — | > **logs full type** > > ```ts theme={null} > { > enabled?: boolean, > drop?: { > ip?: boolean, > domain?: boolean > }, > retention?: number | null, > location?: string | null > } > ``` > **blockPage full type** > > ```ts theme={null} > { > enabled?: boolean > } > ``` > **performance full type** > > ```ts theme={null} > { > ecs?: boolean, > cacheBoost?: boolean, > cnameFlattening?: boolean > } > ``` *** ### updateBlockPage `settings.updateBlockPage` Enable or disable the branded block page **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.settings.updateBlockPage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `enabled` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | No | — | *** ### updateLogs `settings.updateLogs` Update log retention, storage location, and privacy options **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.settings.updateLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `enabled` | `boolean` | No | — | | `retention` | `3600` | No | — | | `location` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `enabled` | `boolean` | No | — | | `drop` | `object` | No | — | | `retention` | `number` | No | — | | `location` | `string` | No | — | > **drop full type** > > ```ts theme={null} > { > ip?: boolean, > domain?: boolean > } > ``` *** ### updatePerformance `settings.updatePerformance` Update performance optimization settings **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.settings.updatePerformance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `ecs` | `boolean` | No | — | | `cacheBoost` | `boolean` | No | — | | `cnameFlattening` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ecs` | `boolean` | No | — | | `cacheBoost` | `boolean` | No | — | | `cnameFlattening` | `boolean` | No | — | *** ## Setup ### updateLinkedIp `setup.updateLinkedIp` Update the profile's Linked IP to the caller's current public IP **Risk:** `write` ```ts theme={null} await corsair.nextdns.api.setup.updateLinkedIp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `servers` | `string[]` | No | — | | `ip` | `string` | No | — | | `ddns` | `string` | No | — | | `updateToken` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/nextdns/database NextDNS local sync: searchable entities, `.search()` filters, and operators. The NextDNS plugin syncs data locally. Use `corsair.nextdns.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Profiles Path: `nextdns.db.profiles.search` ```ts theme={null} const rows = await corsair.nextdns.db.profiles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `fingerprint` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/nextdns/overview DNS security service for blocking ads, trackers, and malware at the network level. Use **NextDNS** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 71 typed API operations * 1 synced entity (`profiles`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/nextdns ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/nextdns ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/nextdns ``` ```bash bun theme={null} bun add corsair @corsair-dev/nextdns ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { nextdns } from '@corsair-dev/nextdns'; export const corsair = createCorsair({ plugins: [ nextdns(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} nextdns() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'nextdns', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`allowlist.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.nextdns.api.allowlist.get({}); ``` **`allowlist.add`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.nextdns.api.allowlist.add({}); ``` See the full list on the [API](/plugins/nextdns/api) page. ## Query synced data Synced entities support `tenant.nextdns.db..search()` and `.list()`: `profiles`. See [Database](/plugins/nextdns/database) for filters and operators. ## What's next > **[API reference](/plugins/nextdns/api)** > > Every `nextdns.api.*` operation with input and output types. > **[Database](/plugins/nextdns/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/northflank/api API reference for Northflank: every `northflank.api.*` operation with input and output types. Every `northflank.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Addon Types ### list `addonTypes.list` List available Northflank addon types **Risk:** `read` ```ts theme={null} await corsair.northflank.api.addonTypes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > addonTypes: { > type: string, > name: string, > description?: string, > features?: { > }, > resources?: { > }, > versions?: string[], > majors?: string[] > }[] > } > ``` > **pagination full type** > > ```ts theme={null} > { > hasNextPage: boolean, > cursor?: string, > count: number > } > ``` *** ## Cloud Providers ### listNodeTypes `cloudProviders.listNodeTypes` List supported cloud provider node types **Risk:** `read` ```ts theme={null} await corsair.northflank.api.cloudProviders.listNodeTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `cursor` | `string` | No | — | | `provider` | `string` | No | — | | `region` | `string` | No | — | | `family` | `string` | No | — | | `maxGenerationAge` | `number` | No | — | | `hasGpu` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > nodeTypes: { > id: string, > name: string, > family?: string | null, > processorFamily?: string | null, > workloadType?: string | null, > generationAge?: number | null, > provider?: string | null, > resources?: { > vcpu?: number | null, > memory?: number | null > } > }[] > } > ``` > **pagination full type** > > ```ts theme={null} > { > hasNextPage: boolean, > cursor?: string, > count: number > } > ``` *** ### listRegions `cloudProviders.listRegions` List supported cloud provider regions **Risk:** `read` ```ts theme={null} await corsair.northflank.api.cloudProviders.listRegions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `cursor` | `string` | No | — | | `provider` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > regions: { > id: string, > name: string, > regionName?: string, > provider?: string, > availabilityZones?: { > id: string, > name: string > }[] > }[] > } > ``` > **pagination full type** > > ```ts theme={null} > { > hasNextPage: boolean, > cursor?: string, > count: number > } > ``` *** ## Misc ### getDnsId `misc.getDnsId` Get the DNS identifier for the authenticated account **Risk:** `read` ```ts theme={null} await corsair.northflank.api.misc.getDnsId({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > dns: string > } > ``` *** ## Pipelines ### list `pipelines.list` List pipelines in a Northflank project **Risk:** `read` ```ts theme={null} await corsair.northflank.api.pipelines.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > pipelines: { > id: string, > name?: string, > description?: string, > createdAt?: string, > updatedAt?: string > }[] > } > ``` > **pagination full type** > > ```ts theme={null} > { > hasNextPage: boolean, > cursor?: string, > count: number > } > ``` *** ## Plans ### list `plans.list` List available Northflank resource plans **Risk:** `read` ```ts theme={null} await corsair.northflank.api.plans.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > plans: { > id: string, > name: string, > currency?: string, > amountPerMonth?: number, > amountPerHour?: number > }[] > } > ``` > **pagination full type** > > ```ts theme={null} > { > hasNextPage: boolean, > cursor?: string, > count: number > } > ``` *** ## Projects ### create `projects.create` Create a new Northflank project **Risk:** `write` ```ts theme={null} await corsair.northflank.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `region` | `string` | No | — | | `clusterId` | `string` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > color?: string, > region?: string, > clusterId?: string, > createdAt?: string, > updatedAt?: string > } > ``` *** ### createOrUpdate `projects.createOrUpdate` Create or update a Northflank project (upsert) **Risk:** `write` ```ts theme={null} await corsair.northflank.api.projects.createOrUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `color` | `string` | No | — | | `region` | `string` | No | — | | `clusterId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > color?: string, > region?: string, > clusterId?: string, > createdAt?: string, > updatedAt?: string > } > ``` *** ### delete `projects.delete` Delete a Northflank project **Risk:** `write` ```ts theme={null} await corsair.northflank.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `delete_child_objects` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ### get `projects.get` Get details of a Northflank project **Risk:** `read` ```ts theme={null} await corsair.northflank.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > color?: string, > region?: string, > clusterId?: string, > createdAt?: string, > updatedAt?: string > } > ``` *** ### list `projects.list` List Northflank projects **Risk:** `read` ```ts theme={null} await corsair.northflank.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > projects: { > id: string, > name: string, > description?: string, > color?: string, > region?: string, > clusterId?: string, > createdAt?: string, > updatedAt?: string > }[] > } > ``` > **pagination full type** > > ```ts theme={null} > { > hasNextPage: boolean, > cursor?: string, > count: number > } > ``` *** ### update `projects.update` Update an existing Northflank project **Risk:** `write` ```ts theme={null} await corsair.northflank.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `description` | `string` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > color?: string, > region?: string, > clusterId?: string, > createdAt?: string, > updatedAt?: string > } > ``` *** ## Regions ### list `regions.list` List available Northflank regions **Risk:** `read` ```ts theme={null} await corsair.northflank.api.regions.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > regions: { > id: string, > name: string, > regionName?: string > }[] > } > ``` *** ## Secrets ### create `secrets.create` Create a new secret group in a Northflank project **Risk:** `write` ```ts theme={null} await corsair.northflank.api.secrets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `stageId` | `string` | No | — | | `tags` | `string[]` | No | — | | `type` | `secret \| config` | No | — | | `secretType` | `environment-arguments \| environment \| arguments` | Yes | — | | `priority` | `number` | Yes | — | | `restrictions` | `object` | No | — | | `addonDependencies` | `object[]` | No | — | | `externalAddonDependencies` | `object[]` | No | — | | `secrets` | `object` | No | — | > **restrictions full type** > > ```ts theme={null} > { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > } > ``` > **addonDependencies full type** > > ```ts theme={null} > { > addonId: string, > keys?: { > keyName: string, > aliases?: string[] > }[] > }[] > ``` > **externalAddonDependencies full type** > > ```ts theme={null} > { > addonId: string, > keys?: { > keyName: string, > aliases?: string[] > }[] > }[] > ``` > **secrets full type** > > ```ts theme={null} > { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > projectId?: string, > name: string, > description?: string, > tags?: string[], > type?: secret | config, > secretType?: environment-arguments | environment | arguments, > priority?: number, > restrictions?: { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > }, > secrets?: { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > }, > createdAt?: string, > updatedAt?: string > } > ``` *** ### createOrUpdate `secrets.createOrUpdate` Create or update a secret group in a Northflank project **Risk:** `write` ```ts theme={null} await corsair.northflank.api.secrets.createOrUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `stageId` | `string` | No | — | | `tags` | `string[]` | No | — | | `type` | `secret \| config` | No | — | | `secretType` | `environment-arguments \| environment \| arguments` | Yes | — | | `priority` | `number` | Yes | — | | `restrictions` | `object` | No | — | | `addonDependencies` | `object[]` | No | — | | `externalAddonDependencies` | `object[]` | No | — | | `secrets` | `object` | No | — | > **restrictions full type** > > ```ts theme={null} > { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > } > ``` > **addonDependencies full type** > > ```ts theme={null} > { > addonId: string, > keys?: { > keyName: string, > aliases?: string[] > }[] > }[] > ``` > **externalAddonDependencies full type** > > ```ts theme={null} > { > addonId: string, > keys?: { > keyName: string, > aliases?: string[] > }[] > }[] > ``` > **secrets full type** > > ```ts theme={null} > { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > projectId?: string, > name: string, > description?: string, > tags?: string[], > type?: secret | config, > secretType?: environment-arguments | environment | arguments, > priority?: number, > restrictions?: { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > }, > secrets?: { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > }, > createdAt?: string, > updatedAt?: string > } > ``` *** ### get `secrets.get` Get details of a Northflank secret group **Risk:** `read` ```ts theme={null} await corsair.northflank.api.secrets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `secretId` | `string` | Yes | — | | `show` | `this \| inherited \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > projectId?: string, > name: string, > description?: string, > tags?: string[], > type?: secret | config, > secretType?: environment-arguments | environment | arguments, > priority?: number, > restrictions?: { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > }, > secrets?: { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > }, > createdAt?: string, > updatedAt?: string > } > ``` *** ### getDetails `secrets.getDetails` Get a secret group with linked addon details **Risk:** `read` ```ts theme={null} await corsair.northflank.api.secrets.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `secretId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > projectId?: string, > name: string, > description?: string, > tags?: string[], > type?: secret | config, > secretType?: environment-arguments | environment | arguments, > priority?: number, > restrictions?: { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > }, > secrets?: { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > }, > createdAt?: string, > updatedAt?: string, > addonSecrets?: { > id: string, > name: string, > addonType: string, > version: string, > variables?: { > } > }[] > } > ``` *** ### list `secrets.list` List secret groups in a Northflank project **Risk:** `read` ```ts theme={null} await corsair.northflank.api.secrets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > secrets: { > id: string, > projectId?: string, > name: string, > description?: string, > tags?: string[], > type?: secret | config, > secretType?: environment-arguments | environment | arguments, > priority?: number, > restrictions?: { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > }, > secrets?: { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > }, > createdAt?: string, > updatedAt?: string > }[] > } > ``` > **pagination full type** > > ```ts theme={null} > { > hasNextPage: boolean, > cursor?: string, > count: number > } > ``` *** ### patch `secrets.patch` Partially update a secret group in a Northflank project **Risk:** `write` ```ts theme={null} await corsair.northflank.api.secrets.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `secretId` | `string` | Yes | — | | `description` | `string` | No | — | | `stageId` | `string` | No | — | | `tags` | `string[]` | No | — | | `type` | `secret \| config` | No | — | | `secretType` | `environment-arguments \| environment \| arguments` | No | — | | `priority` | `number` | No | — | | `restrictions` | `object` | No | — | | `addonDependencies` | `object[]` | No | — | | `externalAddonDependencies` | `object[]` | No | — | | `secrets` | `object` | No | — | > **restrictions full type** > > ```ts theme={null} > { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > } > ``` > **addonDependencies full type** > > ```ts theme={null} > { > addonId: string, > keys?: { > keyName: string, > aliases?: string[] > }[] > }[] > ``` > **externalAddonDependencies full type** > > ```ts theme={null} > { > addonId: string, > keys?: { > keyName: string, > aliases?: string[] > }[] > }[] > ``` > **secrets full type** > > ```ts theme={null} > { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > projectId?: string, > name: string, > description?: string, > tags?: string[], > type?: secret | config, > secretType?: environment-arguments | environment | arguments, > priority?: number, > restrictions?: { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > }, > secrets?: { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > }, > createdAt?: string, > updatedAt?: string > } > ``` *** ### update `secrets.update` Update a secret group in a Northflank project **Risk:** `write` ```ts theme={null} await corsair.northflank.api.secrets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `secretId` | `string` | Yes | — | | `description` | `string` | No | — | | `priority` | `number` | No | — | | `restrictions` | `object` | No | — | | `addonDependencies` | `object[]` | No | — | | `externalAddonDependencies` | `object[]` | No | — | | `type` | `secret \| config` | No | — | | `secretType` | `environment-arguments \| environment \| arguments` | No | — | | `secrets` | `object` | No | — | > **restrictions full type** > > ```ts theme={null} > { > restricted?: boolean, > nfObjects?: { > id: string, > type: service | job > }[], > tags?: string[], > tagMatchCondition?: and | or, > stageIds?: string[] > } > ``` > **addonDependencies full type** > > ```ts theme={null} > { > addonId: string, > keys?: { > keyName: string, > aliases?: string[] > }[] > }[] > ``` > **externalAddonDependencies full type** > > ```ts theme={null} > { > addonId: string, > keys?: { > keyName: string, > aliases?: string[] > }[] > }[] > ``` > **secrets full type** > > ```ts theme={null} > { > variables?: { > }, > files?: { > }, > dockerSecretMounts?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` *** ## Services ### list `services.list` List services in a Northflank project **Risk:** `read` ```ts theme={null} await corsair.northflank.api.services.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > services: { > id: string, > appId?: string, > projectId?: string, > stageId?: string, > name?: string, > description?: string, > serviceType?: combined | build | deployment, > disabledCI?: boolean, > disabledCD?: boolean > }[] > } > ``` > **pagination full type** > > ```ts theme={null} > { > hasNextPage: boolean, > cursor?: string, > count: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/northflank/database Northflank local sync: searchable entities, `.search()` filters, and operators. The Northflank plugin syncs data locally. Use `corsair.northflank.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/northflank/overview Connect Northflank to manage projects, services, preview environments, secrets, plans, and regions. Use **Northflank** through Corsair: one client, typed API calls. **What you get:** * 21 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/northflank ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/northflank ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/northflank ``` ```bash bun theme={null} bun add corsair @corsair-dev/northflank ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { northflank } from '@corsair-dev/northflank'; export const corsair = createCorsair({ plugins: [ northflank(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} northflank() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'northflank', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`addonTypes.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.northflank.api.addonTypes.list({}); ``` **`projects.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.northflank.api.projects.create({}); ``` See the full list on the [API](/plugins/northflank/api) page. ## What's next > **[API reference](/plugins/northflank/api)** > > Every `northflank.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/notion/api API reference for Notion: every `notion.api.*` operation with input and output types. Every `notion.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Blocks ### appendBlock `blocks.appendBlock` Append new blocks to a block or page **Risk:** `write` ```ts theme={null} await corsair.notion.api.blocks.appendBlock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `block_id` | `string` | Yes | — | | `children` | `object[]` | Yes | — | > **children full type** > > ```ts theme={null} > { > object: block, > id: string, > type: string, > created_time?: string, > created_by?: { > object: user, > id: string > }, > last_edited_time?: string, > last_edited_by?: { > object: user, > id: string > }, > archived?: boolean, > has_children?: boolean, > parent?: { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `results` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `type` | `string` | No | — | | `page_or_database` | `object` | No | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > object: block, > id: string, > type: string, > created_time?: string, > created_by?: { > object: user, > id: string > }, > last_edited_time?: string, > last_edited_by?: { > object: user, > id: string > }, > archived?: boolean, > has_children?: boolean, > parent?: { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > }[] > ``` > **page\_or\_database full type** > > ```ts theme={null} > { > } > ``` *** ### getManyChildBlocks `blocks.getManyChildBlocks` Retrieve child blocks of a block or page **Risk:** `read` ```ts theme={null} await corsair.notion.api.blocks.getManyChildBlocks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `block_id` | `string` | Yes | — | | `start_cursor` | `string` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `results` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `type` | `string` | No | — | | `page_or_database` | `object` | No | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > object: block, > id: string, > type: string, > created_time?: string, > created_by?: { > object: user, > id: string > }, > last_edited_time?: string, > last_edited_by?: { > object: user, > id: string > }, > archived?: boolean, > has_children?: boolean, > parent?: { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > }[] > ``` > **page\_or\_database full type** > > ```ts theme={null} > { > } > ``` *** ## Database Pages ### createDatabasePage `databasePages.createDatabasePage` Create a new page in a database **Risk:** `write` ```ts theme={null} await corsair.notion.api.databasePages.createDatabasePage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `database_id` | `string` | Yes | — | | `properties` | `object` | Yes | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `page` | Yes | — | | `id` | `string` | Yes | — | | `created_time` | `string` | Yes | — | | `created_by` | `object` | No | — | | `last_edited_time` | `string` | Yes | — | | `last_edited_by` | `object` | No | — | | `cover` | `object` | No | — | | `icon` | `object` | No | — | | `parent` | `object` | Yes | — | | `archived` | `boolean` | Yes | — | | `in_trash` | `boolean` | No | — | | `is_locked` | `boolean` | No | — | | `properties` | `object` | Yes | — | | `url` | `string` | Yes | — | | `public_url` | `string` | No | — | > **created\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **last\_edited\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **cover full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > file?: { > url: string > } > } > ``` > **icon full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > emoji?: string > } > ``` > **parent full type** > > ```ts theme={null} > { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### getDatabasePage `databasePages.getDatabasePage` Get a page from a database **Risk:** `read` ```ts theme={null} await corsair.notion.api.databasePages.getDatabasePage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `page` | Yes | — | | `id` | `string` | Yes | — | | `created_time` | `string` | Yes | — | | `created_by` | `object` | No | — | | `last_edited_time` | `string` | Yes | — | | `last_edited_by` | `object` | No | — | | `cover` | `object` | No | — | | `icon` | `object` | No | — | | `parent` | `object` | Yes | — | | `archived` | `boolean` | Yes | — | | `in_trash` | `boolean` | No | — | | `is_locked` | `boolean` | No | — | | `properties` | `object` | Yes | — | | `url` | `string` | Yes | — | | `public_url` | `string` | No | — | > **created\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **last\_edited\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **cover full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > file?: { > url: string > } > } > ``` > **icon full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > emoji?: string > } > ``` > **parent full type** > > ```ts theme={null} > { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### getManyDatabasePages `databasePages.getManyDatabasePages` List and filter pages in a database **Risk:** `read` ```ts theme={null} await corsair.notion.api.databasePages.getManyDatabasePages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `database_id` | `string` | Yes | — | | `filter` | `any` | No | — | | `sorts` | `any[]` | No | — | | `start_cursor` | `string` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `results` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `type` | `string` | No | — | | `page_or_database` | `object` | No | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > object: page, > id: string, > created_time: string, > created_by?: { > object: user, > id: string > }, > last_edited_time: string, > last_edited_by?: { > object: user, > id: string > }, > cover?: { > type: string, > external?: { > url: string > }, > file?: { > url: string > } > } | null, > icon?: { > type: string, > external?: { > url: string > }, > emoji?: string > } | null, > parent: { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > }, > archived: boolean, > in_trash?: boolean, > is_locked?: boolean, > properties: { > }, > url: string, > public_url?: string | null > }[] > ``` > **page\_or\_database full type** > > ```ts theme={null} > { > } > ``` *** ### updateDatabasePage `databasePages.updateDatabasePage` Update properties of a database page **Risk:** `write` ```ts theme={null} await corsair.notion.api.databasePages.updateDatabasePage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | | `properties` | `object` | No | — | | `archived` | `boolean` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `page` | Yes | — | | `id` | `string` | Yes | — | | `created_time` | `string` | Yes | — | | `created_by` | `object` | No | — | | `last_edited_time` | `string` | Yes | — | | `last_edited_by` | `object` | No | — | | `cover` | `object` | No | — | | `icon` | `object` | No | — | | `parent` | `object` | Yes | — | | `archived` | `boolean` | Yes | — | | `in_trash` | `boolean` | No | — | | `is_locked` | `boolean` | No | — | | `properties` | `object` | Yes | — | | `url` | `string` | Yes | — | | `public_url` | `string` | No | — | > **created\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **last\_edited\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **cover full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > file?: { > url: string > } > } > ``` > **icon full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > emoji?: string > } > ``` > **parent full type** > > ```ts theme={null} > { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` *** ## Databases ### getDatabase `databases.getDatabase` Get info about a database **Risk:** `read` ```ts theme={null} await corsair.notion.api.databases.getDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `database_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `database` | Yes | — | | `id` | `string` | Yes | — | | `cover` | `object` | No | — | | `icon` | `object` | No | — | | `created_time` | `string` | Yes | — | | `created_by` | `object` | No | — | | `last_edited_time` | `string` | Yes | — | | `last_edited_by` | `object` | No | — | | `title` | `object[]` | Yes | — | | `description` | `object[]` | Yes | — | | `is_inline` | `boolean` | Yes | — | | `properties` | `object` | Yes | — | | `parent` | `object` | Yes | — | | `url` | `string` | Yes | — | | `public_url` | `string` | No | — | | `archived` | `boolean` | Yes | — | | `in_trash` | `boolean` | No | — | > **cover full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > } > } > ``` > **icon full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > emoji?: string > } > ``` > **created\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **last\_edited\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **title full type** > > ```ts theme={null} > { > type: string, > text?: { > content: string, > link?: { > url: string > } | null > }, > annotations?: { > bold?: boolean, > italic?: boolean, > strikethrough?: boolean, > underline?: boolean, > code?: boolean, > color?: string > }, > plain_text?: string, > href?: string | null > }[] > ``` > **description full type** > > ```ts theme={null} > { > type: string, > text?: { > content: string, > link?: { > url: string > } | null > }, > annotations?: { > bold?: boolean, > italic?: boolean, > strikethrough?: boolean, > underline?: boolean, > code?: boolean, > color?: string > }, > plain_text?: string, > href?: string | null > }[] > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` > **parent full type** > > ```ts theme={null} > { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > ``` *** ### getManyDatabases `databases.getManyDatabases` List databases accessible to the integration **Risk:** `read` ```ts theme={null} await corsair.notion.api.databases.getManyDatabases({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_cursor` | `string` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `results` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `type` | `string` | No | — | | `page_or_database` | `object` | No | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > object: database, > id: string, > cover?: { > type: string, > external?: { > url: string > } > } | null, > icon?: { > type: string, > external?: { > url: string > }, > emoji?: string > } | null, > created_time: string, > created_by?: { > object: user, > id: string > }, > last_edited_time: string, > last_edited_by?: { > object: user, > id: string > }, > title: { > type: string, > text?: { > content: string, > link?: { > url: string > } | null > }, > annotations?: { > bold?: boolean, > italic?: boolean, > strikethrough?: boolean, > underline?: boolean, > code?: boolean, > color?: string > }, > plain_text?: string, > href?: string | null > }[], > description: { > type: string, > text?: { > content: string, > link?: { > url: string > } | null > }, > annotations?: { > bold?: boolean, > italic?: boolean, > strikethrough?: boolean, > underline?: boolean, > code?: boolean, > color?: string > }, > plain_text?: string, > href?: string | null > }[], > is_inline: boolean, > properties: { > }, > parent: { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > }, > url: string, > public_url?: string | null, > archived: boolean, > in_trash?: boolean > }[] > ``` > **page\_or\_database full type** > > ```ts theme={null} > { > } > ``` *** ### searchDatabase `databases.searchDatabase` Search and filter databases **Risk:** `read` ```ts theme={null} await corsair.notion.api.databases.searchDatabase({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `sort` | `any` | No | — | | `filter` | `any` | No | — | | `start_cursor` | `string` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `results` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `type` | `string` | No | — | | `page_or_database` | `object` | No | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > object: database, > id: string, > cover?: { > type: string, > external?: { > url: string > } > } | null, > icon?: { > type: string, > external?: { > url: string > }, > emoji?: string > } | null, > created_time: string, > created_by?: { > object: user, > id: string > }, > last_edited_time: string, > last_edited_by?: { > object: user, > id: string > }, > title: { > type: string, > text?: { > content: string, > link?: { > url: string > } | null > }, > annotations?: { > bold?: boolean, > italic?: boolean, > strikethrough?: boolean, > underline?: boolean, > code?: boolean, > color?: string > }, > plain_text?: string, > href?: string | null > }[], > description: { > type: string, > text?: { > content: string, > link?: { > url: string > } | null > }, > annotations?: { > bold?: boolean, > italic?: boolean, > strikethrough?: boolean, > underline?: boolean, > code?: boolean, > color?: string > }, > plain_text?: string, > href?: string | null > }[], > is_inline: boolean, > properties: { > }, > parent: { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > }, > url: string, > public_url?: string | null, > archived: boolean, > in_trash?: boolean > }[] > ``` > **page\_or\_database full type** > > ```ts theme={null} > { > } > ``` *** ## Pages ### archivePage `pages.archivePage` Archive (trash) a page **Risk:** `destructive` ```ts theme={null} await corsair.notion.api.pages.archivePage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `page` | Yes | — | | `id` | `string` | Yes | — | | `created_time` | `string` | Yes | — | | `created_by` | `object` | No | — | | `last_edited_time` | `string` | Yes | — | | `last_edited_by` | `object` | No | — | | `cover` | `object` | No | — | | `icon` | `object` | No | — | | `parent` | `object` | Yes | — | | `archived` | `boolean` | Yes | — | | `in_trash` | `boolean` | No | — | | `is_locked` | `boolean` | No | — | | `properties` | `object` | Yes | — | | `url` | `string` | Yes | — | | `public_url` | `string` | No | — | > **created\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **last\_edited\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **cover full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > file?: { > url: string > } > } > ``` > **icon full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > emoji?: string > } > ``` > **parent full type** > > ```ts theme={null} > { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### createPage `pages.createPage` Create a new page **Risk:** `write` ```ts theme={null} await corsair.notion.api.pages.createPage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent` | `object` | Yes | — | | `properties` | `object` | No | — | | `children` | `object[]` | No | — | > **parent full type** > > ```ts theme={null} > { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: workspace, > workspace: boolean > } > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` > **children full type** > > ```ts theme={null} > { > object: block, > id: string, > type: string, > created_time?: string, > created_by?: { > object: user, > id: string > }, > last_edited_time?: string, > last_edited_by?: { > object: user, > id: string > }, > archived?: boolean, > has_children?: boolean, > parent?: { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `page` | Yes | — | | `id` | `string` | Yes | — | | `created_time` | `string` | Yes | — | | `created_by` | `object` | No | — | | `last_edited_time` | `string` | Yes | — | | `last_edited_by` | `object` | No | — | | `cover` | `object` | No | — | | `icon` | `object` | No | — | | `parent` | `object` | Yes | — | | `archived` | `boolean` | Yes | — | | `in_trash` | `boolean` | No | — | | `is_locked` | `boolean` | No | — | | `properties` | `object` | Yes | — | | `url` | `string` | Yes | — | | `public_url` | `string` | No | — | > **created\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **last\_edited\_by full type** > > ```ts theme={null} > { > object: user, > id: string > } > ``` > **cover full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > file?: { > url: string > } > } > ``` > **icon full type** > > ```ts theme={null} > { > type: string, > external?: { > url: string > }, > emoji?: string > } > ``` > **parent full type** > > ```ts theme={null} > { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > } > ``` > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### searchPage `pages.searchPage` Search pages and databases by title **Risk:** `read` ```ts theme={null} await corsair.notion.api.pages.searchPage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `sort` | `any` | No | — | | `filter` | `any` | No | — | | `start_cursor` | `string` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `results` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `type` | `string` | No | — | | `page_or_database` | `object` | No | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > ( > { > object: page, > id: string, > created_time: string, > created_by?: { > object: user, > id: string > }, > last_edited_time: string, > last_edited_by?: { > object: user, > id: string > }, > cover?: { > type: string, > external?: { > url: string > }, > file?: { > url: string > } > } | null, > icon?: { > type: string, > external?: { > url: string > }, > emoji?: string > } | null, > parent: { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > }, > archived: boolean, > in_trash?: boolean, > is_locked?: boolean, > properties: { > }, > url: string, > public_url?: string | null > } | { > object: database, > id: string, > cover?: { > type: string, > external?: { > url: string > } > } | null, > icon?: { > type: string, > external?: { > url: string > }, > emoji?: string > } | null, > created_time: string, > created_by?: { > object: user, > id: string > }, > last_edited_time: string, > last_edited_by?: { > object: user, > id: string > }, > title: { > type: string, > text?: { > content: string, > link?: { > url: string > } | null > }, > annotations?: { > bold?: boolean, > italic?: boolean, > strikethrough?: boolean, > underline?: boolean, > code?: boolean, > color?: string > }, > plain_text?: string, > href?: string | null > }[], > description: { > type: string, > text?: { > content: string, > link?: { > url: string > } | null > }, > annotations?: { > bold?: boolean, > italic?: boolean, > strikethrough?: boolean, > underline?: boolean, > code?: boolean, > color?: string > }, > plain_text?: string, > href?: string | null > }[], > is_inline: boolean, > properties: { > }, > parent: { > type: workspace, > workspace: boolean > } | { > type: page_id, > page_id: string > } | { > type: database_id, > database_id: string > } | { > type: block_id, > block_id: string > }, > url: string, > public_url?: string | null, > archived: boolean, > in_trash?: boolean > } > )[] > ``` > **page\_or\_database full type** > > ```ts theme={null} > { > } > ``` *** ## Users ### getManyUsers `users.getManyUsers` List all users in the workspace **Risk:** `read` ```ts theme={null} await corsair.notion.api.users.getManyUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_cursor` | `string` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `results` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | | `has_more` | `boolean` | Yes | — | | `type` | `string` | No | — | | `page_or_database` | `object` | No | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > object: user, > id: string, > type: person | bot, > name?: string | null, > avatar_url?: string | null > }[] > ``` > **page\_or\_database full type** > > ```ts theme={null} > { > } > ``` *** ### getUser `users.getUser` Get info about a user **Risk:** `read` ```ts theme={null} await corsair.notion.api.users.getUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `user` | Yes | — | | `id` | `string` | Yes | — | | `type` | `person \| bot` | Yes | — | | `name` | `string` | No | — | | `avatar_url` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/notion/database Notion local sync: searchable entities, `.search()` filters, and operators. The Notion plugin syncs data locally. Use `corsair.notion.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Blocks Path: `notion.db.blocks.search` ```ts theme={null} const rows = await corsair.notion.db.blocks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `object` | `string` | equals, contains, startsWith, endsWith, in | | `created_time` | `string` | equals, contains, startsWith, endsWith, in | | `last_edited_time` | `string` | equals, contains, startsWith, endsWith, in | | `archived` | `boolean` | equals | | `has_children` | `boolean` | equals | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `parent_type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Databases Path: `notion.db.databases.search` ```ts theme={null} const rows = await corsair.notion.db.databases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `object` | `string` | equals, contains, startsWith, endsWith, in | | `created_time` | `string` | equals, contains, startsWith, endsWith, in | | `last_edited_time` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `is_inline` | `boolean` | equals | | `archived` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `properties_json` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `parent_type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pages Path: `notion.db.pages.search` ```ts theme={null} const rows = await corsair.notion.db.pages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `object` | `string` | equals, contains, startsWith, endsWith, in | | `created_time` | `string` | equals, contains, startsWith, endsWith, in | | `last_edited_time` | `string` | equals, contains, startsWith, endsWith, in | | `archived` | `boolean` | equals | | `is_locked` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `public_url` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `parent_type` | `string` | equals, contains, startsWith, endsWith, in | | `database_id` | `string` | equals, contains, startsWith, endsWith, in | | `properties_json` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `notion.db.users.search` ```ts theme={null} const rows = await corsair.notion.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `object` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `avatar_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/notion/get-credentials Step-by-step instructions for Notion internal integration tokens, OAuth, and webhook verification for the Corsair Notion plugin. This guide walks you through obtaining all required credentials for the Notion plugin. ## Authentication Methods The Notion plugin supports two authentication methods: * **[`api_key`](/concepts/api-key)** (default) — Internal integration secret (starts with `secret_`) * **[`oauth_2`](/concepts/oauth)** — Notion OAuth 2.0 for user / workspace authorization ## API Key (Internal Integration) ### Step 1: Create an Internal Integration 1. Open [My integrations](https://www.notion.so/my-integrations) in Notion. 2. Click **New integration**. 3. Choose the **Associated workspace** and give the integration a name. 4. Under **Capabilities**, enable the content capabilities your app needs (read/write comments, content, etc.). 5. Submit and open the integration’s **Secrets** tab. 6. Copy the **Internal Integration Secret** (starts with `secret_`). ### Step 2: Share Pages or Databases With the Integration Internal integrations only see pages and databases you explicitly share: 1. Open the Notion page or database. 2. Use **Share** → invite your integration (or **Connections** / **Add connections** depending on UI). **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=notion api_key=secret_XXXXXXXXXXXX ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=notion --credentials ``` ## OAuth 2.0 Use OAuth when you need per-user or multi-workspace access instead of a single internal integration. ### Step 1: Create a Public OAuth Integration 1. In [My integrations](https://www.notion.so/my-integrations), create an integration and set the type to **Public** (OAuth-capable) when prompted. 2. Note the **OAuth client ID** and **OAuth client secret** from the integration settings. ### Step 2: Register Redirect URLs 1. In the integration settings, add the **Redirect URI** that Corsair will use (for example, the callback URL your app exposes for Notion OAuth). 2. Save changes. Notion’s OAuth flow does not use traditional scope strings the same way some providers do; access is determined by workspace sharing and integration capabilities. **Storing credentials and completing authorization:** ```bash theme={null} pnpm corsair setup --plugin=notion client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=notion ``` Open the printed authorization URL, approve access, and return — tokens are stored for Corsair to use. ## Webhook Verification Secret When you enable Notion webhooks for a subscription, Notion provides a secret used with the `X-Notion-Signature` header. 1. Configure your webhook subscription in the Notion API / integration settings (per Notion’s current webhook documentation). 2. Copy the **verification / signing secret** for that subscription. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=notion webhook_signature=your-notion-webhook-secret ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | Internal integration secret | [`api_key`](/concepts/api-key) | My integrations → integration → Secrets | | Client ID / secret | [`oauth_2`](/concepts/oauth) | Same integration, OAuth section | | Webhook secret | Webhooks | Webhook subscription configuration | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). For tenant-specific OAuth URLs, see [Multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/notion/overview All-in-one workspace for notes, databases, wikis, tasks, and team documentation. Use **Notion** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 14 typed API operations * 4 synced entities (`blocks`, `databases`, `pages`, `users`) for fast `.search()` / `.list()` * 3 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/notion ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/notion ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/notion ``` ```bash bun theme={null} bun add corsair @corsair-dev/notion ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { notion } from '@corsair-dev/notion'; export const corsair = createCorsair({ plugins: [ notion({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Notion** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/notion/get-credentials). ```ts theme={null} notion({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. Provider walkthrough: [Get Credentials](/plugins/notion/get-credentials). ```ts theme={null} notion() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Notion OAuth app. Provider walkthrough: [Get Credentials](/plugins/notion/get-credentials). ```ts theme={null} notion({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'notion', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Search pages** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.notion.api.pages.searchPage({}); ``` **Create a new page** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.notion.api.pages.createPage({ parent: { type: 'database_id', database_id: 'd9824bdc-8445-4327-be8b-5b47500af6ce' }, }); ``` See the full list on the [API](/plugins/notion/api) page. ## Query synced data Search synced pages without hitting Notion's API. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.notion.db.pages.search({ data: { archived: false }, limit: 50, }); ``` Synced entities: `blocks`, `databases`, `pages`, `users`. See [Database](/plugins/notion/database) for filters and operators. ## Webhooks Fires when a page is created in a Notion database. ```ts theme={null} notion({ webhookHooks: { databasePages: { pageCreated: { after: async (ctx, result) => { const pageId = result.data?.entity?.id; console.log('New Notion page created with ID:', pageId); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/notion/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/notion/api)** > > Every `notion.api.*` operation with input and output types. > **[Database](/plugins/notion/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/notion/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/notion/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/notion/webhooks Notion incoming webhooks: event paths, payloads, and response data. The Notion plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/notion/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `databasePages` * `pageCreated` (`databasePages.pageCreated`) * `pageUpdated` (`databasePages.pageUpdated`) * `verification` (`verification`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Database Pages ### Page Created `databasePages.pageCreated` A page was created in a database **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | | `workspace_id` | `string` | Yes | — | | `subscription_id` | `string` | Yes | — | | `integration_id` | `string` | Yes | — | | `type` | `page.created` | Yes | — | | `authors` | `object[]` | Yes | — | | `accessible_by` | `object[]` | Yes | — | | `entity` | `object` | Yes | — | | `data` | `object` | Yes | — | > **authors full type** > > ```ts theme={null} > { > id: string, > object: string, > type?: string, > name?: string, > avatar_url?: string > }[] > ``` > **accessible\_by full type** > > ```ts theme={null} > { > id: string, > object: string, > type?: string, > name?: string, > avatar_url?: string > }[] > ``` > **entity full type** > > ```ts theme={null} > { > id: string, > object: string > } > ``` > **data full type** > > ```ts theme={null} > { > page_id: string, > database_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > timestamp: string, > workspace_id: string, > subscription_id: string, > integration_id: string, > type: page.created, > authors: { > id: string, > object: string, > type?: string, > name?: string, > avatar_url?: string > }[], > accessible_by: { > id: string, > object: string, > type?: string, > name?: string, > avatar_url?: string > }[], > entity: { > id: string, > object: string > }, > data: { > page_id: string, > database_id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} notion({ webhookHooks: { databasePages: { pageCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Page Updated `databasePages.pageUpdated` A page was updated in a database **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | | `workspace_id` | `string` | Yes | — | | `subscription_id` | `string` | Yes | — | | `integration_id` | `string` | Yes | — | | `type` | `page.updated` | Yes | — | | `authors` | `object[]` | Yes | — | | `accessible_by` | `object[]` | Yes | — | | `entity` | `object` | Yes | — | | `data` | `object` | Yes | — | > **authors full type** > > ```ts theme={null} > { > id: string, > object: string, > type?: string, > name?: string, > avatar_url?: string > }[] > ``` > **accessible\_by full type** > > ```ts theme={null} > { > id: string, > object: string, > type?: string, > name?: string, > avatar_url?: string > }[] > ``` > **entity full type** > > ```ts theme={null} > { > id: string, > object: string > } > ``` > **data full type** > > ```ts theme={null} > { > page_id: string, > database_id: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > timestamp: string, > workspace_id: string, > subscription_id: string, > integration_id: string, > type: page.updated, > authors: { > id: string, > object: string, > type?: string, > name?: string, > avatar_url?: string > }[], > accessible_by: { > id: string, > object: string, > type?: string, > name?: string, > avatar_url?: string > }[], > entity: { > id: string, > object: string > }, > data: { > page_id: string, > database_id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} notion({ webhookHooks: { databasePages: { pageUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Verification ### Verification `verification` Notion URL verification — respond to confirm the webhook endpoint **Payload** | Name | Type | Required | Description | | - | - | - | - | | `verification_token` | `string` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > type: url_verification, > verification_token: string > } > ``` **`webhookHooks` example** ```ts theme={null} notion({ webhookHooks: { verification: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/ocrspace/api API reference for OCR.space: every `ocrspace.api.*` operation with input and output types. Every `ocrspace.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### conversions `account.conversions` Retrieve conversion counts for the current month per OCR engine, updated once a day **Risk:** `read` ```ts theme={null} await corsair.ocrspace.api.account.conversions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `startDate` | `lastMonth` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count_total` | `number` | No | — | | `count_engine1` | `number` | No | — | | `count_engine2` | `number` | No | — | | `count_engine3` | `number` | No | — | *** ## Ocr ### parse `ocr.parse` Extract text from an image or PDF supplied as exactly one of a URL, a file upload (pass a File so the filename is sent, or set filetype), or a base64 data URI **Risk:** `read` ```ts theme={null} await corsair.ocrspace.api.ocr.parse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `file` | `custom` | No | — | | `base64Image` | `string` | No | — | | `language` | `string` | No | — | | `OCREngine` | `1 \| 2 \| 3` | No | — | | `isOverlayRequired` | `boolean` | No | — | | `detectOrientation` | `boolean` | No | — | | `scale` | `boolean` | No | — | | `isTable` | `boolean` | No | — | | `isCreateSearchablePdf` | `boolean` | No | — | | `isSearchablePdfHideTextLayer` | `boolean` | No | — | | `filetype` | `PDF \| GIF \| PNG \| JPG \| TIF \| BMP` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ParsedResults` | `object[]` | No | — | | `OCRExitCode` | `number` | No | — | | `IsErroredOnProcessing` | `boolean` | No | — | | `ErrorMessage` | `string \| string[]` | No | — | | `ErrorDetails` | `string` | No | — | | `SearchablePDFURL` | `string` | No | — | | `ProcessingTimeInMilliseconds` | `string \| number` | No | — | > **ParsedResults full type** > > ```ts theme={null} > { > ParsedText?: string | null, > TextOrientation?: string | null, > FileParseExitCode?: number | null, > TextOverlay?: { > Lines?: { > LineText?: string | null, > Words?: { > WordText?: string | null, > Left?: number | null, > Top?: number | null, > Height?: number | null, > Width?: number | null > }[] | null, > MaxHeight?: number | null, > MinTop?: number | null > }[] | null, > HasOverlay?: boolean | null, > Message?: string | null > } | null, > ErrorMessage?: string | string[] | null, > ErrorDetails?: string | null > }[] > ``` *** ### parseImageUrl `ocr.parseImageUrl` Extract text from an image at a public URL using the simplified GET endpoint **Risk:** `read` ```ts theme={null} await corsair.ocrspace.api.ocr.parseImageUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `language` | `string` | No | — | | `OCREngine` | `1 \| 2 \| 3` | No | — | | `isOverlayRequired` | `boolean` | No | — | | `detectOrientation` | `boolean` | No | — | | `scale` | `boolean` | No | — | | `isTable` | `boolean` | No | — | | `isCreateSearchablePdf` | `boolean` | No | — | | `isSearchablePdfHideTextLayer` | `boolean` | No | — | | `filetype` | `PDF \| GIF \| PNG \| JPG \| TIF \| BMP` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ParsedResults` | `object[]` | No | — | | `OCRExitCode` | `number` | No | — | | `IsErroredOnProcessing` | `boolean` | No | — | | `ErrorMessage` | `string \| string[]` | No | — | | `ErrorDetails` | `string` | No | — | | `SearchablePDFURL` | `string` | No | — | | `ProcessingTimeInMilliseconds` | `string \| number` | No | — | > **ParsedResults full type** > > ```ts theme={null} > { > ParsedText?: string | null, > TextOrientation?: string | null, > FileParseExitCode?: number | null, > TextOverlay?: { > Lines?: { > LineText?: string | null, > Words?: { > WordText?: string | null, > Left?: number | null, > Top?: number | null, > Height?: number | null, > Width?: number | null > }[] | null, > MaxHeight?: number | null, > MinTop?: number | null > }[] | null, > HasOverlay?: boolean | null, > Message?: string | null > } | null, > ErrorMessage?: string | string[] | null, > ErrorDetails?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/ocrspace/database OCR.space local sync: searchable entities, `.search()` filters, and operators. The OCR.space plugin syncs data locally. Use `corsair.ocrspace.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Conversions Path: `ocrspace.db.conversions.search` ```ts theme={null} const rows = await corsair.ocrspace.db.conversions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `engine1` | `number` | equals, gt, gte, lt, lte, in | | `engine2` | `number` | equals, gt, gte, lt, lte, in | | `engine3` | `number` | equals, gt, gte, lt, lte, in | | `total` | `number` | equals, gt, gte, lt, lte, in | | `period` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Ocr Results Path: `ocrspace.db.ocrResults.search` ```ts theme={null} const rows = await corsair.ocrspace.db.ocrResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `engine` | `number` | equals, gt, gte, lt, lte, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `pageCount` | `number` | equals, gt, gte, lt, lte, in | | `exitCode` | `number` | equals, gt, gte, lt, lte, in | | `isSearchablePdf` | `boolean` | equals | | `processingTimeMs` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/ocrspace/overview Optical character recognition API for extracting text from images and scanned documents. Use **OCR.space** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 3 typed API operations * 2 synced entities (`conversions`, `ocrResults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ocrspace ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ocrspace ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ocrspace ``` ```bash bun theme={null} bun add corsair @corsair-dev/ocrspace ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ocrspace } from '@corsair-dev/ocrspace'; export const corsair = createCorsair({ plugins: [ ocrspace(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ocrspace() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ocrspace', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.conversions`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ocrspace.api.account.conversions({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/ocrspace/api) reference.* See the full list on the [API](/plugins/ocrspace/api) page. ## Query synced data Synced entities support `tenant.ocrspace.db..search()` and `.list()`: `conversions`, `ocrResults`. See [Database](/plugins/ocrspace/database) for filters and operators. ## What's next > **[API reference](/plugins/ocrspace/api)** > > Every `ocrspace.api.*` operation with input and output types. > **[Database](/plugins/ocrspace/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/ocrwebservice/api API reference for OCR Web Service: every `ocrwebservice.api.*` operation with input and output types. Every `ocrwebservice.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getCredentials `account.getCredentials` Extract the OCR Web Service username from stored credentials **Risk:** `read` ```ts theme={null} await corsair.ocrwebservice.api.account.getCredentials({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `user_name` | `string` | Yes | — | *** ### getInformation `account.getInformation` Retrieve remaining pages, subscription plan, and expiration date **Risk:** `read` ```ts theme={null} await corsair.ocrwebservice.api.account.getInformation({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `ErrorMessage` | `string` | No | — | | `AvailablePages` | `number` | No | — | | `MaxPages` | `number` | No | — | | `LastProcessingTime` | `string` | No | — | | `SubcriptionPlan` | `string` | No | — | | `ExpirationDate` | `string` | No | — | *** ### log `account.log` Retrieve OCR processing logs for a date range **Risk:** `read` ```ts theme={null} await corsair.ocrwebservice.api.account.log({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_date` | `string` | Yes | — | | `to_date` | `string` | Yes | — | | `reserved` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `string` | Yes | — | *** ## Ocr ### recognize `ocr.recognize` OCR an image or document via REST processDocument **Risk:** `write` ```ts theme={null} await corsair.ocrwebservice.api.ocr.recognize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom` | Yes | — | | `language` | `string` | Yes | — | | `pagerange` | `string` | No | — | | `tobw` | `boolean` | No | — | | `zone` | `string` | No | — | | `outputformat` | `string` | No | — | | `gettext` | `boolean` | No | — | | `getwords` | `boolean` | No | — | | `newline` | `boolean` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ErrorMessage` | `string` | No | — | | `AvailablePages` | `number` | No | — | | `ProcessedPages` | `number` | No | — | | `OCRText` | `string[][]` | No | — | | `OutputFileUrl` | `string` | No | — | | `TaskDescription` | `string` | No | — | | `Reserved` | `any[]` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/ocrwebservice/database OCR Web Service local sync: searchable entities, `.search()` filters, and operators. The OCR Web Service plugin syncs data locally. Use `corsair.ocrwebservice.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `ocrwebservice.db.accounts.search` ```ts theme={null} const rows = await corsair.ocrwebservice.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `availablePages` | `number` | equals, gt, gte, lt, lte, in | | `maxPages` | `number` | equals, gt, gte, lt, lte, in | | `subscriptionPlan` | `string` | equals, contains, startsWith, endsWith, in | | `expirationDate` | `string` | equals, contains, startsWith, endsWith, in | | `lastProcessingTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Documents Path: `ocrwebservice.db.documents.search` ```ts theme={null} const rows = await corsair.ocrwebservice.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `outputFileUrl` | `string` | equals, contains, startsWith, endsWith, in | | `processedPages` | `number` | equals, gt, gte, lt, lte, in | | `availablePages` | `number` | equals, gt, gte, lt, lte, in | | `taskDescription` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/ocrwebservice/overview Cloud OCR service for converting PDFs and images into searchable text content. Use **OCR Web Service** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 2 synced entities (`accounts`, `documents`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ocrwebservice ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ocrwebservice ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ocrwebservice ``` ```bash bun theme={null} bun add corsair @corsair-dev/ocrwebservice ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ocrwebservice } from '@corsair-dev/ocrwebservice'; export const corsair = createCorsair({ plugins: [ ocrwebservice(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ocrwebservice() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ocrwebservice', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getCredentials`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ocrwebservice.api.account.getCredentials({}); ``` **`ocr.recognize`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ocrwebservice.api.ocr.recognize({}); ``` See the full list on the [API](/plugins/ocrwebservice/api) page. ## Query synced data Synced entities support `tenant.ocrwebservice.db..search()` and `.list()`: `accounts`, `documents`. See [Database](/plugins/ocrwebservice/database) for filters and operators. ## What's next > **[API reference](/plugins/ocrwebservice/api)** > > Every `ocrwebservice.api.*` operation with input and output types. > **[Database](/plugins/ocrwebservice/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/octen/api API reference for Octen: every `octen.api.*` operation with input and output types. Every `octen.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Answer ### create `answer.create` Decompose messages into sub-queries, search, and synthesize an answer **Risk:** `read` ```ts theme={null} await corsair.octen.api.answer.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `openai/gpt-6.1-sol \| openai/gpt-6-astra \| openai/gpt-5.6-sol \| openai/gpt-5.6-terra \| openai/gpt-5.6-luna \| openai/gpt-5.4 \| anthropic/claude-fable-5.1 \| anthropic/claude-fable-5 \| anthropic/claude-opus-5.5 \| anthropic/claude-opus-5 \| anthropic/claude-opus-4.8 \| anthropic/claude-opus-4.6 \| anthropic/claude-sonnet-5.5 \| anthropic/claude-sonnet-5 \| anthropic/claude-sonnet-4.6 \| anthropic/claude-haiku-5.5 \| anthropic/claude-haiku-4.5 \| google/gemini-4-argon \| google/gemini-3.8-flash \| google/gemini-3.5-flash \| google/gemini-3.5-flash-lite \| google/gemini-3.1-pro-preview \| google/gemini-3.1-flash-lite \| google/gemini-3-flash-preview \| moonshotai/kimi-k3 \| moonshotai/kimi-k2.6 \| moonshotai/kimi-k2.5 \| minimax/minimax-m2.5 \| qwen/qwen3.6-plus \| deepseek/deepseek-v4-pro \| deepseek/deepseek-v4-flash-0731` | No | — | | `messages` | `object[]` | Yes | — | | `mode` | `queries_only \| queries_and_search \| full` | No | — | | `max_queries` | `number` | No | — | | `web_search_options` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > role: system | developer | user | assistant | tool > }[] > ``` > **web\_search\_options full type** > > ```ts theme={null} > { > count?: number, > include_domains?: string[], > exclude_domains?: string[], > include_text?: string[], > exclude_text?: string[], > time_basis?: auto | published | crawled, > time_range?: day | week | month | year | d | w | m | y, > start_time?: string, > end_time?: string, > language?: ar | de | en | es | fr | hi | id | it | ja | ko | nl | pl | pt | ru | th | tr | vi | zh[], > highlight?: { > enable?: boolean, > max_tokens?: number > }, > full_content?: { > enable?: boolean, > max_tokens?: number > }, > format?: markdown | text, > safesearch?: off | strict, > include_images?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `object` | `chat.completion` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | | `choices` | `object[]` | Yes | — | | `queries` | `string[]` | No | — | | `search_results` | `object[]` | No | — | | `meta` | `object` | No | — | | `warning` | `string` | No | — | > **choices full type** > > ```ts theme={null} > { > index?: number, > finish_reason?: stop | length | tool_calls | content_filter | error, > message?: { > role?: assistant, > content?: string | null > } > }[] > ``` > **search\_results full type** > > ```ts theme={null} > { > query?: string, > results?: { > title?: string, > url?: string, > highlight?: string, > full_content?: string, > authors?: string, > time_published?: string, > time_last_crawled?: string, > favicon?: string, > cover_image?: { > url?: string, > description?: string > }, > images?: { > url?: string, > description?: string > }[] > }[], > latency?: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > usage?: { > num_search_queries: number, > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > }, > latency?: number > } > ``` *** ## Broad Search ### post `broadSearch.post` Expand one query into sub-queries and search each of them **Risk:** `read` ```ts theme={null} await corsair.octen.api.broadSearch.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `max_queries` | `number` | No | — | | `search_options` | `object` | No | — | > **search\_options full type** > > ```ts theme={null} > { > count?: number, > include_domains?: string[], > exclude_domains?: string[], > include_text?: string[], > exclude_text?: string[], > time_basis?: auto | published | crawled, > time_range?: day | week | month | year | d | w | m | y, > start_time?: string, > end_time?: string, > language?: ar | de | en | es | fr | hi | id | it | ja | ko | nl | pl | pt | ru | th | tr | vi | zh[], > highlight?: { > enable?: boolean, > max_tokens?: number > }, > full_content?: { > enable?: boolean, > max_tokens?: number > }, > format?: markdown | text, > safesearch?: off | strict, > include_images?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `queries` | `string[]` | No | — | | `search_results` | `object[]` | No | — | > **search\_results full type** > > ```ts theme={null} > { > query?: string, > results?: { > title?: string, > url?: string, > highlight?: string, > full_content?: string, > authors?: string, > time_published?: string, > time_last_crawled?: string, > favicon?: string, > cover_image?: { > url?: string, > description?: string > }, > images?: { > url?: string, > description?: string > }[] > }[], > latency?: number > }[] > ``` *** ## Business Search ### post `businessSearch.post` Search business pages and return company and people cards **Risk:** `read` ```ts theme={null} await corsair.octen.api.businessSearch.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `include_domains` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `time_basis` | `auto \| published \| crawled` | No | — | | `time_range` | `day \| week \| month \| year \| d \| w \| m \| y` | No | — | | `start_time` | `string` | No | — | | `end_time` | `string` | No | — | | `language` | `ar \| de \| en \| es \| fr \| hi \| id \| it \| ja \| ko \| nl \| pl \| pt \| ru \| th \| tr \| vi \| zh[]` | No | — | | `highlight` | `object` | No | — | | `full_content` | `object` | No | — | | `entities` | `object` | No | — | > **highlight full type** > > ```ts theme={null} > { > enable?: boolean, > max_tokens?: number > } > ``` > **full\_content full type** > > ```ts theme={null} > { > enable?: boolean, > max_tokens?: number > } > ``` > **entities full type** > > ```ts theme={null} > { > enable?: boolean, > count?: number, > max_activities?: number, > max_news?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `results` | `object[]` | No | — | | `entities` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > title?: string, > url?: string, > highlight?: string, > full_content?: string, > authors?: string, > time_published?: string, > time_last_crawled?: string, > favicon?: string, > cover_image?: { > url?: string, > description?: string > }, > images?: { > url?: string, > description?: string > }[] > }[] > ``` > **entities full type** > > ```ts theme={null} > { > type?: company | person, > name?: string > }[] > ``` *** ## Embedding ### create `embedding.create` Create text embeddings with an Octen embedding model **Risk:** `read` ```ts theme={null} await corsair.octen.api.embedding.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string[]` | Yes | — | | `model` | `octen-embedding-0.6b \| octen-embedding-4b \| octen-embedding-8b` | No | — | | `dimension` | `number` | No | — | | `input_type` | `query \| document` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `model` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > index?: number, > embedding?: number[] > }[] > ``` *** ## Extract ### post `extract.post` Extract page content from up to 20 URLs **Risk:** `read` ```ts theme={null} await corsair.octen.api.extract.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `urls` | `string[]` | Yes | — | | `mode` | `standard \| advanced \| auto` | No | — | | `query` | `string` | No | — | | `max_age_seconds` | `number` | No | — | | `format` | `markdown \| text` | No | — | | `timeout` | `number` | No | — | | `include_images` | `boolean` | No | — | | `include_videos` | `boolean` | No | — | | `include_audio` | `boolean` | No | — | | `include_links` | `object` | No | — | > **include\_links full type** > > ```ts theme={null} > { > scope?: prefer_internal | prefer_external, > max_links?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > url?: string, > status?: success | failed, > resolved_mode?: standard | advanced, > title?: string | null, > full_content?: string | null, > highlights?: string[] | null, > time_published?: string | null, > time_last_crawled?: string, > page_structure?: { > primary?: Index Page | Content Page | No Main Content, > secondary?: string | null > } | null, > category?: { > primary?: string, > secondary?: string | null > } | null, > favicon?: string | null, > cover_image?: { > url?: string > } | null, > images?: { > url?: string > }[], > videos?: { > url?: string > }[], > audio?: { > url?: string > }[], > links?: { > url?: string, > anchor_text?: string, > is_external?: boolean > }[], > error_message?: string > }[] > ``` *** ## Grounded Generation ### create `groundedGeneration.create` Queue a search-grounded image or video generation task **Risk:** `write` ```ts theme={null} await corsair.octen.api.groundedGeneration.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `modality` | `image \| video` | Yes | — | | `prompt` | `string` | Yes | — | | `model` | `google/gemini-3-pro-image \| google/gemini-3.1-flash-image \| minimax/hailuo-3` | No | — | | `aspect_ratio` | `16:9 \| 1:1 \| 9:16` | No | — | | `duration` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | No | — | | `generation_id` | `string` | Yes | — | | `modality` | `image \| video` | Yes | — | | `status` | `queued` | Yes | — | | `created_at` | `number` | Yes | — | *** ### get `groundedGeneration.get` Get a grounded generation task and its output URL **Risk:** `read` ```ts theme={null} await corsair.octen.api.groundedGeneration.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `generation_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | No | — | | `generation_id` | `string` | Yes | — | | `modality` | `image \| video` | Yes | — | | `status` | `queued \| running \| succeeded \| failed` | Yes | — | | `output_url` | `string` | No | — | | `references` | `object[]` | No | — | | `search_results` | `object[]` | No | — | | `error` | `object` | No | — | | `created_at` | `number` | Yes | — | | `updated_at` | `number` | Yes | — | | `usage` | `object` | No | — | > **references full type** > > ```ts theme={null} > { > source_id?: string, > url?: string, > title?: string, > cover_url?: string > }[] > ``` > **search\_results full type** > > ```ts theme={null} > { > query?: string, > results?: { > type?: image | video, > title?: string, > url?: string, > source_page?: string, > description?: string, > cover_url?: string > }[] > }[] > ``` > **error full type** > > ```ts theme={null} > { > code?: MM_GENERATION_CONTENT_POLICY | MM_GENERATION_INPUT_IMAGE_PRIVACY_BLOCKED | MM_GENERATION_CONTENT_NOT_SUPPORTED | MM_GENERATION_NO_REFERENCE_MATERIAL | MM_GENERATION_REJECTED | MM_GENERATION_TIMEOUT | MM_GENERATION_FAILED, > message?: string > } > ``` > **usage full type** > > ```ts theme={null} > { > image_count?: number, > video_count?: number, > video_seconds?: number > } > ``` *** ## Image Search ### post `imageSearch.post` Search images by text query or by a reference image **Risk:** `read` ```ts theme={null} await corsair.octen.api.imageSearch.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inputs` | `object[]` | Yes | — | | `count` | `number` | No | — | | `include_domains` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `safesearch` | `off \| strict` | No | — | > **inputs full type** > > ```ts theme={null} > { > type: text | image, > url?: string, > data?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > title?: string, > url?: string, > source_page?: string, > description?: string, > width?: number, > height?: number, > thumbnail?: string > }[] > ``` *** ## News Search ### post `newsSearch.post` Search news articles, optionally grouped into events **Risk:** `read` ```ts theme={null} await corsair.octen.api.newsSearch.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `include_domains` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `time_basis` | `auto \| published \| crawled` | No | — | | `time_range` | `day \| week \| month \| year \| d \| w \| m \| y` | No | — | | `start_time` | `string` | No | — | | `end_time` | `string` | No | — | | `language` | `ar \| de \| en \| es \| fr \| hi \| id \| it \| ja \| ko \| nl \| pl \| pt \| ru \| th \| tr \| vi \| zh[]` | No | — | | `highlight` | `object` | No | — | | `full_content` | `object` | No | — | | `subjects` | `object` | No | — | > **highlight full type** > > ```ts theme={null} > { > enable?: boolean, > max_tokens?: number > } > ``` > **full\_content full type** > > ```ts theme={null} > { > enable?: boolean, > max_tokens?: number > } > ``` > **subjects full type** > > ```ts theme={null} > { > enable?: boolean, > count?: number, > max_sub_news?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `results` | `object[]` | No | — | | `subjects` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > title?: string, > url?: string, > summary?: string, > highlight?: string, > full_content?: string, > authors?: string, > time_published?: string, > time_last_crawled?: string, > favicon?: string, > cover_image?: { > url?: string, > description?: string > }, > images?: { > url?: string, > description?: string > }[] > }[] > ``` > **subjects full type** > > ```ts theme={null} > { > name?: string, > summary?: string, > time_start?: string, > time_latest?: string, > top_news?: { > title?: string, > url?: string, > summary?: string, > highlight?: string, > full_content?: string, > authors?: string, > time_published?: string, > time_last_crawled?: string, > favicon?: string, > cover_image?: { > url?: string, > description?: string > }, > images?: { > url?: string, > description?: string > }[] > }, > sub_news?: { > title?: string, > url?: string, > summary?: string, > highlight?: string, > full_content?: string, > authors?: string, > time_published?: string, > time_last_crawled?: string, > favicon?: string, > cover_image?: { > url?: string, > description?: string > }, > images?: { > url?: string, > description?: string > }[] > }[] > }[] > ``` *** ## Search ### post `search.post` Search the web with ranked, highlightable results **Risk:** `read` ```ts theme={null} await corsair.octen.api.search.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `include_domains` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `include_text` | `string[]` | No | — | | `exclude_text` | `string[]` | No | — | | `time_basis` | `auto \| published \| crawled` | No | — | | `time_range` | `day \| week \| month \| year \| d \| w \| m \| y` | No | — | | `start_time` | `string` | No | — | | `end_time` | `string` | No | — | | `language` | `ar \| de \| en \| es \| fr \| hi \| id \| it \| ja \| ko \| nl \| pl \| pt \| ru \| th \| tr \| vi \| zh[]` | No | — | | `highlight` | `object` | No | — | | `full_content` | `object` | No | — | | `format` | `markdown \| text` | No | — | | `safesearch` | `off \| strict` | No | — | | `include_images` | `boolean` | No | — | | `query` | `string` | Yes | — | > **highlight full type** > > ```ts theme={null} > { > enable?: boolean, > max_tokens?: number > } > ``` > **full\_content full type** > > ```ts theme={null} > { > enable?: boolean, > max_tokens?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > title?: string, > url?: string, > highlight?: string, > full_content?: string, > authors?: string, > time_published?: string, > time_last_crawled?: string, > favicon?: string, > cover_image?: { > url?: string, > description?: string > }, > images?: { > url?: string, > description?: string > }[] > }[] > ``` *** ## Video Generation ### create `videoGeneration.create` Queue a text-to-video generation task **Risk:** `write` ```ts theme={null} await corsair.octen.api.videoGeneration.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `minimax/minimax-h3 \| bytedance/seedance-2.5 \| google/veo-3.1 \| google/veo-3.1-fast \| google/veo-3.1-lite` | Yes | — | | `prompt` | `string` | Yes | — | | `duration` | `number` | No | — | | `resolution` | `480p \| 720p \| 768p \| 1080p \| 2K` | No | — | | `aspect_ratio` | `16:9 \| 4:3 \| 1:1 \| 3:4 \| 9:16 \| 21:9 \| adaptive` | No | — | | `frame_images` | `object[]` | No | — | | `input_references` | `object[]` | No | — | | `generate_audio` | `boolean` | No | — | | `seed` | `number` | No | — | | `extra_params` | `object` | No | — | > **frame\_images full type** > > ```ts theme={null} > { > image: string, > frame_type: first_frame | last_frame > }[] > ``` > **input\_references full type** > > ```ts theme={null} > { > image: string > }[] > ``` > **extra\_params full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `model` | `string` | Yes | — | | `status` | `queued` | Yes | — | | `created` | `number` | Yes | — | *** ### get `videoGeneration.get` Get a video generation task and its download URL **Risk:** `read` ```ts theme={null} await corsair.octen.api.videoGeneration.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `model` | `string` | Yes | — | | `status` | `queued \| in_progress \| completed \| failed` | Yes | — | | `created` | `number` | Yes | — | | `video_url` | `string` | No | — | | `expires_at` | `number` | No | — | | `duration` | `number` | No | — | | `resolution` | `string` | No | — | | `usage` | `object` | No | — | | `error` | `string` | No | — | | `code` | `string` | No | — | > **usage full type** > > ```ts theme={null} > { > video_seconds?: number, > video_tokens?: number, > input_image_count?: number > } > ``` *** ## Video Search ### post `videoSearch.post` Search videos by a text query **Risk:** `read` ```ts theme={null} await corsair.octen.api.videoSearch.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inputs` | `object[]` | Yes | — | | `count` | `number` | No | — | | `time_range` | `day \| week \| month \| year \| d \| w \| m \| y` | No | — | | `start_time` | `string` | No | — | | `end_time` | `string` | No | — | | `safesearch` | `off \| strict` | No | — | > **inputs full type** > > ```ts theme={null} > { > type: text, > data?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > title?: string, > url?: string, > source_page?: string, > description?: string, > cover_url?: string, > duration_seconds?: number, > authors?: string, > time_published?: string, > time_last_crawled?: string > }[] > ``` *** ## Vl Embedding ### create `vlEmbedding.create` Create multimodal embeddings from text, images and video **Risk:** `read` ```ts theme={null} await corsair.octen.api.vlEmbedding.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `octen-vl-embedding \| octen-vl-embedding-large` | Yes | — | | `input` | `object` | Yes | — | | `enable_fusion` | `boolean` | No | — | | `dimension` | `number` | No | — | | `fps` | `number` | No | — | | `instruct` | `string` | No | — | > **input full type** > > ```ts theme={null} > { > contents: { > text?: string, > image?: string, > video?: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `model` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > index?: number, > embedding?: number[], > type?: vl | fusion > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/octen/database Octen local sync: searchable entities, `.search()` filters, and operators. The Octen plugin syncs data locally. Use `corsair.octen.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/octen/overview Web search, scraping and structured data extraction API. Use **Octen** through Corsair: one client, typed API calls. **What you get:** * 14 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/octen ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/octen ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/octen ``` ```bash bun theme={null} bun add corsair @corsair-dev/octen ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { octen } from '@corsair-dev/octen'; export const corsair = createCorsair({ plugins: [ octen(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} octen() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'octen', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`answer.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.octen.api.answer.create({}); ``` **`groundedGeneration.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.octen.api.groundedGeneration.create({}); ``` See the full list on the [API](/plugins/octen/api) page. ## What's next > **[API reference](/plugins/octen/api)** > > Every `octen.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/ollama/api API reference for Ollama: every `ollama.api.*` operation with input and output types. Every `ollama.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chat ### chat `chat.chat` Tool to send a chat message with conversation history to Ollama. Use when you need to have a multi-turn conversation with an LLM model. **Risk:** `write` ```ts theme={null} await corsair.ollama.api.chat.chat({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | Name of the model to use for chat | | `messages` | `object[]` | Yes | Conversation history | | `tools` | `any[]` | No | List of tools/functions available to the model | | `format` | `object` | No | Output format, e.g. "json" or a JSON schema | | `options` | `object` | No | Model configuration options (temperature, top\_p, etc.) | | `stream` | `boolean` | No | Whether to stream responses (default false) | | `keep_alive` | `string \| number` | No | Duration to keep the model loaded in memory | > **messages full type** > > ```ts theme={null} > { > role: string, > content: string, > images?: string[], > tool_calls?: any[] > }[] > ``` > **format full type** > > ```ts theme={null} > string | { > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `message` | `object` | Yes | — | | `done` | `boolean` | Yes | — | | `total_duration` | `number` | No | — | | `load_duration` | `number` | No | — | | `prompt_eval_count` | `number` | No | — | | `prompt_eval_duration` | `number` | No | — | | `eval_count` | `number` | No | — | | `eval_duration` | `number` | No | — | > **message full type** > > ```ts theme={null} > { > role: string, > content: string, > images?: string[], > tool_calls?: any[] > } > ``` *** ### generate `chat.generate` Tool to generate text responses from Ollama models with optional raw mode. Use raw=true to bypass prompt templating when you need full control over the prompt for debugging or custom processing. Note that raw mode will not return a context. **Risk:** `write` ```ts theme={null} await corsair.ollama.api.chat.generate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | Name of the model to generate text with | | `prompt` | `string` | No | The prompt to generate a response for | | `suffix` | `string` | No | Text after the insertion point | | `images` | `string[]` | No | Base64-encoded images for multimodal models | | `format` | `object` | No | Format of the response | | `options` | `object` | No | Model configuration options | | `system` | `string` | No | System message to override model default | | `template` | `string` | No | Prompt template to override model default | | `stream` | `boolean` | No | Whether to stream response | | `raw` | `boolean` | No | Bypass prompt template when true | | `keep_alive` | `string \| number` | No | Duration to keep the model loaded | > **format full type** > > ```ts theme={null} > string | { > } > ``` > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `response` | `string` | Yes | — | | `done` | `boolean` | Yes | — | | `context` | `number[]` | No | — | | `total_duration` | `number` | No | — | | `load_duration` | `number` | No | — | | `prompt_eval_count` | `number` | No | — | | `prompt_eval_duration` | `number` | No | — | | `eval_count` | `number` | No | — | | `eval_duration` | `number` | No | — | *** ## Models ### listModels `models.listModels` Tool to list all available Ollama models and their details. Use when you need to fetch installed models with metadata including name, size, last modified timestamp, digest, and format information. **Risk:** `read` ```ts theme={null} await corsair.ollama.api.models.listModels({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `models` | `object[]` | Yes | — | > **models full type** > > ```ts theme={null} > { > name: string, > model?: string, > modified_at?: string, > size?: number, > digest?: string, > details?: { > parent_model?: string, > format?: string, > family?: string, > families?: string[], > parameter_size?: string, > quantization_level?: string > } > }[] > ``` *** ### showModel `models.showModel` Tool to show comprehensive information about an Ollama model. Use when you need to retrieve model details, parameters, template, license, or system prompt. **Risk:** `read` ```ts theme={null} await corsair.ollama.api.models.showModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | Name of the model to show information for | | `system` | `string` | No | System prompt override | | `template` | `string` | No | Template override | | `options` | `object` | No | Options override | > **options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `modelfile` | `string` | No | — | | `parameters` | `string` | No | — | | `template` | `string` | No | — | | `details` | `object` | No | — | | `model_info` | `object` | No | — | | `modified_at` | `string` | No | — | | `license` | `string` | No | — | > **details full type** > > ```ts theme={null} > { > parent_model?: string, > format?: string, > family?: string, > families?: string[], > parameter_size?: string, > quantization_level?: string > } > ``` > **model\_info full type** > > ```ts theme={null} > { > } > ``` *** ### version `models.version` Tool to get the version of Ollama running locally. Use to check which version of Ollama is currently installed. **Risk:** `read` ```ts theme={null} await corsair.ollama.api.models.version({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | Yes | — | *** ## Openai ### createOpenAiChatCompletion `openai.createOpenAiChatCompletion` Tool to create OpenAI-compatible chat completions using Ollama models. Use when you need conversational AI responses with OpenAI API format compatibility. **Risk:** `write` ```ts theme={null} await corsair.ollama.api.openai.createOpenAiChatCompletion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | ID of the model to use | | `messages` | `object[]` | Yes | Messages in the conversation | | `temperature` | `number` | No | Sampling temperature | | `top_p` | `number` | No | Nucleus sampling probability | | `n` | `number` | No | Number of completions to generate | | `stream` | `boolean` | No | Whether to stream responses | | `stop` | `string \| string[]` | No | Stop sequences | | `max_tokens` | `number` | No | Maximum tokens to generate | | `presence_penalty` | `number` | No | Presence penalty | | `frequency_penalty` | `number` | No | Frequency penalty | | `user` | `string` | No | Unique identifier representing end-user | > **messages full type** > > ```ts theme={null} > { > role: string, > content: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | | `choices` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > index: number, > message: { > role: string, > content: string > }, > finish_reason?: string | null > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ### createOpenAiCompletion `openai.createOpenAiCompletion` Tool to create OpenAI-compatible text completions using Ollama models. Use when you need text generation with OpenAI API format compatibility beyond chat-based interactions. **Risk:** `write` ```ts theme={null} await corsair.ollama.api.openai.createOpenAiCompletion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | ID of the model to use | | `prompt` | `string \| string[]` | Yes | Prompt text to complete | | `suffix` | `string` | No | Suffix to insert | | `max_tokens` | `number` | No | Maximum tokens to generate | | `temperature` | `number` | No | Sampling temperature | | `top_p` | `number` | No | Nucleus sampling probability | | `n` | `number` | No | Number of completions to generate | | `stream` | `boolean` | No | Whether to stream responses | | `logprobs` | `number` | No | Include log probabilities | | `echo` | `boolean` | No | Echo prompt in completion | | `stop` | `string \| string[]` | No | Stop sequences | | `presence_penalty` | `number` | No | Presence penalty | | `frequency_penalty` | `number` | No | Frequency penalty | | `best_of` | `number` | No | Generates best\_of completions server-side | | `user` | `string` | No | Unique identifier representing end-user | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | | `choices` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > index: number, > text: string, > logprobs?: any | null, > finish_reason?: string | null > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ### listOpenAiModels `openai.listOpenAiModels` Tool to list available models using OpenAI-compatible API format. Use when you need to retrieve locally available Ollama models with metadata following OpenAI's model list format. **Risk:** `read` ```ts theme={null} await corsair.ollama.api.openai.listOpenAiModels({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: string, > created?: number, > owned_by?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/ollama/database Ollama local sync: searchable entities, `.search()` filters, and operators. The Ollama plugin syncs data locally. Use `corsair.ollama.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/ollama/overview Local LLM runtime API for running open-source language models on your own infrastructure. Use **Ollama** through Corsair: one client, typed API calls. **What you get:** * 8 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ollama ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ollama ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ollama ``` ```bash bun theme={null} bun add corsair @corsair-dev/ollama ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ollama } from '@corsair-dev/ollama'; export const corsair = createCorsair({ plugins: [ ollama(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ollama() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Ollama OAuth app. ```ts theme={null} ollama({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ollama', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`models.listModels`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ollama.api.models.listModels({}); ``` **`chat.chat`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ollama.api.chat.chat({}); ``` See the full list on the [API](/plugins/ollama/api) page. ## What's next > **[API reference](/plugins/ollama/api)** > > Every `ollama.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/onedrive/api API reference for OneDrive: every `onedrive.api.*` operation with input and output types. Every `onedrive.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Drive ### get `drive.get` Get a drive by ID **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `drive_id` | `string` | Yes | — | | `select_fields` | `string[]` | No | — | | `expand_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `driveType` | `string` | No | — | | `webUrl` | `string` | No | — | | `description` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `owner` | `object` | No | — | | `quota` | `object` | No | — | > **owner full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **quota full type** > > ```ts theme={null} > { > deleted?: number, > remaining?: number, > total?: number, > used?: number, > state?: string > } > ``` *** ### getGroup `drive.getGroup` Get a group's drive **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.getGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | | `select_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `driveType` | `string` | No | — | | `webUrl` | `string` | No | — | | `description` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `owner` | `object` | No | — | | `quota` | `object` | No | — | > **owner full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **quota full type** > > ```ts theme={null} > { > deleted?: number, > remaining?: number, > total?: number, > used?: number, > state?: string > } > ``` *** ### getQuota `drive.getQuota` Get the user's drive and quota information **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.getQuota({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `driveType` | `string` | No | — | | `webUrl` | `string` | No | — | | `description` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `owner` | `object` | No | — | | `quota` | `object` | No | — | > **owner full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **quota full type** > > ```ts theme={null} > { > deleted?: number, > remaining?: number, > total?: number, > used?: number, > state?: string > } > ``` *** ### getRecentItems `drive.getRecentItems` Get recently accessed drive items **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.getRecentItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `select` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### getRoot `drive.getRoot` Get the root folder of the user's drive **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.getRoot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `select_fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `size` | `number` | No | — | | `webUrl` | `string` | No | — | | `eTag` | `string` | No | — | | `cTag` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `createdBy` | `object` | No | — | | `lastModifiedBy` | `object` | No | — | | `parentReference` | `object` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | | `deleted` | `object` | No | — | | `@microsoft.graph.downloadUrl` | `string` | No | — | | `root` | `object` | No | — | | `description` | `string` | No | — | > **createdBy full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **lastModifiedBy full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **parentReference full type** > > ```ts theme={null} > { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > } > ``` > **file full type** > > ```ts theme={null} > { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > } > ``` > **folder full type** > > ```ts theme={null} > { > childCount?: number > } > ``` > **deleted full type** > > ```ts theme={null} > { > state?: string > } > ``` > **root full type** > > ```ts theme={null} > { > } > ``` *** ### getSharedItems `drive.getSharedItems` Get items shared with the user **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.getSharedItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `allow_external` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### getSpecialFolder `drive.getSpecialFolder` Get a special folder (documents, photos, cameraroll) **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.getSpecialFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `special_folder_name` | `documents \| photos \| cameraroll` | Yes | — | | `select_fields` | `string[]` | No | — | | `expand_relations` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `size` | `number` | No | — | | `webUrl` | `string` | No | — | | `eTag` | `string` | No | — | | `cTag` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `createdBy` | `object` | No | — | | `lastModifiedBy` | `object` | No | — | | `parentReference` | `object` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | | `deleted` | `object` | No | — | | `@microsoft.graph.downloadUrl` | `string` | No | — | | `children` | `object[]` | No | — | > **createdBy full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **lastModifiedBy full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **parentReference full type** > > ```ts theme={null} > { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > } > ``` > **file full type** > > ```ts theme={null} > { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > } > ``` > **folder full type** > > ```ts theme={null} > { > childCount?: number > } > ``` > **deleted full type** > > ```ts theme={null} > { > state?: string > } > ``` > **children full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > ``` *** ### list `drive.list` List available drives **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `expand` | `string` | No | — | | `select` | `string` | No | — | | `orderby` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `group_id` | `string` | No | — | | `skip_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > driveType?: string, > webUrl?: string, > description?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > owner?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > quota?: { > deleted?: number, > remaining?: number, > total?: number, > used?: number, > state?: string > } > }[] > ``` *** ### listActivities `drive.listActivities` List activities across the drive **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.listActivities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > action?: { > comment?: { > }, > create?: { > }, > delete?: { > }, > edit?: { > }, > mention?: { > }, > move?: { > }, > rename?: { > }, > restore?: { > }, > share?: { > }, > version?: { > } > }, > actor?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > times?: { > recordedTime?: string > } > }[] > ``` *** ### listBundles `drive.listBundles` List bundles in a drive **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.listBundles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `drive_id` | `string` | Yes | — | | `top` | `number` | No | — | | `expand` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string` | No | — | | `orderby` | `string` | No | — | | `skip_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### listChanges `drive.listChanges` List changes to drive items using delta **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.drive.listChanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `token` | `string` | No | — | | `expand` | `string` | No | — | | `select` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | | `@odata.deltaLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ## Files ### createFolder `files.createFolder` Create a new folder **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.files.createFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `user_id` | `string` | No | — | | `description` | `string` | No | — | | `parent_folder` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `webUrl` | `string` | No | — | *** ### createTextFile `files.createTextFile` Create a new text file with content **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.files.createTextFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `content` | `string` | Yes | — | | `folder` | `string` | No | — | | `user_id` | `string` | No | — | | `conflict_behavior` | `fail \| replace \| rename` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `file` | `object` | No | — | | `name` | `string` | Yes | — | | `size` | `number` | No | — | > **file full type** > > ```ts theme={null} > { > mimeType?: string > } > ``` *** ### findFile `files.findFile` Find a file by name **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.files.findFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `folder` | `string` | No | — | | `user_id` | `string` | No | — | | `include_metadata` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `odata_context` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### findFolder `files.findFolder` Find a folder by name **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.files.findFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `top` | `number` | No | — | | `expand` | `string` | No | — | | `folder` | `string` | No | — | | `select` | `string[]` | No | — | | `orderby` | `string` | No | — | | `user_id` | `string` | No | — | | `skip_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### list `files.list` List files in the root drive **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `select` | `string[]` | No | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### upload `files.upload` Upload a file to OneDrive **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `object` | Yes | — | | `folder` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `drive_id` | `string` | No | — | | `description` | `string` | No | — | | `defer_commit` | `boolean` | No | — | | `if_match_etag` | `string` | No | — | | `file_system_info` | `object` | No | — | | `conflict_behavior` | `rename \| fail \| replace` | No | — | > **file full type** > > ```ts theme={null} > { > name: string, > s3key: string, > mimetype: string > } > ``` > **file\_system\_info full type** > > ```ts theme={null} > { > createdDateTime?: string, > lastAccessedDateTime?: string, > lastModifiedDateTime?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `file` | `object` | No | — | | `name` | `string` | Yes | — | | `size` | `number` | No | — | > **file full type** > > ```ts theme={null} > { > mimeType?: string > } > ``` *** ## Items ### checkin `items.checkin` Check in a checked-out drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.checkin({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `drive_id` | `string` | Yes | — | | `driveItem_id` | `string` | Yes | — | | `comment` | `string` | No | — | | `checkInAs` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### checkout `items.checkout` Check out a drive item for editing **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.checkout({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `drive_id` | `string` | Yes | — | | `driveItem_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### copy `items.copy` Copy a drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.copy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `name` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `drive_id` | `string` | No | — | | `group_id` | `string` | No | — | | `children_only` | `boolean` | No | — | | `parent_reference` | `object` | No | — | | `conflict_behavior` | `fail \| replace \| rename` | No | — | | `include_all_version_history` | `boolean` | No | — | > **parent\_reference full type** > > ```ts theme={null} > { > id?: string, > driveId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `item_id` | `string` | No | — | | `message` | `string` | Yes | — | | `web_url` | `string` | No | — | | `monitor_url` | `string` | No | — | | `status_code` | `number` | Yes | — | *** ### delete `items.delete` Delete a drive item **Risk:** `destructive` ```ts theme={null} await corsair.onedrive.api.items.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `if_match` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### deletePermanently `items.deletePermanently` Permanently delete a drive item **Risk:** `destructive` ```ts theme={null} await corsair.onedrive.api.items.deletePermanently({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `drive_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### discardCheckout `items.discardCheckout` Discard the checkout of a drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.discardCheckout({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `drive_id` | `string` | Yes | — | | `driveItem_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### download `items.download` Download a file **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `file_name` | `string` | Yes | — | | `drive_id` | `string` | No | — | | `user_id` | `string` | No | — | | `format` | `pdf \| html` | No | — | | `if_none_match` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | *** ### downloadAsFormat `items.downloadAsFormat` Download a file converted to a different format **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.downloadAsFormat({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `path_and_filename` | `string` | Yes | — | | `file_name` | `string` | Yes | — | | `format` | `pdf \| html` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | *** ### downloadByPath `items.downloadByPath` Download a file by path **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.downloadByPath({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_path` | `string` | Yes | — | | `file_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | *** ### downloadVersion `items.downloadVersion` Download a specific version of a file **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.downloadVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `version_id` | `string` | Yes | — | | `file_name` | `string` | Yes | — | | `drive_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | *** ### follow `items.follow` Follow a drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.follow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `drive_id` | `string` | Yes | — | | `driveItem_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `size` | `number` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | *** ### get `items.get` Get a drive item by ID **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `drive_id` | `string` | No | — | | `select_fields` | `string[]` | No | — | | `expand_relations` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `size` | `number` | No | — | | `webUrl` | `string` | No | — | | `eTag` | `string` | No | — | | `cTag` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `createdBy` | `object` | No | — | | `lastModifiedBy` | `object` | No | — | | `parentReference` | `object` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | | `deleted` | `object` | No | — | | `@microsoft.graph.downloadUrl` | `string` | No | — | | `children` | `object[]` | No | — | > **createdBy full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **lastModifiedBy full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **parentReference full type** > > ```ts theme={null} > { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > } > ``` > **file full type** > > ```ts theme={null} > { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > } > ``` > **folder full type** > > ```ts theme={null} > { > childCount?: number > } > ``` > **deleted full type** > > ```ts theme={null} > { > state?: string > } > ``` > **children full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > ``` *** ### getDriveItemBySharingUrl `items.getDriveItemBySharingUrl` Get a drive item by sharing URL **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.getDriveItemBySharingUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sharing_url` | `string` | No | — | | `prefer_redeem` | `redeemSharingLinkIfNecessary \| redeemSharingLink` | No | — | | `select_fields` | `string[]` | No | — | | `expand_children` | `boolean` | No | — | | `share_id_or_encoded_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `size` | `number` | No | — | | `webUrl` | `string` | No | — | | `eTag` | `string` | No | — | | `cTag` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | | `@microsoft.graph.downloadUrl` | `string` | No | — | | `parentReference` | `object` | No | — | | `item_id` | `string` | No | — | | `drive_id` | `string` | No | — | > **file full type** > > ```ts theme={null} > { > mimeType?: string > } > ``` > **folder full type** > > ```ts theme={null} > { > childCount?: number > } > ``` > **parentReference full type** > > ```ts theme={null} > { > driveId?: string, > id?: string, > path?: string > } > ``` *** ### getFollowed `items.getFollowed` Get a followed drive item **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.getFollowed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `drive_id` | `string` | Yes | — | | `driveItem_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `file` | `object` | No | — | | `name` | `string` | Yes | — | | `size` | `number` | No | — | | `folder` | `object` | No | — | | `webUrl` | `string` | No | — | | `followed` | `boolean` | No | — | > **file full type** > > ```ts theme={null} > { > mimeType?: string > } > ``` > **folder full type** > > ```ts theme={null} > { > childCount?: number > } > ``` *** ### getThumbnails `items.getThumbnails` Get thumbnails for a drive item **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.getThumbnails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `drive_id` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `group_id` | `string` | No | — | | `select` | `string` | No | — | | `original_orientation` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id?: string, > large?: { > height?: number, > width?: number, > url?: string, > content?: string > }, > medium?: { > height?: number, > width?: number, > url?: string, > content?: string > }, > small?: { > height?: number, > width?: number, > url?: string, > content?: string > }, > source?: { > height?: number, > width?: number, > url?: string, > content?: string > } > }[] > ``` *** ### getVersions `items.getVersions` Get versions of a drive item **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.getVersions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `drive_id` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `group_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id: string, > lastModifiedDateTime?: string, > size?: number, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > published?: { > level?: string, > versionId?: string > } > }[] > ``` *** ### listActivities `items.listActivities` List activities on a drive item **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.listActivities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `drive_id` | `string` | Yes | — | | `top` | `number` | No | — | | `skip` | `string` | No | — | | `expand` | `string[]` | No | — | | `filter` | `string` | No | — | | `select` | `string[]` | No | — | | `orderby` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > action?: { > comment?: { > }, > create?: { > }, > delete?: { > }, > edit?: { > }, > mention?: { > }, > move?: { > }, > rename?: { > }, > restore?: { > }, > share?: { > }, > version?: { > } > }, > actor?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > times?: { > recordedTime?: string > } > }[] > ``` *** ### listFolderChildren `items.listFolderChildren` List children of a folder **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.listFolderChildren({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `expand` | `string[]` | No | — | | `select` | `string[]` | No | — | | `orderby` | `string` | No | — | | `site_id` | `string` | No | — | | `drive_id` | `string` | No | — | | `next_link` | `string` | No | — | | `skip_token` | `string` | No | — | | `folder_path` | `string` | No | — | | `use_me_drive` | `boolean` | No | — | | `folder_item_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### move `items.move` Move a drive item to a new location **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `itemId` | `string` | Yes | — | | `parentReference` | `object` | Yes | — | | `name` | `string` | No | — | | `siteId` | `string` | No | — | | `userId` | `string` | No | — | | `driveId` | `string` | No | — | | `groupId` | `string` | No | — | | `description` | `string` | No | — | > **parentReference full type** > > ```ts theme={null} > { > id: string, > driveId: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `size` | `number` | No | — | | `webUrl` | `string` | No | — | | `parentReference` | `object` | No | — | > **parentReference full type** > > ```ts theme={null} > { > driveId?: string, > id?: string, > path?: string > } > ``` *** ### preview `items.preview` Get a preview URL for a drive item **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.preview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `drive_id` | `string` | No | — | | `group_id` | `string` | No | — | | `share_id` | `string` | No | — | | `page` | `string` | No | — | | `zoom` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `getUrl` | `string` | No | — | | `postUrl` | `string` | No | — | | `postParameters` | `string` | No | — | *** ### restore `items.restore` Restore a deleted drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.restore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `name` | `string` | No | — | | `parent_reference_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `file` | `object` | No | — | | `name` | `string` | Yes | — | | `size` | `number` | No | — | | `folder` | `object` | No | — | | `webUrl` | `string` | No | — | | `deleted` | `object` | No | — | | `createdDateTime` | `string` | No | — | | `parentReference` | `object` | No | — | | `lastModifiedDateTime` | `string` | No | — | > **file full type** > > ```ts theme={null} > { > mimeType?: string > } > ``` > **folder full type** > > ```ts theme={null} > { > childCount?: number > } > ``` > **deleted full type** > > ```ts theme={null} > { > state?: string > } > ``` > **parentReference full type** > > ```ts theme={null} > { > driveId?: string, > id?: string, > path?: string > } > ``` *** ### search `items.search` Search for drive items **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.items.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `top` | `number` | No | — | | `expand` | `string` | No | — | | `select` | `string` | No | — | | `orderby` | `string` | No | — | | `drive_id` | `string` | No | — | | `skip_token` | `string` | No | — | | `search_scope` | `drive \| root` | No | — | | `stripped_annotations` | `string[]` | No | — | | `transformed_path_query` | `string` | No | — | | `transformed_kql_operator` | `string` | No | — | | `transformed_parent_query` | `string` | No | — | | `transformed_wildcard_query` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### unfollow `items.unfollow` Unfollow a drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.unfollow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### updateContent `items.updateContent` Update the content of a file **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.updateContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `name` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `drive_id` | `string` | No | — | | `group_id` | `string` | No | — | | `file_size` | `number` | No | — | | `description` | `string` | No | — | | `defer_commit` | `boolean` | No | — | | `media_source` | `object` | No | — | | `if_match_etag` | `string` | No | — | | `file_system_info` | `object` | No | — | | `conflict_behavior` | `string` | No | — | | `drive_item_source` | `object` | No | — | | `if_none_match_etag` | `string` | No | — | > **media\_source full type** > > ```ts theme={null} > { > contentCategory?: string > } > ``` > **file\_system\_info full type** > > ```ts theme={null} > { > createdDateTime?: string, > lastAccessedDateTime?: string, > lastModifiedDateTime?: string > } > ``` > **drive\_item\_source full type** > > ```ts theme={null} > { > externalId?: string, > application?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `uploadUrl` | `string` | No | — | | `expirationDateTime` | `string` | No | — | | `nextExpectedRanges` | `string[]` | No | — | *** ### updateMetadata `items.updateMetadata` Update metadata for a drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.items.updateMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `drive_id` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `group_id` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `ifMatch` | `string` | No | — | | `fileSystemInfo` | `object` | No | — | | `parent_reference_id` | `string` | No | — | | `parent_reference_drive_id` | `string` | No | — | | `additional_properties` | `object` | No | — | > **fileSystemInfo full type** > > ```ts theme={null} > { > createdDateTime?: string, > lastAccessedDateTime?: string, > lastModifiedDateTime?: string > } > ``` > **additional\_properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `cTag` | `string` | No | — | | `eTag` | `string` | No | — | | `file` | `object` | No | — | | `name` | `string` | Yes | — | | `size` | `number` | No | — | | `folder` | `object` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | > **file full type** > > ```ts theme={null} > { > mimeType?: string > } > ``` > **folder full type** > > ```ts theme={null} > { > childCount?: number > } > ``` *** ## Permissions ### createForItem `permissions.createForItem` Create a permission for a drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.permissions.createForItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `drive_id` | `string` | Yes | — | | `driveItem_id` | `string` | Yes | — | | `roles` | `string[]` | Yes | — | | `grantedToV2` | `object` | Yes | — | > **grantedToV2 full type** > > ```ts theme={null} > { > siteGroup?: { > }, > application?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `link` | `object` | No | — | | `roles` | `string[]` | No | — | | `grantedTo` | `object` | No | — | | `grantedToV2` | `object` | No | — | | `hasPassword` | `boolean` | No | — | | `expirationDateTime` | `string` | No | — | > **link full type** > > ```ts theme={null} > { > type?: string, > scope?: string, > webUrl?: string, > webHtml?: string, > preventsDownload?: boolean, > application?: { > id?: string, > displayName?: string > } > } > ``` > **grantedTo full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > } > ``` > **grantedToV2 full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > } > ``` *** ### createLink `permissions.createLink` Create a sharing link for a drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.permissions.createLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `type` | `view \| edit \| embed` | Yes | — | | `scope` | `anonymous \| organization \| users` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `drive_id` | `string` | No | — | | `group_id` | `string` | No | — | | `password` | `string` | No | — | | `expiration_date_time` | `string` | No | — | | `retain_inherited_permissions` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `link` | `object` | No | — | | `roles` | `string[]` | No | — | | `shareId` | `string` | No | — | | `hasPassword` | `boolean` | No | — | > **link full type** > > ```ts theme={null} > { > type?: string, > scope?: string, > webUrl?: string, > webHtml?: string, > preventsDownload?: boolean, > application?: { > id?: string, > displayName?: string > } > } > ``` *** ### deleteFromItem `permissions.deleteFromItem` Delete a permission from a drive item **Risk:** `destructive` ```ts theme={null} await corsair.onedrive.api.permissions.deleteFromItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `perm_id` | `string` | Yes | — | | `drive_id` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `group_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### deleteSharePermission `permissions.deleteSharePermission` Delete a share permission **Risk:** `destructive` ```ts theme={null} await corsair.onedrive.api.permissions.deleteSharePermission({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shared_drive_item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | *** ### getForItem `permissions.getForItem` Get permissions for a drive item **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.permissions.getForItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `drive_id` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `group_id` | `string` | No | — | | `item_path` | `string` | No | — | | `select` | `string` | No | — | | `if_none_match` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > link?: { > type?: string, > scope?: string, > webUrl?: string, > webHtml?: string, > preventsDownload?: boolean, > application?: { > id?: string, > displayName?: string > } > }, > roles?: string[], > grantedTo?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > }, > grantedToV2?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > }, > hasPassword?: boolean, > expirationDateTime?: string > }[] > ``` *** ### getShare `permissions.getShare` Get a shared item by share ID or encoded URL **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.permissions.getShare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `share_id_or_encoded_sharing_url` | `string` | Yes | — | | `prefer_redeem` | `redeemSharingLinkIfNecessary \| redeemSharingLink` | No | — | | `expand_children` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `root` | `object` | No | — | | `items` | `object[]` | No | — | | `owner` | `object` | No | — | | `children` | `object[]` | No | — | > **root full type** > > ```ts theme={null} > { > } > ``` > **items full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` > **owner full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > ``` > **children full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### grantSharePermission `permissions.grantSharePermission` Grant a permission on a shared item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.permissions.grantSharePermission({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `encoded_sharing_url` | `string` | Yes | — | | `roles` | `string[]` | Yes | — | | `recipients` | `object[]` | Yes | — | > **recipients full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id?: string, > link?: { > type?: string, > scope?: string, > webUrl?: string, > webHtml?: string, > preventsDownload?: boolean, > application?: { > id?: string, > displayName?: string > } > }, > roles?: string[], > grantedTo?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > }, > grantedToV2?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > }, > hasPassword?: boolean, > expirationDateTime?: string > }[] > ``` *** ### inviteUser `permissions.inviteUser` Invite a user to access a drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.permissions.inviteUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `roles` | `string[]` | Yes | — | | `recipients` | `object[]` | Yes | — | | `drive_id` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `group_id` | `string` | No | — | | `message` | `string` | No | — | | `password` | `string` | No | — | | `require_sign_in` | `boolean` | No | — | | `send_invitation` | `boolean` | No | — | | `expiration_date_time` | `string` | No | — | | `retain_inherited_permissions` | `boolean` | No | — | > **recipients full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id?: string, > link?: { > type?: string, > scope?: string, > webUrl?: string, > webHtml?: string, > preventsDownload?: boolean, > application?: { > id?: string, > displayName?: string > } > }, > roles?: string[], > grantedTo?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > }, > grantedToV2?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > }, > hasPassword?: boolean, > expirationDateTime?: string > }[] > ``` *** ### listSharePermissions `permissions.listSharePermissions` List permissions on a shared drive item **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.permissions.listSharePermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `shared_drive_item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `link` | `object` | No | — | | `roles` | `string[]` | No | — | | `hasPassword` | `boolean` | No | — | > **link full type** > > ```ts theme={null} > { > type?: string, > scope?: string, > webUrl?: string, > webHtml?: string, > preventsDownload?: boolean, > application?: { > id?: string, > displayName?: string > } > } > ``` *** ### updateForItem `permissions.updateForItem` Update a permission on a drive item **Risk:** `write` ```ts theme={null} await corsair.onedrive.api.permissions.updateForItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | | `permission_id` | `string` | Yes | — | | `roles` | `string[]` | Yes | — | | `drive_id` | `string` | No | — | | `site_id` | `string` | No | — | | `user_id` | `string` | No | — | | `group_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `link` | `object` | No | — | | `roles` | `string[]` | No | — | | `grantedTo` | `object` | No | — | | `grantedToV2` | `object` | No | — | | `hasPassword` | `boolean` | No | — | | `expirationDateTime` | `string` | No | — | > **link full type** > > ```ts theme={null} > { > type?: string, > scope?: string, > webUrl?: string, > webHtml?: string, > preventsDownload?: boolean, > application?: { > id?: string, > displayName?: string > } > } > ``` > **grantedTo full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > } > ``` > **grantedToV2 full type** > > ```ts theme={null} > { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > }, > siteUser?: { > id?: string, > displayName?: string, > loginName?: string, > email?: string > }, > siteGroup?: { > id?: string, > displayName?: string, > loginName?: string > }, > group?: { > id?: string, > displayName?: string > } > } > ``` *** ## Sharepoint ### getListItems `sharepoint.getListItems` Get items from a SharePoint list **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.sharepoint.getListItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `list_id` | `string` | Yes | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `count` | `boolean` | No | — | | `expand` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string` | No | — | | `orderby` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.count` | `number` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > eTag?: string, > webUrl?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > contentType?: { > id?: string, > name?: string > }, > fields?: { > }, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > }[] > ``` *** ### getSite `sharepoint.getSite` Get a SharePoint site by ID **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.sharepoint.getSite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `expand` | `string` | No | — | | `select` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `eTag` | `string` | No | — | | `name` | `string` | No | — | | `webUrl` | `string` | No | — | | `description` | `string` | No | — | | `displayName` | `string` | No | — | | `sharepointIds` | `object` | No | — | | `isPersonalSite` | `boolean` | No | — | | `siteCollection` | `object` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | > **sharepointIds full type** > > ```ts theme={null} > { > siteId?: string, > siteUrl?: string, > webId?: string, > webUrl?: string, > listId?: string, > tenantId?: string > } > ``` > **siteCollection full type** > > ```ts theme={null} > { > hostname?: string, > dataLocationCode?: string, > root?: { > } > } > ``` *** ### getSitePage `sharepoint.getSitePage` Get a page from a SharePoint site **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.sharepoint.getSitePage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `page_id` | `string` | Yes | — | | `expand` | `string` | No | — | | `select` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `webUrl` | `string` | No | — | *** ### listListItemsDelta `sharepoint.listListItemsDelta` List changes to SharePoint list items using delta **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.sharepoint.listListItemsDelta({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `list_id` | `string` | Yes | — | | `top` | `number` | No | — | | `token` | `string` | No | — | | `expand` | `string` | No | — | | `select` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | | `@odata.deltaLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > eTag?: string, > webUrl?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > contentType?: { > id?: string, > name?: string > }, > fields?: { > }, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > } > }[] > ``` *** ### listSiteColumns `sharepoint.listSiteColumns` List site columns in a SharePoint site **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.sharepoint.listSiteColumns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `count` | `boolean` | No | — | | `expand` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string` | No | — | | `orderby` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.count` | `number` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > displayName?: string, > description?: string, > columnGroup?: string, > indexed?: boolean, > readOnly?: boolean, > required?: boolean, > hidden?: boolean, > enforceUniqueValues?: boolean, > boolean?: { > }, > text?: { > allowMultipleLines?: boolean, > maxLength?: number, > textType?: string > }, > number?: { > decimalPlaces?: string, > displayAs?: string, > maximum?: number, > minimum?: number > }, > dateTime?: { > displayAs?: string, > format?: string > }, > choice?: { > allowTextEntry?: boolean, > choices?: string[], > displayAs?: string > }, > lookup?: { > allowMultipleValues?: boolean, > columnName?: string, > listId?: string > } > }[] > ``` *** ### listSiteItemsDelta `sharepoint.listSiteItemsDelta` List changes to all drive items in a site using delta **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.sharepoint.listSiteItemsDelta({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `top` | `number` | No | — | | `token` | `string` | No | — | | `expand` | `string` | No | — | | `select` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | | `@odata.deltaLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string, > children?: { > id: string, > name?: string, > size?: number, > webUrl?: string, > eTag?: string, > cTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > parentReference?: { > driveId?: string, > id?: string, > path?: string, > name?: string, > siteId?: string > }, > file?: { > mimeType?: string, > hashes?: { > quickXorHash?: string, > sha1Hash?: string, > sha256Hash?: string > } > }, > folder?: { > childCount?: number > }, > deleted?: { > state?: string > }, > @microsoft.graph.downloadUrl?: string > }[] > }[] > ``` *** ### listSiteLists `sharepoint.listSiteLists` List all lists in a SharePoint site **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.sharepoint.listSiteLists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `count` | `boolean` | No | — | | `expand` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string` | No | — | | `orderby` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.count` | `number` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > displayName?: string, > description?: string, > webUrl?: string, > eTag?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > createdBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > lastModifiedBy?: { > user?: { > id?: string, > displayName?: string > }, > application?: { > id?: string, > displayName?: string > }, > device?: { > id?: string, > displayName?: string > } > }, > list?: { > hidden?: boolean, > template?: string > } > }[] > ``` *** ### listSiteSubsites `sharepoint.listSiteSubsites` List subsites of a SharePoint site **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.sharepoint.listSiteSubsites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `count` | `boolean` | No | — | | `expand` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string` | No | — | | `orderby` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.count` | `number` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id: string, > eTag?: string, > name?: string, > webUrl?: string, > description?: string, > displayName?: string, > sharepointIds?: { > siteId?: string, > siteUrl?: string, > webId?: string, > webUrl?: string, > listId?: string, > tenantId?: string > }, > isPersonalSite?: boolean, > siteCollection?: { > hostname?: string, > dataLocationCode?: string, > root?: { > } > }, > createdDateTime?: string, > lastModifiedDateTime?: string > }[] > ``` *** ## Subscriptions ### list `subscriptions.list` List all active subscriptions **Risk:** `read` ```ts theme={null} await corsair.onedrive.api.subscriptions.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > resource?: string | null, > changeType?: string | null, > clientState?: string | null, > notificationUrl?: string | null, > expirationDateTime?: string | null, > applicationId?: string | null, > creatorId?: string | null, > notificationQueryOptions?: string | null, > lifecycleNotificationUrl?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/onedrive/database OneDrive local sync: searchable entities, `.search()` filters, and operators. The OneDrive plugin syncs data locally. Use `corsair.onedrive.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Drive Items Path: `onedrive.db.driveItems.search` ```ts theme={null} const rows = await corsair.onedrive.db.driveItems.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `webUrl` | `string` | equals, contains, startsWith, endsWith, in | | `eTag` | `string` | equals, contains, startsWith, endsWith, in | | `cTag` | `string` | equals, contains, startsWith, endsWith, in | | `createdDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Drives Path: `onedrive.db.drives.search` ```ts theme={null} const rows = await corsair.onedrive.db.drives.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `driveType` | `string` | equals, contains, startsWith, endsWith, in | | `webUrl` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/onedrive/get-credentials Step-by-step instructions for obtaining Microsoft OneDrive OAuth credentials. ## Authentication Method * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 (Microsoft identity platform) ## OAuth App Setup ### Step 1: Register an App in Azure 1. Go to the [Azure portal](https://portal.azure.com) 2. Navigate to **Azure Active Directory** → **App registrations** 3. Click **New registration** 4. Fill in the app name and select **Accounts in any organizational directory and personal Microsoft accounts** 5. Add a redirect URI (e.g., `http://localhost:3456/callback`) under **Web** 6. Click **Register** ### Step 2: Configure API Permissions 1. Go to **API permissions** → **Add a permission** → **Microsoft Graph** 2. Add the permissions your app needs: * `Files.ReadWrite` — Read and write files * `Files.ReadWrite.All` — Full file access * `Sites.ReadWrite.All` — Access SharePoint sites ### Step 3: Create a Client Secret 1. Go to **Certificates & secrets** → **New client secret** 2. Give it a description and expiry 3. Copy the **Value** immediately — you won't see it again ### Step 4: Store Credentials ```bash theme={null} pnpm corsair setup --plugin=onedrive client_id=your-application-id client_secret=your-client-secret ``` ### Step 5: Authorize ```bash theme={null} pnpm corsair auth --plugin=onedrive ``` This opens a browser window to complete the Microsoft OAuth flow. Tokens are saved automatically. ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Application (Client) ID | OAuth flow | Azure App registration → Overview | | Client Secret | OAuth flow | Azure App registration → Certificates & secrets | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/onedrive/overview Microsoft cloud storage for files, folders, sharing, and Office document synchronization. Use **OneDrive** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 61 typed API operations * 2 synced entities (`driveItems`, `drives`) for fast `.search()` / `.list()` * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/onedrive ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/onedrive ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/onedrive ``` ```bash bun theme={null} bun add corsair @corsair-dev/onedrive ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { onedrive } from '@corsair-dev/onedrive'; export const corsair = createCorsair({ plugins: [ onedrive({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **OneDrive** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/onedrive/get-credentials). ```ts theme={null} onedrive({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your OneDrive OAuth app. Provider walkthrough: [Get Credentials](/plugins/onedrive/get-credentials). ```ts theme={null} onedrive() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'onedrive', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`drive.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.onedrive.api.drive.get({}); ``` **`files.createFolder`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.onedrive.api.files.createFolder({}); ``` See the full list on the [API](/plugins/onedrive/api) page. ## Query synced data Synced entities support `tenant.onedrive.db..search()` and `.list()`: `driveItems`, `drives`. See [Database](/plugins/onedrive/database) for filters and operators. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/onedrive/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/onedrive/api)** > > Every `onedrive.api.*` operation with input and output types. > **[Database](/plugins/onedrive/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/onedrive/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/onedrive/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/onedrive/webhooks OneDrive incoming webhooks: event paths, payloads, and response data. The OneDrive plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/onedrive/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `drive` * `driveNotification` (`drive.driveNotification`) * `validation` (`drive.validation`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Drive ### Drive Notification `drive.driveNotification` Microsoft Graph drive change notification — item created, updated, or deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: string, > clientState?: string, > resource?: string, > resourceData?: { > }, > tenantId?: string, > subscriptionExpirationDateTime?: string > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: string, > clientState?: string, > resource?: string, > resourceData?: { > }, > tenantId?: string, > subscriptionExpirationDateTime?: string > } > ``` **`webhookHooks` example** ```ts theme={null} onedrive({ webhookHooks: { drive: { driveNotification: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Validation `drive.validation` Microsoft Graph OneDrive webhook validation handshake **Payload** | Name | Type | Required | Description | | - | - | - | - | | `validationToken` | `string` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > validationToken: string > } > ``` **`webhookHooks` example** ```ts theme={null} onedrive({ webhookHooks: { drive: { validation: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/onepassword/api API reference for 1Password: every `onepassword.api.*` operation with input and output types. Every `onepassword.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Items ### create `items.create` Create a new item in a vault **Risk:** `write` ```ts theme={null} await corsair.onepassword.api.items.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `string` | Yes | — | | `title` | `string` | Yes | — | | `category` | `LOGIN \| PASSWORD \| SECURE_NOTE \| DATABASE \| CREDIT_CARD \| MEMBERSHIP \| PASSPORT \| SOFTWARE_LICENSE \| OUTDOOR_LICENSE \| API_CREDENTIAL` | Yes | — | | `urls` | `object[]` | No | — | | `fields` | `object[]` | No | — | > **urls full type** > > ```ts theme={null} > { > primary?: boolean, > href: string > }[] > ``` > **fields full type** > > ```ts theme={null} > { > id?: string, > label?: string, > type: string, > value?: string, > section?: { > id: string > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `vault` | `object` | Yes | — | | `category` | `string` | Yes | — | | `urls` | `object[]` | No | — | | `fields` | `object[]` | No | — | > **vault full type** > > ```ts theme={null} > { > id: string > } > ``` > **urls full type** > > ```ts theme={null} > { > primary?: boolean, > href: string > }[] > ``` > **fields full type** > > ```ts theme={null} > { > id?: string, > label?: string, > type: string, > value?: string, > section?: { > id: string > } > }[] > ``` *** ### delete `items.delete` Delete an item from a vault **Risk:** `destructive` ```ts theme={null} await corsair.onepassword.api.items.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `items.get` Get details of a vault item (e.g. login credentials, notes) **Risk:** `read` ```ts theme={null} await corsair.onepassword.api.items.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `vault` | `object` | Yes | — | | `category` | `string` | Yes | — | | `urls` | `object[]` | No | — | | `fields` | `object[]` | No | — | > **vault full type** > > ```ts theme={null} > { > id: string > } > ``` > **urls full type** > > ```ts theme={null} > { > primary?: boolean, > href: string > }[] > ``` > **fields full type** > > ```ts theme={null} > { > id?: string, > label?: string, > type: string, > value?: string, > section?: { > id: string > } > }[] > ``` *** ### list `items.list` List all items inside a specific vault **Risk:** `read` ```ts theme={null} await corsair.onepassword.api.items.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > title: string, > vault: { > id: string > }, > category: string, > urls?: { > primary?: boolean, > href: string > }[], > fields?: { > id?: string, > label?: string, > type: string, > value?: string, > section?: { > id: string > } > }[] > }[] > ``` *** ### update `items.update` Update details of an existing vault item **Risk:** `write` ```ts theme={null} await corsair.onepassword.api.items.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vaultId` | `string` | Yes | — | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `category` | `LOGIN \| PASSWORD \| SECURE_NOTE \| DATABASE \| CREDIT_CARD \| MEMBERSHIP \| PASSPORT \| SOFTWARE_LICENSE \| OUTDOOR_LICENSE \| API_CREDENTIAL` | Yes | — | | `urls` | `object[]` | No | — | | `fields` | `object[]` | No | — | > **urls full type** > > ```ts theme={null} > { > primary?: boolean, > href: string > }[] > ``` > **fields full type** > > ```ts theme={null} > { > id?: string, > label?: string, > type: string, > value?: string, > section?: { > id: string > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `vault` | `object` | Yes | — | | `category` | `string` | Yes | — | | `urls` | `object[]` | No | — | | `fields` | `object[]` | No | — | > **vault full type** > > ```ts theme={null} > { > id: string > } > ``` > **urls full type** > > ```ts theme={null} > { > primary?: boolean, > href: string > }[] > ``` > **fields full type** > > ```ts theme={null} > { > id?: string, > label?: string, > type: string, > value?: string, > section?: { > id: string > } > }[] > ``` *** ## Vaults ### get `vaults.get` Get details of a specific vault by ID **Risk:** `read` ```ts theme={null} await corsair.onepassword.api.vaults.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `attributeVersion` | `number` | No | — | | `contentVersion` | `number` | No | — | | `type` | `string` | No | — | *** ### list `vaults.list` List all vaults the integration can access **Risk:** `read` ```ts theme={null} await corsair.onepassword.api.vaults.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string, > attributeVersion?: number, > contentVersion?: number, > type?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/onepassword/database 1Password local sync: searchable entities, `.search()` filters, and operators. The 1Password plugin syncs data locally. Use `corsair.onepassword.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Items Path: `onepassword.db.items.search` ```ts theme={null} const rows = await corsair.onepassword.db.items.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Vaults Path: `onepassword.db.vaults.search` ```ts theme={null} const rows = await corsair.onepassword.db.vaults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `attributeVersion` | `number` | equals, gt, gte, lt, lte, in | | `contentVersion` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/onepassword/overview Password manager for secure vaults, item storage, and team credential management. Use **1Password** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 7 typed API operations * 2 synced entities (`items`, `vaults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/onepassword ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/onepassword ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/onepassword ``` ```bash bun theme={null} bun add corsair @corsair-dev/onepassword ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { onepassword } from '@corsair-dev/onepassword'; export const corsair = createCorsair({ plugins: [ onepassword(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} onepassword() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'onepassword', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`items.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.onepassword.api.items.get({}); ``` **`items.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.onepassword.api.items.create({}); ``` See the full list on the [API](/plugins/onepassword/api) page. ## Query synced data Synced entities support `tenant.onepassword.db..search()` and `.list()`: `items`, `vaults`. See [Database](/plugins/onepassword/database) for filters and operators. ## What's next > **[API reference](/plugins/onepassword/api)** > > Every `onepassword.api.*` operation with input and output types. > **[Database](/plugins/onepassword/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/openai/api API reference for OpenAI: every `openai.api.*` operation with input and output types. Every `openai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Assistants ### create `assistants.create` Create an assistant **Risk:** `write` ```ts theme={null} await corsair.openai.api.assistants.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | No | — | | `toolResources` | `object` | No | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **toolResources full type** > > ```ts theme={null} > { > code_interpreter?: { > file_ids: string[] > }, > file_search?: { > vector_store_ids: string[] > } > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `assistant` | Yes | — | | `created_at` | `number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `model` | `string` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `top_p` | `number` | No | — | > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `assistants.delete` Delete an assistant **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.assistants.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `assistant.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### list `assistants.list` List assistants **Risk:** `read` ```ts theme={null} await corsair.openai.api.assistants.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: assistant, > created_at: number, > name?: string | null, > description?: string | null, > model: string, > instructions?: string | null, > tools: ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[], > metadata?: { > } | null, > temperature?: number | null, > top_p?: number | null > }[] > ``` *** ### modify `assistants.modify` Modify an assistant **Risk:** `write` ```ts theme={null} await corsair.openai.api.assistants.modify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantId` | `string` | Yes | — | | `model` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | No | — | | `toolResources` | `object` | No | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **toolResources full type** > > ```ts theme={null} > { > code_interpreter?: { > file_ids: string[] > }, > file_search?: { > vector_store_ids: string[] > } > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `assistant` | Yes | — | | `created_at` | `number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `model` | `string` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `top_p` | `number` | No | — | > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### retrieve `assistants.retrieve` Retrieve an assistant by id **Risk:** `read` ```ts theme={null} await corsair.openai.api.assistants.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `assistant` | Yes | — | | `created_at` | `number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `model` | `string` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `top_p` | `number` | No | — | > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Audio ### createSpeech `audio.createSpeech` Generate spoken audio from text **Risk:** `write` ```ts theme={null} await corsair.openai.api.audio.createSpeech({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `string` | Yes | — | | `voice` | `string` | Yes | — | | `responseFormat` | `mp3 \| opus \| aac \| flac \| wav \| pcm` | No | — | | `speed` | `number` | No | — | | `instructions` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `audioBase64` | `string` | Yes | — | | `format` | `string` | Yes | — | *** ### createTranscription `audio.createTranscription` Transcribe audio into text **Risk:** `write` ```ts theme={null} await corsair.openai.api.audio.createTranscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom \| string` | Yes | — | | `fileName` | `string` | Yes | — | | `model` | `string` | Yes | — | | `language` | `string` | No | — | | `prompt` | `string` | No | — | | `responseFormat` | `json \| text \| srt \| verbose_json \| vtt` | No | — | | `temperature` | `number` | No | — | | `timestampGranularities` | `word \| segment[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | *** ### createTranslation `audio.createTranslation` Translate audio into English text **Risk:** `write` ```ts theme={null} await corsair.openai.api.audio.createTranslation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom \| string` | Yes | — | | `fileName` | `string` | Yes | — | | `model` | `string` | Yes | — | | `prompt` | `string` | No | — | | `responseFormat` | `json \| text \| srt \| verbose_json \| vtt` | No | — | | `temperature` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | *** ## Batches ### cancel `batches.cancel` Cancel an in-progress batch job **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.batches.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `batch` | Yes | — | | `endpoint` | `string` | Yes | — | | `input_file_id` | `string` | Yes | — | | `completion_window` | `string` | Yes | — | | `status` | `validating \| failed \| in_progress \| finalizing \| completed \| expired \| cancelling \| cancelled` | Yes | — | | `output_file_id` | `string` | No | — | | `error_file_id` | `string` | No | — | | `created_at` | `number` | Yes | — | | `in_progress_at` | `number` | No | — | | `expires_at` | `number` | No | — | | `finalizing_at` | `number` | No | — | | `completed_at` | `number` | No | — | | `failed_at` | `number` | No | — | | `expired_at` | `number` | No | — | | `cancelling_at` | `number` | No | — | | `cancelled_at` | `number` | No | — | | `request_counts` | `object` | No | — | | `errors` | `object` | No | — | | `metadata` | `object` | No | — | > **request\_counts full type** > > ```ts theme={null} > { > total: number, > completed: number, > failed: number > } > ``` > **errors full type** > > ```ts theme={null} > { > data?: { > code: string, > message: string, > param?: string | null, > line?: number | null > }[] > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### create `batches.create` Create a batch job **Risk:** `write` ```ts theme={null} await corsair.openai.api.batches.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inputFileId` | `string` | Yes | — | | `endpoint` | `/v1/chat/completions \| /v1/completions \| /v1/embeddings \| /v1/responses` | Yes | — | | `completionWindow` | `24h` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `batch` | Yes | — | | `endpoint` | `string` | Yes | — | | `input_file_id` | `string` | Yes | — | | `completion_window` | `string` | Yes | — | | `status` | `validating \| failed \| in_progress \| finalizing \| completed \| expired \| cancelling \| cancelled` | Yes | — | | `output_file_id` | `string` | No | — | | `error_file_id` | `string` | No | — | | `created_at` | `number` | Yes | — | | `in_progress_at` | `number` | No | — | | `expires_at` | `number` | No | — | | `finalizing_at` | `number` | No | — | | `completed_at` | `number` | No | — | | `failed_at` | `number` | No | — | | `expired_at` | `number` | No | — | | `cancelling_at` | `number` | No | — | | `cancelled_at` | `number` | No | — | | `request_counts` | `object` | No | — | | `errors` | `object` | No | — | | `metadata` | `object` | No | — | > **request\_counts full type** > > ```ts theme={null} > { > total: number, > completed: number, > failed: number > } > ``` > **errors full type** > > ```ts theme={null} > { > data?: { > code: string, > message: string, > param?: string | null, > line?: number | null > }[] > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `batches.list` List batch jobs **Risk:** `read` ```ts theme={null} await corsair.openai.api.batches.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `after` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: batch, > endpoint: string, > input_file_id: string, > completion_window: string, > status: validating | failed | in_progress | finalizing | completed | expired | cancelling | cancelled, > output_file_id?: string, > error_file_id?: string, > created_at: number, > in_progress_at?: number, > expires_at?: number, > finalizing_at?: number, > completed_at?: number, > failed_at?: number, > expired_at?: number, > cancelling_at?: number, > cancelled_at?: number, > request_counts?: { > total: number, > completed: number, > failed: number > }, > errors?: { > data?: { > code: string, > message: string, > param?: string | null, > line?: number | null > }[] > }, > metadata?: { > } | null > }[] > ``` *** ### retrieve `batches.retrieve` Retrieve a batch job **Risk:** `read` ```ts theme={null} await corsair.openai.api.batches.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `batch` | Yes | — | | `endpoint` | `string` | Yes | — | | `input_file_id` | `string` | Yes | — | | `completion_window` | `string` | Yes | — | | `status` | `validating \| failed \| in_progress \| finalizing \| completed \| expired \| cancelling \| cancelled` | Yes | — | | `output_file_id` | `string` | No | — | | `error_file_id` | `string` | No | — | | `created_at` | `number` | Yes | — | | `in_progress_at` | `number` | No | — | | `expires_at` | `number` | No | — | | `finalizing_at` | `number` | No | — | | `completed_at` | `number` | No | — | | `failed_at` | `number` | No | — | | `expired_at` | `number` | No | — | | `cancelling_at` | `number` | No | — | | `cancelled_at` | `number` | No | — | | `request_counts` | `object` | No | — | | `errors` | `object` | No | — | | `metadata` | `object` | No | — | > **request\_counts full type** > > ```ts theme={null} > { > total: number, > completed: number, > failed: number > } > ``` > **errors full type** > > ```ts theme={null} > { > data?: { > code: string, > message: string, > param?: string | null, > line?: number | null > }[] > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Chat ### createCompletion `chat.createCompletion` Create a chat completion for the given messages **Risk:** `write` ```ts theme={null} await corsair.openai.api.chat.createCompletion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `frequencyPenalty` | `number` | No | — | | `logitBias` | `object` | No | — | | `logprobs` | `boolean` | No | — | | `topLogprobs` | `number` | No | — | | `maxCompletionTokens` | `number` | No | — | | `n` | `number` | No | — | | `presencePenalty` | `number` | No | — | | `responseFormat` | `object` | No | — | | `seed` | `number` | No | — | | `serviceTier` | `auto \| default \| flex \| priority` | No | — | | `stop` | `string \| string[]` | No | — | | `store` | `boolean` | No | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `tools` | `object[]` | No | — | | `toolChoice` | `object` | No | — | | `parallelToolCalls` | `boolean` | No | — | | `reasoningEffort` | `minimal \| low \| medium \| high` | No | — | | `user` | `string` | No | — | > **messages full type** > > ```ts theme={null} > { > role: system | developer | user | assistant | tool, > content?: string | ( > { > type: text, > text: string > } | { > type: image_url, > image_url: { > url: string, > detail?: auto | low | high > } > } | { > type: input_audio, > input_audio: { > data: string, > format: wav | mp3 > } > } | { > type: file, > file: { > file_id?: string, > filename?: string, > file_data?: string > } > } > )[] | null, > name?: string, > tool_calls?: { > id: string, > type: function, > function: { > name: string, > arguments: string > } > }[], > tool_call_id?: string, > refusal?: string | null > }[] > ``` > **logitBias full type** > > ```ts theme={null} > { > } > ``` > **responseFormat full type** > > ```ts theme={null} > { > type: text > } | { > type: json_object > } | { > type: json_schema, > json_schema: { > name: string, > description?: string, > schema?: { > }, > strict?: boolean | null > } > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **tools full type** > > ```ts theme={null} > { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > }[] > ``` > **toolChoice full type** > > ```ts theme={null} > none | auto | required | { > type: function, > function: { > name: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `chat.completion` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | | `choices` | `object[]` | Yes | — | | `system_fingerprint` | `string` | No | — | | `service_tier` | `string` | No | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > index: number, > message: { > role: assistant, > content?: string | null, > refusal?: string | null, > tool_calls?: { > id: string, > type: function, > function: { > name: string, > arguments: string > } > }[] > }, > logprobs?: { > } | null, > finish_reason: stop | length | tool_calls | content_filter | function_call > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ## Chat Completions ### delete `chatCompletions.delete` Delete a stored chat completion **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.chatCompletions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `completionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `chat.completion.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### list `chatCompletions.list` List stored chat completions **Risk:** `read` ```ts theme={null} await corsair.openai.api.chatCompletions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | No | — | | `metadata` | `object` | No | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### listMessages `chatCompletions.listMessages` List messages of a stored chat completion **Risk:** `read` ```ts theme={null} await corsair.openai.api.chatCompletions.listMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `completionId` | `string` | Yes | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### retrieve `chatCompletions.retrieve` Retrieve a stored chat completion **Risk:** `read` ```ts theme={null} await corsair.openai.api.chatCompletions.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `completionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `chat.completion` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | *** ### update `chatCompletions.update` Update a stored chat completion's metadata **Risk:** `write` ```ts theme={null} await corsair.openai.api.chatCompletions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `completionId` | `string` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `chat.completion` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | *** ## Chatkit ### getThread `chatkit.getThread` Retrieve a ChatKit thread **Risk:** `read` ```ts theme={null} await corsair.openai.api.chatkit.getThread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `chatkit.thread` | Yes | — | | `created_at` | `number` | Yes | — | | `status` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > } > ``` *** ### listThreadItems `chatkit.listThreadItems` List items in a ChatKit thread **Risk:** `read` ```ts theme={null} await corsair.openai.api.chatkit.listThreadItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### listThreads `chatkit.listThreads` List ChatKit threads **Risk:** `read` ```ts theme={null} await corsair.openai.api.chatkit.listThreads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `user` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: chatkit.thread, > created_at: number, > status?: { > } > }[] > ``` *** ## Completions ### create `completions.create` Create a legacy text completion **Risk:** `write` ```ts theme={null} await corsair.openai.api.completions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `prompt` | `string \| string[]` | Yes | — | | `maxTokens` | `number` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `n` | `number` | No | — | | `stop` | `string \| string[]` | No | — | | `presencePenalty` | `number` | No | — | | `frequencyPenalty` | `number` | No | — | | `logprobs` | `number` | No | — | | `echo` | `boolean` | No | — | | `bestOf` | `number` | No | — | | `logitBias` | `object` | No | — | | `user` | `string` | No | — | | `suffix` | `string` | No | — | > **logitBias full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `text_completion` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | | `choices` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > text: string, > index: number, > logprobs?: { > } | null, > finish_reason: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ## Container Files ### create `containerFiles.create` Add a file to a container **Risk:** `write` ```ts theme={null} await corsair.openai.api.containerFiles.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | Yes | — | | `file` | `custom \| string` | No | — | | `fileName` | `string` | No | — | | `fileId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `container.file` | Yes | — | | `container_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `bytes` | `number` | No | — | | `path` | `string` | No | — | | `source` | `string` | No | — | *** ### delete `containerFiles.delete` Delete a container file **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.containerFiles.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `container.file.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### list `containerFiles.list` List files in a container **Risk:** `read` ```ts theme={null} await corsair.openai.api.containerFiles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: container.file, > container_id: string, > created_at: number, > bytes?: number, > path?: string, > source?: string > }[] > ``` *** ### retrieve `containerFiles.retrieve` Retrieve a container file **Risk:** `read` ```ts theme={null} await corsair.openai.api.containerFiles.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `container.file` | Yes | — | | `container_id` | `string` | Yes | — | | `created_at` | `number` | Yes | — | | `bytes` | `number` | No | — | | `path` | `string` | No | — | | `source` | `string` | No | — | *** ### retrieveContent `containerFiles.retrieveContent` Download the contents of a container file **Risk:** `read` ```ts theme={null} await corsair.openai.api.containerFiles.retrieveContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | | `contentBase64` | `string` | Yes | — | *** ## Containers ### create `containers.create` Create a code interpreter container **Risk:** `write` ```ts theme={null} await corsair.openai.api.containers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `fileIds` | `string[]` | No | — | | `expiresAfter` | `object` | No | — | > **expiresAfter full type** > > ```ts theme={null} > { > anchor: string, > minutes: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `container` | Yes | — | | `created_at` | `number` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `expires_after` | `object` | No | — | > **expires\_after full type** > > ```ts theme={null} > { > anchor: string, > minutes: number > } > ``` *** ### delete `containers.delete` Delete a container **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.containers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `container.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### list `containers.list` List containers **Risk:** `read` ```ts theme={null} await corsair.openai.api.containers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: container, > created_at: number, > name?: string, > status?: string, > expires_after?: { > anchor: string, > minutes: number > } | null > }[] > ``` *** ### retrieve `containers.retrieve` Retrieve a container **Risk:** `read` ```ts theme={null} await corsair.openai.api.containers.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `container` | Yes | — | | `created_at` | `number` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `expires_after` | `object` | No | — | > **expires\_after full type** > > ```ts theme={null} > { > anchor: string, > minutes: number > } > ``` *** ## Conversations ### create `conversations.create` Create a conversation **Risk:** `write` ```ts theme={null} await corsair.openai.api.conversations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `metadata` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `conversation` | Yes | — | | `created_at` | `number` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### createItems `conversations.createItems` Add items to a conversation **Risk:** `write` ```ts theme={null} await corsair.openai.api.conversations.createItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversationId` | `string` | Yes | — | | `items` | `object[]` | Yes | — | | `include` | `string[]` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### delete `conversations.delete` Delete a conversation **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.conversations.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `conversation.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### deleteItem `conversations.deleteItem` Delete a conversation item **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.conversations.deleteItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversationId` | `string` | Yes | — | | `itemId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `conversation` | Yes | — | | `created_at` | `number` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### getItem `conversations.getItem` Retrieve a conversation item **Risk:** `read` ```ts theme={null} await corsair.openai.api.conversations.getItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversationId` | `string` | Yes | — | | `itemId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `string` | Yes | — | *** ### listItems `conversations.listItems` List items in a conversation **Risk:** `read` ```ts theme={null} await corsair.openai.api.conversations.listItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversationId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `include` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### update `conversations.update` Update a conversation's metadata **Risk:** `write` ```ts theme={null} await corsair.openai.api.conversations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `conversationId` | `string` | Yes | — | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `conversation` | Yes | — | | `created_at` | `number` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Embeddings ### create `embeddings.create` Create embeddings for the given input **Risk:** `write` ```ts theme={null} await corsair.openai.api.embeddings.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `string \| string[] \| number[] \| number[][]` | Yes | — | | `encodingFormat` | `float \| base64` | No | — | | `dimensions` | `number` | No | — | | `user` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `model` | `string` | Yes | — | | `usage` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > object: embedding, > embedding: number[] | string, > index: number > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > total_tokens: number > } > ``` *** ## Engines ### list `engines.list` List available engines (legacy, deprecated) **Risk:** `read` ```ts theme={null} await corsair.openai.api.engines.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: engine, > owner?: string, > ready?: boolean > }[] > ``` *** ### retrieve `engines.retrieve` Retrieve an engine by id (legacy, deprecated) **Risk:** `read` ```ts theme={null} await corsair.openai.api.engines.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `engineId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `engine` | Yes | — | | `owner` | `string` | No | — | | `ready` | `boolean` | No | — | *** ## Eval Runs ### cancel `evalRuns.cancel` Cancel an in-progress eval run **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.evalRuns.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `eval.run` | Yes | — | | `eval_id` | `string` | Yes | — | | `name` | `string` | No | — | | `created_at` | `number` | Yes | — | | `status` | `string` | Yes | — | | `model` | `string` | No | — | | `data_source` | `object` | No | — | | `metadata` | `object` | No | — | | `result_counts` | `object` | No | — | > **data\_source full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **result\_counts full type** > > ```ts theme={null} > { > } > ``` *** ### create `evalRuns.create` Create an eval run **Risk:** `write` ```ts theme={null} await corsair.openai.api.evalRuns.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | | `name` | `string` | No | — | | `dataSource` | `object` | Yes | — | | `metadata` | `object` | No | — | > **dataSource full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `eval.run` | Yes | — | | `eval_id` | `string` | Yes | — | | `name` | `string` | No | — | | `created_at` | `number` | Yes | — | | `status` | `string` | Yes | — | | `model` | `string` | No | — | | `data_source` | `object` | No | — | | `metadata` | `object` | No | — | | `result_counts` | `object` | No | — | > **data\_source full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **result\_counts full type** > > ```ts theme={null} > { > } > ``` *** ### delete `evalRuns.delete` Delete an eval run **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.evalRuns.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `eval.run.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | | `run_id` | `string` | Yes | — | *** ### get `evalRuns.get` Retrieve an eval run **Risk:** `read` ```ts theme={null} await corsair.openai.api.evalRuns.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `eval.run` | Yes | — | | `eval_id` | `string` | Yes | — | | `name` | `string` | No | — | | `created_at` | `number` | Yes | — | | `status` | `string` | Yes | — | | `model` | `string` | No | — | | `data_source` | `object` | No | — | | `metadata` | `object` | No | — | | `result_counts` | `object` | No | — | > **data\_source full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **result\_counts full type** > > ```ts theme={null} > { > } > ``` *** ### getOutputItem `evalRuns.getOutputItem` Retrieve an eval run output item **Risk:** `read` ```ts theme={null} await corsair.openai.api.evalRuns.getOutputItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | | `runId` | `string` | Yes | — | | `outputItemId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `eval.run.output_item` | Yes | — | *** ### list `evalRuns.list` List eval runs **Risk:** `read` ```ts theme={null} await corsair.openai.api.evalRuns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: eval.run, > eval_id: string, > name?: string | null, > created_at: number, > status: string, > model?: string, > data_source?: { > }, > metadata?: { > } | null, > result_counts?: { > } > }[] > ``` *** ### listOutputItems `evalRuns.listOutputItems` List output items for an eval run **Risk:** `read` ```ts theme={null} await corsair.openai.api.evalRuns.listOutputItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | | `runId` | `string` | Yes | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Evals ### create `evals.create` Create an eval **Risk:** `write` ```ts theme={null} await corsair.openai.api.evals.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `dataSourceConfig` | `object` | Yes | — | | `testingCriteria` | `object[]` | Yes | — | | `metadata` | `object` | No | — | > **dataSourceConfig full type** > > ```ts theme={null} > { > } > ``` > **testingCriteria full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `eval` | Yes | — | | `name` | `string` | No | — | | `created_at` | `number` | Yes | — | | `data_source_config` | `object` | Yes | — | | `testing_criteria` | `object[]` | Yes | — | | `metadata` | `object` | No | — | > **data\_source\_config full type** > > ```ts theme={null} > { > } > ``` > **testing\_criteria full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `evals.delete` Delete an eval **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.evals.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `eval.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | | `eval_id` | `string` | Yes | — | *** ### get `evals.get` Retrieve an eval **Risk:** `read` ```ts theme={null} await corsair.openai.api.evals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `eval` | Yes | — | | `name` | `string` | No | — | | `created_at` | `number` | Yes | — | | `data_source_config` | `object` | Yes | — | | `testing_criteria` | `object[]` | Yes | — | | `metadata` | `object` | No | — | > **data\_source\_config full type** > > ```ts theme={null} > { > } > ``` > **testing\_criteria full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `evals.list` List evals **Risk:** `read` ```ts theme={null} await corsair.openai.api.evals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `orderBy` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: eval, > name?: string | null, > created_at: number, > data_source_config: { > }, > testing_criteria: { > }[], > metadata?: { > } | null > }[] > ``` *** ### update `evals.update` Update an eval **Risk:** `write` ```ts theme={null} await corsair.openai.api.evals.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `evalId` | `string` | Yes | — | | `name` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `eval` | Yes | — | | `name` | `string` | No | — | | `created_at` | `number` | Yes | — | | `data_source_config` | `object` | Yes | — | | `testing_criteria` | `object[]` | Yes | — | | `metadata` | `object` | No | — | > **data\_source\_config full type** > > ```ts theme={null} > { > } > ``` > **testing\_criteria full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Files ### delete `files.delete` Delete a file **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `file` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### downloadContent `files.downloadContent` Download the contents of a file **Risk:** `read` ```ts theme={null} await corsair.openai.api.files.downloadContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | | `contentBase64` | `string` | Yes | — | *** ### list `files.list` List uploaded files **Risk:** `read` ```ts theme={null} await corsair.openai.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `purpose` | `assistants \| assistants_output \| batch \| batch_output \| fine-tune \| fine-tune-results \| vision \| user_data \| evals` | No | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: file, > bytes: number, > created_at: number, > expires_at?: number, > filename: string, > purpose: assistants | assistants_output | batch | batch_output | fine-tune | fine-tune-results | vision | user_data | evals > }[] > ``` *** ### retrieve `files.retrieve` Retrieve file metadata **Risk:** `read` ```ts theme={null} await corsair.openai.api.files.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `file` | Yes | — | | `bytes` | `number` | Yes | — | | `created_at` | `number` | Yes | — | | `expires_at` | `number` | No | — | | `filename` | `string` | Yes | — | | `purpose` | `assistants \| assistants_output \| batch \| batch_output \| fine-tune \| fine-tune-results \| vision \| user_data \| evals` | Yes | — | *** ### upload `files.upload` Upload a file to OpenAI **Risk:** `write` ```ts theme={null} await corsair.openai.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom \| string` | Yes | — | | `fileName` | `string` | Yes | — | | `purpose` | `assistants \| assistants_output \| batch \| batch_output \| fine-tune \| fine-tune-results \| vision \| user_data \| evals` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `file` | Yes | — | | `bytes` | `number` | Yes | — | | `created_at` | `number` | Yes | — | | `expires_at` | `number` | No | — | | `filename` | `string` | Yes | — | | `purpose` | `assistants \| assistants_output \| batch \| batch_output \| fine-tune \| fine-tune-results \| vision \| user_data \| evals` | Yes | — | *** ## Fine Tuning ### cancelJob `fineTuning.cancelJob` Cancel an in-progress fine-tuning job **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.fineTuning.cancelJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `fine_tuning.job` | Yes | — | | `created_at` | `number` | Yes | — | | `model` | `string` | Yes | — | | `fine_tuned_model` | `string` | No | — | | `status` | `validating_files \| queued \| running \| succeeded \| failed \| cancelled` | Yes | — | | `training_file` | `string` | Yes | — | | `validation_file` | `string` | No | — | | `hyperparameters` | `object` | No | — | | `result_files` | `string[]` | No | — | | `trained_tokens` | `number` | No | — | | `error` | `object` | No | — | | `metadata` | `object` | No | — | > **hyperparameters full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### createJob `fineTuning.createJob` Create a fine-tuning job **Risk:** `write` ```ts theme={null} await corsair.openai.api.fineTuning.createJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `trainingFile` | `string` | Yes | — | | `validationFile` | `string` | No | — | | `hyperparameters` | `object` | No | — | | `suffix` | `string` | No | — | | `integrations` | `object[]` | No | — | | `seed` | `number` | No | — | | `method` | `object` | No | — | | `metadata` | `object` | No | — | > **hyperparameters full type** > > ```ts theme={null} > { > } > ``` > **integrations full type** > > ```ts theme={null} > { > }[] > ``` > **method full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `fine_tuning.job` | Yes | — | | `created_at` | `number` | Yes | — | | `model` | `string` | Yes | — | | `fine_tuned_model` | `string` | No | — | | `status` | `validating_files \| queued \| running \| succeeded \| failed \| cancelled` | Yes | — | | `training_file` | `string` | Yes | — | | `validation_file` | `string` | No | — | | `hyperparameters` | `object` | No | — | | `result_files` | `string[]` | No | — | | `trained_tokens` | `number` | No | — | | `error` | `object` | No | — | | `metadata` | `object` | No | — | > **hyperparameters full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### listCheckpoints `fineTuning.listCheckpoints` List checkpoints for a fine-tuning job **Risk:** `read` ```ts theme={null} await corsair.openai.api.fineTuning.listCheckpoints({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: fine_tuning.job.checkpoint, > created_at: number, > fine_tuned_model_checkpoint: string, > step_number: number, > metrics?: { > } > }[] > ``` *** ### listEvents `fineTuning.listEvents` List events for a fine-tuning job **Risk:** `read` ```ts theme={null} await corsair.openai.api.fineTuning.listEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: fine_tuning.job.event, > created_at: number, > level: string, > message: string, > data?: { > } > }[] > ``` *** ### listJobs `fineTuning.listJobs` List fine-tuning jobs **Risk:** `read` ```ts theme={null} await corsair.openai.api.fineTuning.listJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: fine_tuning.job, > created_at: number, > model: string, > fine_tuned_model?: string | null, > status: validating_files | queued | running | succeeded | failed | cancelled, > training_file: string, > validation_file?: string | null, > hyperparameters?: { > }, > result_files?: string[], > trained_tokens?: number | null, > error?: { > code: string, > message: string > } | null, > metadata?: { > } | null > }[] > ``` *** ### retrieveJob `fineTuning.retrieveJob` Retrieve a fine-tuning job **Risk:** `read` ```ts theme={null} await corsair.openai.api.fineTuning.retrieveJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `fine_tuning.job` | Yes | — | | `created_at` | `number` | Yes | — | | `model` | `string` | Yes | — | | `fine_tuned_model` | `string` | No | — | | `status` | `validating_files \| queued \| running \| succeeded \| failed \| cancelled` | Yes | — | | `training_file` | `string` | Yes | — | | `validation_file` | `string` | No | — | | `hyperparameters` | `object` | No | — | | `result_files` | `string[]` | No | — | | `trained_tokens` | `number` | No | — | | `error` | `object` | No | — | | `metadata` | `object` | No | — | > **hyperparameters full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Graders ### run `graders.run` Run a grader against a model sample **Risk:** `read` ```ts theme={null} await corsair.openai.api.graders.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `grader` | `object` | Yes | — | | `item` | `object` | No | — | | `modelSample` | `string` | Yes | — | > **grader full type** > > ```ts theme={null} > { > } > ``` > **item full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `reward` | `number` | No | — | *** ### validate `graders.validate` Validate a grader configuration **Risk:** `read` ```ts theme={null} await corsair.openai.api.graders.validate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `grader` | `object` | Yes | — | > **grader full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `grader` | `object` | No | — | > **grader full type** > > ```ts theme={null} > { > } > ``` *** ## Images ### create `images.create` Generate images from a prompt **Risk:** `write` ```ts theme={null} await corsair.openai.api.images.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | No | — | | `prompt` | `string` | Yes | — | | `n` | `number` | No | — | | `size` | `string` | No | — | | `quality` | `string` | No | — | | `style` | `string` | No | — | | `responseFormat` | `url \| b64_json` | No | — | | `background` | `string` | No | — | | `user` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `number` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > url?: string, > b64_json?: string, > revised_prompt?: string > }[] > ``` *** ### createEdit `images.createEdit` Edit an image given a prompt and mask **Risk:** `write` ```ts theme={null} await corsair.openai.api.images.createEdit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image` | `custom \| string` | Yes | — | | `imageFileName` | `string` | Yes | — | | `mask` | `custom \| string` | No | — | | `maskFileName` | `string` | No | — | | `prompt` | `string` | Yes | — | | `model` | `string` | No | — | | `n` | `number` | No | — | | `size` | `string` | No | — | | `responseFormat` | `url \| b64_json` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `number` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > url?: string, > b64_json?: string, > revised_prompt?: string > }[] > ``` *** ### createVariation `images.createVariation` Create variations of an image **Risk:** `write` ```ts theme={null} await corsair.openai.api.images.createVariation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image` | `custom \| string` | Yes | — | | `imageFileName` | `string` | Yes | — | | `model` | `string` | No | — | | `n` | `number` | No | — | | `size` | `string` | No | — | | `responseFormat` | `url \| b64_json` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `created` | `number` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > url?: string, > b64_json?: string, > revised_prompt?: string > }[] > ``` *** ## Messages ### create `messages.create` Create a message on a thread **Risk:** `write` ```ts theme={null} await corsair.openai.api.messages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `role` | `user \| assistant` | Yes | — | | `content` | `object[]` | Yes | — | | `attachments` | `object[]` | No | — | | `metadata` | `object` | No | — | > **content full type** > > ```ts theme={null} > string | ( > { > type: text, > text: { > value: string, > annotations: { > }[] > } > } | { > type: image_file, > image_file: { > file_id: string, > detail?: auto | low | high > } > } | { > type: image_url, > image_url: { > url: string, > detail?: auto | low | high > } > } > )[] > ``` > **attachments full type** > > ```ts theme={null} > { > file_id?: string, > tools?: ( > { > type: code_interpreter > } | { > type: file_search > } > )[] > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.message` | Yes | — | | `created_at` | `number` | Yes | — | | `thread_id` | `string` | Yes | — | | `status` | `in_progress \| incomplete \| completed` | No | — | | `role` | `user \| assistant` | Yes | — | | `content` | `object[]` | Yes | — | | `assistant_id` | `string` | No | — | | `run_id` | `string` | No | — | | `attachments` | `object[]` | No | — | | `metadata` | `object` | No | — | > **content full type** > > ```ts theme={null} > ( > { > type: text, > text: { > value: string, > annotations: { > }[] > } > } | { > type: image_file, > image_file: { > file_id: string, > detail?: auto | low | high > } > } | { > type: image_url, > image_url: { > url: string, > detail?: auto | low | high > } > } > )[] > ``` > **attachments full type** > > ```ts theme={null} > { > file_id?: string, > tools?: ( > { > type: code_interpreter > } | { > type: file_search > } > )[] > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `messages.delete` Delete a message **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.message.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### list `messages.list` List messages on a thread **Risk:** `read` ```ts theme={null} await corsair.openai.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `runId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: thread.message, > created_at: number, > thread_id: string, > status?: in_progress | incomplete | completed, > role: user | assistant, > content: ( > { > type: text, > text: { > value: string, > annotations: { > }[] > } > } | { > type: image_file, > image_file: { > file_id: string, > detail?: auto | low | high > } > } | { > type: image_url, > image_url: { > url: string, > detail?: auto | low | high > } > } > )[], > assistant_id?: string | null, > run_id?: string | null, > attachments?: { > file_id?: string, > tools?: ( > { > type: code_interpreter > } | { > type: file_search > } > )[] > }[] | null, > metadata?: { > } | null > }[] > ``` *** ### modify `messages.modify` Modify a message **Risk:** `write` ```ts theme={null} await corsair.openai.api.messages.modify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.message` | Yes | — | | `created_at` | `number` | Yes | — | | `thread_id` | `string` | Yes | — | | `status` | `in_progress \| incomplete \| completed` | No | — | | `role` | `user \| assistant` | Yes | — | | `content` | `object[]` | Yes | — | | `assistant_id` | `string` | No | — | | `run_id` | `string` | No | — | | `attachments` | `object[]` | No | — | | `metadata` | `object` | No | — | > **content full type** > > ```ts theme={null} > ( > { > type: text, > text: { > value: string, > annotations: { > }[] > } > } | { > type: image_file, > image_file: { > file_id: string, > detail?: auto | low | high > } > } | { > type: image_url, > image_url: { > url: string, > detail?: auto | low | high > } > } > )[] > ``` > **attachments full type** > > ```ts theme={null} > { > file_id?: string, > tools?: ( > { > type: code_interpreter > } | { > type: file_search > } > )[] > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### retrieve `messages.retrieve` Retrieve a message **Risk:** `read` ```ts theme={null} await corsair.openai.api.messages.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.message` | Yes | — | | `created_at` | `number` | Yes | — | | `thread_id` | `string` | Yes | — | | `status` | `in_progress \| incomplete \| completed` | No | — | | `role` | `user \| assistant` | Yes | — | | `content` | `object[]` | Yes | — | | `assistant_id` | `string` | No | — | | `run_id` | `string` | No | — | | `attachments` | `object[]` | No | — | | `metadata` | `object` | No | — | > **content full type** > > ```ts theme={null} > ( > { > type: text, > text: { > value: string, > annotations: { > }[] > } > } | { > type: image_file, > image_file: { > file_id: string, > detail?: auto | low | high > } > } | { > type: image_url, > image_url: { > url: string, > detail?: auto | low | high > } > } > )[] > ``` > **attachments full type** > > ```ts theme={null} > { > file_id?: string, > tools?: ( > { > type: code_interpreter > } | { > type: file_search > } > )[] > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Models ### list `models.list` List available models **Risk:** `read` ```ts theme={null} await corsair.openai.api.models.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: model, > created: number, > owned_by: string > }[] > ``` *** ### retrieve `models.retrieve` Retrieve a model by id **Risk:** `read` ```ts theme={null} await corsair.openai.api.models.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `model` | Yes | — | | `created` | `number` | Yes | — | | `owned_by` | `string` | Yes | — | *** ## Moderation ### create `moderation.create` Classify text/image input against usage policies **Risk:** `read` ```ts theme={null} await corsair.openai.api.moderation.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object[]` | Yes | — | | `model` | `string` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `model` | `string` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > flagged: boolean, > categories: { > }, > category_scores: { > }, > category_applied_input_types?: { > } > }[] > ``` *** ## Realtime ### createCall `realtime.createCall` Create a realtime call **Risk:** `write` ```ts theme={null} await corsair.openai.api.realtime.createCall({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sdp` | `string` | No | — | | `session` | `object` | Yes | — | > **session full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `sdp` | `string` | No | — | *** ### createClientSecret `realtime.createClientSecret` Create an ephemeral client secret for the Realtime API **Risk:** `write` ```ts theme={null} await corsair.openai.api.realtime.createClientSecret({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session` | `object` | No | — | | `expiresAfter` | `object` | No | — | > **session full type** > > ```ts theme={null} > { > } > ``` > **expiresAfter full type** > > ```ts theme={null} > { > anchor: string, > seconds: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `string` | Yes | — | | `expires_at` | `number` | Yes | — | *** ### createSession `realtime.createSession` Create a realtime session **Risk:** `write` ```ts theme={null} await corsair.openai.api.realtime.createSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | No | — | | `voice` | `string` | No | — | | `modalities` | `string[]` | No | — | | `instructions` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ### createTranscriptionSession `realtime.createTranscriptionSession` Create a realtime transcription session **Risk:** `write` ```ts theme={null} await corsair.openai.api.realtime.createTranscriptionSession({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `inputAudioFormat` | `string` | No | — | | `inputAudioTranscription` | `object` | No | — | > **inputAudioTranscription full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ## Responses ### cancel `responses.cancel` Cancel an in-progress background response **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.responses.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `response` | Yes | — | | `created_at` | `number` | Yes | — | | `status` | `completed \| failed \| in_progress \| cancelled \| queued \| incomplete` | Yes | — | | `model` | `string` | Yes | — | | `output` | `object[]` | Yes | — | | `previous_response_id` | `string` | No | — | | `usage` | `object` | No | — | > **output full type** > > ```ts theme={null} > { > }[] > ``` > **usage full type** > > ```ts theme={null} > { > input_tokens: number, > output_tokens: number, > total_tokens: number > } > ``` *** ### compact `responses.compact` Compact response input to reduce token usage **Risk:** `write` ```ts theme={null} await corsair.openai.api.responses.compact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `object[]` | Yes | — | > **input full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `response.compaction` | Yes | — | | `created_at` | `number` | Yes | — | | `output` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **output full type** > > ```ts theme={null} > { > }[] > ``` > **usage full type** > > ```ts theme={null} > { > input_tokens: number, > output_tokens: number, > total_tokens: number > } > ``` *** ### create `responses.create` Create a model response via the Responses API **Risk:** `write` ```ts theme={null} await corsair.openai.api.responses.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `object[]` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | No | — | | `toolChoice` | `object` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `maxOutputTokens` | `number` | No | — | | `previousResponseId` | `string` | No | — | | `store` | `boolean` | No | — | | `metadata` | `object` | No | — | | `truncation` | `auto \| disabled` | No | — | | `parallelToolCalls` | `boolean` | No | — | | `background` | `boolean` | No | — | | `reasoning` | `object` | No | — | > **input full type** > > ```ts theme={null} > string | { > }[] > ``` > **tools full type** > > ```ts theme={null} > { > }[] > ``` > **toolChoice full type** > > ```ts theme={null} > none | auto | required | { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **reasoning full type** > > ```ts theme={null} > { > effort?: minimal | low | medium | high > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `response` | Yes | — | | `created_at` | `number` | Yes | — | | `status` | `completed \| failed \| in_progress \| cancelled \| queued \| incomplete` | Yes | — | | `model` | `string` | Yes | — | | `output` | `object[]` | Yes | — | | `previous_response_id` | `string` | No | — | | `usage` | `object` | No | — | > **output full type** > > ```ts theme={null} > { > }[] > ``` > **usage full type** > > ```ts theme={null} > { > input_tokens: number, > output_tokens: number, > total_tokens: number > } > ``` *** ### delete `responses.delete` Delete a stored model response **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.responses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `response.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### listInputItems `responses.listInputItems` List input items for a response **Risk:** `read` ```ts theme={null} await corsair.openai.api.responses.listInputItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### retrieve `responses.retrieve` Retrieve a model response **Risk:** `read` ```ts theme={null} await corsair.openai.api.responses.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `response` | Yes | — | | `created_at` | `number` | Yes | — | | `status` | `completed \| failed \| in_progress \| cancelled \| queued \| incomplete` | Yes | — | | `model` | `string` | Yes | — | | `output` | `object[]` | Yes | — | | `previous_response_id` | `string` | No | — | | `usage` | `object` | No | — | > **output full type** > > ```ts theme={null} > { > }[] > ``` > **usage full type** > > ```ts theme={null} > { > input_tokens: number, > output_tokens: number, > total_tokens: number > } > ``` *** ## Runs ### cancel `runs.cancel` Cancel an in-progress run **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.runs.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.run` | Yes | — | | `created_at` | `number` | Yes | — | | `thread_id` | `string` | Yes | — | | `assistant_id` | `string` | Yes | — | | `status` | `queued \| in_progress \| requires_action \| cancelling \| cancelled \| failed \| completed \| incomplete \| expired` | Yes | — | | `required_action` | `object` | No | — | | `last_error` | `object` | No | — | | `model` | `string` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `usage` | `object` | No | — | > **required\_action full type** > > ```ts theme={null} > { > } > ``` > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ### create `runs.create` Create a run on a thread **Risk:** `write` ```ts theme={null} await corsair.openai.api.runs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `assistantId` | `string` | Yes | — | | `model` | `string` | No | — | | `instructions` | `string` | No | — | | `additionalInstructions` | `string` | No | — | | `tools` | `object[]` | No | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `maxPromptTokens` | `number` | No | — | | `maxCompletionTokens` | `number` | No | — | | `truncationStrategy` | `object` | No | — | | `toolChoice` | `object` | No | — | | `parallelToolCalls` | `boolean` | No | — | > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **truncationStrategy full type** > > ```ts theme={null} > { > type: auto | last_messages, > last_messages?: number | null > } > ``` > **toolChoice full type** > > ```ts theme={null} > none | auto | required | { > type: function | code_interpreter | file_search, > function?: { > name: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.run` | Yes | — | | `created_at` | `number` | Yes | — | | `thread_id` | `string` | Yes | — | | `assistant_id` | `string` | Yes | — | | `status` | `queued \| in_progress \| requires_action \| cancelling \| cancelled \| failed \| completed \| incomplete \| expired` | Yes | — | | `required_action` | `object` | No | — | | `last_error` | `object` | No | — | | `model` | `string` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `usage` | `object` | No | — | > **required\_action full type** > > ```ts theme={null} > { > } > ``` > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ### list `runs.list` List runs on a thread **Risk:** `read` ```ts theme={null} await corsair.openai.api.runs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: thread.run, > created_at: number, > thread_id: string, > assistant_id: string, > status: queued | in_progress | requires_action | cancelling | cancelled | failed | completed | incomplete | expired, > required_action?: { > } | null, > last_error?: { > code: string, > message: string > } | null, > model: string, > instructions?: string | null, > tools: ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[], > metadata?: { > } | null, > usage?: { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } | null > }[] > ``` *** ### modify `runs.modify` Modify a run **Risk:** `write` ```ts theme={null} await corsair.openai.api.runs.modify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.run` | Yes | — | | `created_at` | `number` | Yes | — | | `thread_id` | `string` | Yes | — | | `assistant_id` | `string` | Yes | — | | `status` | `queued \| in_progress \| requires_action \| cancelling \| cancelled \| failed \| completed \| incomplete \| expired` | Yes | — | | `required_action` | `object` | No | — | | `last_error` | `object` | No | — | | `model` | `string` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `usage` | `object` | No | — | > **required\_action full type** > > ```ts theme={null} > { > } > ``` > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ### retrieve `runs.retrieve` Retrieve a run **Risk:** `read` ```ts theme={null} await corsair.openai.api.runs.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.run` | Yes | — | | `created_at` | `number` | Yes | — | | `thread_id` | `string` | Yes | — | | `assistant_id` | `string` | Yes | — | | `status` | `queued \| in_progress \| requires_action \| cancelling \| cancelled \| failed \| completed \| incomplete \| expired` | Yes | — | | `required_action` | `object` | No | — | | `last_error` | `object` | No | — | | `model` | `string` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `usage` | `object` | No | — | > **required\_action full type** > > ```ts theme={null} > { > } > ``` > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ### submitToolOutputs `runs.submitToolOutputs` Submit tool outputs to a run awaiting action **Risk:** `write` ```ts theme={null} await corsair.openai.api.runs.submitToolOutputs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | | `toolOutputs` | `object[]` | Yes | — | > **toolOutputs full type** > > ```ts theme={null} > { > toolCallId?: string, > output?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.run` | Yes | — | | `created_at` | `number` | Yes | — | | `thread_id` | `string` | Yes | — | | `assistant_id` | `string` | Yes | — | | `status` | `queued \| in_progress \| requires_action \| cancelling \| cancelled \| failed \| completed \| incomplete \| expired` | Yes | — | | `required_action` | `object` | No | — | | `last_error` | `object` | No | — | | `model` | `string` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `usage` | `object` | No | — | > **required\_action full type** > > ```ts theme={null} > { > } > ``` > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ## Run Steps ### list `runSteps.list` List steps of a run **Risk:** `read` ```ts theme={null} await corsair.openai.api.runSteps.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: thread.run.step, > created_at: number, > run_id: string, > assistant_id: string, > thread_id: string, > type: message_creation | tool_calls, > status: in_progress | cancelled | failed | completed | expired, > step_details: { > }, > last_error?: { > code: string, > message: string > } | null, > usage?: { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } | null > }[] > ``` *** ### retrieve `runSteps.retrieve` Retrieve a run step **Risk:** `read` ```ts theme={null} await corsair.openai.api.runSteps.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `runId` | `string` | Yes | — | | `stepId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.run.step` | Yes | — | | `created_at` | `number` | Yes | — | | `run_id` | `string` | Yes | — | | `assistant_id` | `string` | Yes | — | | `thread_id` | `string` | Yes | — | | `type` | `message_creation \| tool_calls` | Yes | — | | `status` | `in_progress \| cancelled \| failed \| completed \| expired` | Yes | — | | `step_details` | `object` | Yes | — | | `last_error` | `object` | No | — | | `usage` | `object` | No | — | > **step\_details full type** > > ```ts theme={null} > { > } > ``` > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ## Skills ### create `skills.create` Upload a skill **Risk:** `write` ```ts theme={null} await corsair.openai.api.skills.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom \| string` | Yes | — | | `fileName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `skill` | No | — | | `created_at` | `number` | No | — | | `default_version` | `number` | No | — | | `latest_version` | `number` | No | — | | `description` | `string` | No | — | | `name` | `string` | No | — | *** ### delete `skills.delete` Delete a skill **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.skills.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `skillId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `skill.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### list `skills.list` List skills **Risk:** `read` ```ts theme={null} await corsair.openai.api.skills.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Threads ### create `threads.create` Create a thread **Risk:** `write` ```ts theme={null} await corsair.openai.api.threads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | No | — | | `toolResources` | `object` | No | — | | `metadata` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > role: user | assistant, > content: string, > metadata?: { > } | null > }[] > ``` > **toolResources full type** > > ```ts theme={null} > { > code_interpreter?: { > file_ids: string[] > }, > file_search?: { > vector_store_ids: string[] > } > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread` | Yes | — | | `created_at` | `number` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### createAndRun `threads.createAndRun` Create a thread and run it in one call **Risk:** `write` ```ts theme={null} await corsair.openai.api.threads.createAndRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantId` | `string` | Yes | — | | `thread` | `object` | No | — | | `model` | `string` | No | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | No | — | | `toolResources` | `object` | No | — | | `metadata` | `object` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `truncationStrategy` | `object` | No | — | | `toolChoice` | `object` | No | — | | `parallelToolCalls` | `boolean` | No | — | > **thread full type** > > ```ts theme={null} > { > messages?: { > role: user | assistant, > content: string, > metadata?: { > } | null > }[], > toolResources?: { > code_interpreter?: { > file_ids: string[] > }, > file_search?: { > vector_store_ids: string[] > } > }, > metadata?: { > } | null > } > ``` > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **toolResources full type** > > ```ts theme={null} > { > code_interpreter?: { > file_ids: string[] > }, > file_search?: { > vector_store_ids: string[] > } > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **truncationStrategy full type** > > ```ts theme={null} > { > type: auto | last_messages, > last_messages?: number | null > } > ``` > **toolChoice full type** > > ```ts theme={null} > none | auto | required | { > type: function | code_interpreter | file_search, > function?: { > name: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.run` | Yes | — | | `created_at` | `number` | Yes | — | | `thread_id` | `string` | Yes | — | | `assistant_id` | `string` | Yes | — | | `status` | `queued \| in_progress \| requires_action \| cancelling \| cancelled \| failed \| completed \| incomplete \| expired` | Yes | — | | `required_action` | `object` | No | — | | `last_error` | `object` | No | — | | `model` | `string` | Yes | — | | `instructions` | `string` | No | — | | `tools` | `object[]` | Yes | — | | `metadata` | `object` | No | — | | `usage` | `object` | No | — | > **required\_action full type** > > ```ts theme={null} > { > } > ``` > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **tools full type** > > ```ts theme={null} > ( > { > type: code_interpreter > } | { > type: file_search, > file_search?: { > max_num_results?: number, > ranking_options?: { > ranker?: string, > score_threshold?: number > } > } > } | { > type: function, > function: { > name: string, > description?: string, > parameters?: { > }, > strict?: boolean | null > } > } > )[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** ### delete `threads.delete` Delete a thread **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.threads.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### modify `threads.modify` Modify a thread **Risk:** `write` ```ts theme={null} await corsair.openai.api.threads.modify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `toolResources` | `object` | No | — | | `metadata` | `object` | No | — | > **toolResources full type** > > ```ts theme={null} > { > code_interpreter?: { > file_ids: string[] > }, > file_search?: { > vector_store_ids: string[] > } > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread` | Yes | — | | `created_at` | `number` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### retrieve `threads.retrieve` Retrieve a thread by id **Risk:** `read` ```ts theme={null} await corsair.openai.api.threads.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `thread` | Yes | — | | `created_at` | `number` | Yes | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Tokens ### countInput `tokens.countInput` Count input tokens for a prospective request **Risk:** `read` ```ts theme={null} await corsair.openai.api.tokens.countInput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `object[]` | Yes | — | | `tools` | `object[]` | No | — | > **input full type** > > ```ts theme={null} > string | { > }[] > ``` > **tools full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `input_tokens` | `number` | Yes | — | *** ## Uploads ### addPart `uploads.addPart` Add a part of file data to an upload **Risk:** `write` ```ts theme={null} await corsair.openai.api.uploads.addPart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uploadId` | `string` | Yes | — | | `data` | `custom \| string` | Yes | — | | `fileName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `upload.part` | Yes | — | | `created_at` | `number` | Yes | — | | `upload_id` | `string` | Yes | — | *** ### cancel `uploads.cancel` Cancel an in-progress upload session **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.uploads.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uploadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `upload` | Yes | — | | `bytes` | `number` | Yes | — | | `created_at` | `number` | Yes | — | | `filename` | `string` | Yes | — | | `purpose` | `string` | Yes | — | | `status` | `pending \| completed \| cancelled \| expired` | Yes | — | | `expires_at` | `number` | Yes | — | | `file` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > object: file, > bytes: number, > created_at: number, > filename: string, > purpose: string > } > ``` *** ### complete `uploads.complete` Complete a multipart upload session **Risk:** `write` ```ts theme={null} await corsair.openai.api.uploads.complete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uploadId` | `string` | Yes | — | | `partIds` | `string[]` | Yes | — | | `md5` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `upload` | Yes | — | | `bytes` | `number` | Yes | — | | `created_at` | `number` | Yes | — | | `filename` | `string` | Yes | — | | `purpose` | `string` | Yes | — | | `status` | `pending \| completed \| cancelled \| expired` | Yes | — | | `expires_at` | `number` | Yes | — | | `file` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > object: file, > bytes: number, > created_at: number, > filename: string, > purpose: string > } > ``` *** ### create `uploads.create` Create a multipart upload session **Risk:** `write` ```ts theme={null} await corsair.openai.api.uploads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | Yes | — | | `purpose` | `assistants \| assistants_output \| batch \| batch_output \| fine-tune \| fine-tune-results \| vision \| user_data \| evals` | Yes | — | | `bytes` | `number` | Yes | — | | `mimeType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `upload` | Yes | — | | `bytes` | `number` | Yes | — | | `created_at` | `number` | Yes | — | | `filename` | `string` | Yes | — | | `purpose` | `string` | Yes | — | | `status` | `pending \| completed \| cancelled \| expired` | Yes | — | | `expires_at` | `number` | Yes | — | | `file` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > object: file, > bytes: number, > created_at: number, > filename: string, > purpose: string > } > ``` *** ## Vector Store File Batches ### create `vectorStoreFileBatches.create` Attach a batch of files to a vector store **Risk:** `write` ```ts theme={null} await corsair.openai.api.vectorStoreFileBatches.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `fileIds` | `string[]` | Yes | — | | `chunkingStrategy` | `object` | No | — | | `attributes` | `object` | No | — | > **chunkingStrategy full type** > > ```ts theme={null} > { > type: auto > } | { > type: static, > static: { > max_chunk_size_tokens: number, > chunk_overlap_tokens: number > } > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store.file_batch` | Yes | — | | `created_at` | `number` | Yes | — | | `vector_store_id` | `string` | Yes | — | | `status` | `in_progress \| completed \| cancelled \| failed` | Yes | — | | `file_counts` | `object` | Yes | — | > **file\_counts full type** > > ```ts theme={null} > { > in_progress: number, > completed: number, > failed: number, > cancelled: number, > total: number > } > ``` *** ### listFiles `vectorStoreFileBatches.listFiles` List files in a vector store file batch **Risk:** `read` ```ts theme={null} await corsair.openai.api.vectorStoreFileBatches.listFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `batchId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `filter` | `in_progress \| completed \| cancelled \| failed` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: vector_store.file, > usage_bytes: number, > created_at: number, > vector_store_id: string, > status: in_progress | completed | cancelled | failed, > last_error?: { > code: string, > message: string > } | null, > attributes?: { > } | null > }[] > ``` *** ### retrieve `vectorStoreFileBatches.retrieve` Retrieve a vector store file batch **Risk:** `read` ```ts theme={null} await corsair.openai.api.vectorStoreFileBatches.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `batchId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store.file_batch` | Yes | — | | `created_at` | `number` | Yes | — | | `vector_store_id` | `string` | Yes | — | | `status` | `in_progress \| completed \| cancelled \| failed` | Yes | — | | `file_counts` | `object` | Yes | — | > **file\_counts full type** > > ```ts theme={null} > { > in_progress: number, > completed: number, > failed: number, > cancelled: number, > total: number > } > ``` *** ## Vector Store Files ### create `vectorStoreFiles.create` Attach a file to a vector store **Risk:** `write` ```ts theme={null} await corsair.openai.api.vectorStoreFiles.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | | `chunkingStrategy` | `object` | No | — | | `attributes` | `object` | No | — | > **chunkingStrategy full type** > > ```ts theme={null} > { > type: auto > } | { > type: static, > static: { > max_chunk_size_tokens: number, > chunk_overlap_tokens: number > } > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store.file` | Yes | — | | `usage_bytes` | `number` | Yes | — | | `created_at` | `number` | Yes | — | | `vector_store_id` | `string` | Yes | — | | `status` | `in_progress \| completed \| cancelled \| failed` | Yes | — | | `last_error` | `object` | No | — | | `attributes` | `object` | No | — | > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` *** ### delete `vectorStoreFiles.delete` Detach a file from a vector store **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.vectorStoreFiles.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store.file.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### list `vectorStoreFiles.list` List files attached to a vector store **Risk:** `read` ```ts theme={null} await corsair.openai.api.vectorStoreFiles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `filter` | `in_progress \| completed \| cancelled \| failed` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: vector_store.file, > usage_bytes: number, > created_at: number, > vector_store_id: string, > status: in_progress | completed | cancelled | failed, > last_error?: { > code: string, > message: string > } | null, > attributes?: { > } | null > }[] > ``` *** ### retrieve `vectorStoreFiles.retrieve` Retrieve a vector store file **Risk:** `read` ```ts theme={null} await corsair.openai.api.vectorStoreFiles.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store.file` | Yes | — | | `usage_bytes` | `number` | Yes | — | | `created_at` | `number` | Yes | — | | `vector_store_id` | `string` | Yes | — | | `status` | `in_progress \| completed \| cancelled \| failed` | Yes | — | | `last_error` | `object` | No | — | | `attributes` | `object` | No | — | > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` *** ### retrieveContent `vectorStoreFiles.retrieveContent` Retrieve the parsed content of a vector store file **Risk:** `read` ```ts theme={null} await corsair.openai.api.vectorStoreFiles.retrieveContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `vector_store.file_content.page` | Yes | — | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_page` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > type: text, > text: string > }[] > ``` *** ### updateAttributes `vectorStoreFiles.updateAttributes` Update attributes on a vector store file **Risk:** `write` ```ts theme={null} await corsair.openai.api.vectorStoreFiles.updateAttributes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `fileId` | `string` | Yes | — | | `attributes` | `object` | No | — | > **attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store.file` | Yes | — | | `usage_bytes` | `number` | Yes | — | | `created_at` | `number` | Yes | — | | `vector_store_id` | `string` | Yes | — | | `status` | `in_progress \| completed \| cancelled \| failed` | Yes | — | | `last_error` | `object` | No | — | | `attributes` | `object` | No | — | > **last\_error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` > **attributes full type** > > ```ts theme={null} > { > } > ``` *** ## Vector Stores ### create `vectorStores.create` Create a vector store **Risk:** `write` ```ts theme={null} await corsair.openai.api.vectorStores.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `fileIds` | `string[]` | No | — | | `expiresAfter` | `object` | No | — | | `chunkingStrategy` | `object` | No | — | | `metadata` | `object` | No | — | > **expiresAfter full type** > > ```ts theme={null} > { > anchor: last_active_at, > days: number > } > ``` > **chunkingStrategy full type** > > ```ts theme={null} > { > type: auto > } | { > type: static, > static: { > max_chunk_size_tokens: number, > chunk_overlap_tokens: number > } > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store` | Yes | — | | `created_at` | `number` | Yes | — | | `name` | `string` | No | — | | `usage_bytes` | `number` | Yes | — | | `file_counts` | `object` | Yes | — | | `status` | `expired \| in_progress \| completed` | Yes | — | | `expires_after` | `object` | No | — | | `expires_at` | `number` | No | — | | `last_active_at` | `number` | No | — | | `metadata` | `object` | No | — | > **file\_counts full type** > > ```ts theme={null} > { > in_progress: number, > completed: number, > failed: number, > cancelled: number, > total: number > } > ``` > **expires\_after full type** > > ```ts theme={null} > { > anchor: last_active_at, > days: number > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `vectorStores.delete` Delete a vector store **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.vectorStores.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### list `vectorStores.list` List vector stores **Risk:** `read` ```ts theme={null} await corsair.openai.api.vectorStores.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: vector_store, > created_at: number, > name?: string | null, > usage_bytes: number, > file_counts: { > in_progress: number, > completed: number, > failed: number, > cancelled: number, > total: number > }, > status: expired | in_progress | completed, > expires_after?: { > anchor: last_active_at, > days: number > }, > expires_at?: number | null, > last_active_at?: number | null, > metadata?: { > } | null > }[] > ``` *** ### modify `vectorStores.modify` Modify a vector store **Risk:** `write` ```ts theme={null} await corsair.openai.api.vectorStores.modify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `name` | `string` | No | — | | `expiresAfter` | `object` | No | — | | `metadata` | `object` | No | — | > **expiresAfter full type** > > ```ts theme={null} > { > anchor: last_active_at, > days: number > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store` | Yes | — | | `created_at` | `number` | Yes | — | | `name` | `string` | No | — | | `usage_bytes` | `number` | Yes | — | | `file_counts` | `object` | Yes | — | | `status` | `expired \| in_progress \| completed` | Yes | — | | `expires_after` | `object` | No | — | | `expires_at` | `number` | No | — | | `last_active_at` | `number` | No | — | | `metadata` | `object` | No | — | > **file\_counts full type** > > ```ts theme={null} > { > in_progress: number, > completed: number, > failed: number, > cancelled: number, > total: number > } > ``` > **expires\_after full type** > > ```ts theme={null} > { > anchor: last_active_at, > days: number > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### retrieve `vectorStores.retrieve` Retrieve a vector store **Risk:** `read` ```ts theme={null} await corsair.openai.api.vectorStores.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `vector_store` | Yes | — | | `created_at` | `number` | Yes | — | | `name` | `string` | No | — | | `usage_bytes` | `number` | Yes | — | | `file_counts` | `object` | Yes | — | | `status` | `expired \| in_progress \| completed` | Yes | — | | `expires_after` | `object` | No | — | | `expires_at` | `number` | No | — | | `last_active_at` | `number` | No | — | | `metadata` | `object` | No | — | > **file\_counts full type** > > ```ts theme={null} > { > in_progress: number, > completed: number, > failed: number, > cancelled: number, > total: number > } > ``` > **expires\_after full type** > > ```ts theme={null} > { > anchor: last_active_at, > days: number > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### search `vectorStores.search` Search a vector store for relevant chunks **Risk:** `read` ```ts theme={null} await corsair.openai.api.vectorStores.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `vectorStoreId` | `string` | Yes | — | | `query` | `string \| string[]` | Yes | — | | `filters` | `object` | No | — | | `maxNumResults` | `number` | No | — | | `rankingOptions` | `object` | No | — | | `rewriteQuery` | `boolean` | No | — | > **filters full type** > > ```ts theme={null} > { > } > ``` > **rankingOptions full type** > > ```ts theme={null} > { > ranker?: string, > score_threshold?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `vector_store.search_results.page` | Yes | — | | `search_query` | `string[]` | Yes | — | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | | `next_page` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > file_id: string, > filename: string, > score: number, > attributes?: { > } | null, > content: { > type: text, > text: string > }[] > }[] > ``` *** ## Videos ### create `videos.create` Generate a video from a prompt **Risk:** `write` ```ts theme={null} await corsair.openai.api.videos.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `prompt` | `string` | Yes | — | | `model` | `string` | No | — | | `size` | `string` | No | — | | `seconds` | `string` | No | — | | `inputReference` | `custom \| string` | No | — | | `inputReferenceFileName` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `video` | Yes | — | | `created_at` | `number` | Yes | — | | `status` | `queued \| in_progress \| completed \| failed` | Yes | — | | `model` | `string` | No | — | | `progress` | `number` | No | — | | `seconds` | `string` | No | — | | `size` | `string` | No | — | | `remixed_from_video_id` | `string` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` *** ### createRemix `videos.createRemix` Create a remix of an existing video **Risk:** `write` ```ts theme={null} await corsair.openai.api.videos.createRemix({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | — | | `prompt` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `video` | Yes | — | | `created_at` | `number` | Yes | — | | `status` | `queued \| in_progress \| completed \| failed` | Yes | — | | `model` | `string` | No | — | | `progress` | `number` | No | — | | `seconds` | `string` | No | — | | `size` | `string` | No | — | | `remixed_from_video_id` | `string` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` *** ### delete `videos.delete` Delete a video **Risk:** `destructive` ```ts theme={null} await corsair.openai.api.videos.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `video.deleted` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### download `videos.download` Download the rendered content of a video **Risk:** `read` ```ts theme={null} await corsair.openai.api.videos.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | — | | `contentBase64` | `string` | Yes | — | *** ### list `videos.list` List generated videos **Risk:** `read` ```ts theme={null} await corsair.openai.api.videos.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | | `has_more` | `boolean` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: video, > created_at: number, > status: queued | in_progress | completed | failed, > model?: string, > progress?: number, > seconds?: string, > size?: string, > remixed_from_video_id?: string | null, > error?: { > code: string, > message: string > } | null > }[] > ``` *** ### retrieve `videos.retrieve` Retrieve a video **Risk:** `read` ```ts theme={null} await corsair.openai.api.videos.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `video` | Yes | — | | `created_at` | `number` | Yes | — | | `status` | `queued \| in_progress \| completed \| failed` | Yes | — | | `model` | `string` | No | — | | `progress` | `number` | No | — | | `seconds` | `string` | No | — | | `size` | `string` | No | — | | `remixed_from_video_id` | `string` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/openai/database OpenAI local sync: searchable entities, `.search()` filters, and operators. The OpenAI plugin syncs data locally. Use `corsair.openai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Assistants Path: `openai.db.assistants.search` ```ts theme={null} const rows = await corsair.openai.db.assistants.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Threads Path: `openai.db.threads.search` ```ts theme={null} const rows = await corsair.openai.db.threads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Vector Stores Path: `openai.db.vectorStores.search` ```ts theme={null} const rows = await corsair.openai.db.vectorStores.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `usageBytes` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/openai/overview AI platform API for GPT chat completions, embeddings, images, and assistant workflows. Use **OpenAI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 129 typed API operations * 3 synced entities (`assistants`, `threads`, `vectorStores`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/openai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/openai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/openai ``` ```bash bun theme={null} bun add corsair @corsair-dev/openai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { openai } from '@corsair-dev/openai'; export const corsair = createCorsair({ plugins: [ openai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} openai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'openai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`assistants.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.openai.api.assistants.list({}); ``` **`assistants.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.openai.api.assistants.create({}); ``` See the full list on the [API](/plugins/openai/api) page. ## Query synced data Synced entities support `tenant.openai.db..search()` and `.list()`: `assistants`, `threads`, `vectorStores`. See [Database](/plugins/openai/database) for filters and operators. ## What's next > **[API reference](/plugins/openai/api)** > > Every `openai.api.*` operation with input and output types. > **[Database](/plugins/openai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/openrouter/api API reference for OpenRouter: every `openrouter.api.*` operation with input and output types. Every `openrouter.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chat Completions ### create `chatCompletions.create` Generate an AI response via OpenRouter with automatic multi-provider routing, retries, and fallbacks; supports tool calling, structured output, reasoning, and provider/route overrides **Risk:** `write` ```ts theme={null} await corsair.openrouter.api.chatCompletions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `stream` | `false` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `maxTokens` | `number` | No | — | | `maxCompletionTokens` | `number` | No | — | | `n` | `number` | No | — | | `stop` | `string \| string[]` | No | — | | `presencePenalty` | `number` | No | — | | `frequencyPenalty` | `number` | No | — | | `logitBias` | `object` | No | — | | `user` | `string` | No | — | | `responseFormat` | `object` | No | — | | `tools` | `object[]` | No | — | | `toolChoice` | `object` | No | — | | `reasoning` | `object` | No | — | | `transforms` | `string[]` | No | — | | `models` | `string[]` | No | — | | `route` | `string` | No | — | | `provider` | `object` | No | — | | `plugins` | `object[]` | No | — | > **messages full type** > > ```ts theme={null} > ( > { > role: system, > content: string > } | { > role: assistant, > content?: string | ( > { > type: text, > text: string > } | { > type: image_url, > image_url: { > url: string, > detail?: string > } > } | { > type: input_audio, > input_audio: { > data: string, > format: string > } > } > )[] | null, > tool_calls?: { > id: string, > type: function, > function: { > name: string, > arguments: string > } > }[] > } | { > role: user, > content: string | ( > { > type: text, > text: string > } | { > type: image_url, > image_url: { > url: string, > detail?: string > } > } | { > type: input_audio, > input_audio: { > data: string, > format: string > } > } > )[] > } | { > role: tool, > tool_call_id: string, > content: string | ( > { > type: text, > text: string > } | { > type: image_url, > image_url: { > url: string, > detail?: string > } > } | { > type: input_audio, > input_audio: { > data: string, > format: string > } > } > )[] > } > )[] > ``` > **logitBias full type** > > ```ts theme={null} > { > } > ``` > **responseFormat full type** > > ```ts theme={null} > { > type: text | json_object | json_schema, > json_schema?: { > name: string, > strict?: boolean, > schema?: { > } > } > } > ``` > **tools full type** > > ```ts theme={null} > { > type: function, > function: { > name: string, > description?: string, > parameters?: { > } > } > }[] > ``` > **toolChoice full type** > > ```ts theme={null} > string | { > type: function, > function: { > name: string > } > } > ``` > **reasoning full type** > > ```ts theme={null} > { > effort?: none | minimal | low | medium | high | xhigh | max, > summary?: auto | concise | detailed | null > } > ``` > **provider full type** > > ```ts theme={null} > { > order?: string[], > allow_fallbacks?: boolean, > ignore?: string[], > require_parameters?: boolean, > data_collection?: string, > zdr?: boolean > } > ``` > **plugins full type** > > ```ts theme={null} > { > name: string, > max_tokens?: number, > num_images_per_prompt?: number, > image_format?: string, > num_prompts?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `chat.completion` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | | `choices` | `object[]` | Yes | — | | `usage` | `object` | No | — | | `provider` | `string` | No | — | | `models` | `string[]` | No | — | | `native_tool_calls` | `any[]` | No | — | > **choices full type** > > ```ts theme={null} > { > index: number, > message: { > role: assistant, > content?: string | null, > tool_calls?: { > id: string, > type: function, > function: { > name: string, > arguments: string > } > }[], > reasoning?: string | null, > reasoning_details?: { > }[] > }, > finish_reason?: string | null > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number, > prompt_tokens_details?: { > cached_tokens?: number, > cache_write_tokens?: number, > audio_tokens?: number, > video_tokens?: number > }, > completion_tokens_details?: { > reasoning_tokens?: number, > audio_tokens?: number, > image_tokens?: number > }, > cost?: number, > is_byok?: boolean > } > ``` *** ## Credits ### list `credits.list` Get the account credit balance and usage with a management API key **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.credits.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > total_credits: number, > total_usage: number, > limit_reached?: boolean, > prepaid?: number, > billed_prepaid?: number, > soft_limit?: number, > pending_balance?: number > } > ``` *** ## Embeddings ### create `embeddings.create` Generate vector embeddings for one or more input strings using a supported embedding model **Risk:** `write` ```ts theme={null} await corsair.openrouter.api.embeddings.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `object[]` | Yes | — | | `encodingFormat` | `float \| base64` | No | — | | `dimensions` | `number` | No | — | | `user` | `string` | No | — | | `inputType` | `string` | No | — | | `provider` | `object` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | number[] | number[][] | { > }[] > ``` > **provider full type** > > ```ts theme={null} > { > order?: string[], > allow_fallbacks?: boolean, > ignore?: string[], > require_parameters?: boolean, > data_collection?: string, > zdr?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `model` | `string` | Yes | — | | `usage` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > index?: number, > object: embedding, > embedding: number[] | string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > total_tokens: number > } > ``` *** ## Generations ### get `generations.get` Fetch request and usage metadata for a previous generation by its ID **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.generations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > model?: string, > provider?: string, > provider_name?: string | null, > api_type?: string | null, > created_at?: string, > streamed?: boolean | null, > finish_reason?: string | null, > total_cost?: number | null, > prompt_tokens?: number, > completion_tokens?: number, > total_tokens?: number, > usage?: number | { > }, > tokens_prompt?: number | null, > tokens_completion?: number | null, > provider_responses?: any[] | null, > provider_response?: { > } > } > ``` *** ## Key ### get `key.get` Get metadata about the current API key, including usage, limits, and rate limits **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.key.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > label?: string, > usage: number, > usage_daily?: number, > usage_weekly?: number, > usage_monthly?: number, > byok_usage?: number, > byok_usage_daily?: number, > byok_usage_weekly?: number, > byok_usage_monthly?: number, > limit?: number | null, > limit_reset?: string | null, > limit_remaining?: number | null, > include_byok_in_limit?: boolean, > creator_user_id?: string | null, > is_free_tier?: boolean, > is_management_key?: boolean, > is_provisioning_key?: boolean, > rate_limit?: { > requests: number, > interval: string > }, > expires_at?: string | null, > created_at?: string > } > ``` *** ## Messages ### create `messages.create` Create a message via OpenRouter's Anthropic Messages API, with support for system prompts and multi-part content **Risk:** `write` ```ts theme={null} await corsair.openrouter.api.messages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `maxTokens` | `number` | No | — | | `messages` | `object[]` | Yes | — | | `system` | `string` | No | — | | `temperature` | `number` | No | — | | `topP` | `number` | No | — | | `stopSequences` | `string[]` | No | — | | `tools` | `object[]` | No | — | | `toolChoice` | `object` | No | — | | `thinking` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > role: user | assistant, > content: string | ( > { > type: text, > text: string > } | { > type: image, > source: { > type: base64, > media_type: string, > data: string > } | { > type: url, > url: string > } > } | { > type: document, > source: { > type: base64, > media_type: string, > data: string > } | { > type: url, > url: string > } | { > type: text, > media_type: text/plain, > data: string > } | { > type: content, > content: string | ( > { > type: text, > text: string > } | { > type: image, > source: { > type: base64, > media_type: string, > data: string > } | { > type: url, > url: string > } > } > )[] > } | { > type: file, > file_id: string > }, > title?: string | null, > context?: string | null, > citations?: { > enabled?: boolean > } | null > } | { > type: tool_use, > id: string, > name: string, > input: { > } > } | { > type: tool_result, > tool_use_id: string, > content: string | any[], > is_error?: boolean > } | { > type: thinking, > thinking: string, > signature?: string > } | { > type: redacted_thinking, > data: string > } > )[] > }[] > ``` > **tools full type** > > ```ts theme={null} > { > name: string, > description?: string, > input_schema: { > } > }[] > ``` > **toolChoice full type** > > ```ts theme={null} > { > type: tool, > name: string > } | { > type: auto | any | none > } > ``` > **thinking full type** > > ```ts theme={null} > { > type: enabled, > budget_tokens: number > } | { > type: disabled > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `type` | `message` | Yes | — | | `role` | `assistant` | Yes | — | | `model` | `string` | Yes | — | | `stop_reason` | `string` | No | — | | `content` | `object[]` | Yes | — | | `usage` | `object` | Yes | — | | `provider` | `string` | No | — | > **content full type** > > ```ts theme={null} > ( > { > type: text, > text: string, > citations?: any[] | null > } | { > type: thinking, > thinking: string, > signature?: string > } | { > type: redacted_thinking, > data: string > } | { > type: tool_use, > id: string, > name: string, > input: { > } > } > )[] > ``` > **usage full type** > > ```ts theme={null} > { > input_tokens: number, > output_tokens: number, > cache_read_input_tokens?: number | null, > cache_creation_input_tokens?: number | null, > output_tokens_details?: { > thinking_tokens?: number > } | null > } > ``` *** ## Model Endpoints ### list `modelEndpoints.list` List the individual endpoints serving a model, with per-provider pricing, latency, and throughput **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.modelEndpoints.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `author` | `string` | Yes | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > created?: number, > description?: string, > architecture?: { > }, > endpoints: { > name: string, > model_id?: string, > model_name?: string, > provider_name: string, > tag?: string, > context_length?: number, > max_completion_tokens?: number | null, > max_prompt_tokens?: number | null, > quantization?: string | null, > pricing?: { > }, > supported_parameters?: string[], > status?: number, > uptime_last_30m?: number | null, > uptime_last_5m?: number | null, > uptime_last_1d?: number | null, > supports_implicit_caching?: boolean, > supports_voice_cloning?: boolean, > latency_last_30m?: { > p50?: number, > p75?: number, > p90?: number, > p99?: number > } | null, > throughput_last_30m?: { > p50?: number, > p75?: number, > p90?: number, > p99?: number > } | null > }[] > } > ``` *** ## Models ### count `models.count` Get the total count of models available on OpenRouter **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.models.count({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > count: number > } > ``` *** ### list `models.list` List all models available on OpenRouter, including pricing, context length, and supported parameters **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.models.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `links` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > created?: number, > description?: string, > context_length?: number, > pricing?: { > }, > architecture?: { > modality?: string, > input_modalities?: string[], > output_modalities?: string[], > tokenizer?: string, > instruct_type?: string | null > }, > top_provider?: { > context_length?: number | null, > max_completion_tokens?: number | null, > is_moderated?: boolean > }, > per_request_limits?: { > prompt_tokens?: string | null, > completion_tokens?: string | null > } | null, > supported_parameters?: string[] > }[] > ``` > **links full type** > > ```ts theme={null} > { > next?: string | null > } > ``` *** ### listEmbeddings `models.listEmbeddings` List all embedding models available on OpenRouter **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.models.listEmbeddings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `links` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > created?: number, > description?: string, > context_length?: number, > pricing?: { > }, > architecture?: { > modality?: string, > input_modalities?: string[], > output_modalities?: string[], > tokenizer?: string, > instruct_type?: string | null > }, > top_provider?: { > context_length?: number | null, > max_completion_tokens?: number | null, > is_moderated?: boolean > }, > per_request_limits?: { > prompt_tokens?: string | null, > completion_tokens?: string | null > } | null, > supported_parameters?: string[] > }[] > ``` > **links full type** > > ```ts theme={null} > { > next?: string | null > } > ``` *** ### listUser `models.listUser` List models filtered by the authenticated user’s provider preferences, privacy settings, and guardrails **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.models.listUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `links` | `object` | No | — | | `total_count` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > created?: number, > description?: string, > context_length?: number, > pricing?: { > }, > architecture?: { > modality?: string, > input_modalities?: string[], > output_modalities?: string[], > tokenizer?: string, > instruct_type?: string | null > }, > top_provider?: { > context_length?: number | null, > max_completion_tokens?: number | null, > is_moderated?: boolean > }, > per_request_limits?: { > prompt_tokens?: string | null, > completion_tokens?: string | null > } | null, > supported_parameters?: string[] > }[] > ``` > **links full type** > > ```ts theme={null} > { > next?: string | null > } > ``` *** ## Providers ### list `providers.list` List the providers available on OpenRouter with their privacy policies and data-center regions **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.providers.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > name: string, > slug: string, > privacy_policy_url?: string | null, > terms_of_service_url?: string | null, > status_page_url?: string | null, > headquarters?: string | null, > datacenters?: string[] | null > }[] > ``` *** ## Zdr ### list `zdr.list` List the Zero-Data Residency (ZDR) endpoint specification for the account **Risk:** `read` ```ts theme={null} await corsair.openrouter.api.zdr.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > name: string, > model_id?: string, > model_name?: string, > provider_name: string, > tag?: string, > context_length?: number, > max_completion_tokens?: number | null, > max_prompt_tokens?: number | null, > quantization?: string | null, > pricing?: { > }, > supported_parameters?: string[], > status?: number, > uptime_last_30m?: number | null, > uptime_last_5m?: number | null, > uptime_last_1d?: number | null, > supports_implicit_caching?: boolean, > supports_voice_cloning?: boolean, > latency_last_30m?: { > p50?: number, > p75?: number, > p90?: number, > p99?: number > } | null, > throughput_last_30m?: { > p50?: number, > p75?: number, > p90?: number, > p99?: number > } | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/openrouter/database OpenRouter local sync: searchable entities, `.search()` filters, and operators. The OpenRouter plugin syncs data locally. Use `corsair.openrouter.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Generations Path: `openrouter.db.generations.search` ```ts theme={null} const rows = await corsair.openrouter.db.generations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `provider` | `string` | equals, contains, startsWith, endsWith, in | | `total_cost` | `number` | equals, gt, gte, lt, lte, in | | `prompt_tokens` | `number` | equals, gt, gte, lt, lte, in | | `completion_tokens` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Models Path: `openrouter.db.models.search` ```ts theme={null} const rows = await corsair.openrouter.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `context_length` | `number` | equals, gt, gte, lt, lte, in | | `created` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Providers Path: `openrouter.db.providers.search` ```ts theme={null} const rows = await corsair.openrouter.db.providers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `headquarters` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/openrouter/overview Unified LLM router API for accessing many AI models through one endpoint. Use **OpenRouter** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 13 typed API operations * 3 synced entities (`generations`, `models`, `providers`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/openrouter ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/openrouter ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/openrouter ``` ```bash bun theme={null} bun add corsair @corsair-dev/openrouter ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { openrouter } from '@corsair-dev/openrouter'; export const corsair = createCorsair({ plugins: [ openrouter(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} openrouter() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'openrouter', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`credits.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.openrouter.api.credits.list({}); ``` **`chatCompletions.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.openrouter.api.chatCompletions.create({}); ``` See the full list on the [API](/plugins/openrouter/api) page. ## Query synced data Synced entities support `tenant.openrouter.db..search()` and `.list()`: `generations`, `models`, `providers`. See [Database](/plugins/openrouter/database) for filters and operators. ## What's next > **[API reference](/plugins/openrouter/api)** > > Every `openrouter.api.*` operation with input and output types. > **[Database](/plugins/openrouter/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/openweathermap/api API reference for OpenWeatherMap: every `openweathermap.api.*` operation with input and output types. Every `openweathermap.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Air Pollution ### current `airPollution.current` Get current air pollution data for a latitude/longitude pair **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.airPollution.current({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude | | `lon` | `number` | Yes | Longitude | **Output** | Name | Type | Required | Description | | - | - | - | - | | `coord` | `object` | No | — | | `list` | `object[]` | No | — | > **coord full type** > > ```ts theme={null} > tuple | { > } > ``` > **list full type** > > ```ts theme={null} > { > dt: number, > main?: { > aqi: number > }, > components?: { > co?: number, > no?: number, > no2?: number, > o3?: number, > so2?: number, > pm2_5?: number, > pm10?: number, > nh3?: number > } > }[] > ``` *** ### forecast `airPollution.forecast` Get forecasted air pollution data for a latitude/longitude pair **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.airPollution.forecast({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude | | `lon` | `number` | Yes | Longitude | **Output** | Name | Type | Required | Description | | - | - | - | - | | `coord` | `object` | No | — | | `list` | `object[]` | No | — | > **coord full type** > > ```ts theme={null} > tuple | { > } > ``` > **list full type** > > ```ts theme={null} > { > dt: number, > main?: { > aqi: number > }, > components?: { > co?: number, > no?: number, > no2?: number, > o3?: number, > so2?: number, > pm2_5?: number, > pm10?: number, > nh3?: number > } > }[] > ``` *** ### history `airPollution.history` Get historical air pollution data for a latitude/longitude pair and time range **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.airPollution.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude | | `lon` | `number` | Yes | Longitude | | `start` | `number` | Yes | Start UNIX timestamp (UTC) | | `end` | `number` | Yes | End UNIX timestamp (UTC) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `coord` | `object` | No | — | | `list` | `object[]` | No | — | > **coord full type** > > ```ts theme={null} > tuple | { > } > ``` > **list full type** > > ```ts theme={null} > { > dt: number, > main?: { > aqi: number > }, > components?: { > co?: number, > no?: number, > no2?: number, > o3?: number, > so2?: number, > pm2_5?: number, > pm10?: number, > nh3?: number > } > }[] > ``` *** ## Geocoding ### byZip `geocoding.byZip` Convert a zip/post code into geographic coordinates **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.geocoding.byZip({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `zip` | `string` | Yes | Zip/post code and country code (e.g. E14,GB) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `zip` | `string` | No | — | | `name` | `string` | No | — | | `lat` | `number` | Yes | — | | `lon` | `number` | Yes | — | | `country` | `string` | No | — | *** ### direct `geocoding.direct` Convert a location name into geographic coordinates **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.geocoding.direct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | City name, state code, and country code (e.g. London,UK) | | `limit` | `number` | No | Max number of results (1-5) | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string, > local_names?: { > }, > lat: number, > lon: number, > country?: string, > state?: string > }[] > ``` *** ### reverse `geocoding.reverse` Convert geographic coordinates into location names **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.geocoding.reverse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude | | `lon` | `number` | Yes | Longitude | | `limit` | `number` | No | Max number of results (1-5) | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string, > local_names?: { > }, > lat: number, > lon: number, > country?: string, > state?: string > }[] > ``` *** ## History ### timeMachine `history.timeMachine` Get historical weather data for a specific timestamp (available from 1979-01-01) **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.history.timeMachine({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude of the location | | `lon` | `number` | Yes | Longitude of the location | | `dt` | `number` | Yes | Unix timestamp (UTC) for the requested historical date | | `units` | `standard \| metric \| imperial` | No | Units: standard (Kelvin), metric (Celsius), imperial (Fahrenheit) | | `lang` | `string` | No | Language code for weather descriptions | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | — | | `lon` | `number` | Yes | — | | `timezone` | `string` | Yes | — | | `timezone_offset` | `number` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > dt: number, > sunrise: number, > sunset: number, > temp: number, > feels_like: number, > pressure: number, > humidity: number, > dew_point: number, > uvi?: number, > clouds: number, > visibility?: number, > wind_speed: number, > wind_deg: number, > wind_gust?: number, > weather: { > id: number, > main: string, > description: string, > icon: string > }[], > rain?: { > 1h: number > }, > snow?: { > 1h: number > } > }[] > ``` *** ## Maps ### weatherMapTile `maps.weatherMapTile` Fetch a Weather Maps 2.0 tile image for a layer and coordinates **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.maps.weatherMapTile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `layer` | `PAC0 \| PR0 \| PA0 \| PAR0 \| PAS0 \| SD0 \| WS10 \| WND \| APM \| TA2 \| TD2 \| TS0 \| TS10 \| HRD0 \| CL` | Yes | Weather map layer code (Maps 2.0 op parameter) | | `z` | `number` | Yes | Zoom level | | `x` | `number` | Yes | Tile X coordinate | | `y` | `number` | Yes | Tile Y coordinate | | `date` | `number` | No | Unix timestamp for forecast/historical tile | | `opacity` | `number` | No | — | | `palette` | `string` | No | — | | `fill_bound` | `boolean` | No | — | | `arrow_step` | `number` | No | — | | `use_norm` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `image/png` | Yes | — | | `dataBase64` | `string` | Yes | — | *** ## Stations ### create `stations.create` Register a new personal weather station with OpenWeather **Risk:** `write` ```ts theme={null} await corsair.openweathermap.api.stations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | Your external station identifier | | `name` | `string` | Yes | Station name | | `latitude` | `number` | Yes | Station latitude | | `longitude` | `number` | Yes | Station longitude | | `altitude` | `number` | Yes | Station altitude in meters | **Output:** `unknown` *** ### get `stations.get` Get details for a registered weather station by ID **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.stations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `station_id` | `string` | Yes | Internal OpenWeather station ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `external_id` | `string` | No | — | | `name` | `string` | No | — | | `latitude` | `number` | No | — | | `longitude` | `number` | No | — | | `altitude` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `rank` | `number` | No | — | *** ### getMeasurements `stations.getMeasurements` Get aggregated measurements from a registered station (minute/hour/day intervals) **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.stations.getMeasurements({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `station_id` | `string` | Yes | Internal OpenWeather station ID | | `type` | `m \| h \| d` | Yes | Aggregation interval: m, h, or d | | `from` | `number` | Yes | Start of interval (Unix timestamp) | | `to` | `number` | Yes | End of interval (Unix timestamp) | | `limit` | `number` | Yes | Maximum number of records to return | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > station_id?: string, > dt?: number, > date?: number, > temperature?: number | { > min?: number, > max?: number, > average?: number, > weight?: number > }, > temp?: number | { > min?: number, > max?: number, > average?: number, > weight?: number > }, > wind_speed?: number | { > min?: number, > max?: number, > average?: number, > weight?: number > }, > wind_gust?: number | { > min?: number, > max?: number, > average?: number, > weight?: number > }, > wind_deg?: number | { > min?: number, > max?: number, > average?: number, > weight?: number > }, > pressure?: number | { > min?: number, > max?: number, > average?: number, > weight?: number > }, > humidity?: number | { > min?: number, > max?: number, > average?: number, > weight?: number > }, > precipitation?: number | { > min?: number, > max?: number, > average?: number, > weight?: number > } > }[] > ``` *** ### list `stations.list` List all weather stations registered to your OpenWeather account **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.stations.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > external_id?: string, > name?: string, > latitude?: number, > longitude?: number, > altitude?: number, > created_at?: string, > updated_at?: string, > rank?: number > }[] > ``` *** ### remove `stations.remove` Delete a registered weather station from your account **Risk:** `destructive` ```ts theme={null} await corsair.openweathermap.api.stations.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `station_id` | `string` | Yes | Internal OpenWeather station ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### submitMeasurements `stations.submitMeasurements` Submit weather measurements from a registered station **Risk:** `write` ```ts theme={null} await corsair.openweathermap.api.stations.submitMeasurements({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `measurements` | `object[]` | Yes | Measurement records to submit | > **measurements full type** > > ```ts theme={null} > { > station_id: string, > dt: number, > temperature?: number, > wind_speed?: number, > wind_gust?: number, > wind_deg?: number, > pressure?: number, > humidity?: number, > precipitation?: number, > rain_1h?: number, > snow_1h?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `stations.update` Update a registered weather station name, location, or external ID **Risk:** `write` ```ts theme={null} await corsair.openweathermap.api.stations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `station_id` | `string` | Yes | Internal OpenWeather station ID | | `name` | `string` | No | — | | `external_id` | `string` | No | — | | `latitude` | `number` | No | — | | `longitude` | `number` | No | — | | `altitude` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `external_id` | `string` | No | — | | `name` | `string` | No | — | | `latitude` | `number` | No | — | | `longitude` | `number` | No | — | | `altitude` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `rank` | `number` | No | — | *** ## Summary ### daySummary `summary.daySummary` Get aggregated weather summary for a specific date (temperature, wind, precipitation) **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.summary.daySummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude of the location | | `lon` | `number` | Yes | Longitude of the location | | `date` | `string` | Yes | Date in YYYY-MM-DD format | | `units` | `standard \| metric \| imperial` | No | Units: standard (Kelvin), metric (Celsius), imperial (Fahrenheit) | | `lang` | `string` | No | Language code for weather descriptions | | `tz` | `string` | No | Timezone offset in ±XX:XX format (e.g. +05:30) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | — | | `lon` | `number` | Yes | — | | `tz` | `string` | Yes | — | | `date` | `string` | Yes | — | | `units` | `string` | Yes | — | | `cloud_cover` | `object` | Yes | — | | `humidity` | `object` | Yes | — | | `precipitation` | `object` | Yes | — | | `temperature` | `object` | Yes | — | | `pressure` | `object` | Yes | — | | `wind` | `object` | Yes | — | > **cloud\_cover full type** > > ```ts theme={null} > { > afternoon: number > } > ``` > **humidity full type** > > ```ts theme={null} > { > afternoon: number > } > ``` > **precipitation full type** > > ```ts theme={null} > { > total: number > } > ``` > **temperature full type** > > ```ts theme={null} > { > min: number, > max: number, > afternoon: number, > night: number, > evening: number, > morning: number > } > ``` > **pressure full type** > > ```ts theme={null} > { > afternoon: number > } > ``` > **wind full type** > > ```ts theme={null} > { > max: { > speed: number, > direction: number > } > } > ``` *** ### overview `summary.overview` Get a human-readable weather overview text for a location and date **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.summary.overview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude of the location | | `lon` | `number` | Yes | Longitude of the location | | `date` | `string` | No | Date in YYYY-MM-DD format (defaults to today) | | `units` | `standard \| metric \| imperial` | No | Units: standard (Kelvin), metric (Celsius), imperial (Fahrenheit) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | — | | `lon` | `number` | Yes | — | | `tz` | `string` | Yes | — | | `date` | `string` | Yes | — | | `units` | `string` | Yes | — | | `weather_overview` | `string` | Yes | — | *** ## Weather ### circleCity `weather.circleCity` Get current weather for cities within a circle around a geographic point **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.weather.circleCity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude of circle center | | `lon` | `number` | Yes | Longitude of circle center | | `cnt` | `number` | No | Number of cities to return (1-50, default 10) | | `units` | `standard \| metric \| imperial` | No | — | | `lang` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cod` | `string` | No | — | | `count` | `number` | No | — | | `list` | `object[]` | No | — | > **list full type** > > ```ts theme={null} > { > coord?: { > lon: number, > lat: number > }, > weather?: { > id: number, > main: string, > description: string, > icon: string > }[], > main?: { > temp: number, > feels_like?: number, > temp_min?: number, > temp_max?: number, > pressure?: number, > humidity?: number > }, > wind?: { > speed: number, > deg?: number, > gust?: number > }, > clouds?: { > all: number > }, > dt?: number, > sys?: { > country?: string, > sunrise?: number, > sunset?: number > }, > timezone?: number, > id?: number, > name?: string, > cod?: number > }[] > ``` *** ### current `weather.current` Get current weather for a location by city name, city ID, zip code, or coordinates **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.weather.current({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | City name, state code, country code | | `id` | `number` | No | OpenWeatherMap city ID | | `zip` | `string` | No | Zip/post code with country code | | `lat` | `number` | No | Latitude | | `lon` | `number` | No | Longitude | | `units` | `standard \| metric \| imperial` | No | — | | `lang` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `coord` | `object` | No | — | | `weather` | `object[]` | No | — | | `main` | `object` | No | — | | `wind` | `object` | No | — | | `clouds` | `object` | No | — | | `dt` | `number` | No | — | | `sys` | `object` | No | — | | `timezone` | `number` | No | — | | `id` | `number` | No | — | | `name` | `string` | No | — | | `cod` | `number` | No | — | > **coord full type** > > ```ts theme={null} > { > lon: number, > lat: number > } > ``` > **weather full type** > > ```ts theme={null} > { > id: number, > main: string, > description: string, > icon: string > }[] > ``` > **main full type** > > ```ts theme={null} > { > temp: number, > feels_like?: number, > temp_min?: number, > temp_max?: number, > pressure?: number, > humidity?: number > } > ``` > **wind full type** > > ```ts theme={null} > { > speed: number, > deg?: number, > gust?: number > } > ``` > **clouds full type** > > ```ts theme={null} > { > all: number > } > ``` > **sys full type** > > ```ts theme={null} > { > country?: string, > sunrise?: number, > sunset?: number > } > ``` *** ### forecast5Day `weather.forecast5Day` Get 5-day forecast in 3-hour steps (up to 40 timestamps) for a location **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.weather.forecast5Day({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | City name, state code, country code | | `id` | `number` | No | OpenWeatherMap city ID | | `zip` | `string` | No | Zip/post code with country code | | `lat` | `number` | No | Latitude | | `lon` | `number` | No | Longitude | | `units` | `standard \| metric \| imperial` | No | — | | `lang` | `string` | No | — | | `cnt` | `number` | No | Number of timestamps to return (1-40) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cod` | `string` | No | — | | `message` | `number` | No | — | | `cnt` | `number` | No | — | | `list` | `object[]` | No | — | | `city` | `object` | No | — | > **list full type** > > ```ts theme={null} > { > dt: number, > main?: { > }, > weather?: { > id: number, > main: string, > description: string, > icon: string > }[], > clouds?: { > }, > wind?: { > }, > pop?: number, > rain?: { > }, > snow?: { > }, > sys?: { > }, > dt_txt?: string > }[] > ``` > **city full type** > > ```ts theme={null} > { > id?: number, > name?: string, > coord?: { > }, > country?: string, > population?: number, > timezone?: number, > sunrise?: number, > sunset?: number > } > ``` *** ### oneCall `weather.oneCall` Get current weather, minutely/hourly/daily forecasts, and weather alerts for a location **Risk:** `read` ```ts theme={null} await corsair.openweathermap.api.weather.oneCall({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | Latitude of the location | | `lon` | `number` | Yes | Longitude of the location | | `exclude` | `current \| minutely \| hourly \| daily \| alerts[]` | No | Parts to exclude from the response: current, minutely, hourly, daily, alerts | | `units` | `standard \| metric \| imperial` | No | Units: standard (Kelvin), metric (Celsius), imperial (Fahrenheit) | | `lang` | `string` | No | Language code for weather descriptions | **Output** | Name | Type | Required | Description | | - | - | - | - | | `lat` | `number` | Yes | — | | `lon` | `number` | Yes | — | | `timezone` | `string` | Yes | — | | `timezone_offset` | `number` | Yes | — | | `current` | `object` | No | — | | `minutely` | `object[]` | No | — | | `hourly` | `object[]` | No | — | | `daily` | `object[]` | No | — | | `alerts` | `object[]` | No | — | > **current full type** > > ```ts theme={null} > { > dt: number, > sunrise?: number, > sunset?: number, > temp: number, > feels_like: number, > pressure: number, > humidity: number, > dew_point: number, > uvi: number, > clouds: number, > visibility?: number, > wind_speed: number, > wind_deg: number, > wind_gust?: number, > weather: { > id: number, > main: string, > description: string, > icon: string > }[], > rain?: { > 1h: number > }, > snow?: { > 1h: number > } > } > ``` > **minutely full type** > > ```ts theme={null} > { > dt: number, > precipitation: number > }[] > ``` > **hourly full type** > > ```ts theme={null} > { > dt: number, > temp: number, > feels_like: number, > pressure: number, > humidity: number, > dew_point: number, > uvi: number, > clouds: number, > visibility?: number, > wind_speed: number, > wind_deg: number, > wind_gust?: number, > weather: { > id: number, > main: string, > description: string, > icon: string > }[], > pop: number, > rain?: { > 1h: number > }, > snow?: { > 1h: number > } > }[] > ``` > **daily full type** > > ```ts theme={null} > { > dt: number, > sunrise: number, > sunset: number, > moonrise: number, > moonset: number, > moon_phase: number, > summary?: string, > temp: { > day: number, > min: number, > max: number, > night: number, > eve: number, > morn: number > }, > feels_like: { > day: number, > night: number, > eve: number, > morn: number > }, > pressure: number, > humidity: number, > dew_point: number, > wind_speed: number, > wind_deg: number, > wind_gust?: number, > weather: { > id: number, > main: string, > description: string, > icon: string > }[], > clouds: number, > pop: number, > rain?: number, > snow?: number, > uvi: number > }[] > ``` > **alerts full type** > > ```ts theme={null} > { > sender_name: string, > event: string, > start: number, > end: number, > description: string, > tags: string[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/openweathermap/database OpenWeatherMap local sync: searchable entities, `.search()` filters, and operators. The OpenWeatherMap plugin syncs data locally. Use `corsair.openweathermap.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Day Summaries Path: `openweathermap.db.daySummaries.search` ```ts theme={null} const rows = await corsair.openweathermap.db.daySummaries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `lat` | `number` | equals, gt, gte, lt, lte, in | | `lon` | `number` | equals, gt, gte, lt, lte, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `tz` | `string` | equals, contains, startsWith, endsWith, in | | `units` | `string` | equals, contains, startsWith, endsWith, in | | `temperatureMin` | `number` | equals, gt, gte, lt, lte, in | | `temperatureMax` | `number` | equals, gt, gte, lt, lte, in | | `temperatureAfternoon` | `number` | equals, gt, gte, lt, lte, in | | `temperatureMorning` | `number` | equals, gt, gte, lt, lte, in | | `temperatureEvening` | `number` | equals, gt, gte, lt, lte, in | | `temperatureNight` | `number` | equals, gt, gte, lt, lte, in | | `precipitationTotal` | `number` | equals, gt, gte, lt, lte, in | | `windMaxSpeed` | `number` | equals, gt, gte, lt, lte, in | | `windMaxDirection` | `number` | equals, gt, gte, lt, lte, in | | `cloudCoverAfternoon` | `number` | equals, gt, gte, lt, lte, in | | `humidityAfternoon` | `number` | equals, gt, gte, lt, lte, in | | `pressureAfternoon` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Overviews Path: `openweathermap.db.overviews.search` ```ts theme={null} const rows = await corsair.openweathermap.db.overviews.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `lat` | `number` | equals, gt, gte, lt, lte, in | | `lon` | `number` | equals, gt, gte, lt, lte, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `tz` | `string` | equals, contains, startsWith, endsWith, in | | `units` | `string` | equals, contains, startsWith, endsWith, in | | `weatherOverview` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/openweathermap/overview Weather data API for forecasts, current conditions, and historical climate information. Use **OpenWeatherMap** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 21 typed API operations * 2 synced entities (`daySummaries`, `overviews`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/openweathermap ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/openweathermap ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/openweathermap ``` ```bash bun theme={null} bun add corsair @corsair-dev/openweathermap ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { openweathermap } from '@corsair-dev/openweathermap'; export const corsair = createCorsair({ plugins: [ openweathermap(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} openweathermap() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'openweathermap', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`airPollution.current`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.openweathermap.api.airPollution.current({}); ``` **`stations.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.openweathermap.api.stations.create({}); ``` See the full list on the [API](/plugins/openweathermap/api) page. ## Query synced data Synced entities support `tenant.openweathermap.db..search()` and `.list()`: `daySummaries`, `overviews`. See [Database](/plugins/openweathermap/database) for filters and operators. ## What's next > **[API reference](/plugins/openweathermap/api)** > > Every `openweathermap.api.*` operation with input and output types. > **[Database](/plugins/openweathermap/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/orbit/api API reference for Orbit: every `orbit.api.*` operation with input and output types. Every `orbit.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Bulk ### cancel `bulk.cancel` Cancel undispatched bulk items **Risk:** `write` ```ts theme={null} await corsair.orbit.api.bulk.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `status` | `queued \| running \| waiting_for_credits \| needs_attention \| completed \| completed_with_errors \| canceled` | Yes | — | | `request_id` | `string` | No | — | | `updated_at` | `string` | No | — | | `billing` | `object` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` *** ### get `bulk.get` Read bulk search progress **Risk:** `read` ```ts theme={null} await corsair.orbit.api.bulk.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `status` | `queued \| running \| waiting_for_credits \| needs_attention \| completed \| completed_with_errors \| canceled` | Yes | — | | `request_id` | `string` | No | — | | `updated_at` | `string` | No | — | | `billing` | `object` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` *** ### results `bulk.results` Read bulk search results **Risk:** `read` ```ts theme={null} await corsair.orbit.api.bulk.results({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | No | — | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### submit `bulk.submit` Submit a bulk search **Risk:** `write` ```ts theme={null} await corsair.orbit.api.bulk.submit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > query?: string, > intent?: { > names?: string[], > experiences?: { > }[], > semanticClauses?: { > }[], > schools?: { > }[], > geo?: { > } | null, > demographics?: { > } | null, > personalization?: { > } | null > }, > signals?: { > address?: string, > email?: string, > phone?: string, > linkedin_url?: string, > urls?: string[], > usernames?: string[], > face_source?: { > image_url: string, > bbox?: number[] > } > }, > candidate_discovery?: boolean, > candidate_discovery_limit?: number, > profile_depth?: partial | full, > include_profile?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `status` | `queued \| running \| waiting_for_credits \| needs_attention \| completed \| completed_with_errors \| canceled` | Yes | — | | `request_id` | `string` | No | — | | `updated_at` | `string` | No | — | | `billing` | `object` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` *** ## Enrich ### batch `enrich.batch` Enrich up to 20 profiles **Risk:** `write` ```ts theme={null} await corsair.orbit.api.enrich.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile_ids` | `string[]` | Yes | — | | `operation` | `partial \| full \| regenerate` | Yes | — | | `request_id` | `string` | No | — | | `include_profile` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | No | — | | `status` | `string` | No | — | *** ### get `enrich.get` Poll an enrichment **Risk:** `read` ```ts theme={null} await corsair.orbit.api.enrich.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `profile_id` | `string` | No | — | | `status` | `running \| completed \| failed` | Yes | — | | `billing` | `object` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` *** ### read `enrich.read` Read an enriched profile **Risk:** `read` ```ts theme={null} await corsair.orbit.api.enrich.read({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile_id` | `string` | Yes | — | | `format` | `json \| markdown` | No | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `profile_id` | `string` | No | — | | `id` | `string` | No | — | *** ### start `enrich.start` Enrich one profile **Risk:** `write` ```ts theme={null} await corsair.orbit.api.enrich.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile_id` | `string` | Yes | — | | `operation` | `partial \| full \| regenerate` | Yes | — | | `request_id` | `string` | No | — | | `include_profile` | `boolean` | No | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `profile_id` | `string` | No | — | | `status` | `running \| completed \| failed` | Yes | — | | `billing` | `object` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` *** ## Faces ### detect `faces.detect` Detect faces in a photo **Risk:** `write` ```ts theme={null} await corsair.orbit.api.faces.detect({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageBase64` | `string` | Yes | — | | `contentType` | `image/jpeg \| image/png \| image/webp` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `image_url` | `string` | Yes | — | | `faces` | `object[]` | Yes | — | > **faces full type** > > ```ts theme={null} > { > }[] > ``` *** ### index `faces.index` Search the face index **Risk:** `write` ```ts theme={null} await corsair.orbit.api.faces.index({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image_url` | `string` | Yes | — | | `bbox` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `matches` | `object[]` | Yes | — | > **matches full type** > > ```ts theme={null} > { > }[] > ``` *** ## Search ### get `search.get` Poll a people search **Risk:** `read` ```ts theme={null} await corsair.orbit.api.search.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_id` | `string` | Yes | — | | `status` | `running \| completed \| completed_with_errors \| failed` | Yes | — | | `request_id` | `string` | No | — | | `updated_at` | `string` | No | — | | `billing` | `object` | No | — | | `results` | `object[]` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### quotePopulation `search.quotePopulation` Price a population search **Risk:** `read` ```ts theme={null} await corsair.orbit.api.search.quotePopulation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `population` | `object` | Yes | — | | `size` | `number` | No | — | | `profile_depth` | `partial \| full` | No | — | > **population full type** > > ```ts theme={null} > { > kind: company | school, > id: string, > name: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `credits` | `number` | No | — | *** ### start `search.start` Start a people search **Risk:** `write` ```ts theme={null} await corsair.orbit.api.search.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | No | — | | `query` | `string` | No | — | | `intent` | `object` | No | — | | `signals` | `object` | No | — | | `candidate_discovery` | `boolean` | No | — | | `candidate_discovery_limit` | `number` | No | — | | `profile_depth` | `partial \| full` | No | — | | `include_profile` | `boolean` | No | — | | `limit` | `number` | No | — | | `webhooks` | `boolean` | No | — | > **intent full type** > > ```ts theme={null} > { > names?: string[], > experiences?: { > }[], > semanticClauses?: { > }[], > schools?: { > }[], > geo?: { > } | null, > demographics?: { > } | null, > personalization?: { > } | null > } > ``` > **signals full type** > > ```ts theme={null} > { > address?: string, > email?: string, > phone?: string, > linkedin_url?: string, > urls?: string[], > usernames?: string[], > face_source?: { > image_url: string, > bbox?: number[] > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_id` | `string` | Yes | — | | `status` | `running \| completed \| completed_with_errors \| failed` | Yes | — | | `request_id` | `string` | No | — | | `updated_at` | `string` | No | — | | `billing` | `object` | No | — | | `results` | `object[]` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### startPopulation `search.startPopulation` Search everyone at a company or school **Risk:** `write` ```ts theme={null} await corsair.orbit.api.search.startPopulation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `population` | `object` | Yes | — | | `size` | `number` | No | — | | `profile_depth` | `partial \| full` | No | — | | `request_id` | `string` | No | — | > **population full type** > > ```ts theme={null} > { > kind: company | school, > id: string, > name: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_id` | `string` | Yes | — | | `status` | `running \| completed \| completed_with_errors \| failed` | Yes | — | | `request_id` | `string` | No | — | | `updated_at` | `string` | No | — | | `billing` | `object` | No | — | | `results` | `object[]` | No | — | > **billing full type** > > ```ts theme={null} > { > } > ``` > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ## Watchers ### create `watchers.create` Watch a profile **Risk:** `write` ```ts theme={null} await corsair.orbit.api.watchers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orbit_id` | `string` | Yes | — | | `interval_seconds` | `number` | Yes | — | | `phases` | `existing_sources \| existing_socials \| new_sources[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orbit_id` | `string` | No | — | | `enabled` | `boolean` | No | — | *** ### delete `watchers.delete` Delete a watcher **Risk:** `destructive` ```ts theme={null} await corsair.orbit.api.watchers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watcher_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `deleted` | `true` | Yes | — | *** ### get `watchers.get` Get a watcher **Risk:** `read` ```ts theme={null} await corsair.orbit.api.watchers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watcher_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orbit_id` | `string` | No | — | | `enabled` | `boolean` | No | — | *** ### list `watchers.list` List watchers **Risk:** `read` ```ts theme={null} await corsair.orbit.api.watchers.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `watchers` | `object[]` | No | — | > **watchers full type** > > ```ts theme={null} > { > id: string, > orbit_id?: string, > enabled?: boolean > }[] > ``` *** ### runs `watchers.runs` List watcher runs **Risk:** `read` ```ts theme={null} await corsair.orbit.api.watchers.runs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watcher_id` | `string` | Yes | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `runs` | `object[]` | No | — | > **runs full type** > > ```ts theme={null} > { > }[] > ``` *** ### update `watchers.update` Update a watcher **Risk:** `write` ```ts theme={null} await corsair.orbit.api.watchers.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watcher_id` | `string` | Yes | — | | `enabled` | `boolean` | No | — | | `interval_seconds` | `number` | No | — | | `phases` | `existing_sources \| existing_socials \| new_sources[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orbit_id` | `string` | No | — | | `enabled` | `boolean` | No | — | *** ## Webhooks ### create `webhooks.create` Register a webhook endpoint **Risk:** `write` ```ts theme={null} await corsair.orbit.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `event_types` | `profile.updated \| company.thesis.changed \| company.alert \| portfolio.changed \| search.profile.updated \| search.completed[]` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `event_types` | `string[]` | Yes | — | | `enabled` | `boolean` | Yes | — | | `secret` | `string` | No | — | *** ### delete `webhooks.delete` Delete a webhook endpoint **Risk:** `destructive` ```ts theme={null} await corsair.orbit.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `deleted` | `true` | Yes | — | *** ### list `webhooks.list` List webhook endpoints **Risk:** `read` ```ts theme={null} await corsair.orbit.api.webhooks.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | No | — | > **webhooks full type** > > ```ts theme={null} > { > id: string, > url: string, > event_types: string[], > enabled: boolean, > secret?: string > }[] > ``` *** ### test `webhooks.test` Send a test webhook delivery **Risk:** `write` ```ts theme={null} await corsair.orbit.api.webhooks.test({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `string` | Yes | — | | `event_type` | `profile.updated \| company.thesis.changed \| company.alert \| portfolio.changed \| search.profile.updated \| search.completed` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `delivered` | `boolean` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/orbit/database Orbit local sync: searchable entities, `.search()` filters, and operators. The Orbit plugin syncs data locally. Use `corsair.orbit.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Bulk Jobs Path: `orbit.db.bulkJobs.search` ```ts theme={null} const rows = await corsair.orbit.db.bulkJobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `requestId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Enrichments Path: `orbit.db.enrichments.search` ```ts theme={null} const rows = await corsair.orbit.db.enrichments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `requestId` | `string` | equals, contains, startsWith, endsWith, in | | `profileId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Searches Path: `orbit.db.searches.search` ```ts theme={null} const rows = await corsair.orbit.db.searches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `searchId` | `string` | equals, contains, startsWith, endsWith, in | | `requestId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/orbit/overview Search for people and enrich public profiles on the Orbit API. Use **Orbit** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 24 typed API operations * 3 synced entities (`bulkJobs`, `enrichments`, `searches`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/orbit ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/orbit ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/orbit ``` ```bash bun theme={null} bun add corsair @corsair-dev/orbit ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { orbit } from '@corsair-dev/orbit'; export const corsair = createCorsair({ plugins: [ orbit(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} orbit() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'orbit', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`bulk.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.orbit.api.bulk.get({}); ``` **`bulk.cancel`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.orbit.api.bulk.cancel({}); ``` See the full list on the [API](/plugins/orbit/api) page. ## Query synced data Synced entities support `tenant.orbit.db..search()` and `.list()`: `bulkJobs`, `enrichments`, `searches`. See [Database](/plugins/orbit/database) for filters and operators. ## Webhooks This plugin registers **1** webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/orbit/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/orbit/api)** > > Every `orbit.api.*` operation with input and output types. > **[Database](/plugins/orbit/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/orbit/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/orbit/webhooks Orbit incoming webhooks: event paths, payloads, and response data. The Orbit plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/orbit/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `events` * `delivery` (`events.delivery`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Events ### Delivery `events.delivery` A signed Orbit event delivery **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `type` | `string` | No | — | | `created` | `string` | No | — | | `test` | `boolean` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > } > ``` **`webhookHooks` example** ```ts theme={null} orbit({ webhookHooks: { events: { delivery: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/oura/api API reference for Oura: every `oura.api.*` operation with input and output types. Every `oura.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Profile ### get `profile.get` Get the authenticated user Oura profile and personal info **Risk:** `read` ```ts theme={null} await corsair.oura.api.profile.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `age` | `number` | No | — | | `weight` | `number` | No | — | | `height` | `number` | No | — | | `biological_sex` | `string` | No | — | | `email` | `string` | No | — | *** ## Summary ### getActivity `summary.getActivity` Get daily activity summary data for a date range **Risk:** `read` ```ts theme={null} await corsair.oura.api.summary.getActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `next_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > class_5_min?: string | null, > score?: number | null, > active_calories?: number, > average_met_minutes?: number, > contributors?: { > meet_daily_targets?: number | null, > move_every_hour?: number | null, > recovery_time?: number | null, > stay_active?: number | null, > training_frequency?: number | null, > training_volume?: number | null > }, > equivalent_walking_distance?: number, > high_activity_met_minutes?: number, > high_activity_time?: number, > inactivity_alerts?: number, > low_activity_met_minutes?: number, > low_activity_time?: number, > medium_activity_met_minutes?: number, > medium_activity_time?: number, > meters_to_target?: number, > non_wear_time?: number, > resting_time?: number, > sedentary_met_minutes?: number, > sedentary_time?: number, > steps?: number, > target_calories?: number, > target_meters?: number, > total_calories?: number, > day: string, > timestamp: string > }[] > ``` *** ### getReadiness `summary.getReadiness` Get daily readiness summary data for a date range **Risk:** `read` ```ts theme={null} await corsair.oura.api.summary.getReadiness({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `next_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > contributors?: { > activity_balance?: number | null, > body_temperature?: number | null, > hrv_balance?: number | null, > previous_day_activity?: number | null, > previous_night?: number | null, > recovery_index?: number | null, > resting_heart_rate?: number | null, > sleep_balance?: number | null > }, > day: string, > score?: number | null, > temperature_deviation?: number | null, > temperature_trend_deviation?: number | null, > timestamp: string > }[] > ``` *** ### getSleep `summary.getSleep` Get daily sleep summary data for a date range **Risk:** `read` ```ts theme={null} await corsair.oura.api.summary.getSleep({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `next_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `next_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > contributors?: { > deep_sleep?: number | null, > efficiency?: number | null, > latency?: number | null, > rem_sleep?: number | null, > restfulness?: number | null, > timing?: number | null, > total_sleep?: number | null > }, > day: string, > score?: number | null, > timestamp: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/oura/database Oura local sync: searchable entities, `.search()` filters, and operators. The Oura plugin syncs data locally. Use `corsair.oura.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Daily Activity Path: `oura.db.dailyActivity.search` ```ts theme={null} const rows = await corsair.oura.db.dailyActivity.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `day` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `active_calories` | `number` | equals, gt, gte, lt, lte, in | | `steps` | `number` | equals, gt, gte, lt, lte, in | | `total_calories` | `number` | equals, gt, gte, lt, lte, in | | `high_activity_time` | `number` | equals, gt, gte, lt, lte, in | | `medium_activity_time` | `number` | equals, gt, gte, lt, lte, in | | `low_activity_time` | `number` | equals, gt, gte, lt, lte, in | | `sedentary_time` | `number` | equals, gt, gte, lt, lte, in | | `resting_time` | `number` | equals, gt, gte, lt, lte, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Daily Readiness Path: `oura.db.dailyReadiness.search` ```ts theme={null} const rows = await corsair.oura.db.dailyReadiness.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `day` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `temperature_deviation` | `number` | equals, gt, gte, lt, lte, in | | `temperature_trend_deviation` | `number` | equals, gt, gte, lt, lte, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Daily Sleep Path: `oura.db.dailySleep.search` ```ts theme={null} const rows = await corsair.oura.db.dailySleep.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `day` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Personal Info Path: `oura.db.personalInfo.search` ```ts theme={null} const rows = await corsair.oura.db.personalInfo.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `age` | `number` | equals, gt, gte, lt, lte, in | | `weight` | `number` | equals, gt, gte, lt, lte, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `biological_sex` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/oura/get-credentials Step-by-step instructions for obtaining an Oura personal access token and webhook secrets for the Corsair Oura plugin. This guide walks you through obtaining all required credentials for the Oura plugin. ## Authentication Method The Oura plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) — Personal access token for the Oura Cloud API ## Personal Access Token ### Step 1: Register an Application 1. Sign in to [Oura Cloud](https://cloud.ouraring.com/) with your Oura account. 2. Open the developer / OAuth section (typically **Personal Access Tokens** or **API Applications** — see [Oura API documentation](https://cloud.ouraring.com/docs/) for the current path). 3. Create a new **personal access token** or OAuth application, following Oura’s steps to generate a token with the scopes you need (sleep, activity, readiness, etc.). ### Step 2: Copy the Token Copy the token when it is displayed. Treat it like a password. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=oura api_key=your-personal-access-token ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=oura --credentials ``` ## Webhook Secret If you configure Oura webhooks that sign requests, copy the signing secret from Oura’s webhook or subscription settings and store it for verification in Corsair. ```bash theme={null} pnpm corsair setup --plugin=oura webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | Personal access token | [`api_key`](/concepts/api-key) auth | Oura Cloud → developer / token settings | | Webhook secret | Webhooks (if used) | Oura webhook configuration | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/oura/overview Wearable health platform API for sleep, readiness, activity, and wellness ring data. Use **Oura** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 4 typed API operations * 4 synced entities (`dailyActivity`, `dailyReadiness`, `dailySleep`, `personalInfo`) for fast `.search()` / `.list()` * 3 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/oura ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/oura ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/oura ``` ```bash bun theme={null} bun add corsair @corsair-dev/oura ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { oura } from '@corsair-dev/oura'; export const corsair = createCorsair({ plugins: [ oura(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/oura/get-credentials). ```ts theme={null} oura() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'oura', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`profile.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.oura.api.profile.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/oura/api) reference.* See the full list on the [API](/plugins/oura/api) page. ## Query synced data Synced entities support `tenant.oura.db..search()` and `.list()`: `dailyActivity`, `dailyReadiness`, `dailySleep`, `personalInfo`. See [Database](/plugins/oura/database) for filters and operators. ## Webhooks This plugin registers **3** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/oura/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/oura/api)** > > Every `oura.api.*` operation with input and output types. > **[Database](/plugins/oura/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/oura/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/oura/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/oura/webhooks Oura incoming webhooks: event paths, payloads, and response data. The Oura plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/oura/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `summary` * `dailyActivity` (`summary.dailyActivity`) * `dailyReadiness` (`summary.dailyReadiness`) * `dailySleep` (`summary.dailySleep`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Summary ### Daily Activity `summary.dailyActivity` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} oura({ webhookHooks: { summary: { dailyActivity: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Daily Readiness `summary.dailyReadiness` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} oura({ webhookHooks: { summary: { dailyReadiness: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Daily Sleep `summary.dailySleep` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} oura({ webhookHooks: { summary: { dailySleep: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/outlook/api API reference for Outlook: every `outlook.api.*` operation with input and output types. Every `outlook.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Calendars ### create `calendars.create` Create a new calendar **Risk:** `write` ```ts theme={null} await corsair.outlook.api.calendars.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `user_id` | `string` | No | — | | `color` | `string` | No | — | | `hexColor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `hexColor` | `string` | No | — | | `isDefaultCalendar` | `boolean` | No | — | | `canEdit` | `boolean` | No | — | | `canShare` | `boolean` | No | — | | `canViewPrivateItems` | `boolean` | No | — | | `isRemovable` | `boolean` | No | — | | `isTallyingResponses` | `boolean` | No | — | | `owner` | `object` | No | — | | `changeKey` | `string` | No | — | | `allowedOnlineMeetingProviders` | `string[]` | No | — | | `defaultOnlineMeetingProvider` | `string` | No | — | > **owner full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` *** ### delete `calendars.delete` Delete a calendar **Risk:** `destructive` ```ts theme={null} await corsair.outlook.api.calendars.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `calendar_id` | `string` | Yes | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `calendars.get` Get a calendar by ID **Risk:** `read` ```ts theme={null} await corsair.outlook.api.calendars.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `calendar_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `hexColor` | `string` | No | — | | `isDefaultCalendar` | `boolean` | No | — | | `canEdit` | `boolean` | No | — | | `canShare` | `boolean` | No | — | | `canViewPrivateItems` | `boolean` | No | — | | `isRemovable` | `boolean` | No | — | | `isTallyingResponses` | `boolean` | No | — | | `owner` | `object` | No | — | | `changeKey` | `string` | No | — | | `allowedOnlineMeetingProviders` | `string[]` | No | — | | `defaultOnlineMeetingProvider` | `string` | No | — | > **owner full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` *** ### list `calendars.list` List all calendars **Risk:** `read` ```ts theme={null} await corsair.outlook.api.calendars.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string[]` | No | — | | `orderby` | `string[]` | No | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | | `@odata.deltaLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > color?: string, > hexColor?: string, > isDefaultCalendar?: boolean, > canEdit?: boolean, > canShare?: boolean, > canViewPrivateItems?: boolean, > isRemovable?: boolean, > isTallyingResponses?: boolean, > owner?: { > name?: string, > address?: string > }, > changeKey?: string, > allowedOnlineMeetingProviders?: string[], > defaultOnlineMeetingProvider?: string > }[] > ``` *** ## Contacts ### create `contacts.create` Create a new contact **Risk:** `write` ```ts theme={null} await corsair.outlook.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `givenName` | `string` | No | — | | `surname` | `string` | No | — | | `displayName` | `string` | No | — | | `emailAddresses` | `object[]` | No | — | | `mobilePhone` | `string` | No | — | | `homePhone` | `string` | No | — | | `businessPhones` | `string[]` | No | — | | `jobTitle` | `string` | No | — | | `companyName` | `string` | No | — | | `department` | `string` | No | — | | `officeLocation` | `string` | No | — | | `birthday` | `string` | No | — | | `notes` | `string` | No | — | | `categories` | `string[]` | No | — | > **emailAddresses full type** > > ```ts theme={null} > { > address: string, > name?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `givenName` | `string` | No | — | | `surname` | `string` | No | — | | `middleName` | `string` | No | — | | `nickName` | `string` | No | — | | `emailAddresses` | `object[]` | No | — | | `mobilePhone` | `string` | No | — | | `homePhones` | `string[]` | No | — | | `businessPhones` | `string[]` | No | — | | `jobTitle` | `string` | No | — | | `companyName` | `string` | No | — | | `department` | `string` | No | — | | `officeLocation` | `string` | No | — | | `birthday` | `string` | No | — | | `personalNotes` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `changeKey` | `string` | No | — | | `categories` | `string[]` | No | — | > **emailAddresses full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` *** ### delete `contacts.delete` Delete a contact **Risk:** `destructive` ```ts theme={null} await corsair.outlook.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### list `contacts.list` List contacts **Risk:** `read` ```ts theme={null} await corsair.outlook.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `contact_folder_id` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string[]` | No | — | | `orderby` | `string[]` | No | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > displayName?: string, > givenName?: string, > surname?: string, > middleName?: string | null, > nickName?: string | null, > emailAddresses?: { > name?: string, > address?: string > }[], > mobilePhone?: string | null, > homePhones?: string[], > businessPhones?: string[], > jobTitle?: string | null, > companyName?: string | null, > department?: string | null, > officeLocation?: string | null, > birthday?: string | null, > personalNotes?: string, > parentFolderId?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > changeKey?: string, > categories?: string[] > }[] > ``` *** ### update `contacts.update` Update a contact **Risk:** `write` ```ts theme={null} await corsair.outlook.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `user_id` | `string` | No | — | | `givenName` | `string` | No | — | | `surname` | `string` | No | — | | `displayName` | `string` | No | — | | `emailAddresses` | `object[]` | No | — | | `mobilePhone` | `string` | No | — | | `homePhones` | `string[]` | No | — | | `businessPhones` | `string[]` | No | — | | `jobTitle` | `string` | No | — | | `companyName` | `string` | No | — | | `department` | `string` | No | — | | `officeLocation` | `string` | No | — | | `birthday` | `string` | No | — | | `notes` | `string` | No | — | | `categories` | `string[]` | No | — | > **emailAddresses full type** > > ```ts theme={null} > { > address: string, > name?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `givenName` | `string` | No | — | | `surname` | `string` | No | — | | `middleName` | `string` | No | — | | `nickName` | `string` | No | — | | `emailAddresses` | `object[]` | No | — | | `mobilePhone` | `string` | No | — | | `homePhones` | `string[]` | No | — | | `businessPhones` | `string[]` | No | — | | `jobTitle` | `string` | No | — | | `companyName` | `string` | No | — | | `department` | `string` | No | — | | `officeLocation` | `string` | No | — | | `birthday` | `string` | No | — | | `personalNotes` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `changeKey` | `string` | No | — | | `categories` | `string[]` | No | — | > **emailAddresses full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` *** ## Events ### cancel `events.cancel` Cancel a calendar event and notify attendees **Risk:** `write` ```ts theme={null} await corsair.outlook.api.events.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_id` | `string` | Yes | — | | `user_id` | `string` | Yes | — | | `calendar_id` | `string` | Yes | — | | `Comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | | `user_id` | `string` | No | — | | `event_id` | `string` | No | — | | `calendar_id` | `string` | No | — | *** ### create `events.create` Create a calendar event **Risk:** `write` ```ts theme={null} await corsair.outlook.api.events.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subject` | `string` | Yes | — | | `start_datetime` | `string` | Yes | — | | `end_datetime` | `string` | Yes | — | | `time_zone` | `string` | Yes | — | | `user_id` | `string` | No | — | | `calendar_id` | `string` | No | — | | `body` | `string` | No | — | | `is_html` | `boolean` | No | — | | `location` | `string` | No | — | | `attendees_info` | `object[]` | No | — | | `is_online_meeting` | `boolean` | No | — | | `online_meeting_provider` | `string` | No | — | | `show_as` | `string` | No | — | | `categories` | `string[]` | No | — | | `importance` | `string` | No | — | > **attendees\_info full type** > > ```ts theme={null} > { > email: string, > name?: string, > type?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `object` | No | — | | `bodyPreview` | `string` | No | — | | `start` | `object` | No | — | | `end` | `object` | No | — | | `location` | `object` | No | — | | `locations` | `object[]` | No | — | | `attendees` | `object[]` | No | — | | `organizer` | `object` | No | — | | `isAllDay` | `boolean` | No | — | | `isCancelled` | `boolean` | No | — | | `isOrganizer` | `boolean` | No | — | | `isDraft` | `boolean` | No | — | | `isOnlineMeeting` | `boolean` | No | — | | `isReminderOn` | `boolean` | No | — | | `showAs` | `string` | No | — | | `importance` | `string` | No | — | | `sensitivity` | `string` | No | — | | `type` | `string` | No | — | | `iCalUId` | `string` | No | — | | `webLink` | `string` | No | — | | `changeKey` | `string` | No | — | | `categories` | `string[]` | No | — | | `recurrence` | `object` | No | — | | `responseStatus` | `object` | No | — | | `responseRequested` | `boolean` | No | — | | `seriesMasterId` | `string` | No | — | | `transactionId` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `onlineMeeting` | `object` | No | — | | `onlineMeetingProvider` | `string` | No | — | | `onlineMeetingUrl` | `string` | No | — | | `reminderMinutesBeforeStart` | `number` | No | — | | `allowNewTimeProposals` | `boolean` | No | — | | `hasAttachments` | `boolean` | No | — | | `hideAttendees` | `boolean` | No | — | > **body full type** > > ```ts theme={null} > { > contentType?: string, > content?: string > } > ``` > **start full type** > > ```ts theme={null} > { > dateTime: string, > timeZone: string > } > ``` > **end full type** > > ```ts theme={null} > { > dateTime: string, > timeZone: string > } > ``` > **location full type** > > ```ts theme={null} > { > displayName?: string, > address?: { > } > } > ``` > **locations full type** > > ```ts theme={null} > { > displayName?: string, > address?: { > } > }[] > ``` > **attendees full type** > > ```ts theme={null} > { > type?: string, > status?: { > }, > emailAddress?: { > name?: string, > address?: string > } > }[] > ``` > **organizer full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **recurrence full type** > > ```ts theme={null} > { > } > ``` > **responseStatus full type** > > ```ts theme={null} > { > } > ``` > **onlineMeeting full type** > > ```ts theme={null} > { > joinUrl?: string, > conferenceId?: string, > tollNumber?: string > } > ``` *** ### decline `events.decline` Decline a calendar event invitation **Risk:** `write` ```ts theme={null} await corsair.outlook.api.events.decline({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_id` | `string` | Yes | — | | `comment` | `string` | No | — | | `user_id` | `string` | No | — | | `sendResponse` | `boolean` | No | — | | `proposedNewTime` | `object` | No | — | > **proposedNewTime full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `message` | `string` | No | — | *** ### delete `events.delete` Delete a calendar event **Risk:** `destructive` ```ts theme={null} await corsair.outlook.api.events.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_id` | `string` | Yes | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### findMeetingTimes `events.findMeetingTimes` Find available meeting times for attendees **Risk:** `read` ```ts theme={null} await corsair.outlook.api.events.findMeetingTimes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `attendees` | `object[]` | No | — | | `timeConstraint` | `object` | No | — | | `locationConstraint` | `object` | No | — | | `meetingDuration` | `string` | No | — | | `maxCandidates` | `number` | No | — | | `isOrganizerOptional` | `boolean` | No | — | | `returnSuggestionReasons` | `boolean` | No | — | | `minimumAttendeePercentage` | `number` | No | — | | `prefer_timezone` | `string` | No | — | > **attendees full type** > > ```ts theme={null} > { > }[] > ``` > **timeConstraint full type** > > ```ts theme={null} > { > } > ``` > **locationConstraint full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `@odata.context` | `string` | No | — | | `meetingTimeSuggestions` | `object[]` | No | — | | `emptySuggestionsReason` | `string` | No | — | > **meetingTimeSuggestions full type** > > ```ts theme={null} > { > confidence?: number, > organizerAvailability?: string, > suggestionReason?: string, > meetingTimeSlot?: { > start?: { > dateTime: string, > timeZone: string > }, > end?: { > dateTime: string, > timeZone: string > } > }, > attendeeAvailability?: { > attendee?: { > type?: string, > status?: { > }, > emailAddress?: { > name?: string, > address?: string > } > }, > availability?: string > }[], > locations?: { > displayName?: string, > address?: { > } > }[] > }[] > ``` *** ### get `events.get` Get a calendar event by ID **Risk:** `read` ```ts theme={null} await corsair.outlook.api.events.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_id` | `string` | Yes | — | | `user_id` | `string` | No | — | | `calendar_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `object` | No | — | | `bodyPreview` | `string` | No | — | | `start` | `object` | No | — | | `end` | `object` | No | — | | `location` | `object` | No | — | | `locations` | `object[]` | No | — | | `attendees` | `object[]` | No | — | | `organizer` | `object` | No | — | | `isAllDay` | `boolean` | No | — | | `isCancelled` | `boolean` | No | — | | `isOrganizer` | `boolean` | No | — | | `isDraft` | `boolean` | No | — | | `isOnlineMeeting` | `boolean` | No | — | | `isReminderOn` | `boolean` | No | — | | `showAs` | `string` | No | — | | `importance` | `string` | No | — | | `sensitivity` | `string` | No | — | | `type` | `string` | No | — | | `iCalUId` | `string` | No | — | | `webLink` | `string` | No | — | | `changeKey` | `string` | No | — | | `categories` | `string[]` | No | — | | `recurrence` | `object` | No | — | | `responseStatus` | `object` | No | — | | `responseRequested` | `boolean` | No | — | | `seriesMasterId` | `string` | No | — | | `transactionId` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `onlineMeeting` | `object` | No | — | | `onlineMeetingProvider` | `string` | No | — | | `onlineMeetingUrl` | `string` | No | — | | `reminderMinutesBeforeStart` | `number` | No | — | | `allowNewTimeProposals` | `boolean` | No | — | | `hasAttachments` | `boolean` | No | — | | `hideAttendees` | `boolean` | No | — | > **body full type** > > ```ts theme={null} > { > contentType?: string, > content?: string > } > ``` > **start full type** > > ```ts theme={null} > { > dateTime: string, > timeZone: string > } > ``` > **end full type** > > ```ts theme={null} > { > dateTime: string, > timeZone: string > } > ``` > **location full type** > > ```ts theme={null} > { > displayName?: string, > address?: { > } > } > ``` > **locations full type** > > ```ts theme={null} > { > displayName?: string, > address?: { > } > }[] > ``` > **attendees full type** > > ```ts theme={null} > { > type?: string, > status?: { > }, > emailAddress?: { > name?: string, > address?: string > } > }[] > ``` > **organizer full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **recurrence full type** > > ```ts theme={null} > { > } > ``` > **responseStatus full type** > > ```ts theme={null} > { > } > ``` > **onlineMeeting full type** > > ```ts theme={null} > { > joinUrl?: string, > conferenceId?: string, > tollNumber?: string > } > ``` *** ### getSchedule `events.getSchedule` Get free/busy schedule for a calendar **Risk:** `read` ```ts theme={null} await corsair.outlook.api.events.getSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `calendar_id` | `string` | Yes | — | | `schedules` | `string[]` | Yes | — | | `startTime` | `object` | Yes | — | | `endTime` | `object` | Yes | — | | `availabilityViewInterval` | `number` | No | — | > **startTime full type** > > ```ts theme={null} > { > dateTime: string, > timeZone: string > } > ``` > **endTime full type** > > ```ts theme={null} > { > dateTime: string, > timeZone: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | | `@odata.context` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > }[] > ``` *** ### list `events.list` List calendar events **Risk:** `read` ```ts theme={null} await corsair.outlook.api.events.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `calendar_id` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string[]` | No | — | | `orderby` | `string[]` | No | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `timezone` | `string` | No | — | | `expand_recurring_events` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > subject?: string, > body?: { > contentType?: string, > content?: string > }, > bodyPreview?: string, > start?: { > dateTime: string, > timeZone: string > }, > end?: { > dateTime: string, > timeZone: string > }, > location?: { > displayName?: string, > address?: { > } > }, > locations?: { > displayName?: string, > address?: { > } > }[], > attendees?: { > type?: string, > status?: { > }, > emailAddress?: { > name?: string, > address?: string > } > }[], > organizer?: { > name?: string, > address?: string > }, > isAllDay?: boolean, > isCancelled?: boolean, > isOrganizer?: boolean, > isDraft?: boolean, > isOnlineMeeting?: boolean, > isReminderOn?: boolean, > showAs?: string, > importance?: string, > sensitivity?: string, > type?: string, > iCalUId?: string, > webLink?: string, > changeKey?: string, > categories?: string[], > recurrence?: { > } | null, > responseStatus?: { > }, > responseRequested?: boolean, > seriesMasterId?: string | null, > transactionId?: string | null, > createdDateTime?: string, > lastModifiedDateTime?: string, > onlineMeeting?: { > joinUrl?: string, > conferenceId?: string, > tollNumber?: string > } | null, > onlineMeetingProvider?: string, > onlineMeetingUrl?: string | null, > reminderMinutesBeforeStart?: number, > allowNewTimeProposals?: boolean, > hasAttachments?: boolean, > hideAttendees?: boolean > }[] > ``` *** ### update `events.update` Update a calendar event **Risk:** `write` ```ts theme={null} await corsair.outlook.api.events.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_id` | `string` | Yes | — | | `user_id` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `object` | No | — | | `start_datetime` | `string` | No | — | | `end_datetime` | `string` | No | — | | `time_zone` | `string` | No | — | | `location` | `string` | No | — | | `attendees` | `object[]` | No | — | | `show_as` | `string` | No | — | | `categories` | `string[]` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` > **attendees full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `object` | No | — | | `bodyPreview` | `string` | No | — | | `start` | `object` | No | — | | `end` | `object` | No | — | | `location` | `object` | No | — | | `locations` | `object[]` | No | — | | `attendees` | `object[]` | No | — | | `organizer` | `object` | No | — | | `isAllDay` | `boolean` | No | — | | `isCancelled` | `boolean` | No | — | | `isOrganizer` | `boolean` | No | — | | `isDraft` | `boolean` | No | — | | `isOnlineMeeting` | `boolean` | No | — | | `isReminderOn` | `boolean` | No | — | | `showAs` | `string` | No | — | | `importance` | `string` | No | — | | `sensitivity` | `string` | No | — | | `type` | `string` | No | — | | `iCalUId` | `string` | No | — | | `webLink` | `string` | No | — | | `changeKey` | `string` | No | — | | `categories` | `string[]` | No | — | | `recurrence` | `object` | No | — | | `responseStatus` | `object` | No | — | | `responseRequested` | `boolean` | No | — | | `seriesMasterId` | `string` | No | — | | `transactionId` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `onlineMeeting` | `object` | No | — | | `onlineMeetingProvider` | `string` | No | — | | `onlineMeetingUrl` | `string` | No | — | | `reminderMinutesBeforeStart` | `number` | No | — | | `allowNewTimeProposals` | `boolean` | No | — | | `hasAttachments` | `boolean` | No | — | | `hideAttendees` | `boolean` | No | — | > **body full type** > > ```ts theme={null} > { > contentType?: string, > content?: string > } > ``` > **start full type** > > ```ts theme={null} > { > dateTime: string, > timeZone: string > } > ``` > **end full type** > > ```ts theme={null} > { > dateTime: string, > timeZone: string > } > ``` > **location full type** > > ```ts theme={null} > { > displayName?: string, > address?: { > } > } > ``` > **locations full type** > > ```ts theme={null} > { > displayName?: string, > address?: { > } > }[] > ``` > **attendees full type** > > ```ts theme={null} > { > type?: string, > status?: { > }, > emailAddress?: { > name?: string, > address?: string > } > }[] > ``` > **organizer full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **recurrence full type** > > ```ts theme={null} > { > } > ``` > **responseStatus full type** > > ```ts theme={null} > { > } > ``` > **onlineMeeting full type** > > ```ts theme={null} > { > joinUrl?: string, > conferenceId?: string, > tollNumber?: string > } > ``` *** ## Folders ### create `folders.create` Create a new mail folder **Risk:** `write` ```ts theme={null} await corsair.outlook.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `displayName` | `string` | Yes | — | | `user_id` | `string` | No | — | | `isHidden` | `boolean` | No | — | | `return_existing_if_exists` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `totalItemCount` | `number` | No | — | | `unreadItemCount` | `number` | No | — | | `childFolderCount` | `number` | No | — | | `isHidden` | `boolean` | No | — | | `sizeInBytes` | `number` | No | — | *** ### delete `folders.delete` Delete a mail folder **Risk:** `destructive` ```ts theme={null} await corsair.outlook.api.folders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_id` | `string` | Yes | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `folders.get` Get a mail folder by ID **Risk:** `read` ```ts theme={null} await corsair.outlook.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mail_folder_id` | `string` | Yes | — | | `user_id` | `string` | No | — | | `select` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `totalItemCount` | `number` | No | — | | `unreadItemCount` | `number` | No | — | | `childFolderCount` | `number` | No | — | | `isHidden` | `boolean` | No | — | | `sizeInBytes` | `number` | No | — | *** ### list `folders.list` List mail folders **Risk:** `read` ```ts theme={null} await corsair.outlook.api.folders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string` | No | — | | `orderby` | `string` | No | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `count` | `boolean` | No | — | | `include_hidden_folders` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | | `@odata.count` | `number` | No | — | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > displayName?: string, > parentFolderId?: string, > totalItemCount?: number, > unreadItemCount?: number, > childFolderCount?: number, > isHidden?: boolean, > sizeInBytes?: number > }[] > ``` *** ### update `folders.update` Rename a mail folder **Risk:** `write` ```ts theme={null} await corsair.outlook.api.folders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mail_folder_id` | `string` | Yes | — | | `displayName` | `string` | Yes | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `totalItemCount` | `number` | No | — | | `unreadItemCount` | `number` | No | — | | `childFolderCount` | `number` | No | — | | `isHidden` | `boolean` | No | — | | `sizeInBytes` | `number` | No | — | *** ## Messages ### addAttachment `messages.addAttachment` Add an attachment to a message **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.addAttachment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | | `name` | `string` | No | — | | `user_id` | `string` | No | — | | `odata_type` | `string` | No | — | | `contentBytes` | `string` | No | — | | `contentType` | `string` | No | — | | `contentId` | `string` | No | — | | `contentLocation` | `string` | No | — | | `isInline` | `boolean` | No | — | | `item` | `object` | No | — | | `attachment` | `object` | No | — | > **item full type** > > ```ts theme={null} > { > } > ``` > **attachment full type** > > ```ts theme={null} > { > name: string, > mimetype: string, > s3key: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `contentType` | `string` | No | — | | `size` | `number` | No | — | | `isInline` | `boolean` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `@odata.type` | `string` | No | — | | `contentBytes` | `string` | No | — | | `contentId` | `string` | No | — | | `contentLocation` | `string` | No | — | *** ### batchMove `messages.batchMove` Batch move up to 20 messages to a folder **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.batchMove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_ids` | `string[]` | Yes | — | | `destination_id` | `string` | Yes | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_requested` | `number` | Yes | — | | `total_succeeded` | `number` | Yes | — | | `total_failed` | `number` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > original_message_id: string, > moved_message_id?: string, > success: boolean, > status?: number, > error_message?: string > }[] > ``` *** ### batchUpdate `messages.batchUpdate` Batch update up to 20 messages **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.batchUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `updates` | `object[]` | Yes | — | | `user_id` | `string` | No | — | > **updates full type** > > ```ts theme={null} > { > message_id: string, > patch: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `total_requested` | `number` | Yes | — | | `total_succeeded` | `number` | Yes | — | | `total_failed` | `number` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > message_id: string, > success: boolean, > status?: number, > error_message?: string > }[] > ``` *** ### createDraft `messages.createDraft` Create an email draft **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.createDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subject` | `string` | Yes | — | | `body` | `string` | Yes | — | | `is_html` | `boolean` | No | — | | `to_recipients` | `string[]` | No | — | | `cc_recipients` | `string[]` | No | — | | `bcc_recipients` | `string[]` | No | — | | `attachment` | `object` | No | — | > **attachment full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `object` | No | — | | `bodyPreview` | `string` | No | — | | `from` | `object` | No | — | | `sender` | `object` | No | — | | `toRecipients` | `object[]` | No | — | | `ccRecipients` | `object[]` | No | — | | `bccRecipients` | `object[]` | No | — | | `replyTo` | `object[]` | No | — | | `isRead` | `boolean` | No | — | | `isDraft` | `boolean` | No | — | | `hasAttachments` | `boolean` | No | — | | `importance` | `string` | No | — | | `conversationId` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `sentDateTime` | `string` | No | — | | `receivedDateTime` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `webLink` | `string` | No | — | | `changeKey` | `string` | No | — | | `categories` | `string[]` | No | — | | `flag` | `object` | No | — | | `internetMessageId` | `string` | No | — | | `conversationIndex` | `string` | No | — | | `inferenceClassification` | `string` | No | — | | `isReadReceiptRequested` | `boolean` | No | — | | `isDeliveryReceiptRequested` | `boolean` | No | — | > **body full type** > > ```ts theme={null} > { > contentType?: string, > content?: string > } > ``` > **from full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **sender full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **toRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **ccRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **bccRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **replyTo full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **flag full type** > > ```ts theme={null} > { > } > ``` *** ### delete `messages.delete` Delete an email message **Risk:** `destructive` ```ts theme={null} await corsair.outlook.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### forward `messages.forward` Forward an email message **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.forward({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | | `to_recipients` | `string[]` | Yes | — | | `comment` | `string` | No | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `messages.get` Get an email message by ID **Risk:** `read` ```ts theme={null} await corsair.outlook.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | | `user_id` | `string` | No | — | | `select` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `object` | No | — | | `bodyPreview` | `string` | No | — | | `from` | `object` | No | — | | `sender` | `object` | No | — | | `toRecipients` | `object[]` | No | — | | `ccRecipients` | `object[]` | No | — | | `bccRecipients` | `object[]` | No | — | | `replyTo` | `object[]` | No | — | | `isRead` | `boolean` | No | — | | `isDraft` | `boolean` | No | — | | `hasAttachments` | `boolean` | No | — | | `importance` | `string` | No | — | | `conversationId` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `sentDateTime` | `string` | No | — | | `receivedDateTime` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `webLink` | `string` | No | — | | `changeKey` | `string` | No | — | | `categories` | `string[]` | No | — | | `flag` | `object` | No | — | | `internetMessageId` | `string` | No | — | | `conversationIndex` | `string` | No | — | | `inferenceClassification` | `string` | No | — | | `isReadReceiptRequested` | `boolean` | No | — | | `isDeliveryReceiptRequested` | `boolean` | No | — | > **body full type** > > ```ts theme={null} > { > contentType?: string, > content?: string > } > ``` > **from full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **sender full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **toRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **ccRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **bccRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **replyTo full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **flag full type** > > ```ts theme={null} > { > } > ``` *** ### list `messages.list` List email messages in a folder **Risk:** `read` ```ts theme={null} await corsair.outlook.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `folder` | `string` | No | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `select` | `string[]` | No | — | | `orderby` | `string[]` | No | — | | `is_read` | `boolean` | No | — | | `subject` | `string` | No | — | | `subject_contains` | `string` | No | — | | `subject_startswith` | `string` | No | — | | `subject_endswith` | `string` | No | — | | `from_address` | `string` | No | — | | `has_attachments` | `boolean` | No | — | | `importance` | `string` | No | — | | `categories` | `string[]` | No | — | | `conversationId` | `string` | No | — | | `sent_date_time_gt` | `string` | No | — | | `sent_date_time_lt` | `string` | No | — | | `received_date_time_ge` | `string` | No | — | | `received_date_time_gt` | `string` | No | — | | `received_date_time_le` | `string` | No | — | | `received_date_time_lt` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > subject?: string, > body?: { > contentType?: string, > content?: string > }, > bodyPreview?: string, > from?: { > name?: string, > address?: string > }, > sender?: { > name?: string, > address?: string > }, > toRecipients?: { > name?: string, > address?: string > }[], > ccRecipients?: { > name?: string, > address?: string > }[], > bccRecipients?: { > name?: string, > address?: string > }[], > replyTo?: { > name?: string, > address?: string > }[], > isRead?: boolean, > isDraft?: boolean, > hasAttachments?: boolean, > importance?: string, > conversationId?: string, > parentFolderId?: string, > sentDateTime?: string, > receivedDateTime?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > webLink?: string, > changeKey?: string, > categories?: string[], > flag?: { > }, > internetMessageId?: string, > conversationIndex?: string, > inferenceClassification?: string, > isReadReceiptRequested?: boolean | null, > isDeliveryReceiptRequested?: boolean | null > }[] > ``` *** ### move `messages.move` Move a message to a different folder **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | | `destination_id` | `string` | Yes | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `object` | No | — | | `bodyPreview` | `string` | No | — | | `from` | `object` | No | — | | `sender` | `object` | No | — | | `toRecipients` | `object[]` | No | — | | `ccRecipients` | `object[]` | No | — | | `bccRecipients` | `object[]` | No | — | | `replyTo` | `object[]` | No | — | | `isRead` | `boolean` | No | — | | `isDraft` | `boolean` | No | — | | `hasAttachments` | `boolean` | No | — | | `importance` | `string` | No | — | | `conversationId` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `sentDateTime` | `string` | No | — | | `receivedDateTime` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `webLink` | `string` | No | — | | `changeKey` | `string` | No | — | | `categories` | `string[]` | No | — | | `flag` | `object` | No | — | | `internetMessageId` | `string` | No | — | | `conversationIndex` | `string` | No | — | | `inferenceClassification` | `string` | No | — | | `isReadReceiptRequested` | `boolean` | No | — | | `isDeliveryReceiptRequested` | `boolean` | No | — | > **body full type** > > ```ts theme={null} > { > contentType?: string, > content?: string > } > ``` > **from full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **sender full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **toRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **ccRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **bccRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **replyTo full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **flag full type** > > ```ts theme={null} > { > } > ``` *** ### query `messages.query` Query email messages with OData filters **Risk:** `read` ```ts theme={null} await corsair.outlook.api.messages.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `folder` | `string` | No | — | | `filter` | `string` | No | — | | `select` | `string[]` | No | — | | `orderby` | `string` | No | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | | `@odata.count` | `number` | No | — | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > subject?: string, > body?: { > contentType?: string, > content?: string > }, > bodyPreview?: string, > from?: { > name?: string, > address?: string > }, > sender?: { > name?: string, > address?: string > }, > toRecipients?: { > name?: string, > address?: string > }[], > ccRecipients?: { > name?: string, > address?: string > }[], > bccRecipients?: { > name?: string, > address?: string > }[], > replyTo?: { > name?: string, > address?: string > }[], > isRead?: boolean, > isDraft?: boolean, > hasAttachments?: boolean, > importance?: string, > conversationId?: string, > parentFolderId?: string, > sentDateTime?: string, > receivedDateTime?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > webLink?: string, > changeKey?: string, > categories?: string[], > flag?: { > }, > internetMessageId?: string, > conversationIndex?: string, > inferenceClassification?: string, > isReadReceiptRequested?: boolean | null, > isDeliveryReceiptRequested?: boolean | null > }[] > ``` *** ### reply `messages.reply` Reply to an email message **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.reply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | | `comment` | `string` | Yes | — | | `user_id` | `string` | No | — | | `cc_emails` | `string[]` | No | — | | `bcc_emails` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | No | — | | `response_body` | `object` | No | — | > **response\_body full type** > > ```ts theme={null} > { > } > ``` *** ### search `messages.search` Search email messages **Risk:** `read` ```ts theme={null} await corsair.outlook.api.messages.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `subject` | `string` | No | — | | `fromEmail` | `string` | No | — | | `hasAttachments` | `boolean` | No | — | | `size` | `number` | No | — | | `from_index` | `number` | No | — | | `enable_top_results` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | | `@odata.context` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > subject?: string, > body?: { > contentType?: string, > content?: string > }, > bodyPreview?: string, > from?: { > name?: string, > address?: string > }, > sender?: { > name?: string, > address?: string > }, > toRecipients?: { > name?: string, > address?: string > }[], > ccRecipients?: { > name?: string, > address?: string > }[], > bccRecipients?: { > name?: string, > address?: string > }[], > replyTo?: { > name?: string, > address?: string > }[], > isRead?: boolean, > isDraft?: boolean, > hasAttachments?: boolean, > importance?: string, > conversationId?: string, > parentFolderId?: string, > sentDateTime?: string, > receivedDateTime?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > webLink?: string, > changeKey?: string, > categories?: string[], > flag?: { > }, > internetMessageId?: string, > conversationIndex?: string, > inferenceClassification?: string, > isReadReceiptRequested?: boolean | null, > isDeliveryReceiptRequested?: boolean | null > }[] > ``` *** ### send `messages.send` Send an email message **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `to` | `string` | Yes | — | | `subject` | `string` | Yes | — | | `body` | `string` | Yes | — | | `user_id` | `string` | No | — | | `to_name` | `string` | No | — | | `is_html` | `boolean` | No | — | | `cc_emails` | `string[]` | No | — | | `bcc_emails` | `string[]` | No | — | | `from_address` | `string` | No | — | | `save_to_sent_items` | `boolean` | No | — | | `attachment` | `object` | No | — | > **attachment full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status_code` | `number` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > } > ``` *** ### sendDraft `messages.sendDraft` Send a saved draft message **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.sendDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | | `user_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### update `messages.update` Update an email message (e.g. mark as read) **Risk:** `write` ```ts theme={null} await corsair.outlook.api.messages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message_id` | `string` | Yes | — | | `user_id` | `string` | No | — | | `is_read` | `boolean` | No | — | | `subject` | `string` | No | — | | `importance` | `string` | No | — | | `categories` | `string[]` | No | — | | `to_recipients` | `object[]` | No | — | | `cc_recipients` | `object[]` | No | — | | `bcc_recipients` | `object[]` | No | — | | `reply_to` | `object[]` | No | — | | `flag` | `object` | No | — | | `inference_classification` | `string` | No | — | | `is_read_receipt_requested` | `boolean` | No | — | | `is_delivery_receipt_requested` | `boolean` | No | — | > **to\_recipients full type** > > ```ts theme={null} > { > }[] > ``` > **cc\_recipients full type** > > ```ts theme={null} > { > }[] > ``` > **bcc\_recipients full type** > > ```ts theme={null} > { > }[] > ``` > **reply\_to full type** > > ```ts theme={null} > { > }[] > ``` > **flag full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `subject` | `string` | No | — | | `body` | `object` | No | — | | `bodyPreview` | `string` | No | — | | `from` | `object` | No | — | | `sender` | `object` | No | — | | `toRecipients` | `object[]` | No | — | | `ccRecipients` | `object[]` | No | — | | `bccRecipients` | `object[]` | No | — | | `replyTo` | `object[]` | No | — | | `isRead` | `boolean` | No | — | | `isDraft` | `boolean` | No | — | | `hasAttachments` | `boolean` | No | — | | `importance` | `string` | No | — | | `conversationId` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `sentDateTime` | `string` | No | — | | `receivedDateTime` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `webLink` | `string` | No | — | | `changeKey` | `string` | No | — | | `categories` | `string[]` | No | — | | `flag` | `object` | No | — | | `internetMessageId` | `string` | No | — | | `conversationIndex` | `string` | No | — | | `inferenceClassification` | `string` | No | — | | `isReadReceiptRequested` | `boolean` | No | — | | `isDeliveryReceiptRequested` | `boolean` | No | — | > **body full type** > > ```ts theme={null} > { > contentType?: string, > content?: string > } > ``` > **from full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **sender full type** > > ```ts theme={null} > { > name?: string, > address?: string > } > ``` > **toRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **ccRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **bccRecipients full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **replyTo full type** > > ```ts theme={null} > { > name?: string, > address?: string > }[] > ``` > **flag full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/outlook/database Outlook local sync: searchable entities, `.search()` filters, and operators. The Outlook plugin syncs data locally. Use `corsair.outlook.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Calendars Path: `outlook.db.calendars.search` ```ts theme={null} const rows = await corsair.outlook.db.calendars.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `hexColor` | `string` | equals, contains, startsWith, endsWith, in | | `isDefaultCalendar` | `boolean` | equals | | `canEdit` | `boolean` | equals | | `canShare` | `boolean` | equals | | `owner` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `outlook.db.contacts.search` ```ts theme={null} const rows = await corsair.outlook.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `givenName` | `string` | equals, contains, startsWith, endsWith, in | | `surname` | `string` | equals, contains, startsWith, endsWith, in | | `emailAddresses` | `string` | equals, contains, startsWith, endsWith, in | | `mobilePhone` | `string` | equals, contains, startsWith, endsWith, in | | `businessPhones` | `string` | equals, contains, startsWith, endsWith, in | | `jobTitle` | `string` | equals, contains, startsWith, endsWith, in | | `companyName` | `string` | equals, contains, startsWith, endsWith, in | | `department` | `string` | equals, contains, startsWith, endsWith, in | | `officeLocation` | `string` | equals, contains, startsWith, endsWith, in | | `parentFolderId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Events Path: `outlook.db.events.search` ```ts theme={null} const rows = await corsair.outlook.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `bodyPreview` | `string` | equals, contains, startsWith, endsWith, in | | `start` | `string` | equals, contains, startsWith, endsWith, in | | `end` | `string` | equals, contains, startsWith, endsWith, in | | `isAllDay` | `boolean` | equals | | `isCancelled` | `boolean` | equals | | `isOrganizer` | `boolean` | equals | | `isOnlineMeeting` | `boolean` | equals | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `calendarId` | `string` | equals, contains, startsWith, endsWith, in | | `organizer` | `string` | equals, contains, startsWith, endsWith, in | | `importance` | `string` | equals, contains, startsWith, endsWith, in | | `sensitivity` | `string` | equals, contains, startsWith, endsWith, in | | `showAs` | `string` | equals, contains, startsWith, endsWith, in | | `webLink` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Folders Path: `outlook.db.folders.search` ```ts theme={null} const rows = await corsair.outlook.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `parentFolderId` | `string` | equals, contains, startsWith, endsWith, in | | `totalItemCount` | `number` | equals, gt, gte, lt, lte, in | | `unreadItemCount` | `number` | equals, gt, gte, lt, lte, in | | `childFolderCount` | `number` | equals, gt, gte, lt, lte, in | | `isHidden` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `outlook.db.messages.search` ```ts theme={null} const rows = await corsair.outlook.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `bodyPreview` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `toRecipients` | `string` | equals, contains, startsWith, endsWith, in | | `ccRecipients` | `string` | equals, contains, startsWith, endsWith, in | | `isRead` | `boolean` | equals | | `isDraft` | `boolean` | equals | | `hasAttachments` | `boolean` | equals | | `importance` | `string` | equals, contains, startsWith, endsWith, in | | `conversationId` | `string` | equals, contains, startsWith, endsWith, in | | `parentFolderId` | `string` | equals, contains, startsWith, endsWith, in | | `sentDateTime` | `date` | equals, before, after, between | | `receivedDateTime` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `webLink` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/outlook/get-credentials Step-by-step instructions for obtaining Microsoft Outlook OAuth credentials. ## Authentication Method * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 (Microsoft identity platform) ## OAuth App Setup ### Step 1: Register an App in Azure 1. Go to the [Azure portal](https://portal.azure.com) 2. Navigate to **Azure Active Directory** → **App registrations** 3. Click **New registration** 4. Fill in the app name and select the account type 5. Add a redirect URI (e.g., `http://localhost:3456/callback`) under **Web** 6. Click **Register** ### Step 2: Configure API Permissions 1. Go to **API permissions** → **Add a permission** → **Microsoft Graph** 2. Add delegated permissions: * `Mail.ReadWrite` — Read and write emails * `Mail.Send` — Send emails * `Calendars.ReadWrite` — Read and write calendars * `Contacts.ReadWrite` — Read and write contacts ### Step 3: Create a Client Secret 1. Go to **Certificates & secrets** → **New client secret** 2. Give it a description and expiry 3. Copy the **Value** immediately — you won't see it again ### Step 4: Store Credentials ```bash theme={null} pnpm corsair setup --plugin=outlook client_id=your-application-id client_secret=your-client-secret ``` ### Step 5: Authorize ```bash theme={null} pnpm corsair auth --plugin=outlook ``` This opens a browser window to complete the Microsoft OAuth flow. Tokens are saved automatically. ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Application (Client) ID | OAuth flow | Azure App registration → Overview | | Client Secret | OAuth flow | Azure App registration → Certificates & secrets | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/outlook/overview Microsoft email and calendar service for messages, events, contacts, and scheduling. Use **Outlook** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 37 typed API operations * 5 synced entities (`calendars`, `contacts`, `events`, `folders`, `messages`) for fast `.search()` / `.list()` * 6 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/outlook ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/outlook ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/outlook ``` ```bash bun theme={null} bun add corsair @corsair-dev/outlook ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { outlook } from '@corsair-dev/outlook'; export const corsair = createCorsair({ plugins: [ outlook({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Outlook** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/outlook/get-credentials). ```ts theme={null} outlook({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Outlook OAuth app. Provider walkthrough: [Get Credentials](/plugins/outlook/get-credentials). ```ts theme={null} outlook() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'outlook', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List messages** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.outlook.api.messages.list({}); ``` **Send a message** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.outlook.api.messages.send({ to: 'you@example.com', subject: 'Hello from Corsair', body: 'Hello from Corsair' }); ``` See the full list on the [API](/plugins/outlook/api) page. ## Query synced data Search synced mail without hitting Outlook. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.outlook.db.messages.search({ data: { isRead: false }, limit: 50, }); ``` Synced entities: `calendars`, `contacts`, `events`, `folders`, `messages`. See [Database](/plugins/outlook/database) for filters and operators. ## Webhooks Fires when a new Outlook message arrives. ```ts theme={null} outlook({ webhookHooks: { messages: { newMessage: { after: async (ctx, result) => { console.log('Outlook message:', result.corsairEntityId); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/outlook/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/outlook/api)** > > Every `outlook.api.*` operation with input and output types. > **[Database](/plugins/outlook/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/outlook/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/outlook/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/outlook/webhooks Outlook incoming webhooks: event paths, payloads, and response data. The Outlook plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/outlook/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `contacts` * `newContact` (`contacts.newContact`) * `events` * `eventChange` (`events.eventChange`) * `newEvent` (`events.newEvent`) * `messages` * `newMessage` (`messages.newMessage`) * `sentMessage` (`messages.sentMessage`) * `subscriptionValidation` (`subscriptionValidation`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Contacts ### New Contact `contacts.newContact` Triggered when a new contact is added in Outlook contacts **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType?: created | updated | deleted, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType: created, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > } > ``` **`webhookHooks` example** ```ts theme={null} outlook({ webhookHooks: { contacts: { newContact: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Events ### Event Change `events.eventChange` Triggered when a calendar event is created, updated, or deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType?: created | updated | deleted, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType: created | updated | deleted, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > } > ``` **`webhookHooks` example** ```ts theme={null} outlook({ webhookHooks: { events: { eventChange: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### New Event `events.newEvent` Triggered when a new calendar event is created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType?: created | updated | deleted, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType: created, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > } > ``` **`webhookHooks` example** ```ts theme={null} outlook({ webhookHooks: { events: { newEvent: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Messages ### New Message `messages.newMessage` Triggered when a new message is received in the Outlook mailbox **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType?: created | updated | deleted, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType: created, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > } > ``` **`webhookHooks` example** ```ts theme={null} outlook({ webhookHooks: { messages: { newMessage: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Sent Message `messages.sentMessage` Triggered when a message is sent from the Outlook mailbox **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType?: created | updated | deleted, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId?: string, > subscriptionExpirationDateTime?: string, > changeType: created, > resource?: string, > resourceData?: { > @odata.type?: string, > @odata.id?: string, > @odata.etag?: string, > id?: string > }, > clientState?: string, > tenantId?: string, > eventType?: string > } > ``` **`webhookHooks` example** ```ts theme={null} outlook({ webhookHooks: { messages: { sentMessage: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Subscription Validation ### Subscription Validation `subscriptionValidation` Microsoft Graph subscription validation handshake **Payload** | Name | Type | Required | Description | | - | - | - | - | | `validationToken` | `string` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > validationToken: string > } > ``` **`webhookHooks` example** ```ts theme={null} outlook({ webhookHooks: { subscriptionValidation: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/pagerduty/api API reference for PagerDuty: every `pagerduty.api.*` operation with input and output types. Every `pagerduty.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Incident Notes ### create `incidentNotes.create` Add a note to an incident **Risk:** `write` ```ts theme={null} await corsair.pagerduty.api.incidentNotes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `incident_id` | `string` | Yes | — | | `content` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `note` | `object` | Yes | — | > **note full type** > > ```ts theme={null} > { > id: string, > content?: string, > created_at?: string, > user?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > channel?: { > type?: string, > name?: string > } > } > ``` *** ### list `incidentNotes.list` List notes for an incident **Risk:** `read` ```ts theme={null} await corsair.pagerduty.api.incidentNotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `incident_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `notes` | `object[]` | Yes | — | > **notes full type** > > ```ts theme={null} > { > id: string, > content?: string, > created_at?: string, > user?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > channel?: { > type?: string, > name?: string > } > }[] > ``` *** ## Incidents ### create `incidents.create` Create a new incident **Risk:** `write` ```ts theme={null} await corsair.pagerduty.api.incidents.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `from` | `string` | Yes | — | | `service` | `object` | Yes | — | | `urgency` | `high \| low` | No | — | | `body` | `object` | No | — | | `escalation_policy` | `object` | No | — | | `assignments` | `object[]` | No | — | > **service full type** > > ```ts theme={null} > { > id: string, > type: service_reference > } > ``` > **body full type** > > ```ts theme={null} > { > type: incident_body, > details: string > } > ``` > **escalation\_policy full type** > > ```ts theme={null} > { > id: string, > type: escalation_policy_reference > } > ``` > **assignments full type** > > ```ts theme={null} > { > assignee: { > id: string, > type: user_reference > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `incident` | `object` | Yes | — | > **incident full type** > > ```ts theme={null} > { > id: string, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignments?: { > at: string, > assignee: { > id: string, > type: string, > summary?: string, > html_url?: string | null > } > }[], > body?: { > type?: string, > details?: string > } > } > ``` *** ### get `incidents.get` Get a single incident by ID **Risk:** `read` ```ts theme={null} await corsair.pagerduty.api.incidents.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `incident` | `object` | Yes | — | > **incident full type** > > ```ts theme={null} > { > id: string, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignments?: { > at: string, > assignee: { > id: string, > type: string, > summary?: string, > html_url?: string | null > } > }[], > body?: { > type?: string, > details?: string > } > } > ``` *** ### list `incidents.list` List incidents with optional filters **Risk:** `read` ```ts theme={null} await corsair.pagerduty.api.incidents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `statuses` | `triggered \| acknowledged \| resolved[]` | No | — | | `since` | `string` | No | — | | `until` | `string` | No | — | | `urgencies` | `high \| low[]` | No | — | | `service_ids` | `string[]` | No | — | | `team_ids` | `string[]` | No | — | | `sort_by` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `incidents` | `object[]` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `more` | `boolean` | No | — | | `total` | `number` | No | — | > **incidents full type** > > ```ts theme={null} > { > id: string, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignments?: { > at: string, > assignee: { > id: string, > type: string, > summary?: string, > html_url?: string | null > } > }[], > body?: { > type?: string, > details?: string > } > }[] > ``` *** ### update `incidents.update` Update an incident (acknowledge, resolve, reassign) **Risk:** `write` ```ts theme={null} await corsair.pagerduty.api.incidents.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `acknowledged \| resolved` | No | — | | `urgency` | `high \| low` | No | — | | `title` | `string` | No | — | | `assignments` | `object[]` | No | — | | `escalation_policy` | `object` | No | — | > **assignments full type** > > ```ts theme={null} > { > assignee: { > id: string, > type: user_reference > } > }[] > ``` > **escalation\_policy full type** > > ```ts theme={null} > { > id: string, > type: escalation_policy_reference > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `incident` | `object` | Yes | — | > **incident full type** > > ```ts theme={null} > { > id: string, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignments?: { > at: string, > assignee: { > id: string, > type: string, > summary?: string, > html_url?: string | null > } > }[], > body?: { > type?: string, > details?: string > } > } > ``` *** ## Log Entries ### get `logEntries.get` Get a single log entry by ID **Risk:** `read` ```ts theme={null} await corsair.pagerduty.api.logEntries.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `include` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `log_entry` | `object` | Yes | — | > **log\_entry full type** > > ```ts theme={null} > { > id: string, > type?: string, > summary?: string, > created_at?: string, > html_url?: string | null, > incident?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > agent?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > channel?: { > type: string, > name?: string > } > } > ``` *** ### list `logEntries.list` List log entries **Risk:** `read` ```ts theme={null} await corsair.pagerduty.api.logEntries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `since` | `string` | No | — | | `until` | `string` | No | — | | `is_overview` | `boolean` | No | — | | `include` | `string[]` | No | — | | `team_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `log_entries` | `object[]` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `more` | `boolean` | No | — | | `total` | `number` | No | — | > **log\_entries full type** > > ```ts theme={null} > { > id: string, > type?: string, > summary?: string, > created_at?: string, > html_url?: string | null, > incident?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > agent?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > channel?: { > type: string, > name?: string > } > }[] > ``` *** ## Users ### get `users.get` Get a user by ID **Risk:** `read` ```ts theme={null} await corsair.pagerduty.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `include` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: string, > name?: string, > email?: string, > role?: string, > description?: string | null, > time_zone?: string, > html_url?: string, > avatar_url?: string, > color?: string, > contact_methods?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > notification_rules?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/pagerduty/database PagerDuty local sync: searchable entities, `.search()` filters, and operators. The PagerDuty plugin syncs data locally. Use `corsair.pagerduty.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Incidents Path: `pagerduty.db.incidents.search` ```ts theme={null} const rows = await corsair.pagerduty.db.incidents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `incident_number` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `html_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `updated_at` | `date` | equals, before, after, between | | `resolved_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/pagerduty/get-credentials Step-by-step instructions for obtaining PagerDuty REST API tokens and webhook signing secrets for the Corsair PagerDuty plugin. This guide walks you through obtaining all required credentials for the PagerDuty plugin. ## Authentication Method The PagerDuty plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) — REST API token sent as `Authorization: Token token=` ## API Token ### Step 1: Create an API Token 1. Log in to [PagerDuty](https://www.pagerduty.com/). 2. Open your user menu → **User settings** → **User settings** (or **API access** / **Personal settings** depending on UI). 3. Under **API Access**, create a new **API token** (General Access with REST API, or the token type your organization allows for automation). 4. Copy the token when shown — you may not be able to view it again. Use a token with at least the permissions required for the incidents, notes, and log-entry operations you plan to call. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=pagerduty api_key=your-api-token ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=pagerduty --credentials ``` ## Webhook Signing Secret PagerDuty v3 webhooks can be verified using a signing secret associated with your webhook subscription. 1. In PagerDuty, open **Integrations** → **Generic Webhooks** (or your webhook subscription type). 2. Create or edit a subscription pointing at your HTTPS endpoint. 3. Copy the **signing secret** (or signing key) PagerDuty provides for verifying `X-Pagerduty-Signature`. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=pagerduty webhook_signature=your-signing-secret ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | REST API token | [`api_key`](/concepts/api-key) auth | User settings → API access | | Webhook signing secret | Webhooks | Webhook subscription details | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/pagerduty/overview Incident response platform for on-call schedules, alerts, and operational reliability workflows. Use **PagerDuty** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 9 typed API operations * 1 synced entity (`incidents`) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/pagerduty ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/pagerduty ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/pagerduty ``` ```bash bun theme={null} bun add corsair @corsair-dev/pagerduty ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { pagerduty } from '@corsair-dev/pagerduty'; export const corsair = createCorsair({ plugins: [ pagerduty(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/pagerduty/get-credentials). ```ts theme={null} pagerduty() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'pagerduty', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`incidentNotes.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pagerduty.api.incidentNotes.list({}); ``` **`incidentNotes.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pagerduty.api.incidentNotes.create({}); ``` See the full list on the [API](/plugins/pagerduty/api) page. ## Query synced data Synced entities support `tenant.pagerduty.db..search()` and `.list()`: `incidents`. See [Database](/plugins/pagerduty/database) for filters and operators. ## Webhooks This plugin registers **4** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/pagerduty/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/pagerduty/api)** > > Every `pagerduty.api.*` operation with input and output types. > **[Database](/plugins/pagerduty/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/pagerduty/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/pagerduty/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/pagerduty/webhooks PagerDuty incoming webhooks: event paths, payloads, and response data. The PagerDuty plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/pagerduty/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `incidents` * `acknowledged` (`incidents.acknowledged`) * `assigned` (`incidents.assigned`) * `resolved` (`incidents.resolved`) * `triggered` (`incidents.triggered`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Incidents ### Acknowledged `incidents.acknowledged` An incident was acknowledged **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id: string, > event_type: incident.triggered, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.acknowledged, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.resolved, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.assigned, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: string, > resource_type: string, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > event_type: incident.acknowledged, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} pagerduty({ webhookHooks: { incidents: { acknowledged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Assigned `incidents.assigned` An incident was assigned to a user or escalation policy **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id: string, > event_type: incident.triggered, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.acknowledged, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.resolved, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.assigned, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: string, > resource_type: string, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > event_type: incident.assigned, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} pagerduty({ webhookHooks: { incidents: { assigned: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Resolved `incidents.resolved` An incident was resolved **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id: string, > event_type: incident.triggered, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.acknowledged, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.resolved, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.assigned, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: string, > resource_type: string, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > event_type: incident.resolved, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} pagerduty({ webhookHooks: { incidents: { resolved: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Triggered `incidents.triggered` An incident was triggered (created) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `object` | Yes | — | > **event full type** > > ```ts theme={null} > { > id: string, > event_type: incident.triggered, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.acknowledged, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.resolved, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: incident.assigned, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } | { > id: string, > event_type: string, > resource_type: string, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > event_type: incident.triggered, > resource_type: incident, > occurred_at: string, > agent?: { > id?: string, > type?: string, > summary?: string, > html_url?: string | null > }, > client?: { > name?: string > } | null, > data: { > id: string, > type: incident, > incident_number?: number, > title?: string, > status?: triggered | acknowledged | resolved, > urgency?: high | low, > html_url?: string, > created_at?: string, > updated_at?: string, > resolved_at?: string | null, > service?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > escalation_policy?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }, > teams?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[], > assignees?: { > id: string, > type: string, > summary?: string, > html_url?: string | null > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} pagerduty({ webhookHooks: { incidents: { triggered: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/parseur/api API reference for Parseur: every `parseur.api.*` operation with input and output types. Every `parseur.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Bootstrap ### getBootstrap `bootstrap.getBootstrap` Retrieve bootstrap configuration: choices, mappings, max\_field\_lengths, email\_domain, extra\_fields, and master\_parser\_set. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.bootstrap.getBootstrap({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `choices` | `object` | Yes | — | | `mappings` | `object` | Yes | — | | `max_field_lengths` | `object` | Yes | — | | `email_domain` | `string` | Yes | — | | `extra_fields` | `any[]` | Yes | — | | `master_parser_set` | `any[]` | Yes | — | > **choices full type** > > ```ts theme={null} > { > } > ``` > **mappings full type** > > ```ts theme={null} > { > } > ``` > **max\_field\_lengths full type** > > ```ts theme={null} > { > } > ``` *** ## Documents ### copyDocument `documents.copyDocument` Copy a document to another mailbox. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.documents.copyDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `target_mailbox_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `notification_set` | `object` | Yes | — | > **notification\_set full type** > > ```ts theme={null} > { > info: string[] > } > ``` *** ### createEmailDocument `documents.createEmailDocument` Upload an email or text document to Parseur for parsing. Requires subject, from, and recipient. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.documents.createEmailDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subject` | `string` | Yes | — | | `from` | `string` | Yes | — | | `recipient` | `string` | Yes | — | | `to` | `string` | No | — | | `cc` | `string` | No | — | | `bcc` | `string` | No | — | | `body_html` | `string` | No | — | | `body_plain` | `string` | No | — | | `message_headers` | `tuple[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `DocumentID` | `string` | No | — | | `DocumentIDs` | `string[]` | No | — | | `attachments` | `object[]` | No | — | > **attachments full type** > > ```ts theme={null} > { > name?: string, > DocumentID?: string > }[] > ``` *** ### deleteDocument `documents.deleteDocument` Delete a document by ID \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.parseur.api.documents.deleteDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getDocument `documents.getDocument` Retrieve full details of a document by ID: status, processing info, parsed results, and download URLs. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.documents.getDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `parser` | `number` | No | — | | `status` | `INCOMING \| ANALYZING \| PROGRESS \| PARSEDOK \| PARSEDKO \| QUOTAEXC \| SKIPPED \| SPLIT \| EXPORTKO \| TRANSKO \| INVALID \| string` | No | — | | `received` | `string` | No | — | | `processed` | `string` | No | — | | `result` | `object` | No | — | | `json_download_url` | `string` | No | — | | `csv_download_url` | `string` | No | — | | `xls_download_url` | `string` | No | — | > **result full type** > > ```ts theme={null} > string | { > } | null > ``` *** ### getDocumentLogs `documents.getDocumentLogs` Get document logs for a document. Returns a paginated list of logs with status, source, and message details. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.documents.getDocumentLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `current` | `number` | No | — | | `total` | `number` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string | number, > created?: string, > status?: string, > source?: string, > message?: string, > code?: string > }[] > ``` *** ### listDocuments `documents.listDocuments` List documents within a mailbox. Use when you need to paginate, search, or sort documents after obtaining the mailbox ID. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.documents.listDocuments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `search` | `string` | No | — | | `ordering` | `name \| -name \| created \| -created \| processed \| -processed \| status \| -status` | No | — | | `status` | `INCOMING \| ANALYZING \| PROGRESS \| PARSEDOK \| PARSEDKO \| QUOTAEXC \| SKIPPED \| SPLIT \| EXPORTKO \| TRANSKO \| INVALID` | No | — | | `received_after` | `string` | No | — | | `received_before` | `string` | No | — | | `tz` | `string` | No | — | | `with_result` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `current` | `number` | No | — | | `total` | `number` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > parser?: number, > status?: INCOMING | ANALYZING | PROGRESS | PARSEDOK | PARSEDKO | QUOTAEXC | SKIPPED | SPLIT | EXPORTKO | TRANSKO | INVALID | string, > received?: string, > processed?: string | null, > result?: string | { > } | null, > json_download_url?: string | null, > csv_download_url?: string | null, > xls_download_url?: string | null > }[] > ``` *** ### processDocument `documents.processDocument` Reprocess a document with the current template configuration. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.documents.processDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `notification_set` | `object` | Yes | — | > **notification\_set full type** > > ```ts theme={null} > { > info: string[] > } > ``` *** ### skipDocument `documents.skipDocument` Skip a document. Marks the document with status SKIPPED. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.documents.skipDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `parser` | `number` | No | — | | `status` | `INCOMING \| ANALYZING \| PROGRESS \| PARSEDOK \| PARSEDKO \| QUOTAEXC \| SKIPPED \| SPLIT \| EXPORTKO \| TRANSKO \| INVALID \| string` | No | — | | `received` | `string` | No | — | | `processed` | `string` | No | — | | `result` | `object` | No | — | | `json_download_url` | `string` | No | — | | `csv_download_url` | `string` | No | — | | `xls_download_url` | `string` | No | — | > **result full type** > > ```ts theme={null} > string | { > } | null > ``` *** ### uploadDocument `documents.uploadDocument` Upload a binary file to a Parseur mailbox as multipart/form-data. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.documents.uploadDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `file` | `string` | Yes | — | | `file_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | | `attachments` | `object[]` | Yes | — | > **attachments full type** > > ```ts theme={null} > { > name?: string, > DocumentID?: string > }[] > ``` *** ## Export Configs ### createExportConfig `exportConfigs.createExportConfig` Create a custom download for a mailbox. Requires type and items (field names). **Risk:** `write` ```ts theme={null} await corsair.parseur.api.exportConfigs.createExportConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | Yes | — | | `type` | `PARSER \| PARSER_FIELD` | No | — | | `items` | `string[]` | Yes | — | | `parser_field_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `type` | `PARSER \| PARSER_FIELD` | No | — | | `items` | `string[]` | No | — | | `parser_field_id` | `string` | No | — | | `parser_field_name` | `string` | No | — | | `csv_download` | `string` | No | — | | `xls_download` | `string` | No | — | *** ### deleteExportConfig `exportConfigs.deleteExportConfig` Delete a custom download from a mailbox \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.parseur.api.exportConfigs.deleteExportConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mailbox_id` | `string \| number` | Yes | — | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### listExportConfigs `exportConfigs.listExportConfigs` List custom downloads (export configurations) for a mailbox. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.exportConfigs.listExportConfigs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `current` | `number` | No | — | | `total` | `number` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > type?: PARSER | PARSER_FIELD, > items?: string[], > parser_field_id?: string | null, > parser_field_name?: string | null, > csv_download?: string, > xls_download?: string > }[] > ``` *** ### updateExportConfig `exportConfigs.updateExportConfig` Update a custom download field list, name, or type for an existing configuration. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.exportConfigs.updateExportConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mailbox_id` | `string \| number` | Yes | — | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `type` | `PARSER \| PARSER_FIELD` | No | — | | `items` | `string[]` | No | — | | `parser_field_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `type` | `PARSER \| PARSER_FIELD` | No | — | | `items` | `string[]` | No | — | | `parser_field_id` | `string` | No | — | | `parser_field_name` | `string` | No | — | | `csv_download` | `string` | No | — | | `xls_download` | `string` | No | — | *** ## Mailboxes ### copyMailbox `mailboxes.copyMailbox` Copy a mailbox (parser) in Parseur. Creates a duplicate of the mailbox with all its configuration. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.mailboxes.copyMailbox({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `notification_set` | `object` | Yes | — | > **notification\_set full type** > > ```ts theme={null} > { > info: string[] > } > ``` *** ### createMailbox `mailboxes.createMailbox` Create a new mailbox (parser) in Parseur. Use when you need to set up a new parser for document parsing with custom configuration. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.mailboxes.createMailbox({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `ai_engine` | `DISABLED \| GCP_AI_2 \| GCP_AI_2_5 \| GCP_AI_3_TXT` | No | — | | `ai_instructions` | `string` | No | — | | `email_prefix` | `string` | No | — | | `attachments_only_override` | `boolean` | No | — | | `disable_deskew` | `boolean` | No | — | | `force_ocr` | `boolean` | No | — | | `decimal_separator` | `. \| ,` | No | — | | `input_date_format` | `MONTH_FIRST \| DAY_FIRST` | No | — | | `retention_policy` | `any` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `account_uuid` | `string` | No | — | | `ai_engine` | `string` | No | — | | `ai_instructions` | `string` | No | — | | `email_prefix` | `string` | No | — | | `document_count` | `number` | No | — | | `template_count` | `number` | No | — | | `webhook_count` | `number` | No | — | | `attachments_only` | `boolean` | No | — | | `is_master` | `boolean` | No | — | | `webhook_set` | `any[]` | No | — | | `available_webhook_set` | `any[]` | No | — | *** ### deleteMailbox `mailboxes.deleteMailbox` Delete a mailbox (parser) by ID \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.parseur.api.mailboxes.deleteMailbox({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getMailbox `mailboxes.getMailbox` Retrieve full mailbox (parser) configuration by ID, including fields, webhooks, and settings. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.mailboxes.getMailbox({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `account_uuid` | `string` | No | — | | `ai_engine` | `string` | No | — | | `ai_instructions` | `string` | No | — | | `email_prefix` | `string` | No | — | | `document_count` | `number` | No | — | | `template_count` | `number` | No | — | | `webhook_count` | `number` | No | — | | `attachments_only` | `boolean` | No | — | | `is_master` | `boolean` | No | — | | `webhook_set` | `any[]` | No | — | | `available_webhook_set` | `any[]` | No | — | *** ### getMailboxSchema `mailboxes.getMailboxSchema` Retrieve the JSON schema for a mailbox's parsed fields. Use when you need the structure and types of data fields extracted by a parser. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.mailboxes.getMailboxSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `properties` | `object` | Yes | — | > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### listMailboxes `mailboxes.listMailboxes` List mailboxes (parsers) with full configuration details. Use when you need comprehensive mailbox information including field configurations, processing options, and webhook settings. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.mailboxes.listMailboxes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `search` | `string` | No | — | | `ordering` | `name \| -name \| document_count \| -document_count \| template_count \| -template_count \| PARSEDOK_count \| -PARSEDOK_count \| PARSEDKO_count \| -PARSEDKO_count \| QUOTAEXC_count \| -QUOTAEXC_count \| EXPORTKO_count \| -EXPORTKO_count \| TRANSKO_count \| -TRANSKO_count` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `current` | `number` | No | — | | `total` | `number` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > account_uuid?: string, > ai_engine?: string, > ai_instructions?: string | null, > email_prefix?: string, > document_count?: number, > template_count?: number, > webhook_count?: number, > attachments_only?: boolean, > is_master?: boolean, > webhook_set?: any[], > available_webhook_set?: any[] > }[] > ``` *** ### updateMailbox `mailboxes.updateMailbox` Update a mailbox (parser) configuration such as name, AI engine, processing options, or document handling rules. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.mailboxes.updateMailbox({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `ai_engine` | `DISABLED \| GCP_AI_2 \| GCP_AI_2_5 \| GCP_AI_3_TXT` | No | — | | `ai_instructions` | `string` | No | — | | `email_prefix` | `string` | No | — | | `attachments_only_override` | `boolean` | No | — | | `disable_deskew` | `boolean` | No | — | | `force_ocr` | `boolean` | No | — | | `decimal_separator` | `. \| ,` | No | — | | `input_date_format` | `MONTH_FIRST \| DAY_FIRST` | No | — | | `retention_policy` | `any` | No | — | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `account_uuid` | `string` | No | — | | `ai_engine` | `string` | No | — | | `ai_instructions` | `string` | No | — | | `email_prefix` | `string` | No | — | | `document_count` | `number` | No | — | | `template_count` | `number` | No | — | | `webhook_count` | `number` | No | — | | `attachments_only` | `boolean` | No | — | | `is_master` | `boolean` | No | — | | `webhook_set` | `any[]` | No | — | | `available_webhook_set` | `any[]` | No | — | *** ## Templates ### copyTemplate `templates.copyTemplate` Copy a template to another mailbox. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.templates.copyTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `target_mailbox_id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `notification_set` | `object` | Yes | — | > **notification\_set full type** > > ```ts theme={null} > { > info: string[] > } > ``` *** ### deleteTemplate `templates.deleteTemplate` Delete a template by ID \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.parseur.api.templates.deleteTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getTemplate `templates.getTemplate` Get a template by ID. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.templates.getTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `parser` | `number` | No | — | | `engine` | `TXT \| OCR \| string` | No | — | | `action` | `string` | No | — | | `status` | `DRAFT \| PROD \| string` | No | — | *** ### listTemplates `templates.listTemplates` List all templates in a mailbox. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.templates.listTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `search` | `string` | No | — | | `ordering` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `current` | `number` | No | — | | `total` | `number` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > parser?: number, > engine?: TXT | OCR | string, > action?: string, > status?: DRAFT | PROD | string > }[] > ``` *** ## Webhooks ### createWebhook `webhooks.createWebhook` Create a webhook. Official body uses target (URL), event, and category CUSTOM. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.webhooks.createWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event` | `document.processed \| document.processed.flattened \| document.template_needed \| document.export_failed \| table.processed` | Yes | — | | `target` | `string` | Yes | — | | `category` | `CUSTOM \| ZAPIER \| MAKE \| FLOW \| N8N` | No | — | | `name` | `string` | No | — | | `headers` | `object` | No | — | | `parser` | `number` | No | — | | `parser_field` | `string` | No | — | > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `event` | `document.processed \| document.processed.flattened \| document.template_needed \| document.export_failed \| table.processed \| string` | Yes | — | | `target` | `string` | Yes | — | | `name` | `string` | No | — | | `headers` | `object` | No | — | | `category` | `CUSTOM \| ZAPIER \| MAKE \| FLOW \| N8N \| string` | Yes | — | | `parser_field_set` | `string[]` | No | — | > **headers full type** > > ```ts theme={null} > { > } > ``` *** ### deleteWebhook `webhooks.deleteWebhook` Delete a webhook by ID \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.parseur.api.webhooks.deleteWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### disableWebhook `webhooks.disableWebhook` Disable a webhook for a mailbox. Removes the webhook from webhook\_set. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.webhooks.disableWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mailbox_id` | `string \| number` | Yes | — | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### enableWebhook `webhooks.enableWebhook` Enable a paused webhook for a mailbox. Only webhooks in available\_webhook\_set can be enabled. **Risk:** `write` ```ts theme={null} await corsair.parseur.api.webhooks.enableWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mailbox_id` | `string \| number` | Yes | — | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `account_uuid` | `string` | No | — | | `ai_engine` | `string` | No | — | | `ai_instructions` | `string` | No | — | | `email_prefix` | `string` | No | — | | `document_count` | `number` | No | — | | `template_count` | `number` | No | — | | `webhook_count` | `number` | No | — | | `attachments_only` | `boolean` | No | — | | `is_master` | `boolean` | No | — | | `webhook_set` | `any[]` | No | — | | `available_webhook_set` | `any[]` | No | — | *** ### listWebhooks `webhooks.listWebhooks` List active (webhook\_set) and paused (available\_webhook\_set) webhooks for a mailbox via GET /parser/. **Risk:** `read` ```ts theme={null} await corsair.parseur.api.webhooks.listWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhook_set` | `object[]` | Yes | — | | `available_webhook_set` | `object[]` | Yes | — | > **webhook\_set full type** > > ```ts theme={null} > { > id: number, > event: document.processed | document.processed.flattened | document.template_needed | document.export_failed | table.processed | string, > target: string, > name?: string, > headers?: { > } | null, > category: CUSTOM | ZAPIER | MAKE | FLOW | N8N | string, > parser_field_set?: string[] > }[] > ``` > **available\_webhook\_set full type** > > ```ts theme={null} > { > id: number, > event: document.processed | document.processed.flattened | document.template_needed | document.export_failed | table.processed | string, > target: string, > name?: string, > headers?: { > } | null, > category: CUSTOM | ZAPIER | MAKE | FLOW | N8N | string, > parser_field_set?: string[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/parseur/database Parseur local sync: searchable entities, `.search()` filters, and operators. The Parseur plugin syncs data locally. Use `corsair.parseur.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Documents Path: `parseur.db.documents.search` ```ts theme={null} const rows = await corsair.parseur.db.documents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `parser` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `received` | `string` | equals, contains, startsWith, endsWith, in | | `processed` | `string` | equals, contains, startsWith, endsWith, in | | `result` | `string` | equals, contains, startsWith, endsWith, in | | `json_download_url` | `string` | equals, contains, startsWith, endsWith, in | | `csv_download_url` | `string` | equals, contains, startsWith, endsWith, in | | `xls_download_url` | `string` | equals, contains, startsWith, endsWith, in | | `original_document_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Export Configs Path: `parseur.db.exportConfigs.search` ```ts theme={null} const rows = await corsair.parseur.db.exportConfigs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `parser_field_id` | `string` | equals, contains, startsWith, endsWith, in | | `parser_field_name` | `string` | equals, contains, startsWith, endsWith, in | | `csv_download` | `string` | equals, contains, startsWith, endsWith, in | | `xls_download` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Logs Path: `parseur.db.logs.search` ```ts theme={null} const rows = await corsair.parseur.db.logs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `document` | `number` | equals, gt, gte, lt, lte, in | | `document_name` | `string` | equals, contains, startsWith, endsWith, in | | `parser` | `number` | equals, gt, gte, lt, lte, in | | `parser_name` | `string` | equals, contains, startsWith, endsWith, in | | `template` | `number` | equals, gt, gte, lt, lte, in | | `template_name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Parsers Path: `parseur.db.parsers.search` ```ts theme={null} const rows = await corsair.parseur.db.parsers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `account_uuid` | `string` | equals, contains, startsWith, endsWith, in | | `ai_engine` | `string` | equals, contains, startsWith, endsWith, in | | `ai_instructions` | `string` | equals, contains, startsWith, endsWith, in | | `email_prefix` | `string` | equals, contains, startsWith, endsWith, in | | `document_count` | `number` | equals, gt, gte, lt, lte, in | | `template_count` | `number` | equals, gt, gte, lt, lte, in | | `webhook_count` | `number` | equals, gt, gte, lt, lte, in | | `attachments_only` | `boolean` | equals | | `is_master` | `boolean` | equals | | `last_activity` | `string` | equals, contains, startsWith, endsWith, in | | `decimal_separator` | `string` | equals, contains, startsWith, endsWith, in | | `default_timezone` | `string` | equals, contains, startsWith, endsWith, in | | `csv_download` | `string` | equals, contains, startsWith, endsWith, in | | `json_download` | `string` | equals, contains, startsWith, endsWith, in | | `xls_download` | `string` | equals, contains, startsWith, endsWith, in | | `secret` | `string` | equals, contains, startsWith, endsWith, in | | `ai_split_instructions` | `string` | equals, contains, startsWith, endsWith, in | | `workflow_enabled` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `parseur.db.templates.search` ```ts theme={null} const rows = await corsair.parseur.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `parser` | `number` | equals, gt, gte, lt, lte, in | | `engine` | `string` | equals, contains, startsWith, endsWith, in | | `action` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `document_count` | `number` | equals, gt, gte, lt, lte, in | | `last_activity` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `parseur.db.webhooks.search` ```ts theme={null} const rows = await corsair.parseur.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `event` | `string` | equals, contains, startsWith, endsWith, in | | `target` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/parseur/overview Document parsing service that extracts structured data from emails and PDF attachments. Use **Parseur** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 30 typed API operations * 6 synced entities (`documents`, `exportConfigs`, `logs`, `parsers`, `templates`, `webhooks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/parseur ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/parseur ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/parseur ``` ```bash bun theme={null} bun add corsair @corsair-dev/parseur ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { parseur } from '@corsair-dev/parseur'; export const corsair = createCorsair({ plugins: [ parseur(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} parseur() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'parseur', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`bootstrap.getBootstrap`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.parseur.api.bootstrap.getBootstrap({}); ``` **`documents.copyDocument`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.parseur.api.documents.copyDocument({}); ``` See the full list on the [API](/plugins/parseur/api) page. ## Query synced data Synced entities support `tenant.parseur.db..search()` and `.list()`: `documents`, `exportConfigs`, `logs`, `parsers`, `templates`, `webhooks`. See [Database](/plugins/parseur/database) for filters and operators. ## What's next > **[API reference](/plugins/parseur/api)** > > Every `parseur.api.*` operation with input and output types. > **[Database](/plugins/parseur/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/pdfco/api API reference for Pdfco: every `pdfco.api.*` operation with input and output types. Every `pdfco.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account Balance ### accountBalance `accountBalance` Get remaining PDF.co credit balance **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.accountBalance({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | Yes | — | | `jobId` | `string` | No | — | *** ## Barcode Generate ### barcodeGenerate `barcodeGenerate` Generate a barcode image **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.barcodeGenerate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | Barcode type, e.g. "QRCode" or "Code128" | | `value` | `string` | Yes | Value to encode inside the barcode | | `name` | `string` | No | Output file name | | `inline` | `boolean` | No | Return image inline | | `decorationImage` | `string` | No | Logo image URL embedded inside QR-Code barcodes | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Document Parser ### documentParser `documentParser` Extract structured data with a parser template **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.documentParser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `templateId` | `string` | No | Parser template id from PDF.co | | `template` | `string` | No | Inline YAML parser template | | `password` | `string` | No | PDF password if protected | | `inline` | `boolean` | No | Return parsed data inline in body | | `pages` | `string` | No | Page indices; default all | | `outputFormat` | `JSON \| CSV \| XML` | No | Parsed output format | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > objects?: { > }[], > elapsed?: number, > templateName?: string, > templateVersion?: string, > timestamp?: string > } > ``` *** ## Excel To Csv ### excelToCsv `excelToCsv` Convert Excel to CSV **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.excelToCsv({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source xls/xlsx/csv file | | `inline` | `boolean` | No | Return converted content inline | | `worksheetIndex` | `string` | No | Worksheet index, 1-based | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** ## Excel To Html ### excelToHtml `excelToHtml` Convert Excel to HTML **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.excelToHtml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source xls/xlsx/csv file | | `inline` | `boolean` | No | Return converted content inline | | `worksheetIndex` | `string` | No | Worksheet index, 1-based | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** ## Excel To Json ### excelToJson `excelToJson` Convert Excel to JSON **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.excelToJson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source xls/xlsx/csv file | | `inline` | `boolean` | No | Return converted content inline | | `worksheetIndex` | `string` | No | Worksheet index, 1-based | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** ## Excel To Text ### excelToText `excelToText` Convert Excel to plain text **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.excelToText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source xls/xlsx/csv file | | `inline` | `boolean` | No | Return converted content inline | | `worksheetIndex` | `string` | No | Worksheet index, 1-based | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** ## Excel To Xml ### excelToXml `excelToXml` Convert Excel to XML **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.excelToXml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source xls/xlsx/csv file | | `inline` | `boolean` | No | Return converted content inline | | `worksheetIndex` | `string` | No | Worksheet index, 1-based | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** ## File Upload ### fileUpload `fileUpload` Upload a file URL to PDF.co storage **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.fileUpload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source file to store | | `name` | `string` | No | Destination file name | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## File Upload Base64 ### fileUploadBase64 `fileUploadBase64` Upload base64 content to PDF.co storage **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.fileUploadBase64({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | Yes | Base64-encoded file content | | `name` | `string` | No | Destination file name | | `expiration` | `number` | No | Output link lifetime in minutes | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Job Check ### jobCheck `jobCheck` Check an async job status **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.jobCheck({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | Background job id from an async call | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `working \| success \| failed \| aborted` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `jobDuration` | `number` | No | — | | `duration` | `number` | No | — | *** ## Pdf Add ### pdfAdd `pdfAdd` Overlay text, images, or form values on a PDF **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfAdd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `annotations` | `object[]` | No | Text annotations to overlay | | `images` | `object[]` | No | Images to overlay | | `fields` | `object[]` | No | Fillable form field values to set | | `annotationsString` | `string` | No | Compact ";"-separated text object notation | | `imagesString` | `string` | No | Compact ";"-separated image object notation | | `fieldsString` | `string` | No | Compact ";"-separated fillable field notation | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **annotations full type** > > ```ts theme={null} > { > text: string, > x: number, > y: number, > type?: string, > id?: string, > pages?: string, > size?: number, > color?: string, > link?: string, > fontName?: string, > width?: number, > height?: number, > alignment?: left | center | right > }[] > ``` > **images full type** > > ```ts theme={null} > { > url: string, > x: number, > y: number, > pages?: string, > width?: number, > height?: number, > link?: string > }[] > ``` > **fields full type** > > ```ts theme={null} > { > fieldName: string, > text: string, > pages?: string > }[] > ``` > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf Change Text Searchable ### pdfChangeTextSearchable `pdfChangeTextSearchable` Make scanned PDF text searchable with OCR **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfChangeTextSearchable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the scanned PDF or image | | `lang` | `string` | No | OCR language, e.g. "eng" or "eng+deu" | | `pages` | `string` | No | Page indices, e.g. "0,1,2-" | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf Delete Pages ### pdfDeletePages `pdfDeletePages` Delete pages from a PDF **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfDeletePages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | Yes | 1-based pages to delete, e.g. '1-2' | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf Extract Attachments ### pdfExtractAttachments `pdfExtractAttachments` Extract embedded PDF attachments **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfExtractAttachments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `inline` | `boolean` | No | Return attachments inline | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `urls` | `string[]` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf Find ### pdfFind `pdfFind` Find text and coordinates in a PDF **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfFind({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `searchString` | `string` | Yes | Text or regex pattern to find | | `pages` | `string` | No | 0-based pages to search; default all | | `regexSearch` | `boolean` | No | Treat searchString as regex | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `body` | `object[]` | No | — | | `pageCount` | `number` | No | — | > **body full type** > > ```ts theme={null} > { > text?: string, > pageIndex?: number, > left?: number, > top?: number, > width?: number, > height?: number > }[] > ``` *** ## Pdf Forms Info Reader ### pdfFormsInfoReader `pdfFormsInfoReader` Read PDF form field info **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfFormsInfoReader({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `info` | `object` | No | — | | `fields` | `object[]` | No | — | > **info full type** > > ```ts theme={null} > { > PageCount?: number, > Author?: string, > Title?: string, > Subject?: string, > Keywords?: string, > Creator?: string, > Producer?: string, > CreationDate?: string, > ModificationDate?: string, > Encrypted?: boolean > } > ``` > **fields full type** > > ```ts theme={null} > { > PageIndex?: number, > Type?: string, > FieldName?: string, > Value?: string, > Left?: number, > Top?: number, > Width?: number, > Height?: number > }[] > ``` *** ## Pdf From Email ### pdfFromEmail `pdfFromEmail` Convert an email file to PDF **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfFromEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the .msg or .eml file | | `embedAttachments` | `boolean` | No | Embed email attachments into the PDF | | `convertAttachments` | `boolean` | No | Convert convertible attachments to PDF pages | | `margins` | `string` | No | Margins, e.g. "10px 10px 10px 10px" | | `paperSize` | `string` | No | Paper size, e.g. "A4" or "Letter" | | `orientation` | `Portrait \| Landscape` | No | Page orientation | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf From Html ### pdfFromHtml `pdfFromHtml` Generate PDF from HTML markup **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfFromHtml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `html` | `string` | Yes | Raw HTML markup to render as PDF | | `margins` | `string` | No | Margins, e.g. "10px 10px 10px 10px" | | `paperSize` | `string` | No | Paper size, e.g. "A4" or "Letter" | | `orientation` | `Portrait \| Landscape` | No | Page orientation | | `printBackground` | `boolean` | No | Print CSS backgrounds | | `header` | `string` | No | HTML header template | | `footer` | `string` | No | HTML footer template | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf From Text ### pdfFromText `pdfFromText` Convert a text document to PDF **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfFromText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the TXT/DOC/DOCX/RTF/PPT source file | | `pages` | `string` | No | Page indices, e.g. "0-" | | `autosize` | `boolean` | No | Autosize pages to content | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf Info Reader ### pdfInfoReader `pdfInfoReader` Read PDF metadata and properties **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfInfoReader({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `info` | `object` | No | — | > **info full type** > > ```ts theme={null} > { > PageCount?: number, > Author?: string, > Title?: string, > Subject?: string, > Keywords?: string, > Creator?: string, > Producer?: string, > CreationDate?: string, > ModificationDate?: string, > Encrypted?: boolean > } > ``` *** ## Pdf Merge ### pdfMerge `pdfMerge` Merge multiple PDFs into one **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfMerge({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Comma-separated list of PDF URLs to merge | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf Rotate ### pdfRotate `pdfRotate` Rotate selected PDF pages **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfRotate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | No | 0-based pages to rotate, e.g. "0-2,4"; default all pages | | `angle` | `0 \| 90 \| 180 \| 270` | No | Clockwise rotation angle in degrees | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `fileSize` | `number` | No | — | *** ## Pdf Search And Delete Text ### pdfSearchAndDeleteText `pdfSearchAndDeleteText` Search and delete text in a PDF **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfSearchAndDeleteText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `searchString` | `string` | No | Single text to delete | | `searchStrings` | `string[]` | No | Multiple texts to delete | | `caseSensitive` | `boolean` | No | Case-sensitive match | | `regex` | `boolean` | No | Treat search strings as regex | | `replacementLimit` | `number` | No | Max deletions per string; 0 means all | | `pages` | `string` | No | 0-based pages; default all | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf Search And Replace Text ### pdfSearchAndReplaceText `pdfSearchAndReplaceText` Search and replace text in a PDF **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfSearchAndReplaceText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `searchString` | `string` | No | Single text to search for | | `replaceString` | `string` | No | Replacement text | | `searchStrings` | `string[]` | No | Multiple texts to search for, in order | | `replaceStrings` | `string[]` | No | Replacements aligned with searchStrings | | `caseSensitive` | `boolean` | No | Case-sensitive match | | `regex` | `boolean` | No | Treat search strings as regex | | `replacementLimit` | `number` | No | Max replacements per string; 0 means all | | `pages` | `string` | No | 0-based pages; default all | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf Split ### pdfSplit `pdfSplit` Split a PDF into multiple files **Risk:** `write` ```ts theme={null} await corsair.pdfco.api.pdfSplit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | Yes | 1-based pages or ranges to keep, e.g. '1-2,3-' | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `urls` | `string[]` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf To Csv ### pdfToCsv `pdfToCsv` Convert PDF to CSV **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfToCsv({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | No | Page indices, e.g. "0,1,2-" | | `inline` | `boolean` | No | Return CSV inline in body | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** ## Pdf To Html ### pdfToHtml `pdfToHtml` Convert PDF to HTML **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfToHtml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | No | Page indices, e.g. "0,1,2-" | | `inline` | `boolean` | No | Return HTML inline in body | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** ## Pdf To Image ### pdfToImage `pdfToImage` Convert PDF pages to images **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfToImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `format` | `jpg \| png \| tiff` | No | Output image format; selects the /to/jpg, /to/png, or /to/tiff endpoint | | `pages` | `string` | No | Page indices, e.g. "0,1,2-" | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `urls` | `string[]` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf To Json ### pdfToJson `pdfToJson` Convert PDF to JSON **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfToJson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | No | Page indices, e.g. "0,1,2-" | | `inline` | `boolean` | No | Return JSON inline in body | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** ## Pdf To Text ### pdfToText `pdfToText` Convert PDF to plain text **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfToText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | No | Page indices, e.g. "0,1,2-" | | `inline` | `boolean` | No | Return text inline in body | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** ## Pdf To Xls ### pdfToXls `pdfToXls` Convert PDF to XLS **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfToXls({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | No | Page indices, e.g. "0,1,2-" | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf To Xlsx ### pdfToXlsx `pdfToXlsx` Convert PDF to XLSX **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfToXlsx({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | No | Page indices, e.g. "0,1,2-" | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | *** ## Pdf To Xml ### pdfToXml `pdfToXml` Convert PDF to XML **Risk:** `read` ```ts theme={null} await corsair.pdfco.api.pdfToXml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Public URL of the source PDF | | `pages` | `string` | No | Page indices, e.g. "0,1,2-" | | `inline` | `boolean` | No | Return XML inline in body | | `password` | `string` | No | PDF password if protected | | `async` | `boolean` | No | Run in background and return a jobId for PDF\_CO\_JOB\_CHECK | | `name` | `string` | No | Output file name | | `expiration` | `number` | No | Output link lifetime in minutes | | `profiles` | `object` | No | Advanced profiles object or serialized JSON string, see [https://developer.pdf.co/api/profiles](https://developer.pdf.co/api/profiles) | > **profiles full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `boolean` | Yes | — | | `message` | `string` | No | — | | `status` | `number` | No | — | | `name` | `string` | No | — | | `credits` | `number` | No | — | | `remainingCredits` | `number` | No | — | | `jobId` | `string` | No | — | | `url` | `string` | No | — | | `outputLinkValidTill` | `string` | No | — | | `pageCount` | `number` | No | — | | `body` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/pdfco/database Pdfco local sync: searchable entities, `.search()` filters, and operators. The Pdfco plugin syncs data locally. Use `corsair.pdfco.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/pdfco/overview Pdfco plugin for Corsair Use **Pdfco** through Corsair: one client, typed API calls. **What you get:** * 34 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/pdfco ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/pdfco ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/pdfco ``` ```bash bun theme={null} bun add corsair @corsair-dev/pdfco ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { pdfco } from '@corsair-dev/pdfco'; export const corsair = createCorsair({ plugins: [ pdfco(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} pdfco() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'pdfco', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accountBalance`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pdfco.api.accountBalance({}); ``` **`barcodeGenerate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pdfco.api.barcodeGenerate({}); ``` See the full list on the [API](/plugins/pdfco/api) page. ## What's next > **[API reference](/plugins/pdfco/api)** > > Every `pdfco.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/pdfmonkey/api API reference for PDFMonkey: every `pdfmonkey.api.*` operation with input and output types. Every `pdfmonkey.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Documents ### createDocument `documents.createDocument` Create a document and queue it for PDF generation **Risk:** `write` ```ts theme={null} await corsair.pdfmonkey.api.documents.createDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `document` | `object` | Yes | — | > **document full type** > > ```ts theme={null} > { > document_template_id: string, > status?: draft | pending, > payload?: any, > meta?: any > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `app_id` | `string` | Yes | — | | `document_template_id` | `string` | Yes | — | | `document_template_identifier` | `string` | No | — | | `status` | `draft \| pending \| generating \| success \| failure` | Yes | — | | `payload` | `any` | No | — | | `meta` | `any` | No | — | | `filename` | `string` | No | — | | `download_url` | `string` | No | — | | `preview_url` | `string` | No | — | | `public_share_link` | `string` | No | — | | `checksum` | `string` | No | — | | `generation_logs` | `any[]` | No | — | | `failure_cause` | `string` | No | — | | `output_type` | `pdf \| image` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### createDocumentSync `documents.createDocumentSync` Create a document and wait for generation to complete **Risk:** `write` ```ts theme={null} await corsair.pdfmonkey.api.documents.createDocumentSync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `document` | `object` | Yes | — | > **document full type** > > ```ts theme={null} > { > document_template_id: string, > status: draft | pending, > payload?: any, > meta?: any > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `app_id` | `string` | Yes | — | | `document_template_id` | `string` | No | — | | `document_template_identifier` | `string` | No | — | | `status` | `draft \| pending \| generating \| success \| failure` | Yes | — | | `filename` | `string` | No | — | | `download_url` | `string` | No | — | | `preview_url` | `string` | No | — | | `public_share_link` | `string` | No | — | | `failure_cause` | `string` | No | — | | `meta` | `any` | No | — | | `output_type` | `pdf \| image` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### deleteDocument `documents.deleteDocument` Delete a document \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.pdfmonkey.api.documents.deleteDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getDocument `documents.getDocument` Get a full document including payload and generation logs **Risk:** `read` ```ts theme={null} await corsair.pdfmonkey.api.documents.getDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `app_id` | `string` | Yes | — | | `document_template_id` | `string` | Yes | — | | `document_template_identifier` | `string` | No | — | | `status` | `draft \| pending \| generating \| success \| failure` | Yes | — | | `payload` | `any` | No | — | | `meta` | `any` | No | — | | `filename` | `string` | No | — | | `download_url` | `string` | No | — | | `preview_url` | `string` | No | — | | `public_share_link` | `string` | No | — | | `checksum` | `string` | No | — | | `generation_logs` | `any[]` | No | — | | `failure_cause` | `string` | No | — | | `output_type` | `pdf \| image` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### getDocumentCard `documents.getDocumentCard` Get a document card with status and download URL **Risk:** `read` ```ts theme={null} await corsair.pdfmonkey.api.documents.getDocumentCard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `app_id` | `string` | Yes | — | | `document_template_id` | `string` | No | — | | `document_template_identifier` | `string` | No | — | | `status` | `draft \| pending \| generating \| success \| failure` | Yes | — | | `filename` | `string` | No | — | | `download_url` | `string` | No | — | | `preview_url` | `string` | No | — | | `public_share_link` | `string` | No | — | | `failure_cause` | `string` | No | — | | `meta` | `any` | No | — | | `output_type` | `pdf \| image` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ### listDocumentCards `documents.listDocumentCards` List document cards with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.pdfmonkey.api.documents.listDocumentCards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | Yes | — | | `q` | `object` | No | — | > **q full type** > > ```ts theme={null} > { > document_template_id?: string, > status?: draft | pending | generating | success | failure, > workspace_id?: string, > updated_since?: string, > search?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `document_cards` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **document\_cards full type** > > ```ts theme={null} > { > id: string, > app_id: string, > document_template_id?: string, > document_template_identifier?: string, > status: draft | pending | generating | success | failure, > filename?: string | null, > download_url?: string | null, > preview_url?: string | null, > public_share_link?: string | null, > failure_cause?: string | null, > meta?: any | null, > output_type?: pdf | image, > created_at: string, > updated_at: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > current_page: number, > next_page?: number | null, > prev_page?: number | null, > total_pages: number > } > ``` *** ### updateDocument `documents.updateDocument` Update a document's payload, metadata, or template **Risk:** `write` ```ts theme={null} await corsair.pdfmonkey.api.documents.updateDocument({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `document_id` | `string` | Yes | — | | `document` | `object` | Yes | — | > **document full type** > > ```ts theme={null} > { > document_template_id?: string, > status?: draft | pending, > payload?: any, > meta?: any > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `app_id` | `string` | Yes | — | | `document_template_id` | `string` | Yes | — | | `document_template_identifier` | `string` | No | — | | `status` | `draft \| pending \| generating \| success \| failure` | Yes | — | | `payload` | `any` | No | — | | `meta` | `any` | No | — | | `filename` | `string` | No | — | | `download_url` | `string` | No | — | | `preview_url` | `string` | No | — | | `public_share_link` | `string` | No | — | | `checksum` | `string` | No | — | | `generation_logs` | `any[]` | No | — | | `failure_cause` | `string` | No | — | | `output_type` | `pdf \| image` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | Yes | — | *** ## Templates ### createTemplate `templates.createTemplate` Create a new document template **Risk:** `write` ```ts theme={null} await corsair.pdfmonkey.api.templates.createTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `document_template` | `object` | Yes | — | > **document\_template full type** > > ```ts theme={null} > { > app_id: string, > identifier: string, > body: string, > body_draft?: string, > scss_style?: string, > scss_style_draft?: string, > sample_data?: string, > sample_data_draft?: string, > settings?: any, > settings_draft?: any, > pdf_engine_id?: string, > pdf_engine_draft_id?: string, > template_folder_id?: string, > ttl?: number | null, > edition_mode: code | builder, > output_type: pdf | image > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `document_template` | `object` | Yes | — | > **document\_template full type** > > ```ts theme={null} > { > id: string > } > ``` *** ### deleteTemplate `templates.deleteTemplate` Delete a template \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.pdfmonkey.api.templates.deleteTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getTemplate `templates.getTemplate` Get a template by ID **Risk:** `read` ```ts theme={null} await corsair.pdfmonkey.api.templates.getTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `document_template` | `object` | Yes | — | > **document\_template full type** > > ```ts theme={null} > { > id: string, > app_id: string, > identifier?: string, > body?: string, > body_draft?: string, > scss_style?: string, > scss_style_draft?: string, > sample_data?: string, > sample_data_draft?: string, > settings?: any, > settings_draft?: any, > pdf_engine_id?: string | null, > pdf_engine_draft_id?: string | null, > template_folder_id?: string | null, > template_folder_identifier?: string, > ttl?: number | null, > edition_mode?: code | builder, > output_type?: pdf | image, > created_at: string, > updated_at: string > } > ``` *** ### listTemplateCards `templates.listTemplateCards` List template cards for a workspace **Risk:** `read` ```ts theme={null} await corsair.pdfmonkey.api.templates.listTemplateCards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | Yes | — | | `q` | `object` | Yes | — | | `sort` | `string` | No | — | > **q full type** > > ```ts theme={null} > { > workspace_id: string, > folders?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `document_template_cards` | `object[]` | Yes | — | | `meta` | `object` | No | — | > **document\_template\_cards full type** > > ```ts theme={null} > { > id: string, > app_id: string, > identifier?: string, > edition_mode?: code | builder, > output_type?: pdf | image, > is_draft?: boolean, > created_at: string, > updated_at: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > current_page: number, > next_page?: number | null, > prev_page?: number | null, > total_pages: number > } > ``` *** ### updateTemplate `templates.updateTemplate` Update an existing template **Risk:** `write` ```ts theme={null} await corsair.pdfmonkey.api.templates.updateTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `document_template_id` | `string` | Yes | — | | `document_template` | `object` | Yes | — | > **document\_template full type** > > ```ts theme={null} > { > identifier?: string, > body?: string, > body_draft?: string, > scss_style?: string, > scss_style_draft?: string, > sample_data?: string, > sample_data_draft?: string, > settings?: any, > settings_draft?: any, > pdf_engine_id?: string, > pdf_engine_draft_id?: string, > template_folder_id?: string, > ttl?: number | null, > edition_mode?: code | builder, > output_type?: pdf | image > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `document_template` | `object` | Yes | — | > **document\_template full type** > > ```ts theme={null} > { > id: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/pdfmonkey/database PDFMonkey local sync: searchable entities, `.search()` filters, and operators. The PDFMonkey plugin syncs data locally. Use `corsair.pdfmonkey.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/pdfmonkey/overview PDF generation API for creating documents from HTML templates and dynamic data. Use **PDFMonkey** through Corsair: one client, typed API calls, and incoming webhooks. **What you get:** * 12 typed API operations * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/pdfmonkey ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/pdfmonkey ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/pdfmonkey ``` ```bash bun theme={null} bun add corsair @corsair-dev/pdfmonkey ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { pdfmonkey } from '@corsair-dev/pdfmonkey'; export const corsair = createCorsair({ plugins: [ pdfmonkey(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} pdfmonkey() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'pdfmonkey', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`documents.getDocument`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pdfmonkey.api.documents.getDocument({}); ``` **`documents.createDocument`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pdfmonkey.api.documents.createDocument({}); ``` See the full list on the [API](/plugins/pdfmonkey/api) page. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/pdfmonkey/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/pdfmonkey/api)** > > Every `pdfmonkey.api.*` operation with input and output types. > **[Webhooks](/plugins/pdfmonkey/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/pdfmonkey/webhooks PDFMonkey incoming webhooks: event paths, payloads, and response data. The PDFMonkey plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/pdfmonkey/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `documents` * `generationFailure` (`documents.generationFailure`) * `generationSuccess` (`documents.generationSuccess`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Documents ### Generation Failure `documents.generationFailure` A document failed to generate **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `documents.generation.failure` | No | — | | `document` | `object` | Yes | — | > **document full type** > > ```ts theme={null} > { > id: string, > app_id: string, > document_template_id?: string, > document_template_identifier?: string, > status: failure, > filename?: string | null, > download_url?: string | null, > preview_url?: string | null, > public_share_link?: string | null, > failure_cause?: string | null, > meta?: any | null, > output_type?: pdf | image, > created_at: string, > updated_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type?: documents.generation.failure, > document: { > id: string, > app_id: string, > document_template_id?: string, > document_template_identifier?: string, > status: failure, > filename?: string | null, > download_url?: string | null, > preview_url?: string | null, > public_share_link?: string | null, > failure_cause?: string | null, > meta?: any | null, > output_type?: pdf | image, > created_at: string, > updated_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} pdfmonkey({ webhookHooks: { documents: { generationFailure: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Generation Success `documents.generationSuccess` A document finished generating successfully **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `documents.generation.success` | No | — | | `document` | `object` | Yes | — | > **document full type** > > ```ts theme={null} > { > id: string, > app_id: string, > document_template_id?: string, > document_template_identifier?: string, > status: success, > filename?: string | null, > download_url?: string | null, > preview_url?: string | null, > public_share_link?: string | null, > failure_cause?: string | null, > meta?: any | null, > output_type?: pdf | image, > created_at: string, > updated_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type?: documents.generation.success, > document: { > id: string, > app_id: string, > document_template_id?: string, > document_template_identifier?: string, > status: success, > filename?: string | null, > download_url?: string | null, > preview_url?: string | null, > public_share_link?: string | null, > failure_cause?: string | null, > meta?: any | null, > output_type?: pdf | image, > created_at: string, > updated_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} pdfmonkey({ webhookHooks: { documents: { generationSuccess: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/pdl/api API reference for People Data Labs: every `pdl.api.*` operation with input and output types. Every `pdl.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Autocomplete ### suggest `autocomplete.suggest` Get value suggestions for a PDL field prefix **Risk:** `read` ```ts theme={null} await corsair.pdl.api.autocomplete.suggest({ field: 'job_title', text: 'soft', size: 10 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `field` | `string` | Yes | — | | `text` | `string` | Yes | — | | `size` | `number` | No | — | | `titlecase` | `boolean` | No | — | | `pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `string[]` | Yes | — | | `data` | `object[]` | Yes | — | | `status` | `number` | Yes | — | > **data full type** > > ```ts theme={null} > { > count: number, > name: string, > meta?: { > } > }[] > ``` *** ## Company ### clean `company.clean` Normalize a company name or website (free) **Risk:** `read` ```ts theme={null} await corsair.pdl.api.company.clean({ website: 'www.peopledatalabs.com' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `website` | `string` | No | — | | `profile` | `string` | No | — | | `pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### enrich `company.enrich` Enrich one company record (billed per match) **Risk:** `read` ```ts theme={null} await corsair.pdl.api.company.enrich({ website: 'peopledatalabs.com' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pdl_id` | `string` | No | — | | `name` | `string` | No | — | | `profile` | `string` | No | — | | `ticker` | `string` | No | — | | `website` | `string` | No | — | | `location` | `string` | No | — | | `locality` | `string` | No | — | | `region` | `string` | No | — | | `country` | `string` | No | — | | `street_address` | `string` | No | — | | `postal_code` | `string` | No | — | | `min_likelihood` | `number` | No | — | | `include_if_matched` | `boolean` | No | — | | `required` | `string[]` | No | — | | `data_include` | `string[]` | No | — | | `titlecase` | `boolean` | No | — | | `pretty` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > found: true, > status: number, > likelihood: number, > company: { > } > } | { > found: false > } > ``` *** ### search `company.search` Search the company dataset with an Elasticsearch query or SQL **Risk:** `read` ```ts theme={null} await corsair.pdl.api.company.search({ sql: "SELECT * FROM company WHERE tags='mobile'", size: 10 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `sql` | `string` | No | — | | `size` | `number` | No | — | | `scroll_token` | `string` | No | — | | `titlecase` | `boolean` | No | — | | `pretty` | `boolean` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | Yes | — | | `data` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `scroll_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ## Ip ### enrich `ip.enrich` Look up company and person data behind an IP address **Risk:** `read` ```ts theme={null} await corsair.pdl.api.ip.enrich({ ip: '174.110.144.98', return_person: true, min_confidence: 'high' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string \| string` | Yes | — | | `return_ip_location` | `boolean` | No | — | | `return_ip_metadata` | `boolean` | No | — | | `return_if_unmatched` | `boolean` | No | — | | `return_person` | `boolean` | No | — | | `min_confidence` | `very high \| high \| moderate \| low \| very low` | No | — | | `pretty` | `boolean` | No | — | | `titlecase` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > found: true, > status: number, > data: { > ip: { > address: string, > metadata?: { > }, > location?: { > } > }, > company?: { > }, > person?: { > } > }, > dataset_version?: string | number > } | { > found: false > } > ``` *** ## Job ### search `job.search` Search job postings with structured filters or an Elasticsearch query (Beta) **Risk:** `read` ```ts theme={null} await corsair.pdl.api.job.search({ title: 'software engineer', company_website: 'peopledatalabs.com', is_active: true, size: 10 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | | `company_website` | `string` | No | — | | `location` | `string` | No | — | | `salary_range_min` | `number` | No | — | | `salary_range_max` | `number` | No | — | | `remote_work_policy` | `string` | No | — | | `inferred_skills` | `string` | No | — | | `is_active` | `boolean` | No | — | | `query` | `object` | No | — | | `size` | `number` | No | — | | `scroll_token` | `string` | No | — | | `pretty` | `boolean` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | Yes | — | | `data` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `scroll_token` | `string` | No | — | | `dataset_version` | `string \| number` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ## Location ### clean `location.clean` Normalize and geocode a location string (free) **Risk:** `read` ```ts theme={null} await corsair.pdl.api.location.clean({ location: 'san fransisco' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `location` | `string` | Yes | — | | `pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ## Person ### bulk `person.bulk` Enrich up to 100 people in one request, billed per match **Risk:** `read` ```ts theme={null} await corsair.pdl.api.person.bulk({ requests: [{ params: { profile: 'linkedin.com/in/a' } }, { params: { email: 'b@example.com' }, metadata: { row: 2 } }] }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | | `required` | `string[]` | No | — | | `include_if_matched` | `boolean` | No | — | > **requests full type** > > ```ts theme={null} > { > params: { > }, > metadata?: { > } > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > status: number, > likelihood?: number, > data?: { > } | null, > metadata?: { > }, > error?: { > type?: string, > message?: string > } > }[] > ``` *** ### enrich `person.enrich` Enrich one person record (billed per match) **Risk:** `read` ```ts theme={null} await corsair.pdl.api.person.enrich({ profile: 'linkedin.com/in/gracehopper', min_likelihood: 8 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pdl_id` | `string` | No | — | | `name` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `middle_name` | `string` | No | — | | `location` | `string` | No | — | | `street_address` | `string` | No | — | | `locality` | `string` | No | — | | `region` | `string` | No | — | | `country` | `string` | No | — | | `postal_code` | `string` | No | — | | `company` | `string` | No | — | | `school` | `string` | No | — | | `phone` | `string` | No | — | | `email` | `string` | No | — | | `email_hash` | `string` | No | — | | `profile` | `string` | No | — | | `lid` | `string` | No | — | | `birth_date` | `string` | No | — | | `min_likelihood` | `number` | No | — | | `include_if_matched` | `boolean` | No | — | | `required` | `string[]` | No | — | | `data_include` | `string[]` | No | — | | `titlecase` | `boolean` | No | — | | `pretty` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > found: true, > status: number, > likelihood: number, > data?: { > } | null, > matched?: string[] > } | { > found: false > } > ``` *** ### identify `person.identify` Find candidate person profiles matching the given identity inputs (billed per call) **Risk:** `read` ```ts theme={null} await corsair.pdl.api.person.identify({ name: 'grace hopper', company: 'us navy', include_if_matched: true }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pdl_id` | `string` | No | — | | `name` | `string` | No | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `middle_name` | `string` | No | — | | `location` | `string` | No | — | | `street_address` | `string` | No | — | | `locality` | `string` | No | — | | `region` | `string` | No | — | | `country` | `string` | No | — | | `postal_code` | `string` | No | — | | `company` | `string` | No | — | | `school` | `string` | No | — | | `phone` | `string` | No | — | | `email` | `string` | No | — | | `email_hash` | `string` | No | — | | `profile` | `string` | No | — | | `lid` | `string` | No | — | | `birth_date` | `string` | No | — | | `include_if_matched` | `boolean` | No | — | | `titlecase` | `boolean` | No | — | | `pretty` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > found: true, > status: number, > matches: { > match_score: number, > data: { > }[], > matched_on?: string[] > }[] > } | { > found: false > } > ``` *** ### search `person.search` Search the person dataset with an Elasticsearch query or SQL **Risk:** `read` ```ts theme={null} await corsair.pdl.api.person.search({ query: { term: { location_country: 'mexico' } }, dataset: 'phone,-resume', size: 10 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | No | — | | `sql` | `string` | No | — | | `size` | `number` | No | — | | `scroll_token` | `string` | No | — | | `dataset` | `string` | No | — | | `titlecase` | `boolean` | No | — | | `pretty` | `boolean` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | Yes | — | | `data` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `scroll_token` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ## School ### clean `school.clean` Normalize a school name or website (free) **Risk:** `read` ```ts theme={null} await corsair.pdl.api.school.clean({ name: 'harverd' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `website` | `string` | No | — | | `profile` | `string` | No | — | | `pretty` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/pdl/database People Data Labs local sync: searchable entities, `.search()` filters, and operators. The People Data Labs plugin syncs data locally. Use `corsair.pdl.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Companies Path: `pdl.db.companies.search` ```ts theme={null} const rows = await corsair.pdl.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `companyId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `industry` | `string` | equals, contains, startsWith, endsWith, in | | `employeeCount` | `number` | equals, gt, gte, lt, lte, in | | `foundedYear` | `number` | equals, gt, gte, lt, lte, in | | `likelihood` | `number` | equals, gt, gte, lt, lte, in | | `enrichedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## People Path: `pdl.db.people.search` ```ts theme={null} const rows = await corsair.pdl.db.people.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `pdlId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `jobTitle` | `string` | equals, contains, startsWith, endsWith, in | | `jobCompanyName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `locality` | `string` | equals, contains, startsWith, endsWith, in | | `likelihood` | `number` | equals, gt, gte, lt, lte, in | | `enrichedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/pdl/overview B2B person and company data - enrichment, dataset search, identity resolution, IP lookups and cleaners from People Data Labs. Use **People Data Labs** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 12 typed API operations * 2 synced entities (`companies`, `people`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/pdl ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/pdl ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/pdl ``` ```bash bun theme={null} bun add corsair @corsair-dev/pdl ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { pdl } from '@corsair-dev/pdl'; export const corsair = createCorsair({ plugins: [ pdl(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} pdl() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'pdl', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Enrich a person profile** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pdl.api.person.enrich({ profile: 'linkedin.com/in/gracehopper', min_likelihood: 8 }); ``` **Search the person dataset** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pdl.api.person.search({ query: { term: { job_company_name: 'people data labs' }, }, size: 10, }); ``` See the full list on the [API](/plugins/pdl/api) page. ## Query synced data Matched people are stored by their PDL person id when a database is configured, so re-enriching the same profile refreshes the row instead of duplicating it. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.pdl.db.people.search({ data: { pdlId: 'person_abc', name: 'grace hopper' }, limit: 50, }); ``` Synced entities: `companies`, `people`. See [Database](/plugins/pdl/database) for filters and operators. ## What's next > **[API reference](/plugins/pdl/api)** > > Every `pdl.api.*` operation with input and output types. > **[Database](/plugins/pdl/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/perplexityai/api API reference for Perplexity: every `perplexityai.api.*` operation with input and output types. Every `perplexityai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chat ### completions `chat.completions` Create a chat completion **Risk:** `read` ```ts theme={null} await corsair.perplexityai.api.chat.completions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `max_tokens` | `number` | No | — | | `temperature` | `number` | No | — | | `top_p` | `number` | No | — | | `top_k` | `number` | No | — | | `return_citations` | `boolean` | No | — | | `return_images` | `boolean` | No | — | | `stream` | `boolean` | No | — | | `presence_penalty` | `number` | No | — | | `frequency_penalty` | `number` | No | — | > **messages full type** > > ```ts theme={null} > { > role: system | user | assistant, > content: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `model` | `string` | Yes | — | | `object` | `string` | No | — | | `created` | `number` | No | — | | `choices` | `object[]` | Yes | — | | `usage` | `object` | No | — | | `citations` | `string[]` | No | — | | `images` | `string[]` | No | — | > **choices full type** > > ```ts theme={null} > { > index: number, > finish_reason?: string | null, > message?: { > role: string, > content: string > }, > delta?: { > role?: string, > content?: string > } > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > completion_tokens: number, > total_tokens: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/perplexityai/database Perplexity local sync: searchable entities, `.search()` filters, and operators. The Perplexity plugin syncs data locally. Use `corsair.perplexityai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/perplexityai/overview AI search and answer API for grounded responses with web citations and research. Use **Perplexity** through Corsair: one client, typed API calls. **What you get:** * 1 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/perplexityai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/perplexityai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/perplexityai ``` ```bash bun theme={null} bun add corsair @corsair-dev/perplexityai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { perplexityai } from '@corsair-dev/perplexityai'; export const corsair = createCorsair({ plugins: [ perplexityai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} perplexityai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'perplexityai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`chat.completions`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.perplexityai.api.chat.completions({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/perplexityai/api) reference.* See the full list on the [API](/plugins/perplexityai/api) page. ## What's next > **[API reference](/plugins/perplexityai/api)** > > Every `perplexityai.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/phantombuster/api API reference for PhantomBuster: every `phantombuster.api.*` operation with input and output types. Every `phantombuster.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agents ### delete `agents.delete` Delete a PhantomBuster agent by ID **Risk:** `destructive` ```ts theme={null} await corsair.phantombuster.api.agents.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### fetch `agents.fetch` Get details for a specific PhantomBuster agent by ID **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.agents.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `scriptOrgName` | `string` | No | — | | `scriptId` | `string` | No | — | | `script` | `string` | No | — | | `branch` | `string` | No | — | | `environment` | `staging \| release` | No | — | | `argument` | `string` | No | — | | `lastEndType` | `finished \| killed \| global timeout \| org timeout \| agent timeout \| unknown \| no log timeout` | No | — | *** ### fetchAll `agents.fetchAll` Get all PhantomBuster agents (Phantoms) in the organization **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.agents.fetchAll({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > scriptId?: string | null, > scriptName?: string | null, > status?: idle | running | launching | error, > nbLaunches?: number, > fileMgmt?: string, > fileMgmtValue?: number, > launchType?: string, > launchTimes?: string[], > launchTimezone?: string | null, > cronString?: string | null, > loadChrome?: boolean, > disableWebSecurity?: boolean, > ignoreSslErrors?: boolean, > argument?: string | { > }, > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### fetchDeleted `agents.fetchDeleted` Get all deleted agents in the organization **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.agents.fetchDeleted({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string | null, > createdAt: number, > deletedAt: number, > deletedBy?: string | null, > nbContainersRunning: number > }[] > ``` *** ### fetchOutput `agents.fetchOutput` Get the output of the most recent container for an agent, including status, progress, console log, and result object **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.agents.fetchOutput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fromOutputPos` | `number` | No | — | | `prevContainerId` | `string` | No | — | | `prevStatus` | `starting \| running \| finished \| unknown \| launch error \| never launched` | No | — | | `prevRuntimeEventIndex` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | No | — | | `status` | `starting \| running \| finished \| unknown \| launch error \| never launched` | Yes | — | | `output` | `string` | No | — | | `outputPos` | `number` | No | — | | `mostRecentEndedAt` | `number` | No | — | | `progress` | `number` | No | — | | `progressLabel` | `string` | No | — | | `isAgentRunning` | `boolean` | Yes | — | | `canSoftAbort` | `boolean` | Yes | — | *** ### launch `agents.launch` Add a PhantomBuster agent to the launch queue **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.agents.launch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `argument` | `object` | No | — | | `arguments` | `object` | No | — | | `bonusArgument` | `object` | No | — | | `saveArgument` | `boolean` | No | — | | `saveArguments` | `boolean` | No | — | | `manualLaunch` | `boolean` | No | — | | `maxInstanceCount` | `number` | No | — | > **argument full type** > > ```ts theme={null} > string | { > } > ``` > **arguments full type** > > ```ts theme={null} > string | { > } > ``` > **bonusArgument full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | No | — | *** ### launchSoon `agents.launchSoon` Schedule a PhantomBuster agent to launch before a specific time **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.agents.launchSoon({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `minutes` | `number` | Yes | — | | `argument` | `object` | No | — | | `arguments` | `object` | No | — | | `saveArgument` | `boolean` | No | — | | `saveArguments` | `boolean` | No | — | > **argument full type** > > ```ts theme={null} > string | { > } > ``` > **arguments full type** > > ```ts theme={null} > string | { > } > ``` **Output:** *empty object* *** ### save `agents.save` Create a new agent or update an existing one **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.agents.save({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `org` | `string` | No | — | | `script` | `string` | No | — | | `branch` | `string` | No | — | | `environment` | `staging \| release` | No | — | | `argument` | `object` | No | — | | `launchType` | `manually \| repeatedly \| once \| after agent` | No | — | | `launchTimes` | `string[]` | No | — | | `launchTimezone` | `string` | No | — | | `cronString` | `string` | No | — | | `fileMgmt` | `folders \| mix \| delete` | No | — | | `fileMgmtValue` | `number` | No | — | | `loadChrome` | `boolean` | No | — | | `disableWebSecurity` | `boolean` | No | — | | `ignoreSslErrors` | `boolean` | No | — | > **argument full type** > > ```ts theme={null} > string | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### stop `agents.stop` Stop a currently running PhantomBuster agent **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.agents.stop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `softAbort` | `boolean` | No | — | | `cascadeToAllSlaves` | `boolean` | No | — | | `dontLaunchSoon` | `boolean` | No | — | | `switchToManualLaunch` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `containerId` | `string` | No | — | *** ### unscheduleAll `agents.unscheduleAll` Disable automatic launch for all agents in the organization **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.agents.unscheduleAll({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Branches ### create `branches.create` Create a new branch **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.branches.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### delete `branches.delete` Delete a branch by ID **Risk:** `destructive` ```ts theme={null} await corsair.phantombuster.api.branches.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### fetchAll `branches.fetchAll` Fetch all branches in the organization **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.branches.fetchAll({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > created_at: number > }[] > ``` *** ### fetchDiff `branches.fetchDiff` Get the staging/release diff for script branches **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.branches.fetchDiff({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > diffLength: number, > stagingVisibility: private | semi public | public | semi open source | open source, > releaseVisibility?: private | semi public | public | semi open source | open source, > stagingAccessList?: string[] | null, > releaseAccessList?: string[] | null > }[] > ``` *** ### release `branches.release` Release a script branch **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.branches.release({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `scriptIds` | `string[]` | Yes | — | **Output:** *empty object* *** ## Containers ### fetch `containers.fetch` Get details for a specific run container by ID **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.containers.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `withResultObject` | `string` | No | — | | `withOutput` | `string` | No | — | | `withRuntimeEvents` | `string` | No | — | | `withNewerAndOlderContainerId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `agentId` | `string` | No | — | | `status` | `string` | No | — | | `exitCode` | `number` | No | — | | `duration` | `number` | No | — | | `startTime` | `number` | No | — | | `endTime` | `number` | No | — | | `output` | `string` | No | — | | `resultObject` | `string` | No | — | *** ### fetchAll `containers.fetchAll` Get all run containers for a specific agent **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.containers.fetchAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agentId` | `string` | Yes | — | | `beforeEndedAt` | `string` | No | — | | `limit` | `string` | No | — | | `mode` | `all \| finalized` | No | — | | `withRuntimeEvents` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxLimitReached` | `boolean` | Yes | — | | `containers` | `object[]` | Yes | — | > **containers full type** > > ```ts theme={null} > { > id: string, > agentId?: string, > status?: string, > exitCode?: number | null, > duration?: number | null, > startTime?: number | null, > endTime?: number | null, > output?: string | null, > resultObject?: string | null > }[] > ``` *** ### fetchOutput `containers.fetchOutput` Get the console output for a specific container **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.containers.fetchOutput({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `mode` | `json \| raw` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `output` | `string` | No | — | *** ### fetchResultObject `containers.fetchResultObject` Get the result object (JSON data) from a specific container **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.containers.fetchResultObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resultObject` | `string` | No | — | *** ## Identities ### generateToken `identities.generateToken` Generate an identity token **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.identities.generateToken({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | *** ### saveEvent `identities.saveEvent` Save an identity event **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.identities.saveEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identity_type` | `string` | Yes | — | | `profile_id` | `string` | Yes | — | | `event_type` | `string` | Yes | — | | `event_data` | `object` | Yes | — | | `timestamp` | `number` | No | — | > **event\_data full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Leads ### deleteMany `leads.deleteMany` Delete multiple leads by their IDs **Risk:** `destructive` ```ts theme={null} await corsair.phantombuster.api.leads.deleteMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deletedCount` | `number` | Yes | — | *** ### fetchByList `leads.fetchByList` Fetch leads belonging to a specific lead list **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.leads.fetchByList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `paginationOptions` | `object` | No | — | | `withLeadObjectsOfTypes` | `string[]` | No | — | | `withCompanies` | `boolean` | No | — | > **paginationOptions full type** > > ```ts theme={null} > { > paginationOrder?: ASC | DESC, > paginationSize?: number, > paginationOffset?: number, > paginationProperty?: string, > includeTotalCount?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `leads` | `object[]` | Yes | — | | `totalCount` | `number` | No | — | > **leads full type** > > ```ts theme={null} > { > linkedinProfileUrl: string, > firstName?: string, > lastName?: string, > companyName?: string > }[] > ``` *** ### save `leads.save` Save a single lead to PhantomBuster org storage **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.leads.save({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `lead` | `object` | Yes | — | > **lead full type** > > ```ts theme={null} > { > linkedinProfileUrl: string, > firstName?: string, > lastName?: string, > companyName?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `linkedinProfileSlug` | `string` | No | — | | `isCreation` | `boolean` | No | — | *** ### saveMany `leads.saveMany` Bulk-save multiple leads to PhantomBuster org storage **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.leads.saveMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leads` | `object[]` | Yes | — | > **leads full type** > > ```ts theme={null} > { > linkedinProfileUrl: string, > firstName?: string, > lastName?: string, > companyName?: string > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > ( > { > linkedinProfileUrl: string, > status: success, > isCreation: boolean > } | { > linkedinProfileUrl: string, > status: error, > error: string > } > )[] > ``` *** ## Lists ### delete `lists.delete` Delete a lead list by ID **Risk:** `destructive` ```ts theme={null} await corsair.phantombuster.api.lists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### fetch `lists.fetch` Get details for a specific lead list by ID **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.lists.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `totalLeads` | `number` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### fetchAll `lists.fetchAll` Get all lead lists in the organization **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.lists.fetchAll({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string, > description?: string | null, > totalLeads?: number, > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### save `lists.save` Create a new lead list or update an existing one **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.lists.save({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Misc ### fetchIpLocation `misc.fetchIpLocation` Retrieve the country of an IP address **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.misc.fetchIpLocation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | *** ### requestAiCompletion `misc.requestAiCompletion` Request a text completion from the AI module **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.misc.requestAiCompletion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | — | | `model` | `gpt-35-turbo \| gpt-4 \| gpt-4o \| gpt-4o-mini \| gpt-4.1-mini \| gpt-5.1` | No | — | | `temperature` | `number` | No | — | > **messages full type** > > ```ts theme={null} > { > role: system | assistant | user, > content: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `choices` | `string[]` | Yes | — | | `creditsCost` | `number` | Yes | — | *** ### solveHCaptcha `misc.solveHCaptcha` Solve an hCaptcha challenge **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.misc.solveHCaptcha({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `string` | Yes | — | *** ### solveRecaptcha `misc.solveRecaptcha` Solve a reCAPTCHA challenge (v2 or v3) **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.misc.solveRecaptcha({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `key` | `string` | Yes | — | | `type` | `v2 \| v3` | Yes | — | | `minScore` | `0.3 \| 0.7 \| 0.9` | No | — | | `pageAction` | `string` | No | — | | `enterprise` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `string` | Yes | — | *** ## Orgs ### exportAgentUsage `orgs.exportAgentUsage` Export agent usage CSV for the organization **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.orgs.exportAgentUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `days` | `string` | Yes | — | **Output:** `string` *** ### exportContainerUsage `orgs.exportContainerUsage` Export container usage CSV for the organization **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.orgs.exportContainerUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `days` | `string` | Yes | — | | `agentId` | `string` | No | — | **Output:** `string` *** ### fetch `orgs.fetch` Get the current organization info **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.orgs.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `withGlobalObject` | `string` | No | — | | `withProxies` | `string` | No | — | | `withCrmIntegrations` | `string` | No | — | | `withCustomPrompts` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | *** ### fetchAgentGroups `orgs.fetchAgentGroups` Get agent groups and order for the organization **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.orgs.fetchAgentGroups({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > ( > string | { > id: string, > name: string, > agents: string[] > } > )[] > ``` *** ### fetchResources `orgs.fetchResources` Get the organization resource usage (slots, limits) **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.orgs.fetchResources({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `dailyExecutionTime` | `number` | No | — | | `dailyMail` | `number` | No | — | | `dailyCaptcha` | `number` | No | — | | `dailyDiscoveredMail` | `number` | No | — | | `dailyAiCredit` | `number` | No | — | | `dailySerpCredits` | `number` | No | — | | `monthlyExecutionTime` | `number` | No | — | | `monthlyMail` | `number` | No | — | | `monthlyCaptcha` | `number` | No | — | | `monthlyDiscoveredMail` | `number` | No | — | | `monthlyAiCredit` | `number` | No | — | | `monthlySerpCredits` | `number` | No | — | | `s3Storage` | `number` | No | — | | `agentCount` | `number` | No | — | | `planName` | `string` | No | — | | `dailyResourceNextResetAt` | `number` | No | — | | `monthlyResourceNextResetAt` | `number` | No | — | | `planShouldCancelAt` | `number` | No | — | *** ### fetchRunningContainers `orgs.fetchRunningContainers` Get the organization's running containers **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.orgs.fetchRunningContainers({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `containers` | `object[]` | Yes | — | > **containers full type** > > ```ts theme={null} > { > id: string, > agentId: string, > agentName?: string | null, > createdAt: number, > retryNumber: number, > launchType: string, > scriptSlug: string > }[] > ``` *** ### saveAgentGroups `orgs.saveAgentGroups` Update agent groups and order for the organization **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.orgs.saveAgentGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `agentGroups` | `object[]` | Yes | — | > **agentGroups full type** > > ```ts theme={null} > ( > string | { > id: string, > name: string, > agents: string[] > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `agentGroups` | `object[]` | Yes | — | > **agentGroups full type** > > ```ts theme={null} > ( > string | { > id: string, > name: string, > agents: string[] > } > )[] > ``` *** ## Scripts ### delete `scripts.delete` Delete a script by ID **Risk:** `destructive` ```ts theme={null} await corsair.phantombuster.api.scripts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `branch` | `string` | No | — | | `environment` | `staging \| release` | No | — | **Output:** *empty object* *** ### fetch `scripts.fetch` Fetch a script by ID **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.scripts.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `branch` | `string` | No | — | | `environment` | `staging \| release` | No | — | | `withCode` | `staging \| release` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `orgId` | `string` | Yes | — | | `orgSlug` | `string` | Yes | — | | `environment` | `staging \| release` | Yes | — | | `visibility` | `private \| semi public \| public \| semi open source \| open source` | Yes | — | | `description` | `string` | No | — | | `code` | `string` | No | — | | `branch` | `string` | No | — | | `branches` | `object[]` | No | — | > **branches full type** > > ```ts theme={null} > { > id: string, > name: string, > visibility: private | semi public | public | semi open source | open source > }[] > ``` *** ### fetchAll `scripts.fetchAll` Fetch all scripts for the current user **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.scripts.fetchAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `org` | `string` | No | — | | `branch` | `string` | No | — | | `exclude` | `modules \| non-modules` | No | — | | `scriptIds` | `string \| string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > orgId: string, > orgSlug: string, > environment: staging | release, > visibility: private | semi public | public | semi open source | open source, > description?: string | null, > code?: string | null, > branch?: string | null, > branches?: { > id: string, > name: string, > visibility: private | semi public | public | semi open source | open source > }[] > }[] > ``` *** ### fetchCode `scripts.fetchCode` Get the code of a script **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.scripts.fetchCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `script` | `string` | Yes | — | | `org` | `string` | No | — | | `branch` | `string` | No | — | | `environment` | `staging \| release` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | *** ### save `scripts.save` Create a new script or update an existing one **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.scripts.save({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `branch` | `string` | No | — | | `code` | `string` | No | — | | `markdown` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | *** ### updateAccessList `scripts.updateAccessList` Update a script's access list **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.scripts.updateAccessList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `branch` | `string` | Yes | — | | `add` | `string` | No | — | | `remove` | `string` | No | — | **Output:** *empty object* *** ### updateVisibility `scripts.updateVisibility` Update the visibility of a script **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.scripts.updateVisibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `branch` | `string` | Yes | — | | `visibility` | `private \| semi public \| public \| semi open source \| open source` | Yes | — | **Output:** *empty object* *** ## Storage ### deleteLeadObjects `storage.deleteLeadObjects` Delete lead objects from organization storage **Risk:** `destructive` ```ts theme={null} await corsair.phantombuster.api.storage.deleteLeadObjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `slug` | `string` | No | — | | `leadObjectId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deletedCount` | `number` | Yes | — | *** ### saveCompanyObject `storage.saveCompanyObject` Save a company object to organization storage **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.storage.saveCompanyObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `linkedinCompanyId` | `string` | Yes | — | | `type` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `properties` | `object` | Yes | — | | `id` | `string` | No | — | | `orgId` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `linkedinCompanyId` | `string` | Yes | — | | `type` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `properties` | `object` | Yes | — | | `orgId` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### saveLeadObject `storage.saveLeadObject` Save a lead object to organization storage **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.storage.saveLeadObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `properties` | `object` | Yes | — | | `agentId` | `string` | Yes | — | | `leadObjectId` | `string` | No | — | | `leadId` | `string` | No | — | | `leadSlug` | `string` | No | — | | `leadUrn` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | Yes | — | | `type` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `properties` | `object` | Yes | — | | `leadId` | `string` | No | — | | `leadSlug` | `string` | No | — | | `leadUrn` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` *** ### saveManyCompanyObjects `storage.saveManyCompanyObjects` Bulk-save company objects to organization storage **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.storage.saveManyCompanyObjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `objects` | `object[]` | Yes | — | > **objects full type** > > ```ts theme={null} > { > linkedinCompanyId: string, > type: string, > slug: string, > properties: { > } > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > ( > { > status: success, > slug: string, > result: { > id: string, > linkedinCompanyId: string, > type: string, > slug: string, > properties: { > }, > orgId?: string | null > } > } | { > status: error, > slug: string, > error: string > } > )[] > ``` *** ### saveManyLeadObjects `storage.saveManyLeadObjects` Bulk-save lead objects to organization storage **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.storage.saveManyLeadObjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `objects` | `object[]` | Yes | — | > **objects full type** > > ```ts theme={null} > { > type: string, > slug: string, > properties: { > }, > agentId: string, > leadObjectId?: string > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > ( > { > status: success, > slug: string, > id: string > } | { > status: error, > slug: string, > error: string > } > )[] > ``` *** ### searchCompanyObjects `storage.searchCompanyObjects` Search company objects in organization storage **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.storage.searchCompanyObjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > linkedinCompanyId: string, > type: string, > slug: string, > properties: { > }, > orgId?: string | null > }[] | { > companiesObjects: { > id: string, > linkedinCompanyId: string, > type: string, > slug: string, > properties: { > }, > orgId?: string | null > }[], > totalCount: number > } > ``` *** ### searchLeadObjects `storage.searchLeadObjects` Search lead objects in organization storage **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.storage.searchLeadObjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > orgId: string, > type: string, > slug: string, > properties: { > }, > leadId?: string | null, > leadSlug?: string | null, > leadUrn?: string | null > }[] | { > leadsObjects: { > id: string, > orgId: string, > type: string, > slug: string, > properties: { > }, > leadId?: string | null, > leadSlug?: string | null, > leadUrn?: string | null > }[], > totalCount: number > } > ``` *** ## Users ### fetchMe `users.fetchMe` Get info about the currently authenticated PhantomBuster user **Risk:** `read` ```ts theme={null} await corsair.phantombuster.api.users.fetchMe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `detailedOrgId` | `string` | No | — | | `withCustomPrompts` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | | `zendeskToken` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: string, > email: string, > firstName: string, > lastName: string, > newsletter: boolean, > isEmailValidated: boolean, > createdAt: number > } > ``` *** ### updateMe `users.updateMe` Update the current user's info **Risk:** `write` ```ts theme={null} await corsair.phantombuster.api.users.updateMe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `phone` | `string` | No | — | | `company` | `string` | No | — | | `job` | `string` | No | — | | `newsletter` | `boolean` | No | — | | `developerMode` | `boolean` | No | — | **Output:** *empty object* *** # Database Source: https://docs.corsair.dev/plugins/phantombuster/database PhantomBuster local sync: searchable entities, `.search()` filters, and operators. The PhantomBuster plugin syncs data locally. Use `corsair.phantombuster.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/phantombuster/overview Web automation and data extraction platform for scraping websites and automating workflows. Use **PhantomBuster** through Corsair: one client, typed API calls. **What you get:** * 56 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/phantombuster ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/phantombuster ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/phantombuster ``` ```bash bun theme={null} bun add corsair @corsair-dev/phantombuster ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { phantombuster } from '@corsair-dev/phantombuster'; export const corsair = createCorsair({ plugins: [ phantombuster(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} phantombuster() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'phantombuster', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`agents.fetch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.phantombuster.api.agents.fetch({}); ``` **`agents.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.phantombuster.api.agents.delete({}); ``` See the full list on the [API](/plugins/phantombuster/api) page. ## What's next > **[API reference](/plugins/phantombuster/api)** > > Every `phantombuster.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/pinecone/api API reference for Pinecone: every `pinecone.api.*` operation with input and output types. Every `pinecone.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Assistant Chat ### chat `assistantChat.chat` Chat with an Assistant using retrieved file context and citations. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.assistantChat.chat({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `assistantName` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `stream` | `false` | Yes | — | | `model` | `string` | No | — | | `temperature` | `number` | No | — | | `filter` | `object` | No | — | | `json_response` | `boolean` | No | — | | `include_highlights` | `boolean` | No | — | | `context_options` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > role: user | assistant, > content: string > }[] > ``` > **filter full type** > > ```ts theme={null} > { > } > ``` > **context\_options full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `message` | `object` | No | — | | `citations` | `object[]` | No | — | | `usage` | `object` | No | — | > **message full type** > > ```ts theme={null} > { > role: user | assistant, > content: string > } > ``` > **citations full type** > > ```ts theme={null} > { > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ### completion `assistantChat.completion` Chat through Pinecone’s OpenAI-compatible completion response. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.assistantChat.completion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `assistantName` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `stream` | `false` | Yes | — | | `model` | `string` | No | — | | `temperature` | `number` | No | — | | `filter` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > role: user | assistant, > content: string > }[] > ``` > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `choices` | `object[]` | No | — | | `model` | `string` | No | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ### context `assistantChat.context` Retrieve relevant Assistant snippets without generating an answer. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.assistantChat.context({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `assistantName` | `string` | Yes | — | | `query` | `string` | No | — | | `messages` | `object[]` | No | — | | `filter` | `object` | No | — | | `top_k` | `number` | No | — | | `snippet_size` | `number` | No | — | | `multimodal` | `boolean` | No | — | | `include_binary_content` | `boolean` | No | — | > **messages full type** > > ```ts theme={null} > { > role: user | assistant, > content: string > }[] > ``` > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `snippets` | `object[]` | Yes | — | | `usage` | `object` | Yes | — | > **snippets full type** > > ```ts theme={null} > { > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ## Assistant Files ### delete `assistantFiles.delete` Start permanent deletion of a file from an Assistant. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.pinecone.api.assistantFiles.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `assistantName` | `string` | Yes | — | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `operation_type` | `upload_file \| upsert_file \| update_file_metadata \| delete_file` | Yes | — | | `status` | `Processing \| Completed \| Failed` | Yes | — | | `created_on` | `string` | Yes | — | | `file_id` | `string` | No | — | | `percent_complete` | `number` | No | — | | `error_message` | `string` | No | — | *** ### describe `assistantFiles.describe` Describe an Assistant file and optionally request a signed URL. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.assistantFiles.describe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `assistantName` | `string` | Yes | — | | `fileId` | `string` | Yes | — | | `includeUrl` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `size` | `number` | No | — | | `metadata` | `object` | No | — | | `status` | `Processing \| Available \| Deleting \| ProcessingFailed` | No | — | | `created_on` | `string` | No | — | | `updated_on` | `string` | No | — | | `signed_url` | `string` | No | — | | `multimodal` | `boolean` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `assistantFiles.list` List paginated files uploaded to an Assistant. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.assistantFiles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `assistantName` | `string` | Yes | — | | `filter` | `string` | No | — | | `limit` | `number` | No | — | | `paginationToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `files` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **files full type** > > ```ts theme={null} > { > id: string, > name: string, > size?: number, > metadata?: { > } | null, > status?: Processing | Available | Deleting | ProcessingFailed, > created_on?: string, > updated_on?: string, > signed_url?: string | null, > multimodal?: boolean > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ### upload `assistantFiles.upload` Upload a base64-encoded file for asynchronous Assistant ingestion. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.assistantFiles.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `assistantName` | `string` | Yes | — | | `fileName` | `string` | Yes | — | | `fileBase64` | `string` | Yes | — | | `contentType` | `string` | No | — | | `metadata` | `object` | No | — | | `multimodal` | `boolean` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `operation_type` | `upload_file \| upsert_file \| update_file_metadata \| delete_file` | Yes | — | | `status` | `Processing \| Completed \| Failed` | Yes | — | | `created_on` | `string` | Yes | — | | `file_id` | `string` | No | — | | `percent_complete` | `number` | No | — | | `error_message` | `string` | No | — | *** ## Assistants ### create `assistants.create` Create a Pinecone Assistant with instructions and metadata. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.assistants.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `instructions` | `string` | No | — | | `metadata` | `object` | No | — | | `region` | `us \| eu` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `status` | `Initializing \| Failed \| Ready \| Terminating \| InitializationFailed` | Yes | — | | `host` | `string` | No | — | | `instructions` | `string` | No | — | | `metadata` | `object` | No | — | | `region` | `us \| eu` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `assistants.delete` Permanently delete a Pinecone Assistant and its indexed files. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.pinecone.api.assistants.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | | undefined > ``` *** ### get `assistants.get` Describe Assistant configuration, status, and data-plane host. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.assistants.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `status` | `Initializing \| Failed \| Ready \| Terminating \| InitializationFailed` | Yes | — | | `host` | `string` | No | — | | `instructions` | `string` | No | — | | `metadata` | `object` | No | — | | `region` | `us \| eu` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `assistants.list` List paginated Pinecone Assistants for the current project. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.assistants.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `paginationToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `assistants` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **assistants full type** > > ```ts theme={null} > { > name: string, > status: Initializing | Failed | Ready | Terminating | InitializationFailed, > host?: string, > instructions?: string | null, > metadata?: { > } | null, > region?: us | eu, > created_at?: string, > updated_at?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ### update `assistants.update` Update an Assistant’s shared instructions or metadata. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.assistants.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantName` | `string` | Yes | — | | `instructions` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `status` | `Initializing \| Failed \| Ready \| Terminating \| InitializationFailed` | Yes | — | | `host` | `string` | No | — | | `instructions` | `string` | No | — | | `metadata` | `object` | No | — | | `region` | `us \| eu` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Backups ### create `backups.create` Create a restorable backup of an existing Pinecone index. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.backups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `indexName` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `backup_id` | `string` | Yes | — | | `name` | `string` | No | — | | `source_index_name` | `string` | No | — | | `source_index_id` | `string` | No | — | | `status` | `string` | No | — | | `cloud` | `string` | No | — | | `region` | `string` | No | — | | `dimension` | `number` | No | — | | `metric` | `string` | No | — | | `record_count` | `number` | No | — | | `namespace_count` | `number` | No | — | | `size_bytes` | `number` | No | — | | `source_index_deleted_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### createIndex `backups.createIndex` Start restoring a backup into a new Pinecone index. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.backups.createIndex({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `backupId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `deletion_protection` | `enabled \| disabled` | No | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `restore_job_id` | `string` | Yes | — | | `index_id` | `string` | No | — | *** ### delete `backups.delete` Permanently delete a Pinecone index backup. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.pinecone.api.backups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `backupId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | | undefined > ``` *** ### describe `backups.describe` Describe backup status, source, size, and creation details. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.backups.describe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `backupId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `backup_id` | `string` | Yes | — | | `name` | `string` | No | — | | `source_index_name` | `string` | No | — | | `source_index_id` | `string` | No | — | | `status` | `string` | No | — | | `cloud` | `string` | No | — | | `region` | `string` | No | — | | `dimension` | `number` | No | — | | `metric` | `string` | No | — | | `record_count` | `number` | No | — | | `namespace_count` | `number` | No | — | | `size_bytes` | `number` | No | — | | `source_index_deleted_at` | `string` | No | — | | `created_at` | `string` | No | — | *** ### listForIndex `backups.listForIndex` List paginated backups created from one index. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.backups.listForIndex({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `indexName` | `string` | Yes | — | | `includeDeleted` | `boolean` | No | — | | `limit` | `number` | No | — | | `paginationToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > backup_id: string, > name?: string, > source_index_name?: string, > source_index_id?: string, > status?: string, > cloud?: string, > region?: string, > dimension?: number, > metric?: string, > record_count?: number, > namespace_count?: number, > size_bytes?: number, > source_index_deleted_at?: string, > created_at?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ### listForProject `backups.listForProject` List paginated backups across the current Pinecone project. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.backups.listForProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `paginationToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > backup_id: string, > name?: string, > source_index_name?: string, > source_index_id?: string, > status?: string, > cloud?: string, > region?: string, > dimension?: number, > metric?: string, > record_count?: number, > namespace_count?: number, > size_bytes?: number, > source_index_deleted_at?: string, > created_at?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ## Bulk Imports ### cancel `bulkImports.cancel` Cancel a running Pinecone bulk-import job. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.bulkImports.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `importId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | | undefined > ``` *** ### describe `bulkImports.describe` Describe progress and errors for one bulk-import job. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.bulkImports.describe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `importId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `uri` | `string` | No | — | | `status` | `string` | No | — | | `percentComplete` | `number` | No | — | | `createdAt` | `string` | No | — | | `finishedAt` | `string` | No | — | | `recordsImported` | `number` | No | — | | `error` | `string` | No | — | *** ### list `bulkImports.list` List paginated bulk-import jobs for an index. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.bulkImports.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `limit` | `number` | No | — | | `paginationToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > uri?: string, > status?: string, > percentComplete?: number, > createdAt?: string, > finishedAt?: string | null, > recordsImported?: number, > error?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ### start `bulkImports.start` Start importing vector data from object storage into an index. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.bulkImports.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `uri` | `string` | Yes | — | | `integrationId` | `string` | No | — | | `errorMode` | `object` | No | — | > **errorMode full type** > > ```ts theme={null} > { > onError: abort | continue > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Collections ### list `collections.list` List legacy Pinecone collections visible to the project. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.collections.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `collections` | `object[]` | Yes | — | > **collections full type** > > ```ts theme={null} > { > name: string, > status?: string, > environment?: string, > size?: number, > vector_count?: number, > dimension?: number > }[] > ``` *** ## Indexes ### configure `indexes.configure` Update index configuration, tags, or deletion protection. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.indexes.configure({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `indexName` | `string` | Yes | — | | `deletion_protection` | `enabled \| disabled` | No | — | | `tags` | `object` | No | — | | `spec` | `object` | No | — | | `embed` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > } > ``` > **spec full type** > > ```ts theme={null} > { > } > ``` > **embed full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `metric` | `string` | No | — | | `host` | `string` | No | — | | `dimension` | `number` | No | — | | `vector_type` | `dense \| sparse` | No | — | | `deletion_protection` | `enabled \| disabled` | No | — | | `status` | `object` | No | — | | `spec` | `object` | No | — | | `tags` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > ready?: boolean, > state?: string > } > ``` > **spec full type** > > ```ts theme={null} > { > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### create `indexes.create` Create a serverless Pinecone vector index. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.indexes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `dimension` | `number` | No | — | | `metric` | `cosine \| euclidean \| dotproduct` | No | — | | `vector_type` | `dense \| sparse` | No | — | | `spec` | `object` | Yes | — | | `deletion_protection` | `enabled \| disabled` | No | — | | `tags` | `object` | No | — | > **spec full type** > > ```ts theme={null} > { > serverless: { > cloud: aws | gcp | azure, > region: string > } > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `metric` | `string` | No | — | | `host` | `string` | No | — | | `dimension` | `number` | No | — | | `vector_type` | `dense \| sparse` | No | — | | `deletion_protection` | `enabled \| disabled` | No | — | | `status` | `object` | No | — | | `spec` | `object` | No | — | | `tags` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > ready?: boolean, > state?: string > } > ``` > **spec full type** > > ```ts theme={null} > { > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### createForModel `indexes.createForModel` Create an integrated-embedding index for a hosted model. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.indexes.createForModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `cloud` | `aws \| gcp \| azure` | Yes | — | | `region` | `string` | Yes | — | | `embed` | `object` | Yes | — | | `deletion_protection` | `enabled \| disabled` | No | — | | `tags` | `object` | No | — | > **embed full type** > > ```ts theme={null} > { > model: string, > field_map: { > }, > metric?: cosine | euclidean | dotproduct, > read_parameters?: { > }, > write_parameters?: { > } > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `metric` | `string` | No | — | | `host` | `string` | No | — | | `dimension` | `number` | No | — | | `vector_type` | `dense \| sparse` | No | — | | `deletion_protection` | `enabled \| disabled` | No | — | | `status` | `object` | No | — | | `spec` | `object` | No | — | | `tags` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > ready?: boolean, > state?: string > } > ``` > **spec full type** > > ```ts theme={null} > { > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### delete `indexes.delete` Permanently delete a Pinecone index and its vector data. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.pinecone.api.indexes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `indexName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | | undefined > ``` *** ### describe `indexes.describe` Describe an index, including its data-plane host and readiness. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.indexes.describe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `indexName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `metric` | `string` | No | — | | `host` | `string` | No | — | | `dimension` | `number` | No | — | | `vector_type` | `dense \| sparse` | No | — | | `deletion_protection` | `enabled \| disabled` | No | — | | `status` | `object` | No | — | | `spec` | `object` | No | — | | `tags` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > ready?: boolean, > state?: string > } > ``` > **spec full type** > > ```ts theme={null} > { > } > ``` > **tags full type** > > ```ts theme={null} > { > } > ``` *** ### list `indexes.list` List all Pinecone indexes available to the project. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.indexes.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `indexes` | `object[]` | Yes | — | > **indexes full type** > > ```ts theme={null} > { > name: string, > metric?: string, > host?: string, > dimension?: number | null, > vector_type?: dense | sparse, > deletion_protection?: enabled | disabled, > status?: { > ready?: boolean, > state?: string > }, > spec?: { > }, > tags?: { > } | null > }[] > ``` *** ## Inference ### embed `inference.embed` Generate dense or sparse vectors with a hosted embedding model. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.inference.embed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `inputs` | `object[]` | Yes | — | | `parameters` | `object` | No | — | > **inputs full type** > > ```ts theme={null} > { > text: string > }[] > ``` > **parameters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | No | — | | `vector_type` | `dense \| sparse` | No | — | | `data` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ### getModel `inference.getModel` Describe capabilities and limits for one hosted inference model. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.inference.getModel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `modelName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `short_description` | `string` | No | — | | `type` | `embed \| rerank` | No | — | | `vector_type` | `dense \| sparse` | No | — | | `dimension` | `number` | No | — | | `max_sequence_length` | `number` | No | — | *** ### listModels `inference.listModels` List hosted embedding and reranking models with optional filters. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.inference.listModels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `embed \| rerank` | No | — | | `vectorType` | `dense \| sparse` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `models` | `object[]` | Yes | — | > **models full type** > > ```ts theme={null} > { > model: string, > short_description?: string, > type?: embed | rerank, > vector_type?: dense | sparse, > dimension?: number, > max_sequence_length?: number > }[] > ``` *** ### rerank `inference.rerank` Rerank documents against a query using a hosted reranking model. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.inference.rerank({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `query` | `string` | Yes | — | | `documents` | `object[]` | Yes | — | | `top_n` | `number` | No | — | | `return_documents` | `boolean` | No | — | | `parameters` | `object` | No | — | > **documents full type** > > ```ts theme={null} > { > text: string > }[] > ``` > **parameters full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | No | — | | `data` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > index: number, > score: number, > document?: { > } > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ## Namespaces ### create `namespaces.create` Create an empty namespace in a Pinecone index. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.namespaces.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `namespace` | `string` | Yes | — | | `schema` | `object` | No | — | > **schema full type** > > ```ts theme={null} > { > fields: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `record_count` | `number` | No | — | *** ### delete `namespaces.delete` Permanently delete a namespace and every record it contains. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.pinecone.api.namespaces.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `namespace` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | | undefined > ``` *** ### describe `namespaces.describe` Describe one namespace and its current record count. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.namespaces.describe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `namespace` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `record_count` | `number` | No | — | *** ### list `namespaces.list` List paginated namespaces in lexical order. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.namespaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `limit` | `number` | No | — | | `paginationToken` | `string` | No | — | | `prefix` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `namespaces` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **namespaces full type** > > ```ts theme={null} > { > name: string, > record_count?: number > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ## Records ### search `records.search` Search integrated records by text, vector, ID, or metadata filter. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.records.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `namespace` | `string` | Yes | — | | `query` | `object` | Yes | — | | `fields` | `string[]` | No | — | > **query full type** > > ```ts theme={null} > { > top_k: number, > inputs?: { > text: string > }, > vector?: number[], > id?: string, > filter?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `object` | Yes | — | | `usage` | `object` | No | — | > **result full type** > > ```ts theme={null} > { > hits: { > }[] > } > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ### upsert `records.upsert` Upsert text records as newline-delimited JSON for integrated embedding. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.records.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `namespace` | `string` | Yes | — | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > _id: string > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | | undefined > ``` *** ## Restore Jobs ### describe `restoreJobs.describe` Describe progress and status for a backup restore job. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.restoreJobs.describe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `restoreJobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `restore_job_id` | `string` | Yes | — | | `backup_id` | `string` | No | — | | `target_index_name` | `string` | No | — | | `target_index_id` | `string` | No | — | | `status` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `percent_complete` | `number` | No | — | *** ### list `restoreJobs.list` List paginated backup restore jobs for the project. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.restoreJobs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `paginationToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > restore_job_id: string, > backup_id?: string, > target_index_name?: string, > target_index_id?: string, > status?: string, > created_at?: string, > completed_at?: string | null, > percent_complete?: number > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ## Vectors ### delete `vectors.delete` Permanently delete selected vectors or an entire namespace. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.pinecone.api.vectors.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `ids` | `string[]` | No | — | | `deleteAll` | `boolean` | No | — | | `namespace` | `string` | No | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | | undefined > ``` *** ### describeIndexStats `vectors.describeIndexStats` Return index dimension, fullness, and per-namespace record counts. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.vectors.describeIndexStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `filter` | `object` | No | — | > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `dimension` | `number` | No | — | | `indexFullness` | `number` | No | — | | `totalVectorCount` | `number` | No | — | | `namespaces` | `object` | No | — | > **namespaces full type** > > ```ts theme={null} > { > } > ``` *** ### fetch `vectors.fetch` Fetch vectors and metadata by their record identifiers. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.vectors.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `ids` | `string[]` | Yes | — | | `namespace` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `vectors` | `object` | Yes | — | | `namespace` | `string` | No | — | > **vectors full type** > > ```ts theme={null} > { > } > ``` *** ### list `vectors.list` List paginated vector identifiers with optional prefix filtering. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.vectors.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `prefix` | `string` | No | — | | `limit` | `number` | No | — | | `paginationToken` | `string` | No | — | | `namespace` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `vectors` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **vectors full type** > > ```ts theme={null} > { > id: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ### query `vectors.query` Find the vectors most similar to an ID or query vector. **Risk:** `read` ```ts theme={null} await corsair.pinecone.api.vectors.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `namespace` | `string` | No | — | | `topK` | `number` | Yes | — | | `vector` | `number[]` | No | — | | `id` | `string` | No | — | | `sparseVector` | `object` | No | — | | `filter` | `object` | No | — | | `includeValues` | `boolean` | No | — | | `includeMetadata` | `boolean` | No | — | > **sparseVector full type** > > ```ts theme={null} > { > indices: number[], > values: number[] > } > ``` > **filter full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `matches` | `object[]` | Yes | — | | `namespace` | `string` | No | — | | `usage` | `object` | No | — | > **matches full type** > > ```ts theme={null} > { > id: string, > score?: number, > values?: number[], > metadata?: { > } > }[] > ``` > **usage full type** > > ```ts theme={null} > { > } > ``` *** ### update `vectors.update` Update vector values or metadata for one existing record. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.vectors.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `id` | `string` | Yes | — | | `values` | `number[]` | No | — | | `sparseValues` | `object` | No | — | | `setMetadata` | `object` | No | — | | `namespace` | `string` | No | — | > **sparseValues full type** > > ```ts theme={null} > { > indices: number[], > values: number[] > } > ``` > **setMetadata full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | | undefined > ``` *** ### upsert `vectors.upsert` Insert or replace a batch of vectors in an index namespace. **Risk:** `write` ```ts theme={null} await corsair.pinecone.api.vectors.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `host` | `string` | Yes | — | | `vectors` | `object[]` | Yes | — | | `namespace` | `string` | No | — | > **vectors full type** > > ```ts theme={null} > { > id: string, > values?: number[], > sparse_values?: { > indices: number[], > values: number[] > }, > metadata?: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `upsertedCount` | `number` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/pinecone/database Pinecone local sync: searchable entities, `.search()` filters, and operators. The Pinecone plugin syncs data locally. Use `corsair.pinecone.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Assistant Files Path: `pinecone.db.assistantFiles.search` ```ts theme={null} const rows = await corsair.pinecone.db.assistantFiles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_on` | `string` | equals, contains, startsWith, endsWith, in | | `updated_on` | `string` | equals, contains, startsWith, endsWith, in | | `signed_url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Assistants Path: `pinecone.db.assistants.search` ```ts theme={null} const rows = await corsair.pinecone.db.assistants.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `host` | `string` | equals, contains, startsWith, endsWith, in | | `instructions` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Backups Path: `pinecone.db.backups.search` ```ts theme={null} const rows = await corsair.pinecone.db.backups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `backup_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `source_index_name` | `string` | equals, contains, startsWith, endsWith, in | | `source_index_id` | `string` | equals, contains, startsWith, endsWith, in | | `source_index_deleted_at` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `cloud` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `dimension` | `number` | equals, gt, gte, lt, lte, in | | `metric` | `string` | equals, contains, startsWith, endsWith, in | | `record_count` | `number` | equals, gt, gte, lt, lte, in | | `namespace_count` | `number` | equals, gt, gte, lt, lte, in | | `size_bytes` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Collections Path: `pinecone.db.collections.search` ```ts theme={null} const rows = await corsair.pinecone.db.collections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `environment` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `vector_count` | `number` | equals, gt, gte, lt, lte, in | | `dimension` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Indexes Path: `pinecone.db.indexes.search` ```ts theme={null} const rows = await corsair.pinecone.db.indexes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `host` | `string` | equals, contains, startsWith, endsWith, in | | `dimension` | `number` | equals, gt, gte, lt, lte, in | | `metric` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Models Path: `pinecone.db.models.search` ```ts theme={null} const rows = await corsair.pinecone.db.models.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `short_description` | `string` | equals, contains, startsWith, endsWith, in | | `dimension` | `number` | equals, gt, gte, lt, lte, in | | `max_sequence_length` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Namespaces Path: `pinecone.db.namespaces.search` ```ts theme={null} const rows = await corsair.pinecone.db.namespaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `record_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Restore Jobs Path: `pinecone.db.restoreJobs.search` ```ts theme={null} const rows = await corsair.pinecone.db.restoreJobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `restore_job_id` | `string` | equals, contains, startsWith, endsWith, in | | `backup_id` | `string` | equals, contains, startsWith, endsWith, in | | `target_index_name` | `string` | equals, contains, startsWith, endsWith, in | | `target_index_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `completed_at` | `string` | equals, contains, startsWith, endsWith, in | | `percent_complete` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Vectors Path: `pinecone.db.vectors.search` ```ts theme={null} const rows = await corsair.pinecone.db.vectors.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/pinecone/overview Vector database for semantic search, embeddings storage, and retrieval-augmented AI applications. Use **Pinecone** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 48 typed API operations * 9 synced entities (`assistantFiles`, `assistants`, `backups`, `collections`, `indexes`, `models`, and 3 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/pinecone ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/pinecone ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/pinecone ``` ```bash bun theme={null} bun add corsair @corsair-dev/pinecone ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { pinecone } from '@corsair-dev/pinecone'; export const corsair = createCorsair({ plugins: [ pinecone(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} pinecone() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'pinecone', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`assistantChat.chat`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pinecone.api.assistantChat.chat({}); ``` **`assistantFiles.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pinecone.api.assistantFiles.delete({}); ``` See the full list on the [API](/plugins/pinecone/api) page. ## Query synced data Synced entities support `tenant.pinecone.db..search()` and `.list()`: `assistantFiles`, `assistants`, `backups`, `collections`, `indexes`, `models`, `namespaces`, `restoreJobs`, `vectors`. See [Database](/plugins/pinecone/database) for filters and operators. ## What's next > **[API reference](/plugins/pinecone/api)** > > Every `pinecone.api.*` operation with input and output types. > **[Database](/plugins/pinecone/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/plain/api API reference for Plain: every `plain.api.*` operation with input and output types. Every `plain.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Companies ### fetch `companies.fetch` Fetch a company by ID. **Risk:** `read` ```ts theme={null} await corsair.plain.api.companies.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companyId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `company` | `object` | No | — | > **company full type** > > ```ts theme={null} > { > id: string, > name: string, > domainName: string, > contractValue?: number | null > } > ``` *** ### update `companies.update` Create or update a company by ID or domain. **Risk:** `write` ```ts theme={null} await corsair.plain.api.companies.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `object` | Yes | — | | `name` | `string` | Yes | — | | `domainName` | `string` | Yes | — | | `contractValue` | `number` | No | — | | `accountOwnerUserId` | `string` | No | — | > **identifier full type** > > ```ts theme={null} > { > companyId?: string, > companyDomainName?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `CREATED \| UPDATED \| NOOP` | No | — | | `company` | `object` | No | — | > **company full type** > > ```ts theme={null} > { > id: string, > name: string, > domainName: string, > contractValue?: number | null > } > ``` *** ## Customer Groups ### addCustomer `customerGroups.addCustomer` Add a customer to one or more customer groups. **Risk:** `write` ```ts theme={null} await corsair.plain.api.customerGroups.addCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `string` | Yes | — | | `customerGroupIdentifiers` | `object[]` | Yes | — | > **customerGroupIdentifiers full type** > > ```ts theme={null} > { > customerGroupId?: string, > customerGroupKey?: string, > externalId?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `customerGroupMemberships` | `object[]` | Yes | — | > **customerGroupMemberships full type** > > ```ts theme={null} > { > customerId: string, > customerGroup: { > id: string, > name: string, > key: string, > color: string, > externalId?: string | null > } > }[] > ``` *** ### create `customerGroups.create` Create a customer group. **Risk:** `write` ```ts theme={null} await corsair.plain.api.customerGroups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `key` | `string` | Yes | — | | `color` | `string` | Yes | — | | `externalId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `customerGroup` | `object` | Yes | — | > **customerGroup full type** > > ```ts theme={null} > { > id: string, > name: string, > key: string, > color: string, > externalId?: string | null > } > ``` *** ### list `customerGroups.list` List customer groups with cursor pagination. **Risk:** `read` ```ts theme={null} await corsair.plain.api.customerGroups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filters` | `object` | No | — | | `first` | `number` | No | — | | `after` | `string` | No | — | | `last` | `number` | No | — | | `before` | `string` | No | — | > **filters full type** > > ```ts theme={null} > { > externalIds?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `customerGroups` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | > **customerGroups full type** > > ```ts theme={null} > { > id: string, > name: string, > key: string, > color: string, > externalId?: string | null > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ### removeCustomer `customerGroups.removeCustomer` Remove a customer from one or more customer groups. **Risk:** `write` ```ts theme={null} await corsair.plain.api.customerGroups.removeCustomer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `string` | Yes | — | | `customerGroupIdentifiers` | `object[]` | Yes | — | > **customerGroupIdentifiers full type** > > ```ts theme={null} > { > customerGroupId?: string, > customerGroupKey?: string, > externalId?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ## Customers ### delete `customers.delete` Delete a customer asynchronously. **Risk:** `write` ```ts theme={null} await corsair.plain.api.customers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### getByEmail `customers.getByEmail` Fetch a customer by email address. **Risk:** `read` ```ts theme={null} await corsair.plain.api.customers.getByEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `customer` | `object` | No | — | > **customer full type** > > ```ts theme={null} > { > id: string, > externalId?: string | null, > fullName: string, > shortName?: string | null, > email: { > email: string, > isVerified: boolean > } > } > ``` *** ### getById `customers.getById` Fetch a customer by Plain customer ID. **Risk:** `read` ```ts theme={null} await corsair.plain.api.customers.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `customer` | `object` | No | — | > **customer full type** > > ```ts theme={null} > { > id: string, > externalId?: string | null, > fullName: string, > shortName?: string | null, > email: { > email: string, > isVerified: boolean > } > } > ``` *** ### list `customers.list` List customers with optional filters and cursor pagination (first/after or last/before). **Risk:** `read` ```ts theme={null} await corsair.plain.api.customers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filters` | `object` | No | — | | `sortBy` | `object` | No | — | | `first` | `number` | No | — | | `after` | `string` | No | — | | `last` | `number` | No | — | | `before` | `string` | No | — | > **filters full type** > > ```ts theme={null} > { > isMarkedAsSpam?: boolean, > customerGroupIds?: string[], > customerGroupKeys?: string[], > companyIdentifiers?: { > companyId?: string, > companyDomainName?: string > }[], > tenantIdentifiers?: { > tenantId?: string, > externalId?: string > }[], > slackChannelId?: string > } > ``` > **sortBy full type** > > ```ts theme={null} > { > field: FULL_NAME, > direction: ASC | DESC > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `customers` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | | `totalCount` | `number` | Yes | — | > **customers full type** > > ```ts theme={null} > { > id: string, > externalId?: string | null, > fullName: string, > shortName?: string | null, > email: { > email: string, > isVerified: boolean > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ### upsert `customers.upsert` Create or update a customer by identifier. **Risk:** `write` ```ts theme={null} await corsair.plain.api.customers.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `object` | Yes | — | | `onCreate` | `object` | Yes | — | | `onUpdate` | `object` | Yes | — | > **identifier full type** > > ```ts theme={null} > { > externalId?: string, > emailAddress?: string, > customerId?: string > } > ``` > **onCreate full type** > > ```ts theme={null} > { > externalId?: string, > fullName: string, > shortName?: string, > email: { > email: string, > isVerified: boolean > }, > customerGroupIdentifiers?: { > customerGroupId?: string, > customerGroupKey?: string, > externalId?: string > }[], > tenantIdentifiers?: { > tenantId?: string, > externalId?: string > }[] > } > ``` > **onUpdate full type** > > ```ts theme={null} > { > externalId?: { > value?: string | null > }, > fullName?: { > value: string > }, > shortName?: { > value?: string | null > }, > email?: { > email: string, > isVerified: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `CREATED \| UPDATED \| NOOP` | No | — | | `customer` | `object` | No | — | > **customer full type** > > ```ts theme={null} > { > id: string, > externalId?: string | null, > fullName: string, > shortName?: string | null, > email: { > email: string, > isVerified: boolean > } > } > ``` *** ## Graphql ### run `graphql.run` Run an arbitrary GraphQL query or mutation. **Risk:** `write` ```ts theme={null} await corsair.plain.api.graphql.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `variables` | `object` | No | — | | `operationName` | `string` | No | — | > **variables full type** > > ```ts theme={null} > { > } > ``` **Output:** `lazy` *** ## Threads ### create `threads.create` Create a thread for a customer. **Risk:** `write` ```ts theme={null} await corsair.plain.api.threads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerIdentifier` | `object` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `priority` | `number` | No | — | | `labelTypeIds` | `string[]` | No | — | | `threadFields` | `object[]` | No | — | | `assignedTo` | `object` | No | — | | `externalId` | `string` | No | — | | `tenantIdentifier` | `object` | No | — | | `channel` | `API \| EMAIL \| SLACK \| MS_TEAMS \| CHAT \| INTERNAL \| DISCORD \| IMPORT` | No | — | > **customerIdentifier full type** > > ```ts theme={null} > { > externalId?: string, > emailAddress?: string, > customerId?: string > } > ``` > **threadFields full type** > > ```ts theme={null} > { > key: string, > type: STRING | BOOL | ENUM | NUMBER | CURRENCY | DATE, > stringValue?: string, > booleanValue?: boolean, > numberValue?: number, > dateValue?: string > }[] > ``` > **assignedTo full type** > > ```ts theme={null} > { > userId?: string, > machineUserId?: string > } > ``` > **tenantIdentifier full type** > > ```ts theme={null} > { > tenantId?: string, > externalId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `thread` | `object` | No | — | > **thread full type** > > ```ts theme={null} > { > id: string, > ref: string, > title: string, > status: string, > priority: number > } > ``` *** ### fetchIssues `threads.fetchIssues` Fetch external thread links for a customer and flatten as issue records. **Risk:** `read` ```ts theme={null} await corsair.plain.api.threads.fetchIssues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customerId` | `string` | Yes | — | | `threadFirst` | `number` | No | — | | `threadAfter` | `string` | No | — | | `threadLast` | `number` | No | — | | `threadBefore` | `string` | No | — | | `linkFirst` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `issues` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | | `totalThreads` | `number` | Yes | — | > **issues full type** > > ```ts theme={null} > { > threadId: string, > threadRef: string, > threadTitle: string, > link: { > id: string, > sourceId: string, > sourceType: string, > title: string, > description?: string | null, > url: string, > status: string, > linkType: string > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ### getById `threads.getById` Fetch a thread by Plain thread ID. **Risk:** `read` ```ts theme={null} await corsair.plain.api.threads.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `thread` | `object` | No | — | > **thread full type** > > ```ts theme={null} > { > id: string, > ref: string, > title: string, > status: string, > priority: number > } > ``` *** ### listDeprecated `threads.listDeprecated` Deprecated threads listing operation; use threads.query. **Risk:** `read` ```ts theme={null} await corsair.plain.api.threads.listDeprecated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filters` | `object` | No | — | | `sortBy` | `object` | No | — | | `first` | `number` | No | — | | `after` | `string` | No | — | | `last` | `number` | No | — | | `before` | `string` | No | — | > **filters full type** > > ```ts theme={null} > { > threadIds?: string[], > refs?: string[], > labelTypeIds?: string[], > priorities?: number[], > customerIds?: string[], > isAssigned?: boolean, > assignedToUser?: string[], > isMarkedAsSpam?: boolean, > supportEmailAddresses?: string[], > customerGroupIdentifiers?: { > customerGroupId?: string, > customerGroupKey?: string, > externalId?: string > }[], > tierIdentifiers?: { > tierId?: string, > externalId?: string > }[], > companyIdentifiers?: { > companyId?: string, > companyDomainName?: string > }[], > tenantIdentifiers?: { > tenantId?: string, > externalId?: string > }[], > messageSource?: CHAT | EMAIL | API | SLACK | MS_TEAMS | DISCORD | INTERNAL[], > participantIds?: string[], > broadcastIds?: string[], > statuses?: TODO | SNOOZED | DONE[] > } > ``` > **sortBy full type** > > ```ts theme={null} > { > field: STATUS_CHANGED_AT | CREATED_AT | CLOSEST_TO_BREACH_SLA | LAST_INBOUND_MESSAGE_AT | PRIORITY | THREAD_FIELD, > direction: ASC | DESC, > threadFieldKey?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `threads` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | | `totalCount` | `number` | Yes | — | > **threads full type** > > ```ts theme={null} > { > id: string, > ref: string, > title: string, > status: string, > priority: number > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ### query `threads.query` List threads with filters, sort, and cursor pagination. **Risk:** `read` ```ts theme={null} await corsair.plain.api.threads.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filters` | `object` | No | — | | `sortBy` | `object` | No | — | | `first` | `number` | No | — | | `after` | `string` | No | — | | `last` | `number` | No | — | | `before` | `string` | No | — | > **filters full type** > > ```ts theme={null} > { > threadIds?: string[], > refs?: string[], > labelTypeIds?: string[], > priorities?: number[], > customerIds?: string[], > isAssigned?: boolean, > assignedToUser?: string[], > isMarkedAsSpam?: boolean, > supportEmailAddresses?: string[], > customerGroupIdentifiers?: { > customerGroupId?: string, > customerGroupKey?: string, > externalId?: string > }[], > tierIdentifiers?: { > tierId?: string, > externalId?: string > }[], > companyIdentifiers?: { > companyId?: string, > companyDomainName?: string > }[], > tenantIdentifiers?: { > tenantId?: string, > externalId?: string > }[], > messageSource?: CHAT | EMAIL | API | SLACK | MS_TEAMS | DISCORD | INTERNAL[], > participantIds?: string[], > broadcastIds?: string[], > statuses?: TODO | SNOOZED | DONE[] > } > ``` > **sortBy full type** > > ```ts theme={null} > { > field: STATUS_CHANGED_AT | CREATED_AT | CLOSEST_TO_BREACH_SLA | LAST_INBOUND_MESSAGE_AT | PRIORITY | THREAD_FIELD, > direction: ASC | DESC, > threadFieldKey?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `threads` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | | `totalCount` | `number` | Yes | — | > **threads full type** > > ```ts theme={null} > { > id: string, > ref: string, > title: string, > status: string, > priority: number > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ### sendMessage `threads.sendMessage` Reply to a thread via Plain routing. **Risk:** `write` ```ts theme={null} await corsair.plain.api.threads.sendMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `textContent` | `string` | Yes | — | | `markdownContent` | `string` | No | — | | `attachmentIds` | `string[]` | No | — | | `impersonation` | `object` | No | — | > **impersonation full type** > > ```ts theme={null} > { > asCustomer: { > customerIdentifier: { > externalId?: string, > emailAddress?: string, > customerId?: string > } > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### update `threads.update` Update a thread title. **Risk:** `write` ```ts theme={null} await corsair.plain.api.threads.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `string` | Yes | — | | `title` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `thread` | `object` | No | — | > **thread full type** > > ```ts theme={null} > { > id: string, > ref: string, > title: string, > status: string, > priority: number > } > ``` *** ## Tiers ### fetch `tiers.fetch` Fetch a tier by ID. **Risk:** `read` ```ts theme={null} await corsair.plain.api.tiers.fetch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tierId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tier` | `object` | No | — | > **tier full type** > > ```ts theme={null} > { > id: string, > name: string, > externalId?: string | null, > color?: string, > isDefault?: boolean > } > ``` *** ### list `tiers.list` List tiers with cursor pagination. **Risk:** `read` ```ts theme={null} await corsair.plain.api.tiers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | No | — | | `after` | `string` | No | — | | `last` | `number` | No | — | | `before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tiers` | `object[]` | Yes | — | | `pageInfo` | `object` | Yes | — | > **tiers full type** > > ```ts theme={null} > { > id: string, > name: string, > externalId?: string | null, > color?: string, > isDefault?: boolean > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > hasNextPage: boolean, > hasPreviousPage: boolean, > startCursor?: string | null, > endCursor?: string | null > } > ``` *** ## Users ### delete `users.delete` Delete a workspace user. **Risk:** `write` ```ts theme={null} await corsair.plain.api.users.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### getById `users.getById` Fetch a workspace user by ID. **Risk:** `read` ```ts theme={null} await corsair.plain.api.users.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: string, > fullName: string, > publicName: string, > email: string, > isDeleted?: boolean > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/plain/database Plain local sync: searchable entities, `.search()` filters, and operators. The Plain plugin syncs data locally. Use `corsair.plain.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Companies Path: `plain.db.companies.search` ```ts theme={null} const rows = await corsair.plain.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `domainName` | `string` | equals, contains, startsWith, endsWith, in | | `contractValue` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Customer Groups Path: `plain.db.customer_groups.search` ```ts theme={null} const rows = await corsair.plain.db.customer_groups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Customers Path: `plain.db.customers.search` ```ts theme={null} const rows = await corsair.plain.db.customers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | | `fullName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Threads Path: `plain.db.threads.search` ```ts theme={null} const rows = await corsair.plain.db.threads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ref` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tiers Path: `plain.db.tiers.search` ```ts theme={null} const rows = await corsair.plain.db.tiers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/plain/overview Plain plugin for Corsair Use **Plain** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 23 typed API operations * 5 synced entities (`companies`, `customer_groups`, `customers`, `threads`, `tiers`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/plain ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/plain ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/plain ``` ```bash bun theme={null} bun add corsair @corsair-dev/plain ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { plain } from '@corsair-dev/plain'; export const corsair = createCorsair({ plugins: [ plain(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} plain() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'plain', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`companies.fetch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.plain.api.companies.fetch({}); ``` **`companies.update`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.plain.api.companies.update({}); ``` See the full list on the [API](/plugins/plain/api) page. ## Query synced data Synced entities support `tenant.plain.db..search()` and `.list()`: `companies`, `customer_groups`, `customers`, `threads`, `tiers`. See [Database](/plugins/plain/database) for filters and operators. ## What's next > **[API reference](/plugins/plain/api)** > > Every `plain.api.*` operation with input and output types. > **[Database](/plugins/plain/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/ploid/api API reference for Ploid: every `ploid.api.*` operation with input and output types. Every `ploid.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### credits `account.credits` Read the workspace ACU balance and API key budget state **Risk:** `read` ```ts theme={null} await corsair.ploid.api.account.credits({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > plan?: string, > acu?: { > included: number, > purchased: number, > used: number, > available: number, > overage: number > } > } > ``` > **meta full type** > > ```ts theme={null} > { > request_id: string > } > ``` *** ### usage `account.usage` Read workspace ACU usage plus the calling key id and active key count **Risk:** `read` ```ts theme={null} await corsair.ploid.api.account.usage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > credits?: { > plan?: string, > acu?: { > included: number, > purchased: number, > used: number, > available: number, > overage: number > } > }, > api_key?: { > id?: string, > active_keys?: number > } > } > ``` > **meta full type** > > ```ts theme={null} > { > request_id: string > } > ``` *** ## Contacts ### enrich `contacts.enrich` Resolve contact fields (work\_email 1, personal\_email 3, phone 10 ACU per hit) from a person\_id, LinkedIn URL, email, or name plus company domain **Risk:** `write` ```ts theme={null} await corsair.ploid.api.contacts.enrich({ identifier: { person_id: 'per_abc123' }, fields: ['work_email', 'phone'], }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `object` | Yes | — | | `fields` | `work_email \| personal_email \| phone[]` | Yes | — | | `response_format` | `standard` | No | — | > **identifier full type** > > ```ts theme={null} > { > linkedin_url: string > } | { > person_id: string > } | { > email: string > } | { > name: string, > company_domain: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > work_email?: { > value?: string | null, > status: found | not_found | unavailable, > confidence?: guess | strong | verified | null, > source?: contact_network | linked_profile | public_code | public_web | null, > last_seen?: string | null > }, > personal_email?: { > value?: string | null, > status: found | not_found | unavailable, > confidence?: guess | strong | verified | null, > source?: contact_network | linked_profile | public_code | public_web | null, > last_seen?: string | null > }, > phone?: { > value?: string | null, > status: found | not_found | unavailable, > confidence?: guess | strong | verified | null, > source?: contact_network | linked_profile | public_code | public_web | null, > last_seen?: string | null > } > } > ``` > **meta full type** > > ```ts theme={null} > { > request_id: string > } > ``` *** ## Person ### cancelRun `person.cancelRun` Cancel a queued or running person research run **Risk:** `destructive` ```ts theme={null} await corsair.ploid.api.person.cancelRun({ id: 'run_abc123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > run_id: string, > status: queued | running | cancelled, > poll_url?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > request_id: string > } > ``` *** ### get `person.get` Fetch a reviewed deep person profile (25 ACU first profile) or start a durable research run (202) **Risk:** `write` ```ts theme={null} await corsair.ploid.api.person.get({ identifier: { person_id: 'per_abc123' }, }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `identifier` | `object` | Yes | — | > **identifier full type** > > ```ts theme={null} > { > person_id: string > } | { > linkedin_url: string > } | { > name: string, > company_domain: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: { > run_id: string, > status: queued | running | cancelled, > poll_url?: string > }, > meta: { > request_id: string > } > } | { > data?: { > person_id?: string, > summary?: string | null, > identity?: { > name?: string, > linkedin_url?: string | null, > headline?: string | null, > company?: string | null, > location?: string | null, > confidence?: number > } | null > } | null, > meta: { > request_id: string > } > } > ``` *** ### getRun `person.getRun` Poll a person research run by id; returns run state or, once finished, the reviewed profile. 404 unknown, 410 expired **Risk:** `read` ```ts theme={null} await corsair.ploid.api.person.getRun({ id: 'run_abc123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: { > run_id: string, > status: queued | running | cancelled, > poll_url?: string > }, > meta: { > request_id: string > } > } | { > data?: { > person_id?: string, > summary?: string | null, > identity?: { > name?: string, > linkedin_url?: string | null, > headline?: string | null, > company?: string | null, > location?: string | null, > confidence?: number > } | null > } | null, > meta: { > request_id: string > } > } > ``` *** ### resolve `person.resolve` Identify one person from a name plus a clue and return the permanent person\_id; 2 ACU when found, free when not **Risk:** `write` ```ts theme={null} await corsair.ploid.api.person.resolve({ name: 'Jane Doe', company: 'acme.com' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `company` | `string` | No | — | | `role` | `string` | No | — | | `location` | `string` | No | — | | `address` | `string` | No | — | | `work_email` | `string` | No | — | | `personal_email` | `string` | No | — | | `phone` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > found: boolean, > person?: { > person_id: string, > name: string, > headline?: string | null, > company?: string | null, > location?: string | null, > profiles?: { > linkedin?: string, > github?: string, > x?: string > }, > identity_verified?: boolean > } | null, > confidence: number, > summary?: string, > sources?: string[] > } > ``` > **meta full type** > > ```ts theme={null} > { > request_id: string > } > ``` *** ## Search ### candidates `search.candidates` Find candidate identities in the people index for 1 ACU, including zero matches **Risk:** `write` ```ts theme={null} await corsair.ploid.api.search.candidates({ name: 'Jane Doe', company: 'Acme', limit: 5 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `company` | `string` | No | — | | `location` | `string` | No | — | | `title` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > matches: { > person_id: string, > name: string, > title?: string | null, > company?: string | null, > location?: string | null, > linkedin_url?: string | null, > profile_url?: string | null > }[], > returned: number > } > ``` > **meta full type** > > ```ts theme={null} > { > request_id: string > } > ``` *** ### search `search.search` Search people by semantic query and hard filters; synchronous, at most 150 results **Risk:** `write` ```ts theme={null} await corsair.ploid.api.search.search({ query: 'venture-backed founders in Berlin', num_results: 25 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `type` | `instant \| fast \| auto \| deep` | No | — | | `category` | `people` | No | — | | `num_results` | `number` | No | — | | `criteria` | `string[]` | No | — | | `async` | `boolean` | No | — | | `webhook_url` | `string` | No | — | | `filters` | `object` | No | — | | `freshness` | `object` | No | — | | `contents` | `object` | No | — | > **filters full type** > > ```ts theme={null} > { > title?: string | { > any_of?: string[], > none_of?: string[] > }, > seniority?: string | { > any_of?: string[], > none_of?: string[] > }, > company?: string | { > any_of?: string[], > none_of?: string[], > employee_count?: { > gte?: number, > lte?: number > }, > funding_stage?: { > in: pre_seed | seed | series_a | series_b | series_c | series_d_plus | public | bootstrapped[] > } > }, > industry?: string | { > any_of?: string[], > none_of?: string[] > }, > location?: string | { > any_of?: string[], > none_of?: string[], > countries?: string[], > cities?: string[] > }, > company_size?: { > min?: number, > max?: number > }, > experience?: { > past_companies: { > any_of: string[] > } > }, > education?: { > schools: { > any_of: string[] > } > } > } > ``` > **freshness full type** > > ```ts theme={null} > { > max_age_days: number > } > ``` > **contents full type** > > ```ts theme={null} > { > fields?: linkedin | title | company | location | name[] > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > data: { > results: { > url?: string | null, > title?: string | null, > score?: number | null, > person: { > person_id: string, > name?: string | null, > title?: string | null, > company?: string | null, > location?: string | null, > linkedin_url?: string | null, > profile_url?: string | null, > confidence?: number | null, > identity_verified?: boolean > } > }[] > }, > meta: { > request_id: string > } > } | { > data: { > mode: async, > set_id: string, > status?: string, > items_url?: string, > events_url?: string > }, > meta: { > request_id: string > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/ploid/database Ploid local sync: searchable entities, `.search()` filters, and operators. The Ploid plugin syncs data locally. Use `corsair.ploid.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## People Path: `ploid.db.people.search` ```ts theme={null} const rows = await corsair.ploid.db.people.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `personId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `headline` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `linkedinUrl` | `string` | equals, contains, startsWith, endsWith, in | | `profileUrl` | `string` | equals, contains, startsWith, endsWith, in | | `githubUrl` | `string` | equals, contains, startsWith, endsWith, in | | `xUrl` | `string` | equals, contains, startsWith, endsWith, in | | `identityVerified` | `boolean` | equals | | `confidence` | `number` | equals, gt, gte, lt, lte, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/ploid/overview Agent-native people API for evidence-backed people search, identity resolution, deep profiles, and contact enrichment. Use **Ploid** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 9 typed API operations * 1 synced entity (`people`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ploid ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ploid ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ploid ``` ```bash bun theme={null} bun add corsair @corsair-dev/ploid ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ploid } from '@corsair-dev/ploid'; export const corsair = createCorsair({ plugins: [ ploid(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} ploid() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ploid', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Read the workspace ACU balance** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ploid.api.account.credits({}); ``` **Resolve a person to a permanent person\_id** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ploid.api.person.resolve({ name: 'Jane Doe', company: 'acme.com' }); ``` See the full list on the [API](/plugins/ploid/api) page. ## Query synced data Read a previously resolved or enriched person without calling the API. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.ploid.db.people.search({ data: { personId: 'per_abc123', name: 'Jane Doe', company: 'Acme' }, limit: 10, }); ``` Synced entities: `people`. See [Database](/plugins/ploid/database) for filters and operators. ## What's next > **[API reference](/plugins/ploid/api)** > > Every `ploid.api.*` operation with input and output types. > **[Database](/plugins/ploid/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/posthog/api API reference for PostHog: every `posthog.api.*` operation with input and output types. Every `posthog.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Events ### aliasCreate `events.aliasCreate` Create an alias linking two distinct user IDs **Risk:** `write` ```ts theme={null} await corsair.posthog.api.events.aliasCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `distinct_id` | `string` | Yes | — | | `alias` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > number | string | { > status?: number | string, > message?: string > } | any > ``` *** ### eventCreate `events.eventCreate` Ingest an analytics event **Risk:** `write` ```ts theme={null} await corsair.posthog.api.events.eventCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `distinct_id` | `string` | Yes | — | | `event` | `string` | Yes | — | | `properties` | `object` | No | — | | `timestamp` | `string` | No | — | | `uuid` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > number | string | { > status?: number | string, > message?: string > } | any > ``` *** ### identityCreate `events.identityCreate` Associate properties with a user identity **Risk:** `write` ```ts theme={null} await corsair.posthog.api.events.identityCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `distinct_id` | `string` | Yes | — | | `properties` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > number | string | { > status?: number | string, > message?: string > } | any > ``` *** ### trackPage `events.trackPage` Track a page view event **Risk:** `write` ```ts theme={null} await corsair.posthog.api.events.trackPage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `distinct_id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `properties` | `object` | No | — | | `timestamp` | `string` | No | — | | `uuid` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > number | string | { > status?: number | string, > message?: string > } | any > ``` *** ### trackScreen `events.trackScreen` Track a screen view event **Risk:** `write` ```ts theme={null} await corsair.posthog.api.events.trackScreen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `distinct_id` | `string` | Yes | — | | `screen_name` | `string` | Yes | — | | `properties` | `object` | No | — | | `timestamp` | `string` | No | — | | `uuid` | `string` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > number | string | { > status?: number | string, > message?: string > } | any > ``` *** # Database Source: https://docs.corsair.dev/plugins/posthog/database PostHog local sync: searchable entities, `.search()` filters, and operators. The PostHog plugin syncs data locally. Use `corsair.posthog.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Events Path: `posthog.db.events.search` ```ts theme={null} const rows = await corsair.posthog.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `event` | `string` | equals, contains, startsWith, endsWith, in | | `distinct_id` | `string` | equals, contains, startsWith, endsWith, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/posthog/get-credentials Step-by-step instructions for obtaining PostHog API keys and webhook secrets. This guide walks you through obtaining all required credentials for the PostHog plugin. ## Authentication Method The PostHog plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) - Project API key authentication ## API Key Setup ### Step 1: Get Project API Key 1. Log in to your [PostHog account](https://app.posthog.com) 2. Navigate to **Project Settings** 3. Click on **Project API Key** in the left sidebar 4. Copy your **Project API Key** 5. Store it securely **Storing Credentials:** Store the API key with the Corsair CLI: ```bash theme={null} pnpm corsair setup --plugin=posthog api_key=your-api-key ``` Verify it was saved: ```bash theme={null} pnpm corsair auth --plugin=posthog --credentials ``` ## Personal API Key (Optional) For advanced API access, you can also create a Personal API Key: 1. In PostHog, click on your profile icon (top right) 2. Go to **Personal API Keys** 3. Click **Create Personal API Key** 4. Give it a name and copy the key 5. **Important**: Store this key securely - you won't be able to see it again ## Webhook Secret ### Step 1: Create Webhook Destination 1. Go to your PostHog project settings 2. Navigate to **Data Pipelines** → **Destinations** 3. Click **New destination** 4. Select **Webhook** as the destination type 5. Configure: * **Webhook URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`) * **Events**: Select `event_captured` or all events 6. Click **Save** 7. If a webhook secret is provided, copy it and store securely **Storing Credentials:** Store the webhook secret with the CLI: ```bash theme={null} pnpm corsair setup --plugin=posthog webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Project API Key | API Key auth | Project Settings → Project API Key | | Personal API Key | Advanced API access (optional) | Profile → Personal API Keys | | Webhook Secret | Webhooks | Data Pipelines → Destinations → Webhook | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/posthog/overview Product analytics platform for event tracking, feature flags, session replay, and experiments. Use **PostHog** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 5 typed API operations * 1 synced entity (`events`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/posthog ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/posthog ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/posthog ``` ```bash bun theme={null} bun add corsair @corsair-dev/posthog ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { posthog } from '@corsair-dev/posthog'; export const corsair = createCorsair({ plugins: [ posthog(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/posthog/get-credentials). ```ts theme={null} posthog() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'posthog', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Read** *No read-style endpoint inferred; pick any operation from the [API](/plugins/posthog/api) reference.* **Capture an event** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.posthog.api.events.eventCreate({ distinct_id: 'abc123', event: 'corsair_example' }); ``` See the full list on the [API](/plugins/posthog/api) page. ## Query synced data Search synced events without hitting PostHog. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.posthog.db.events.search({ data: {}, limit: 50, }); ``` Synced entities: `events`. See [Database](/plugins/posthog/database) for filters and operators. ## Webhooks Fires when a PostHog event is captured. ```ts theme={null} posthog({ webhookHooks: { events: { captured: { after: async (ctx, result) => { console.log('PostHog event captured:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/posthog/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/posthog/api)** > > Every `posthog.api.*` operation with input and output types. > **[Database](/plugins/posthog/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/posthog/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/posthog/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/posthog/webhooks PostHog incoming webhooks: event paths, payloads, and response data. The PostHog plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/posthog/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `events` * `captured` (`events.captured`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Events ### Captured `events.captured` A PostHog event was captured **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `string` | Yes | — | | `distinct_id` | `string` | Yes | — | | `timestamp` | `string` | No | — | | `uuid` | `string` | No | — | | `properties` | `object` | No | — | | `person` | `object` | No | — | | `groups` | `object` | No | — | | `$set` | `object` | No | — | | `$set_once` | `object` | No | — | | `$unset` | `string[]` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **person full type** > > ```ts theme={null} > { > distinct_id: string, > properties?: { > } > } > ``` > **groups full type** > > ```ts theme={null} > { > } > ``` > **\$set full type** > > ```ts theme={null} > { > } > ``` > **\$set\_once full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: string, > distinct_id: string, > timestamp?: string, > uuid?: string, > properties?: { > }, > person?: { > distinct_id: string, > properties?: { > } > }, > groups?: { > }, > $set?: { > }, > $set_once?: { > }, > $unset?: string[] > } > ``` **`webhookHooks` example** ```ts theme={null} posthog({ webhookHooks: { events: { captured: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/postman/api API reference for Postman: every `postman.api.*` operation with input and output types. Every `postman.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Access Keys ### list `accessKeys.list` Get collection access keys **Risk:** `read` ```ts theme={null} await corsair.postman.api.accessKeys.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > token?: string, > status?: ACTIVE | INACTIVE, > teamId?: number, > userId?: number, > collectionId?: string, > expiresAfter?: string, > lastUsedAt?: string, > createdAt?: string, > updatedAt?: string, > deletedAt?: string | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > nextCursor?: string, > prevCursor?: string > } > ``` *** ## Account ### me `account.me` Get authenticated user **Risk:** `read` ```ts theme={null} await corsair.postman.api.account.me({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | No | — | | `operations` | `object[]` | No | — | > **user full type** > > ```ts theme={null} > { > id?: number, > sub?: string, > username?: string, > email?: string, > fullName?: string, > avatar?: string | null, > isPublic?: boolean, > emailVerified?: boolean, > teamId?: number, > teamName?: string, > teamDomain?: string, > roles?: string[] > } > ``` > **operations full type** > > ```ts theme={null} > { > limit?: number, > name?: string, > overage?: number, > usage?: number > }[] > ``` *** ## Apis ### create `apis.create` Create an API (Deprecated by Postman.) **Risk:** `write` ```ts theme={null} await corsair.postman.api.apis.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `summary` | `string` | No | — | | `createdAt` | `string` | No | — | | `createdBy` | `number` | No | — | | `updatedAt` | `string` | No | — | | `updatedBy` | `number` | No | — | | `description` | `string` | No | — | *** ### createCollectionFromSchema `apis.createCollectionFromSchema` Add a collection (Deprecated by Postman.) **Risk:** `write` ```ts theme={null} await corsair.postman.api.apis.createCollectionFromSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > data?: { > collectionId?: string > }, > operationType?: COPY_COLLECTION > } | { > data?: { > info?: { > name?: string, > schema?: https://schema.postman.com/json/collection/v2.1.0/collection.json > }, > item?: { > id?: string, > uid?: string, > name?: string, > description?: string | null, > variable?: { > key?: string, > value?: string | boolean | number, > description?: string, > disabled?: boolean, > type?: string > }[], > event?: { > id?: string, > listen?: test | prerequest, > script?: { > id?: string, > name?: string, > type?: string, > exec?: string[] > } > }[], > request?: string | { > url?: string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > }, > auth?: any, > method?: string, > description?: string | null, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string | { > mode?: string, > raw?: string, > urlencoded?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > formdata?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > file?: { > src?: string, > content?: string > }, > graphql?: { > }, > options?: { > } > } > }, > response?: { > id?: string, > name?: string, > status?: string, > code?: string | number, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > cookie?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string, > responseTime?: string | number, > originalRequest?: { > url?: string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > }, > auth?: any, > method?: string, > description?: string | null, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string | { > mode?: string, > raw?: string, > urlencoded?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > formdata?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > file?: { > src?: string, > content?: string > }, > graphql?: { > }, > options?: { > } > } > } > }[], > protocolProfileBehavior?: { > strictSSL?: boolean, > followRedirects?: boolean, > maxRedirects?: number, > disableBodyPruning?: boolean, > disableUrlEncoding?: boolean, > disabledSystemHeaders?: string[], > insecureHTTPParser?: boolean, > followOriginalHttpMethod?: boolean, > followAuthorizationHeader?: boolean, > protocolVersion?: http1 | http2 | auto, > removeRefererHeaderOnRedirect?: boolean, > tlsPreferServerCiphers?: boolean, > tlsDisabledProtocols?: string[], > tlsCipherSelection?: string[] > }, > createdAt?: string, > updatedAt?: string, > item?: lazy[] > }[] > }, > operationType?: CREATE_NEW > } | { > name?: string, > operationType?: GENERATE_FROM_SCHEMA, > options?: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ### createOrUpdateSchemaFile `apis.createOrUpdateSchemaFile` Create or update a schema file (Deprecated by Postman.) **Risk:** `write` ```ts theme={null} await corsair.postman.api.apis.createOrUpdateSchemaFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `schemaId` | `string` | Yes | — | | `filePath` | `string` | Yes | — | | `name` | `string` | No | — | | `root` | `object` | No | — | | `content` | `string` | No | — | > **root full type** > > ```ts theme={null} > { > enabled?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdBy` | `string` | No | — | | `createdAt` | `string` | No | — | | `root` | `object` | No | — | | `name` | `string` | No | — | | `path` | `string` | No | — | | `updatedBy` | `string` | No | — | | `id` | `string` | No | — | | `updatedAt` | `string` | No | — | > **root full type** > > ```ts theme={null} > { > enabled?: boolean > } > ``` *** ### createRelations `apis.createRelations` Create API version relations **Risk:** `write` ```ts theme={null} await corsair.postman.api.apis.createRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createSchema `apis.createSchema` Create a schema (Deprecated by Postman.) **Risk:** `write` ```ts theme={null} await corsair.postman.api.apis.createSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `type` | `proto:2 \| proto:3 \| graphql \| openapi:3_1 \| openapi:3 \| openapi:2 \| openapi:1 \| raml:1 \| raml:0_8 \| wsdl:2 \| wsdl:1 \| asyncapi:2` | Yes | — | | `files` | `object[]` | Yes | — | > **files full type** > > ```ts theme={null} > { > path?: string, > root?: { > enabled?: boolean > }, > content?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `type` | `proto:2 \| proto:3 \| graphql \| openapi:3_1 \| openapi:3 \| openapi:2 \| openapi:1 \| raml:1 \| raml:0_8 \| wsdl:2 \| wsdl:1 \| asyncapi:2` | No | — | | `files` | `object[]` | No | — | | `createdAt` | `string` | No | — | | `createdBy` | `string` | No | — | | `updatedAt` | `string` | No | — | | `updatedBy` | `string` | No | — | > **files full type** > > ```ts theme={null} > { > id?: string, > name?: string, > path?: string, > createdAt?: string, > root?: { > enabled?: boolean > }, > createdBy?: string, > updatedAt?: string, > updatedBy?: string > }[] > ``` *** ### deleteComment `apis.deleteComment` Delete an API's comment (Deprecated by Postman.) **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.apis.deleteComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `commentId` | `number` | Yes | — | **Output:** `any` *** ### deleteSchemaFile `apis.deleteSchemaFile` Delete a schema file (Deprecated by Postman.) **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.apis.deleteSchemaFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `schemaId` | `string` | Yes | — | | `filePath` | `string` | Yes | — | **Output:** `any` *** ### get `apis.get` Get an API (Deprecated by Postman.) **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `include` | `collections \| versions \| schemas \| gitInfo[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > name?: string, > summary?: string, > createdAt?: string, > createdBy?: number, > updatedAt?: string, > updatedBy?: number, > description?: string > } | { > id?: string, > name?: string, > summary?: string, > createdAt?: string, > createdBy?: number, > updatedAt?: string, > updatedBy?: number, > description?: string, > gitInfo?: { > domain?: string | null, > repository?: string, > organization?: string, > schemaFolder?: string, > collectionFolder?: string > }, > schemas?: { > id?: string > }[], > versions?: { > id?: string, > name?: string > }[], > collections?: { > id?: string > }[] > } > ``` *** ### getComments `apis.getComments` Get an API's comments (Deprecated by Postman.) **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > status?: Open | Resolved, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > }[] > ``` *** ### getContractTestRelations `apis.getContractTestRelations` Get contract test relations **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getContractTestRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getDocumentationRelations `apis.getDocumentationRelations` Get documentation relations **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getDocumentationRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getEnvironmentRelations `apis.getEnvironmentRelations` Get environment relations **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getEnvironmentRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getIntegrationTestRelations `apis.getIntegrationTestRelations` Get integration test relations **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getIntegrationTestRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getLinkedRelations `apis.getLinkedRelations` Get all linked relations **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getLinkedRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSchema `apis.getSchema` Get a schema (Deprecated by Postman.) **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `schemaId` | `string` | Yes | — | | `versionId` | `string` | No | — | | `bundled` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id?: string, > type?: string, > files?: { > data?: { > id?: string, > name?: string, > path?: string, > createdAt?: string, > createdBy?: string, > updatedAt?: string, > updatedBy?: string > }[], > meta?: { > nextPath?: string > } > }, > createdAt?: string, > createdBy?: string, > updatedAt?: string, > updatedBy?: string > } | { > id?: string, > type?: string, > createdBy?: string, > updatedBy?: string, > createdAt?: string, > updatedAt?: string, > content?: string > } > ``` *** ### getSchemaFileContents `apis.getSchemaFileContents` Get schema file contents (Deprecated by Postman.) **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getSchemaFileContents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `schemaId` | `string` | Yes | — | | `filePath` | `string` | Yes | — | | `versionId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `path` | `string` | No | — | | `content` | `string` | No | — | | `createdAt` | `string` | No | — | | `createdBy` | `string` | No | — | | `updatedAt` | `string` | No | — | | `updatedBy` | `string` | No | — | *** ### getSchemaFiles `apis.getSchemaFiles` Get schema files (Deprecated by Postman.) **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getSchemaFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `schemaId` | `string` | Yes | — | | `versionId` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `files` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > nextCursor?: string > } > ``` > **files full type** > > ```ts theme={null} > { > id?: string, > name?: string, > path?: string, > createdAt?: string, > createdBy?: number, > updatedAt?: string, > updatedBy?: number > }[] > ``` *** ### getTestRelations `apis.getTestRelations` Get all test relations **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getTestRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTestSuiteRelations `apis.getTestSuiteRelations` Get test suite relations **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getTestSuiteRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUnclassifiedRelations `apis.getUnclassifiedRelations` Get unclassified relations **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getUnclassifiedRelations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getVersion `apis.getVersion` Get a version (Deprecated by Postman.) **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.getVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `version` | `object` | No | — | > **version full type** > > ```ts theme={null} > { > id?: string, > name?: string, > createdAt?: string, > updatedAt?: string, > releaseNotes?: string, > schemas?: { > id?: string, > type?: string > }[], > collections?: { > id?: string, > type?: string > }[] > } > ``` *** ### list `apis.list` Get all APIs (Deprecated by Postman.) **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `createdBy` | `number` | No | — | | `cursor` | `string` | No | — | | `description` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `apis` | `object[]` | No | — | | `meta` | `object` | No | — | > **apis full type** > > ```ts theme={null} > { > id?: string, > name?: string, > summary?: string, > createdAt?: string, > createdBy?: number, > updatedAt?: string, > updatedBy?: number, > description?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > limit?: number, > total?: number, > nextCursor?: string > } > ``` *** ### listReleases `apis.listReleases` Get all API releases **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.listReleases({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listVersions `apis.listVersions` Get all versions (Deprecated by Postman.) **Risk:** `read` ```ts theme={null} await corsair.postman.api.apis.listVersions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `versions` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > limit?: number, > total?: number, > nextCursor?: string > } > ``` > **versions full type** > > ```ts theme={null} > { > id?: string, > name?: string, > createdAt?: string, > updatedAt?: string, > releaseNotes?: string > }[] > ``` *** ### remove `apis.remove` Delete an API (Deprecated by Postman.) **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.apis.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | **Output:** `any` *** ### update `apis.update` Update an API (Deprecated by Postman.) **Risk:** `write` ```ts theme={null} await corsair.postman.api.apis.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `summary` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | Yes | — | | `summary` | `string` | No | — | | `createdAt` | `string` | No | — | | `createdBy` | `string` | No | — | | `updatedAt` | `string` | No | — | | `updatedBy` | `string` | No | — | | `description` | `string` | No | — | *** ### updateComment `apis.updateComment` Update an API's comment (Deprecated by Postman.) **Risk:** `write` ```ts theme={null} await corsair.postman.api.apis.updateComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `commentId` | `number` | Yes | — | | `body` | `string` | Yes | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > { > { > userName > } > }?: { > type: user, > id: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > } > ``` *** ## Billing ### getAccount `billing.getAccount` Get accounts **Risk:** `read` ```ts theme={null} await corsair.postman.api.billing.getAccount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `billingEmail` | `string` | No | — | | `id` | `number` | No | — | | `state` | `string` | No | — | | `teamId` | `number` | No | — | | `salesChannel` | `SELF_SERVE \| SALES_SERVE` | No | — | | `slots` | `object` | No | — | > **slots full type** > > ```ts theme={null} > { > available?: number, > consumed?: number, > total?: number, > unbilled?: number > } > ``` *** ### listInvoices `billing.listInvoices` List account invoices **Risk:** `read` ```ts theme={null} await corsair.postman.api.billing.listInvoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | Yes | — | | `status` | `PAID` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id?: string, > status?: string, > issuedAt?: string, > totalAmount?: { > value?: number, > currency?: string > }, > links?: { > web?: any > } > }[] > ``` *** ## Collections ### create `collections.create` Create a collection **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > info: { > name: string, > description?: string, > schema: https://schema.postman.com/json/collection/v2.1.0/collection.json > }, > item: { > name?: string, > description?: string | null, > variable?: { > key?: string, > value?: string | boolean | number, > description?: string, > disabled?: boolean, > type?: string > }[], > event?: { > id?: string, > listen?: test | prerequest, > script?: { > id?: string, > name?: string, > type?: string, > exec?: string[] > } > }[], > request?: { > url?: string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > }, > auth?: any, > method?: string, > description?: string | null, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string | { > mode?: string, > raw?: string, > urlencoded?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > formdata?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > file?: { > src?: string, > content?: string > }, > graphql?: { > }, > options?: { > } > } > }, > response?: { > id?: string, > name?: string, > status?: string, > code?: string | number, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > cookie?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string, > responseTime?: string | number, > originalRequest?: { > url?: string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > }, > auth?: any, > method?: string, > description?: string | null, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string | { > mode?: string, > raw?: string, > urlencoded?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > formdata?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > file?: { > src?: string, > content?: string > }, > graphql?: { > }, > options?: { > } > } > } > }[], > protocolProfileBehavior?: { > strictSSL?: boolean, > followRedirects?: boolean, > maxRedirects?: number, > disableBodyPruning?: boolean, > disableUrlEncoding?: boolean, > disabledSystemHeaders?: string[], > insecureHTTPParser?: boolean, > followOriginalHttpMethod?: boolean, > followAuthorizationHeader?: boolean, > protocolVersion?: http1 | http2 | auto, > removeRefererHeaderOnRedirect?: boolean, > tlsPreferServerCiphers?: boolean, > tlsDisabledProtocols?: string[], > tlsCipherSelection?: string[] > } > }[], > event?: { > listen: test | prerequest, > script?: { > type?: string, > exec?: string[] > } > }[], > variable?: { > key?: string, > value?: string | boolean | number, > description?: string, > disabled?: boolean > }[], > auth?: { > type: noauth | basic | bearer | apikey | digest | oauth1 | oauth2 | hawk | awsv4 | ntlm | edgegrid, > noauth?: any, > apikey?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > awsv4?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > basic?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > bearer?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > digest?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > edgegrid?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > hawk?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > ntlm?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > oauth1?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > oauth2?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[] > }, > protocolProfileBehavior?: { > strictSSL?: boolean, > followRedirects?: boolean, > maxRedirects?: number, > disableBodyPruning?: boolean, > disableUrlEncoding?: boolean, > disabledSystemHeaders?: { > cache-control?: boolean, > postman-token?: boolean, > content-type?: boolean, > content-length?: boolean, > accept-encoding?: boolean, > connection?: boolean, > host?: boolean > }, > insecureHTTPParser?: boolean, > followOriginalHttpMethod?: boolean, > followAuthorizationHeader?: boolean, > protocolVersion?: http1 | http2 | auto, > removeRefererHeaderOnRedirect?: boolean, > tlsPreferServerCiphers?: boolean, > tlsDisabledProtocols?: string[], > tlsCipherSelection?: string[] > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > id?: string, > name?: string, > uid?: string > } > ``` *** ### createComment `collections.createComment` Create a collection comment **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.createComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `body` | `string` | Yes | — | | `threadId` | `number` | No | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > { > { > userName > } > }?: { > type: user, > id: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > } > ``` *** ### createFolder `collections.createFolder` Create a folder **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.createFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `name` | `string` | No | — | | `folder` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | | `model_id` | `string` | No | — | | `revision` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > order?: string[], > owner?: string, > folder?: string | null, > folders?: string[], > requests?: string[], > createdAt?: string, > updatedAt?: string, > collection?: string, > description?: string, > folders_order?: string[], > lastUpdatedBy?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### createFolderComment `collections.createFolderComment` Create a folder comment **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.createFolderComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `body` | `string` | Yes | — | | `threadId` | `number` | No | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > { > { > userName > } > }?: { > type: user, > id: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > } > ``` *** ### createPullRequest `collections.createPullRequest` Create a pull request **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.createPullRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `reviewers` | `string[]` | Yes | — | | `destinationId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdAt` | `string` | No | — | | `createdBy` | `string` | No | — | | `description` | `string` | No | — | | `destinationId` | `string` | No | — | | `id` | `string` | No | — | | `sourceId` | `string` | No | — | | `status` | `string` | No | — | | `title` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### createRequest `collections.createRequest` Create a request **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.createRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `folder` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `method` | `GET \| PUT \| POST \| PATCH \| DELETE \| COPY \| HEAD \| OPTIONS \| LINK \| UNLINK \| PURGE \| LOCK \| UNLOCK \| PROPFIND \| VIEW` | No | — | | `url` | `object` | No | — | | `headerData` | `object[]` | No | — | | `queryParams` | `object[]` | No | — | | `dataMode` | `raw \| urlencoded \| formdata \| binary \| graphql` | No | — | | `data` | `object[]` | No | — | | `rawModeData` | `string` | No | — | | `graphqlModeData` | `object` | No | — | | `dataOptions` | `object` | No | — | | `auth` | `object` | No | — | | `events` | `object[]` | No | — | > **url full type** > > ```ts theme={null} > string | string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > } > ``` > **headerData full type** > > ```ts theme={null} > { > key?: string, > value?: string, > description?: string > }[] > ``` > **queryParams full type** > > ```ts theme={null} > { > key?: string, > value?: string, > description?: string, > enabled?: boolean > }[] > ``` > **data full type** > > ```ts theme={null} > { > key?: string, > value?: string, > description?: string, > enabled?: boolean, > type?: text | file, > uuid?: string > }[] > ``` > **graphqlModeData full type** > > ```ts theme={null} > { > query?: string, > variables?: string > } > ``` > **dataOptions full type** > > ```ts theme={null} > { > raw?: { > language?: string > }, > urlencoded?: { > }, > params?: { > }, > binary?: { > }, > graphql?: { > } > } > ``` > **auth full type** > > ```ts theme={null} > { > type: basic | bearer | apikey | digest | oauth1 | oauth2 | hawk | awsv4 | ntlm | edgegrid | jwt | asap | noauth, > apikey?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > awsv4?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > basic?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > bearer?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > digest?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > edgegrid?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > hawk?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > ntlm?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > oauth1?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > oauth2?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > jwt?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > asap?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[] > } > ``` > **events full type** > > ```ts theme={null} > { > listen?: test | prerequest, > script?: { > id?: string, > type?: string, > exec?: string[] > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | | `model_id` | `string` | No | — | | `revision` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > owner?: string, > folder?: string | null, > responses?: string[], > collection?: string, > responses_order?: string[], > createdAt?: string, > updatedAt?: string, > lastUpdatedBy?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### createRequestComment `collections.createRequestComment` Create a request comment **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.createRequestComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `requestId` | `string` | Yes | — | | `body` | `string` | Yes | — | | `threadId` | `number` | No | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > { > { > userName > } > }?: { > type: user, > id: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > } > ``` *** ### createResponse `collections.createResponse` Create a response **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.createResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `request` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `url` | `object` | No | — | | `method` | `GET \| PUT \| POST \| PATCH \| DELETE \| COPY \| HEAD \| OPTIONS \| LINK \| UNLINK \| PURGE \| LOCK \| UNLOCK \| PROPFIND \| VIEW` | No | — | | `headers` | `object[]` | No | — | | `dataMode` | `raw \| urlencoded \| formdata \| binary \| graphql` | No | — | | `rawModeData` | `string` | No | — | | `dataOptions` | `object` | No | — | | `responseCode` | `object` | No | — | | `status` | `string` | No | — | | `time` | `string` | No | — | | `cookies` | `string` | No | — | | `mime` | `string` | No | — | | `text` | `string` | No | — | | `language` | `string` | No | — | | `rawDataType` | `string` | No | — | | `requestObject` | `string` | No | — | > **url full type** > > ```ts theme={null} > string | string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > } > ``` > **headers full type** > > ```ts theme={null} > { > key: string, > value: string, > description?: string | null > }[] > ``` > **dataOptions full type** > > ```ts theme={null} > { > raw?: { > language?: string > }, > urlencoded?: { > }, > params?: { > }, > binary?: { > }, > graphql?: { > } > } > ``` > **responseCode full type** > > ```ts theme={null} > { > code?: number, > name?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | | `model_id` | `string` | No | — | | `revision` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > owner?: string, > request?: string, > createdAt?: string, > updatedAt?: string, > lastUpdatedBy?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### createResponseComment `collections.createResponseComment` Create a response comment **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.createResponseComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `responseId` | `string` | Yes | — | | `body` | `string` | Yes | — | | `threadId` | `number` | No | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > { > { > userName > } > }?: { > type: user, > id: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > } > ``` *** ### deleteComment `collections.deleteComment` Delete a collection's comment **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.collections.deleteComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `commentId` | `number` | Yes | — | **Output:** `any` *** ### deleteFolder `collections.deleteFolder` Delete a folder **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.collections.deleteFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | | `collectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | | `model_id` | `string` | No | — | | `revision` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > owner?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### deleteFolderComment `collections.deleteFolderComment` Delete a folder's comment **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.collections.deleteFolderComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `commentId` | `number` | Yes | — | **Output:** `any` *** ### deleteRequestComment `collections.deleteRequestComment` Delete a request's comment **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.collections.deleteRequestComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `requestId` | `string` | Yes | — | | `commentId` | `number` | Yes | — | **Output:** `any` *** ### deleteResponse `collections.deleteResponse` Delete a response **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.collections.deleteResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | | `collectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | | `revision` | `number` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string, > owner?: string > } > ``` *** ### deleteResponseComment `collections.deleteResponseComment` Delete a response's comment **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.collections.deleteResponseComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `responseId` | `string` | Yes | — | | `commentId` | `number` | Yes | — | **Output:** `any` *** ### duplicate `collections.duplicate` Duplicate a collection **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.duplicate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `suffix` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task` | `object` | No | — | > **task full type** > > ```ts theme={null} > { > id?: string, > status?: processing | completed | failed, > reason?: string | null > } > ``` *** ### fork `collections.fork` Create a fork **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.fork({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `workspace` | `string` | Yes | — | | `label` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > id?: string, > name?: string, > fork?: { > label?: string, > createdAt?: string, > from?: string > }, > uid?: string > } > ``` *** ### generateSpec `collections.generateSpec` Generate spec from collection **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.generateSpec({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionUid` | `string` | Yes | — | | `elementType` | `spec` | Yes | — | | `name` | `string` | Yes | — | | `type` | `OPENAPI:2.0 \| OPENAPI:3.0 \| OPENAPI:3.1` | No | — | | `format` | `JSON \| YAML` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | No | — | | `url` | `string` | No | — | *** ### getComments `collections.getComments` Get a collection's comments **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > status?: Open | Resolved, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > }[] > ``` *** ### getDuplicationStatus `collections.getDuplicationStatus` Get duplication task status **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getDuplicationStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task` | `object` | No | — | > **task full type** > > ```ts theme={null} > { > id?: string, > status?: processing | completed | failed, > reason?: string | null > } > ``` *** ### getFolder `collections.getFolder` Get a folder **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | | `collectionId` | `string` | Yes | — | | `ids` | `boolean` | No | — | | `uid` | `boolean` | No | — | | `populate` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > description?: string, > createdAt?: string, > updatedAt?: string, > owner?: string, > lastUpdatedBy?: string, > lastRevision?: number, > collection?: string > } > ``` *** ### getFolderComments `collections.getFolderComments` Get a folder's comments **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getFolderComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > status?: Open | Resolved, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > }[] > ``` *** ### getForks `collections.getForks` Get a collection's forks **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getForks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `direction` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > createdAt?: string, > createdBy?: string, > forkId?: string, > forkName?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > nextCursor?: string | null, > total?: number > } > ``` *** ### getGeneratedSpecs `collections.getGeneratedSpecs` Get generated spec **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getGeneratedSpecs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionUid` | `string` | Yes | — | | `elementType` | `spec` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `specs` | `object[]` | No | — | | `meta` | `object` | No | — | > **specs full type** > > ```ts theme={null} > { > id?: string, > name?: string, > state?: in-sync | out-of-sync | sync-in-progress, > createdAt?: string, > updatedAt?: string, > createdBy?: number, > updatedBy?: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > nextCursor?: string | null > } > ``` *** ### getPullRequests `collections.getPullRequests` Get a collection's pull requests **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getPullRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > createdAt?: string, > createdBy?: string, > description?: string, > destinationId?: string, > href?: string, > id?: string, > sourceId?: string, > status?: open | approved | declined | merged, > comment?: string, > title?: string, > updatedBy?: string, > updatedAt?: string > }[] > ``` *** ### getRequest `collections.getRequest` Get a request **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `collectionId` | `string` | Yes | — | | `ids` | `boolean` | No | — | | `uid` | `boolean` | No | — | | `populate` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | No | — | | `meta` | `object` | No | — | | `data` | `object` | No | — | > **meta full type** > > ```ts theme={null} > { > } > ``` > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > owner?: string, > lastRevision?: number, > lastUpdatedBy?: string, > createdAt?: string, > updatedAt?: string > } > ``` *** ### getRequestComments `collections.getRequestComments` Get a request's comments **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getRequestComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `requestId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > status?: Open | Resolved, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > }[] > ``` *** ### getResponse `collections.getResponse` Get a response **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | | `collectionId` | `string` | Yes | — | | `ids` | `boolean` | No | — | | `uid` | `boolean` | No | — | | `populate` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | | `model_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > request?: string, > name?: string, > owner?: string, > createdAt?: string, > updatedAt?: string, > lastRevision?: number, > lastUpdatedBy?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### getResponseComments `collections.getResponseComments` Get a response's comments **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getResponseComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `responseId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > status?: Open | Resolved, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > }[] > ``` *** ### getRoles `collections.getRoles` Get a collection's roles **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `group` | `object[]` | No | — | | `team` | `object[]` | No | — | | `user` | `object[]` | No | — | > **group full type** > > ```ts theme={null} > { > role?: VIEWER | EDITOR, > id?: number > }[] > ``` > **team full type** > > ```ts theme={null} > { > role?: VIEWER | EDITOR, > id?: number > }[] > ``` > **user full type** > > ```ts theme={null} > { > role?: VIEWER | EDITOR, > id?: number > }[] > ``` *** ### getSourceStatus `collections.getSourceStatus` Get source collection's status **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getSourceStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > collectionUid?: { > isSourceAhead?: boolean > } > } > ``` *** ### getUpdateStatus `collections.getUpdateStatus` Get async collection update status **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.getUpdateStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `status` | `successful \| failed \| in-progress` | No | — | *** ### list `collections.list` Get all collections **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | No | — | | `name` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collections` | `object[]` | No | — | | `meta` | `object` | No | — | > **collections full type** > > ```ts theme={null} > { > id?: string, > name?: string, > owner?: string, > createdAt?: string, > updatedAt?: string, > uid?: string, > fork?: { > label?: string, > createdAt?: string, > from?: string > }, > isPublic?: boolean > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > offset?: number, > limit?: number > } > ``` *** ### listForked `collections.listForked` Get all forked collections **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.listForked({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `direction` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > forkName?: string, > forkId?: string, > sourceId?: string, > createdAt?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > nextCursor?: string | null, > inaccessibleFork?: number > } > ``` *** ### mergeFork `collections.mergeFork` Merge a fork (Deprecated by Postman.) **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.mergeFork({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `destination` | `string` | Yes | — | | `source` | `string` | Yes | — | | `strategy` | `deleteSource \| updateSourceWithDestination` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > id?: string, > uid?: string > } > ``` *** ### pullChanges `collections.pullChanges` Pull source changes **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.pullChanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > destinationId?: string, > sourceId?: string > } > ``` *** ### remove `collections.remove` Delete a collection **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.collections.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > id?: string, > uid?: string > } > ``` *** ### replace `collections.replace` Replace a collection's data **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > info: { > name: string, > _postman_id?: string, > description?: string, > schema: https://schema.postman.com/json/collection/v2.1.0/collection.json, > updatedAt?: string, > createdAt?: string, > lastUpdatedBy?: string, > uid?: string > }, > item: { > id: string, > name?: string, > description?: string | null, > variable?: { > key?: string, > value?: string | boolean | number, > description?: string, > disabled?: boolean, > type?: string > }[], > event?: { > id?: string, > listen?: test | prerequest, > script?: { > id?: string, > name?: string, > type?: string, > exec?: string[] > } > }[], > request?: { > url?: string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > }, > auth?: any, > method?: string, > description?: string | null, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string | { > mode?: string, > raw?: string, > urlencoded?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > formdata?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > file?: { > src?: string, > content?: string > }, > graphql?: { > }, > options?: { > } > } > }, > response?: { > id?: string, > name?: string, > status?: string, > code?: string | number, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > cookie?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string, > responseTime?: string | number, > originalRequest?: { > url?: string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > }, > auth?: any, > method?: string, > description?: string | null, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string | { > mode?: string, > raw?: string, > urlencoded?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > formdata?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > file?: { > src?: string, > content?: string > }, > graphql?: { > }, > options?: { > } > } > } > }[], > protocolProfileBehavior?: { > strictSSL?: boolean, > followRedirects?: boolean, > maxRedirects?: number, > disableBodyPruning?: boolean, > disableUrlEncoding?: boolean, > disabledSystemHeaders?: string[], > insecureHTTPParser?: boolean, > followOriginalHttpMethod?: boolean, > followAuthorizationHeader?: boolean, > protocolVersion?: http1 | http2 | auto, > removeRefererHeaderOnRedirect?: boolean, > tlsPreferServerCiphers?: boolean, > tlsDisabledProtocols?: string[], > tlsCipherSelection?: string[] > }, > createdAt?: string, > updatedAt?: string, > uid?: string > }[], > event?: { > id?: string, > listen: test | prerequest, > script?: { > id?: string, > type?: string, > exec?: string[] > } > }[], > variable?: ( > { > key?: string, > value?: string | boolean | number, > disabled?: boolean > } | { > enabled?: boolean, > key?: string, > secret?: boolean, > source?: { > postman?: { > }, > provider?: postman > }, > description?: string > } > )[], > auth?: { > type: basic | bearer | apikey | digest | oauth1 | oauth2 | hawk | awsv4 | ntlm | edgegrid | jwt | asap, > apikey?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > awsv4?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > basic?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > bearer?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > digest?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > edgegrid?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > hawk?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > ntlm?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > oauth1?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > oauth2?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > jwt?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > asap?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[] > }, > protocolProfileBehavior?: { > strictSSL?: boolean, > followRedirects?: boolean, > maxRedirects?: number, > disableBodyPruning?: boolean, > disableUrlEncoding?: boolean, > disabledSystemHeaders?: { > cache-control?: boolean, > postman-token?: boolean, > content-type?: boolean, > content-length?: boolean, > accept-encoding?: boolean, > connection?: boolean, > host?: boolean > }, > insecureHTTPParser?: boolean, > followOriginalHttpMethod?: boolean, > followAuthorizationHeader?: boolean, > protocolVersion?: http1 | http2 | auto, > removeRefererHeaderOnRedirect?: boolean, > tlsPreferServerCiphers?: boolean, > tlsDisabledProtocols?: string[], > tlsCipherSelection?: string[] > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > id?: string, > name?: string, > uid?: string > } > ``` *** ### syncWithSchema `collections.syncWithSchema` Sync collection with schema (Deprecated by Postman.) **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.syncWithSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiId` | `string` | Yes | — | | `collectionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | No | — | *** ### syncWithSpec `collections.syncWithSpec` Sync collection with spec **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.syncWithSpec({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionUid` | `string` | Yes | — | | `specId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | No | — | | `url` | `string` | No | — | *** ### transferFolders `collections.transferFolders` Transfer folders **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.transferFolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | | `mode` | `copy \| move` | Yes | — | | `target` | `object` | Yes | — | | `location` | `object` | Yes | — | > **target full type** > > ```ts theme={null} > { > id: string, > model: collection | folder | request > } > ``` > **location full type** > > ```ts theme={null} > { > id?: string | null, > model?: string | null, > position: start | end | before | after > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | No | — | *** ### transformToOpenapi `collections.transformToOpenapi` Transform collection to OpenAPI **Risk:** `read` ```ts theme={null} await corsair.postman.api.collections.transformToOpenapi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `format` | `json \| yaml` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `output` | `string` | No | — | *** ### update `collections.update` Update part of a collection **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > string | { > info?: { > name?: string, > description?: string, > schema?: string > }, > item?: { > id?: string, > uid?: string, > name?: string, > description?: string | null, > variable?: { > key?: string, > value?: string | boolean | number, > description?: string, > disabled?: boolean, > type?: string > }[], > event?: { > id?: string, > listen?: test | prerequest, > script?: { > id?: string, > name?: string, > type?: string, > exec?: string[] > } > }[], > request?: string | { > url?: string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > }, > auth?: any, > method?: string, > description?: string | null, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string | { > mode?: string, > raw?: string, > urlencoded?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > formdata?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > file?: { > src?: string, > content?: string > }, > graphql?: { > }, > options?: { > } > } > }, > response?: { > id?: string, > name?: string, > status?: string, > code?: string | number, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > cookie?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string, > responseTime?: string | number, > originalRequest?: { > url?: string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > }, > auth?: any, > method?: string, > description?: string | null, > header?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > body?: string | { > mode?: string, > raw?: string, > urlencoded?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > formdata?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > file?: { > src?: string, > content?: string > }, > graphql?: { > }, > options?: { > } > } > } > }[], > protocolProfileBehavior?: { > strictSSL?: boolean, > followRedirects?: boolean, > maxRedirects?: number, > disableBodyPruning?: boolean, > disableUrlEncoding?: boolean, > disabledSystemHeaders?: string[], > insecureHTTPParser?: boolean, > followOriginalHttpMethod?: boolean, > followAuthorizationHeader?: boolean, > protocolVersion?: http1 | http2 | auto, > removeRefererHeaderOnRedirect?: boolean, > tlsPreferServerCiphers?: boolean, > tlsDisabledProtocols?: string[], > tlsCipherSelection?: string[] > }, > createdAt?: string, > updatedAt?: string, > item?: lazy[] > }[], > event?: { > id?: string, > listen?: test | prerequest, > script?: { > id?: string, > name?: string, > type?: string, > exec?: string[] > } > }[], > variable?: { > key?: string, > value?: string | boolean | number, > description?: string, > disabled?: boolean, > type?: string > }[], > auth?: any > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `collection` | `object` | No | — | > **collection full type** > > ```ts theme={null} > { > id?: string, > name?: string, > description?: string > } > ``` *** ### updateFolder `collections.updateFolder` Update a folder **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.updateFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | Yes | — | | `collectionId` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | | `model_id` | `string` | No | — | | `revision` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > description?: string, > createdAt?: string, > updatedAt?: string, > owner?: string, > lastUpdatedBy?: string, > lastRevision?: number, > collection?: string, > folder?: string | null > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### updateFolderComment `collections.updateFolderComment` Update a folder's comment **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.updateFolderComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `folderId` | `string` | Yes | — | | `commentId` | `number` | Yes | — | | `body` | `string` | Yes | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > { > { > userName > } > }?: { > type: user, > id: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > } > ``` *** ### updateRequest `collections.updateRequest` Update a request **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.updateRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `collectionId` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `method` | `GET \| PUT \| POST \| PATCH \| DELETE \| COPY \| HEAD \| OPTIONS \| LINK \| UNLINK \| PURGE \| LOCK \| UNLOCK \| PROPFIND \| VIEW` | No | — | | `url` | `object` | No | — | | `headerData` | `object[]` | No | — | | `queryParams` | `object[]` | No | — | | `dataMode` | `raw \| urlencoded \| formdata \| binary \| graphql` | No | — | | `data` | `object[]` | No | — | | `rawModeData` | `string` | No | — | | `graphqlModeData` | `object` | No | — | | `dataOptions` | `object` | No | — | | `auth` | `object` | No | — | | `events` | `object[]` | No | — | > **url full type** > > ```ts theme={null} > string | string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > } > ``` > **headerData full type** > > ```ts theme={null} > { > key?: string, > value?: string, > description?: string > }[] > ``` > **queryParams full type** > > ```ts theme={null} > { > key?: string, > value?: string, > description?: string, > enabled?: boolean > }[] > ``` > **data full type** > > ```ts theme={null} > { > key?: string, > value?: string, > description?: string, > enabled?: boolean, > type?: text | file, > uuid?: string > }[] > ``` > **graphqlModeData full type** > > ```ts theme={null} > { > query?: string, > variables?: string > } > ``` > **dataOptions full type** > > ```ts theme={null} > { > raw?: { > language?: string > }, > urlencoded?: { > }, > params?: { > }, > binary?: { > }, > graphql?: { > } > } > ``` > **auth full type** > > ```ts theme={null} > { > type: basic | bearer | apikey | digest | oauth1 | oauth2 | hawk | awsv4 | ntlm | edgegrid | jwt | asap | noauth, > apikey?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > awsv4?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > basic?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > bearer?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > digest?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > edgegrid?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > hawk?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > ntlm?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > oauth1?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > oauth2?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > jwt?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[], > asap?: { > key: string, > value?: string | { > key: string, > value?: string | number | boolean, > type?: string > }[], > type?: string | boolean | number | array | object | any > }[] > } > ``` > **events full type** > > ```ts theme={null} > { > listen?: test | prerequest, > script?: { > id?: string, > type?: string, > exec?: string[] > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | | `model_id` | `string` | No | — | | `revision` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > description?: string, > createdAt?: string, > updatedAt?: string, > owner?: string, > lastUpdatedBy?: string, > lastRevision?: number > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### updateRequestComment `collections.updateRequestComment` Update a request's comment **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.updateRequestComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `requestId` | `string` | Yes | — | | `commentId` | `number` | Yes | — | | `body` | `string` | Yes | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > { > { > userName > } > }?: { > type: user, > id: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > } > ``` *** ### updateResponse `collections.updateResponse` Update a response **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.updateResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `responseId` | `string` | Yes | — | | `collectionId` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `url` | `object` | No | — | | `method` | `GET \| PUT \| POST \| PATCH \| DELETE \| COPY \| HEAD \| OPTIONS \| LINK \| UNLINK \| PURGE \| LOCK \| UNLOCK \| PROPFIND \| VIEW` | No | — | | `headers` | `object[]` | No | — | | `dataMode` | `raw \| urlencoded \| formdata \| binary \| graphql` | No | — | | `rawModeData` | `string` | No | — | | `dataOptions` | `object` | No | — | | `responseCode` | `object` | No | — | | `status` | `string` | No | — | | `time` | `string` | No | — | | `cookies` | `string` | No | — | | `mime` | `string` | No | — | | `text` | `string` | No | — | | `language` | `string` | No | — | | `rawDataType` | `string` | No | — | | `requestObject` | `string` | No | — | > **url full type** > > ```ts theme={null} > string | string | { > raw?: string, > protocol?: string, > host?: string[], > path?: string[], > port?: string, > query?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[], > variable?: { > key?: string, > value?: string, > description?: string | null, > disabled?: boolean > }[] > } > ``` > **headers full type** > > ```ts theme={null} > { > key: string, > value: string, > description?: string | null > }[] > ``` > **dataOptions full type** > > ```ts theme={null} > { > raw?: { > language?: string > }, > urlencoded?: { > }, > params?: { > }, > binary?: { > }, > graphql?: { > } > } > ``` > **responseCode full type** > > ```ts theme={null} > { > code?: number, > name?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | | `model_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > name?: string, > owner?: string, > createdAt?: string, > updatedAt?: string, > lastRevision?: number, > lastUpdatedBy?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` *** ### updateResponseComment `collections.updateResponseComment` Update a response's comment **Risk:** `write` ```ts theme={null} await corsair.postman.api.collections.updateResponseComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionId` | `string` | Yes | — | | `responseId` | `string` | Yes | — | | `commentId` | `number` | Yes | — | | `body` | `string` | Yes | — | | `tags` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > { > { > userName > } > }?: { > type: user, > id: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > threadId?: number, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > body?: string > } > ``` *** ## Comments ### resolve `comments.resolve` Resolve a comment thread **Risk:** `write` ```ts theme={null} await corsair.postman.api.comments.resolve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `threadId` | `number` | Yes | — | **Output:** `any` *** ## Environments ### create `environments.create` Create an environment **Risk:** `write` ```ts theme={null} await corsair.postman.api.environments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `environment` | `object` | No | — | > **environment full type** > > ```ts theme={null} > { > name: string, > values?: ( > { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > description?: string > } | { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > secret?: boolean, > source?: { > postman?: { > }, > provider?: postman > }, > description?: string > } > )[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `environment` | `object` | No | — | > **environment full type** > > ```ts theme={null} > { > id?: string, > name?: string, > uid?: string > } > ``` *** ### fork `environments.fork` Create a fork **Risk:** `write` ```ts theme={null} await corsair.postman.api.environments.fork({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `environmentId` | `string` | Yes | — | | `workspaceId` | `string` | Yes | — | | `forkName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `environment` | `object` | No | — | > **environment full type** > > ```ts theme={null} > { > uid?: string, > name?: string, > forkName?: string > } > ``` *** ### get `environments.get` Get an environment **Risk:** `read` ```ts theme={null} await corsair.postman.api.environments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `environmentId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `environment` | `object` | No | — | > **environment full type** > > ```ts theme={null} > { > id?: string, > name?: string, > owner?: string, > createdAt?: string, > updatedAt?: string, > values?: ( > { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > description?: string > } | { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > secret?: boolean, > source?: { > }, > description?: string > } > )[], > isPublic?: boolean > } > ``` *** ### getForks `environments.getForks` Get an environment's forks **Risk:** `read` ```ts theme={null} await corsair.postman.api.environments.getForks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `environmentId` | `string` | Yes | — | | `cursor` | `string` | No | — | | `direction` | `asc \| desc` | No | — | | `limit` | `number` | No | — | | `sort` | `createdAt` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > forkId?: string, > forkName?: string, > createdAt?: string, > createdBy?: string, > updatedAt?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total?: number, > nextCursor?: string | null > } > ``` *** ### list `environments.list` Get all environments **Risk:** `read` ```ts theme={null} await corsair.postman.api.environments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `environments` | `object[]` | No | — | > **environments full type** > > ```ts theme={null} > { > id?: string, > name?: string, > createdAt?: string, > updatedAt?: string, > owner?: string, > uid?: string, > isPublic?: boolean > }[] > ``` *** ### mergeFork `environments.mergeFork` Merge a fork **Risk:** `write` ```ts theme={null} await corsair.postman.api.environments.mergeFork({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `environmentId` | `string` | Yes | — | | `source` | `string` | Yes | — | | `deleteSource` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `environment` | `object` | No | — | > **environment full type** > > ```ts theme={null} > { > uid?: string > } > ``` *** ### remove `environments.remove` Delete an environment **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.environments.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `environmentId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `environment` | `object` | No | — | > **environment full type** > > ```ts theme={null} > { > id?: string, > uid?: string > } > ``` *** ### replace `environments.replace` Replace an environment's data **Risk:** `write` ```ts theme={null} await corsair.postman.api.environments.replace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `environmentId` | `string` | Yes | — | | `environment` | `object` | No | — | > **environment full type** > > ```ts theme={null} > { > name?: string, > values?: ( > { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > description?: string > } | { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > secret?: boolean, > source?: { > postman?: { > }, > provider?: postman > }, > description?: string > } > )[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `environment` | `object` | No | — | > **environment full type** > > ```ts theme={null} > { > id?: string, > name?: string, > uid?: string > } > ``` *** ### update `environments.update` Update an environment **Risk:** `write` ```ts theme={null} await corsair.postman.api.environments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `environmentId` | `string` | Yes | — | | `body` | `object[]` | No | — | > **body full type** > > ```ts theme={null} > { > op: string, > path: string, > value: { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > description?: string > } | { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > secret?: boolean, > source?: { > postman?: { > }, > provider?: postman > }, > description?: string > } > }[] | { > op: string, > path: string, > value: string > }[] | { > op: string, > path: string, > value: string > }[] | { > op: string, > path: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `environment` | `object` | No | — | > **environment full type** > > ```ts theme={null} > { > id?: string, > name?: string, > owner?: string, > createdAt?: string, > updatedAt?: string, > values?: ( > { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > description?: string > } | { > enabled?: boolean, > key?: string, > value?: string, > type?: secret | default, > secret?: boolean, > source?: { > }, > description?: string > } > )[], > uid?: string > } > ``` *** ## Groups ### list `groups.list` Get all groups **Risk:** `read` ```ts theme={null} await corsair.postman.api.groups.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > teamId?: number, > name?: string, > summary?: string, > createdBy?: number, > createdAt?: string, > updatedAt?: string, > members?: number[], > roles?: string[] > }[] > ``` *** ## Mocks ### create `mocks.create` Create a mock server **Risk:** `write` ```ts theme={null} await corsair.postman.api.mocks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `mock` | `object` | No | — | > **mock full type** > > ```ts theme={null} > { > collection: string, > environment?: string, > name?: string, > private?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `mock` | `object` | No | — | > **mock full type** > > ```ts theme={null} > { > id?: string, > owner?: string, > uid?: string, > collection?: string, > mockUrl?: string, > name?: string, > config?: { > delay?: { > type?: fixed, > preset?: 1 | 2, > duration?: number > }, > headers?: string[], > matchBody?: boolean, > matchHeader?: boolean, > matchQueryParams?: boolean, > matchWildcards?: boolean, > serverResponseId?: string | null > }, > createdAt?: string, > updatedAt?: string, > environment?: string > } > ``` *** ### createServerResponse `mocks.createServerResponse` Create a server response **Risk:** `write` ```ts theme={null} await corsair.postman.api.mocks.createServerResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mockId` | `string` | Yes | — | | `serverResponse` | `object` | No | — | > **serverResponse full type** > > ```ts theme={null} > { > name: string, > statusCode: number, > headers?: { > key?: string, > value?: string > }[], > language?: text | javascript | json | html | xml, > body?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `id` | `string` | No | — | | `name` | `string` | No | — | | `statusCode` | `number` | No | — | | `headers` | `object[]` | No | — | | `language` | `text \| javascript \| json \| html \| xml` | No | — | | `body` | `string` | No | — | | `createdBy` | `string` | No | — | | `updatedBy` | `string` | No | — | | `mock` | `string` | No | — | > **headers full type** > > ```ts theme={null} > { > key?: string, > value?: string > }[] > ``` *** ### deleteServerResponse `mocks.deleteServerResponse` Delete a server response **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.mocks.deleteServerResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mockId` | `string` | Yes | — | | `serverResponseId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `statusCode` | `number` | No | — | | `headers` | `object[]` | No | — | | `language` | `text \| javascript \| json \| html \| xml` | No | — | | `body` | `string` | No | — | | `createdBy` | `string` | No | — | | `updatedBy` | `string` | No | — | | `createdAt` | `string` | No | — | > **headers full type** > > ```ts theme={null} > { > key?: string, > value?: string > }[] > ``` *** ### list `mocks.list` Get all mock servers **Risk:** `read` ```ts theme={null} await corsair.postman.api.mocks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | No | — | | `workspace` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `mocks` | `object[]` | No | — | > **mocks full type** > > ```ts theme={null} > { > id?: string, > owner?: string, > uid?: string, > collection?: string, > mockUrl?: string, > name?: string, > config?: { > delay?: any, > headers?: string[], > matchBody?: boolean, > matchHeader?: boolean, > matchQueryParams?: boolean, > matchWildcards?: boolean, > serverResponseId?: string | null > }, > createdAt?: string, > updatedAt?: string, > isPublic?: boolean, > deactivated?: boolean, > environment?: string > }[] > ``` *** ### publish `mocks.publish` Publish a mock server **Risk:** `write` ```ts theme={null} await corsair.postman.api.mocks.publish({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mockId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `mock` | `object` | No | — | > **mock full type** > > ```ts theme={null} > { > id?: string > } > ``` *** ### update `mocks.update` Update a mock server **Risk:** `write` ```ts theme={null} await corsair.postman.api.mocks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mockId` | `string` | Yes | — | | `mock` | `object` | No | — | > **mock full type** > > ```ts theme={null} > { > name?: string, > environment?: string, > description?: string, > private?: boolean, > versionTag?: string, > collection?: string, > config?: { > serverResponseId?: string | null > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `mock` | `object` | No | — | > **mock full type** > > ```ts theme={null} > { > id?: string, > owner?: string, > uid?: string, > collection?: string, > mockUrl?: string, > name?: string, > config?: { > delay?: { > type?: fixed, > preset?: 1 | 2, > duration?: number > }, > headers?: string[], > matchBody?: boolean, > matchHeader?: boolean, > matchQueryParams?: boolean, > matchWildcards?: boolean, > serverResponseId?: string | null > }, > createdAt?: string, > updatedAt?: string, > environment?: string > } > ``` *** ### updateServerResponse `mocks.updateServerResponse` Update a server response **Risk:** `write` ```ts theme={null} await corsair.postman.api.mocks.updateServerResponse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mockId` | `string` | Yes | — | | `serverResponseId` | `string` | Yes | — | | `serverResponse` | `object` | No | — | > **serverResponse full type** > > ```ts theme={null} > { > name?: string, > statusCode?: number, > headers?: { > key?: string, > value?: string > }[], > language?: text | javascript | json | html | xml, > body?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `id` | `string` | No | — | | `name` | `string` | No | — | | `statusCode` | `number` | No | — | | `headers` | `object[]` | No | — | | `language` | `text \| javascript \| json \| html \| xml` | No | — | | `body` | `string` | No | — | | `createdBy` | `string` | No | — | | `updatedBy` | `string` | No | — | | `mock` | `string` | No | — | > **headers full type** > > ```ts theme={null} > { > key?: string, > value?: string > }[] > ``` *** ## Monitors ### create `monitors.create` Create a monitor **Risk:** `write` ```ts theme={null} await corsair.postman.api.monitors.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `monitor` | `object` | No | — | > **monitor full type** > > ```ts theme={null} > { > name: string, > active?: boolean, > notificationLimit?: number, > collection: string, > environment?: string, > retry?: { > attempts?: number > }, > options?: { > followRedirects?: boolean, > requestDelay?: number, > requestTimeout?: number, > strictSSL?: boolean > }, > schedule: { > cron?: string, > timezone?: string > }, > distribution?: { > region?: us-east | us-west | ap-southeast | ca-central | eu-central | sa-east | uk | us-east-staticip | us-west-staticip > }[], > notifications?: { > onError?: { > email?: string > }[], > onFailure?: { > email?: string > }[] > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `monitor` | `object` | No | — | > **monitor full type** > > ```ts theme={null} > { > id?: string, > name?: string, > active?: boolean, > uid?: string > } > ``` *** ### get `monitors.get` Get a monitor **Risk:** `read` ```ts theme={null} await corsair.postman.api.monitors.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `monitorId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `monitor` | `object` | No | — | > **monitor full type** > > ```ts theme={null} > { > id?: string, > name?: string, > uid?: string, > owner?: number, > active?: boolean, > notificationLimit?: number, > collectionUid?: string, > environmentUid?: string, > jobId?: string, > options?: { > followRedirects?: boolean, > requestDelay?: number, > requestTimeout?: number, > strictSSL?: boolean > }, > notifications?: { > onError?: any[], > onFailure?: any[] > }, > distribution?: { > region?: us-east | us-west | ap-southeast | ca-central | eu-central | sa-east | uk | us-east-staticip | us-west-staticip > }[], > schedule?: { > cron?: string, > nextRun?: string, > timezone?: string > }, > retry?: { > attempts?: number > }, > lastRun?: { > status?: string, > startedAt?: string, > finishedAt?: string, > stats?: { > assertions?: any, > requests?: any, > runCount?: number, > errorCount?: number, > abortedCount?: number, > responseLatency?: number, > responseSize?: number > } > } > } > ``` *** ### list `monitors.list` Get all monitors **Risk:** `read` ```ts theme={null} await corsair.postman.api.monitors.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | No | — | | `active` | `boolean` | No | — | | `owner` | `number` | No | — | | `collectionUid` | `string` | No | — | | `environmentUid` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `monitors` | `object[]` | No | — | | `meta` | `object` | No | — | > **monitors full type** > > ```ts theme={null} > { > id?: string, > name?: string, > active?: boolean, > uid?: string, > owner?: number, > collectionUid?: string, > environmentUid?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > nextCursor?: string | null, > limit?: number > } > ``` *** ### remove `monitors.remove` Delete a monitor **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.monitors.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `monitorId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `monitor` | `object` | No | — | > **monitor full type** > > ```ts theme={null} > { > id?: string, > uid?: string > } > ``` *** ### run `monitors.run` Run a monitor **Risk:** `write` ```ts theme={null} await corsair.postman.api.monitors.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `monitorId` | `string` | Yes | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `run` | `object` | No | — | > **run full type** > > ```ts theme={null} > { > info?: { > jobId?: string, > collectionUid?: string, > environmentUid?: string, > monitorId?: string, > name?: string, > status?: string, > startedAt?: string, > finishedAt?: string > }, > stats?: { > assertions?: { > total?: number, > failed?: number > }, > requests?: { > total?: number, > failed?: number > }, > runCount?: number, > errorCount?: number, > abortedCount?: number, > responseLatency?: number, > responseSize?: number > }, > executions?: { > id?: number, > item?: any, > request?: any, > response?: any, > errors?: any[] > }[], > failures?: { > }[] > } > ``` *** ### update `monitors.update` Update a monitor **Risk:** `write` ```ts theme={null} await corsair.postman.api.monitors.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `monitorId` | `string` | Yes | — | | `monitor` | `object` | No | — | > **monitor full type** > > ```ts theme={null} > { > name?: string, > active?: boolean, > notificationLimit?: number, > retry?: { > attempts?: number > }, > options?: { > followRedirects?: boolean, > requestDelay?: number, > requestTimeout?: number, > strictSSL?: boolean > }, > schedule?: { > cron?: string, > timezone?: string > }, > distribution?: { > region?: us-east | us-west | ap-southeast | ca-central | eu-central | sa-east | uk | us-east-staticip | us-west-staticip > }[], > notifications?: { > onError?: { > email?: string > }[], > onFailure?: { > email?: string > }[] > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `monitor` | `object` | No | — | > **monitor full type** > > ```ts theme={null} > { > id?: string, > name?: string, > active?: boolean, > uid?: string > } > ``` *** ## Pull Requests ### review `pullRequests.review` Review a pull request **Risk:** `write` ```ts theme={null} await corsair.postman.api.pullRequests.review({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pullRequestId` | `string` | Yes | — | | `action` | `approve \| decline \| merge \| unapprove` | Yes | — | | `comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `reviewedBy` | `object` | No | — | | `status` | `string` | No | — | | `updatedAt` | `string` | No | — | > **reviewedBy full type** > > ```ts theme={null} > { > id?: number, > name?: string, > username?: string > } > ``` *** ### update `pullRequests.update` Update a pull request **Risk:** `write` ```ts theme={null} await corsair.postman.api.pullRequests.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pullRequestId` | `string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `reviewers` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdAt` | `string` | No | — | | `createdBy` | `string` | No | — | | `description` | `string` | No | — | | `destinationId` | `string` | No | — | | `forkType` | `string` | No | — | | `id` | `string` | No | — | | `sourceId` | `string` | No | — | | `status` | `open \| approved \| declined \| merged` | No | — | | `title` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ## Scim ### getResourceTypes `scim.getResourceTypes` Get resource types **Risk:** `read` ```ts theme={null} await corsair.postman.api.scim.getResourceTypes({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > schemas?: string[], > id?: string, > name?: string, > endpoint?: string, > description?: string, > schema?: string, > schemaExtensions?: { > schema?: string, > required?: boolean > }[] > }[] > ``` *** ### getServiceConfig `scim.getServiceConfig` Get service provider configuration **Risk:** `read` ```ts theme={null} await corsair.postman.api.scim.getServiceConfig({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `schemas` | `string[]` | No | — | | `documentationUri` | `string` | No | — | | `patch` | `object` | No | — | | `bulk` | `object` | No | — | | `filter` | `object` | No | — | | `changePassword` | `object` | No | — | | `sort` | `object` | No | — | | `authenticationSchemes` | `object[]` | No | — | | `etag` | `object` | No | — | | `meta` | `object` | No | — | > **patch full type** > > ```ts theme={null} > { > supported?: boolean > } > ``` > **bulk full type** > > ```ts theme={null} > { > maxOperations?: number, > maxPayloadSize?: number, > supported?: boolean > } > ``` > **filter full type** > > ```ts theme={null} > { > maxResults?: number, > supported?: boolean > } > ``` > **changePassword full type** > > ```ts theme={null} > { > supported?: boolean > } > ``` > **sort full type** > > ```ts theme={null} > { > supported?: boolean > } > ``` > **authenticationSchemes full type** > > ```ts theme={null} > { > description?: string, > name?: string, > specUri?: string, > type?: string > }[] > ``` > **etag full type** > > ```ts theme={null} > { > supported?: boolean > } > ``` > **meta full type** > > ```ts theme={null} > { > resourceType?: string, > location?: string > } > ``` *** ## Specs ### create `specs.create` Create a spec **Risk:** `write` ```ts theme={null} await corsair.postman.api.specs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `type` | `OPENAPI:2.0 \| OPENAPI:3.0 \| OPENAPI:3.1 \| ASYNCAPI:2.0 \| ASYNCAPI:3.0 \| PROTOBUF:2 \| PROTOBUF:3 \| GRAPHQL \| SMITHY:2.0` | Yes | — | | `files` | `object[]` | Yes | — | > **files full type** > > ```ts theme={null} > ( > { > path: string, > content: string, > type: DEFAULT | ROOT > } | { > path: string, > content: string > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `type` | `OPENAPI:2.0 \| OPENAPI:3.0 \| OPENAPI:3.1 \| ASYNCAPI:2.0 \| ASYNCAPI:3.0 \| PROTOBUF:2 \| PROTOBUF:3 \| GRAPHQL \| SMITHY:2.0` | No | — | | `id` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `createdBy` | `number` | No | — | | `updatedBy` | `number` | No | — | *** ### createFile `specs.createFile` Create a spec file **Risk:** `write` ```ts theme={null} await corsair.postman.api.specs.createFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | | `path` | `string` | Yes | — | | `content` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdAt` | `string` | No | — | | `createdBy` | `number` | No | — | | `id` | `string` | No | — | | `path` | `string` | No | — | | `updatedAt` | `string` | No | — | | `updatedBy` | `number` | No | — | | `type` | `DEFAULT \| ROOT` | No | — | *** ### deleteFile `specs.deleteFile` Delete a spec file **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.specs.deleteFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | | `filePath` | `string` | Yes | — | **Output:** `any` *** ### generateCollection `specs.generateCollection` Generate a collection from spec **Risk:** `write` ```ts theme={null} await corsair.postman.api.specs.generateCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | | `elementType` | `collection` | Yes | — | | `name` | `string` | Yes | — | | `options` | `object` | Yes | — | > **options full type** > > ```ts theme={null} > { > requestNameSource?: Fallback | URL, > indentCharacter?: Tab | Space, > parametersResolution?: string, > folderStrategy?: Paths | Tags, > includeAuthInfoInExample?: boolean, > enableOptionalParameters?: boolean, > keepImplicitHeaders?: boolean, > includeDeprecated?: boolean, > alwaysInheritAuthentication?: boolean, > nestedFolderHierarchy?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | No | — | | `url` | `string` | No | — | *** ### get `specs.get` Get a spec **Risk:** `read` ```ts theme={null} await corsair.postman.api.specs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `fileFormat` | `json \| yaml \| proto \| graphql \| smithy` | No | — | | `name` | `string` | No | — | | `type` | `OPENAPI:2.0 \| OPENAPI:3.0 \| OPENAPI:3.1 \| ASYNCAPI:2.0 \| ASYNCAPI:3.0 \| PROTOBUF:2 \| PROTOBUF:3 \| GRAPHQL \| SMITHY:2.0` | No | — | | `createdBy` | `number` | No | — | | `updatedBy` | `number` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### getDefinition `specs.getDefinition` Get a spec's definition **Risk:** `read` ```ts theme={null} await corsair.postman.api.specs.getDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getFile `specs.getFile` Get a spec file **Risk:** `read` ```ts theme={null} await corsair.postman.api.specs.getFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | | `filePath` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `path` | `string` | No | — | | `createdBy` | `number` | No | — | | `updatedBy` | `number` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `type` | `ROOT \| DEFAULT` | No | — | | `content` | `string` | No | — | *** ### getFiles `specs.getFiles` Get a spec's files **Risk:** `read` ```ts theme={null} await corsair.postman.api.specs.getFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `files` | `object[]` | No | — | | `meta` | `object` | No | — | > **files full type** > > ```ts theme={null} > { > id?: string, > path?: string, > name?: string, > createdBy?: number, > updatedBy?: number, > createdAt?: string, > updatedAt?: string, > type?: ROOT | DEFAULT > }[] > ``` > **meta full type** > > ```ts theme={null} > { > nextCursor?: string | null > } > ``` *** ### getGeneratedCollections `specs.getGeneratedCollections` Get a spec's generated collections **Risk:** `read` ```ts theme={null} await corsair.postman.api.specs.getGeneratedCollections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | | `elementType` | `collection` | Yes | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `collections` | `object[]` | No | — | | `meta` | `object` | No | — | > **collections full type** > > ```ts theme={null} > { > id?: string, > name?: string, > state?: in-sync | out-of-sync | sync-in-progress, > createdAt?: string, > updatedAt?: string, > createdBy?: number > }[] > ``` > **meta full type** > > ```ts theme={null} > { > nextCursor?: string | null > } > ``` *** ### list `specs.list` Get all specs **Risk:** `read` ```ts theme={null} await corsair.postman.api.specs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meta` | `object` | No | — | | `specs` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > nextCursor?: string | null > } > ``` > **specs full type** > > ```ts theme={null} > { > id?: string, > name?: string, > type?: OPENAPI:2.0 | OPENAPI:3.0 | OPENAPI:3.1 | ASYNCAPI:2.0 | ASYNCAPI:3.0 | PROTOBUF:2 | PROTOBUF:3 | GRAPHQL | SMITHY:2.0, > createdBy?: number, > updatedBy?: number, > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### remove `specs.remove` Delete a spec **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.specs.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | **Output:** `any` *** ### syncWithCollection `specs.syncWithCollection` Sync spec with collection **Risk:** `write` ```ts theme={null} await corsair.postman.api.specs.syncWithCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | | `collectionUid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | No | — | | `url` | `string` | No | — | *** ### update `specs.update` Update a spec's properties **Risk:** `write` ```ts theme={null} await corsair.postman.api.specs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `type` | `OPENAPI:2.0 \| OPENAPI:3.0 \| OPENAPI:3.1 \| ASYNCAPI:2.0 \| ASYNCAPI:3.0 \| PROTOBUF:2 \| PROTOBUF:3 \| GRAPHQL \| SMITHY:2.0` | No | — | | `createdBy` | `number` | No | — | | `updatedBy` | `number` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `name` | `string` | No | — | *** ### updateFile `specs.updateFile` Update a spec file **Risk:** `write` ```ts theme={null} await corsair.postman.api.specs.updateFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `specId` | `string` | Yes | — | | `filePath` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `DEFAULT \| ROOT` | No | — | | `content` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdAt` | `string` | No | — | | `createdBy` | `number` | No | — | | `id` | `string` | No | — | | `path` | `string` | No | — | | `updatedAt` | `string` | No | — | | `updatedBy` | `number` | No | — | | `type` | `DEFAULT \| ROOT` | No | — | *** ## Tools ### importOpenapi `tools.importOpenapi` Import an OpenAPI definition **Risk:** `write` ```ts theme={null} await corsair.postman.api.tools.importOpenapi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `body` | `object` | No | — | > **body full type** > > ```ts theme={null} > { > type: json, > input: { > }, > options?: { > requestNameSource?: Fallback | URL, > indentCharacter?: Tab | Space, > parametersResolution?: string, > folderStrategy?: Paths | Tags, > includeAuthInfoInExample?: boolean, > enableOptionalParameters?: boolean, > keepImplicitHeaders?: boolean, > includeDeprecated?: boolean, > alwaysInheritAuthentication?: boolean, > nestedFolderHierarchy?: boolean > } > } | { > type: string, > input: string, > options?: { > requestNameSource?: Fallback | URL, > indentCharacter?: Tab | Space, > parametersResolution?: string, > folderStrategy?: Paths | Tags, > includeAuthInfoInExample?: boolean, > enableOptionalParameters?: boolean, > keepImplicitHeaders?: boolean, > includeDeprecated?: boolean, > alwaysInheritAuthentication?: boolean, > nestedFolderHierarchy?: boolean > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `collections` | `object[]` | No | — | > **collections full type** > > ```ts theme={null} > { > id?: string, > name?: string, > uid?: string > }[] > ``` *** ## Users ### get `users.get` Get a team user **Risk:** `read` ```ts theme={null} await corsair.postman.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `name` | `string` | No | — | | `username` | `string` | No | — | | `email` | `string` | No | — | | `roles` | `string[]` | No | — | | `joinedAt` | `string` | No | — | *** ### list `users.list` Get all team users **Risk:** `read` ```ts theme={null} await corsair.postman.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `groupId` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id?: number, > name?: string, > username?: string, > email?: string, > roles?: string[], > joinedAt?: string > }[] > ``` *** ## Webhooks ### create `webhooks.create` Create a webhook **Risk:** `write` ```ts theme={null} await corsair.postman.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `collection` | `string` | Yes | — | | `workspace` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhook` | `object` | No | — | > **webhook full type** > > ```ts theme={null} > { > id?: string, > name?: string, > collection?: string, > webhookUrl?: string > } > ``` *** ## Workspaces ### create `workspaces.create` Create a workspace **Risk:** `write` ```ts theme={null} await corsair.postman.api.workspaces.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `object` | No | — | > **workspace full type** > > ```ts theme={null} > { > name: string, > type: personal | private | public | team | partner, > description?: string, > about?: string, > teamId?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `object` | No | — | > **workspace full type** > > ```ts theme={null} > { > id?: string, > name?: string > } > ``` *** ### get `workspaces.get` Get a workspace **Risk:** `read` ```ts theme={null} await corsair.postman.api.workspaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `include` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `object` | No | — | > **workspace full type** > > ```ts theme={null} > { > id?: string, > name?: string, > type?: personal | team | private | public | partner, > description?: string | null, > visibility?: personal | team | private | public | partner, > createdBy?: string, > updatedBy?: string, > createdAt?: string, > updatedAt?: string, > about?: string, > team?: string, > collections?: { > id?: string, > name?: string, > uid?: string > }[], > environments?: { > id?: string, > name?: string, > uid?: string > }[], > mocks?: { > id?: string, > name?: string, > uid?: string, > deactivated?: boolean > }[], > monitors?: { > id?: string, > name?: string, > uid?: string, > deactivated?: boolean > }[], > specs?: { > id?: string, > name?: string, > uid?: string > }[], > scim?: { > createdBy?: string, > updatedBy?: string > } > } > ``` *** ### getActivity `workspaces.getActivity` Get a workspace's activity feed **Risk:** `read` ```ts theme={null} await corsair.postman.api.workspaces.getActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `userId` | `number` | No | — | | `elementType` | `collection \| workspace \| environment \| mock \| monitor` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > workspaceId?: string, > createdAt?: string, > updatedAt?: string, > id?: number, > user?: { > id?: number, > username?: string, > isPartner?: boolean, > name?: string > }, > action?: create | update | destroy, > elementType?: string, > trigger?: string, > elementId?: string, > elementName?: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > nextCursor?: string | null > } > ``` *** ### getGlobalVariables `workspaces.getGlobalVariables` Get global variables **Risk:** `read` ```ts theme={null} await corsair.postman.api.workspaces.getGlobalVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `values` | `object[]` | No | — | > **values full type** > > ```ts theme={null} > { > key?: string, > type?: default | secret, > value?: string, > enabled?: boolean, > description?: string > }[] > ``` *** ### getRoles `workspaces.getRoles` Get a workspace's roles **Risk:** `read` ```ts theme={null} await corsair.postman.api.workspaces.getRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `include` | `scim` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `roles` | `object[]` | No | — | > **roles full type** > > ```ts theme={null} > { > id?: string, > user?: string[], > usergroup?: string[], > partner?: string[], > displayName?: string > }[] > ``` *** ### list `workspaces.list` Get all workspaces **Risk:** `read` ```ts theme={null} await corsair.postman.api.workspaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `personal \| team \| private \| public \| partner` | No | — | | `createdBy` | `number` | No | — | | `include` | `mocks:deactivated \| scim` | No | — | | `elementType` | `collection \| specification` | No | — | | `elementId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `workspaces` | `object[]` | No | — | | `meta` | `object` | No | — | > **workspaces full type** > > ```ts theme={null} > { > id?: string, > name?: string, > type?: personal | team | private | public | partner, > visibility?: personal | team | private | public | partner, > createdBy?: string, > about?: string, > createdAt?: string, > updatedAt?: string, > scim?: { > createdBy?: string > } > }[] > ``` > **meta full type** > > ```ts theme={null} > { > nextCursor?: string > } > ``` *** ### remove `workspaces.remove` Delete a workspace **Risk:** `destructive` ```ts theme={null} await corsair.postman.api.workspaces.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `object` | No | — | > **workspace full type** > > ```ts theme={null} > { > id?: string > } > ``` *** ### update `workspaces.update` Update a workspace **Risk:** `write` ```ts theme={null} await corsair.postman.api.workspaces.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `workspace` | `object` | No | — | > **workspace full type** > > ```ts theme={null} > { > name?: string, > type?: private | personal | team | public, > description?: string, > about?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `object` | No | — | > **workspace full type** > > ```ts theme={null} > { > id?: string, > name?: string > } > ``` *** ### updateGlobalVariables `workspaces.updateGlobalVariables` Update global variables **Risk:** `write` ```ts theme={null} await corsair.postman.api.workspaces.updateGlobalVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `values` | `object[]` | No | — | > **values full type** > > ```ts theme={null} > { > key?: string, > type?: default | secret, > value?: string, > enabled?: boolean, > description?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `values` | `object[]` | No | — | > **values full type** > > ```ts theme={null} > { > key?: string, > type?: default | secret, > value?: string, > enabled?: boolean, > description?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/postman/database Postman local sync: searchable entities, `.search()` filters, and operators. The Postman plugin syncs data locally. Use `corsair.postman.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Collection Path: `postman.db.collection.search` ```ts theme={null} const rows = await corsair.postman.db.collection.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `uid` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Environment Path: `postman.db.environment.search` ```ts theme={null} const rows = await corsair.postman.db.environment.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `uid` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Mock Path: `postman.db.mock.search` ```ts theme={null} const rows = await corsair.postman.db.mock.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `uid` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Monitor Path: `postman.db.monitor.search` ```ts theme={null} const rows = await corsair.postman.db.monitor.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `uid` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspace Path: `postman.db.workspace.search` ```ts theme={null} const rows = await corsair.postman.db.workspace.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/postman/overview Postman plugin for Corsair Use **Postman** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 135 typed API operations * 5 synced entities (`collection`, `environment`, `mock`, `monitor`, `workspace`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/postman ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/postman ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/postman ``` ```bash bun theme={null} bun add corsair @corsair-dev/postman ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { postman } from '@corsair-dev/postman'; export const corsair = createCorsair({ plugins: [ postman(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} postman() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'postman', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accessKeys.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.postman.api.accessKeys.list({}); ``` **`apis.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.postman.api.apis.create({}); ``` See the full list on the [API](/plugins/postman/api) page. ## Query synced data Synced entities support `tenant.postman.db..search()` and `.list()`: `collection`, `environment`, `mock`, `monitor`, `workspace`. See [Database](/plugins/postman/database) for filters and operators. ## What's next > **[API reference](/plugins/postman/api)** > > Every `postman.api.*` operation with input and output types. > **[Database](/plugins/postman/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/prisma/api API reference for Prisma: every `prisma.api.*` operation with input and output types. Every `prisma.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Backups ### list `backups.list` List backups for a database **Risk:** `read` ```ts theme={null} await corsair.prisma.api.backups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > databaseId?: string, > status?: string, > createdAt?: string > } | { > id: string, > databaseId?: string, > status?: string, > createdAt?: string > }[] | { > items: { > id: string, > databaseId?: string, > status?: string, > createdAt?: string > }[] > } | { > data: { > id: string, > databaseId?: string, > status?: string, > createdAt?: string > } | { > id: string, > databaseId?: string, > status?: string, > createdAt?: string > }[] > } > ``` *** ### restore `backups.restore` Restore a backup onto the target database (async, overwrites current data) **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.prisma.api.backups.restore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | Yes | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > backupId: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > undefined | null | { > } > ``` *** ## Connections ### create `connections.create` Create a connection (returns a ready-to-use connection string) **Risk:** `write` ```ts theme={null} await corsair.prisma.api.connections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > name: string, > databaseId: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > } | { > data: { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > } > } | { > project: { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > } > } | { > database: { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > } > } | { > connection: { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > } > } > ``` *** ### delete `connections.delete` Delete/revoke a connection and access for anything using it **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.prisma.api.connections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | Yes | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > undefined | null | { > } > ``` *** ### list `connections.list` List connections **Risk:** `read` ```ts theme={null} await corsair.prisma.api.connections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > } | { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > }[] | { > items: { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > }[] > } | { > data: { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > } | { > id: string, > name?: string, > databaseId?: string, > connectionString?: string, > type?: string, > createdAt?: string > }[] > } > ``` *** ## Databases ### create `databases.create` Create a database in a project **Risk:** `write` ```ts theme={null} await corsair.prisma.api.databases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | Yes | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > name: string, > region: string, > isDefault?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } | { > data: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } > } | { > project: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } > } | { > database: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } > } | { > connection: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } > } > ``` *** ### delete `databases.delete` Delete a database and all of its data **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.prisma.api.databases.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > undefined | null | { > } > ``` *** ### get `databases.get` Retrieve database details **Risk:** `read` ```ts theme={null} await corsair.prisma.api.databases.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } | { > data: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } > } | { > project: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } > } | { > database: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } > } | { > connection: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } > } > ``` *** ### getUsage `databases.getUsage` Retrieve database usage metrics for a time period **Risk:** `read` ```ts theme={null} await corsair.prisma.api.databases.getUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > databaseId?: string, > id?: string, > startDate?: string, > endDate?: string, > storage?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > operations?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > reads?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > writes?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > totalOperations?: number, > metrics?: { > timestamp?: string, > value?: number > }[] | { > } > } | { > data: { > databaseId?: string, > id?: string, > startDate?: string, > endDate?: string, > storage?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > operations?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > reads?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > writes?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > totalOperations?: number, > metrics?: { > timestamp?: string, > value?: number > }[] | { > } > } > } | { > usage: { > databaseId?: string, > id?: string, > startDate?: string, > endDate?: string, > storage?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > operations?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > reads?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > writes?: number | { > reads?: number, > writes?: number, > total?: number, > bytes?: number, > history?: { > timestamp?: string, > value?: number > }[] > }, > totalOperations?: number, > metrics?: { > timestamp?: string, > value?: number > }[] | { > } > } > } | { > timestamp?: string, > value?: number > }[] | { > data: { > timestamp?: string, > value?: number > }[] > } > ``` *** ### inspectSchema `databases.inspectSchema` Inspect a database schema (tables, columns, types, constraints) **Risk:** `read` ```ts theme={null} await corsair.prisma.api.databases.inspectSchema({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `host` | `string` | Yes | — | | `port` | `number` | No | — | | `user` | `string` | Yes | — | | `password` | `string` | Yes | — | | `database` | `string` | Yes | — | | `sslRejectUnauthorized` | `boolean` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `tables` | `object[]` | Yes | — | > **tables full type** > > ```ts theme={null} > { > schema: string, > name: string, > columns: { > name: string, > type: string, > nullable: boolean, > default?: string | null > }[], > foreignKeys: { > column: string, > foreignTable: string, > foreignColumn: string > }[] > }[] > ``` *** ### list `databases.list` List databases for a project **Risk:** `read` ```ts theme={null} await corsair.prisma.api.databases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | Yes | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } | { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] | { > items: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } | { > data: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > } | { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > ``` *** ## Integrations ### list `integrations.list` List integrations (OAuth clients, granted scopes) for a workspace **Risk:** `read` ```ts theme={null} await corsair.prisma.api.integrations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string, > workspaceId?: string, > type?: string > } | { > id: string, > name?: string, > workspaceId?: string, > type?: string > }[] | { > items: { > id: string, > name?: string, > workspaceId?: string, > type?: string > }[] > } | { > data: { > id: string, > name?: string, > workspaceId?: string, > type?: string > } | { > id: string, > name?: string, > workspaceId?: string, > type?: string > }[] > } > ``` *** ## Projects ### create `projects.create` Create a project and its default/database environment **Risk:** `write` ```ts theme={null} await corsair.prisma.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > name: string, > displayName?: string, > region: string, > createDatabase?: boolean > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } | { > data: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } | { > project: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } | { > database: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } | { > connection: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } > ``` *** ### delete `projects.delete` Delete a project and all of its data **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.prisma.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | Yes | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > undefined | null | { > } > ``` *** ### get `projects.get` Retrieve project details **Risk:** `read` ```ts theme={null} await corsair.prisma.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | Yes | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } | { > data: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } | { > project: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } | { > database: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } | { > connection: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } > ``` *** ### list `projects.list` List projects the token has access to **Risk:** `read` ```ts theme={null} await corsair.prisma.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } | { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > }[] | { > items: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > }[] > } | { > data: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } | { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > }[] > } > ``` *** ### transfer `projects.transfer` Transfer a project to another workspace **Risk:** `write` ```ts theme={null} await corsair.prisma.api.projects.transfer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | Yes | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` > **body full type** > > ```ts theme={null} > { > recipientAccessToken: string > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } | { > data: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } | { > project: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } | { > database: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } | { > connection: { > id: string, > createdAt?: string, > name?: string, > displayName?: string | null, > workspaceId?: string, > region?: string, > logicalId?: string, > databases?: { > id: string, > createdAt?: string, > name?: string, > connectionString?: string, > region?: string, > status?: string, > isDefault?: boolean, > apiKeys?: { > id: string, > createdAt?: string, > apiKey?: string, > connectionString?: string, > ppgDirectConnection?: { > host?: string, > user?: string, > pass?: string > } > }[] > }[] > } > } > ``` *** ## Regions ### list `regions.list` List all available regions across products (optionally by product) **Risk:** `read` ```ts theme={null} await corsair.prisma.api.regions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > } | { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > }[] | { > items: { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > }[] > } | { > data: { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > } | { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > }[] > } > ``` *** ### listAccelerate `regions.listAccelerate` List all available Prisma Accelerate regions **Risk:** `read` ```ts theme={null} await corsair.prisma.api.regions.listAccelerate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > } | { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > }[] | { > items: { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > }[] > } | { > data: { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > } | { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > }[] > } > ``` *** ### listPostgres `regions.listPostgres` List all available Prisma Postgres regions with availability **Risk:** `read` ```ts theme={null} await corsair.prisma.api.regions.listPostgres({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > } | { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > }[] | { > items: { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > }[] > } | { > data: { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > } | { > id: string, > region?: string, > name?: string, > displayName?: string, > available?: boolean, > status?: string, > product?: string > }[] > } > ``` *** ## Sql ### execute `sql.execute` Execute a SQL command (INSERT/UPDATE/DELETE/DDL) over the Postgres connection **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.prisma.api.sql.execute({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `host` | `string` | Yes | — | | `port` | `number` | No | — | | `user` | `string` | Yes | — | | `password` | `string` | Yes | — | | `database` | `string` | Yes | — | | `sslRejectUnauthorized` | `boolean` | No | — | | `sql` | `string` | Yes | — | | `params` | `any[]` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `object[]` | Yes | — | | `rowCount` | `number` | No | — | | `command` | `string` | Yes | — | > **rows full type** > > ```ts theme={null} > { > }[] > ``` *** ### query `sql.query` Execute a read-only SQL query (SELECT) over the Postgres connection **Risk:** `read` ```ts theme={null} await corsair.prisma.api.sql.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `host` | `string` | Yes | — | | `port` | `number` | No | — | | `user` | `string` | Yes | — | | `password` | `string` | Yes | — | | `database` | `string` | Yes | — | | `sslRejectUnauthorized` | `boolean` | No | — | | `sql` | `string` | Yes | — | | `params` | `any[]` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `rows` | `object[]` | Yes | — | | `rowCount` | `number` | No | — | | `command` | `string` | Yes | — | > **rows full type** > > ```ts theme={null} > { > }[] > ``` *** ## Workspaces ### list `workspaces.list` List workspaces the token can access **Risk:** `read` ```ts theme={null} await corsair.prisma.api.workspaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `projectId` | `string` | No | — | | `databaseId` | `string` | No | — | | `connectionId` | `string` | No | — | | `targetDatabaseId` | `string` | No | — | | `backupId` | `string` | No | — | | `regionId` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | | `body` | `undefined` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string > } | { > id: string, > name?: string > }[] | { > items: { > id: string, > name?: string > }[] > } | { > data: { > id: string, > name?: string > } | { > id: string, > name?: string > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/prisma/database Prisma local sync: searchable entities, `.search()` filters, and operators. The Prisma plugin syncs data locally. Use `corsair.prisma.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Backups Path: `prisma.db.backups.search` ```ts theme={null} const rows = await corsair.prisma.db.backups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `databaseId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Connections Path: `prisma.db.connections.search` ```ts theme={null} const rows = await corsair.prisma.db.connections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `databaseId` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Databases Path: `prisma.db.databases.search` ```ts theme={null} const rows = await corsair.prisma.db.databases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `isDefault` | `boolean` | equals | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Integrations Path: `prisma.db.integrations.search` ```ts theme={null} const rows = await corsair.prisma.db.integrations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `prisma.db.projects.search` ```ts theme={null} const rows = await corsair.prisma.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `logicalId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Regions Path: `prisma.db.regions.search` ```ts theme={null} const rows = await corsair.prisma.db.regions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `available` | `boolean` | equals | | `product` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `prisma.db.workspaces.search` ```ts theme={null} const rows = await corsair.prisma.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/prisma/overview Prisma plugin for Corsair Use **Prisma** through Corsair: one client, typed API calls, local DB sync. Prisma is the company behind Prisma ORM and the Prisma Data Platform: Prisma Postgres (managed PostgreSQL), Accelerate (global database cache), and the Console for managing workspaces, projects, databases, API keys, backups, and integrations. This plugin drives all of that through the Prisma Management API ([https://api.prisma.io/v1](https://api.prisma.io/v1)) plus direct Postgres wire-protocol access for read-only queries, write commands, and schema inspection. Use Corsair permissions for destructive actions such as deleting projects, deleting databases, restoring backups, and revoking connections. **What you get:** * 23 typed API operations * 7 synced entities (`backups`, `connections`, `databases`, `integrations`, `projects`, `regions`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/prisma ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/prisma ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/prisma ``` ```bash bun theme={null} bun add corsair @corsair-dev/prisma ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { prisma } from '@corsair-dev/prisma'; export const corsair = createCorsair({ plugins: [ prisma(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} prisma() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Prisma OAuth app. ```ts theme={null} prisma({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'prisma', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`backups.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.prisma.api.backups.list({}); ``` **`backups.restore`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.prisma.api.backups.restore({}); ``` See the full list on the [API](/plugins/prisma/api) page. ## Query synced data Synced entities support `tenant.prisma.db..search()` and `.list()`: `backups`, `connections`, `databases`, `integrations`, `projects`, `regions`, `workspaces`. See [Database](/plugins/prisma/database) for filters and operators. ## What's next > **[API reference](/plugins/prisma/api)** > > Every `prisma.api.*` operation with input and output types. > **[Database](/plugins/prisma/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/pushbullet/api API reference for Pushbullet: every `pushbullet.api.*` operation with input and output types. Every `pushbullet.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chats ### create `chats.create` Start a chat with another Pushbullet user by email **Risk:** `write` ```ts theme={null} await corsair.pushbullet.api.chats.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `active` | `boolean` | No | — | | `muted` | `boolean` | No | — | | `created` | `number` | No | — | | `modified` | `number` | No | — | | `with` | `object` | No | — | > **with full type** > > ```ts theme={null} > { > iden?: string, > email?: string, > name?: string, > image_url?: string, > type?: string > } > ``` *** ### delete `chats.delete` Delete a chat **Risk:** `destructive` ```ts theme={null} await corsair.pushbullet.api.chats.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | **Output:** *empty object* *** ### list `chats.list` List the chats on the account **Risk:** `read` ```ts theme={null} await corsair.pushbullet.api.chats.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `active` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `chats` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **chats full type** > > ```ts theme={null} > { > iden: string, > active?: boolean, > muted?: boolean, > created?: number, > modified?: number, > with?: { > iden?: string, > email?: string, > name?: string, > image_url?: string, > type?: string > } > }[] > ``` *** ### setMuted `chats.setMuted` Mute or unmute a chat **Risk:** `write` ```ts theme={null} await corsair.pushbullet.api.chats.setMuted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `muted` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `active` | `boolean` | No | — | | `muted` | `boolean` | No | — | | `created` | `number` | No | — | | `modified` | `number` | No | — | | `with` | `object` | No | — | > **with full type** > > ```ts theme={null} > { > iden?: string, > email?: string, > name?: string, > image_url?: string, > type?: string > } > ``` *** ## Devices ### delete `devices.delete` Delete a device from the account **Risk:** `destructive` ```ts theme={null} await corsair.pushbullet.api.devices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | **Output:** *empty object* *** ### list `devices.list` List devices registered to the account **Risk:** `read` ```ts theme={null} await corsair.pushbullet.api.devices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `active` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `devices` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **devices full type** > > ```ts theme={null} > { > iden: string, > active?: boolean, > nickname?: string, > manufacturer?: string, > model?: string, > icon?: string, > app_version?: number, > push_token?: string, > has_sms?: boolean, > created?: number, > modified?: number > }[] > ``` *** ### register `devices.register` Register a new device on the account **Risk:** `write` ```ts theme={null} await corsair.pushbullet.api.devices.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nickname` | `string` | No | — | | `model` | `string` | No | — | | `manufacturer` | `string` | No | — | | `push_token` | `string` | No | — | | `app_version` | `number` | No | — | | `icon` | `string` | No | — | | `has_sms` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `active` | `boolean` | No | — | | `nickname` | `string` | No | — | | `manufacturer` | `string` | No | — | | `model` | `string` | No | — | | `icon` | `string` | No | — | | `app_version` | `number` | No | — | | `push_token` | `string` | No | — | | `has_sms` | `boolean` | No | — | | `created` | `number` | No | — | | `modified` | `number` | No | — | *** ### update `devices.update` Update a device nickname, model or push token **Risk:** `write` ```ts theme={null} await corsair.pushbullet.api.devices.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `nickname` | `string` | No | — | | `model` | `string` | No | — | | `manufacturer` | `string` | No | — | | `push_token` | `string` | No | — | | `app_version` | `number` | No | — | | `icon` | `string` | No | — | | `has_sms` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `active` | `boolean` | No | — | | `nickname` | `string` | No | — | | `manufacturer` | `string` | No | — | | `model` | `string` | No | — | | `icon` | `string` | No | — | | `app_version` | `number` | No | — | | `push_token` | `string` | No | — | | `has_sms` | `boolean` | No | — | | `created` | `number` | No | — | | `modified` | `number` | No | — | *** ## Files ### uploadRequest `files.uploadRequest` Reserve an upload slot, returning the upload URL and the file URL to use in a file push **Risk:** `write` ```ts theme={null} await corsair.pushbullet.api.files.uploadRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_name` | `string` | Yes | — | | `file_type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_name` | `string` | Yes | — | | `file_type` | `string` | Yes | — | | `upload_url` | `string` | Yes | — | | `file_url` | `string` | Yes | — | *** ## Pushes ### create `pushes.create` Send a note, link or file push to a device, person or channel **Risk:** `write` ```ts theme={null} await corsair.pushbullet.api.pushes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `note \| link \| file` | Yes | — | | `title` | `string` | No | — | | `body` | `string` | No | — | | `url` | `string` | No | — | | `file_name` | `string` | No | — | | `file_type` | `string` | No | — | | `file_url` | `string` | No | — | | `guid` | `string` | No | — | | `source_device_iden` | `string` | No | — | | `device_iden` | `string` | No | — | | `email` | `string` | No | — | | `channel_tag` | `string` | No | — | | `client_iden` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `active` | `boolean` | No | — | | `type` | `string` | No | — | | `title` | `string` | No | — | | `body` | `string` | No | — | | `url` | `string` | No | — | | `dismissed` | `boolean` | No | — | | `direction` | `string` | No | — | | `sender_iden` | `string` | No | — | | `sender_email` | `string` | No | — | | `receiver_iden` | `string` | No | — | | `receiver_email` | `string` | No | — | | `target_device_iden` | `string` | No | — | | `source_device_iden` | `string` | No | — | | `file_name` | `string` | No | — | | `file_type` | `string` | No | — | | `file_url` | `string` | No | — | | `created` | `number` | No | — | | `modified` | `number` | No | — | *** ### delete `pushes.delete` Delete a single push **Risk:** `destructive` ```ts theme={null} await corsair.pushbullet.api.pushes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | **Output:** *empty object* *** ### deleteAll `pushes.deleteAll` Delete every push on the account **Risk:** `destructive` ```ts theme={null} await corsair.pushbullet.api.pushes.deleteAll({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### list `pushes.list` List pushes on the account, optionally modified after a time **Risk:** `read` ```ts theme={null} await corsair.pushbullet.api.pushes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `modified_after` | `number` | No | — | | `active` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pushes` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **pushes full type** > > ```ts theme={null} > { > iden: string, > active?: boolean, > type?: string, > title?: string, > body?: string, > url?: string, > dismissed?: boolean, > direction?: string, > sender_iden?: string, > sender_email?: string, > receiver_iden?: string, > receiver_email?: string, > target_device_iden?: string, > source_device_iden?: string, > file_name?: string, > file_type?: string, > file_url?: string, > created?: number, > modified?: number > }[] > ``` *** ### update `pushes.update` Mark a push dismissed or undismissed **Risk:** `write` ```ts theme={null} await corsair.pushbullet.api.pushes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `dismissed` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `active` | `boolean` | No | — | | `type` | `string` | No | — | | `title` | `string` | No | — | | `body` | `string` | No | — | | `url` | `string` | No | — | | `dismissed` | `boolean` | No | — | | `direction` | `string` | No | — | | `sender_iden` | `string` | No | — | | `sender_email` | `string` | No | — | | `receiver_iden` | `string` | No | — | | `receiver_email` | `string` | No | — | | `target_device_iden` | `string` | No | — | | `source_device_iden` | `string` | No | — | | `file_name` | `string` | No | — | | `file_type` | `string` | No | — | | `file_url` | `string` | No | — | | `created` | `number` | No | — | | `modified` | `number` | No | — | *** ## Users ### me `users.me` Retrieve the account the access token belongs to **Risk:** `read` ```ts theme={null} await corsair.pushbullet.api.users.me({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `iden` | `string` | Yes | — | | `email` | `string` | No | — | | `email_normalized` | `string` | No | — | | `name` | `string` | No | — | | `image_url` | `string` | No | — | | `max_upload_size` | `number` | No | — | | `created` | `number` | No | — | | `modified` | `number` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/pushbullet/database Pushbullet local sync: searchable entities, `.search()` filters, and operators. The Pushbullet plugin syncs data locally. Use `corsair.pushbullet.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Devices Path: `pushbullet.db.devices.search` ```ts theme={null} const rows = await corsair.pushbullet.db.devices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `nickname` | `string` | equals, contains, startsWith, endsWith, in | | `manufacturer` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `icon` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `has_sms` | `boolean` | equals | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pushes Path: `pushbullet.db.pushes.search` ```ts theme={null} const rows = await corsair.pushbullet.db.pushes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `dismissed` | `boolean` | equals | | `direction` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/pushbullet/overview Pushbullet plugin for Corsair Use **Pushbullet** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 15 typed API operations * 2 synced entities (`devices`, `pushes`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/pushbullet ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/pushbullet ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/pushbullet ``` ```bash bun theme={null} bun add corsair @corsair-dev/pushbullet ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { pushbullet } from '@corsair-dev/pushbullet'; export const corsair = createCorsair({ plugins: [ pushbullet(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} pushbullet() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Pushbullet OAuth app. ```ts theme={null} pushbullet({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'pushbullet', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`chats.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pushbullet.api.chats.list({}); ``` **`chats.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.pushbullet.api.chats.create({}); ``` See the full list on the [API](/plugins/pushbullet/api) page. ## Query synced data Synced entities support `tenant.pushbullet.db..search()` and `.list()`: `devices`, `pushes`. See [Database](/plugins/pushbullet/database) for filters and operators. ## What's next > **[API reference](/plugins/pushbullet/api)** > > Every `pushbullet.api.*` operation with input and output types. > **[Database](/plugins/pushbullet/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/razorpay/api API reference for Razorpay: every `razorpay.api.*` operation with input and output types. Every `razorpay.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Customers ### create `customers.create` Create a Razorpay customer **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.customers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `email` | `string` | No | — | | `contact` | `string` | No | — | | `gstin` | `string` | No | — | | `notes` | `object[]` | No | — | | `fail_existing` | `0 \| 1` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `customer` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `contact` | `string` | No | — | | `gstin` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### get `customers.get` Fetch a Razorpay customer by ID **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.customers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `customer` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `contact` | `string` | No | — | | `gstin` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### list `customers.list` List Razorpay customers **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.customers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `collection` | No | — | | `count` | `number` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > entity: customer, > name?: string | null, > email?: string | null, > contact?: string | null, > gstin?: string | null, > notes?: { > } | any[], > created_at?: number > }[] > ``` *** ### update `customers.update` Update a Razorpay customer **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.customers.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `contact` | `string` | No | — | | `gstin` | `string` | No | — | | `notes` | `object[]` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `customer` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `contact` | `string` | No | — | | `gstin` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ## Orders ### create `orders.create` Create a Razorpay order **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.orders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `receipt` | `string` | No | — | | `notes` | `object[]` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `order` | Yes | — | | `amount` | `number` | Yes | — | | `amount_paid` | `number` | No | — | | `amount_due` | `number` | No | — | | `currency` | `string` | Yes | — | | `receipt` | `string` | No | — | | `offer_id` | `string` | No | — | | `status` | `string` | Yes | — | | `attempts` | `number` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### get `orders.get` Fetch a Razorpay order by ID **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.orders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `order` | Yes | — | | `amount` | `number` | Yes | — | | `amount_paid` | `number` | No | — | | `amount_due` | `number` | No | — | | `currency` | `string` | Yes | — | | `receipt` | `string` | No | — | | `offer_id` | `string` | No | — | | `status` | `string` | Yes | — | | `attempts` | `number` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### list `orders.list` List Razorpay orders **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.orders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | | `count` | `number` | No | — | | `skip` | `number` | No | — | | `authorized` | `0 \| 1` | No | — | | `receipt` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `collection` | No | — | | `count` | `number` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > entity: order, > amount: number, > amount_paid?: number | null, > amount_due?: number, > currency: string, > receipt?: string | null, > offer_id?: string | null, > status: string, > attempts?: number, > notes?: { > } | any[], > created_at?: number > }[] > ``` *** ## Payments ### capture `payments.capture` Capture an authorized Razorpay payment **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.payments.capture({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `payment` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `order_id` | `string` | No | — | | `invoice_id` | `string` | No | — | | `method` | `string` | No | — | | `captured` | `boolean` | No | — | | `description` | `string` | No | — | | `email` | `string` | No | — | | `contact` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### get `payments.get` Fetch a Razorpay payment by ID **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.payments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `payment` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `order_id` | `string` | No | — | | `invoice_id` | `string` | No | — | | `method` | `string` | No | — | | `captured` | `boolean` | No | — | | `description` | `string` | No | — | | `email` | `string` | No | — | | `contact` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### list `payments.list` List Razorpay payments **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.payments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | | `count` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `collection` | No | — | | `count` | `number` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > entity: payment, > amount: number, > currency: string, > status: string, > order_id?: string | null, > invoice_id?: string | null, > method?: string | null, > captured?: boolean, > description?: string | null, > email?: string | null, > contact?: string | null, > notes?: { > } | any[], > created_at?: number > }[] > ``` *** ## Payouts ### create `payouts.create` Create a Razorpay payout **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.payouts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_number` | `string` | Yes | — | | `fund_account_id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `mode` | `string` | Yes | — | | `purpose` | `string` | Yes | — | | `queue_if_low_balance` | `boolean` | No | — | | `reference_id` | `string` | No | — | | `narration` | `string` | No | — | | `notes` | `object[]` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `payout` | Yes | — | | `fund_account_id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `notes` | `object[]` | No | — | | `fees` | `number` | No | — | | `tax` | `number` | No | — | | `status` | `string` | Yes | — | | `utr` | `string` | No | — | | `mode` | `string` | No | — | | `purpose` | `string` | No | — | | `reference_id` | `string` | No | — | | `debit_account_number` | `string` | No | — | | `narration` | `string` | No | — | | `batch_id` | `string` | No | — | | `status_details` | `object` | No | — | | `created_at` | `number` | No | — | | `fee_type` | `string` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` > **status\_details full type** > > ```ts theme={null} > { > description: string, > source: string, > reason: string > } > ``` *** ### get `payouts.get` Fetch a Razorpay payout by ID **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.payouts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `payout` | Yes | — | | `fund_account_id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `notes` | `object[]` | No | — | | `fees` | `number` | No | — | | `tax` | `number` | No | — | | `status` | `string` | Yes | — | | `utr` | `string` | No | — | | `mode` | `string` | No | — | | `purpose` | `string` | No | — | | `reference_id` | `string` | No | — | | `debit_account_number` | `string` | No | — | | `narration` | `string` | No | — | | `batch_id` | `string` | No | — | | `status_details` | `object` | No | — | | `created_at` | `number` | No | — | | `fee_type` | `string` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` > **status\_details full type** > > ```ts theme={null} > { > description: string, > source: string, > reason: string > } > ``` *** ### list `payouts.list` List Razorpay payouts **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.payouts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account_number` | `string` | Yes | — | | `contact_id` | `string` | No | — | | `fund_account_id` | `string` | No | — | | `mode` | `string` | No | — | | `reference_id` | `string` | No | — | | `status` | `string` | No | — | | `from` | `number` | No | — | | `to` | `number` | No | — | | `count` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `collection` | No | — | | `count` | `number` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > entity: payout, > fund_account_id: string, > amount: number, > currency: string, > notes?: { > } | any[], > fees?: number, > tax?: number, > status: string, > utr?: string | null, > mode?: string, > purpose?: string, > reference_id?: string | null, > debit_account_number?: string, > narration?: string | null, > batch_id?: string | null, > status_details?: { > description: string, > source: string, > reason: string > } | null, > created_at?: number, > fee_type?: string > }[] > ``` *** ## Refunds ### create `refunds.create` Create a refund for a Razorpay payment **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.refunds.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `paymentId` | `string` | Yes | — | | `amount` | `number` | No | — | | `speed` | `normal \| optimum` | No | — | | `receipt` | `string` | No | — | | `notes` | `object[]` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `refund` | Yes | — | | `payment_id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | No | — | | `notes` | `object[]` | No | — | | `receipt` | `string` | No | — | | `speed_processed` | `string` | No | — | | `speed_requested` | `string` | No | — | | `status` | `string` | Yes | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### get `refunds.get` Fetch a specific refund for a Razorpay payment **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.refunds.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `paymentId` | `string` | Yes | — | | `refundId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `refund` | Yes | — | | `payment_id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | No | — | | `notes` | `object[]` | No | — | | `receipt` | `string` | No | — | | `speed_processed` | `string` | No | — | | `speed_requested` | `string` | No | — | | `status` | `string` | Yes | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### list `refunds.list` List refunds for a Razorpay payment **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.refunds.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `paymentId` | `string` | Yes | — | | `from` | `number` | No | — | | `to` | `number` | No | — | | `count` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `collection` | No | — | | `count` | `number` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > entity: refund, > payment_id: string, > amount: number, > currency?: string | null, > notes?: { > } | any[], > receipt?: string | null, > speed_processed?: string | null, > speed_requested?: string | null, > status: string, > created_at?: number > }[] > ``` *** ## Settlements ### get `settlements.get` Fetch a Razorpay settlement by ID **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.settlements.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `settlement` | Yes | — | | `amount` | `number` | No | — | | `status` | `created \| processed \| failed` | Yes | — | | `fees` | `number` | No | — | | `tax` | `number` | No | — | | `utr` | `string` | No | — | | `created_at` | `number` | No | — | *** ### list `settlements.list` List Razorpay settlements **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.settlements.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | | `count` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `collection` | No | — | | `count` | `number` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > entity: settlement, > amount?: number | null, > status: created | processed | failed, > fees?: number | null, > tax?: number | null, > utr?: string | null, > created_at?: number > }[] > ``` *** ## Subscriptions ### cancel `subscriptions.cancel` Cancel a Razorpay subscription **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.razorpay.api.subscriptions.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `cancel_at_cycle_end` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `subscription` | Yes | — | | `plan_id` | `string` | Yes | — | | `customer_id` | `string` | No | — | | `status` | `string` | Yes | — | | `current_start` | `number` | No | — | | `current_end` | `number` | No | — | | `ended_at` | `number` | No | — | | `charge_at` | `number` | No | — | | `offer_id` | `string` | No | — | | `start_at` | `number` | No | — | | `end_at` | `number` | No | — | | `auth_attempts` | `number` | No | — | | `quantity` | `number` | No | — | | `total_count` | `number` | No | — | | `paid_count` | `number` | No | — | | `remaining_count` | `number` | No | — | | `customer_notify` | `boolean` | No | — | | `expire_by` | `number` | No | — | | `short_url` | `string` | No | — | | `has_scheduled_changes` | `boolean` | No | — | | `change_scheduled_at` | `number` | No | — | | `source` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### create `subscriptions.create` Create a Razorpay subscription **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.subscriptions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `plan_id` | `string` | Yes | — | | `total_count` | `number` | Yes | — | | `quantity` | `number` | No | — | | `start_at` | `number` | No | — | | `expire_by` | `number` | No | — | | `customer_notify` | `0 \| 1` | No | — | | `notes` | `object[]` | No | — | | `offer_id` | `string` | No | — | | `customer_id` | `string` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `subscription` | Yes | — | | `plan_id` | `string` | Yes | — | | `customer_id` | `string` | No | — | | `status` | `string` | Yes | — | | `current_start` | `number` | No | — | | `current_end` | `number` | No | — | | `ended_at` | `number` | No | — | | `charge_at` | `number` | No | — | | `offer_id` | `string` | No | — | | `start_at` | `number` | No | — | | `end_at` | `number` | No | — | | `auth_attempts` | `number` | No | — | | `quantity` | `number` | No | — | | `total_count` | `number` | No | — | | `paid_count` | `number` | No | — | | `remaining_count` | `number` | No | — | | `customer_notify` | `boolean` | No | — | | `expire_by` | `number` | No | — | | `short_url` | `string` | No | — | | `has_scheduled_changes` | `boolean` | No | — | | `change_scheduled_at` | `number` | No | — | | `source` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### get `subscriptions.get` Fetch a Razorpay subscription by ID **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.subscriptions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `subscription` | Yes | — | | `plan_id` | `string` | Yes | — | | `customer_id` | `string` | No | — | | `status` | `string` | Yes | — | | `current_start` | `number` | No | — | | `current_end` | `number` | No | — | | `ended_at` | `number` | No | — | | `charge_at` | `number` | No | — | | `offer_id` | `string` | No | — | | `start_at` | `number` | No | — | | `end_at` | `number` | No | — | | `auth_attempts` | `number` | No | — | | `quantity` | `number` | No | — | | `total_count` | `number` | No | — | | `paid_count` | `number` | No | — | | `remaining_count` | `number` | No | — | | `customer_notify` | `boolean` | No | — | | `expire_by` | `number` | No | — | | `short_url` | `string` | No | — | | `has_scheduled_changes` | `boolean` | No | — | | `change_scheduled_at` | `number` | No | — | | `source` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### list `subscriptions.list` List Razorpay subscriptions **Risk:** `read` ```ts theme={null} await corsair.razorpay.api.subscriptions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `number` | No | — | | `to` | `number` | No | — | | `count` | `number` | No | — | | `skip` | `number` | No | — | | `plan_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `collection` | No | — | | `count` | `number` | Yes | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > entity: subscription, > plan_id: string, > customer_id?: string | null, > status: string, > current_start?: number | null, > current_end?: number | null, > ended_at?: number | null, > charge_at?: number | null, > offer_id?: string | null, > start_at?: number | null, > end_at?: number | null, > auth_attempts?: number, > quantity?: number, > total_count?: number, > paid_count?: number, > remaining_count?: number, > customer_notify?: boolean, > expire_by?: number | null, > short_url?: string | null, > has_scheduled_changes?: boolean, > change_scheduled_at?: number | null, > source?: string | null, > notes?: { > } | any[], > created_at?: number > }[] > ``` *** ### pause `subscriptions.pause` Pause a Razorpay subscription **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.subscriptions.pause({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `pause_initiated_by` | `customer \| bank` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `subscription` | Yes | — | | `plan_id` | `string` | Yes | — | | `customer_id` | `string` | No | — | | `status` | `string` | Yes | — | | `current_start` | `number` | No | — | | `current_end` | `number` | No | — | | `ended_at` | `number` | No | — | | `charge_at` | `number` | No | — | | `offer_id` | `string` | No | — | | `start_at` | `number` | No | — | | `end_at` | `number` | No | — | | `auth_attempts` | `number` | No | — | | `quantity` | `number` | No | — | | `total_count` | `number` | No | — | | `paid_count` | `number` | No | — | | `remaining_count` | `number` | No | — | | `customer_notify` | `boolean` | No | — | | `expire_by` | `number` | No | — | | `short_url` | `string` | No | — | | `has_scheduled_changes` | `boolean` | No | — | | `change_scheduled_at` | `number` | No | — | | `source` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### resume `subscriptions.resume` Resume a paused Razorpay subscription **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.subscriptions.resume({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `resume_at` | `now` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `subscription` | Yes | — | | `plan_id` | `string` | Yes | — | | `customer_id` | `string` | No | — | | `status` | `string` | Yes | — | | `current_start` | `number` | No | — | | `current_end` | `number` | No | — | | `ended_at` | `number` | No | — | | `charge_at` | `number` | No | — | | `offer_id` | `string` | No | — | | `start_at` | `number` | No | — | | `end_at` | `number` | No | — | | `auth_attempts` | `number` | No | — | | `quantity` | `number` | No | — | | `total_count` | `number` | No | — | | `paid_count` | `number` | No | — | | `remaining_count` | `number` | No | — | | `customer_notify` | `boolean` | No | — | | `expire_by` | `number` | No | — | | `short_url` | `string` | No | — | | `has_scheduled_changes` | `boolean` | No | — | | `change_scheduled_at` | `number` | No | — | | `source` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### update `subscriptions.update` Update a Razorpay subscription **Risk:** `write` ```ts theme={null} await corsair.razorpay.api.subscriptions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `plan_id` | `string` | No | — | | `quantity` | `number` | No | — | | `remaining_count` | `number` | No | — | | `offer_id` | `string` | No | — | | `schedule_change_at` | `now \| cycle_end` | No | — | | `customer_notify` | `0 \| 1` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entity` | `subscription` | Yes | — | | `plan_id` | `string` | Yes | — | | `customer_id` | `string` | No | — | | `status` | `string` | Yes | — | | `current_start` | `number` | No | — | | `current_end` | `number` | No | — | | `ended_at` | `number` | No | — | | `charge_at` | `number` | No | — | | `offer_id` | `string` | No | — | | `start_at` | `number` | No | — | | `end_at` | `number` | No | — | | `auth_attempts` | `number` | No | — | | `quantity` | `number` | No | — | | `total_count` | `number` | No | — | | `paid_count` | `number` | No | — | | `remaining_count` | `number` | No | — | | `customer_notify` | `boolean` | No | — | | `expire_by` | `number` | No | — | | `short_url` | `string` | No | — | | `has_scheduled_changes` | `boolean` | No | — | | `change_scheduled_at` | `number` | No | — | | `source` | `string` | No | — | | `notes` | `object[]` | No | — | | `created_at` | `number` | No | — | > **notes full type** > > ```ts theme={null} > { > } | any[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/razorpay/database Razorpay local sync: searchable entities, `.search()` filters, and operators. The Razorpay plugin syncs data locally. Use `corsair.razorpay.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Customers Path: `razorpay.db.customers.search` ```ts theme={null} const rows = await corsair.razorpay.db.customers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `contact` | `string` | equals, contains, startsWith, endsWith, in | | `gstin` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Orders Path: `razorpay.db.orders.search` ```ts theme={null} const rows = await corsair.razorpay.db.orders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `amount_paid` | `number` | equals, gt, gte, lt, lte, in | | `amount_due` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `receipt` | `string` | equals, contains, startsWith, endsWith, in | | `offer_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `attempts` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payments Path: `razorpay.db.payments.search` ```ts theme={null} const rows = await corsair.razorpay.db.payments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `order_id` | `string` | equals, contains, startsWith, endsWith, in | | `invoice_id` | `string` | equals, contains, startsWith, endsWith, in | | `method` | `string` | equals, contains, startsWith, endsWith, in | | `captured` | `boolean` | equals | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `contact` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payouts Path: `razorpay.db.payouts.search` ```ts theme={null} const rows = await corsair.razorpay.db.payouts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `fund_account_id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `fees` | `number` | equals, gt, gte, lt, lte, in | | `tax` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `utr` | `string` | equals, contains, startsWith, endsWith, in | | `mode` | `string` | equals, contains, startsWith, endsWith, in | | `purpose` | `string` | equals, contains, startsWith, endsWith, in | | `reference_id` | `string` | equals, contains, startsWith, endsWith, in | | `debit_account_number` | `string` | equals, contains, startsWith, endsWith, in | | `narration` | `string` | equals, contains, startsWith, endsWith, in | | `batch_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `fee_type` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Refunds Path: `razorpay.db.refunds.search` ```ts theme={null} const rows = await corsair.razorpay.db.refunds.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `payment_id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `receipt` | `string` | equals, contains, startsWith, endsWith, in | | `speed_processed` | `string` | equals, contains, startsWith, endsWith, in | | `speed_requested` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Settlements Path: `razorpay.db.settlements.search` ```ts theme={null} const rows = await corsair.razorpay.db.settlements.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `fees` | `number` | equals, gt, gte, lt, lte, in | | `tax` | `number` | equals, gt, gte, lt, lte, in | | `utr` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Subscriptions Path: `razorpay.db.subscriptions.search` ```ts theme={null} const rows = await corsair.razorpay.db.subscriptions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `plan_id` | `string` | equals, contains, startsWith, endsWith, in | | `customer_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `current_start` | `number` | equals, gt, gte, lt, lte, in | | `current_end` | `number` | equals, gt, gte, lt, lte, in | | `ended_at` | `number` | equals, gt, gte, lt, lte, in | | `charge_at` | `number` | equals, gt, gte, lt, lte, in | | `offer_id` | `string` | equals, contains, startsWith, endsWith, in | | `start_at` | `number` | equals, gt, gte, lt, lte, in | | `end_at` | `number` | equals, gt, gte, lt, lte, in | | `auth_attempts` | `number` | equals, gt, gte, lt, lte, in | | `quantity` | `number` | equals, gt, gte, lt, lte, in | | `total_count` | `number` | equals, gt, gte, lt, lte, in | | `paid_count` | `number` | equals, gt, gte, lt, lte, in | | `remaining_count` | `number` | equals, gt, gte, lt, lte, in | | `customer_notify` | `boolean` | equals | | `expire_by` | `number` | equals, gt, gte, lt, lte, in | | `short_url` | `string` | equals, contains, startsWith, endsWith, in | | `has_scheduled_changes` | `boolean` | equals | | `change_scheduled_at` | `number` | equals, gt, gte, lt, lte, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/razorpay/overview Payment gateway for accepting online payments, subscriptions, and payouts in India. Use **Razorpay** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 25 typed API operations * 7 synced entities (`customers`, `orders`, `payments`, `payouts`, `refunds`, `settlements`, and 1 more) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/razorpay ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/razorpay ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/razorpay ``` ```bash bun theme={null} bun add corsair @corsair-dev/razorpay ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { razorpay } from '@corsair-dev/razorpay'; export const corsair = createCorsair({ plugins: [ razorpay(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} razorpay() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'razorpay', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`customers.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.razorpay.api.customers.get({}); ``` **`customers.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.razorpay.api.customers.create({}); ``` See the full list on the [API](/plugins/razorpay/api) page. ## Query synced data Synced entities support `tenant.razorpay.db..search()` and `.list()`: `customers`, `orders`, `payments`, `payouts`, `refunds`, `settlements`, `subscriptions`. See [Database](/plugins/razorpay/database) for filters and operators. ## Webhooks This plugin registers **4** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/razorpay/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/razorpay/api)** > > Every `razorpay.api.*` operation with input and output types. > **[Database](/plugins/razorpay/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/razorpay/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/razorpay/webhooks Razorpay incoming webhooks: event paths, payloads, and response data. The Razorpay plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/razorpay/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `orders` * `paid` (`orders.paid`) * `payments` * `captured` (`payments.captured`) * `failed` (`payments.failed`) * `refunds` * `processed` (`refunds.processed`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Orders ### Paid `orders.paid` A Razorpay order was paid **Payload** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `event` | Yes | — | | `account_id` | `string` | Yes | — | | `event` | `order.paid` | Yes | — | | `contains` | `string[]` | Yes | — | | `created_at` | `number` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > order: { > entity: { > id: string, > entity: order, > amount: number, > amount_paid?: number | null, > amount_due?: number, > currency: string, > receipt?: string | null, > offer_id?: string | null, > status: string, > attempts?: number, > notes?: { > } | any[], > created_at?: number > } > }, > payment?: { > entity: { > id: string, > entity: payment, > amount: number, > currency: string, > status: string, > order_id?: string | null, > invoice_id?: string | null, > method?: string | null, > captured?: boolean, > description?: string | null, > email?: string | null, > contact?: string | null, > notes?: { > } | any[], > created_at?: number > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > entity: event, > account_id: string, > event: order.paid, > contains: string[], > created_at: number, > payload: { > order: { > entity: { > id: string, > entity: order, > amount: number, > amount_paid?: number | null, > amount_due?: number, > currency: string, > receipt?: string | null, > offer_id?: string | null, > status: string, > attempts?: number, > notes?: { > } | any[], > created_at?: number > } > }, > payment?: { > entity: { > id: string, > entity: payment, > amount: number, > currency: string, > status: string, > order_id?: string | null, > invoice_id?: string | null, > method?: string | null, > captured?: boolean, > description?: string | null, > email?: string | null, > contact?: string | null, > notes?: { > } | any[], > created_at?: number > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} razorpay({ webhookHooks: { orders: { paid: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Payments ### Captured `payments.captured` A Razorpay payment was captured **Payload** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `event` | Yes | — | | `account_id` | `string` | Yes | — | | `event` | `payment.captured` | Yes | — | | `contains` | `string[]` | Yes | — | | `created_at` | `number` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > payment: { > entity: { > id: string, > entity: payment, > amount: number, > currency: string, > status: string, > order_id?: string | null, > invoice_id?: string | null, > method?: string | null, > captured?: boolean, > description?: string | null, > email?: string | null, > contact?: string | null, > notes?: { > } | any[], > created_at?: number > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > entity: event, > account_id: string, > event: payment.captured, > contains: string[], > created_at: number, > payload: { > payment: { > entity: { > id: string, > entity: payment, > amount: number, > currency: string, > status: string, > order_id?: string | null, > invoice_id?: string | null, > method?: string | null, > captured?: boolean, > description?: string | null, > email?: string | null, > contact?: string | null, > notes?: { > } | any[], > created_at?: number > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} razorpay({ webhookHooks: { payments: { captured: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Failed `payments.failed` A Razorpay payment failed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `event` | Yes | — | | `account_id` | `string` | Yes | — | | `event` | `payment.failed` | Yes | — | | `contains` | `string[]` | Yes | — | | `created_at` | `number` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > payment: { > entity: { > id: string, > entity: payment, > amount: number, > currency: string, > status: string, > order_id?: string | null, > invoice_id?: string | null, > method?: string | null, > captured?: boolean, > description?: string | null, > email?: string | null, > contact?: string | null, > notes?: { > } | any[], > created_at?: number > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > entity: event, > account_id: string, > event: payment.failed, > contains: string[], > created_at: number, > payload: { > payment: { > entity: { > id: string, > entity: payment, > amount: number, > currency: string, > status: string, > order_id?: string | null, > invoice_id?: string | null, > method?: string | null, > captured?: boolean, > description?: string | null, > email?: string | null, > contact?: string | null, > notes?: { > } | any[], > created_at?: number > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} razorpay({ webhookHooks: { payments: { failed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Refunds ### Processed `refunds.processed` A Razorpay refund was processed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `event` | Yes | — | | `account_id` | `string` | Yes | — | | `event` | `refund.processed` | Yes | — | | `contains` | `string[]` | Yes | — | | `created_at` | `number` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > refund: { > entity: { > id: string, > entity: refund, > payment_id: string, > amount: number, > currency?: string | null, > notes?: { > } | any[], > receipt?: string | null, > speed_processed?: string | null, > speed_requested?: string | null, > status: string, > created_at?: number > } > }, > payment?: { > entity: { > id: string, > entity: payment, > amount: number, > currency: string, > status: string, > order_id?: string | null, > invoice_id?: string | null, > method?: string | null, > captured?: boolean, > description?: string | null, > email?: string | null, > contact?: string | null, > notes?: { > } | any[], > created_at?: number > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > entity: event, > account_id: string, > event: refund.processed, > contains: string[], > created_at: number, > payload: { > refund: { > entity: { > id: string, > entity: refund, > payment_id: string, > amount: number, > currency?: string | null, > notes?: { > } | any[], > receipt?: string | null, > speed_processed?: string | null, > speed_requested?: string | null, > status: string, > created_at?: number > } > }, > payment?: { > entity: { > id: string, > entity: payment, > amount: number, > currency: string, > status: string, > order_id?: string | null, > invoice_id?: string | null, > method?: string | null, > captured?: boolean, > description?: string | null, > email?: string | null, > contact?: string | null, > notes?: { > } | any[], > created_at?: number > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} razorpay({ webhookHooks: { refunds: { processed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/reddit/api API reference for Reddit: every `reddit.api.*` operation with input and output types. Every `reddit.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Feeds ### getAll `feeds.getAll` Get posts from /r/all feed **Risk:** `read` ```ts theme={null} await corsair.reddit.api.feeds.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ### getPopular `feeds.getPopular` Get posts from /r/popular feed **Risk:** `read` ```ts theme={null} await corsair.reddit.api.feeds.getPopular({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ## Listings ### subredditsNew `listings.subredditsNew` Get new subreddit listings **Risk:** `read` ```ts theme={null} await corsair.reddit.api.listings.subredditsNew({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subreddits` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **subreddits full type** > > ```ts theme={null} > { > id: string, > name: string, > display_name: string, > display_name_prefixed: string, > title: string, > description: string | null, > description_html: string | null, > public_description: string | null, > subscribers: number, > active_user_count?: number | null, > accounts_active?: number | null, > over18: boolean, > quarantine: boolean, > restrict_posting?: boolean, > restrict_commenting?: boolean, > icon_img: string | null, > banner_img: string | null, > community_icon: string | null, > primary_color: string | null, > created_utc: number, > created: number, > lang: string, > allow_discovery?: boolean, > submit_text_label?: string | null, > wiki_enabled?: boolean, > subreddit_type?: string > }[] > ``` *** ### subredditsPopular `listings.subredditsPopular` Get popular subreddit listings **Risk:** `read` ```ts theme={null} await corsair.reddit.api.listings.subredditsPopular({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subreddits` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **subreddits full type** > > ```ts theme={null} > { > id: string, > name: string, > display_name: string, > display_name_prefixed: string, > title: string, > description: string | null, > description_html: string | null, > public_description: string | null, > subscribers: number, > active_user_count?: number | null, > accounts_active?: number | null, > over18: boolean, > quarantine: boolean, > restrict_posting?: boolean, > restrict_commenting?: boolean, > icon_img: string | null, > banner_img: string | null, > community_icon: string | null, > primary_color: string | null, > created_utc: number, > created: number, > lang: string, > allow_discovery?: boolean, > submit_text_label?: string | null, > wiki_enabled?: boolean, > subreddit_type?: string > }[] > ``` *** ## Posts ### getById `posts.getById` Get posts by fullname IDs **Risk:** `read` ```ts theme={null} await corsair.reddit.api.posts.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `names` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ### getComments `posts.getComments` Get a post and its comments **Risk:** `read` ```ts theme={null} await corsair.reddit.api.posts.getComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `post_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `depth` | `number` | No | — | | `context` | `number` | No | — | | `sort` | `confidence \| top \| new \| controversial \| old \| random \| qa` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `post` | `object` | Yes | — | | `comments` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | > **post full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > } > ``` > **comments full type** > > ```ts theme={null} > { > id: string, > name: string, > body: string, > body_html: string, > author: string | null, > author_fullname?: string, > score: number, > ups: number, > downs: number, > depth?: number, > parent_id: string, > link_id: string, > created_utc: number, > controversiality: number, > gilded?: number, > edited: boolean | number, > score_hidden?: boolean, > collapsed?: boolean, > archived?: boolean, > locked?: boolean, > stickied?: boolean, > permalink: string, > subreddit: string, > subreddit_name_prefixed: string, > over_18?: boolean > }[] > ``` *** ## Search ### global `search.global` Search all of Reddit **Risk:** `read` ```ts theme={null} await corsair.reddit.api.search.global({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `sort` | `relevance \| hot \| top \| new \| comments` | No | — | | `t` | `hour \| day \| week \| month \| year \| all` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | | `restrict_sr` | `boolean` | No | — | | `sr_name` | `string` | No | — | | `type` | `link \| sr \| user` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ### subreddit `search.subreddit` Search within a subreddit **Risk:** `read` ```ts theme={null} await corsair.reddit.api.search.subreddit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subreddit` | `string` | Yes | — | | `q` | `string` | Yes | — | | `sort` | `relevance \| hot \| top \| new \| comments` | No | — | | `t` | `hour \| day \| week \| month \| year \| all` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ### subreddits `search.subreddits` Search for subreddits by name **Risk:** `read` ```ts theme={null} await corsair.reddit.api.search.subreddits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `subreddits` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **subreddits full type** > > ```ts theme={null} > { > id: string, > name: string, > display_name: string, > display_name_prefixed: string, > title: string, > description: string | null, > description_html: string | null, > public_description: string | null, > subscribers: number, > active_user_count?: number | null, > accounts_active?: number | null, > over18: boolean, > quarantine: boolean, > restrict_posting?: boolean, > restrict_commenting?: boolean, > icon_img: string | null, > banner_img: string | null, > community_icon: string | null, > primary_color: string | null, > created_utc: number, > created: number, > lang: string, > allow_discovery?: boolean, > submit_text_label?: string | null, > wiki_enabled?: boolean, > subreddit_type?: string > }[] > ``` *** ## Subreddits ### getAbout `subreddits.getAbout` Get subreddit metadata and info **Risk:** `read` ```ts theme={null} await corsair.reddit.api.subreddits.getAbout({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subreddit` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `display_name` | `string` | Yes | — | | `display_name_prefixed` | `string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string \| null` | Yes | — | | `description_html` | `string \| null` | Yes | — | | `public_description` | `string \| null` | Yes | — | | `subscribers` | `number` | Yes | — | | `active_user_count` | `number` | No | — | | `accounts_active` | `number` | No | — | | `over18` | `boolean` | Yes | — | | `quarantine` | `boolean` | Yes | — | | `restrict_posting` | `boolean` | No | — | | `restrict_commenting` | `boolean` | No | — | | `icon_img` | `string \| null` | Yes | — | | `banner_img` | `string \| null` | Yes | — | | `community_icon` | `string \| null` | Yes | — | | `primary_color` | `string \| null` | Yes | — | | `created_utc` | `number` | Yes | — | | `created` | `number` | Yes | — | | `lang` | `string` | Yes | — | | `allow_discovery` | `boolean` | No | — | | `submit_text_label` | `string \| null` | No | — | | `wiki_enabled` | `boolean` | No | — | | `subreddit_type` | `string` | No | — | *** ### getControversial `subreddits.getControversial` Get controversial posts from a subreddit **Risk:** `read` ```ts theme={null} await corsair.reddit.api.subreddits.getControversial({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subreddit` | `string` | Yes | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | | `t` | `hour \| day \| week \| month \| year \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ### getHot `subreddits.getHot` Get hot posts from a subreddit **Risk:** `read` ```ts theme={null} await corsair.reddit.api.subreddits.getHot({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subreddit` | `string` | Yes | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ### getNew `subreddits.getNew` Get new posts from a subreddit **Risk:** `read` ```ts theme={null} await corsair.reddit.api.subreddits.getNew({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subreddit` | `string` | Yes | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ### getRising `subreddits.getRising` Get rising posts from a subreddit **Risk:** `read` ```ts theme={null} await corsair.reddit.api.subreddits.getRising({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subreddit` | `string` | Yes | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ### getTop `subreddits.getTop` Get top posts from a subreddit with time filter **Risk:** `read` ```ts theme={null} await corsair.reddit.api.subreddits.getTop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subreddit` | `string` | Yes | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | | `t` | `hour \| day \| week \| month \| year \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** ## Users ### getAbout `users.getAbout` Get user profile information **Risk:** `read` ```ts theme={null} await corsair.reddit.api.users.getAbout({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `link_karma` | `number` | Yes | — | | `comment_karma` | `number` | Yes | — | | `total_karma` | `number` | Yes | — | | `is_employee` | `boolean` | No | — | | `is_mod` | `boolean` | No | — | | `is_gold` | `boolean` | No | — | | `created_utc` | `number` | Yes | — | | `has_verified_email` | `boolean` | Yes | — | | `verified` | `boolean` | No | — | | `icon_img` | `string \| null` | Yes | — | | `is_suspended` | `boolean` | No | — | | `pref_show_snoovatar` | `boolean` | No | — | | `accept_followers` | `boolean` | No | — | *** ### getComments `users.getComments` Get a user's comments **Risk:** `read` ```ts theme={null} await corsair.reddit.api.users.getComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `sort` | `new \| hot \| top` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | | `t` | `hour \| day \| week \| month \| year \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `comments` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **comments full type** > > ```ts theme={null} > { > id: string, > name: string, > body: string, > body_html: string, > author: string | null, > author_fullname?: string, > score: number, > ups: number, > downs: number, > depth?: number, > parent_id: string, > link_id: string, > created_utc: number, > controversiality: number, > gilded?: number, > edited: boolean | number, > score_hidden?: boolean, > collapsed?: boolean, > archived?: boolean, > locked?: boolean, > stickied?: boolean, > permalink: string, > subreddit: string, > subreddit_name_prefixed: string, > over_18?: boolean > }[] > ``` *** ### getOverview `users.getOverview` Get a user's mixed posts and comments **Risk:** `read` ```ts theme={null} await corsair.reddit.api.users.getOverview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `sort` | `new \| hot \| top` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | | `t` | `hour \| day \| week \| month \| year \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **items full type** > > ```ts theme={null} > ( > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > } | { > id: string, > name: string, > body: string, > body_html: string, > author: string | null, > author_fullname?: string, > score: number, > ups: number, > downs: number, > depth?: number, > parent_id: string, > link_id: string, > created_utc: number, > controversiality: number, > gilded?: number, > edited: boolean | number, > score_hidden?: boolean, > collapsed?: boolean, > archived?: boolean, > locked?: boolean, > stickied?: boolean, > permalink: string, > subreddit: string, > subreddit_name_prefixed: string, > over_18?: boolean > } > )[] > ``` *** ### getSubmitted `users.getSubmitted` Get a user's submitted posts **Risk:** `read` ```ts theme={null} await corsair.reddit.api.users.getSubmitted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `sort` | `new \| hot \| top` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `count` | `number` | No | — | | `t` | `hour \| day \| week \| month \| year \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `posts` | `object[]` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `dist` | `number` | Yes | — | > **posts full type** > > ```ts theme={null} > { > id: string, > name: string, > title: string, > selftext: string | null, > selftext_html: string | null, > url: string, > author: string | null, > author_fullname?: string, > subreddit: string, > subreddit_name_prefixed: string, > subreddit_id?: string, > score: number, > ups: number, > downs: number, > upvote_ratio: number, > num_comments: number, > over_18: boolean, > spoiler: boolean, > stickied: boolean, > archived?: boolean, > locked?: boolean, > hide_score?: boolean, > created_utc: number, > permalink: string, > thumbnail: string, > total_awards_received?: number > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/reddit/database Reddit local sync: searchable entities, `.search()` filters, and operators. The Reddit plugin syncs data locally. Use `corsair.reddit.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Comments Path: `reddit.db.comments.search` ```ts theme={null} const rows = await corsair.reddit.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `depth` | `number` | equals, gt, gte, lt, lte, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `link_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_utc` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Posts Path: `reddit.db.posts.search` ```ts theme={null} const rows = await corsair.reddit.db.posts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `selftext` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `subreddit` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `ups` | `number` | equals, gt, gte, lt, lte, in | | `downs` | `number` | equals, gt, gte, lt, lte, in | | `upvote_ratio` | `number` | equals, gt, gte, lt, lte, in | | `num_comments` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `permalink` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnail` | `string` | equals, contains, startsWith, endsWith, in | | `over_18` | `boolean` | equals | | `spoiler` | `boolean` | equals | | `stickied` | `boolean` | equals | | `created_utc` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Subreddits Path: `reddit.db.subreddits.search` ```ts theme={null} const rows = await corsair.reddit.db.subreddits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `display_name` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `public_description` | `string` | equals, contains, startsWith, endsWith, in | | `subscribers` | `number` | equals, gt, gte, lt, lte, in | | `active_user_count` | `number` | equals, gt, gte, lt, lte, in | | `over18` | `boolean` | equals | | `created_utc` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `reddit.db.users.search` ```ts theme={null} const rows = await corsair.reddit.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `link_karma` | `number` | equals, gt, gte, lt, lte, in | | `comment_karma` | `number` | equals, gt, gte, lt, lte, in | | `total_karma` | `number` | equals, gt, gte, lt, lte, in | | `is_suspended` | `boolean` | equals | | `created_utc` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/reddit/get-credentials Reddit API access, restrictions, and how that relates to the Corsair Reddit plugin. This page explains how Reddit credentials work today and why you may not have a traditional “API key in five minutes” flow. ## Authentication in Corsair The Reddit plugin is typed with [`api_key`](/concepts/api-key) as the default `authType`. In the current implementation, requests target Reddit’s **public JSON** endpoints (`reddit.com` / `old.reddit.com` style `.json` routes) with a **User-Agent** only — there is **no OAuth token or API key** attached to those calls in the plugin’s HTTP client. That means **you do not need to run `pnpm corsair setup --plugin=reddit` with a secret** for basic read-style usage that relies on those public endpoints, subject to Reddit’s rules and rate limits. ## Reddit’s official API is restricted Reddit has **closed off easy, open access** to their official API for most third-party apps: * New **developer applications** and pricing/terms have changed substantially (commercial use, rate limits, and approval requirements). * You typically must **apply** through Reddit’s developer program, accept their terms, and in many cases **pay** or operate within strict quotas depending on use case and time period. * **Read Reddit’s current developer documentation** before building anything that depends on guaranteed access: [https://www.reddit.com/dev/api/](https://www.reddit.com/dev/api/) and the linked developer / business pages from Reddit. If you need **OAuth**, **mod tools**, **posting as a user**, or **stable, supported quotas**, you must follow Reddit’s official process — there is no generic “paste a key from a dashboard” path that works for everyone anymore. ## What you should do 1. **Decide if you need the official Reddit API** (OAuth client ID/secret, approved app, compliance with Reddit’s Developer Terms). If yes, apply and register an app in Reddit’s developer settings and use credentials only as Reddit’s docs allow. 2. **If you only need public reads** that the plugin implements today, understand that access is **subject to Reddit blocking, rate limiting, or HTML/JSON changes** at any time — treat it as best-effort, not a contractually guaranteed feed. 3. **Monitor Reddit’s announcements** — policies and endpoints change; “public JSON” behavior is not a stable public API product. ## Summary | Topic | Detail | | - | - | | Corsair `api_key` / setup | Not required for the current public-JSON client behavior; check your deployment if you extend the plugin. | | Official Reddit API | Apply through Reddit; restrictions and pricing apply — see Reddit’s developer docs. | | Public endpoints | No OAuth in the default client; respect Reddit’s terms and rate limits. | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/reddit/overview Social news platform for subreddits, posts, comments, moderation, and community discussions. Use **Reddit** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 19 typed API operations * 4 synced entities (`comments`, `posts`, `subreddits`, `users`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/reddit ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/reddit ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/reddit ``` ```bash bun theme={null} bun add corsair @corsair-dev/reddit ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { reddit } from '@corsair-dev/reddit'; export const corsair = createCorsair({ plugins: [ reddit(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/reddit/get-credentials). ```ts theme={null} reddit() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'reddit', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`feeds.getAll`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.reddit.api.feeds.getAll({}); ``` **`posts.getById`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.reddit.api.posts.getById({}); ``` See the full list on the [API](/plugins/reddit/api) page. ## Query synced data Synced entities support `tenant.reddit.db..search()` and `.list()`: `comments`, `posts`, `subreddits`, `users`. See [Database](/plugins/reddit/database) for filters and operators. ## What's next > **[API reference](/plugins/reddit/api)** > > Every `reddit.api.*` operation with input and output types. > **[Database](/plugins/reddit/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/reddit/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/reducto/api API reference for Reducto: every `reducto.api.*` operation with input and output types. Every `reducto.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### configureWebhook `account.configureWebhook` Open the Svix webhook portal URL for this account **Risk:** `write` ```ts theme={null} await corsair.reducto.api.account.configureWebhook({}); ``` **Input:** *empty object* **Output:** `string` *** ### version `account.version` Read the Reducto API version **Risk:** `read` ```ts theme={null} await corsair.reducto.api.account.version({}); ``` **Input:** *empty object* **Output:** `string` *** ## Classify ### classify `classify.classify` Classify a document against a list of categories **Risk:** `write` ```ts theme={null} await corsair.reducto.api.classify.classify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `classification_schema` | `object[]` | No | — | | `category_groups` | `object` | No | — | | `page_range` | `object[]` | No | — | | `document_metadata` | `string` | No | — | | `model` | `default \| accurate` | No | — | | `priority` | `boolean` | No | — | | `force_url_result` | `boolean` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **classification\_schema full type** > > ```ts theme={null} > { > category: string, > criteria: string[] > }[] > ``` > **category\_groups full type** > > ```ts theme={null} > { > } > ``` > **page\_range full type** > > ```ts theme={null} > { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `result` | `object` | Yes | — | | `duration` | `number` | No | — | | `usage` | `object` | No | — | > **result full type** > > ```ts theme={null} > { > category: string > } | { > type: url, > url: string, > result_id: string > } > ``` > **usage full type** > > ```ts theme={null} > { > num_pages: number, > credits?: number | null, > num_categories: number > } > ``` *** ### classifyAsync `classify.classifyAsync` Start a classify job and return its job id **Risk:** `write` ```ts theme={null} await corsair.reducto.api.classify.classifyAsync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `classification_schema` | `object[]` | No | — | | `category_groups` | `object` | No | — | | `page_range` | `object[]` | No | — | | `document_metadata` | `string` | No | — | | `model` | `default \| accurate` | No | — | | `priority` | `boolean` | No | — | | `force_url_result` | `boolean` | No | — | | `async` | `object` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **classification\_schema full type** > > ```ts theme={null} > { > category: string, > criteria: string[] > }[] > ``` > **category\_groups full type** > > ```ts theme={null} > { > } > ``` > **page\_range full type** > > ```ts theme={null} > { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] > ``` > **async full type** > > ```ts theme={null} > { > metadata?: { > } | null, > priority?: boolean, > webhook?: { > mode: direct, > url: string > } | { > mode: svix, > channels?: string[] > } | { > mode: disabled, > channels?: string[] > } | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** ## Edit ### edit `edit.edit` Fill or edit a PDF or DOCX from natural language instructions **Risk:** `write` ```ts theme={null} await corsair.reducto.api.edit.edit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `document_url` | `object` | Yes | — | | `edit_instructions` | `string` | Yes | — | | `edit_options` | `object` | No | — | | `form_schema` | `any[]` | No | — | | `priority` | `boolean` | No | — | > **document\_url full type** > > ```ts theme={null} > string | { > file_id: string, > presigned_url?: string | null > } > ``` > **edit\_options full type** > > ```ts theme={null} > { > color?: string, > font_size?: number | null, > llm_provider_preference?: string | null, > enable_overflow_pages?: boolean, > flatten?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `document_url` | `string` | Yes | — | | `job_id` | `string` | No | — | | `form_schema` | `any[]` | No | — | | `usage` | `object` | No | — | > **usage full type** > > ```ts theme={null} > { > num_pages: number, > credits?: number | null > } > ``` *** ### editAsync `edit.editAsync` Start an edit job and return its job id **Risk:** `write` ```ts theme={null} await corsair.reducto.api.edit.editAsync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `document_url` | `object` | Yes | — | | `edit_instructions` | `string` | Yes | — | | `edit_options` | `object` | No | — | | `form_schema` | `any[]` | No | — | | `priority` | `boolean` | No | — | | `webhook` | `object` | No | — | > **document\_url full type** > > ```ts theme={null} > string | { > file_id: string, > presigned_url?: string | null > } > ``` > **edit\_options full type** > > ```ts theme={null} > { > color?: string, > font_size?: number | null, > llm_provider_preference?: string | null, > enable_overflow_pages?: boolean, > flatten?: boolean > } > ``` > **webhook full type** > > ```ts theme={null} > { > mode: direct, > url: string > } | { > mode: svix, > channels?: string[] > } | { > mode: disabled, > channels?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** ## Extract ### extract `extract.extract` Extract fields from a document using a JSON schema **Risk:** `write` ```ts theme={null} await corsair.reducto.api.extract.extract({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `parsing` | `object` | No | — | | `instructions` | `object` | No | — | | `settings` | `object` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **parsing full type** > > ```ts theme={null} > { > enhance?: { > agentic?: { > scope: text | table | figure, > prompt?: string | null, > mode?: default | auto | max, > advanced_chart_agent?: boolean, > return_overlays?: boolean > }[], > advanced_chart_agent?: boolean, > summarize_figures?: boolean, > intelligent_ordering?: boolean > }, > retrieval?: { > chunking?: { > chunk_mode?: variable | section | page | disabled | block | page_sections, > chunk_size?: number | null, > chunk_overlap?: number > }, > filter_blocks?: Header | Footer | Title | Section Header | Page Number | List Item | Figure | Table | Key Value | Text | Comment | Signature[], > embedding_optimized?: boolean > }, > formatting?: { > add_page_markers?: boolean, > table_output_format?: html | json | md | jsonbbox | dynamic | csv, > merge_tables?: boolean, > include?: change_tracking | highlight | comments | hyperlinks | signatures | ignore_watermarks[] > }, > spreadsheet?: { > split_large_tables?: { > enabled?: boolean, > size?: number > }, > include?: cell_colors | formula | dropdowns[], > clustering?: accurate | fast | disabled, > exclude?: string[], > max_cell_count?: number | null > }, > settings?: { > ocr_system?: standard | legacy, > extraction_mode?: ocr | hybrid, > force_url_result?: boolean, > force_file_extension?: string | null, > return_ocr_data?: boolean, > return_images?: figure | table | page[], > embed_pdf_metadata?: boolean, > extract_document_properties?: boolean, > embed_pdf_metadata_dpi?: number, > persist_results?: boolean, > timeout?: number | null, > page_range?: { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] | null, > document_password?: string | null, > model?: string | null > } > } > ``` > **instructions full type** > > ```ts theme={null} > { > schema?: any, > system_prompt?: string > } > ``` > **settings full type** > > ```ts theme={null} > { > include_images?: boolean, > optimize_for_latency?: boolean, > force_url_result?: boolean, > array_extract?: boolean, > deep_extract?: boolean, > citations?: { > enabled?: boolean, > numerical_confidence?: boolean, > parent_block?: string > }, > page_range?: { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `usage` | `object` | Yes | — | | `result` | `object` | Yes | — | | `citations` | `object` | No | — | | `job_id` | `string` | No | — | | `duration` | `number` | No | — | | `studio_link` | `string` | No | — | > **usage full type** > > ```ts theme={null} > { > num_pages: number, > credits?: number | null, > num_fields: number > } > ``` > **result full type** > > ```ts theme={null} > any[] | { > } | { > type: url, > url: string, > result_id: string > } > ``` > **citations full type** > > ```ts theme={null} > any[] | { > type: url, > url: string, > result_id: string > } > ``` *** ### extractAsync `extract.extractAsync` Start an extract job and return its job id **Risk:** `write` ```ts theme={null} await corsair.reducto.api.extract.extractAsync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `parsing` | `object` | No | — | | `instructions` | `object` | No | — | | `settings` | `object` | No | — | | `async` | `object` | No | — | | `queue_priority` | `auto \| standard \| batch` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **parsing full type** > > ```ts theme={null} > { > enhance?: { > agentic?: { > scope: text | table | figure, > prompt?: string | null, > mode?: default | auto | max, > advanced_chart_agent?: boolean, > return_overlays?: boolean > }[], > advanced_chart_agent?: boolean, > summarize_figures?: boolean, > intelligent_ordering?: boolean > }, > retrieval?: { > chunking?: { > chunk_mode?: variable | section | page | disabled | block | page_sections, > chunk_size?: number | null, > chunk_overlap?: number > }, > filter_blocks?: Header | Footer | Title | Section Header | Page Number | List Item | Figure | Table | Key Value | Text | Comment | Signature[], > embedding_optimized?: boolean > }, > formatting?: { > add_page_markers?: boolean, > table_output_format?: html | json | md | jsonbbox | dynamic | csv, > merge_tables?: boolean, > include?: change_tracking | highlight | comments | hyperlinks | signatures | ignore_watermarks[] > }, > spreadsheet?: { > split_large_tables?: { > enabled?: boolean, > size?: number > }, > include?: cell_colors | formula | dropdowns[], > clustering?: accurate | fast | disabled, > exclude?: string[], > max_cell_count?: number | null > }, > settings?: { > ocr_system?: standard | legacy, > extraction_mode?: ocr | hybrid, > force_url_result?: boolean, > force_file_extension?: string | null, > return_ocr_data?: boolean, > return_images?: figure | table | page[], > embed_pdf_metadata?: boolean, > extract_document_properties?: boolean, > embed_pdf_metadata_dpi?: number, > persist_results?: boolean, > timeout?: number | null, > page_range?: { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] | null, > document_password?: string | null, > model?: string | null > } > } > ``` > **instructions full type** > > ```ts theme={null} > { > schema?: any, > system_prompt?: string > } > ``` > **settings full type** > > ```ts theme={null} > { > include_images?: boolean, > optimize_for_latency?: boolean, > force_url_result?: boolean, > array_extract?: boolean, > deep_extract?: boolean, > citations?: { > enabled?: boolean, > numerical_confidence?: boolean, > parent_block?: string > }, > page_range?: { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] | null > } > ``` > **async full type** > > ```ts theme={null} > { > metadata?: { > } | null, > priority?: boolean, > webhook?: { > mode: direct, > url: string > } | { > mode: svix, > channels?: string[] > } | { > mode: disabled, > channels?: string[] > } | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** ## Files ### delete `files.delete` Delete an uploaded file. Free plans return 422 NOT\_APPLICABLE; Growth and Enterprise delete it **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.reducto.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | *** ### upload `files.upload` Upload a file and return a reducto:// file id **Risk:** `write` ```ts theme={null} await corsair.reducto.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom` | Yes | — | | `extension` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `presigned_url` | `string` | No | — | *** ## Jobs ### cancel `jobs.cancel` Cancel a running job **Risk:** `destructive` ```ts theme={null} await corsair.reducto.api.jobs.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } | null | undefined > ``` *** ### delete `jobs.delete` Delete a job and its stored artifacts. Returns 202. Free plans return 422 NOT\_APPLICABLE **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.reducto.api.jobs.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `include_persisted` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** ### get `jobs.get` Retrieve a job status and, when finished, its result **Risk:** `read` ```ts theme={null} await corsair.reducto.api.jobs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `result` | `any` | No | — | | `progress` | `number` | No | — | | `reason` | `string` | No | — | | `error` | `any` | No | — | | `type` | `string` | No | — | | `source` | `any` | No | — | | `num_pages` | `number` | No | — | | `total_pages` | `number` | No | — | | `duration` | `number` | No | — | | `created_at` | `string` | No | — | | `bucket` | `any` | No | — | *** ### list `jobs.list` List jobs, page by page, using cursor and limit **Risk:** `read` ```ts theme={null} await corsair.reducto.api.jobs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `exclude_configs` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `jobs` | `object[]` | Yes | — | | `next_cursor` | `string` | No | — | > **jobs full type** > > ```ts theme={null} > { > job_id: string, > status: string, > type: string, > raw_config?: string, > created_at: string, > source?: any | null, > num_pages?: number | null, > total_pages?: number | null, > duration?: number | null, > bucket?: any | null > }[] > ``` *** ## Parse ### parse `parse.parse` Parse a document into chunks of text, tables, and figures with bounding boxes **Risk:** `write` ```ts theme={null} await corsair.reducto.api.parse.parse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `enhance` | `object` | No | — | | `retrieval` | `object` | No | — | | `formatting` | `object` | No | — | | `spreadsheet` | `object` | No | — | | `settings` | `object` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **enhance full type** > > ```ts theme={null} > { > agentic?: { > scope: text | table | figure, > prompt?: string | null, > mode?: default | auto | max, > advanced_chart_agent?: boolean, > return_overlays?: boolean > }[], > advanced_chart_agent?: boolean, > summarize_figures?: boolean, > intelligent_ordering?: boolean > } > ``` > **retrieval full type** > > ```ts theme={null} > { > chunking?: { > chunk_mode?: variable | section | page | disabled | block | page_sections, > chunk_size?: number | null, > chunk_overlap?: number > }, > filter_blocks?: Header | Footer | Title | Section Header | Page Number | List Item | Figure | Table | Key Value | Text | Comment | Signature[], > embedding_optimized?: boolean > } > ``` > **formatting full type** > > ```ts theme={null} > { > add_page_markers?: boolean, > table_output_format?: html | json | md | jsonbbox | dynamic | csv, > merge_tables?: boolean, > include?: change_tracking | highlight | comments | hyperlinks | signatures | ignore_watermarks[] > } > ``` > **spreadsheet full type** > > ```ts theme={null} > { > split_large_tables?: { > enabled?: boolean, > size?: number > }, > include?: cell_colors | formula | dropdowns[], > clustering?: accurate | fast | disabled, > exclude?: string[], > max_cell_count?: number | null > } > ``` > **settings full type** > > ```ts theme={null} > { > ocr_system?: standard | legacy, > extraction_mode?: ocr | hybrid, > force_url_result?: boolean, > force_file_extension?: string | null, > return_ocr_data?: boolean, > return_images?: figure | table | page[], > embed_pdf_metadata?: boolean, > extract_document_properties?: boolean, > embed_pdf_metadata_dpi?: number, > persist_results?: boolean, > timeout?: number | null, > page_range?: { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] | null, > document_password?: string | null, > model?: string | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `duration` | `number` | Yes | — | | `usage` | `object` | Yes | — | | `result` | `object` | Yes | — | | `response_type` | `string` | No | — | | `pdf_url` | `string` | No | — | | `studio_link` | `string` | No | — | | `document_properties` | `object` | No | — | > **usage full type** > > ```ts theme={null} > { > num_pages: number, > credits?: number | null > } > ``` > **result full type** > > ```ts theme={null} > { > type: full, > chunks: { > content: string, > embed?: string, > blocks?: { > type: string, > content?: string, > bbox?: { > left: number, > top: number, > width: number, > height: number, > page: number, > original_page?: number > }, > confidence?: string, > granular_confidence?: { > parse_confidence?: number | null, > extract_confidence?: number | null > }, > image_url?: string | null, > chart_data?: string[], > merged_tables?: any[], > extra?: { > } > }[], > enriched?: string | null, > enrichment_success?: boolean > }[], > ocr?: { > words?: { > text: string, > bbox: { > left: number, > top: number, > width: number, > height: number, > page: number, > original_page?: number > }, > confidence?: number, > chunk_index?: number, > rotation?: number > }[], > lines?: { > text: string, > bbox: { > left: number, > top: number, > width: number, > height: number, > page: number, > original_page?: number > }, > confidence?: number, > chunk_index?: number, > rotation?: number > }[] > }, > custom?: any | null > } | { > type: url, > url: string, > result_id: string > } > ``` > **document\_properties full type** > > ```ts theme={null} > { > title?: string | null, > author?: string | null, > subject?: string | null, > keywords?: string | null, > creator?: string | null, > producer?: string | null, > last_modified_by?: string | null, > created_at?: string | null, > modified_at?: string | null > } > ``` *** ### parseAsync `parse.parseAsync` Start a parse job and return its job id **Risk:** `write` ```ts theme={null} await corsair.reducto.api.parse.parseAsync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `enhance` | `object` | No | — | | `retrieval` | `object` | No | — | | `formatting` | `object` | No | — | | `spreadsheet` | `object` | No | — | | `settings` | `object` | No | — | | `async` | `object` | No | — | | `queue_priority` | `auto \| standard \| batch` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **enhance full type** > > ```ts theme={null} > { > agentic?: { > scope: text | table | figure, > prompt?: string | null, > mode?: default | auto | max, > advanced_chart_agent?: boolean, > return_overlays?: boolean > }[], > advanced_chart_agent?: boolean, > summarize_figures?: boolean, > intelligent_ordering?: boolean > } > ``` > **retrieval full type** > > ```ts theme={null} > { > chunking?: { > chunk_mode?: variable | section | page | disabled | block | page_sections, > chunk_size?: number | null, > chunk_overlap?: number > }, > filter_blocks?: Header | Footer | Title | Section Header | Page Number | List Item | Figure | Table | Key Value | Text | Comment | Signature[], > embedding_optimized?: boolean > } > ``` > **formatting full type** > > ```ts theme={null} > { > add_page_markers?: boolean, > table_output_format?: html | json | md | jsonbbox | dynamic | csv, > merge_tables?: boolean, > include?: change_tracking | highlight | comments | hyperlinks | signatures | ignore_watermarks[] > } > ``` > **spreadsheet full type** > > ```ts theme={null} > { > split_large_tables?: { > enabled?: boolean, > size?: number > }, > include?: cell_colors | formula | dropdowns[], > clustering?: accurate | fast | disabled, > exclude?: string[], > max_cell_count?: number | null > } > ``` > **settings full type** > > ```ts theme={null} > { > ocr_system?: standard | legacy, > extraction_mode?: ocr | hybrid, > force_url_result?: boolean, > force_file_extension?: string | null, > return_ocr_data?: boolean, > return_images?: figure | table | page[], > embed_pdf_metadata?: boolean, > extract_document_properties?: boolean, > embed_pdf_metadata_dpi?: number, > persist_results?: boolean, > timeout?: number | null, > page_range?: { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] | null, > document_password?: string | null, > model?: string | null > } > ``` > **async full type** > > ```ts theme={null} > { > metadata?: { > } | null, > priority?: boolean, > webhook?: { > mode: direct, > url: string > } | { > mode: svix, > channels?: string[] > } | { > mode: disabled, > channels?: string[] > } | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** ## Pipeline ### run `pipeline.run` Run a Studio pipeline against a document **Risk:** `write` ```ts theme={null} await corsair.reducto.api.pipeline.run({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `pipeline_id` | `string` | Yes | — | | `settings` | `object` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **settings full type** > > ```ts theme={null} > { > document_password?: string | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `usage` | `object` | Yes | — | | `result` | `any` | Yes | — | > **usage full type** > > ```ts theme={null} > { > num_pages: number, > credits?: number | null > } > ``` *** ### runAsync `pipeline.runAsync` Start a Studio pipeline job and return its job id **Risk:** `write` ```ts theme={null} await corsair.reducto.api.pipeline.runAsync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `pipeline_id` | `string` | Yes | — | | `settings` | `object` | No | — | | `async` | `object` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **settings full type** > > ```ts theme={null} > { > document_password?: string | null > } > ``` > **async full type** > > ```ts theme={null} > { > metadata?: { > } | null, > priority?: boolean, > webhook?: { > mode: direct, > url: string > } | { > mode: svix, > channels?: string[] > } | { > mode: disabled, > channels?: string[] > } | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** ## Split ### split `split.split` Split a document into named sections by page **Risk:** `write` ```ts theme={null} await corsair.reducto.api.split.split({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `parsing` | `object` | No | — | | `split_description` | `object[]` | Yes | — | | `split_rules` | `string` | No | — | | `settings` | `object` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **parsing full type** > > ```ts theme={null} > { > enhance?: { > agentic?: { > scope: text | table | figure, > prompt?: string | null, > mode?: default | auto | max, > advanced_chart_agent?: boolean, > return_overlays?: boolean > }[], > advanced_chart_agent?: boolean, > summarize_figures?: boolean, > intelligent_ordering?: boolean > }, > retrieval?: { > chunking?: { > chunk_mode?: variable | section | page | disabled | block | page_sections, > chunk_size?: number | null, > chunk_overlap?: number > }, > filter_blocks?: Header | Footer | Title | Section Header | Page Number | List Item | Figure | Table | Key Value | Text | Comment | Signature[], > embedding_optimized?: boolean > }, > formatting?: { > add_page_markers?: boolean, > table_output_format?: html | json | md | jsonbbox | dynamic | csv, > merge_tables?: boolean, > include?: change_tracking | highlight | comments | hyperlinks | signatures | ignore_watermarks[] > }, > spreadsheet?: { > split_large_tables?: { > enabled?: boolean, > size?: number > }, > include?: cell_colors | formula | dropdowns[], > clustering?: accurate | fast | disabled, > exclude?: string[], > max_cell_count?: number | null > }, > settings?: { > ocr_system?: standard | legacy, > extraction_mode?: ocr | hybrid, > force_url_result?: boolean, > force_file_extension?: string | null, > return_ocr_data?: boolean, > return_images?: figure | table | page[], > embed_pdf_metadata?: boolean, > extract_document_properties?: boolean, > embed_pdf_metadata_dpi?: number, > persist_results?: boolean, > timeout?: number | null, > page_range?: { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] | null, > document_password?: string | null, > model?: string | null > } > } > ``` > **split\_description full type** > > ```ts theme={null} > { > name: string, > description: string, > partition_key?: string | null > }[] > ``` > **settings full type** > > ```ts theme={null} > { > table_cutoff?: truncate | preserve, > allow_page_overlap?: boolean, > auto_partition?: boolean, > deep_split?: boolean, > force_url_result?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `usage` | `object` | Yes | — | | `result` | `object` | Yes | — | | `job_id` | `string` | No | — | | `duration` | `number` | No | — | > **usage full type** > > ```ts theme={null} > { > num_pages: number, > credits?: number | null > } > ``` > **result full type** > > ```ts theme={null} > { > splits: { > name: string, > pages: number[] > }[] > } | { > type: url, > url: string, > result_id: string > } | { > } > ``` *** ### splitAsync `split.splitAsync` Start a split job and return its job id **Risk:** `write` ```ts theme={null} await corsair.reducto.api.split.splitAsync({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `parsing` | `object` | No | — | | `split_description` | `object[]` | Yes | — | | `split_rules` | `string` | No | — | | `settings` | `object` | No | — | | `async` | `object` | No | — | > **input full type** > > ```ts theme={null} > string | string[] | { > file_id: string, > presigned_url?: string | null > } > ``` > **parsing full type** > > ```ts theme={null} > { > enhance?: { > agentic?: { > scope: text | table | figure, > prompt?: string | null, > mode?: default | auto | max, > advanced_chart_agent?: boolean, > return_overlays?: boolean > }[], > advanced_chart_agent?: boolean, > summarize_figures?: boolean, > intelligent_ordering?: boolean > }, > retrieval?: { > chunking?: { > chunk_mode?: variable | section | page | disabled | block | page_sections, > chunk_size?: number | null, > chunk_overlap?: number > }, > filter_blocks?: Header | Footer | Title | Section Header | Page Number | List Item | Figure | Table | Key Value | Text | Comment | Signature[], > embedding_optimized?: boolean > }, > formatting?: { > add_page_markers?: boolean, > table_output_format?: html | json | md | jsonbbox | dynamic | csv, > merge_tables?: boolean, > include?: change_tracking | highlight | comments | hyperlinks | signatures | ignore_watermarks[] > }, > spreadsheet?: { > split_large_tables?: { > enabled?: boolean, > size?: number > }, > include?: cell_colors | formula | dropdowns[], > clustering?: accurate | fast | disabled, > exclude?: string[], > max_cell_count?: number | null > }, > settings?: { > ocr_system?: standard | legacy, > extraction_mode?: ocr | hybrid, > force_url_result?: boolean, > force_file_extension?: string | null, > return_ocr_data?: boolean, > return_images?: figure | table | page[], > embed_pdf_metadata?: boolean, > extract_document_properties?: boolean, > embed_pdf_metadata_dpi?: number, > persist_results?: boolean, > timeout?: number | null, > page_range?: { > start?: number | null, > end?: number | null > } | { > start?: number | null, > end?: number | null > }[] | number[] | null, > document_password?: string | null, > model?: string | null > } > } > ``` > **split\_description full type** > > ```ts theme={null} > { > name: string, > description: string, > partition_key?: string | null > }[] > ``` > **settings full type** > > ```ts theme={null} > { > table_cutoff?: truncate | preserve, > allow_page_overlap?: boolean, > auto_partition?: boolean, > deep_split?: boolean, > force_url_result?: boolean > } > ``` > **async full type** > > ```ts theme={null} > { > metadata?: { > } | null, > priority?: boolean, > webhook?: { > mode: direct, > url: string > } | { > mode: svix, > channels?: string[] > } | { > mode: disabled, > channels?: string[] > } | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/reducto/database Reducto local sync: searchable entities, `.search()` filters, and operators. The Reducto plugin syncs data locally. Use `corsair.reducto.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Classify Outputs Path: `reducto.db.classifyOutputs.search` ```ts theme={null} const rows = await corsair.reducto.db.classifyOutputs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `resultUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resultId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Edit Form Fields Path: `reducto.db.editFormFields.search` ```ts theme={null} const rows = await corsair.reducto.db.editFormFields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `fieldIndex` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Edit Outputs Path: `reducto.db.editOutputs.search` ```ts theme={null} const rows = await corsair.reducto.db.editOutputs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `documentUrl` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Extract Citations Path: `reducto.db.extractCitations.search` ```ts theme={null} const rows = await corsair.reducto.db.extractCitations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `citationIndex` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Extract Outputs Path: `reducto.db.extractOutputs.search` ```ts theme={null} const rows = await corsair.reducto.db.extractOutputs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `resultUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resultId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Extract Records Path: `reducto.db.extractRecords.search` ```ts theme={null} const rows = await corsair.reducto.db.extractRecords.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `recordIndex` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `reducto.db.jobs.search` ```ts theme={null} const rows = await corsair.reducto.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `numPages` | `number` | equals, gt, gte, lt, lte, in | | `totalPages` | `number` | equals, gt, gte, lt, lte, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `providerCreatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `studioLink` | `string` | equals, contains, startsWith, endsWith, in | | `responseType` | `string` | equals, contains, startsWith, endsWith, in | | `pdfUrl` | `string` | equals, contains, startsWith, endsWith, in | | `parseResultUrl` | `string` | equals, contains, startsWith, endsWith, in | | `parseResultId` | `string` | equals, contains, startsWith, endsWith, in | | `splitResultUrl` | `string` | equals, contains, startsWith, endsWith, in | | `splitResultId` | `string` | equals, contains, startsWith, endsWith, in | | `pipelineResultUrl` | `string` | equals, contains, startsWith, endsWith, in | | `pipelineResultId` | `string` | equals, contains, startsWith, endsWith, in | | `progress` | `number` | equals, gt, gte, lt, lte, in | | `reason` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Parse Blocks Path: `reducto.db.parseBlocks.search` ```ts theme={null} const rows = await corsair.reducto.db.parseBlocks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `chunkIndex` | `number` | equals, gt, gte, lt, lte, in | | `blockIndex` | `number` | equals, gt, gte, lt, lte, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `confidence` | `string` | equals, contains, startsWith, endsWith, in | | `imageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Parse Chunks Path: `reducto.db.parseChunks.search` ```ts theme={null} const rows = await corsair.reducto.db.parseChunks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `chunkIndex` | `number` | equals, gt, gte, lt, lte, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `embed` | `string` | equals, contains, startsWith, endsWith, in | | `enriched` | `string` | equals, contains, startsWith, endsWith, in | | `enrichmentSuccess` | `boolean` | equals | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Parse Ocr Items Path: `reducto.db.parseOcrItems.search` ```ts theme={null} const rows = await corsair.reducto.db.parseOcrItems.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `ocrIndex` | `number` | equals, gt, gte, lt, lte, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `confidence` | `number` | equals, gt, gte, lt, lte, in | | `chunkIndex` | `number` | equals, gt, gte, lt, lte, in | | `rotation` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pipeline Outputs Path: `reducto.db.pipelineOutputs.search` ```ts theme={null} const rows = await corsair.reducto.db.pipelineOutputs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `resultUrl` | `string` | equals, contains, startsWith, endsWith, in | | `resultId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Split Segments Path: `reducto.db.splitSegments.search` ```ts theme={null} const rows = await corsair.reducto.db.splitSegments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `splitIndex` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `partitionKey` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/reducto/overview Reducto plugin for Corsair Use **Reducto** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 20 typed API operations * 12 synced entities (`classifyOutputs`, `editFormFields`, `editOutputs`, `extractCitations`, `extractOutputs`, `extractRecords`, and 6 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/reducto ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/reducto ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/reducto ``` ```bash bun theme={null} bun add corsair @corsair-dev/reducto ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { reducto } from '@corsair-dev/reducto'; export const corsair = createCorsair({ plugins: [ reducto(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} reducto() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'reducto', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.version`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.reducto.api.account.version({}); ``` **`account.configureWebhook`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.reducto.api.account.configureWebhook({}); ``` See the full list on the [API](/plugins/reducto/api) page. ## Query synced data Synced entities support `tenant.reducto.db..search()` and `.list()`: `classifyOutputs`, `editFormFields`, `editOutputs`, `extractCitations`, `extractOutputs`, `extractRecords`, `jobs`, `parseBlocks`, `parseChunks`, `parseOcrItems`, `pipelineOutputs`, `splitSegments`. See [Database](/plugins/reducto/database) for filters and operators. ## What's next > **[API reference](/plugins/reducto/api)** > > Every `reducto.api.*` operation with input and output types. > **[Database](/plugins/reducto/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/remoet/api API reference for Remoet: every `remoet.api.*` operation with input and output types. Every `remoet.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Companies ### get `companies.get` Get one Remoet company by slug, including its tech stack, perks and open-role counts; pass checkTechStack to see which technologies it uses **Risk:** `read` ```ts theme={null} await corsair.remoet.api.companies.get({ slug: 'starburst' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | The company's slug, e.g. "stripe". | | `checkTechStack` | `string[]` | No | Technologies to check against the company's full stack (max 50); matches come back in matchedTechStack. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `url` | `string` | No | — | | `nbrOfStars` | `number` | No | — | | `jobCount` | `number` | No | — | | `techStack` | `string[]` | No | A preview capped by Remoet; techStackCount is the full size. | | `matchedTechStack` | `string[]` | No | — | | `techStackCount` | `number` | No | — | | `experienceLevels` | `object` | No | — | | `shortDescription` | `string` | No | — | | `isStarred` | `boolean` | No | — | | `jobPreview` | `string[]` | No | — | | `about` | `string` | No | — | | `careersUrl` | `string` | No | — | | `verified` | `boolean` | No | — | | `urls` | `object` | No | — | | `perks` | `object[]` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **experienceLevels full type** > > ```ts theme={null} > { > junior?: number | null, > mid?: number | null, > senior?: number | null > } > ``` > **urls full type** > > ```ts theme={null} > { > } > ``` > **perks full type** > > ```ts theme={null} > { > id?: string | null, > title: string, > tags?: string[] | null, > description?: string | null, > category?: string | null > }[] > ``` *** ### search `companies.search` Search Remoet's tech companies by name, description, tech stack or seniority, or set starred to list the companies the user has starred. Paginated with page and pageSize (max 100) **Risk:** `read` ```ts theme={null} await corsair.remoet.api.companies.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `starred` | `boolean` | No | Set true to list every starred company instead of searching; the other filters and paging are ignored. | | `searchQuery` | `string` | No | Search keyword: matches company name, description and about text. | | `techStack` | `string[]` | No | — | | `techStackMatch` | `any \| all` | No | How techStack combines: "any" (at least one) or "all" (every one required). | | `experienceLevel` | `junior \| mid \| senior[]` | No | — | | `sortBy` | `stars \| jobCount \| name` | No | — | | `page` | `number` | No | Page number, starting from 1. | | `pageSize` | `number` | No | Results per page, max 100. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `listings` | `object[]` | Yes | — | | `totalCount` | `number` | Yes | — | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `totalPages` | `number` | No | — | | `hasNextPage` | `boolean` | No | — | | `starred` | `boolean` | No | — | | `hint` | `string` | No | — | | `note` | `string` | No | — | > **listings full type** > > ```ts theme={null} > { > id: string, > name: string, > slug: string, > url?: string | null, > nbrOfStars?: number | null, > jobCount?: number | null, > techStack?: string[] | null, > matchedTechStack?: string[] | null, > techStackCount?: number | null, > experienceLevels?: { > junior?: number | null, > mid?: number | null, > senior?: number | null > } | null, > shortDescription?: string | null, > isStarred?: boolean | null, > jobPreview?: string[] | null > }[] > ``` *** ## Education ### create `education.create` Add an education entry to the user's profile: institution is required **Risk:** `write` ```ts theme={null} await corsair.remoet.api.education.create({ institution: 'MIT' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `institution` | `string` | Yes | Institution name, e.g. "MIT". | | `institutionUrl` | `string` | No | Institution website URL. On update, '' clears it. | | `studyLevel` | `HIGH_SCHOOL \| ASSOCIATE \| BACHELOR \| MASTER \| DOCTORATE \| BOOTCAMP \| OTHER` | No | Level of study. | | `fieldOfStudy` | `string` | No | Field of study, e.g. "Computer Science". On update, '' clears it. | | `startDate` | `string` | No | A date, e.g. "2024-01-15". | | `endDate` | `string` | No | A date, e.g. "2024-01-15". | | `isCurrent` | `boolean` | No | Whether currently studying here. | | `description` | `string` | No | Description of studies and achievements. On update, '' clears it. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `institution` | `string` | Yes | — | | `institutionUrl` | `string` | No | — | | `studyLevel` | `string` | No | — | | `fieldOfStudy` | `string` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `isCurrent` | `boolean` | No | — | | `description` | `string` | No | — | *** ### delete `education.delete` Permanently remove an education entry by its id **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.remoet.api.education.delete({ id: '65f0000000000000000000a3' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | Yes | — | | `id` | `string` | Yes | — | *** ### list `education.list` List the education entries on the user profile **Risk:** `read` ```ts theme={null} await corsair.remoet.api.education.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > institution: string, > institutionUrl?: string | null, > studyLevel?: string | null, > fieldOfStudy?: string | null, > startDate?: string | null, > endDate?: string | null, > isCurrent?: boolean | null, > description?: string | null > }[] > ``` *** ### update `education.update` Update an education entry by its id. Omit a field to leave it unchanged; set an optional text field to '' to clear it. startDate, endDate and isCurrent can only be replaced, never cleared **Risk:** `write` ```ts theme={null} await corsair.remoet.api.education.update({ id: '65f0000000000000000000a3', isCurrent: true }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `institution` | `string` | No | Institution name, e.g. "MIT". | | `institutionUrl` | `string` | No | Institution website URL. On update, '' clears it. | | `studyLevel` | `HIGH_SCHOOL \| ASSOCIATE \| BACHELOR \| MASTER \| DOCTORATE \| BOOTCAMP \| OTHER` | No | Level of study. | | `fieldOfStudy` | `string` | No | Field of study, e.g. "Computer Science". On update, '' clears it. | | `startDate` | `string` | No | A date, e.g. "2024-01-15". | | `endDate` | `string` | No | A date, e.g. "2024-01-15". | | `isCurrent` | `boolean` | No | Whether currently studying here. | | `description` | `string` | No | Description of studies and achievements. On update, '' clears it. | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `institution` | `string` | Yes | — | | `institutionUrl` | `string` | No | — | | `studyLevel` | `string` | No | — | | `fieldOfStudy` | `string` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `isCurrent` | `boolean` | No | — | | `description` | `string` | No | — | *** ## Feed ### list `feed.list` List a page of the user's composed feed: their own item lane (new jobs, welcome, starred-company snapshots) merged with blog posts, job of the day and broadcasts, newest first. Paginated with pageSize (max 50) and cursor, taken from the previous page's nextCursor **Risk:** `read` ```ts theme={null} await corsair.remoet.api.feed.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageSize` | `number` | No | Items per page, max 50. | | `cursor` | `string` | No | nextCursor from the previous page. Omit for the newest page. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hasNextPage` | `boolean` | Yes | — | | `filtersApplied` | `boolean` | Yes | — | | `nextCursor` | `string` | No | — | | `entries` | `object[]` | Yes | — | > **entries full type** > > ```ts theme={null} > { > id: string, > kind: string, > date: string, > item?: { > id: string, > type: string, > listingId?: string | null, > isStarred?: boolean | null, > listingName?: string | null, > listingSlug?: string | null, > listingImage?: string | null, > jobs: { > id: string, > isActive: boolean, > savedJobId?: string | null, > title: string, > url?: string | null, > remotePolicy?: string | null, > remoteRestrictions?: string | null, > techStack?: string[] | null, > salaryEnriched?: { > from?: number | null, > to?: number | null, > currency?: string | null, > period?: string | null > } | null, > experienceLevel?: string | null, > isOnPublishablePlatform?: boolean | null, > postingCount?: number | null, > matchesFilters: boolean > }[], > jobCount?: number | null, > createdAt: string > } | null, > blogPost?: { > id: string, > createdAt: string, > updatedAt: string, > publishedAt?: string | null, > isPublished: boolean, > isFeatured?: boolean | null, > views?: number | null, > image?: string | null, > title: string, > slug: string, > description: string, > tags?: string[] | null, > readingTime?: number | null, > audience?: string | null > } | null, > broadcast?: { > id: string, > title: string, > body: string, > createdAt: string > } | null, > jobOfTheDay?: { > id: string, > listingId: string, > listingName: string, > listingSlug?: string | null, > listingImage?: string | null, > job: { > id: string, > isActive: boolean, > savedJobId?: string | null, > title: string, > url?: string | null, > remotePolicy?: string | null, > remoteRestrictions?: string | null, > techStack?: string[] | null, > salaryEnriched?: { > from?: number | null, > to?: number | null, > currency?: string | null, > period?: string | null > } | null, > experienceLevel?: string | null, > isOnPublishablePlatform?: boolean | null, > postingCount?: number | null > }, > nbrOfStars?: number | null, > createdAt: string > } | null > }[] > ``` *** ## Job Context ### get `jobContext.get` Look up what Remoet knows about a job page URL: company, tech stack, salary, remote policy, reposts and how long ago Remoet first saw it (at least that old, not a posting date). Returns match null for untracked pages **Risk:** `read` ```ts theme={null} await corsair.remoet.api.jobContext.get({ url: 'https://job-boards.greenhouse.io/starburst/jobs/5432864008' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | Full URL of the job page, e.g. an ATS posting. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `match` | `object` | No | — | > **match full type** > > ```ts theme={null} > { > company: string, > companySlug: string, > firstSeenAt: string, > daysSinceFirstSeen: number, > firstSeenAtIsCensored: boolean, > isActive: boolean, > deactivatedAt?: string | null, > reposts: { > removedAt: string, > repostedAt: string, > gapDays: number > }[], > otherOpenRoles: number, > isStarred: boolean, > techStack: string[], > remotePolicy?: string | null, > remoteRestrictions?: string | null, > salary?: { > from?: number | null, > to?: number | null, > currency?: string | null, > period?: string | null > } | null, > experienceLevel?: string | null, > summary?: string | null > } > ``` *** ## Jobs ### search `jobs.search` Search Remoet's public tech job catalogue by keywords, tech stack, company, location, remote policy, seniority and salary floor. Each job's firstSeenAt is when Remoet first saw it, not when it was posted. Paginated with page and pageSize (max 50) **Risk:** `read` ```ts theme={null} await corsair.remoet.api.jobs.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `searchQuery` | `string` | No | Free text, matched against the job title, summary and tech stack. Comma-separate keywords to require ALL of them. | | `techStack` | `string[]` | No | Match roles carrying technologies from this list, e.g. \["React", "Go"]. | | `techStackMatch` | `any \| all` | No | How techStack combines: "any" (at least one) or "all" (every one required). | | `companySlug` | `string` | No | Restrict to one company by its Remoet slug, e.g. "stripe". | | `remotePolicy` | `onsite \| hybrid \| remote \| remote-restricted[]` | No | — | | `experienceLevel` | `junior \| mid \| senior[]` | No | — | | `salaryMin` | `number` | No | Minimum salary. | | `location` | `string[]` | No | Place names, e.g. \["Berlin"]. Each may itself contain a comma, e.g. "Portland, OR". | | `sortBy` | `newest \| salary` | No | — | | `sortOrder` | `asc \| desc` | No | — | | `page` | `number` | No | Page number, starting from 1. | | `pageSize` | `number` | No | Results per page, max 50. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `jobs` | `object[]` | Yes | — | | `totalCount` | `number` | Yes | — | | `page` | `number` | Yes | — | | `pageSize` | `number` | Yes | — | | `totalPages` | `number` | Yes | — | | `hasNextPage` | `boolean` | Yes | — | | `hint` | `string` | No | Present on an empty result: which filter emptied it and what to try. | > **jobs full type** > > ```ts theme={null} > { > id: string, > title: string, > company: string, > companySlug: string, > url?: string | null, > applyUrl?: string | null, > companyUrl?: string | null, > location?: string | null, > remotePolicy?: string | null, > remoteRestrictions?: string | null, > experienceLevel?: string | null, > salary?: { > from?: number | null, > to?: number | null, > currency?: string | null, > period?: string | null > } | null, > techStack?: string[] | null, > summary?: string | null, > firstSeenAt: string, > lastVerifiedAt?: string | null, > duplicateCount?: number | null > }[] > ``` *** ## Link Trees ### get `linkTrees.get` Get one of the user's link tree pages by slug **Risk:** `read` ```ts theme={null} await corsair.remoet.api.linkTrees.get({ slug: 'my-links' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `slug` | `string` | Yes | The link tree's own slug, from linkTrees.list. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `slug` | `string` | Yes | — | | `links` | `object[]` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **links full type** > > ```ts theme={null} > { > id: string, > label: string, > url: string > }[] > ``` *** ### list `linkTrees.list` List the user's shareable link tree pages **Risk:** `read` ```ts theme={null} await corsair.remoet.api.linkTrees.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > title: string, > description?: string | null, > slug: string, > links: { > id: string, > label: string, > url: string > }[], > createdAt: string, > updatedAt: string > }[] > ``` *** ## Profile ### get `profile.get` Get the signed-in user's whole Remoet profile: contact fields, work experience, projects, education and link trees **Risk:** `read` ```ts theme={null} await corsair.remoet.api.profile.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | | `ghId` | `number` | No | Numeric GitHub user id; absent for users who never linked GitHub. | | `email` | `string` | No | — | | `profile` | `object` | Yes | — | | `jobs` | `object[]` | Yes | — | | `projects` | `object[]` | Yes | — | | `linkTrees` | `object[]` | Yes | — | | `education` | `object[]` | Yes | — | > **profile full type** > > ```ts theme={null} > { > updatedAt: string, > isPublic?: boolean | null, > slug?: string | null, > name?: { > value?: string | null, > isPublic: boolean > } | null, > avatarUrl?: { > value?: string | null, > isPublic: boolean > } | null, > phone?: { > value?: string | null, > isPublic: boolean > } | null, > url?: { > value?: string | null, > isPublic: boolean > } | null, > summary?: { > value?: string | null, > isPublic: boolean > } | null, > location?: { > value?: string | null, > isPublic: boolean > } | null, > githubUrl?: { > value?: string | null, > isPublic: boolean > } | null, > facebookUrl?: { > value?: string | null, > isPublic: boolean > } | null, > twitterUrl?: { > value?: string | null, > isPublic: boolean > } | null, > linkedinUrl?: { > value?: string | null, > isPublic: boolean > } | null, > youtubeUrl?: { > value?: string | null, > isPublic: boolean > } | null > } > ``` > **jobs full type** > > ```ts theme={null} > { > id: string, > createdAt: string, > updatedAt: string, > userId?: string | null, > title: string, > startDate: string, > endDate?: string | null, > isCurrent?: boolean | null, > isPublic?: boolean | null, > companyName?: string | null, > technologies?: string[] | null, > description?: string | null, > isRemote?: boolean | null, > companyUrl?: string | null, > listingId?: string | null > }[] > ``` > **projects full type** > > ```ts theme={null} > { > id: string, > title: string, > shortDescription?: string | null, > technologies?: string[] | null, > isCurrent?: boolean | null, > isRemote?: boolean | null, > isOpenSource?: boolean | null, > description?: string | null, > role?: string | null, > startDate?: string | null, > endDate?: string | null, > repoUrl?: string | null, > demoUrl?: string | null, > jobId?: string | null > }[] > ``` > **linkTrees full type** > > ```ts theme={null} > { > id: string, > title: string, > description?: string | null, > slug: string, > links: { > id: string, > label: string, > url: string > }[], > createdAt: string, > updatedAt: string > }[] > ``` > **education full type** > > ```ts theme={null} > { > id: string, > institution: string, > institutionUrl?: string | null, > studyLevel?: string | null, > fieldOfStudy?: string | null, > startDate?: string | null, > endDate?: string | null, > isCurrent?: boolean | null, > description?: string | null > }[] > ``` *** ### getLinks `profile.getLinks` Get the user's public profile links (website, GitHub, LinkedIn and more); private links come back null **Risk:** `read` ```ts theme={null} await corsair.remoet.api.profile.getLinks({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `githubUrl` | `string` | No | — | | `facebookUrl` | `string` | No | — | | `twitterUrl` | `string` | No | — | | `linkedinUrl` | `string` | No | — | | `youtubeUrl` | `string` | No | — | *** ### update `profile.update` Update the user's Remoet profile: contact fields, name, avatarUrl, socials and summary (each may be set to null to clear it, 500 characters max, 5000 for summary), and visibility. Visibility controls who can see the profile in company candidate lists: NONE hides it from every company, STARRED shows it only to companies the user has starred, and ALL shows it to every company on Remoet **Risk:** `write` ```ts theme={null} await corsair.remoet.api.profile.update({ location: 'Stockholm' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phone` | `string \| null` | No | Phone number. Null clears it. | | `url` | `string \| null` | No | Personal website URL. Null clears it. | | `location` | `string \| null` | No | Location. Null clears it. | | `githubUrl` | `string \| null` | No | GitHub profile URL. Null clears it. | | `linkedinUrl` | `string \| null` | No | LinkedIn profile URL. Null clears it. | | `name` | `string \| null` | No | Full name. Null clears it. | | `avatarUrl` | `string \| null` | No | Avatar/photo URL. Null clears it. | | `facebookUrl` | `string \| null` | No | Facebook profile URL. Null clears it. | | `twitterUrl` | `string \| null` | No | Twitter/X profile URL. Null clears it. | | `youtubeUrl` | `string \| null` | No | YouTube channel URL. Null clears it. | | `summary` | `string \| null` | No | Brief professional summary or bio. Null clears it. | | `visibility` | `NONE \| STARRED \| ALL` | No | Who can see the profile in company candidate lists. Not writable to null; leave it out to leave it unchanged. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `updated` | `string[]` | Yes | — | *** ## Projects ### create `projects.create` Add a project entry to the user's profile: title and shortDescription are required **Risk:** `write` ```ts theme={null} await corsair.remoet.api.projects.create({ title: 'corsair-remoet', shortDescription: 'A Corsair plugin' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | Project title. | | `shortDescription` | `string` | Yes | A one-line summary of the project. | | `description` | `string` | No | Full project description. On update, '' clears it. | | `role` | `string` | No | Role on the project. On update, '' clears it. | | `technologies` | `string[]` | No | Technologies used, e.g. \["React", "Node.js"]. On update, \[] empties it. | | `isCurrent` | `boolean` | No | Whether this is an ongoing project. | | `isRemote` | `boolean` | No | Whether this was remote work. | | `isOpenSource` | `boolean` | No | Whether this is open source. | | `startDate` | `string` | No | A date, e.g. "2024-01-15". | | `endDate` | `string` | No | A date, e.g. "2024-01-15". | | `repoUrl` | `string` | No | Repository URL. On update, '' clears it. | | `demoUrl` | `string` | No | Live demo URL. On update, '' clears it. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `shortDescription` | `string` | No | — | | `technologies` | `string[]` | No | — | | `isCurrent` | `boolean` | No | — | | `isRemote` | `boolean` | No | — | | `isOpenSource` | `boolean` | No | — | | `description` | `string` | No | — | | `role` | `string` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `repoUrl` | `string` | No | — | | `demoUrl` | `string` | No | — | | `jobId` | `string` | No | Set when this project is linked to a work experience entry. | *** ### delete `projects.delete` Permanently remove a project entry by its id **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.remoet.api.projects.delete({ id: '65f0000000000000000000a2' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | Yes | — | | `id` | `string` | Yes | — | *** ### list `projects.list` List the projects on the user profile **Risk:** `read` ```ts theme={null} await corsair.remoet.api.projects.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > title: string, > shortDescription?: string | null, > technologies?: string[] | null, > isCurrent?: boolean | null, > isRemote?: boolean | null, > isOpenSource?: boolean | null, > description?: string | null, > role?: string | null, > startDate?: string | null, > endDate?: string | null, > repoUrl?: string | null, > demoUrl?: string | null, > jobId?: string | null > }[] > ``` *** ### update `projects.update` Update a project entry by its id. Omit a field to leave it unchanged; set an optional text field to '' to clear it or technologies to \[] to empty it. startDate, endDate and the booleans can only be replaced, never cleared **Risk:** `write` ```ts theme={null} await corsair.remoet.api.projects.update({ id: '65f0000000000000000000a2', isOpenSource: true }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | Project title. | | `shortDescription` | `string` | No | A one-line summary of the project. | | `description` | `string` | No | Full project description. On update, '' clears it. | | `role` | `string` | No | Role on the project. On update, '' clears it. | | `technologies` | `string[]` | No | Technologies used, e.g. \["React", "Node.js"]. On update, \[] empties it. | | `isCurrent` | `boolean` | No | Whether this is an ongoing project. | | `isRemote` | `boolean` | No | Whether this was remote work. | | `isOpenSource` | `boolean` | No | Whether this is open source. | | `startDate` | `string` | No | A date, e.g. "2024-01-15". | | `endDate` | `string` | No | A date, e.g. "2024-01-15". | | `repoUrl` | `string` | No | Repository URL. On update, '' clears it. | | `demoUrl` | `string` | No | Live demo URL. On update, '' clears it. | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `shortDescription` | `string` | No | — | | `technologies` | `string[]` | No | — | | `isCurrent` | `boolean` | No | — | | `isRemote` | `boolean` | No | — | | `isOpenSource` | `boolean` | No | — | | `description` | `string` | No | — | | `role` | `string` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `repoUrl` | `string` | No | — | | `demoUrl` | `string` | No | — | | `jobId` | `string` | No | Set when this project is linked to a work experience entry. | *** ## Saved Jobs ### create `savedJobs.create` Save a job to the user's saved jobs by its id, with an optional note (500 characters max) **Risk:** `write` ```ts theme={null} await corsair.remoet.api.savedJobs.create({ jobId: '65f0000000000000000000b1' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | Id of the job, e.g. from jobs.search or starredJobs.list. | | `jobType` | `ai_job \| listing_job` | No | "ai\_job" (the default) or "listing\_job". | | `note` | `string \| null` | No | Optional note about why this job is interesting. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The saved-job entry id, used by savedJobs.update and savedJobs.delete. | | `jobId` | `string` | Yes | — | | `jobType` | `string` | Yes | — | | `note` | `string` | No | — | | `savedAt` | `string` | Yes | — | | `job` | `object` | No | — | | `locked` | `boolean` | No | — | | `lockedReason` | `string` | No | — | > **job full type** > > ```ts theme={null} > { > title: string, > listingId?: string | null, > techStack?: string[] | null, > remotePolicy?: string | null, > experienceLevel?: string | null, > salaryMin?: number | null, > salaryMax?: number | null, > salaryCurrency?: string | null, > applicationUrl?: string | null, > isActive?: boolean | null, > deactivatedAt?: string | null > } > ``` *** ### delete `savedJobs.delete` Permanently remove a saved-job entry by its saved-job id (not the job id) **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.remoet.api.savedJobs.delete({ savedJobId: '65f0000000000000000000b2' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `savedJobId` | `string` | Yes | The saved-job entry id, not the job id. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | Yes | — | | `id` | `string` | Yes | — | *** ### list `savedJobs.list` List the user's saved jobs with their notes. A locked entry has job null and a lockedReason saying how to unlock it, usually: star the company to see it again. Paginated with page and pageSize (max 50) **Risk:** `read` ```ts theme={null} await corsair.remoet.api.savedJobs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Page number, starting from 1. | | `pageSize` | `number` | No | Results per page, max 50. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `totalCount` | `number` | Yes | — | | `page` | `number` | Yes | — | | `pageSize` | `number` | Yes | — | | `totalPages` | `number` | Yes | — | | `hasNextPage` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > jobId: string, > jobType: string, > note?: string | null, > savedAt: string, > job?: { > title: string, > listingId?: string | null, > techStack?: string[] | null, > remotePolicy?: string | null, > experienceLevel?: string | null, > salaryMin?: number | null, > salaryMax?: number | null, > salaryCurrency?: string | null, > applicationUrl?: string | null, > isActive?: boolean | null, > deactivatedAt?: string | null > } | null, > locked?: boolean, > lockedReason?: string > }[] > ``` *** ### update `savedJobs.update` Replace the note on a saved-job entry by its saved-job id (not the job id); null clears it **Risk:** `write` ```ts theme={null} await corsair.remoet.api.savedJobs.update({ savedJobId: '65f0000000000000000000b2', note: 'Great stack' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `savedJobId` | `string` | Yes | The saved-job entry id, not the job id. | | `note` | `string \| null` | Yes | The new note, or null to clear it. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The saved-job entry id, used by savedJobs.update and savedJobs.delete. | | `jobId` | `string` | Yes | — | | `jobType` | `string` | Yes | — | | `note` | `string` | No | — | | `savedAt` | `string` | Yes | — | | `job` | `object` | No | — | | `locked` | `boolean` | No | — | | `lockedReason` | `string` | No | — | > **job full type** > > ```ts theme={null} > { > title: string, > listingId?: string | null, > techStack?: string[] | null, > remotePolicy?: string | null, > experienceLevel?: string | null, > salaryMin?: number | null, > salaryMax?: number | null, > salaryCurrency?: string | null, > applicationUrl?: string | null, > isActive?: boolean | null, > deactivatedAt?: string | null > } > ``` *** ## Starred Jobs ### list `starredJobs.list` List jobs at the companies the user has starred, filtered by keywords, location, tech stack, remote policy, seniority and salary floor. createdAt is when Remoet first saw a job, not when it was posted. Paginated with page and pageSize (max 50) **Risk:** `read` ```ts theme={null} await corsair.remoet.api.starredJobs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `searchQuery` | `string` | No | Search keywords for job title, summary or tech stack. | | `locationQuery` | `string` | No | Filter by location or remote restrictions. | | `techStack` | `string[]` | No | — | | `techStackMatch` | `any \| all` | No | How techStack combines: "any" (at least one) or "all" (every one required). | | `remotePolicy` | `onsite \| hybrid \| remote \| remote-restricted[]` | No | — | | `experienceLevel` | `junior \| mid \| senior[]` | No | — | | `salaryMin` | `number` | No | Minimum salary. | | `sortBy` | `createdAt \| remotePolicy \| salaryEnriched.from \| experienceLevel` | No | — | | `sortOrder` | `asc \| desc` | No | — | | `page` | `number` | No | Page number, starting from 1. | | `pageSize` | `number` | No | Results per page, max 50. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `jobs` | `object[]` | Yes | — | | `totalCount` | `number` | Yes | — | | `totalPages` | `number` | Yes | — | | `page` | `number` | Yes | — | | `pageSize` | `number` | Yes | — | | `hasNextPage` | `boolean` | Yes | — | | `starsOverCap` | `object` | No | Present when the user holds more stars than the cap allows. | > **jobs full type** > > ```ts theme={null} > { > id: string, > title: string, > url?: string | null, > createdAt: string, > remotePolicy?: string | null, > remoteRestrictions?: string | null, > techStack?: string[] | null, > salaryEnriched?: { > from?: number | null, > to?: number | null, > currency?: string | null, > period?: string | null > } | null, > experienceLevel?: string | null, > benefits?: string[] | null, > summary?: string | null, > isOnPublishablePlatform?: boolean | null, > listing: { > id: string, > name: string, > slug: string > }, > postingCount?: number | null, > postingLocations?: string[] | null > }[] > ``` > **starsOverCap full type** > > ```ts theme={null} > { > surplusStars: number, > maxActiveStars: number, > starsPendingDeletionAt?: string | null, > note: string > } > ``` *** ## Stars ### create `stars.create` Star a company on Remoet by its slug so its jobs reach the user feed. Stars are capped per user, and removing one spends from a limited unstar budget **Risk:** `write` ```ts theme={null} await corsair.remoet.api.stars.create({ companySlug: 'starburst' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | Yes | Slug of an active Remoet company, e.g. from jobContext.get. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `company` | `string` | Yes | — | *** ### delete `stars.delete` Unstar a company by its slug. Each unstar spends from a limited budget that resets every 30 days **Risk:** `destructive` ```ts theme={null} await corsair.remoet.api.stars.delete({ companySlug: 'starburst' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companySlug` | `string` | Yes | Slug of the company to unstar. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `company` | `string` | Yes | — | *** ## Work Experience ### create `workExperience.create` Add a work experience entry to the user's profile: title and startDate are required **Risk:** `write` ```ts theme={null} await corsair.remoet.api.workExperience.create({ title: 'Senior Engineer', companyName: 'Acme', startDate: '2023-04-01', technologies: ['TypeScript', 'Go'], }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | Job title. | | `startDate` | `string` | Yes | A date, e.g. "2024-01-15". | | `companyName` | `string` | No | Company name. On update, '' clears it. | | `companyUrl` | `string` | No | Company website URL. On update, '' clears it. | | `endDate` | `string` | No | A date, e.g. "2024-01-15". | | `isCurrent` | `boolean` | No | Whether this is the current job. | | `isRemote` | `boolean` | No | Whether this job is remote. | | `technologies` | `string[]` | No | Technologies used, e.g. \["React", "Node.js"]. On update, \[] empties it. | | `description` | `string` | No | Job description. On update, '' clears it. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | | `userId` | `string` | No | — | | `title` | `string` | Yes | — | | `startDate` | `string` | Yes | — | | `endDate` | `string` | No | Null or absent for a current role. | | `isCurrent` | `boolean` | No | — | | `isPublic` | `boolean` | No | — | | `companyName` | `string` | No | — | | `technologies` | `string[]` | No | — | | `description` | `string` | No | — | | `isRemote` | `boolean` | No | — | | `companyUrl` | `string` | No | — | | `listingId` | `string` | No | Id of a Remoet company listing linked to this entry, when one is linked; usually null. Not evidence of a job match. | *** ### delete `workExperience.delete` Permanently remove a work experience entry by its id **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.remoet.api.workExperience.delete({ id: '65f0000000000000000000a1' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | Yes | — | | `id` | `string` | Yes | — | *** ### list `workExperience.list` List the user's work experience (their employment history, not job postings) **Risk:** `read` ```ts theme={null} await corsair.remoet.api.workExperience.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > createdAt: string, > updatedAt: string, > userId?: string | null, > title: string, > startDate: string, > endDate?: string | null, > isCurrent?: boolean | null, > isPublic?: boolean | null, > companyName?: string | null, > technologies?: string[] | null, > description?: string | null, > isRemote?: boolean | null, > companyUrl?: string | null, > listingId?: string | null > }[] > ``` *** ### update `workExperience.update` Update a work experience entry by its id. Omit a field to leave it unchanged; set an optional text field to '' to clear it or technologies to \[] to empty it. startDate, endDate and the booleans can only be replaced, never cleared **Risk:** `write` ```ts theme={null} await corsair.remoet.api.workExperience.update({ id: '65f0000000000000000000a1', isCurrent: false }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | Job title. | | `startDate` | `string` | No | A date, e.g. "2024-01-15". | | `companyName` | `string` | No | Company name. On update, '' clears it. | | `companyUrl` | `string` | No | Company website URL. On update, '' clears it. | | `endDate` | `string` | No | A date, e.g. "2024-01-15". | | `isCurrent` | `boolean` | No | Whether this is the current job. | | `isRemote` | `boolean` | No | Whether this job is remote. | | `technologies` | `string[]` | No | Technologies used, e.g. \["React", "Node.js"]. On update, \[] empties it. | | `description` | `string` | No | Job description. On update, '' clears it. | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | | `userId` | `string` | No | — | | `title` | `string` | Yes | — | | `startDate` | `string` | Yes | — | | `endDate` | `string` | No | Null or absent for a current role. | | `isCurrent` | `boolean` | No | — | | `isPublic` | `boolean` | No | — | | `companyName` | `string` | No | — | | `technologies` | `string[]` | No | — | | `description` | `string` | No | — | | `isRemote` | `boolean` | No | — | | `companyUrl` | `string` | No | — | | `listingId` | `string` | No | Id of a Remoet company listing linked to this entry, when one is linked; usually null. Not evidence of a job match. | *** # Database Source: https://docs.corsair.dev/plugins/remoet/database Remoet local sync: searchable entities, `.search()` filters, and operators. The Remoet plugin syncs data locally. Use `corsair.remoet.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/remoet/overview Read and manage a Remoet user's career profile (work experience, projects, education, visibility) and feed, look up what Remoet knows about a job page, search jobs and companies, and star or save jobs. Remoet is an AI-agent-first tech job platform for tracking tech jobs from companies you love. Use **Remoet** through Corsair: one client, typed API calls. **What you get:** * 29 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/remoet ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/remoet ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/remoet ``` ```bash bun theme={null} bun add corsair @corsair-dev/remoet ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { remoet } from '@corsair-dev/remoet'; export const corsair = createCorsair({ plugins: [ remoet(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} remoet() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'remoet', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Search open jobs** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.remoet.api.jobs.search({ searchQuery: 'typescript', remotePolicy: ['remote'], pageSize: 5, }); ``` **Add a work experience entry** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.remoet.api.workExperience.create({ title: 'Senior Engineer', companyName: 'Acme', startDate: '2023-04-01', technologies: ['TypeScript', 'Go'], }); ``` See the full list on the [API](/plugins/remoet/api) page. ## What's next > **[API reference](/plugins/remoet/api)** > > Every `remoet.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/removebg/api API reference for remove.bg: every `removebg.api.*` operation with input and output types. Every `removebg.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get account credit balance and API usage limits **Risk:** `read` ```ts theme={null} await corsair.removebg.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > attributes: { > credits: { > total: number, > subscription: number, > payg: number, > enterprise: number > }, > api: { > free_calls: number, > sizes: string > } > } > } > ``` *** ## Improvement ### submit `improvement.submit` Submit an image to the remove.bg Improvement program for AI training **Risk:** `write` ```ts theme={null} await corsair.removebg.api.improvement.submit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageUrl` | `string` | No | — | | `imageFileB64` | `string` | No | — | | `errorType` | `other \| kind \| result-type \| foreground-edges \| foreground-parts-missing \| background-not-fully-removed \| foreground-inside-cutout \| foreground-cut-off` | Yes | — | | `errorDescription` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Remove Background ### remove `removeBackground.remove` Remove the background from an image, returning a base64-encoded cutout **Risk:** `write` ```ts theme={null} await corsair.removebg.api.removeBackground.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageUrl` | `string` | No | — | | `imageFileB64` | `string` | No | — | | `size` | `preview \| small \| regular \| medium \| hd \| full \| 4k \| 50MP \| auto` | No | — | | `type` | `auto \| person \| product \| car \| animal \| graphic \| transportation` | No | — | | `typeLevel` | `1 \| 2 \| none \| latest` | No | — | | `format` | `auto \| png \| jpg \| webp \| zip` | No | — | | `roi` | `string` | No | — | | `crop` | `boolean` | No | — | | `cropMargin` | `string` | No | — | | `scale` | `string` | No | — | | `position` | `string` | No | — | | `channels` | `rgba \| alpha` | No | — | | `shadowType` | `auto \| car \| 3D \| drop \| none` | No | — | | `shadowOpacity` | `number` | No | — | | `semitransparency` | `boolean` | No | — | | `bgColor` | `string` | No | — | | `bgImageUrl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > result_b64: string, > foreground_top?: number, > foreground_left?: number, > foreground_width?: number, > foreground_height?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/removebg/database remove.bg local sync: searchable entities, `.search()` filters, and operators. The remove.bg plugin syncs data locally. Use `corsair.removebg.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/removebg/overview Background removal API for automatically cutting out subjects from photos and images. Use **remove.bg** through Corsair: one client, typed API calls. **What you get:** * 3 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/removebg ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/removebg ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/removebg ``` ```bash bun theme={null} bun add corsair @corsair-dev/removebg ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { removebg } from '@corsair-dev/removebg'; export const corsair = createCorsair({ plugins: [ removebg(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} removebg() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'removebg', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.removebg.api.account.get({}); ``` **`improvement.submit`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.removebg.api.improvement.submit({}); ``` See the full list on the [API](/plugins/removebg/api) page. ## What's next > **[API reference](/plugins/removebg/api)** > > Every `removebg.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/replicate/api API reference for Replicate: every `replicate.api.*` operation with input and output types. Every `replicate.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get authenticated account information **Risk:** `read` ```ts theme={null} await corsair.replicate.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | — | | `name` | `string` | No | — | | `type` | `user \| organization` | Yes | — | | `avatar_url` | `string` | No | — | | `github_url` | `string` | No | — | *** ## Collections ### get `collections.get` Get model collection details by slug **Risk:** `read` ```ts theme={null} await corsair.replicate.api.collections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `collectionSlug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `description` | `string` | Yes | — | | `full_description` | `string` | No | — | | `models` | `object[]` | No | — | > **models full type** > > ```ts theme={null} > { > owner: string, > name: string, > description?: string | null, > visibility?: public | private, > url?: string, > github_url?: string | null, > paper_url?: string | null, > license_url?: string | null, > cover_image_url?: string | null, > run_count?: number, > is_official?: boolean, > default_example?: any | null, > latest_version?: any | null > }[] > ``` *** ### list `collections.list` List model collections **Risk:** `read` ```ts theme={null} await corsair.replicate.api.collections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > name: string, > slug: string, > description: string > }[] > ``` *** ## Deployments ### create `deployments.create` Create a deployment **Risk:** `write` ```ts theme={null} await corsair.replicate.api.deployments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `model` | `string` | Yes | — | | `version` | `string` | Yes | — | | `hardware` | `string` | Yes | — | | `min_instances` | `number` | Yes | — | | `max_instances` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `current_release` | `object` | No | — | > **current\_release full type** > > ```ts theme={null} > { > number?: number, > model?: string, > version?: string, > created_at?: string | string, > configuration?: { > hardware?: string, > min_instances?: number, > max_instances?: number > } > } > ``` *** ### delete `deployments.delete` Delete a deployment **Risk:** `destructive` ```ts theme={null} await corsair.replicate.api.deployments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `deployments.get` Get deployment details **Risk:** `read` ```ts theme={null} await corsair.replicate.api.deployments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `current_release` | `object` | No | — | > **current\_release full type** > > ```ts theme={null} > { > number?: number, > model?: string, > version?: string, > created_at?: string | string, > configuration?: { > hardware?: string, > min_instances?: number, > max_instances?: number > } > } > ``` *** ### list `deployments.list` List deployments **Risk:** `read` ```ts theme={null} await corsair.replicate.api.deployments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > owner: string, > name: string, > current_release?: { > number?: number, > model?: string, > version?: string, > created_at?: string | string, > configuration?: { > hardware?: string, > min_instances?: number, > max_instances?: number > } > } > }[] > ``` *** ### predictionsCreate `deployments.predictionsCreate` Create a prediction from deployment **Risk:** `write` ```ts theme={null} await corsair.replicate.api.deployments.predictionsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `input` | `object` | Yes | — | | `stream` | `boolean` | No | — | | `webhook` | `string` | No | — | | `webhook_events_filter` | `start \| output \| logs \| completed[]` | No | — | | `prefer` | `string` | No | — | | `cancelAfter` | `string` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `starting \| processing \| succeeded \| failed \| canceled \| aborted` | Yes | — | | `model` | `string` | No | — | | `version` | `string` | No | — | | `deployment` | `string` | No | — | | `input` | `object` | No | — | | `output` | `any` | No | — | | `error` | `string` | No | — | | `logs` | `string` | No | — | | `source` | `api \| web` | No | — | | `data_removed` | `boolean` | No | — | | `created_at` | `string \| string` | No | — | | `started_at` | `string \| string` | No | — | | `completed_at` | `string \| string` | No | — | | `deadline` | `string \| string` | No | — | | `metrics` | `object` | No | — | | `urls` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` > **metrics full type** > > ```ts theme={null} > { > } > ``` > **urls full type** > > ```ts theme={null} > { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > ``` *** ## Files ### create `files.create` Upload a file **Risk:** `write` ```ts theme={null} await corsair.replicate.api.files.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `any` | Yes | — | | `filename` | `string` | No | — | | `type` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `content_type` | `string` | Yes | — | | `size` | `number` | Yes | — | | `checksums` | `object` | Yes | — | | `metadata` | `object` | Yes | — | | `created_at` | `string \| string` | Yes | — | | `expires_at` | `string \| string` | Yes | — | | `urls` | `object` | Yes | — | > **checksums full type** > > ```ts theme={null} > { > sha256?: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **urls full type** > > ```ts theme={null} > { > get: string > } > ``` *** ### delete `files.delete` Delete a file **Risk:** `destructive` ```ts theme={null} await corsair.replicate.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `files.get` Get file details **Risk:** `read` ```ts theme={null} await corsair.replicate.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `content_type` | `string` | Yes | — | | `size` | `number` | Yes | — | | `checksums` | `object` | Yes | — | | `metadata` | `object` | Yes | — | | `created_at` | `string \| string` | Yes | — | | `expires_at` | `string \| string` | Yes | — | | `urls` | `object` | Yes | — | > **checksums full type** > > ```ts theme={null} > { > sha256?: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **urls full type** > > ```ts theme={null} > { > get: string > } > ``` *** ### list `files.list` List uploaded files **Risk:** `read` ```ts theme={null} await corsair.replicate.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > content_type: string, > size: number, > checksums: { > sha256?: string > }, > metadata: { > }, > created_at: string | string, > expires_at: string | string, > urls: { > get: string > } > }[] > ``` *** ## Hardware ### list `hardware.list` List available hardware SKUs **Risk:** `read` ```ts theme={null} await corsair.replicate.api.hardware.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > sku: string, > name: string > }[] > ``` *** ## Models ### examplesList `models.examplesList` List model examples **Risk:** `read` ```ts theme={null} await corsair.replicate.api.models.examplesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > status: starting | processing | succeeded | failed | canceled | aborted, > model?: string, > version?: string, > deployment?: string, > input?: { > }, > output?: any, > error?: string | null, > logs?: string, > source?: api | web, > data_removed?: boolean, > created_at?: string | string, > started_at?: string | string | null, > completed_at?: string | string | null, > deadline?: string | string, > metrics?: { > }, > urls?: { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > }[] > ``` *** ### get `models.get` Get model details **Risk:** `read` ```ts theme={null} await corsair.replicate.api.models.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `visibility` | `public \| private` | No | — | | `url` | `string` | No | — | | `github_url` | `string` | No | — | | `paper_url` | `string` | No | — | | `license_url` | `string` | No | — | | `cover_image_url` | `string` | No | — | | `run_count` | `number` | No | — | | `is_official` | `boolean` | No | — | | `default_example` | `any` | No | — | | `latest_version` | `any` | No | — | *** ### list `models.list` List public models **Risk:** `read` ```ts theme={null} await corsair.replicate.api.models.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `sort_by` | `model_created_at \| latest_version_created_at` | No | — | | `sort_direction` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > owner: string, > name: string, > description?: string | null, > visibility?: public | private, > url?: string, > github_url?: string | null, > paper_url?: string | null, > license_url?: string | null, > cover_image_url?: string | null, > run_count?: number, > is_official?: boolean, > default_example?: any | null, > latest_version?: any | null > }[] > ``` *** ### predictionsCreate `models.predictionsCreate` Create official model prediction **Risk:** `write` ```ts theme={null} await corsair.replicate.api.models.predictionsCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `input` | `object` | Yes | — | | `stream` | `boolean` | No | — | | `webhook` | `string` | No | — | | `webhook_events_filter` | `start \| output \| logs \| completed[]` | No | — | | `prefer` | `string` | No | — | | `cancelAfter` | `string` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `starting \| processing \| succeeded \| failed \| canceled \| aborted` | Yes | — | | `model` | `string` | No | — | | `version` | `string` | No | — | | `deployment` | `string` | No | — | | `input` | `object` | No | — | | `output` | `any` | No | — | | `error` | `string` | No | — | | `logs` | `string` | No | — | | `source` | `api \| web` | No | — | | `data_removed` | `boolean` | No | — | | `created_at` | `string \| string` | No | — | | `started_at` | `string \| string` | No | — | | `completed_at` | `string \| string` | No | — | | `deadline` | `string \| string` | No | — | | `metrics` | `object` | No | — | | `urls` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` > **metrics full type** > > ```ts theme={null} > { > } > ``` > **urls full type** > > ```ts theme={null} > { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > ``` *** ### readmeGet `models.readmeGet` Get model README **Risk:** `read` ```ts theme={null} await corsair.replicate.api.models.readmeGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output:** `string` *** ### update `models.update` Update model metadata **Risk:** `write` ```ts theme={null} await corsair.replicate.api.models.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `readme` | `string` | No | — | | `github_url` | `string` | No | — | | `paper_url` | `string` | No | — | | `weights_url` | `string` | No | — | | `license_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `visibility` | `public \| private` | No | — | | `url` | `string` | No | — | | `github_url` | `string` | No | — | | `paper_url` | `string` | No | — | | `license_url` | `string` | No | — | | `cover_image_url` | `string` | No | — | | `run_count` | `number` | No | — | | `is_official` | `boolean` | No | — | | `default_example` | `any` | No | — | | `latest_version` | `any` | No | — | *** ### versionsGet `models.versionsGet` Get model version **Risk:** `read` ```ts theme={null} await corsair.replicate.api.models.versionsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `versionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `created_at` | `string \| string` | Yes | — | | `cog_version` | `string` | No | — | | `openapi_schema` | `any` | No | — | *** ### versionsList `models.versionsList` List model versions **Risk:** `read` ```ts theme={null} await corsair.replicate.api.models.versionsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > created_at: string | string, > cog_version?: string | null, > openapi_schema?: any | null > }[] > ``` *** ## Predictions ### cancel `predictions.cancel` Cancel prediction **Risk:** `write` ```ts theme={null} await corsair.replicate.api.predictions.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `predictionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `starting \| processing \| succeeded \| failed \| canceled \| aborted` | Yes | — | | `model` | `string` | No | — | | `version` | `string` | No | — | | `deployment` | `string` | No | — | | `input` | `object` | No | — | | `output` | `any` | No | — | | `error` | `string` | No | — | | `logs` | `string` | No | — | | `source` | `api \| web` | No | — | | `data_removed` | `boolean` | No | — | | `created_at` | `string \| string` | No | — | | `started_at` | `string \| string` | No | — | | `completed_at` | `string \| string` | No | — | | `deadline` | `string \| string` | No | — | | `metrics` | `object` | No | — | | `urls` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` > **metrics full type** > > ```ts theme={null} > { > } > ``` > **urls full type** > > ```ts theme={null} > { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > ``` *** ### create `predictions.create` Create prediction by version **Risk:** `write` ```ts theme={null} await corsair.replicate.api.predictions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object` | Yes | — | | `stream` | `boolean` | No | — | | `webhook` | `string` | No | — | | `webhook_events_filter` | `start \| output \| logs \| completed[]` | No | — | | `prefer` | `string` | No | — | | `cancelAfter` | `string` | No | — | | `version` | `string` | Yes | — | > **input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `starting \| processing \| succeeded \| failed \| canceled \| aborted` | Yes | — | | `model` | `string` | No | — | | `version` | `string` | No | — | | `deployment` | `string` | No | — | | `input` | `object` | No | — | | `output` | `any` | No | — | | `error` | `string` | No | — | | `logs` | `string` | No | — | | `source` | `api \| web` | No | — | | `data_removed` | `boolean` | No | — | | `created_at` | `string \| string` | No | — | | `started_at` | `string \| string` | No | — | | `completed_at` | `string \| string` | No | — | | `deadline` | `string \| string` | No | — | | `metrics` | `object` | No | — | | `urls` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` > **metrics full type** > > ```ts theme={null} > { > } > ``` > **urls full type** > > ```ts theme={null} > { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > ``` *** ### get `predictions.get` Get prediction status **Risk:** `read` ```ts theme={null} await corsair.replicate.api.predictions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `predictionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `starting \| processing \| succeeded \| failed \| canceled \| aborted` | Yes | — | | `model` | `string` | No | — | | `version` | `string` | No | — | | `deployment` | `string` | No | — | | `input` | `object` | No | — | | `output` | `any` | No | — | | `error` | `string` | No | — | | `logs` | `string` | No | — | | `source` | `api \| web` | No | — | | `data_removed` | `boolean` | No | — | | `created_at` | `string \| string` | No | — | | `started_at` | `string \| string` | No | — | | `completed_at` | `string \| string` | No | — | | `deadline` | `string \| string` | No | — | | `metrics` | `object` | No | — | | `urls` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` > **metrics full type** > > ```ts theme={null} > { > } > ``` > **urls full type** > > ```ts theme={null} > { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > ``` *** ### list `predictions.list` List predictions **Risk:** `read` ```ts theme={null} await corsair.replicate.api.predictions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `created_after` | `string` | No | — | | `created_before` | `string` | No | — | | `source` | `web` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > status: starting | processing | succeeded | failed | canceled | aborted, > model?: string, > version?: string, > deployment?: string, > input?: { > }, > output?: any, > error?: string | null, > logs?: string, > source?: api | web, > data_removed?: boolean, > created_at?: string | string, > started_at?: string | string | null, > completed_at?: string | string | null, > deadline?: string | string, > metrics?: { > }, > urls?: { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > }[] > ``` *** ## Search ### search `search.search` Search models, collections, and docs **Risk:** `read` ```ts theme={null} await corsair.replicate.api.search.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `models` | `object[]` | Yes | — | | `collections` | `object[]` | Yes | — | | `pages` | `object[]` | Yes | — | > **models full type** > > ```ts theme={null} > { > model: { > owner: string, > name: string, > description?: string | null, > visibility?: public | private, > url?: string, > github_url?: string | null, > paper_url?: string | null, > license_url?: string | null, > cover_image_url?: string | null, > run_count?: number, > is_official?: boolean, > default_example?: any | null, > latest_version?: any | null > }, > metadata: { > } > }[] > ``` > **collections full type** > > ```ts theme={null} > { > slug: string, > name: string > }[] > ``` > **pages full type** > > ```ts theme={null} > { > title?: string > }[] > ``` *** ## Trainings ### cancel `trainings.cancel` Cancel training job **Risk:** `write` ```ts theme={null} await corsair.replicate.api.trainings.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `trainingId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `starting \| processing \| succeeded \| failed \| canceled \| aborted` | Yes | — | | `model` | `string` | No | — | | `version` | `string` | No | — | | `input` | `object` | No | — | | `output` | `object` | No | — | | `error` | `string` | No | — | | `logs` | `string` | No | — | | `source` | `api \| web` | No | — | | `created_at` | `string \| string` | No | — | | `started_at` | `string \| string` | No | — | | `completed_at` | `string \| string` | No | — | | `urls` | `object` | No | — | | `metrics` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` > **output full type** > > ```ts theme={null} > { > version?: string, > weights?: string > } > ``` > **urls full type** > > ```ts theme={null} > { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > ``` > **metrics full type** > > ```ts theme={null} > { > } > ``` *** ### create `trainings.create` Create training job **Risk:** `write` ```ts theme={null} await corsair.replicate.api.trainings.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `owner` | `string` | Yes | — | | `name` | `string` | Yes | — | | `versionId` | `string` | Yes | — | | `destination` | `string` | Yes | — | | `input` | `object` | Yes | — | | `webhook` | `string` | No | — | | `webhook_events_filter` | `start \| output \| logs \| completed[]` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `starting \| processing \| succeeded \| failed \| canceled \| aborted` | Yes | — | | `model` | `string` | No | — | | `version` | `string` | No | — | | `input` | `object` | No | — | | `output` | `object` | No | — | | `error` | `string` | No | — | | `logs` | `string` | No | — | | `source` | `api \| web` | No | — | | `created_at` | `string \| string` | No | — | | `started_at` | `string \| string` | No | — | | `completed_at` | `string \| string` | No | — | | `urls` | `object` | No | — | | `metrics` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` > **output full type** > > ```ts theme={null} > { > version?: string, > weights?: string > } > ``` > **urls full type** > > ```ts theme={null} > { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > ``` > **metrics full type** > > ```ts theme={null} > { > } > ``` *** ### get `trainings.get` Get training job details **Risk:** `read` ```ts theme={null} await corsair.replicate.api.trainings.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `trainingId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `starting \| processing \| succeeded \| failed \| canceled \| aborted` | Yes | — | | `model` | `string` | No | — | | `version` | `string` | No | — | | `input` | `object` | No | — | | `output` | `object` | No | — | | `error` | `string` | No | — | | `logs` | `string` | No | — | | `source` | `api \| web` | No | — | | `created_at` | `string \| string` | No | — | | `started_at` | `string \| string` | No | — | | `completed_at` | `string \| string` | No | — | | `urls` | `object` | No | — | | `metrics` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > } > ``` > **output full type** > > ```ts theme={null} > { > version?: string, > weights?: string > } > ``` > **urls full type** > > ```ts theme={null} > { > get?: string, > cancel?: string, > web?: string, > stream?: string > } > ``` > **metrics full type** > > ```ts theme={null} > { > } > ``` *** ### list `trainings.list` List training jobs **Risk:** `read` ```ts theme={null} await corsair.replicate.api.trainings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > status: starting | processing | succeeded | failed | canceled | aborted, > model?: string, > version?: string, > input?: { > }, > output?: { > version?: string, > weights?: string > }, > error?: string | null, > logs?: string, > source?: api | web, > created_at?: string | string, > started_at?: string | string | null, > completed_at?: string | string | null, > urls?: { > get?: string, > cancel?: string, > web?: string, > stream?: string > }, > metrics?: { > } > }[] > ``` *** ## Webhooks ### defaultSecretGet `webhooks.defaultSecretGet` Get default webhook signing secret **Risk:** `read` ```ts theme={null} await corsair.replicate.api.webhooks.defaultSecretGet({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `key` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/replicate/database Replicate local sync: searchable entities, `.search()` filters, and operators. The Replicate plugin syncs data locally. Use `corsair.replicate.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/replicate/overview Replicate plugin for Corsair Use **Replicate** through Corsair: one client, typed API calls. **What you get:** * 31 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/replicate ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/replicate ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/replicate ``` ```bash bun theme={null} bun add corsair @corsair-dev/replicate ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { replicate } from '@corsair-dev/replicate'; export const corsair = createCorsair({ plugins: [ replicate(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} replicate() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'replicate', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.replicate.api.account.get({}); ``` **`deployments.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.replicate.api.deployments.create({}); ``` See the full list on the [API](/plugins/replicate/api) page. ## What's next > **[API reference](/plugins/replicate/api)** > > Every `replicate.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/replyio/api API reference for Reply.io: every `replyio.api.*` operation with input and output types. Every `replyio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Contact Lists ### list `contactLists.list` List contact lists with pagination **Risk:** `read` ```ts theme={null} await corsair.replyio.api.contactLists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `search` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `hasMore` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > name: string, > isShared: boolean > }[] > ``` *** ## Contacts ### clearStatus `contacts.clearStatus` Clear clearable contact statuses (opt-out, replied, bounced) **Risk:** `write` ```ts theme={null} await corsair.replyio.api.contacts.clearStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactIds` | `number[]` | Yes | — | | `statuses` | `optedOut \| replied \| bounced[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### create `contacts.create` Create a new contact in Reply.io **Risk:** `write` ```ts theme={null} await corsair.replyio.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `phone` | `string` | No | — | | `phone2` | `string` | No | — | | `title` | `string` | No | — | | `company` | `string` | No | — | | `companySize` | `Empty \| SelfEmployed \| Ten \| Fifty \| TwoHundred \| FiveHundred \| OneThousand \| FiveThousand \| TenThousand \| OverTenThousand` | No | — | | `industry` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `timeZoneId` | `string` | No | — | | `linkedInUrl` | `string` | No | — | | `linkedInSalesNavigatorUrl` | `string` | No | — | | `linkedInRecruiterUrl` | `string` | No | — | | `notes` | `string` | No | — | | `accountId` | `number` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > key: string, > value?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `email` | `string` | No | — | | `domain` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `phone` | `string` | No | — | | `title` | `string` | No | — | | `company` | `string` | No | — | | `companySize` | `string` | No | — | | `industry` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `timeZoneId` | `string` | No | — | | `linkedInUrl` | `string` | No | — | | `linkedInSalesNavigatorUrl` | `string` | No | — | | `linkedInRecruiterUrl` | `string` | No | — | | `phoneStatus` | `pending \| invalid \| valid \| validationFailed \| notValidated` | No | — | | `notes` | `string` | No | — | | `ownerUserId` | `number` | No | — | | `accountId` | `number` | No | — | | `isOptedOut` | `boolean` | No | — | | `callStatus` | `none \| toCall \| called` | No | — | | `meetingStatus` | `none \| meetingBooked` | No | — | | `addingDate` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModifiedAt` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > key: string, > value?: string | null > }[] > ``` *** ### delete `contacts.delete` Delete a contact \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.replyio.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `contacts.get` Get a contact by ID **Risk:** `read` ```ts theme={null} await corsair.replyio.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `email` | `string` | No | — | | `domain` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `phone` | `string` | No | — | | `title` | `string` | No | — | | `company` | `string` | No | — | | `companySize` | `string` | No | — | | `industry` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `timeZoneId` | `string` | No | — | | `linkedInUrl` | `string` | No | — | | `linkedInSalesNavigatorUrl` | `string` | No | — | | `linkedInRecruiterUrl` | `string` | No | — | | `phoneStatus` | `pending \| invalid \| valid \| validationFailed \| notValidated` | No | — | | `notes` | `string` | No | — | | `ownerUserId` | `number` | No | — | | `accountId` | `number` | No | — | | `isOptedOut` | `boolean` | No | — | | `callStatus` | `none \| toCall \| called` | No | — | | `meetingStatus` | `none \| meetingBooked` | No | — | | `addingDate` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModifiedAt` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > key: string, > value?: string | null > }[] > ``` *** ### getStatus `contacts.getStatus` Get a contact's statuses across sequences **Risk:** `read` ```ts theme={null} await corsair.replyio.api.contacts.getStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `number` | Yes | — | | `isOptedOut` | `boolean` | Yes | — | | `callStatus` | `none \| toCall \| called` | Yes | — | | `meetingStatus` | `none \| meetingBooked` | Yes | — | | `sequences` | `object[]` | Yes | — | > **sequences full type** > > ```ts theme={null} > { > sequenceId: number, > sequenceName: string, > statusInSequence: active | paused | inactive | invalidEmail | outOfOffice | finished | contacted | opened | clicked | autoReplied | bounced | replied, > emailDisposition: { > isReplied: boolean, > isBounced: boolean > } > }[] > ``` *** ### list `contacts.list` List contacts with pagination and optional filters **Risk:** `read` ```ts theme={null} await corsair.replyio.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `email` | `string` | No | — | | `linkedIn` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `hasMore` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > email?: string | null, > domain?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > title?: string | null, > company?: string | null, > companySize?: string | null, > industry?: string | null, > city?: string | null, > state?: string | null, > country?: string | null, > timeZoneId?: string | null, > linkedInUrl?: string | null, > linkedInSalesNavigatorUrl?: string | null, > linkedInRecruiterUrl?: string | null, > phoneStatus?: pending | invalid | valid | validationFailed | notValidated | null, > notes?: string | null, > ownerUserId?: number | null, > accountId?: number | null, > isOptedOut?: boolean, > callStatus?: none | toCall | called | null, > meetingStatus?: none | meetingBooked | null, > addingDate?: string | null, > createdAt?: string | null, > lastModifiedAt?: string | null, > customFields?: { > key: string, > value?: string | null > }[] > }[] > ``` *** ### searchByEmail `contacts.searchByEmail` Search contacts by exact email address **Risk:** `read` ```ts theme={null} await corsair.replyio.api.contacts.searchByEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `hasMore` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > email?: string | null, > domain?: string | null, > firstName?: string | null, > lastName?: string | null, > phone?: string | null, > title?: string | null, > company?: string | null, > companySize?: string | null, > industry?: string | null, > city?: string | null, > state?: string | null, > country?: string | null, > timeZoneId?: string | null, > linkedInUrl?: string | null, > linkedInSalesNavigatorUrl?: string | null, > linkedInRecruiterUrl?: string | null, > phoneStatus?: pending | invalid | valid | validationFailed | notValidated | null, > notes?: string | null, > ownerUserId?: number | null, > accountId?: number | null, > isOptedOut?: boolean, > callStatus?: none | toCall | called | null, > meetingStatus?: none | meetingBooked | null, > addingDate?: string | null, > createdAt?: string | null, > lastModifiedAt?: string | null, > customFields?: { > key: string, > value?: string | null > }[] > }[] > ``` *** ### setStatus `contacts.setStatus` Set contacts' in-sequence status in bulk **Risk:** `write` ```ts theme={null} await corsair.replyio.api.contacts.setStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | | `contactIds` | `number[]` | Yes | — | | `statusInSequence` | `active \| paused \| finished \| outOfOffice` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### update `contacts.update` Update an existing contact **Risk:** `write` ```ts theme={null} await corsair.replyio.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `email` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `phone` | `string` | No | — | | `phone2` | `string` | No | — | | `title` | `string` | No | — | | `company` | `string` | No | — | | `companySize` | `Empty \| SelfEmployed \| Ten \| Fifty \| TwoHundred \| FiveHundred \| OneThousand \| FiveThousand \| TenThousand \| OverTenThousand` | No | — | | `industry` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `timeZoneId` | `string` | No | — | | `linkedInUrl` | `string` | No | — | | `linkedInSalesNavigatorUrl` | `string` | No | — | | `linkedInRecruiterUrl` | `string` | No | — | | `notes` | `string` | No | — | | `accountId` | `number` | No | — | | `isOptedOut` | `boolean` | No | — | | `callStatus` | `none \| toCall \| called` | No | — | | `meetingStatus` | `none \| meetingBooked` | No | — | | `ownerUserId` | `number` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > id?: number, > name?: string, > value?: string | null > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `email` | `string` | No | — | | `domain` | `string` | No | — | | `firstName` | `string` | No | — | | `lastName` | `string` | No | — | | `phone` | `string` | No | — | | `title` | `string` | No | — | | `company` | `string` | No | — | | `companySize` | `string` | No | — | | `industry` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `timeZoneId` | `string` | No | — | | `linkedInUrl` | `string` | No | — | | `linkedInSalesNavigatorUrl` | `string` | No | — | | `linkedInRecruiterUrl` | `string` | No | — | | `phoneStatus` | `pending \| invalid \| valid \| validationFailed \| notValidated` | No | — | | `notes` | `string` | No | — | | `ownerUserId` | `number` | No | — | | `accountId` | `number` | No | — | | `isOptedOut` | `boolean` | No | — | | `callStatus` | `none \| toCall \| called` | No | — | | `meetingStatus` | `none \| meetingBooked` | No | — | | `addingDate` | `string` | No | — | | `createdAt` | `string` | No | — | | `lastModifiedAt` | `string` | No | — | | `customFields` | `object[]` | No | — | > **customFields full type** > > ```ts theme={null} > { > key: string, > value?: string | null > }[] > ``` *** ## Email Accounts ### connectGmail `emailAccounts.connectGmail` Get the Gmail OAuth connect URL for the user to open **Risk:** `write` ```ts theme={null} await corsair.replyio.api.emailAccounts.connectGmail({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `provider` | `gmail` | Yes | — | *** ### connectOffice365 `emailAccounts.connectOffice365` Get the Microsoft 365 OAuth connect URL for the user to open **Risk:** `write` ```ts theme={null} await corsair.replyio.api.emailAccounts.connectOffice365({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `provider` | `office-365` | Yes | — | *** ### delete `emailAccounts.delete` Delete an email account \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.replyio.api.emailAccounts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### list `emailAccounts.list` List email accounts with pagination **Risk:** `read` ```ts theme={null} await corsair.replyio.api.emailAccounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `my` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `hasMore` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > ownerUserId?: number | null, > email: string, > senderName?: string | null, > emailAccountType: custom | gmail | outlook | exchange | exchangeOnPremise, > isDefault?: boolean, > dailyLimit?: number | null, > connectionStatus: unknown | connected | disconnected, > tags?: string[] > }[] > ``` *** ### listDisconnected `emailAccounts.listDisconnected` List email accounts disconnected by auth or connection errors **Risk:** `read` ```ts theme={null} await corsair.replyio.api.emailAccounts.listDisconnected({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `hasMore` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > ownerUserId?: number | null, > email: string, > senderName?: string | null, > emailAccountType: custom | gmail | outlook | exchange | exchangeOnPremise, > isDefault?: boolean, > dailyLimit?: number | null, > connectionStatus: unknown | connected | disconnected, > tags?: string[] > }[] > ``` *** ### update `emailAccounts.update` Update an email account with custom SMTP/IMAP settings **Risk:** `write` ```ts theme={null} await corsair.replyio.api.emailAccounts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `connection` | `object` | No | — | | `safety` | `object` | No | — | | `signature` | `object` | No | — | | `optOut` | `object` | No | — | | `rampUp` | `object` | No | — | | `tags` | `string[]` | No | — | > **connection full type** > > ```ts theme={null} > { > email?: string, > senderName?: string, > smtpHost?: string, > smtpPort?: number, > smtpPassword?: string, > smtpSsl?: boolean, > imapHost?: string, > imapPort?: number, > imapPassword?: string, > imapSsl?: boolean > } > ``` > **safety full type** > > ```ts theme={null} > { > dailyLimit?: number, > isEmailsThrottlingEnabled?: boolean, > emailsPerInterval?: number, > emailsThrottlingSecondsInterval?: number, > isSendingDelayEnabled?: boolean, > maxSendingDelaySeconds?: number, > minSendingDelaySeconds?: number > } > ``` > **signature full type** > > ```ts theme={null} > { > signature?: string > } > ``` > **optOut full type** > > ```ts theme={null} > { > message?: string, > emailFooter?: string, > isOptOutLinkEnabled?: boolean, > optOutTextBlock?: string > } > ``` > **rampUp full type** > > ```ts theme={null} > { > enabled?: boolean, > startValue?: number, > incrementValue?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `ownerUserId` | `number` | No | — | | `email` | `string` | Yes | — | | `senderName` | `string` | No | — | | `emailAccountType` | `custom \| gmail \| outlook \| exchange \| exchangeOnPremise` | Yes | — | | `isDefault` | `boolean` | No | — | | `dailyLimit` | `number` | No | — | | `connectionStatus` | `unknown \| connected \| disconnected` | Yes | — | | `tags` | `string[]` | No | — | | `isInUse` | `boolean` | No | — | | `sendingConnectivityError` | `string` | No | — | | `receivingConnectivityError` | `string` | No | — | | `sendingLockedByProvider` | `boolean` | No | — | | `updatedAt` | `string` | No | — | *** ## Schedules ### delete `schedules.delete` Delete a sending schedule \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.replyio.api.schedules.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ## Sequence Contacts ### add `sequenceContacts.add` Add contacts to a sequence in bulk **Risk:** `write` ```ts theme={null} await corsair.replyio.api.sequenceContacts.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | | `contactIds` | `number[]` | Yes | — | | `removeFromExisting` | `boolean` | No | — | | `startStepId` | `number` | No | — | | `ignoreStepDelay` | `boolean` | No | — | | `startFrom` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `added` | `number[]` | Yes | — | | `notProcessed` | `object` | Yes | — | > **notProcessed full type** > > ```ts theme={null} > { > } > ``` *** ### bulkRemove `sequenceContacts.bulkRemove` Remove multiple contacts from a sequence at once **Risk:** `write` ```ts theme={null} await corsair.replyio.api.sequenceContacts.bulkRemove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | | `contactIds` | `number[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requested` | `number` | Yes | — | | `removed` | `number` | Yes | — | | `notFound` | `number` | Yes | — | | `notInSequence` | `number` | Yes | — | | `removedIds` | `number[]` | Yes | — | *** ### listExtended `sequenceContacts.listExtended` List sequence contacts with extended engagement state **Risk:** `read` ```ts theme={null} await corsair.replyio.api.sequenceContacts.listExtended({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `additionalColumns` | `CurrentStep \| LastStepCompletedAt \| Status[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `hasMore` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > contactId: number, > email?: string | null, > firstName?: string | null, > lastName?: string | null, > title?: string | null, > addedAt?: string | null, > currentStep?: { > stepId: number, > displayStepNumber?: string | null, > stepNumber?: number | null > } | null, > lastStepCompletedAt?: string | null, > status?: { > status: string, > replied?: boolean, > delivered?: boolean, > bounced?: boolean, > opened?: boolean, > clicked?: boolean > } | null > }[] > ``` *** ### remove `sequenceContacts.remove` Remove a contact from a sequence **Risk:** `write` ```ts theme={null} await corsair.replyio.api.sequenceContacts.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | | `contactId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### setStatus `sequenceContacts.setStatus` Set contacts' status for enrollments in a specific sequence **Risk:** `write` ```ts theme={null} await corsair.replyio.api.sequenceContacts.setStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | | `contactIds` | `number[]` | Yes | — | | `statusInSequence` | `active \| paused \| finished \| outOfOffice` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Sequences ### archive `sequences.archive` Archive a sequence and remove its contacts **Risk:** `write` ```ts theme={null} await corsair.replyio.api.sequences.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `ownerUserId` | `number` | No | — | | `name` | `string` | Yes | — | | `created` | `string` | No | — | | `status` | `new \| active \| paused` | Yes | — | | `isArchived` | `boolean` | Yes | — | | `health` | `healthy \| stalled \| degraded \| blocked` | No | — | | `scheduleId` | `number` | No | — | | `emailAccounts` | `object[]` | No | — | | `linkedInAccounts` | `object[]` | No | — | | `settings` | `object` | No | — | | `steps` | `object[]` | No | — | > **emailAccounts full type** > > ```ts theme={null} > { > id: number, > email: string > }[] > ``` > **linkedInAccounts full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > profileUrl?: string | null, > status?: string | null > }[] > ``` > **settings full type** > > ```ts theme={null} > { > } > ``` > **steps full type** > > ```ts theme={null} > { > id?: number, > type?: string > }[] > ``` *** ### delete `sequences.delete` Delete a sequence \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.replyio.api.sequences.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `sequences.get` Get a sequence by ID with settings and steps **Risk:** `read` ```ts theme={null} await corsair.replyio.api.sequences.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `ownerUserId` | `number` | No | — | | `name` | `string` | Yes | — | | `created` | `string` | No | — | | `status` | `new \| active \| paused` | Yes | — | | `isArchived` | `boolean` | Yes | — | | `health` | `healthy \| stalled \| degraded \| blocked` | No | — | | `scheduleId` | `number` | No | — | | `emailAccounts` | `object[]` | No | — | | `linkedInAccounts` | `object[]` | No | — | | `settings` | `object` | No | — | | `steps` | `object[]` | No | — | > **emailAccounts full type** > > ```ts theme={null} > { > id: number, > email: string > }[] > ``` > **linkedInAccounts full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > profileUrl?: string | null, > status?: string | null > }[] > ``` > **settings full type** > > ```ts theme={null} > { > } > ``` > **steps full type** > > ```ts theme={null} > { > id?: number, > type?: string > }[] > ``` *** ### list `sequences.list` List sequences with pagination and optional filters **Risk:** `read` ```ts theme={null} await corsair.replyio.api.sequences.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top` | `number` | No | — | | `skip` | `number` | No | — | | `status` | `active \| paused \| new` | No | — | | `ownerUserId` | `number` | No | — | | `folderId` | `string` | No | — | | `isArchived` | `boolean` | No | — | | `name` | `string` | No | — | | `createdAfter` | `string` | No | — | | `sortBy` | `created \| name \| status` | No | — | | `sortDirection` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `hasMore` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > ownerUserId?: number | null, > name: string, > created?: string | null, > status: new | active | paused, > isArchived: boolean, > health?: healthy | stalled | degraded | blocked | null > }[] > ``` *** ### pause `sequences.pause` Pause a running sequence **Risk:** `write` ```ts theme={null} await corsair.replyio.api.sequences.pause({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `ownerUserId` | `number` | No | — | | `name` | `string` | Yes | — | | `created` | `string` | No | — | | `status` | `new \| active \| paused` | Yes | — | | `isArchived` | `boolean` | Yes | — | | `health` | `healthy \| stalled \| degraded \| blocked` | No | — | | `scheduleId` | `number` | No | — | | `emailAccounts` | `object[]` | No | — | | `linkedInAccounts` | `object[]` | No | — | | `settings` | `object` | No | — | | `steps` | `object[]` | No | — | > **emailAccounts full type** > > ```ts theme={null} > { > id: number, > email: string > }[] > ``` > **linkedInAccounts full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > profileUrl?: string | null, > status?: string | null > }[] > ``` > **settings full type** > > ```ts theme={null} > { > } > ``` > **steps full type** > > ```ts theme={null} > { > id?: number, > type?: string > }[] > ``` *** ### start `sequences.start` Start a sequence in New or Paused status **Risk:** `write` ```ts theme={null} await corsair.replyio.api.sequences.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `ownerUserId` | `number` | No | — | | `name` | `string` | Yes | — | | `created` | `string` | No | — | | `status` | `new \| active \| paused` | Yes | — | | `isArchived` | `boolean` | Yes | — | | `health` | `healthy \| stalled \| degraded \| blocked` | No | — | | `scheduleId` | `number` | No | — | | `emailAccounts` | `object[]` | No | — | | `linkedInAccounts` | `object[]` | No | — | | `settings` | `object` | No | — | | `steps` | `object[]` | No | — | > **emailAccounts full type** > > ```ts theme={null} > { > id: number, > email: string > }[] > ``` > **linkedInAccounts full type** > > ```ts theme={null} > { > id: number, > name?: string | null, > profileUrl?: string | null, > status?: string | null > }[] > ``` > **settings full type** > > ```ts theme={null} > { > } > ``` > **steps full type** > > ```ts theme={null} > { > id?: number, > type?: string > }[] > ``` *** ## Steps ### create `steps.create` Add a new step to a sequence **Risk:** `write` ```ts theme={null} await corsair.replyio.api.steps.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | | `step` | `object` | Yes | — | > **step full type** > > ```ts theme={null} > { > type: email, > delayInMinutes: number, > executionMode: automatic | manual, > variants: { > subject?: string, > message?: string, > attachmentIds?: number[] > }[] > } | { > type: linkedIn, > actionType: message | connect | inMail | viewProfile | endorseSkills | voiceMessage | likeRecentPosts | followProfile | commentOnRecentPost, > delayInMinutes: number > } | { > type: call, > delayInMinutes: number > } | { > type: sms, > delayInMinutes: number, > executionMode: automatic | manual, > message: string > } | { > type: whatsApp, > delayInMinutes: number, > message: string > } | { > type: zapier, > delayInMinutes: number, > name: string, > action: immediately | wait > } | { > type: task, > delayInMinutes: number, > actionType: toDo | meeting, > description: string > } | { > type: condition, > delayInMinutes: number, > waitInMinutes: number, > conditions: { > property: string, > rules: { > operator: string, > value: string > }[] > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `type` | `email \| linkedIn \| call \| sms \| whatsApp \| zapier \| task \| condition` | Yes | — | | `parentId` | `number` | No | — | | `ifConditionPositive` | `boolean` | No | — | | `delayInMinutes` | `number` | No | — | *** ### get `steps.get` Get a sequence step by ID **Risk:** `read` ```ts theme={null} await corsair.replyio.api.steps.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | | `stepId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `type` | `email \| linkedIn \| call \| sms \| whatsApp \| zapier \| task \| condition` | Yes | — | | `parentId` | `number` | No | — | | `ifConditionPositive` | `boolean` | No | — | | `delayInMinutes` | `number` | No | — | *** ### list `steps.list` List all steps in a sequence **Risk:** `read` ```ts theme={null} await corsair.replyio.api.steps.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sequenceId` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > type: email | linkedIn | call | sms | whatsApp | zapier | task | condition, > parentId?: number | null, > ifConditionPositive?: boolean | null, > delayInMinutes?: number | null > }[] > ``` *** ## Users ### getCurrent `users.getCurrent` Get the current authenticated user and verify the API key **Risk:** `read` ```ts theme={null} await corsair.replyio.api.users.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `number` | Yes | — | | `username` | `string` | Yes | — | | `teamId` | `number` | Yes | — | *** ### listTeam `users.listTeam` List users on the current team **Risk:** `read` ```ts theme={null} await corsair.replyio.api.users.listTeam({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > teamId: number, > teamName: string, > userId: number, > userName: string, > userEmail: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/replyio/database Reply.io local sync: searchable entities, `.search()` filters, and operators. The Reply.io plugin syncs data locally. Use `corsair.replyio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/replyio/overview AI-powered sales engagement platform for contacts, multichannel sequences, email accounts, and sending schedules. Use **Reply.io** through Corsair: one client, typed API calls. **What you get:** * 33 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/replyio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/replyio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/replyio ``` ```bash bun theme={null} bun add corsair @corsair-dev/replyio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { replyio } from '@corsair-dev/replyio'; export const corsair = createCorsair({ plugins: [ replyio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} replyio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'replyio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List sequences** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.replyio.api.sequences.list({}); ``` **Create a contact** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.replyio.api.contacts.create({ email: 'prospect@example.com', firstName: 'Ada', lastName: 'Lovelace' }); ``` See the full list on the [API](/plugins/replyio/api) page. ## What's next > **[API reference](/plugins/replyio/api)** > > Every `replyio.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/resend/api API reference for Resend: every `resend.api.*` operation with input and output types. Every `resend.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Contacts ### create `contacts.create` Create a new contact **Risk:** `write` ```ts theme={null} await corsair.resend.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `unsubscribed` | `boolean` | No | — | | `properties` | `object` | No | — | | `segments` | `object[]` | No | — | | `topics` | `object[]` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` > **segments full type** > > ```ts theme={null} > { > id: string > }[] > ``` > **topics full type** > > ```ts theme={null} > { > id: string, > subscription: opt_in | opt_out > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `id` | `string` | Yes | — | *** ### delete `contacts.delete` Delete a contact \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.resend.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `contact` | `string` | No | — | | `object` | `string` | No | — | | `deleted` | `boolean` | Yes | — | *** ### get `contacts.get` Get info about a contact **Risk:** `read` ```ts theme={null} await corsair.resend.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `id` | `string` | Yes | — | | `email` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `created_at` | `Date` | No | — | | `unsubscribed` | `boolean` | No | — | *** ### list `contacts.list` List all contacts **Risk:** `read` ```ts theme={null} await corsair.resend.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `has_more` | `boolean` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > object?: string, > id: string, > email: string, > first_name?: string | null, > last_name?: string | null, > created_at?: Date | null, > unsubscribed?: boolean > }[] > ``` *** ### update `contacts.update` Update an existing contact **Risk:** `write` ```ts theme={null} await corsair.resend.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `unsubscribed` | `boolean` | No | — | | `properties` | `object` | No | — | > **properties full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `id` | `string` | Yes | — | *** ## Domains ### create `domains.create` Add a new sending domain **Risk:** `write` ```ts theme={null} await corsair.resend.api.domains.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `region` | `us-east-1 \| eu-west-1 \| sa-east-1` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `not_started \| validation \| scheduled \| ready \| error \| verified \| pending \| failed \| partially_verified \| partially_failed` | Yes | — | | `created_at` | `Date` | No | — | | `region` | `string` | No | — | *** ### delete `domains.delete` Remove a sending domain \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.resend.api.domains.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | Yes | — | | `deleted` | `boolean` | Yes | — | *** ### get `domains.get` Get info about a sending domain **Risk:** `read` ```ts theme={null} await corsair.resend.api.domains.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `not_started \| validation \| scheduled \| ready \| error \| verified \| pending \| failed \| partially_verified \| partially_failed` | Yes | — | | `created_at` | `Date` | No | — | | `region` | `string` | No | — | *** ### list `domains.list` List all sending domains **Risk:** `read` ```ts theme={null} await corsair.resend.api.domains.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `has_more` | `boolean` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > status: not_started | validation | scheduled | ready | error | verified | pending | failed | partially_verified | partially_failed, > created_at?: Date | null, > region?: string > }[] > ``` *** ### verify `domains.verify` Trigger DNS verification for a domain **Risk:** `write` ```ts theme={null} await corsair.resend.api.domains.verify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `id` | `string` | No | — | | `records` | `object[]` | No | — | | `status` | `not_started \| validation \| scheduled \| ready \| error \| verified \| pending` | No | — | | `created_at` | `Date` | No | — | | `region` | `string` | No | — | > **records full type** > > ```ts theme={null} > { > record: string, > name: string, > type: string, > value: string, > status: not_started | validation | scheduled | ready | error | verified | pending, > ttl?: string, > priority?: number > }[] > ``` *** ## Emails ### batch `emails.batch` Send up to 100 emails in a single API call **Risk:** `write` ```ts theme={null} await corsair.resend.api.emails.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `object[]` | Yes | — | > **emails full type** > > ```ts theme={null} > { > from: string, > to: string | string[], > subject: string, > html?: string, > text?: string, > cc?: string | string[], > bcc?: string | string[], > reply_to?: string | string[], > scheduled_at?: string, > tags?: { > name: string, > value: string > }[], > headers?: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ### cancel `emails.cancel` Cancel a scheduled email **Risk:** `write` ```ts theme={null} await corsair.resend.api.emails.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `string` | No | — | | `cancelled` | `boolean` | No | — | *** ### get `emails.get` Get info about a sent email **Risk:** `read` ```ts theme={null} await corsair.resend.api.emails.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `from` | `string` | Yes | — | | `to` | `string[]` | Yes | — | | `created_at` | `Date` | No | — | | `subject` | `string` | No | — | *** ### list `emails.list` List sent emails **Risk:** `read` ```ts theme={null} await corsair.resend.api.emails.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `string` | No | — | | `has_more` | `boolean` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > from: string, > to: string[], > created_at?: Date | null, > subject?: string > }[] > ``` *** ### send `emails.send` Send an email to one or more recipients **Risk:** `write` ```ts theme={null} await corsair.resend.api.emails.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | Yes | — | | `to` | `string \| string[]` | Yes | — | | `subject` | `string` | Yes | — | | `html` | `string` | No | — | | `text` | `string` | No | — | | `cc` | `string \| string[]` | No | — | | `bcc` | `string \| string[]` | No | — | | `reply_to` | `string \| string[]` | No | — | | `scheduled_at` | `string` | No | — | | `attachments` | `object[]` | No | — | | `tags` | `object[]` | No | — | | `headers` | `object` | No | — | > **attachments full type** > > ```ts theme={null} > { > filename: string, > content: string | custom, > path?: string > }[] > ``` > **tags full type** > > ```ts theme={null} > { > name: string, > value: string > }[] > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/resend/database Resend local sync: searchable entities, `.search()` filters, and operators. The Resend plugin syncs data locally. Use `corsair.resend.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Contacts Path: `resend.db.contacts.search` ```ts theme={null} const rows = await corsair.resend.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `unsubscribed` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Domains Path: `resend.db.domains.search` ```ts theme={null} const rows = await corsair.resend.db.domains.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | | `region` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Emails Path: `resend.db.emails.search` ```ts theme={null} const rows = await corsair.resend.db.emails.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/resend/get-credentials Step-by-step instructions for obtaining Resend API keys and webhook secrets. This guide walks you through obtaining all required credentials for the Resend plugin. ## Authentication Method The Resend plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) - API key authentication ## API Key Setup ### Step 1: Get API Key 1. Log in to your [Resend account](https://resend.com) 2. Navigate to **API Keys** in the dashboard 3. Click **Create API Key** 4. Give your key a name (e.g., "Corsair Integration") 5. Select the required permissions 6. Click **Create** 7. Copy the API key immediately 8. **Important**: Store the key securely - you won't be able to see it again **Storing Credentials:** The preferred method is to store the API key in the database using the keys API: ```ts theme={null} await corsair .withTenant('default') .resend.keys.setApiKey('your-api-key'); ``` Alternatively, you can provide the key directly in the plugin configuration: ```ts corsair.ts theme={null} resend({ authType: "api_key", key: process.env.RESEND_API_KEY, }) ``` ## Webhook Secret ### Step 1: Create Webhook 1. In your Resend dashboard, go to **Webhooks** 2. Click **Add Webhook** 3. Configure: * **Webhook URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`) * **Events**: Select the events you want to receive: * `email.sent` * `email.delivered` * `email.bounced` * `email.opened` * `email.clicked` * `email.complained` * `email.failed` * `email.received` * `domain.created` * `domain.updated` 4. Click **Add Webhook** 5. After creation, copy the **Signing Secret** shown 6. Store it securely **Storing Credentials:** The preferred method is to store the webhook secret in the database using the keys API: ```ts theme={null} await corsair .withTenant('default') .resend.keys.setWebhookSignature('your-webhook-secret'); ``` Alternatively, you can provide the secret directly in the plugin configuration: ```ts corsair.ts theme={null} resend({ webhookSecret: process.env.RESEND_WEBHOOK_SECRET, }) ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Key | API Key auth | Dashboard → API Keys | | Webhook Secret | Webhooks | Dashboard → Webhooks → Signing Secret | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/resend/overview Developer email API for sending transactional messages, broadcasts, and deliverability tools. Use **Resend** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 15 typed API operations * 3 synced entities (`contacts`, `domains`, `emails`) for fast `.search()` / `.list()` * 16 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/resend ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/resend ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/resend ``` ```bash bun theme={null} bun add corsair @corsair-dev/resend ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { resend } from '@corsair-dev/resend'; export const corsair = createCorsair({ plugins: [ resend(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/resend/get-credentials). ```ts theme={null} resend() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'resend', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List emails** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.resend.api.emails.list({}); ``` **Send an email** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.resend.api.emails.send({ from: 'corsair@example.com', to: 'you@example.com', subject: 'Hello from Corsair', text: 'Hello from Corsair', }); ``` See the full list on the [API](/plugins/resend/api) page. ## Query synced data Search synced emails without hitting Resend. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.resend.db.emails.search({ data: {}, limit: 50, }); ``` Synced entities: `contacts`, `domains`, `emails`. See [Database](/plugins/resend/database) for filters and operators. ## Webhooks Fires when Resend accepts an outbound email. ```ts theme={null} resend({ webhookHooks: { emails: { sent: { after: async (ctx, result) => { console.log('Email sent:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/resend/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/resend/api)** > > Every `resend.api.*` operation with input and output types. > **[Database](/plugins/resend/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/resend/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/resend/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/resend/webhooks Resend incoming webhooks: event paths, payloads, and response data. The Resend plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/resend/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `contacts` * `created` (`contacts.created`) * `deleted` (`contacts.deleted`) * `updated` (`contacts.updated`) * `domains` * `created` (`domains.created`) * `deleted` (`domains.deleted`) * `updated` (`domains.updated`) * `emails` * `bounced` (`emails.bounced`) * `clicked` (`emails.clicked`) * `complained` (`emails.complained`) * `delivered` (`emails.delivered`) * `failed` (`emails.failed`) * `opened` (`emails.opened`) * `received` (`emails.received`) * `scheduled` (`emails.scheduled`) * `sent` (`emails.sent`) * `suppressed` (`emails.suppressed`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Contacts ### Created `contacts.created` A new contact was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `contact.created` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > email?: string, > first_name?: string | null, > last_name?: string | null, > created_at?: string, > unsubscribed?: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: contact.created, > created_at: string, > data: { > id: string, > email?: string, > first_name?: string | null, > last_name?: string | null, > created_at?: string, > unsubscribed?: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { contacts: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `contacts.deleted` A contact was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `contact.deleted` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > email?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: contact.deleted, > created_at: string, > data: { > id: string, > email?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { contacts: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `contacts.updated` A contact was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `contact.updated` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > email?: string, > first_name?: string | null, > last_name?: string | null, > created_at?: string, > unsubscribed?: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: contact.updated, > created_at: string, > data: { > id: string, > email?: string, > first_name?: string | null, > last_name?: string | null, > created_at?: string, > unsubscribed?: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { contacts: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Domains ### Created `domains.created` A new sending domain was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `domain.created` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > domain_id: string, > name: string, > status: not_started | validation | scheduled | ready | error | verified | pending | failed | partially_verified | partially_failed, > created_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: domain.created, > created_at: string, > data: { > domain_id: string, > name: string, > status: not_started | validation | scheduled | ready | error | verified | pending | failed | partially_verified | partially_failed, > created_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { domains: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `domains.deleted` A sending domain was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `domain.deleted` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: domain.deleted, > created_at: string, > data: { > id: string, > name?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { domains: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `domains.updated` A sending domain was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `domain.updated` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > domain_id: string, > name: string, > status: not_started | validation | scheduled | ready | error | verified | pending | failed | partially_verified | partially_failed, > created_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: domain.updated, > created_at: string, > data: { > domain_id: string, > name: string, > status: not_started | validation | scheduled | ready | error | verified | pending | failed | partially_verified | partially_failed, > created_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { domains: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Emails ### Bounced `emails.bounced` An email bounced and was not delivered **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.bounced` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string, > bounce_type?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.bounced, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string, > bounce_type?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { bounced: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Clicked `emails.clicked` A recipient clicked a link in an email **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.clicked` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string, > link?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.clicked, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string, > link?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { clicked: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Complained `emails.complained` A recipient marked an email as spam **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.complained` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.complained, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { complained: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Delivered `emails.delivered` An email was delivered to the recipient **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.delivered` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.delivered, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { delivered: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Failed `emails.failed` An email failed to send **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.failed` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string, > error?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.failed, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string, > error?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { failed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Opened `emails.opened` A recipient opened an email **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.opened` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.opened, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { opened: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Received `emails.received` An inbound email was received **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.received` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.received, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { received: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Scheduled `emails.scheduled` An email was scheduled to be sent **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.scheduled` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.scheduled, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { scheduled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Sent `emails.sent` An email was accepted and sent **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.sent` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.sent, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { sent: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Suppressed `emails.suppressed` An email was suppressed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `email.suppressed` | Yes | — | | `created_at` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string, > suppressed?: { > message?: string, > type?: string > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: email.suppressed, > created_at: string, > data: { > email_id: string, > from: string, > to: string[], > subject?: string, > created_at: string, > suppressed?: { > message?: string, > type?: string > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} resend({ webhookHooks: { emails: { suppressed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/retailed/api API reference for Retailed: every `retailed.api.*` operation with input and output types. Every `retailed.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Goat ### prices `goat.prices` Get GOAT product prices **Risk:** `read` ```ts theme={null} await corsair.retailed.api.goat.prices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > sizeOption: { > value: number, > presentation: string > }, > stockStatus: string, > boxCondition: string, > shoeCondition: string, > lowestPriceCents: { > currency: string > }, > lastSoldPriceCents: { > amount?: number, > currency: string, > amountUsdCents?: number > }, > instantShipLowestPriceCents: { > currency: string > } > }[] > ``` *** ## Products ### search `products.search` Search products **Risk:** `read` ```ts theme={null} await corsair.retailed.api.products.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `sku` | `string` | No | — | | `page` | `number` | No | — | | `sort` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `docs` | `object[]` | Yes | — | | `totalDocs` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `totalPages` | `number` | Yes | — | | `page` | `number` | Yes | — | | `hasPrevPage` | `boolean` | Yes | — | | `hasNextPage` | `boolean` | Yes | — | | `prevPage` | `number` | No | — | | `nextPage` | `number` | No | — | > **docs full type** > > ```ts theme={null} > { > id: string, > productId: string, > name: string, > url?: string, > domain?: string, > price?: number | null > }[] > ``` *** ## Stockx ### product `stockx.product` Get StockX product details **Risk:** `read` ```ts theme={null} await corsair.retailed.api.stockx.product({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `country` | `string` | No | — | | `language` | `string` | No | — | | `currency` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `productId` | `string` | Yes | — | | `name` | `string` | Yes | — | | `url` | `string` | No | — | | `domain` | `string` | No | — | | `price` | `number` | No | — | *** ### search `stockx.search` Search StockX products **Risk:** `read` ```ts theme={null} await corsair.retailed.api.stockx.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > productId: string, > name: string, > url?: string, > domain?: string, > price?: number | null > }[] > ``` *** ### trends `stockx.trends` Get StockX trends **Risk:** `read` ```ts theme={null} await corsair.retailed.api.stockx.trends({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `sort_by` | `featured \| most_active \| release_date` | No | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > productId: string, > name: string, > url?: string, > domain?: string, > price?: number | null > }[] > ``` *** ## Usage ### get `usage.get` Get API usage information **Risk:** `read` ```ts theme={null} await corsair.retailed.api.usage.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `plan` | `string` | Yes | — | | `remaining` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/retailed/database Retailed local sync: searchable entities, `.search()` filters, and operators. The Retailed plugin syncs data locally. Use `corsair.retailed.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Product Path: `retailed.db.product.search` ```ts theme={null} const rows = await corsair.retailed.db.product.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `productId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `price` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/retailed/overview Retail data API for product pricing, availability, and e-commerce market intelligence. Use **Retailed** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 6 typed API operations * 1 synced entity (`product`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/retailed ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/retailed ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/retailed ``` ```bash bun theme={null} bun add corsair @corsair-dev/retailed ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { retailed } from '@corsair-dev/retailed'; export const corsair = createCorsair({ plugins: [ retailed(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} retailed() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Retailed OAuth app. ```ts theme={null} retailed({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'retailed', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`goat.prices`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.retailed.api.goat.prices({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/retailed/api) reference.* See the full list on the [API](/plugins/retailed/api) page. ## Query synced data Synced entities support `tenant.retailed.db..search()` and `.list()`: `product`. See [Database](/plugins/retailed/database) for filters and operators. ## What's next > **[API reference](/plugins/retailed/api)** > > Every `retailed.api.*` operation with input and output types. > **[Database](/plugins/retailed/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/revai/api API reference for RevAI: every `revai.api.*` operation with input and output types. Every `revai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Jobs ### getJob `jobs.getJob` Get an async job **Risk:** `read` ```ts theme={null} await corsair.revai.api.jobs.getJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `in_progress \| transcribed \| failed` | No | — | | `created_on` | `string` | No | — | | `completed_on` | `string` | No | — | | `name` | `string` | No | — | | `type` | `async \| human_tc \| stream` | No | — | | `metadata` | `string` | No | — | | `media_url` | `string` | No | — | | `callback_url` | `string` | No | — | | `language` | `string` | No | — | | `transcriber` | `string` | No | — | | `failure` | `string` | No | — | | `failure_detail` | `string` | No | — | | `duration_seconds` | `number` | No | — | | `stream_duration_seconds` | `number` | No | — | | `delete_after_seconds` | `number` | No | — | | `skip_diarization` | `boolean` | No | — | | `skip_postprocessing` | `boolean` | No | — | | `skip_punctuation` | `boolean` | No | — | | `remove_disfluencies` | `boolean` | No | — | | `remove_atmospherics` | `boolean` | No | — | | `filter_profanity` | `boolean` | No | — | | `custom_vocabulary_id` | `string` | No | — | | `speaker_channels_count` | `number` | No | — | | `enable_multilingual` | `boolean` | No | — | *** ### getTranscript `jobs.getTranscript` Get transcript of a job **Risk:** `read` ```ts theme={null} await corsair.revai.api.jobs.getTranscript({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `accept` | `application/vnd.rev.transcript.v1.0+json \| text/plain` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > monologues: { > speaker?: number, > elements: { > type: string, > value: string, > ts?: number | null, > end_ts?: number | null, > confidence?: number | null > }[] > }[] > } | string > ``` *** ### submitJob `jobs.submitJob` Submit an async job **Risk:** `write` ```ts theme={null} await corsair.revai.api.jobs.submitJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_url` | `string` | Yes | — | | `metadata` | `string` | No | — | | `language` | `string` | No | — | | `notification_config` | `object` | No | — | > **notification\_config full type** > > ```ts theme={null} > { > url: string, > auth_headers?: { > Authorization: string > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `in_progress \| transcribed \| failed` | No | — | | `created_on` | `string` | No | — | | `completed_on` | `string` | No | — | | `name` | `string` | No | — | | `type` | `async \| human_tc \| stream` | No | — | | `metadata` | `string` | No | — | | `media_url` | `string` | No | — | | `callback_url` | `string` | No | — | | `language` | `string` | No | — | | `transcriber` | `string` | No | — | | `failure` | `string` | No | — | | `failure_detail` | `string` | No | — | | `duration_seconds` | `number` | No | — | | `stream_duration_seconds` | `number` | No | — | | `delete_after_seconds` | `number` | No | — | | `skip_diarization` | `boolean` | No | — | | `skip_postprocessing` | `boolean` | No | — | | `skip_punctuation` | `boolean` | No | — | | `remove_disfluencies` | `boolean` | No | — | | `remove_atmospherics` | `boolean` | No | — | | `filter_profanity` | `boolean` | No | — | | `custom_vocabulary_id` | `string` | No | — | | `speaker_channels_count` | `number` | No | — | | `enable_multilingual` | `boolean` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/revai/database RevAI local sync: searchable entities, `.search()` filters, and operators. The RevAI plugin syncs data locally. Use `corsair.revai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Job Path: `revai.db.job.search` ```ts theme={null} const rows = await corsair.revai.db.job.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `created_on` | `date` | equals, before, after, between | | `completed_on` | `date` | equals, before, after, between | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `metadata` | `string` | equals, contains, startsWith, endsWith, in | | `media_url` | `string` | equals, contains, startsWith, endsWith, in | | `callback_url` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `transcriber` | `string` | equals, contains, startsWith, endsWith, in | | `failure` | `string` | equals, contains, startsWith, endsWith, in | | `failure_detail` | `string` | equals, contains, startsWith, endsWith, in | | `duration_seconds` | `number` | equals, gt, gte, lt, lte, in | | `stream_duration_seconds` | `number` | equals, gt, gte, lt, lte, in | | `delete_after_seconds` | `number` | equals, gt, gte, lt, lte, in | | `skip_diarization` | `boolean` | equals | | `skip_postprocessing` | `boolean` | equals | | `skip_punctuation` | `boolean` | equals | | `remove_disfluencies` | `boolean` | equals | | `remove_atmospherics` | `boolean` | equals | | `filter_profanity` | `boolean` | equals | | `custom_vocabulary_id` | `string` | equals, contains, startsWith, endsWith, in | | `speaker_channels_count` | `number` | equals, gt, gte, lt, lte, in | | `enable_multilingual` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/revai/overview RevAI plugin for Corsair Use **RevAI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 3 typed API operations * 1 synced entity (`job`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/revai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/revai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/revai ``` ```bash bun theme={null} bun add corsair @corsair-dev/revai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { revai } from '@corsair-dev/revai'; export const corsair = createCorsair({ plugins: [ revai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} revai() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your RevAI OAuth app. ```ts theme={null} revai({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'revai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`jobs.getJob`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.revai.api.jobs.getJob({}); ``` **`jobs.submitJob`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.revai.api.jobs.submitJob({}); ``` See the full list on the [API](/plugins/revai/api) page. ## Query synced data Synced entities support `tenant.revai.db..search()` and `.list()`: `job`. See [Database](/plugins/revai/database) for filters and operators. ## What's next > **[API reference](/plugins/revai/api)** > > Every `revai.api.*` operation with input and output types. > **[Database](/plugins/revai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/rootly/api API reference for Rootly: every `rootly.api.*` operation with input and output types. Every `rootly.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Action Items ### delete `actionItems.delete` Delete a Rootly incident action item **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.rootly.api.actionItems.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > } > ``` *** ### get `actionItems.get` Get a Rootly incident action item **Risk:** `read` ```ts theme={null} await corsair.rootly.api.actionItems.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` *** ### list `actionItems.list` List action items for a Rootly incident **Risk:** `read` ```ts theme={null} await corsair.rootly.api.actionItems.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `incident_id` | `string` | Yes | — | | `include` | `string` | No | — | | `page_number` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `links` | `object` | No | — | | `meta` | `object` | No | — | | `included` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` > **links full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` *** ## Incidents ### delete `incidents.delete` Delete a Rootly incident **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.rootly.api.incidents.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > } > ``` *** ### get `incidents.get` Get a Rootly incident **Risk:** `read` ```ts theme={null} await corsair.rootly.api.incidents.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` *** ### update `incidents.update` Update a Rootly incident **Risk:** `write` ```ts theme={null} await corsair.rootly.api.incidents.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `kind` | `string` | No | — | | `parent_incident_id` | `string` | No | — | | `duplicate_incident_id` | `string` | No | — | | `summary` | `string` | No | — | | `private` | `boolean` | No | — | | `severity_id` | `string` | No | — | | `public_title` | `string` | No | — | | `alert_ids` | `string[]` | No | — | | `environment_ids` | `string[]` | No | — | | `incident_type_ids` | `string[]` | No | — | | `service_ids` | `string[]` | No | — | | `functionality_ids` | `string[]` | No | — | | `muted_service_ids` | `string[]` | No | — | | `cause_ids` | `string[]` | No | — | | `labels` | `object` | No | — | | `slack_channel_id` | `string` | No | — | | `slack_channel_name` | `string` | No | — | | `slack_channel_url` | `string` | No | — | | `slack_channel_archived` | `boolean` | No | — | | `google_drive_parent_id` | `string` | No | — | | `google_drive_url` | `string` | No | — | | `jira_issue_key` | `string` | No | — | | `jira_issue_id` | `string` | No | — | | `jira_issue_url` | `string` | No | — | | `scheduled_for` | `string` | No | — | | `scheduled_until` | `string` | No | — | | `in_triage_at` | `string` | No | — | | `started_at` | `string` | No | — | | `detected_at` | `string` | No | — | | `acknowledged_at` | `string` | No | — | | `mitigated_at` | `string` | No | — | | `resolved_at` | `string` | No | — | | `closed_at` | `string` | No | — | | `cancelled_at` | `string` | No | — | | `mitigation_message` | `string` | No | — | | `resolution_message` | `string` | No | — | | `cancellation_message` | `string` | No | — | > **labels full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `included` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > } > ``` > **included full type** > > ```ts theme={null} > { > id: string, > type?: string, > attributes?: { > }, > relationships?: { > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/rootly/database Rootly local sync: searchable entities, `.search()` filters, and operators. The Rootly plugin syncs data locally. Use `corsair.rootly.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/rootly/overview Rootly plugin for Corsair Use **Rootly** through Corsair: one client, typed API calls. **What you get:** * 6 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/rootly ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/rootly ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/rootly ``` ```bash bun theme={null} bun add corsair @corsair-dev/rootly ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { rootly } from '@corsair-dev/rootly'; export const corsair = createCorsair({ plugins: [ rootly(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} rootly() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'rootly', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`actionItems.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.rootly.api.actionItems.get({}); ``` **`actionItems.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.rootly.api.actionItems.delete({}); ``` See the full list on the [API](/plugins/rootly/api) page. ## What's next > **[API reference](/plugins/rootly/api)** > > Every `rootly.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Database Source: https://docs.corsair.dev/plugins/runpod/database Runpod local sync: searchable entities, `.search()` filters, and operators. The Runpod plugin syncs data locally. Use `corsair.runpod.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Clusters Path: `runpod.db.clusters.search` ```ts theme={null} const rows = await corsair.runpod.db.clusters.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Endpoints Path: `runpod.db.endpoints.search` ```ts theme={null} const rows = await corsair.runpod.db.endpoints.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `templateId` | `string` | equals, contains, startsWith, endsWith, in | | `gpuIds` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pods Path: `runpod.db.pods.search` ```ts theme={null} const rows = await corsair.runpod.db.pods.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `image` | `string` | equals, contains, startsWith, endsWith, in | | `costPerHr` | `number` | equals, gt, gte, lt, lte, in | | `memoryInGb` | `number` | equals, gt, gte, lt, lte, in | | `vcpuCount` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Registry Auths Path: `runpod.db.registryAuths.search` ```ts theme={null} const rows = await corsair.runpod.db.registryAuths.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Secrets Path: `runpod.db.secrets.search` ```ts theme={null} const rows = await corsair.runpod.db.secrets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `runpod.db.templates.search` ```ts theme={null} const rows = await corsair.runpod.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `imageName` | `string` | equals, contains, startsWith, endsWith, in | | `isServerless` | `boolean` | equals | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `runpod.db.users.search` ```ts theme={null} const rows = await corsair.runpod.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `multiFactorEnabled` | `boolean` | equals | | `pubKey` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/runpod/overview Runpod plugin for Corsair Use **Runpod** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 14 typed API operations * 7 synced entities (`clusters`, `endpoints`, `pods`, `registryAuths`, `secrets`, `templates`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/runpod ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/runpod ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/runpod ``` ```bash bun theme={null} bun add corsair @corsair-dev/runpod ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { runpod } from '@corsair-dev/runpod'; export const corsair = createCorsair({ plugins: [ runpod(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} runpod() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'runpod', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.myself`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.runpod.api.account.myself({}); ``` **`account.updateSettings`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.runpod.api.account.updateSettings({}); ``` See the full list on the [API](/plugins/runpod/api) page. ## Query synced data Synced entities support `tenant.runpod.db..search()` and `.list()`: `clusters`, `endpoints`, `pods`, `registryAuths`, `secrets`, `templates`, `users`. See [Database](/plugins/runpod/database) for filters and operators. ## What's next > **[API reference](/plugins/runpod/api)** > > Every `runpod.api.*` operation with input and output types. > **[Database](/plugins/runpod/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/salesforce/api API reference for Salesforce: every `salesforce.api.*` operation with input and output types. Every `salesforce.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### accountCreationWithContentTypeOption `accounts.accountCreationWithContentTypeOption` Create account (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.accounts.accountCreationWithContentTypeOption({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### createAccount `accounts.createAccount` Create account in Salesforce **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.accounts.createAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | Yes | — | | `Type` | `string` | No | — | | `Industry` | `string` | No | — | | `Phone` | `string` | No | — | | `Website` | `string` | No | — | | `BillingStreet` | `string` | No | — | | `BillingCity` | `string` | No | — | | `BillingState` | `string` | No | — | | `BillingPostalCode` | `string` | No | — | | `BillingCountry` | `string` | No | — | | `CustomFields` | `object` | No | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | | `errors` | `any[]` | No | — | *** ### deleteAccount `accounts.deleteAccount` Delete account **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.accounts.deleteAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### fetchAccountByIdWithQuery `accounts.fetchAccountByIdWithQuery` Fetch account by ID with query (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.accounts.fetchAccountByIdWithQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | *** ### getAccount `accounts.getAccount` Get account by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.accounts.getAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | | `Name` | `string` | No | — | *** ### listAccounts `accounts.listAccounts` List accounts **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.accounts.listAccounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `done` | `boolean` | Yes | — | | `records` | `object[]` | Yes | — | | `nextRecordsUrl` | `string` | No | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### removeAccountByUniqueIdentifier `accounts.removeAccountByUniqueIdentifier` Remove account by unique identifier (deprecated) **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.accounts.removeAccountByUniqueIdentifier({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### retrieveAccountDataAndErrorResponses `accounts.retrieveAccountDataAndErrorResponses` Retrieve account data and error responses (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.accounts.retrieveAccountDataAndErrorResponses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `objectDescribe` | `object` | No | — | > **objectDescribe full type** > > ```ts theme={null} > { > } > ``` *** ### searchAccounts `accounts.searchAccounts` Search accounts **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.accounts.searchAccounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `industry` | `string` | No | — | | `type` | `string` | No | — | | `phone` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateAccount `accounts.updateAccount` Update account **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.accounts.updateAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | No | — | | `Type` | `string` | No | — | | `Industry` | `string` | No | — | | `Phone` | `string` | No | — | | `Website` | `string` | No | — | | `BillingStreet` | `string` | No | — | | `BillingCity` | `string` | No | — | | `BillingState` | `string` | No | — | | `BillingPostalCode` | `string` | No | — | | `BillingCountry` | `string` | No | — | | `CustomFields` | `object` | No | — | | `id` | `string` | Yes | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### updateAccountObjectById `accounts.updateAccountObjectById` Update account by id (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.accounts.updateAccountObjectById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | No | — | | `Type` | `string` | No | — | | `Industry` | `string` | No | — | | `Phone` | `string` | No | — | | `Website` | `string` | No | — | | `BillingStreet` | `string` | No | — | | `BillingCity` | `string` | No | — | | `BillingState` | `string` | No | — | | `BillingPostalCode` | `string` | No | — | | `BillingCountry` | `string` | No | — | | `CustomFields` | `object` | No | — | | `id` | `string` | Yes | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Analytics Reports ### getDashboard `analyticsReports.getDashboard` Get dashboard metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.analyticsReports.getDashboard({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dashboardId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getReport `analyticsReports.getReport` Get report metadata (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.analyticsReports.getReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reportId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getReportInstance `analyticsReports.getReportInstance` Get report instance results (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.analyticsReports.getReportInstance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reportId` | `string` | Yes | — | | `instanceId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAnalyticsTemplates `analyticsReports.listAnalyticsTemplates` List CRM Analytics templates **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.analyticsReports.listAnalyticsTemplates({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `templates` | `object[]` | Yes | — | > **templates full type** > > ```ts theme={null} > { > }[] > ``` *** ### listDashboards `analyticsReports.listDashboards` List all dashboards **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.analyticsReports.listDashboards({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `dashboards` | `object[]` | Yes | — | > **dashboards full type** > > ```ts theme={null} > { > }[] > ``` *** ### listEmailTemplates `analyticsReports.listEmailTemplates` List email templates **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.analyticsReports.listEmailTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `developerName` | `string` | No | — | | `folderId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `templates` | `object[]` | Yes | — | > **templates full type** > > ```ts theme={null} > { > }[] > ``` *** ### listReports `analyticsReports.listReports` List all reports **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.analyticsReports.listReports({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `reports` | `object[]` | Yes | — | > **reports full type** > > ```ts theme={null} > { > }[] > ``` *** ### queryReport `analyticsReports.queryReport` Query report (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.analyticsReports.queryReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `reportType` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### runReport `analyticsReports.runReport` Run report and return results **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.analyticsReports.runReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reportId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Campaigns ### addContactToCampaign `campaigns.addContactToCampaign` Add contact to campaign **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.campaigns.addContactToCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaignId` | `string` | Yes | — | | `contactId` | `string` | Yes | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### addLeadToCampaign `campaigns.addLeadToCampaign` Add lead to campaign **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.campaigns.addLeadToCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | — | | `lead_id` | `string` | Yes | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createCampaign `campaigns.createCampaign` Create campaign **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.campaigns.createCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | Yes | — | | `Type` | `string` | No | — | | `Status` | `string` | No | — | | `StartDate` | `string` | No | — | | `EndDate` | `string` | No | — | | `IsActive` | `boolean` | No | — | | `ParentId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### createCampaignRecordViaPost `campaigns.createCampaignRecordViaPost` Create campaign record via POST (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.campaigns.createCampaignRecordViaPost({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | Yes | — | | `ParentId` | `string` | No | — | | `OwnerId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteCampaign `campaigns.deleteCampaign` Delete campaign **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.campaigns.deleteCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getCampaign `campaigns.getCampaign` Get campaign by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.campaigns.getCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | *** ### listCampaigns `campaigns.listCampaigns` List campaigns **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.campaigns.listCampaigns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `done` | `boolean` | Yes | — | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### removeCampaignObjectById `campaigns.removeCampaignObjectById` Remove campaign object by ID (deprecated) **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.campaigns.removeCampaignObjectById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### removeFromCampaign `campaigns.removeFromCampaign` Remove member from campaign **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.campaigns.removeFromCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `member_id` | `string` | No | — | | `campaign_member_id` | `string` | No | — | | `campaign_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### retrieveCampaignDataWithErrorHandling `campaigns.retrieveCampaignDataWithErrorHandling` Retrieve campaign data (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.campaigns.retrieveCampaignDataWithErrorHandling({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### retrieveSpecificCampaignObjectDetails `campaigns.retrieveSpecificCampaignObjectDetails` Retrieve specific campaign details (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.campaigns.retrieveSpecificCampaignObjectDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | *** ### searchCampaigns `campaigns.searchCampaigns` Search campaigns **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.campaigns.searchCampaigns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateCampaign `campaigns.updateCampaign` Update campaign **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.campaigns.updateCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | No | — | | `Type` | `string` | No | — | | `Status` | `string` | No | — | | `StartDate` | `string` | No | — | | `EndDate` | `string` | No | — | | `IsActive` | `boolean` | No | — | | `ParentId` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### updateCampaignByIdWithJson `campaigns.updateCampaignByIdWithJson` Update campaign by id (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.campaigns.updateCampaignByIdWithJson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | No | — | | `Type` | `string` | No | — | | `Status` | `string` | No | — | | `StartDate` | `string` | No | — | | `EndDate` | `string` | No | — | | `IsActive` | `boolean` | No | — | | `ParentId` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Composite ### compositeGraphAction `composite.compositeGraphAction` Execute composite graph (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.composite.compositeGraphAction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `graphs` | `object[]` | Yes | — | > **graphs full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `graphs` | `object[]` | Yes | — | > **graphs full type** > > ```ts theme={null} > { > }[] > ``` *** ### createSobjectTree `composite.createSobjectTree` Create sObject tree **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.composite.createSobjectTree({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `hasErrors` | `boolean` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### deleteSobjectCollections `composite.deleteSobjectCollections` Delete sObject collections **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.composite.deleteSobjectCollections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | | `allOrNone` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getABatchOfRecords `composite.getABatchOfRecords` Get batch of UI API records **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.composite.getABatchOfRecords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | | `fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### getCompositeResources `composite.getCompositeResources` Get composite resources **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.composite.getCompositeResources({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCompositeSobjects `composite.getCompositeSobjects` Get composite sObjects **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.composite.getCompositeSobjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | | `fields` | `string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getSobjectCollections `composite.getSobjectCollections` Get sObject collections **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.composite.getSobjectCollections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | | `fields` | `string[]` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### patchCompositeSobjects `composite.patchCompositeSobjects` Upsert records using external ID **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.composite.patchCompositeSobjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `allOrNone` | `boolean` | No | — | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** ### postCompositeGraph `composite.postCompositeGraph` Execute composite graph **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.composite.postCompositeGraph({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `graphs` | `object[]` | Yes | — | > **graphs full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `graphs` | `object[]` | Yes | — | > **graphs full type** > > ```ts theme={null} > { > }[] > ``` *** ### postCompositeSobjects `composite.postCompositeSobjects` Create records using sObject Collections **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.composite.postCompositeSobjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `allOrNone` | `boolean` | No | — | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ## Contacts ### associateContactToAccount `contacts.associateContactToAccount` Associate contact to account **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.contacts.associateContactToAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | | `accountId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### createContact `contacts.createContact` Create contact **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.contacts.createContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `LastName` | `string` | Yes | — | | `FirstName` | `string` | No | — | | `Email` | `string` | No | — | | `Phone` | `string` | No | — | | `AccountId` | `string` | No | — | | `Title` | `string` | No | — | | `CustomFields` | `object` | No | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### createNewContactWithJsonHeader `contacts.createNewContactWithJsonHeader` Create new contact with JSON header (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.contacts.createNewContactWithJsonHeader({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `LastName` | `string` | Yes | — | | `AccountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteContact `contacts.deleteContact` Delete contact **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.contacts.deleteContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getContact `contacts.getContact` Get contact by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.contacts.getContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | | `LastName` | `string` | No | — | *** ### getContactById `contacts.getContactById` Get contact by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.contacts.getContactById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | *** ### listContacts `contacts.listContacts` List contacts **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.contacts.listContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `done` | `boolean` | Yes | — | | `records` | `object[]` | Yes | — | | `nextRecordsUrl` | `string` | No | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### queryContactsByName `contacts.queryContactsByName` Query contacts by name (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.contacts.queryContactsByName({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### removeASpecificContactById `contacts.removeASpecificContactById` Remove contact by ID (deprecated) **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.contacts.removeASpecificContactById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### retrieveContactInfoWithStandardResponses `contacts.retrieveContactInfoWithStandardResponses` Retrieve contact info (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.contacts.retrieveContactInfoWithStandardResponses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### searchContacts `contacts.searchContacts` Search contacts **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.contacts.searchContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `accountId` | `string` | No | — | | `title` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateContact `contacts.updateContact` Update contact **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.contacts.updateContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `LastName` | `string` | No | — | | `FirstName` | `string` | No | — | | `Email` | `string` | No | — | | `Phone` | `string` | No | — | | `AccountId` | `string` | No | — | | `Title` | `string` | No | — | | `CustomFields` | `object` | No | — | | `id` | `string` | Yes | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### updateContactById `contacts.updateContactById` Update contact by id (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.contacts.updateContactById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `LastName` | `string` | No | — | | `FirstName` | `string` | No | — | | `Email` | `string` | No | — | | `Phone` | `string` | No | — | | `AccountId` | `string` | No | — | | `Title` | `string` | No | — | | `CustomFields` | `object` | No | — | | `id` | `string` | Yes | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Files ### deleteFile `files.deleteFile` Delete file permanently **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.files.deleteFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getFileContent `files.getFileContent` Get binary file content **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.files.getFileContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | *** ### getFileInformation `files.getFileInformation` Get file metadata information **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.files.getFileInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getFileShares `files.getFileShares` Get file shares information **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.files.getFileShares({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `shares` | `object[]` | Yes | — | > **shares full type** > > ```ts theme={null} > { > }[] > ``` *** ### uploadFile `files.uploadFile` Upload a file to Salesforce Files **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.files.uploadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `versionData` | `string` | Yes | — | | `pathOnClient` | `string` | No | — | | `firstPublishLocationId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ## Jobs ### closeOrAbortJob `jobs.closeOrAbortJob` Close or abort bulk job **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.jobs.closeOrAbortJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | | `state` | `UploadComplete \| Aborted` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `state` | `string` | Yes | — | *** ### deleteJobQuery `jobs.deleteJobQuery` Delete query job **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.jobs.deleteJobQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getJobFailedRecordResults `jobs.getJobFailedRecordResults` Get job failed record results **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.jobs.getJobFailedRecordResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### getJobSuccessfulRecordResults `jobs.getJobSuccessfulRecordResults` Get job successful record results **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.jobs.getJobSuccessfulRecordResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### getJobUnprocessedRecordResults `jobs.getJobUnprocessedRecordResults` Get job unprocessed record results **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.jobs.getJobUnprocessedRecordResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### getQueryJobInfo `jobs.getQueryJobInfo` Get query job info **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.jobs.getQueryJobInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `state` | `string` | Yes | — | *** ### getQueryJobResults `jobs.getQueryJobResults` Get query job results **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.jobs.getQueryJobResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | | `maxRecords` | `number` | No | — | | `locator` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > string | { > }[] > ``` *** ### uploadJobData `jobs.uploadJobData` Upload CSV data to a bulk ingest job **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.jobs.uploadJobData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | | `csv` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Leads ### applyLeadAssignmentRules `leads.applyLeadAssignmentRules` Apply lead assignment rules **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.leads.applyLeadAssignmentRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `leadId` | `string` | Yes | — | | `assignmentRuleId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### createLead `leads.createLead` Create lead **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.leads.createLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `LastName` | `string` | Yes | — | | `Company` | `string` | Yes | — | | `FirstName` | `string` | No | — | | `Email` | `string` | No | — | | `Phone` | `string` | No | — | | `Status` | `string` | No | — | | `Title` | `string` | No | — | | `CustomFields` | `object` | No | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### createLeadWithSpecifiedContentType `leads.createLeadWithSpecifiedContentType` Create lead with content type (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.leads.createLeadWithSpecifiedContentType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `LastName` | `string` | Yes | — | | `Company` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteALeadObjectByItsId `leads.deleteALeadObjectByItsId` Delete lead object by ID (deprecated) **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.leads.deleteALeadObjectByItsId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteLead `leads.deleteLead` Delete lead **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.leads.deleteLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getLead `leads.getLead` Get lead by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.leads.getLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | *** ### listLeads `leads.listLeads` List leads **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.leads.listLeads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `done` | `boolean` | Yes | — | | `records` | `object[]` | Yes | — | | `nextRecordsUrl` | `string` | No | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### retrieveLeadById `leads.retrieveLeadById` Retrieve lead by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.leads.retrieveLeadById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | *** ### retrieveLeadDataWithVariousResponses `leads.retrieveLeadDataWithVariousResponses` Retrieve lead data (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.leads.retrieveLeadDataWithVariousResponses({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | No | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### searchLeads `leads.searchLeads` Search leads **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.leads.searchLeads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `company` | `string` | No | — | | `status` | `string` | No | — | | `title` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateLead `leads.updateLead` Update lead **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.leads.updateLead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `LastName` | `string` | No | — | | `Company` | `string` | No | — | | `FirstName` | `string` | No | — | | `Email` | `string` | No | — | | `Phone` | `string` | No | — | | `Status` | `string` | No | — | | `Title` | `string` | No | — | | `CustomFields` | `object` | No | — | | `id` | `string` | Yes | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### updateLeadByIdWithJsonPayload `leads.updateLeadByIdWithJsonPayload` Update lead by id (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.leads.updateLeadByIdWithJsonPayload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `LastName` | `string` | No | — | | `Company` | `string` | No | — | | `FirstName` | `string` | No | — | | `Email` | `string` | No | — | | `Phone` | `string` | No | — | | `Status` | `string` | No | — | | `Title` | `string` | No | — | | `CustomFields` | `object` | No | — | | `id` | `string` | Yes | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Metadata ### cloneRecord `metadata.cloneRecord` Clone record **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.cloneRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `overrides` | `object` | No | — | > **overrides full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createCustomField `metadata.createCustomField` Create custom field via Tooling API **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.createCustomField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `developerName` | `string` | Yes | — | | `label` | `string` | Yes | — | | `type` | `string` | Yes | — | | `length` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### createCustomObject `metadata.createCustomObject` Create custom object via Metadata API **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.createCustomObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `developerName` | `string` | Yes | — | | `label` | `string` | Yes | — | | `pluralLabel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### createSObjectRecord `metadata.createSObjectRecord` Create sObject record **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.createSObjectRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### deleteSobject `metadata.deleteSobject` Delete sObject record **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.metadata.deleteSobject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteSobjectRows `metadata.deleteSobjectRows` Delete sObject rows **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.metadata.deleteSobjectRows({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### executeSobjectQuickAction `metadata.executeSobjectQuickAction` Execute sObject quick action **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.executeSobjectQuickAction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `actionName` | `string` | Yes | — | | `contextId` | `string` | No | — | | `record` | `object` | No | — | > **record full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `recordId` | `string` | No | — | *** ### getAllCustomObjects `metadata.getAllCustomObjects` Get all custom objects **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getAllCustomObjects({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `sobjects` | `object[]` | Yes | — | > **sobjects full type** > > ```ts theme={null} > { > }[] > ``` *** ### getAllFieldsForObject `metadata.getAllFieldsForObject` Get all fields for object **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getAllFieldsForObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `object[]` | Yes | — | > **fields full type** > > ```ts theme={null} > { > }[] > ``` *** ### getApi `metadata.getApi` Get API resources by version **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getApi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `version` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getChatterResources `metadata.getChatterResources` Get Chatter resources **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getChatterResources({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getChildRecords `metadata.getChildRecords` Get child records **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getChildRecords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parentId` | `string` | Yes | — | | `relationshipName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### getConsentAction `metadata.getConsentAction` Get consent action preferences **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getConsentAction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `action` | `string` | Yes | — | | `ids` | `string[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getGlobalActions `metadata.getGlobalActions` Get global actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getGlobalActions({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `actions` | `object[]` | Yes | — | > **actions full type** > > ```ts theme={null} > { > }[] > ``` *** ### getOrgLimits `metadata.getOrgLimits` Get org limits **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getOrgLimits({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPicklistValuesByRecordType `metadata.getPicklistValuesByRecordType` Get picklist values by record type **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getPicklistValuesByRecordType({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `recordTypeId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getQuickActions `metadata.getQuickActions` Get quick actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getQuickActions({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `actions` | `object[]` | Yes | — | > **actions full type** > > ```ts theme={null} > { > }[] > ``` *** ### getRecordCounts `metadata.getRecordCounts` Get record counts **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getRecordCounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobjects` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sObjects` | `object[]` | Yes | — | > **sObjects full type** > > ```ts theme={null} > { > }[] > ``` *** ### getSobjectApprovalLayouts `metadata.getSobjectApprovalLayouts` Get approval layouts for sObject **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSobjectApprovalLayouts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSobjectByExternalId `metadata.getSobjectByExternalId` Get sObject by external ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSobjectByExternalId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `fieldName` | `string` | Yes | — | | `fieldValue` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSobjectPlatformaction `metadata.getSobjectPlatformaction` Get PlatformAction metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSobjectPlatformaction({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSobjectQuickActionDefaultValues `metadata.getSobjectQuickActionDefaultValues` Get quick action default values **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSobjectQuickActionDefaultValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `actionName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSObjectQuickActionDefaultValues `metadata.getSObjectQuickActionDefaultValues` Get quick action default values **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSObjectQuickActionDefaultValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `actionName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSObjectRecord `metadata.getSObjectRecord` Get sObject record by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSObjectRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `id` | `string` | Yes | — | | `fields` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSobjectRelationship `metadata.getSobjectRelationship` Get sObject relationship **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSobjectRelationship({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `id` | `string` | Yes | — | | `fieldName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSobjects `metadata.getSobjects` Describe global sObjects **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSobjects({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `encoding` | `string` | No | — | | `maxBatchSize` | `number` | No | — | | `sobjects` | `object[]` | Yes | — | > **sobjects full type** > > ```ts theme={null} > { > }[] > ``` *** ### getSObjectsDescribeLayoutsRecordTypeId `metadata.getSObjectsDescribeLayoutsRecordTypeId` Get layouts for object with record type **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSObjectsDescribeLayoutsRecordTypeId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `recordTypeId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSobjectsSobjectDescribeApprovallayouts `metadata.getSobjectsSobjectDescribeApprovallayouts` Get approval layouts for object **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSobjectsSobjectDescribeApprovallayouts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSObjectsUpdated `metadata.getSObjectsUpdated` Get updated sObject records **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSObjectsUpdated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `start` | `string` | Yes | — | | `end` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | | `latestDateCovered` | `string` | Yes | — | *** ### getSupport `metadata.getSupport` Get support knowledge root **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSupport({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSupportedObjectsDirectory `metadata.getSupportedObjectsDirectory` Get supported objects directory **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSupportedObjectsDirectory({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSupportKnowledgeArticles `metadata.getSupportKnowledgeArticles` Get support knowledge articles **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getSupportKnowledgeArticles({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTheme `metadata.getTheme` Get theme metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getTheme({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUserInfo `metadata.getUserInfo` Get user info **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.getUserInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### headActionsCustom `metadata.headActionsCustom` Head custom actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.headActionsCustom({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### headActionsStandard `metadata.headActionsStandard` Head standard actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.headActionsStandard({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### headProcessRulesSObject `metadata.headProcessRulesSObject` Head process rules for sObject **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.headProcessRulesSObject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### headQuickActions `metadata.headQuickActions` Head Quick Actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.headQuickActions({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### headSobjectQuickActionDefaultValues `metadata.headSobjectQuickActionDefaultValues` Head quick action default values **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.headSobjectQuickActionDefaultValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `actionName` | `string` | Yes | — | | `contextId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### headSobjectsGlobalDescribeLayouts `metadata.headSobjectsGlobalDescribeLayouts` Head global describe layouts **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.headSobjectsGlobalDescribeLayouts({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### headSobjectsQuickAction `metadata.headSobjectsQuickAction` Head sObject quick action **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.headSobjectsQuickAction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `actionName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### headSobjectsUserPassword `metadata.headSobjectsUserPassword` Head user password status **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.headSobjectsUserPassword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### listCustomInvocableActions `metadata.listCustomInvocableActions` List custom invocable actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.listCustomInvocableActions({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `actions` | `object[]` | Yes | — | > **actions full type** > > ```ts theme={null} > { > }[] > ``` *** ### listStandardInvocableActions `metadata.listStandardInvocableActions` List standard invocable actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.listStandardInvocableActions({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `actions` | `object[]` | Yes | — | > **actions full type** > > ```ts theme={null} > { > }[] > ``` *** ### massTransferOwnership `metadata.massTransferOwnership` Mass transfer record ownership **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.massTransferOwnership({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `fromUserId` | `string` | Yes | — | | `toUserId` | `string` | Yes | — | | `recordIds` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `transferred` | `number` | No | — | | `failed` | `object[]` | No | — | > **failed full type** > > ```ts theme={null} > { > id?: string, > errors?: any > }[] > ``` *** ### setUserPassword `metadata.setUserPassword` Set user password **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.setUserPassword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `password` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** ### sobjectRowsUpdate `metadata.sobjectRowsUpdate` Update sObject rows **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.sobjectRowsUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `id` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### sobjectUserPassword `metadata.sobjectUserPassword` Check user password expiration status **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.metadata.sobjectUserPassword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `isExpired` | `boolean` | No | — | *** ### updateSobject `metadata.updateSobject` Update sObject fields **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.updateSobject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `id` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### upsertSobjectByExternalId `metadata.upsertSobjectByExternalId` Upsert sObject by external ID **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.metadata.upsertSobjectByExternalId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `fieldName` | `string` | Yes | — | | `fieldValue` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `created` | `boolean` | No | — | | `success` | `boolean` | No | — | *** ## Notes ### createNote `notes.createNote` Create note **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.notes.createNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Title` | `string` | Yes | — | | `Body` | `string` | No | — | | `ParentId` | `string` | No | — | | `IsPrivate` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### createNoteRecordWithContentTypeHeader `notes.createNoteRecordWithContentTypeHeader` Create note record (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.notes.createNoteRecordWithContentTypeHeader({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Title` | `string` | Yes | — | | `ParentId` | `string` | Yes | — | | `Body` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteNote `notes.deleteNote` Delete note **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.notes.deleteNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getNote `notes.getNote` Get note by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.notes.getNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | | `Title` | `string` | No | — | | `Body` | `string` | No | — | *** ### getNoteByIdWithFields `notes.getNoteByIdWithFields` Get note by ID with fields (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.notes.getNoteByIdWithFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | *** ### listNotes `notes.listNotes` List notes **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.notes.listNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parentId` | `string` | No | — | | `query` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### removeNoteObjectById `notes.removeNoteObjectById` Remove note object by ID (deprecated) **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.notes.removeNoteObjectById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### retrieveNoteObjectInformation `notes.retrieveNoteObjectInformation` Retrieve note object info (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.notes.retrieveNoteObjectInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### searchNotes `notes.searchNotes` Search notes **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.notes.searchNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `body` | `string` | No | — | | `parentId` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateNote `notes.updateNote` Update note **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.notes.updateNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Title` | `string` | No | — | | `Body` | `string` | No | — | | `ParentId` | `string` | No | — | | `IsPrivate` | `boolean` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### updateSpecificNoteById `notes.updateSpecificNoteById` Update note by id (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.notes.updateSpecificNoteById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Title` | `string` | No | — | | `Body` | `string` | No | — | | `ParentId` | `string` | No | — | | `IsPrivate` | `boolean` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Opportunities ### addOpportunityLineItem `opportunities.addOpportunityLineItem` Add line item to opportunity **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.opportunities.addOpportunityLineItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `OpportunityId` | `string` | Yes | — | | `PricebookEntryId` | `string` | Yes | — | | `Quantity` | `number` | Yes | — | | `UnitPrice` | `number` | No | — | | `TotalPrice` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### cloneOpportunityWithProducts `opportunities.cloneOpportunityWithProducts` Clone opportunity with products **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.opportunities.cloneOpportunityWithProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `opportunityId` | `string` | Yes | — | | `name` | `string` | No | — | | `cloneProducts` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### createOpportunity `opportunities.createOpportunity` Create opportunity **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.opportunities.createOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | Yes | — | | `StageName` | `string` | Yes | — | | `CloseDate` | `string` | Yes | — | | `AccountId` | `string` | No | — | | `Amount` | `number` | No | — | | `Probability` | `number` | No | — | | `CustomFields` | `object` | No | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### createOpportunityRecord `opportunities.createOpportunityRecord` Create opportunity record (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.opportunities.createOpportunityRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | Yes | — | | `StageName` | `string` | Yes | — | | `CloseDate` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### deleteOpportunity `opportunities.deleteOpportunity` Delete opportunity **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.opportunities.deleteOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getOpportunity `opportunities.getOpportunity` Get opportunity by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.opportunities.getOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | *** ### listOpportunities `opportunities.listOpportunities` List opportunities **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.opportunities.listOpportunities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `done` | `boolean` | Yes | — | | `records` | `object[]` | Yes | — | | `nextRecordsUrl` | `string` | No | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### listPricebookEntries `opportunities.listPricebookEntries` List pricebook entries **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.opportunities.listPricebookEntries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pricebookId` | `string` | No | — | | `query` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### listPricebooks `opportunities.listPricebooks` List pricebooks **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.opportunities.listPricebooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### removeOpportunityById `opportunities.removeOpportunityById` Remove opportunity by ID (deprecated) **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.salesforce.api.opportunities.removeOpportunityById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### retrieveOpportunitiesData `opportunities.retrieveOpportunitiesData` Retrieve opportunities data **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.opportunities.retrieveOpportunitiesData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### retrieveOpportunityByIdWithOptionalFields `opportunities.retrieveOpportunityByIdWithOptionalFields` Retrieve opportunity by ID with fields (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.opportunities.retrieveOpportunityByIdWithOptionalFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Id` | `string` | Yes | — | *** ### searchOpportunities `opportunities.searchOpportunities` Search opportunities **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.opportunities.searchOpportunities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `accountId` | `string` | No | — | | `stageName` | `string` | No | — | | `isClosed` | `boolean` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateOpportunity `opportunities.updateOpportunity` Update opportunity **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.opportunities.updateOpportunity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | No | — | | `StageName` | `string` | No | — | | `CloseDate` | `string` | No | — | | `AccountId` | `string` | No | — | | `Amount` | `number` | No | — | | `Probability` | `number` | No | — | | `CustomFields` | `object` | No | — | | `id` | `string` | Yes | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### updateOpportunityById `opportunities.updateOpportunityById` Update opportunity by id (deprecated) **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.opportunities.updateOpportunityById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Name` | `string` | No | — | | `StageName` | `string` | No | — | | `CloseDate` | `string` | No | — | | `AccountId` | `string` | No | — | | `Amount` | `number` | No | — | | `Probability` | `number` | No | — | | `CustomFields` | `object` | No | — | | `id` | `string` | Yes | — | > **CustomFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Soql Sosl ### executeSoqlQuery `soqlSosl.executeSoqlQuery` Execute SOQL query (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.executeSoqlQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### executeSoslSearch `soqlSosl.executeSoslSearch` Execute SOSL search **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.executeSoslSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `searchRecords` | `object[]` | Yes | — | > **searchRecords full type** > > ```ts theme={null} > { > }[] > ``` *** ### getParameterizedSearch `soqlSosl.getParameterizedSearch` Parameterized search via GET **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.getParameterizedSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `sobjects` | `object[]` | No | — | > **sobjects full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `searchRecords` | `object[]` | Yes | — | > **searchRecords full type** > > ```ts theme={null} > { > }[] > ``` *** ### getSearchLayout `soqlSosl.getSearchLayout` Get search layout **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.getSearchLayout({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobjects` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getSearchSuggestions `soqlSosl.getSearchSuggestions` Get search suggestions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.getSearchSuggestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `sobject` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** ### parameterizedSearch `soqlSosl.parameterizedSearch` Run parameterized search **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.parameterizedSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `sobjects` | `object[]` | No | — | > **sobjects full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `searchRecords` | `object[]` | Yes | — | > **searchRecords full type** > > ```ts theme={null} > { > }[] > ``` *** ### postParameterizedSearch `soqlSosl.postParameterizedSearch` Post parameterized search **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.postParameterizedSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `searchRecords` | `object[]` | Yes | — | > **searchRecords full type** > > ```ts theme={null} > { > }[] > ``` *** ### query `soqlSosl.query` Execute SOQL query (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### queryAll `soqlSosl.queryAll` Run queryAll including deleted records **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.queryAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `done` | `boolean` | Yes | — | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### runSoqlQuery `soqlSosl.runSoqlQuery` Run SOQL query **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.runSoqlQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `done` | `boolean` | Yes | — | | `records` | `object[]` | Yes | — | | `nextRecordsUrl` | `string` | No | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### search `soqlSosl.search` Run SOSL search **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `searchRecords` | `object[]` | Yes | — | > **searchRecords full type** > > ```ts theme={null} > { > }[] > ``` *** ### searchKnowledgeArticles `soqlSosl.searchKnowledgeArticles` Search knowledge articles **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.searchKnowledgeArticles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** ### toolingQuery `soqlSosl.toolingQuery` Run Tooling API SOQL query **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.soqlSosl.toolingQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalSize` | `number` | Yes | — | | `done` | `boolean` | Yes | — | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ## Tasks ### completeTask `tasks.completeTask` Complete task **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.tasks.completeTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `completionNotes` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### createTask `tasks.createTask` Create task **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.tasks.createTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Subject` | `string` | Yes | — | | `Status` | `string` | No | — | | `Priority` | `string` | No | — | | `WhoId` | `string` | No | — | | `WhatId` | `string` | No | — | | `OwnerId` | `string` | No | — | | `ActivityDate` | `string` | No | — | | `Description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `success` | `boolean` | No | — | *** ### logCall `tasks.logCall` Log phone call activity **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.tasks.logCall({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Subject` | `string` | Yes | — | | `CallDurationInSeconds` | `number` | No | — | | `CallType` | `string` | No | — | | `CallDisposition` | `string` | No | — | | `Description` | `string` | No | — | | `WhoId` | `string` | No | — | | `WhatId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### logEmailActivity `tasks.logEmailActivity` Log email activity **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.tasks.logEmailActivity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Subject` | `string` | Yes | — | | `TextBody` | `string` | No | — | | `HtmlBody` | `string` | No | — | | `FromAddress` | `string` | No | — | | `ToAddress` | `string` | No | — | | `RelatedToId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### searchTasks `tasks.searchTasks` Search tasks **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.tasks.searchTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subject` | `string` | No | — | | `status` | `string` | No | — | | `priority` | `string` | No | — | | `whoId` | `string` | No | — | | `whatId` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | Yes | — | > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### sendEmail `tasks.sendEmail` Send email **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.tasks.sendEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `toAddresses` | `string[]` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `senderType` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** ### sendEmailFromTemplate `tasks.sendEmailFromTemplate` Send email from template **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.tasks.sendEmailFromTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `toAddresses` | `string[]` | No | — | | `templateId` | `string` | Yes | — | | `targetObjectId` | `string` | No | — | | `senderType` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** ### sendMassEmail `tasks.sendMassEmail` Send mass email **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.tasks.sendMassEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `toAddresses` | `string[]` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | | `templateId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** ### updateTask `tasks.updateTask` Update task **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.tasks.updateTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `Subject` | `string` | No | — | | `Status` | `string` | No | — | | `Priority` | `string` | No | — | | `WhoId` | `string` | No | — | | `WhatId` | `string` | No | — | | `OwnerId` | `string` | No | — | | `ActivityDate` | `string` | No | — | | `Description` | `string` | No | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Ui Api ### createARecord `uiApi.createARecord` Create record via UI API **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.uiApi.createARecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiName` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `apiName` | `string` | No | — | *** ### createRecordUiApi `uiApi.createRecordUiApi` Create record using UI API **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.uiApi.createRecordUiApi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `apiName` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `apiName` | `string` | No | — | *** ### getAllNavigationItems `uiApi.getAllNavigationItems` Get all navigation items **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getAllNavigationItems({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getApp `uiApi.getApp` Get app metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getApp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `appId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getApps `uiApi.getApps` Get apps metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getApps({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCompactLayouts `uiApi.getCompactLayouts` Get compact layouts **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getCompactLayouts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobjects` | `string[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getLastSelectedApp `uiApi.getLastSelectedApp` Get last selected app **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getLastSelectedApp({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListViewActions `uiApi.getListViewActions` Get list view actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getListViewActions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListViewMetadataBatch `uiApi.getListViewMetadataBatch` Get batch list view metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getListViewMetadataBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listViewIds` | `string[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListViewMetadataByName `uiApi.getListViewMetadataByName` Get list view metadata by API name **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getListViewMetadataByName({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `listViewName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListViewRecordsById `uiApi.getListViewRecordsById` Get list view records by ID **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getListViewRecordsById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listViewId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListViewRecordsByName `uiApi.getListViewRecordsByName` Get list view records by API name **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getListViewRecordsByName({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `listViewName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getListViewResults `uiApi.getListViewResults` Get list view results by sObject **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getListViewResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `listViewId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getLookupFieldSuggestions `uiApi.getLookupFieldSuggestions` Get lookup field suggestions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getLookupFieldSuggestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `field` | `string` | Yes | — | | `q` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getLookupSuggestionsCaseContact `uiApi.getLookupSuggestionsCaseContact` Get lookup field suggestions for Case ContactId with POST **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getLookupSuggestionsCaseContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getLookupSuggestionsOpportunityAccount `uiApi.getLookupSuggestionsOpportunityAccount` Get lookup field suggestions for Opportunity AccountId with POST **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getLookupSuggestionsOpportunityAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMruListViewMetadata `uiApi.getMruListViewMetadata` Get MRU list view metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getMruListViewMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMruListViewRecords `uiApi.getMruListViewRecords` Get MRU list view records **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getMruListViewRecords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getObjectListViews `uiApi.getObjectListViews` Get list views for an object **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getObjectListViews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPhotoActions `uiApi.getPhotoActions` Get photo actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getPhotoActions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `pageId` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRecordEditPageActions `uiApi.getRecordEditPageActions` Get record edit page actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getRecordEditPageActions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `recordId` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRecordUiDataAndMetadata `uiApi.getRecordUiDataAndMetadata` Get record UI data and metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getRecordUiDataAndMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRelatedListActions `uiApi.getRelatedListActions` Get related list actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getRelatedListActions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parentRecordId` | `string` | Yes | — | | `relationshipName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRelatedListPreferencesBatch `uiApi.getRelatedListPreferencesBatch` Get batch related list user preferences **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getRelatedListPreferencesBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `relatedListIds` | `string[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getRelatedListRecordsContacts `uiApi.getRelatedListRecordsContacts` Get related list records for Contacts **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getRelatedListRecordsContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parentRecordId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSobjectListView `uiApi.getSobjectListView` Get sObject list view information **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getSobjectListView({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `listViewId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSobjectListViews `uiApi.getSobjectListViews` Get list views for sObject **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getSobjectListViews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiApiActionsLookupAccount `uiApi.getUiApiActionsLookupAccount` Get lookup field actions for Account **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiApiActionsLookupAccount({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiapiActionsMruListAccount `uiApi.getUiapiActionsMruListAccount` Get MRU list view actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiapiActionsMruListAccount({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiApiActionsRecordRelatedList `uiApi.getUiApiActionsRecordRelatedList` Get record related list actions **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiApiActionsRecordRelatedList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parentRecordId` | `string` | Yes | — | | `relationshipName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiApiAppsUserNavItems `uiApi.getUiApiAppsUserNavItems` Get user navigation items **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiApiAppsUserNavItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `appId` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiapiListInfoAccountAllAccounts `uiApi.getUiapiListInfoAccountAllAccounts` Get Account AllAccounts list view metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiapiListInfoAccountAllAccounts({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiapiListInfoAccountRecent `uiApi.getUiapiListInfoAccountRecent` Get Account Recent list view metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiapiListInfoAccountRecent({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiapiListInfoAccountSearchResult `uiApi.getUiapiListInfoAccountSearchResult` Get Account SearchResult list view metadata **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiapiListInfoAccountSearchResult({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiApiListInfoRecent `uiApi.getUiApiListInfoRecent` Get Recent list view metadata for object **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiApiListInfoRecent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiapiLookupsOpportunityAccountId `uiApi.getUiapiLookupsOpportunityAccountId` Get lookup field suggestions for Opportunity AccountId **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiapiLookupsOpportunityAccountId({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiapimruListInfoAccount `uiApi.getUiapimruListInfoAccount` Get MRU list info for Account (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiapimruListInfoAccount({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiApiMruListRecordsAccount `uiApi.getUiApiMruListRecordsAccount` Get MRU list records for Account (deprecated) **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiApiMruListRecordsAccount({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUiapiRelatedListPreferences `uiApi.getUiapiRelatedListPreferences` Get related list user preferences **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.getUiapiRelatedListPreferences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parentRecordId` | `string` | Yes | — | | `relationshipName` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### headAppmenuSalesforce1 `uiApi.headAppmenuSalesforce1` Head AppMenu Salesforce1 **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.headAppmenuSalesforce1({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | *** ### listViewResults `uiApi.listViewResults` Get list view results **Risk:** `read` ```ts theme={null} await corsair.salesforce.api.uiApi.listViewResults({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listViewId` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateFavorite `uiApi.updateFavorite` Update a favorite **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.uiApi.updateFavorite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `favoriteId` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** ### updateListViewPreferences `uiApi.updateListViewPreferences` Update list view preferences **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.uiApi.updateListViewPreferences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sobject` | `string` | Yes | — | | `listViewId` | `string` | Yes | — | | `preferences` | `object` | Yes | — | > **preferences full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** ### updateRecord `uiApi.updateRecord` Update a record via UI API **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.uiApi.updateRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recordId` | `string` | Yes | — | | `apiName` | `string` | Yes | — | | `fields` | `object` | Yes | — | | `ifUnmodifiedSince` | `string` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### updateRelatedListPreferences `uiApi.updateRelatedListPreferences` Update related list preferences **Risk:** `write` ```ts theme={null} await corsair.salesforce.api.uiApi.updateRelatedListPreferences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `relatedListId` | `string` | Yes | — | | `preferences` | `object` | Yes | — | > **preferences full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `any` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/salesforce/database Salesforce local sync: searchable entities, `.search()` filters, and operators. The Salesforce plugin syncs data locally. Use `corsair.salesforce.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Account Path: `salesforce.db.account.search` ```ts theme={null} const rows = await corsair.salesforce.db.account.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `AccountNumber` | `string` | equals, contains, startsWith, endsWith, in | | `AccountSource` | `string` | equals, contains, startsWith, endsWith, in | | `AnnualRevenue` | `number` | equals, gt, gte, lt, lte, in | | `BillingCity` | `string` | equals, contains, startsWith, endsWith, in | | `BillingCountry` | `string` | equals, contains, startsWith, endsWith, in | | `BillingGeocodeAccuracy` | `string` | equals, contains, startsWith, endsWith, in | | `BillingLatitude` | `number` | equals, gt, gte, lt, lte, in | | `BillingLongitude` | `number` | equals, gt, gte, lt, lte, in | | `BillingPostalCode` | `string` | equals, contains, startsWith, endsWith, in | | `BillingState` | `string` | equals, contains, startsWith, endsWith, in | | `BillingStreet` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `Fax` | `string` | equals, contains, startsWith, endsWith, in | | `Industry` | `string` | equals, contains, startsWith, endsWith, in | | `IsDeleted` | `boolean` | equals | | `IsPersonAccount` | `boolean` | equals | | `LastActivityDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastReferencedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastViewedDate` | `string` | equals, contains, startsWith, endsWith, in | | `MasterRecordId` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `NumberOfEmployees` | `number` | equals, gt, gte, lt, lte, in | | `OwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `Ownership` | `string` | equals, contains, startsWith, endsWith, in | | `ParentId` | `string` | equals, contains, startsWith, endsWith, in | | `Phone` | `string` | equals, contains, startsWith, endsWith, in | | `PhotoUrl` | `string` | equals, contains, startsWith, endsWith, in | | `Rating` | `string` | equals, contains, startsWith, endsWith, in | | `RecordTypeId` | `string` | equals, contains, startsWith, endsWith, in | | `ShippingCity` | `string` | equals, contains, startsWith, endsWith, in | | `ShippingCountry` | `string` | equals, contains, startsWith, endsWith, in | | `ShippingGeocodeAccuracy` | `string` | equals, contains, startsWith, endsWith, in | | `ShippingLatitude` | `number` | equals, gt, gte, lt, lte, in | | `ShippingLongitude` | `number` | equals, gt, gte, lt, lte, in | | `ShippingPostalCode` | `string` | equals, contains, startsWith, endsWith, in | | `ShippingState` | `string` | equals, contains, startsWith, endsWith, in | | `ShippingStreet` | `string` | equals, contains, startsWith, endsWith, in | | `Sic` | `string` | equals, contains, startsWith, endsWith, in | | `SicDesc` | `string` | equals, contains, startsWith, endsWith, in | | `Site` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `TickerSymbol` | `string` | equals, contains, startsWith, endsWith, in | | `Type` | `string` | equals, contains, startsWith, endsWith, in | | `Website` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Campaign Path: `salesforce.db.campaign.search` ```ts theme={null} const rows = await corsair.salesforce.db.campaign.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `ActualCost` | `number` | equals, gt, gte, lt, lte, in | | `AmountAllOpportunities` | `number` | equals, gt, gte, lt, lte, in | | `AmountWonOpportunities` | `number` | equals, gt, gte, lt, lte, in | | `BudgetedCost` | `number` | equals, gt, gte, lt, lte, in | | `CampaignMemberRecordTypeId` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `EndDate` | `string` | equals, contains, startsWith, endsWith, in | | `ExpectedResponse` | `number` | equals, gt, gte, lt, lte, in | | `ExpectedRevenue` | `number` | equals, gt, gte, lt, lte, in | | `IsActive` | `boolean` | equals | | `IsDeleted` | `boolean` | equals | | `LastActivityDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastReferencedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastViewedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `NumberOfContacts` | `number` | equals, gt, gte, lt, lte, in | | `NumberOfConvertedLeads` | `number` | equals, gt, gte, lt, lte, in | | `NumberOfLeads` | `number` | equals, gt, gte, lt, lte, in | | `NumberOfOpportunities` | `number` | equals, gt, gte, lt, lte, in | | `NumberOfResponses` | `number` | equals, gt, gte, lt, lte, in | | `NumberOfWonOpportunities` | `number` | equals, gt, gte, lt, lte, in | | `NumberSent` | `number` | equals, gt, gte, lt, lte, in | | `OwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `ParentId` | `string` | equals, contains, startsWith, endsWith, in | | `RecordTypeId` | `string` | equals, contains, startsWith, endsWith, in | | `StartDate` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `Type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Campaign Member Path: `salesforce.db.campaignMember.search` ```ts theme={null} const rows = await corsair.salesforce.db.campaignMember.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `CampaignId` | `string` | equals, contains, startsWith, endsWith, in | | `ContactId` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `FirstRespondedDate` | `string` | equals, contains, startsWith, endsWith, in | | `HasResponded` | `boolean` | equals | | `IsDeleted` | `boolean` | equals | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LeadId` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contact Path: `salesforce.db.contact.search` ```ts theme={null} const rows = await corsair.salesforce.db.contact.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `AccountId` | `string` | equals, contains, startsWith, endsWith, in | | `AssistantName` | `string` | equals, contains, startsWith, endsWith, in | | `AssistantPhone` | `string` | equals, contains, startsWith, endsWith, in | | `Birthdate` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Department` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `DoNotCall` | `boolean` | equals | | `Email` | `string` | equals, contains, startsWith, endsWith, in | | `EmailBouncedDate` | `string` | equals, contains, startsWith, endsWith, in | | `EmailBouncedReason` | `string` | equals, contains, startsWith, endsWith, in | | `Fax` | `string` | equals, contains, startsWith, endsWith, in | | `FirstName` | `string` | equals, contains, startsWith, endsWith, in | | `HasOptedOutOfEmail` | `boolean` | equals | | `HasOptedOutOfFax` | `boolean` | equals | | `HomePhone` | `string` | equals, contains, startsWith, endsWith, in | | `IndividualId` | `string` | equals, contains, startsWith, endsWith, in | | `IsDeleted` | `boolean` | equals | | `IsEmailBounced` | `boolean` | equals | | `LastActivityDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastReferencedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastViewedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastName` | `string` | equals, contains, startsWith, endsWith, in | | `LeadSource` | `string` | equals, contains, startsWith, endsWith, in | | `MailingCity` | `string` | equals, contains, startsWith, endsWith, in | | `MailingCountry` | `string` | equals, contains, startsWith, endsWith, in | | `MailingGeocodeAccuracy` | `string` | equals, contains, startsWith, endsWith, in | | `MailingLatitude` | `number` | equals, gt, gte, lt, lte, in | | `MailingLongitude` | `number` | equals, gt, gte, lt, lte, in | | `MailingPostalCode` | `string` | equals, contains, startsWith, endsWith, in | | `MailingState` | `string` | equals, contains, startsWith, endsWith, in | | `MailingStreet` | `string` | equals, contains, startsWith, endsWith, in | | `MasterRecordId` | `string` | equals, contains, startsWith, endsWith, in | | `MobilePhone` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `OtherCity` | `string` | equals, contains, startsWith, endsWith, in | | `OtherCountry` | `string` | equals, contains, startsWith, endsWith, in | | `OtherPhone` | `string` | equals, contains, startsWith, endsWith, in | | `OtherPostalCode` | `string` | equals, contains, startsWith, endsWith, in | | `OtherState` | `string` | equals, contains, startsWith, endsWith, in | | `OtherStreet` | `string` | equals, contains, startsWith, endsWith, in | | `OwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `Phone` | `string` | equals, contains, startsWith, endsWith, in | | `PhotoUrl` | `string` | equals, contains, startsWith, endsWith, in | | `RecordTypeId` | `string` | equals, contains, startsWith, endsWith, in | | `ReportsToId` | `string` | equals, contains, startsWith, endsWith, in | | `Salutation` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `Title` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Content Document Path: `salesforce.db.contentDocument.search` ```ts theme={null} const rows = await corsair.salesforce.db.contentDocument.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `ContentModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `ContentSize` | `number` | equals, gt, gte, lt, lte, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `FileExtension` | `string` | equals, contains, startsWith, endsWith, in | | `FileType` | `string` | equals, contains, startsWith, endsWith, in | | `IsDeleted` | `boolean` | equals | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LatestPublishedVersionId` | `string` | equals, contains, startsWith, endsWith, in | | `OwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `ParentId` | `string` | equals, contains, startsWith, endsWith, in | | `PublishStatus` | `string` | equals, contains, startsWith, endsWith, in | | `SharingOption` | `string` | equals, contains, startsWith, endsWith, in | | `SharingPrivacy` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `Title` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Email Message Path: `salesforce.db.emailMessage.search` ```ts theme={null} const rows = await corsair.salesforce.db.emailMessage.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `BccAddress` | `string` | equals, contains, startsWith, endsWith, in | | `CcAddress` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `FromAddress` | `string` | equals, contains, startsWith, endsWith, in | | `FromName` | `string` | equals, contains, startsWith, endsWith, in | | `HasAttachment` | `boolean` | equals | | `Headers` | `string` | equals, contains, startsWith, endsWith, in | | `HtmlBody` | `string` | equals, contains, startsWith, endsWith, in | | `Incoming` | `boolean` | equals | | `IsDeleted` | `boolean` | equals | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `MessageDate` | `string` | equals, contains, startsWith, endsWith, in | | `ParentId` | `string` | equals, contains, startsWith, endsWith, in | | `RelatedToId` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `Subject` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `TextBody` | `string` | equals, contains, startsWith, endsWith, in | | `ToAddress` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lead Path: `salesforce.db.lead.search` ```ts theme={null} const rows = await corsair.salesforce.db.lead.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `AnnualRevenue` | `number` | equals, gt, gte, lt, lte, in | | `City` | `string` | equals, contains, startsWith, endsWith, in | | `Company` | `string` | equals, contains, startsWith, endsWith, in | | `ConvertedAccountId` | `string` | equals, contains, startsWith, endsWith, in | | `ConvertedContactId` | `string` | equals, contains, startsWith, endsWith, in | | `ConvertedDate` | `string` | equals, contains, startsWith, endsWith, in | | `ConvertedOpportunityId` | `string` | equals, contains, startsWith, endsWith, in | | `Country` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `Email` | `string` | equals, contains, startsWith, endsWith, in | | `EmailBouncedDate` | `string` | equals, contains, startsWith, endsWith, in | | `EmailBouncedReason` | `string` | equals, contains, startsWith, endsWith, in | | `Fax` | `string` | equals, contains, startsWith, endsWith, in | | `FirstName` | `string` | equals, contains, startsWith, endsWith, in | | `HasOptedOutOfEmail` | `boolean` | equals | | `IndividualId` | `string` | equals, contains, startsWith, endsWith, in | | `Industry` | `string` | equals, contains, startsWith, endsWith, in | | `IsConverted` | `boolean` | equals | | `IsDeleted` | `boolean` | equals | | `IsUnreadByOwner` | `boolean` | equals | | `LastActivityDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastReferencedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastViewedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastName` | `string` | equals, contains, startsWith, endsWith, in | | `LeadSource` | `string` | equals, contains, startsWith, endsWith, in | | `MasterRecordId` | `string` | equals, contains, startsWith, endsWith, in | | `MobilePhone` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `NumberOfEmployees` | `number` | equals, gt, gte, lt, lte, in | | `OwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `Phone` | `string` | equals, contains, startsWith, endsWith, in | | `PostalCode` | `string` | equals, contains, startsWith, endsWith, in | | `Rating` | `string` | equals, contains, startsWith, endsWith, in | | `RecordTypeId` | `string` | equals, contains, startsWith, endsWith, in | | `Salutation` | `string` | equals, contains, startsWith, endsWith, in | | `State` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `Street` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `Title` | `string` | equals, contains, startsWith, endsWith, in | | `Website` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Note Path: `salesforce.db.note.search` ```ts theme={null} const rows = await corsair.salesforce.db.note.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `Body` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `IsDeleted` | `boolean` | equals | | `IsPrivate` | `boolean` | equals | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `OwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `ParentId` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `Title` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Opportunity Path: `salesforce.db.opportunity.search` ```ts theme={null} const rows = await corsair.salesforce.db.opportunity.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `AccountId` | `string` | equals, contains, startsWith, endsWith, in | | `Amount` | `number` | equals, gt, gte, lt, lte, in | | `CampaignId` | `string` | equals, contains, startsWith, endsWith, in | | `CloseDate` | `string` | equals, contains, startsWith, endsWith, in | | `ContactId` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `ExpectedRevenue` | `number` | equals, gt, gte, lt, lte, in | | `ForecastCategory` | `string` | equals, contains, startsWith, endsWith, in | | `ForecastCategoryName` | `string` | equals, contains, startsWith, endsWith, in | | `HasOpportunityLineItem` | `boolean` | equals | | `IsClosed` | `boolean` | equals | | `IsDeleted` | `boolean` | equals | | `IsPrivate` | `boolean` | equals | | `IsWon` | `boolean` | equals | | `LastActivityDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastReferencedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastViewedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LeadSource` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `NextStep` | `string` | equals, contains, startsWith, endsWith, in | | `OwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `Pricebook2Id` | `string` | equals, contains, startsWith, endsWith, in | | `Probability` | `number` | equals, gt, gte, lt, lte, in | | `RecordTypeId` | `string` | equals, contains, startsWith, endsWith, in | | `StageName` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `TotalOpportunityQuantity` | `number` | equals, gt, gte, lt, lte, in | | `Type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Opportunity Line Item Path: `salesforce.db.opportunityLineItem.search` ```ts theme={null} const rows = await corsair.salesforce.db.opportunityLineItem.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `IsDeleted` | `boolean` | equals | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `ListPrice` | `number` | equals, gt, gte, lt, lte, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `OpportunityId` | `string` | equals, contains, startsWith, endsWith, in | | `PricebookEntryId` | `string` | equals, contains, startsWith, endsWith, in | | `Product2Id` | `string` | equals, contains, startsWith, endsWith, in | | `ProductCode` | `string` | equals, contains, startsWith, endsWith, in | | `Quantity` | `number` | equals, gt, gte, lt, lte, in | | `ServiceDate` | `string` | equals, contains, startsWith, endsWith, in | | `SortOrder` | `number` | equals, gt, gte, lt, lte, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `TotalPrice` | `number` | equals, gt, gte, lt, lte, in | | `UnitPrice` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pricebook Path: `salesforce.db.pricebook.search` ```ts theme={null} const rows = await corsair.salesforce.db.pricebook.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `IsActive` | `boolean` | equals | | `IsArchived` | `boolean` | equals | | `IsDeleted` | `boolean` | equals | | `IsStandard` | `boolean` | equals | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastReferencedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastViewedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pricebook Entry Path: `salesforce.db.pricebookEntry.search` ```ts theme={null} const rows = await corsair.salesforce.db.pricebookEntry.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `IsActive` | `boolean` | equals | | `IsArchived` | `boolean` | equals | | `IsDeleted` | `boolean` | equals | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `Pricebook2Id` | `string` | equals, contains, startsWith, endsWith, in | | `Product2Id` | `string` | equals, contains, startsWith, endsWith, in | | `ProductCode` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `UnitPrice` | `number` | equals, gt, gte, lt, lte, in | | `UseStandardPrice` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Task Path: `salesforce.db.task.search` ```ts theme={null} const rows = await corsair.salesforce.db.task.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `AccountId` | `string` | equals, contains, startsWith, endsWith, in | | `ActivityDate` | `string` | equals, contains, startsWith, endsWith, in | | `CallDisposition` | `string` | equals, contains, startsWith, endsWith, in | | `CallDurationInSeconds` | `number` | equals, gt, gte, lt, lte, in | | `CallObject` | `string` | equals, contains, startsWith, endsWith, in | | `CallType` | `string` | equals, contains, startsWith, endsWith, in | | `CompletedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `IsArchived` | `boolean` | equals | | `IsClosed` | `boolean` | equals | | `IsDeleted` | `boolean` | equals | | `IsHighPriority` | `boolean` | equals | | `IsRecurrence` | `boolean` | equals | | `IsReminderSet` | `boolean` | equals | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `OwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `Priority` | `string` | equals, contains, startsWith, endsWith, in | | `RecurrenceRegeneratedType` | `string` | equals, contains, startsWith, endsWith, in | | `ReminderDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `Subject` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `TaskSubtype` | `string` | equals, contains, startsWith, endsWith, in | | `WhatId` | `string` | equals, contains, startsWith, endsWith, in | | `WhoId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## User Path: `salesforce.db.user.search` ```ts theme={null} const rows = await corsair.salesforce.db.user.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `Id` | `string` | equals, contains, startsWith, endsWith, in | | `AboutMe` | `string` | equals, contains, startsWith, endsWith, in | | `AccountId` | `string` | equals, contains, startsWith, endsWith, in | | `Alias` | `string` | equals, contains, startsWith, endsWith, in | | `City` | `string` | equals, contains, startsWith, endsWith, in | | `CompanyName` | `string` | equals, contains, startsWith, endsWith, in | | `Country` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedById` | `string` | equals, contains, startsWith, endsWith, in | | `CreatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `Department` | `string` | equals, contains, startsWith, endsWith, in | | `Email` | `string` | equals, contains, startsWith, endsWith, in | | `EmailEncodingKey` | `string` | equals, contains, startsWith, endsWith, in | | `FirstName` | `string` | equals, contains, startsWith, endsWith, in | | `IsActive` | `boolean` | equals | | `LanguageLocaleKey` | `string` | equals, contains, startsWith, endsWith, in | | `LastLoginDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedById` | `string` | equals, contains, startsWith, endsWith, in | | `LastModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `LastName` | `string` | equals, contains, startsWith, endsWith, in | | `LocaleSidKey` | `string` | equals, contains, startsWith, endsWith, in | | `MobilePhone` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `Phone` | `string` | equals, contains, startsWith, endsWith, in | | `PostalCode` | `string` | equals, contains, startsWith, endsWith, in | | `ProfileId` | `string` | equals, contains, startsWith, endsWith, in | | `State` | `string` | equals, contains, startsWith, endsWith, in | | `Street` | `string` | equals, contains, startsWith, endsWith, in | | `SystemModstamp` | `string` | equals, contains, startsWith, endsWith, in | | `TimeZoneSidKey` | `string` | equals, contains, startsWith, endsWith, in | | `Title` | `string` | equals, contains, startsWith, endsWith, in | | `Username` | `string` | equals, contains, startsWith, endsWith, in | | `UserRoleId` | `string` | equals, contains, startsWith, endsWith, in | | `UserType` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/salesforce/overview Enterprise CRM for leads, accounts, opportunities, service cases, and sales automation. Use **Salesforce** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 225 typed API operations * 14 synced entities (`account`, `campaign`, `campaignMember`, `contact`, `contentDocument`, `emailMessage`, and 8 more) for fast `.search()` / `.list()` * 7 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/salesforce ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/salesforce ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/salesforce ``` ```bash bun theme={null} bun add corsair @corsair-dev/salesforce ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { salesforce } from '@corsair-dev/salesforce'; export const corsair = createCorsair({ plugins: [ salesforce(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Salesforce OAuth app. ```ts theme={null} salesforce() ``` More: [OAuth 2.0](/concepts/oauth) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. ```ts theme={null} salesforce({ authType: 'api_key', }) ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'salesforce', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.fetchAccountByIdWithQuery`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.salesforce.api.accounts.fetchAccountByIdWithQuery({}); ``` **`accounts.accountCreationWithContentTypeOption`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.salesforce.api.accounts.accountCreationWithContentTypeOption({}); ``` See the full list on the [API](/plugins/salesforce/api) page. ## Query synced data Synced entities support `tenant.salesforce.db..search()` and `.list()`: `account`, `campaign`, `campaignMember`, `contact`, `contentDocument`, `emailMessage`, `lead`, `note`, `opportunity`, `opportunityLineItem`, `pricebook`, `pricebookEntry`, `task`, `user`. See [Database](/plugins/salesforce/database) for filters and operators. ## Webhooks This plugin registers **7** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/salesforce/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/salesforce/api)** > > Every `salesforce.api.*` operation with input and output types. > **[Database](/plugins/salesforce/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/salesforce/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/salesforce/webhooks Salesforce incoming webhooks: event paths, payloads, and response data. The Salesforce plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/salesforce/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `accountCreatedOrUpdated` (`accountCreatedOrUpdated`) * `contactUpdated` (`contactUpdated`) * `genericSObjectRecordUpdated` (`genericSObjectRecordUpdated`) * `newContact` (`newContact`) * `newLead` (`newLead`) * `newOrUpdatedOpportunity` (`newOrUpdatedOpportunity`) * `taskCreatedOrCompleted` (`taskCreatedOrCompleted`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Account Created Or Updated ### Account Created Or Updated `accountCreatedOrUpdated` Account created or updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ChangeEventHeader` | `object` | No | — | | `Id` | `string` | No | — | | `id` | `string` | No | — | | `sobject` | `string` | No | — | | `type` | `string` | No | — | | `Status` | `string` | No | — | | `LastModifiedDate` | `string` | No | — | | `SystemModstamp` | `string` | No | — | | `organization_id` | `string` | No | — | > **ChangeEventHeader full type** > > ```ts theme={null} > { > entityName?: string, > changeType?: string, > recordIds?: string[], > commitTimestamp?: number, > commitUser?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} salesforce({ webhookHooks: { accountCreatedOrUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Contact Updated ### Contact Updated `contactUpdated` Contact updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ChangeEventHeader` | `object` | No | — | | `Id` | `string` | No | — | | `id` | `string` | No | — | | `sobject` | `string` | No | — | | `type` | `string` | No | — | | `Status` | `string` | No | — | | `LastModifiedDate` | `string` | No | — | | `SystemModstamp` | `string` | No | — | | `organization_id` | `string` | No | — | > **ChangeEventHeader full type** > > ```ts theme={null} > { > entityName?: string, > changeType?: string, > recordIds?: string[], > commitTimestamp?: number, > commitUser?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} salesforce({ webhookHooks: { contactUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Generic SObject Record Updated ### Generic SObject Record Updated `genericSObjectRecordUpdated` Generic sObject record updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ChangeEventHeader` | `object` | No | — | | `Id` | `string` | No | — | | `id` | `string` | No | — | | `sobject` | `string` | No | — | | `type` | `string` | No | — | | `Status` | `string` | No | — | | `LastModifiedDate` | `string` | No | — | | `SystemModstamp` | `string` | No | — | | `organization_id` | `string` | No | — | > **ChangeEventHeader full type** > > ```ts theme={null} > { > entityName?: string, > changeType?: string, > recordIds?: string[], > commitTimestamp?: number, > commitUser?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} salesforce({ webhookHooks: { genericSObjectRecordUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## New Contact ### New Contact `newContact` New contact created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ChangeEventHeader` | `object` | No | — | | `Id` | `string` | No | — | | `id` | `string` | No | — | | `sobject` | `string` | No | — | | `type` | `string` | No | — | | `Status` | `string` | No | — | | `LastModifiedDate` | `string` | No | — | | `SystemModstamp` | `string` | No | — | | `organization_id` | `string` | No | — | > **ChangeEventHeader full type** > > ```ts theme={null} > { > entityName?: string, > changeType?: string, > recordIds?: string[], > commitTimestamp?: number, > commitUser?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} salesforce({ webhookHooks: { newContact: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## New Lead ### New Lead `newLead` New lead created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ChangeEventHeader` | `object` | No | — | | `Id` | `string` | No | — | | `id` | `string` | No | — | | `sobject` | `string` | No | — | | `type` | `string` | No | — | | `Status` | `string` | No | — | | `LastModifiedDate` | `string` | No | — | | `SystemModstamp` | `string` | No | — | | `organization_id` | `string` | No | — | > **ChangeEventHeader full type** > > ```ts theme={null} > { > entityName?: string, > changeType?: string, > recordIds?: string[], > commitTimestamp?: number, > commitUser?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} salesforce({ webhookHooks: { newLead: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## New Or Updated Opportunity ### New Or Updated Opportunity `newOrUpdatedOpportunity` Opportunity created or updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ChangeEventHeader` | `object` | No | — | | `Id` | `string` | No | — | | `id` | `string` | No | — | | `sobject` | `string` | No | — | | `type` | `string` | No | — | | `Status` | `string` | No | — | | `LastModifiedDate` | `string` | No | — | | `SystemModstamp` | `string` | No | — | | `organization_id` | `string` | No | — | > **ChangeEventHeader full type** > > ```ts theme={null} > { > entityName?: string, > changeType?: string, > recordIds?: string[], > commitTimestamp?: number, > commitUser?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} salesforce({ webhookHooks: { newOrUpdatedOpportunity: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Task Created Or Completed ### Task Created Or Completed `taskCreatedOrCompleted` Task created or completed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `ChangeEventHeader` | `object` | No | — | | `Id` | `string` | No | — | | `id` | `string` | No | — | | `sobject` | `string` | No | — | | `type` | `string` | No | — | | `Status` | `string` | No | — | | `LastModifiedDate` | `string` | No | — | | `SystemModstamp` | `string` | No | — | | `organization_id` | `string` | No | — | > **ChangeEventHeader full type** > > ```ts theme={null} > { > entityName?: string, > changeType?: string, > recordIds?: string[], > commitTimestamp?: number, > commitUser?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > success: boolean > } > ``` **`webhookHooks` example** ```ts theme={null} salesforce({ webhookHooks: { taskCreatedOrCompleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/saperly/api API reference for Saperly: every `saperly.api.*` operation with input and output types. Every `saperly.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Assistant ### answer `assistant.answer` Ask the workspace assistant a question **Risk:** `write` ```ts theme={null} await corsair.saperly.api.assistant.answer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceSlug` | `string` | Yes | — | | `question` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `answer` | `string` | Yes | — | | `provider` | `workers-ai \| openai-compatible \| mock` | Yes | — | | `modelId` | `string` | Yes | — | | `usedTools` | `string[]` | Yes | — | | `assistantConfigured` | `boolean` | Yes | — | *** ## Calls ### end `calls.end` Hang up a live call **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.saperly.api.calls.end({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `numberId` | `string` | Yes | — | | `direction` | `inbound \| outbound` | Yes | — | | `to` | `string` | Yes | — | | `from` | `string` | Yes | — | | `status` | `string` | Yes | — | | `rateCentsPerMin` | `number` | No | — | | `durationSec` | `number` | No | — | | `costCents` | `number` | No | — | | `hasRecording` | `boolean` | Yes | — | | `hasTranscript` | `boolean` | Yes | — | | `createdAt` | `string` | Yes | — | *** ### get `calls.get` Get a call by id **Risk:** `read` ```ts theme={null} await corsair.saperly.api.calls.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `numberId` | `string` | Yes | — | | `direction` | `inbound \| outbound` | Yes | — | | `to` | `string` | Yes | — | | `from` | `string` | Yes | — | | `status` | `string` | Yes | — | | `rateCentsPerMin` | `number` | No | — | | `durationSec` | `number` | No | — | | `costCents` | `number` | No | — | | `hasRecording` | `boolean` | Yes | — | | `hasTranscript` | `boolean` | Yes | — | | `createdAt` | `string` | Yes | — | *** ### list `calls.list` List calls **Risk:** `read` ```ts theme={null} await corsair.saperly.api.calls.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > numberId: string, > direction: inbound | outbound, > to: string, > from: string, > status: string, > rateCentsPerMin?: number | null, > durationSec?: number | null, > costCents?: number | null, > hasRecording: boolean, > hasTranscript: boolean, > createdAt: string > }[] > ``` *** ### place `calls.place` Place an outbound call. Reserves prepaid balance **Risk:** `write` ```ts theme={null} await corsair.saperly.api.calls.place({ fromNumberId: 'num_01H', to: '+15555550123' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fromNumberId` | `string` | Yes | — | | `to` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `instructions` | `string` | No | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `numberId` | `string` | Yes | — | | `direction` | `inbound \| outbound` | Yes | — | | `to` | `string` | Yes | — | | `from` | `string` | Yes | — | | `status` | `string` | Yes | — | | `rateCentsPerMin` | `number` | No | — | | `durationSec` | `number` | No | — | | `costCents` | `number` | No | — | | `hasRecording` | `boolean` | Yes | — | | `hasTranscript` | `boolean` | Yes | — | | `createdAt` | `string` | Yes | — | *** ### recording `calls.recording` Read the call recording download URL **Risk:** `read` ```ts theme={null} await corsair.saperly.api.calls.recording({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | *** ### transcript `calls.transcript` Read a call transcript **Risk:** `read` ```ts theme={null} await corsair.saperly.api.calls.transcript({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### transfer `calls.transfer` Blind-transfer a live call **Risk:** `write` ```ts theme={null} await corsair.saperly.api.calls.transfer({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `to` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `numberId` | `string` | Yes | — | | `direction` | `inbound \| outbound` | Yes | — | | `to` | `string` | Yes | — | | `from` | `string` | Yes | — | | `status` | `string` | Yes | — | | `rateCentsPerMin` | `number` | No | — | | `durationSec` | `number` | No | — | | `costCents` | `number` | No | — | | `hasRecording` | `boolean` | Yes | — | | `hasTranscript` | `boolean` | Yes | — | | `createdAt` | `string` | Yes | — | *** ## Connections ### create `connections.create` Create a hosted or manual connection **Risk:** `write` ```ts theme={null} await corsair.saperly.api.connections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `mode` | `hosted \| manual` | No | — | | `backend` | `network \| openai_realtime` | No | — | | `instructions` | `string` | No | — | | `llm` | `object` | No | — | | `tts` | `object` | No | — | | `backgroundAudio` | `object` | No | — | | `language` | `string` | No | — | | `mcpServers` | `object` | No | — | | `callControl` | `object` | No | — | | `complianceEnabled` | `boolean` | No | — | | `smsAutoReply` | `boolean` | No | — | | `disclosure` | `string` | No | — | | `openaiRealtime` | `object` | No | — | | `manualWebhookUrl` | `string` | No | — | | `idempotencyKey` | `string` | No | — | > **llm full type** > > ```ts theme={null} > { > kind: managed, > model: string > } | null > ``` > **tts full type** > > ```ts theme={null} > { > provider?: string | null, > voiceId: string > } | null > ``` > **backgroundAudio full type** > > ```ts theme={null} > { > type: off > } | { > type: office, > volume: number > } | null > ``` > **mcpServers full type** > > ```ts theme={null} > { > url: string, > auth?: { > type: bearer | none, > token?: string | null > } | null, > allowedTools?: string[] | null > }[] | null > ``` > **callControl full type** > > ```ts theme={null} > { > endCall?: boolean | null, > sendDtmf?: boolean | null, > transfer?: { > targets: string[], > from?: string | null > } | null > } | null > ``` > **openaiRealtime full type** > > ```ts theme={null} > { > model: string, > voice?: string | null > } | null > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `mode` | `hosted \| manual` | Yes | — | | `instructions` | `string` | Yes | — | | `llm` | `object` | No | — | | `backgroundAudio` | `object` | No | — | | `language` | `string` | No | — | | `mcpServers` | `object[]` | No | — | | `callControl` | `object` | No | — | | `complianceEnabled` | `boolean` | Yes | — | | `smsAutoReply` | `boolean` | Yes | — | | `disclosure` | `string` | Yes | — | | `recordingEnabled` | `boolean` | Yes | — | | `openaiRealtime` | `object` | No | — | | `manualSecret` | `string` | No | — | | `manualWebhookUrl` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `backend` | `network \| openai_realtime` | Yes | — | | `tts` | `object` | No | — | > **llm full type** > > ```ts theme={null} > { > kind: managed, > model: string > } > ``` > **backgroundAudio full type** > > ```ts theme={null} > { > type: off > } | { > type: office, > volume: number > } > ``` > **mcpServers full type** > > ```ts theme={null} > { > url: string, > auth?: { > type: bearer | none, > token?: string | null > } | null, > allowedTools?: string[] | null > }[] > ``` > **callControl full type** > > ```ts theme={null} > { > endCall?: boolean | null, > sendDtmf?: boolean | null, > transfer?: { > targets: string[], > from?: string | null > } | null > } > ``` > **openaiRealtime full type** > > ```ts theme={null} > { > model: string, > voice?: string | null > } > ``` > **tts full type** > > ```ts theme={null} > { > voiceId: string > } > ``` *** ### delete `connections.delete` Delete a connection **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.saperly.api.connections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ### get `connections.get` Get a connection by id **Risk:** `read` ```ts theme={null} await corsair.saperly.api.connections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `mode` | `hosted \| manual` | Yes | — | | `instructions` | `string` | Yes | — | | `llm` | `object` | No | — | | `backgroundAudio` | `object` | No | — | | `language` | `string` | No | — | | `mcpServers` | `object[]` | No | — | | `callControl` | `object` | No | — | | `complianceEnabled` | `boolean` | Yes | — | | `smsAutoReply` | `boolean` | Yes | — | | `disclosure` | `string` | Yes | — | | `recordingEnabled` | `boolean` | Yes | — | | `openaiRealtime` | `object` | No | — | | `manualSecret` | `string` | No | — | | `manualWebhookUrl` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `backend` | `network \| openai_realtime` | Yes | — | | `tts` | `object` | No | — | > **llm full type** > > ```ts theme={null} > { > kind: managed, > model: string > } > ``` > **backgroundAudio full type** > > ```ts theme={null} > { > type: off > } | { > type: office, > volume: number > } > ``` > **mcpServers full type** > > ```ts theme={null} > { > url: string, > auth?: { > type: bearer | none, > token?: string | null > } | null, > allowedTools?: string[] | null > }[] > ``` > **callControl full type** > > ```ts theme={null} > { > endCall?: boolean | null, > sendDtmf?: boolean | null, > transfer?: { > targets: string[], > from?: string | null > } | null > } > ``` > **openaiRealtime full type** > > ```ts theme={null} > { > model: string, > voice?: string | null > } > ``` > **tts full type** > > ```ts theme={null} > { > voiceId: string > } > ``` *** ### list `connections.list` List connections in the workspace **Risk:** `read` ```ts theme={null} await corsair.saperly.api.connections.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > mode: hosted | manual, > instructions: string, > llm?: { > kind: managed, > model: string > } | null, > backgroundAudio?: { > type: off > } | { > type: office, > volume: number > } | null, > language?: string | null, > mcpServers?: { > url: string, > auth?: { > type: bearer | none, > token?: string | null > } | null, > allowedTools?: string[] | null > }[] | null, > callControl?: { > endCall?: boolean | null, > sendDtmf?: boolean | null, > transfer?: { > targets: string[], > from?: string | null > } | null > } | null, > complianceEnabled: boolean, > smsAutoReply: boolean, > disclosure: string, > recordingEnabled: boolean, > openaiRealtime?: { > model: string, > voice?: string | null > } | null, > manualSecret?: string | null, > manualWebhookUrl?: string | null, > createdAt: string, > backend: network | openai_realtime, > tts?: { > voiceId: string > } | null > }[] > ``` *** ### update `connections.update` Update a connection **Risk:** `write` ```ts theme={null} await corsair.saperly.api.connections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `mode` | `hosted \| manual` | No | — | | `backend` | `network \| openai_realtime` | No | — | | `instructions` | `string` | No | — | | `llm` | `object` | No | — | | `tts` | `object` | No | — | | `backgroundAudio` | `object` | No | — | | `language` | `string` | No | — | | `mcpServers` | `object` | No | — | | `callControl` | `object` | No | — | | `complianceEnabled` | `boolean` | No | — | | `smsAutoReply` | `boolean` | No | — | | `disclosure` | `string` | No | — | | `openaiRealtime` | `object` | No | — | | `manualWebhookUrl` | `string` | No | — | | `idempotencyKey` | `string` | No | — | > **llm full type** > > ```ts theme={null} > { > kind: managed, > model: string > } | null > ``` > **tts full type** > > ```ts theme={null} > { > provider?: string | null, > voiceId: string > } | null > ``` > **backgroundAudio full type** > > ```ts theme={null} > { > type: off > } | { > type: office, > volume: number > } | null > ``` > **mcpServers full type** > > ```ts theme={null} > { > url: string, > auth?: { > type: bearer | none, > token?: string | null > } | null, > allowedTools?: string[] | null > }[] | null > ``` > **callControl full type** > > ```ts theme={null} > { > endCall?: boolean | null, > sendDtmf?: boolean | null, > transfer?: { > targets: string[], > from?: string | null > } | null > } | null > ``` > **openaiRealtime full type** > > ```ts theme={null} > { > model: string, > voice?: string | null > } | null > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `mode` | `hosted \| manual` | Yes | — | | `instructions` | `string` | Yes | — | | `llm` | `object` | No | — | | `backgroundAudio` | `object` | No | — | | `language` | `string` | No | — | | `mcpServers` | `object[]` | No | — | | `callControl` | `object` | No | — | | `complianceEnabled` | `boolean` | Yes | — | | `smsAutoReply` | `boolean` | Yes | — | | `disclosure` | `string` | Yes | — | | `recordingEnabled` | `boolean` | Yes | — | | `openaiRealtime` | `object` | No | — | | `manualSecret` | `string` | No | — | | `manualWebhookUrl` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `backend` | `network \| openai_realtime` | Yes | — | | `tts` | `object` | No | — | > **llm full type** > > ```ts theme={null} > { > kind: managed, > model: string > } > ``` > **backgroundAudio full type** > > ```ts theme={null} > { > type: off > } | { > type: office, > volume: number > } > ``` > **mcpServers full type** > > ```ts theme={null} > { > url: string, > auth?: { > type: bearer | none, > token?: string | null > } | null, > allowedTools?: string[] | null > }[] > ``` > **callControl full type** > > ```ts theme={null} > { > endCall?: boolean | null, > sendDtmf?: boolean | null, > transfer?: { > targets: string[], > from?: string | null > } | null > } > ``` > **openaiRealtime full type** > > ```ts theme={null} > { > model: string, > voice?: string | null > } > ``` > **tts full type** > > ```ts theme={null} > { > voiceId: string > } > ``` *** ## Consent ### check `consent.check` Check whether a contact has active consent **Risk:** `read` ```ts theme={null} await corsair.saperly.api.consent.check({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `numberId` | `string` | Yes | — | | `peerNumber` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hasConsent` | `boolean` | Yes | — | | `type` | `implied_inbound \| explicit_outbound` | No | — | *** ### list `consent.list` List consent records **Risk:** `read` ```ts theme={null} await corsair.saperly.api.consent.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > numberId: string, > peerNumber: string, > consentType: implied_inbound | explicit_outbound, > source: string, > grantedAt: string, > revokedAt?: string | null > }[] > ``` *** ### record `consent.record` Record consent for a contact **Risk:** `write` ```ts theme={null} await corsair.saperly.api.consent.record({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `numberId` | `string` | Yes | — | | `peerNumber` | `string` | Yes | — | | `consentType` | `implied_inbound \| explicit_outbound` | Yes | — | | `source` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `numberId` | `string` | Yes | — | | `peerNumber` | `string` | Yes | — | | `consentType` | `implied_inbound \| explicit_outbound` | Yes | — | | `source` | `string` | Yes | — | | `grantedAt` | `string` | Yes | — | | `revokedAt` | `string` | No | — | *** ### revoke `consent.revoke` Revoke consent for a contact **Risk:** `destructive` ```ts theme={null} await corsair.saperly.api.consent.revoke({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `numberId` | `string` | Yes | — | | `peerNumber` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ## Custom Voices ### create `customVoices.create` Upload a custom voice sample **Risk:** `write` ```ts theme={null} await corsair.saperly.api.customVoices.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `language` | `string` | Yes | — | | `gender` | `male \| female \| neutral` | Yes | — | | `audio` | `custom` | Yes | — | | `idempotencyKey` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `language` | `string` | Yes | — | | `gender` | `male \| female \| neutral` | Yes | — | | `status` | `pending \| active \| failed \| expired` | Yes | — | | `failureReason` | `string` | No | — | | `deletionPending` | `boolean` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | *** ### delete `customVoices.delete` Delete a custom voice **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.saperly.api.customVoices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ### get `customVoices.get` Get a custom voice by id **Risk:** `read` ```ts theme={null} await corsair.saperly.api.customVoices.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `language` | `string` | Yes | — | | `gender` | `male \| female \| neutral` | Yes | — | | `status` | `pending \| active \| failed \| expired` | Yes | — | | `failureReason` | `string` | No | — | | `deletionPending` | `boolean` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | *** ### list `customVoices.list` List custom voices **Risk:** `read` ```ts theme={null} await corsair.saperly.api.customVoices.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > language: string, > gender: male | female | neutral, > status: pending | active | failed | expired, > failureReason?: string | null, > deletionPending?: boolean | null, > createdAt: string, > updatedAt: string > }[] > ``` *** ## Health ### check `health.check` Liveness probe **Risk:** `read` ```ts theme={null} await corsair.saperly.api.health.check({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `ok` | Yes | — | *** ## Keys ### list `keys.list` List API keys. Requires the admin scope **Risk:** `read` ```ts theme={null} await corsair.saperly.api.keys.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > token: string, > prefix: string, > scopes: read | write | admin[], > lastUsedAt?: string | null, > createdAt: string, > numberScope?: string[] | null, > spendLimitCents?: number | null, > spendLimitResetPeriod?: monthly | null, > spentThisPeriodCents?: number | null, > canProvisionKeys?: boolean | null, > permissions?: string[] | null, > mintedByTokenId?: string | null > }[] > ``` *** ### mint `keys.mint` Mint a child API key. The plaintext token is returned once **Risk:** `write` ```ts theme={null} await corsair.saperly.api.keys.mint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `scopes` | `read \| write \| admin[]` | Yes | — | | `numberScope` | `string[] \| null` | No | — | | `spendLimitCents` | `number \| null` | No | — | | `spendLimitResetPeriod` | `monthly \| null` | No | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `prefix` | `string` | Yes | — | | `scopes` | `read \| write \| admin[]` | Yes | — | | `lastUsedAt` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `token` | `string` | Yes | — | *** ### revoke `keys.revoke` Revoke an API key **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.saperly.api.keys.revoke({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ## Languages ### list `languages.list` List supported spoken languages **Risk:** `read` ```ts theme={null} await corsair.saperly.api.languages.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > code: string, > name: string > }[] > ``` *** ## Messages ### list `messages.list` List SMS messages, optionally for one number **Risk:** `read` ```ts theme={null} await corsair.saperly.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `numberId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > numberId: string, > direction: inbound | outbound, > to: string, > from: string, > body: string, > segments: number, > status: string, > createdAt: string > }[] > ``` *** ### send `messages.send` Send an SMS. Billed per segment **Risk:** `write` ```ts theme={null} await corsair.saperly.api.messages.send({ fromNumberId: 'num_01H', to: '+15555550123', body: 'Hello from Corsair' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fromNumberId` | `string` | Yes | — | | `to` | `string` | Yes | — | | `body` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `numberId` | `string` | Yes | — | | `direction` | `inbound \| outbound` | Yes | — | | `to` | `string` | Yes | — | | `from` | `string` | Yes | — | | `body` | `string` | Yes | — | | `segments` | `number` | Yes | — | | `status` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | *** ## Numbers ### assignConnection `numbers.assignConnection` Bind a connection to a phone number **Risk:** `write` ```ts theme={null} await corsair.saperly.api.numbers.assignConnection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `connectionId` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `phoneNumber` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `webhookUrl` | `string` | No | — | | `smsSenderId` | `string` | No | — | | `callerIdName` | `string` | No | — | | `country` | `string` | No | — | | `numberType` | `string` | No | — | | `monthlyPriceCents` | `number` | No | — | | `currency` | `string` | No | — | | `nextChargeAt` | `string` | No | — | | `releasedAt` | `string` | No | — | | `createdAt` | `string` | Yes | — | *** ### get `numbers.get` Get a phone number by id **Risk:** `read` ```ts theme={null} await corsair.saperly.api.numbers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `phoneNumber` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `webhookUrl` | `string` | No | — | | `smsSenderId` | `string` | No | — | | `callerIdName` | `string` | No | — | | `country` | `string` | No | — | | `numberType` | `string` | No | — | | `monthlyPriceCents` | `number` | No | — | | `currency` | `string` | No | — | | `nextChargeAt` | `string` | No | — | | `releasedAt` | `string` | No | — | | `createdAt` | `string` | Yes | — | *** ### list `numbers.list` List phone numbers in the workspace **Risk:** `read` ```ts theme={null} await corsair.saperly.api.numbers.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > phoneNumber: string, > connectionId?: string | null, > webhookUrl?: string | null, > smsSenderId?: string | null, > callerIdName?: string | null, > country?: string | null, > numberType?: string | null, > monthlyPriceCents?: number | null, > currency?: string | null, > nextChargeAt?: string | null, > releasedAt?: string | null, > createdAt: string > }[] > ``` *** ### provision `numbers.provision` Provision a phone number. Reserves prepaid balance **Risk:** `write` ```ts theme={null} await corsair.saperly.api.numbers.provision({ areaCode: '415', idempotencyKey: '3f1d6c5e-2b7a-4f0e-9c2d-8a1b6e4f0c11' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | — | | `numberType` | `string` | No | — | | `areaCode` | `string` | No | — | | `expectedMonthlyPriceCents` | `number` | No | — | | `expectedUpfrontPriceCents` | `number` | No | — | | `approveHigherPrice` | `boolean` | No | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `phoneNumber` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `webhookUrl` | `string` | No | — | | `smsSenderId` | `string` | No | — | | `callerIdName` | `string` | No | — | | `country` | `string` | No | — | | `numberType` | `string` | No | — | | `monthlyPriceCents` | `number` | No | — | | `currency` | `string` | No | — | | `nextChargeAt` | `string` | No | — | | `releasedAt` | `string` | No | — | | `createdAt` | `string` | Yes | — | *** ### release `numbers.release` Release a phone number **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.saperly.api.numbers.release({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ### setCallerId `numbers.setCallerId` Set or clear the outbound caller ID name **Risk:** `write` ```ts theme={null} await corsair.saperly.api.numbers.setCallerId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `callerIdName` | `string \| null` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `phoneNumber` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `webhookUrl` | `string` | No | — | | `smsSenderId` | `string` | No | — | | `callerIdName` | `string` | No | — | | `country` | `string` | No | — | | `numberType` | `string` | No | — | | `monthlyPriceCents` | `number` | No | — | | `currency` | `string` | No | — | | `nextChargeAt` | `string` | No | — | | `releasedAt` | `string` | No | — | | `createdAt` | `string` | Yes | — | *** ### setSmsSender `numbers.setSmsSender` Set or clear the alphanumeric SMS sender id **Risk:** `write` ```ts theme={null} await corsair.saperly.api.numbers.setSmsSender({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `smsSenderId` | `string \| null` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `phoneNumber` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `webhookUrl` | `string` | No | — | | `smsSenderId` | `string` | No | — | | `callerIdName` | `string` | No | — | | `country` | `string` | No | — | | `numberType` | `string` | No | — | | `monthlyPriceCents` | `number` | No | — | | `currency` | `string` | No | — | | `nextChargeAt` | `string` | No | — | | `releasedAt` | `string` | No | — | | `createdAt` | `string` | Yes | — | *** ### setWebhook `numbers.setWebhook` Set the per-number manual-mode brain URL **Risk:** `write` ```ts theme={null} await corsair.saperly.api.numbers.setWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `idempotencyKey` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `phoneNumber` | `string` | Yes | — | | `connectionId` | `string` | No | — | | `webhookUrl` | `string` | No | — | | `smsSenderId` | `string` | No | — | | `callerIdName` | `string` | No | — | | `country` | `string` | No | — | | `numberType` | `string` | No | — | | `monthlyPriceCents` | `number` | No | — | | `currency` | `string` | No | — | | `nextChargeAt` | `string` | No | — | | `releasedAt` | `string` | No | — | | `createdAt` | `string` | Yes | — | *** ## Pricing ### quote `pricing.quote` Quote the monthly and upfront price of a number **Risk:** `read` ```ts theme={null} await corsair.saperly.api.pricing.quote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country` | `string` | Yes | — | | `numberType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `customerMonthlyCents` | `number` | Yes | — | | `customerUpfrontCents` | `number` | Yes | — | *** ## Usage ### summary `usage.summary` Read usage and the prepaid balance **Risk:** `read` ```ts theme={null} await corsair.saperly.api.usage.summary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `calls` | `object` | Yes | — | | `messages` | `object` | Yes | — | | `balanceCents` | `number` | Yes | — | > **calls full type** > > ```ts theme={null} > { > count: number, > totalCostCents: number, > totalDurationSec: number > } > ``` > **messages full type** > > ```ts theme={null} > { > count: number > } > ``` *** ## Voices ### list `voices.list` List in-network voices **Risk:** `read` ```ts theme={null} await corsair.saperly.api.voices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `language` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > gender: string, > language: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/saperly/database Saperly local sync: searchable entities, `.search()` filters, and operators. The Saperly plugin syncs data locally. Use `corsair.saperly.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/saperly/overview Phone numbers, voice, and SMS for AI agents. The workspace is resolved from a bearer API key. Use **Saperly** through Corsair: one client, typed API calls, and incoming webhooks. **What you get:** * 39 typed API operations * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/saperly ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/saperly ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/saperly ``` ```bash bun theme={null} bun add corsair @corsair-dev/saperly ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { saperly } from '@corsair-dev/saperly'; export const corsair = createCorsair({ plugins: [ saperly(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} saperly() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'saperly', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`calls.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.saperly.api.calls.get({}); ``` **`assistant.answer`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.saperly.api.assistant.answer({}); ``` See the full list on the [API](/plugins/saperly/api) page. ## Webhooks This plugin registers **1** webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/saperly/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/saperly/api)** > > Every `saperly.api.*` operation with input and output types. > **[Webhooks](/plugins/saperly/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/saperly/webhooks Saperly incoming webhooks: event paths, payloads, and response data. The Saperly plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/saperly/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `events` * `delivery` (`events.delivery`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Events ### Delivery `events.delivery` Signed call and SMS deliveries. The handler confirms the resource with the API before returning success. **Payload** | Name | Type | Required | Description | | - | - | - | - | | `deliveryId` | `string` | Yes | — | | `eventType` | `string` | Yes | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > callId?: string, > messageId?: string, > numberId?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > eventType: string, > deliveryId: string, > resource: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} saperly({ webhookHooks: { events: { delivery: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # Database Source: https://docs.corsair.dev/plugins/sapsuccessfactors/database SAP SuccessFactors local sync: searchable entities, `.search()` filters, and operators. The SAP SuccessFactors plugin syncs data locally. Use `corsair.sapsuccessfactors.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Calibration Session Path: `sapsuccessfactors.db.calibrationSession.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.calibrationSession.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `sessionId` | `string` | equals, contains, startsWith, endsWith, in | | `sessionName` | `string` | equals, contains, startsWith, endsWith, in | | `sessionOwnerId` | `string` | equals, contains, startsWith, endsWith, in | | `sessionType` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `endDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Candidate Path: `sapsuccessfactors.db.candidate.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.candidate.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `primaryEmail` | `string` | equals, contains, startsWith, endsWith, in | | `contactEmail` | `string` | equals, contains, startsWith, endsWith, in | | `cellPhone` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `currentTitle` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Company Path: `sapsuccessfactors.db.company.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.company.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `externalCode` | `string` | equals, contains, startsWith, endsWith, in | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `name_defaultValue` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `entityOID` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Employment Path: `sapsuccessfactors.db.employment.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.employment.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `personIdExternal` | `string` | equals, contains, startsWith, endsWith, in | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `endDate` | `string` | equals, contains, startsWith, endsWith, in | | `originalStartDate` | `string` | equals, contains, startsWith, endsWith, in | | `seniorityDate` | `string` | equals, contains, startsWith, endsWith, in | | `assignmentClass` | `string` | equals, contains, startsWith, endsWith, in | | `employmentType` | `string` | equals, contains, startsWith, endsWith, in | | `isContingentWorker` | `boolean` | equals | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Goal Path: `sapsuccessfactors.db.goal.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.goal.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `flag` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `metric` | `string` | equals, contains, startsWith, endsWith, in | | `done` | `number` | equals, gt, gte, lt, lte, in | | `start` | `string` | equals, contains, startsWith, endsWith, in | | `due` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Goal Plan Path: `sapsuccessfactors.db.goalPlan.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.goalPlan.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `dueDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Job Application Path: `sapsuccessfactors.db.jobApplication.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.jobApplication.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `appStatusSetId` | `string` | equals, contains, startsWith, endsWith, in | | `applicationDate` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Job Requisition Path: `sapsuccessfactors.db.jobRequisition.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.jobRequisition.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `internalStatus` | `string` | equals, contains, startsWith, endsWith, in | | `jobTitle` | `string` | equals, contains, startsWith, endsWith, in | | `jobCode` | `string` | equals, contains, startsWith, endsWith, in | | `department` | `string` | equals, contains, startsWith, endsWith, in | | `division` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `statusSetId` | `string` | equals, contains, startsWith, endsWith, in | | `appStatusSetId` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Person Path: `sapsuccessfactors.db.person.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.person.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `personIdExternal` | `string` | equals, contains, startsWith, endsWith, in | | `personId` | `string` | equals, contains, startsWith, endsWith, in | | `dateOfBirth` | `string` | equals, contains, startsWith, endsWith, in | | `countryOfBirth` | `string` | equals, contains, startsWith, endsWith, in | | `regionOfBirth` | `string` | equals, contains, startsWith, endsWith, in | | `placeOfBirth` | `string` | equals, contains, startsWith, endsWith, in | | `perPersonUuid` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Personal Path: `sapsuccessfactors.db.personal.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.personal.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `personIdExternal` | `string` | equals, contains, startsWith, endsWith, in | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `endDate` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `middleName` | `string` | equals, contains, startsWith, endsWith, in | | `formalName` | `string` | equals, contains, startsWith, endsWith, in | | `birthName` | `string` | equals, contains, startsWith, endsWith, in | | `gender` | `string` | equals, contains, startsWith, endsWith, in | | `maritalStatus` | `string` | equals, contains, startsWith, endsWith, in | | `nationality` | `string` | equals, contains, startsWith, endsWith, in | | `preferredName` | `string` | equals, contains, startsWith, endsWith, in | | `salutation` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Position Path: `sapsuccessfactors.db.position.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.position.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `effectiveStartDate` | `string` | equals, contains, startsWith, endsWith, in | | `effectiveEndDate` | `string` | equals, contains, startsWith, endsWith, in | | `effectiveStatus` | `string` | equals, contains, startsWith, endsWith, in | | `externalName_defaultValue` | `string` | equals, contains, startsWith, endsWith, in | | `jobCode` | `string` | equals, contains, startsWith, endsWith, in | | `department` | `string` | equals, contains, startsWith, endsWith, in | | `division` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `payGrade` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## User Path: `sapsuccessfactors.db.user.search` ```ts theme={null} const rows = await corsair.sapsuccessfactors.db.user.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `defaultFullName` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `mi` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `department` | `string` | equals, contains, startsWith, endsWith, in | | `division` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `managerId` | `string` | equals, contains, startsWith, endsWith, in | | `hrId` | `string` | equals, contains, startsWith, endsWith, in | | `hireDate` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastModified` | `string` | equals, contains, startsWith, endsWith, in | | `timeZone` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `zipCode` | `string` | equals, contains, startsWith, endsWith, in | | `addressLine1` | `string` | equals, contains, startsWith, endsWith, in | | `businessPhone` | `string` | equals, contains, startsWith, endsWith, in | | `cellPhone` | `string` | equals, contains, startsWith, endsWith, in | | `empId` | `string` | equals, contains, startsWith, endsWith, in | | `totalTeamSize` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/sapsuccessfactors/overview Cloud HR suite for employee records, recruiting, performance, and workforce management. Use **SAP SuccessFactors** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 64 typed API operations * 12 synced entities (`calibrationSession`, `candidate`, `company`, `employment`, `goal`, `goalPlan`, and 6 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/sapsuccessfactors ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/sapsuccessfactors ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/sapsuccessfactors ``` ```bash bun theme={null} bun add corsair @corsair-dev/sapsuccessfactors ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { sapsuccessfactors } from '@corsair-dev/sapsuccessfactors'; export const corsair = createCorsair({ plugins: [ sapsuccessfactors(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your SAP SuccessFactors OAuth app. ```ts theme={null} sapsuccessfactors() ``` More: [OAuth 2.0](/concepts/oauth) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. ```ts theme={null} sapsuccessfactors({ authType: 'api_key', }) ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'sapsuccessfactors', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`application.getApplicationInterview`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.sapsuccessfactors.api.application.getApplicationInterview({}); ``` **`a.createAFeedbackRequest`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.sapsuccessfactors.api.a.createAFeedbackRequest({}); ``` See the full list on the [API](/plugins/sapsuccessfactors/api) page. ## Query synced data Synced entities support `tenant.sapsuccessfactors.db..search()` and `.list()`: `calibrationSession`, `candidate`, `company`, `employment`, `goal`, `goalPlan`, `jobApplication`, `jobRequisition`, `person`, `personal`, `position`, `user`. See [Database](/plugins/sapsuccessfactors/database) for filters and operators. ## What's next > **[API reference](/plugins/sapsuccessfactors/api)** > > Every `sapsuccessfactors.api.*` operation with input and output types. > **[Database](/plugins/sapsuccessfactors/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/scaleai/api API reference for Scale AI: every `scaleai.api.*` operation with input and output types. Every `scaleai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Audits ### getFixlessAudits `audits.getFixlessAudits` Retrieve fixless audits by task id or audit id **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.audits.getFixlessAudits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | No | — | | `id` | `string` | No | — | **Output:** `any` *** ## Batches ### createBatch `batches.createBatch` Create a new batch within a project **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.batches.createBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `name` | `string` | Yes | — | | `callback` | `string` | No | — | | `calibration_batch` | `boolean` | No | — | | `self_label_batch` | `boolean` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `project` | `string` | No | — | | `status` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `callback` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### finalizeBatch `batches.finalizeBatch` Finalize a batch so its tasks can be worked on **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.batches.finalizeBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `project` | `string` | No | — | | `status` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `callback` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### getBatch `batches.getBatch` Retrieve a batch by name **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.batches.getBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `project` | `string` | No | — | | `status` | `string` | No | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `callback` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### getBatchStatus `batches.getBatchStatus` Retrieve a batch status with task completion counts **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.batches.getBatchStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batchName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `tasks_pending` | `number` | No | — | | `tasks_completed` | `number` | No | — | | `tasks_error` | `number` | No | — | | `tasks_canceled` | `number` | No | — | *** ### listBatches `batches.listBatches` List batches newest-first with pagination **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.batches.listBatches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `status` | `string` | No | — | | `start_time` | `string` | No | — | | `end_time` | `string` | No | — | | `exclude_archived` | `boolean` | No | — | | `detailed` | `boolean` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `docs` | `object[]` | Yes | — | | `totalDocs` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `has_more` | `boolean` | No | — | > **docs full type** > > ```ts theme={null} > { > name: string, > project?: string, > status?: string, > created_at?: string, > completed_at?: string, > callback?: string, > metadata?: { > } > }[] > ``` *** ## Files ### getAssets `files.getAssets` List file assets filtered by project and metadata (paginated) **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.files.getAssets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `metadata` | `object` | No | — | | `limit` | `number` | No | — | | `next_token` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `docs` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `next_token` | `string` | No | — | | `total` | `number` | No | — | > **docs full type** > > ```ts theme={null} > { > id?: string, > attachment_url?: string, > created_at?: string > }[] > ``` *** ### importFile `files.importFile` Import a file into Scale from a remote URL **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.files.importFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_url` | `string` | Yes | — | | `project_name` | `string` | No | — | | `reference_id` | `string` | No | — | | `attachment_type` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `attachment_url` | `string` | No | — | | `created_at` | `string` | No | — | *** ### uploadFile `files.uploadFile` Upload a local file (base64) to Scale, max 80 MB **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.files.uploadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_base64` | `string` | Yes | — | | `file_name` | `string` | Yes | — | | `mime_type` | `string` | No | — | | `project_name` | `string` | No | — | | `reference_id` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `attachment_url` | `string` | No | — | | `created_at` | `string` | No | — | *** ## Projects ### getProject `projects.getProject` Retrieve a project by name **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.projects.getProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `name` | `string` | Yes | — | | `param_history` | `object[]` | No | — | | `created_at` | `string` | No | — | | `archived` | `boolean` | No | — | > **param\_history full type** > > ```ts theme={null} > { > }[] > ``` *** ### listProjects `projects.listProjects` List all projects, optionally filtered by archived state **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.projects.listProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `archived` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > type?: string, > name: string, > param_history?: { > }[], > created_at?: string, > archived?: boolean > }[] > ``` *** ### setProjectOntology `projects.setProjectOntology` Set the ontology (label classes) for a project **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.projects.setProjectOntology({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `ontology` | `object` | No | — | > **ontology full type** > > ```ts theme={null} > any[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `name` | `string` | Yes | — | | `param_history` | `object[]` | No | — | | `created_at` | `string` | No | — | | `archived` | `boolean` | No | — | > **param\_history full type** > > ```ts theme={null} > { > }[] > ``` *** ### setProjectParams `projects.setProjectParams` Set default task parameters for a project **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.projects.setProjectParams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | Yes | — | | `patch` | `boolean` | No | — | | `instruction` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `name` | `string` | Yes | — | | `param_history` | `object[]` | No | — | | `created_at` | `string` | No | — | | `archived` | `boolean` | No | — | > **param\_history full type** > > ```ts theme={null} > { > }[] > ``` *** ## Quality ### getQualityLabelers `quality.getQualityLabelers` Retrieve labeler training attempts by quality task id or email **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.quality.getQualityLabelers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `quality_task_ids` | `string[]` | No | — | | `labeler_emails` | `string[]` | No | — | **Output:** `any` *** ## Studio ### addStudioAssignments `studio.addStudioAssignments` Assign projects to Studio team members by email **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.studio.addStudioAssignments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `string[]` | Yes | — | | `projects` | `string[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getStudioAssignments `studio.getStudioAssignments` Retrieve current Studio project assignments per active user **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.studio.getStudioAssignments({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getStudioBatches `studio.getStudioBatches` List pending Studio batches ordered by priority **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.studio.getStudioBatches({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### removeStudioAssignments `studio.removeStudioAssignments` Unassign projects from Studio team members by email **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.studio.removeStudioAssignments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `string[]` | Yes | — | | `projects` | `string[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### resetBatchPriorities `studio.resetBatchPriorities` Reset Studio batch priority order to the default **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.studio.resetBatchPriorities({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### setBatchPriorities `studio.setBatchPriorities` Set the priority order of pending Studio batches **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.studio.setBatchPriorities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch_names` | `string[]` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ## Tasks ### addTaskTags `tasks.addTaskTags` Add tags to a task (duplicates ignored) **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.addTaskTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `tags` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### createDocumentTranscriptionTask `tasks.createDocumentTranscriptionTask` Create a document transcription / annotation task **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.createDocumentTranscriptionTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `callback_url` | `string` | No | — | | `instruction` | `string` | No | — | | `unique_id` | `string` | No | — | | `clear_unique_id_on_error` | `boolean` | No | — | | `metadata` | `object` | No | — | | `priority` | `number` | No | — | | `tags` | `string[]` | No | — | | `attachment` | `string` | No | — | | `attachments` | `string[]` | No | — | | `attachment_type` | `string` | No | — | | `fields` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **fields full type** > > ```ts theme={null} > { > }[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### createImageAnnotationTask `tasks.createImageAnnotationTask` Create an image annotation task (boxes, polygons, points, etc.) **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.createImageAnnotationTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `callback_url` | `string` | No | — | | `instruction` | `string` | No | — | | `unique_id` | `string` | No | — | | `clear_unique_id_on_error` | `boolean` | No | — | | `metadata` | `object` | No | — | | `priority` | `number` | No | — | | `tags` | `string[]` | No | — | | `attachment` | `string` | Yes | — | | `attachment_type` | `string` | No | — | | `geometries` | `object` | Yes | — | | `annotation_attributes` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **geometries full type** > > ```ts theme={null} > { > } > ``` > **annotation\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### createLidarAnnotationTask `tasks.createLidarAnnotationTask` Create a LiDAR 3D cuboid annotation task **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.createLidarAnnotationTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `callback_url` | `string` | No | — | | `instruction` | `string` | No | — | | `unique_id` | `string` | No | — | | `clear_unique_id_on_error` | `boolean` | No | — | | `metadata` | `object` | No | — | | `priority` | `number` | No | — | | `tags` | `string[]` | No | — | | `attachments` | `string[]` | No | — | | `attachment` | `string` | No | — | | `labels` | `object[]` | No | — | | `annotation_attributes` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **labels full type** > > ```ts theme={null} > ( > string | { > } > )[] > ``` > **annotation\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### createLidarSegmentationTask `tasks.createLidarSegmentationTask` Create a LiDAR point cloud semantic segmentation task **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.createLidarSegmentationTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `callback_url` | `string` | No | — | | `instruction` | `string` | No | — | | `unique_id` | `string` | No | — | | `clear_unique_id_on_error` | `boolean` | No | — | | `metadata` | `object` | No | — | | `priority` | `number` | No | — | | `tags` | `string[]` | No | — | | `attachments` | `string[]` | No | — | | `attachment` | `string` | No | — | | `labels` | `object[]` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **labels full type** > > ```ts theme={null} > ( > string | { > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### createNamedEntityRecognitionTask `tasks.createNamedEntityRecognitionTask` Create a named entity recognition task over text **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.createNamedEntityRecognitionTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `callback_url` | `string` | No | — | | `instruction` | `string` | No | — | | `unique_id` | `string` | No | — | | `clear_unique_id_on_error` | `boolean` | No | — | | `metadata` | `object` | No | — | | `priority` | `number` | No | — | | `tags` | `string[]` | No | — | | `text` | `string` | No | — | | `attachments` | `object[]` | No | — | | `labels` | `object[]` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **attachments full type** > > ```ts theme={null} > ( > string | { > } > )[] > ``` > **labels full type** > > ```ts theme={null} > ( > string | { > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### createSegmentationAnnotationTask `tasks.createSegmentationAnnotationTask` Create a semantic segmentation task classifying image pixels **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.createSegmentationAnnotationTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `callback_url` | `string` | No | — | | `instruction` | `string` | No | — | | `unique_id` | `string` | No | — | | `clear_unique_id_on_error` | `boolean` | No | — | | `metadata` | `object` | No | — | | `priority` | `number` | No | — | | `tags` | `string[]` | No | — | | `attachment` | `string` | Yes | — | | `labels` | `object[]` | Yes | — | | `allow_unlabeled` | `boolean` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **labels full type** > > ```ts theme={null} > ( > string | { > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### createTextCollectionTask `tasks.createTextCollectionTask` Create a text collection task gathering structured field data **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.createTextCollectionTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `callback_url` | `string` | No | — | | `instruction` | `string` | No | — | | `unique_id` | `string` | No | — | | `clear_unique_id_on_error` | `boolean` | No | — | | `metadata` | `object` | No | — | | `priority` | `number` | No | — | | `tags` | `string[]` | No | — | | `attachments` | `object[]` | No | — | | `fields` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **fields full type** > > ```ts theme={null} > { > }[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### createVideoAnnotationTask `tasks.createVideoAnnotationTask` Create a video annotation task across frames or video files **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.createVideoAnnotationTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `callback_url` | `string` | No | — | | `instruction` | `string` | No | — | | `unique_id` | `string` | No | — | | `clear_unique_id_on_error` | `boolean` | No | — | | `metadata` | `object` | No | — | | `priority` | `number` | No | — | | `tags` | `string[]` | No | — | | `attachment` | `string` | No | — | | `attachments` | `string[]` | No | — | | `attachment_type` | `string` | No | — | | `geometries` | `object` | Yes | — | | `annotation_attributes` | `object` | No | — | | `events_to_annotate` | `string[]` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **geometries full type** > > ```ts theme={null} > { > } > ``` > **annotation\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### createVideoPlaybackAnnotationTask `tasks.createVideoPlaybackAnnotationTask` Create a video playback annotation task for object tracking **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.createVideoPlaybackAnnotationTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `callback_url` | `string` | No | — | | `instruction` | `string` | No | — | | `unique_id` | `string` | No | — | | `clear_unique_id_on_error` | `boolean` | No | — | | `metadata` | `object` | No | — | | `priority` | `number` | No | — | | `tags` | `string[]` | No | — | | `attachment` | `string` | Yes | — | | `attachments` | `string[]` | No | — | | `geometries` | `object` | Yes | — | | `annotation_attributes` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **geometries full type** > > ```ts theme={null} > { > } > ``` > **annotation\_attributes full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### deleteTaskTags `tasks.deleteTaskTags` Remove tags from a task **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.deleteTaskTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `tags` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### deleteTaskUniqueId `tasks.deleteTaskUniqueId` Remove a task's unique\_id **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.deleteTaskUniqueId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### getTask `tasks.getTask` Retrieve a task by id including status, response and metadata **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.tasks.getTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### getTaskResponseUrl `tasks.getTaskResponseUrl` Fetch secure authenticated task response data for a task **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.tasks.getTaskResponseUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `uuid` | `string` | Yes | — | **Output:** `any` *** ### listTasks `tasks.listTasks` List tasks with filtering and cursor pagination **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.tasks.listTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `type` | `imageannotation \| segmentannotation \| videoannotation \| videoplaybackannotation \| lidarannotation \| lidarsegmentation \| lidartopdown \| namedentityrecognition \| textcollection \| documenttranscription \| categorization \| transcription \| comparison` | No | — | | `status` | `pending \| completed \| canceled \| error` | No | — | | `customer_review_status` | `accepted \| fixed \| commented \| rejected \| pending \| accepted \| fixed \| commented \| rejected \| pending[]` | No | — | | `unique_id` | `string \| string[]` | No | — | | `tags` | `string \| string[]` | No | — | | `start_time` | `string` | No | — | | `end_time` | `string` | No | — | | `completed_after` | `string` | No | — | | `completed_before` | `string` | No | — | | `updated_after` | `string` | No | — | | `updated_before` | `string` | No | — | | `include_attachment_url` | `boolean` | No | — | | `limited_response` | `boolean` | No | — | | `limit` | `number` | No | — | | `next_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `docs` | `object[]` | Yes | — | | `total` | `number` | No | — | | `count` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `has_more` | `boolean` | No | — | | `next_token` | `string` | No | — | > **docs full type** > > ```ts theme={null} > { > task_id: string, > created_at?: string, > updated_at?: string, > completed_at?: string, > type?: string, > status?: string, > instruction?: string, > params?: { > }, > callback_url?: string, > callback_completed?: boolean, > project?: string, > batch?: string, > metadata?: { > }, > response?: { > }, > audits?: { > }[], > tags?: string[], > unique_id?: string | null > }[] > ``` *** ### sendTaskCallback `tasks.sendTaskCallback` Re-send the callback for a completed or errored task **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.sendTaskCallback({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### setTaskMetadata `tasks.setTaskMetadata` Set the metadata object on a task (idempotent) **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.setTaskMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `metadata` | `object` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateTaskUniqueId `tasks.updateTaskUniqueId` Set or update a task's unique\_id **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.tasks.updateTaskUniqueId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `unique_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `instruction` | `string` | No | — | | `params` | `object` | No | — | | `callback_url` | `string` | No | — | | `callback_completed` | `boolean` | No | — | | `project` | `string` | No | — | | `batch` | `string` | No | — | | `metadata` | `object` | No | — | | `response` | `object` | No | — | | `audits` | `object[]` | No | — | | `tags` | `string[]` | No | — | | `unique_id` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **response full type** > > ```ts theme={null} > { > } > ``` > **audits full type** > > ```ts theme={null} > { > }[] > ``` *** ## Teams ### getTeams `teams.getTeams` List all team members with roles and notification preferences **Risk:** `read` ```ts theme={null} await corsair.scaleai.api.teams.getTeams({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id?: string, > id?: string, > email?: string, > role?: string, > disableRapidEmails?: boolean, > isStudioLabeler?: boolean > }[] > ``` *** ### inviteTeamMember `teams.inviteTeamMember` Invite users by email to the team with a role **Risk:** `write` ```ts theme={null} await corsair.scaleai.api.teams.inviteTeamMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `string[]` | Yes | — | | `role` | `labeler \| member \| manager` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > _id?: string, > id?: string, > email?: string, > role?: string, > disableRapidEmails?: boolean, > isStudioLabeler?: boolean > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/scaleai/database Scale AI local sync: searchable entities, `.search()` filters, and operators. The Scale AI plugin syncs data locally. Use `corsair.scaleai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Batches Path: `scaleai.db.batches.search` ```ts theme={null} const rows = await corsair.scaleai.db.batches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `completed_at` | `string` | equals, contains, startsWith, endsWith, in | | `callback` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Batch Statuses Path: `scaleai.db.batchStatuses.search` ```ts theme={null} const rows = await corsair.scaleai.db.batchStatuses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `tasks_pending` | `number` | equals, gt, gte, lt, lte, in | | `tasks_completed` | `number` | equals, gt, gte, lt, lte, in | | `tasks_error` | `number` | equals, gt, gte, lt, lte, in | | `tasks_canceled` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `scaleai.db.files.search` ```ts theme={null} const rows = await corsair.scaleai.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `attachment_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `scaleai.db.projects.search` ```ts theme={null} const rows = await corsair.scaleai.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `archived` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `scaleai.db.tasks.search` ```ts theme={null} const rows = await corsair.scaleai.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `task_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `completed_at` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `instruction` | `string` | equals, contains, startsWith, endsWith, in | | `callback_url` | `string` | equals, contains, startsWith, endsWith, in | | `callback_completed` | `boolean` | equals | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `batch` | `string` | equals, contains, startsWith, endsWith, in | | `unique_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teammates Path: `scaleai.db.teammates.search` ```ts theme={null} const rows = await corsair.scaleai.db.teammates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `disableRapidEmails` | `boolean` | equals | | `isStudioLabeler` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/scaleai/overview Scale AI plugin for Corsair — data labeling tasks, batches, projects and Studio Use **Scale AI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 40 typed API operations * 6 synced entities (`batches`, `batchStatuses`, `files`, `projects`, `tasks`, `teammates`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/scaleai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/scaleai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/scaleai ``` ```bash bun theme={null} bun add corsair @corsair-dev/scaleai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { scaleai } from '@corsair-dev/scaleai'; export const corsair = createCorsair({ plugins: [ scaleai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} scaleai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'scaleai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`audits.getFixlessAudits`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.scaleai.api.audits.getFixlessAudits({}); ``` **`batches.createBatch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.scaleai.api.batches.createBatch({}); ``` See the full list on the [API](/plugins/scaleai/api) page. ## Query synced data Synced entities support `tenant.scaleai.db..search()` and `.list()`: `batches`, `batchStatuses`, `files`, `projects`, `tasks`, `teammates`. See [Database](/plugins/scaleai/database) for filters and operators. ## What's next > **[API reference](/plugins/scaleai/api)** > > Every `scaleai.api.*` operation with input and output types. > **[Database](/plugins/scaleai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/scrapegraphai/api API reference for ScrapeGraphAI: every `scrapegraphai.api.*` operation with input and output types. Every `scrapegraphai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### credits `account.credits` Get remaining and used credit balance **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.account.credits({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `remaining_credits` | `number` | Yes | — | | `total_credits_used` | `number` | Yes | — | *** ### usageTimeline `account.usageTimeline` Get a timeline of past request usage **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.account.usageTimeline({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `days` | `7 \| 14 \| 30 \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `timeline` | `object[]` | Yes | — | > **timeline full type** > > ```ts theme={null} > { > service: string, > timestamp: string > }[] > ``` *** ### validateApiKey `account.validateApiKey` Validate that the configured API key is active **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.account.validateApiKey({}); ``` **Input:** *empty object* **Output:** *empty object* *** ## Agentic Scraper ### getLiveSessionUrl `agenticScraper.getLiveSessionUrl` Open a live, remotely-controllable browser session for a URL **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.agenticScraper.getLiveSessionUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `timeout` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `session_url` | `string` | Yes | — | | `session_id` | `string` | Yes | — | *** ### history `agenticScraper.history` List past agentic (browser-driven) scraper requests **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.agenticScraper.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | | `next_key` | `object` | No | — | > **requests full type** > > ```ts theme={null} > { > request_id: string, > user_id: string, > webpage_id: string, > website_url: string, > user_prompt?: string | null, > output_schema?: { > } | null, > requested_at: string, > finished_at?: string | null, > status: queued | processing | processinghtml | processedhtml | completed | failed, > metadata?: any | null, > result?: any | null, > total_cost?: number | null, > usage_id?: string | null, > error?: string | null > }[] > ``` > **next\_key full type** > > ```ts theme={null} > { > } > ``` *** ## Endpoint ### getSuggestions `endpoint.getSuggestions` Analyze a webpage and suggest reusable scraping endpoint configs (spends credits) **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.endpoint.getSuggestions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `website_url` | `string` | Yes | — | | `prompt` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | | `html_with_markdowns` | `any` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > endpoint: string, > method?: string, > description: string, > target_url: string, > parameters: { > name: string, > type: string, > location: string, > required: boolean, > description: string, > is_url?: boolean > }[], > pydantic_schema: { > }, > extraction_prompt: string, > interaction_steps?: string[] | null > }[] > ``` *** ### save `endpoint.save` Save custom scraping endpoint configurations **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.endpoint.save({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `suggestions` | `object[]` | Yes | — | > **suggestions full type** > > ```ts theme={null} > { > endpoint: string, > method?: string, > description: string, > target_url: string, > parameters: { > name: string, > type: string, > location: string, > required: boolean, > description: string, > is_url?: boolean > }[], > pydantic_schema: { > }, > extraction_prompt: string, > interaction_steps?: string[] | null > }[] > ``` **Output:** *empty object* *** ## Feedback ### submit `feedback.submit` Submit a rating/feedback for a completed request **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.feedback.submit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `rating` | `number` | Yes | — | | `feedback_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `feedback_id` | `string` | Yes | — | | `request_id` | `string` | Yes | — | | `message` | `string` | No | — | | `feedback_timestamp` | `string` | Yes | — | *** ### submitProduct `feedback.submitProduct` Submit general product feedback **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.feedback.submitProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `feedback_id` | `string` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `company` | `string` | No | — | | `how_discovered` | `string` | No | — | | `usage_frequency` | `string` | No | — | | `use_cases` | `string[]` | No | — | | `rating` | `number` | No | — | | `liked_most` | `string` | No | — | | `disliked` | `string` | No | — | | `requested_features` | `string` | No | — | | `setup_easy` | `boolean` | No | — | | `issues` | `string` | No | — | | `recommend_score` | `number` | No | — | | `improvement_suggestions` | `string` | No | — | | `can_contact` | `boolean` | No | — | | `contact_method` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | *** ## Markdownify ### history `markdownify.history` List past Markdownify requests **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.markdownify.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | | `next_key` | `object` | No | — | > **requests full type** > > ```ts theme={null} > { > request_id?: string, > user_id?: string | null, > webpage_id?: string | null, > requested_at?: string, > status?: queued | processing | completed | failed, > error?: string | null, > website_url: string, > finished_at?: string | null, > metadata?: { > } | null, > usage_id?: string | null, > request_params?: { > } | null > }[] > ``` > **next\_key full type** > > ```ts theme={null} > { > } > ``` *** ### start `markdownify.start` Start converting a webpage to clean Markdown (async, spends credits) **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.markdownify.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `website_url` | `string` | Yes | — | | `render_heavy_js` | `boolean` | No | — | | `mock` | `boolean` | No | — | | `stealth` | `boolean` | No | — | | `branding` | `boolean` | No | — | | `stream` | `boolean` | No | — | | `country_code` | `string` | No | — | | `wait_ms` | `number` | No | — | | `headers` | `object` | No | — | | `steps` | `string[]` | No | — | | `webhook_url` | `string` | No | — | > **headers full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `status` | `queued \| processing \| completed \| failed` | Yes | — | | `website_url` | `string` | Yes | — | | `result` | `string` | No | — | | `error` | `string` | No | — | *** ### status `markdownify.status` Get status and results for a Markdownify job **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.markdownify.status({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | No | — | | `status` | `queued \| processing \| completed \| failed` | No | — | | `website_url` | `string` | No | — | | `result` | `string` | No | — | | `error` | `string` | No | — | *** ## Scheduled Jobs ### list `scheduledJobs.list` List scheduled recurring scraping jobs **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.scheduledJobs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `service_type` | `smartscraper \| searchscraper \| markdownify \| smartcrawler \| agenticscrapper \| site_monitor` | No | — | | `is_active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | Yes | — | | `page` | `number` | Yes | — | | `page_size` | `number` | Yes | — | | `jobs` | `object[]` | Yes | — | > **jobs full type** > > ```ts theme={null} > { > id: string, > user_id: string, > job_name: string, > service_type: smartscraper | searchscraper | markdownify | smartcrawler | agenticscrapper | site_monitor, > cron_expression: string, > job_config: { > }, > is_active: boolean, > created_at: string, > updated_at: string, > last_run_at?: string | null, > next_run_at?: string | null > }[] > ``` *** ## Schema ### generate `schema.generate` Generate or refine a JSON schema from a natural-language prompt (spends credits) **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.schema.generate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_prompt` | `string` | Yes | — | | `existing_schema` | `object` | No | — | > **existing\_schema full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `user_prompt` | `string` | Yes | — | | `refined_prompt` | `string` | Yes | — | | `generated_schema` | `object` | Yes | — | | `error` | `string` | No | — | > **generated\_schema full type** > > ```ts theme={null} > { > } > ``` *** ## Scrape ### history `scrape.history` List past single-page Scrape requests **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.scrape.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | | `next_key` | `object` | No | — | > **requests full type** > > ```ts theme={null} > { > request_id: string, > user_id?: string | null, > website_url: string, > render_heavy_js?: boolean, > result?: string | null, > status?: queued | processing | completed | failed, > metadata?: { > }, > error?: string | null, > finished_at?: string | null, > requested_at?: string, > cost?: number, > request_params?: { > } | null > }[] > ``` > **next\_key full type** > > ```ts theme={null} > { > } > ``` *** ## Search Scraper ### history `searchScraper.history` List past SearchScraper requests **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.searchScraper.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | | `next_key` | `object` | No | — | > **requests full type** > > ```ts theme={null} > { > request_id: string, > user_id?: string | null, > user_prompt: string, > search_query?: string | null, > extraction_query?: string | null, > references_urls?: string[] | null, > output_schema?: { > } | null, > result?: any | null, > status?: queued | processing | completed | failed, > metadata?: { > }, > error?: string | null, > requested_at?: string, > finished_at?: string | null > }[] > ``` > **next\_key full type** > > ```ts theme={null} > { > } > ``` *** ### start `searchScraper.start` Start an AI-powered web search job (async, spends credits) **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.searchScraper.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_prompt` | `string` | Yes | — | | `num_results` | `number` | No | — | | `headers` | `object` | No | — | | `output_schema` | `object` | No | — | | `extraction_mode` | `boolean` | No | — | | `markdown_mode` | `boolean` | No | — | | `stealth` | `boolean` | No | — | | `mock` | `boolean` | No | — | | `stream` | `boolean` | No | — | | `webhook_url` | `string` | No | — | | `location_geo_code` | `string` | No | — | | `time_range` | `past_hour \| past_24_hours \| past_week \| past_month \| past_year` | No | — | > **headers full type** > > ```ts theme={null} > { > } > ``` > **output\_schema full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `status` | `queued \| processing \| completed \| failed` | Yes | — | | `user_prompt` | `string` | Yes | — | | `num_results` | `number` | No | — | | `result` | `any` | No | — | | `reference_urls` | `string[]` | No | — | | `markdown_content` | `string` | No | — | | `error` | `string` | No | — | *** ### status `searchScraper.status` Get status and results for a SearchScraper job **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.searchScraper.status({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | No | — | | `status` | `queued \| processing \| completed \| failed` | No | — | | `user_prompt` | `string` | No | — | | `num_results` | `number` | No | — | | `result` | `any` | No | — | | `reference_urls` | `string[]` | No | — | | `markdown_content` | `string` | No | — | | `error` | `string` | No | — | *** ## Sitemap ### history `sitemap.history` List past sitemap generation requests **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.sitemap.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | | `next_key` | `object` | No | — | > **requests full type** > > ```ts theme={null} > { > request_id: string, > website_url: string, > api_key_id: string, > user_id: string, > requested_at: string, > status: string, > urls_count: number, > error_message?: string | null, > metadata?: { > } | null > }[] > ``` > **next\_key full type** > > ```ts theme={null} > { > } > ``` *** ## Smart Crawler ### history `smartCrawler.history` List past SmartCrawler requests **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.smartCrawler.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | | `next_key` | `object` | No | — | > **requests full type** > > ```ts theme={null} > { > request_id: string, > user_id: string, > url: string, > prompt?: string | null, > max_pages: number, > status: queued | processing | completed | failed, > error?: string | null, > metadata?: { > } | null, > requested_at: string, > finished_at?: string | null, > total_cost?: number | null, > credits_used?: number | null, > pages_processed?: number | null, > crawled_urls?: string[] | null, > task_id?: string | null, > result?: { > } | null, > result_url?: string | null, > request_params?: { > } | null > }[] > ``` > **next\_key full type** > > ```ts theme={null} > { > } > ``` *** ### start `smartCrawler.start` Start a multi-page crawl of a site with optional AI extraction (async, spends credits) **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.smartCrawler.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `depth` | `number` | No | — | | `breadth` | `number` | No | — | | `max_pages` | `number` | No | — | | `prompt` | `string` | No | — | | `schema` | `object` | No | — | | `rules` | `object` | No | — | | `sitemap` | `boolean` | No | — | | `render_heavy_js` | `boolean` | No | — | | `extraction_mode` | `boolean` | No | — | | `stealth` | `boolean` | No | — | | `mock` | `boolean` | No | — | | `webhook_url` | `string` | No | — | | `reader_mode` | `boolean` | No | — | | `wait_ms` | `number` | No | — | | `country_code` | `string` | No | — | > **schema full type** > > ```ts theme={null} > { > } > ``` > **rules full type** > > ```ts theme={null} > { > exclude?: string[] | null, > include_paths?: string[] | null, > exclude_paths?: string[] | null, > same_domain?: boolean | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | No | — | | `request_id` | `string` | No | — | | `status` | `string` | No | — | | `url` | `string` | No | — | | `prompt` | `string` | No | — | | `max_pages` | `number` | No | — | | `error` | `string` | No | — | | `metadata` | `object` | No | — | | `requested_at` | `string` | No | — | | `finished_at` | `string` | No | — | | `total_cost` | `number` | No | — | | `credits_used` | `number` | No | — | | `pages_processed` | `number` | No | — | | `crawled_urls` | `string[]` | No | — | | `result` | `object` | No | — | | `result_url` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **result full type** > > ```ts theme={null} > { > } > ``` *** ### status `smartCrawler.status` Get status and results for a SmartCrawler job **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.smartCrawler.status({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | No | — | | `request_id` | `string` | No | — | | `status` | `string` | No | — | | `url` | `string` | No | — | | `prompt` | `string` | No | — | | `max_pages` | `number` | No | — | | `error` | `string` | No | — | | `metadata` | `object` | No | — | | `requested_at` | `string` | No | — | | `finished_at` | `string` | No | — | | `total_cost` | `number` | No | — | | `credits_used` | `number` | No | — | | `pages_processed` | `number` | No | — | | `crawled_urls` | `string[]` | No | — | | `result` | `object` | No | — | | `result_url` | `string` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **result full type** > > ```ts theme={null} > { > } > ``` *** ### webhookLogs `smartCrawler.webhookLogs` Get webhook delivery logs for a SmartCrawler job **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.smartCrawler.webhookLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `crawler_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `logs` | `object[]` | No | — | > **logs full type** > > ```ts theme={null} > { > }[] > ``` *** ## Smart Scraper ### history `smartScraper.history` List past SmartScraper requests **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.smartScraper.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requests` | `object[]` | Yes | — | | `next_key` | `object` | No | — | > **requests full type** > > ```ts theme={null} > { > request_id: string, > user_id?: string | null, > webpage_id?: string | null, > website_url?: string | null, > user_prompt: string, > output_schema?: { > } | null, > result?: { > } | string | null, > status?: queued | processing | completed | failed, > requested_at: string, > finished_at?: string | null, > error?: string | null, > metadata?: { > } | null, > request_params?: { > } | null > }[] > ``` > **next\_key full type** > > ```ts theme={null} > { > } > ``` *** ### start `smartScraper.start` Start an AI-powered structured extraction job for a webpage (async, spends credits) **Risk:** `write` ```ts theme={null} await corsair.scrapegraphai.api.smartScraper.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_prompt` | `string` | Yes | — | | `website_url` | `string` | No | — | | `website_html` | `string` | No | — | | `website_markdown` | `string` | No | — | | `render_heavy_js` | `boolean` | No | — | | `mock` | `boolean` | No | — | | `stealth` | `boolean` | No | — | | `branding` | `boolean` | No | — | | `stream` | `boolean` | No | — | | `country_code` | `string` | No | — | | `wait_ms` | `number` | No | — | | `output_schema` | `object` | No | — | | `headers` | `object` | No | — | | `number_of_scrolls` | `number` | No | — | | `total_pages` | `number` | No | — | | `steps` | `string[]` | No | — | | `cookies` | `object` | No | — | | `plain_text` | `boolean` | No | — | | `webhook_url` | `string` | No | — | | `offset` | `number` | No | — | | `is_multipage_child` | `boolean` | No | — | > **output\_schema full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` > **cookies full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `status` | `queued \| processing \| completed \| failed` | Yes | — | | `website_url` | `string` | No | — | | `user_prompt` | `string` | Yes | — | | `result` | `object` | No | — | | `error` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > } | string > ``` *** ### status `smartScraper.status` Get status and results for a SmartScraper job **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.smartScraper.status({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | No | — | | `status` | `queued \| processing \| completed \| failed` | No | — | | `website_url` | `string` | No | — | | `user_prompt` | `string` | No | — | | `result` | `object` | No | — | | `error` | `string` | No | — | > **result full type** > > ```ts theme={null} > { > } | string > ``` *** ## Utilities ### toonify `utilities.toonify` Convert JSON to TOON (Token-Oriented Object Notation) to reduce LLM token usage **Risk:** `read` ```ts theme={null} await corsair.scrapegraphai.api.utilities.toonify({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > string | { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/scrapegraphai/database ScrapeGraphAI local sync: searchable entities, `.search()` filters, and operators. The ScrapeGraphAI plugin syncs data locally. Use `corsair.scrapegraphai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Crawls Path: `scrapegraphai.db.crawls.search` ```ts theme={null} const rows = await corsair.scrapegraphai.db.crawls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `task_id` | `string` | equals, contains, startsWith, endsWith, in | | `request_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `error` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Credits Path: `scrapegraphai.db.credits.search` ```ts theme={null} const rows = await corsair.scrapegraphai.db.credits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `remaining_credits` | `number` | equals, gt, gte, lt, lte, in | | `total_credits_used` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Generated Schemas Path: `scrapegraphai.db.generatedSchemas.search` ```ts theme={null} const rows = await corsair.scrapegraphai.db.generatedSchemas.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `request_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `user_prompt` | `string` | equals, contains, startsWith, endsWith, in | | `refined_prompt` | `string` | equals, contains, startsWith, endsWith, in | | `error` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `scrapegraphai.db.jobs.search` ```ts theme={null} const rows = await corsair.scrapegraphai.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `websiteUrl` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Markdownifies Path: `scrapegraphai.db.markdownifies.search` ```ts theme={null} const rows = await corsair.scrapegraphai.db.markdownifies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `request_id` | `string` | equals, contains, startsWith, endsWith, in | | `website_url` | `string` | equals, contains, startsWith, endsWith, in | | `result` | `string` | equals, contains, startsWith, endsWith, in | | `error` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scheduled Jobs Path: `scrapegraphai.db.scheduledJobs.search` ```ts theme={null} const rows = await corsair.scrapegraphai.db.scheduledJobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `job_name` | `string` | equals, contains, startsWith, endsWith, in | | `service_type` | `string` | equals, contains, startsWith, endsWith, in | | `cron_expression` | `string` | equals, contains, startsWith, endsWith, in | | `is_active` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_run_at` | `string` | equals, contains, startsWith, endsWith, in | | `next_run_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Search Scrapers Path: `scrapegraphai.db.searchScrapers.search` ```ts theme={null} const rows = await corsair.scrapegraphai.db.searchScrapers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `request_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_prompt` | `string` | equals, contains, startsWith, endsWith, in | | `num_results` | `number` | equals, gt, gte, lt, lte, in | | `markdown_content` | `string` | equals, contains, startsWith, endsWith, in | | `error` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Smart Scrapers Path: `scrapegraphai.db.smartScrapers.search` ```ts theme={null} const rows = await corsair.scrapegraphai.db.smartScrapers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `request_id` | `string` | equals, contains, startsWith, endsWith, in | | `website_url` | `string` | equals, contains, startsWith, endsWith, in | | `user_prompt` | `string` | equals, contains, startsWith, endsWith, in | | `error` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/scrapegraphai/overview AI-powered web scraping API that extracts structured data using natural language prompts. Use **ScrapeGraphAI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 27 typed API operations * 8 synced entities (`crawls`, `credits`, `generatedSchemas`, `jobs`, `markdownifies`, `scheduledJobs`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/scrapegraphai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/scrapegraphai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/scrapegraphai ``` ```bash bun theme={null} bun add corsair @corsair-dev/scrapegraphai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { scrapegraphai } from '@corsair-dev/scrapegraphai'; export const corsair = createCorsair({ plugins: [ scrapegraphai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} scrapegraphai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'scrapegraphai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.credits`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.scrapegraphai.api.account.credits({}); ``` **`agenticScraper.getLiveSessionUrl`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.scrapegraphai.api.agenticScraper.getLiveSessionUrl({}); ``` See the full list on the [API](/plugins/scrapegraphai/api) page. ## Query synced data Synced entities support `tenant.scrapegraphai.db..search()` and `.list()`: `crawls`, `credits`, `generatedSchemas`, `jobs`, `markdownifies`, `scheduledJobs`, `searchScrapers`, `smartScrapers`. See [Database](/plugins/scrapegraphai/database) for filters and operators. ## What's next > **[API reference](/plugins/scrapegraphai/api)** > > Every `scrapegraphai.api.*` operation with input and output types. > **[Database](/plugins/scrapegraphai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/search1api/api API reference for Search1API: every `search1api.api.*` operation with input and output types. Every `search1api.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### health `account.health` Check whether the Search1API API is serving traffic **Risk:** `read` ```ts theme={null} await corsair.search1api.api.account.health({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `timestamp` | `string` | No | — | | `version` | `string` | No | — | *** ### usage `account.usage` Get the remaining credit balance **Risk:** `read` ```ts theme={null} await corsair.search1api.api.account.usage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `period` | `day \| week \| month \| year` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `usage` | `number` | Yes | — | | `user_id` | `string` | No | — | | `credential_type` | `api_key \| oauth` | Yes | — | | `client_id` | `string` | No | — | *** ## Content ### crawl `content.crawl` Crawl a URL and return its readable content **Risk:** `read` ```ts theme={null} await corsair.search1api.api.content.crawl({ url: 'https://example.com/docs' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `enableFallback` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `crawlParameters` | `object` | Yes | — | | `results` | `object` | Yes | — | > **crawlParameters full type** > > ```ts theme={null} > { > url: string > } > ``` > **results full type** > > ```ts theme={null} > { > title: string, > link: string, > content: string, > metadata?: { > } > } > ``` *** ### crawlBatch `content.crawlBatch` Crawl many URLs in a single request **Risk:** `read` ```ts theme={null} await corsair.search1api.api.content.crawlBatch({}); ``` **Input:** `object[]` > **Input full type** > > ```ts theme={null} > { > url: string, > enableFallback?: boolean > }[] > ``` **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > crawlParameters: { > url: string > }, > results: { > title: string, > link: string, > content: string, > metadata?: { > } > } > }[] > ``` *** ### extract `content.extract` Extract structured data from a page with a prompt **Risk:** `read` ```ts theme={null} await corsair.search1api.api.content.extract({ url: 'https://example.com/pricing', prompt: 'List the pricing tiers' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `prompt` | `string` | No | — | | `response_format` | `object` | No | — | > **response\_format full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | | `extractParameters` | `object` | Yes | — | | `results` | `any` | Yes | — | > **extractParameters full type** > > ```ts theme={null} > { > url: string > } > ``` *** ### screenshot `content.screenshot` Render a page as a PNG, JPEG, or WebP image **Risk:** `read` ```ts theme={null} await corsair.search1api.api.content.screenshot({ url: 'https://example.com', full_page: true, viewport: { width: 1440, height: 900 }, }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `format` | `png \| jpeg \| webp` | No | — | | `full_page` | `boolean` | No | — | | `viewport` | `object` | No | — | | `wait_until` | `domcontentloaded \| load \| networkidle` | No | — | | `wait_for_selector` | `string` | No | — | | `selector` | `string` | No | — | | `delay_ms` | `number` | No | — | | `timeout_ms` | `number` | No | — | | `quality` | `number` | No | — | | `omit_background` | `boolean` | No | — | | `color_scheme` | `light \| dark` | No | — | | `animations` | `disabled \| allow` | No | — | > **viewport full type** > > ```ts theme={null} > { > width?: number, > height?: number, > device_scale_factor?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `base64` | `string` | Yes | — | | `sizeBytes` | `number` | Yes | — | *** ### sitemap `content.sitemap` Extract a site's URLs from its sitemap **Risk:** `read` ```ts theme={null} await corsair.search1api.api.content.sitemap({ url: 'https://example.com', type: 'sitemap' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `type` | `sitemap \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `links` | `string[]` | Yes | — | *** ## Deepcrawl ### start `deepcrawl.start` Start an asynchronous whole-site crawl **Risk:** `write` ```ts theme={null} await corsair.search1api.api.deepcrawl.start({ url: 'https://example.com', type: 'sitemap' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `type` | `sitemap \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `status` | `queued` | Yes | — | *** ### status `deepcrawl.status` Check a deepcrawl task's status and result archive **Risk:** `read` ```ts theme={null} await corsair.search1api.api.deepcrawl.status({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `status` | `queued \| waiting \| processing \| completed \| failed \| not_found` | Yes | — | | `success` | `boolean` | No | — | | `message` | `string` | No | — | | `error` | `string` | No | — | | `r2Key` | `string` | No | — | | `zipUrl` | `string` | No | — | *** ## Web ### ask `web.ask` Agentic search that picks engines and reranks results automatically **Risk:** `read` ```ts theme={null} await corsair.search1api.api.web.ask({ query: 'what shipped in AI this week?' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `intent` | `object` | Yes | — | | `results` | `object[]` | Yes | — | | `errors` | `object[]` | Yes | — | > **intent full type** > > ```ts theme={null} > { > search_query: string, > sources: string[], > time_range?: day | week | month | year | | null > } > ``` > **results full type** > > ```ts theme={null} > { > title: string, > link: string, > snippet: string, > published_date?: string, > source: string, > relevance: number > }[] > ``` > **errors full type** > > ```ts theme={null} > { > source: string, > message: string > }[] > ``` *** ### feedback `web.feedback` Report a Search1API problem or feature request from an agent run **Risk:** `write` ```ts theme={null} await corsair.search1api.api.web.feedback({ message: 'POST /crawl returned empty content for example.com/docs', category: 'bug', request_id: 'req_8f3a' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | Yes | — | | `intent` | `string` | No | — | | `category` | `bug \| feature_request \| docs \| other` | No | — | | `request_id` | `string` | No | — | | `agent` | `object` | No | — | > **agent full type** > > ```ts theme={null} > { > name?: string, > model?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `new` | Yes | — | *** ### news `web.news` Search recent news across six sources **Risk:** `read` ```ts theme={null} await corsair.search1api.api.web.news({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `search_service` | `google \| bing \| duckduckgo \| yahoo \| hackernews \| reuters \| ` | No | — | | `max_results` | `number` | No | — | | `crawl_results` | `number` | No | — | | `image` | `boolean` | No | — | | `include_sites` | `string[]` | No | — | | `exclude_sites` | `string[]` | No | — | | `language` | `string` | No | — | | `time_range` | `day \| week \| month \| year \| ` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `searchParameters` | `object` | Yes | — | | `results` | `object[]` | Yes | — | | `images` | `string[]` | No | — | > **searchParameters full type** > > ```ts theme={null} > { > query: string, > search_service?: google | bing | duckduckgo | yahoo | hackernews | reuters | , > max_results?: number, > crawl_results?: number, > image?: boolean, > include_sites?: string[], > exclude_sites?: string[], > language?: string, > time_range?: day | week | month | year | > } > ``` > **results full type** > > ```ts theme={null} > { > title: string, > link: string, > snippet: string, > content?: string, > published_date?: string, > metadata?: { > kind?: repo | issue | pr | discussion, > stars?: number, > language?: string, > num_comments?: number, > story_url?: string, > points?: number > } > }[] > ``` *** ### newsBatch `web.newsBatch` Run many news searches in a single request **Risk:** `read` ```ts theme={null} await corsair.search1api.api.web.newsBatch({}); ``` **Input:** `object[]` > **Input full type** > > ```ts theme={null} > { > query: string, > search_service?: google | bing | duckduckgo | yahoo | hackernews | reuters | , > max_results?: number, > crawl_results?: number, > image?: boolean, > include_sites?: string[], > exclude_sites?: string[], > language?: string, > time_range?: day | week | month | year | > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `summary` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > success: boolean, > data?: { > searchParameters: { > query: string, > search_service?: google | bing | duckduckgo | yahoo | hackernews | reuters | , > max_results?: number, > crawl_results?: number, > image?: boolean, > include_sites?: string[], > exclude_sites?: string[], > language?: string, > time_range?: day | week | month | year | > }, > results: { > title: string, > link: string, > snippet: string, > content?: string, > published_date?: string, > metadata?: { > kind?: repo | issue | pr | discussion, > stars?: number, > language?: string, > num_comments?: number, > story_url?: string, > points?: number > } > }[], > images?: string[] > }, > error?: { > message?: string, > statusCode?: number > }, > cost: number > }[] > ``` > **summary full type** > > ```ts theme={null} > { > total: number, > successful: number, > failed: number, > totalCost: number > } > ``` *** ### search `web.search` Search the web across 19 engines, with optional crawling **Risk:** `read` ```ts theme={null} await corsair.search1api.api.web.search({ query: 'open source integration layer', search_service: 'duckduckgo', max_results: 10 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `search_service` | `360 \| google \| bing \| bingcn \| duckduckgo \| yahoo \| yandex \| youtube \| x \| reddit \| github \| arxiv \| wechat \| bilibili \| imdb \| wikipedia \| grokipedia \| baidu \| quark \| ` | No | — | | `max_results` | `number` | No | — | | `page` | `number` | No | — | | `crawl_results` | `number` | No | — | | `image` | `boolean` | No | — | | `include_sites` | `string[]` | No | — | | `exclude_sites` | `string[]` | No | — | | `language` | `string` | No | — | | `time_range` | `day \| week \| month \| year \| ` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `searchParameters` | `object` | Yes | — | | `results` | `object[]` | Yes | — | | `images` | `string[]` | No | — | > **searchParameters full type** > > ```ts theme={null} > { > query: string, > search_service?: 360 | google | bing | bingcn | duckduckgo | yahoo | yandex | youtube | x | reddit | github | arxiv | wechat | bilibili | imdb | wikipedia | grokipedia | baidu | quark | , > max_results?: number, > page?: number, > crawl_results?: number, > image?: boolean, > include_sites?: string[], > exclude_sites?: string[], > language?: string, > time_range?: day | week | month | year | > } > ``` > **results full type** > > ```ts theme={null} > { > title: string, > link: string, > snippet: string, > content?: string, > published_date?: string, > metadata?: { > kind?: repo | issue | pr | discussion, > stars?: number, > language?: string, > num_comments?: number, > story_url?: string, > points?: number > } > }[] > ``` *** ### searchBatch `web.searchBatch` Run many web searches in a single request **Risk:** `read` ```ts theme={null} await corsair.search1api.api.web.searchBatch({}); ``` **Input:** `object[]` > **Input full type** > > ```ts theme={null} > { > query: string, > search_service?: 360 | google | bing | bingcn | duckduckgo | yahoo | yandex | youtube | x | reddit | github | arxiv | wechat | bilibili | imdb | wikipedia | grokipedia | baidu | quark | , > max_results?: number, > page?: number, > crawl_results?: number, > image?: boolean, > include_sites?: string[], > exclude_sites?: string[], > language?: string, > time_range?: day | week | month | year | > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `summary` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > success: boolean, > data?: { > searchParameters: { > query: string, > search_service?: 360 | google | bing | bingcn | duckduckgo | yahoo | yandex | youtube | x | reddit | github | arxiv | wechat | bilibili | imdb | wikipedia | grokipedia | baidu | quark | , > max_results?: number, > page?: number, > crawl_results?: number, > image?: boolean, > include_sites?: string[], > exclude_sites?: string[], > language?: string, > time_range?: day | week | month | year | > }, > results: { > title: string, > link: string, > snippet: string, > content?: string, > published_date?: string, > metadata?: { > kind?: repo | issue | pr | discussion, > stars?: number, > language?: string, > num_comments?: number, > story_url?: string, > points?: number > } > }[], > images?: string[] > }, > error?: { > message?: string, > statusCode?: number > }, > cost: number > }[] > ``` > **summary full type** > > ```ts theme={null} > { > total: number, > successful: number, > failed: number, > totalCost: number > } > ``` *** ### trending `web.trending` Get trending topics from GitHub or Hacker News **Risk:** `read` ```ts theme={null} await corsair.search1api.api.web.trending({ search_service: 'github', max_results: 10 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_service` | `string` | Yes | — | | `max_results` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `trendingParameters` | `object` | Yes | — | | `results` | `object[]` | Yes | — | > **trendingParameters full type** > > ```ts theme={null} > { > search_service: string, > max_results?: number > } > ``` > **results full type** > > ```ts theme={null} > { > title: string, > url: string, > description?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/search1api/database Search1API local sync: searchable entities, `.search()` filters, and operators. The Search1API plugin syncs data locally. Use `corsair.search1api.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Search Results Path: `search1api.db.searchResults.search` ```ts theme={null} const rows = await corsair.search1api.db.searchResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `link` | `string` | equals, contains, startsWith, endsWith, in | | `snippet` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `publishedDate` | `date` | equals, before, after, between | | `service` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/search1api/overview Live web search, crawl, extraction, and site-wide data in one API for AI agents. Use **Search1API** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 16 typed API operations * 1 synced entity (`searchResults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/search1api ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/search1api ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/search1api ``` ```bash bun theme={null} bun add corsair @corsair-dev/search1api ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { search1api } from '@corsair-dev/search1api'; export const corsair = createCorsair({ plugins: [ search1api(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} search1api() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'search1api', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Search the web** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.search1api.api.web.search({ query: 'open source integration layer', max_results: 10 }); ``` **Crawl a page** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.search1api.api.content.crawl({ url: 'https://example.com/docs' }); ``` See the full list on the [API](/plugins/search1api/api) page. ## Query synced data Search hits are cached by link when a database is configured, so repeated searches refresh rows instead of duplicating them. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.search1api.db.searchResults.search({ data: { query: 'corsair' }, limit: 50, }); ``` Synced entities: `searchResults`. See [Database](/plugins/search1api/database) for filters and operators. ## What's next > **[API reference](/plugins/search1api/api)** > > Every `search1api.api.*` operation with input and output types. > **[Database](/plugins/search1api/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/securitytrails/api API reference for SecurityTrails: every `securitytrails.api.*` operation with input and output types. Every `securitytrails.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### ping `account.ping` Verify the configured SecurityTrails API key is accepted and the API is reachable. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.account.ping({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### usage `account.usage` Return the current and allowed monthly API usage for the account. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.account.usage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `current_monthly_usage` | `number` | No | — | | `allowed_monthly_usage` | `number` | No | — | *** ## Company ### associatedIps `company.associatedIps` List the CIDR blocks associated with a company domain. Paginated. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.company.associatedIps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `records` | `object[]` | No | — | | `query` | `string` | No | — | | `record_count` | `number` | No | — | | `domain` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `redir` | `string` | No | — | > **records full type** > > ```ts theme={null} > { > cidr?: string > }[] > ``` *** ## Domain ### get `domain.get` Get current DNS records (A, AAAA, MX, NS, SOA, TXT) and co-occurrence statistics for a hostname. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.domain.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hostname` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `hostname` | `string` | No | — | | `alexa_rank` | `number` | No | — | | `current_dns` | `object` | No | — | > **current\_dns full type** > > ```ts theme={null} > { > a?: { > first_seen?: string | null, > values?: { > ip?: string, > ip_count?: number > }[] > }, > aaaa?: { > first_seen?: string | null, > values?: { > ip?: string, > ip_count?: number > }[] > }, > mx?: { > first_seen?: string | null, > values?: { > priority?: number, > host?: string, > host_count?: number > }[] > }, > ns?: { > first_seen?: string | null, > values?: { > nameserver?: string, > nameserver_count?: number > }[] > }, > soa?: { > first_seen?: string | null, > values?: { > ttl?: number, > email?: string, > email_count?: number > }[] > }, > txt?: { > first_seen?: string | null, > values?: { > value?: string > }[] > } > } > ``` *** ### ssl `domain.ssl` List current and historical SSL/TLS certificates for a hostname, optionally including subdomains. Paginated. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.domain.ssl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hostname` | `string` | Yes | — | | `include_subdomains` | `boolean` | No | — | | `status` | `valid \| all \| expired` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `endpoint` | `string` | No | — | | `meta` | `object` | No | — | | `record_count` | `number` | No | — | | `records` | `object[]` | No | — | > **meta full type** > > ```ts theme={null} > { > max_page?: number, > page?: number, > total_pages?: number, > query?: { > } > } > ``` > **records full type** > > ```ts theme={null} > { > dns_names?: string[], > fingerprints?: { > sha1?: string, > sha256?: string > }, > issuer?: { > common_name?: string, > country?: string[], > organization?: string[] > }, > subject?: { > }, > not_after?: number | null, > not_before?: number | null, > serial_number?: string > }[] > ``` *** ## Ips ### search `ips.search` Search the IP dataset with a DSL query, returning matching addresses, PTR records and open ports. Paginated. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.ips.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `endpoint` | `string` | No | — | | `records` | `object[]` | No | — | | `record_count` | `number` | No | — | | `meta` | `object` | No | — | > **records full type** > > ```ts theme={null} > { > ip?: string, > ptr?: string | null, > ports?: number[] > }[] > ``` > **meta full type** > > ```ts theme={null} > { > total_pages?: number, > query?: string, > page?: number, > max_page?: number > } > ``` *** ### stats `ips.stats` Return aggregate open-port and PTR-pattern statistics for a DSL query over the IP dataset. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.ips.stats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `endpoint` | `string` | No | — | | `top_ptr_patterns` | `object[]` | No | — | | `ports` | `object[]` | No | — | | `total` | `number` | No | — | > **top\_ptr\_patterns full type** > > ```ts theme={null} > { > key?: string, > count?: number > }[] > ``` > **ports full type** > > ```ts theme={null} > { > key?: number, > count?: number > }[] > ``` *** ## Projects ### bulkStaticAssetRules `projects.bulkStaticAssetRules` Add or remove static asset rules for an ASI project, changing which assets are in the project's monitoring scope. Up to 1000 rules per request. **Risk:** `write` ```ts theme={null} await corsair.securitytrails.api.projects.bulkStaticAssetRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | Yes | — | | `add_rules` | `object[]` | No | — | | `remove_rules` | `object[]` | No | — | > **add\_rules full type** > > ```ts theme={null} > { > asset: string, > membership_type: include | exclude, > static_type: ipv4 | hostname | wildcard > }[] > ``` > **remove\_rules full type** > > ```ts theme={null} > { > asset: string, > membership_type: include | exclude, > static_type: ipv4 | hostname | wildcard > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `object` | No | — | | `complete` | `boolean` | No | — | | `task_ids` | `string[]` | No | — | > **data full type** > > ```ts theme={null} > { > added?: { > asset: string, > membership_type: include | exclude, > static_type: ipv4 | hostname | wildcard > }[], > removed?: { > asset: string, > membership_type: include | exclude, > static_type: ipv4 | hostname | wildcard > }[], > errors?: { > rule?: { > asset: string, > membership_type: include | exclude, > static_type: ipv4 | hostname | wildcard > } | null, > failed?: boolean | null, > messages?: string[] | null > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > params?: { > } | null, > counts?: { > total?: number | null, > returned?: number > } | null, > pagination?: { > next_cursor?: string | null, > limit?: number, > total?: number | null, > sort?: string[][] | null > } | null, > request_id?: string | null > } > ``` *** ### list `projects.list` List the Attack Surface Intelligence projects the API key can access. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sort_direction` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > title: string, > scanning_enabled?: boolean | null, > last_scanned_at?: string | null, > inserted_at?: string | null, > max_exposure_score?: number | null > }[] > ``` > **meta full type** > > ```ts theme={null} > { > params?: { > } | null, > counts?: { > total?: number | null, > returned?: number > } | null, > pagination?: { > next_cursor?: string | null, > limit?: number, > total?: number | null, > sort?: string[][] | null > } | null, > request_id?: string | null > } > ``` *** ## Scroll ### get `scroll.get` Fetch the next page of a DSL search using a scroll cursor from a previous response. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.scroll.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `scroll_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Sql ### query `sql.query` Run a SQL-like query against the hosts or ips tables. Returns up to 100 records plus a scroll cursor. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.sql.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `id` | `string` | No | — | | `total` | `object` | No | — | | `records` | `object[]` | No | — | > **total full type** > > ```ts theme={null} > { > value?: string | number, > relation?: string > } > ``` > **records full type** > > ```ts theme={null} > { > }[] > ``` *** ### scroll `sql.scroll` Fetch the next 100 records for an open SQL API scroll cursor. **Risk:** `read` ```ts theme={null} await corsair.securitytrails.api.sql.scroll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `id` | `string` | No | — | | `total` | `object` | No | — | | `records` | `object[]` | No | — | > **total full type** > > ```ts theme={null} > { > value?: string | number, > relation?: string > } > ``` > **records full type** > > ```ts theme={null} > { > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/securitytrails/database SecurityTrails local sync: searchable entities, `.search()` filters, and operators. The SecurityTrails plugin syncs data locally. Use `corsair.securitytrails.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Certificates Path: `securitytrails.db.certificates.search` ```ts theme={null} const rows = await corsair.securitytrails.db.certificates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `hostname` | `string` | equals, contains, startsWith, endsWith, in | | `sha1` | `string` | equals, contains, startsWith, endsWith, in | | `sha256` | `string` | equals, contains, startsWith, endsWith, in | | `issuer_common_name` | `string` | equals, contains, startsWith, endsWith, in | | `serial_number` | `string` | equals, contains, startsWith, endsWith, in | | `not_before` | `date` | equals, before, after, between | | `not_after` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Company Ip Ranges Path: `securitytrails.db.companyIpRanges.search` ```ts theme={null} const rows = await corsair.securitytrails.db.companyIpRanges.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `cidr` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Domains Path: `securitytrails.db.domains.search` ```ts theme={null} const rows = await corsair.securitytrails.db.domains.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `hostname` | `string` | equals, contains, startsWith, endsWith, in | | `alexa_rank` | `number` | equals, gt, gte, lt, lte, in | | `dns_first_seen` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Ips Path: `securitytrails.db.ips.search` ```ts theme={null} const rows = await corsair.securitytrails.db.ips.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `ptr` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `securitytrails.db.projects.search` ```ts theme={null} const rows = await corsair.securitytrails.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `scanning_enabled` | `boolean` | equals | | `last_scanned_at` | `date` | equals, before, after, between | | `inserted_at` | `date` | equals, before, after, between | | `max_exposure_score` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/securitytrails/overview DNS and domain intelligence API for historical records, subdomains, and security research. Use **SecurityTrails** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 12 typed API operations * 5 synced entities (`certificates`, `companyIpRanges`, `domains`, `ips`, `projects`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/securitytrails ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/securitytrails ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/securitytrails ``` ```bash bun theme={null} bun add corsair @corsair-dev/securitytrails ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { securitytrails } from '@corsair-dev/securitytrails'; export const corsair = createCorsair({ plugins: [ securitytrails(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} securitytrails() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'securitytrails', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.ping`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.securitytrails.api.account.ping({}); ``` **`projects.bulkStaticAssetRules`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.securitytrails.api.projects.bulkStaticAssetRules({}); ``` See the full list on the [API](/plugins/securitytrails/api) page. ## Query synced data Synced entities support `tenant.securitytrails.db..search()` and `.list()`: `certificates`, `companyIpRanges`, `domains`, `ips`, `projects`. See [Database](/plugins/securitytrails/database) for filters and operators. ## What's next > **[API reference](/plugins/securitytrails/api)** > > Every `securitytrails.api.*` operation with input and output types. > **[Database](/plugins/securitytrails/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Database Source: https://docs.corsair.dev/plugins/semanticscholar/database SemanticScholar local sync: searchable entities, `.search()` filters, and operators. The SemanticScholar plugin syncs data locally. Use `corsair.semanticscholar.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Author Path: `semanticscholar.db.author.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.author.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `authorId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `homepage` | `string` | equals, contains, startsWith, endsWith, in | | `paperCount` | `number` | equals, gt, gte, lt, lte, in | | `citationCount` | `number` | equals, gt, gte, lt, lte, in | | `hIndex` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Author Summary Path: `semanticscholar.db.authorSummary.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.authorSummary.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `authorId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Autocomplete Match Path: `semanticscholar.db.autocompleteMatch.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.autocompleteMatch.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `authorsYear` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Citation Path: `semanticscholar.db.citation.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.citation.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `isInfluential` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Dataset Path: `semanticscholar.db.dataset.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.dataset.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `README` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Dataset Diff Path: `semanticscholar.db.datasetDiff.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.datasetDiff.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `fromRelease` | `string` | equals, contains, startsWith, endsWith, in | | `toRelease` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Dataset Release Path: `semanticscholar.db.datasetRelease.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.datasetRelease.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `release_id` | `string` | equals, contains, startsWith, endsWith, in | | `releaseId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Paper Path: `semanticscholar.db.paper.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.paper.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `paperId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `abstract` | `string` | equals, contains, startsWith, endsWith, in | | `venue` | `string` | equals, contains, startsWith, endsWith, in | | `year` | `number` | equals, gt, gte, lt, lte, in | | `referenceCount` | `number` | equals, gt, gte, lt, lte, in | | `citationCount` | `number` | equals, gt, gte, lt, lte, in | | `influentialCitationCount` | `number` | equals, gt, gte, lt, lte, in | | `isOpenAccess` | `boolean` | equals | | `publicationDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Reference Path: `semanticscholar.db.reference.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.reference.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `isInfluential` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Snippet Path: `semanticscholar.db.snippet.search` ```ts theme={null} const rows = await corsair.semanticscholar.db.snippet.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/semanticscholar/overview SemanticScholar plugin for Corsair Use **SemanticScholar** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 21 typed API operations * 10 synced entities (`author`, `authorSummary`, `autocompleteMatch`, `citation`, `dataset`, `datasetDiff`, and 4 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/semanticscholar ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/semanticscholar ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/semanticscholar ``` ```bash bun theme={null} bun add corsair @corsair-dev/semanticscholar ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { semanticscholar } from '@corsair-dev/semanticscholar'; export const corsair = createCorsair({ plugins: [ semanticscholar(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} semanticscholar() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'semanticscholar', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`authors.batchGet`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.semanticscholar.api.authors.batchGet({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/semanticscholar/api) reference.* See the full list on the [API](/plugins/semanticscholar/api) page. ## Query synced data Synced entities support `tenant.semanticscholar.db..search()` and `.list()`: `author`, `authorSummary`, `autocompleteMatch`, `citation`, `dataset`, `datasetDiff`, `datasetRelease`, `paper`, `reference`, `snippet`. See [Database](/plugins/semanticscholar/database) for filters and operators. ## What's next > **[API reference](/plugins/semanticscholar/api)** > > Every `semanticscholar.api.*` operation with input and output types. > **[Database](/plugins/semanticscholar/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/sendgrid/api API reference for SendGrid: every `sendgrid.api.*` operation with input and output types. Every `sendgrid.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Api Keys ### create `apiKeys.create` Create an API key **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.apiKeys.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `scopes` | `string[]` | No | — | **Output:** *empty object* *** ### get `apiKeys.get` Retrieve an API key **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.apiKeys.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### getAll `apiKeys.getAll` Retrieve all API keys **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.apiKeys.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | **Output:** *empty object* *** ### remove `apiKeys.remove` Delete an API key **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.apiKeys.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### update `apiKeys.update` Update an API key name or scopes **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.apiKeys.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `scopes` | `string[]` | No | — | **Output:** *empty object* *** ## Asm ### addGroupSuppressions `asm.addGroupSuppressions` Add suppressions to an unsubscribe group **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.asm.addGroupSuppressions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `recipient_emails` | `string[]` | Yes | — | **Output:** *empty object* *** ### createGroup `asm.createGroup` Create an unsubscribe group **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.asm.createGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | Yes | — | | `is_default` | `boolean` | No | — | **Output:** *empty object* *** ### deleteGroup `asm.deleteGroup` Delete an unsubscribe group **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.asm.deleteGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** *empty object* *** ### deleteGroupSuppression `asm.deleteGroupSuppression` Delete a suppression from an unsubscribe group **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.asm.deleteGroupSuppression({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `email` | `string` | Yes | — | **Output:** *empty object* *** ### getGroup `asm.getGroup` Retrieve an unsubscribe group **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.asm.getGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** *empty object* *** ### getGroups `asm.getGroups` Retrieve unsubscribe groups **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.asm.getGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getGroupSuppressions `asm.getGroupSuppressions` Retrieve suppressions for an unsubscribe group **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.asm.getGroupSuppressions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateGroup `asm.updateGroup` Update an unsubscribe group **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.asm.updateGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `is_default` | `boolean` | No | — | **Output:** *empty object* *** ## Contacts ### addOrUpdate `contacts.addOrUpdate` Add or update contacts in SendGrid Marketing **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.contacts.addOrUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_ids` | `string[]` | No | — | | `contacts` | `object[]` | Yes | — | > **contacts full type** > > ```ts theme={null} > { > id?: string, > email?: string, > phone_number_id?: string, > external_id?: string, > anonymous_id?: string, > first_name?: string, > last_name?: string, > address_line_1?: string, > address_line_2?: string, > alternate_emails?: string[], > city?: string, > country?: string, > postal_code?: string, > state_province_region?: string, > custom_fields?: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** ### export `contacts.export` Create a marketing contacts export job **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.contacts.export({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_ids` | `string[]` | No | — | | `segment_ids` | `string[]` | No | — | | `file_type` | `csv \| json` | No | — | | `max_file_size` | `number` | No | — | **Output:** *empty object* *** ### exportStatus `contacts.exportStatus` Get a marketing contacts export job **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.contacts.exportStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### get `contacts.get` Get a marketing contact by ID **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### getCount `contacts.getCount` Get marketing contact count **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.contacts.getCount({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### getSample `contacts.getSample` Get a sample of marketing contacts **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.contacts.getSample({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_size` | `number` | No | — | | `page_token` | `string` | No | — | **Output:** *empty object* *** ### import `contacts.import` Create a marketing contacts import job **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.contacts.import({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_type` | `csv` | Yes | — | | `field_mappings` | `string \| null[]` | Yes | — | | `list_ids` | `string[]` | No | — | **Output:** *empty object* *** ### importStatus `contacts.importStatus` Get a marketing contacts import job **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.contacts.importStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### listExports `contacts.listExports` List marketing contacts export jobs **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.contacts.listExports({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### remove `contacts.remove` Delete marketing contacts by ID **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.contacts.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** ### search `contacts.search` Search marketing contacts with SGQL **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.contacts.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | **Output:** *empty object* *** ### searchEmails `contacts.searchEmails` Search marketing contacts by email **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.contacts.searchEmails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `string[]` | Yes | — | **Output:** *empty object* *** ## Fields ### create `fields.create` Create a custom field definition **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.fields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `field_type` | `string` | Yes | — | **Output:** *empty object* *** ### getAll `fields.getAll` Get all marketing field definitions **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.fields.getAll({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### remove `fields.remove` Delete a custom field definition **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.fields.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### update `fields.update` Update a custom field definition **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.fields.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output:** *empty object* *** ## Lists ### create `lists.create` Create a new marketing contact list **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.lists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `contact_count` | `number` | Yes | — | | `_metadata` | `object` | No | — | > **\_metadata full type** > > ```ts theme={null} > { > } > ``` *** ### get `lists.get` Get a marketing list by ID **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.lists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `contact_sample` | `boolean` | No | — | **Output:** *empty object* *** ### getAll `lists.getAll` Retrieve all marketing contact lists **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.lists.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_size` | `number` | No | — | | `page_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `result` | `object[]` | Yes | — | | `_metadata` | `object` | No | — | > **result full type** > > ```ts theme={null} > { > id: string, > name: string, > contact_count: number, > _metadata?: { > } > }[] > ``` > **\_metadata full type** > > ```ts theme={null} > { > } > ``` *** ### getContactCount `lists.getContactCount` Get contact count for a marketing list **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.lists.getContactCount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### remove `lists.remove` Delete a marketing list **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.lists.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `delete_contacts` | `boolean` | No | — | **Output:** *empty object* *** ### removeContacts `lists.removeContacts` Remove contacts from a marketing list **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.lists.removeContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `contact_ids` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | *** ### update `lists.update` Update a marketing list **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.lists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `contact_count` | `number` | Yes | — | | `_metadata` | `object` | No | — | > **\_metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Mail ### cancelScheduledSend `mail.cancelScheduledSend` Cancel or pause a scheduled send **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.mail.cancelScheduledSend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch_id` | `string` | Yes | — | | `status` | `pause \| cancel` | Yes | — | **Output:** *empty object* *** ### createBatchId `mail.createBatchId` Create a batch ID for scheduled mail **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.mail.createBatchId({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### deleteScheduledSend `mail.deleteScheduledSend` Delete a cancellation/pause for a scheduled send **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.mail.deleteScheduledSend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch_id` | `string` | Yes | — | **Output:** *empty object* *** ### getScheduledSend `mail.getScheduledSend` Retrieve a scheduled send by batch ID **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.mail.getScheduledSend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch_id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### listScheduledSends `mail.listScheduledSends` Retrieve all scheduled sends **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.mail.listScheduledSends({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### send `mail.send` Send an email via SendGrid Mail Send API v3 **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.mail.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `personalizations` | `object[]` | Yes | — | | `from` | `object` | Yes | — | | `subject` | `string` | No | — | | `content` | `object[]` | No | — | | `reply_to` | `object` | No | — | | `template_id` | `string` | No | — | | `categories` | `string[]` | No | — | | `send_at` | `number` | No | — | | `batch_id` | `string` | No | — | | `ip_pool_name` | `string` | No | — | | `asm` | `object` | No | — | > **personalizations full type** > > ```ts theme={null} > { > to: { > email: string, > name?: string > }[], > cc?: { > email: string, > name?: string > }[], > bcc?: { > email: string, > name?: string > }[], > subject?: string, > headers?: { > }, > substitutions?: { > }, > dynamic_template_data?: { > }, > custom_args?: { > }, > send_at?: number > }[] > ``` > **from full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` > **content full type** > > ```ts theme={null} > { > type: string, > value: string > }[] > ``` > **reply\_to full type** > > ```ts theme={null} > { > email: string, > name?: string > } > ``` > **asm full type** > > ```ts theme={null} > { > group_id: number, > groups_to_display?: number[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `x_message_id` | `string` | No | — | *** ### updateScheduledSend `mail.updateScheduledSend` Update a scheduled send status **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.mail.updateScheduledSend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch_id` | `string` | Yes | — | | `status` | `pause \| cancel` | Yes | — | **Output:** *empty object* *** ### validateBatchId `mail.validateBatchId` Validate a mail batch ID **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.mail.validateBatchId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `batch_id` | `string` | Yes | — | **Output:** *empty object* *** ## Segments ### create `segments.create` Create a Marketing Campaigns segment 2.0 **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.segments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `query_dsl` | `string` | No | — | | `parent_list_id` | `string` | No | — | **Output:** *empty object* *** ### get `segments.get` Get a Marketing Campaigns segment 2.0 **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.segments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `contacts_sample` | `boolean` | No | — | **Output:** *empty object* *** ### getAll `segments.getAll` Get all Marketing Campaigns segments 2.0 **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.segments.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parent_list_ids` | `string` | No | — | | `no_parent_list_id` | `boolean` | No | — | **Output:** *empty object* *** ### refresh `segments.refresh` Manually refresh a Marketing Campaigns segment 2.0 **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.segments.refresh({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `user_time_zone` | `string` | Yes | — | **Output:** *empty object* *** ### remove `segments.remove` Delete a Marketing Campaigns segment 2.0 **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.segments.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### update `segments.update` Update a Marketing Campaigns segment 2.0 **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.segments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `query_dsl` | `string` | No | — | **Output:** *empty object* *** ## Senders ### create `senders.create` Create a verified sender **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.senders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `nickname` | `string` | Yes | — | | `from_email` | `string` | Yes | — | | `from_name` | `string` | No | — | | `reply_to` | `string` | No | — | | `address` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `zip` | `string` | No | — | | `country` | `string` | No | — | **Output:** *empty object* *** ### createIdentity `senders.createIdentity` Create a Marketing Campaigns sender identity **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.senders.createIdentity({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### getAll `senders.getAll` Retrieve verified senders **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.senders.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `lastSeenID` | `number` | No | — | | `id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: number, > nickname: string, > from_email: string, > from_name?: string, > reply_to?: string, > reply_to_name?: string, > address?: string, > address2?: string, > state?: string, > city?: string, > zip?: string, > country?: string, > verified: boolean, > locked?: boolean > }[] > ``` *** ### getIdentity `senders.getIdentity` Get a Marketing Campaigns sender identity **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.senders.getIdentity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** *empty object* *** ### listIdentities `senders.listIdentities` Get Marketing Campaigns sender identities **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.senders.listIdentities({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### remove `senders.remove` Delete a verified sender **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.senders.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** *empty object* *** ### resend `senders.resend` Resend verified sender verification **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.senders.resend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output:** *empty object* *** ### update `senders.update` Update a verified sender **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.senders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | | `nickname` | `string` | No | — | | `from_email` | `string` | No | — | **Output:** *empty object* *** ## Stats ### getCategory `stats.getCategory` Retrieve category statistics **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.stats.getCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | No | — | | `aggregated_by` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `mailbox_providers` | `string` | No | — | | `country` | `string` | No | — | | `categories` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getClient `stats.getClient` Retrieve email client statistics **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.stats.getClient({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | No | — | | `aggregated_by` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `mailbox_providers` | `string` | No | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getDevice `stats.getDevice` Retrieve device statistics **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.stats.getDevice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | No | — | | `aggregated_by` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `mailbox_providers` | `string` | No | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getGeo `stats.getGeo` Retrieve geographic statistics **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.stats.getGeo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | No | — | | `aggregated_by` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `mailbox_providers` | `string` | No | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getGlobal `stats.getGlobal` Retrieve global email statistics **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.stats.getGlobal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | No | — | | `aggregated_by` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `mailbox_providers` | `string` | No | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getMailboxProvider `stats.getMailboxProvider` Retrieve mailbox provider statistics **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.stats.getMailboxProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string` | Yes | — | | `end_date` | `string` | No | — | | `aggregated_by` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `mailbox_providers` | `string` | No | — | | `country` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ## Suppressions ### addGlobalUnsubscribes `suppressions.addGlobalUnsubscribes` Add emails to the global unsubscribe list **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.addGlobalUnsubscribes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recipient_emails` | `string[]` | Yes | — | **Output:** *empty object* *** ### deleteBlock `suppressions.deleteBlock` Delete a block by email **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.deleteBlock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** *empty object* *** ### deleteBlocks `suppressions.deleteBlocks` Delete blocked emails **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.deleteBlocks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `delete_all` | `boolean` | No | — | | `emails` | `string[]` | No | — | **Output:** *empty object* *** ### deleteBounce `suppressions.deleteBounce` Delete a bounce by email **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.deleteBounce({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** *empty object* *** ### deleteBounces `suppressions.deleteBounces` Delete bounce suppressions **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.deleteBounces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `delete_all` | `boolean` | No | — | | `emails` | `string[]` | No | — | **Output:** *empty object* *** ### deleteGlobalUnsubscribe `suppressions.deleteGlobalUnsubscribe` Delete a global unsubscribe by email **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.deleteGlobalUnsubscribe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** *empty object* *** ### deleteInvalidEmail `suppressions.deleteInvalidEmail` Delete an invalid email **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.deleteInvalidEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** *empty object* *** ### deleteInvalidEmails `suppressions.deleteInvalidEmails` Delete invalid emails **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.deleteInvalidEmails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `delete_all` | `boolean` | No | — | | `emails` | `string[]` | No | — | **Output:** *empty object* *** ### deleteSpamReport `suppressions.deleteSpamReport` Delete a spam report by email **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.deleteSpamReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** *empty object* *** ### deleteSpamReports `suppressions.deleteSpamReports` Delete spam reports **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.suppressions.deleteSpamReports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `delete_all` | `boolean` | No | — | | `emails` | `string[]` | No | — | **Output:** *empty object* *** ### getBlock `suppressions.getBlock` Retrieve a block by email **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getBlock({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getBlocks `suppressions.getBlocks` Retrieve blocked emails **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getBlocks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `number` | No | — | | `end_time` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### getBounce `suppressions.getBounce` Retrieve a bounce by email **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getBounce({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getBounces `suppressions.getBounces` Retrieve email bounce suppressions **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getBounces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `number` | No | — | | `end_time` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bounces` | `object[]` | Yes | — | > **bounces full type** > > ```ts theme={null} > { > created: number, > email: string, > reason: string, > status: string > }[] > ``` *** ### getGlobalUnsubscribe `suppressions.getGlobalUnsubscribe` Retrieve a global unsubscribe by email **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getGlobalUnsubscribe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** *empty object* *** ### getGlobalUnsubscribes `suppressions.getGlobalUnsubscribes` Retrieve global unsubscribes **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getGlobalUnsubscribes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `number` | No | — | | `end_time` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### getInvalidEmail `suppressions.getInvalidEmail` Retrieve an invalid email **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getInvalidEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getInvalidEmails `suppressions.getInvalidEmails` Retrieve invalid emails **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getInvalidEmails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `number` | No | — | | `end_time` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ### getSpamReport `suppressions.getSpamReport` Retrieve a spam report by email **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getSpamReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > }[] > ``` *** ### getSpamReports `suppressions.getSpamReports` Retrieve spam reports **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.suppressions.getSpamReports({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `number` | No | — | | `end_time` | `number` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > }[] > ``` *** ## Templates ### activateVersion `templates.activateVersion` Activate a transactional template version **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.templates.activateVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `version_id` | `string` | Yes | — | **Output:** *empty object* *** ### create `templates.create` Create a transactional template **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.templates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `generation` | `string` | No | — | **Output:** *empty object* *** ### createVersion `templates.createVersion` Create a transactional template version **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.templates.createVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `html_content` | `string` | No | — | | `plain_content` | `string` | No | — | | `active` | `number` | No | — | **Output:** *empty object* *** ### get `templates.get` Get a transactional template **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.templates.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### getAll `templates.getAll` Get all transactional templates **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.templates.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `generations` | `string` | No | — | | `page_size` | `number` | No | — | **Output:** *empty object* *** ### getVersion `templates.getVersion` Get a transactional template version **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.templates.getVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `version_id` | `string` | Yes | — | **Output:** *empty object* *** ### remove `templates.remove` Delete a transactional template **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.templates.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### removeVersion `templates.removeVersion` Delete a transactional template version **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.templates.removeVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `version_id` | `string` | Yes | — | **Output:** *empty object* *** ### update `templates.update` Update a transactional template **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.templates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output:** *empty object* *** ### updateVersion `templates.updateVersion` Update a transactional template version **Risk:** `write` ```ts theme={null} await corsair.sendgrid.api.templates.updateVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `version_id` | `string` | Yes | — | | `name` | `string` | No | — | | `subject` | `string` | No | — | | `html_content` | `string` | No | — | | `plain_content` | `string` | No | — | **Output:** *empty object* *** ## User ### getAccount `user.getAccount` Retrieve the user account **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.user.getAccount({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### getCredits `user.getCredits` Retrieve remaining email credits **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.user.getCredits({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### getEmail `user.getEmail` Retrieve the account email address **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.user.getEmail({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### getProfile `user.getProfile` Retrieve the user profile **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.user.getProfile({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### getScopes `user.getScopes` Retrieve API key scopes for the current key **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.user.getScopes({}); ``` **Input:** *empty object* **Output:** *empty object* *** ### getUsername `user.getUsername` Retrieve the account username **Risk:** `read` ```ts theme={null} await corsair.sendgrid.api.user.getUsername({}); ``` **Input:** *empty object* **Output:** *empty object* *** # Database Source: https://docs.corsair.dev/plugins/sendgrid/database SendGrid local sync: searchable entities, `.search()` filters, and operators. The SendGrid plugin syncs data locally. Use `corsair.sendgrid.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Bounces Path: `sendgrid.db.bounces.search` ```ts theme={null} const rows = await corsair.sendgrid.db.bounces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `reason` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `sendgrid.db.contacts.search` ```ts theme={null} const rows = await corsair.sendgrid.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number_id` | `string` | equals, contains, startsWith, endsWith, in | | `external_id` | `string` | equals, contains, startsWith, endsWith, in | | `anonymous_id` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `address_line_1` | `string` | equals, contains, startsWith, endsWith, in | | `address_line_2` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `postal_code` | `string` | equals, contains, startsWith, endsWith, in | | `state_province_region` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `sendgrid.db.lists.search` ```ts theme={null} const rows = await corsair.sendgrid.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `contact_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Senders Path: `sendgrid.db.senders.search` ```ts theme={null} const rows = await corsair.sendgrid.db.senders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `nickname` | `string` | equals, contains, startsWith, endsWith, in | | `from_email` | `string` | equals, contains, startsWith, endsWith, in | | `from_name` | `string` | equals, contains, startsWith, endsWith, in | | `reply_to` | `string` | equals, contains, startsWith, endsWith, in | | `reply_to_name` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `address2` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `zip` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `verified` | `boolean` | equals | | `locked` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/sendgrid/overview Email delivery platform for transactional mail, marketing campaigns, and sender reputation tools. Use **SendGrid** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 100 typed API operations * 4 synced entities (`bounces`, `contacts`, `lists`, `senders`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/sendgrid ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/sendgrid ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/sendgrid ``` ```bash bun theme={null} bun add corsair @corsair-dev/sendgrid ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { sendgrid } from '@corsair-dev/sendgrid'; export const corsair = createCorsair({ plugins: [ sendgrid(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} sendgrid() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'sendgrid', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`apiKeys.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.sendgrid.api.apiKeys.get({}); ``` **`apiKeys.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.sendgrid.api.apiKeys.create({}); ``` See the full list on the [API](/plugins/sendgrid/api) page. ## Query synced data Synced entities support `tenant.sendgrid.db..search()` and `.list()`: `bounces`, `contacts`, `lists`, `senders`. See [Database](/plugins/sendgrid/database) for filters and operators. ## What's next > **[API reference](/plugins/sendgrid/api)** > > Every `sendgrid.api.*` operation with input and output types. > **[Database](/plugins/sendgrid/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/sentry/api API reference for Sentry: every `sentry.api.*` operation with input and output types. Every `sentry.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Events ### get `events.get` Get an event by ID **Risk:** `read` ```ts theme={null} await corsair.sentry.api.events.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `projectSlug` | `string` | Yes | — | | `eventId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `eventID` | `string` | Yes | — | | `title` | `string` | No | — | | `message` | `string` | No | — | | `platform` | `string` | No | — | | `dateCreated` | `string` | No | — | | `dateReceived` | `string` | No | — | | `type` | `string` | No | — | | `groupID` | `string` | No | — | | `tags` | `object[]` | No | — | | `context` | `object` | No | — | > **tags full type** > > ```ts theme={null} > { > key: string, > value: string > }[] > ``` > **context full type** > > ```ts theme={null} > { > } > ``` *** ### list `events.list` List events for a project **Risk:** `read` ```ts theme={null} await corsair.sentry.api.events.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `projectSlug` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > eventID: string, > title?: string | null, > message?: string | null, > platform?: string | null, > dateCreated?: string | null, > dateReceived?: string | null, > type?: string | null, > groupID?: string | null, > tags?: { > key: string, > value: string > }[] | null, > context?: { > } | null > }[] > ``` *** ## Issues ### delete `issues.delete` Permanently delete an issue **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.sentry.api.issues.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issueId` | `string` | Yes | — | **Output:** `boolean` *** ### get `issues.get` Get an issue by ID **Risk:** `read` ```ts theme={null} await corsair.sentry.api.issues.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issueId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `shortId` | `string` | Yes | — | | `title` | `string` | Yes | — | | `culprit` | `string` | No | — | | `permalink` | `string` | No | — | | `level` | `string` | No | — | | `status` | `string` | Yes | — | | `platform` | `string` | No | — | | `type` | `string` | No | — | | `count` | `string` | No | — | | `userCount` | `number` | No | — | | `firstSeen` | `string` | No | — | | `lastSeen` | `string` | No | — | | `isPublic` | `boolean` | No | — | | `isBookmarked` | `boolean` | No | — | | `hasSeen` | `boolean` | No | — | | `isSubscribed` | `boolean` | No | — | | `metadata` | `object` | No | — | | `project` | `object` | No | — | | `assignedTo` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **project full type** > > ```ts theme={null} > { > id: string, > name: string, > slug: string > } > ``` > **assignedTo full type** > > ```ts theme={null} > { > id: string, > name: string, > type: string > } > ``` *** ### list `issues.list` List issues for a project **Risk:** `read` ```ts theme={null} await corsair.sentry.api.issues.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `projectSlug` | `string` | Yes | — | | `query` | `string` | No | — | | `cursor` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > shortId: string, > title: string, > culprit?: string | null, > permalink?: string | null, > level?: string | null, > status: string, > platform?: string | null, > type?: string | null, > count?: string | null, > userCount?: number | null, > firstSeen?: string | null, > lastSeen?: string | null, > isPublic?: boolean | null, > isBookmarked?: boolean | null, > hasSeen?: boolean | null, > isSubscribed?: boolean | null, > metadata?: { > } | null, > project?: { > id: string, > name: string, > slug: string > } | null, > assignedTo?: { > id: string, > name: string, > type: string > } | null > }[] > ``` *** ### update `issues.update` Update an issue **Risk:** `write` ```ts theme={null} await corsair.sentry.api.issues.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `issueId` | `string` | Yes | — | | `status` | `resolved \| unresolved \| ignored` | No | — | | `assignedTo` | `string` | No | — | | `hasSeen` | `boolean` | No | — | | `isBookmarked` | `boolean` | No | — | | `isPublic` | `boolean` | No | — | | `isSubscribed` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `shortId` | `string` | Yes | — | | `title` | `string` | Yes | — | | `culprit` | `string` | No | — | | `permalink` | `string` | No | — | | `level` | `string` | No | — | | `status` | `string` | Yes | — | | `platform` | `string` | No | — | | `type` | `string` | No | — | | `count` | `string` | No | — | | `userCount` | `number` | No | — | | `firstSeen` | `string` | No | — | | `lastSeen` | `string` | No | — | | `isPublic` | `boolean` | No | — | | `isBookmarked` | `boolean` | No | — | | `hasSeen` | `boolean` | No | — | | `isSubscribed` | `boolean` | No | — | | `metadata` | `object` | No | — | | `project` | `object` | No | — | | `assignedTo` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **project full type** > > ```ts theme={null} > { > id: string, > name: string, > slug: string > } > ``` > **assignedTo full type** > > ```ts theme={null} > { > id: string, > name: string, > type: string > } > ``` *** ## Organizations ### create `organizations.create` Create a new organization **Risk:** `write` ```ts theme={null} await corsair.sentry.api.organizations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `slug` | `string` | No | — | | `agreeTerms` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `dateCreated` | `string` | No | — | | `status` | `object` | No | — | | `isEarlyAdopter` | `boolean` | No | — | | `require2FA` | `boolean` | No | — | | `avatar` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > id: string, > name: string > } > ``` > **avatar full type** > > ```ts theme={null} > { > avatarType: string, > avatarUuid?: string | null > } > ``` *** ### get `organizations.get` Get an organization by slug **Risk:** `read` ```ts theme={null} await corsair.sentry.api.organizations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `dateCreated` | `string` | No | — | | `status` | `object` | No | — | | `isEarlyAdopter` | `boolean` | No | — | | `require2FA` | `boolean` | No | — | | `avatar` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > id: string, > name: string > } > ``` > **avatar full type** > > ```ts theme={null} > { > avatarType: string, > avatarUuid?: string | null > } > ``` *** ### list `organizations.list` List organizations **Risk:** `read` ```ts theme={null} await corsair.sentry.api.organizations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string, > dateCreated?: string | null, > status?: { > id: string, > name: string > } | null, > isEarlyAdopter?: boolean | null, > require2FA?: boolean | null, > avatar?: { > avatarType: string, > avatarUuid?: string | null > } | null > }[] > ``` *** ### update `organizations.update` Update an organization **Risk:** `write` ```ts theme={null} await corsair.sentry.api.organizations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `name` | `string` | No | — | | `slug` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `dateCreated` | `string` | No | — | | `status` | `object` | No | — | | `isEarlyAdopter` | `boolean` | No | — | | `require2FA` | `boolean` | No | — | | `avatar` | `object` | No | — | > **status full type** > > ```ts theme={null} > { > id: string, > name: string > } > ``` > **avatar full type** > > ```ts theme={null} > { > avatarType: string, > avatarUuid?: string | null > } > ``` *** ## Projects ### create `projects.create` Create a new project **Risk:** `write` ```ts theme={null} await corsair.sentry.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `teamSlug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `slug` | `string` | No | — | | `platform` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `platform` | `string` | No | — | | `dateCreated` | `string` | No | — | | `isBookmarked` | `boolean` | No | — | | `isMember` | `boolean` | No | — | | `hasAccess` | `boolean` | No | — | | `organization` | `object` | No | — | | `team` | `object` | No | — | > **organization full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string, > dateCreated?: string | null, > status?: { > id: string, > name: string > } | null, > isEarlyAdopter?: boolean | null, > require2FA?: boolean | null, > avatar?: { > avatarType: string, > avatarUuid?: string | null > } | null > } > ``` > **team full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string > } > ``` *** ### delete `projects.delete` Permanently delete a project **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.sentry.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `projectSlug` | `string` | Yes | — | **Output:** `boolean` *** ### get `projects.get` Get a project by slug **Risk:** `read` ```ts theme={null} await corsair.sentry.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `projectSlug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `platform` | `string` | No | — | | `dateCreated` | `string` | No | — | | `isBookmarked` | `boolean` | No | — | | `isMember` | `boolean` | No | — | | `hasAccess` | `boolean` | No | — | | `organization` | `object` | No | — | | `team` | `object` | No | — | > **organization full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string, > dateCreated?: string | null, > status?: { > id: string, > name: string > } | null, > isEarlyAdopter?: boolean | null, > require2FA?: boolean | null, > avatar?: { > avatarType: string, > avatarUuid?: string | null > } | null > } > ``` > **team full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string > } > ``` *** ### list `projects.list` List projects for an organization **Risk:** `read` ```ts theme={null} await corsair.sentry.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string, > platform?: string | null, > dateCreated?: string | null, > isBookmarked?: boolean | null, > isMember?: boolean | null, > hasAccess?: boolean | null, > organization?: { > id: string, > slug: string, > name: string, > dateCreated?: string | null, > status?: { > id: string, > name: string > } | null, > isEarlyAdopter?: boolean | null, > require2FA?: boolean | null, > avatar?: { > avatarType: string, > avatarUuid?: string | null > } | null > } | null, > team?: { > id: string, > slug: string, > name: string > } | null > }[] > ``` *** ### update `projects.update` Update a project **Risk:** `write` ```ts theme={null} await corsair.sentry.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `projectSlug` | `string` | Yes | — | | `name` | `string` | No | — | | `slug` | `string` | No | — | | `platform` | `string` | No | — | | `isBookmarked` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `platform` | `string` | No | — | | `dateCreated` | `string` | No | — | | `isBookmarked` | `boolean` | No | — | | `isMember` | `boolean` | No | — | | `hasAccess` | `boolean` | No | — | | `organization` | `object` | No | — | | `team` | `object` | No | — | > **organization full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string, > dateCreated?: string | null, > status?: { > id: string, > name: string > } | null, > isEarlyAdopter?: boolean | null, > require2FA?: boolean | null, > avatar?: { > avatarType: string, > avatarUuid?: string | null > } | null > } > ``` > **team full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string > } > ``` *** ## Releases ### create `releases.create` Create a new release **Risk:** `write` ```ts theme={null} await corsair.sentry.api.releases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `version` | `string` | Yes | — | | `ref` | `string` | No | — | | `url` | `string` | No | — | | `projects` | `string[]` | Yes | — | | `dateReleased` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `version` | `string` | Yes | — | | `shortVersion` | `string` | No | — | | `dateCreated` | `string` | No | — | | `dateReleased` | `string` | No | — | | `firstEvent` | `string` | No | — | | `lastEvent` | `string` | No | — | | `newGroups` | `number` | No | — | | `url` | `string` | No | — | | `ref` | `string` | No | — | | `projects` | `object[]` | No | — | > **projects full type** > > ```ts theme={null} > { > id: number, > slug: string, > name: string > }[] > ``` *** ### delete `releases.delete` Delete a release **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.sentry.api.releases.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `version` | `string` | Yes | — | **Output:** `boolean` *** ### get `releases.get` Get a release by version ID **Risk:** `read` ```ts theme={null} await corsair.sentry.api.releases.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `version` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `version` | `string` | Yes | — | | `shortVersion` | `string` | No | — | | `dateCreated` | `string` | No | — | | `dateReleased` | `string` | No | — | | `firstEvent` | `string` | No | — | | `lastEvent` | `string` | No | — | | `newGroups` | `number` | No | — | | `url` | `string` | No | — | | `ref` | `string` | No | — | | `projects` | `object[]` | No | — | > **projects full type** > > ```ts theme={null} > { > id: number, > slug: string, > name: string > }[] > ``` *** ### list `releases.list` List releases for an organization **Risk:** `read` ```ts theme={null} await corsair.sentry.api.releases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `query` | `string` | No | — | | `cursor` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > version: string, > shortVersion?: string | null, > dateCreated?: string | null, > dateReleased?: string | null, > firstEvent?: string | null, > lastEvent?: string | null, > newGroups?: number | null, > url?: string | null, > ref?: string | null, > projects?: { > id: number, > slug: string, > name: string > }[] | null > }[] > ``` *** ### update `releases.update` Update a release **Risk:** `write` ```ts theme={null} await corsair.sentry.api.releases.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `version` | `string` | Yes | — | | `ref` | `string` | No | — | | `url` | `string` | No | — | | `dateReleased` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `version` | `string` | Yes | — | | `shortVersion` | `string` | No | — | | `dateCreated` | `string` | No | — | | `dateReleased` | `string` | No | — | | `firstEvent` | `string` | No | — | | `lastEvent` | `string` | No | — | | `newGroups` | `number` | No | — | | `url` | `string` | No | — | | `ref` | `string` | No | — | | `projects` | `object[]` | No | — | > **projects full type** > > ```ts theme={null} > { > id: number, > slug: string, > name: string > }[] > ``` *** ## Teams ### create `teams.create` Create a new team **Risk:** `write` ```ts theme={null} await corsair.sentry.api.teams.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `slug` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `dateCreated` | `string` | No | — | | `isMember` | `boolean` | No | — | | `memberCount` | `number` | No | — | | `hasAccess` | `boolean` | No | — | | `isPending` | `boolean` | No | — | | `avatar` | `object` | No | — | > **avatar full type** > > ```ts theme={null} > { > avatarType: string, > avatarUuid?: string | null > } > ``` *** ### delete `teams.delete` Delete a team **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.sentry.api.teams.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `teamSlug` | `string` | Yes | — | **Output:** `boolean` *** ### get `teams.get` Get a team by slug **Risk:** `read` ```ts theme={null} await corsair.sentry.api.teams.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `teamSlug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `dateCreated` | `string` | No | — | | `isMember` | `boolean` | No | — | | `memberCount` | `number` | No | — | | `hasAccess` | `boolean` | No | — | | `isPending` | `boolean` | No | — | | `avatar` | `object` | No | — | > **avatar full type** > > ```ts theme={null} > { > avatarType: string, > avatarUuid?: string | null > } > ``` *** ### list `teams.list` List teams for an organization **Risk:** `read` ```ts theme={null} await corsair.sentry.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string, > dateCreated?: string | null, > isMember?: boolean | null, > memberCount?: number | null, > hasAccess?: boolean | null, > isPending?: boolean | null, > avatar?: { > avatarType: string, > avatarUuid?: string | null > } | null > }[] > ``` *** ### update `teams.update` Update a team **Risk:** `write` ```ts theme={null} await corsair.sentry.api.teams.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationSlug` | `string` | Yes | — | | `teamSlug` | `string` | Yes | — | | `name` | `string` | No | — | | `slug` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `slug` | `string` | Yes | — | | `name` | `string` | Yes | — | | `dateCreated` | `string` | No | — | | `isMember` | `boolean` | No | — | | `memberCount` | `number` | No | — | | `hasAccess` | `boolean` | No | — | | `isPending` | `boolean` | No | — | | `avatar` | `object` | No | — | > **avatar full type** > > ```ts theme={null} > { > avatarType: string, > avatarUuid?: string | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/sentry/database Sentry local sync: searchable entities, `.search()` filters, and operators. The Sentry plugin syncs data locally. Use `corsair.sentry.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Comments Path: `sentry.db.comments.search` ```ts theme={null} const rows = await corsair.sentry.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `comment_id` | `string` | equals, contains, startsWith, endsWith, in | | `issue_id` | `string` | equals, contains, startsWith, endsWith, in | | `project_slug` | `string` | equals, contains, startsWith, endsWith, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | | `timestamp` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Events Path: `sentry.db.events.search` ```ts theme={null} const rows = await corsair.sentry.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `eventID` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `platform` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `date` | equals, before, after, between | | `dateReceived` | `date` | equals, before, after, between | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `groupID` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Issues Path: `sentry.db.issues.search` ```ts theme={null} const rows = await corsair.sentry.db.issues.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `shortId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `culprit` | `string` | equals, contains, startsWith, endsWith, in | | `permalink` | `string` | equals, contains, startsWith, endsWith, in | | `level` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `platform` | `string` | equals, contains, startsWith, endsWith, in | | `project` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `count` | `string` | equals, contains, startsWith, endsWith, in | | `userCount` | `number` | equals, gt, gte, lt, lte, in | | `firstSeen` | `date` | equals, before, after, between | | `lastSeen` | `date` | equals, before, after, between | | `isPublic` | `boolean` | equals | | `isBookmarked` | `boolean` | equals | | `hasSeen` | `boolean` | equals | | `isSubscribed` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `sentry.db.organizations.search` ```ts theme={null} const rows = await corsair.sentry.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `date` | equals, before, after, between | | `isEarlyAdopter` | `boolean` | equals | | `require2FA` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `sentry.db.projects.search` ```ts theme={null} const rows = await corsair.sentry.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `platform` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `date` | equals, before, after, between | | `isBookmarked` | `boolean` | equals | | `isMember` | `boolean` | equals | | `hasAccess` | `boolean` | equals | | `organization` | `string` | equals, contains, startsWith, endsWith, in | | `team` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Releases Path: `sentry.db.releases.search` ```ts theme={null} const rows = await corsair.sentry.db.releases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `shortVersion` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `date` | equals, before, after, between | | `dateReleased` | `date` | equals, before, after, between | | `firstEvent` | `date` | equals, before, after, between | | `lastEvent` | `date` | equals, before, after, between | | `newGroups` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `sentry.db.teams.search` ```ts theme={null} const rows = await corsair.sentry.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `date` | equals, before, after, between | | `isMember` | `boolean` | equals | | `memberCount` | `number` | equals, gt, gte, lt, lte, in | | `hasAccess` | `boolean` | equals | | `isPending` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/sentry/get-credentials Step-by-step instructions for obtaining Sentry auth tokens and webhook secrets for the Corsair Sentry plugin. This guide walks you through obtaining all required credentials for the Sentry plugin. ## Authentication Method The Sentry plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) — Sentry **User auth token** (sent as `Authorization: Bearer ` to `https://sentry.io/api/0/`) Sentry’s API expects a bearer token with sufficient scopes for the endpoints you use (organizations, projects, issues, releases, etc.). ## User Auth Token ### Step 1: Create a Token 1. Log in to [Sentry](https://sentry.io/). 2. Open **Settings** → **Account** → **Auth Tokens** (or **User settings** → **Auth Tokens**). 3. Click **Create New Token**. 4. Name the token (for example, `Corsair`) and select **scopes** that match your needs — at minimum, the read/write scopes for organizations, projects, issues, or releases you will access via Corsair. 5. Create the token and **copy it immediately**. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=sentry api_key=your-auth-token ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=sentry --credentials ``` If you self-host Sentry, generate tokens from your instance’s account settings the same way; Corsair still sends the value as a Bearer token to your configured API base where applicable. ## Webhook Secret Sentry integrations that deliver webhooks to your app may include a secret for verifying `sentry-hook-signature` (or related headers). 1. In Sentry, open **Settings** → **Integrations** (or your **Internal integration**) for the project or organization. 2. Configure the outbound webhook and copy the **secret** used for signature verification. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=sentry webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | User auth token | [`api_key`](/concepts/api-key) auth | Sentry → Settings → Auth Tokens | | Webhook secret | Webhooks | Integration / webhook configuration | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/sentry/overview Application monitoring for error tracking, performance tracing, and release health insights. Use **Sentry** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 25 typed API operations * 7 synced entities (`comments`, `events`, `issues`, `organizations`, `projects`, `releases`, and 1 more) for fast `.search()` / `.list()` * 9 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/sentry ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/sentry ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/sentry ``` ```bash bun theme={null} bun add corsair @corsair-dev/sentry ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { sentry } from '@corsair-dev/sentry'; export const corsair = createCorsair({ plugins: [ sentry(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/sentry/get-credentials). ```ts theme={null} sentry() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'sentry', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`events.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.sentry.api.events.get({}); ``` **`issues.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.sentry.api.issues.delete({}); ``` See the full list on the [API](/plugins/sentry/api) page. ## Query synced data Synced entities support `tenant.sentry.db..search()` and `.list()`: `comments`, `events`, `issues`, `organizations`, `projects`, `releases`, `teams`. See [Database](/plugins/sentry/database) for filters and operators. ## Webhooks This plugin registers **9** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/sentry/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/sentry/api)** > > Every `sentry.api.*` operation with input and output types. > **[Database](/plugins/sentry/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/sentry/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/sentry/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/sentry/webhooks Sentry incoming webhooks: event paths, payloads, and response data. The Sentry plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/sentry/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `alerts` * `eventAlert` (`alerts.eventAlert`) * `metricAlert` (`alerts.metricAlert`) * `comments` * `created` (`comments.created`) * `deleted` (`comments.deleted`) * `updated` (`comments.updated`) * `errors` * `created` (`errors.created`) * `issues` * `assigned` (`issues.assigned`) * `created` (`issues.created`) * `resolved` (`issues.resolved`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Alerts ### Event Alert `alerts.eventAlert` An issue alert rule was triggered **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `triggered` | Yes | — | | `data` | `object` | Yes | — | | `actor` | `object` | No | — | | `installation` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > event: { > event_id?: string, > title?: string, > message?: string, > platform?: string | null, > level?: string | null, > url?: string > }, > triggered_rule?: string > } > ``` > **actor full type** > > ```ts theme={null} > { > type: string, > id?: number, > name?: string > } > ``` > **installation full type** > > ```ts theme={null} > { > uuid: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: triggered, > data: { > event: { > event_id?: string, > title?: string, > message?: string, > platform?: string | null, > level?: string | null, > url?: string > }, > triggered_rule?: string > }, > actor?: { > type: string, > id?: number, > name?: string > }, > installation?: { > uuid: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} sentry({ webhookHooks: { alerts: { eventAlert: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Metric Alert `alerts.metricAlert` A metric alert was triggered **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `triggered` | Yes | — | | `data` | `object` | Yes | — | | `actor` | `object` | No | — | | `installation` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > metric_alert: { > id?: string, > title?: string, > alert_rule?: { > id?: number, > name?: string > }, > status?: string, > date_triggered?: string > }, > description_title?: string, > description_text?: string > } > ``` > **actor full type** > > ```ts theme={null} > { > type: string, > id?: number, > name?: string > } > ``` > **installation full type** > > ```ts theme={null} > { > uuid: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: triggered, > data: { > metric_alert: { > id?: string, > title?: string, > alert_rule?: { > id?: number, > name?: string > }, > status?: string, > date_triggered?: string > }, > description_title?: string, > description_text?: string > }, > actor?: { > type: string, > id?: number, > name?: string > }, > installation?: { > uuid: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} sentry({ webhookHooks: { alerts: { metricAlert: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Comments ### Created `comments.created` A comment was added to an issue **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `data` | `object` | Yes | — | | `actor` | `object` | Yes | — | | `installation` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > comment_id?: string, > issue_id?: string, > project_slug?: string, > comment?: string, > timestamp?: string > } > ``` > **actor full type** > > ```ts theme={null} > { > type: string, > id?: number, > name?: string > } > ``` > **installation full type** > > ```ts theme={null} > { > uuid: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > data: { > comment_id?: string, > issue_id?: string, > project_slug?: string, > comment?: string, > timestamp?: string > }, > actor: { > type: string, > id?: number, > name?: string > }, > installation?: { > uuid: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} sentry({ webhookHooks: { comments: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `comments.deleted` A comment was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `deleted` | Yes | — | | `data` | `object` | Yes | — | | `actor` | `object` | Yes | — | | `installation` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > comment_id?: string, > issue_id?: string, > project_slug?: string, > comment?: string, > timestamp?: string > } > ``` > **actor full type** > > ```ts theme={null} > { > type: string, > id?: number, > name?: string > } > ``` > **installation full type** > > ```ts theme={null} > { > uuid: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: deleted, > data: { > comment_id?: string, > issue_id?: string, > project_slug?: string, > comment?: string, > timestamp?: string > }, > actor: { > type: string, > id?: number, > name?: string > }, > installation?: { > uuid: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} sentry({ webhookHooks: { comments: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `comments.updated` A comment was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `updated` | Yes | — | | `data` | `object` | Yes | — | | `actor` | `object` | Yes | — | | `installation` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > comment_id?: string, > issue_id?: string, > project_slug?: string, > comment?: string, > timestamp?: string > } > ``` > **actor full type** > > ```ts theme={null} > { > type: string, > id?: number, > name?: string > } > ``` > **installation full type** > > ```ts theme={null} > { > uuid: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: updated, > data: { > comment_id?: string, > issue_id?: string, > project_slug?: string, > comment?: string, > timestamp?: string > }, > actor: { > type: string, > id?: number, > name?: string > }, > installation?: { > uuid: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} sentry({ webhookHooks: { comments: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Errors ### Created `errors.created` A new error event was captured in Sentry **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `data` | `object` | Yes | — | | `actor` | `object` | No | — | | `installation` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > error: { > event_id?: string, > title?: string, > platform?: string | null, > level?: string | null, > url?: string, > culprit?: string | null, > project?: string | null, > message?: string | null > } > } > ``` > **actor full type** > > ```ts theme={null} > { > type: string, > id?: number, > name?: string > } > ``` > **installation full type** > > ```ts theme={null} > { > uuid: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > data: { > error: { > event_id?: string, > title?: string, > platform?: string | null, > level?: string | null, > url?: string, > culprit?: string | null, > project?: string | null, > message?: string | null > } > }, > actor?: { > type: string, > id?: number, > name?: string > }, > installation?: { > uuid: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} sentry({ webhookHooks: { errors: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Issues ### Assigned `issues.assigned` An issue was assigned to a user or team **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `assigned` | Yes | — | | `data` | `object` | Yes | — | | `actor` | `object` | Yes | — | | `installation` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > issue: { > id: string, > shortId: string, > title: string, > culprit?: string | null, > level?: string | null, > status: string, > platform?: string | null, > type?: string | null, > permalink?: string | null, > firstSeen?: string | null, > lastSeen?: string | null, > assignedTo?: { > id?: string, > name?: string, > type?: string > } | null > } > } > ``` > **actor full type** > > ```ts theme={null} > { > type: string, > id?: number, > name?: string > } > ``` > **installation full type** > > ```ts theme={null} > { > uuid: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: assigned, > data: { > issue: { > id: string, > shortId: string, > title: string, > culprit?: string | null, > level?: string | null, > status: string, > platform?: string | null, > type?: string | null, > permalink?: string | null, > firstSeen?: string | null, > lastSeen?: string | null, > assignedTo?: { > id?: string, > name?: string, > type?: string > } | null > } > }, > actor: { > type: string, > id?: number, > name?: string > }, > installation?: { > uuid: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} sentry({ webhookHooks: { issues: { assigned: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `issues.created` A new issue was created in Sentry **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `created` | Yes | — | | `data` | `object` | Yes | — | | `actor` | `object` | Yes | — | | `installation` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > issue: { > id: string, > shortId: string, > title: string, > culprit?: string | null, > level?: string | null, > status: string, > platform?: string | null, > type?: string | null, > permalink?: string | null, > firstSeen?: string | null, > lastSeen?: string | null > } > } > ``` > **actor full type** > > ```ts theme={null} > { > type: string, > id?: number, > name?: string > } > ``` > **installation full type** > > ```ts theme={null} > { > uuid: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: created, > data: { > issue: { > id: string, > shortId: string, > title: string, > culprit?: string | null, > level?: string | null, > status: string, > platform?: string | null, > type?: string | null, > permalink?: string | null, > firstSeen?: string | null, > lastSeen?: string | null > } > }, > actor: { > type: string, > id?: number, > name?: string > }, > installation?: { > uuid: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} sentry({ webhookHooks: { issues: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Resolved `issues.resolved` An issue was resolved **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `resolved` | Yes | — | | `data` | `object` | Yes | — | | `actor` | `object` | Yes | — | | `installation` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > issue: { > id: string, > shortId: string, > title: string, > culprit?: string | null, > level?: string | null, > status: string, > platform?: string | null, > type?: string | null, > permalink?: string | null, > firstSeen?: string | null, > lastSeen?: string | null > }, > resolution_type?: string > } > ``` > **actor full type** > > ```ts theme={null} > { > type: string, > id?: number, > name?: string > } > ``` > **installation full type** > > ```ts theme={null} > { > uuid: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: resolved, > data: { > issue: { > id: string, > shortId: string, > title: string, > culprit?: string | null, > level?: string | null, > status: string, > platform?: string | null, > type?: string | null, > permalink?: string | null, > firstSeen?: string | null, > lastSeen?: string | null > }, > resolution_type?: string > }, > actor: { > type: string, > id?: number, > name?: string > }, > installation?: { > uuid: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} sentry({ webhookHooks: { issues: { resolved: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/serpapi/api API reference for SerpApi: every `serpapi.api.*` operation with input and output types. Every `serpapi.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Engines ### baiduSearch `engines.baiduSearch` Baidu (Chinese search engine) results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.baiduSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### bingMaps `engines.bingMaps` Bing Maps search for places and businesses **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.bingMaps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `id` | `string` | No | — | | `location` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### bingSearch `engines.bingSearch` Bing search engine results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.bingSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `mkt` | `string` | No | — | | `cc` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### duckDuckGoLightSearch `engines.duckDuckGoLightSearch` Fast, lightweight DuckDuckGo search **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.duckDuckGoLightSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `kl` | `string` | No | — | | `df` | `string` | No | — | | `start` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### duckDuckGoMaps `engines.duckDuckGoMaps` DuckDuckGo Maps search for places and businesses **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.duckDuckGoMaps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `kl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### duckDuckGoSearch `engines.duckDuckGoSearch` DuckDuckGo search engine results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.duckDuckGoSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `kl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### naverSearch `engines.naverSearch` Naver (South Korea's leading search engine) results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.naverSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `where` | `string` | No | — | | `period` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### yahooSearch `engines.yahooSearch` Yahoo! search engine results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.yahooSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `p` | `string` | Yes | — | | `location` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### yahooVideos `engines.yahooVideos` Yahoo! Videos search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.yahooVideos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `p` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### yandexImagesSearch `engines.yandexImagesSearch` Yandex Images search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.yandexImagesSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `isize` | `string` | No | — | | `icolor` | `string` | No | — | | `itype` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### yandexSearch `engines.yandexSearch` Yandex search engine results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.yandexSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `location` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### youtubeSearch `engines.youtubeSearch` YouTube video search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.engines.youtubeSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_query` | `string` | Yes | — | | `gl` | `string` | No | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ## Marketplace ### appleAppStoreSearch `marketplace.appleAppStoreSearch` Apple App Store search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.marketplace.appleAppStoreSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `term` | `string` | Yes | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### ebaySearch `marketplace.ebaySearch` eBay product listing search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.marketplace.ebaySearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `_nkw` | `string` | Yes | — | | `_sacat` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### facebookProfile `marketplace.facebookProfile` Public information from a Facebook profile or page **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.marketplace.facebookProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### openTableReviews `marketplace.openTableReviews` Customer reviews for an OpenTable restaurant **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.marketplace.openTableReviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### walmartProductReviews `marketplace.walmartProductReviews` Customer reviews for a Walmart product **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.marketplace.walmartProductReviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | — | | `sort` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### walmartSearch `marketplace.walmartSearch` Walmart product listing search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.marketplace.walmartSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `cat_id` | `string` | No | — | | `store_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### yelpSearch `marketplace.yelpSearch` Yelp business search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.marketplace.yelpSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `find_loc` | `string` | Yes | — | | `find_desc` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ## Search ### aboutThisResult `search.aboutThisResult` Google's "About this result" details for a URL **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.aboutThisResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### eventSearch `search.eventSearch` Google Events search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.eventSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### financeSearch `search.financeSearch` Google Finance data for a company or ticker **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.financeSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### forumsSearch `search.forumsSearch` Google Forums discussion search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.forumsSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | | `no_cache` | `boolean` | No | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### hotelsAutocomplete `search.hotelsAutocomplete` Autocomplete suggestions for Google Hotels destinations **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.hotelsAutocomplete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### hotelSearch `search.hotelSearch` Google Hotels search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.hotelSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `check_in_date` | `string` | No | — | | `check_out_date` | `string` | No | — | | `adults` | `number` | No | — | | `currency` | `string` | No | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | | `no_cache` | `boolean` | No | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### imageSearch `search.imageSearch` Google Images search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.imageSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | | `no_cache` | `boolean` | No | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### imagesLightSearch `search.imagesLightSearch` Fast, lightweight Google Images search **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.imagesLightSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | | `no_cache` | `boolean` | No | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### imagesRelatedContent `search.imagesRelatedContent` Related content for a Google Images result **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.imagesRelatedContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `related_content_id` | `string` | Yes | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### jobsSearch `search.jobsSearch` Google Jobs search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.jobsSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `start` | `number` | No | — | | `ltype` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### lensSearch `search.lensSearch` Reverse image search via Google Lens **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.lensSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `hl` | `string` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### lightSearch `search.lightSearch` Fast, lightweight Google Search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.lightSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | | `no_cache` | `boolean` | No | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### localServicesSearch `search.localServicesSearch` Google's guaranteed local service providers **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.localServicesSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### mapsPosts `search.mapsPosts` Posts published by a business on its Google Maps listing **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.mapsPosts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data_id` | `string` | Yes | — | | `hl` | `string` | No | — | | `next_page_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### mapsSearch `search.mapsSearch` Google Maps search for places and businesses **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.mapsSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `ll` | `string` | No | — | | `type` | `string` | No | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | | `no_cache` | `boolean` | No | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### newsSearch `search.newsSearch` Google News article search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.newsSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | | `no_cache` | `boolean` | No | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### patentDetails `search.patentDetails` Detailed information for a specific Google Patent **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.patentDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `patent_id` | `string` | Yes | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### playProduct `search.playProduct` Details for a specific Google Play Store item **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.playProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_id` | `string` | Yes | — | | `store` | `apps \| movies \| tv \| audiobooks \| books` | No | — | | `gl` | `string` | No | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### playSearch `search.playSearch` Google Play Store search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.playSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `gl` | `string` | No | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### scholarAuthor `search.scholarAuthor` A researcher's full Google Scholar author profile **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.scholarAuthor({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `author_id` | `string` | Yes | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### scholarCite `search.scholarCite` Formatted citations for a Google Scholar paper **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.scholarCite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### scholarSearch `search.scholarSearch` Google Scholar academic search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.scholarSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `cites` | `string` | No | — | | `cluster` | `string` | No | — | | `hl` | `string` | No | — | | `start` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### search `search.search` Real-time Google search results **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | | `no_cache` | `boolean` | No | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### shoppingSearch `search.shoppingSearch` Google Shopping product listings **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.shoppingSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### trendsSearch `search.trendsSearch` Google Trends relative interest data **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.trendsSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `category` | `string` | No | — | | `data_type` | `string` | No | — | | `geo` | `string` | No | — | | `date` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ### videosLightSearch `search.videosLightSearch` Fast, lightweight Google Videos search **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.search.videosLightSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | | `no_cache` | `boolean` | No | — | | `async` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** ## Utilities ### domainsList `utilities.domainsList` The list of supported Google domains **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.utilities.domainsList({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > domain: string, > language_code?: string, > country_code?: string, > country_name?: string > }[] > ``` *** ### locationOptions `utilities.locationOptions` Valid location values for a Google search's location parameter **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.utilities.locationOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > google_id?: number, > google_parent_id?: number, > name: string, > canonical_name?: string, > country_code?: string, > target_type?: string, > reach?: number, > gps?: number[], > keys?: string[] > }[] > ``` *** ### searchArchive `utilities.searchArchive` Results from a previously run async search, by search id **Risk:** `read` ```ts theme={null} await corsair.serpapi.api.utilities.searchArchive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `search_metadata` | `object` | Yes | — | | `search_parameters` | `object` | No | — | | `search_information` | `object` | No | — | | `error` | `string` | No | — | > **search\_metadata full type** > > ```ts theme={null} > { > id: string, > status: string, > created_at?: string, > processed_at?: string, > total_time_taken?: number, > json_endpoint?: string > } > ``` > **search\_parameters full type** > > ```ts theme={null} > { > } > ``` > **search\_information full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/serpapi/database SerpApi local sync: searchable entities, `.search()` filters, and operators. The SerpApi plugin syncs data locally. Use `corsair.serpapi.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/serpapi/overview Search engine results API for Google, Bing, and other SERP scraping at scale. Use **SerpApi** through Corsair: one client, typed API calls. **What you get:** * 48 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/serpapi ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/serpapi ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/serpapi ``` ```bash bun theme={null} bun add corsair @corsair-dev/serpapi ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { serpapi } from '@corsair-dev/serpapi'; export const corsair = createCorsair({ plugins: [ serpapi(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} serpapi() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'serpapi', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`engines.baiduSearch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.serpapi.api.engines.baiduSearch({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/serpapi/api) reference.* See the full list on the [API](/plugins/serpapi/api) page. ## What's next > **[API reference](/plugins/serpapi/api)** > > Every `serpapi.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/sharepoint/api API reference for SharePoint: every `sharepoint.api.*` operation with input and output types. Every `sharepoint.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Content Types ### addFieldLink `contentTypes.addFieldLink` Add a field link to a list content type **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.contentTypes.addFieldLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listid` | `string` | Yes | — | | `contenttypeid` | `string` | Yes | — | | `field_internal_name` | `string` | Yes | — | | `hidden` | `boolean` | No | — | | `required` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `field_link` | `object` | No | — | > **field\_link full type** > > ```ts theme={null} > { > Id?: string, > Name?: string, > Hidden?: boolean, > Required?: boolean, > FieldInternalName?: string > } > ``` *** ### create `contentTypes.create` Create a new SharePoint content type **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.contentTypes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `group` | `string` | No | — | | `id` | `object` | No | — | > **id full type** > > ```ts theme={null} > { > StringValue: string > } | string > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `group` | `string` | No | — | | `hidden` | `boolean` | No | — | *** ### createListField `contentTypes.createListField` Create a new field (column) on a SharePoint list **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.contentTypes.createListField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `field_type` | `string` | Yes | — | | `internal_name` | `string` | Yes | — | | `display_name` | `string` | Yes | — | | `required` | `boolean` | No | — | | `choices` | `string[]` | No | — | | `default_value` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `displayName` | `string` | No | — | | `required` | `boolean` | No | — | | `hidden` | `boolean` | No | — | | `readOnly` | `boolean` | No | — | | `defaultValue` | `string` | No | — | *** ### get `contentTypes.get` Get a SharePoint content type by ID **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.contentTypes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content_type_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `group` | `string` | No | — | | `hidden` | `boolean` | No | — | *** ### getAll `contentTypes.getAll` Get all content types defined on the site **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.contentTypes.getAll({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > description?: string, > group?: string, > hidden?: boolean > }[] > ``` *** ### getById `contentTypes.getById` Get a content type from a list by its ID **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.contentTypes.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `content_type_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `group` | `string` | No | — | | `hidden` | `boolean` | No | — | *** ### getForList `contentTypes.getForList` Get content types available for a specific list **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.contentTypes.getForList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > description?: string, > group?: string, > hidden?: boolean > }[] > ``` *** ### update `contentTypes.update` Update an existing SharePoint content type **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.contentTypes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content_type_id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `group` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Drive ### createSharingLink `drive.createSharingLink` Create a sharing link for a drive item via Graph API **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.drive.createSharingLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `item_id` | `string` | Yes | — | | `type` | `view \| edit \| embed` | Yes | — | | `scope` | `anonymous \| organization \| users` | No | — | | `expiration_date_time` | `string` | No | — | | `password` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `type` | `string` | No | — | | `link` | `object` | No | — | > **link full type** > > ```ts theme={null} > { > type?: string, > webUrl?: string, > scope?: string > } > ``` *** ### deleteVersion `drive.deleteVersion` Delete a specific version of a drive item **Risk:** `destructive` ```ts theme={null} await corsair.sharepoint.api.drive.deleteVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `item_id` | `string` | Yes | — | | `version_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getAnalytics `drive.getAnalytics` Get analytics for a SharePoint drive item via Graph API **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.drive.getAnalytics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `allTime` | `object` | No | — | > **allTime full type** > > ```ts theme={null} > { > access?: { > actionCount?: number, > actorCount?: number > } > } > ``` *** ### listRecentItems `drive.listRecentItems` List recently accessed drive items via Graph API **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.drive.listRecentItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > size?: number, > webUrl?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > file?: { > }, > folder?: { > } > }[] > ``` *** ### restoreVersion `drive.restoreVersion` Restore a previous version of a drive item via Graph API **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.drive.restoreVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `item_id` | `string` | Yes | — | | `version_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### updateItem `drive.updateItem` Update a drive item (rename, move) via Graph API **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.drive.updateItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `item_id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `parent_reference` | `object` | No | — | > **parent\_reference full type** > > ```ts theme={null} > { > driveId?: string, > id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `size` | `number` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **folder full type** > > ```ts theme={null} > { > } > ``` *** ## Files ### checkIn `files.checkIn` Check in a SharePoint file to publish changes **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.files.checkIn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_path` | `string` | Yes | — | | `comment` | `string` | No | — | | `checkintype` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | | `message` | `string` | No | — | | `server_relative_path` | `string` | No | — | *** ### checkOut `files.checkOut` Check out a SharePoint file for exclusive editing **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.files.checkOut({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `server_relative_path` | `string` | No | — | *** ### download `files.download` Download a file by its server-relative URL **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.files.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | | `fileName` | `string` | No | — | | `mimeType` | `string` | No | — | *** ### get `files.get` Get metadata of a SharePoint file by server-relative URL **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `webUrl` | `string` | No | — | | `size` | `number` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | | `parentReference` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **folder full type** > > ```ts theme={null} > { > } > ``` > **parentReference full type** > > ```ts theme={null} > { > } > ``` *** ### listInFolder `files.listInFolder` List all files in a SharePoint folder **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.files.listInFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_server_relative_url` | `string` | Yes | — | | `filter` | `string` | No | — | | `select` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > webUrl?: string, > size?: number, > createdDateTime?: string, > lastModifiedDateTime?: string, > file?: { > }, > folder?: { > }, > parentReference?: { > } > }[] > ``` *** ### recycle `files.recycle` Move a SharePoint file to the recycle bin **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.files.recycle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `string` | No | — | *** ### undoCheckout `files.undoCheckout` Undo a checked-out SharePoint file **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.files.undoCheckout({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `server_relative_path` | `string` | No | — | *** ### upload `files.upload` Upload a file to a SharePoint document library folder **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `folder_server_relative_url` | `string` | Yes | — | | `file_name` | `string` | Yes | — | | `content_text` | `string` | No | — | | `content_base64` | `string` | No | — | | `overwrite` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `webUrl` | `string` | No | — | | `size` | `number` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | | `parentReference` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **folder full type** > > ```ts theme={null} > { > } > ``` > **parentReference full type** > > ```ts theme={null} > { > } > ``` *** ## Folders ### create `folders.create` Create a new SharePoint folder **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `webUrl` | `string` | No | — | | `size` | `number` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | | `parentReference` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **folder full type** > > ```ts theme={null} > { > } > ``` > **parentReference full type** > > ```ts theme={null} > { > } > ``` *** ### delete `folders.delete` Delete a SharePoint folder and all its contents **Risk:** `destructive` ```ts theme={null} await corsair.sharepoint.api.folders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `folders.get` Get a SharePoint folder by server-relative URL **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `webUrl` | `string` | No | — | | `size` | `number` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | | `parentReference` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **folder full type** > > ```ts theme={null} > { > } > ``` > **parentReference full type** > > ```ts theme={null} > { > } > ``` *** ### getAll `folders.getAll` Get all SharePoint folders in a list or location **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.folders.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | No | — | | `server_relative_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > webUrl?: string, > size?: number, > createdDateTime?: string, > lastModifiedDateTime?: string, > file?: { > }, > folder?: { > }, > parentReference?: { > } > }[] > ``` *** ### listSubfolders `folders.listSubfolders` List subfolders inside a SharePoint folder **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.folders.listSubfolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > webUrl?: string, > size?: number, > createdDateTime?: string, > lastModifiedDateTime?: string, > file?: { > }, > folder?: { > }, > parentReference?: { > } > }[] > ``` *** ### rename `folders.rename` Rename a SharePoint folder **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.folders.rename({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `server_relative_url` | `string` | Yes | — | | `new_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `new_server_relative_url` | `string` | No | — | *** ## Items ### addAttachment `items.addAttachment` Add a file attachment to a SharePoint list item **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.items.addAttachment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `number` | Yes | — | | `list_title` | `string` | Yes | — | | `file_name` | `string` | Yes | — | | `content_text` | `string` | No | — | | `content_base64` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `FileName` | `string` | No | — | | `ServerRelativeUrl` | `string` | No | — | *** ### create `items.create` Create a new SharePoint list item **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.items.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `webUrl` | `string` | No | — | | `fields` | `object` | No | — | | `@odata.etag` | `string` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### createByGuid `items.createByGuid` Create a new item in a SharePoint list by GUID **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.items.createByGuid({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_guid` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `webUrl` | `string` | No | — | | `fields` | `object` | No | — | | `@odata.etag` | `string` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### createInFolder `items.createInFolder` Create a new list item inside a specific folder **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.items.createInFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `folder_path` | `string` | Yes | — | | `fields` | `object` | Yes | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `webUrl` | `string` | No | — | | `fields` | `object` | No | — | | `@odata.etag` | `string` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### delete `items.delete` Permanently delete a SharePoint list item **Risk:** `destructive` ```ts theme={null} await corsair.sharepoint.api.items.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `items.get` Get a SharePoint list item by ID **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.items.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | | `select` | `string` | No | — | | `expand` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `webUrl` | `string` | No | — | | `fields` | `object` | No | — | | `@odata.etag` | `string` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### getAttachmentContent `items.getAttachmentContent` Download the content of a list item attachment **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.items.getAttachmentContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | | `file_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | No | — | | `fileName` | `string` | No | — | *** ### getEtag `items.getEtag` Get the ETag for a SharePoint list item **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.items.getEtag({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | Yes | — | *** ### getVersion `items.getVersion` Get a specific version of a SharePoint list item **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.items.getVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | | `version_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `fields` | `object` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` *** ### list `items.list` List items in a SharePoint list **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.items.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `filter` | `string` | No | — | | `select` | `string` | No | — | | `expand` | `string` | No | — | | `order_by` | `string` | No | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > webUrl?: string, > fields?: { > }, > @odata.etag?: string > }[] > ``` *** ### listAttachments `items.listAttachments` List all attachments for a SharePoint list item **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.items.listAttachments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > FileName?: string, > ServerRelativeUrl?: string > }[] > ``` *** ### listByGuid `items.listByGuid` List items in a SharePoint list by GUID **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.items.listByGuid({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_guid` | `string` | Yes | — | | `filter` | `string` | No | — | | `select` | `string` | No | — | | `top` | `number` | No | — | | `skip` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > webUrl?: string, > fields?: { > }, > @odata.etag?: string > }[] > ``` *** ### recycle `items.recycle` Move a SharePoint list item to the recycle bin **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.items.recycle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `string` | No | — | *** ### update `items.update` Update an existing SharePoint list item **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.items.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | | `fields` | `object` | Yes | — | | `etag` | `string` | No | — | > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Lists ### create `lists.create` Create a new SharePoint list **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.lists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `template` | `number` | No | — | | `enable_versioning` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `list` | `object` | No | — | > **list full type** > > ```ts theme={null} > { > hidden?: boolean, > template?: string, > contentTypesEnabled?: boolean > } > ``` *** ### delete `lists.delete` Delete a SharePoint list by GUID **Risk:** `destructive` ```ts theme={null} await corsair.sharepoint.api.lists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_guid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### deleteByTitle `lists.deleteByTitle` Delete a SharePoint list by title **Risk:** `destructive` ```ts theme={null} await corsair.sharepoint.api.lists.deleteByTitle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getByGuid `lists.getByGuid` Get a SharePoint list by GUID **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.lists.getByGuid({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_guid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `list` | `object` | No | — | > **list full type** > > ```ts theme={null} > { > hidden?: boolean, > template?: string, > contentTypesEnabled?: boolean > } > ``` *** ### getByTitle `lists.getByTitle` Get a SharePoint list by title **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.lists.getByTitle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `list` | `object` | No | — | > **list full type** > > ```ts theme={null} > { > hidden?: boolean, > template?: string, > contentTypesEnabled?: boolean > } > ``` *** ### getChanges `lists.getChanges` Get change log entries for a SharePoint list **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.lists.getChanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `change_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | | `@odata.deltaLink` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > webUrl?: string, > fields?: { > }, > @odata.etag?: string > }[] > ``` *** ### listAll `lists.listAll` List all SharePoint lists in the site **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.lists.listAll({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > displayName?: string, > description?: string, > webUrl?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > list?: { > hidden?: boolean, > template?: string, > contentTypesEnabled?: boolean > } > }[] > ``` *** ### listColumns `lists.listColumns` List all columns (fields) in a SharePoint list **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.lists.listColumns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > name?: string, > displayName?: string, > required?: boolean, > hidden?: boolean, > readOnly?: boolean, > defaultValue?: string | null > }[] > ``` *** ### renderDataAsStream `lists.renderDataAsStream` Render list data as a pageable stream **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.lists.renderDataAsStream({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `view_xml` | `string` | No | — | | `row_limit` | `number` | No | — | | `paging_info` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Row` | `object[]` | No | — | | `NextHref` | `string` | No | — | | `PrevHref` | `string` | No | — | | `FirstRow` | `number` | No | — | | `LastRow` | `number` | No | — | > **Row full type** > > ```ts theme={null} > { > }[] > ``` *** ### update `lists.update` Update an existing SharePoint list **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.lists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `enable_versioning` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Permissions ### addRoleToItem `permissions.addRoleToItem` Grant a role assignment to a user on a list item **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.permissions.addRoleToItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | | `principal_id` | `number` | Yes | — | | `role_definition_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `list_title` | `string` | No | — | | `item_id` | `number` | No | — | | `principal_id` | `number` | No | — | | `role_definition_id` | `number` | No | — | *** ### addRoleToList `permissions.addRoleToList` Grant a role assignment to a user on a SharePoint list **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.permissions.addRoleToList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `principal_id` | `number` | Yes | — | | `role_definition_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `status_code` | `number` | No | — | *** ### breakInheritanceOnItem `permissions.breakInheritanceOnItem` Break permission inheritance on a list item **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.permissions.breakInheritanceOnItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `item_id` | `number` | Yes | — | | `copy_role_assignments` | `boolean` | No | — | | `clear_subscopes` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | *** ### breakInheritanceOnList `permissions.breakInheritanceOnList` Break permission inheritance on a SharePoint list **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.permissions.breakInheritanceOnList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_title` | `string` | Yes | — | | `copy_role_assignments` | `boolean` | Yes | — | | `clear_subscopes` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | *** ### getRoleDefinitions `permissions.getRoleDefinitions` Get all role definitions (permission levels) in the site **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.permissions.getRoleDefinitions({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: number | string, > Name?: string, > Description?: string > }[] > ``` *** ## Recycle Bin ### deletePermanent `recycleBin.deletePermanent` Permanently delete an item from the recycle bin **Risk:** `destructive` ```ts theme={null} await corsair.sharepoint.api.recycleBin.deletePermanent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### list `recycleBin.list` List items in the SharePoint recycle bin **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.recycleBin.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `row_limit` | `number` | No | — | | `is_ascending` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > Id?: string, > Title?: string, > DirName?: string, > LeafName?: string, > DeletedDate?: string, > DeletedByName?: string, > Size?: string, > ItemType?: number > }[] > ``` *** ### restore `recycleBin.restore` Restore an item from the SharePoint recycle bin **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.recycleBin.restore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Search ### query `search.query` Execute a full-text search query against SharePoint **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.search.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query_text` | `string` | Yes | — | | `row_limit` | `number` | No | — | | `start_row` | `number` | No | — | | `select_properties` | `string[]` | No | — | | `refiners` | `string` | No | — | | `refinement_filters` | `string` | No | — | | `sort_list` | `object[]` | No | — | > **sort\_list full type** > > ```ts theme={null} > { > Property: string, > Direction: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > searchTerms?: string[], > hitsContainers?: { > hits?: { > hitId?: string, > rank?: number, > summary?: string, > resource?: { > } > }[], > total?: number, > moreResultsAvailable?: boolean > }[] > }[] > ``` *** ### suggest `search.suggest` Get query suggestions from SharePoint search **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.search.suggest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query_text` | `string` | Yes | — | | `show_people_name_suggestions` | `boolean` | No | — | | `max_suggestion_results` | `number` | No | — | | `is_prefix_match` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > }[] > ``` *** ## Social ### follow `social.follow` Follow a SharePoint actor (person, document, site, tag) **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.social.follow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `actor_type` | `number` | Yes | — | | `content_uri` | `string` | No | — | | `id` | `string` | No | — | | `tag_guid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `number` | No | — | *** ### getFollowed `social.getFollowed` Get entities followed by the current user **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.social.getFollowed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `types` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > AccountName?: string, > ActorType?: number, > ContentUri?: string, > Id?: string, > ImageUri?: string | null, > Name?: string, > StatusText?: string, > Uri?: string > }[] > ``` *** ### getFollowers `social.getFollowers` Get followers of the current user **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.social.getFollowers({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > AccountName?: string, > ActorType?: number, > ContentUri?: string, > Id?: string, > ImageUri?: string | null, > Name?: string, > StatusText?: string, > Uri?: string > }[] > ``` *** ### isFollowed `social.isFollowed` Check if the current user is following an actor **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.social.isFollowed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `actor_type` | `number` | Yes | — | | `content_uri` | `string` | No | — | | `id` | `string` | No | — | | `tag_guid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `boolean` | No | — | *** ## Users ### create `users.create` Add an Azure AD user to the SharePoint site **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `login_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `mail` | `string` | No | — | | `userPrincipalName` | `string` | No | — | | `jobTitle` | `string` | No | — | *** ### ensure `users.ensure` Ensure a user exists in SharePoint (create if not present) **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.users.ensure({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `login_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `mail` | `string` | No | — | | `userPrincipalName` | `string` | No | — | | `jobTitle` | `string` | No | — | *** ### find `users.find` Find SharePoint users by name or email **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.users.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search_value` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > displayName?: string, > mail?: string, > userPrincipalName?: string, > jobTitle?: string | null > }[] > ``` *** ### getCurrent `users.getCurrent` Get the currently authenticated SharePoint user **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.users.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `mail` | `string` | No | — | | `userPrincipalName` | `string` | No | — | | `jobTitle` | `string` | No | — | *** ### getEffectivePermissions `users.getEffectivePermissions` Get the effective permissions of a user on the web **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.users.getEffectivePermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_login_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `mail` | `string` | No | — | | `userPrincipalName` | `string` | No | — | | `jobTitle` | `string` | No | — | *** ### getGroupUsers `users.getGroupUsers` Get users belonging to a SharePoint site group by name **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.users.getGroupUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > displayName?: string, > mail?: string, > userPrincipalName?: string, > jobTitle?: string | null > }[] > ``` *** ### getGroupUsersById `users.getGroupUsersById` Get users belonging to a SharePoint site group by ID **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.users.getGroupUsersById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > displayName?: string, > mail?: string, > userPrincipalName?: string, > jobTitle?: string | null > }[] > ``` *** ### listGroups `users.listGroups` List all site groups **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.users.listGroups({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > displayName?: string, > description?: string, > mail?: string > }[] > ``` *** ### listSite `users.listSite` List all users in the SharePoint site **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.users.listSite({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > displayName?: string, > mail?: string, > userPrincipalName?: string, > jobTitle?: string | null > }[] > ``` *** ### remove `users.remove` Remove a user from the SharePoint site **Risk:** `destructive` ```ts theme={null} await corsair.sharepoint.api.users.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `login_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Web ### createSubsite `web.createSubsite` Create a new SharePoint subsite **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.web.createSubsite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `url` | `string` | Yes | — | | `description` | `string` | No | — | | `web_template` | `string` | No | — | | `language` | `number` | No | — | | `use_unique_permissions` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `siteCollection` | `object` | No | — | > **siteCollection full type** > > ```ts theme={null} > { > } > ``` *** ### getContextInfo `web.getContextInfo` Get SharePoint context info including form digest token **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.web.getContextInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `FormDigestValue` | `string` | No | — | | `FormDigestTimeoutSeconds` | `number` | No | — | | `LibraryVersion` | `string` | No | — | | `SiteFullUrl` | `string` | No | — | | `WebFullUrl` | `string` | No | — | *** ### getDriveItemByPath `web.getDriveItemByPath` Get a drive item by its path using Microsoft Graph **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.web.getDriveItemByPath({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `size` | `number` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `file` | `object` | No | — | | `folder` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > } > ``` > **folder full type** > > ```ts theme={null} > { > } > ``` *** ### getInfo `web.getInfo` Get information about the current SharePoint web/site **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.web.getInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `siteCollection` | `object` | No | — | > **siteCollection full type** > > ```ts theme={null} > { > } > ``` *** ### getSiteCollectionInfo `web.getSiteCollectionInfo` Get information about the SharePoint site collection **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.web.getSiteCollectionInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `webUrl` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `siteCollection` | `object` | No | — | > **siteCollection full type** > > ```ts theme={null} > { > } > ``` *** ### getSitePage `web.getSitePage` Get the content of a SharePoint modern site page **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.web.getSitePage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_server_relative_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `title` | `string` | No | — | | `webUrl` | `string` | No | — | *** ### logEvent `web.logEvent` Log a custom event to the SharePoint ULS log **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.web.logEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entry_type` | `number` | Yes | — | | `event_code` | `number` | Yes | — | | `message` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### updateSite `web.updateSite` Update SharePoint site title or description **Risk:** `write` ```ts theme={null} await corsair.sharepoint.api.web.updateSite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ## Webhook Subscriptions ### get `webhookSubscriptions.get` Get a specific SharePoint webhook subscription **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.webhookSubscriptions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | | `subscription_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `clientState` | `string` | No | — | | `expirationDateTime` | `string` | No | — | | `notificationUrl` | `string` | No | — | | `resource` | `string` | No | — | *** ### getAll `webhookSubscriptions.getAll` Get all webhook subscriptions for a SharePoint list **Risk:** `read` ```ts theme={null} await corsair.sharepoint.api.webhookSubscriptions.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `list_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | No | — | > **value full type** > > ```ts theme={null} > { > id?: string, > clientState?: string | null, > expirationDateTime?: string, > notificationUrl?: string, > resource?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/sharepoint/database SharePoint local sync: searchable entities, `.search()` filters, and operators. The SharePoint plugin syncs data locally. Use `corsair.sharepoint.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Files Path: `sharepoint.db.files.search` ```ts theme={null} const rows = await corsair.sharepoint.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `serverRelativeUrl` | `string` | equals, contains, startsWith, endsWith, in | | `timeCreated` | `string` | equals, contains, startsWith, endsWith, in | | `timeLastModified` | `string` | equals, contains, startsWith, endsWith, in | | `length` | `string` | equals, contains, startsWith, endsWith, in | | `majorVersion` | `number` | equals, gt, gte, lt, lte, in | | `minorVersion` | `number` | equals, gt, gte, lt, lte, in | | `checkOutType` | `number` | equals, gt, gte, lt, lte, in | | `eTag` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Folders Path: `sharepoint.db.folders.search` ```ts theme={null} const rows = await corsair.sharepoint.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `serverRelativeUrl` | `string` | equals, contains, startsWith, endsWith, in | | `itemCount` | `number` | equals, gt, gte, lt, lte, in | | `timeCreated` | `string` | equals, contains, startsWith, endsWith, in | | `timeLastModified` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Items Path: `sharepoint.db.items.search` ```ts theme={null} const rows = await corsair.sharepoint.db.items.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `listId` | `string` | equals, contains, startsWith, endsWith, in | | `listTitle` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `authorId` | `number` | equals, gt, gte, lt, lte, in | | `editorId` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `modified` | `string` | equals, contains, startsWith, endsWith, in | | `fileSystemObjectType` | `number` | equals, gt, gte, lt, lte, in | | `serverRedirectedEmbedUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `sharepoint.db.lists.search` ```ts theme={null} const rows = await corsair.sharepoint.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `itemCount` | `number` | equals, gt, gte, lt, lte, in | | `baseType` | `number` | equals, gt, gte, lt, lte, in | | `baseTemplate` | `number` | equals, gt, gte, lt, lte, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `lastItemModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `lastItemUserModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `hidden` | `boolean` | equals | | `serverRelativeUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `modifiedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sites Path: `sharepoint.db.sites.search` ```ts theme={null} const rows = await corsair.sharepoint.db.sites.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `serverRelativeUrl` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `lastItemUserModifiedDate` | `string` | equals, contains, startsWith, endsWith, in | | `webTemplate` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `sharepoint.db.users.search` ```ts theme={null} const rows = await corsair.sharepoint.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `loginName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `principalType` | `number` | equals, gt, gte, lt, lte, in | | `isSiteAdmin` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/sharepoint/overview Microsoft collaboration platform for document libraries, sites, lists, and intranet content. Use **SharePoint** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 86 typed API operations * 6 synced entities (`files`, `folders`, `items`, `lists`, `sites`, `users`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/sharepoint ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/sharepoint ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/sharepoint ``` ```bash bun theme={null} bun add corsair @corsair-dev/sharepoint ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { sharepoint } from '@corsair-dev/sharepoint'; export const corsair = createCorsair({ plugins: [ sharepoint({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **SharePoint** — your tenants connect through Hub when they sign in. ```ts theme={null} sharepoint({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your SharePoint OAuth app. ```ts theme={null} sharepoint() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'sharepoint', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`contentTypes.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.sharepoint.api.contentTypes.get({}); ``` **`contentTypes.addFieldLink`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.sharepoint.api.contentTypes.addFieldLink({}); ``` See the full list on the [API](/plugins/sharepoint/api) page. ## Query synced data Synced entities support `tenant.sharepoint.db..search()` and `.list()`: `files`, `folders`, `items`, `lists`, `sites`, `users`. See [Database](/plugins/sharepoint/database) for filters and operators. ## Webhooks This plugin registers **1** webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/sharepoint/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/sharepoint/api)** > > Every `sharepoint.api.*` operation with input and output types. > **[Database](/plugins/sharepoint/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/sharepoint/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/sharepoint/webhooks SharePoint incoming webhooks: event paths, payloads, and response data. The SharePoint plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/sharepoint/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `lists` * `listChanged` (`lists.listChanged`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Lists ### List Changed `lists.listChanged` A SharePoint list item was created, updated, or deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId: string, > clientState?: string | null, > expirationDateTime?: string, > resource: string, > tenantId: string, > siteUrl: string, > webId: string > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId: string, > resource: string, > siteUrl: string, > webId: string, > tenantId: string, > receivedAt: Date > } > ``` **`webhookHooks` example** ```ts theme={null} sharepoint({ webhookHooks: { lists: { listChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/slack/api API reference for Slack: every `slack.api.*` operation with input and output types. Every `slack.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Admin ### conversationsGetTeams `admin.conversationsGetTeams` Get all the workspaces a given channel is connected to **Risk:** `read` ```ts theme={null} await corsair.slack.api.admin.conversationsGetTeams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `team_ids` | `string[]` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### conversationsSearch `admin.conversationsSearch` Search for channels on an Enterprise organization **Risk:** `read` ```ts theme={null} await corsair.slack.api.admin.conversationsSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_ids` | `string[]` | No | — | | `connected_team_ids` | `string[]` | No | — | | `query` | `string` | No | — | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | | `search_channel_types` | `string[]` | No | — | | `sort` | `string` | No | — | | `sort_dir` | `string` | No | — | | `total_count_only` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `conversations` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **conversations full type** > > ```ts theme={null} > { > id?: string, > name?: string > }[] > ``` *** ### conversationsSetTeams `admin.conversationsSetTeams` Set the workspaces in an Enterprise grid org that connect to a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.admin.conversationsSetTeams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_id` | `string` | Yes | — | | `team_id` | `string` | No | — | | `target_team_ids` | `string[]` | No | — | | `org_channel` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### listTeams `admin.listTeams` List all teams on an Enterprise organization **Risk:** `read` ```ts theme={null} await corsair.slack.api.admin.listTeams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `teams` | `object[]` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **teams full type** > > ```ts theme={null} > { > id?: string, > name?: string, > discoverability?: string, > primary_owner?: { > user_id?: string, > email?: string > }, > team_url?: string > }[] > ``` *** ## Channels ### archive `channels.archive` Archive a Slack channel **Risk:** `destructive` ```ts theme={null} await corsair.slack.api.channels.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### close `channels.close` Close a direct message or multi-party DM **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.close({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `no_op` | `boolean` | No | — | | `already_closed` | `boolean` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### create `channels.create` Create a new Slack channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `is_private` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > created?: number, > is_archived?: boolean, > is_general?: boolean, > unlinked?: number, > name_normalized?: string, > is_shared?: boolean, > is_org_shared?: boolean, > is_pending_ext_shared?: boolean, > pending_shared?: string[], > context_team_id?: string, > updated?: number, > creator?: string, > is_member?: boolean, > num_members?: number, > topic?: { > value: string, > creator: string, > last_set: number > }, > purpose?: { > value: string, > creator: string, > last_set: number > } > } > ``` *** ### get `channels.get` Get info about a channel **Risk:** `read` ```ts theme={null} await corsair.slack.api.channels.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `include_locale` | `boolean` | No | — | | `include_num_members` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > created?: number, > is_archived?: boolean, > is_general?: boolean, > unlinked?: number, > name_normalized?: string, > is_shared?: boolean, > is_org_shared?: boolean, > is_pending_ext_shared?: boolean, > pending_shared?: string[], > context_team_id?: string, > updated?: number, > creator?: string, > is_member?: boolean, > num_members?: number, > topic?: { > value: string, > creator: string, > last_set: number > }, > purpose?: { > value: string, > creator: string, > last_set: number > } > } > ``` *** ### getHistory `channels.getHistory` Fetch message history for a channel **Risk:** `read` ```ts theme={null} await corsair.slack.api.channels.getHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `latest` | `string` | No | — | | `oldest` | `string` | No | — | | `inclusive` | `boolean` | No | — | | `include_all_metadata` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `messages` | `object[]` | No | — | | `has_more` | `boolean` | No | — | | `pin_count` | `number` | No | — | | `channel_actions_count` | `number` | No | — | | `channel_actions_ts` | `number` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **messages full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > text?: string, > ts?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > icons?: { > emoji?: string, > image_36?: string, > image_48?: string, > image_72?: string > }, > blocks?: { > type: string > }[], > attachments?: { > }[], > thread_ts?: string, > parent_user_id?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > is_locked?: boolean, > subscribed?: boolean, > reactions?: { > name: string, > count: number, > users: string[] > }[], > edited?: { > user: string, > ts: string > } > }[] > ``` *** ### getMembers `channels.getMembers` List members of a channel **Risk:** `read` ```ts theme={null} await corsair.slack.api.channels.getMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `members` | `string[]` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### getReplies `channels.getReplies` Fetch replies for a thread **Risk:** `read` ```ts theme={null} await corsair.slack.api.channels.getReplies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `ts` | `string` | Yes | — | | `latest` | `string` | No | — | | `oldest` | `string` | No | — | | `inclusive` | `boolean` | No | — | | `include_all_metadata` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `messages` | `object[]` | No | — | | `has_more` | `boolean` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **messages full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > text?: string, > ts?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > icons?: { > emoji?: string, > image_36?: string, > image_48?: string, > image_72?: string > }, > blocks?: { > type: string > }[], > attachments?: { > }[], > thread_ts?: string, > parent_user_id?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > is_locked?: boolean, > subscribed?: boolean, > reactions?: { > name: string, > count: number, > users: string[] > }[], > edited?: { > user: string, > ts: string > } > }[] > ``` *** ### invite `channels.invite` Invite users to a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.invite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `users` | `string` | Yes | — | | `force` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > created?: number, > is_archived?: boolean, > is_general?: boolean, > unlinked?: number, > name_normalized?: string, > is_shared?: boolean, > is_org_shared?: boolean, > is_pending_ext_shared?: boolean, > pending_shared?: string[], > context_team_id?: string, > updated?: number, > creator?: string, > is_member?: boolean, > num_members?: number, > topic?: { > value: string, > creator: string, > last_set: number > }, > purpose?: { > value: string, > creator: string, > last_set: number > } > } > ``` *** ### join `channels.join` Join a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.join({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `object` | No | — | | `warning` | `string` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > created?: number, > is_archived?: boolean, > is_general?: boolean, > unlinked?: number, > name_normalized?: string, > is_shared?: boolean, > is_org_shared?: boolean, > is_pending_ext_shared?: boolean, > pending_shared?: string[], > context_team_id?: string, > updated?: number, > creator?: string, > is_member?: boolean, > num_members?: number, > topic?: { > value: string, > creator: string, > last_set: number > }, > purpose?: { > value: string, > creator: string, > last_set: number > } > } > ``` *** ### kick `channels.kick` Remove a user from a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.kick({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `user` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### leave `channels.leave` Leave a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.leave({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `not_in_channel` | `boolean` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### list `channels.list` List all channels in the workspace **Risk:** `read` ```ts theme={null} await corsair.slack.api.channels.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `exclude_archived` | `boolean` | No | — | | `types` | `string` | No | — | | `team_id` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channels` | `object[]` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **channels full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > created?: number, > is_archived?: boolean, > is_general?: boolean, > unlinked?: number, > name_normalized?: string, > is_shared?: boolean, > is_org_shared?: boolean, > is_pending_ext_shared?: boolean, > pending_shared?: string[], > context_team_id?: string, > updated?: number, > creator?: string, > is_member?: boolean, > num_members?: number, > topic?: { > value: string, > creator: string, > last_set: number > }, > purpose?: { > value: string, > creator: string, > last_set: number > } > }[] > ``` *** ### open `channels.open` Open a direct message or multi-party DM **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.open({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `users` | `string` | No | — | | `prevent_creation` | `boolean` | No | — | | `return_im` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `object` | No | — | | `no_op` | `boolean` | No | — | | `already_open` | `boolean` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > created?: number, > is_archived?: boolean, > is_general?: boolean, > unlinked?: number, > name_normalized?: string, > is_shared?: boolean, > is_org_shared?: boolean, > is_pending_ext_shared?: boolean, > pending_shared?: string[], > context_team_id?: string, > updated?: number, > creator?: string, > is_member?: boolean, > num_members?: number, > topic?: { > value: string, > creator: string, > last_set: number > }, > purpose?: { > value: string, > creator: string, > last_set: number > } > } > ``` *** ### rename `channels.rename` Rename a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.rename({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > created?: number, > is_archived?: boolean, > is_general?: boolean, > unlinked?: number, > name_normalized?: string, > is_shared?: boolean, > is_org_shared?: boolean, > is_pending_ext_shared?: boolean, > pending_shared?: string[], > context_team_id?: string, > updated?: number, > creator?: string, > is_member?: boolean, > num_members?: number, > topic?: { > value: string, > creator: string, > last_set: number > }, > purpose?: { > value: string, > creator: string, > last_set: number > } > } > ``` *** ### setPurpose `channels.setPurpose` Set the purpose of a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.setPurpose({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `purpose` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `object` | No | — | | `purpose` | `string` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > created?: number, > is_archived?: boolean, > is_general?: boolean, > unlinked?: number, > name_normalized?: string, > is_shared?: boolean, > is_org_shared?: boolean, > is_pending_ext_shared?: boolean, > pending_shared?: string[], > context_team_id?: string, > updated?: number, > creator?: string, > is_member?: boolean, > num_members?: number, > topic?: { > value: string, > creator: string, > last_set: number > }, > purpose?: { > value: string, > creator: string, > last_set: number > } > } > ``` *** ### setTopic `channels.setTopic` Set the topic of a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.setTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `topic` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `object` | No | — | | `topic` | `string` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > created?: number, > is_archived?: boolean, > is_general?: boolean, > unlinked?: number, > name_normalized?: string, > is_shared?: boolean, > is_org_shared?: boolean, > is_pending_ext_shared?: boolean, > pending_shared?: string[], > context_team_id?: string, > updated?: number, > creator?: string, > is_member?: boolean, > num_members?: number, > topic?: { > value: string, > creator: string, > last_set: number > }, > purpose?: { > value: string, > creator: string, > last_set: number > } > } > ``` *** ### unarchive `channels.unarchive` Unarchive a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.channels.unarchive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ## Files ### get `files.get` Get info about a file **Risk:** `read` ```ts theme={null} await corsair.slack.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `file` | `object` | No | — | | `comments` | `object[]` | No | — | | `paging` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **file full type** > > ```ts theme={null} > { > id: string, > created?: number, > timestamp?: number, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > pretty_type?: string, > user?: string, > user_team?: string, > editable?: boolean, > size?: number, > mode?: string, > is_external?: boolean, > external_type?: string, > is_public?: boolean, > public_url_shared?: boolean, > display_as_bot?: boolean, > username?: string, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > channels?: string[], > groups?: string[], > ims?: string[] > } > ``` > **comments full type** > > ```ts theme={null} > { > id: string, > timestamp: number, > user: string, > comment: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > count: number, > total: number, > page: number, > pages: number > } > ``` *** ### list `files.list` List files in the workspace **Risk:** `read` ```ts theme={null} await corsair.slack.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `user` | `string` | No | — | | `types` | `string` | No | — | | `ts_from` | `string` | No | — | | `ts_to` | `string` | No | — | | `show_files_hidden_by_limit` | `boolean` | No | — | | `team_id` | `string` | No | — | | `page` | `number` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `files` | `object[]` | No | — | | `paging` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **files full type** > > ```ts theme={null} > { > id: string, > created?: number, > timestamp?: number, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > pretty_type?: string, > user?: string, > user_team?: string, > editable?: boolean, > size?: number, > mode?: string, > is_external?: boolean, > external_type?: string, > is_public?: boolean, > public_url_shared?: boolean, > display_as_bot?: boolean, > username?: string, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > channels?: string[], > groups?: string[], > ims?: string[] > }[] > ``` > **paging full type** > > ```ts theme={null} > { > count: number, > total: number, > page: number, > pages: number > } > ``` *** ### upload `files.upload` Upload a file to Slack **Risk:** `write` ```ts theme={null} await corsair.slack.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channels` | `string` | No | — | | `content` | `string` | No | — | | `file` | `any` | No | — | | `filename` | `string` | No | — | | `filetype` | `string` | No | — | | `initial_comment` | `string` | No | — | | `thread_ts` | `string` | No | — | | `title` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `file` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **file full type** > > ```ts theme={null} > { > id: string, > created?: number, > timestamp?: number, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > pretty_type?: string, > user?: string, > user_team?: string, > editable?: boolean, > size?: number, > mode?: string, > is_external?: boolean, > external_type?: string, > is_public?: boolean, > public_url_shared?: boolean, > display_as_bot?: boolean, > username?: string, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > channels?: string[], > groups?: string[], > ims?: string[] > } > ``` *** ## Messages ### delete `messages.delete` Delete a message **Risk:** `destructive` ```ts theme={null} await corsair.slack.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `ts` | `string` | Yes | — | | `as_user` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `string` | No | — | | `ts` | `string` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### getPermalink `messages.getPermalink` Get a permalink for a message **Risk:** `read` ```ts theme={null} await corsair.slack.api.messages.getPermalink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `message_ts` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `string` | No | — | | `permalink` | `string` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### post `messages.post` Post a message to a channel **Risk:** `write` ```ts theme={null} await corsair.slack.api.messages.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `text` | `string` | No | — | | `blocks` | `object[]` | No | — | | `attachments` | `object[]` | No | — | | `thread_ts` | `string` | No | — | | `reply_broadcast` | `boolean` | No | — | | `parse` | `full \| none` | No | — | | `link_names` | `boolean` | No | — | | `unfurl_links` | `boolean` | No | — | | `unfurl_media` | `boolean` | No | — | | `mrkdwn` | `boolean` | No | — | | `as_user` | `boolean` | No | — | | `icon_emoji` | `string` | No | — | | `icon_url` | `string` | No | — | | `username` | `string` | No | — | | `metadata` | `object` | No | — | > **blocks full type** > > ```ts theme={null} > { > type: string > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > event_type: string, > event_payload: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `string` | No | — | | `ts` | `string` | No | — | | `message` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **message full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > text?: string, > ts?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > icons?: { > emoji?: string, > image_36?: string, > image_48?: string, > image_72?: string > }, > blocks?: { > type: string > }[], > attachments?: { > }[], > thread_ts?: string, > parent_user_id?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > is_locked?: boolean, > subscribed?: boolean, > reactions?: { > name: string, > count: number, > users: string[] > }[], > edited?: { > user: string, > ts: string > } > } > ``` *** ### search `messages.search` Search messages in the workspace **Risk:** `read` ```ts theme={null} await corsair.slack.api.messages.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `sort` | `score \| timestamp` | No | — | | `sort_dir` | `asc \| desc` | No | — | | `highlight` | `boolean` | No | — | | `team_id` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `query` | `string` | No | — | | `messages` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **messages full type** > > ```ts theme={null} > { > total?: number, > pagination?: { > total_count?: number, > page?: number, > per_page?: number, > page_count?: number, > first?: number, > last?: number > }, > paging?: { > count: number, > total: number, > page: number, > pages: number > }, > matches?: { > type?: string, > subtype?: string, > text?: string, > ts?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > icons?: { > emoji?: string, > image_36?: string, > image_48?: string, > image_72?: string > }, > blocks?: { > type: string > }[], > attachments?: { > }[], > thread_ts?: string, > parent_user_id?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > is_locked?: boolean, > subscribed?: boolean, > reactions?: { > name: string, > count: number, > users: string[] > }[], > edited?: { > user: string, > ts: string > }, > channel?: { > id: string, > name?: string > }, > permalink?: string > }[] > } > ``` *** ### update `messages.update` Update an existing message **Risk:** `write` ```ts theme={null} await corsair.slack.api.messages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `ts` | `string` | Yes | — | | `text` | `string` | No | — | | `blocks` | `object[]` | No | — | | `attachments` | `object[]` | No | — | | `parse` | `full \| none` | No | — | | `link_names` | `boolean` | No | — | | `as_user` | `boolean` | No | — | | `file_ids` | `string[]` | No | — | | `reply_broadcast` | `boolean` | No | — | | `metadata` | `object` | No | — | > **blocks full type** > > ```ts theme={null} > { > type: string > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > event_type: string, > event_payload: { > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `channel` | `string` | No | — | | `ts` | `string` | No | — | | `text` | `string` | No | — | | `message` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **message full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > text?: string, > ts?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > icons?: { > emoji?: string, > image_36?: string, > image_48?: string, > image_72?: string > }, > blocks?: { > type: string > }[], > attachments?: { > }[], > thread_ts?: string, > parent_user_id?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > is_locked?: boolean, > subscribed?: boolean, > reactions?: { > name: string, > count: number, > users: string[] > }[], > edited?: { > user: string, > ts: string > } > } > ``` *** ## Reactions ### add `reactions.add` Add a reaction emoji to a message **Risk:** `write` ```ts theme={null} await corsair.slack.api.reactions.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### get `reactions.get` Get reactions for a message **Risk:** `read` ```ts theme={null} await corsair.slack.api.reactions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `timestamp` | `string` | No | — | | `file` | `string` | No | — | | `file_comment` | `string` | No | — | | `full` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `type` | `string` | No | — | | `channel` | `string` | No | — | | `message` | `object` | No | — | | `file` | `object` | No | — | | `comment` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **message full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > text?: string, > ts?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > icons?: { > emoji?: string, > image_36?: string, > image_48?: string, > image_72?: string > }, > blocks?: { > type: string > }[], > attachments?: { > }[], > thread_ts?: string, > parent_user_id?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > is_locked?: boolean, > subscribed?: boolean, > reactions?: { > name: string, > count: number, > users: string[] > }[], > edited?: { > user: string, > ts: string > } > } > ``` > **file full type** > > ```ts theme={null} > { > id: string, > created?: number, > timestamp?: number, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > pretty_type?: string, > user?: string, > user_team?: string, > editable?: boolean, > size?: number, > mode?: string, > is_external?: boolean, > external_type?: string, > is_public?: boolean, > public_url_shared?: boolean, > display_as_bot?: boolean, > username?: string, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > channels?: string[], > groups?: string[], > ims?: string[] > } > ``` > **comment full type** > > ```ts theme={null} > { > id: string, > comment: string, > reactions?: { > name: string, > count: number, > users: string[] > }[] > } > ``` *** ### remove `reactions.remove` Remove a reaction emoji from a message **Risk:** `write` ```ts theme={null} await corsair.slack.api.reactions.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `channel` | `string` | No | — | | `timestamp` | `string` | No | — | | `file` | `string` | No | — | | `file_comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ## Stars ### add `stars.add` Star an item **Risk:** `write` ```ts theme={null} await corsair.slack.api.stars.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `timestamp` | `string` | No | — | | `file` | `string` | No | — | | `file_comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### list `stars.list` List starred items for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.slack.api.stars.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | | `count` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `items` | `object[]` | No | — | | `paging` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **items full type** > > ```ts theme={null} > { > type: string, > channel?: string, > message?: { > type?: string, > subtype?: string, > text?: string, > ts?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > icons?: { > emoji?: string, > image_36?: string, > image_48?: string, > image_72?: string > }, > blocks?: { > type: string > }[], > attachments?: { > }[], > thread_ts?: string, > parent_user_id?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > is_locked?: boolean, > subscribed?: boolean, > reactions?: { > name: string, > count: number, > users: string[] > }[], > edited?: { > user: string, > ts: string > } > }, > file?: { > id: string, > created?: number, > timestamp?: number, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > pretty_type?: string, > user?: string, > user_team?: string, > editable?: boolean, > size?: number, > mode?: string, > is_external?: boolean, > external_type?: string, > is_public?: boolean, > public_url_shared?: boolean, > display_as_bot?: boolean, > username?: string, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > channels?: string[], > groups?: string[], > ims?: string[] > }, > comment?: { > id: string, > comment: string > }, > date_create?: number > }[] > ``` > **paging full type** > > ```ts theme={null} > { > count: number, > total: number, > page: number, > pages: number > } > ``` *** ### remove `stars.remove` Unstar an item **Risk:** `write` ```ts theme={null} await corsair.slack.api.stars.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `timestamp` | `string` | No | — | | `file` | `string` | No | — | | `file_comment` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ## User Groups ### create `userGroups.create` Create a user group **Risk:** `write` ```ts theme={null} await corsair.slack.api.userGroups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `channels` | `string` | No | — | | `description` | `string` | No | — | | `handle` | `string` | No | — | | `include_count` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `usergroup` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **usergroup full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > is_usergroup?: boolean, > is_subteam?: boolean, > name?: string, > description?: string, > handle?: string, > is_external?: boolean, > date_create?: number, > date_update?: number, > date_delete?: number, > auto_type?: string | null, > auto_provision?: boolean, > enterprise_subteam_id?: string, > created_by?: string, > updated_by?: string, > deleted_by?: string | null, > prefs?: { > channels?: string[], > groups?: string[] > }, > users?: string[], > user_count?: number, > channel_count?: number > } > ``` *** ### disable `userGroups.disable` Disable a user group **Risk:** `write` ```ts theme={null} await corsair.slack.api.userGroups.disable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userGroup` | `string` | Yes | — | | `include_count` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `usergroup` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **usergroup full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > is_usergroup?: boolean, > is_subteam?: boolean, > name?: string, > description?: string, > handle?: string, > is_external?: boolean, > date_create?: number, > date_update?: number, > date_delete?: number, > auto_type?: string | null, > auto_provision?: boolean, > enterprise_subteam_id?: string, > created_by?: string, > updated_by?: string, > deleted_by?: string | null, > prefs?: { > channels?: string[], > groups?: string[] > }, > users?: string[], > user_count?: number, > channel_count?: number > } > ``` *** ### enable `userGroups.enable` Enable a user group **Risk:** `write` ```ts theme={null} await corsair.slack.api.userGroups.enable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userGroup` | `string` | Yes | — | | `include_count` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `usergroup` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **usergroup full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > is_usergroup?: boolean, > is_subteam?: boolean, > name?: string, > description?: string, > handle?: string, > is_external?: boolean, > date_create?: number, > date_update?: number, > date_delete?: number, > auto_type?: string | null, > auto_provision?: boolean, > enterprise_subteam_id?: string, > created_by?: string, > updated_by?: string, > deleted_by?: string | null, > prefs?: { > channels?: string[], > groups?: string[] > }, > users?: string[], > user_count?: number, > channel_count?: number > } > ``` *** ### list `userGroups.list` List user groups in the workspace **Risk:** `read` ```ts theme={null} await corsair.slack.api.userGroups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_count` | `boolean` | No | — | | `include_disabled` | `boolean` | No | — | | `include_users` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `userGroups` | `object[]` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **userGroups full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > is_usergroup?: boolean, > is_subteam?: boolean, > name?: string, > description?: string, > handle?: string, > is_external?: boolean, > date_create?: number, > date_update?: number, > date_delete?: number, > auto_type?: string | null, > auto_provision?: boolean, > enterprise_subteam_id?: string, > created_by?: string, > updated_by?: string, > deleted_by?: string | null, > prefs?: { > channels?: string[], > groups?: string[] > }, > users?: string[], > user_count?: number, > channel_count?: number > }[] > ``` *** ### update `userGroups.update` Update a user group **Risk:** `write` ```ts theme={null} await corsair.slack.api.userGroups.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userGroup` | `string` | Yes | — | | `name` | `string` | No | — | | `channels` | `string` | No | — | | `description` | `string` | No | — | | `handle` | `string` | No | — | | `include_count` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `usergroup` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **usergroup full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > is_usergroup?: boolean, > is_subteam?: boolean, > name?: string, > description?: string, > handle?: string, > is_external?: boolean, > date_create?: number, > date_update?: number, > date_delete?: number, > auto_type?: string | null, > auto_provision?: boolean, > enterprise_subteam_id?: string, > created_by?: string, > updated_by?: string, > deleted_by?: string | null, > prefs?: { > channels?: string[], > groups?: string[] > }, > users?: string[], > user_count?: number, > channel_count?: number > } > ``` *** ## Users ### get `users.get` Get info about a user **Risk:** `read` ```ts theme={null} await corsair.slack.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | Yes | — | | `include_locale` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `user` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **user full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > deleted?: boolean, > color?: string, > real_name?: string, > tz?: string, > tz_label?: string, > tz_offset?: number, > profile?: { > avatar_hash?: string, > status_text?: string, > status_emoji?: string, > status_expiration?: number, > real_name?: string, > display_name?: string, > real_name_normalized?: string, > display_name_normalized?: string, > email?: string, > image_24?: string, > image_32?: string, > image_48?: string, > image_72?: string, > image_192?: string, > image_512?: string, > team?: string, > title?: string, > phone?: string, > skype?: string, > first_name?: string, > last_name?: string > }, > is_admin?: boolean, > is_owner?: boolean, > is_primary_owner?: boolean, > is_restricted?: boolean, > is_ultra_restricted?: boolean, > is_bot?: boolean, > is_app_user?: boolean, > updated?: number, > is_email_confirmed?: boolean, > who_can_share_contact_card?: string, > locale?: string > } > ``` *** ### getPresence `users.getPresence` Get the presence status of a user **Risk:** `read` ```ts theme={null} await corsair.slack.api.users.getPresence({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `presence` | `string` | No | — | | `online` | `boolean` | No | — | | `auto_away` | `boolean` | No | — | | `manual_away` | `boolean` | No | — | | `connection_count` | `number` | No | — | | `last_activity` | `number` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` *** ### getProfile `users.getProfile` Get a user profile **Risk:** `read` ```ts theme={null} await corsair.slack.api.users.getProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | | `include_labels` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `profile` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **profile full type** > > ```ts theme={null} > { > avatar_hash?: string, > status_text?: string, > status_emoji?: string, > status_expiration?: number, > real_name?: string, > display_name?: string, > real_name_normalized?: string, > display_name_normalized?: string, > email?: string, > image_24?: string, > image_32?: string, > image_48?: string, > image_72?: string, > image_192?: string, > image_512?: string, > team?: string, > title?: string, > phone?: string, > skype?: string, > first_name?: string, > last_name?: string > } > ``` *** ### list `users.list` List all users in the workspace **Risk:** `read` ```ts theme={null} await corsair.slack.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_locale` | `boolean` | No | — | | `team_id` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `members` | `object[]` | No | — | | `cache_ts` | `number` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **members full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > deleted?: boolean, > color?: string, > real_name?: string, > tz?: string, > tz_label?: string, > tz_offset?: number, > profile?: { > avatar_hash?: string, > status_text?: string, > status_emoji?: string, > status_expiration?: number, > real_name?: string, > display_name?: string, > real_name_normalized?: string, > display_name_normalized?: string, > email?: string, > image_24?: string, > image_32?: string, > image_48?: string, > image_72?: string, > image_192?: string, > image_512?: string, > team?: string, > title?: string, > phone?: string, > skype?: string, > first_name?: string, > last_name?: string > }, > is_admin?: boolean, > is_owner?: boolean, > is_primary_owner?: boolean, > is_restricted?: boolean, > is_ultra_restricted?: boolean, > is_bot?: boolean, > is_app_user?: boolean, > updated?: number, > is_email_confirmed?: boolean, > who_can_share_contact_card?: string, > locale?: string > }[] > ``` *** ### updateProfile `users.updateProfile` Update the authenticated user's profile **Risk:** `write` ```ts theme={null} await corsair.slack.api.users.updateProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profile` | `object` | No | — | | `user` | `string` | No | — | | `name` | `string` | No | — | | `value` | `string` | No | — | > **profile full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `response_metadata` | `object` | No | — | | `profile` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > messages?: string[] > } > ``` > **profile full type** > > ```ts theme={null} > { > avatar_hash?: string, > status_text?: string, > status_emoji?: string, > status_expiration?: number, > real_name?: string, > display_name?: string, > real_name_normalized?: string, > display_name_normalized?: string, > email?: string, > image_24?: string, > image_32?: string, > image_48?: string, > image_72?: string, > image_192?: string, > image_512?: string, > team?: string, > title?: string, > phone?: string, > skype?: string, > first_name?: string, > last_name?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/slack/database Slack local sync: searchable entities, `.search()` filters, and operators. The Slack plugin syncs data locally. Use `corsair.slack.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Channels Path: `slack.db.channels.search` ```ts theme={null} const rows = await corsair.slack.db.channels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `name_normalized` | `string` | equals, contains, startsWith, endsWith, in | | `is_channel` | `boolean` | equals | | `is_group` | `boolean` | equals | | `is_im` | `boolean` | equals | | `is_mpim` | `boolean` | equals | | `is_private` | `boolean` | equals | | `is_archived` | `boolean` | equals | | `is_general` | `boolean` | equals | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `is_member` | `boolean` | equals | | `num_members` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `slack.db.files.search` ```ts theme={null} const rows = await corsair.slack.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `mimetype` | `string` | equals, contains, startsWith, endsWith, in | | `filetype` | `string` | equals, contains, startsWith, endsWith, in | | `pretty_type` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `url_private` | `string` | equals, contains, startsWith, endsWith, in | | `url_private_download` | `string` | equals, contains, startsWith, endsWith, in | | `permalink` | `string` | equals, contains, startsWith, endsWith, in | | `permalink_public` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `timestamp` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `slack.db.messages.search` ```ts theme={null} const rows = await corsair.slack.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ts` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `subtype` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `bot_id` | `string` | equals, contains, startsWith, endsWith, in | | `app_id` | `string` | equals, contains, startsWith, endsWith, in | | `team` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `channel` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `authorId` | `string` | equals, contains, startsWith, endsWith, in | | `thread_ts` | `string` | equals, contains, startsWith, endsWith, in | | `reply_count` | `number` | equals, gt, gte, lt, lte, in | | `is_locked` | `boolean` | equals | | `subscribed` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## User Groups Path: `slack.db.userGroups.search` ```ts theme={null} const rows = await corsair.slack.db.userGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `handle` | `string` | equals, contains, startsWith, endsWith, in | | `is_usergroup` | `boolean` | equals | | `date_create` | `number` | equals, gt, gte, lt, lte, in | | `date_update` | `number` | equals, gt, gte, lt, lte, in | | `created_by` | `string` | equals, contains, startsWith, endsWith, in | | `user_count` | `number` | equals, gt, gte, lt, lte, in | | `channel_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `slack.db.users.search` ```ts theme={null} const rows = await corsair.slack.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `real_name` | `string` | equals, contains, startsWith, endsWith, in | | `display_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `is_bot` | `boolean` | equals | | `is_admin` | `boolean` | equals | | `deleted` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/slack/get-credentials Step-by-step instructions for obtaining Slack API keys, OAuth credentials, and webhook secrets. This guide walks you through obtaining all required credentials for the Slack plugin. ## Authentication Methods The Slack plugin supports two authentication methods: * **[`api_key`](/concepts/api-key)** (default) - Bot token authentication * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 user authentication ## API Key Authentication (Bot Token) ### Step 1: Create a Slack App 1. Go to [api.slack.com/apps](https://api.slack.com/apps) 2. Click **Create New App** 3. Choose **From scratch** 4. Enter your app name and select your workspace 5. Click **Create App** ### Step 2: Configure Bot Token Scopes 1. In your app settings, go to **OAuth & Permissions** in the left sidebar 2. Scroll to **Scopes** → **Bot Token Scopes** 3. Add the required scopes: * `channels:read` - View basic information about public channels * `channels:write` - Manage public channels * `chat:write` - Send messages * `files:read` - View files shared in channels * `files:write` - Upload, edit, and delete files * `users:read` - View people in a workspace * `reactions:write` - Add and remove emoji reactions * Add any other scopes your application needs ### Step 3: Install App to Workspace 1. Scroll to the top of the **OAuth & Permissions** page 2. Click **Install to Workspace** 3. Review the permissions and click **Allow** ### Step 4: Copy Bot Token 1. After installation, you'll be redirected back to **OAuth & Permissions** 2. Under **OAuth Tokens for Your Workspace**, find **Bot User OAuth Token** 3. Click **Copy** to copy the token (starts with `xoxb-`) 4. Store this token securely **Storing Credentials:** Store the bot token with the Corsair CLI: ```bash theme={null} pnpm corsair setup --plugin=slack bot_token=xoxb-your-bot-token ``` Verify it was saved: ```bash theme={null} pnpm corsair auth --plugin=slack --credentials ``` ## OAuth 2.0 Authentication ### Step 1: Create a Slack App 1. Go to [api.slack.com/apps](https://api.slack.com/apps) 2. Click **Create New App** 3. Choose **From scratch** 4. Enter your app name and select your workspace 5. Click **Create App** ### Step 2: Configure OAuth Settings 1. Go to **OAuth & Permissions** in the left sidebar 2. Under **Redirect URLs**, click **Add New Redirect URL** 3. Add your OAuth redirect URL (e.g., `https://yourapp.com/auth/slack/callback`) 4. Click **Save URLs** ### Step 3: Get Client Credentials 1. Scroll to **App Credentials** section 2. Copy the **Client ID** and **Client Secret** 3. Store these securely **Storing Credentials:** Store your OAuth app credentials, then start the flow: ```bash theme={null} pnpm corsair setup --plugin=slack client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=slack ``` The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically. ## Webhook Signing Secret ### Step 1: Enable Event Subscriptions 1. In your Slack app settings, go to **Event Subscriptions** in the left sidebar 2. Toggle **Enable Events** to **On** 3. Enter your **Request URL** (e.g., `https://yourapp.com/api/webhook`) 4. Slack will send a verification request - ensure your endpoint handles it ### Step 2: Subscribe to Bot Events 1. Scroll to **Subscribe to bot events** 2. Click **Add Bot User Event** 3. Add events you want to receive: * `message.channels` - Messages posted to channels * `channel_created` - A channel was created * `reaction_added` - A reaction was added * `team_join` - A new member joined * `user_change` - A user's profile was updated * `file_created` - A file was created * `file_public` - A file was made public * `file_shared` - A file was shared ### Step 3: Get Signing Secret 1. Scroll to the top of the **Event Subscriptions** page 2. Under **Signing Secret**, click **Show** and copy the secret 3. Store this securely **Storing Credentials:** Store the signing secret with the CLI: ```bash theme={null} pnpm corsair setup --plugin=slack webhook_signature=your-signing-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Bot Token (`xoxb-...`) | API Key auth | OAuth & Permissions → Bot User OAuth Token | | Client ID | OAuth 2.0 | OAuth & Permissions → App Credentials | | Client Secret | OAuth 2.0 | OAuth & Permissions → App Credentials | | Signing Secret | Webhooks | Event Subscriptions → Signing Secret | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/slack/overview Team messaging platform for channels, direct messages, files, and workplace collaboration. Use **Slack** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 45 typed API operations * 5 synced entities (`channels`, `files`, `messages`, `userGroups`, `users`) for fast `.search()` / `.list()` * 9 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/slack ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/slack ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/slack ``` ```bash bun theme={null} bun add corsair @corsair-dev/slack ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { slack } from '@corsair-dev/slack'; export const corsair = createCorsair({ plugins: [ slack({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Slack** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/slack/get-credentials). ```ts theme={null} slack({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. Provider walkthrough: [Get Credentials](/plugins/slack/get-credentials). ```ts theme={null} slack() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Slack OAuth app. Provider walkthrough: [Get Credentials](/plugins/slack/get-credentials). ```ts theme={null} slack({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'slack', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List channels** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.slack.api.channels.list({}); ``` **Post a message** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.slack.api.messages.post({ channel: 'C01234567', text: 'Hello from Corsair' }); ``` See the full list on the [API](/plugins/slack/api) page. ## Query synced data Search synced channels without hitting Slack's API. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.slack.db.channels.search({ data: { is_archived: false }, limit: 50, }); ``` Synced entities: `channels`, `files`, `messages`, `userGroups`, `users`. See [Database](/plugins/slack/database) for filters and operators. ## Webhooks React when someone posts in a channel — `messages.message` is the common entry point. ```ts theme={null} slack({ webhookHooks: { messages: { message: { after: async (ctx, result) => { const text = result.data?.text; console.log('Slack message:', text); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/slack/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/slack/api)** > > Every `slack.api.*` operation with input and output types. > **[Database](/plugins/slack/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/slack/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/slack/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/slack/webhooks Slack incoming webhooks: event paths, payloads, and response data. The Slack plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/slack/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `challenge` * `challenge` (`challenge.challenge`) * `channels` * `created` (`channels.created`) * `files` * `created` (`files.created`) * `public` (`files.public`) * `shared` (`files.shared`) * `messages` * `message` (`messages.message`) * `reactions` * `added` (`reactions.added`) * `users` * `teamJoin` (`users.teamJoin`) * `userChange` (`users.userChange`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Challenge ### Challenge `challenge.challenge` Slack URL verification challenge — respond to confirm the webhook endpoint **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `url_verification` | Yes | — | | `challenge` | `string` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > type: url_verification, > challenge: string > } > ``` **`webhookHooks` example** ```ts theme={null} slack({ webhookHooks: { challenge: { challenge: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Channels ### Created `channels.created` A new channel was created in the workspace **Payload** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | | `team_id` | `string` | Yes | — | | `api_app_id` | `string` | Yes | — | | `type` | `event_callback` | Yes | — | | `event_id` | `string` | Yes | — | | `event_time` | `number` | Yes | — | | `event_context` | `string` | No | — | | `authorizations` | `object[]` | No | — | | `event` | `object` | Yes | — | > **authorizations full type** > > ```ts theme={null} > { > enterprise_id?: string | null, > team_id: string, > user_id: string, > is_bot: boolean, > is_enterprise_install: boolean > }[] > ``` > **event full type** > > ```ts theme={null} > { > type: channel_created, > event_ts: string, > channel: { > id: string, > is_channel: boolean, > name: string, > name_normalized: string, > created: number, > creator: string, > is_shared: boolean, > is_org_shared: boolean, > context_team_id: string, > is_archived: boolean, > is_frozen: boolean, > is_general: boolean, > is_group: boolean, > is_private: boolean, > is_ext_shared: boolean, > is_im: boolean, > is_mpim: boolean, > is_pending_ext_shared: boolean > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: channel_created, > event_ts: string, > channel: { > id: string, > is_channel: boolean, > name: string, > name_normalized: string, > created: number, > creator: string, > is_shared: boolean, > is_org_shared: boolean, > context_team_id: string, > is_archived: boolean, > is_frozen: boolean, > is_general: boolean, > is_group: boolean, > is_private: boolean, > is_ext_shared: boolean, > is_im: boolean, > is_mpim: boolean, > is_pending_ext_shared: boolean > } > } > ``` **`webhookHooks` example** ```ts theme={null} slack({ webhookHooks: { channels: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Files ### Created `files.created` A file was uploaded or created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | | `team_id` | `string` | Yes | — | | `api_app_id` | `string` | Yes | — | | `type` | `event_callback` | Yes | — | | `event_id` | `string` | Yes | — | | `event_time` | `number` | Yes | — | | `event_context` | `string` | No | — | | `authorizations` | `object[]` | No | — | | `event` | `object` | Yes | — | > **authorizations full type** > > ```ts theme={null} > { > enterprise_id?: string | null, > team_id: string, > user_id: string, > is_bot: boolean, > is_enterprise_install: boolean > }[] > ``` > **event full type** > > ```ts theme={null} > { > type: file_created, > file_id: string, > user_id: string, > file: { > id: string > }, > event_ts: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: file_created, > file_id: string, > user_id: string, > file: { > id: string > }, > event_ts: string > } > ``` **`webhookHooks` example** ```ts theme={null} slack({ webhookHooks: { files: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Public `files.public` A file was made publicly accessible **Payload** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | | `team_id` | `string` | Yes | — | | `api_app_id` | `string` | Yes | — | | `type` | `event_callback` | Yes | — | | `event_id` | `string` | Yes | — | | `event_time` | `number` | Yes | — | | `event_context` | `string` | No | — | | `authorizations` | `object[]` | No | — | | `event` | `object` | Yes | — | > **authorizations full type** > > ```ts theme={null} > { > enterprise_id?: string | null, > team_id: string, > user_id: string, > is_bot: boolean, > is_enterprise_install: boolean > }[] > ``` > **event full type** > > ```ts theme={null} > { > type: file_public, > file_id: string, > user_id: string, > file: { > id: string > }, > event_ts: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: file_public, > file_id: string, > user_id: string, > file: { > id: string > }, > event_ts: string > } > ``` **`webhookHooks` example** ```ts theme={null} slack({ webhookHooks: { files: { public: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Shared `files.shared` A file was shared into a channel **Payload** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | | `team_id` | `string` | Yes | — | | `api_app_id` | `string` | Yes | — | | `type` | `event_callback` | Yes | — | | `event_id` | `string` | Yes | — | | `event_time` | `number` | Yes | — | | `event_context` | `string` | No | — | | `authorizations` | `object[]` | No | — | | `event` | `object` | Yes | — | > **authorizations full type** > > ```ts theme={null} > { > enterprise_id?: string | null, > team_id: string, > user_id: string, > is_bot: boolean, > is_enterprise_install: boolean > }[] > ``` > **event full type** > > ```ts theme={null} > { > type: file_shared, > file_id: string, > user_id: string, > file: { > id: string > }, > channel_id: string, > event_ts: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: file_shared, > file_id: string, > user_id: string, > file: { > id: string > }, > channel_id: string, > event_ts: string > } > ``` **`webhookHooks` example** ```ts theme={null} slack({ webhookHooks: { files: { shared: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Messages ### Message `messages.message` A message was posted or updated in a channel **Payload** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | | `team_id` | `string` | Yes | — | | `api_app_id` | `string` | Yes | — | | `type` | `event_callback` | Yes | — | | `event_id` | `string` | Yes | — | | `event_time` | `number` | Yes | — | | `event_context` | `string` | No | — | | `authorizations` | `object[]` | No | — | | `event` | `object` | Yes | — | > **authorizations full type** > > ```ts theme={null} > { > enterprise_id?: string | null, > team_id: string, > user_id: string, > is_bot: boolean, > is_enterprise_install: boolean > }[] > ``` > **event full type** > > ```ts theme={null} > { > type: message, > event_ts: string, > team?: string, > channel: string, > user: string, > bot_id?: string, > bot_profile?: { > id: string, > name: string, > app_id: string, > team_id: string, > icons: { > }, > updated: number, > deleted: boolean > }, > text?: string, > ts: string, > thread_ts?: string, > channel_type: channel | group | im | mpim | app_home, > attachments?: { > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > fallback?: string, > color?: string, > pretext?: string, > author_name?: string, > author_link?: string, > author_icon?: string, > title?: string, > title_link?: string, > text?: string, > fields?: { > title: string, > value: string, > short?: boolean > }[], > image_url?: string, > thumb_url?: string, > footer?: string, > footer_icon?: string, > ts?: string > }[], > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > files?: { > id: string, > created: number, > name?: string | null, > title?: string | null, > mimetype: string, > filetype: string, > pretty_type: string, > user?: string, > editable: boolean, > size: number, > mode: hosted | external | snippet | post, > is_external: boolean, > external_type?: string | null, > is_public: boolean, > public_url_shared: boolean, > display_as_bot: boolean, > username?: string | null, > url_private?: string, > url_private_download?: string, > permalink: string, > permalink_public?: string, > channels?: string[] | null, > groups?: string[] | null, > users?: string[], > is_starred?: boolean, > num_stars?: number > }[], > edited?: { > user: string, > ts: string > }, > client_msg_id?: string, > parent_user_id?: string, > is_starred?: boolean, > pinned_to?: string[], > reactions?: { > name: string, > count: number, > users: string[] > }[], > assistant_thread?: { > } > } | { > type: message, > subtype: bot_message, > event_ts: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > streaming_state?: in_progress | completed | errored, > ts: string, > text: string, > bot_id: string, > username?: string, > user?: string, > attachments?: { > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > fallback?: string, > color?: string, > pretext?: string, > author_name?: string, > author_link?: string, > author_icon?: string, > title?: string, > title_link?: string, > text?: string, > fields?: { > title: string, > value: string, > short?: boolean > }[], > image_url?: string, > thumb_url?: string, > footer?: string, > footer_icon?: string, > ts?: string > }[], > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > edited?: { > user: string, > ts: string > }, > thread_ts?: string > } | { > type: message, > subtype: channel_archive, > team: string, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_join, > team: string, > user: string, > inviter: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_leave, > team: string, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_name, > team: string, > user: string, > name: string, > old_name: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_posting_permissions, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_purpose, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > purpose: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_topic, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > topic: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_unarchive, > team: string, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: ekm_access_denied, > event_ts: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > ts: string, > text: string, > user: UREVOKEDU > } | { > type: message, > subtype: file_share, > text: string, > attachments?: { > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > fallback?: string, > color?: string, > pretext?: string, > author_name?: string, > author_link?: string, > author_icon?: string, > title?: string, > title_link?: string, > text?: string, > fields?: { > title: string, > value: string, > short?: boolean > }[], > image_url?: string, > thumb_url?: string, > footer?: string, > footer_icon?: string, > ts?: string > }[], > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > files?: { > id: string, > created: number, > name?: string | null, > title?: string | null, > mimetype: string, > filetype: string, > pretty_type: string, > user?: string, > editable: boolean, > size: number, > mode: hosted | external | snippet | post, > is_external: boolean, > external_type?: string | null, > is_public: boolean, > public_url_shared: boolean, > display_as_bot: boolean, > username?: string | null, > url_private?: string, > url_private_download?: string, > permalink: string, > permalink_public?: string, > channels?: string[] | null, > groups?: string[] | null, > users?: string[], > is_starred?: boolean, > num_stars?: number > }[], > upload?: boolean, > display_as_bot?: boolean, > x_files?: string[], > user: string, > parent_user_id?: string, > ts: string, > thread_ts?: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > event_ts: string > } | { > type: message, > subtype: me_message, > event_ts: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > user: string, > text: string, > ts: string > } | { > type: message, > subtype: message_changed, > event_ts: string, > hidden: true, > channel: string, > channel_type: channel | group | im | mpim | app_home, > ts: string, > message: { > type: message, > subtype?: string, > user?: string, > bot_id?: string, > ts: string, > client_msg_id?: string, > text?: string, > team?: string, > source_team?: string, > user_team?: string, > edited?: { > user: string, > ts: string > }, > blocks?: { > type: string, > block_id?: string > }[], > thread_ts?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > subscribed?: boolean, > is_locked?: boolean > }, > previous_message: { > type: message, > subtype?: string, > user?: string, > bot_id?: string, > ts: string, > client_msg_id?: string, > text?: string, > team?: string, > source_team?: string, > user_team?: string, > edited?: { > user: string, > ts: string > }, > blocks?: { > type: string, > block_id?: string > }[], > thread_ts?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > subscribed?: boolean, > is_locked?: boolean > } > } | { > type: message, > subtype: message_deleted, > event_ts: string, > hidden: true, > channel: string, > channel_type: channel | group | im | mpim | app_home, > ts: string, > deleted_ts: string, > previous_message: lazy > } | { > type: message, > subtype: message_replied, > event_ts: string, > hidden: true, > channel: string, > channel_type: channel | group | im | mpim | app_home, > ts: string, > message: lazy & { > thread_ts: string, > reply_count: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > replies: { > user: string, > ts: string > }[] > } > } | { > type: message, > subtype: thread_broadcast, > event_ts: string, > text: string, > attachments?: { > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > fallback?: string, > color?: string, > pretext?: string, > author_name?: string, > author_link?: string, > author_icon?: string, > title?: string, > title_link?: string, > text?: string, > fields?: { > title: string, > value: string, > short?: boolean > }[], > image_url?: string, > thumb_url?: string, > footer?: string, > footer_icon?: string, > ts?: string > }[], > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > user: string, > ts: string, > thread_ts?: string, > root: { > type: message, > event_ts: string, > channel: string, > ts: string, > channel_type: channel | group | im | mpim | app_home, > thread_ts: string, > reply_count: number, > reply_users_count: number, > latest_reply: string, > reply_users: string[], > user?: string, > text?: string, > bot_id?: string > }, > client_msg_id: string, > channel: string, > channel_type: channel | group | im | mpim | app_home > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: message, > event_ts: string, > team?: string, > channel: string, > user: string, > bot_id?: string, > bot_profile?: { > id: string, > name: string, > app_id: string, > team_id: string, > icons: { > }, > updated: number, > deleted: boolean > }, > text?: string, > ts: string, > thread_ts?: string, > channel_type: channel | group | im | mpim | app_home, > attachments?: { > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > fallback?: string, > color?: string, > pretext?: string, > author_name?: string, > author_link?: string, > author_icon?: string, > title?: string, > title_link?: string, > text?: string, > fields?: { > title: string, > value: string, > short?: boolean > }[], > image_url?: string, > thumb_url?: string, > footer?: string, > footer_icon?: string, > ts?: string > }[], > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > files?: { > id: string, > created: number, > name?: string | null, > title?: string | null, > mimetype: string, > filetype: string, > pretty_type: string, > user?: string, > editable: boolean, > size: number, > mode: hosted | external | snippet | post, > is_external: boolean, > external_type?: string | null, > is_public: boolean, > public_url_shared: boolean, > display_as_bot: boolean, > username?: string | null, > url_private?: string, > url_private_download?: string, > permalink: string, > permalink_public?: string, > channels?: string[] | null, > groups?: string[] | null, > users?: string[], > is_starred?: boolean, > num_stars?: number > }[], > edited?: { > user: string, > ts: string > }, > client_msg_id?: string, > parent_user_id?: string, > is_starred?: boolean, > pinned_to?: string[], > reactions?: { > name: string, > count: number, > users: string[] > }[], > assistant_thread?: { > } > } | { > type: message, > subtype: bot_message, > event_ts: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > streaming_state?: in_progress | completed | errored, > ts: string, > text: string, > bot_id: string, > username?: string, > user?: string, > attachments?: { > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > fallback?: string, > color?: string, > pretext?: string, > author_name?: string, > author_link?: string, > author_icon?: string, > title?: string, > title_link?: string, > text?: string, > fields?: { > title: string, > value: string, > short?: boolean > }[], > image_url?: string, > thumb_url?: string, > footer?: string, > footer_icon?: string, > ts?: string > }[], > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > edited?: { > user: string, > ts: string > }, > thread_ts?: string > } | { > type: message, > subtype: channel_archive, > team: string, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_join, > team: string, > user: string, > inviter: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_leave, > team: string, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_name, > team: string, > user: string, > name: string, > old_name: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_posting_permissions, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_purpose, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > purpose: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_topic, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > topic: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: channel_unarchive, > team: string, > user: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > text: string, > ts: string, > event_ts: string > } | { > type: message, > subtype: ekm_access_denied, > event_ts: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > ts: string, > text: string, > user: UREVOKEDU > } | { > type: message, > subtype: file_share, > text: string, > attachments?: { > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > fallback?: string, > color?: string, > pretext?: string, > author_name?: string, > author_link?: string, > author_icon?: string, > title?: string, > title_link?: string, > text?: string, > fields?: { > title: string, > value: string, > short?: boolean > }[], > image_url?: string, > thumb_url?: string, > footer?: string, > footer_icon?: string, > ts?: string > }[], > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > files?: { > id: string, > created: number, > name?: string | null, > title?: string | null, > mimetype: string, > filetype: string, > pretty_type: string, > user?: string, > editable: boolean, > size: number, > mode: hosted | external | snippet | post, > is_external: boolean, > external_type?: string | null, > is_public: boolean, > public_url_shared: boolean, > display_as_bot: boolean, > username?: string | null, > url_private?: string, > url_private_download?: string, > permalink: string, > permalink_public?: string, > channels?: string[] | null, > groups?: string[] | null, > users?: string[], > is_starred?: boolean, > num_stars?: number > }[], > upload?: boolean, > display_as_bot?: boolean, > x_files?: string[], > user: string, > parent_user_id?: string, > ts: string, > thread_ts?: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > event_ts: string > } | { > type: message, > subtype: me_message, > event_ts: string, > channel: string, > channel_type: channel | group | im | mpim | app_home, > user: string, > text: string, > ts: string > } | { > type: message, > subtype: message_changed, > event_ts: string, > hidden: true, > channel: string, > channel_type: channel | group | im | mpim | app_home, > ts: string, > message: { > type: message, > subtype?: string, > user?: string, > bot_id?: string, > ts: string, > client_msg_id?: string, > text?: string, > team?: string, > source_team?: string, > user_team?: string, > edited?: { > user: string, > ts: string > }, > blocks?: { > type: string, > block_id?: string > }[], > thread_ts?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > subscribed?: boolean, > is_locked?: boolean > }, > previous_message: { > type: message, > subtype?: string, > user?: string, > bot_id?: string, > ts: string, > client_msg_id?: string, > text?: string, > team?: string, > source_team?: string, > user_team?: string, > edited?: { > user: string, > ts: string > }, > blocks?: { > type: string, > block_id?: string > }[], > thread_ts?: string, > reply_count?: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > subscribed?: boolean, > is_locked?: boolean > } > } | { > type: message, > subtype: message_deleted, > event_ts: string, > hidden: true, > channel: string, > channel_type: channel | group | im | mpim | app_home, > ts: string, > deleted_ts: string, > previous_message: lazy > } | { > type: message, > subtype: message_replied, > event_ts: string, > hidden: true, > channel: string, > channel_type: channel | group | im | mpim | app_home, > ts: string, > message: lazy & { > thread_ts: string, > reply_count: number, > reply_users_count?: number, > latest_reply?: string, > reply_users?: string[], > replies: { > user: string, > ts: string > }[] > } > } | { > type: message, > subtype: thread_broadcast, > event_ts: string, > text: string, > attachments?: { > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > fallback?: string, > color?: string, > pretext?: string, > author_name?: string, > author_link?: string, > author_icon?: string, > title?: string, > title_link?: string, > text?: string, > fields?: { > title: string, > value: string, > short?: boolean > }[], > image_url?: string, > thumb_url?: string, > footer?: string, > footer_icon?: string, > ts?: string > }[], > blocks?: ( > { > type: section | divider | image | actions | context | input | file | header | video | rich_text, > block_id?: string > } | { > type: string, > block_id?: string > } > )[], > user: string, > ts: string, > thread_ts?: string, > root: { > type: message, > event_ts: string, > channel: string, > ts: string, > channel_type: channel | group | im | mpim | app_home, > thread_ts: string, > reply_count: number, > reply_users_count: number, > latest_reply: string, > reply_users: string[], > user?: string, > text?: string, > bot_id?: string > }, > client_msg_id: string, > channel: string, > channel_type: channel | group | im | mpim | app_home > } > ``` **`webhookHooks` example** ```ts theme={null} slack({ webhookHooks: { messages: { message: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Reactions ### Added `reactions.added` A reaction emoji was added to a message **Payload** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | | `team_id` | `string` | Yes | — | | `api_app_id` | `string` | Yes | — | | `type` | `event_callback` | Yes | — | | `event_id` | `string` | Yes | — | | `event_time` | `number` | Yes | — | | `event_context` | `string` | No | — | | `authorizations` | `object[]` | No | — | | `event` | `object` | Yes | — | > **authorizations full type** > > ```ts theme={null} > { > enterprise_id?: string | null, > team_id: string, > user_id: string, > is_bot: boolean, > is_enterprise_install: boolean > }[] > ``` > **event full type** > > ```ts theme={null} > { > type: reaction_added, > user: string, > reaction: string, > item_user: string, > item: { > type: message, > channel: string, > ts: string > }, > event_ts: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: reaction_added, > user: string, > reaction: string, > item_user: string, > item: { > type: message, > channel: string, > ts: string > }, > event_ts: string > } > ``` **`webhookHooks` example** ```ts theme={null} slack({ webhookHooks: { reactions: { added: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Users ### Team Join `users.teamJoin` A new user joined the workspace **Payload** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | | `team_id` | `string` | Yes | — | | `api_app_id` | `string` | Yes | — | | `type` | `event_callback` | Yes | — | | `event_id` | `string` | Yes | — | | `event_time` | `number` | Yes | — | | `event_context` | `string` | No | — | | `authorizations` | `object[]` | No | — | | `event` | `object` | Yes | — | > **authorizations full type** > > ```ts theme={null} > { > enterprise_id?: string | null, > team_id: string, > user_id: string, > is_bot: boolean, > is_enterprise_install: boolean > }[] > ``` > **event full type** > > ```ts theme={null} > { > type: team_join, > user: { > id: string, > team_id: string, > name: string, > deleted: boolean, > color: string, > real_name: string, > tz: string, > tz_label: string, > tz_offset: number, > profile: { > title: string, > phone: string, > skype: string, > real_name: string, > real_name_normalized: string, > display_name: string, > display_name_normalized: string, > status_text: string, > status_text_canonical: string, > status_emoji: string, > status_emoji_display_info: { > emoji_name?: string, > display_alias?: string, > display_url?: string > }[], > status_expiration: number, > avatar_hash: string, > huddle_state?: string, > huddle_state_expiration_ts?: number, > first_name: string, > last_name: string, > email?: string, > image_original?: string, > is_custom_image?: boolean, > image_24: string, > image_32: string, > image_48: string, > image_72: string, > image_192: string, > image_512: string, > image_1024?: string, > team: string, > fields: { > } | never[] | null > }, > is_admin: boolean, > is_owner: boolean, > is_primary_owner: boolean, > is_restricted: boolean, > is_ultra_restricted: boolean, > is_bot: boolean, > is_stranger?: boolean, > updated: number, > is_email_confirmed: boolean, > is_app_user: boolean, > is_invited_user?: boolean, > has_2fa?: boolean, > locale: string, > presence?: string, > enterprise_user?: { > id: string, > enterprise_id: string, > enterprise_name: string, > is_admin: boolean, > is_owner: boolean, > teams: string[] > }, > two_factor_type?: string, > has_files?: boolean, > is_workflow_bot?: boolean, > who_can_share_contact_card: string > }, > cache_ts: number, > event_ts: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: team_join, > user: { > id: string, > team_id: string, > name: string, > deleted: boolean, > color: string, > real_name: string, > tz: string, > tz_label: string, > tz_offset: number, > profile: { > title: string, > phone: string, > skype: string, > real_name: string, > real_name_normalized: string, > display_name: string, > display_name_normalized: string, > status_text: string, > status_text_canonical: string, > status_emoji: string, > status_emoji_display_info: { > emoji_name?: string, > display_alias?: string, > display_url?: string > }[], > status_expiration: number, > avatar_hash: string, > huddle_state?: string, > huddle_state_expiration_ts?: number, > first_name: string, > last_name: string, > email?: string, > image_original?: string, > is_custom_image?: boolean, > image_24: string, > image_32: string, > image_48: string, > image_72: string, > image_192: string, > image_512: string, > image_1024?: string, > team: string, > fields: { > } | never[] | null > }, > is_admin: boolean, > is_owner: boolean, > is_primary_owner: boolean, > is_restricted: boolean, > is_ultra_restricted: boolean, > is_bot: boolean, > is_stranger?: boolean, > updated: number, > is_email_confirmed: boolean, > is_app_user: boolean, > is_invited_user?: boolean, > has_2fa?: boolean, > locale: string, > presence?: string, > enterprise_user?: { > id: string, > enterprise_id: string, > enterprise_name: string, > is_admin: boolean, > is_owner: boolean, > teams: string[] > }, > two_factor_type?: string, > has_files?: boolean, > is_workflow_bot?: boolean, > who_can_share_contact_card: string > }, > cache_ts: number, > event_ts: string > } > ``` **`webhookHooks` example** ```ts theme={null} slack({ webhookHooks: { users: { teamJoin: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### User Change `users.userChange` A user's profile or account settings were updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | No | — | | `team_id` | `string` | Yes | — | | `api_app_id` | `string` | Yes | — | | `type` | `event_callback` | Yes | — | | `event_id` | `string` | Yes | — | | `event_time` | `number` | Yes | — | | `event_context` | `string` | No | — | | `authorizations` | `object[]` | No | — | | `event` | `object` | Yes | — | > **authorizations full type** > > ```ts theme={null} > { > enterprise_id?: string | null, > team_id: string, > user_id: string, > is_bot: boolean, > is_enterprise_install: boolean > }[] > ``` > **event full type** > > ```ts theme={null} > { > type: user_change, > user: { > id: string, > team_id: string, > name: string, > deleted: boolean, > color: string, > real_name: string, > tz: string, > tz_label: string, > tz_offset: number, > profile: { > title: string, > phone: string, > skype: string, > real_name: string, > real_name_normalized: string, > display_name: string, > display_name_normalized: string, > status_text: string, > status_text_canonical: string, > status_emoji: string, > status_emoji_display_info: { > emoji_name?: string, > display_alias?: string, > display_url?: string > }[], > status_expiration: number, > avatar_hash: string, > huddle_state?: string, > huddle_state_expiration_ts?: number, > first_name: string, > last_name: string, > email?: string, > image_original?: string, > is_custom_image?: boolean, > image_24: string, > image_32: string, > image_48: string, > image_72: string, > image_192: string, > image_512: string, > image_1024?: string, > team: string, > fields: { > } | never[] | null > }, > is_admin: boolean, > is_owner: boolean, > is_primary_owner: boolean, > is_restricted: boolean, > is_ultra_restricted: boolean, > is_bot: boolean, > is_stranger?: boolean, > updated: number, > is_email_confirmed: boolean, > is_app_user: boolean, > is_invited_user?: boolean, > has_2fa?: boolean, > locale: string, > presence?: string, > enterprise_user?: { > id: string, > enterprise_id: string, > enterprise_name: string, > is_admin: boolean, > is_owner: boolean, > teams: string[] > }, > two_factor_type?: string, > has_files?: boolean, > is_workflow_bot?: boolean, > who_can_share_contact_card: string > }, > cache_ts: number, > event_ts: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: user_change, > user: { > id: string, > team_id: string, > name: string, > deleted: boolean, > color: string, > real_name: string, > tz: string, > tz_label: string, > tz_offset: number, > profile: { > title: string, > phone: string, > skype: string, > real_name: string, > real_name_normalized: string, > display_name: string, > display_name_normalized: string, > status_text: string, > status_text_canonical: string, > status_emoji: string, > status_emoji_display_info: { > emoji_name?: string, > display_alias?: string, > display_url?: string > }[], > status_expiration: number, > avatar_hash: string, > huddle_state?: string, > huddle_state_expiration_ts?: number, > first_name: string, > last_name: string, > email?: string, > image_original?: string, > is_custom_image?: boolean, > image_24: string, > image_32: string, > image_48: string, > image_72: string, > image_192: string, > image_512: string, > image_1024?: string, > team: string, > fields: { > } | never[] | null > }, > is_admin: boolean, > is_owner: boolean, > is_primary_owner: boolean, > is_restricted: boolean, > is_ultra_restricted: boolean, > is_bot: boolean, > is_stranger?: boolean, > updated: number, > is_email_confirmed: boolean, > is_app_user: boolean, > is_invited_user?: boolean, > has_2fa?: boolean, > locale: string, > presence?: string, > enterprise_user?: { > id: string, > enterprise_id: string, > enterprise_name: string, > is_admin: boolean, > is_owner: boolean, > teams: string[] > }, > two_factor_type?: string, > has_files?: boolean, > is_workflow_bot?: boolean, > who_can_share_contact_card: string > }, > cache_ts: number, > event_ts: string > } > ``` **`webhookHooks` example** ```ts theme={null} slack({ webhookHooks: { users: { userChange: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/slackbot/api API reference for Slackbot: every `slackbot.api.*` operation with input and output types. Every `slackbot.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Calls ### add `calls.add` Register a call with Slack **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.calls.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `external_unique_id` | `string` | Yes | — | | `join_url` | `string` | Yes | — | | `created_by` | `string` | No | — | | `date_start` | `number` | No | — | | `desktop_app_join_url` | `string` | No | — | | `external_display_id` | `string` | No | — | | `title` | `string` | No | — | | `users` | `object[]` | No | — | > **users full type** > > ```ts theme={null} > { > slack_id?: string, > external_id?: string, > display_name?: string, > avatar_url?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `call` | `object` | No | — | > **call full type** > > ```ts theme={null} > { > id: string, > date_start?: number, > external_unique_id?: string, > join_url?: string, > desktop_app_join_url?: string, > title?: string, > users?: { > }[] > } > ``` *** ### end `calls.end` End an in-progress call **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.calls.end({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `duration` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `call` | `object` | No | — | > **call full type** > > ```ts theme={null} > { > id: string, > date_start?: number, > external_unique_id?: string, > join_url?: string, > desktop_app_join_url?: string, > title?: string, > users?: { > }[] > } > ``` *** ### info `calls.info` Retrieve information about a call **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.calls.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `call` | `object` | No | — | > **call full type** > > ```ts theme={null} > { > id: string, > date_start?: number, > external_unique_id?: string, > join_url?: string, > desktop_app_join_url?: string, > title?: string, > users?: { > }[] > } > ``` *** ### participantsAdd `calls.participantsAdd` Add participants to a call **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.calls.participantsAdd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > slack_id?: string, > external_id?: string, > display_name?: string, > avatar_url?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `call` | `object` | No | — | > **call full type** > > ```ts theme={null} > { > id: string, > date_start?: number, > external_unique_id?: string, > join_url?: string, > desktop_app_join_url?: string, > title?: string, > users?: { > }[] > } > ``` *** ### participantsRemove `calls.participantsRemove` Remove participants from a call **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.calls.participantsRemove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > slack_id?: string, > external_id?: string, > display_name?: string, > avatar_url?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `call` | `object` | No | — | > **call full type** > > ```ts theme={null} > { > id: string, > date_start?: number, > external_unique_id?: string, > join_url?: string, > desktop_app_join_url?: string, > title?: string, > users?: { > }[] > } > ``` *** ### update `calls.update` Update a call title or join URLs **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.calls.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | No | — | | `join_url` | `string` | No | — | | `desktop_app_join_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `call` | `object` | No | — | > **call full type** > > ```ts theme={null} > { > id: string, > date_start?: number, > external_unique_id?: string, > join_url?: string, > desktop_app_join_url?: string, > title?: string, > users?: { > }[] > } > ``` *** ## Canvases ### create `canvases.create` Create a standalone or channel canvas **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.canvases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `document_content` | `object` | No | — | | `channel_id` | `string` | No | — | > **document\_content full type** > > ```ts theme={null} > { > type: markdown, > markdown: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `canvas_id` | `string` | No | — | *** ### delete `canvases.delete` Delete a canvas **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.canvases.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `canvas_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### edit `canvases.edit` Apply changes to a canvas **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.canvases.edit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `canvas_id` | `string` | Yes | — | | `changes` | `object[]` | Yes | — | > **changes full type** > > ```ts theme={null} > { > operation: insert_after | insert_before | insert_at_start | insert_at_end | replace | delete, > section_id?: string, > document_content?: { > type: markdown, > markdown: string > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### get `canvases.get` Retrieve a canvas and its content **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.canvases.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `canvas_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `file` | `object` | No | — | | `content` | `string` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ### list `canvases.list` List canvases in the workspace **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.canvases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `user` | `string` | No | — | | `team_id` | `string` | No | — | | `count` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `files` | `object[]` | No | — | | `paging` | `object` | No | — | | `response_metadata` | `object` | No | — | > **files full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > } > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### sectionsLookup `canvases.sectionsLookup` Look up section ids within a canvas **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.canvases.sectionsLookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `canvas_id` | `string` | Yes | — | | `criteria` | `object` | Yes | — | > **criteria full type** > > ```ts theme={null} > { > section_types?: any_header | h1 | h2 | h3[], > contains_text?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `sections` | `object[]` | No | — | > **sections full type** > > ```ts theme={null} > { > id: string > }[] > ``` *** ## Conversations ### archive `conversations.archive` Archive a conversation **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.conversations.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### close `conversations.close` Close a direct message or group conversation **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.close({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `object` | No | — | | `no_op` | `boolean` | No | — | | `already_open` | `boolean` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > } > ``` *** ### create `conversations.create` Create a public or private channel **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `is_private` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `object` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > } > ``` *** ### find `conversations.find` Search conversations by name **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.conversations.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `exclude_archived` | `boolean` | No | — | | `types` | `public_channel \| private_channel \| mpim \| im[]` | No | — | | `team_id` | `string` | No | — | | `match` | `contains \| exact \| prefix` | No | — | | `limit` | `number` | No | — | | `max_pages` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channels` | `object[]` | Yes | — | | `truncated` | `boolean` | Yes | — | | `pages_scanned` | `number` | Yes | — | > **channels full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > }[] > ``` *** ### info `conversations.info` Retrieve information about a conversation **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.conversations.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `include_locale` | `boolean` | No | — | | `include_num_members` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `object` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > } > ``` *** ### invite `conversations.invite` Invite users to a channel **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.invite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `users` | `string[]` | Yes | — | | `force` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `object` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > } > ``` *** ### join `conversations.join` Join a public channel **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.join({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `object` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > } > ``` *** ### kick `conversations.kick` Remove a user from a conversation **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.conversations.kick({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `user` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### leave `conversations.leave` Leave a conversation **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.leave({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### list `conversations.list` List conversations in the workspace **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.conversations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `exclude_archived` | `boolean` | No | — | | `types` | `public_channel \| private_channel \| mpim \| im[]` | No | — | | `team_id` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channels` | `object[]` | No | — | | `response_metadata` | `object` | No | — | > **channels full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > }[] > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### listForUser `conversations.listForUser` List the conversations a user belongs to **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.conversations.listForUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | | `exclude_archived` | `boolean` | No | — | | `types` | `public_channel \| private_channel \| mpim \| im[]` | No | — | | `team_id` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channels` | `object[]` | No | — | | `response_metadata` | `object` | No | — | > **channels full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > }[] > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### mark `conversations.mark` Move a conversation read cursor **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.mark({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `ts` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### members `conversations.members` List the members of a conversation **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.conversations.members({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `members` | `string[]` | No | — | | `response_metadata` | `object` | No | — | > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### rename `conversations.rename` Rename a conversation **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.rename({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `object` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > } > ``` *** ### setPurpose `conversations.setPurpose` Set a conversation purpose **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.setPurpose({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `purpose` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `purpose` | `string` | No | — | | `channel` | `object` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > } > ``` *** ### setTopic `conversations.setTopic` Set a conversation topic **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.setTopic({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `topic` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `topic` | `string` | No | — | | `channel` | `object` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > } > ``` *** ### unarchive `conversations.unarchive` Unarchive a conversation **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.conversations.unarchive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ## Files ### commentsDelete `files.commentsDelete` Delete a comment on a file **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.files.commentsDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### delete `files.delete` Delete a file by ID **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### download `files.download` Download the contents of a Slack file **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.files.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | Yes | — | | `max_bytes` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `file` | `object` | No | — | | `content` | `string` | Yes | — | | `content_type` | `string` | No | — | | `byte_size` | `number` | Yes | — | > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ### info `files.info` Retrieve detailed information about a file **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.files.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | Yes | — | | `count` | `number` | No | — | | `page` | `number` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `file` | `object` | No | — | | `content` | `string` | No | — | | `comments` | `object[]` | No | — | | `response_metadata` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` > **comments full type** > > ```ts theme={null} > { > }[] > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### list `files.list` List files in the workspace, filtered by channel, user or type **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `user` | `string` | No | — | | `ts_from` | `number` | No | — | | `ts_to` | `number` | No | — | | `types` | `string` | No | — | | `show_files_hidden_by_limit` | `boolean` | No | — | | `team_id` | `string` | No | — | | `count` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `files` | `object[]` | No | — | | `paging` | `object` | No | — | | `response_metadata` | `object` | No | — | > **files full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > }[] > ``` > **paging full type** > > ```ts theme={null} > { > } > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### remoteAdd `files.remoteAdd` Register an externally hosted file with Slack **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.files.remoteAdd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `external_id` | `string` | Yes | — | | `external_url` | `string` | Yes | — | | `title` | `string` | Yes | — | | `filetype` | `string` | No | — | | `indexable_file_contents` | `string` | No | — | | `preview_image` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `file` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ### remoteInfo `files.remoteInfo` Retrieve a remote file metadata **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.files.remoteInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | No | — | | `external_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `file` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ### remoteList `files.remoteList` List remote files **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.files.remoteList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `ts_from` | `number` | No | — | | `ts_to` | `number` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `files` | `object[]` | No | — | | `response_metadata` | `object` | No | — | > **files full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > }[] > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### remoteRemove `files.remoteRemove` Remove a remote file **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.files.remoteRemove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | No | — | | `external_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### remoteShare `files.remoteShare` Share a remote file into one or more channels **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.files.remoteShare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channels` | `string` | Yes | — | | `file` | `string` | No | — | | `external_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `file` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ### remoteUpdate `files.remoteUpdate` Update an existing remote file **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.files.remoteUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | No | — | | `external_id` | `string` | No | — | | `external_url` | `string` | No | — | | `title` | `string` | No | — | | `filetype` | `string` | No | — | | `indexable_file_contents` | `string` | No | — | | `preview_image` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `file` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ### revokePublicUrl `files.revokePublicUrl` Revoke a file public URL **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.files.revokePublicUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `file` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ### sharePublicUrl `files.sharePublicUrl` Create a public URL for a file **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.files.sharePublicUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `file` | `object` | No | — | > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ### upload `files.upload` Upload a file to Slack and optionally share it to a channel **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | Yes | — | | `content` | `string` | Yes | — | | `title` | `string` | No | — | | `alt_txt` | `string` | No | — | | `snippet_type` | `string` | No | — | | `channel_id` | `string` | No | — | | `initial_comment` | `string` | No | — | | `thread_ts` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `files` | `object[]` | No | — | | `file` | `object` | No | — | > **files full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > }[] > ``` > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ## Messages ### delete `messages.delete` Delete a message from a conversation **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `ts` | `string` | Yes | — | | `as_user` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `string` | No | — | | `ts` | `string` | No | — | *** ### deleteScheduled `messages.deleteScheduled` Cancel a scheduled message before it sends **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.messages.deleteScheduled({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `scheduled_message_id` | `string` | Yes | — | | `as_user` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### history `messages.history` Fetch a conversation message history **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.messages.history({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `latest` | `string` | No | — | | `oldest` | `string` | No | — | | `inclusive` | `boolean` | No | — | | `include_all_metadata` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `messages` | `object[]` | No | — | | `has_more` | `boolean` | No | — | | `pin_count` | `number` | No | — | | `response_metadata` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > ts?: string, > text?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > thread_ts?: string, > reply_count?: number, > blocks?: { > }[], > attachments?: { > }[] > }[] > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### pinAdd `messages.pinAdd` Pin a message to a channel **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.messages.pinAdd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### pinRemove `messages.pinRemove` Unpin a message from a channel **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.messages.pinRemove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### pinsList `messages.pinsList` List the pinned items in a channel **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.messages.pinsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` *** ### post `messages.post` Send a message to a channel, DM or thread **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.messages.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `text` | `string` | No | — | | `blocks` | `object[]` | No | — | | `attachments` | `object[]` | No | — | | `thread_ts` | `string` | No | — | | `mrkdwn` | `boolean` | No | — | | `parse` | `full \| none` | No | — | | `link_names` | `boolean` | No | — | | `unfurl_links` | `boolean` | No | — | | `unfurl_media` | `boolean` | No | — | | `metadata` | `object` | No | — | | `as_user` | `boolean` | No | — | | `icon_emoji` | `string` | No | — | | `icon_url` | `string` | No | — | | `username` | `string` | No | — | | `reply_broadcast` | `boolean` | No | — | > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `string` | No | — | | `ts` | `string` | No | — | | `message` | `object` | No | — | > **message full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > ts?: string, > text?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > thread_ts?: string, > reply_count?: number, > blocks?: { > }[], > attachments?: { > }[] > } > ``` *** ### postEphemeral `messages.postEphemeral` Send a message visible only to a single user **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.messages.postEphemeral({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `user` | `string` | Yes | — | | `text` | `string` | No | — | | `blocks` | `object[]` | No | — | | `attachments` | `object[]` | No | — | | `thread_ts` | `string` | No | — | | `mrkdwn` | `boolean` | No | — | | `parse` | `full \| none` | No | — | | `link_names` | `boolean` | No | — | | `unfurl_links` | `boolean` | No | — | | `unfurl_media` | `boolean` | No | — | | `metadata` | `object` | No | — | | `as_user` | `boolean` | No | — | | `icon_emoji` | `string` | No | — | | `icon_url` | `string` | No | — | | `username` | `string` | No | — | > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `message_ts` | `string` | No | — | *** ### postMe `messages.postMe` Send a me-style message to a channel **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.messages.postMe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `string` | No | — | | `ts` | `string` | No | — | | `message` | `object` | No | — | > **message full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > ts?: string, > text?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > thread_ts?: string, > reply_count?: number, > blocks?: { > }[], > attachments?: { > }[] > } > ``` *** ### reactionAdd `messages.reactionAdd` Add an emoji reaction to a message **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.messages.reactionAdd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `channel` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### reactionRemove `messages.reactionRemove` Remove an emoji reaction from a message **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.messages.reactionRemove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `channel` | `string` | Yes | — | | `timestamp` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### reactionsGet `messages.reactionsGet` Fetch the reactions on a message or file **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.messages.reactionsGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `timestamp` | `string` | No | — | | `file` | `string` | No | — | | `file_comment` | `string` | No | — | | `full` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `type` | `string` | No | — | | `channel` | `string` | No | — | | `message` | `object` | No | — | | `file` | `object` | No | — | > **message full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > ts?: string, > text?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > thread_ts?: string, > reply_count?: number, > blocks?: { > }[], > attachments?: { > }[] > } > ``` > **file full type** > > ```ts theme={null} > { > id: string, > name?: string, > title?: string, > mimetype?: string, > filetype?: string, > size?: number, > user?: string, > created?: number, > is_external?: boolean, > is_public?: boolean, > url_private?: string, > url_private_download?: string, > permalink?: string, > permalink_public?: string, > external_id?: string, > external_url?: string > } > ``` *** ### reactionsList `messages.reactionsList` List the items a user has reacted to **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.messages.reactionsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | | `full` | `boolean` | No | — | | `team_id` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `items` | `object[]` | No | — | | `response_metadata` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### replies `messages.replies` Fetch the replies in a message thread **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.messages.replies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `ts` | `string` | Yes | — | | `latest` | `string` | No | — | | `oldest` | `string` | No | — | | `inclusive` | `boolean` | No | — | | `include_all_metadata` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `messages` | `object[]` | No | — | | `has_more` | `boolean` | No | — | | `response_metadata` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > ts?: string, > text?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > thread_ts?: string, > reply_count?: number, > blocks?: { > }[], > attachments?: { > }[] > }[] > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### schedule `messages.schedule` Schedule a message to be sent at a future time **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.messages.schedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `post_at` | `number` | Yes | — | | `text` | `string` | No | — | | `blocks` | `object[]` | No | — | | `attachments` | `object[]` | No | — | | `thread_ts` | `string` | No | — | | `mrkdwn` | `boolean` | No | — | | `parse` | `full \| none` | No | — | | `link_names` | `boolean` | No | — | | `unfurl_links` | `boolean` | No | — | | `unfurl_media` | `boolean` | No | — | | `metadata` | `object` | No | — | | `as_user` | `boolean` | No | — | | `reply_broadcast` | `boolean` | No | — | > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `string` | No | — | | `scheduled_message_id` | `string` | No | — | | `post_at` | `number` | No | — | | `message` | `object` | No | — | > **message full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > ts?: string, > text?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > thread_ts?: string, > reply_count?: number, > blocks?: { > }[], > attachments?: { > }[] > } > ``` *** ### update `messages.update` Update the text or blocks of an existing message **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.messages.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `ts` | `string` | Yes | — | | `text` | `string` | No | — | | `blocks` | `object[]` | No | — | | `attachments` | `object[]` | No | — | | `as_user` | `boolean` | No | — | | `link_names` | `boolean` | No | — | | `parse` | `full \| none` | No | — | | `metadata` | `object` | No | — | | `reply_broadcast` | `boolean` | No | — | | `file_ids` | `string[]` | No | — | > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `string` | No | — | | `ts` | `string` | No | — | | `text` | `string` | No | — | | `message` | `object` | No | — | > **message full type** > > ```ts theme={null} > { > type?: string, > subtype?: string, > ts?: string, > text?: string, > user?: string, > bot_id?: string, > app_id?: string, > team?: string, > username?: string, > thread_ts?: string, > reply_count?: number, > blocks?: { > }[], > attachments?: { > }[] > } > ``` *** ## Reminders ### add `reminders.add` Create a reminder **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.reminders.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `time` | `number \| string` | Yes | — | | `user` | `string` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `reminder` | `object` | No | — | > **reminder full type** > > ```ts theme={null} > { > id: string, > creator?: string, > user?: string, > text?: string, > recurring?: boolean, > time?: number, > complete_ts?: number > } > ``` *** ### complete `reminders.complete` Mark a reminder complete (deprecated by Slack) **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.reminders.complete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reminder` | `string` | Yes | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### delete `reminders.delete` Delete a reminder **Risk:** `destructive` ```ts theme={null} await corsair.slackbot.api.reminders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reminder` | `string` | Yes | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### info `reminders.info` Retrieve information about a reminder **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.reminders.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `reminder` | `string` | Yes | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `reminder` | `object` | No | — | > **reminder full type** > > ```ts theme={null} > { > id: string, > creator?: string, > user?: string, > text?: string, > recurring?: boolean, > time?: number, > complete_ts?: number > } > ``` *** ### list `reminders.list` List the reminders visible to the token **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.reminders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `reminders` | `object[]` | No | — | > **reminders full type** > > ```ts theme={null} > { > id: string, > creator?: string, > user?: string, > text?: string, > recurring?: boolean, > time?: number, > complete_ts?: number > }[] > ``` *** ## Team ### emojiList `team.emojiList` List the workspace custom emoji **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.team.emojiList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_categories` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `emoji` | `object` | No | — | | `categories` | `object[]` | No | — | > **emoji full type** > > ```ts theme={null} > { > } > ``` > **categories full type** > > ```ts theme={null} > { > }[] > ``` *** ### info `team.info` Fetch workspace information **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.team.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `team` | `string` | No | — | | `domain` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `team` | `object` | No | — | > **team full type** > > ```ts theme={null} > { > id: string, > name?: string, > domain?: string, > email_domain?: string, > icon?: { > }, > enterprise_id?: string, > enterprise_name?: string > } > ``` *** ### openDm `team.openDm` Open a direct or multi-person direct message **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.team.openDm({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | No | — | | `users` | `string[]` | No | — | | `prevent_creation` | `boolean` | No | — | | `return_im` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `channel` | `object` | No | — | | `no_op` | `boolean` | No | — | | `already_open` | `boolean` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > is_channel?: boolean, > is_group?: boolean, > is_im?: boolean, > is_mpim?: boolean, > is_private?: boolean, > is_archived?: boolean, > is_general?: boolean, > is_member?: boolean, > created?: number, > creator?: string, > num_members?: number, > topic?: { > }, > purpose?: { > } > } > ``` *** ### profileGet `team.profileGet` Fetch the workspace profile field definitions **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.team.profileGet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `visibility` | `all \| visible \| hidden` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `profile` | `object` | No | — | > **profile full type** > > ```ts theme={null} > { > } > ``` *** ### unfurl `team.unfurl` Attach a custom preview to a link in a message **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.team.unfurl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel` | `string` | Yes | — | | `ts` | `string` | Yes | — | | `unfurls` | `object` | Yes | — | | `user_auth_message` | `string` | No | — | | `user_auth_required` | `boolean` | No | — | | `user_auth_url` | `string` | No | — | > **unfurls full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ## User Groups ### create `userGroups.create` Create a user group **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.userGroups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `handle` | `string` | No | — | | `description` | `string` | No | — | | `channels` | `string[]` | No | — | | `include_count` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `usergroup` | `object` | No | — | > **usergroup full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > handle?: string, > description?: string, > is_external?: boolean, > date_create?: number, > date_delete?: number, > user_count?: number | string, > users?: string[] > } > ``` *** ### disable `userGroups.disable` Disable a user group **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.userGroups.disable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `usergroup` | `string` | Yes | — | | `include_count` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `usergroup` | `object` | No | — | > **usergroup full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > handle?: string, > description?: string, > is_external?: boolean, > date_create?: number, > date_delete?: number, > user_count?: number | string, > users?: string[] > } > ``` *** ### enable `userGroups.enable` Enable a user group **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.userGroups.enable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `usergroup` | `string` | Yes | — | | `include_count` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `usergroup` | `object` | No | — | > **usergroup full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > handle?: string, > description?: string, > is_external?: boolean, > date_create?: number, > date_delete?: number, > user_count?: number | string, > users?: string[] > } > ``` *** ### list `userGroups.list` List the workspace user groups **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.userGroups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_disabled` | `boolean` | No | — | | `include_count` | `boolean` | No | — | | `include_users` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `usergroups` | `object[]` | No | — | > **usergroups full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > handle?: string, > description?: string, > is_external?: boolean, > date_create?: number, > date_delete?: number, > user_count?: number | string, > users?: string[] > }[] > ``` *** ### update `userGroups.update` Update a user group name, handle or channels **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.userGroups.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `usergroup` | `string` | Yes | — | | `name` | `string` | No | — | | `handle` | `string` | No | — | | `description` | `string` | No | — | | `channels` | `string[]` | No | — | | `include_count` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `usergroup` | `object` | No | — | > **usergroup full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > handle?: string, > description?: string, > is_external?: boolean, > date_create?: number, > date_delete?: number, > user_count?: number | string, > users?: string[] > } > ``` *** ### usersList `userGroups.usersList` List the members of a user group **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.userGroups.usersList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `usergroup` | `string` | Yes | — | | `include_disabled` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `users` | `string[]` | No | — | *** ### usersUpdate `userGroups.usersUpdate` Replace a user group membership **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.userGroups.usersUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `usergroup` | `string` | Yes | — | | `users` | `string[]` | Yes | — | | `include_count` | `boolean` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `usergroup` | `object` | No | — | > **usergroup full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > handle?: string, > description?: string, > is_external?: boolean, > date_create?: number, > date_delete?: number, > user_count?: number | string, > users?: string[] > } > ``` *** ## Users ### botsInfo `users.botsInfo` Retrieve information about a bot user **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.users.botsInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bot` | `string` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `bot` | `object` | No | — | > **bot full type** > > ```ts theme={null} > { > id?: string, > deleted?: boolean, > name?: string, > updated?: number, > app_id?: string, > user_id?: string, > icons?: { > } > } > ``` *** ### dndInfo `users.dndInfo` Retrieve a user do-not-disturb status **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.users.dndInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `dnd_enabled` | `boolean` | No | — | | `next_dnd_start_ts` | `number` | No | — | | `next_dnd_end_ts` | `number` | No | — | | `snooze_enabled` | `boolean` | No | — | | `snooze_endtime` | `number` | No | — | | `snooze_remaining` | `number` | No | — | *** ### dndTeamInfo `users.dndTeamInfo` Retrieve do-not-disturb status for several users **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.users.dndTeamInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `users` | `string[]` | No | — | | `team_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `users` | `object` | No | — | > **users full type** > > ```ts theme={null} > { > } > ``` *** ### find `users.find` Search users by name, display name or email **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.users.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `include_deleted` | `boolean` | No | — | | `include_bots` | `boolean` | No | — | | `team_id` | `string` | No | — | | `limit` | `number` | No | — | | `max_pages` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `members` | `object[]` | Yes | — | | `truncated` | `boolean` | Yes | — | | `pages_scanned` | `number` | Yes | — | > **members full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > real_name?: string, > deleted?: boolean, > is_bot?: boolean, > is_admin?: boolean, > is_owner?: boolean, > is_app_user?: boolean, > tz?: string, > updated?: number, > profile?: { > } > }[] > ``` *** ### getPresence `users.getPresence` Retrieve a user presence **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.users.getPresence({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `presence` | `string` | No | — | | `online` | `boolean` | No | — | | `auto_away` | `boolean` | No | — | | `manual_away` | `boolean` | No | — | | `connection_count` | `number` | No | — | | `last_activity` | `number` | No | — | *** ### getProfile `users.getProfile` Retrieve a user profile **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.users.getProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | No | — | | `include_labels` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `profile` | `object` | No | — | > **profile full type** > > ```ts theme={null} > { > } > ``` *** ### info `users.info` Retrieve detailed information about a user **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.users.info({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user` | `string` | Yes | — | | `include_locale` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > real_name?: string, > deleted?: boolean, > is_bot?: boolean, > is_admin?: boolean, > is_owner?: boolean, > is_app_user?: boolean, > tz?: string, > updated?: number, > profile?: { > } > } > ``` *** ### list `users.list` List the users in the workspace **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_locale` | `boolean` | No | — | | `team_id` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `members` | `object[]` | No | — | | `cache_ts` | `number` | No | — | | `response_metadata` | `object` | No | — | > **members full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > real_name?: string, > deleted?: boolean, > is_bot?: boolean, > is_admin?: boolean, > is_owner?: boolean, > is_app_user?: boolean, > tz?: string, > updated?: number, > profile?: { > } > }[] > ``` > **response\_metadata full type** > > ```ts theme={null} > { > next_cursor?: string, > warnings?: string[], > messages?: string[] > } > ``` *** ### lookupByEmail `users.lookupByEmail` Look up a user by email address (deprecated by Slack) **Risk:** `read` ```ts theme={null} await corsair.slackbot.api.users.lookupByEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > id: string, > team_id?: string, > name?: string, > real_name?: string, > deleted?: boolean, > is_bot?: boolean, > is_admin?: boolean, > is_owner?: boolean, > is_app_user?: boolean, > tz?: string, > updated?: number, > profile?: { > } > } > ``` *** ### setActive `users.setActive` Mark the calling user as active **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.users.setActive({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** ### setPresence `users.setPresence` Set the calling user presence **Risk:** `write` ```ts theme={null} await corsair.slackbot.api.users.setPresence({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `presence` | `auto \| away` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | Yes | — | | `error` | `string` | No | — | | `warning` | `string` | No | — | | `needed` | `string` | No | — | | `provided` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/slackbot/database Slackbot local sync: searchable entities, `.search()` filters, and operators. The Slackbot plugin syncs data locally. Use `corsair.slackbot.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Channels Path: `slackbot.db.channels.search` ```ts theme={null} const rows = await corsair.slackbot.db.channels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `is_private` | `boolean` | equals | | `is_archived` | `boolean` | equals | | `created` | `number` | equals, gt, gte, lt, lte, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `num_members` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `slackbot.db.files.search` ```ts theme={null} const rows = await corsair.slackbot.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `mimetype` | `string` | equals, contains, startsWith, endsWith, in | | `filetype` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `permalink` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `slackbot.db.messages.search` ```ts theme={null} const rows = await corsair.slackbot.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ts` | `string` | equals, contains, startsWith, endsWith, in | | `channel` | `string` | equals, contains, startsWith, endsWith, in | | `subtype` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `bot_id` | `string` | equals, contains, startsWith, endsWith, in | | `app_id` | `string` | equals, contains, startsWith, endsWith, in | | `team` | `string` | equals, contains, startsWith, endsWith, in | | `thread_ts` | `string` | equals, contains, startsWith, endsWith, in | | `authorId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Reminders Path: `slackbot.db.reminders.search` ```ts theme={null} const rows = await corsair.slackbot.db.reminders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `user` | `string` | equals, contains, startsWith, endsWith, in | | `creator` | `string` | equals, contains, startsWith, endsWith, in | | `time` | `number` | equals, gt, gte, lt, lte, in | | `recurring` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scheduled Messages Path: `slackbot.db.scheduled_messages.search` ```ts theme={null} const rows = await corsair.slackbot.db.scheduled_messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `channel` | `string` | equals, contains, startsWith, endsWith, in | | `post_at` | `number` | equals, gt, gte, lt, lte, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `thread_ts` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `slackbot.db.users.search` ```ts theme={null} const rows = await corsair.slackbot.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `real_name` | `string` | equals, contains, startsWith, endsWith, in | | `team_id` | `string` | equals, contains, startsWith, endsWith, in | | `is_bot` | `boolean` | equals | | `deleted` | `boolean` | equals | | `tz` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/slackbot/overview Slackbot plugin for Corsair Use **Slackbot** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 87 typed API operations * 6 synced entities (`channels`, `files`, `messages`, `reminders`, `scheduled_messages`, `users`) for fast `.search()` / `.list()` * 10 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/slackbot ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/slackbot ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/slackbot ``` ```bash bun theme={null} bun add corsair @corsair-dev/slackbot ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { slackbot } from '@corsair-dev/slackbot'; export const corsair = createCorsair({ plugins: [ slackbot(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Slackbot OAuth app. ```ts theme={null} slackbot() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'slackbot', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`calls.info`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.slackbot.api.calls.info({}); ``` **`calls.add`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.slackbot.api.calls.add({}); ``` See the full list on the [API](/plugins/slackbot/api) page. ## Query synced data Synced entities support `tenant.slackbot.db..search()` and `.list()`: `channels`, `files`, `messages`, `reminders`, `scheduled_messages`, `users`. See [Database](/plugins/slackbot/database) for filters and operators. ## Webhooks This plugin registers **10** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/slackbot/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/slackbot/api)** > > Every `slackbot.api.*` operation with input and output types. > **[Database](/plugins/slackbot/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/slackbot/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/slackbot/webhooks Slackbot incoming webhooks: event paths, payloads, and response data. The Slackbot plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/slackbot/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `channels` * `created` (`channels.created`) * `messages` * `botMessage` (`messages.botMessage`) * `directMessage` (`messages.directMessage`) * `groupDirectMessage` (`messages.groupDirectMessage`) * `message` (`messages.message`) * `privateChannelMessage` (`messages.privateChannelMessage`) * `threadReply` (`messages.threadReply`) * `reactions` * `added` (`reactions.added`) * `removed` (`reactions.removed`) * `setup` * `challenge` (`setup.challenge`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Channels ### Created `channels.created` A new channel created in the workspace **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `channel_created` | Yes | — | | `channel` | `object` | Yes | — | | `event_ts` | `string` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name?: string, > created?: number, > creator?: string, > is_channel?: boolean, > is_private?: boolean > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: channel_created, > channel: { > id: string, > name?: string, > created?: number, > creator?: string, > is_channel?: boolean, > is_private?: boolean > }, > event_ts?: string > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { channels: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Messages ### Bot Message `messages.botMessage` A message posted by another bot or app **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `message` | Yes | — | | `subtype` | `string` | No | — | | `channel` | `string` | Yes | — | | `channel_type` | `channel \| group \| im \| mpim` | No | — | | `user` | `string` | No | — | | `bot_id` | `string` | No | — | | `app_id` | `string` | No | — | | `bot_profile` | `object` | No | — | | `text` | `string` | No | — | | `ts` | `string` | Yes | — | | `thread_ts` | `string` | No | — | | `parent_user_id` | `string` | No | — | | `team` | `string` | No | — | | `event_ts` | `string` | No | — | | `blocks` | `object[]` | No | — | | `files` | `object[]` | No | — | > **bot\_profile full type** > > ```ts theme={null} > { > } > ``` > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **files full type** > > ```ts theme={null} > { > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > type: message, > subtype?: string, > channel: string, > channel_type?: channel | group | im | mpim, > user?: string, > bot_id?: string, > app_id?: string, > bot_profile?: { > }, > text?: string, > ts: string, > thread_ts?: string, > parent_user_id?: string, > team?: string, > event_ts?: string, > blocks?: { > }[], > files?: { > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { messages: { botMessage: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Direct Message `messages.directMessage` A direct message sent to the bot **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `message` | Yes | — | | `subtype` | `string` | No | — | | `channel` | `string` | Yes | — | | `channel_type` | `channel \| group \| im \| mpim` | No | — | | `user` | `string` | No | — | | `bot_id` | `string` | No | — | | `app_id` | `string` | No | — | | `bot_profile` | `object` | No | — | | `text` | `string` | No | — | | `ts` | `string` | Yes | — | | `thread_ts` | `string` | No | — | | `parent_user_id` | `string` | No | — | | `team` | `string` | No | — | | `event_ts` | `string` | No | — | | `blocks` | `object[]` | No | — | | `files` | `object[]` | No | — | > **bot\_profile full type** > > ```ts theme={null} > { > } > ``` > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **files full type** > > ```ts theme={null} > { > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > type: message, > subtype?: string, > channel: string, > channel_type?: channel | group | im | mpim, > user?: string, > bot_id?: string, > app_id?: string, > bot_profile?: { > }, > text?: string, > ts: string, > thread_ts?: string, > parent_user_id?: string, > team?: string, > event_ts?: string, > blocks?: { > }[], > files?: { > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { messages: { directMessage: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Group Direct Message `messages.groupDirectMessage` A message in a multi-person direct message **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `message` | Yes | — | | `subtype` | `string` | No | — | | `channel` | `string` | Yes | — | | `channel_type` | `channel \| group \| im \| mpim` | No | — | | `user` | `string` | No | — | | `bot_id` | `string` | No | — | | `app_id` | `string` | No | — | | `bot_profile` | `object` | No | — | | `text` | `string` | No | — | | `ts` | `string` | Yes | — | | `thread_ts` | `string` | No | — | | `parent_user_id` | `string` | No | — | | `team` | `string` | No | — | | `event_ts` | `string` | No | — | | `blocks` | `object[]` | No | — | | `files` | `object[]` | No | — | > **bot\_profile full type** > > ```ts theme={null} > { > } > ``` > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **files full type** > > ```ts theme={null} > { > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > type: message, > subtype?: string, > channel: string, > channel_type?: channel | group | im | mpim, > user?: string, > bot_id?: string, > app_id?: string, > bot_profile?: { > }, > text?: string, > ts: string, > thread_ts?: string, > parent_user_id?: string, > team?: string, > event_ts?: string, > blocks?: { > }[], > files?: { > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { messages: { groupDirectMessage: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Message `messages.message` A message posted by a person in a public channel **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `message` | Yes | — | | `subtype` | `string` | No | — | | `channel` | `string` | Yes | — | | `channel_type` | `channel \| group \| im \| mpim` | No | — | | `user` | `string` | No | — | | `bot_id` | `string` | No | — | | `app_id` | `string` | No | — | | `bot_profile` | `object` | No | — | | `text` | `string` | No | — | | `ts` | `string` | Yes | — | | `thread_ts` | `string` | No | — | | `parent_user_id` | `string` | No | — | | `team` | `string` | No | — | | `event_ts` | `string` | No | — | | `blocks` | `object[]` | No | — | | `files` | `object[]` | No | — | > **bot\_profile full type** > > ```ts theme={null} > { > } > ``` > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **files full type** > > ```ts theme={null} > { > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > type: message, > subtype?: string, > channel: string, > channel_type?: channel | group | im | mpim, > user?: string, > bot_id?: string, > app_id?: string, > bot_profile?: { > }, > text?: string, > ts: string, > thread_ts?: string, > parent_user_id?: string, > team?: string, > event_ts?: string, > blocks?: { > }[], > files?: { > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { messages: { message: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Private Channel Message `messages.privateChannelMessage` A message posted by a person in a private channel **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `message` | Yes | — | | `subtype` | `string` | No | — | | `channel` | `string` | Yes | — | | `channel_type` | `channel \| group \| im \| mpim` | No | — | | `user` | `string` | No | — | | `bot_id` | `string` | No | — | | `app_id` | `string` | No | — | | `bot_profile` | `object` | No | — | | `text` | `string` | No | — | | `ts` | `string` | Yes | — | | `thread_ts` | `string` | No | — | | `parent_user_id` | `string` | No | — | | `team` | `string` | No | — | | `event_ts` | `string` | No | — | | `blocks` | `object[]` | No | — | | `files` | `object[]` | No | — | > **bot\_profile full type** > > ```ts theme={null} > { > } > ``` > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **files full type** > > ```ts theme={null} > { > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > type: message, > subtype?: string, > channel: string, > channel_type?: channel | group | im | mpim, > user?: string, > bot_id?: string, > app_id?: string, > bot_profile?: { > }, > text?: string, > ts: string, > thread_ts?: string, > parent_user_id?: string, > team?: string, > event_ts?: string, > blocks?: { > }[], > files?: { > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { messages: { privateChannelMessage: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Thread Reply `messages.threadReply` A reply posted inside a message thread **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `message` | Yes | — | | `subtype` | `string` | No | — | | `channel` | `string` | Yes | — | | `channel_type` | `channel \| group \| im \| mpim` | No | — | | `user` | `string` | No | — | | `bot_id` | `string` | No | — | | `app_id` | `string` | No | — | | `bot_profile` | `object` | No | — | | `text` | `string` | No | — | | `ts` | `string` | Yes | — | | `thread_ts` | `string` | No | — | | `parent_user_id` | `string` | No | — | | `team` | `string` | No | — | | `event_ts` | `string` | No | — | | `blocks` | `object[]` | No | — | | `files` | `object[]` | No | — | > **bot\_profile full type** > > ```ts theme={null} > { > } > ``` > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **files full type** > > ```ts theme={null} > { > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > type: message, > subtype?: string, > channel: string, > channel_type?: channel | group | im | mpim, > user?: string, > bot_id?: string, > app_id?: string, > bot_profile?: { > }, > text?: string, > ts: string, > thread_ts?: string, > parent_user_id?: string, > team?: string, > event_ts?: string, > blocks?: { > }[], > files?: { > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { messages: { threadReply: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Reactions ### Added `reactions.added` An emoji reaction added to a message or file **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `reaction_added` | Yes | — | | `user` | `string` | Yes | — | | `reaction` | `string` | Yes | — | | `item_user` | `string` | No | — | | `item` | `object` | Yes | — | | `event_ts` | `string` | No | — | > **item full type** > > ```ts theme={null} > { > type: string, > channel?: string, > ts?: string, > file?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: reaction_added, > user: string, > reaction: string, > item_user?: string, > item: { > type: string, > channel?: string, > ts?: string, > file?: string > }, > event_ts?: string > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { reactions: { added: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Removed `reactions.removed` An emoji reaction removed from a message or file **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `reaction_removed` | Yes | — | | `user` | `string` | Yes | — | | `reaction` | `string` | Yes | — | | `item_user` | `string` | No | — | | `item` | `object` | Yes | — | | `event_ts` | `string` | No | — | > **item full type** > > ```ts theme={null} > { > type: string, > channel?: string, > ts?: string, > file?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: reaction_removed, > user: string, > reaction: string, > item_user?: string, > item: { > type: string, > channel?: string, > ts?: string, > file?: string > }, > event_ts?: string > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { reactions: { removed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Setup ### Challenge `setup.challenge` Slack Events API URL verification handshake **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `url_verification` | Yes | — | | `token` | `string` | No | — | | `challenge` | `string` | Yes | — | > **Response data full type** > > ```ts theme={null} > { > type: url_verification, > challenge: string > } > ``` **`webhookHooks` example** ```ts theme={null} slackbot({ webhookHooks: { setup: { challenge: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/snapchat/api API reference for Snapchat: every `snapchat.api.*` operation with input and output types. Every `snapchat.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Actions ### addSegmentUsers `actions.addSegmentUsers` Add Segment Users **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.addSegmentUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `users` | `string[] \| string` | Yes | User identifiers (SHA-256 hashed email, phone, or mobile ad ID) | | `segment_id` | `string` | Yes | Unique identifier for segment\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### copyMedia `actions.copyMedia` Copy Media **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.copyMedia({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_copy` | `object[]` | Yes | Parameter media\_copy | | `destination_ad_account_id` | `string` | Yes | Unique identifier for destination\_ad\_account\_id | > **media\_copy full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAccountRole `actions.createAccountRole` Create Account Role **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAccountRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roles` | `object[]` | Yes | Parameter roles | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | > **roles full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdAccount `actions.createAdAccount` Create Ad Account **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `adaccounts` | `object[]` | Yes | Parameter adaccounts | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | > **adaccounts full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdaccountsAudienceSizeV2 `actions.createAdaccountsAudienceSizeV2` Create Adaccounts Audience Size V2 **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdaccountsAudienceSizeV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `targeting` | `object` | Yes | Targeting or delivery specification for targeting | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | > **targeting full type** > > ```ts theme={null} > { > } | string > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdaccountsCreativeElements `actions.createAdaccountsCreativeElements` Create Adaccounts Creative Elements **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdaccountsCreativeElements({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier for id | | `creative_elements` | `object[]` | Yes | Parameter creative\_elements | > **creative\_elements full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdaccountsDynamicTemplates `actions.createAdaccountsDynamicTemplates` Create Adaccounts Dynamic Templates **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdaccountsDynamicTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `adaccount_id` | `string` | Yes | Unique identifier for adaccount\_id | | `dynamic_templates` | `object[]` | Yes | Parameter dynamic\_templates | > **dynamic\_templates full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdaccountsEventDetails `actions.createAdaccountsEventDetails` Create Adaccounts Event Details **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdaccountsEventDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | | `event_details` | `object[]` | Yes | Parameter event\_details | > **event\_details full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdaccountsInteractionZones `actions.createAdaccountsInteractionZones` Create Adaccounts Interaction Zones **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdaccountsInteractionZones({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | | `interaction_zones` | `object[]` | Yes | Parameter interaction\_zones | > **interaction\_zones full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdaccountsOfferDisclaimers `actions.createAdaccountsOfferDisclaimers` Create Adaccounts Offer Disclaimers **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdaccountsOfferDisclaimers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier for id | | `offer_disclaimers` | `object[]` | Yes | Parameter offer\_disclaimers | > **offer\_disclaimers full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdaccountsReservedForecasting `actions.createAdaccountsReservedForecasting` Create Adaccounts Reserved Forecasting **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdaccountsReservedForecasting({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier for id | | `end_time` | `string \| Date` | Yes | Timestamp for end\_time | | `targeting` | `object` | Yes | Targeting or delivery specification for targeting | | `start_time` | `string \| Date` | Yes | Timestamp for start\_time | | `placement_v2` | `object` | Yes | Targeting or delivery specification for placement\_v2 | | `optimization_goal` | `object[]` | Yes | Parameter optimization\_goal | | `delivery_constraint` | `object` | Yes | Targeting or delivery specification for delivery\_constraint | | `cap_and_exclusion_config` | `object` | Yes | Targeting or delivery specification for cap\_and\_exclusion\_config | > **targeting full type** > > ```ts theme={null} > { > } | string > ``` > **placement\_v2 full type** > > ```ts theme={null} > { > } | string > ``` > **optimization\_goal full type** > > ```ts theme={null} > string | { > } | any[] > ``` > **delivery\_constraint full type** > > ```ts theme={null} > { > } | string > ``` > **cap\_and\_exclusion\_config full type** > > ```ts theme={null} > { > } | string > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdaccountsTargetingInsights `actions.createAdaccountsTargetingInsights` Create Adaccounts Targeting Insights **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdaccountsTargetingInsights({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier for id | | `base_spec` | `object` | Yes | Targeting or delivery specification for base\_spec | | `targeting_spec` | `object` | Yes | Targeting or delivery specification for targeting\_spec | > **base\_spec full type** > > ```ts theme={null} > { > } | string > ``` > **targeting\_spec full type** > > ```ts theme={null} > { > } | string > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createAdSquad `actions.createAdSquad` Create Ad Squad **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createAdSquad({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `adsquads` | `object[]` | Yes | Parameter adsquads | | `campaign_id` | `string` | Yes | Unique identifier for campaign\_id | > **adsquads full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createBillingCenter `actions.createBillingCenter` Create Billing Center **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createBillingCenter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `billingcenters` | `object[]` | Yes | Parameter billingcenters | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | > **billingcenters full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createCampaign `actions.createCampaign` Create Campaign **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Value for name | | `start_time` | `string \| Date` | Yes | Timestamp for start\_time | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createCatalogRole `actions.createCatalogRole` Create Catalog Role **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createCatalogRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roles` | `object[]` | Yes | Parameter roles | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | > **roles full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createCatalogsFacets `actions.createCatalogsFacets` Create Catalogs Facets **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createCatalogsFacets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `facets` | `object[]` | Yes | Parameter facets | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | > **facets full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createCatalogsFlightsSearch `actions.createCatalogsFlightsSearch` Create Catalogs Flights Search **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createCatalogsFlightsSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createCatalogsProductFeeds `actions.createCatalogsProductFeeds` Create Catalogs Product Feeds **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createCatalogsProductFeeds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Value for name | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | | `default_currency` | `string` | Yes | Value for default\_currency | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createCatalogsProductSets `actions.createCatalogsProductSets` Create Catalogs Product Sets **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createCatalogsProductSets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Value for name | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createMedia `actions.createMedia` Create Media **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createMedia({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media` | `object[]` | Yes | Parameter media | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | > **media full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createOrganizationsCatalogs `actions.createOrganizationsCatalogs` Create Organizations Catalogs **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createOrganizationsCatalogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalogs` | `object[]` | Yes | Parameter catalogs | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | > **catalogs full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createOrgRole `actions.createOrgRole` Create Org Role **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createOrgRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `roles` | `object[]` | Yes | Parameter roles | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | > **roles full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createSegment `actions.createSegment` Create Segment **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.createSegment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segments` | `object[]` | Yes | Parameter segments | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | > **segments full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteAdaccountsOfferDisclaimers `actions.deleteAdaccountsOfferDisclaimers` Delete Adaccounts Offer Disclaimers **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteAdaccountsOfferDisclaimers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | | `offer_disclaimer_id` | `string` | Yes | Unique identifier for offer\_disclaimer\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteAdsquads `actions.deleteAdsquads` Delete Adsquads **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteAdsquads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier for id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteAllSegmentUsers `actions.deleteAllSegmentUsers` Delete All Segment Users **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteAllSegmentUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segment_id` | `string` | Yes | Unique identifier for segment\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteCampaign `actions.deleteCampaign` Delete Campaign **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | Unique identifier for campaign\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteCatalogs `actions.deleteCatalogs` Delete Catalogs **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteCatalogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteEventDetails `actions.deleteEventDetails` Delete Event Details **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteEventDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_details_id` | `string` | Yes | Unique identifier for event\_details\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteMember `actions.deleteMember` Delete Member **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `member_id` | `string` | Yes | Unique identifier for member\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteProductFeeds `actions.deleteProductFeeds` Delete Product Feeds **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteProductFeeds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_feed_id` | `string` | Yes | Unique identifier for product\_feed\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteRole `actions.deleteRole` Delete Role **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role_id` | `string` | Yes | Unique identifier for role\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteSegment `actions.deleteSegment` Delete Segment **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteSegment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segment_id` | `string` | Yes | Unique identifier for segment\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteSegmentUsers `actions.deleteSegmentUsers` Delete Segment Users **Risk:** `destructive` ```ts theme={null} await corsair.snapchat.api.actions.deleteSegmentUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `users` | `string[] \| string` | Yes | User identifiers (SHA-256 hashed email, phone, or mobile ad ID) | | `segment_id` | `string` | Yes | Unique identifier for segment\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdAccount `actions.getAdAccount` Get Ad Account **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsAdsquads `actions.getAdaccountsAdsquads` Get Adaccounts Adsquads **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsAdsquads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsAdSquadUiRenderData `actions.getAdaccountsAdSquadUiRenderData` Get Adaccounts Ad Squad Ui Render Data **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsAdSquadUiRenderData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsDynamicTemplates `actions.getAdaccountsDynamicTemplates` Get Adaccounts Dynamic Templates **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsDynamicTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsEventDetails `actions.getAdaccountsEventDetails` Get Adaccounts Event Details **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsEventDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsInteractionZones `actions.getAdaccountsInteractionZones` Get Adaccounts Interaction Zones **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsInteractionZones({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdAccountsLeadGenerationForms `actions.getAdAccountsLeadGenerationForms` Get Ad Accounts Lead Generation Forms **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdAccountsLeadGenerationForms({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsLeadsReport `actions.getAdaccountsLeadsReport` Get Adaccounts Leads Report **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsLeadsReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier for id | | `report_run_id` | `string` | Yes | Unique identifier for report\_run\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsMobileApps `actions.getAdaccountsMobileApps` Get Adaccounts Mobile Apps **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsMobileApps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsOfferDisclaimers `actions.getAdaccountsOfferDisclaimers` Get Adaccounts Offer Disclaimers **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsOfferDisclaimers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsSpendGuidance `actions.getAdaccountsSpendGuidance` Get Adaccounts Spend Guidance **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsSpendGuidance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdAccountsStats `actions.getAdAccountsStats` Get Ad Accounts Stats **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdAccountsStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdaccountsStatsReport `actions.getAdaccountsStatsReport` Get Adaccounts Stats Report **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdaccountsStatsReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | | `report_run_id` | `string` | Yes | Unique identifier for report\_run\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdSquad `actions.getAdSquad` Get Ad Squad **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdSquad({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_squad_id` | `string` | Yes | Unique identifier for ad\_squad\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdSquadRestrictions `actions.getAdSquadRestrictions` Get Ad Squad Restrictions **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdSquadRestrictions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_squad_id` | `string` | Yes | Unique identifier for ad\_squad\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdsquadsAudienceSizeV2 `actions.getAdsquadsAudienceSizeV2` Get Adsquads Audience Size V2 **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdsquadsAudienceSizeV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_squad_id` | `string` | Yes | Unique identifier for ad\_squad\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdsquadsStatsReport `actions.getAdsquadsStatsReport` Get Adsquads Stats Report **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdsquadsStatsReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_squad_id` | `string` | Yes | Unique identifier for ad\_squad\_id | | `report_run_id` | `string` | Yes | Unique identifier for report\_run\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdSquadStats `actions.getAdSquadStats` Get Ad Squad Stats **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdSquadStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_squad_id` | `string` | Yes | Unique identifier for ad\_squad\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdSquadTargeting `actions.getAdSquadTargeting` Get Ad Squad Targeting **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdSquadTargeting({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_squad_id` | `string` | Yes | Unique identifier for ad\_squad\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAdStats `actions.getAdStats` Get Ad Stats **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAdStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_id` | `string` | Yes | Unique identifier for ad\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAuthenticatedUser `actions.getAuthenticatedUser` Get Authenticated User **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getAuthenticatedUser({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getBillingCenter `actions.getBillingCenter` Get Billing Center **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getBillingCenter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `billing_center_id` | `string` | Yes | Unique identifier for billing\_center\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCampaign `actions.getCampaign` Get Campaign **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | Unique identifier for campaign\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCampaignChangelog `actions.getCampaignChangelog` Get Campaign Changelog **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getCampaignChangelog({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | Unique identifier for campaign\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCampaignsByIds `actions.getCampaignsByIds` Get Campaigns By Ids **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getCampaignsByIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity_ids` | `string[] \| string` | Yes | List of entity identifiers or single identifier | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCampaignStats `actions.getCampaignStats` Get Campaign Stats **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getCampaignStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | Unique identifier for campaign\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCatalogs `actions.getCatalogs` Get Catalogs **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getCatalogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getCatalogsProductSets `actions.getCatalogsProductSets` Get Catalogs Product Sets **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getCatalogsProductSets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getDynamicTemplate `actions.getDynamicTemplate` Get Dynamic Template **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getDynamicTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier for id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getDynamicTemplatesExternalChangelogs `actions.getDynamicTemplatesExternalChangelogs` Get Dynamic Templates External Changelogs **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getDynamicTemplatesExternalChangelogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dynamic_template_id` | `string` | Yes | Unique identifier for dynamic\_template\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getEventDetails `actions.getEventDetails` Get Event Details **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getEventDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `event_details_id` | `string` | Yes | Unique identifier for event\_details\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getFundingSource `actions.getFundingSource` Get Funding Source **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getFundingSource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `funding_source_id` | `string` | Yes | Unique identifier for funding\_source\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getInteractionZone `actions.getInteractionZone` Get Interaction Zone **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getInteractionZone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `interaction_zone_id` | `string` | Yes | Unique identifier for interaction\_zone\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getInvoice `actions.getInvoice` Get Invoice **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getInvoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `invoice_id` | `string` | Yes | Unique identifier for invoice\_id | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMedia `actions.getMedia` Get Media **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getMedia({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_id` | `string` | Yes | Unique identifier for media\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMediaByIds `actions.getMediaByIds` Get Media By Ids **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getMediaByIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity_ids` | `string[] \| string` | Yes | List of entity identifiers or single identifier | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMediaStats `actions.getMediaStats` Get Media Stats **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getMediaStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_id` | `string` | Yes | Unique identifier for media\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMember `actions.getMember` Get Member **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getMember({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `member_id` | `string` | Yes | Unique identifier for member\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getOrganization `actions.getOrganization` Get Organization **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getOrganizationsCatalogs `actions.getOrganizationsCatalogs` Get Organizations Catalogs **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getOrganizationsCatalogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getOrganizationsMobileApps `actions.getOrganizationsMobileApps` Get Organizations Mobile Apps **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getOrganizationsMobileApps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getOrganizationsPublicProfiles `actions.getOrganizationsPublicProfiles` Get Organizations Public Profiles **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getOrganizationsPublicProfiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getPixels `actions.getPixels` Get Pixels **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getPixels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getProductFeeds `actions.getProductFeeds` Get Product Feeds **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getProductFeeds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_feed_id` | `string` | Yes | Unique identifier for product\_feed\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getProductFeedsFeedUploads `actions.getProductFeedsFeedUploads` Get Product Feeds Feed Uploads **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getProductFeedsFeedUploads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `product_feed_id` | `string` | Yes | Unique identifier for product\_feed\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getProductSets `actions.getProductSets` Get Product Sets **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getProductSets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Unique identifier for id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSegment `actions.getSegment` Get Segment **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getSegment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segment_id` | `string` | Yes | Unique identifier for segment\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingCarriers `actions.getTargetingCarriers` Get Targeting Carriers **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingCarriers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingConnectionTypes `actions.getTargetingConnectionTypes` Get Targeting Connection Types **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingConnectionTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingDemographicsAdvancedDemographics `actions.getTargetingDemographicsAdvancedDemographics` Get Targeting Demographics Advanced Demographics **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingDemographicsAdvancedDemographics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingDemographicsAgeGroup `actions.getTargetingDemographicsAgeGroup` Get Targeting Demographics Age Group **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingDemographicsAgeGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingDemographicsGender `actions.getTargetingDemographicsGender` Get Targeting Demographics Gender **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingDemographicsGender({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingDemographicsLanguages `actions.getTargetingDemographicsLanguages` Get Targeting Demographics Languages **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingDemographicsLanguages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingDeviceIosOsVersion `actions.getTargetingDeviceIosOsVersion` Get Targeting Device Ios Os Version **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingDeviceIosOsVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingDeviceMarketingNames `actions.getTargetingDeviceMarketingNames` Get Targeting Device Marketing Names **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingDeviceMarketingNames({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingGeoPostalCode `actions.getTargetingGeoPostalCode` Get Targeting Geo Postal Code **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingGeoPostalCode({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingGeoRegion `actions.getTargetingGeoRegion` Get Targeting Geo Region **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingGeoRegion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingGeoUsPostalCode `actions.getTargetingGeoUsPostalCode` Get Targeting Geo Us Postal Code **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingGeoUsPostalCode({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingGeoUsRegion `actions.getTargetingGeoUsRegion` Get Targeting Geo Us Region **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingGeoUsRegion({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingInterestsDlxc `actions.getTargetingInterestsDlxc` Get Targeting Interests Dlxc **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingInterestsDlxc({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingInterestsDlxp `actions.getTargetingInterestsDlxp` Get Targeting Interests Dlxp **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingInterestsDlxp({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingInterestsDlxs `actions.getTargetingInterestsDlxs` Get Targeting Interests Dlxs **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingInterestsDlxs({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingInterestsNln `actions.getTargetingInterestsNln` Get Targeting Interests Nln **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingInterestsNln({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingInterestsPlc `actions.getTargetingInterestsPlc` Get Targeting Interests Plc **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingInterestsPlc({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingLocationCategoriesLoi `actions.getTargetingLocationCategoriesLoi` Get Targeting Location Categories Loi **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingLocationCategoriesLoi({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingMetros `actions.getTargetingMetros` Get Targeting Metros **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingMetros({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingOsTypes `actions.getTargetingOsTypes` Get Targeting Os Types **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingOsTypes({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingOsVersions `actions.getTargetingOsVersions` Get Targeting Os Versions **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingOsVersions({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingV1InterestsScLs `actions.getTargetingV1InterestsScLs` Get Targeting V1 Interests Sc Ls **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingV1InterestsScLs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingV1InterestsShp `actions.getTargetingV1InterestsShp` Get Targeting V1 Interests Shp **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingV1InterestsShp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | Value for country\_code | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingV1InterestsVac `actions.getTargetingV1InterestsVac` Get Targeting V1 Interests Vac **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingV1InterestsVac({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getTargetingV1Options `actions.getTargetingV1Options` Get Targeting V1 Options **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.getTargetingV1Options({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAccountRoles `actions.listAccountRoles` List Account Roles **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listAccountRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAdAccounts `actions.listAdAccounts` List Ad Accounts **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listAdAccounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAdsByAccount `actions.listAdsByAccount` List Ads By Account **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listAdsByAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAdsByAdSquad `actions.listAdsByAdSquad` List Ads By Ad Squad **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listAdsByAdSquad({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_squad_id` | `string` | Yes | Unique identifier for ad\_squad\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAdsByCampaign `actions.listAdsByCampaign` List Ads By Campaign **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listAdsByCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | Unique identifier for campaign\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listAdSquads `actions.listAdSquads` List Ad Squads **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listAdSquads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | Unique identifier for campaign\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listBillingCenters `actions.listBillingCenters` List Billing Centers **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listBillingCenters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listCampaigns `actions.listCampaigns` List Campaigns **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listCampaigns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listCatalogRoles `actions.listCatalogRoles` List Catalog Roles **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listCatalogRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listCreatives `actions.listCreatives` List Creatives **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listCreatives({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listFundingSources `actions.listFundingSources` List Funding Sources **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listFundingSources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listInvoices `actions.listInvoices` List Invoices **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listInvoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listMedia `actions.listMedia` List Media **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listMedia({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listMemberRoles `actions.listMemberRoles` List Member Roles **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listMemberRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `member_id` | `string` | Yes | Unique identifier for member\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listMembers `actions.listMembers` List Members **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listOrganizations `actions.listOrganizations` List Organizations **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listOrganizations({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listOrgPixels `actions.listOrgPixels` List Org Pixels **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listOrgPixels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listOrgRoles `actions.listOrgRoles` List Org Roles **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listOrgRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listPhoneNumbers `actions.listPhoneNumbers` List Phone Numbers **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listPhoneNumbers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listSegments `actions.listSegments` List Segments **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listSegments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listSponsoredContent `actions.listSponsoredContent` List Sponsored Content **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listSponsoredContent({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listTransactions `actions.listTransactions` List Transactions **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.listTransactions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### searchAdsLibrarySponsoredContent `actions.searchAdsLibrarySponsoredContent` Search Ads Library Sponsored Content **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.searchAdsLibrarySponsoredContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `creator_name` | `string` | Yes | Value for creator\_name | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### searchCatalogProducts `actions.searchCatalogProducts` Search Catalog Products **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.searchCatalogProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### searchCatalogsHotels `actions.searchCatalogsHotels` Search Catalogs Hotels **Risk:** `read` ```ts theme={null} await corsair.snapchat.api.actions.searchCatalogsHotels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `catalog_id` | `string` | Yes | Unique identifier for catalog\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateAdAccount `actions.updateAdAccount` Update Ad Account **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.updateAdAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `adaccounts` | `object[]` | Yes | Parameter adaccounts | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | > **adaccounts full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateAdSquad `actions.updateAdSquad` Update Ad Squad **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.updateAdSquad({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `adsquads` | `object[]` | Yes | Parameter adsquads | | `campaign_id` | `string` | Yes | Unique identifier for campaign\_id | > **adsquads full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateBillingCenter `actions.updateBillingCenter` Update Billing Center **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.updateBillingCenter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `billingcenters` | `object[]` | Yes | Parameter billingcenters | | `organization_id` | `string` | Yes | Unique identifier for organization\_id | > **billingcenters full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateCampaign `actions.updateCampaign` Update Campaign **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.updateCampaign({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `campaign_id` | `string` | Yes | Unique identifier for campaign\_id | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateSegment `actions.updateSegment` Update Segment **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.updateSegment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `segments` | `object[]` | Yes | Parameter segments | | `ad_account_id` | `string` | Yes | Unique identifier for ad\_account\_id | > **segments full type** > > ```ts theme={null} > string | { > } | any[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### uploadMediaMultipart `actions.uploadMediaMultipart` Upload Media Multipart **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.uploadMediaMultipart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `media_id` | `string` | Yes | Unique identifier for media\_id | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### validateConversionEvent `actions.validateConversionEvent` Validate Conversion Event **Risk:** `write` ```ts theme={null} await corsair.snapchat.api.actions.validateConversionEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `events` | `object` | Yes | Conversion events array, object, or string to validate | | `pixel_id` | `string` | Yes | Unique identifier for pixel\_id | > **events full type** > > ```ts theme={null} > { > }[] | { > } | string > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/snapchat/database Snapchat local sync: searchable entities, `.search()` filters, and operators. The Snapchat plugin syncs data locally. Use `corsair.snapchat.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/snapchat/overview Snapchat Marketing API and Ads Manager integration for creating and managing ad campaigns, analyzing performance metrics, and accessing business accounts. Use **Snapchat** through Corsair: one client, typed API calls. **What you get:** * 139 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/snapchat ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/snapchat ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/snapchat ``` ```bash bun theme={null} bun add corsair @corsair-dev/snapchat ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { snapchat } from '@corsair-dev/snapchat'; export const corsair = createCorsair({ plugins: [ snapchat(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Snapchat OAuth app. ```ts theme={null} snapchat() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'snapchat', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`actions.getAdAccount`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.snapchat.api.actions.getAdAccount({}); ``` **`actions.addSegmentUsers`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.snapchat.api.actions.addSegmentUsers({}); ``` See the full list on the [API](/plugins/snapchat/api) page. ## What's next > **[API reference](/plugins/snapchat/api)** > > Every `snapchat.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/sourcegraph/api API reference for Sourcegraph: every `sourcegraph.api.*` operation with input and output types. Every `sourcegraph.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Repository ### compareCommits `repository.compareCommits` Compare two commits and list file diffs **Risk:** `read` ```ts theme={null} await corsair.sourcegraph.api.repository.compareCommits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo` | `string` | Yes | — | | `base` | `string` | Yes | — | | `head` | `string` | Yes | — | | `first` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `repository` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > comparison?: { > range?: { > expr?: string > } | null, > fileDiffs?: { > nodes?: { > oldPath?: string | null, > newPath?: string | null, > stat?: { > added?: number, > changed?: number, > deleted?: number > } > }[], > totalCount?: number | null, > pageInfo?: { > hasNextPage?: boolean, > endCursor?: string | null > } > } > } | null > } > ``` *** ### getCommitDetails `repository.getCommitDetails` Get details for a commit, branch, or tag **Risk:** `read` ```ts theme={null} await corsair.sourcegraph.api.repository.getCommitDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo` | `string` | Yes | — | | `rev` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `repository` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > commit?: { > oid: string, > abbreviatedOID?: string, > message?: string, > subject?: string, > body?: string | null, > url?: string, > canonicalURL?: string, > author?: { > date?: string, > person?: { > name?: string | null, > email?: string | null, > displayName?: string | null > } | null > }, > committer?: { > date?: string, > person?: { > name?: string | null, > email?: string | null, > displayName?: string | null > } | null > } | null > } | null > } > ``` *** ### getFileContents `repository.getFileContents` Fetch file contents on the default branch (HEAD) **Risk:** `read` ```ts theme={null} await corsair.sourcegraph.api.repository.getFileContents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_name` | `string` | Yes | — | | `file_path` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `repository` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > name?: string, > defaultBranch?: { > displayName?: string | null > } | null, > commit?: { > oid?: string, > file?: { > name?: string, > path?: string, > content?: string, > binary?: boolean, > byteSize?: number > } | null > } | null > } > ``` *** ### list `repository.list` List repositories on the Sourcegraph instance **Risk:** `read` ```ts theme={null} await corsair.sourcegraph.api.repository.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first` | `number` | Yes | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `repositories` | `object` | Yes | — | > **repositories full type** > > ```ts theme={null} > { > nodes?: { > name: string, > url?: string, > description?: string | null, > language?: string | null > }[], > totalCount?: number | null, > pageInfo?: { > hasNextPage?: boolean, > endCursor?: string | null > } > } > ``` *** ### listFiles `repository.listFiles` List files and directories in a repository path **Risk:** `read` ```ts theme={null} await corsair.sourcegraph.api.repository.listFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repo_name` | `string` | Yes | — | | `path` | `string` | No | — | | `rev` | `string` | No | — | | `recursive` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `repository` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > commit?: { > tree?: { > path?: string, > isRoot?: boolean, > entries?: { > name?: string, > path?: string, > isDirectory?: boolean > }[] > } | null > } | null > } > ``` *** ### listLanguages `repository.listLanguages` List languages used in a repository **Risk:** `read` ```ts theme={null} await corsair.sourcegraph.api.repository.listLanguages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `repoName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `repository` | `object` | No | — | > **repository full type** > > ```ts theme={null} > { > name?: string, > language?: string | null, > commit?: { > languages?: string[], > languageStatistics?: { > name?: string, > totalBytes?: number, > totalLines?: number > }[] > } | null > } > ``` *** ## Site ### checkSettingsEditPermission `site.checkSettingsEditPermission` Check whether the viewer can edit site settings through the GraphQL API **Risk:** `read` ```ts theme={null} await corsair.sourcegraph.api.site.checkSettingsEditPermission({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `site` | `object` | No | — | | `currentUser` | `object` | No | — | | `canEditSiteSettings` | `boolean` | Yes | — | > **site full type** > > ```ts theme={null} > { > id?: string, > siteID?: string, > canReloadSite?: boolean, > viewerCanAdminister?: boolean > } > ``` > **currentUser full type** > > ```ts theme={null} > { > siteAdmin?: boolean, > viewerCanAdminister?: boolean > } > ``` *** ## User ### getCurrent `user.getCurrent` Retrieve the currently authenticated Sourcegraph user **Risk:** `read` ```ts theme={null} await corsair.sourcegraph.api.user.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `currentUser` | `object` | No | — | > **currentUser full type** > > ```ts theme={null} > { > id?: string, > username?: string, > displayName?: string | null, > email?: string | null, > siteAdmin?: boolean, > viewerCanAdminister?: boolean, > avatarURL?: string | null, > url?: string, > createdAt?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/sourcegraph/database Sourcegraph local sync: searchable entities, `.search()` filters, and operators. The Sourcegraph plugin syncs data locally. Use `corsair.sourcegraph.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Commits Path: `sourcegraph.db.commits.search` ```ts theme={null} const rows = await corsair.sourcegraph.db.commits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `oid` | `string` | equals, contains, startsWith, endsWith, in | | `abbreviatedOID` | `string` | equals, contains, startsWith, endsWith, in | | `message` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `sourcegraph.db.files.search` ```ts theme={null} const rows = await corsair.sourcegraph.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `binary` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Repositories Path: `sourcegraph.db.repositories.search` ```ts theme={null} const rows = await corsair.sourcegraph.db.repositories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sites Path: `sourcegraph.db.sites.search` ```ts theme={null} const rows = await corsair.sourcegraph.db.sites.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `siteID` | `string` | equals, contains, startsWith, endsWith, in | | `canReloadSite` | `boolean` | equals | | `viewerCanAdminister` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `sourcegraph.db.users.search` ```ts theme={null} const rows = await corsair.sourcegraph.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `siteAdmin` | `boolean` | equals | | `viewerCanAdminister` | `boolean` | equals | | `avatarURL` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/sourcegraph/overview Code intelligence platform for searching, navigating, and understanding large codebases. Use **Sourcegraph** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 8 typed API operations * 5 synced entities (`commits`, `files`, `repositories`, `sites`, `users`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/sourcegraph ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/sourcegraph ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/sourcegraph ``` ```bash bun theme={null} bun add corsair @corsair-dev/sourcegraph ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { sourcegraph } from '@corsair-dev/sourcegraph'; export const corsair = createCorsair({ plugins: [ sourcegraph(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} sourcegraph() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'sourcegraph', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`repository.compareCommits`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.sourcegraph.api.repository.compareCommits({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/sourcegraph/api) reference.* See the full list on the [API](/plugins/sourcegraph/api) page. ## Query synced data Synced entities support `tenant.sourcegraph.db..search()` and `.list()`: `commits`, `files`, `repositories`, `sites`, `users`. See [Database](/plugins/sourcegraph/database) for filters and operators. ## What's next > **[API reference](/plugins/sourcegraph/api)** > > Every `sourcegraph.api.*` operation with input and output types. > **[Database](/plugins/sourcegraph/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/spoki/api API reference for Spoki integration for Corsair: every `spoki.api.*` operation with input and output types. Every `spoki.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### createOnboardingLink `accounts.createOnboardingLink` Create an account onboarding link **Risk:** `write` ```ts theme={null} await corsair.spoki.api.accounts.createOnboardingLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getAccount `accounts.getAccount` Retrieve a Spoki account **Risk:** `read` ```ts theme={null} await corsair.spoki.api.accounts.getAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `current_credit` | `number` | Yes | — | | `status` | `string` | Yes | — | | `default_language` | `string` | Yes | — | | `phone` | `string` | No | — | | `has_official_verification` | `boolean` | Yes | — | | `daily_limit` | `number` | Yes | — | | `phone_status` | `string` | Yes | — | | `quality_score` | `number` | Yes | — | | `quality_reasons` | `any` | No | — | | `is_active` | `boolean` | Yes | — | | `country_code` | `string` | Yes | — | | `estimated_available_conversations` | `number` | Yes | — | | `account_type` | `number` | Yes | — | | `default_pricing_delta` | `number` | Yes | — | | `low_credit_threshold` | `number` | Yes | — | | `has_low_credit_alert` | `boolean` | Yes | — | | `default_prefix` | `string` | Yes | — | | `default_country_code` | `string` | Yes | — | | `timezone` | `string` | Yes | — | | `contacted_in_24h` | `number` | Yes | — | | `contacted_in_7d` | `number` | Yes | — | | `primary_channel_id` | `number` | No | — | | `channels` | `object[]` | No | — | > **channels full type** > > ```ts theme={null} > { > name: string, > identifier: string, > platform: string, > status: string, > phone_status: string, > quality_score: string, > is_primary: boolean > }[] > ``` *** ### getAccountByPhone `accounts.getAccountByPhone` Retrieve a Spoki account by phone **Risk:** `read` ```ts theme={null} await corsair.spoki.api.accounts.getAccountByPhone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phone` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `current_credit` | `number` | Yes | — | | `status` | `string` | Yes | — | | `default_language` | `string` | Yes | — | | `phone` | `string` | No | — | | `has_official_verification` | `boolean` | Yes | — | | `daily_limit` | `number` | Yes | — | | `phone_status` | `string` | Yes | — | | `quality_score` | `number` | Yes | — | | `quality_reasons` | `any` | No | — | | `is_active` | `boolean` | Yes | — | | `country_code` | `string` | Yes | — | | `estimated_available_conversations` | `number` | Yes | — | | `account_type` | `number` | Yes | — | | `default_pricing_delta` | `number` | Yes | — | | `low_credit_threshold` | `number` | Yes | — | | `has_low_credit_alert` | `boolean` | Yes | — | | `default_prefix` | `string` | Yes | — | | `default_country_code` | `string` | Yes | — | | `timezone` | `string` | Yes | — | | `contacted_in_24h` | `number` | Yes | — | | `contacted_in_7d` | `number` | Yes | — | | `primary_channel_id` | `number` | No | — | | `channels` | `object[]` | No | — | > **channels full type** > > ```ts theme={null} > { > name: string, > identifier: string, > platform: string, > status: string, > phone_status: string, > quality_score: string, > is_primary: boolean > }[] > ``` *** ### getCurrentReport `accounts.getCurrentReport` Get the current account report **Risk:** `read` ```ts theme={null} await corsair.spoki.api.accounts.getCurrentReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### listAccounts `accounts.listAccounts` List Spoki WhatsApp accounts **Risk:** `read` ```ts theme={null} await corsair.spoki.api.accounts.listAccounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > current_credit: number, > status: string, > default_language: string, > phone?: string | null, > has_official_verification: boolean, > daily_limit: number, > phone_status: string, > quality_score: number, > quality_reasons?: any, > is_active: boolean, > country_code: string, > estimated_available_conversations: number, > account_type: number, > default_pricing_delta: number, > low_credit_threshold: number, > has_low_credit_alert: boolean, > default_prefix: string, > default_country_code: string, > timezone: string, > contacted_in_24h: number, > contacted_in_7d: number, > primary_channel_id?: number | null, > channels?: { > name: string, > identifier: string, > platform: string, > status: string, > phone_status: string, > quality_score: string, > is_primary: boolean > }[] > }[] > ``` *** ## Agencies ### list `agencies.list` List agencies **Risk:** `read` ```ts theme={null} await corsair.spoki.api.agencies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ## Automation ### triggerAutomation `automation.triggerAutomation` Trigger a Spoki automation **Risk:** `write` ```ts theme={null} await corsair.spoki.api.automation.triggerAutomation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `secret` | `string` | Yes | — | | `phone` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `language` | `string` | No | — | | `custom_fields` | `object` | No | — | | `metadata` | `object` | No | — | > **custom\_fields full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Automations ### list `automations.list` List automations **Risk:** `read` ```ts theme={null} await corsair.spoki.api.automations.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### retrieve `automations.retrieve` Retrieve an automation **Risk:** `read` ```ts theme={null} await corsair.spoki.api.automations.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Campaigns ### list `campaigns.list` List campaigns **Risk:** `read` ```ts theme={null} await corsair.spoki.api.campaigns.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### update `campaigns.update` Update a campaign **Risk:** `write` ```ts theme={null} await corsair.spoki.api.campaigns.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `scheduled_datetime` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Contacts ### addOperator `contacts.addOperator` Assign an operator to a contact **Risk:** `write` ```ts theme={null} await corsair.spoki.api.contacts.addOperator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `operator_id` | `number` | No | — | | `role_id` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### createOrUpdate `contacts.createOrUpdate` Create or update a contact by phone **Risk:** `write` ```ts theme={null} await corsair.spoki.api.contacts.createOrUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phone` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | | `language` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### delete `contacts.delete` Delete a contact **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.spoki.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > } | any[] > ``` *** ### list `contacts.list` List contacts **Risk:** `read` ```ts theme={null} await corsair.spoki.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### removeOperator `contacts.removeOperator` Remove an operator from a contact **Risk:** `write` ```ts theme={null} await corsair.spoki.api.contacts.removeOperator({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### retrieve `contacts.retrieve` Retrieve a contact **Risk:** `read` ```ts theme={null} await corsair.spoki.api.contacts.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### syncBulk `contacts.syncBulk` Bulk sync contacts **Risk:** `write` ```ts theme={null} await corsair.spoki.api.contacts.syncBulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `any[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### update `contacts.update` Update a contact **Risk:** `write` ```ts theme={null} await corsair.spoki.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Custom Fields ### create `customFields.create` Create a custom field **Risk:** `write` ```ts theme={null} await corsair.spoki.api.customFields.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `label` | `string` | Yes | — | | `code` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### delete `customFields.delete` Delete a custom field **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.spoki.api.customFields.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `customFields.list` List custom fields **Risk:** `read` ```ts theme={null} await corsair.spoki.api.customFields.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### retrieve `customFields.retrieve` Retrieve a custom field **Risk:** `read` ```ts theme={null} await corsair.spoki.api.customFields.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### update `customFields.update` Update a custom field **Risk:** `write` ```ts theme={null} await corsair.spoki.api.customFields.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `label` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Invitations ### resend `invitations.resend` Resend an invitation **Risk:** `write` ```ts theme={null} await corsair.spoki.api.invitations.resend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### updateRole `invitations.updateRole` Update an invitation role **Risk:** `write` ```ts theme={null} await corsair.spoki.api.invitations.updateRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Lists ### create `lists.create` Create a contact list **Risk:** `write` ```ts theme={null} await corsair.spoki.api.lists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### delete `lists.delete` Delete a contact list **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.spoki.api.lists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `lists.list` List contact lists **Risk:** `read` ```ts theme={null} await corsair.spoki.api.lists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### removeAllContacts `lists.removeAllContacts` Remove all contacts from a list **Risk:** `write` ```ts theme={null} await corsair.spoki.api.lists.removeAllContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### removeContacts `lists.removeContacts` Remove contacts from a list **Risk:** `write` ```ts theme={null} await corsair.spoki.api.lists.removeContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `contacts` | `any[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### retrieve `lists.retrieve` Retrieve a contact list **Risk:** `read` ```ts theme={null} await corsair.spoki.api.lists.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### syncContacts `lists.syncContacts` Sync contacts into a list **Risk:** `write` ```ts theme={null} await corsair.spoki.api.lists.syncContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `contacts` | `any[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Media ### create `media.create` Create a media file **Risk:** `write` ```ts theme={null} await corsair.spoki.api.media.create({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### delete `media.delete` Delete a media file **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.spoki.api.media.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `media.list` List media files **Risk:** `read` ```ts theme={null} await corsair.spoki.api.media.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### retrieve `media.retrieve` Retrieve a media file **Risk:** `read` ```ts theme={null} await corsair.spoki.api.media.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### update `media.update` Update a media file **Risk:** `write` ```ts theme={null} await corsair.spoki.api.media.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Messaging ### sendMessage `messaging.sendMessage` Send a WhatsApp message **Risk:** `write` ```ts theme={null} await corsair.spoki.api.messaging.sendMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phone` | `string` | Yes | — | | `text` | `string` | Yes | — | | `channel_id` | `number` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output:** *empty object* *** ## Partners ### list `partners.list` List partners **Risk:** `read` ```ts theme={null} await corsair.spoki.api.partners.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ## Reports ### list `reports.list` List usage reports **Risk:** `read` ```ts theme={null} await corsair.spoki.api.reports.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ## Roles ### addServiceUser `roles.addServiceUser` Add a service user **Risk:** `write` ```ts theme={null} await corsair.spoki.api.roles.addServiceUser({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### checkPrivateKey `roles.checkPrivateKey` Check whether a role has a private key **Risk:** `read` ```ts theme={null} await corsair.spoki.api.roles.checkPrivateKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### delete `roles.delete` Delete a role **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.spoki.api.roles.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### generatePrivateKey `roles.generatePrivateKey` Generate a role private key **Risk:** `write` ```ts theme={null} await corsair.spoki.api.roles.generatePrivateKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `roles.list` List roles **Risk:** `read` ```ts theme={null} await corsair.spoki.api.roles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### retrieve `roles.retrieve` Retrieve a role **Risk:** `read` ```ts theme={null} await corsair.spoki.api.roles.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### update `roles.update` Update a role **Risk:** `write` ```ts theme={null} await corsair.spoki.api.roles.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Tags ### list `tags.list` List tags **Risk:** `read` ```ts theme={null} await corsair.spoki.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### retrieve `tags.retrieve` Retrieve a tag **Risk:** `read` ```ts theme={null} await corsair.spoki.api.tags.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Templates ### clone `templates.clone` Clone a template **Risk:** `write` ```ts theme={null} await corsair.spoki.api.templates.clone({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### create `templates.create` Create a WhatsApp template **Risk:** `write` ```ts theme={null} await corsair.spoki.api.templates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `category` | `string` | Yes | — | | `templatelocalization_set` | `any[]` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### delete `templates.delete` Delete a WhatsApp template **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.spoki.api.templates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `force_delete` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `templates.list` List templates **Risk:** `read` ```ts theme={null} await corsair.spoki.api.templates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** ### retrieve `templates.retrieve` Retrieve a template **Risk:** `read` ```ts theme={null} await corsair.spoki.api.templates.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### revertToDraft `templates.revertToDraft` Revert a template to draft **Risk:** `write` ```ts theme={null} await corsair.spoki.api.templates.revertToDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### update `templates.update` Update a WhatsApp template **Risk:** `write` ```ts theme={null} await corsair.spoki.api.templates.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Tickets ### create `tickets.create` Create a ticket **Risk:** `write` ```ts theme={null} await corsair.spoki.api.tickets.create({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### delete `tickets.delete` Delete a ticket **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.spoki.api.tickets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### list `tickets.list` List tickets **Risk:** `read` ```ts theme={null} await corsair.spoki.api.tickets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `search` | `string` | No | — | | `page` | `number \| string` | No | — | | `limit` | `number \| string` | No | — | | `offset` | `number \| string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/spoki/database Spoki integration for Corsair local sync: searchable entities, `.search()` filters, and operators. The Spoki integration for Corsair plugin syncs data locally. Use `corsair.spoki.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `spoki.db.accounts.search` ```ts theme={null} const rows = await corsair.spoki.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `current_credit` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `default_language` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `has_official_verification` | `boolean` | equals | | `daily_limit` | `number` | equals, gt, gte, lt, lte, in | | `phone_status` | `string` | equals, contains, startsWith, endsWith, in | | `quality_score` | `number` | equals, gt, gte, lt, lte, in | | `is_active` | `boolean` | equals | | `country_code` | `string` | equals, contains, startsWith, endsWith, in | | `estimated_available_conversations` | `number` | equals, gt, gte, lt, lte, in | | `account_type` | `number` | equals, gt, gte, lt, lte, in | | `default_pricing_delta` | `number` | equals, gt, gte, lt, lte, in | | `low_credit_threshold` | `number` | equals, gt, gte, lt, lte, in | | `has_low_credit_alert` | `boolean` | equals | | `default_prefix` | `string` | equals, contains, startsWith, endsWith, in | | `default_country_code` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `contacted_in_24h` | `number` | equals, gt, gte, lt, lte, in | | `contacted_in_7d` | `number` | equals, gt, gte, lt, lte, in | | `primary_channel_id` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Channels Path: `spoki.db.channels.search` ```ts theme={null} const rows = await corsair.spoki.db.channels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `identifier` | `string` | equals, contains, startsWith, endsWith, in | | `platform` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `phone_status` | `string` | equals, contains, startsWith, endsWith, in | | `quality_score` | `string` | equals, contains, startsWith, endsWith, in | | `is_primary` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/spoki/overview Spoki integration for Corsair Use **Spoki integration for Corsair** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 60 typed API operations * 2 synced entities (`accounts`, `channels`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/spoki ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/spoki ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/spoki ``` ```bash bun theme={null} bun add corsair @corsair-dev/spoki ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { spoki } from '@corsair-dev/spoki'; export const corsair = createCorsair({ plugins: [ spoki(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} spoki() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'spoki', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.getAccount`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.spoki.api.accounts.getAccount({}); ``` **`accounts.createOnboardingLink`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.spoki.api.accounts.createOnboardingLink({}); ``` See the full list on the [API](/plugins/spoki/api) page. ## Query synced data Synced entities support `tenant.spoki.db..search()` and `.list()`: `accounts`, `channels`. See [Database](/plugins/spoki/database) for filters and operators. ## What's next > **[API reference](/plugins/spoki/api)** > > Every `spoki.api.*` operation with input and output types. > **[Database](/plugins/spoki/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/spotify/api API reference for Spotify: every `spotify.api.*` operation with input and output types. Every `spotify.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Albums ### get `albums.get` Get info about an album **Risk:** `read` ```ts theme={null} await corsair.spotify.api.albums.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `market` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `album_type` | `string` | Yes | — | | `total_tracks` | `number` | No | — | | `available_markets` | `string[]` | No | — | | `external_urls` | `object` | No | — | | `href` | `string` | No | — | | `images` | `object[]` | No | — | | `release_date` | `string` | No | — | | `release_date_precision` | `string` | No | — | | `artists` | `object[]` | No | — | > **external\_urls full type** > > ```ts theme={null} > { > spotify?: string > } > ``` > **images full type** > > ```ts theme={null} > { > url: string, > height?: number | null, > width?: number | null > }[] > ``` > **artists full type** > > ```ts theme={null} > { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > ``` *** ### getNewReleases `albums.getNewReleases` Get new album releases **Risk:** `read` ```ts theme={null} await corsair.spotify.api.albums.getNewReleases({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `albums` | `object` | Yes | — | > **albums full type** > > ```ts theme={null} > { > href?: string, > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total?: number, > items?: { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }[] > } > ``` *** ### getTracks `albums.getTracks` Get tracks from an album **Risk:** `read` ```ts theme={null} await corsair.spotify.api.albums.getTracks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `market` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `href` | `string` | No | — | | `limit` | `number` | No | — | | `next` | `string` | No | — | | `offset` | `number` | No | — | | `previous` | `string` | No | — | | `total` | `number` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > name: string, > artists?: { > id: string, > name: string > }[], > album?: { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }, > duration_ms?: number, > explicit?: boolean, > external_urls?: { > spotify?: string > }, > href?: string, > is_local?: boolean, > popularity?: number, > preview_url?: string | null, > track_number?: number > }[] > ``` *** ### search `albums.search` Search for albums **Risk:** `read` ```ts theme={null} await corsair.spotify.api.albums.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `type` | `album` | No | — | | `market` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `albums` | `object` | Yes | — | > **albums full type** > > ```ts theme={null} > { > href?: string, > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total?: number, > items?: { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }[] > } > ``` *** ## Artists ### get `artists.get` Get info about an artist **Risk:** `read` ```ts theme={null} await corsair.spotify.api.artists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `external_urls` | `object` | No | — | | `followers` | `object` | No | — | | `genres` | `string[]` | No | — | | `href` | `string` | No | — | | `images` | `object[]` | No | — | | `popularity` | `number` | No | — | > **external\_urls full type** > > ```ts theme={null} > { > spotify?: string > } > ``` > **followers full type** > > ```ts theme={null} > { > total?: number > } > ``` > **images full type** > > ```ts theme={null} > { > url: string, > height?: number | null, > width?: number | null > }[] > ``` *** ### getAlbums `artists.getAlbums` Get albums by an artist **Risk:** `read` ```ts theme={null} await corsair.spotify.api.artists.getAlbums({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `include_groups` | `string` | No | — | | `market` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `href` | `string` | No | — | | `limit` | `number` | No | — | | `next` | `string` | No | — | | `offset` | `number` | No | — | | `previous` | `string` | No | — | | `total` | `number` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }[] > ``` *** ### getRelatedArtists `artists.getRelatedArtists` Get artists related to an artist **Risk:** `read` ```ts theme={null} await corsair.spotify.api.artists.getRelatedArtists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `artists` | `object[]` | No | — | > **artists full type** > > ```ts theme={null} > { > id: string, > name: string, > external_urls?: { > spotify?: string > }, > followers?: { > total?: number > }, > genres?: string[], > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > popularity?: number > }[] > ``` *** ### getTopTracks `artists.getTopTracks` Get top tracks for an artist **Risk:** `read` ```ts theme={null} await corsair.spotify.api.artists.getTopTracks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `market` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tracks` | `object[]` | No | — | > **tracks full type** > > ```ts theme={null} > { > id: string, > name: string, > artists?: { > id: string, > name: string > }[], > album?: { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }, > duration_ms?: number, > explicit?: boolean, > external_urls?: { > spotify?: string > }, > href?: string, > is_local?: boolean, > popularity?: number, > preview_url?: string | null, > track_number?: number > }[] > ``` *** ### search `artists.search` Search for artists **Risk:** `read` ```ts theme={null} await corsair.spotify.api.artists.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `type` | `artist` | No | — | | `market` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `artists` | `object` | Yes | — | > **artists full type** > > ```ts theme={null} > { > href?: string, > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total?: number, > items?: { > id: string, > name: string, > external_urls?: { > spotify?: string > }, > followers?: { > total?: number > }, > genres?: string[], > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > popularity?: number > }[] > } > ``` *** ## Library ### getLikedTracks `library.getLikedTracks` Get the current user's liked tracks **Risk:** `read` ```ts theme={null} await corsair.spotify.api.library.getLikedTracks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `market` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `href` | `string` | No | — | | `limit` | `number` | No | — | | `next` | `string` | No | — | | `offset` | `number` | No | — | | `previous` | `string` | No | — | | `total` | `number` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > added_at?: string, > track?: { > id: string, > name: string, > artists?: { > id: string, > name: string > }[], > album?: { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }, > duration_ms?: number, > explicit?: boolean, > external_urls?: { > spotify?: string > }, > href?: string, > is_local?: boolean, > popularity?: number, > preview_url?: string | null, > track_number?: number > } > }[] > ``` *** ## My Data ### getFollowedArtists `myData.getFollowedArtists` Get artists followed by the current user **Risk:** `read` ```ts theme={null} await corsair.spotify.api.myData.getFollowedArtists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `artist` | No | — | | `limit` | `number` | No | — | | `after` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `artists` | `object` | Yes | — | > **artists full type** > > ```ts theme={null} > { > href?: string, > limit?: number, > next?: string | null, > cursors?: { > after?: string | null > }, > total?: number, > items?: { > id: string, > name: string, > external_urls?: { > spotify?: string > }, > followers?: { > total?: number > }, > genres?: string[], > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > popularity?: number > }[] > } > ``` *** ## Player ### addToQueue `player.addToQueue` Add a track to the playback queue **Risk:** `write` ```ts theme={null} await corsair.spotify.api.player.addToQueue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uri` | `string` | Yes | — | | `device_id` | `string` | No | — | **Output:** *empty object* *** ### getCurrentlyPlaying `player.getCurrentlyPlaying` Get the currently playing track **Risk:** `read` ```ts theme={null} await corsair.spotify.api.player.getCurrentlyPlaying({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `market` | `string` | No | — | | `additional_types` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `timestamp` | `number` | No | — | | `context` | `object` | No | — | | `progress_ms` | `number` | No | — | | `is_playing` | `boolean` | No | — | | `item` | `object` | No | — | | `currently_playing_type` | `string` | No | — | | `actions` | `object` | No | — | > **context full type** > > ```ts theme={null} > { > external_urls?: { > spotify?: string > }, > href?: string, > type?: string, > uri?: string > } > ``` > **item full type** > > ```ts theme={null} > { > id: string, > name: string, > artists?: { > id: string, > name: string > }[], > album?: { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }, > duration_ms?: number, > explicit?: boolean, > external_urls?: { > spotify?: string > }, > href?: string, > is_local?: boolean, > popularity?: number, > preview_url?: string | null, > track_number?: number > } > ``` > **actions full type** > > ```ts theme={null} > { > disallows?: { > resuming?: boolean > } > } > ``` *** ### getRecentlyPlayed `player.getRecentlyPlayed` Get recently played tracks **Risk:** `read` ```ts theme={null} await corsair.spotify.api.player.getRecentlyPlayed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `after` | `number` | No | — | | `before` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `next` | `string` | No | — | | `cursors` | `object` | No | — | | `limit` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > track?: { > id: string, > name: string, > artists?: { > id: string, > name: string > }[], > album?: { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }, > duration_ms?: number, > explicit?: boolean, > external_urls?: { > spotify?: string > }, > href?: string, > is_local?: boolean, > popularity?: number, > preview_url?: string | null, > track_number?: number > }, > played_at?: string, > context?: { > type?: string, > href?: string, > external_urls?: { > spotify?: string > }, > uri?: string > } | null > }[] > ``` > **cursors full type** > > ```ts theme={null} > { > after?: string, > before?: string > } > ``` *** ### pause `player.pause` Pause playback **Risk:** `write` ```ts theme={null} await corsair.spotify.api.player.pause({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `device_id` | `string` | No | — | **Output:** *empty object* *** ### resume `player.resume` Resume playback **Risk:** `write` ```ts theme={null} await corsair.spotify.api.player.resume({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `device_id` | `string` | No | — | **Output:** *empty object* *** ### setVolume `player.setVolume` Set the playback volume **Risk:** `write` ```ts theme={null} await corsair.spotify.api.player.setVolume({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `volume_percent` | `number` | Yes | — | | `device_id` | `string` | No | — | **Output:** *empty object* *** ### skipToNext `player.skipToNext` Skip to the next track **Risk:** `write` ```ts theme={null} await corsair.spotify.api.player.skipToNext({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `device_id` | `string` | No | — | **Output:** *empty object* *** ### skipToPrevious `player.skipToPrevious` Skip to the previous track **Risk:** `write` ```ts theme={null} await corsair.spotify.api.player.skipToPrevious({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `device_id` | `string` | No | — | **Output:** *empty object* *** ### startPlayback `player.startPlayback` Start playback of specified content **Risk:** `write` ```ts theme={null} await corsair.spotify.api.player.startPlayback({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `device_id` | `string` | No | — | | `context_uri` | `string` | No | — | | `uris` | `string[]` | No | — | | `offset` | `object` | No | — | | `position_ms` | `number` | No | — | > **offset full type** > > ```ts theme={null} > { > position?: number, > uri?: string > } > ``` **Output:** *empty object* *** ## Playlists ### addItem `playlists.addItem` Add a track to a playlist **Risk:** `write` ```ts theme={null} await corsair.spotify.api.playlists.addItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `playlist_id` | `string` | Yes | — | | `uris` | `string[]` | Yes | — | | `position` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `snapshot_id` | `string` | No | — | *** ### create `playlists.create` Create a new playlist **Risk:** `write` ```ts theme={null} await corsair.spotify.api.playlists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `public` | `boolean` | No | — | | `collaborative` | `boolean` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `public` | `boolean` | No | — | | `collaborative` | `boolean` | No | — | | `owner` | `object` | No | — | | `followers` | `object` | No | — | | `images` | `object[]` | No | — | | `tracks` | `object` | No | — | | `external_urls` | `object` | No | — | | `href` | `string` | No | — | > **owner full type** > > ```ts theme={null} > { > id: string, > display_name?: string, > external_urls?: { > spotify?: string > } > } > ``` > **followers full type** > > ```ts theme={null} > { > total?: number > } > ``` > **images full type** > > ```ts theme={null} > { > url: string, > height?: number | null, > width?: number | null > }[] > ``` > **tracks full type** > > ```ts theme={null} > { > href?: string, > total?: number > } > ``` > **external\_urls full type** > > ```ts theme={null} > { > spotify?: string > } > ``` *** ### get `playlists.get` Get info about a playlist **Risk:** `read` ```ts theme={null} await corsair.spotify.api.playlists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `playlist_id` | `string` | Yes | — | | `market` | `string` | No | — | | `fields` | `string` | No | — | | `additional_types` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `public` | `boolean` | No | — | | `collaborative` | `boolean` | No | — | | `owner` | `object` | No | — | | `followers` | `object` | No | — | | `images` | `object[]` | No | — | | `tracks` | `object` | No | — | | `external_urls` | `object` | No | — | | `href` | `string` | No | — | > **owner full type** > > ```ts theme={null} > { > id: string, > display_name?: string, > external_urls?: { > spotify?: string > } > } > ``` > **followers full type** > > ```ts theme={null} > { > total?: number > } > ``` > **images full type** > > ```ts theme={null} > { > url: string, > height?: number | null, > width?: number | null > }[] > ``` > **tracks full type** > > ```ts theme={null} > { > href?: string, > total?: number > } > ``` > **external\_urls full type** > > ```ts theme={null} > { > spotify?: string > } > ``` *** ### getTracks `playlists.getTracks` Get tracks in a playlist **Risk:** `read` ```ts theme={null} await corsair.spotify.api.playlists.getTracks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `playlist_id` | `string` | Yes | — | | `market` | `string` | No | — | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `additional_types` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `href` | `string` | No | — | | `limit` | `number` | No | — | | `next` | `string` | No | — | | `offset` | `number` | No | — | | `previous` | `string` | No | — | | `total` | `number` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > added_at?: string, > added_by?: { > id?: string > }, > is_local?: boolean, > track?: { > id: string, > name: string, > artists?: { > id: string, > name: string > }[], > album?: { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }, > duration_ms?: number, > explicit?: boolean, > external_urls?: { > spotify?: string > }, > href?: string, > is_local?: boolean, > popularity?: number, > preview_url?: string | null, > track_number?: number > } > }[] > ``` *** ### getUserPlaylists `playlists.getUserPlaylists` Get the current user's playlists **Risk:** `read` ```ts theme={null} await corsair.spotify.api.playlists.getUserPlaylists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `href` | `string` | No | — | | `limit` | `number` | No | — | | `next` | `string` | No | — | | `offset` | `number` | No | — | | `previous` | `string` | No | — | | `total` | `number` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > public?: boolean, > collaborative?: boolean, > owner?: { > id: string, > display_name?: string, > external_urls?: { > spotify?: string > } > }, > followers?: { > total?: number > }, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > tracks?: { > href?: string, > total?: number > }, > external_urls?: { > spotify?: string > }, > href?: string > } | null[] > ``` *** ### removeItem `playlists.removeItem` Remove a track from a playlist **Risk:** `write` ```ts theme={null} await corsair.spotify.api.playlists.removeItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `playlist_id` | `string` | Yes | — | | `tracks` | `object[]` | Yes | — | | `snapshot_id` | `string` | No | — | > **tracks full type** > > ```ts theme={null} > { > uri: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `snapshot_id` | `string` | No | — | *** ### search `playlists.search` Search for playlists **Risk:** `read` ```ts theme={null} await corsair.spotify.api.playlists.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `type` | `playlist` | No | — | | `market` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `playlists` | `object` | Yes | — | > **playlists full type** > > ```ts theme={null} > { > href?: string, > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total?: number, > items?: { > id: string, > name: string, > description?: string | null, > public?: boolean, > collaborative?: boolean, > owner?: { > id: string, > display_name?: string, > external_urls?: { > spotify?: string > } > }, > followers?: { > total?: number > }, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > tracks?: { > href?: string, > total?: number > }, > external_urls?: { > spotify?: string > }, > href?: string > } | null[] > } > ``` *** ## Tracks ### get `tracks.get` Get info about a track **Risk:** `read` ```ts theme={null} await corsair.spotify.api.tracks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `market` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `artists` | `object[]` | No | — | | `album` | `object` | No | — | | `duration_ms` | `number` | No | — | | `explicit` | `boolean` | No | — | | `external_urls` | `object` | No | — | | `href` | `string` | No | — | | `is_local` | `boolean` | No | — | | `popularity` | `number` | No | — | | `preview_url` | `string` | No | — | | `track_number` | `number` | No | — | > **artists full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` > **album full type** > > ```ts theme={null} > { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > } > ``` > **external\_urls full type** > > ```ts theme={null} > { > spotify?: string > } > ``` *** ### getAudioFeatures `tracks.getAudioFeatures` Get audio features for a track **Risk:** `read` ```ts theme={null} await corsair.spotify.api.tracks.getAudioFeatures({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `danceability` | `number` | No | — | | `energy` | `number` | No | — | | `key` | `number` | No | — | | `loudness` | `number` | No | — | | `mode` | `number` | No | — | | `speechiness` | `number` | No | — | | `acousticness` | `number` | No | — | | `instrumentalness` | `number` | No | — | | `liveness` | `number` | No | — | | `valence` | `number` | No | — | | `tempo` | `number` | No | — | | `duration_ms` | `number` | No | — | | `time_signature` | `number` | No | — | *** ### search `tracks.search` Search for tracks **Risk:** `read` ```ts theme={null} await corsair.spotify.api.tracks.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `type` | `track` | No | — | | `market` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tracks` | `object` | Yes | — | > **tracks full type** > > ```ts theme={null} > { > href?: string, > limit?: number, > next?: string | null, > offset?: number, > previous?: string | null, > total?: number, > items?: { > id: string, > name: string, > artists?: { > id: string, > name: string > }[], > album?: { > id: string, > name: string, > album_type: string, > total_tracks?: number, > available_markets?: string[], > external_urls?: { > spotify?: string > }, > href?: string, > images?: { > url: string, > height?: number | null, > width?: number | null > }[], > release_date?: string, > release_date_precision?: string, > artists?: { > id: string, > name: string, > external_urls?: { > spotify?: string > } > }[] > }, > duration_ms?: number, > explicit?: boolean, > external_urls?: { > spotify?: string > }, > href?: string, > is_local?: boolean, > popularity?: number, > preview_url?: string | null, > track_number?: number > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/spotify/database Spotify local sync: searchable entities, `.search()` filters, and operators. The Spotify plugin syncs data locally. Use `corsair.spotify.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Albums Path: `spotify.db.albums.search` ```ts theme={null} const rows = await corsair.spotify.db.albums.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `album_type` | `string` | equals, contains, startsWith, endsWith, in | | `total_tracks` | `number` | equals, gt, gte, lt, lte, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `release_date` | `string` | equals, contains, startsWith, endsWith, in | | `release_date_precision` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Artists Path: `spotify.db.artists.search` ```ts theme={null} const rows = await corsair.spotify.db.artists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `popularity` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Playlist Items Path: `spotify.db.playlistItems.search` ```ts theme={null} const rows = await corsair.spotify.db.playlistItems.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `playlist_id` | `string` | equals, contains, startsWith, endsWith, in | | `track_id` | `string` | equals, contains, startsWith, endsWith, in | | `added_at` | `string` | equals, contains, startsWith, endsWith, in | | `is_local` | `boolean` | equals | | `position` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Playlists Path: `spotify.db.playlists.search` ```ts theme={null} const rows = await corsair.spotify.db.playlists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `public` | `boolean` | equals | | `collaborative` | `boolean` | equals | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tracks Path: `spotify.db.tracks.search` ```ts theme={null} const rows = await corsair.spotify.db.tracks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `duration_ms` | `number` | equals, gt, gte, lt, lte, in | | `explicit` | `boolean` | equals | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `is_local` | `boolean` | equals | | `popularity` | `number` | equals, gt, gte, lt, lte, in | | `preview_url` | `string` | equals, contains, startsWith, endsWith, in | | `track_number` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `spotify.db.users.search` ```ts theme={null} const rows = await corsair.spotify.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `display_name` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `product` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `uri` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/spotify/get-credentials Step-by-step instructions for Spotify OAuth credentials and optional client credentials for the Corsair Spotify plugin. This guide walks you through obtaining all required credentials for the Spotify plugin. ## Authentication Methods The Spotify plugin supports two authentication methods: * **[`oauth_2`](/concepts/oauth)** (default) — Authorization Code flow with refresh tokens (recommended for user data and playback) * **[`api_key`](/concepts/api-key)** — A single stored string used as a **Bearer** access token for the Spotify Web API (advanced: you supply and refresh the token yourself) The Spotify Web API is OAuth-centric; most users should use [`oauth_2`](/concepts/oauth). ## OAuth 2.0 (Recommended) ### Step 1: Create a Spotify App 1. Open the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard). 2. Log in and click **Create app**. 3. Set the app name, description, and redirect URI placeholder as required. ### Step 2: Configure Redirect URIs 1. Open your app → **Settings**. 2. Under **Redirect URIs**, add the exact callback URL Corsair uses after authorization (must match what you configure in your deployment). 3. Save. ### Step 3: Copy Client ID and Client Secret 1. On the same **Settings** page, copy **Client ID** and **Client Secret**. **Storing credentials and authorizing:** ```bash theme={null} pnpm corsair setup --plugin=spotify client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=spotify ``` Open the printed URL, sign in with Spotify, and approve — Corsair stores access and refresh tokens. The integration requests Spotify scopes such as `user-read-private`, `user-read-email`, `user-read-playback-state`, `user-modify-playback-state`, `user-read-currently-playing`, `user-read-recently-played`, `user-library-read`, `user-library-modify`, `user-follow-read`, `user-follow-modify`, `playlist-read-private`, `playlist-read-collaborative`, `playlist-modify-public`, and `playlist-modify-private`. Remove any scopes you do not need when configuring your own OAuth app, if Spotify’s dashboard allows it. ## API Key (Bearer Access Token) If you set `authType: 'api_key'`, Corsair uses the stored value as the **Bearer** token for API requests. Spotify does not issue long-lived static API keys for the Web API; this mode is for cases where **you** obtain an access token (for example via the Client Credentials flow or a manual token for testing) and store it as `api_key`. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=spotify api_key=your-access-token ``` Remember that Spotify access tokens expire; prefer [`oauth_2`](/concepts/oauth) so Corsair can refresh tokens automatically. ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | Client ID / secret | [`oauth_2`](/concepts/oauth) | Developer Dashboard → app → Settings | | Access token string | [`api_key`](/concepts/api-key) (manual) | Your own token acquisition flow | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/spotify/overview Music streaming platform for playlists, tracks, albums, artists, and listening data APIs. Use **Spotify** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 30 typed API operations * 6 synced entities (`albums`, `artists`, `playlistItems`, `playlists`, `tracks`, `users`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/spotify ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/spotify ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/spotify ``` ```bash bun theme={null} bun add corsair @corsair-dev/spotify ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { spotify } from '@corsair-dev/spotify'; export const corsair = createCorsair({ plugins: [ spotify({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Spotify** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/spotify/get-credentials). ```ts theme={null} spotify({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. Provider walkthrough: [Get Credentials](/plugins/spotify/get-credentials). ```ts theme={null} spotify({ authType: 'api_key', }) ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Spotify OAuth app. Provider walkthrough: [Get Credentials](/plugins/spotify/get-credentials). ```ts theme={null} spotify() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'spotify', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`albums.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.spotify.api.albums.get({}); ``` **`player.addToQueue`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.spotify.api.player.addToQueue({}); ``` See the full list on the [API](/plugins/spotify/api) page. ## Query synced data Synced entities support `tenant.spotify.db..search()` and `.list()`: `albums`, `artists`, `playlistItems`, `playlists`, `tracks`, `users`. See [Database](/plugins/spotify/database) for filters and operators. ## What's next > **[API reference](/plugins/spotify/api)** > > Every `spotify.api.*` operation with input and output types. > **[Database](/plugins/spotify/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/spotify/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/starton/api API reference for Starton: every `starton.api.*` operation with input and output types. Every `starton.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Ipfs ### uploadFile `ipfs.uploadFile` Upload a file to the project's IPFS storage and pin it **Risk:** `write` ```ts theme={null} await corsair.starton.api.ipfs.uploadFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | File contents, base64-encoded (standard alphabet, padded). | | `filename` | `string` | Yes | File name stored on the pin, e.g. `metadata.json`. | | `contentType` | `string` | No | MIME type of the file. Defaults to application/octet-stream. | | `metadata` | `object` | No | Arbitrary JSON stored alongside the pin. | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `cid` | `string` | No | — | | `origins` | `string[]` | No | — | | `metadata` | `object` | No | — | | `status` | `queued \| pinning \| pinned \| failed \| deleted` | Yes | — | | `delegates` | `string[]` | No | — | | `size` | `number` | No | — | | `type` | `directory \| file` | No | — | | `directoryContent` | `object[]` | No | — | | `projectId` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **directoryContent full type** > > ```ts theme={null} > { > }[] > ``` *** ## Smart Contract ### call `smartContract.call` Execute a state-changing function on a deployed smart contract **Risk:** `write` ```ts theme={null} await corsair.starton.api.smartContract.call({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `string` | Yes | Network of the smart contract, e.g. `polygon-mumbai`. List via GET /v3/network. | | `address` | `string` | Yes | Address of the deployed smart contract. | | `functionName` | `string` | Yes | Name of the contract function to execute. Must be state-changing; use smartContract.read for view functions. | | `params` | `object[]` | Yes | Function arguments, in the order the ABI declares them. | | `signerWallet` | `string` | Yes | Address of the KMS wallet that signs and pays for the transaction. | | `speed` | `low \| average \| fast \| fastest \| custom` | No | Gas speed. Defaults to `average`; use `custom` to supply customGas. | | `customGas` | `object` | No | Custom gas settings. Only used when speed is set to `custom`. | | `gasLimit` | `string` | No | Optional gas limit. | | `nonce` | `number` | No | Manual nonce. If set, the Starton relayer will not assign one automatically. | | `value` | `string` | No | Native-currency value sent with the call, in wei. | | `simulate` | `boolean` | No | Simulate only: estimates gas and does NOT broadcast a transaction. | > **params full type** > > ```ts theme={null} > ( > string | number | boolean | { > } > )[] > ``` > **customGas full type** > > ```ts theme={null} > { > gasPrice?: string, > maxFeePerGas?: string, > maxPriorityFeePerGas?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `blockHash` | `string` | No | — | | `blockNumber` | `number` | No | — | | `chainId` | `number` | Yes | — | | `network` | `string` | Yes | — | | `data` | `string` | No | — | | `from` | `string` | Yes | — | | `gasLimit` | `string` | No | — | | `gasPrice` | `string` | No | — | | `maxFeePerGas` | `string` | No | — | | `maxPriorityFeePerGas` | `string` | No | — | | `metadata` | `object` | No | — | | `nonce` | `number` | No | — | | `type` | `number` | No | — | | `signerWallet` | `string` | Yes | — | | `publishedDate` | `string` | No | — | | `minedDate` | `string` | No | — | | `signedTransaction` | `string` | No | — | | `status` | `UNSIGNED \| ERROR_TX \| ERROR_PUBLISH \| PUBLISHED \| RECEIVED_BY_STARTON \| CREATED_BY_STARTON \| COULD_NOT_ESTIMATE_GAS_PRICE \| COULD_NOT_INCREASE_GAS_PRICE \| GAS_PRICE_ESTIMATED \| INVALID_GAS_PRICE \| REPLACEMENT_GAS_PRICE_UNDERPRICED \| COULD_NOT_ESTIMATE_GAS_LIMIT \| GAS_LIMIT_ESTIMATED \| EXECUTION_WILL_FAIL \| INVALID_ARGUMENT \| INSUFFICIENT_FUNDS \| INSUFFICIENT_FUNDS_AFTER_BROADCAST \| COULD_NOT_ASSIGN_NONCE \| COULD_NOT_UNSTUCK_NONCE \| NONCE_ASSIGNED \| NONCE_EXPIRED \| COULD_NOT_SIGN \| SIGNED \| SENT_TO_MEMPOOL \| COULD_NOT_BROADCAST \| ALREADY_KNOWN \| MINED \| CONFIRMED \| REPLACED \| FAILED \| MONITORING_IN_PROGRESS \| STUCK_BY_PREVIOUS_TRANSACTION \| MAX_GAS_PRICE_REACH \| GAS_PRICE_INCREASED \| NEW_TRANSACTION_HASH \| UNKNOWN \| MONITORING_INTERRUPTED` | Yes | — | | `state` | `SUCCESS \| PENDING \| MANUAL_ACTION_REQUIRED \| ERROR` | Yes | — | | `speed` | `low \| average \| fast \| fastest \| custom` | No | — | | `logs` | `object[]` | Yes | — | | `to` | `string` | No | — | | `transactionHash` | `string` | No | — | | `value` | `string` | Yes | — | | `automaticNonce` | `boolean` | Yes | — | | `isDeployTransaction` | `boolean` | Yes | — | | `projectId` | `string` | Yes | — | | `parentTransaction` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **logs full type** > > ```ts theme={null} > { > message: string, > type: UNSIGNED | ERROR_TX | ERROR_PUBLISH | PUBLISHED | RECEIVED_BY_STARTON | CREATED_BY_STARTON | COULD_NOT_ESTIMATE_GAS_PRICE | COULD_NOT_INCREASE_GAS_PRICE | GAS_PRICE_ESTIMATED | INVALID_GAS_PRICE | REPLACEMENT_GAS_PRICE_UNDERPRICED | COULD_NOT_ESTIMATE_GAS_LIMIT | GAS_LIMIT_ESTIMATED | EXECUTION_WILL_FAIL | INVALID_ARGUMENT | INSUFFICIENT_FUNDS | INSUFFICIENT_FUNDS_AFTER_BROADCAST | COULD_NOT_ASSIGN_NONCE | COULD_NOT_UNSTUCK_NONCE | NONCE_ASSIGNED | NONCE_EXPIRED | COULD_NOT_SIGN | SIGNED | SENT_TO_MEMPOOL | COULD_NOT_BROADCAST | ALREADY_KNOWN | MINED | CONFIRMED | REPLACED | FAILED | MONITORING_IN_PROGRESS | STUCK_BY_PREVIOUS_TRANSACTION | MAX_GAS_PRICE_REACH | GAS_PRICE_INCREASED | NEW_TRANSACTION_HASH | UNKNOWN | MONITORING_INTERRUPTED, > context?: { > }, > createdAt: string > }[] > ``` *** ### deployFromTemplate `smartContract.deployFromTemplate` Deploy a smart contract from a Starton-audited template (e.g. ERC20, ERC721) **Risk:** `write` ```ts theme={null} await corsair.starton.api.smartContract.deployFromTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `string` | Yes | Network of the smart contract, e.g. `polygon-mumbai`. List via GET /v3/network. | | `signerWallet` | `string` | Yes | Address of the KMS wallet that signs and pays for the transaction. | | `templateId` | `string` | Yes | Starton Library template to deploy, e.g. `ERC20_META_TRANSACTION`. List via GET /v3/smart-contract-template. | | `name` | `string` | Yes | Contract name on Starton (off-chain). Max 255 characters. | | `params` | `object[]` | Yes | Smart contract constructor parameters, in the order the template declares them. | | `description` | `string` | No | Contract description on Starton (off-chain). | | `gasLimit` | `string` | No | Optional gas limit. | | `speed` | `low \| average \| fast \| fastest \| custom` | No | Gas speed. Defaults to `average`; use `custom` to supply customGas. | | `customGas` | `object` | No | Custom gas settings. Only used when speed is set to `custom`. | | `nonce` | `number` | No | Manual nonce. If set, the Starton relayer will not assign one automatically. | | `value` | `string` | No | Native-currency value sent with the deployment, in wei. For payable constructors. | | `metadata` | `object` | No | Arbitrary JSON stored alongside the contract. | | `uiData` | `object` | No | Dashboard display metadata Starton stores with the contract. | | `simulate` | `boolean` | No | Simulate only: estimates gas and does NOT broadcast a transaction. | > **params full type** > > ```ts theme={null} > ( > string | number | boolean | { > } > )[] > ``` > **customGas full type** > > ```ts theme={null} > { > gasPrice?: string, > maxFeePerGas?: string, > maxPriorityFeePerGas?: string > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **uiData full type** > > ```ts theme={null} > { > version: 1, > deployMethod: web3 | kms, > imported: boolean, > deployType?: string, > chainId?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `smartContract` | `object` | Yes | — | | `transaction` | `object` | Yes | — | > **smartContract full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > network: string, > abi?: { > }[], > address: string, > params?: string[] | null, > compilationDetails?: { > } | null, > creationHash?: string | null, > status: UNSIGNED | ERROR_TX | ERROR_PUBLISH | PUBLISHED | RECEIVED_BY_STARTON | CREATED_BY_STARTON | COULD_NOT_ESTIMATE_GAS_PRICE | COULD_NOT_INCREASE_GAS_PRICE | GAS_PRICE_ESTIMATED | INVALID_GAS_PRICE | REPLACEMENT_GAS_PRICE_UNDERPRICED | COULD_NOT_ESTIMATE_GAS_LIMIT | GAS_LIMIT_ESTIMATED | EXECUTION_WILL_FAIL | INVALID_ARGUMENT | INSUFFICIENT_FUNDS | INSUFFICIENT_FUNDS_AFTER_BROADCAST | COULD_NOT_ASSIGN_NONCE | COULD_NOT_UNSTUCK_NONCE | NONCE_ASSIGNED | NONCE_EXPIRED | COULD_NOT_SIGN | SIGNED | SENT_TO_MEMPOOL | COULD_NOT_BROADCAST | ALREADY_KNOWN | MINED | CONFIRMED | REPLACED | FAILED | MONITORING_IN_PROGRESS | STUCK_BY_PREVIOUS_TRANSACTION | MAX_GAS_PRICE_REACH | GAS_PRICE_INCREASED | NEW_TRANSACTION_HASH | UNKNOWN | MONITORING_INTERRUPTED, > state: SUCCESS | PENDING | MANUAL_ACTION_REQUIRED | ERROR, > minedDate?: string | null, > blockNumber?: number | null, > templateId?: string | null, > projectId: string, > metadata?: { > } | null, > uiData?: { > version: 1, > deployMethod: web3 | kms, > imported: boolean, > deployType?: string, > chainId?: number > } | null, > createdAt: string, > updatedAt: string > } > ``` > **transaction full type** > > ```ts theme={null} > { > id: string, > blockHash?: string | null, > blockNumber?: number | null, > chainId: number, > network: string, > data?: string | null, > from: string, > gasLimit?: string | null, > gasPrice?: string | null, > maxFeePerGas?: string | null, > maxPriorityFeePerGas?: string | null, > metadata?: { > } | null, > nonce?: number | null, > type?: number | null, > signerWallet: string, > publishedDate?: string | null, > minedDate?: string | null, > signedTransaction?: string | null, > status: UNSIGNED | ERROR_TX | ERROR_PUBLISH | PUBLISHED | RECEIVED_BY_STARTON | CREATED_BY_STARTON | COULD_NOT_ESTIMATE_GAS_PRICE | COULD_NOT_INCREASE_GAS_PRICE | GAS_PRICE_ESTIMATED | INVALID_GAS_PRICE | REPLACEMENT_GAS_PRICE_UNDERPRICED | COULD_NOT_ESTIMATE_GAS_LIMIT | GAS_LIMIT_ESTIMATED | EXECUTION_WILL_FAIL | INVALID_ARGUMENT | INSUFFICIENT_FUNDS | INSUFFICIENT_FUNDS_AFTER_BROADCAST | COULD_NOT_ASSIGN_NONCE | COULD_NOT_UNSTUCK_NONCE | NONCE_ASSIGNED | NONCE_EXPIRED | COULD_NOT_SIGN | SIGNED | SENT_TO_MEMPOOL | COULD_NOT_BROADCAST | ALREADY_KNOWN | MINED | CONFIRMED | REPLACED | FAILED | MONITORING_IN_PROGRESS | STUCK_BY_PREVIOUS_TRANSACTION | MAX_GAS_PRICE_REACH | GAS_PRICE_INCREASED | NEW_TRANSACTION_HASH | UNKNOWN | MONITORING_INTERRUPTED, > state: SUCCESS | PENDING | MANUAL_ACTION_REQUIRED | ERROR, > speed?: low | average | fast | fastest | custom | null, > logs: { > message: string, > type: UNSIGNED | ERROR_TX | ERROR_PUBLISH | PUBLISHED | RECEIVED_BY_STARTON | CREATED_BY_STARTON | COULD_NOT_ESTIMATE_GAS_PRICE | COULD_NOT_INCREASE_GAS_PRICE | GAS_PRICE_ESTIMATED | INVALID_GAS_PRICE | REPLACEMENT_GAS_PRICE_UNDERPRICED | COULD_NOT_ESTIMATE_GAS_LIMIT | GAS_LIMIT_ESTIMATED | EXECUTION_WILL_FAIL | INVALID_ARGUMENT | INSUFFICIENT_FUNDS | INSUFFICIENT_FUNDS_AFTER_BROADCAST | COULD_NOT_ASSIGN_NONCE | COULD_NOT_UNSTUCK_NONCE | NONCE_ASSIGNED | NONCE_EXPIRED | COULD_NOT_SIGN | SIGNED | SENT_TO_MEMPOOL | COULD_NOT_BROADCAST | ALREADY_KNOWN | MINED | CONFIRMED | REPLACED | FAILED | MONITORING_IN_PROGRESS | STUCK_BY_PREVIOUS_TRANSACTION | MAX_GAS_PRICE_REACH | GAS_PRICE_INCREASED | NEW_TRANSACTION_HASH | UNKNOWN | MONITORING_INTERRUPTED, > context?: { > }, > createdAt: string > }[], > to?: string | null, > transactionHash?: string | null, > value: string, > automaticNonce: boolean, > isDeployTransaction: boolean, > projectId: string, > parentTransaction?: string | null, > createdAt: string, > updatedAt: string > } > ``` *** ### list `smartContract.list` List the smart contracts in the project (paginated) **Risk:** `read` ```ts theme={null} await corsair.starton.api.smartContract.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Number of returned page. By default the returned page is the first. | | `limit` | `number` | No | Number of entities returned on each page. Defaults to 100, maximum 2500. | | `network` | `string` | No | Filter by network, e.g. `polygon-amoy`. | | `address` | `string` | No | Filter by contract address. | | `includeAbi` | `boolean` | No | Include each contract ABI in the response. | | `includeCompilationDetails` | `boolean` | No | Include each contract compilation details in the response. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `meta` | `object` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > network: string, > abi?: { > }[], > address: string, > params?: string[] | null, > compilationDetails?: { > } | null, > creationHash?: string | null, > status: UNSIGNED | ERROR_TX | ERROR_PUBLISH | PUBLISHED | RECEIVED_BY_STARTON | CREATED_BY_STARTON | COULD_NOT_ESTIMATE_GAS_PRICE | COULD_NOT_INCREASE_GAS_PRICE | GAS_PRICE_ESTIMATED | INVALID_GAS_PRICE | REPLACEMENT_GAS_PRICE_UNDERPRICED | COULD_NOT_ESTIMATE_GAS_LIMIT | GAS_LIMIT_ESTIMATED | EXECUTION_WILL_FAIL | INVALID_ARGUMENT | INSUFFICIENT_FUNDS | INSUFFICIENT_FUNDS_AFTER_BROADCAST | COULD_NOT_ASSIGN_NONCE | COULD_NOT_UNSTUCK_NONCE | NONCE_ASSIGNED | NONCE_EXPIRED | COULD_NOT_SIGN | SIGNED | SENT_TO_MEMPOOL | COULD_NOT_BROADCAST | ALREADY_KNOWN | MINED | CONFIRMED | REPLACED | FAILED | MONITORING_IN_PROGRESS | STUCK_BY_PREVIOUS_TRANSACTION | MAX_GAS_PRICE_REACH | GAS_PRICE_INCREASED | NEW_TRANSACTION_HASH | UNKNOWN | MONITORING_INTERRUPTED, > state: SUCCESS | PENDING | MANUAL_ACTION_REQUIRED | ERROR, > minedDate?: string | null, > blockNumber?: number | null, > templateId?: string | null, > projectId: string, > metadata?: { > } | null, > uiData?: { > version: 1, > deployMethod: web3 | kms, > imported: boolean, > deployType?: string, > chainId?: number > } | null, > createdAt: string, > updatedAt: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > itemCount: number, > totalItems?: number, > itemsPerPage: number, > totalPages?: number, > currentPage: number > } > ``` *** ### read `smartContract.read` Call a read-only function on a deployed smart contract without broadcasting a transaction **Risk:** `read` ```ts theme={null} await corsair.starton.api.smartContract.read({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `network` | `string` | Yes | Network of the smart contract, e.g. `polygon-mumbai`. List via GET /v3/network. | | `address` | `string` | Yes | Address of the deployed smart contract. | | `functionName` | `string` | Yes | Name of the read-only (view) contract function to call. | | `params` | `object[]` | Yes | Function arguments, in the order the ABI declares them. | > **params full type** > > ```ts theme={null} > ( > string | number | boolean | { > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `response` | `object[]` | Yes | — | | `params` | `object[]` | Yes | — | | `functionName` | `string` | Yes | — | | `address` | `string` | Yes | — | | `network` | `string` | Yes | — | > **response full type** > > ```ts theme={null} > string | number | boolean | { > } | any[] > ``` > **params full type** > > ```ts theme={null} > ( > string | number | boolean | { > } > )[] > ``` *** ## Template ### list `template.list` List the Starton Library smart contract templates **Risk:** `read` ```ts theme={null} await corsair.starton.api.template.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Number of returned page. By default the returned page is the first. | | `limit` | `number` | No | Number of entities returned on each page. Defaults to 100, maximum 2500. | | `isAudited` | `boolean` | No | Only return templates audited by Starton. | | `isActivated` | `boolean` | No | Only return activated (deployable) templates. | | `name` | `string` | No | Filter by template name. Letters, digits, -, \_ and spaces only. | | `blockchain` | `string` | No | Filter by supported blockchain, e.g. `ethereum`. | | `category` | `NFT \| FUNGIBLE \| OTHER \| DEPRECATED \| SALE \| TOOL` | No | Filter by template category. | | `includeCompilationDetails` | `boolean` | No | Include each template compilation details. | | `includeForm` | `boolean` | No | Include each template deployment form definition. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `meta` | `object` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > name: string, > description: string, > shortDescription: string, > githubUrl: string, > blockchains: string[], > tags: string[], > category: NFT | FUNGIBLE | OTHER | DEPRECATED | SALE | TOOL, > humanReadableAbi: string[], > abi: { > }[], > form?: { > } | null, > compilationDetails?: { > } | null, > isAudited: boolean, > isActivated: boolean, > order: number, > createdAt: string, > updatedAt: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > itemCount: number, > totalItems?: number, > itemsPerPage: number, > totalPages?: number, > currentPage: number > } > ``` *** ## Transaction ### get `transaction.get` Retrieve a blockchain transaction by its Starton id **Risk:** `read` ```ts theme={null} await corsair.starton.api.transaction.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Starton transaction id, as returned by smartContract.call or smartContract.deployFromTemplate. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `blockHash` | `string` | No | — | | `blockNumber` | `number` | No | — | | `chainId` | `number` | Yes | — | | `network` | `string` | Yes | — | | `data` | `string` | No | — | | `from` | `string` | Yes | — | | `gasLimit` | `string` | No | — | | `gasPrice` | `string` | No | — | | `maxFeePerGas` | `string` | No | — | | `maxPriorityFeePerGas` | `string` | No | — | | `metadata` | `object` | No | — | | `nonce` | `number` | No | — | | `type` | `number` | No | — | | `signerWallet` | `string` | Yes | — | | `publishedDate` | `string` | No | — | | `minedDate` | `string` | No | — | | `signedTransaction` | `string` | No | — | | `status` | `UNSIGNED \| ERROR_TX \| ERROR_PUBLISH \| PUBLISHED \| RECEIVED_BY_STARTON \| CREATED_BY_STARTON \| COULD_NOT_ESTIMATE_GAS_PRICE \| COULD_NOT_INCREASE_GAS_PRICE \| GAS_PRICE_ESTIMATED \| INVALID_GAS_PRICE \| REPLACEMENT_GAS_PRICE_UNDERPRICED \| COULD_NOT_ESTIMATE_GAS_LIMIT \| GAS_LIMIT_ESTIMATED \| EXECUTION_WILL_FAIL \| INVALID_ARGUMENT \| INSUFFICIENT_FUNDS \| INSUFFICIENT_FUNDS_AFTER_BROADCAST \| COULD_NOT_ASSIGN_NONCE \| COULD_NOT_UNSTUCK_NONCE \| NONCE_ASSIGNED \| NONCE_EXPIRED \| COULD_NOT_SIGN \| SIGNED \| SENT_TO_MEMPOOL \| COULD_NOT_BROADCAST \| ALREADY_KNOWN \| MINED \| CONFIRMED \| REPLACED \| FAILED \| MONITORING_IN_PROGRESS \| STUCK_BY_PREVIOUS_TRANSACTION \| MAX_GAS_PRICE_REACH \| GAS_PRICE_INCREASED \| NEW_TRANSACTION_HASH \| UNKNOWN \| MONITORING_INTERRUPTED` | Yes | — | | `state` | `SUCCESS \| PENDING \| MANUAL_ACTION_REQUIRED \| ERROR` | Yes | — | | `speed` | `low \| average \| fast \| fastest \| custom` | No | — | | `logs` | `object[]` | Yes | — | | `to` | `string` | No | — | | `transactionHash` | `string` | No | — | | `value` | `string` | Yes | — | | `automaticNonce` | `boolean` | Yes | — | | `isDeployTransaction` | `boolean` | Yes | — | | `projectId` | `string` | Yes | — | | `parentTransaction` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **logs full type** > > ```ts theme={null} > { > message: string, > type: UNSIGNED | ERROR_TX | ERROR_PUBLISH | PUBLISHED | RECEIVED_BY_STARTON | CREATED_BY_STARTON | COULD_NOT_ESTIMATE_GAS_PRICE | COULD_NOT_INCREASE_GAS_PRICE | GAS_PRICE_ESTIMATED | INVALID_GAS_PRICE | REPLACEMENT_GAS_PRICE_UNDERPRICED | COULD_NOT_ESTIMATE_GAS_LIMIT | GAS_LIMIT_ESTIMATED | EXECUTION_WILL_FAIL | INVALID_ARGUMENT | INSUFFICIENT_FUNDS | INSUFFICIENT_FUNDS_AFTER_BROADCAST | COULD_NOT_ASSIGN_NONCE | COULD_NOT_UNSTUCK_NONCE | NONCE_ASSIGNED | NONCE_EXPIRED | COULD_NOT_SIGN | SIGNED | SENT_TO_MEMPOOL | COULD_NOT_BROADCAST | ALREADY_KNOWN | MINED | CONFIRMED | REPLACED | FAILED | MONITORING_IN_PROGRESS | STUCK_BY_PREVIOUS_TRANSACTION | MAX_GAS_PRICE_REACH | GAS_PRICE_INCREASED | NEW_TRANSACTION_HASH | UNKNOWN | MONITORING_INTERRUPTED, > context?: { > }, > createdAt: string > }[] > ``` *** ## Wallet ### create `wallet.create` Create a new KMS-managed blockchain wallet for the project **Risk:** `write` ```ts theme={null} await corsair.starton.api.wallet.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `kmsId` | `string` | Yes | Id of the Key Management System the wallet key is stored under. Required. List available KMS via GET /v3/kms. | | `name` | `string` | No | Wallet name on Starton (off-chain). | | `description` | `string` | No | Wallet description on Starton (off-chain). | | `metadata` | `object` | No | Arbitrary JSON stored alongside the wallet. | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `address` | `string` | Yes | — | | `providerKeyId` | `string` | Yes | — | | `kmsId` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `metadata` | `object` | No | — | | `projectId` | `string` | Yes | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `wallet.list` List the KMS-managed wallets for the project (paginated) **Risk:** `read` ```ts theme={null} await corsair.starton.api.wallet.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Number of returned page. By default the returned page is the first. | | `limit` | `number` | No | Number of entities returned on each page. Defaults to 100, maximum 2500. | | `name` | `string` | No | Filter by wallet name. Letters, digits, -, \_ and spaces only. | | `kmsId` | `string` | No | Filter by Key Management System id. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `meta` | `object` | Yes | — | > **items full type** > > ```ts theme={null} > { > address: string, > providerKeyId: string, > kmsId: string, > name?: string | null, > description?: string | null, > metadata?: { > } | null, > projectId: string, > createdAt: string, > updatedAt: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > itemCount: number, > totalItems?: number, > itemsPerPage: number, > totalPages?: number, > currentPage: number > } > ``` *** ## Watcher ### delete `watcher.delete` Delete a blockchain event watcher by its id **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.starton.api.watcher.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Starton watcher id. | **Output:** `number` *** ### get `watcher.get` Retrieve a blockchain event watcher by its id **Risk:** `read` ```ts theme={null} await corsair.starton.api.watcher.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Starton watcher id. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `address` | `string` | Yes | — | | `network` | `string` | Yes | — | | `projectId` | `string` | Yes | — | | `type` | `MINED_TRANSACTION \| ADDRESS_ACTIVITY \| ADDRESS_RECEIVED_NATIVE_CURRENCY \| ADDRESS_SENT_NATIVE_CURRENCY \| EVENT_TRANSFER \| ERC721_EVENT_TRANSFER \| ERC1155_EVENT_TRANSFER_SINGLE \| ERC1155_EVENT_TRANSFER_BATCH \| EVENT_MINT \| EVENT_APPROVAL \| EVENT_CUSTOM` | Yes | — | | `customEventAbi` | `object[]` | No | — | | `triggerType` | `BLOCK \| TRANSACTION \| EVENT \| GAS_PRICE` | Yes | — | | `webhookUrl` | `string` | Yes | — | | `confirmationsBlocks` | `number` | Yes | — | | `paused` | `boolean` | Yes | — | | `pausedReason` | `string` | No | — | | `metadata` | `object` | No | — | | `customFilters` | `object` | No | — | | `createdAt` | `string` | Yes | — | | `updatedAt` | `string` | Yes | — | > **customEventAbi full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **customFilters full type** > > ```ts theme={null} > { > } > ``` *** ## Webhook ### list `webhook.list` List the webhook deliveries sent by watchers (paginated) **Risk:** `read` ```ts theme={null} await corsair.starton.api.webhook.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | Number of returned page. By default the returned page is the first. | | `limit` | `number` | No | Number of entities returned on each page. Defaults to 100, maximum 2500. | | `status` | `RETRYING \| SUCCESSFUL \| FAILED \| CANCELED` | No | Filter by delivery status. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `meta` | `object` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > refId: string, > status: RETRYING | SUCCESSFUL | FAILED | CANCELED, > payload?: { > } | null, > url: string, > headers?: { > } | null, > attempts: { > }[], > projectId: string, > createdAt: string, > updatedAt: string > }[] > ``` > **meta full type** > > ```ts theme={null} > { > itemCount: number, > totalItems?: number, > itemsPerPage: number, > totalPages?: number, > currentPage: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/starton/database Starton local sync: searchable entities, `.search()` filters, and operators. The Starton plugin syncs data locally. Use `corsair.starton.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Pins Path: `starton.db.pins.search` ```ts theme={null} const rows = await corsair.starton.db.pins.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `cid` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Smart Contracts Path: `starton.db.smartContracts.search` ```ts theme={null} const rows = await corsair.starton.db.smartContracts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `creationHash` | `string` | equals, contains, startsWith, endsWith, in | | `minedDate` | `string` | equals, contains, startsWith, endsWith, in | | `blockNumber` | `number` | equals, gt, gte, lt, lte, in | | `templateId` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `starton.db.templates.search` ```ts theme={null} const rows = await corsair.starton.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `shortDescription` | `string` | equals, contains, startsWith, endsWith, in | | `githubUrl` | `string` | equals, contains, startsWith, endsWith, in | | `isAudited` | `boolean` | equals | | `isActivated` | `boolean` | equals | | `order` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transactions Path: `starton.db.transactions.search` ```ts theme={null} const rows = await corsair.starton.db.transactions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `blockHash` | `string` | equals, contains, startsWith, endsWith, in | | `blockNumber` | `number` | equals, gt, gte, lt, lte, in | | `chainId` | `number` | equals, gt, gte, lt, lte, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `data` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `gasLimit` | `string` | equals, contains, startsWith, endsWith, in | | `gasPrice` | `string` | equals, contains, startsWith, endsWith, in | | `maxFeePerGas` | `string` | equals, contains, startsWith, endsWith, in | | `maxPriorityFeePerGas` | `string` | equals, contains, startsWith, endsWith, in | | `nonce` | `number` | equals, gt, gte, lt, lte, in | | `type` | `number` | equals, gt, gte, lt, lte, in | | `signerWallet` | `string` | equals, contains, startsWith, endsWith, in | | `publishedDate` | `string` | equals, contains, startsWith, endsWith, in | | `minedDate` | `string` | equals, contains, startsWith, endsWith, in | | `signedTransaction` | `string` | equals, contains, startsWith, endsWith, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | | `transactionHash` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `string` | equals, contains, startsWith, endsWith, in | | `automaticNonce` | `boolean` | equals | | `isDeployTransaction` | `boolean` | equals | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `parentTransaction` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Wallets Path: `starton.db.wallets.search` ```ts theme={null} const rows = await corsair.starton.db.wallets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `providerKeyId` | `string` | equals, contains, startsWith, endsWith, in | | `kmsId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Watchers Path: `starton.db.watchers.search` ```ts theme={null} const rows = await corsair.starton.db.watchers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `network` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `webhookUrl` | `string` | equals, contains, startsWith, endsWith, in | | `confirmationsBlocks` | `number` | equals, gt, gte, lt, lte, in | | `paused` | `boolean` | equals | | `pausedReason` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `starton.db.webhooks.search` ```ts theme={null} const rows = await corsair.starton.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `refId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/starton/overview Web3 backend for deploying and calling smart contracts, managing wallets, watching blockchain events, and pinning files to IPFS. Use **Starton** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 12 typed API operations * 7 synced entities (`pins`, `smartContracts`, `templates`, `transactions`, `wallets`, `watchers`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/starton ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/starton ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/starton ``` ```bash bun theme={null} bun add corsair @corsair-dev/starton ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { starton } from '@corsair-dev/starton'; export const corsair = createCorsair({ plugins: [ starton(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} starton() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'starton', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List smart contracts** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.starton.api.smartContract.list({}); ``` **Upload a file to IPFS** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.starton.api.ipfs.uploadFile({ content: 'aGVsbG8gd29ybGQ=', filename: 'hello.txt', contentType: 'text/plain' }); ``` See the full list on the [API](/plugins/starton/api) page. ## Query synced data Synced entities support `tenant.starton.db..search()` and `.list()`: `pins`, `smartContracts`, `templates`, `transactions`, `wallets`, `watchers`, `webhooks`. See [Database](/plugins/starton/database) for filters and operators. ## What's next > **[API reference](/plugins/starton/api)** > > Every `starton.api.*` operation with input and output types. > **[Database](/plugins/starton/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/strava/api API reference for Strava: every `strava.api.*` operation with input and output types. Every `strava.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Activities ### create `activities.create` Create a manual activity **Risk:** `write` ```ts theme={null} await corsair.strava.api.activities.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `sport_type` | `string` | Yes | — | | `start_date_local` | `string` | Yes | — | | `elapsed_time` | `number` | Yes | — | | `type` | `string` | No | — | | `commute` | `number` | No | — | | `trainer` | `number` | No | — | | `distance` | `number` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `sport_type` | `string` | No | — | | `start_date` | `string` | No | — | | `start_date_local` | `string` | No | — | | `elapsed_time` | `number` | No | — | | `moving_time` | `number` | No | — | | `distance` | `number` | No | — | | `total_elevation_gain` | `number` | No | — | | `timezone` | `string` | No | — | | `description` | `string` | No | — | | `calories` | `number` | No | — | | `map` | `object` | No | — | | `athlete` | `object` | No | — | | `gear_id` | `string` | No | — | | `commute` | `boolean` | No | — | | `trainer` | `boolean` | No | — | | `manual` | `boolean` | No | — | | `private` | `boolean` | No | — | | `resource_state` | `number` | No | — | | `kudos_count` | `number` | No | — | | `comment_count` | `number` | No | — | | `athlete_count` | `number` | No | — | | `photo_count` | `number` | No | — | | `average_speed` | `number` | No | — | | `max_speed` | `number` | No | — | | `average_heartrate` | `number` | No | — | | `max_heartrate` | `number` | No | — | | `average_watts` | `number` | No | — | | `max_watts` | `number` | No | — | | `kilojoules` | `number` | No | — | | `device_watts` | `boolean` | No | — | | `has_heartrate` | `boolean` | No | — | | `elev_high` | `number` | No | — | | `elev_low` | `number` | No | — | | `pr_count` | `number` | No | — | | `suffer_score` | `number` | No | — | | `workout_type` | `number` | No | — | | `start_latlng` | `number[]` | No | — | | `end_latlng` | `number[]` | No | — | | `upload_id` | `number` | No | — | | `external_id` | `string` | No | — | | `has_kudoed` | `boolean` | No | — | | `average_cadence` | `number` | No | — | | `device_name` | `string` | No | — | > **map full type** > > ```ts theme={null} > { > id?: string, > polyline?: string | null, > summary_polyline?: string | null > } > ``` > **athlete full type** > > ```ts theme={null} > { > id: number > } > ``` *** ### get `activities.get` Get details of an activity by ID **Risk:** `read` ```ts theme={null} await corsair.strava.api.activities.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `include_all_efforts` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `sport_type` | `string` | No | — | | `start_date` | `string` | No | — | | `start_date_local` | `string` | No | — | | `elapsed_time` | `number` | No | — | | `moving_time` | `number` | No | — | | `distance` | `number` | No | — | | `total_elevation_gain` | `number` | No | — | | `timezone` | `string` | No | — | | `description` | `string` | No | — | | `calories` | `number` | No | — | | `map` | `object` | No | — | | `athlete` | `object` | No | — | | `gear_id` | `string` | No | — | | `commute` | `boolean` | No | — | | `trainer` | `boolean` | No | — | | `manual` | `boolean` | No | — | | `private` | `boolean` | No | — | | `resource_state` | `number` | No | — | | `kudos_count` | `number` | No | — | | `comment_count` | `number` | No | — | | `athlete_count` | `number` | No | — | | `photo_count` | `number` | No | — | | `average_speed` | `number` | No | — | | `max_speed` | `number` | No | — | | `average_heartrate` | `number` | No | — | | `max_heartrate` | `number` | No | — | | `average_watts` | `number` | No | — | | `max_watts` | `number` | No | — | | `kilojoules` | `number` | No | — | | `device_watts` | `boolean` | No | — | | `has_heartrate` | `boolean` | No | — | | `elev_high` | `number` | No | — | | `elev_low` | `number` | No | — | | `pr_count` | `number` | No | — | | `suffer_score` | `number` | No | — | | `workout_type` | `number` | No | — | | `start_latlng` | `number[]` | No | — | | `end_latlng` | `number[]` | No | — | | `upload_id` | `number` | No | — | | `external_id` | `string` | No | — | | `has_kudoed` | `boolean` | No | — | | `average_cadence` | `number` | No | — | | `device_name` | `string` | No | — | > **map full type** > > ```ts theme={null} > { > id?: string, > polyline?: string | null, > summary_polyline?: string | null > } > ``` > **athlete full type** > > ```ts theme={null} > { > id: number > } > ``` *** ### getStreams `activities.getStreams` Get stream data for an activity **Risk:** `read` ```ts theme={null} await corsair.strava.api.activities.getStreams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `keys` | `time \| distance \| latlng \| altitude \| velocity_smooth \| heartrate \| cadence \| watts \| temp \| moving \| grade_smooth[]` | Yes | — | | `key_by_type` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `time` | `object` | No | — | | `distance` | `object` | No | — | | `latlng` | `object` | No | — | | `altitude` | `object` | No | — | | `velocity_smooth` | `object` | No | — | | `heartrate` | `object` | No | — | | `cadence` | `object` | No | — | | `watts` | `object` | No | — | | `temp` | `object` | No | — | | `moving` | `object` | No | — | | `grade_smooth` | `object` | No | — | > **time full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **distance full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **latlng full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **altitude full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **velocity\_smooth full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **heartrate full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **cadence full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **watts full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **temp full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **moving full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **grade\_smooth full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` *** ### getZones `activities.getZones` Get heart rate and power zones for an activity **Risk:** `read` ```ts theme={null} await corsair.strava.api.activities.getZones({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > type?: string, > score?: number, > distribution_buckets?: { > min?: number, > max?: number, > time?: number > }[], > resource_state?: number, > sensor_based?: boolean, > points?: number, > custom_zones?: boolean > }[] > ``` *** ### list `activities.list` List the authenticated athlete's activities **Risk:** `read` ```ts theme={null} await corsair.strava.api.activities.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `before` | `number` | No | — | | `after` | `number` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string, > sport_type?: string, > start_date?: string, > start_date_local?: string, > elapsed_time?: number, > moving_time?: number, > distance?: number, > total_elevation_gain?: number, > timezone?: string, > description?: string | null, > calories?: number, > map?: { > id?: string, > polyline?: string | null, > summary_polyline?: string | null > }, > athlete?: { > id: number > }, > gear_id?: string | null, > commute?: boolean, > trainer?: boolean, > manual?: boolean, > private?: boolean, > resource_state?: number, > kudos_count?: number, > comment_count?: number, > athlete_count?: number, > photo_count?: number, > average_speed?: number, > max_speed?: number, > average_heartrate?: number, > max_heartrate?: number, > average_watts?: number, > max_watts?: number, > kilojoules?: number, > device_watts?: boolean, > has_heartrate?: boolean, > elev_high?: number, > elev_low?: number, > pr_count?: number, > suffer_score?: number | null, > workout_type?: number | null, > start_latlng?: number[], > end_latlng?: number[], > upload_id?: number | null, > external_id?: string | null, > has_kudoed?: boolean, > average_cadence?: number, > device_name?: string > }[] > ``` *** ### listComments `activities.listComments` List comments on an activity **Risk:** `read` ```ts theme={null} await corsair.strava.api.activities.listComments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: number, > activity_id?: number, > text?: string, > athlete?: { > id: number, > username?: string | null, > firstname?: string, > lastname?: string, > city?: string | null, > state?: string | null, > country?: string | null, > sex?: string | null, > premium?: boolean, > summit?: boolean, > created_at?: string, > updated_at?: string, > follower_count?: number, > friend_count?: number, > measurement_preference?: string, > ftp?: number | null, > weight?: number | null, > profile?: string, > profile_medium?: string, > resource_state?: number, > bikes?: { > id: string, > primary?: boolean, > name?: string, > nickname?: string, > distance?: number, > converted_distance?: number, > resource_state?: number, > retired?: boolean > }[], > shoes?: { > id: string, > primary?: boolean, > name?: string, > nickname?: string, > distance?: number, > converted_distance?: number, > resource_state?: number, > retired?: boolean > }[] > }, > created_at?: string > }[] > ``` *** ### listKudoers `activities.listKudoers` List athletes who kudoed an activity **Risk:** `read` ```ts theme={null} await corsair.strava.api.activities.listKudoers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: number, > username?: string | null, > firstname?: string, > lastname?: string, > profile_medium?: string, > profile?: string, > resource_state?: number > }[] > ``` *** ### listLaps `activities.listLaps` List laps of an activity **Risk:** `read` ```ts theme={null} await corsair.strava.api.activities.listLaps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > activity?: { > id?: number > }, > athlete?: { > id?: number > }, > average_cadence?: number, > average_speed?: number, > average_heartrate?: number, > average_watts?: number, > device_watts?: boolean, > distance?: number, > elapsed_time?: number, > end_index?: number, > lap_index?: number, > max_speed?: number, > max_heartrate?: number, > moving_time?: number, > name?: string, > pace_zone?: number, > resource_state?: number, > split?: number, > start_date?: string, > start_date_local?: string, > start_index?: number, > total_elevation_gain?: number > }[] > ``` *** ## Athletes ### get `athletes.get` Get the authenticated athlete profile **Risk:** `read` ```ts theme={null} await corsair.strava.api.athletes.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `username` | `string` | No | — | | `firstname` | `string` | No | — | | `lastname` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `sex` | `string` | No | — | | `premium` | `boolean` | No | — | | `summit` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `follower_count` | `number` | No | — | | `friend_count` | `number` | No | — | | `measurement_preference` | `string` | No | — | | `ftp` | `number` | No | — | | `weight` | `number` | No | — | | `profile` | `string` | No | — | | `profile_medium` | `string` | No | — | | `resource_state` | `number` | No | — | | `bikes` | `object[]` | No | — | | `shoes` | `object[]` | No | — | > **bikes full type** > > ```ts theme={null} > { > id: string, > primary?: boolean, > name?: string, > nickname?: string, > distance?: number, > converted_distance?: number, > resource_state?: number, > retired?: boolean > }[] > ``` > **shoes full type** > > ```ts theme={null} > { > id: string, > primary?: boolean, > name?: string, > nickname?: string, > distance?: number, > converted_distance?: number, > resource_state?: number, > retired?: boolean > }[] > ``` *** ### getStats `athletes.getStats` Get an athlete's activity statistics **Risk:** `read` ```ts theme={null} await corsair.strava.api.athletes.getStats({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `biggest_ride_distance` | `number` | No | — | | `biggest_climb_elevation_gain` | `number` | No | — | | `recent_ride_totals` | `object` | No | — | | `recent_run_totals` | `object` | No | — | | `recent_swim_totals` | `object` | No | — | | `ytd_ride_totals` | `object` | No | — | | `ytd_run_totals` | `object` | No | — | | `ytd_swim_totals` | `object` | No | — | | `all_ride_totals` | `object` | No | — | | `all_run_totals` | `object` | No | — | | `all_swim_totals` | `object` | No | — | > **recent\_ride\_totals full type** > > ```ts theme={null} > { > count?: number, > distance?: number, > moving_time?: number, > elapsed_time?: number, > elevation_gain?: number, > achievement_count?: number > } > ``` > **recent\_run\_totals full type** > > ```ts theme={null} > { > count?: number, > distance?: number, > moving_time?: number, > elapsed_time?: number, > elevation_gain?: number, > achievement_count?: number > } > ``` > **recent\_swim\_totals full type** > > ```ts theme={null} > { > count?: number, > distance?: number, > moving_time?: number, > elapsed_time?: number, > elevation_gain?: number, > achievement_count?: number > } > ``` > **ytd\_ride\_totals full type** > > ```ts theme={null} > { > count?: number, > distance?: number, > moving_time?: number, > elapsed_time?: number, > elevation_gain?: number, > achievement_count?: number > } > ``` > **ytd\_run\_totals full type** > > ```ts theme={null} > { > count?: number, > distance?: number, > moving_time?: number, > elapsed_time?: number, > elevation_gain?: number, > achievement_count?: number > } > ``` > **ytd\_swim\_totals full type** > > ```ts theme={null} > { > count?: number, > distance?: number, > moving_time?: number, > elapsed_time?: number, > elevation_gain?: number, > achievement_count?: number > } > ``` > **all\_ride\_totals full type** > > ```ts theme={null} > { > count?: number, > distance?: number, > moving_time?: number, > elapsed_time?: number, > elevation_gain?: number, > achievement_count?: number > } > ``` > **all\_run\_totals full type** > > ```ts theme={null} > { > count?: number, > distance?: number, > moving_time?: number, > elapsed_time?: number, > elevation_gain?: number, > achievement_count?: number > } > ``` > **all\_swim\_totals full type** > > ```ts theme={null} > { > count?: number, > distance?: number, > moving_time?: number, > elapsed_time?: number, > elevation_gain?: number, > achievement_count?: number > } > ``` *** ### getZones `athletes.getZones` Get the authenticated athlete's heart rate and power zones **Risk:** `read` ```ts theme={null} await corsair.strava.api.athletes.getZones({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `heart_rate` | `object` | No | — | | `power` | `object` | No | — | > **heart\_rate full type** > > ```ts theme={null} > { > custom_zones?: boolean, > zones?: { > min?: number, > max?: number > }[] > } > ``` > **power full type** > > ```ts theme={null} > { > zones?: { > min?: number, > max?: number > }[] > } > ``` *** ### update `athletes.update` Update the authenticated athlete's profile **Risk:** `write` ```ts theme={null} await corsair.strava.api.athletes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `weight` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `username` | `string` | No | — | | `firstname` | `string` | No | — | | `lastname` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `sex` | `string` | No | — | | `premium` | `boolean` | No | — | | `summit` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `follower_count` | `number` | No | — | | `friend_count` | `number` | No | — | | `measurement_preference` | `string` | No | — | | `ftp` | `number` | No | — | | `weight` | `number` | No | — | | `profile` | `string` | No | — | | `profile_medium` | `string` | No | — | | `resource_state` | `number` | No | — | | `bikes` | `object[]` | No | — | | `shoes` | `object[]` | No | — | > **bikes full type** > > ```ts theme={null} > { > id: string, > primary?: boolean, > name?: string, > nickname?: string, > distance?: number, > converted_distance?: number, > resource_state?: number, > retired?: boolean > }[] > ``` > **shoes full type** > > ```ts theme={null} > { > id: string, > primary?: boolean, > name?: string, > nickname?: string, > distance?: number, > converted_distance?: number, > resource_state?: number, > retired?: boolean > }[] > ``` *** ## Clubs ### get `clubs.get` Get details of a club by ID **Risk:** `read` ```ts theme={null} await corsair.strava.api.clubs.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `profile` | `string` | No | — | | `profile_medium` | `string` | No | — | | `description` | `string` | No | — | | `club_type` | `string` | No | — | | `sport_type` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `private` | `boolean` | No | — | | `member_count` | `number` | No | — | | `featured` | `boolean` | No | — | | `verified` | `boolean` | No | — | | `url` | `string` | No | — | *** ## Gear ### get `gear.get` Get details of a gear item by ID **Risk:** `read` ```ts theme={null} await corsair.strava.api.gear.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `primary` | `boolean` | No | — | | `name` | `string` | No | — | | `distance` | `number` | No | — | | `brand_name` | `string` | No | — | | `model_name` | `string` | No | — | | `frame_type` | `number` | No | — | | `description` | `string` | No | — | | `athlete_id` | `number` | No | — | | `resource_state` | `number` | No | — | | `retired` | `boolean` | No | — | | `converted_distance` | `number` | No | — | | `notification_distance` | `number` | No | — | *** ## Routes ### exportGpx `routes.exportGpx` Export a route as GPX **Risk:** `read` ```ts theme={null} await corsair.strava.api.routes.exportGpx({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `string` *** ### exportTcx `routes.exportTcx` Export a route as TCX **Risk:** `read` ```ts theme={null} await corsair.strava.api.routes.exportTcx({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output:** `string` *** ### get `routes.get` Get details of a route by ID **Risk:** `read` ```ts theme={null} await corsair.strava.api.routes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `athlete` | `object` | No | — | | `description` | `string` | No | — | | `distance` | `number` | No | — | | `elevation_gain` | `number` | No | — | | `map` | `object` | No | — | | `name` | `string` | No | — | | `private` | `boolean` | No | — | | `starred` | `boolean` | No | — | | `timestamp` | `number` | No | — | | `type` | `number` | No | — | | `sub_type` | `number` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `estimated_moving_time` | `number` | No | — | | `segments` | `any[]` | No | — | > **athlete full type** > > ```ts theme={null} > { > id?: number > } > ``` > **map full type** > > ```ts theme={null} > { > id?: string, > polyline?: string | null > } > ``` *** ### getStreams `routes.getStreams` Get stream data for a route **Risk:** `read` ```ts theme={null} await corsair.strava.api.routes.getStreams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `time` | `object` | No | — | | `distance` | `object` | No | — | | `latlng` | `object` | No | — | | `altitude` | `object` | No | — | | `velocity_smooth` | `object` | No | — | | `heartrate` | `object` | No | — | | `cadence` | `object` | No | — | | `watts` | `object` | No | — | | `temp` | `object` | No | — | | `moving` | `object` | No | — | | `grade_smooth` | `object` | No | — | > **time full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **distance full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **latlng full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **altitude full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **velocity\_smooth full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **heartrate full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **cadence full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **watts full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **temp full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **moving full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **grade\_smooth full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` *** ## Segment Efforts ### get `segmentEfforts.get` Get details of a segment effort by ID **Risk:** `read` ```ts theme={null} await corsair.strava.api.segmentEfforts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `activity_id` | `number` | No | — | | `athlete_id` | `number` | No | — | | `segment` | `object` | No | — | | `name` | `string` | No | — | | `elapsed_time` | `number` | No | — | | `moving_time` | `number` | No | — | | `start_date` | `string` | No | — | | `start_date_local` | `string` | No | — | | `distance` | `number` | No | — | | `start_index` | `number` | No | — | | `end_index` | `number` | No | — | | `kom_rank` | `number` | No | — | | `pr_rank` | `number` | No | — | | `achievements` | `any[]` | No | — | | `device_watts` | `boolean` | No | — | | `average_watts` | `number` | No | — | | `average_heartrate` | `number` | No | — | | `max_heartrate` | `number` | No | — | | `average_cadence` | `number` | No | — | | `resource_state` | `number` | No | — | > **segment full type** > > ```ts theme={null} > { > id?: number > } > ``` *** ### getStreams `segmentEfforts.getStreams` Get stream data for a segment effort **Risk:** `read` ```ts theme={null} await corsair.strava.api.segmentEfforts.getStreams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `keys` | `time \| distance \| latlng \| altitude \| velocity_smooth \| heartrate \| cadence \| watts \| temp \| moving \| grade_smooth[]` | Yes | — | | `key_by_type` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `time` | `object` | No | — | | `distance` | `object` | No | — | | `latlng` | `object` | No | — | | `altitude` | `object` | No | — | | `velocity_smooth` | `object` | No | — | | `heartrate` | `object` | No | — | | `cadence` | `object` | No | — | | `watts` | `object` | No | — | | `temp` | `object` | No | — | | `moving` | `object` | No | — | | `grade_smooth` | `object` | No | — | > **time full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **distance full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **latlng full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **altitude full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **velocity\_smooth full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **heartrate full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **cadence full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **watts full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **temp full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **moving full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **grade\_smooth full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` *** ## Segments ### explore `segments.explore` Find popular segments within a bounding box **Risk:** `read` ```ts theme={null} await corsair.strava.api.segments.explore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `bounds` | `string` | Yes | — | | `activity_type` | `running \| riding` | No | — | | `min_cat` | `number` | No | — | | `max_cat` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `segments` | `object[]` | No | — | > **segments full type** > > ```ts theme={null} > { > id?: number, > name?: string, > climb_category?: number, > climb_category_desc?: string, > avg_grade?: number, > start_latlng?: number[], > end_latlng?: number[], > elev_difference?: number, > distance?: number, > points?: string, > starred?: boolean, > resource_state?: number, > starred_date?: string | null > }[] > ``` *** ### get `segments.get` Get details of a segment by ID **Risk:** `read` ```ts theme={null} await corsair.strava.api.segments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `activity_type` | `string` | No | — | | `distance` | `number` | No | — | | `average_grade` | `number` | No | — | | `maximum_grade` | `number` | No | — | | `elevation_high` | `number` | No | — | | `elevation_low` | `number` | No | — | | `start_latlng` | `number[]` | No | — | | `end_latlng` | `number[]` | No | — | | `climb_category` | `number` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `private` | `boolean` | No | — | | `starred` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `total_elevation_gain` | `number` | No | — | | `map` | `object` | No | — | | `effort_count` | `number` | No | — | | `athlete_count` | `number` | No | — | | `hazardous` | `boolean` | No | — | | `star_count` | `number` | No | — | > **map full type** > > ```ts theme={null} > { > id?: string, > polyline?: string | null > } > ``` *** ### getStreams `segments.getStreams` Get stream data for a segment **Risk:** `read` ```ts theme={null} await corsair.strava.api.segments.getStreams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `keys` | `time \| distance \| latlng \| altitude \| velocity_smooth \| heartrate \| cadence \| watts \| temp \| moving \| grade_smooth[]` | Yes | — | | `key_by_type` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `time` | `object` | No | — | | `distance` | `object` | No | — | | `latlng` | `object` | No | — | | `altitude` | `object` | No | — | | `velocity_smooth` | `object` | No | — | | `heartrate` | `object` | No | — | | `cadence` | `object` | No | — | | `watts` | `object` | No | — | | `temp` | `object` | No | — | | `moving` | `object` | No | — | | `grade_smooth` | `object` | No | — | > **time full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **distance full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **latlng full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **altitude full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **velocity\_smooth full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **heartrate full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **cadence full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **watts full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **temp full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **moving full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` > **grade\_smooth full type** > > ```ts theme={null} > { > type?: string, > data?: any[], > series_type?: string, > original_size?: number, > resolution?: string > } > ``` *** ### list `segments.list` List the authenticated athlete's starred segments **Risk:** `read` ```ts theme={null} await corsair.strava.api.segments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name?: string, > activity_type?: string, > distance?: number, > average_grade?: number, > maximum_grade?: number, > elevation_high?: number, > elevation_low?: number, > start_latlng?: number[], > end_latlng?: number[], > climb_category?: number, > city?: string | null, > state?: string | null, > country?: string | null, > private?: boolean, > starred?: boolean, > created_at?: string, > updated_at?: string, > total_elevation_gain?: number, > map?: { > id?: string, > polyline?: string | null > }, > effort_count?: number, > athlete_count?: number, > hazardous?: boolean, > star_count?: number > }[] > ``` *** ### star `segments.star` Star or unstar a segment **Risk:** `write` ```ts theme={null} await corsair.strava.api.segments.star({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `starred` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `activity_type` | `string` | No | — | | `distance` | `number` | No | — | | `average_grade` | `number` | No | — | | `maximum_grade` | `number` | No | — | | `elevation_high` | `number` | No | — | | `elevation_low` | `number` | No | — | | `start_latlng` | `number[]` | No | — | | `end_latlng` | `number[]` | No | — | | `climb_category` | `number` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `country` | `string` | No | — | | `private` | `boolean` | No | — | | `starred` | `boolean` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `total_elevation_gain` | `number` | No | — | | `map` | `object` | No | — | | `effort_count` | `number` | No | — | | `athlete_count` | `number` | No | — | | `hazardous` | `boolean` | No | — | | `star_count` | `number` | No | — | > **map full type** > > ```ts theme={null} > { > id?: string, > polyline?: string | null > } > ``` *** ## Uploads ### create `uploads.create` Upload an activity file (FIT, TCX, GPX) **Risk:** `write` ```ts theme={null} await corsair.strava.api.uploads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `custom` | Yes | — | | `data_type` | `fit \| fit.gz \| tcx \| tcx.gz \| gpx \| gpx.gz` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `trainer` | `string` | No | — | | `commute` | `string` | No | — | | `external_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `external_id` | `string` | No | — | | `error` | `string` | No | — | | `status` | `string` | No | — | | `activity_id` | `number` | No | — | *** ### get `uploads.get` Get the status of an upload by ID **Risk:** `read` ```ts theme={null} await corsair.strava.api.uploads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `external_id` | `string` | No | — | | `error` | `string` | No | — | | `status` | `string` | No | — | | `activity_id` | `number` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/strava/database Strava local sync: searchable entities, `.search()` filters, and operators. The Strava plugin syncs data locally. Use `corsair.strava.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Activities Path: `strava.db.activities.search` ```ts theme={null} const rows = await corsair.strava.db.activities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `sport_type` | `string` | equals, contains, startsWith, endsWith, in | | `start_date` | `string` | equals, contains, startsWith, endsWith, in | | `start_date_local` | `string` | equals, contains, startsWith, endsWith, in | | `elapsed_time` | `number` | equals, gt, gte, lt, lte, in | | `moving_time` | `number` | equals, gt, gte, lt, lte, in | | `distance` | `number` | equals, gt, gte, lt, lte, in | | `total_elevation_gain` | `number` | equals, gt, gte, lt, lte, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `calories` | `number` | equals, gt, gte, lt, lte, in | | `gear_id` | `string` | equals, contains, startsWith, endsWith, in | | `commute` | `boolean` | equals | | `trainer` | `boolean` | equals | | `manual` | `boolean` | equals | | `private` | `boolean` | equals | | `resource_state` | `number` | equals, gt, gte, lt, lte, in | | `kudos_count` | `number` | equals, gt, gte, lt, lte, in | | `comment_count` | `number` | equals, gt, gte, lt, lte, in | | `athlete_count` | `number` | equals, gt, gte, lt, lte, in | | `photo_count` | `number` | equals, gt, gte, lt, lte, in | | `average_speed` | `number` | equals, gt, gte, lt, lte, in | | `max_speed` | `number` | equals, gt, gte, lt, lte, in | | `average_heartrate` | `number` | equals, gt, gte, lt, lte, in | | `max_heartrate` | `number` | equals, gt, gte, lt, lte, in | | `average_watts` | `number` | equals, gt, gte, lt, lte, in | | `max_watts` | `number` | equals, gt, gte, lt, lte, in | | `kilojoules` | `number` | equals, gt, gte, lt, lte, in | | `device_watts` | `boolean` | equals | | `has_heartrate` | `boolean` | equals | | `elev_high` | `number` | equals, gt, gte, lt, lte, in | | `elev_low` | `number` | equals, gt, gte, lt, lte, in | | `pr_count` | `number` | equals, gt, gte, lt, lte, in | | `suffer_score` | `number` | equals, gt, gte, lt, lte, in | | `workout_type` | `number` | equals, gt, gte, lt, lte, in | | `upload_id` | `number` | equals, gt, gte, lt, lte, in | | `external_id` | `string` | equals, contains, startsWith, endsWith, in | | `has_kudoed` | `boolean` | equals | | `average_cadence` | `number` | equals, gt, gte, lt, lte, in | | `device_name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Athletes Path: `strava.db.athletes.search` ```ts theme={null} const rows = await corsair.strava.db.athletes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `firstname` | `string` | equals, contains, startsWith, endsWith, in | | `lastname` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `sex` | `string` | equals, contains, startsWith, endsWith, in | | `premium` | `boolean` | equals | | `summit` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `follower_count` | `number` | equals, gt, gte, lt, lte, in | | `friend_count` | `number` | equals, gt, gte, lt, lte, in | | `measurement_preference` | `string` | equals, contains, startsWith, endsWith, in | | `ftp` | `number` | equals, gt, gte, lt, lte, in | | `weight` | `number` | equals, gt, gte, lt, lte, in | | `profile` | `string` | equals, contains, startsWith, endsWith, in | | `profile_medium` | `string` | equals, contains, startsWith, endsWith, in | | `resource_state` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Clubs Path: `strava.db.clubs.search` ```ts theme={null} const rows = await corsair.strava.db.clubs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `profile` | `string` | equals, contains, startsWith, endsWith, in | | `profile_medium` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `club_type` | `string` | equals, contains, startsWith, endsWith, in | | `sport_type` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `member_count` | `number` | equals, gt, gte, lt, lte, in | | `featured` | `boolean` | equals | | `verified` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Gears Path: `strava.db.gears.search` ```ts theme={null} const rows = await corsair.strava.db.gears.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `primary` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `distance` | `number` | equals, gt, gte, lt, lte, in | | `brand_name` | `string` | equals, contains, startsWith, endsWith, in | | `model_name` | `string` | equals, contains, startsWith, endsWith, in | | `frame_type` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `athlete_id` | `number` | equals, gt, gte, lt, lte, in | | `resource_state` | `number` | equals, gt, gte, lt, lte, in | | `retired` | `boolean` | equals | | `converted_distance` | `number` | equals, gt, gte, lt, lte, in | | `notification_distance` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Laps Path: `strava.db.laps.search` ```ts theme={null} const rows = await corsair.strava.db.laps.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `average_cadence` | `number` | equals, gt, gte, lt, lte, in | | `average_speed` | `number` | equals, gt, gte, lt, lte, in | | `average_heartrate` | `number` | equals, gt, gte, lt, lte, in | | `average_watts` | `number` | equals, gt, gte, lt, lte, in | | `device_watts` | `boolean` | equals | | `distance` | `number` | equals, gt, gte, lt, lte, in | | `elapsed_time` | `number` | equals, gt, gte, lt, lte, in | | `end_index` | `number` | equals, gt, gte, lt, lte, in | | `lap_index` | `number` | equals, gt, gte, lt, lte, in | | `max_speed` | `number` | equals, gt, gte, lt, lte, in | | `max_heartrate` | `number` | equals, gt, gte, lt, lte, in | | `moving_time` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `pace_zone` | `number` | equals, gt, gte, lt, lte, in | | `resource_state` | `number` | equals, gt, gte, lt, lte, in | | `split` | `number` | equals, gt, gte, lt, lte, in | | `start_date` | `string` | equals, contains, startsWith, endsWith, in | | `start_date_local` | `string` | equals, contains, startsWith, endsWith, in | | `start_index` | `number` | equals, gt, gte, lt, lte, in | | `total_elevation_gain` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Routes Path: `strava.db.routes.search` ```ts theme={null} const rows = await corsair.strava.db.routes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `distance` | `number` | equals, gt, gte, lt, lte, in | | `elevation_gain` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `starred` | `boolean` | equals | | `timestamp` | `number` | equals, gt, gte, lt, lte, in | | `type` | `number` | equals, gt, gte, lt, lte, in | | `sub_type` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `estimated_moving_time` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Segment Efforts Path: `strava.db.segmentEfforts.search` ```ts theme={null} const rows = await corsair.strava.db.segmentEfforts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `activity_id` | `number` | equals, gt, gte, lt, lte, in | | `athlete_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `elapsed_time` | `number` | equals, gt, gte, lt, lte, in | | `moving_time` | `number` | equals, gt, gte, lt, lte, in | | `start_date` | `string` | equals, contains, startsWith, endsWith, in | | `start_date_local` | `string` | equals, contains, startsWith, endsWith, in | | `distance` | `number` | equals, gt, gte, lt, lte, in | | `start_index` | `number` | equals, gt, gte, lt, lte, in | | `end_index` | `number` | equals, gt, gte, lt, lte, in | | `kom_rank` | `number` | equals, gt, gte, lt, lte, in | | `pr_rank` | `number` | equals, gt, gte, lt, lte, in | | `device_watts` | `boolean` | equals | | `average_watts` | `number` | equals, gt, gte, lt, lte, in | | `average_heartrate` | `number` | equals, gt, gte, lt, lte, in | | `max_heartrate` | `number` | equals, gt, gte, lt, lte, in | | `average_cadence` | `number` | equals, gt, gte, lt, lte, in | | `resource_state` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Segments Path: `strava.db.segments.search` ```ts theme={null} const rows = await corsair.strava.db.segments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `activity_type` | `string` | equals, contains, startsWith, endsWith, in | | `distance` | `number` | equals, gt, gte, lt, lte, in | | `average_grade` | `number` | equals, gt, gte, lt, lte, in | | `maximum_grade` | `number` | equals, gt, gte, lt, lte, in | | `elevation_high` | `number` | equals, gt, gte, lt, lte, in | | `elevation_low` | `number` | equals, gt, gte, lt, lte, in | | `climb_category` | `number` | equals, gt, gte, lt, lte, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `private` | `boolean` | equals | | `starred` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `total_elevation_gain` | `number` | equals, gt, gte, lt, lte, in | | `effort_count` | `number` | equals, gt, gte, lt, lte, in | | `athlete_count` | `number` | equals, gt, gte, lt, lte, in | | `hazardous` | `boolean` | equals | | `star_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Uploads Path: `strava.db.uploads.search` ```ts theme={null} const rows = await corsair.strava.db.uploads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `external_id` | `string` | equals, contains, startsWith, endsWith, in | | `error` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `activity_id` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/strava/get-credentials Step-by-step instructions for obtaining Strava OAuth credentials. ## Authentication Method * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 ## OAuth App Setup ### Step 1: Create a Strava App 1. Log in to [Strava](https://www.strava.com) 2. Go to [strava.com/settings/api](https://www.strava.com/settings/api) 3. Fill in the app details: * **Application Name**: Your app name * **Category**: Choose an appropriate category * **Website**: Your website URL * **Authorization Callback Domain**: `localhost` (for development) 4. Click **Create** ### Step 2: Get Your Credentials After creating the app, you'll see: * **Client ID** * **Client Secret** ### Step 3: Store Credentials ```bash theme={null} pnpm corsair setup --plugin=strava client_id=your-client-id client_secret=your-client-secret ``` ### Step 4: Authorize ```bash theme={null} pnpm corsair auth --plugin=strava ``` This opens a browser window to complete the Strava OAuth flow. Tokens are saved automatically. ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth flow | Strava API settings | | Client Secret | OAuth flow | Strava API settings | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/strava/overview Fitness tracking network for runs, rides, activities, segments, and athlete social data. Use **Strava** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 27 typed API operations * 9 synced entities (`activities`, `athletes`, `clubs`, `gears`, `laps`, `routes`, and 3 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/strava ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/strava ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/strava ``` ```bash bun theme={null} bun add corsair @corsair-dev/strava ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { strava } from '@corsair-dev/strava'; export const corsair = createCorsair({ plugins: [ strava(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Strava OAuth app. Provider walkthrough: [Get Credentials](/plugins/strava/get-credentials). ```ts theme={null} strava() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'strava', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`activities.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.strava.api.activities.get({}); ``` **`activities.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.strava.api.activities.create({}); ``` See the full list on the [API](/plugins/strava/api) page. ## Query synced data Synced entities support `tenant.strava.db..search()` and `.list()`: `activities`, `athletes`, `clubs`, `gears`, `laps`, `routes`, `segmentEfforts`, `segments`, `uploads`. See [Database](/plugins/strava/database) for filters and operators. ## What's next > **[API reference](/plugins/strava/api)** > > Every `strava.api.*` operation with input and output types. > **[Database](/plugins/strava/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/strava/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/streamtime/api API reference for Streamtime: every `streamtime.api.*` operation with input and output types. Every `streamtime.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Organisation ### get `organisation.get` Retrieve the organisation's details **Risk:** `read` ```ts theme={null} await corsair.streamtime.api.organisation.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Organisation name | | `domain` | `string` | Yes | Organisation domain | | `currency` | `object` | Yes | Default customer currency | | `address` | `string` | Yes | Organisation address (default branch) | | `country` | `object` | Yes | Organisation country | > **currency full type** > > ```ts theme={null} > { > id: string, > name: string, > symbol: string > } > ``` > **country full type** > > ```ts theme={null} > { > id: string, > name: string > } > ``` *** ## Roles ### get `roles.get` Retrieve a role by ID **Risk:** `read` ```ts theme={null} await corsair.streamtime.api.roles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `role_id` | `number` | Yes | Role ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | The ID of the role | | `name` | `string` | Yes | The name of the role | | `active` | `boolean` | Yes | Whether the role is active or archived | *** ### list `roles.list` Retrieve all roles in the organisation **Risk:** `read` ```ts theme={null} await corsair.streamtime.api.roles.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > active: boolean > }[] > ``` *** ## Users ### listSavedSegments `users.listSavedSegments` Retrieve saved segments for a specific user **Risk:** `read` ```ts theme={null} await corsair.streamtime.api.users.listSavedSegments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `user_id` | `number` | Yes | User ID | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: number | null, > userId: number, > savedSegmentType: { > id: number, > name?: string > }, > name: string, > value: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/streamtime/database Streamtime local sync: searchable entities, `.search()` filters, and operators. The Streamtime plugin syncs data locally. Use `corsair.streamtime.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/streamtime/overview Job management software for creative agencies tracking projects, schedules, and profitability. Use **Streamtime** through Corsair: one client, typed API calls. **What you get:** * 4 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/streamtime ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/streamtime ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/streamtime ``` ```bash bun theme={null} bun add corsair @corsair-dev/streamtime ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { streamtime } from '@corsair-dev/streamtime'; export const corsair = createCorsair({ plugins: [ streamtime(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} streamtime() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'streamtime', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`organisation.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.streamtime.api.organisation.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/streamtime/api) reference.* See the full list on the [API](/plugins/streamtime/api) page. ## What's next > **[API reference](/plugins/streamtime/api)** > > Every `streamtime.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/stripe/api API reference for Stripe: every `stripe.api.*` operation with input and output types. Every `stripe.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Balance ### get `balance.get` Retrieve the current account balance **Risk:** `read` ```ts theme={null} await corsair.stripe.api.balance.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `balance` | Yes | — | | `livemode` | `boolean` | No | — | | `available` | `object[]` | No | — | | `pending` | `object[]` | No | — | > **available full type** > > ```ts theme={null} > { > amount: number, > currency: string > }[] > ``` > **pending full type** > > ```ts theme={null} > { > amount: number, > currency: string > }[] > ``` *** ## Charges ### create `charges.create` Create a new Stripe charge **Risk:** `write` ```ts theme={null} await corsair.stripe.api.charges.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `source` | `string` | No | — | | `customer` | `string` | No | — | | `description` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `charge` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `customer` | `string` | No | — | | `description` | `string` | No | — | | `paid` | `boolean` | No | — | | `refunded` | `boolean` | No | — | | `created` | `number` | No | — | | `payment_intent` | `string` | No | — | | `failure_code` | `string` | No | — | | `failure_message` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### get `charges.get` Retrieve a Stripe charge by ID **Risk:** `read` ```ts theme={null} await corsair.stripe.api.charges.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `charge` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `customer` | `string` | No | — | | `description` | `string` | No | — | | `paid` | `boolean` | No | — | | `refunded` | `boolean` | No | — | | `created` | `number` | No | — | | `payment_intent` | `string` | No | — | | `failure_code` | `string` | No | — | | `failure_message` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `charges.list` List Stripe charges with optional filters **Risk:** `read` ```ts theme={null} await corsair.stripe.api.charges.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customer` | `string` | No | — | | `payment_intent` | `string` | No | — | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `url` | `string` | No | — | | `has_more` | `boolean` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: charge, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > paid?: boolean, > refunded?: boolean, > created?: number, > payment_intent?: string | null, > failure_code?: string | null, > failure_message?: string | null, > metadata?: { > } > }[] > ``` *** ### update `charges.update` Update a Stripe charge **Risk:** `write` ```ts theme={null} await corsair.stripe.api.charges.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `description` | `string` | No | — | | `metadata` | `object` | No | — | | `receipt_email` | `string` | No | — | | `shipping` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` > **shipping full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `charge` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `customer` | `string` | No | — | | `description` | `string` | No | — | | `paid` | `boolean` | No | — | | `refunded` | `boolean` | No | — | | `created` | `number` | No | — | | `payment_intent` | `string` | No | — | | `failure_code` | `string` | No | — | | `failure_message` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Coupons ### create `coupons.create` Create a new Stripe coupon **Risk:** `write` ```ts theme={null} await corsair.stripe.api.coupons.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `amount_off` | `number` | No | — | | `percent_off` | `number` | No | — | | `currency` | `string` | No | — | | `duration` | `forever \| once \| repeating` | No | — | | `duration_in_months` | `number` | No | — | | `max_redemptions` | `number` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `coupon` | Yes | — | | `name` | `string` | No | — | | `amount_off` | `number` | No | — | | `percent_off` | `number` | No | — | | `currency` | `string` | No | — | | `duration` | `string` | No | — | | `duration_in_months` | `number` | No | — | | `max_redemptions` | `number` | No | — | | `times_redeemed` | `number` | No | — | | `valid` | `boolean` | No | — | | `created` | `number` | No | — | | `livemode` | `boolean` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `coupons.list` List Stripe coupons **Risk:** `read` ```ts theme={null} await corsair.stripe.api.coupons.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `url` | `string` | No | — | | `has_more` | `boolean` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: coupon, > name?: string | null, > amount_off?: number | null, > percent_off?: number | null, > currency?: string | null, > duration?: string, > duration_in_months?: number | null, > max_redemptions?: number | null, > times_redeemed?: number, > valid?: boolean, > created?: number, > livemode?: boolean, > metadata?: { > } > }[] > ``` *** ## Customers ### create `customers.create` Create a new Stripe customer **Risk:** `write` ```ts theme={null} await corsair.stripe.api.customers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `name` | `string` | No | — | | `phone` | `string` | No | — | | `description` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `customer` | Yes | — | | `email` | `string` | No | — | | `name` | `string` | No | — | | `phone` | `string` | No | — | | `description` | `string` | No | — | | `currency` | `string` | No | — | | `balance` | `number` | No | — | | `created` | `number` | No | — | | `livemode` | `boolean` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `customers.delete` Delete a Stripe customer **Risk:** `destructive` ```ts theme={null} await corsair.stripe.api.customers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `customer` | Yes | — | | `deleted` | `true` | Yes | — | *** ### get `customers.get` Retrieve a Stripe customer by ID **Risk:** `read` ```ts theme={null} await corsair.stripe.api.customers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `customer` | Yes | — | | `email` | `string` | No | — | | `name` | `string` | No | — | | `phone` | `string` | No | — | | `description` | `string` | No | — | | `currency` | `string` | No | — | | `balance` | `number` | No | — | | `created` | `number` | No | — | | `livemode` | `boolean` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `customers.list` List Stripe customers with optional filters **Risk:** `read` ```ts theme={null} await corsair.stripe.api.customers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | No | — | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `url` | `string` | No | — | | `has_more` | `boolean` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: customer, > email?: string | null, > name?: string | null, > phone?: string | null, > description?: string | null, > currency?: string | null, > balance?: number, > created?: number, > livemode?: boolean, > metadata?: { > } > }[] > ``` *** ## Payment Intents ### create `paymentIntents.create` Create a new Stripe payment intent **Risk:** `write` ```ts theme={null} await corsair.stripe.api.paymentIntents.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `customer` | `string` | No | — | | `description` | `string` | No | — | | `payment_method` | `string` | No | — | | `confirm` | `boolean` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `payment_intent` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `customer` | `string` | No | — | | `description` | `string` | No | — | | `created` | `number` | No | — | | `payment_method` | `string` | No | — | | `client_secret` | `string` | No | — | | `canceled_at` | `number` | No | — | | `cancellation_reason` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### get `paymentIntents.get` Retrieve a Stripe payment intent by ID **Risk:** `read` ```ts theme={null} await corsair.stripe.api.paymentIntents.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `payment_intent` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `customer` | `string` | No | — | | `description` | `string` | No | — | | `created` | `number` | No | — | | `payment_method` | `string` | No | — | | `client_secret` | `string` | No | — | | `canceled_at` | `number` | No | — | | `cancellation_reason` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `paymentIntents.list` List Stripe payment intents with optional filters **Risk:** `read` ```ts theme={null} await corsair.stripe.api.paymentIntents.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `customer` | `string` | No | — | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `url` | `string` | No | — | | `has_more` | `boolean` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: payment_intent, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > created?: number, > payment_method?: string | null, > client_secret?: string | null, > canceled_at?: number | null, > cancellation_reason?: string | null, > metadata?: { > } > }[] > ``` *** ### update `paymentIntents.update` Update a Stripe payment intent **Risk:** `write` ```ts theme={null} await corsair.stripe.api.paymentIntents.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `amount` | `number` | No | — | | `currency` | `string` | No | — | | `customer` | `string` | No | — | | `description` | `string` | No | — | | `payment_method` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `payment_intent` | Yes | — | | `amount` | `number` | Yes | — | | `currency` | `string` | Yes | — | | `status` | `string` | Yes | — | | `customer` | `string` | No | — | | `description` | `string` | No | — | | `created` | `number` | No | — | | `payment_method` | `string` | No | — | | `client_secret` | `string` | No | — | | `canceled_at` | `number` | No | — | | `cancellation_reason` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Prices ### create `prices.create` Create a new Stripe price **Risk:** `write` ```ts theme={null} await corsair.stripe.api.prices.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `currency` | `string` | Yes | — | | `unit_amount` | `number` | No | — | | `product` | `string` | No | — | | `product_data` | `object` | No | — | | `nickname` | `string` | No | — | | `recurring` | `object` | No | — | | `metadata` | `object` | No | — | > **product\_data full type** > > ```ts theme={null} > { > name: string > } > ``` > **recurring full type** > > ```ts theme={null} > { > interval: day | week | month | year, > interval_count?: number > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `price` | Yes | — | | `active` | `boolean` | No | — | | `currency` | `string` | No | — | | `unit_amount` | `number` | No | — | | `nickname` | `string` | No | — | | `product` | `string` | No | — | | `type` | `string` | No | — | | `recurring` | `object` | No | — | | `created` | `number` | No | — | | `livemode` | `boolean` | No | — | | `metadata` | `object` | No | — | > **recurring full type** > > ```ts theme={null} > { > interval: string, > interval_count: number > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `prices.list` List Stripe prices **Risk:** `read` ```ts theme={null} await corsair.stripe.api.prices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `active` | `boolean` | No | — | | `currency` | `string` | No | — | | `product` | `string` | No | — | | `type` | `one_time \| recurring` | No | — | | `limit` | `number` | No | — | | `starting_after` | `string` | No | — | | `ending_before` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `object` | `list` | Yes | — | | `url` | `string` | No | — | | `has_more` | `boolean` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > object: price, > active?: boolean, > currency?: string, > unit_amount?: number | null, > nickname?: string | null, > product?: string, > type?: string, > recurring?: { > interval: string, > interval_count: number > } | null, > created?: number, > livemode?: boolean, > metadata?: { > } > }[] > ``` *** ## Sources ### create `sources.create` Create a new Stripe source **Risk:** `write` ```ts theme={null} await corsair.stripe.api.sources.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | Yes | — | | `amount` | `number` | No | — | | `currency` | `string` | No | — | | `flow` | `string` | No | — | | `owner` | `object` | No | — | | `redirect` | `object` | No | — | | `metadata` | `object` | No | — | | `token` | `string` | No | — | > **owner full type** > > ```ts theme={null} > { > } > ``` > **redirect full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `source` | Yes | — | | `type` | `string` | No | — | | `amount` | `number` | No | — | | `currency` | `string` | No | — | | `status` | `string` | No | — | | `created` | `number` | No | — | | `livemode` | `boolean` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### get `sources.get` Retrieve a Stripe source by ID **Risk:** `read` ```ts theme={null} await corsair.stripe.api.sources.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `source` | Yes | — | | `type` | `string` | No | — | | `amount` | `number` | No | — | | `currency` | `string` | No | — | | `status` | `string` | No | — | | `created` | `number` | No | — | | `livemode` | `boolean` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Tokens ### create `tokens.create` Create a Stripe token **Risk:** `write` ```ts theme={null} await corsair.stripe.api.tokens.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `card` | `object` | No | — | | `bank_account` | `object` | No | — | | `pii` | `object` | No | — | > **card full type** > > ```ts theme={null} > { > } > ``` > **bank\_account full type** > > ```ts theme={null} > { > } > ``` > **pii full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `token` | Yes | — | | `type` | `string` | No | — | | `created` | `number` | No | — | | `livemode` | `boolean` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/stripe/database Stripe local sync: searchable entities, `.search()` filters, and operators. The Stripe plugin syncs data locally. Use `corsair.stripe.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Balance Path: `stripe.db.balance.search` ```ts theme={null} const rows = await corsair.stripe.db.balance.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `livemode` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Charges Path: `stripe.db.charges.search` ```ts theme={null} const rows = await corsair.stripe.db.charges.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `customer` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `paid` | `boolean` | equals | | `refunded` | `boolean` | equals | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `payment_intent` | `string` | equals, contains, startsWith, endsWith, in | | `failure_code` | `string` | equals, contains, startsWith, endsWith, in | | `failure_message` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Coupons Path: `stripe.db.coupons.search` ```ts theme={null} const rows = await corsair.stripe.db.coupons.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `amount_off` | `number` | equals, gt, gte, lt, lte, in | | `percent_off` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `string` | equals, contains, startsWith, endsWith, in | | `duration_in_months` | `number` | equals, gt, gte, lt, lte, in | | `max_redemptions` | `number` | equals, gt, gte, lt, lte, in | | `times_redeemed` | `number` | equals, gt, gte, lt, lte, in | | `valid` | `boolean` | equals | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `livemode` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Customers Path: `stripe.db.customers.search` ```ts theme={null} const rows = await corsair.stripe.db.customers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `balance` | `number` | equals, gt, gte, lt, lte, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `livemode` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payment Intents Path: `stripe.db.paymentIntents.search` ```ts theme={null} const rows = await corsair.stripe.db.paymentIntents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `customer` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `payment_method` | `string` | equals, contains, startsWith, endsWith, in | | `client_secret` | `string` | equals, contains, startsWith, endsWith, in | | `canceled_at` | `number` | equals, gt, gte, lt, lte, in | | `cancellation_reason` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Prices Path: `stripe.db.prices.search` ```ts theme={null} const rows = await corsair.stripe.db.prices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `unit_amount` | `number` | equals, gt, gte, lt, lte, in | | `nickname` | `string` | equals, contains, startsWith, endsWith, in | | `product` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `livemode` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sources Path: `stripe.db.sources.search` ```ts theme={null} const rows = await corsair.stripe.db.sources.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `number` | equals, gt, gte, lt, lte, in | | `currency` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `livemode` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/stripe/get-credentials Step-by-step instructions for obtaining Stripe API credentials. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Stripe secret key ## API Key Setup ### Step 1: Get Your Secret Key 1. Log in to the [Stripe Dashboard](https://dashboard.stripe.com) 2. Go to **Developers** → **API keys** 3. Copy your **Secret key** (starts with `sk_live_` for production or `sk_test_` for testing) 4. Store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=stripe api_key=sk_live_your-secret-key ``` > [!WARNING] > > Use `sk_test_` keys during development to avoid real charges. ## Webhook Setup (Optional) 1. In the Stripe Dashboard, go to **Developers** → **Webhooks** 2. Click **Add endpoint** 3. Enter your endpoint URL (e.g., `https://yourapp.com/webhooks/stripe`) 4. Select the events to listen for 5. Copy the **Signing secret** (starts with `whsec_`) ```bash theme={null} pnpm corsair setup --plugin=stripe webhook_signature=whsec_your-signing-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Secret Key | All API calls | Dashboard → Developers → API keys | | Webhook Signing Secret | Webhook verification | Dashboard → Developers → Webhooks | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/stripe/overview Payment infrastructure for accepting charges, subscriptions, invoices, and online checkout flows. Use **Stripe** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 20 typed API operations * 7 synced entities (`balance`, `charges`, `coupons`, `customers`, `paymentIntents`, `prices`, and 1 more) for fast `.search()` / `.list()` * 11 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/stripe ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/stripe ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/stripe ``` ```bash bun theme={null} bun add corsair @corsair-dev/stripe ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { stripe } from '@corsair-dev/stripe'; export const corsair = createCorsair({ plugins: [ stripe(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/stripe/get-credentials). ```ts theme={null} stripe() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Stripe OAuth app. Provider walkthrough: [Get Credentials](/plugins/stripe/get-credentials). ```ts theme={null} stripe({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'stripe', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List customers** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.stripe.api.customers.list({}); ``` **Create a payment intent** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.stripe.api.paymentIntents.create({ amount: 2000, currency: 'usd' }); ``` See the full list on the [API](/plugins/stripe/api) page. ## Query synced data Search synced customers without hitting Stripe. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.stripe.db.customers.search({ data: {}, limit: 50, }); ``` Synced entities: `balance`, `charges`, `coupons`, `customers`, `paymentIntents`, `prices`, `sources`. See [Database](/plugins/stripe/database) for filters and operators. ## Webhooks Fires when a payment intent transitions to `succeeded`. Use this to fulfil orders. ```ts theme={null} stripe({ webhookHooks: { paymentIntent: { succeeded: { after: async (ctx, result) => { const intent = result.data.data.object; console.log('Payment succeeded:', intent.id, intent.amount, intent.currency); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/stripe/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/stripe/api)** > > Every `stripe.api.*` operation with input and output types. > **[Database](/plugins/stripe/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/stripe/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/stripe/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/stripe/webhooks Stripe incoming webhooks: event paths, payloads, and response data. The Stripe plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/stripe/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `charge` * `failed` (`charge.failed`) * `refunded` (`charge.refunded`) * `succeeded` (`charge.succeeded`) * `coupon` * `created` (`coupon.created`) * `deleted` (`coupon.deleted`) * `customer` * `created` (`customer.created`) * `deleted` (`customer.deleted`) * `updated` (`customer.updated`) * `paymentIntent` * `failed` (`paymentIntent.failed`) * `succeeded` (`paymentIntent.succeeded`) * `ping` * `ping` (`ping.ping`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Charge ### Failed `charge.failed` A charge attempt failed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `charge.failed` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: charge, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > paid?: boolean, > refunded?: boolean, > created?: number, > payment_intent?: string | null, > failure_code?: string | null, > failure_message?: string | null, > metadata?: { > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: charge.failed, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: charge, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > paid?: boolean, > refunded?: boolean, > created?: number, > payment_intent?: string | null, > failure_code?: string | null, > failure_message?: string | null, > metadata?: { > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { charge: { failed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Refunded `charge.refunded` A charge was refunded **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `charge.refunded` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: charge, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > paid?: boolean, > refunded?: boolean, > created?: number, > payment_intent?: string | null, > failure_code?: string | null, > failure_message?: string | null, > metadata?: { > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: charge.refunded, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: charge, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > paid?: boolean, > refunded?: boolean, > created?: number, > payment_intent?: string | null, > failure_code?: string | null, > failure_message?: string | null, > metadata?: { > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { charge: { refunded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Succeeded `charge.succeeded` A charge was successfully completed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `charge.succeeded` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: charge, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > paid?: boolean, > refunded?: boolean, > created?: number, > payment_intent?: string | null, > failure_code?: string | null, > failure_message?: string | null, > metadata?: { > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: charge.succeeded, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: charge, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > paid?: boolean, > refunded?: boolean, > created?: number, > payment_intent?: string | null, > failure_code?: string | null, > failure_message?: string | null, > metadata?: { > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { charge: { succeeded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Coupon ### Created `coupon.created` A coupon was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `coupon.created` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: coupon, > name?: string | null, > amount_off?: number | null, > percent_off?: number | null, > currency?: string | null, > duration?: string, > duration_in_months?: number | null, > max_redemptions?: number | null, > times_redeemed?: number, > valid?: boolean, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: coupon.created, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: coupon, > name?: string | null, > amount_off?: number | null, > percent_off?: number | null, > currency?: string | null, > duration?: string, > duration_in_months?: number | null, > max_redemptions?: number | null, > times_redeemed?: number, > valid?: boolean, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { coupon: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `coupon.deleted` A coupon was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `coupon.deleted` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: coupon, > name?: string | null, > amount_off?: number | null, > percent_off?: number | null, > currency?: string | null, > duration?: string, > duration_in_months?: number | null, > max_redemptions?: number | null, > times_redeemed?: number, > valid?: boolean, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: coupon.deleted, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: coupon, > name?: string | null, > amount_off?: number | null, > percent_off?: number | null, > currency?: string | null, > duration?: string, > duration_in_months?: number | null, > max_redemptions?: number | null, > times_redeemed?: number, > valid?: boolean, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { coupon: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Customer ### Created `customer.created` A new customer was created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `customer.created` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: customer, > email?: string | null, > name?: string | null, > phone?: string | null, > description?: string | null, > currency?: string | null, > balance?: number, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: customer.created, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: customer, > email?: string | null, > name?: string | null, > phone?: string | null, > description?: string | null, > currency?: string | null, > balance?: number, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { customer: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `customer.deleted` A customer was deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `customer.deleted` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: customer, > email?: string | null, > name?: string | null, > phone?: string | null, > description?: string | null, > currency?: string | null, > balance?: number, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: customer.deleted, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: customer, > email?: string | null, > name?: string | null, > phone?: string | null, > description?: string | null, > currency?: string | null, > balance?: number, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { customer: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `customer.updated` A customer was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `customer.updated` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: customer, > email?: string | null, > name?: string | null, > phone?: string | null, > description?: string | null, > currency?: string | null, > balance?: number, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: customer.updated, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: customer, > email?: string | null, > name?: string | null, > phone?: string | null, > description?: string | null, > currency?: string | null, > balance?: number, > created?: number, > livemode?: boolean, > metadata?: { > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { customer: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Payment Intent ### Failed `paymentIntent.failed` A payment intent payment failed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `payment_intent.payment_failed` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: payment_intent, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > created?: number, > payment_method?: string | null, > client_secret?: string | null, > canceled_at?: number | null, > cancellation_reason?: string | null, > metadata?: { > }, > last_payment_error?: { > code?: string, > message?: string, > type?: string > } | null > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: payment_intent.payment_failed, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: payment_intent, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > created?: number, > payment_method?: string | null, > client_secret?: string | null, > canceled_at?: number | null, > cancellation_reason?: string | null, > metadata?: { > }, > last_payment_error?: { > code?: string, > message?: string, > type?: string > } | null > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { paymentIntent: { failed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Succeeded `paymentIntent.succeeded` A payment intent succeeded **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `payment_intent.succeeded` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > id: string, > object: payment_intent, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > created?: number, > payment_method?: string | null, > client_secret?: string | null, > canceled_at?: number | null, > cancellation_reason?: string | null, > metadata?: { > }, > last_payment_error?: { > code?: string, > message?: string, > type?: string > } | null > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: payment_intent.succeeded, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > id: string, > object: payment_intent, > amount: number, > currency: string, > status: string, > customer?: string | null, > description?: string | null, > created?: number, > payment_method?: string | null, > client_secret?: string | null, > canceled_at?: number | null, > cancellation_reason?: string | null, > metadata?: { > }, > last_payment_error?: { > code?: string, > message?: string, > type?: string > } | null > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { paymentIntent: { succeeded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Ping ### Ping `ping.ping` Stripe webhook endpoint connectivity test **Payload** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `event` | Yes | — | | `api_version` | `string` | No | — | | `created` | `number` | Yes | — | | `livemode` | `boolean` | Yes | — | | `type` | `v2.core.event_destination.ping` | Yes | — | | `request` | `object` | No | — | | `data` | `object` | Yes | — | > **request full type** > > ```ts theme={null} > { > id?: string | null, > idempotency_key?: string | null > } > ``` > **data full type** > > ```ts theme={null} > { > object: { > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > id: string, > object: event, > api_version?: string | null, > created: number, > livemode: boolean, > type: v2.core.event_destination.ping, > request?: { > id?: string | null, > idempotency_key?: string | null > } | null, > data: { > object: { > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} stripe({ webhookHooks: { ping: { ping: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/studiobyai21labs/api API reference for ElevenLabs Studio: every `studiobyai21labs.api.*` operation with input and output types. Every `studiobyai21labs.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Chat ### completions `chat.completions` Generate a Jamba chat completion from a conversation history **Risk:** `write` ```ts theme={null} await corsair.studiobyai21labs.api.chat.completions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `tools` | `object[]` | No | — | | `documents` | `object[]` | No | — | | `response_format` | `object` | No | — | | `max_tokens` | `number` | No | — | | `temperature` | `number` | No | — | | `top_p` | `number` | No | — | | `stop` | `string \| string[]` | No | — | | `n` | `number` | No | — | > **messages full type** > > ```ts theme={null} > { > role: system | user | assistant | tool, > content?: string | null, > tool_calls?: { > id: string, > type: string, > function: { > name: string, > arguments: string > } > }[], > tool_call_id?: string > }[] > ``` > **tools full type** > > ```ts theme={null} > { > type: function, > function: { > name: string, > description?: string, > parameters?: { > } > } > }[] > ``` > **documents full type** > > ```ts theme={null} > { > content: string, > metadata?: { > } > }[] > ``` > **response\_format full type** > > ```ts theme={null} > { > type: text | json_object > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `choices` | `object[]` | Yes | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > index?: number, > message?: { > role?: string, > content?: string | null, > tool_calls?: any[] > }, > finish_reason?: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens?: number, > completion_tokens?: number, > total_tokens?: number > } > ``` *** ## Library ### delete `library.delete` Delete a library file **Risk:** `write` ```ts theme={null} await corsair.studiobyai21labs.api.library.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | **Output:** `undefined` *** ### download `library.download` Get a signed download URL for a library file **Risk:** `read` ```ts theme={null} await corsair.studiobyai21labs.api.library.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | **Output:** `string` *** ### get `library.get` Get metadata for a library file **Risk:** `read` ```ts theme={null} await corsair.studiobyai21labs.api.library.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `size` | `number` | No | — | | `created_at` | `string` | No | — | | `labels` | `string[]` | No | — | | `errorCode` | `string` | No | — | | `errorMessage` | `string` | No | — | *** ### list `library.list` List workspace library files with optional filters **Risk:** `read` ```ts theme={null} await corsair.studiobyai21labs.api.library.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `path` | `string` | No | — | | `status` | `DB_RECORD_CREATED \| UPLOADED \| UPLOAD_FAILED \| PROCESSED \| PROCESSING_FAILED` | No | — | | `label` | `string \| string[]` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string, > size?: number, > created_at?: string, > labels?: string[], > errorCode?: string, > errorMessage?: string > }[] > ``` *** ### update `library.update` Update a library file public URL or labels **Risk:** `write` ```ts theme={null} await corsair.studiobyai21labs.api.library.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `publicUrl` | `string` | No | — | | `labels` | `string[]` | No | — | **Output:** `undefined` *** ### upload `library.upload` Upload a file or register a public URL in the library **Risk:** `write` ```ts theme={null} await corsair.studiobyai21labs.api.library.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `string \| custom` | No | — | | `fileName` | `string` | No | — | | `path` | `string` | No | — | | `labels` | `string[]` | No | — | | `publicUrl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Maestro ### createRun `maestro.createRun` Create an AI21 Maestro run **Risk:** `write` ```ts theme={null} await corsair.studiobyai21labs.api.maestro.createRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `object[]` | Yes | — | | `system_prompt` | `string` | No | — | | `requirements` | `object[]` | No | — | | `tools` | `object[]` | No | — | | `models` | `string[]` | No | — | | `budget` | `low \| medium \| high` | No | — | | `include` | `data_sources \| requirements_result[]` | No | — | | `response_language` | `arabic \| dutch \| english \| french \| german \| hebrew \| italian \| portuguese \| spanish` | No | — | > **input full type** > > ```ts theme={null} > string | { > role: user | assistant, > content: string > }[] > ``` > **requirements full type** > > ```ts theme={null} > { > name: string, > description: string, > is_mandatory?: boolean > }[] > ``` > **tools full type** > > ```ts theme={null} > ( > { > type: mcp, > server_label: string, > server_url: string, > headers?: { > }, > allowed_tools?: string[] > } | { > type: http, > function: { > name: string, > description?: string, > parameters?: { > } > }, > endpoint: { > url: string, > headers?: { > } > } > } | { > type: file_search, > labels?: string[], > file_ids?: string[] > } | { > type: web_search, > urls?: string[] > } > )[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `completed \| failed \| in_progress` | No | — | | `result` | `any` | No | — | | `requirements_result` | `object` | No | — | | `data_sources` | `object` | No | — | | `error` | `object` | No | — | > **requirements\_result full type** > > ```ts theme={null} > { > score?: number, > finish_reason?: string, > requirements?: any[] > } > ``` > **data\_sources full type** > > ```ts theme={null} > { > web_search?: any[], > file_search?: any[], > tool_calls?: any[] > } > ``` > **error full type** > > ```ts theme={null} > { > message?: string > } > ``` *** ### retrieveRun `maestro.retrieveRun` Retrieve an AI21 Maestro run by id **Risk:** `read` ```ts theme={null} await corsair.studiobyai21labs.api.maestro.retrieveRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `completed \| failed \| in_progress` | No | — | | `result` | `any` | No | — | | `requirements_result` | `object` | No | — | | `data_sources` | `object` | No | — | | `error` | `object` | No | — | > **requirements\_result full type** > > ```ts theme={null} > { > score?: number, > finish_reason?: string, > requirements?: any[] > } > ``` > **data\_sources full type** > > ```ts theme={null} > { > web_search?: any[], > file_search?: any[], > tool_calls?: any[] > } > ``` > **error full type** > > ```ts theme={null} > { > message?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/studiobyai21labs/database ElevenLabs Studio local sync: searchable entities, `.search()` filters, and operators. The ElevenLabs Studio plugin syncs data locally. Use `corsair.studiobyai21labs.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/studiobyai21labs/overview AI audio studio for voice generation, dubbing, and long-form spoken content production. Use **ElevenLabs Studio** through Corsair: one client, typed API calls. **What you get:** * 9 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/studiobyai21labs ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/studiobyai21labs ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/studiobyai21labs ``` ```bash bun theme={null} bun add corsair @corsair-dev/studiobyai21labs ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { studiobyai21labs } from '@corsair-dev/studiobyai21labs'; export const corsair = createCorsair({ plugins: [ studiobyai21labs(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} studiobyai21labs() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'studiobyai21labs', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`library.download`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.studiobyai21labs.api.library.download({}); ``` **`chat.completions`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.studiobyai21labs.api.chat.completions({}); ``` See the full list on the [API](/plugins/studiobyai21labs/api) page. ## What's next > **[API reference](/plugins/studiobyai21labs/api)** > > Every `studiobyai21labs.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/supabase/api API reference for Supabase: every `supabase.api.*` operation with input and output types. Every `supabase.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Advisors ### getPerformanceAdvisors `advisors.getPerformanceAdvisors` Get performance advisors **Risk:** `read` ```ts theme={null} await corsair.supabase.api.advisors.getPerformanceAdvisors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSecurityAdvisors `advisors.getSecurityAdvisors` Get security advisors **Risk:** `read` ```ts theme={null} await corsair.supabase.api.advisors.getSecurityAdvisors({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Analytics ### getProjectLogs `analytics.getProjectLogs` Get project logs **Risk:** `read` ```ts theme={null} await corsair.supabase.api.analytics.getProjectLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Auth ### createProjectSigningKey `auth.createProjectSigningKey` Create a project signing key **Risk:** `write` ```ts theme={null} await corsair.supabase.api.auth.createProjectSigningKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createSsoProvider `auth.createSsoProvider` Create an SSO provider **Risk:** `write` ```ts theme={null} await corsair.supabase.api.auth.createSsoProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createThirdPartyAuthIntegration `auth.createThirdPartyAuthIntegration` Create a third-party auth integration **Risk:** `write` ```ts theme={null} await corsair.supabase.api.auth.createThirdPartyAuthIntegration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteSsoProvider `auth.deleteSsoProvider` Remove an SSO provider **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.auth.deleteSsoProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | Yes | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteThirdPartyAuthIntegration `auth.deleteThirdPartyAuthIntegration` Delete a third-party auth integration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.auth.deleteThirdPartyAuthIntegration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | Yes | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getLegacySigningKey `auth.getLegacySigningKey` Get legacy signing key **Risk:** `read` ```ts theme={null} await corsair.supabase.api.auth.getLegacySigningKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectAuthConfig `auth.getProjectAuthConfig` Get project auth config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.auth.getProjectAuthConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectSigningKeys `auth.getProjectSigningKeys` Get project signing keys **Risk:** `read` ```ts theme={null} await corsair.supabase.api.auth.getProjectSigningKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSsoProvider `auth.getSsoProvider` Get an SSO provider **Risk:** `read` ```ts theme={null} await corsair.supabase.api.auth.getSsoProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | Yes | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getThirdPartyIntegration `auth.getThirdPartyIntegration` Get a third-party auth integration **Risk:** `read` ```ts theme={null} await corsair.supabase.api.auth.getThirdPartyIntegration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | Yes | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listSsoProviders `auth.listSsoProviders` List SSO providers **Risk:** `read` ```ts theme={null} await corsair.supabase.api.auth.listSsoProviders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listThirdPartyAuthIntegrations `auth.listThirdPartyAuthIntegrations` List third-party auth integrations **Risk:** `read` ```ts theme={null} await corsair.supabase.api.auth.listThirdPartyAuthIntegrations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectAuthConfig `auth.updateProjectAuthConfig` Update project auth config **Risk:** `write` ```ts theme={null} await corsair.supabase.api.auth.updateProjectAuthConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSsoProvider `auth.updateSsoProvider` Update an SSO provider **Risk:** `write` ```ts theme={null} await corsair.supabase.api.auth.updateSsoProvider({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | Yes | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Database ### applyMigration `database.applyMigration` Apply a database migration **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.applyMigration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createLoginRole `database.createLoginRole` Create a CLI login role **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.createLoginRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createReadReplica `database.createReadReplica` Set up a read replica **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.createReadReplica({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteLoginRoles `database.deleteLoginRoles` Delete CLI login roles **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.database.deleteLoginRoles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### disableProjectReadonly `database.disableProjectReadonly` Temporarily disable project read-only mode **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.disableProjectReadonly({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### enableDatabaseWebhooks `database.enableDatabaseWebhooks` Enable database webhooks **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.enableDatabaseWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### generateTypescriptTypes `database.generateTypescriptTypes` Generate TypeScript database types **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.generateTypescriptTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDatabaseMetadata `database.getDatabaseMetadata` Get database metadata **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getDatabaseMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getJitAccessConfig `database.getJitAccessConfig` Get JIT access config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getJitAccessConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getMigration `database.getMigration` Get a migration **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getMigration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | Yes | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectPgbouncerConfig `database.getProjectPgbouncerConfig` Get project PgBouncer config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getProjectPgbouncerConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectPostgresConfig `database.getProjectPostgresConfig` Get project postgres config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getProjectPostgresConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectReadonlyModeStatus `database.getProjectReadonlyModeStatus` Get project read-only mode status **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getProjectReadonlyModeStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectSslEnforcementConfig `database.getProjectSslEnforcementConfig` Get project SSL enforcement config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getProjectSslEnforcementConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectSupavisorConfig `database.getProjectSupavisorConfig` Get project Supavisor config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getProjectSupavisorConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSqlSnippet `database.getSqlSnippet` Get a SQL snippet **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getSqlSnippet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getTableSchemas `database.getTableSchemas` Get database table schemas **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.getTableSchemas({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listBackups `database.listBackups` List project database backups **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.listBackups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listMigrationHistory `database.listMigrationHistory` List migration history **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.listMigrationHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listSqlSnippets `database.listSqlSnippets` List SQL snippets **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.listSqlSnippets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listTables `database.listTables` List database tables **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.listTables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### patchMigration `database.patchMigration` Patch a migration **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.patchMigration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | Yes | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### removeReadReplica `database.removeReadReplica` Remove a read replica **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.database.removeReadReplica({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### restorePitrBackup `database.restorePitrBackup` Restore database PITR backup **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.database.restorePitrBackup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runReadOnlyQuery `database.runReadOnlyQuery` Execute a read-only database query **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.runReadOnlyQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### runSqlQuery `database.runSqlQuery` Execute a project database query **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.runSqlQuery({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### selectFromTable `database.selectFromTable` Select rows from a database table **Risk:** `read` ```ts theme={null} await corsair.supabase.api.database.selectFromTable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDatabasePassword `database.updateDatabasePassword` Update database password **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.updateDatabasePassword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateJitAccessConfig `database.updateJitAccessConfig` Update JIT access config **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.updateJitAccessConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectPostgresConfig `database.updateProjectPostgresConfig` Update project postgres config **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.updateProjectPostgresConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectSupavisorConfig `database.updateProjectSupavisorConfig` Update project Supavisor config **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.updateProjectSupavisorConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSslEnforcementConfig `database.updateSslEnforcementConfig` Update SSL enforcement config **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.updateSslEnforcementConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### upsertMigration `database.upsertMigration` Upsert a migration **Risk:** `write` ```ts theme={null} await corsair.supabase.api.database.upsertMigration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Domains ### activateCustomHostname `domains.activateCustomHostname` Activate a configured custom hostname **Risk:** `write` ```ts theme={null} await corsair.supabase.api.domains.activateCustomHostname({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### activateVanitySubdomain `domains.activateVanitySubdomain` Activate a vanity subdomain for a project **Risk:** `write` ```ts theme={null} await corsair.supabase.api.domains.activateVanitySubdomain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### checkVanitySubdomainAvailability `domains.checkVanitySubdomainAvailability` Check vanity subdomain availability **Risk:** `read` ```ts theme={null} await corsair.supabase.api.domains.checkVanitySubdomainAvailability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteCustomHostnameConfig `domains.deleteCustomHostnameConfig` Delete custom hostname configuration **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.domains.deleteCustomHostnameConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProjectVanitySubdomain `domains.deleteProjectVanitySubdomain` Delete a project vanity subdomain **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.domains.deleteProjectVanitySubdomain({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectCustomHostnameConfig `domains.getProjectCustomHostnameConfig` Get a project custom hostname configuration **Risk:** `read` ```ts theme={null} await corsair.supabase.api.domains.getProjectCustomHostnameConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getVanitySubdomainConfig `domains.getVanitySubdomainConfig` Get current vanity subdomain config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.domains.getVanitySubdomainConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectCustomHostname `domains.updateProjectCustomHostname` Update project custom hostname **Risk:** `write` ```ts theme={null} await corsair.supabase.api.domains.updateProjectCustomHostname({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### verifyCustomHostnameDns `domains.verifyCustomHostnameDns` Reverify custom hostname DNS **Risk:** `write` ```ts theme={null} await corsair.supabase.api.domains.verifyCustomHostnameDns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Edge Functions ### createFunction `edgeFunctions.createFunction` Create an Edge Function **Risk:** `write` ```ts theme={null} await corsair.supabase.api.edgeFunctions.createFunction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteFunction `edgeFunctions.deleteFunction` Delete an Edge Function **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.edgeFunctions.deleteFunction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | Yes | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deployFunction `edgeFunctions.deployFunction` Deploy an Edge Function **Risk:** `write` ```ts theme={null} await corsair.supabase.api.edgeFunctions.deployFunction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getFunction `edgeFunctions.getFunction` Retrieve an Edge Function **Risk:** `read` ```ts theme={null} await corsair.supabase.api.edgeFunctions.getFunction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | Yes | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getFunctionBody `edgeFunctions.getFunctionBody` Retrieve an Edge Function body **Risk:** `read` ```ts theme={null} await corsair.supabase.api.edgeFunctions.getFunctionBody({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | Yes | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### invokeEdgeFunction `edgeFunctions.invokeEdgeFunction` Invoke an Edge Function **Risk:** `write` ```ts theme={null} await corsair.supabase.api.edgeFunctions.invokeEdgeFunction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | Yes | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listFunctions `edgeFunctions.listFunctions` List Edge Functions **Risk:** `read` ```ts theme={null} await corsair.supabase.api.edgeFunctions.listFunctions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateFunction `edgeFunctions.updateFunction` Update an Edge Function **Risk:** `write` ```ts theme={null} await corsair.supabase.api.edgeFunctions.updateFunction({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | Yes | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateFunctions `edgeFunctions.updateFunctions` Bulk update Edge Functions **Risk:** `write` ```ts theme={null} await corsair.supabase.api.edgeFunctions.updateFunctions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Environments ### countActionRuns `environments.countActionRuns` Count action runs **Risk:** `read` ```ts theme={null} await corsair.supabase.api.environments.countActionRuns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createDatabaseBranch `environments.createDatabaseBranch` Create a database branch **Risk:** `write` ```ts theme={null} await corsair.supabase.api.environments.createDatabaseBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteDatabaseBranch `environments.deleteDatabaseBranch` Delete a database branch **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.environments.deleteDatabaseBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | Yes | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### disablePreviewBranching `environments.disablePreviewBranching` Disable preview branching **Risk:** `write` ```ts theme={null} await corsair.supabase.api.environments.disablePreviewBranching({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActionRun `environments.getActionRun` Get action run status **Risk:** `read` ```ts theme={null} await corsair.supabase.api.environments.getActionRun({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | Yes | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getActionRunLogs `environments.getActionRunLogs` Get action run logs **Risk:** `read` ```ts theme={null} await corsair.supabase.api.environments.getActionRunLogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | Yes | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getBranch `environments.getBranch` Get a database branch by name **Risk:** `read` ```ts theme={null} await corsair.supabase.api.environments.getBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | Yes | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getDatabaseBranchConfig `environments.getDatabaseBranchConfig` Get database branch config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.environments.getDatabaseBranchConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | Yes | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listDatabaseBranches `environments.listDatabaseBranches` List database branches **Risk:** `read` ```ts theme={null} await corsair.supabase.api.environments.listDatabaseBranches({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### pushBranch `environments.pushBranch` Push a database branch **Risk:** `write` ```ts theme={null} await corsair.supabase.api.environments.pushBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | Yes | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### resetDatabaseBranch `environments.resetDatabaseBranch` Reset a database branch **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.environments.resetDatabaseBranch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | Yes | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateDatabaseBranchConfig `environments.updateDatabaseBranchConfig` Update database branch config **Risk:** `write` ```ts theme={null} await corsair.supabase.api.environments.updateDatabaseBranchConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | Yes | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Oauth ### authorizeUserThroughOauth `oauth.authorizeUserThroughOauth` Generate a Supabase OAuth authorization URL **Risk:** `read` ```ts theme={null} await corsair.supabase.api.oauth.authorizeUserThroughOauth({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### exchangeOauthToken `oauth.exchangeOauthToken` Exchange an OAuth authorization code or refresh token **Risk:** `write` ```ts theme={null} await corsair.supabase.api.oauth.exchangeOauthToken({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Organizations ### createOrganization `organizations.createOrganization` Create an organization **Risk:** `write` ```ts theme={null} await corsair.supabase.api.organizations.createOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrganization `organizations.getOrganization` Get organization information **Risk:** `read` ```ts theme={null} await corsair.supabase.api.organizations.getOrganization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | Yes | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllOrganizations `organizations.listAllOrganizations` List organizations **Risk:** `read` ```ts theme={null} await corsair.supabase.api.organizations.listAllOrganizations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listOrganizationMembers `organizations.listOrganizationMembers` List organization members **Risk:** `read` ```ts theme={null} await corsair.supabase.api.organizations.listOrganizationMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | Yes | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Projects ### createProject `projects.createProject` Create a project **Risk:** `write` ```ts theme={null} await corsair.supabase.api.projects.createProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteProject `projects.deleteProject` Delete a project **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.projects.deleteProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAvailableRegions `projects.getAvailableRegions` Get available project regions **Risk:** `read` ```ts theme={null} await corsair.supabase.api.projects.getAvailableRegions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getHealth `projects.getHealth` Get project API health status **Risk:** `read` ```ts theme={null} await corsair.supabase.api.projects.getHealth({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProject `projects.getProject` Get a project **Risk:** `read` ```ts theme={null} await corsair.supabase.api.projects.getProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectNetworkBans `projects.getProjectNetworkBans` Retrieve project network bans **Risk:** `read` ```ts theme={null} await corsair.supabase.api.projects.getProjectNetworkBans({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectNetworkRestrictions `projects.getProjectNetworkRestrictions` Get project network restrictions **Risk:** `read` ```ts theme={null} await corsair.supabase.api.projects.getProjectNetworkRestrictions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectServiceHealthStatus `projects.getProjectServiceHealthStatus` Get project service health status **Risk:** `read` ```ts theme={null} await corsair.supabase.api.projects.getProjectServiceHealthStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectUpgradeEligibility `projects.getProjectUpgradeEligibility` Get project upgrade eligibility **Risk:** `read` ```ts theme={null} await corsair.supabase.api.projects.getProjectUpgradeEligibility({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectUpgradeStatus `projects.getProjectUpgradeStatus` Get project upgrade status **Risk:** `read` ```ts theme={null} await corsair.supabase.api.projects.getProjectUpgradeStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAllProjects `projects.listAllProjects` List projects **Risk:** `read` ```ts theme={null} await corsair.supabase.api.projects.listAllProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | No | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### patchNetworkRestrictions `projects.patchNetworkRestrictions` Patch project network restrictions **Risk:** `write` ```ts theme={null} await corsair.supabase.api.projects.patchNetworkRestrictions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### removeNetworkBans `projects.removeNetworkBans` Remove project network bans **Risk:** `write` ```ts theme={null} await corsair.supabase.api.projects.removeNetworkBans({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProject `projects.updateProject` Update a project **Risk:** `write` ```ts theme={null} await corsair.supabase.api.projects.updateProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectNetworkRestrictions `projects.updateProjectNetworkRestrictions` Apply project network restrictions **Risk:** `write` ```ts theme={null} await corsair.supabase.api.projects.updateProjectNetworkRestrictions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### upgradeProjectPostgresVersion `projects.upgradeProjectPostgresVersion` Upgrade project PostgreSQL version **Risk:** `write` ```ts theme={null} await corsair.supabase.api.projects.upgradeProjectPostgresVersion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Rest ### getProjectPostgrestConfig `rest.getProjectPostgrestConfig` Get project PostgREST config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.rest.getProjectPostgrestConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectPostgrestConfig `rest.updateProjectPostgrestConfig` Update project PostgREST config **Risk:** `write` ```ts theme={null} await corsair.supabase.api.rest.updateProjectPostgrestConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Secrets ### createApiKey `secrets.createApiKey` Create a project API key **Risk:** `write` ```ts theme={null} await corsair.supabase.api.secrets.createApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createBulkSecrets `secrets.createBulkSecrets` Create multiple project secrets **Risk:** `write` ```ts theme={null} await corsair.supabase.api.secrets.createBulkSecrets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteApiKey `secrets.deleteApiKey` Delete a project API key **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.secrets.deleteApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteSecrets `secrets.deleteSecrets` Delete multiple project secrets **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.supabase.api.secrets.deleteSecrets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectApiKey `secrets.getProjectApiKey` Get a project API key **Risk:** `read` ```ts theme={null} await corsair.supabase.api.secrets.getProjectApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectApiKeys `secrets.getProjectApiKeys` Get project API keys **Risk:** `read` ```ts theme={null} await corsair.supabase.api.secrets.getProjectApiKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectLegacyApiKeys `secrets.getProjectLegacyApiKeys` Get project legacy API keys status **Risk:** `read` ```ts theme={null} await corsair.supabase.api.secrets.getProjectLegacyApiKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getProjectPgsodiumConfig `secrets.getProjectPgsodiumConfig` Get project pgsodium config **Risk:** `read` ```ts theme={null} await corsair.supabase.api.secrets.getProjectPgsodiumConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listSecrets `secrets.listSecrets` List project secrets **Risk:** `read` ```ts theme={null} await corsair.supabase.api.secrets.listSecrets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateApiKey `secrets.updateApiKey` Update a project API key **Risk:** `write` ```ts theme={null} await corsair.supabase.api.secrets.updateApiKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | Yes | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updatePgsodiumConfig `secrets.updatePgsodiumConfig` Update pgsodium root key **Risk:** `destructive` ```ts theme={null} await corsair.supabase.api.secrets.updatePgsodiumConfig({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateProjectLegacyApiKeys `secrets.updateProjectLegacyApiKeys` Update project legacy API keys **Risk:** `write` ```ts theme={null} await corsair.supabase.api.secrets.updateProjectLegacyApiKeys({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Storage ### getResumableUploadBaseOptions `storage.getResumableUploadBaseOptions` Get TUS resumable upload base options **Risk:** `read` ```ts theme={null} await corsair.supabase.api.storage.getResumableUploadBaseOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getResumableUploadOptions `storage.getResumableUploadOptions` Get TUS resumable upload options **Risk:** `read` ```ts theme={null} await corsair.supabase.api.storage.getResumableUploadOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | Yes | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### handleResumableUploadSignOptions `storage.handleResumableUploadSignOptions` Handle TUS resumable upload sign options **Risk:** `read` ```ts theme={null} await corsair.supabase.api.storage.handleResumableUploadSignOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### handleResumableUploadSignOptionsWithId `storage.handleResumableUploadSignOptionsWithId` Handle TUS resumable upload sign options with ID **Risk:** `read` ```ts theme={null} await corsair.supabase.api.storage.handleResumableUploadSignOptionsWithId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | Yes | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listBuckets `storage.listBuckets` List storage buckets **Risk:** `read` ```ts theme={null} await corsair.supabase.api.storage.listBuckets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ref` | `string` | Yes | — | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | | `version` | `string` | No | — | | `runId` | `string` | No | — | | `tpaId` | `string` | No | — | | `providerId` | `string` | No | — | | `branchId` | `string` | No | — | | `functionSlug` | `string` | No | — | | `uploadId` | `string` | No | — | | `schema` | `string` | No | — | | `table` | `string` | No | — | | `columns` | `string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `mediaType` | `string` | No | — | | `baseUrl` | `string` | No | — | | `projectApiKey` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/supabase/database Supabase local sync: searchable entities, `.search()` filters, and operators. The Supabase plugin syncs data locally. Use `corsair.supabase.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Api Keys Path: `supabase.db.apiKeys.search` ```ts theme={null} const rows = await corsair.supabase.db.apiKeys.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Branches Path: `supabase.db.branches.search` ```ts theme={null} const rows = await corsair.supabase.db.branches.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ref` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `branch_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Buckets Path: `supabase.db.buckets.search` ```ts theme={null} const rows = await corsair.supabase.db.buckets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `public` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Functions Path: `supabase.db.functions.search` ```ts theme={null} const rows = await corsair.supabase.db.functions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Migrations Path: `supabase.db.migrations.search` ```ts theme={null} const rows = await corsair.supabase.db.migrations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `version` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `inserted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `supabase.db.organizations.search` ```ts theme={null} const rows = await corsair.supabase.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `supabase.db.projects.search` ```ts theme={null} const rows = await corsair.supabase.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `ref` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `region` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get credentials Source: https://docs.corsair.dev/plugins/supabase/get-credentials How to get Supabase credentials for the Corsair Supabase plugin ## API key Use a Supabase personal access token for Management API operations. 1. Open Supabase account settings. 2. Go to **Access Tokens**. 3. Create a personal access token. 4. Store it as `api_key`. ```bash theme={null} pnpm corsair setup --supabase api_key= ``` ## OAuth 2.0 Use OAuth when you want users to connect their own Supabase account through Corsair. 1. Create a Supabase OAuth app. 2. Add the redirect URL used by your Corsair app. 3. Store the OAuth app credentials with Corsair. ```bash theme={null} pnpm corsair setup \ --supabase client_id= \ --supabase client_secret= ``` Supabase OAuth app scopes are configured in the Supabase dashboard. ## Project API key Most Supabase Management API operations use the account token above. Project-hosted routes, such as invoking an Edge Function or TUS storage options, need a project API key too. Pass it in plugin options or per call: ```ts theme={null} supabase({ key: process.env.SUPABASE_ACCESS_TOKEN, projectApiKey: process.env.SUPABASE_PROJECT_API_KEY, }) ``` # Overview Source: https://docs.corsair.dev/plugins/supabase/overview Open-source Firebase alternative with Postgres, auth, storage, and realtime backend services. Use **Supabase** through Corsair: one client, typed API calls, local DB sync. Supabase exposes project, database, auth, functions, storage, and infrastructure workflows. Use Corsair permissions for destructive actions such as deleting projects, resetting branches, restoring backups, or changing network restrictions. **What you get:** * 121 typed API operations * 7 synced entities (`apiKeys`, `branches`, `buckets`, `functions`, `migrations`, `organizations`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/supabase ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/supabase ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/supabase ``` ```bash bun theme={null} bun add corsair @corsair-dev/supabase ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { supabase } from '@corsair-dev/supabase'; export const corsair = createCorsair({ plugins: [ supabase(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/supabase/get-credentials). ```ts theme={null} supabase() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Supabase OAuth app. Provider walkthrough: [Get Credentials](/plugins/supabase/get-credentials). ```ts theme={null} supabase({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'supabase', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`advisors.getPerformanceAdvisors`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.supabase.api.advisors.getPerformanceAdvisors({}); ``` **`auth.createProjectSigningKey`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.supabase.api.auth.createProjectSigningKey({}); ``` See the full list on the [API](/plugins/supabase/api) page. ## Query synced data Synced entities support `tenant.supabase.db..search()` and `.list()`: `apiKeys`, `branches`, `buckets`, `functions`, `migrations`, `organizations`, `projects`. See [Database](/plugins/supabase/database) for filters and operators. ## What's next > **[API reference](/plugins/supabase/api)** > > Every `supabase.api.*` operation with input and output types. > **[Database](/plugins/supabase/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/supabase/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/supadata/api API reference for Supadata: every `supadata.api.*` operation with input and output types. Every `supadata.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### me `account.me` Retrieve organization details, plan information and credit usage **Risk:** `read` ```ts theme={null} await corsair.supadata.api.account.me({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | | `plan` | `string` | Yes | — | | `maxCredits` | `number` | Yes | — | | `usedCredits` | `number` | Yes | — | *** ## Metadata ### get `metadata.get` Retrieve unified metadata for media from social platforms **Risk:** `read` ```ts theme={null} await corsair.supadata.api.metadata.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `platform` | `youtube \| tiktok \| instagram \| twitter \| facebook` | Yes | — | | `type` | `video \| image \| carousel \| post` | Yes | — | | `id` | `string` | Yes | — | | `url` | `string` | No | — | | `title` | `string` | No | — | | `description` | `string` | No | — | | `author` | `object` | No | — | | `stats` | `object` | No | — | | `media` | `object` | No | — | | `tags` | `string[]` | No | — | | `createdAt` | `string` | No | — | | `additionalData` | `object` | No | — | > **author full type** > > ```ts theme={null} > { > displayName: string, > username?: string, > avatarUrl?: string, > verified?: boolean > } > ``` > **stats full type** > > ```ts theme={null} > { > likes?: number | null, > comments?: number | null, > shares?: number | null, > views?: number | null > } > ``` > **media full type** > > ```ts theme={null} > { > type: video | image | carousel | post, > duration?: number, > thumbnailUrl?: string, > url?: string, > items?: any[] > } > ``` > **additionalData full type** > > ```ts theme={null} > { > } > ``` *** ## Transcript ### get `transcript.get` Retrieve a transcript for a video or file URL **Risk:** `read` ```ts theme={null} await corsair.supadata.api.transcript.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `lang` | `string` | No | — | | `text` | `boolean` | No | — | | `chunkSize` | `number` | No | — | | `mode` | `native \| auto \| generate` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > content: string | { > text: string, > offset: number, > duration: number, > lang?: string > }[], > lang: string, > availableLangs: string[] > } | { > jobId: string > } > ``` *** ### getJob `transcript.getJob` Retrieve the status or result of an asynchronous transcript job **Risk:** `read` ```ts theme={null} await corsair.supadata.api.transcript.getJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `queued \| active \| completed \| failed` | Yes | — | | `error` | `object` | No | — | | `content` | `object[]` | No | — | | `lang` | `string` | No | — | | `availableLangs` | `string[]` | No | — | > **error full type** > > ```ts theme={null} > { > error: string, > message: string, > details: string, > documentationUrl?: string > } > ``` > **content full type** > > ```ts theme={null} > string | { > text: string, > offset: number, > duration: number, > lang?: string > }[] > ``` *** ## Web ### map `web.map` Discover every URL on a website **Risk:** `read` ```ts theme={null} await corsair.supadata.api.web.map({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `urls` | `string[]` | Yes | — | *** ### scrape `web.scrape` Extract web page content as Markdown **Risk:** `read` ```ts theme={null} await corsair.supadata.api.web.scrape({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `noLinks` | `boolean` | No | — | | `lang` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `content` | `string` | Yes | — | | `countCharacters` | `number` | Yes | — | | `urls` | `string[]` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `ogUrl` | `string` | No | — | *** ## Youtube ### channel `youtube.channel` Retrieve metadata for a YouTube channel **Risk:** `read` ```ts theme={null} await corsair.supadata.api.youtube.channel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `handle` | `string` | No | — | | `description` | `string` | No | — | | `subscriberCount` | `number` | No | — | | `videoCount` | `number` | No | — | | `viewCount` | `number` | No | — | | `thumbnail` | `string` | No | — | | `banner` | `string` | No | — | *** ### channelVideos `youtube.channelVideos` List video, Shorts and live stream IDs for a YouTube channel **Risk:** `read` ```ts theme={null} await corsair.supadata.api.youtube.channelVideos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `type` | `all \| video \| short \| live` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `videoIds` | `string[]` | Yes | — | | `shortIds` | `string[]` | Yes | — | | `liveIds` | `string[]` | Yes | — | *** ### playlist `youtube.playlist` Retrieve metadata for a YouTube playlist **Risk:** `read` ```ts theme={null} await corsair.supadata.api.youtube.playlist({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `videoCount` | `number` | Yes | — | | `channel` | `object` | Yes | — | | `description` | `string` | No | — | | `viewCount` | `number` | No | — | | `lastUpdated` | `string` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name: string, > thumbnail?: string > } > ``` *** ### playlistVideos `youtube.playlistVideos` List video, Shorts and live stream IDs for a YouTube playlist **Risk:** `read` ```ts theme={null} await corsair.supadata.api.youtube.playlistVideos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `videoIds` | `string[]` | Yes | — | | `shortIds` | `string[]` | Yes | — | | `liveIds` | `string[]` | Yes | — | *** ### search `youtube.search` Search YouTube for videos, channels or playlists **Risk:** `read` ```ts theme={null} await corsair.supadata.api.youtube.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `type` | `all \| video \| channel \| playlist \| movie` | No | — | | `limit` | `number` | No | — | | `uploadDate` | `all \| hour \| today \| week \| month \| year` | No | — | | `sortBy` | `relevance \| rating \| date \| views` | No | — | | `duration` | `all \| short \| medium \| long` | No | — | | `features` | `360 \| hd \| subtitles \| creative-commons \| 3d \| live \| 4k \| location \| hdr \| vr180[]` | No | — | | `nextPageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `results` | `object[]` | Yes | — | | `totalResults` | `number` | No | — | | `nextPageToken` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > type: video | channel | playlist, > id: string, > title: string, > description?: string, > thumbnail?: string, > duration?: number, > viewCount?: number, > uploadDate?: string, > channel?: { > id: string, > name: string, > thumbnail?: string > }, > handle?: string, > videoCount?: number > }[] > ``` *** ### video `youtube.video` Retrieve metadata for a YouTube video **Risk:** `read` ```ts theme={null} await corsair.supadata.api.youtube.video({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | Yes | — | | `duration` | `number` | Yes | — | | `channel` | `object` | Yes | — | | `tags` | `string[]` | Yes | — | | `transcriptLanguages` | `string[]` | Yes | — | | `thumbnail` | `string` | No | — | | `uploadDate` | `string` | No | — | | `viewCount` | `number` | No | — | | `likeCount` | `number` | No | — | | `isLive` | `boolean` | No | — | > **channel full type** > > ```ts theme={null} > { > id: string, > name: string, > thumbnail?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/supadata/database Supadata local sync: searchable entities, `.search()` filters, and operators. The Supadata plugin syncs data locally. Use `corsair.supadata.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `supadata.db.accounts.search` ```ts theme={null} const rows = await corsair.supadata.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `organizationId` | `string` | equals, contains, startsWith, endsWith, in | | `plan` | `string` | equals, contains, startsWith, endsWith, in | | `maxCredits` | `number` | equals, gt, gte, lt, lte, in | | `usedCredits` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Media Metadata Path: `supadata.db.mediaMetadata.search` ```ts theme={null} const rows = await corsair.supadata.db.mediaMetadata.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transcript Jobs Path: `supadata.db.transcriptJobs.search` ```ts theme={null} const rows = await corsair.supadata.db.transcriptJobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `lang` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Transcripts Path: `supadata.db.transcripts.search` ```ts theme={null} const rows = await corsair.supadata.db.transcripts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `lang` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Web Maps Path: `supadata.db.webMaps.search` ```ts theme={null} const rows = await corsair.supadata.db.webMaps.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Web Pages Path: `supadata.db.webPages.search` ```ts theme={null} const rows = await corsair.supadata.db.webPages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `countCharacters` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `ogUrl` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Youtube Channels Path: `supadata.db.youtubeChannels.search` ```ts theme={null} const rows = await corsair.supadata.db.youtubeChannels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `handle` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `subscriberCount` | `number` | equals, gt, gte, lt, lte, in | | `videoCount` | `number` | equals, gt, gte, lt, lte, in | | `viewCount` | `number` | equals, gt, gte, lt, lte, in | | `thumbnail` | `string` | equals, contains, startsWith, endsWith, in | | `banner` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Youtube Playlists Path: `supadata.db.youtubePlaylists.search` ```ts theme={null} const rows = await corsair.supadata.db.youtubePlaylists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `videoCount` | `number` | equals, gt, gte, lt, lte, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `viewCount` | `number` | equals, gt, gte, lt, lte, in | | `lastUpdated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Youtube Search Results Path: `supadata.db.youtubeSearchResults.search` ```ts theme={null} const rows = await corsair.supadata.db.youtubeSearchResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnail` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `viewCount` | `number` | equals, gt, gte, lt, lte, in | | `uploadDate` | `string` | equals, contains, startsWith, endsWith, in | | `handle` | `string` | equals, contains, startsWith, endsWith, in | | `videoCount` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Youtube Videos Path: `supadata.db.youtubeVideos.search` ```ts theme={null} const rows = await corsair.supadata.db.youtubeVideos.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `thumbnail` | `string` | equals, contains, startsWith, endsWith, in | | `uploadDate` | `string` | equals, contains, startsWith, endsWith, in | | `viewCount` | `number` | equals, gt, gte, lt, lte, in | | `likeCount` | `number` | equals, gt, gte, lt, lte, in | | `isLive` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/supadata/overview Supadata plugin for Corsair Use **Supadata** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 12 typed API operations * 10 synced entities (`accounts`, `mediaMetadata`, `transcriptJobs`, `transcripts`, `webMaps`, `webPages`, and 4 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/supadata ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/supadata ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/supadata ``` ```bash bun theme={null} bun add corsair @corsair-dev/supadata ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { supadata } from '@corsair-dev/supadata'; export const corsair = createCorsair({ plugins: [ supadata(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} supadata() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'supadata', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.me`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.supadata.api.account.me({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/supadata/api) reference.* See the full list on the [API](/plugins/supadata/api) page. ## Query synced data Synced entities support `tenant.supadata.db..search()` and `.list()`: `accounts`, `mediaMetadata`, `transcriptJobs`, `transcripts`, `webMaps`, `webPages`, `youtubeChannels`, `youtubePlaylists`, `youtubeSearchResults`, `youtubeVideos`. See [Database](/plugins/supadata/database) for filters and operators. ## What's next > **[API reference](/plugins/supadata/api)** > > Every `supadata.api.*` operation with input and output types. > **[Database](/plugins/supadata/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Database Source: https://docs.corsair.dev/plugins/surf/database Surf local sync: searchable entities, `.search()` filters, and operators. The Surf plugin syncs data locally. Use `corsair.surf.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/surf/overview Crypto and US equity market data from the Surf Data API. Use **Surf** through Corsair: one client, typed API calls. **What you get:** * 124 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/surf ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/surf ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/surf ``` ```bash bun theme={null} bun add corsair @corsair-dev/surf ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { surf } from '@corsair-dev/surf'; export const corsair = createCorsair({ plugins: [ surf(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} surf() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'surf', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`dex.tokenPrice`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.surf.api.dex.tokenPrice({}); ``` **`onchain.query`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.surf.api.onchain.query({}); ``` See the full list on the [API](/plugins/surf/api) page. ## What's next > **[API reference](/plugins/surf/api)** > > Every `surf.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/suzanne/api API reference for Suzanne: every `suzanne.api.*` operation with input and output types. Every `suzanne.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Generations ### photoTo3d `generations.photoTo3d` Submit one to four photos and queue a 3D mesh job **Risk:** `write` ```ts theme={null} await corsair.suzanne.api.generations.photoTo3d({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `sculptor \| atelier \| capture` | Yes | — | | `images_upload_ids` | `object` | No | — | | `images_inline` | `object` | No | — | | `params` | `object` | No | — | | `outputs` | `glb \| obj \| stl \| fbx[]` | No | — | | `idempotencyKey` | `string` | No | — | > **images\_upload\_ids full type** > > ```ts theme={null} > { > front: string, > back?: string, > left?: string, > right?: string > } > ``` > **images\_inline full type** > > ```ts theme={null} > { > front: string > } > ``` > **params full type** > > ```ts theme={null} > { > faces?: 200000 | 500000 | 1000000 | 2000000, > pbr?: boolean, > quad?: boolean, > texture_quality?: standard | detailed > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `billable_amount_cents` | `number` | Yes | — | *** ### textTo3d `generations.textTo3d` Submit a text prompt and queue a 3D mesh job **Risk:** `write` ```ts theme={null} await corsair.suzanne.api.generations.textTo3d({ model: 'sculptor', prompt: 'a low-poly fox', idempotencyKey: '3f1d6c5e-2b7a-4f0e-9c2d-8a1b6e4f0c11' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `sculptor \| atelier` | Yes | — | | `prompt` | `string` | Yes | — | | `params` | `object` | No | — | | `outputs` | `glb \| obj \| stl \| fbx[]` | No | — | | `idempotencyKey` | `string` | No | — | > **params full type** > > ```ts theme={null} > { > faces?: 200000 | 500000 | 1000000 | 2000000, > pbr?: boolean, > quad?: boolean, > texture_quality?: standard | detailed > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `billable_amount_cents` | `number` | Yes | — | *** ## Jobs ### cancel `jobs.cancel` Cancel a queued or running generation job **Risk:** `destructive` ```ts theme={null} await corsair.suzanne.api.jobs.cancel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `already_terminal` | `boolean` | Yes | — | *** ### get `jobs.get` Read a generation job and its download URLs **Risk:** `read` ```ts theme={null} await corsair.suzanne.api.jobs.get({ job_id: 'job_01H' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `model` | `string` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `outputs` | `object[]` | No | — | | `error` | `object` | No | — | > **outputs full type** > > ```ts theme={null} > { > format: string, > download_url: string > }[] > ``` > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` *** ## Models ### download `models.download` Mint a fresh download URL for a finished mesh **Risk:** `read` ```ts theme={null} await corsair.suzanne.api.models.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `format` | `glb \| obj \| stl \| fbx` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | *** ## Uploads ### create `uploads.create` Create a presigned URL for a JPEG or PNG upload **Risk:** `write` ```ts theme={null} await corsair.suzanne.api.uploads.create({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `upload_id` | `string` | Yes | — | | `upload_url` | `string` | Yes | — | | `expires_at` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/suzanne/database Suzanne local sync: searchable entities, `.search()` filters, and operators. The Suzanne plugin syncs data locally. Use `corsair.suzanne.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Jobs Path: `suzanne.db.jobs.search` ```ts theme={null} const rows = await corsair.suzanne.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `jobId` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `providerCreatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `completedAt` | `string` | equals, contains, startsWith, endsWith, in | | `billableAmountCents` | `number` | equals, gt, gte, lt, lte, in | | `errorCode` | `string` | equals, contains, startsWith, endsWith, in | | `errorMessage` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/suzanne/overview Turn a text prompt or photos into a downloadable 3D mesh. Use **Suzanne** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 6 typed API operations * 1 synced entity (`jobs`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/suzanne ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/suzanne ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/suzanne ``` ```bash bun theme={null} bun add corsair @corsair-dev/suzanne ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { suzanne } from '@corsair-dev/suzanne'; export const corsair = createCorsair({ plugins: [ suzanne(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} suzanne() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'suzanne', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`jobs.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.suzanne.api.jobs.get({}); ``` **`generations.photoTo3d`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.suzanne.api.generations.photoTo3d({}); ``` See the full list on the [API](/plugins/suzanne/api) page. ## Query synced data Synced entities support `tenant.suzanne.db..search()` and `.list()`: `jobs`. See [Database](/plugins/suzanne/database) for filters and operators. ## What's next > **[API reference](/plugins/suzanne/api)** > > Every `suzanne.api.*` operation with input and output types. > **[Database](/plugins/suzanne/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/synthflowai/api API reference for Synthflow AI: every `synthflowai.api.*` operation with input and output types. Every `synthflowai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Actions ### attach `actions.attach` Attach actions to a Synthflow AI agent **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.actions.attach({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | Yes | — | | `actions` | `string[]` | No | — | | `action_ids` | `string[]` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### create `actions.create` Create a new action in Synthflow AI **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.actions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `REAL_TIME_BOOKING` | `object` | No | — | | `CALCOM` | `object` | No | — | | `GHL` | `object` | No | — | | `INFORMATION_EXTRACTOR` | `object` | No | — | | `LIVE_TRANSFER` | `object` | No | — | | `SEND_SMS` | `object` | No | — | | `INCALL_SMS` | `object` | No | — | | `INCALL_WHATSAPP` | `object` | No | — | | `CUSTOM_ACTION` | `object` | No | — | | `CUSTOM_EVAL` | `object` | No | — | > **REAL\_TIME\_BOOKING full type** > > ```ts theme={null} > { > } > ``` > **CALCOM full type** > > ```ts theme={null} > { > } > ``` > **GHL full type** > > ```ts theme={null} > { > } > ``` > **INFORMATION\_EXTRACTOR full type** > > ```ts theme={null} > { > } > ``` > **LIVE\_TRANSFER full type** > > ```ts theme={null} > { > } > ``` > **SEND\_SMS full type** > > ```ts theme={null} > { > } > ``` > **INCALL\_SMS full type** > > ```ts theme={null} > { > } > ``` > **INCALL\_WHATSAPP full type** > > ```ts theme={null} > { > } > ``` > **CUSTOM\_ACTION full type** > > ```ts theme={null} > { > } > ``` > **CUSTOM\_EVAL full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### delete `actions.delete` Delete an action in Synthflow AI **Risk:** `destructive` ```ts theme={null} await corsair.synthflowai.api.actions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `action_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### detach `actions.detach` Detach actions from a Synthflow AI agent **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.actions.detach({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | Yes | — | | `actions` | `string[]` | No | — | | `action_ids` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### get `actions.get` Retrieve metadata about a specific action by ID **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.actions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `action_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### list `actions.list` List all actions in the workspace **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.actions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### update `actions.update` Update an existing action in Synthflow AI **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.actions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `action_id` | `string` | Yes | — | | `REAL_TIME_BOOKING` | `object` | No | — | | `CALCOM` | `object` | No | — | | `GHL` | `object` | No | — | | `INFORMATION_EXTRACTOR` | `object` | No | — | | `LIVE_TRANSFER` | `object` | No | — | | `SEND_SMS` | `object` | No | — | | `INCALL_SMS` | `object` | No | — | | `INCALL_WHATSAPP` | `object` | No | — | | `CUSTOM_ACTION` | `object` | No | — | | `CUSTOM_EVAL` | `object` | No | — | > **REAL\_TIME\_BOOKING full type** > > ```ts theme={null} > { > } > ``` > **CALCOM full type** > > ```ts theme={null} > { > } > ``` > **GHL full type** > > ```ts theme={null} > { > } > ``` > **INFORMATION\_EXTRACTOR full type** > > ```ts theme={null} > { > } > ``` > **LIVE\_TRANSFER full type** > > ```ts theme={null} > { > } > ``` > **SEND\_SMS full type** > > ```ts theme={null} > { > } > ``` > **INCALL\_SMS full type** > > ```ts theme={null} > { > } > ``` > **INCALL\_WHATSAPP full type** > > ```ts theme={null} > { > } > ``` > **CUSTOM\_ACTION full type** > > ```ts theme={null} > { > } > ``` > **CUSTOM\_EVAL full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ## Assistants ### create `assistants.create` Create a new Synthflow AI assistant **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.assistants.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `outbound \| inbound \| widget` | Yes | — | | `name` | `string` | Yes | — | | `agent` | `object` | Yes | — | | `description` | `string` | No | — | | `phone_number` | `string` | No | — | | `external_webhook_url` | `string` | No | — | | `is_recording` | `boolean` | No | — | > **agent full type** > > ```ts theme={null} > { > prompt: string, > greeting_message: string, > llm: string, > language: string, > voice_id: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `object` | No | — | | `details` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > model_id?: string > } > ``` > **details full type** > > ```ts theme={null} > { > phone?: string, > voice?: string > } > ``` *** ### delete `assistants.delete` Delete a Synthflow AI assistant **Risk:** `destructive` ```ts theme={null} await corsair.synthflowai.api.assistants.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | No | — | | `assistant_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### get `assistants.get` Retrieve details of an existing Synthflow AI assistant **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.assistants.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | No | — | | `assistant_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### list `assistants.list` List all Synthflow AI assistants **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.assistants.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > pagination?: { > total_records?: number, > limit?: number, > offset?: number > }, > assistants?: { > }[] | { > } > } > ``` *** ### update `assistants.update` Update a Synthflow AI assistant's settings **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.assistants.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | No | — | | `assistant_id` | `string` | No | — | | `name` | `string` | No | — | | `type` | `outbound \| inbound \| widget` | No | — | | `description` | `string` | No | — | | `phone_number` | `string` | No | — | | `external_webhook_url` | `string` | No | — | | `is_recording` | `boolean` | No | — | | `agent` | `object` | No | — | > **agent full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ## Calls ### create `calls.create` Initiate an outbound voice call via Synthflow AI **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.calls.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | Yes | — | | `phone` | `string` | Yes | — | | `name` | `string` | Yes | — | | `from_phone_number` | `string` | No | — | | `custom_variables` | `object` | No | — | | `lead_email` | `string` | No | — | | `lead_timezone` | `string` | No | — | | `prompt` | `string` | No | — | | `greeting` | `string` | No | — | > **custom\_variables full type** > > ```ts theme={null} > { > key: string, > value: string > }[] | { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `object` | No | — | | `eta` | `number` | No | — | > **response full type** > > ```ts theme={null} > { > answer?: string, > call_id?: string > } > ``` *** ### get `calls.get` Retrieve details and transcript of a phone call **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.calls.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `call_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### list `calls.list` List call history logs for a Synthflow AI model **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.calls.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `from_date` | `number` | No | — | | `to_date` | `number` | No | — | | `call_status` | `string` | No | — | | `duration_min` | `number` | No | — | | `duration_max` | `number` | No | — | | `lead_phone_number` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > pagination?: { > }, > calls?: { > }[] > } > ``` *** ## Contacts ### create `contacts.create` Create a new contact in Synthflow AI **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `phone_number` | `string` | Yes | — | | `email` | `string` | No | — | | `company` | `string` | No | — | | `contact_metadata` | `object` | No | — | > **contact\_metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > id?: string > } > ``` *** ### delete `contacts.delete` Delete a contact in Synthflow AI **Risk:** `destructive` ```ts theme={null} await corsair.synthflowai.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### get `contacts.get` Retrieve details of a contact by ID **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### list `contacts.list` List contacts in Synthflow AI **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > pagination?: { > }, > contacts?: { > }[] > } > ``` *** ### update `contacts.update` Update contact details in Synthflow AI **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contact_id` | `string` | Yes | — | | `name` | `string` | No | — | | `phone_number` | `string` | No | — | | `email` | `string` | No | — | | `contact_metadata` | `object` | No | — | > **contact\_metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ## Knowledge Bases ### attach `knowledgeBases.attach` Attach a knowledge base to an assistant model **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.knowledgeBases.attach({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | | `model_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > body?: any, > knowledge_base_id?: string, > model_id?: string > } > ``` *** ### create `knowledgeBases.create` Create a new knowledge base in Synthflow AI **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.knowledgeBases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `rag_use_condition` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > body?: string, > knowledge_base_id?: string > } > ``` *** ### delete `knowledgeBases.delete` Delete a knowledge base in Synthflow AI **Risk:** `destructive` ```ts theme={null} await corsair.synthflowai.api.knowledgeBases.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### detach `knowledgeBases.detach` Detach a knowledge base from an assistant model **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.knowledgeBases.detach({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | | `model_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### get `knowledgeBases.get` Get details of a knowledge base by ID **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.knowledgeBases.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### update `knowledgeBases.update` Update a knowledge base name or usage conditions **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.knowledgeBases.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `knowledge_base_id` | `string` | Yes | — | | `name` | `string` | No | — | | `rag_use_condition` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ## Memory Stores ### attachToAgent `memoryStores.attachToAgent` Attach a memory store to an assistant agent **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.memoryStores.attachToAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `memory_store_id` | `string` | Yes | — | | `model_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### create `memoryStores.create` Create a new memory store in Synthflow AI **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.memoryStores.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > id?: string > } > ``` *** ### delete `memoryStores.delete` Delete a memory store in Synthflow AI **Risk:** `destructive` ```ts theme={null} await corsair.synthflowai.api.memoryStores.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `memory_store_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### detachFromAgent `memoryStores.detachFromAgent` Detach a memory store from an assistant agent **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.memoryStores.detachFromAgent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `memory_store_id` | `string` | Yes | — | | `model_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### get `memoryStores.get` Get details of a memory store by ID **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.memoryStores.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `memory_store_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### list `memoryStores.list` List memory stores in Synthflow AI **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.memoryStores.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### update `memoryStores.update` Update a memory store's title and description **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.memoryStores.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `memory_store_id` | `string` | Yes | — | | `title` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ## Phone Books ### create `phoneBooks.create` Create a new phone book in Synthflow AI **Risk:** `write` ```ts theme={null} await corsair.synthflowai.api.phoneBooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### delete `phoneBooks.delete` Delete a phone book in Synthflow AI **Risk:** `destructive` ```ts theme={null} await corsair.synthflowai.api.phoneBooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phone_book_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ### list `phoneBooks.list` List all phone books in the workspace **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.phoneBooks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** ## Voices ### list `voices.list` List all text-to-speech voices available in the workspace **Risk:** `read` ```ts theme={null} await corsair.synthflowai.api.voices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `search` | `string` | No | — | | `provider` | `elevenlabs \| deepgram \| synthflow` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `response` | `any` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/synthflowai/database Synthflow AI local sync: searchable entities, `.search()` filters, and operators. The Synthflow AI plugin syncs data locally. Use `corsair.synthflowai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Actions Path: `synthflowai.db.actions.search` ```ts theme={null} const rows = await corsair.synthflowai.db.actions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `action_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Assistants Path: `synthflowai.db.assistants.search` ```ts theme={null} const rows = await corsair.synthflowai.db.assistants.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `model_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Calls Path: `synthflowai.db.calls.search` ```ts theme={null} const rows = await corsair.synthflowai.db.calls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `call_id` | `string` | equals, contains, startsWith, endsWith, in | | `model_id` | `string` | equals, contains, startsWith, endsWith, in | | `call_status` | `string` | equals, contains, startsWith, endsWith, in | | `lead_phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `synthflowai.db.contacts.search` ```ts theme={null} const rows = await corsair.synthflowai.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Knowledge Bases Path: `synthflowai.db.knowledgeBases.search` ```ts theme={null} const rows = await corsair.synthflowai.db.knowledgeBases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `knowledge_base_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `rag_use_condition` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Memory Stores Path: `synthflowai.db.memoryStores.search` ```ts theme={null} const rows = await corsair.synthflowai.db.memoryStores.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Phone Books Path: `synthflowai.db.phoneBooks.search` ```ts theme={null} const rows = await corsair.synthflowai.db.phoneBooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `phone_book_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `workspace_id` | `string` | equals, contains, startsWith, endsWith, in | | `entry_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Voices Path: `synthflowai.db.voices.search` ```ts theme={null} const rows = await corsair.synthflowai.db.voices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `voice_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `workspace` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/synthflowai/overview Voice AI platform for building phone agents, call automation, and conversational IVR flows. Use **Synthflow AI** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 37 typed API operations * 8 synced entities (`actions`, `assistants`, `calls`, `contacts`, `knowledgeBases`, `memoryStores`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/synthflowai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/synthflowai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/synthflowai ``` ```bash bun theme={null} bun add corsair @corsair-dev/synthflowai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { synthflowai } from '@corsair-dev/synthflowai'; export const corsair = createCorsair({ plugins: [ synthflowai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} synthflowai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'synthflowai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`actions.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.synthflowai.api.actions.get({}); ``` **`actions.attach`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.synthflowai.api.actions.attach({}); ``` See the full list on the [API](/plugins/synthflowai/api) page. ## Query synced data Synced entities support `tenant.synthflowai.db..search()` and `.list()`: `actions`, `assistants`, `calls`, `contacts`, `knowledgeBases`, `memoryStores`, `phoneBooks`, `voices`. See [Database](/plugins/synthflowai/database) for filters and operators. ## What's next > **[API reference](/plugins/synthflowai/api)** > > Every `synthflowai.api.*` operation with input and output types. > **[Database](/plugins/synthflowai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/tally/api API reference for Tally: every `tally.api.*` operation with input and output types. Every `tally.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Forms ### create `forms.create` Create a new form **Risk:** `write` ```ts theme={null} await corsair.tally.api.forms.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | No | — | | `templateId` | `string` | No | — | | `status` | `string` | Yes | — | | `blocks` | `object[]` | Yes | — | | `settings` | `object` | No | — | > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **settings full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `workspaceId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `blocks` | `object[]` | No | — | | `settings` | `object` | No | — | > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **settings full type** > > ```ts theme={null} > { > } > ``` *** ### delete `forms.delete` Delete a form **Risk:** `destructive` ```ts theme={null} await corsair.tally.api.forms.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | **Output:** `void` *** ### get `forms.get` Retrieve a form by ID **Risk:** `read` ```ts theme={null} await corsair.tally.api.forms.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `workspaceId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `blocks` | `object[]` | No | — | | `settings` | `object` | No | — | > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **settings full type** > > ```ts theme={null} > { > } > ``` *** ### list `forms.list` List all forms with optional pagination and workspace filter **Risk:** `read` ```ts theme={null} await corsair.tally.api.forms.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `workspaceIds` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `total` | `number` | No | — | | `hasMore` | `boolean` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > name?: string, > status?: string, > workspaceId?: string | null, > createdAt?: string, > updatedAt?: string, > blocks?: { > }[], > settings?: { > } > }[] > ``` *** ### update `forms.update` Update an existing form **Risk:** `write` ```ts theme={null} await corsair.tally.api.forms.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `blocks` | `object[]` | No | — | | `settings` | `object` | No | — | > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **settings full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | | `workspaceId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `blocks` | `object[]` | No | — | | `settings` | `object` | No | — | > **blocks full type** > > ```ts theme={null} > { > }[] > ``` > **settings full type** > > ```ts theme={null} > { > } > ``` *** ## Organizations ### cancelInvite `organizations.cancelInvite` Cancel a pending organization invite **Risk:** `destructive` ```ts theme={null} await corsair.tally.api.organizations.cancelInvite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | | `inviteId` | `string` | Yes | — | **Output:** `void` *** ### createInvite `organizations.createInvite` Invite users to an organization **Risk:** `write` ```ts theme={null} await corsair.tally.api.organizations.createInvite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | | `workspaceIds` | `string[]` | Yes | — | | `emails` | `string` | Yes | — | **Output:** `void` *** ### listInvites `organizations.listInvites` List pending invites for an organization **Risk:** `read` ```ts theme={null} await corsair.tally.api.organizations.listInvites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > organizationId?: string, > email?: string, > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### listUsers `organizations.listUsers` List all users in an organization **Risk:** `read` ```ts theme={null} await corsair.tally.api.organizations.listUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > email?: string, > name?: string | null, > subscriptionPlan?: string | null > }[] > ``` *** ### removeUser `organizations.removeUser` Remove a user from an organization **Risk:** `destructive` ```ts theme={null} await corsair.tally.api.organizations.removeUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `string` | Yes | — | | `userId` | `string` | Yes | — | **Output:** `void` *** ## Questions ### list `questions.list` List all questions for a form **Risk:** `read` ```ts theme={null} await corsair.tally.api.questions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `questions` | `object[]` | Yes | — | | `hasResponses` | `boolean` | No | — | > **questions full type** > > ```ts theme={null} > { > id: string, > type?: string, > title?: string | null, > isTitleModifiedByUser?: boolean, > formId?: string, > isDeleted?: boolean, > numberOfResponses?: number, > createdAt?: string, > updatedAt?: string, > fields?: { > }[] > }[] > ``` *** ## Submissions ### delete `submissions.delete` Delete a form submission **Risk:** `destructive` ```ts theme={null} await corsair.tally.api.submissions.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `submissionId` | `string` | Yes | — | **Output:** `void` *** ### get `submissions.get` Retrieve a specific form submission **Risk:** `read` ```ts theme={null} await corsair.tally.api.submissions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `submissionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `questions` | `object[]` | No | — | | `submission` | `object` | Yes | — | > **questions full type** > > ```ts theme={null} > { > id: string, > type?: string, > title?: string | null, > isTitleModifiedByUser?: boolean, > formId?: string, > isDeleted?: boolean, > numberOfResponses?: number, > createdAt?: string, > updatedAt?: string, > fields?: { > }[] > }[] > ``` > **submission full type** > > ```ts theme={null} > { > id: string, > respondentId?: string | null, > formId?: string, > createdAt?: string, > isCompleted?: boolean, > responses?: { > id: string, > formId?: string, > questionId?: string, > respondentId?: string, > submissionId?: string | null, > sessionUuid?: string, > answer?: any, > formattedAnswer?: string, > createdAt?: string, > updatedAt?: string > }[] > } > ``` *** ### list `submissions.list` List form submissions with optional filters **Risk:** `read` ```ts theme={null} await corsair.tally.api.submissions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `filter` | `all \| completed \| partial` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `afterId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `hasMore` | `boolean` | No | — | | `totalNumberOfSubmissionsPerFilter` | `object` | No | — | | `questions` | `object[]` | No | — | | `submissions` | `object[]` | Yes | — | > **totalNumberOfSubmissionsPerFilter full type** > > ```ts theme={null} > { > } > ``` > **questions full type** > > ```ts theme={null} > { > id: string, > type?: string, > title?: string | null, > isTitleModifiedByUser?: boolean, > formId?: string, > isDeleted?: boolean, > numberOfResponses?: number, > createdAt?: string, > updatedAt?: string, > fields?: { > }[] > }[] > ``` > **submissions full type** > > ```ts theme={null} > { > id: string, > respondentId?: string | null, > formId?: string, > createdAt?: string, > isCompleted?: boolean, > responses?: { > id: string, > formId?: string, > questionId?: string, > respondentId?: string, > submissionId?: string | null, > sessionUuid?: string, > answer?: any, > formattedAnswer?: string, > createdAt?: string, > updatedAt?: string > }[] > }[] > ``` *** ## Users ### getMe `users.getMe` Retrieve the current authenticated user **Risk:** `read` ```ts theme={null} await corsair.tally.api.users.getMe({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `email` | `string` | No | — | | `name` | `string` | No | — | | `subscriptionPlan` | `string` | No | — | *** ## Webhook Management ### create `webhookManagement.create` Create a new webhook subscription **Risk:** `write` ```ts theme={null} await corsair.tally.api.webhookManagement.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `formId` | `string` | Yes | — | | `url` | `string` | Yes | — | | `eventTypes` | `string[]` | Yes | — | | `signingSecret` | `string` | No | — | | `httpHeaders` | `object[]` | No | — | | `externalSubscriber` | `string` | No | — | > **httpHeaders full type** > > ```ts theme={null} > { > name: string, > value: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `url` | `string` | No | — | | `eventTypes` | `string[]` | No | — | | `isEnabled` | `boolean` | No | — | | `signingSecret` | `string` | No | — | | `createdAt` | `string` | No | — | *** ### delete `webhookManagement.delete` Delete a webhook subscription **Risk:** `destructive` ```ts theme={null} await corsair.tally.api.webhookManagement.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | **Output:** `void` *** ### list `webhookManagement.list` List all webhooks **Risk:** `read` ```ts theme={null} await corsair.tally.api.webhookManagement.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `hasMore` | `boolean` | No | — | | `totalCount` | `number` | No | — | > **webhooks full type** > > ```ts theme={null} > { > id: string, > url?: string, > eventTypes?: string[], > isEnabled?: boolean, > signingSecret?: string | null, > createdAt?: string > }[] > ``` *** ### listEvents `webhookManagement.listEvents` List delivery events for a webhook **Risk:** `read` ```ts theme={null} await corsair.tally.api.webhookManagement.listEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `events` | `object[]` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `hasMore` | `boolean` | No | — | | `totalNumberOfEvents` | `number` | No | — | > **events full type** > > ```ts theme={null} > { > id?: string, > eventType?: string, > deliveryStatus?: string, > statusCode?: number | null, > response?: string | null, > retry?: number, > payload?: { > }, > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### retryEvent `webhookManagement.retryEvent` Retry a failed webhook event delivery **Risk:** `write` ```ts theme={null} await corsair.tally.api.webhookManagement.retryEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | | `eventId` | `string` | Yes | — | **Output:** `void` *** ### update `webhookManagement.update` Update a webhook subscription **Risk:** `write` ```ts theme={null} await corsair.tally.api.webhookManagement.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhookId` | `string` | Yes | — | | `formId` | `string` | Yes | — | | `url` | `string` | Yes | — | | `eventTypes` | `string[]` | Yes | — | | `isEnabled` | `boolean` | Yes | — | | `signingSecret` | `string` | No | — | | `httpHeaders` | `object[]` | No | — | > **httpHeaders full type** > > ```ts theme={null} > { > name: string, > value: string > }[] > ``` **Output:** `void` *** ## Workspaces ### create `workspaces.create` Create a new workspace (Pro subscription required) **Risk:** `write` ```ts theme={null} await corsair.tally.api.workspaces.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `members` | `any[]` | No | — | | `invites` | `any[]` | No | — | *** ### delete `workspaces.delete` Delete a workspace **Risk:** `destructive` ```ts theme={null} await corsair.tally.api.workspaces.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | **Output:** `void` *** ### get `workspaces.get` Retrieve a workspace by ID **Risk:** `read` ```ts theme={null} await corsair.tally.api.workspaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `members` | `any[]` | No | — | | `invites` | `any[]` | No | — | *** ### list `workspaces.list` List all workspaces **Risk:** `read` ```ts theme={null} await corsair.tally.api.workspaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `total` | `number` | No | — | | `hasMore` | `boolean` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > name?: string, > createdAt?: string, > updatedAt?: string, > members?: any[], > invites?: any[] > }[] > ``` *** ### update `workspaces.update` Update a workspace name **Risk:** `write` ```ts theme={null} await corsair.tally.api.workspaces.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspaceId` | `string` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `members` | `any[]` | No | — | | `invites` | `any[]` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/tally/database Tally local sync: searchable entities, `.search()` filters, and operators. The Tally plugin syncs data locally. Use `corsair.tally.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Forms Path: `tally.db.forms.search` ```ts theme={null} const rows = await corsair.tally.db.forms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Submissions Path: `tally.db.submissions.search` ```ts theme={null} const rows = await corsair.tally.db.submissions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `formId` | `string` | equals, contains, startsWith, endsWith, in | | `respondentId` | `string` | equals, contains, startsWith, endsWith, in | | `isCompleted` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `tally.db.workspaces.search` ```ts theme={null} const rows = await corsair.tally.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/tally/overview Simple form builder for surveys, signup flows, and collecting responses without code. Use **Tally** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 26 typed API operations * 3 synced entities (`forms`, `submissions`, `workspaces`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tally ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tally ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tally ``` ```bash bun theme={null} bun add corsair @corsair-dev/tally ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tally } from '@corsair-dev/tally'; export const corsair = createCorsair({ plugins: [ tally(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} tally() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tally', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`forms.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tally.api.forms.get({}); ``` **`forms.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tally.api.forms.create({}); ``` See the full list on the [API](/plugins/tally/api) page. ## Query synced data Synced entities support `tenant.tally.db..search()` and `.list()`: `forms`, `submissions`, `workspaces`. See [Database](/plugins/tally/database) for filters and operators. ## Webhooks This plugin registers **1** webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/tally/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/tally/api)** > > Every `tally.api.*` operation with input and output types. > **[Database](/plugins/tally/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/tally/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/tally/webhooks Tally incoming webhooks: event paths, payloads, and response data. The Tally plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/tally/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `formResponse` * `formResponse` (`formResponse.formResponse`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Form Response ### Form Response `formResponse.formResponse` A new form response was submitted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `eventId` | `string` | Yes | — | | `eventType` | `FORM_RESPONSE` | Yes | — | | `createdAt` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > responseId?: string, > submissionId: string, > respondentId?: string | null, > formId: string, > formName?: string, > createdAt?: string, > fields: { > key: string, > label?: string, > type?: string, > value?: any, > options?: any[], > rows?: any[], > columns?: any[] > }[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > eventId: string, > eventType: FORM_RESPONSE, > createdAt: string, > data: { > responseId?: string, > submissionId: string, > respondentId?: string | null, > formId: string, > formName?: string, > createdAt?: string, > fields: { > key: string, > label?: string, > type?: string, > value?: any, > options?: any[], > rows?: any[], > columns?: any[] > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} tally({ webhookHooks: { formResponse: { formResponse: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/tavily/api API reference for Tavily: every `tavily.api.*` operation with input and output types. Every `tavily.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Crawl ### crawl `crawl.crawl` Crawl a website starting from a root URL **Risk:** `read` ```ts theme={null} await corsair.tavily.api.crawl.crawl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `max_depth` | `number` | No | — | | `max_breadth` | `number` | No | — | | `limit` | `number` | No | — | | `instructions` | `string` | No | — | | `select_paths` | `string[]` | No | — | | `select_domains` | `string[]` | No | — | | `exclude_paths` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `allow_external` | `boolean` | No | — | | `categories` | `Careers \| Blog \| Documentation \| About \| Pricing \| Community \| Developers \| Contact \| Media[]` | No | — | | `extract_depth` | `basic \| advanced` | No | — | | `format` | `markdown \| text` | No | — | | `include_images` | `boolean` | No | — | | `include_favicon` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `base_url` | `string` | Yes | — | | `results` | `object[]` | Yes | — | | `failed_results` | `object[]` | No | — | | `response_time` | `number` | Yes | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > url: string, > raw_content: string, > images?: string[], > favicon?: string > }[] > ``` > **failed\_results full type** > > ```ts theme={null} > { > url: string, > error: string > }[] > ``` *** ## Extract ### extract `extract.extract` Extract content from one or more URLs **Risk:** `read` ```ts theme={null} await corsair.tavily.api.extract.extract({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `urls` | `string \| string[]` | Yes | — | | `include_images` | `boolean` | No | — | | `extract_depth` | `basic \| advanced` | No | — | | `format` | `markdown \| text` | No | — | | `include_favicon` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `failed_results` | `object[]` | Yes | — | | `response_time` | `number` | Yes | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > url: string, > raw_content: string, > images?: string[], > favicon?: string > }[] > ``` > **failed\_results full type** > > ```ts theme={null} > { > url: string, > error: string > }[] > ``` *** ## Map ### map `map.map` Map all URLs on a website starting from a root URL **Risk:** `read` ```ts theme={null} await corsair.tavily.api.map.map({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `max_depth` | `number` | No | — | | `max_breadth` | `number` | No | — | | `limit` | `number` | No | — | | `instructions` | `string` | No | — | | `select_paths` | `string[]` | No | — | | `select_domains` | `string[]` | No | — | | `exclude_paths` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `allow_external` | `boolean` | No | — | | `categories` | `Careers \| Blog \| Documentation \| About \| Pricing \| Community \| Developers \| Contact \| Media[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `base_url` | `string` | Yes | — | | `results` | `string[]` | Yes | — | | `response_time` | `number` | Yes | — | | `request_id` | `string` | No | — | *** ## Search ### search `search.search` Search the web using Tavily **Risk:** `read` ```ts theme={null} await corsair.tavily.api.search.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `search_depth` | `advanced \| basic \| fast \| ultra-fast` | No | — | | `chunks_per_source` | `number` | No | — | | `max_results` | `number` | No | — | | `topic` | `general \| news \| finance` | No | — | | `time_range` | `day \| week \| month \| year \| d \| w \| m \| y` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `include_answer` | `boolean \| basic \| advanced` | No | — | | `include_raw_content` | `boolean \| markdown \| text` | No | — | | `include_images` | `boolean` | No | — | | `include_image_descriptions` | `boolean` | No | — | | `include_favicon` | `boolean` | No | — | | `include_domains` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `country` | `string` | No | — | | `auto_parameters` | `boolean` | No | — | | `include_usage` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `answer` | `string` | No | — | | `images` | `object[]` | Yes | — | | `results` | `object[]` | Yes | — | | `response_time` | `number` | Yes | — | | `usage` | `object` | No | — | | `request_id` | `string` | No | — | | `auto_parameters` | `object` | No | — | > **images full type** > > ```ts theme={null} > { > url: string, > description?: string | null > }[] > ``` > **results full type** > > ```ts theme={null} > { > title: string, > url: string, > content: string, > score: number, > raw_content?: string | null, > favicon?: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > credits: number > } > ``` > **auto\_parameters full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/tavily/database Tavily local sync: searchable entities, `.search()` filters, and operators. The Tavily plugin syncs data locally. Use `corsair.tavily.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Crawl Results Path: `tavily.db.crawlResults.search` ```ts theme={null} const rows = await corsair.tavily.db.crawlResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `raw_content` | `string` | equals, contains, startsWith, endsWith, in | | `favicon` | `string` | equals, contains, startsWith, endsWith, in | | `baseUrl` | `string` | equals, contains, startsWith, endsWith, in | | `crawledAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Extract Results Path: `tavily.db.extractResults.search` ```ts theme={null} const rows = await corsair.tavily.db.extractResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `raw_content` | `string` | equals, contains, startsWith, endsWith, in | | `favicon` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Map Results Path: `tavily.db.mapResults.search` ```ts theme={null} const rows = await corsair.tavily.db.mapResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `baseUrl` | `string` | equals, contains, startsWith, endsWith, in | | `mappedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Search Results Path: `tavily.db.searchResults.search` ```ts theme={null} const rows = await corsair.tavily.db.searchResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `raw_content` | `string` | equals, contains, startsWith, endsWith, in | | `favicon` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `searchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/tavily/get-credentials Step-by-step instructions for obtaining a Tavily API key for the Corsair Tavily plugin. This guide walks you through obtaining all required credentials for the Tavily plugin. ## Authentication Method The Tavily plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) — Tavily API key for search, extract, crawl, and map endpoints Tavily does not expose OAuth in this plugin; you use a single API key for server-side calls. ## API Key ### Step 1: Get Your Key 1. Sign in at [tavily.com](https://tavily.com) (or the Tavily console for API keys). 2. Open your **Dashboard** or **API Keys** section. 3. Create or copy an **API key** for your project. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=tavily api_key=your-tavily-api-key ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=tavily --credentials ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | API key | [`api_key`](/concepts/api-key) auth | Tavily dashboard / API keys | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/tavily/overview Search API optimized for AI agents needing fast, relevant web research results. Use **Tavily** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 4 typed API operations * 4 synced entities (`crawlResults`, `extractResults`, `mapResults`, `searchResults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tavily ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tavily ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tavily ``` ```bash bun theme={null} bun add corsair @corsair-dev/tavily ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tavily } from '@corsair-dev/tavily'; export const corsair = createCorsair({ plugins: [ tavily(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/tavily/get-credentials). ```ts theme={null} tavily() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tavily', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`crawl.crawl`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tavily.api.crawl.crawl({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/tavily/api) reference.* See the full list on the [API](/plugins/tavily/api) page. ## Query synced data Synced entities support `tenant.tavily.db..search()` and `.list()`: `crawlResults`, `extractResults`, `mapResults`, `searchResults`. See [Database](/plugins/tavily/database) for filters and operators. ## What's next > **[API reference](/plugins/tavily/api)** > > Every `tavily.api.*` operation with input and output types. > **[Database](/plugins/tavily/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/tavily/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/tavilymcp/api API reference for Tavily MCP: every `tavilymcp.api.*` operation with input and output types. Every `tavilymcp.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Tavily ### crawl `tavily.crawl` Crawl a site from a start URL with configurable depth and breadth **Risk:** `read` ```ts theme={null} await corsair.tavilymcp.api.tavily.crawl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `max_depth` | `number` | No | — | | `max_breadth` | `number` | No | — | | `limit` | `number` | No | — | | `instructions` | `string` | No | — | | `chunks_per_source` | `number` | No | — | | `select_paths` | `string[]` | No | — | | `select_domains` | `string[]` | No | — | | `exclude_paths` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `allow_external` | `boolean` | No | — | | `categories` | `Careers \| Blog \| Documentation \| About \| Pricing \| Community \| Developers \| Contact \| Media \| People[]` | No | — | | `extract_depth` | `basic \| advanced` | No | — | | `format` | `markdown \| text` | No | — | | `include_images` | `boolean` | No | — | | `include_favicon` | `boolean` | No | — | | `timeout` | `number` | No | — | | `include_usage` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `base_url` | `string` | Yes | — | | `results` | `object[]` | Yes | — | | `failed_results` | `object[]` | No | — | | `response_time` | `number` | Yes | — | | `usage` | `object` | No | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > url: string, > raw_content: string, > images?: string[], > favicon?: string | null > }[] > ``` > **failed\_results full type** > > ```ts theme={null} > { > url: string, > error: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > credits: number > } > ``` *** ### extract `tavily.extract` Extract page content from one or more URLs as markdown or plain text **Risk:** `read` ```ts theme={null} await corsair.tavilymcp.api.tavily.extract({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `urls` | `string \| string[]` | Yes | — | | `query` | `string` | No | — | | `chunks_per_source` | `number` | No | — | | `include_images` | `boolean` | No | — | | `extract_depth` | `basic \| advanced` | No | — | | `format` | `markdown \| text` | No | — | | `include_favicon` | `boolean` | No | — | | `timeout` | `number` | No | — | | `include_usage` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `failed_results` | `object[]` | Yes | — | | `response_time` | `number` | Yes | — | | `usage` | `object` | No | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > url: string, > raw_content: string, > title?: string | null, > images?: string[], > favicon?: string | null > }[] > ``` > **failed\_results full type** > > ```ts theme={null} > { > url: string, > error: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > credits: number > } > ``` *** ### map `tavily.map` Map a site's structure from a start URL and return its URLs **Risk:** `read` ```ts theme={null} await corsair.tavilymcp.api.tavily.map({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `max_depth` | `number` | No | — | | `max_breadth` | `number` | No | — | | `limit` | `number` | No | — | | `instructions` | `string` | No | — | | `select_paths` | `string[]` | No | — | | `select_domains` | `string[]` | No | — | | `exclude_paths` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `allow_external` | `boolean` | No | — | | `categories` | `Careers \| Blog \| Documentation \| About \| Pricing \| Community \| Developers \| Contact \| Media \| People[]` | No | — | | `timeout` | `number` | No | — | | `include_usage` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `base_url` | `string` | Yes | — | | `results` | `string[]` | Yes | — | | `response_time` | `number` | Yes | — | | `usage` | `object` | No | — | | `request_id` | `string` | No | — | > **usage full type** > > ```ts theme={null} > { > credits: number > } > ``` *** ### research `tavily.research` Run comprehensive multi-source research on a topic and return a cited report **Risk:** `read` ```ts theme={null} await corsair.tavilymcp.api.tavily.research({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string` | Yes | — | | `model` | `auto \| mini \| pro` | No | — | | `output_schema` | `object` | No | — | | `citation_format` | `numbered \| mla \| apa \| chicago` | No | — | | `include_domains` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `output_length` | `short \| standard \| long` | No | — | | `files` | `object[]` | No | — | | `max_wait_ms` | `number` | No | — | | `poll_interval_ms` | `number` | No | — | > **output\_schema full type** > > ```ts theme={null} > { > } > ``` > **files full type** > > ```ts theme={null} > { > name: string, > data: string, > type: base64 > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | | `status` | `pending \| in_progress \| completed \| failed` | Yes | — | | `input` | `string` | No | — | | `model` | `string` | No | — | | `created_at` | `string` | No | — | | `content` | `object` | No | — | | `sources` | `object[]` | No | — | | `response_time` | `number` | No | — | | `usage` | `object` | No | — | > **content full type** > > ```ts theme={null} > string | { > } > ``` > **sources full type** > > ```ts theme={null} > { > title?: string | null, > url: string, > favicon?: string | null > }[] > ``` > **usage full type** > > ```ts theme={null} > { > credits: number > } > ``` *** ### search `tavily.search` Search the web with Tavily and return ranked snippets with source URLs **Risk:** `read` ```ts theme={null} await corsair.tavilymcp.api.tavily.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `search_depth` | `advanced \| basic \| fast \| ultra-fast` | No | — | | `chunks_per_source` | `number` | No | — | | `max_results` | `number` | No | — | | `topic` | `general \| news \| finance` | No | — | | `time_range` | `day \| week \| month \| year \| d \| w \| m \| y` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `include_answer` | `boolean \| basic \| advanced` | No | — | | `include_raw_content` | `boolean \| markdown \| text` | No | — | | `include_images` | `boolean` | No | — | | `include_image_descriptions` | `boolean` | No | — | | `include_favicon` | `boolean` | No | — | | `include_domains` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `country` | `string` | No | — | | `auto_parameters` | `boolean` | No | — | | `exact_match` | `boolean` | No | — | | `safe_search` | `boolean` | No | — | | `include_usage` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `answer` | `string` | No | — | | `follow_up_questions` | `string[]` | No | — | | `images` | `object[]` | Yes | — | | `results` | `object[]` | Yes | — | | `response_time` | `number` | Yes | — | | `usage` | `object` | No | — | | `request_id` | `string` | No | — | | `auto_parameters` | `object` | No | — | > **images full type** > > ```ts theme={null} > { > url: string, > description?: string | null > }[] > ``` > **results full type** > > ```ts theme={null} > { > title: string, > url: string, > content: string, > score: number, > raw_content?: string | null, > favicon?: string | null, > images?: { > url: string, > description?: string | null > }[] | null, > id?: string > }[] > ``` > **usage full type** > > ```ts theme={null} > { > credits: number > } > ``` > **auto\_parameters full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/tavilymcp/database Tavily MCP local sync: searchable entities, `.search()` filters, and operators. The Tavily MCP plugin syncs data locally. Use `corsair.tavilymcp.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Crawl Results Path: `tavilymcp.db.crawlResults.search` ```ts theme={null} const rows = await corsair.tavilymcp.db.crawlResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `raw_content` | `string` | equals, contains, startsWith, endsWith, in | | `favicon` | `string` | equals, contains, startsWith, endsWith, in | | `baseUrl` | `string` | equals, contains, startsWith, endsWith, in | | `crawledAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Extract Results Path: `tavilymcp.db.extractResults.search` ```ts theme={null} const rows = await corsair.tavilymcp.db.extractResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `raw_content` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `favicon` | `string` | equals, contains, startsWith, endsWith, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Map Results Path: `tavilymcp.db.mapResults.search` ```ts theme={null} const rows = await corsair.tavilymcp.db.mapResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `baseUrl` | `string` | equals, contains, startsWith, endsWith, in | | `mappedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Research Results Path: `tavilymcp.db.researchResults.search` ```ts theme={null} const rows = await corsair.tavilymcp.db.researchResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `requestId` | `string` | equals, contains, startsWith, endsWith, in | | `input` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `researchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Search Results Path: `tavilymcp.db.searchResults.search` ```ts theme={null} const rows = await corsair.tavilymcp.db.searchResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `score` | `number` | equals, gt, gte, lt, lte, in | | `raw_content` | `string` | equals, contains, startsWith, endsWith, in | | `favicon` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `searchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/tavilymcp/overview MCP server exposing Tavily web search tools for AI agent research workflows. Use **Tavily MCP** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 5 synced entities (`crawlResults`, `extractResults`, `mapResults`, `researchResults`, `searchResults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tavilymcp ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tavilymcp ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tavilymcp ``` ```bash bun theme={null} bun add corsair @corsair-dev/tavilymcp ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tavilymcp } from '@corsair-dev/tavilymcp'; export const corsair = createCorsair({ plugins: [ tavilymcp(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} tavilymcp() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tavilymcp', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`tavily.crawl`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tavilymcp.api.tavily.crawl({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/tavilymcp/api) reference.* See the full list on the [API](/plugins/tavilymcp/api) page. ## Query synced data Synced entities support `tenant.tavilymcp.db..search()` and `.list()`: `crawlResults`, `extractResults`, `mapResults`, `researchResults`, `searchResults`. See [Database](/plugins/tavilymcp/database) for filters and operators. ## What's next > **[API reference](/plugins/tavilymcp/api)** > > Every `tavilymcp.api.*` operation with input and output types. > **[Database](/plugins/tavilymcp/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/teams/api API reference for Microsoft Teams: every `teams.api.*` operation with input and output types. Every `teams.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Channels ### create `channels.create` Create a new channel in a team **Risk:** `write` ```ts theme={null} await corsair.teams.api.channels.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `displayName` | `string` | Yes | — | | `description` | `string` | No | — | | `membershipType` | `standard \| private \| shared` | No | — | | `isFavoriteByDefault` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `email` | `string` | No | — | | `webUrl` | `string` | No | — | | `membershipType` | `string` | No | — | | `isFavoriteByDefault` | `boolean` | No | — | | `createdDateTime` | `string` | No | — | *** ### delete `channels.delete` Delete a channel **Risk:** `destructive` ```ts theme={null} await corsair.teams.api.channels.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `channelId` | `string` | Yes | — | **Output:** *empty object* *** ### get `channels.get` Get details of a specific channel **Risk:** `read` ```ts theme={null} await corsair.teams.api.channels.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `channelId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `email` | `string` | No | — | | `webUrl` | `string` | No | — | | `membershipType` | `string` | No | — | | `isFavoriteByDefault` | `boolean` | No | — | | `createdDateTime` | `string` | No | — | *** ### list `channels.list` List channels in a team **Risk:** `read` ```ts theme={null} await corsair.teams.api.channels.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id: string, > displayName?: string, > description?: string | null, > email?: string | null, > webUrl?: string | null, > membershipType?: string | null, > isFavoriteByDefault?: boolean | null, > createdDateTime?: string | null > }[] > ``` *** ### update `channels.update` Update a channel **Risk:** `write` ```ts theme={null} await corsair.teams.api.channels.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `channelId` | `string` | Yes | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `isFavoriteByDefault` | `boolean` | No | — | **Output:** *empty object* *** ## Chats ### create `chats.create` Create a new chat **Risk:** `write` ```ts theme={null} await corsair.teams.api.chats.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chatType` | `oneOnOne \| group` | Yes | — | | `topic` | `string` | No | — | | `members` | `object[]` | Yes | — | > **members full type** > > ```ts theme={null} > { > userId: string, > roles?: string[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `topic` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastUpdatedDateTime` | `string` | No | — | | `chatType` | `string` | No | — | | `webUrl` | `string` | No | — | | `tenantId` | `string` | No | — | *** ### get `chats.get` Get details of a specific chat **Risk:** `read` ```ts theme={null} await corsair.teams.api.chats.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chatId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `topic` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastUpdatedDateTime` | `string` | No | — | | `chatType` | `string` | No | — | | `webUrl` | `string` | No | — | | `tenantId` | `string` | No | — | *** ### list `chats.list` List chats for the current user **Risk:** `read` ```ts theme={null} await corsair.teams.api.chats.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter` | `string` | No | — | | `top` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id: string, > topic?: string | null, > createdDateTime?: string, > lastUpdatedDateTime?: string, > chatType?: string, > webUrl?: string, > tenantId?: string > }[] > ``` *** ### listMessages `chats.listMessages` List messages in a chat **Risk:** `read` ```ts theme={null} await corsair.teams.api.chats.listMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chatId` | `string` | Yes | — | | `top` | `number` | No | — | | `skipToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id: string, > replyToId?: string | null, > etag?: string, > messageType?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > deletedDateTime?: string | null, > subject?: string | null, > summary?: string | null, > chatId?: string | null, > importance?: string, > locale?: string, > webUrl?: string | null, > from?: { > application?: { > } | null, > device?: { > } | null, > user?: { > id?: string, > displayName?: string | null, > userIdentityType?: string > } | null > } | null, > body?: { > contentType?: text | html, > content?: string > }, > channelIdentity?: { > teamId?: string, > channelId?: string > } | null, > attachments?: { > }[], > mentions?: { > }[], > reactions?: { > }[] > }[] > ``` *** ### sendMessage `chats.sendMessage` Send a message in a chat **Risk:** `write` ```ts theme={null} await corsair.teams.api.chats.sendMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `chatId` | `string` | Yes | — | | `body` | `object` | Yes | — | | `importance` | `normal \| high \| urgent` | No | — | > **body full type** > > ```ts theme={null} > { > content: string, > contentType?: text | html > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `replyToId` | `string` | No | — | | `etag` | `string` | No | — | | `messageType` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `deletedDateTime` | `string` | No | — | | `subject` | `string` | No | — | | `summary` | `string` | No | — | | `chatId` | `string` | No | — | | `importance` | `string` | No | — | | `locale` | `string` | No | — | | `webUrl` | `string` | No | — | | `from` | `object` | No | — | | `body` | `object` | No | — | | `channelIdentity` | `object` | No | — | | `attachments` | `object[]` | No | — | | `mentions` | `object[]` | No | — | | `reactions` | `object[]` | No | — | > **from full type** > > ```ts theme={null} > { > application?: { > } | null, > device?: { > } | null, > user?: { > id?: string, > displayName?: string | null, > userIdentityType?: string > } | null > } > ``` > **body full type** > > ```ts theme={null} > { > contentType?: text | html, > content?: string > } > ``` > **channelIdentity full type** > > ```ts theme={null} > { > teamId?: string, > channelId?: string > } > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **mentions full type** > > ```ts theme={null} > { > }[] > ``` > **reactions full type** > > ```ts theme={null} > { > }[] > ``` *** ## Members ### add `members.add` Add a member to a team **Risk:** `write` ```ts theme={null} await corsair.teams.api.members.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `userId` | `string` | Yes | — | | `roles` | `owner \| member[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `displayName` | `string` | No | — | | `userId` | `string` | No | — | | `email` | `string` | No | — | | `tenantId` | `string` | No | — | | `roles` | `string[]` | No | — | | `visibleHistoryStartDateTime` | `string` | No | — | *** ### get `members.get` Get a specific team member **Risk:** `read` ```ts theme={null} await corsair.teams.api.members.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `membershipId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `displayName` | `string` | No | — | | `userId` | `string` | No | — | | `email` | `string` | No | — | | `tenantId` | `string` | No | — | | `roles` | `string[]` | No | — | | `visibleHistoryStartDateTime` | `string` | No | — | *** ### list `members.list` List members of a team **Risk:** `read` ```ts theme={null} await corsair.teams.api.members.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `filter` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id: string, > displayName?: string | null, > userId?: string | null, > email?: string | null, > tenantId?: string | null, > roles?: string[], > visibleHistoryStartDateTime?: string | null > }[] > ``` *** ### remove `members.remove` Remove a member from a team **Risk:** `destructive` ```ts theme={null} await corsair.teams.api.members.remove({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `membershipId` | `string` | Yes | — | **Output:** *empty object* *** ## Messages ### delete `messages.delete` Delete a channel message **Risk:** `destructive` ```ts theme={null} await corsair.teams.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `channelId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | **Output:** *empty object* *** ### get `messages.get` Get a specific channel message **Risk:** `read` ```ts theme={null} await corsair.teams.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `channelId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `replyToId` | `string` | No | — | | `etag` | `string` | No | — | | `messageType` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `deletedDateTime` | `string` | No | — | | `subject` | `string` | No | — | | `summary` | `string` | No | — | | `chatId` | `string` | No | — | | `importance` | `string` | No | — | | `locale` | `string` | No | — | | `webUrl` | `string` | No | — | | `from` | `object` | No | — | | `body` | `object` | No | — | | `channelIdentity` | `object` | No | — | | `attachments` | `object[]` | No | — | | `mentions` | `object[]` | No | — | | `reactions` | `object[]` | No | — | > **from full type** > > ```ts theme={null} > { > application?: { > } | null, > device?: { > } | null, > user?: { > id?: string, > displayName?: string | null, > userIdentityType?: string > } | null > } > ``` > **body full type** > > ```ts theme={null} > { > contentType?: text | html, > content?: string > } > ``` > **channelIdentity full type** > > ```ts theme={null} > { > teamId?: string, > channelId?: string > } > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **mentions full type** > > ```ts theme={null} > { > }[] > ``` > **reactions full type** > > ```ts theme={null} > { > }[] > ``` *** ### list `messages.list` List messages in a channel **Risk:** `read` ```ts theme={null} await corsair.teams.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `channelId` | `string` | Yes | — | | `top` | `number` | No | — | | `skipToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id: string, > replyToId?: string | null, > etag?: string, > messageType?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > deletedDateTime?: string | null, > subject?: string | null, > summary?: string | null, > chatId?: string | null, > importance?: string, > locale?: string, > webUrl?: string | null, > from?: { > application?: { > } | null, > device?: { > } | null, > user?: { > id?: string, > displayName?: string | null, > userIdentityType?: string > } | null > } | null, > body?: { > contentType?: text | html, > content?: string > }, > channelIdentity?: { > teamId?: string, > channelId?: string > } | null, > attachments?: { > }[], > mentions?: { > }[], > reactions?: { > }[] > }[] > ``` *** ### listReplies `messages.listReplies` List replies to a channel message **Risk:** `read` ```ts theme={null} await corsair.teams.api.messages.listReplies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `channelId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | | `top` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `@odata.context` | `string` | No | — | | `@odata.nextLink` | `string` | No | — | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id: string, > replyToId?: string | null, > etag?: string, > messageType?: string, > createdDateTime?: string, > lastModifiedDateTime?: string, > deletedDateTime?: string | null, > subject?: string | null, > summary?: string | null, > chatId?: string | null, > importance?: string, > locale?: string, > webUrl?: string | null, > from?: { > application?: { > } | null, > device?: { > } | null, > user?: { > id?: string, > displayName?: string | null, > userIdentityType?: string > } | null > } | null, > body?: { > contentType?: text | html, > content?: string > }, > channelIdentity?: { > teamId?: string, > channelId?: string > } | null, > attachments?: { > }[], > mentions?: { > }[], > reactions?: { > }[] > }[] > ``` *** ### reply `messages.reply` Reply to a message in a channel **Risk:** `write` ```ts theme={null} await corsair.teams.api.messages.reply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `channelId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | | `body` | `object` | Yes | — | | `importance` | `normal \| high \| urgent` | No | — | > **body full type** > > ```ts theme={null} > { > content: string, > contentType?: text | html > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `replyToId` | `string` | No | — | | `etag` | `string` | No | — | | `messageType` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `deletedDateTime` | `string` | No | — | | `subject` | `string` | No | — | | `summary` | `string` | No | — | | `chatId` | `string` | No | — | | `importance` | `string` | No | — | | `locale` | `string` | No | — | | `webUrl` | `string` | No | — | | `from` | `object` | No | — | | `body` | `object` | No | — | | `channelIdentity` | `object` | No | — | | `attachments` | `object[]` | No | — | | `mentions` | `object[]` | No | — | | `reactions` | `object[]` | No | — | > **from full type** > > ```ts theme={null} > { > application?: { > } | null, > device?: { > } | null, > user?: { > id?: string, > displayName?: string | null, > userIdentityType?: string > } | null > } > ``` > **body full type** > > ```ts theme={null} > { > contentType?: text | html, > content?: string > } > ``` > **channelIdentity full type** > > ```ts theme={null} > { > teamId?: string, > channelId?: string > } > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **mentions full type** > > ```ts theme={null} > { > }[] > ``` > **reactions full type** > > ```ts theme={null} > { > }[] > ``` *** ### send `messages.send` Send a message to a channel **Risk:** `write` ```ts theme={null} await corsair.teams.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `channelId` | `string` | Yes | — | | `body` | `object` | Yes | — | | `subject` | `string` | No | — | | `importance` | `normal \| high \| urgent` | No | — | > **body full type** > > ```ts theme={null} > { > content: string, > contentType?: text | html > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `replyToId` | `string` | No | — | | `etag` | `string` | No | — | | `messageType` | `string` | No | — | | `createdDateTime` | `string` | No | — | | `lastModifiedDateTime` | `string` | No | — | | `deletedDateTime` | `string` | No | — | | `subject` | `string` | No | — | | `summary` | `string` | No | — | | `chatId` | `string` | No | — | | `importance` | `string` | No | — | | `locale` | `string` | No | — | | `webUrl` | `string` | No | — | | `from` | `object` | No | — | | `body` | `object` | No | — | | `channelIdentity` | `object` | No | — | | `attachments` | `object[]` | No | — | | `mentions` | `object[]` | No | — | | `reactions` | `object[]` | No | — | > **from full type** > > ```ts theme={null} > { > application?: { > } | null, > device?: { > } | null, > user?: { > id?: string, > displayName?: string | null, > userIdentityType?: string > } | null > } > ``` > **body full type** > > ```ts theme={null} > { > contentType?: text | html, > content?: string > } > ``` > **channelIdentity full type** > > ```ts theme={null} > { > teamId?: string, > channelId?: string > } > ``` > **attachments full type** > > ```ts theme={null} > { > }[] > ``` > **mentions full type** > > ```ts theme={null} > { > }[] > ``` > **reactions full type** > > ```ts theme={null} > { > }[] > ``` *** ## Teams ### create `teams.create` Create a new team **Risk:** `write` ```ts theme={null} await corsair.teams.api.teams.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `displayName` | `string` | Yes | — | | `description` | `string` | No | — | | `visibility` | `public \| private` | No | — | | `memberSettings` | `object` | No | — | | `guestSettings` | `object` | No | — | | `messagingSettings` | `object` | No | — | | `funSettings` | `object` | No | — | > **memberSettings full type** > > ```ts theme={null} > { > allowCreateUpdateChannels?: boolean, > allowDeleteChannels?: boolean, > allowAddRemoveApps?: boolean, > allowCreateUpdateRemoveTabs?: boolean, > allowCreateUpdateRemoveConnectors?: boolean > } > ``` > **guestSettings full type** > > ```ts theme={null} > { > allowCreateUpdateChannels?: boolean, > allowDeleteChannels?: boolean > } > ``` > **messagingSettings full type** > > ```ts theme={null} > { > allowUserEditMessages?: boolean, > allowUserDeleteMessages?: boolean, > allowOwnerDeleteMessages?: boolean, > allowTeamMentions?: boolean, > allowChannelMentions?: boolean > } > ``` > **funSettings full type** > > ```ts theme={null} > { > allowGiphy?: boolean, > giphyContentRating?: string, > allowStickersAndMemes?: boolean, > allowCustomMemes?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | *** ### delete `teams.delete` Delete a team **Risk:** `destructive` ```ts theme={null} await corsair.teams.api.teams.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | **Output:** *empty object* *** ### get `teams.get` Get details of a specific team **Risk:** `read` ```ts theme={null} await corsair.teams.api.teams.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `internalId` | `string` | No | — | | `classification` | `string` | No | — | | `specialization` | `string` | No | — | | `visibility` | `string` | No | — | | `webUrl` | `string` | No | — | | `isArchived` | `boolean` | No | — | | `memberSettings` | `object` | No | — | | `guestSettings` | `object` | No | — | | `messagingSettings` | `object` | No | — | | `funSettings` | `object` | No | — | > **memberSettings full type** > > ```ts theme={null} > { > allowCreateUpdateChannels?: boolean, > allowDeleteChannels?: boolean, > allowAddRemoveApps?: boolean, > allowCreateUpdateRemoveTabs?: boolean, > allowCreateUpdateRemoveConnectors?: boolean > } > ``` > **guestSettings full type** > > ```ts theme={null} > { > allowCreateUpdateChannels?: boolean, > allowDeleteChannels?: boolean > } > ``` > **messagingSettings full type** > > ```ts theme={null} > { > allowUserEditMessages?: boolean, > allowUserDeleteMessages?: boolean, > allowOwnerDeleteMessages?: boolean, > allowTeamMentions?: boolean, > allowChannelMentions?: boolean > } > ``` > **funSettings full type** > > ```ts theme={null} > { > allowGiphy?: boolean, > giphyContentRating?: string, > allowStickersAndMemes?: boolean, > allowCustomMemes?: boolean > } > ``` *** ### list `teams.list` List teams the current user is a member of **Risk:** `read` ```ts theme={null} await corsair.teams.api.teams.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filter` | `string` | No | — | | `select` | `string` | No | — | | `top` | `number` | No | — | | `skipToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `@odata.context` | `string` | No | — | | `@odata.count` | `number` | No | — | | `@odata.nextLink` | `string` | No | — | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > id: string, > displayName?: string, > description?: string | null, > internalId?: string | null, > classification?: string | null, > specialization?: string | null, > visibility?: string | null, > webUrl?: string | null, > isArchived?: boolean | null, > memberSettings?: { > allowCreateUpdateChannels?: boolean, > allowDeleteChannels?: boolean, > allowAddRemoveApps?: boolean, > allowCreateUpdateRemoveTabs?: boolean, > allowCreateUpdateRemoveConnectors?: boolean > } | null, > guestSettings?: { > allowCreateUpdateChannels?: boolean, > allowDeleteChannels?: boolean > } | null, > messagingSettings?: { > allowUserEditMessages?: boolean, > allowUserDeleteMessages?: boolean, > allowOwnerDeleteMessages?: boolean, > allowTeamMentions?: boolean, > allowChannelMentions?: boolean > } | null, > funSettings?: { > allowGiphy?: boolean, > giphyContentRating?: string, > allowStickersAndMemes?: boolean, > allowCustomMemes?: boolean > } | null > }[] > ``` *** ### update `teams.update` Update team settings **Risk:** `write` ```ts theme={null} await corsair.teams.api.teams.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | Yes | — | | `displayName` | `string` | No | — | | `description` | `string` | No | — | | `visibility` | `string` | No | — | | `memberSettings` | `object` | No | — | | `guestSettings` | `object` | No | — | | `messagingSettings` | `object` | No | — | | `funSettings` | `object` | No | — | > **memberSettings full type** > > ```ts theme={null} > { > allowCreateUpdateChannels?: boolean, > allowDeleteChannels?: boolean, > allowAddRemoveApps?: boolean, > allowCreateUpdateRemoveTabs?: boolean, > allowCreateUpdateRemoveConnectors?: boolean > } > ``` > **guestSettings full type** > > ```ts theme={null} > { > allowCreateUpdateChannels?: boolean, > allowDeleteChannels?: boolean > } > ``` > **messagingSettings full type** > > ```ts theme={null} > { > allowUserEditMessages?: boolean, > allowUserDeleteMessages?: boolean, > allowOwnerDeleteMessages?: boolean, > allowTeamMentions?: boolean, > allowChannelMentions?: boolean > } > ``` > **funSettings full type** > > ```ts theme={null} > { > allowGiphy?: boolean, > giphyContentRating?: string, > allowStickersAndMemes?: boolean, > allowCustomMemes?: boolean > } > ``` **Output:** *empty object* *** # Database Source: https://docs.corsair.dev/plugins/teams/database Microsoft Teams local sync: searchable entities, `.search()` filters, and operators. The Microsoft Teams plugin syncs data locally. Use `corsair.teams.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Channels Path: `teams.db.channels.search` ```ts theme={null} const rows = await corsair.teams.db.channels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `webUrl` | `string` | equals, contains, startsWith, endsWith, in | | `membershipType` | `string` | equals, contains, startsWith, endsWith, in | | `isFavoriteByDefault` | `boolean` | equals | | `createdDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Chats Path: `teams.db.chats.search` ```ts theme={null} const rows = await corsair.teams.db.chats.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `topic` | `string` | equals, contains, startsWith, endsWith, in | | `chatType` | `string` | equals, contains, startsWith, endsWith, in | | `webUrl` | `string` | equals, contains, startsWith, endsWith, in | | `tenantId` | `string` | equals, contains, startsWith, endsWith, in | | `createdDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastUpdatedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Members Path: `teams.db.members.search` ```ts theme={null} const rows = await corsair.teams.db.members.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `userId` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `tenantId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `teams.db.messages.search` ```ts theme={null} const rows = await corsair.teams.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `channelId` | `string` | equals, contains, startsWith, endsWith, in | | `chatId` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | | `replyToId` | `string` | equals, contains, startsWith, endsWith, in | | `messageType` | `string` | equals, contains, startsWith, endsWith, in | | `createdDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `lastModifiedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `deletedDateTime` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `bodyContent` | `string` | equals, contains, startsWith, endsWith, in | | `bodyContentType` | `string` | equals, contains, startsWith, endsWith, in | | `importance` | `string` | equals, contains, startsWith, endsWith, in | | `webUrl` | `string` | equals, contains, startsWith, endsWith, in | | `fromUserId` | `string` | equals, contains, startsWith, endsWith, in | | `fromUserDisplayName` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `teams.db.teams.search` ```ts theme={null} const rows = await corsair.teams.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `internalId` | `string` | equals, contains, startsWith, endsWith, in | | `classification` | `string` | equals, contains, startsWith, endsWith, in | | `specialization` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `webUrl` | `string` | equals, contains, startsWith, endsWith, in | | `isArchived` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/teams/overview Workplace collaboration hub for chat, meetings, channels, and Microsoft 365 team communication. Use **Microsoft Teams** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 25 typed API operations * 5 synced entities (`channels`, `chats`, `members`, `messages`, `teams`) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/teams ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/teams ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/teams ``` ```bash bun theme={null} bun add corsair @corsair-dev/teams ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { teams } from '@corsair-dev/teams'; export const corsair = createCorsair({ plugins: [ teams({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Microsoft Teams** — your tenants connect through Hub when they sign in. ```ts theme={null} teams({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Microsoft Teams OAuth app. ```ts theme={null} teams() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'teams', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`channels.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.teams.api.channels.get({}); ``` **`channels.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.teams.api.channels.create({}); ``` See the full list on the [API](/plugins/teams/api) page. ## Query synced data Synced entities support `tenant.teams.db..search()` and `.list()`: `channels`, `chats`, `members`, `messages`, `teams`. See [Database](/plugins/teams/database) for filters and operators. ## Webhooks This plugin registers **4** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/teams/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/teams/api)** > > Every `teams.api.*` operation with input and output types. > **[Database](/plugins/teams/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/teams/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/teams/webhooks Microsoft Teams incoming webhooks: event paths, payloads, and response data. The Microsoft Teams plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/teams/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `channels` * `created` (`channels.created`) * `message` (`channels.message`) * `chats` * `message` (`chats.message`) * `members` * `changed` (`members.changed`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Channels ### Created `channels.created` A channel was created, updated, or deleted in a team **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: created | updated | deleted, > resource: string, > tenantId?: string, > clientState?: string, > resourceData?: { > @odata.type?: #Microsoft.Graph.channel, > @odata.id?: string, > id: string > } > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: created | updated | deleted, > resource: string, > tenantId?: string, > clientState?: string, > resourceData?: { > @odata.type?: #Microsoft.Graph.channel, > @odata.id?: string, > id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} teams({ webhookHooks: { channels: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Message `channels.message` A message was created or updated in a team channel **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: created | updated | deleted, > resource: string, > tenantId?: string, > clientState?: string, > resourceData?: { > @odata.type?: #Microsoft.Graph.chatMessage, > @odata.id?: string, > id: string > } > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: created | updated | deleted, > resource: string, > tenantId?: string, > clientState?: string, > resourceData?: { > @odata.type?: #Microsoft.Graph.chatMessage, > @odata.id?: string, > id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} teams({ webhookHooks: { channels: { message: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Chats ### Message `chats.message` A message was created or updated in a chat **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: created | updated | deleted, > resource: string, > tenantId?: string, > clientState?: string, > resourceData?: { > @odata.type?: #Microsoft.Graph.chatMessage, > @odata.id?: string, > id: string > } > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: created | updated | deleted, > resource: string, > tenantId?: string, > clientState?: string, > resourceData?: { > @odata.type?: #Microsoft.Graph.chatMessage, > @odata.id?: string, > id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} teams({ webhookHooks: { chats: { message: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Members ### Changed `members.changed` A team membership was added, updated, or removed **Payload** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | > **value full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: created | updated | deleted, > resource: string, > tenantId?: string, > clientState?: string, > resourceData?: { > @odata.type?: #Microsoft.Graph.aadUserConversationMember, > @odata.id?: string, > id: string > } > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > subscriptionId: string, > changeType: created | updated | deleted, > resource: string, > tenantId?: string, > clientState?: string, > resourceData?: { > @odata.type?: #Microsoft.Graph.aadUserConversationMember, > @odata.id?: string, > id: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} teams({ webhookHooks: { members: { changed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/telegram/api API reference for Telegram: every `telegram.api.*` operation with input and output types. Every `telegram.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Callback ### answerCallbackQuery `callback.answerCallbackQuery` Answer callback query **Risk:** `write` ```ts theme={null} await corsair.telegram.api.callback.answerCallbackQuery({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### answerInlineQuery `callback.answerInlineQuery` Answer inline query **Risk:** `write` ```ts theme={null} await corsair.telegram.api.callback.answerInlineQuery({}); ``` **Input:** `unknown` **Output:** `unknown` *** ## Chat ### getChat `chat.getChat` Get chat information **Risk:** `read` ```ts theme={null} await corsair.telegram.api.chat.getChat({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### getChatAdministrators `chat.getChatAdministrators` Get chat administrators **Risk:** `read` ```ts theme={null} await corsair.telegram.api.chat.getChatAdministrators({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### getChatMember `chat.getChatMember` Get chat member information **Risk:** `read` ```ts theme={null} await corsair.telegram.api.chat.getChatMember({}); ``` **Input:** `unknown` **Output:** `unknown` *** ## File ### getFile `file.getFile` Get a file **Risk:** `read` ```ts theme={null} await corsair.telegram.api.file.getFile({}); ``` **Input:** `unknown` **Output:** `unknown` *** ## Me ### getMe `me.getMe` Get bot info **Risk:** `read` ```ts theme={null} await corsair.telegram.api.me.getMe({}); ``` **Input:** `unknown` **Output:** `unknown` *** ## Messages ### deleteMessage `messages.deleteMessage` Delete a message **Risk:** `destructive` ```ts theme={null} await corsair.telegram.api.messages.deleteMessage({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### editMessageText `messages.editMessageText` Edit message text **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.editMessageText({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### pinChatMessage `messages.pinChatMessage` Pin a chat message **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.pinChatMessage({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendAnimation `messages.sendAnimation` Send animation **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendAnimation({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendAudio `messages.sendAudio` Send audio **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendAudio({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendChatAction `messages.sendChatAction` Send a chat action **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendChatAction({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendDocument `messages.sendDocument` Send document **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendDocument({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendLocation `messages.sendLocation` Send location **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendLocation({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendMediaGroup `messages.sendMediaGroup` Send media group **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendMediaGroup({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendMessage `messages.sendMessage` Send a message **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendMessage({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendPhoto `messages.sendPhoto` Send photo **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendPhoto({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendSticker `messages.sendSticker` Send sticker **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendSticker({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### sendVideo `messages.sendVideo` Send video **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.sendVideo({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### unpinChatMessage `messages.unpinChatMessage` Unpin a chat message **Risk:** `write` ```ts theme={null} await corsair.telegram.api.messages.unpinChatMessage({}); ``` **Input:** `unknown` **Output:** `unknown` *** ## Updates ### getUpdates `updates.getUpdates` Get updates **Risk:** `read` ```ts theme={null} await corsair.telegram.api.updates.getUpdates({}); ``` **Input:** `unknown` **Output:** `unknown` *** ## Webhook ### deleteWebhook `webhook.deleteWebhook` Delete webhook **Risk:** `destructive` ```ts theme={null} await corsair.telegram.api.webhook.deleteWebhook({}); ``` **Input:** `unknown` **Output:** `unknown` *** ### setWebhook `webhook.setWebhook` Set webhook **Risk:** `write` ```ts theme={null} await corsair.telegram.api.webhook.setWebhook({}); ``` **Input:** `unknown` **Output:** `unknown` *** # Database Source: https://docs.corsair.dev/plugins/telegram/database Telegram local sync: searchable entities, `.search()` filters, and operators. The Telegram plugin syncs data locally. Use `corsair.telegram.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Chats Path: `telegram.db.chats.search` ```ts theme={null} const rows = await corsair.telegram.db.chats.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `chat_id` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `is_forum` | `boolean` | equals | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `invite_link` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `telegram.db.files.search` ```ts theme={null} const rows = await corsair.telegram.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `file_id` | `string` | equals, contains, startsWith, endsWith, in | | `file_unique_id` | `string` | equals, contains, startsWith, endsWith, in | | `file_size` | `number` | equals, gt, gte, lt, lte, in | | `file_path` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `telegram.db.messages.search` ```ts theme={null} const rows = await corsair.telegram.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `message_id` | `number` | equals, gt, gte, lt, lte, in | | `chat_id` | `string` | equals, contains, startsWith, endsWith, in | | `from_id` | `string` | equals, contains, startsWith, endsWith, in | | `authorId` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `number` | equals, gt, gte, lt, lte, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `caption` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `edit_date` | `number` | equals, gt, gte, lt, lte, in | | `media_group_id` | `string` | equals, contains, startsWith, endsWith, in | | `reply_to_message_id` | `number` | equals, gt, gte, lt, lte, in | | `forward_from_id` | `number` | equals, gt, gte, lt, lte, in | | `forward_from_chat_id` | `number` | equals, gt, gte, lt, lte, in | | `forward_from_message_id` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Polls Path: `telegram.db.polls.search` ```ts theme={null} const rows = await corsair.telegram.db.polls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `poll_id` | `string` | equals, contains, startsWith, endsWith, in | | `question` | `string` | equals, contains, startsWith, endsWith, in | | `total_voter_count` | `number` | equals, gt, gte, lt, lte, in | | `is_closed` | `boolean` | equals | | `is_anonymous` | `boolean` | equals | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `allows_multiple_answers` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `telegram.db.users.search` ```ts theme={null} const rows = await corsair.telegram.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `number` | equals, gt, gte, lt, lte, in | | `is_bot` | `boolean` | equals | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `language_code` | `string` | equals, contains, startsWith, endsWith, in | | `is_premium` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/telegram/get-credentials Step-by-step instructions for obtaining Telegram bot credentials. ## Authentication Method * **`bot_token`** - Telegram bot token ## Bot Token Setup ### Step 1: Create a Telegram Bot 1. Open Telegram and search for **@BotFather** 2. Start a chat and send `/newbot` 3. Follow the prompts to choose a name and username for your bot 4. BotFather will send you a token like `123456789:ABCdef...` 5. Copy and store it securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=telegram bot_token=your-bot-token ``` ## Webhook Setup (Optional) Telegram webhooks use a secret token for verification. 1. Generate a random secret string 2. Store it as the webhook signature: ```bash theme={null} pnpm corsair setup --plugin=telegram webhook_signature=your-secret-token ``` 3. Register the webhook URL with Telegram: ```ts theme={null} await corsair.telegram.api.webhook.setWebhook({ url: "https://yourapp.com/webhooks/telegram", secret_token: "your-secret-token", }); ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Bot Token | All API calls | Telegram @BotFather | | Webhook Secret | Webhook verification | Self-generated | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/telegram/overview Messaging platform for bots, channels, groups, and programmatic chat automation. Use **Telegram** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 24 typed API operations * 5 synced entities (`chats`, `files`, `messages`, `polls`, `users`) for fast `.search()` / `.list()` * 9 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/telegram ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/telegram ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/telegram ``` ```bash bun theme={null} bun add corsair @corsair-dev/telegram ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { telegram } from '@corsair-dev/telegram'; export const corsair = createCorsair({ plugins: [ telegram({ authType: 'api_key', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/telegram/get-credentials). ```ts theme={null} telegram({ authType: 'api_key', }) ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Telegram OAuth app. Provider walkthrough: [Get Credentials](/plugins/telegram/get-credentials). ```ts theme={null} telegram({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'telegram', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`chat.getChat`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.telegram.api.chat.getChat({}); ``` **`callback.answerCallbackQuery`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.telegram.api.callback.answerCallbackQuery({}); ``` See the full list on the [API](/plugins/telegram/api) page. ## Query synced data Synced entities support `tenant.telegram.db..search()` and `.list()`: `chats`, `files`, `messages`, `polls`, `users`. See [Database](/plugins/telegram/database) for filters and operators. ## Webhooks This plugin registers **9** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/telegram/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/telegram/api)** > > Every `telegram.api.*` operation with input and output types. > **[Database](/plugins/telegram/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/telegram/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/telegram/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/telegram/webhooks Telegram incoming webhooks: event paths, payloads, and response data. The Telegram plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/telegram/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `callbackQuery` * `callbackQuery` (`callbackQuery.callbackQuery`) * `channelPost` * `channelPost` (`channelPost.channelPost`) * `editedChannelPost` * `editedChannelPost` (`editedChannelPost.editedChannelPost`) * `editedMessage` * `editedMessage` (`editedMessage.editedMessage`) * `inlineQuery` * `inlineQuery` (`inlineQuery.inlineQuery`) * `message` * `message` (`message.message`) * `poll` * `poll` (`poll.poll`) * `preCheckoutQuery` * `preCheckoutQuery` (`preCheckoutQuery.preCheckoutQuery`) * `shippingQuery` * `shippingQuery` (`shippingQuery.shippingQuery`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Callback Query ### Callback Query `callbackQuery.callbackQuery` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} telegram({ webhookHooks: { callbackQuery: { callbackQuery: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Channel Post ### Channel Post `channelPost.channelPost` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} telegram({ webhookHooks: { channelPost: { channelPost: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Edited Channel Post ### Edited Channel Post `editedChannelPost.editedChannelPost` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} telegram({ webhookHooks: { editedChannelPost: { editedChannelPost: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Edited Message ### Edited Message `editedMessage.editedMessage` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} telegram({ webhookHooks: { editedMessage: { editedMessage: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Inline Query ### Inline Query `inlineQuery.inlineQuery` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} telegram({ webhookHooks: { inlineQuery: { inlineQuery: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Message ### Message `message.message` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} telegram({ webhookHooks: { message: { message: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Poll ### Poll `poll.poll` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} telegram({ webhookHooks: { poll: { poll: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Pre Checkout Query ### Pre Checkout Query `preCheckoutQuery.preCheckoutQuery` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} telegram({ webhookHooks: { preCheckoutQuery: { preCheckoutQuery: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Shipping Query ### Shipping Query `shippingQuery.shippingQuery` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} telegram({ webhookHooks: { shippingQuery: { shippingQuery: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/textrazor/api API reference for TextRazor: every `textrazor.api.*` operation with input and output types. Every `textrazor.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### get `account.get` Get the current TextRazor plan, concurrency limits, and daily usage **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.account.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > plan?: string, > concurrentRequestLimit?: number, > concurrentRequestsUsed?: number, > planDailyRequestsIncluded?: number, > requestsUsedToday?: number > } > ``` *** ## Analysis ### analyzeContent `analysis.analyzeContent` Analyze text or a URL with one or more TextRazor extractors in a single call **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.analysis.analyzeContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | — | | `url` | `string` | No | — | | `cleanupMode` | `raw \| stripTags \| cleanHTML` | No | — | | `cleanupReturnCleaned` | `boolean` | No | — | | `cleanupReturnRaw` | `boolean` | No | — | | `cleanupUseMetadata` | `boolean` | No | — | | `cleanupCleanHtmlPrecision` | `1 \| 2 \| 3` | No | — | | `cleanupCleanHtmlUseTitle` | `boolean` | No | — | | `downloadRunJavascript` | `boolean` | No | — | | `downloadUserAgent` | `string` | No | — | | `entitiesAllowOverlap` | `boolean` | No | — | | `entitiesDictionaries` | `string[]` | No | — | | `entitiesFilterDbpediaTypes` | `string[]` | No | — | | `entitiesFilterFreebaseTypes` | `string[]` | No | — | | `entitiesIncludeAddressPlaces` | `boolean` | No | — | | `languageOverride` | `string` | No | — | | `rules` | `string` | No | — | | `classifiers` | `string[]` | No | — | | `classifierMaxCategories` | `number` | No | — | | `extractors` | `entities \| topics \| words \| phrases \| dependency-trees \| relations \| entailments \| senses \| spelling[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > language?: string, > languageIsReliable?: boolean, > cleanedText?: string, > rawText?: string, > customAnnotationOutput?: any, > matchingRules?: string[], > entities?: { > id?: number, > entityId?: string | null, > entityEnglishId?: string | null, > matchedText?: string, > matchingTokens?: number[], > startingPos?: number, > endingPos?: number, > confidenceScore?: number, > relevanceScore?: number, > type?: string[], > freebaseTypes?: string[], > freebaseId?: string | null, > wikiLink?: string | null, > wikidataId?: string | null, > wikidataTypes?: string[], > customEntityId?: string, > sourceId?: string, > data?: any, > crunchbaseId?: string, > lei?: string, > figi?: string, > permid?: string, > unit?: string > }[], > topics?: { > id?: number, > label?: string, > score?: number, > wikiLink?: string | null, > wikidataId?: string | null > }[], > coarseTopics?: { > id?: number, > label?: string, > score?: number, > wikiLink?: string | null, > wikidataId?: string | null > }[], > categories?: { > id?: number, > categoryId?: string, > label?: string, > score?: number, > classifierId?: string > }[], > sentences?: { > position?: number, > words?: { > position?: number, > startingPos?: number, > endingPos?: number, > token?: string, > stem?: string, > lemma?: string, > partOfSpeech?: string, > parentPosition?: number | null, > relationToParent?: string | null, > senses?: any[], > spellingSuggestions?: any[] > }[] > }[], > nounPhrases?: { > wordPositions?: number[] > }[], > relations?: { > wordPositions?: number[], > params?: { > wordPositions?: number[], > relation?: string > }[] > }[], > properties?: { > wordPositions?: number[], > propertyPositions?: number[] > }[], > entailments?: { > wordPositions?: number[], > score?: number, > priorScore?: number, > contextScore?: number, > entailedTree?: any > }[] > } > ``` *** ### classifyText `analysis.classifyText` Classify text or a URL against built-in or custom TextRazor classifiers **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.analysis.classifyText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | — | | `url` | `string` | No | — | | `cleanupMode` | `raw \| stripTags \| cleanHTML` | No | — | | `cleanupReturnCleaned` | `boolean` | No | — | | `cleanupReturnRaw` | `boolean` | No | — | | `cleanupUseMetadata` | `boolean` | No | — | | `cleanupCleanHtmlPrecision` | `1 \| 2 \| 3` | No | — | | `cleanupCleanHtmlUseTitle` | `boolean` | No | — | | `downloadRunJavascript` | `boolean` | No | — | | `downloadUserAgent` | `string` | No | — | | `entitiesAllowOverlap` | `boolean` | No | — | | `entitiesDictionaries` | `string[]` | No | — | | `entitiesFilterDbpediaTypes` | `string[]` | No | — | | `entitiesFilterFreebaseTypes` | `string[]` | No | — | | `entitiesIncludeAddressPlaces` | `boolean` | No | — | | `languageOverride` | `string` | No | — | | `rules` | `string` | No | — | | `classifiers` | `string[]` | Yes | — | | `classifierMaxCategories` | `number` | No | — | | `extractors` | `entities \| topics \| words \| phrases \| dependency-trees \| relations \| entailments \| senses \| spelling[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > language?: string, > languageIsReliable?: boolean, > cleanedText?: string, > rawText?: string, > customAnnotationOutput?: any, > matchingRules?: string[], > entities?: { > id?: number, > entityId?: string | null, > entityEnglishId?: string | null, > matchedText?: string, > matchingTokens?: number[], > startingPos?: number, > endingPos?: number, > confidenceScore?: number, > relevanceScore?: number, > type?: string[], > freebaseTypes?: string[], > freebaseId?: string | null, > wikiLink?: string | null, > wikidataId?: string | null, > wikidataTypes?: string[], > customEntityId?: string, > sourceId?: string, > data?: any, > crunchbaseId?: string, > lei?: string, > figi?: string, > permid?: string, > unit?: string > }[], > topics?: { > id?: number, > label?: string, > score?: number, > wikiLink?: string | null, > wikidataId?: string | null > }[], > coarseTopics?: { > id?: number, > label?: string, > score?: number, > wikiLink?: string | null, > wikidataId?: string | null > }[], > categories?: { > id?: number, > categoryId?: string, > label?: string, > score?: number, > classifierId?: string > }[], > sentences?: { > position?: number, > words?: { > position?: number, > startingPos?: number, > endingPos?: number, > token?: string, > stem?: string, > lemma?: string, > partOfSpeech?: string, > parentPosition?: number | null, > relationToParent?: string | null, > senses?: any[], > spellingSuggestions?: any[] > }[] > }[], > nounPhrases?: { > wordPositions?: number[] > }[], > relations?: { > wordPositions?: number[], > params?: { > wordPositions?: number[], > relation?: string > }[] > }[], > properties?: { > wordPositions?: number[], > propertyPositions?: number[] > }[], > entailments?: { > wordPositions?: number[], > score?: number, > priorScore?: number, > contextScore?: number, > entailedTree?: any > }[] > } > ``` *** ### extractEntities `analysis.extractEntities` Extract named entities from text or a URL, optionally filtering by relevance and confidence **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.analysis.extractEntities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | — | | `url` | `string` | No | — | | `cleanupMode` | `raw \| stripTags \| cleanHTML` | No | — | | `cleanupReturnCleaned` | `boolean` | No | — | | `cleanupReturnRaw` | `boolean` | No | — | | `cleanupUseMetadata` | `boolean` | No | — | | `cleanupCleanHtmlPrecision` | `1 \| 2 \| 3` | No | — | | `cleanupCleanHtmlUseTitle` | `boolean` | No | — | | `downloadRunJavascript` | `boolean` | No | — | | `downloadUserAgent` | `string` | No | — | | `entitiesAllowOverlap` | `boolean` | No | — | | `entitiesDictionaries` | `string[]` | No | — | | `entitiesFilterDbpediaTypes` | `string[]` | No | — | | `entitiesFilterFreebaseTypes` | `string[]` | No | — | | `entitiesIncludeAddressPlaces` | `boolean` | No | — | | `languageOverride` | `string` | No | — | | `rules` | `string` | No | — | | `classifiers` | `string[]` | No | — | | `classifierMaxCategories` | `number` | No | — | | `extractors` | `entities \| topics \| words \| phrases \| dependency-trees \| relations \| entailments \| senses \| spelling[]` | No | — | | `minRelevanceScore` | `number` | No | — | | `minConfidenceScore` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > language?: string, > languageIsReliable?: boolean, > cleanedText?: string, > rawText?: string, > customAnnotationOutput?: any, > matchingRules?: string[], > entities?: { > id?: number, > entityId?: string | null, > entityEnglishId?: string | null, > matchedText?: string, > matchingTokens?: number[], > startingPos?: number, > endingPos?: number, > confidenceScore?: number, > relevanceScore?: number, > type?: string[], > freebaseTypes?: string[], > freebaseId?: string | null, > wikiLink?: string | null, > wikidataId?: string | null, > wikidataTypes?: string[], > customEntityId?: string, > sourceId?: string, > data?: any, > crunchbaseId?: string, > lei?: string, > figi?: string, > permid?: string, > unit?: string > }[], > topics?: { > id?: number, > label?: string, > score?: number, > wikiLink?: string | null, > wikidataId?: string | null > }[], > coarseTopics?: { > id?: number, > label?: string, > score?: number, > wikiLink?: string | null, > wikidataId?: string | null > }[], > categories?: { > id?: number, > categoryId?: string, > label?: string, > score?: number, > classifierId?: string > }[], > sentences?: { > position?: number, > words?: { > position?: number, > startingPos?: number, > endingPos?: number, > token?: string, > stem?: string, > lemma?: string, > partOfSpeech?: string, > parentPosition?: number | null, > relationToParent?: string | null, > senses?: any[], > spellingSuggestions?: any[] > }[] > }[], > nounPhrases?: { > wordPositions?: number[] > }[], > relations?: { > wordPositions?: number[], > params?: { > wordPositions?: number[], > relation?: string > }[] > }[], > properties?: { > wordPositions?: number[], > propertyPositions?: number[] > }[], > entailments?: { > wordPositions?: number[], > score?: number, > priorScore?: number, > contextScore?: number, > entailedTree?: any > }[] > } > ``` *** ## Classifiers ### delete `classifiers.delete` Delete a custom classifier and all of its categories **Risk:** `destructive` ```ts theme={null} await corsair.textrazor.api.classifiers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | *** ### deleteCategory `classifiers.deleteCategory` Delete a category from a custom classifier **Risk:** `destructive` ```ts theme={null} await corsair.textrazor.api.classifiers.deleteCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `categoryId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | *** ### getCategory `classifiers.getCategory` Get a category from a custom classifier by id **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.classifiers.getCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `categoryId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > categoryId: string, > label?: string, > query?: string > } > ``` *** ### listCategories `classifiers.listCategories` List categories for a custom classifier with limit and offset pagination **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.classifiers.listCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `total` | `number` | No | — | > **response full type** > > ```ts theme={null} > { > categoryId: string, > label?: string, > query?: string > }[] | { > categories: { > categoryId: string, > label?: string, > query?: string > }[] > } > ``` *** ### put `classifiers.put` Create or update a custom classifier from JSON categories **Risk:** `write` ```ts theme={null} await corsair.textrazor.api.classifiers.put({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `categories` | `object[]` | Yes | — | > **categories full type** > > ```ts theme={null} > { > categoryId: string, > label?: string, > query: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | *** ## Dictionaries ### addEntries `dictionaries.addEntries` Add or overwrite entries in a custom entity dictionary **Risk:** `write` ```ts theme={null} await corsair.textrazor.api.dictionaries.addEntries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entries` | `object[]` | Yes | — | > **entries full type** > > ```ts theme={null} > { > id?: string, > text: string, > data?: { > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | *** ### create `dictionaries.create` Create a custom entity dictionary **Risk:** `write` ```ts theme={null} await corsair.textrazor.api.dictionaries.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `matchType` | `token \| stem` | No | — | | `caseInsensitive` | `boolean` | No | — | | `language` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > id: string, > matchType?: token | stem, > caseInsensitive?: boolean, > language?: string > } > ``` *** ### delete `dictionaries.delete` Delete a custom entity dictionary and all of its entries **Risk:** `destructive` ```ts theme={null} await corsair.textrazor.api.dictionaries.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | *** ### deleteEntry `dictionaries.deleteEntry` Delete a dictionary entry by id **Risk:** `destructive` ```ts theme={null} await corsair.textrazor.api.dictionaries.deleteEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entryId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | *** ### get `dictionaries.get` Get a custom entity dictionary by id **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.dictionaries.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > id: string, > matchType?: token | stem, > caseInsensitive?: boolean, > language?: string > } > ``` *** ### getEntry `dictionaries.getEntry` Get a dictionary entry by id **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.dictionaries.getEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `entryId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | > **response full type** > > ```ts theme={null} > { > id: string, > text?: string, > data?: { > } > } > ``` *** ### list `dictionaries.list` List custom entity dictionaries on the account **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.dictionaries.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | | `dictionaries` | `object[]` | No | — | > **response full type** > > ```ts theme={null} > { > id: string, > matchType?: token | stem, > caseInsensitive?: boolean, > language?: string > }[] | { > dictionaries: { > id: string, > matchType?: token | stem, > caseInsensitive?: boolean, > language?: string > }[] > } > ``` > **dictionaries full type** > > ```ts theme={null} > { > id: string, > matchType?: token | stem, > caseInsensitive?: boolean, > language?: string > }[] > ``` *** ### listEntries `dictionaries.listEntries` List dictionary entries with limit and offset pagination **Risk:** `read` ```ts theme={null} await corsair.textrazor.api.dictionaries.listEntries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `boolean` | No | — | | `time` | `number \| string` | No | — | | `error` | `string` | No | — | | `message` | `string` | No | — | | `response` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `total` | `number` | No | — | > **response full type** > > ```ts theme={null} > { > id: string, > text?: string, > data?: { > } > }[] | { > entries: { > id: string, > text?: string, > data?: { > } > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/textrazor/database TextRazor local sync: searchable entities, `.search()` filters, and operators. The TextRazor plugin syncs data locally. Use `corsair.textrazor.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `textrazor.db.accounts.search` ```ts theme={null} const rows = await corsair.textrazor.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `plan` | `string` | equals, contains, startsWith, endsWith, in | | `concurrentRequestLimit` | `number` | equals, gt, gte, lt, lte, in | | `concurrentRequestsUsed` | `number` | equals, gt, gte, lt, lte, in | | `planDailyRequestsIncluded` | `number` | equals, gt, gte, lt, lte, in | | `requestsUsedToday` | `number` | equals, gt, gte, lt, lte, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Categories Path: `textrazor.db.categories.search` ```ts theme={null} const rows = await corsair.textrazor.db.categories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `categoryId` | `string` | equals, contains, startsWith, endsWith, in | | `label` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `classifierId` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Dictionaries Path: `textrazor.db.dictionaries.search` ```ts theme={null} const rows = await corsair.textrazor.db.dictionaries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `matchType` | `string` | equals, contains, startsWith, endsWith, in | | `caseInsensitive` | `boolean` | equals | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Dictionary Entries Path: `textrazor.db.dictionaryEntries.search` ```ts theme={null} const rows = await corsair.textrazor.db.dictionaryEntries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `dictionaryId` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Entities Path: `textrazor.db.entities.search` ```ts theme={null} const rows = await corsair.textrazor.db.entities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `entityId` | `string` | equals, contains, startsWith, endsWith, in | | `matchedText` | `string` | equals, contains, startsWith, endsWith, in | | `confidenceScore` | `number` | equals, gt, gte, lt, lte, in | | `relevanceScore` | `number` | equals, gt, gte, lt, lte, in | | `wikiLink` | `string` | equals, contains, startsWith, endsWith, in | | `wikidataId` | `string` | equals, contains, startsWith, endsWith, in | | `fetchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/textrazor/overview Natural language processing API for entity extraction, classification, and text analysis. Use **TextRazor** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 17 typed API operations * 5 synced entities (`accounts`, `categories`, `dictionaries`, `dictionaryEntries`, `entities`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/textrazor ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/textrazor ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/textrazor ``` ```bash bun theme={null} bun add corsair @corsair-dev/textrazor ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { textrazor } from '@corsair-dev/textrazor'; export const corsair = createCorsair({ plugins: [ textrazor(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} textrazor() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'textrazor', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.textrazor.api.account.get({}); ``` **`classifiers.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.textrazor.api.classifiers.delete({}); ``` See the full list on the [API](/plugins/textrazor/api) page. ## Query synced data Synced entities support `tenant.textrazor.db..search()` and `.list()`: `accounts`, `categories`, `dictionaries`, `dictionaryEntries`, `entities`. See [Database](/plugins/textrazor/database) for filters and operators. ## What's next > **[API reference](/plugins/textrazor/api)** > > Every `textrazor.api.*` operation with input and output types. > **[Database](/plugins/textrazor/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/ticktick/api API reference for TickTick: every `ticktick.api.*` operation with input and output types. Every `ticktick.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Oauth ### generateAuthUrl `oauth.generateAuthUrl` Generate TickTick OAuth2 authorization URL **Risk:** `read` ```ts theme={null} await corsair.ticktick.api.oauth.generateAuthUrl({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `state` | `string` | Yes | — | *** ## Projects ### create `projects.create` Create a new project **Risk:** `write` ```ts theme={null} await corsair.ticktick.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `sortOrder` | `number` | No | — | | `viewMode` | `list \| kanban \| timeline` | No | — | | `kind` | `TASK \| NOTE` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `sortOrder` | `number` | No | — | | `closed` | `boolean` | No | — | | `viewMode` | `list \| kanban \| timeline` | No | — | | `kind` | `TASK \| NOTE` | No | — | | `groupId` | `string` | No | — | | `permission` | `string` | No | — | *** ### delete `projects.delete` Permanently delete a project and its tasks **Risk:** `destructive` ```ts theme={null} await corsair.ticktick.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `projects.get` Get a project by ID **Risk:** `read` ```ts theme={null} await corsair.ticktick.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `sortOrder` | `number` | No | — | | `closed` | `boolean` | No | — | | `viewMode` | `list \| kanban \| timeline` | No | — | | `kind` | `TASK \| NOTE` | No | — | | `groupId` | `string` | No | — | | `permission` | `string` | No | — | *** ### getData `projects.getData` Get a project with its tasks **Risk:** `read` ```ts theme={null} await corsair.ticktick.api.projects.getData({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `project` | `object` | Yes | — | | `tasks` | `object[]` | Yes | — | | `columns` | `object[]` | No | — | > **project full type** > > ```ts theme={null} > { > id: string, > name: string, > color?: string | null, > sortOrder?: number | null, > closed?: boolean | null, > viewMode?: list | kanban | timeline | null, > kind?: TASK | NOTE | null, > groupId?: string | null, > permission?: string | null > } > ``` > **tasks full type** > > ```ts theme={null} > { > id: string, > projectId?: string | null, > title: string, > content?: string | null, > desc?: string | null, > priority?: number | null, > status?: -1 | 0 | 2 | null, > dueDate?: string | null, > startDate?: string | null, > completedTime?: string | null, > timeZone?: string | null, > isAllDay?: boolean | null, > columnId?: string | null, > parentId?: string | null, > sortOrder?: number | null, > reminders?: string[] | null, > tags?: string[] | null, > repeatFlag?: string | null, > items?: { > id?: string, > title: string, > status: number, > startDate?: string, > isAllDay?: boolean > }[] | null > }[] > ``` > **columns full type** > > ```ts theme={null} > { > id: string, > name: string, > sortOrder?: number | null > }[] > ``` *** ### getMany `projects.getMany` Get user projects (TickTick omits Inbox) **Risk:** `read` ```ts theme={null} await corsair.ticktick.api.projects.getMany({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > color?: string | null, > sortOrder?: number | null, > closed?: boolean | null, > viewMode?: list | kanban | timeline | null, > kind?: TASK | NOTE | null, > groupId?: string | null, > permission?: string | null > }[] > ``` *** ### update `projects.update` Update project details **Risk:** `write` ```ts theme={null} await corsair.ticktick.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `sortOrder` | `number` | No | — | | `viewMode` | `list \| kanban \| timeline` | No | — | | `kind` | `TASK \| NOTE` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `sortOrder` | `number` | No | — | | `closed` | `boolean` | No | — | | `viewMode` | `list \| kanban \| timeline` | No | — | | `kind` | `TASK \| NOTE` | No | — | | `groupId` | `string` | No | — | | `permission` | `string` | No | — | *** ## Tasks ### complete `tasks.complete` Mark a task as complete **Risk:** `write` ```ts theme={null} await corsair.ticktick.api.tasks.complete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### create `tasks.create` Create a new task **Risk:** `write` ```ts theme={null} await corsair.ticktick.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `projectId` | `string` | Yes | — | | `content` | `string` | No | — | | `priority` | `number` | No | 0 (None), 1 (Low), 3 (Medium), 5 (High) | | `dueDate` | `string` | No | ISO 8601 datetime, e.g. '2019-11-13T03:00:00+0000' | | `startDate` | `string` | No | — | | `timeZone` | `string` | No | — | | `isAllDay` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > title: string, > status: number, > startDate?: string, > isAllDay?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `projectId` | `string` | No | — | | `title` | `string` | Yes | — | | `content` | `string` | No | — | | `desc` | `string` | No | — | | `priority` | `number` | No | 0 (None), 1 (Low), 3 (Medium), 5 (High) | | `status` | `-1 \| 0 \| 2` | No | -1 (Abandoned), 0 (Undone), 2 (Completed) | | `dueDate` | `string` | No | — | | `startDate` | `string` | No | — | | `completedTime` | `string` | No | — | | `timeZone` | `string` | No | — | | `isAllDay` | `boolean` | No | — | | `columnId` | `string` | No | — | | `parentId` | `string` | No | — | | `sortOrder` | `number` | No | — | | `reminders` | `string[]` | No | — | | `tags` | `string[]` | No | — | | `repeatFlag` | `string` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > title: string, > status: number, > startDate?: string, > isAllDay?: boolean > }[] > ``` *** ### delete `tasks.delete` Permanently delete a task **Risk:** `destructive` ```ts theme={null} await corsair.ticktick.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### get `tasks.get` Get a task by project and ID **Risk:** `read` ```ts theme={null} await corsair.ticktick.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `taskId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `projectId` | `string` | No | — | | `title` | `string` | Yes | — | | `content` | `string` | No | — | | `desc` | `string` | No | — | | `priority` | `number` | No | 0 (None), 1 (Low), 3 (Medium), 5 (High) | | `status` | `-1 \| 0 \| 2` | No | -1 (Abandoned), 0 (Undone), 2 (Completed) | | `dueDate` | `string` | No | — | | `startDate` | `string` | No | — | | `completedTime` | `string` | No | — | | `timeZone` | `string` | No | — | | `isAllDay` | `boolean` | No | — | | `columnId` | `string` | No | — | | `parentId` | `string` | No | — | | `sortOrder` | `number` | No | — | | `reminders` | `string[]` | No | — | | `tags` | `string[]` | No | — | | `repeatFlag` | `string` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > title: string, > status: number, > startDate?: string, > isAllDay?: boolean > }[] > ``` *** ### listAll `tasks.listAll` List open tasks across listed user projects (excludes Inbox) **Risk:** `read` ```ts theme={null} await corsair.ticktick.api.tasks.listAll({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > projectId?: string | null, > title: string, > content?: string | null, > desc?: string | null, > priority?: number | null, > status?: -1 | 0 | 2 | null, > dueDate?: string | null, > startDate?: string | null, > completedTime?: string | null, > timeZone?: string | null, > isAllDay?: boolean | null, > columnId?: string | null, > parentId?: string | null, > sortOrder?: number | null, > reminders?: string[] | null, > tags?: string[] | null, > repeatFlag?: string | null, > items?: { > id?: string, > title: string, > status: number, > startDate?: string, > isAllDay?: boolean > }[] | null > }[] > ``` *** ### update `tasks.update` Update an existing task **Risk:** `write` ```ts theme={null} await corsair.ticktick.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `taskId` | `string` | Yes | — | | `projectId` | `string` | Yes | — | | `title` | `string` | Yes | — | | `content` | `string` | No | — | | `priority` | `number` | No | 0 (None), 1 (Low), 3 (Medium), 5 (High) | | `status` | `number` | No | -1 (Abandoned), 0 (Undone), 2 (Completed) | | `dueDate` | `string` | No | — | | `timeZone` | `string` | No | — | | `isAllDay` | `boolean` | No | — | | `columnId` | `string` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > title: string, > status: number, > startDate?: string, > isAllDay?: boolean > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `projectId` | `string` | No | — | | `title` | `string` | Yes | — | | `content` | `string` | No | — | | `desc` | `string` | No | — | | `priority` | `number` | No | 0 (None), 1 (Low), 3 (Medium), 5 (High) | | `status` | `-1 \| 0 \| 2` | No | -1 (Abandoned), 0 (Undone), 2 (Completed) | | `dueDate` | `string` | No | — | | `startDate` | `string` | No | — | | `completedTime` | `string` | No | — | | `timeZone` | `string` | No | — | | `isAllDay` | `boolean` | No | — | | `columnId` | `string` | No | — | | `parentId` | `string` | No | — | | `sortOrder` | `number` | No | — | | `reminders` | `string[]` | No | — | | `tags` | `string[]` | No | — | | `repeatFlag` | `string` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > title: string, > status: number, > startDate?: string, > isAllDay?: boolean > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/ticktick/database TickTick local sync: searchable entities, `.search()` filters, and operators. The TickTick plugin syncs data locally. Use `corsair.ticktick.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/ticktick/overview Task and habit manager for to-do lists, calendars, reminders, and personal productivity. Use **TickTick** through Corsair: one client, typed API calls. **What you get:** * 13 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/ticktick ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/ticktick ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/ticktick ``` ```bash bun theme={null} bun add corsair @corsair-dev/ticktick ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { ticktick } from '@corsair-dev/ticktick'; export const corsair = createCorsair({ plugins: [ ticktick(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your TickTick OAuth app. ```ts theme={null} ticktick() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'ticktick', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`oauth.generateAuthUrl`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ticktick.api.oauth.generateAuthUrl({}); ``` **`projects.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.ticktick.api.projects.create({}); ``` See the full list on the [API](/plugins/ticktick/api) page. ## What's next > **[API reference](/plugins/ticktick/api)** > > Every `ticktick.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/timecamp/api API reference for TimeCamp: every `timecamp.api.*` operation with input and output types. Every `timecamp.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Projects ### getList `projects.getList` List TimeCamp projects (root-level tasks), returning task id, name, archived status, colour, budget information and assigned users **Risk:** `read` ```ts theme={null} await corsair.timecamp.api.projects.getList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `include_archived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projects` | `object[]` | Yes | — | | `count` | `number` | Yes | — | > **projects full type** > > ```ts theme={null} > { > task_id: string, > name: string, > archived: boolean, > color?: string | null, > billable?: boolean | null, > budgeted?: number | null, > budget_unit?: string | null, > note?: string | null, > add_date?: string | null, > edit_date?: string | null, > root_group_id?: string | null, > assigned_users: string[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/timecamp/database TimeCamp local sync: searchable entities, `.search()` filters, and operators. The TimeCamp plugin syncs data locally. Use `corsair.timecamp.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Projects Path: `timecamp.db.projects.search` ```ts theme={null} const rows = await corsair.timecamp.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `archived` | `boolean` | equals | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `billable` | `boolean` | equals | | `budgeted` | `number` | equals, gt, gte, lt, lte, in | | `budget_unit` | `string` | equals, contains, startsWith, endsWith, in | | `root_group_id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/timecamp/overview Automatic time tracking software for projects, attendance, invoicing, and team productivity. Use **TimeCamp** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 1 typed API operations * 1 synced entity (`projects`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/timecamp ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/timecamp ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/timecamp ``` ```bash bun theme={null} bun add corsair @corsair-dev/timecamp ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { timecamp } from '@corsair-dev/timecamp'; export const corsair = createCorsair({ plugins: [ timecamp(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} timecamp() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'timecamp', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`projects.getList`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.timecamp.api.projects.getList({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/timecamp/api) reference.* See the full list on the [API](/plugins/timecamp/api) page. ## Query synced data Synced entities support `tenant.timecamp.db..search()` and `.list()`: `projects`. See [Database](/plugins/timecamp/database) for filters and operators. ## What's next > **[API reference](/plugins/timecamp/api)** > > Every `timecamp.api.*` operation with input and output types. > **[Database](/plugins/timecamp/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/timelink/api API reference for Timelink: every `timelink.api.*` operation with input and output types. Every `timelink.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Delete Person ### delete `deletePerson.delete` Delete a person record by their unique identifier. **Risk:** `destructive` ```ts theme={null} await corsair.timelink.api.deletePerson.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/timelink/database Timelink local sync: searchable entities, `.search()` filters, and operators. The Timelink plugin syncs data locally. Use `corsair.timelink.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/timelink/overview Scheduling and appointment booking platform for service businesses and calendar coordination. Use **Timelink** through Corsair: one client, typed API calls. **What you get:** * 1 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/timelink ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/timelink ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/timelink ``` ```bash bun theme={null} bun add corsair @corsair-dev/timelink ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { timelink } from '@corsair-dev/timelink'; export const corsair = createCorsair({ plugins: [ timelink(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} timelink() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'timelink', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Read** *No read-style endpoint inferred; pick any operation from the [API](/plugins/timelink/api) reference.* **`deletePerson.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.timelink.api.deletePerson.delete({}); ``` See the full list on the [API](/plugins/timelink/api) page. ## What's next > **[API reference](/plugins/timelink/api)** > > Every `timelink.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/tinyfish/api API reference for TinyFish: every `tinyfish.api.*` operation with input and output types. Every `tinyfish.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Agent ### cancelRun `agent.cancelRun` Cancel a pending or running run **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.agent.cancelRun({ runId: 'run_...' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `runId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `run_id` | `string` | Yes | — | | `status` | `CANCELLED \| COMPLETED \| FAILED` | Yes | — | | `cancelled_at` | `string` | No | — | | `message` | `string` | No | — | *** ### cancelRuns `agent.cancelRuns` Cancel up to 100 runs in one request **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.agent.cancelRuns({ run_ids: ['run_...'] }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `run_ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `not_found` | `string[]` | No | — | > **results full type** > > ```ts theme={null} > { > run_id: string, > status: CANCELLED | COMPLETED | FAILED, > cancelled_at?: string | null, > message?: string | null > }[] > ``` *** ### getRun `agent.getRun` Get one run with its steps, screenshots and HTML artifacts **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.agent.getRun({ runId: 'run_...', screenshots: 'url' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `runId` | `string` | Yes | — | | `screenshots` | `base64 \| url \| none` | No | — | | `html` | `url \| none` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `run_id` | `string` | Yes | — | | `status` | `PENDING \| RUNNING \| COMPLETED \| FAILED \| CANCELLED` | Yes | — | | `goal` | `string` | Yes | — | | `created_at` | `string` | Yes | — | | `started_at` | `string` | No | — | | `finished_at` | `string` | No | — | | `num_of_steps` | `number` | No | — | | `result` | `object` | No | — | | `output_schema` | `object` | No | — | | `profile_attached` | `boolean` | Yes | — | | `profile_id` | `string` | No | — | | `error` | `object` | No | — | | `profile_hint` | `object` | No | — | | `streaming_url` | `string` | No | — | | `browser_config` | `object` | No | — | | `video_url` | `string` | No | — | | `steps` | `object[]` | Yes | — | > **result full type** > > ```ts theme={null} > { > } > ``` > **output\_schema full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code?: string | null, > message: string, > category: SYSTEM_FAILURE | AGENT_FAILURE | BILLING_FAILURE | UNKNOWN, > retry_after?: number | null, > help_url?: string | null, > help_message?: string | null, > profile_hint?: { > message: string, > setup_url: string, > reason: auth_wall | bot_challenge > } | null > } > ``` > **profile\_hint full type** > > ```ts theme={null} > { > message: string, > setup_url: string, > reason: auth_wall | bot_challenge > } > ``` > **browser\_config full type** > > ```ts theme={null} > { > proxy_enabled?: boolean | null, > proxy_country_code?: string | null > } > ``` > **steps full type** > > ```ts theme={null} > { > id: string, > timestamp: string, > status: PENDING | RUNNING | COMPLETED | FAILED | CANCELLED, > action?: string | null, > screenshot?: string | null, > html?: string | null, > duration?: string | null > }[] > ``` *** ### getRuns `agent.getRuns` Get up to 100 runs by ID in one request **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.agent.getRuns({ run_ids: ['run_...'] }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `run_ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `not_found` | `string[]` | No | — | > **data full type** > > ```ts theme={null} > { > run_id: string, > status: PENDING | RUNNING | COMPLETED | FAILED | CANCELLED, > goal: string, > created_at: string, > started_at?: string | null, > finished_at?: string | null, > num_of_steps?: number | null, > result?: { > } | null, > output_schema?: { > } | null, > profile_attached: boolean, > profile_id?: string | null, > error?: { > code?: string | null, > message: string, > category: SYSTEM_FAILURE | AGENT_FAILURE | BILLING_FAILURE | UNKNOWN, > retry_after?: number | null, > help_url?: string | null, > help_message?: string | null, > profile_hint?: { > message: string, > setup_url: string, > reason: auth_wall | bot_challenge > } | null > } | null, > profile_hint?: { > message: string, > setup_url: string, > reason: auth_wall | bot_challenge > } | null, > streaming_url?: string | null, > browser_config?: { > proxy_enabled?: boolean | null, > proxy_country_code?: string | null > } | null, > video_url?: string | null, > steps: { > id: string, > timestamp: string, > status: PENDING | RUNNING | COMPLETED | FAILED | CANCELLED, > action?: string | null, > screenshot?: string | null, > html?: string | null, > duration?: string | null > }[] > }[] > ``` *** ### getStepHtml `agent.getStepHtml` Get the full-page HTML snapshot captured at one step **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.agent.getStepHtml({ runId: 'run_...', stepId: 'evt_...' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `runId` | `string` | Yes | — | | `stepId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `html` | `string` | Yes | — | *** ### getStepScreenshot `agent.getStepScreenshot` Get the JPEG screenshot captured at one step of a run **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.agent.getStepScreenshot({ runId: 'run_...', stepId: 'evt_...' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `runId` | `string` | Yes | — | | `stepId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contentType` | `string` | Yes | — | | `base64` | `string` | Yes | — | | `sizeBytes` | `number` | Yes | — | *** ### listRuns `agent.listRuns` List automation runs with status and date filters **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.agent.listRuns({ status: 'RUNNING', limit: 20 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `PENDING \| RUNNING \| COMPLETED \| FAILED \| CANCELLED` | No | — | | `goal` | `string` | No | — | | `created_after` | `string` | No | — | | `created_before` | `string` | No | — | | `sort_direction` | `asc \| desc` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > run_id: string, > status: PENDING | RUNNING | COMPLETED | FAILED | CANCELLED, > goal: string, > created_at: string, > started_at?: string | null, > finished_at?: string | null, > num_of_steps?: number | null, > result?: { > } | null, > output_schema?: { > } | null, > profile_attached: boolean, > profile_id?: string | null, > error?: { > code?: string | null, > message: string, > category: SYSTEM_FAILURE | AGENT_FAILURE | BILLING_FAILURE | UNKNOWN, > retry_after?: number | null, > help_url?: string | null, > help_message?: string | null, > profile_hint?: { > message: string, > setup_url: string, > reason: auth_wall | bot_challenge > } | null > } | null, > profile_hint?: { > message: string, > setup_url: string, > reason: auth_wall | bot_challenge > } | null, > streaming_url?: string | null, > browser_config?: { > proxy_enabled?: boolean | null, > proxy_country_code?: string | null > } | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total: number, > next_cursor?: string | null, > has_more: boolean > } > ``` *** ### run `agent.run` Automate a goal on a live website and wait for the result (billed per step) **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.agent.run({ url: 'https://example.com', goal: 'Extract the page title' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `goal` | `string` | Yes | — | | `browser_profile` | `lite \| stealth` | No | — | | `api_integration` | `string` | No | — | | `agent_config` | `object` | No | — | | `capture_config` | `object` | No | — | | `webhook_url` | `string` | No | — | | `use_vault` | `boolean` | No | — | | `use_profile` | `boolean` | No | — | | `profile_id` | `string` | No | — | | `credential_item_ids` | `string[]` | No | — | | `proxy_config` | `object` | No | — | | `output_schema` | `object` | No | — | > **agent\_config full type** > > ```ts theme={null} > { > mode?: default | strict, > cursor_style?: fish | standard | green-pointer, > max_steps?: number, > max_duration_seconds?: number > } > ``` > **capture\_config full type** > > ```ts theme={null} > { > elements?: boolean, > snapshots?: boolean, > screenshots?: boolean, > recording?: boolean, > html?: boolean > } > ``` > **proxy\_config full type** > > ```ts theme={null} > { > enabled: boolean, > country_code?: US | GB | CA | DE | FR | JP | AU | null > } > ``` > **output\_schema full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `run_id` | `string` | No | — | | `status` | `COMPLETED \| FAILED` | Yes | — | | `started_at` | `string` | No | — | | `finished_at` | `string` | No | — | | `num_of_steps` | `number` | No | — | | `result` | `object` | No | — | | `error` | `object` | No | — | | `profile_hint` | `object` | No | — | > **result full type** > > ```ts theme={null} > { > } > ``` > **error full type** > > ```ts theme={null} > { > code?: string | null, > message: string, > category: SYSTEM_FAILURE | AGENT_FAILURE | BILLING_FAILURE | UNKNOWN, > retry_after?: number | null, > help_url?: string | null, > help_message?: string | null, > profile_hint?: { > message: string, > setup_url: string, > reason: auth_wall | bot_challenge > } | null > } > ``` > **profile\_hint full type** > > ```ts theme={null} > { > message: string, > setup_url: string, > reason: auth_wall | bot_challenge > } > ``` *** ### runAsync `agent.runAsync` Queue a web automation run and return its run ID (billed per step) **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.agent.runAsync({ url: 'https://example.com', goal: 'Extract the page title', webhook_url: 'https://hooks.example.com/tinyfish' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `goal` | `string` | Yes | — | | `browser_profile` | `lite \| stealth` | No | — | | `api_integration` | `string` | No | — | | `agent_config` | `object` | No | — | | `capture_config` | `object` | No | — | | `webhook_url` | `string` | No | — | | `use_vault` | `boolean` | No | — | | `use_profile` | `boolean` | No | — | | `profile_id` | `string` | No | — | | `credential_item_ids` | `string[]` | No | — | | `proxy_config` | `object` | No | — | | `output_schema` | `object` | No | — | > **agent\_config full type** > > ```ts theme={null} > { > mode?: default | strict, > cursor_style?: fish | standard | green-pointer, > max_steps?: number, > max_duration_seconds?: number > } > ``` > **capture\_config full type** > > ```ts theme={null} > { > elements?: boolean, > snapshots?: boolean, > screenshots?: boolean, > recording?: boolean, > html?: boolean > } > ``` > **proxy\_config full type** > > ```ts theme={null} > { > enabled: boolean, > country_code?: US | GB | CA | DE | FR | JP | AU | null > } > ``` > **output\_schema full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `run_id` | `string` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` *** ### runBatch `agent.runBatch` Queue up to 100 automation runs in a single atomic request (billed per step) **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.agent.runBatch({ runs: [{ url: 'https://example.com', goal: 'Extract the page title' }] }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `runs` | `object[]` | Yes | — | | `profile_id` | `string` | No | — | | `output_schema` | `object` | No | — | > **runs full type** > > ```ts theme={null} > { > url: string, > goal: string, > browser_profile?: lite | stealth, > api_integration?: string, > agent_config?: { > mode?: default | strict, > cursor_style?: fish | standard | green-pointer, > max_steps?: number, > max_duration_seconds?: number > }, > capture_config?: { > elements?: boolean, > snapshots?: boolean, > screenshots?: boolean, > recording?: boolean, > html?: boolean > }, > webhook_url?: string, > use_vault?: boolean, > credential_item_ids?: string[], > proxy_config?: { > enabled: boolean, > country_code?: US | GB | CA | DE | FR | JP | AU | null > }, > output_schema?: { > } > }[] > ``` > **output\_schema full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `run_ids` | `string[]` | No | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > code: string, > message: string, > details?: any | null > } > ``` *** ## Browser ### createSession `browser.createSession` Start a cloud browser session and return its CDP connection URL **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.browser.createSession({ url: 'https://example.com', timeout_seconds: 600 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | — | | `timeout_seconds` | `number` | No | — | | `proxy_config` | `object` | No | — | > **proxy\_config full type** > > ```ts theme={null} > { > enabled?: boolean, > type?: tinyfish | custom, > country_code?: string, > url?: string, > username?: string, > password?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | — | | `cdp_url` | `string` | Yes | — | | `base_url` | `string` | Yes | — | *** ### terminateSession `browser.terminateSession` Terminate a cloud browser session **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.browser.terminateSession({ sessionId: 'sess_...' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sessionId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `terminated` | `true` | Yes | — | | `session_id` | `string` | Yes | — | *** ### usage `browser.usage` List browser session usage and byte volumes **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.browser.usage({ status: 'ended', limit: 50 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | No | — | | `start_after` | `string` | No | — | | `end_before` | `string` | No | — | | `status` | `running \| ended` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `page` | `number` | Yes | — | | `total_pages` | `number` | Yes | — | | `has_more` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > session_id: string, > user_id: string, > sub_user_id?: string | null, > mode: light | stealth | tf-browser, > start_time: string, > end_time?: string | null, > duration_ms?: number | null, > proxy_trg_rx_bytes?: number | null, > proxy_trg_tx_bytes?: number | null, > status: running | ended | created, > created_at: string, > updated_at: string > }[] > ``` *** ## Fetch ### fetch `fetch.fetch` Fetch up to 10 URLs as markdown, HTML or JSON with cache revalidation **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.fetch.fetch({ urls: ['https://example.com'], format: 'markdown', links: true }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `urls` | `string[]` | Yes | — | | `purpose` | `string` | No | — | | `format` | `markdown \| html \| json` | No | — | | `links` | `boolean` | No | — | | `image_links` | `boolean` | No | — | | `iframe_links` | `boolean` | No | — | | `page_metadata` | `boolean` | No | — | | `ttl` | `number` | No | — | | `per_url_timeout_ms` | `number` | No | — | | `if_none_match` | `string` | No | — | | `if_modified_since` | `string` | No | — | | `include_etag_and_last_modified` | `boolean` | No | — | | `include_selectors` | `string[]` | No | — | | `exclude_selectors` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `errors` | `object[]` | Yes | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > url: string, > final_url?: string | null, > title?: string | null, > description?: string | null, > language?: string | null, > format: markdown | html | json, > text?: string | { > } | null, > author?: string | null, > published_date?: string | null, > links?: string[], > image_links?: string[], > iframe_links?: string[], > page_metadata?: { > }, > latency_ms?: number | null, > not_modified?: boolean, > etag?: string, > last_modified?: string, > unmatched_selectors?: string[] > }[] > ``` > **errors full type** > > ```ts theme={null} > { > url: string, > error: string, > status?: number, > unmatched_selectors?: string[], > candidate_selectors?: string[] > }[] > ``` *** ### usage `fetch.usage` List recent fetch requests and their outcomes **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.fetch.usage({ status: 'completed' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_after` | `string` | No | — | | `end_before` | `string` | No | — | | `status` | `completed \| failed` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `page` | `number` | Yes | — | | `total_pages` | `number` | Yes | — | | `has_more` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: string, > url: string, > final_url: string, > title?: string | null, > description?: string | null, > language?: string | null, > author?: string | null, > published_date?: string | null, > format: markdown | html | json, > status: completed | failed, > request_origin: string, > request_id?: string | null, > text_length?: number | null, > links_count: number, > image_links_count: number, > latency_ms?: number | null, > not_modified?: boolean, > etag?: string, > last_modified?: string, > created_at: string, > error?: string | null > }[] > ``` *** ## Profiles ### create `profiles.create` Create a Browser Context Profile **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.profiles.create({ name: 'Work', set_as_default: true }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `set_as_default` | `boolean` | No | — | | `proxy_country_code` | `US \| GB \| CA \| AU \| DE \| FR \| IT \| ES \| NL \| JP \| SG \| BR \| IN` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `proxy_country_code` | `US \| GB \| CA \| AU \| DE \| FR \| IT \| ES \| NL \| JP \| SG \| BR \| IN` | No | — | | `is_default` | `boolean` | No | — | | `fingerprint_seed` | `string` | No | — | | `domain_count` | `number` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | No | — | *** ### delete `profiles.delete` Delete a profile and all of its saved cookies and sessions **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.tinyfish.api.profiles.delete({ profileId: 'p_...' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | Yes | — | *** ### get `profiles.get` Get a profile with the domains it has saved state for **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.profiles.get({ profileId: 'p_...' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `proxy_country_code` | `US \| GB \| CA \| AU \| DE \| FR \| IT \| ES \| NL \| JP \| SG \| BR \| IN` | No | — | | `is_default` | `boolean` | No | — | | `fingerprint_seed` | `string` | No | — | | `domain_count` | `number` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | No | — | | `domains` | `object[]` | Yes | — | > **domains full type** > > ```ts theme={null} > { > domain: string, > cookie_count: number, > local_storage_origin_count: number, > last_accessed_at: string, > last_written_at: string, > last_written_by_run_id: string > }[] > ``` *** ### list `profiles.list` List Browser Context Profiles **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.profiles.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `profiles` | `object[]` | Yes | — | > **profiles full type** > > ```ts theme={null} > { > id: string, > name: string, > proxy_country_code?: US | GB | CA | AU | DE | FR | IT | ES | NL | JP | SG | BR | IN | null, > is_default?: boolean, > fingerprint_seed?: string, > domain_count?: number, > created_at: string, > updated_at?: string, > signed_in_sites?: { > site: string, > claimed_at: string > }[] > }[] > ``` *** ### update `profiles.update` Rename a profile or change its proxy country and default flag **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.profiles.update({ profileId: 'p_...', name: 'Work laptop' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `profileId` | `string` | Yes | — | | `name` | `string` | No | — | | `set_as_default` | `boolean` | No | — | | `proxy_country_code` | `US \| GB \| CA \| AU \| DE \| FR \| IT \| ES \| NL \| JP \| SG \| BR \| IN` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `proxy_country_code` | `US \| GB \| CA \| AU \| DE \| FR \| IT \| ES \| NL \| JP \| SG \| BR \| IN` | No | — | | `is_default` | `boolean` | No | — | | `fingerprint_seed` | `string` | No | — | | `domain_count` | `number` | No | — | | `created_at` | `string` | Yes | — | | `updated_at` | `string` | No | — | | `domains` | `object[]` | Yes | — | > **domains full type** > > ```ts theme={null} > { > domain: string, > cookie_count: number, > local_storage_origin_count: number, > last_accessed_at: string, > last_written_at: string, > last_written_by_run_id: string > }[] > ``` *** ## Research ### cancel `research.cancel` Cancel a research run **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.research.cancel({ researchRunId: 'rr_...' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `researchRunId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `research_run_id` | `string` | Yes | — | | `status` | `RUNNING \| COMPLETED \| FAILED \| CANCELLED \| TIMED_OUT \| QUEUED` | Yes | — | | `cancelled` | `boolean` | Yes | — | *** ### get `research.get` Get a research run with its plan, evidence and report **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.research.get({ researchRunId: 'rr_...' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `researchRunId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `research_run_id` | `string` | Yes | — | | `status` | `RUNNING \| COMPLETED \| FAILED \| CANCELLED \| TIMED_OUT \| QUEUED` | Yes | — | | `query` | `string` | Yes | — | | `quick_result` | `object` | No | — | | `quick_result_summary` | `string` | No | — | | `deep_result` | `object` | No | — | | `run_ids` | `string[]` | Yes | — | | `created_at` | `string` | No | — | | `completed_at` | `string` | No | — | | `error` | `object` | No | — | | `research_plan` | `object` | No | — | | `evidence` | `object[]` | No | — | | `iterations` | `number` | No | — | > **quick\_result full type** > > ```ts theme={null} > { > answer: string, > citations: string[], > actions?: { > id: string, > label: string, > status: running | done | error, > streamingUrl?: string, > kind?: plan | search | fetch | browse | map, > iteration?: number, > url?: string, > query?: string, > details?: string[] > }[], > stats?: { > iterations: number, > sources_searched: number, > sources_fetched: number, > agent_runs: number, > claims_extracted: number, > termination_reason: planner_done | planner_no_queries | max_iterations | deadline | synthesis_failed | abort, > subquestions_covered: number, > subquestions_total: number > } > } > ``` > **deep\_result full type** > > ```ts theme={null} > { > result: string, > citations: string[], > freshness_report?: { > filter_applied?: { > domain_type?: web | news | research_paper, > after_date?: string, > before_date?: string, > recency_minutes?: number > }, > latest_published_date?: string, > sources_with_dates: number, > sources_without_dates: number, > sources_in_requested_window: number, > fetched_at_latest?: string > }, > termination_reason?: planner_done | planner_no_queries | max_iterations | deadline | synthesis_failed | abort > } > ``` > **error full type** > > ```ts theme={null} > { > code: string, > message: string, > details?: any | null > } > ``` > **research\_plan full type** > > ```ts theme={null} > { > summary: string, > subquestions: { > id: string, > question: string, > priority: high | medium | low > }[], > search_queries: string[], > done: boolean, > review?: { > id: string, > status: pending | approve | refine | timeout, > expiresAt: number, > feedback?: string, > resolvedAt?: number > } > } > ``` > **evidence full type** > > ```ts theme={null} > { > url: string, > title: string, > language?: string | null, > published_date?: string | null, > fetched_at?: string, > live_fetch?: boolean, > access_method?: fetch | browser | social, > discovered_by_queries?: string[], > search_filters?: { > after_date?: string, > before_date?: string, > recency_minutes?: number > }, > subquestions_covered: string[], > claims: { > claim: string, > snippet: string, > subquestion_id: string, > confidence: high | medium | low, > claim_type?: fact | official_statement | reported_claim | estimate | opinion | user_sentiment | unverified > }[], > source_quality: primary | secondary | low > }[] > ``` *** ### list `research.list` List research runs with status and date filters **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.research.list({ status: 'RUNNING' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `RUNNING \| COMPLETED \| FAILED \| CANCELLED \| TIMED_OUT \| QUEUED` | No | — | | `query` | `string` | No | — | | `created_after` | `string` | No | — | | `created_before` | `string` | No | — | | `sort_direction` | `asc \| desc` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > research_run_id: string, > status: RUNNING | COMPLETED | FAILED | CANCELLED | TIMED_OUT | QUEUED, > query: string, > quick_result?: { > answer: string, > citations: string[], > actions?: { > id: string, > label: string, > status: running | done | error, > streamingUrl?: string, > kind?: plan | search | fetch | browse | map, > iteration?: number, > url?: string, > query?: string, > details?: string[] > }[], > stats?: { > iterations: number, > sources_searched: number, > sources_fetched: number, > agent_runs: number, > claims_extracted: number, > termination_reason: planner_done | planner_no_queries | max_iterations | deadline | synthesis_failed | abort, > subquestions_covered: number, > subquestions_total: number > } > } | null, > quick_result_summary?: string | null, > deep_result?: { > result: string, > citations: string[], > freshness_report?: { > filter_applied?: { > domain_type?: web | news | research_paper, > after_date?: string, > before_date?: string, > recency_minutes?: number > }, > latest_published_date?: string, > sources_with_dates: number, > sources_without_dates: number, > sources_in_requested_window: number, > fetched_at_latest?: string > }, > termination_reason?: planner_done | planner_no_queries | max_iterations | deadline | synthesis_failed | abort > } | null, > run_ids: string[], > created_at?: string | null, > completed_at?: string | null, > error?: { > code: string, > message: string, > details?: any | null > } | null, > research_plan?: { > summary: string, > subquestions: { > id: string, > question: string, > priority: high | medium | low > }[], > search_queries: string[], > done: boolean, > review?: { > id: string, > status: pending | approve | refine | timeout, > expiresAt: number, > feedback?: string, > resolvedAt?: number > } > } | null, > evidence?: { > url: string, > title: string, > language?: string | null, > published_date?: string | null, > fetched_at?: string, > live_fetch?: boolean, > access_method?: fetch | browser | social, > discovered_by_queries?: string[], > search_filters?: { > after_date?: string, > before_date?: string, > recency_minutes?: number > }, > subquestions_covered: string[], > claims: { > claim: string, > snippet: string, > subquestion_id: string, > confidence: high | medium | low, > claim_type?: fact | official_statement | reported_claim | estimate | opinion | user_sentiment | unverified > }[], > source_quality: primary | secondary | low > }[] | null, > iterations?: number | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > total: number, > next_cursor?: string | null, > has_more: boolean > } > ``` *** ### start `research.start` Start a cited research run and return its research run ID **Risk:** `write` ```ts theme={null} await corsair.tinyfish.api.research.start({ query: 'state of browser agents in 2026', mode: 'deep' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `mode` | `deep \| max` | No | — | | `stream` | `boolean` | No | — | | `output_language` | `string` | No | — | | `weak_sources_enabled` | `boolean` | No | — | | `domain_type` | `web \| news \| research_paper` | No | — | | `after_date` | `string` | No | — | | `before_date` | `string` | No | — | | `recency_minutes` | `number` | No | — | | `domain_filter` | `object` | No | — | | `prior_run_id` | `string` | No | — | | `session_id` | `string` | No | — | > **domain\_filter full type** > > ```ts theme={null} > { > mode: include | exclusive, > domains?: string[], > block?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `research_run_id` | `string` | Yes | — | | `error` | `object` | No | — | > **error full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` *** ## Search ### search `search.search` Search the web with intent, date, domain and academic filters **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.search.search({ query: 'open source integration layer', domain_type: 'news', recency_minutes: 1440 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `purpose` | `string` | No | — | | `location` | `string` | No | — | | `language` | `string` | No | — | | `include_domains` | `string` | No | — | | `exclude_domains` | `string` | No | — | | `domain_type` | `web \| news \| research_paper` | No | — | | `after_date` | `string` | No | — | | `before_date` | `string` | No | — | | `recency_minutes` | `number` | No | — | | `pub_year_min` | `number` | No | — | | `pub_year_max` | `number` | No | — | | `page` | `number` | No | — | | `include_thumbnail` | `true \| false` | No | — | | `fetch` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `results` | `object[]` | Yes | — | | `total_results` | `number` | Yes | — | | `page` | `number` | Yes | — | | `request_id` | `string` | No | — | > **results full type** > > ```ts theme={null} > { > position: number, > site_name: string, > snippet: string, > title: string, > url: string, > thumbnail_url?: string | null, > fetch?: any | null, > fetch_error?: any | null, > date?: string | null, > publisher?: string | null, > authors?: string[], > venue?: string | null, > year?: number | null, > cited_by_count?: number | null, > pdf_url?: string | null > }[] > ``` *** ### usage `search.usage` List recent search requests and their stored results **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.search.usage({ status: 'completed', limit: 20 }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_after` | `string` | No | — | | `end_before` | `string` | No | — | | `status` | `completed \| failed` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `total` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `page` | `number` | Yes | — | | `total_pages` | `number` | Yes | — | | `has_more` | `boolean` | Yes | — | > **items full type** > > ```ts theme={null} > { > id: number, > request_id: string, > query: string, > status_code: number, > result_count: number, > results?: { > position: number, > site_name: string, > snippet: string, > title: string, > url: string, > thumbnail_url?: string | null, > fetch?: any | null, > fetch_error?: any | null, > date?: string | null, > publisher?: string | null, > authors?: string[], > venue?: string | null, > year?: number | null, > cited_by_count?: number | null, > pdf_url?: string | null > }[] | null, > cached?: boolean | null, > response_size_bytes?: number | null, > created_at: string > }[] > ``` *** ## Vault ### list `vault.list` List vault items and the credential IDs a run body can reference **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.vault.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > itemId: string, > connectionId?: string | null, > label: string, > vaultName: string, > domains: string[], > fieldMetadata: { > fieldId: string, > label: string, > type: STRING | CONCEALED | OTP > }[], > hasTotp: boolean > }[] > ``` *** ## Wallet ### get `wallet.get` Get the wallet balance, pending top-up and per-product rates **Risk:** `read` ```ts theme={null} await corsair.tinyfish.api.wallet.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `available_balance` | `string` | Yes | — | | `currency` | `USD` | Yes | — | | `as_of` | `string` | Yes | — | | `auto_reload` | `any` | No | — | | `pending_top_up` | `object` | No | — | | `rates` | `object` | No | — | | `agent_top_up_url` | `string` | No | — | > **pending\_top\_up full type** > > ```ts theme={null} > { > amount: string, > started_at: string > } > ``` > **rates full type** > > ```ts theme={null} > { > meters: { > label: string, > unit_amount: string, > currency: USD, > per: string > }[], > as_of: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/tinyfish/database TinyFish local sync: searchable entities, `.search()` filters, and operators. The TinyFish plugin syncs data locally. Use `corsair.tinyfish.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Agent Runs Path: `tinyfish.db.agentRuns.search` ```ts theme={null} const rows = await corsair.tinyfish.db.agentRuns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `goal` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `startedAt` | `date` | equals, before, after, between | | `finishedAt` | `date` | equals, before, after, between | | `numOfSteps` | `number` | equals, gt, gte, lt, lte, in | | `errorCode` | `string` | equals, contains, startsWith, endsWith, in | | `errorMessage` | `string` | equals, contains, startsWith, endsWith, in | | `profileId` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/tinyfish/overview Web search, page fetch, cloud browser sessions, web automation agents, cited research, and reusable browser profiles behind one API key. Use **TinyFish** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 28 typed API operations * 1 synced entity (`agentRuns`) for fast `.search()` / `.list()` * 3 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tinyfish ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tinyfish ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tinyfish ``` ```bash bun theme={null} bun add corsair @corsair-dev/tinyfish ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tinyfish } from '@corsair-dev/tinyfish'; export const corsair = createCorsair({ plugins: [ tinyfish(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} tinyfish() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tinyfish', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Search the web** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tinyfish.api.search.search({ query: 'open source integration layer', location: 'US' }); ``` **Queue a web automation run** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tinyfish.api.agent.runAsync({ url: 'https://example.com', goal: 'Extract the page title' }); ``` See the full list on the [API](/plugins/tinyfish/api) page. ## Query synced data Runs are stamped into the agentRuns entity by sync runs, async acknowledgements, polls and webhook deliveries, so one run never duplicates rows. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.tinyfish.db.agentRuns.search({ data: { status: 'COMPLETED' }, limit: 50, }); ``` Synced entities: `agentRuns`. See [Database](/plugins/tinyfish/database) for filters and operators. ## Webhooks Fires when a web automation run finishes; the plugin stamps the terminal state into agentRuns. ```ts theme={null} tinyfish({ webhookHooks: { run: { completed: { after: async (ctx, result) => { console.log('Run finished:', result.data.run_id, result.data.status); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/tinyfish/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/tinyfish/api)** > > Every `tinyfish.api.*` operation with input and output types. > **[Database](/plugins/tinyfish/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/tinyfish/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/tinyfish/webhooks TinyFish incoming webhooks: event paths, payloads, and response data. The TinyFish plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/tinyfish/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `run` * `cancelled` (`run.cancelled`) * `completed` (`run.completed`) * `failed` (`run.failed`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Run ### Cancelled `run.cancelled` A run reached CANCELLED **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `run.cancelled` | Yes | — | | `run_id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > run_id?: string, > status?: string, > goal?: string, > created_at?: string, > started_at?: string | null, > finished_at?: string | null, > num_of_steps?: number | null, > result?: { > } | null, > error?: { > code?: string | null, > message?: string, > category?: string > } | null, > streaming_url?: string | null, > steps?: { > id: string, > timestamp: string, > status: string, > action?: string | null, > screenshot?: string | null, > html?: string | null, > duration?: string | null > }[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: run.cancelled, > run_id: string, > status: string, > data?: { > run_id?: string, > status?: string, > goal?: string, > created_at?: string, > started_at?: string | null, > finished_at?: string | null, > num_of_steps?: number | null, > result?: { > } | null, > error?: { > code?: string | null, > message?: string, > category?: string > } | null, > streaming_url?: string | null, > steps?: { > id: string, > timestamp: string, > status: string, > action?: string | null, > screenshot?: string | null, > html?: string | null, > duration?: string | null > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} tinyfish({ webhookHooks: { run: { cancelled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Completed `run.completed` A run reached COMPLETED with its results attached **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `run.completed` | Yes | — | | `run_id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > run_id?: string, > status?: string, > goal?: string, > created_at?: string, > started_at?: string | null, > finished_at?: string | null, > num_of_steps?: number | null, > result?: { > } | null, > error?: { > code?: string | null, > message?: string, > category?: string > } | null, > streaming_url?: string | null, > steps?: { > id: string, > timestamp: string, > status: string, > action?: string | null, > screenshot?: string | null, > html?: string | null, > duration?: string | null > }[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: run.completed, > run_id: string, > status: string, > data?: { > run_id?: string, > status?: string, > goal?: string, > created_at?: string, > started_at?: string | null, > finished_at?: string | null, > num_of_steps?: number | null, > result?: { > } | null, > error?: { > code?: string | null, > message?: string, > category?: string > } | null, > streaming_url?: string | null, > steps?: { > id: string, > timestamp: string, > status: string, > action?: string | null, > screenshot?: string | null, > html?: string | null, > duration?: string | null > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} tinyfish({ webhookHooks: { run: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Failed `run.failed` A run reached FAILED with its error attached **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `run.failed` | Yes | — | | `run_id` | `string` | Yes | — | | `status` | `string` | Yes | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > run_id?: string, > status?: string, > goal?: string, > created_at?: string, > started_at?: string | null, > finished_at?: string | null, > num_of_steps?: number | null, > result?: { > } | null, > error?: { > code?: string | null, > message?: string, > category?: string > } | null, > streaming_url?: string | null, > steps?: { > id: string, > timestamp: string, > status: string, > action?: string | null, > screenshot?: string | null, > html?: string | null, > duration?: string | null > }[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: run.failed, > run_id: string, > status: string, > data?: { > run_id?: string, > status?: string, > goal?: string, > created_at?: string, > started_at?: string | null, > finished_at?: string | null, > num_of_steps?: number | null, > result?: { > } | null, > error?: { > code?: string | null, > message?: string, > category?: string > } | null, > streaming_url?: string | null, > steps?: { > id: string, > timestamp: string, > status: string, > action?: string | null, > screenshot?: string | null, > html?: string | null, > duration?: string | null > }[] > } > } > ``` **`webhookHooks` example** ```ts theme={null} tinyfish({ webhookHooks: { run: { failed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/tinypng/api API reference for TinyPNG: every `tinypng.api.*` operation with input and output types. Every `tinypng.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getCompressionCount `account.getCompressionCount` Get the number of compressions made this calendar month **Risk:** `read` ```ts theme={null} await corsair.tinypng.api.account.getCompressionCount({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `compressionCount` | `number` | Yes | — | *** ## Images ### compressAndStoreInAzure `images.compressAndStoreInAzure` Compress an image and upload the result to Azure Blob Storage through a SAS URL **Risk:** `write` ```ts theme={null} await corsair.tinypng.api.images.compressAndStoreInAzure({ source: { url: 'https://tinypng.com/images/panda-happy.png' }, blobUrl: 'https://myaccount.blob.core.windows.net/images/panda.png?sv=2022-11-02&sig=REDACTED', }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `source` | `object` | Yes | — | | `blobUrl` | `string` | Yes | Full blob URL with a SAS token granting create/write, e.g. [https://acct.blob.core.windows.net/container/name.png?sv=](https://acct.blob.core.windows.net/container/name.png?sv=)... | | `cacheControl` | `string` | No | — | | `resize` | `object` | No | — | | `convert` | `object` | No | Several types return the smallest result | | `transform` | `object` | No | — | | `preserve` | `copyright \| creation \| location[]` | No | — | > **source full type** > > ```ts theme={null} > { > url: string > } | { > base64: string > } > ``` > **resize full type** > > ```ts theme={null} > { > method: scale | fit | cover | thumb, > width?: number, > height?: number > } > ``` > **convert full type** > > ```ts theme={null} > { > type: image/avif | image/webp | image/jpeg | image/png | image/jxl | */* | image/avif | image/webp | image/jpeg | image/png | image/jxl | */*[] > } > ``` > **transform full type** > > ```ts theme={null} > { > background: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `imageId` | `string` | Yes | — | | `blobUrl` | `string` | Yes | Blob URL without the SAS query string | | `contentType` | `string` | Yes | — | | `size` | `number` | Yes | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `compressionCount` | `number` | No | — | | `etag` | `string` | No | — | *** ### output `images.output` Download a compressed image by its Tinify image ID as base64 **Risk:** `read` ```ts theme={null} await corsair.tinypng.api.images.output({ imageId: '2xnsp7jn34e5' }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `imageId` | `string` | Yes | — | | `contentType` | `string` | Yes | — | | `size` | `number` | Yes | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `compressionCount` | `number` | No | — | | `base64` | `string` | Yes | — | *** ### shrink `images.shrink` Compress an image from a URL or base64 bytes and return its Tinify image ID (uses one compression) **Risk:** `write` ```ts theme={null} await corsair.tinypng.api.images.shrink({ source: { url: 'https://tinypng.com/images/panda-happy.png' }, }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `source` | `object` | Yes | — | > **source full type** > > ```ts theme={null} > { > url: string > } | { > base64: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `imageId` | `string` | Yes | — | | `outputUrl` | `string` | Yes | — | | `compressionCount` | `number` | No | — | | `input` | `object` | Yes | — | | `output` | `object` | No | — | > **input full type** > > ```ts theme={null} > { > size: number, > type: string > } > ``` > **output full type** > > ```ts theme={null} > { > size: number, > type: string, > width?: number, > height?: number, > ratio?: number > } > ``` *** ### transform `images.transform` Resize, convert, fill the background of, or preserve metadata on a compressed image, optionally storing it on S3 or GCS **Risk:** `write` ```ts theme={null} await corsair.tinypng.api.images.transform({ imageId: '2xnsp7jn34e5', resize: { method: 'fit', width: 150, height: 100 }, convert: { type: 'image/webp' }, }); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageId` | `string` | Yes | — | | `resize` | `object` | No | — | | `convert` | `object` | No | Several types return the smallest result | | `transform` | `object` | No | — | | `preserve` | `copyright \| creation \| location[]` | No | — | | `store` | `object` | No | Upload the result to S3 or GCS instead of returning the bytes | > **resize full type** > > ```ts theme={null} > { > method: scale | fit | cover | thumb, > width?: number, > height?: number > } > ``` > **convert full type** > > ```ts theme={null} > { > type: image/avif | image/webp | image/jpeg | image/png | image/jxl | */* | image/avif | image/webp | image/jpeg | image/png | image/jxl | */*[] > } > ``` > **transform full type** > > ```ts theme={null} > { > background: string > } > ``` > **store full type** > > ```ts theme={null} > { > service: s3, > aws_access_key_id: string, > aws_secret_access_key: string, > region: string, > path: string, > headers?: { > Cache-Control: string > }, > acl?: string > } | { > service: gcs, > gcp_access_token: string, > path: string, > headers?: { > Cache-Control: string > } > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > imageId: string, > contentType: string, > size: number, > width?: number, > height?: number, > compressionCount?: number, > base64: string, > stored: false > } | { > stored: true, > imageId: string, > location: string, > width?: number, > height?: number, > compressionCount?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/tinypng/database TinyPNG local sync: searchable entities, `.search()` filters, and operators. The TinyPNG plugin syncs data locally. Use `corsair.tinypng.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Images Path: `tinypng.db.images.search` ```ts theme={null} const rows = await corsair.tinypng.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `compression_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Stored Outputs Path: `tinypng.db.storedOutputs.search` ```ts theme={null} const rows = await corsair.tinypng.db.storedOutputs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `image_id` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `number` | equals, gt, gte, lt, lte, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `content_type` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `etag` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Usage Path: `tinypng.db.usage.search` ```ts theme={null} const rows = await corsair.tinypng.db.usage.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `compression_count` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/tinypng/overview Image compression API for shrinking, resizing, and converting AVIF, WebP, JPEG, and PNG images. Use **TinyPNG** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 3 synced entities (`images`, `storedOutputs`, `usage`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tinypng ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tinypng ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tinypng ``` ```bash bun theme={null} bun add corsair @corsair-dev/tinypng ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tinypng } from '@corsair-dev/tinypng'; export const corsair = createCorsair({ plugins: [ tinypng(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} tinypng() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tinypng', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Get this month's compression count** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tinypng.api.account.getCompressionCount({}); ``` **Compress an image from a URL** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tinypng.api.images.shrink({ source: { url: 'https://tinypng.com/images/panda-happy.png' }, }); ``` See the full list on the [API](/plugins/tinypng/api) page. ## Query synced data Synced entities support `tenant.tinypng.db..search()` and `.list()`: `images`, `storedOutputs`, `usage`. See [Database](/plugins/tinypng/database) for filters and operators. ## What's next > **[API reference](/plugins/tinypng/api)** > > Every `tinypng.api.*` operation with input and output types. > **[Database](/plugins/tinypng/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/tinyurl/api API reference for TinyURL: every `tinyurl.api.*` operation with input and output types. Every `tinyurl.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Urls ### create `urls.create` Shorten a URL using TinyURL **Risk:** `write` ```ts theme={null} await corsair.tinyurl.api.urls.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The long URL to be shortened | | `domain` | `string` | No | Domain to use for the shortened URL (e.g. tinyurl.com) | | `alias` | `string` | No | Optional custom alias for the shortened URL | | `tags` | `string \| string[]` | No | Optional tags; official body uses a comma-separated string | | `expires_at` | `string` | No | Optional expiration in YYYY-MM-DD HH:MM:SS | | `description` | `string` | No | Optional description for the link | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `alias` | `string` | Yes | — | | `deleted` | `boolean` | No | — | | `archived` | `boolean` | No | — | | `analytics` | `object` | No | — | | `tags` | `string[]` | No | — | | `created_at` | `string` | No | — | | `expires_at` | `string` | No | — | | `tiny_url` | `string` | Yes | — | | `url` | `string` | Yes | — | | `description` | `string` | No | — | > **analytics full type** > > ```ts theme={null} > { > enabled?: boolean, > public?: boolean > } > ``` *** ### list `urls.list` List available or archived TinyURLs **Risk:** `read` ```ts theme={null} await corsair.tinyurl.api.urls.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `available \| archived` | Yes | URL list type for GET /urls/ | | `page` | `number` | No | Page number for pagination | | `limit` | `number` | No | Results per page (1-100) | | `from` | `string` | No | Start of time period filter | | `to` | `string` | No | End of time period filter | | `alias` | `string` | No | Filter by alias | | `tag` | `string` | No | Filter by tag | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `code` | `number` | No | — | | `errors` | `any[]` | No | — | > **data full type** > > ```ts theme={null} > { > domain: string, > alias: string, > deleted?: boolean, > archived?: boolean, > analytics?: { > enabled?: boolean, > public?: boolean > }, > tags?: string[], > created_at?: string, > expires_at?: string | null, > tiny_url: string, > url?: string, > description?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/tinyurl/database TinyURL local sync: searchable entities, `.search()` filters, and operators. The TinyURL plugin syncs data locally. Use `corsair.tinyurl.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Links Path: `tinyurl.db.links.search` ```ts theme={null} const rows = await corsair.tinyurl.db.links.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `deleted` | `boolean` | equals | | `archived` | `boolean` | equals | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `expires_at` | `string` | equals, contains, startsWith, endsWith, in | | `tiny_url` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/tinyurl/overview URL shortening service for creating compact links and tracking click analytics. Use **TinyURL** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 2 typed API operations * 1 synced entity (`links`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tinyurl ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tinyurl ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tinyurl ``` ```bash bun theme={null} bun add corsair @corsair-dev/tinyurl ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tinyurl } from '@corsair-dev/tinyurl'; export const corsair = createCorsair({ plugins: [ tinyurl(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} tinyurl() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tinyurl', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`urls.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tinyurl.api.urls.list({}); ``` **`urls.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tinyurl.api.urls.create({}); ``` See the full list on the [API](/plugins/tinyurl/api) page. ## Query synced data Synced entities support `tenant.tinyurl.db..search()` and `.list()`: `links`. See [Database](/plugins/tinyurl/database) for filters and operators. ## What's next > **[API reference](/plugins/tinyurl/api)** > > Every `tinyurl.api.*` operation with input and output types. > **[Database](/plugins/tinyurl/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/tisane/api API reference for Tisane: every `tisane.api.*` operation with input and output types. Every `tisane.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Text ### extractEntities `text.extractEntities` Extract named entities and topics from text **Risk:** `read` ```ts theme={null} await corsair.tisane.api.text.extractEntities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | Text to extract named entities and topics from | | `language` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `entities` | `object[]` | Yes | — | | `topics` | `object[]` | Yes | — | > **entities full type** > > ```ts theme={null} > { > name: string, > type?: any, > subtypes?: any[], > wikidata?: string, > mentions?: any[] > }[] > ``` > **topics full type** > > ```ts theme={null} > { > topic: string, > coverage?: number > }[] > ``` *** ### moderate `text.moderate` Content moderation for abuse, hate speech, and harassment **Risk:** `read` ```ts theme={null} await corsair.tisane.api.text.moderate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | Text to check for abusive language, hate speech, or harassment | | `language` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `abuse` | `object[]` | Yes | — | | `flagged` | `boolean` | Yes | — | > **abuse full type** > > ```ts theme={null} > { > type: string, > severity?: string, > text?: string, > offset?: number, > length?: number, > sentence_index?: number, > explanation?: string > }[] > ``` *** ### parse `text.parse` Comprehensive natural language parsing and text analysis **Risk:** `read` ```ts theme={null} await corsair.tisane.api.text.parse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | The text content to analyze | | `language` | `string` | Yes | ISO 639-1 language code | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > snippets?: boolean, > sentiment?: boolean, > entities?: boolean, > topics?: boolean, > abuse?: boolean, > format?: string, > explain?: boolean, > topic_stats?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `language` | `string` | No | — | | `topics` | `object[]` | No | — | | `abuse` | `object[]` | No | — | | `entities_summary` | `object[]` | No | — | | `sentiment_expressions` | `object[]` | No | — | > **topics full type** > > ```ts theme={null} > ( > string | { > topic: string, > coverage?: number > } > )[] > ``` > **abuse full type** > > ```ts theme={null} > { > type: string, > severity?: string, > text?: string, > offset?: number, > length?: number, > sentence_index?: number, > explanation?: string > }[] > ``` > **entities\_summary full type** > > ```ts theme={null} > { > name: string, > type?: any, > subtypes?: any[], > wikidata?: string, > mentions?: any[] > }[] > ``` > **sentiment\_expressions full type** > > ```ts theme={null} > { > polarity: positive | negative | mixed | neutral, > offset?: number, > length?: number, > sentence_index?: number, > targets?: any[], > reasons?: any[], > text?: string, > explanation?: string > }[] > ``` *** ### sentiment `text.sentiment` Aspect-based sentiment analysis and tone evaluation **Risk:** `read` ```ts theme={null} await corsair.tisane.api.text.sentiment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | Text to analyze for aspect-based sentiment | | `language` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sentiment` | `object[]` | Yes | — | | `text` | `string` | No | — | > **sentiment full type** > > ```ts theme={null} > { > polarity: positive | negative | mixed | neutral, > offset?: number, > length?: number, > sentence_index?: number, > targets?: any[], > reasons?: any[], > text?: string, > explanation?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/tisane/database Tisane local sync: searchable entities, `.search()` filters, and operators. The Tisane plugin syncs data locally. Use `corsair.tisane.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/tisane/overview Text moderation API for detecting toxicity, spam, and policy violations in user content. Use **Tisane** through Corsair: one client, typed API calls. **What you get:** * 4 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tisane ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tisane ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tisane ``` ```bash bun theme={null} bun add corsair @corsair-dev/tisane ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tisane } from '@corsair-dev/tisane'; export const corsair = createCorsair({ plugins: [ tisane(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} tisane() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tisane', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`text.extractEntities`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tisane.api.text.extractEntities({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/tisane/api) reference.* See the full list on the [API](/plugins/tisane/api) page. ## What's next > **[API reference](/plugins/tisane/api)** > > Every `tisane.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/todoist/api API reference for Todoist: every `todoist.api.*` operation with input and output types. Every `todoist.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Comments ### create `comments.create` Create a Todoist comment **Risk:** `write` ```ts theme={null} await corsair.todoist.api.comments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | | `task_id` | `string` | No | — | | `project_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `task_id` | `string` | No | — | | `project_id` | `string` | No | — | | `content` | `string` | Yes | — | | `posted_at` | `string` | No | — | *** ### delete `comments.delete` Delete a Todoist comment **Risk:** `destructive` ```ts theme={null} await corsair.todoist.api.comments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### get `comments.get` Get a Todoist comment by ID **Risk:** `read` ```ts theme={null} await corsair.todoist.api.comments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `task_id` | `string` | No | — | | `project_id` | `string` | No | — | | `content` | `string` | Yes | — | | `posted_at` | `string` | No | — | *** ### getMany `comments.getMany` List Todoist comments for a task or project **Risk:** `read` ```ts theme={null} await corsair.todoist.api.comments.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | No | — | | `project_id` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > task_id?: string, > project_id?: string, > content: string, > posted_at?: string > }[] > ``` *** ### update `comments.update` Update a Todoist comment **Risk:** `write` ```ts theme={null} await corsair.todoist.api.comments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `content` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `task_id` | `string` | No | — | | `project_id` | `string` | No | — | | `content` | `string` | Yes | — | | `posted_at` | `string` | No | — | *** ## Labels ### create `labels.create` Create a Todoist label **Risk:** `write` ```ts theme={null} await corsair.todoist.api.labels.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `order` | `number` | No | — | | `favorite` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `order` | `number` | No | — | | `favorite` | `boolean` | No | — | *** ### delete `labels.delete` Delete a Todoist label **Risk:** `destructive` ```ts theme={null} await corsair.todoist.api.labels.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### get `labels.get` Get a Todoist label by ID **Risk:** `read` ```ts theme={null} await corsair.todoist.api.labels.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `order` | `number` | No | — | | `favorite` | `boolean` | No | — | *** ### getMany `labels.getMany` List Todoist labels **Risk:** `read` ```ts theme={null} await corsair.todoist.api.labels.getMany({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > color?: string, > order?: number, > favorite?: boolean > }[] > ``` *** ### update `labels.update` Update a Todoist label **Risk:** `write` ```ts theme={null} await corsair.todoist.api.labels.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `order` | `number` | No | — | | `favorite` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `order` | `number` | No | — | | `favorite` | `boolean` | No | — | *** ## Projects ### archive `projects.archive` Archive a Todoist project **Risk:** `write` ```ts theme={null} await corsair.todoist.api.projects.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### create `projects.create` Create a Todoist project **Risk:** `write` ```ts theme={null} await corsair.todoist.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `favorite` | `boolean` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `favorite` | `boolean` | No | — | | `comment_count` | `number` | No | — | | `is_shared` | `boolean` | No | — | | `is_archived` | `boolean` | No | — | | `is_favorite` | `boolean` | No | — | | `view_style` | `string` | No | — | *** ### delete `projects.delete` Delete a Todoist project **Risk:** `destructive` ```ts theme={null} await corsair.todoist.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### get `projects.get` Get a Todoist project by ID **Risk:** `read` ```ts theme={null} await corsair.todoist.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `favorite` | `boolean` | No | — | | `comment_count` | `number` | No | — | | `is_shared` | `boolean` | No | — | | `is_archived` | `boolean` | No | — | | `is_favorite` | `boolean` | No | — | | `view_style` | `string` | No | — | *** ### getCollaborators `projects.getCollaborators` List collaborators for a Todoist project **Risk:** `read` ```ts theme={null} await corsair.todoist.api.projects.getCollaborators({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string, > email?: string > }[] > ``` *** ### getMany `projects.getMany` List Todoist projects **Risk:** `read` ```ts theme={null} await corsair.todoist.api.projects.getMany({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > color?: string, > parent_id?: string, > order?: number, > favorite?: boolean, > comment_count?: number, > is_shared?: boolean, > is_archived?: boolean, > is_favorite?: boolean, > view_style?: string > }[] | { > projects?: { > id: string, > name: string, > color?: string, > parent_id?: string, > order?: number, > favorite?: boolean, > comment_count?: number, > is_shared?: boolean, > is_archived?: boolean, > is_favorite?: boolean, > view_style?: string > }[] > } > ``` *** ### unarchive `projects.unarchive` Unarchive a Todoist project **Risk:** `write` ```ts theme={null} await corsair.todoist.api.projects.unarchive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### update `projects.update` Update a Todoist project **Risk:** `write` ```ts theme={null} await corsair.todoist.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | | `favorite` | `boolean` | No | — | | `order` | `number` | No | — | | `parent_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `favorite` | `boolean` | No | — | | `comment_count` | `number` | No | — | | `is_shared` | `boolean` | No | — | | `is_archived` | `boolean` | No | — | | `is_favorite` | `boolean` | No | — | | `view_style` | `string` | No | — | *** ## Reminders ### create `reminders.create` Create a Todoist reminder **Risk:** `write` ```ts theme={null} await corsair.todoist.api.reminders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `task_id` | `string` | Yes | — | | `due_datetime` | `string` | No | — | | `due_date` | `string` | No | — | | `due_string` | `string` | No | — | | `relative_duration` | `number` | No | — | | `notification_type` | `string` | No | — | | `notify_uid` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `task_id` | `string` | No | — | | `notify_uid` | `string` | No | — | | `due` | `object` | No | — | > **due full type** > > ```ts theme={null} > { > } > ``` *** ### delete `reminders.delete` Delete a Todoist reminder **Risk:** `destructive` ```ts theme={null} await corsair.todoist.api.reminders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### getMany `reminders.getMany` List Todoist reminders **Risk:** `read` ```ts theme={null} await corsair.todoist.api.reminders.getMany({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > task_id?: string, > notify_uid?: string, > due?: { > } > }[] > ``` *** ### update `reminders.update` Update a Todoist reminder **Risk:** `write` ```ts theme={null} await corsair.todoist.api.reminders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `task_id` | `string` | No | — | | `due_datetime` | `string` | No | — | | `due_date` | `string` | No | — | | `due_string` | `string` | No | — | | `relative_duration` | `number` | No | — | | `notification_type` | `string` | No | — | | `notify_uid` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `task_id` | `string` | No | — | | `notify_uid` | `string` | No | — | | `due` | `object` | No | — | > **due full type** > > ```ts theme={null} > { > } > ``` *** ## Sections ### create `sections.create` Create a Todoist section **Risk:** `write` ```ts theme={null} await corsair.todoist.api.sections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `project_id` | `string` | Yes | — | | `order` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `project_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `order` | `number` | No | — | *** ### delete `sections.delete` Delete a Todoist section **Risk:** `destructive` ```ts theme={null} await corsair.todoist.api.sections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** *empty object* *** ### get `sections.get` Get a Todoist section by ID **Risk:** `read` ```ts theme={null} await corsair.todoist.api.sections.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `project_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `order` | `number` | No | — | *** ### getMany `sections.getMany` List Todoist sections for a project **Risk:** `read` ```ts theme={null} await corsair.todoist.api.sections.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > project_id: string, > name: string, > order?: number > }[] > ``` *** ### update `sections.update` Update a Todoist section **Risk:** `write` ```ts theme={null} await corsair.todoist.api.sections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `order` | `number` | No | — | | `project_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `project_id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `order` | `number` | No | — | *** ## Tasks ### close `tasks.close` Close a Todoist task **Risk:** `write` ```ts theme={null} await corsair.todoist.api.tasks.close({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > undefined | { > } > ``` *** ### create `tasks.create` Create a Todoist task **Risk:** `write` ```ts theme={null} await corsair.todoist.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | | `description` | `string` | No | — | | `project_id` | `string` | No | — | | `section_id` | `string` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `labels` | `string[]` | No | — | | `priority` | `number` | No | — | | `due_datetime` | `string` | No | — | | `due_date` | `string` | No | — | | `due_string` | `string` | No | — | | `assignee_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `project_id` | `string` | No | — | | `section_id` | `string` | No | — | | `content` | `string` | Yes | — | | `description` | `string` | No | — | | `is_completed` | `boolean` | No | — | | `labels` | `string[]` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `priority` | `number` | No | — | | `due` | `object` | No | — | | `url` | `string` | No | — | | `comment_count` | `number` | No | — | | `created_at` | `string` | No | — | | `creator_id` | `string` | No | — | | `assignee_id` | `string` | No | — | | `assigner_id` | `string` | No | — | > **due full type** > > ```ts theme={null} > { > } > ``` *** ### delete `tasks.delete` Delete a Todoist task **Risk:** `destructive` ```ts theme={null} await corsair.todoist.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > undefined | { > } > ``` *** ### get `tasks.get` Get a Todoist task by ID **Risk:** `read` ```ts theme={null} await corsair.todoist.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `project_id` | `string` | No | — | | `section_id` | `string` | No | — | | `content` | `string` | Yes | — | | `description` | `string` | No | — | | `is_completed` | `boolean` | No | — | | `labels` | `string[]` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `priority` | `number` | No | — | | `due` | `object` | No | — | | `url` | `string` | No | — | | `comment_count` | `number` | No | — | | `created_at` | `string` | No | — | | `creator_id` | `string` | No | — | | `assignee_id` | `string` | No | — | | `assigner_id` | `string` | No | — | > **due full type** > > ```ts theme={null} > { > } > ``` *** ### getMany `tasks.getMany` List Todoist tasks with filters **Risk:** `read` ```ts theme={null} await corsair.todoist.api.tasks.getMany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `project_id` | `string` | No | — | | `section_id` | `string` | No | — | | `label` | `string` | No | — | | `filter` | `string` | No | — | | `ids` | `string[]` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > project_id?: string | null, > section_id?: string | null, > content: string, > description?: string, > is_completed?: boolean, > labels?: string[], > parent_id?: string | null, > order?: number, > priority?: number, > due?: { > } | null, > url?: string, > comment_count?: number, > created_at?: string, > creator_id?: string, > assignee_id?: string, > assigner_id?: string > }[] | { > tasks?: { > id: string, > project_id?: string | null, > section_id?: string | null, > content: string, > description?: string, > is_completed?: boolean, > labels?: string[], > parent_id?: string | null, > order?: number, > priority?: number, > due?: { > } | null, > url?: string, > comment_count?: number, > created_at?: string, > creator_id?: string, > assignee_id?: string, > assigner_id?: string > }[] > } > ``` *** ### move `tasks.move` Move a Todoist task between project or section **Risk:** `write` ```ts theme={null} await corsair.todoist.api.tasks.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `project_id` | `string` | No | — | | `section_id` | `string` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `project_id` | `string` | No | — | | `section_id` | `string` | No | — | | `content` | `string` | Yes | — | | `description` | `string` | No | — | | `is_completed` | `boolean` | No | — | | `labels` | `string[]` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `priority` | `number` | No | — | | `due` | `object` | No | — | | `url` | `string` | No | — | | `comment_count` | `number` | No | — | | `created_at` | `string` | No | — | | `creator_id` | `string` | No | — | | `assignee_id` | `string` | No | — | | `assigner_id` | `string` | No | — | > **due full type** > > ```ts theme={null} > { > } > ``` *** ### quickAdd `tasks.quickAdd` Quick add a Todoist task using natural language **Risk:** `write` ```ts theme={null} await corsair.todoist.api.tasks.quickAdd({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `reminder` | `string` | No | — | | `note` | `string` | No | — | | `lang` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `project_id` | `string` | No | — | | `section_id` | `string` | No | — | | `content` | `string` | Yes | — | | `description` | `string` | No | — | | `is_completed` | `boolean` | No | — | | `labels` | `string[]` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `priority` | `number` | No | — | | `due` | `object` | No | — | | `url` | `string` | No | — | | `comment_count` | `number` | No | — | | `created_at` | `string` | No | — | | `creator_id` | `string` | No | — | | `assignee_id` | `string` | No | — | | `assigner_id` | `string` | No | — | > **due full type** > > ```ts theme={null} > { > } > ``` *** ### reopen `tasks.reopen` Reopen a completed Todoist task **Risk:** `write` ```ts theme={null} await corsair.todoist.api.tasks.reopen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > undefined | { > } > ``` *** ### update `tasks.update` Update a Todoist task **Risk:** `write` ```ts theme={null} await corsair.todoist.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `content` | `string` | No | — | | `description` | `string` | No | — | | `project_id` | `string` | No | — | | `section_id` | `string` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `labels` | `string[]` | No | — | | `priority` | `number` | No | — | | `due_datetime` | `string` | No | — | | `due_date` | `string` | No | — | | `due_string` | `string` | No | — | | `assignee_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `project_id` | `string` | No | — | | `section_id` | `string` | No | — | | `content` | `string` | Yes | — | | `description` | `string` | No | — | | `is_completed` | `boolean` | No | — | | `labels` | `string[]` | No | — | | `parent_id` | `string` | No | — | | `order` | `number` | No | — | | `priority` | `number` | No | — | | `due` | `object` | No | — | | `url` | `string` | No | — | | `comment_count` | `number` | No | — | | `created_at` | `string` | No | — | | `creator_id` | `string` | No | — | | `assignee_id` | `string` | No | — | | `assigner_id` | `string` | No | — | > **due full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/todoist/database Todoist local sync: searchable entities, `.search()` filters, and operators. The Todoist plugin syncs data locally. Use `corsair.todoist.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Comments Path: `todoist.db.comments.search` ```ts theme={null} const rows = await corsair.todoist.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `task_id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `posted_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Labels Path: `todoist.db.labels.search` ```ts theme={null} const rows = await corsair.todoist.db.labels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `order` | `number` | equals, gt, gte, lt, lte, in | | `favorite` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `todoist.db.projects.search` ```ts theme={null} const rows = await corsair.todoist.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `order` | `number` | equals, gt, gte, lt, lte, in | | `favorite` | `boolean` | equals | | `comment_count` | `number` | equals, gt, gte, lt, lte, in | | `is_shared` | `boolean` | equals | | `is_archived` | `boolean` | equals | | `is_favorite` | `boolean` | equals | | `view_style` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Reminders Path: `todoist.db.reminders.search` ```ts theme={null} const rows = await corsair.todoist.db.reminders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `task_id` | `string` | equals, contains, startsWith, endsWith, in | | `notify_uid` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sections Path: `todoist.db.sections.search` ```ts theme={null} const rows = await corsair.todoist.db.sections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `order` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tasks Path: `todoist.db.tasks.search` ```ts theme={null} const rows = await corsair.todoist.db.tasks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `section_id` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `is_completed` | `boolean` | equals | | `parent_id` | `string` | equals, contains, startsWith, endsWith, in | | `order` | `number` | equals, gt, gte, lt, lte, in | | `priority` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `comment_count` | `number` | equals, gt, gte, lt, lte, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `creator_id` | `string` | equals, contains, startsWith, endsWith, in | | `assignee_id` | `string` | equals, contains, startsWith, endsWith, in | | `assigner_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/todoist/get-credentials Step-by-step instructions for obtaining a Todoist API token and webhook secret for the Corsair Todoist plugin. This guide walks you through obtaining all required credentials for the Todoist plugin. ## Authentication Method The Todoist plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) — Todoist **API token** used for the REST API ## API Token ### Step 1: Copy Your Personal API Token 1. Log in to [Todoist](https://todoist.com/). 2. Open **Settings** → **Integrations** (or **Developer** / **API token** depending on the current UI). 3. Find **API token** (sometimes called **personal API token**). 4. Copy the token — it is unique to your account. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=todoist api_key=your-api-token ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=todoist --credentials ``` ## Webhook Secret Todoist can send webhooks for task and project events. When you register a webhook URL, Todoist provides a **client secret** or signing material used to verify deliveries (see Todoist’s webhook documentation for the header format). 1. In Todoist developer settings, create a webhook pointing to your HTTPS endpoint. 2. Copy the **secret** associated with that webhook client. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=todoist webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | API token | [`api_key`](/concepts/api-key) auth | Todoist → Settings → Integrations / API | | Webhook secret | Webhooks | Todoist webhook / app registration | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/todoist/overview Task management app for projects, due dates, priorities, and personal or team to-do lists. Use **Todoist** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 36 typed API operations * 6 synced entities (`comments`, `labels`, `projects`, `reminders`, `sections`, `tasks`) for fast `.search()` / `.list()` * 13 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/todoist ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/todoist ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/todoist ``` ```bash bun theme={null} bun add corsair @corsair-dev/todoist ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { todoist } from '@corsair-dev/todoist'; export const corsair = createCorsair({ plugins: [ todoist(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/todoist/get-credentials). ```ts theme={null} todoist() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'todoist', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`comments.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.todoist.api.comments.get({}); ``` **`comments.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.todoist.api.comments.create({}); ``` See the full list on the [API](/plugins/todoist/api) page. ## Query synced data Synced entities support `tenant.todoist.db..search()` and `.list()`: `comments`, `labels`, `projects`, `reminders`, `sections`, `tasks`. See [Database](/plugins/todoist/database) for filters and operators. ## Webhooks This plugin registers **13** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/todoist/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/todoist/api)** > > Every `todoist.api.*` operation with input and output types. > **[Database](/plugins/todoist/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/todoist/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/todoist/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/todoist/webhooks Todoist incoming webhooks: event paths, payloads, and response data. The Todoist plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/todoist/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `items` * `added` (`items.added`) * `completed` (`items.completed`) * `deleted` (`items.deleted`) * `uncompleted` (`items.uncompleted`) * `updated` (`items.updated`) * `notes` * `added` (`notes.added`) * `deleted` (`notes.deleted`) * `updated` (`notes.updated`) * `projects` * `added` (`projects.added`) * `archived` (`projects.archived`) * `deleted` (`projects.deleted`) * `unarchived` (`projects.unarchived`) * `updated` (`projects.updated`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Items ### Added `items.added` A new task was added **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { items: { added: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Completed `items.completed` A task was completed **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { items: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `items.deleted` A task was deleted **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { items: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Uncompleted `items.uncompleted` A completed task was uncompleted **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { items: { uncompleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `items.updated` A task was updated **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { items: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Notes ### Added `notes.added` A new note/comment was added **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { notes: { added: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `notes.deleted` A note/comment was deleted **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { notes: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `notes.updated` A note/comment was updated **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { notes: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Projects ### Added `projects.added` A new project was created **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { projects: { added: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Archived `projects.archived` A project was archived **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { projects: { archived: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Deleted `projects.deleted` A project was deleted **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { projects: { deleted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Unarchived `projects.unarchived` A project was unarchived **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { projects: { unarchived: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Updated `projects.updated` A project was updated **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} todoist({ webhookHooks: { projects: { updated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/toggl/api API reference for Toggl Track: every `toggl.api.*` operation with input and output types. Every `toggl.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Clients ### archive `clients.archive` Archive a client **Risk:** `write` ```ts theme={null} await corsair.toggl.api.clients.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `client_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: number, > wid?: number | null, > name: string, > notes?: string | null, > archived?: boolean | null, > creator_id?: number | null, > at?: string | null > } | { > items?: number[] | null > } > ``` *** ### create `clients.create` Create a client **Risk:** `write` ```ts theme={null} await corsair.toggl.api.clients.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `notes` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `wid` | `number` | No | — | | `name` | `string` | Yes | — | | `notes` | `string` | No | — | | `archived` | `boolean` | No | — | | `creator_id` | `number` | No | — | | `at` | `string` | No | — | *** ### delete `clients.delete` Delete a client **Risk:** `destructive` ```ts theme={null} await corsair.toggl.api.clients.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `client_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `clients.get` Get a client by id **Risk:** `read` ```ts theme={null} await corsair.toggl.api.clients.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `client_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `wid` | `number` | No | — | | `name` | `string` | Yes | — | | `notes` | `string` | No | — | | `archived` | `boolean` | No | — | | `creator_id` | `number` | No | — | | `at` | `string` | No | — | *** ### list `clients.list` List clients in a workspace **Risk:** `read` ```ts theme={null} await corsair.toggl.api.clients.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `status` | `active \| archived \| both` | No | — | | `name` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > wid?: number | null, > name: string, > notes?: string | null, > archived?: boolean | null, > creator_id?: number | null, > at?: string | null > }[] > ``` *** ### update `clients.update` Update or archive a client **Risk:** `write` ```ts theme={null} await corsair.toggl.api.clients.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `client_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `notes` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `wid` | `number` | No | — | | `name` | `string` | Yes | — | | `notes` | `string` | No | — | | `archived` | `boolean` | No | — | | `creator_id` | `number` | No | — | | `at` | `string` | No | — | *** ## Me ### disableProductEmails `me.disableProductEmails` Unsubscribe the account from Toggl product emails **Risk:** `write` ```ts theme={null} await corsair.toggl.api.me.disableProductEmails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `disable_code` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### disableWeeklyReport `me.disableWeeklyReport` Unsubscribe the account from the weekly report email **Risk:** `write` ```ts theme={null} await corsair.toggl.api.me.disableWeeklyReport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### get `me.get` Get the authenticated Toggl user **Risk:** `read` ```ts theme={null} await corsair.toggl.api.me.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `with_related_data` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `email` | `string` | Yes | — | | `fullname` | `string` | No | — | | `timezone` | `string` | No | — | | `toggl_accounts_id` | `string` | No | — | | `user_account_id` | `number` | No | — | | `default_workspace_id` | `number` | No | — | | `beginning_of_week` | `number` | No | — | | `image_url` | `string` | No | — | | `country_id` | `number` | No | — | | `has_password` | `boolean` | No | — | | `openid_email` | `string` | No | — | | `openid_enabled` | `boolean` | No | — | | `oauth_providers` | `string[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `at` | `string` | No | — | *** ### getClients `me.getClients` List clients across all workspaces the user can access **Risk:** `read` ```ts theme={null} await corsair.toggl.api.me.getClients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > wid?: number | null, > name: string, > notes?: string | null, > archived?: boolean | null, > creator_id?: number | null, > at?: string | null > }[] > ``` *** ### getLocation `me.getLocation` Get the last known location of the authenticated user **Risk:** `read` ```ts theme={null} await corsair.toggl.api.me.getLocation({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `city` | `string` | No | — | | `city_lat_long` | `string` | No | — | | `state` | `string` | No | — | | `country_code` | `string` | No | — | | `country_name` | `string` | No | — | *** ### getLogged `me.getLogged` Check that the API token is valid **Risk:** `read` ```ts theme={null} await corsair.toggl.api.me.getLogged({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### getPreferences `me.getPreferences` Get the authenticated user preferences **Risk:** `read` ```ts theme={null} await corsair.toggl.api.me.getPreferences({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `BeginningOfWeek` | `number` | No | — | | `timeofday_format` | `string` | No | — | | `date_format` | `string` | No | — | | `duration_format` | `string` | No | — | | `record_timeline` | `boolean` | No | — | | `send_product_emails` | `boolean` | No | — | | `send_timer_notifications` | `boolean` | No | — | | `send_weekly_report` | `boolean` | No | — | | `pg_time_zone_name` | `string` | No | — | | `alpha_features` | `object[]` | No | — | > **alpha\_features full type** > > ```ts theme={null} > { > }[] > ``` *** ### getProjects `me.getProjects` List projects across all workspaces the user can access **Risk:** `read` ```ts theme={null} await corsair.toggl.api.me.getProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > workspace_id?: number | null, > client_id?: number | null, > name: string, > is_private?: boolean | null, > active?: boolean | null, > billable?: boolean | null, > color?: string | null, > currency?: string | null, > rate?: number | null, > estimated_hours?: number | null, > actual_hours?: number | null, > start_date?: string | null, > end_date?: string | null, > template?: boolean | null, > recurring?: boolean | null, > server_deleted_at?: string | null, > created_at?: string | null, > at?: string | null > }[] > ``` *** ### getQuota `me.getQuota` Get remaining API request quota per organization **Risk:** `read` ```ts theme={null} await corsair.toggl.api.me.getQuota({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > organization_id?: number | null, > remaining: number, > total: number, > resets_in_secs?: number | null > }[] > ``` *** ### getTags `me.getTags` List tags across all workspaces the user can access **Risk:** `read` ```ts theme={null} await corsair.toggl.api.me.getTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > workspace_id?: number | null, > name: string, > creator_id?: number | null, > at?: string | null > }[] > ``` *** ### getTasks `me.getTasks` List tasks across all workspaces the user can access **Risk:** `read` ```ts theme={null} await corsair.toggl.api.me.getTasks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > workspace_id?: number | null, > project_id?: number | null, > user_id?: number | null, > name: string, > active?: boolean | null, > estimated_seconds?: number | null, > tracked_seconds?: number | null, > server_deleted_at?: string | null, > at?: string | null > }[] > ``` *** ### update `me.update` Update the authenticated user profile **Risk:** `write` ```ts theme={null} await corsair.toggl.api.me.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fullname` | `string` | No | — | | `email` | `string` | No | — | | `timezone` | `string` | No | — | | `beginning_of_week` | `number` | No | — | | `default_workspace_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `email` | `string` | Yes | — | | `fullname` | `string` | No | — | | `timezone` | `string` | No | — | | `toggl_accounts_id` | `string` | No | — | | `user_account_id` | `number` | No | — | | `default_workspace_id` | `number` | No | — | | `beginning_of_week` | `number` | No | — | | `image_url` | `string` | No | — | | `country_id` | `number` | No | — | | `has_password` | `boolean` | No | — | | `openid_email` | `string` | No | — | | `openid_enabled` | `boolean` | No | — | | `oauth_providers` | `string[]` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `at` | `string` | No | — | *** ### updatePreferences `me.updatePreferences` Update the authenticated user preferences **Risk:** `write` ```ts theme={null} await corsair.toggl.api.me.updatePreferences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `timeofday_format` | `string` | No | — | | `date_format` | `string` | No | — | | `duration_format` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `BeginningOfWeek` | `number` | No | — | | `timeofday_format` | `string` | No | — | | `date_format` | `string` | No | — | | `duration_format` | `string` | No | — | | `record_timeline` | `boolean` | No | — | | `send_product_emails` | `boolean` | No | — | | `send_timer_notifications` | `boolean` | No | — | | `send_weekly_report` | `boolean` | No | — | | `pg_time_zone_name` | `string` | No | — | | `alpha_features` | `object[]` | No | — | > **alpha\_features full type** > > ```ts theme={null} > { > }[] > ``` *** ## Organizations ### create `organizations.create` Create an organization and its first workspace **Risk:** `write` ```ts theme={null} await corsair.toggl.api.organizations.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `workspace_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `pricing_plan_id` | `number` | No | — | | `created_at` | `string` | No | — | | `is_multi_workspace_enabled` | `boolean` | No | — | | `max_workspaces` | `number` | No | — | | `admin` | `boolean` | No | — | | `owner` | `boolean` | No | — | | `trial_info` | `any` | No | — | | `at` | `string` | No | — | *** ### createGroup `organizations.createGroup` Create a group in an organization **Risk:** `write` ```ts theme={null} await corsair.toggl.api.organizations.createGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `number` | No | — | | `id` | `number` | No | — | | `organization_id` | `number` | No | — | | `name` | `string` | Yes | — | | `users` | `object[]` | No | — | | `workspaces` | `object[]` | No | — | | `at` | `string` | No | — | > **users full type** > > ```ts theme={null} > { > }[] > ``` > **workspaces full type** > > ```ts theme={null} > { > }[] > ``` *** ### createInvitation `organizations.createInvitation` Invite people to an organization by email **Risk:** `write` ```ts theme={null} await corsair.toggl.api.organizations.createInvitation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | | `emails` | `string[]` | Yes | — | | `workspaces` | `object[]` | No | — | | `prevent_email_notification` | `boolean` | No | — | > **workspaces full type** > > ```ts theme={null} > { > workspace_id: number, > admin?: boolean > }[] > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### deleteGroup `organizations.deleteGroup` Delete an organization group **Risk:** `destructive` ```ts theme={null} await corsair.toggl.api.organizations.deleteGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | | `group_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `organizations.get` Get an organization by id **Risk:** `read` ```ts theme={null} await corsair.toggl.api.organizations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `pricing_plan_id` | `number` | No | — | | `created_at` | `string` | No | — | | `is_multi_workspace_enabled` | `boolean` | No | — | | `max_workspaces` | `number` | No | — | | `admin` | `boolean` | No | — | | `owner` | `boolean` | No | — | | `trial_info` | `any` | No | — | | `at` | `string` | No | — | *** ### getGroups `organizations.getGroups` List groups in an organization **Risk:** `read` ```ts theme={null} await corsair.toggl.api.organizations.getGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > group_id?: number | null, > id?: number | null, > organization_id?: number | null, > name: string, > users?: { > }[] | null, > workspaces?: { > }[] | null, > at?: string | null > }[] > ``` *** ### getPlans `organizations.getPlans` Get billing and plan details for an organization **Risk:** `read` ```ts theme={null} await corsair.toggl.api.organizations.getPlans({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getSubscriptionPlans `organizations.getSubscriptionPlans` List subscription plans available to an organization **Risk:** `read` ```ts theme={null} await corsair.toggl.api.organizations.getSubscriptionPlans({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getUsers `organizations.getUsers` List users in an organization **Risk:** `read` ```ts theme={null} await corsair.toggl.api.organizations.getUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | | `filter` | `string` | No | — | | `active` | `boolean` | No | — | | `only_admins` | `boolean` | No | — | | `groups` | `boolean` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > user_id?: number | null, > organization_id?: number | null, > email?: string | null, > name?: string | null, > admin?: boolean | null, > owner?: boolean | null, > joined?: boolean | null, > inactive?: boolean | null, > workspaces?: { > }[] | null, > groups?: { > }[] | null > }[] > ``` *** ### getWorkspaces `organizations.getWorkspaces` List workspaces in an organization **Risk:** `read` ```ts theme={null} await corsair.toggl.api.organizations.getWorkspaces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > organization_id?: number | null, > name: string, > premium?: boolean | null, > business_ws?: boolean | null, > admin?: boolean | null, > role?: string | null, > default_currency?: string | null, > default_hourly_rate?: number | null, > only_admins_may_create_projects?: boolean | null, > only_admins_may_create_tags?: boolean | null, > only_admins_see_billable_rates?: boolean | null, > rounding?: number | null, > rounding_minutes?: number | null, > suspended_at?: string | null, > server_deleted_at?: string | null, > logo_url?: string | null, > at?: string | null > }[] > ``` *** ### update `organizations.update` Rename an organization **Risk:** `write` ```ts theme={null} await corsair.toggl.api.organizations.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `number` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `pricing_plan_id` | `number` | No | — | | `created_at` | `string` | No | — | | `is_multi_workspace_enabled` | `boolean` | No | — | | `max_workspaces` | `number` | No | — | | `admin` | `boolean` | No | — | | `owner` | `boolean` | No | — | | `trial_info` | `any` | No | — | | `at` | `string` | No | — | *** ## Projects ### addUser `projects.addUser` Add a user to a project **Risk:** `write` ```ts theme={null} await corsair.toggl.api.projects.addUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `user_id` | `number` | Yes | — | | `manager` | `boolean` | No | — | | `rate` | `number` | No | — | | `labour_cost` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `project_id` | `number` | No | — | | `user_id` | `number` | No | — | | `workspace_id` | `number` | No | — | | `manager` | `boolean` | No | — | | `rate` | `number` | No | — | | `labour_cost` | `number` | No | — | | `at` | `string` | No | — | *** ### create `projects.create` Create a project **Risk:** `write` ```ts theme={null} await corsair.toggl.api.projects.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `client_id` | `number` | No | — | | `active` | `boolean` | No | — | | `is_private` | `boolean` | No | — | | `billable` | `boolean` | No | — | | `color` | `string` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `estimated_hours` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `client_id` | `number` | No | — | | `name` | `string` | Yes | — | | `is_private` | `boolean` | No | — | | `active` | `boolean` | No | — | | `billable` | `boolean` | No | — | | `color` | `string` | No | — | | `currency` | `string` | No | — | | `rate` | `number` | No | — | | `estimated_hours` | `number` | No | — | | `actual_hours` | `number` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `template` | `boolean` | No | — | | `recurring` | `boolean` | No | — | | `server_deleted_at` | `string` | No | — | | `created_at` | `string` | No | — | | `at` | `string` | No | — | *** ### delete `projects.delete` Delete a project and its time entries **Risk:** `destructive` ```ts theme={null} await corsair.toggl.api.projects.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### deleteGroup `projects.deleteGroup` Delete a project group **Risk:** `destructive` ```ts theme={null} await corsair.toggl.api.projects.deleteGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_group_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `projects.get` Get a project by id **Risk:** `read` ```ts theme={null} await corsair.toggl.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `client_id` | `number` | No | — | | `name` | `string` | Yes | — | | `is_private` | `boolean` | No | — | | `active` | `boolean` | No | — | | `billable` | `boolean` | No | — | | `color` | `string` | No | — | | `currency` | `string` | No | — | | `rate` | `number` | No | — | | `estimated_hours` | `number` | No | — | | `actual_hours` | `number` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `template` | `boolean` | No | — | | `recurring` | `boolean` | No | — | | `server_deleted_at` | `string` | No | — | | `created_at` | `string` | No | — | | `at` | `string` | No | — | *** ### list `projects.list` List projects in a workspace **Risk:** `read` ```ts theme={null} await corsair.toggl.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `active` | `boolean` | No | — | | `name` | `string` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > workspace_id?: number | null, > client_id?: number | null, > name: string, > is_private?: boolean | null, > active?: boolean | null, > billable?: boolean | null, > color?: string | null, > currency?: string | null, > rate?: number | null, > estimated_hours?: number | null, > actual_hours?: number | null, > start_date?: string | null, > end_date?: string | null, > template?: boolean | null, > recurring?: boolean | null, > server_deleted_at?: string | null, > created_at?: string | null, > at?: string | null > }[] > ``` *** ### update `projects.update` Update a project **Risk:** `write` ```ts theme={null} await corsair.toggl.api.projects.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `name` | `string` | No | — | | `client_id` | `number` | No | — | | `active` | `boolean` | No | — | | `is_private` | `boolean` | No | — | | `billable` | `boolean` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `client_id` | `number` | No | — | | `name` | `string` | Yes | — | | `is_private` | `boolean` | No | — | | `active` | `boolean` | No | — | | `billable` | `boolean` | No | — | | `color` | `string` | No | — | | `currency` | `string` | No | — | | `rate` | `number` | No | — | | `estimated_hours` | `number` | No | — | | `actual_hours` | `number` | No | — | | `start_date` | `string` | No | — | | `end_date` | `string` | No | — | | `template` | `boolean` | No | — | | `recurring` | `boolean` | No | — | | `server_deleted_at` | `string` | No | — | | `created_at` | `string` | No | — | | `at` | `string` | No | — | *** ## Reference ### getCountries `reference.getCountries` List countries Toggl supports, with VAT settings **Risk:** `read` ```ts theme={null} await corsair.toggl.api.reference.getCountries({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > name: string, > country_code?: string | null, > vat_applicable?: boolean | null, > vat_percentage?: number | null, > vat_regex?: string | null > }[] > ``` *** ### getCountrySubdivisions `reference.getCountrySubdivisions` List states or provinces for a country id from getCountries **Risk:** `read` ```ts theme={null} await corsair.toggl.api.reference.getCountrySubdivisions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > country_subdivision_id?: number | null, > country_id?: number | null, > name: string, > iso_code?: string | null > }[] > ``` *** ### getCurrencies `reference.getCurrencies` List currencies Toggl supports **Risk:** `read` ```ts theme={null} await corsair.toggl.api.reference.getCurrencies({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > currency_id?: number | null, > iso_code: string, > symbol?: string | null > }[] > ``` *** ### getKeys `reference.getKeys` Get the JWKS keyset used to verify Toggl JWTs **Risk:** `read` ```ts theme={null} await corsair.toggl.api.reference.getKeys({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `keys` | `object[]` | Yes | — | > **keys full type** > > ```ts theme={null} > { > }[] > ``` *** ### getTimezoneOffsets `reference.getTimezoneOffsets` List timezones with their UTC offsets **Risk:** `read` ```ts theme={null} await corsair.toggl.api.reference.getTimezoneOffsets({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name: string, > utc: string > }[] > ``` *** ### getTimezones `reference.getTimezones` List timezones Toggl supports **Risk:** `read` ```ts theme={null} await corsair.toggl.api.reference.getTimezones({}); ``` **Input:** *empty object* **Output:** `string[]` *** ## Smail ### sendContact `smail.sendContact` Send an email to a contact **Risk:** `write` ```ts theme={null} await corsair.toggl.api.smail.sendContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `name` | `string` | Yes | — | | `message` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### sendDemo `smail.sendDemo` Send a product demo request email **Risk:** `write` ```ts theme={null} await corsair.toggl.api.smail.sendDemo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `name` | `string` | No | — | | `company` | `string` | No | — | | `message` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ### sendMeet `smail.sendMeet` Send a meeting invitation email **Risk:** `write` ```ts theme={null} await corsair.toggl.api.smail.sendMeet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `name` | `string` | No | — | | `location` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ok` | `true` | Yes | — | *** ## Tags ### create `tags.create` Create a tag **Risk:** `write` ```ts theme={null} await corsair.toggl.api.tags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `name` | `string` | Yes | — | | `creator_id` | `number` | No | — | | `at` | `string` | No | — | *** ### delete `tags.delete` Delete a tag **Risk:** `destructive` ```ts theme={null} await corsair.toggl.api.tags.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `tag_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### list `tags.list` List tags in a workspace **Risk:** `read` ```ts theme={null} await corsair.toggl.api.tags.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > workspace_id?: number | null, > name: string, > creator_id?: number | null, > at?: string | null > }[] > ``` *** ### update `tags.update` Rename a tag **Risk:** `write` ```ts theme={null} await corsair.toggl.api.tags.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `tag_id` | `number` | Yes | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `name` | `string` | Yes | — | | `creator_id` | `number` | No | — | | `at` | `string` | No | — | *** ## Tasks ### create `tasks.create` Create a task **Risk:** `write` ```ts theme={null} await corsair.toggl.api.tasks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `name` | `string` | Yes | — | | `active` | `boolean` | No | — | | `estimated_seconds` | `number` | No | — | | `user_id` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `project_id` | `number` | No | — | | `user_id` | `number` | No | — | | `name` | `string` | Yes | — | | `active` | `boolean` | No | — | | `estimated_seconds` | `number` | No | — | | `tracked_seconds` | `number` | No | — | | `server_deleted_at` | `string` | No | — | | `at` | `string` | No | — | *** ### delete `tasks.delete` Delete a task **Risk:** `destructive` ```ts theme={null} await corsair.toggl.api.tasks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `task_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `tasks.get` Get a task by id **Risk:** `read` ```ts theme={null} await corsair.toggl.api.tasks.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `task_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `project_id` | `number` | No | — | | `user_id` | `number` | No | — | | `name` | `string` | Yes | — | | `active` | `boolean` | No | — | | `estimated_seconds` | `number` | No | — | | `tracked_seconds` | `number` | No | — | | `server_deleted_at` | `string` | No | — | | `at` | `string` | No | — | *** ### list `tasks.list` List tasks in a project **Risk:** `read` ```ts theme={null} await corsair.toggl.api.tasks.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_id` | `number` | No | — | | `active` | `boolean` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > workspace_id?: number | null, > project_id?: number | null, > user_id?: number | null, > name: string, > active?: boolean | null, > estimated_seconds?: number | null, > tracked_seconds?: number | null, > server_deleted_at?: string | null, > at?: string | null > }[] > ``` *** ### update `tasks.update` Update a task **Risk:** `write` ```ts theme={null} await corsair.toggl.api.tasks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `project_id` | `number` | Yes | — | | `task_id` | `number` | Yes | — | | `name` | `string` | No | — | | `active` | `boolean` | No | — | | `estimated_seconds` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `project_id` | `number` | No | — | | `user_id` | `number` | No | — | | `name` | `string` | Yes | — | | `active` | `boolean` | No | — | | `estimated_seconds` | `number` | No | — | | `tracked_seconds` | `number` | No | — | | `server_deleted_at` | `string` | No | — | | `at` | `string` | No | — | *** ## Time Entries ### bulkEdit `timeEntries.bulkEdit` Bulk edit up to 100 time entries with JSON Patch **Risk:** `write` ```ts theme={null} await corsair.toggl.api.timeEntries.bulkEdit({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `time_entry_ids` | `number[]` | Yes | — | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > op: add | remove | replace, > path: string, > value?: any > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `number[]` | No | — | | `failure` | `object[]` | No | — | > **failure full type** > > ```ts theme={null} > { > id?: number | null, > message?: string | null > }[] > ``` *** ### create `timeEntries.create` Create or start a time entry **Risk:** `write` ```ts theme={null} await corsair.toggl.api.timeEntries.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `start` | `string` | Yes | — | | `duration` | `number` | Yes | — | | `description` | `string` | No | — | | `project_id` | `number` | No | — | | `task_id` | `number` | No | — | | `billable` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `tag_ids` | `number[]` | No | — | | `stop` | `string` | No | — | | `created_with` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `project_id` | `number` | No | — | | `task_id` | `number` | No | — | | `user_id` | `number` | No | — | | `description` | `string` | No | — | | `start` | `string` | Yes | — | | `stop` | `string` | No | — | | `duration` | `number` | Yes | — | | `billable` | `boolean` | No | — | | `duronly` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `tag_ids` | `number[]` | No | — | | `server_deleted_at` | `string` | No | — | | `at` | `string` | No | — | *** ### delete `timeEntries.delete` Delete a time entry **Risk:** `destructive` ```ts theme={null} await corsair.toggl.api.timeEntries.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `time_entry_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### get `timeEntries.get` Get a time entry by id **Risk:** `read` ```ts theme={null} await corsair.toggl.api.timeEntries.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `time_entry_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `project_id` | `number` | No | — | | `task_id` | `number` | No | — | | `user_id` | `number` | No | — | | `description` | `string` | No | — | | `start` | `string` | Yes | — | | `stop` | `string` | No | — | | `duration` | `number` | Yes | — | | `billable` | `boolean` | No | — | | `duronly` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `tag_ids` | `number[]` | No | — | | `server_deleted_at` | `string` | No | — | | `at` | `string` | No | — | *** ### getCurrent `timeEntries.getCurrent` Get the currently running time entry, if any **Risk:** `read` ```ts theme={null} await corsair.toggl.api.timeEntries.getCurrent({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `project_id` | `number` | No | — | | `task_id` | `number` | No | — | | `user_id` | `number` | No | — | | `description` | `string` | No | — | | `start` | `string` | Yes | — | | `stop` | `string` | No | — | | `duration` | `number` | Yes | — | | `billable` | `boolean` | No | — | | `duronly` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `tag_ids` | `number[]` | No | — | | `server_deleted_at` | `string` | No | — | | `at` | `string` | No | — | *** ### list `timeEntries.list` List the current user time entries **Risk:** `read` ```ts theme={null} await corsair.toggl.api.timeEntries.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_date` | `string \| string` | No | — | | `end_date` | `string \| string` | No | — | | `since` | `number` | No | — | | `before` | `string \| string` | No | — | | `meta` | `boolean` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > workspace_id?: number | null, > project_id?: number | null, > task_id?: number | null, > user_id?: number | null, > description?: string | null, > start: string, > stop?: string | null, > duration: number, > billable?: boolean | null, > duronly?: boolean | null, > tags?: string[] | null, > tag_ids?: number[] | null, > server_deleted_at?: string | null, > at?: string | null > }[] > ``` *** ### stop `timeEntries.stop` Stop a running time entry **Risk:** `write` ```ts theme={null} await corsair.toggl.api.timeEntries.stop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `time_entry_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `project_id` | `number` | No | — | | `task_id` | `number` | No | — | | `user_id` | `number` | No | — | | `description` | `string` | No | — | | `start` | `string` | Yes | — | | `stop` | `string` | No | — | | `duration` | `number` | Yes | — | | `billable` | `boolean` | No | — | | `duronly` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `tag_ids` | `number[]` | No | — | | `server_deleted_at` | `string` | No | — | | `at` | `string` | No | — | *** ### update `timeEntries.update` Update a time entry **Risk:** `write` ```ts theme={null} await corsair.toggl.api.timeEntries.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `time_entry_id` | `number` | Yes | — | | `description` | `string` | No | — | | `start` | `string` | No | — | | `stop` | `string` | No | — | | `duration` | `number` | No | — | | `project_id` | `number` | No | — | | `task_id` | `number` | No | — | | `billable` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `tag_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `workspace_id` | `number` | No | — | | `project_id` | `number` | No | — | | `task_id` | `number` | No | — | | `user_id` | `number` | No | — | | `description` | `string` | No | — | | `start` | `string` | Yes | — | | `stop` | `string` | No | — | | `duration` | `number` | Yes | — | | `billable` | `boolean` | No | — | | `duronly` | `boolean` | No | — | | `tags` | `string[]` | No | — | | `tag_ids` | `number[]` | No | — | | `server_deleted_at` | `string` | No | — | | `at` | `string` | No | — | *** ## Webhooks ### deleteSubscription `webhooks.deleteSubscription` Delete a webhook subscription **Risk:** `destructive` ```ts theme={null} await corsair.toggl.api.webhooks.deleteSubscription({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `subscription_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `true` | Yes | — | | `id` | `number` | Yes | — | *** ### getEventFilters `webhooks.getEventFilters` List event types available for webhook subscriptions **Risk:** `read` ```ts theme={null} await corsair.toggl.api.webhooks.getEventFilters({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getStatus `webhooks.getStatus` Check the Toggl webhooks service status **Risk:** `read` ```ts theme={null} await corsair.toggl.api.webhooks.getStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | *** ### listSubscriptions `webhooks.listSubscriptions` List webhook subscriptions for a workspace **Risk:** `read` ```ts theme={null} await corsair.toggl.api.webhooks.listSubscriptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > subscription_id?: number | null, > workspace_id?: number | null, > user_id?: number | null, > url_callback?: string | null, > enabled?: boolean | null, > description?: string | null, > event_filters?: { > }[] | null, > created_at?: string | null > }[] > ``` *** ## Workspaces ### get `workspaces.get` Get a workspace by id **Risk:** `read` ```ts theme={null} await corsair.toggl.api.workspaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `organization_id` | `number` | No | — | | `name` | `string` | Yes | — | | `premium` | `boolean` | No | — | | `business_ws` | `boolean` | No | — | | `admin` | `boolean` | No | — | | `role` | `string` | No | — | | `default_currency` | `string` | No | — | | `default_hourly_rate` | `number` | No | — | | `only_admins_may_create_projects` | `boolean` | No | — | | `only_admins_may_create_tags` | `boolean` | No | — | | `only_admins_see_billable_rates` | `boolean` | No | — | | `rounding` | `number` | No | — | | `rounding_minutes` | `number` | No | — | | `suspended_at` | `string` | No | — | | `server_deleted_at` | `string` | No | — | | `logo_url` | `string` | No | — | | `at` | `string` | No | — | *** ### getLogo `workspaces.getLogo` Get the workspace logo URL **Risk:** `read` ```ts theme={null} await corsair.toggl.api.workspaces.getLogo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `logo` | `string` | No | — | *** ### getPreferences `workspaces.getPreferences` Get workspace preferences **Risk:** `read` ```ts theme={null} await corsair.toggl.api.workspaces.getPreferences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `initial_pricing_plan` | `number` | No | — | | `hide_start_end_times` | `boolean` | No | — | *** ### getUsers `workspaces.getUsers` List users in a workspace **Risk:** `read` ```ts theme={null} await corsair.toggl.api.workspaces.getUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > user_id?: number | null, > workspace_id?: number | null, > admin?: boolean | null, > active?: boolean | null, > email?: string | null, > name?: string | null, > role?: string | null, > at?: string | null > }[] > ``` *** ### list `workspaces.list` List workspaces the user belongs to **Risk:** `read` ```ts theme={null} await corsair.toggl.api.workspaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `since` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > organization_id?: number | null, > name: string, > premium?: boolean | null, > business_ws?: boolean | null, > admin?: boolean | null, > role?: string | null, > default_currency?: string | null, > default_hourly_rate?: number | null, > only_admins_may_create_projects?: boolean | null, > only_admins_may_create_tags?: boolean | null, > only_admins_see_billable_rates?: boolean | null, > rounding?: number | null, > rounding_minutes?: number | null, > suspended_at?: string | null, > server_deleted_at?: string | null, > logo_url?: string | null, > at?: string | null > }[] > ``` *** ### update `workspaces.update` Update workspace settings **Risk:** `write` ```ts theme={null} await corsair.toggl.api.workspaces.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `number` | Yes | — | | `name` | `string` | No | — | | `default_currency` | `string` | No | — | | `default_hourly_rate` | `number` | No | — | | `only_admins_may_create_projects` | `boolean` | No | — | | `only_admins_may_create_tags` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `organization_id` | `number` | No | — | | `name` | `string` | Yes | — | | `premium` | `boolean` | No | — | | `business_ws` | `boolean` | No | — | | `admin` | `boolean` | No | — | | `role` | `string` | No | — | | `default_currency` | `string` | No | — | | `default_hourly_rate` | `number` | No | — | | `only_admins_may_create_projects` | `boolean` | No | — | | `only_admins_may_create_tags` | `boolean` | No | — | | `only_admins_see_billable_rates` | `boolean` | No | — | | `rounding` | `number` | No | — | | `rounding_minutes` | `number` | No | — | | `suspended_at` | `string` | No | — | | `server_deleted_at` | `string` | No | — | | `logo_url` | `string` | No | — | | `at` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/toggl/database Toggl Track local sync: searchable entities, `.search()` filters, and operators. The Toggl Track plugin syncs data locally. Use `corsair.toggl.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Clients Path: `toggl.db.clients.search` ```ts theme={null} const rows = await corsair.toggl.db.clients.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `workspace_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `archived` | `boolean` | equals | | `at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `toggl.db.projects.search` ```ts theme={null} const rows = await corsair.toggl.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `workspace_id` | `number` | equals, gt, gte, lt, lte, in | | `client_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `billable` | `boolean` | equals | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `toggl.db.tags.search` ```ts theme={null} const rows = await corsair.toggl.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `workspace_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `toggl.db.workspaces.search` ```ts theme={null} const rows = await corsair.toggl.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `organization_id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `premium` | `boolean` | equals | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `default_currency` | `string` | equals, contains, startsWith, endsWith, in | | `at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/toggl/overview Time tracking tool for logging work hours, projects, reports, and team billable time. Use **Toggl Track** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 73 typed API operations * 4 synced entities (`clients`, `projects`, `tags`, `workspaces`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/toggl ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/toggl ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/toggl ``` ```bash bun theme={null} bun add corsair @corsair-dev/toggl ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { toggl } from '@corsair-dev/toggl'; export const corsair = createCorsair({ plugins: [ toggl(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} toggl() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'toggl', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`clients.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.toggl.api.clients.get({}); ``` **`clients.archive`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.toggl.api.clients.archive({}); ``` See the full list on the [API](/plugins/toggl/api) page. ## Query synced data Synced entities support `tenant.toggl.db..search()` and `.list()`: `clients`, `projects`, `tags`, `workspaces`. See [Database](/plugins/toggl/database) for filters and operators. ## What's next > **[API reference](/plugins/toggl/api)** > > Every `toggl.api.*` operation with input and output types. > **[Database](/plugins/toggl/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/tokenmetrics/api API reference for Token Metrics: every `tokenmetrics.api.*` operation with input and output types. Every `tokenmetrics.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Market ### getPrice `market.getPrice` Retrieve token price, volume, and market-cap data **Risk:** `read` ```ts theme={null} await corsair.tokenmetrics.api.market.getPrice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `token_id` | `string \| number` | No | — | | `symbol` | `string` | No | — | | `interval` | `string` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `success` | `boolean` | No | — | | `message` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > token_id?: string | number, > symbol?: string, > name?: string, > price?: number, > market_cap?: number, > volume_24h?: number | null, > number_of_holders?: number | null, > token_creation_date?: string > }[] > ``` *** ### getTopMarketCap `market.getTopMarketCap` List tokens ranked by market capitalization **Risk:** `read` ```ts theme={null} await corsair.tokenmetrics.api.market.getTopMarketCap({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `top_k` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `success` | `boolean` | No | — | | `message` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > token_id?: string | number, > symbol?: string, > name?: string, > price?: number, > market_cap?: number, > volume_24h?: number | null, > number_of_holders?: number | null, > token_creation_date?: string > }[] > ``` *** ## Technical ### getIndicators `technical.getIndicators` Retrieve a technical indicator for a token and interval **Risk:** `read` ```ts theme={null} await corsair.tokenmetrics.api.technical.getIndicators({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `symbol` | `string` | Yes | — | | `interval` | `string` | Yes | — | | `indicator` | `string` | Yes | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `success` | `boolean` | No | — | | `message` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > symbol?: string, > indicator?: string, > value?: number, > datetime?: string > }[] > ``` *** ## Tokens ### list `tokens.list` List supported tokens and their identifiers **Risk:** `read` ```ts theme={null} await corsair.tokenmetrics.api.tokens.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `token_id` | `string \| number` | No | — | | `symbol` | `string` | No | — | | `category` | `string` | No | — | | `exchange` | `string` | No | — | | `marketcap` | `number` | No | — | | `volume` | `number` | No | — | | `fdv` | `number` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `success` | `boolean` | No | — | | `message` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > token_id?: string | number, > symbol?: string, > name?: string, > price?: number, > market_cap?: number, > volume_24h?: number | null, > number_of_holders?: number | null, > token_creation_date?: string > }[] > ``` *** ## Trading ### getSignals `trading.getSignals` Retrieve AI-generated token entry and exit signals **Risk:** `read` ```ts theme={null} await corsair.tokenmetrics.api.trading.getSignals({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `token_id` | `string \| number` | No | — | | `symbol` | `string` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `category` | `string` | No | — | | `exchange` | `string` | No | — | | `marketcap` | `number` | No | — | | `volume` | `number` | No | — | | `fdv` | `number` | No | — | | `signal` | `-1 \| 0 \| 1` | No | — | | `limit` | `number` | No | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `success` | `boolean` | No | — | | `message` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > token_id?: string | number, > symbol?: string, > signal?: number, > date?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/tokenmetrics/database Token Metrics local sync: searchable entities, `.search()` filters, and operators. The Token Metrics plugin syncs data locally. Use `corsair.tokenmetrics.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/tokenmetrics/overview Token Metrics plugin for Corsair Use **Token Metrics** through Corsair: one client, typed API calls. **What you get:** * 5 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tokenmetrics ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tokenmetrics ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tokenmetrics ``` ```bash bun theme={null} bun add corsair @corsair-dev/tokenmetrics ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tokenmetrics } from '@corsair-dev/tokenmetrics'; export const corsair = createCorsair({ plugins: [ tokenmetrics(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} tokenmetrics() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tokenmetrics', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`market.getPrice`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tokenmetrics.api.market.getPrice({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/tokenmetrics/api) reference.* See the full list on the [API](/plugins/tokenmetrics/api) page. ## What's next > **[API reference](/plugins/tokenmetrics/api)** > > Every `tokenmetrics.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/tpscheck/api API reference for TPSCheck: every `tpscheck.api.*` operation with input and output types. Every `tpscheck.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Batch ### post `batch.post` Check multiple UK phone numbers against TPS and CTPS registers **Risk:** `read` ```ts theme={null} await corsair.tpscheck.api.batch.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phones` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `total` | `number` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > input: string, > e164?: string, > valid: boolean, > line?: { > type?: string, > original_carrier?: string, > location?: string, > country?: string, > prefix?: string > }, > reachability?: { > status?: string, > confidence?: string > }, > tps?: boolean, > ctps?: boolean, > risk?: any > }[] > ``` *** ## Check ### post `check.post` Check a UK phone number against TPS and CTPS registers **Risk:** `read` ```ts theme={null} await corsair.tpscheck.api.check.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phone` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `input` | `string` | Yes | — | | `e164` | `string` | No | — | | `valid` | `boolean` | Yes | — | | `line` | `object` | No | — | | `reachability` | `object` | No | — | | `tps` | `boolean` | No | — | | `ctps` | `boolean` | No | — | | `risk` | `any` | No | — | > **line full type** > > ```ts theme={null} > { > type?: string, > original_carrier?: string, > location?: string, > country?: string, > prefix?: string > } > ``` > **reachability full type** > > ```ts theme={null} > { > status?: string, > confidence?: string > } > ``` *** ## Credits ### get `credits.get` Get TPSCheck API usage and remaining credits **Risk:** `read` ```ts theme={null} await corsair.tpscheck.api.credits.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `requests_used` | `number` | Yes | — | | `requests_remaining` | `number` | Yes | — | | `monthly_limit` | `number` | Yes | — | | `plan` | `string` | Yes | — | | `reset_date` | `string` | Yes | — | *** ## Status ### get `status.get` Check TPSCheck API health and version **Risk:** `read` ```ts theme={null} await corsair.tpscheck.api.status.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `version` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/tpscheck/database TPSCheck local sync: searchable entities, `.search()` filters, and operators. The TPSCheck plugin syncs data locally. Use `corsair.tpscheck.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/tpscheck/overview UK phone number validation and TPS/CTPS register checking for marketing compliance. Use **TPSCheck** through Corsair: one client, typed API calls. **What you get:** * 4 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tpscheck ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tpscheck ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tpscheck ``` ```bash bun theme={null} bun add corsair @corsair-dev/tpscheck ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tpscheck } from '@corsair-dev/tpscheck'; export const corsair = createCorsair({ plugins: [ tpscheck(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} tpscheck() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tpscheck', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`batch.post`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tpscheck.api.batch.post({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/tpscheck/api) reference.* See the full list on the [API](/plugins/tpscheck/api) page. ## What's next > **[API reference](/plugins/tpscheck/api)** > > Every `tpscheck.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/trello/api API reference for Trello: every `trello.api.*` operation with input and output types. Every `trello.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Boards ### create `boards.create` Create a new board **Risk:** `write` ```ts theme={null} await corsair.trello.api.boards.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `desc` | `string` | No | — | | `idOrganization` | `string` | No | — | | `idBoardSource` | `string` | No | — | | `keepFromSource` | `string` | No | — | | `powerUps` | `string` | No | — | | `prefs_permissionLevel` | `org \| private \| public` | No | — | | `prefs_voting` | `string` | No | — | | `prefs_comments` | `string` | No | — | | `prefs_invitations` | `string` | No | — | | `prefs_selfJoin` | `boolean` | No | — | | `prefs_cardCovers` | `boolean` | No | — | | `prefs_background` | `string` | No | — | | `prefs_cardAging` | `pirate \| regular` | No | — | | `defaultLabels` | `boolean` | No | — | | `defaultLists` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `desc` | `string` | No | — | | `descData` | `any` | No | — | | `closed` | `boolean` | No | — | | `idOrganization` | `string` | No | — | | `idEnterprise` | `string` | No | — | | `pinned` | `boolean` | No | — | | `url` | `string` | No | — | | `shortUrl` | `string` | No | — | | `prefs` | `object` | No | — | | `labelNames` | `object` | No | — | | `starred` | `boolean` | No | — | | `memberships` | `any[]` | No | — | > **prefs full type** > > ```ts theme={null} > { > permissionLevel?: string, > hideVotes?: boolean, > voting?: string, > comments?: string, > invitations?: string, > selfJoin?: boolean, > cardCovers?: boolean, > isTemplate?: boolean, > cardAging?: string, > calendarFeedEnabled?: boolean, > background?: string | null, > backgroundImage?: string | null, > backgroundTile?: boolean, > backgroundBrightness?: string, > canBePublic?: boolean, > canBeOrg?: boolean, > canBePrivate?: boolean, > canInvite?: string | boolean > } > ``` > **labelNames full type** > > ```ts theme={null} > { > } > ``` *** ### delete `boards.delete` Delete a board **Risk:** `destructive` ```ts theme={null} await corsair.trello.api.boards.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_value` | `string` | No | — | *** ### get `boards.get` Get a board by ID **Risk:** `read` ```ts theme={null} await corsair.trello.api.boards.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardId` | `string` | Yes | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `desc` | `string` | No | — | | `descData` | `any` | No | — | | `closed` | `boolean` | No | — | | `idOrganization` | `string` | No | — | | `idEnterprise` | `string` | No | — | | `pinned` | `boolean` | No | — | | `url` | `string` | No | — | | `shortUrl` | `string` | No | — | | `prefs` | `object` | No | — | | `labelNames` | `object` | No | — | | `starred` | `boolean` | No | — | | `memberships` | `any[]` | No | — | > **prefs full type** > > ```ts theme={null} > { > permissionLevel?: string, > hideVotes?: boolean, > voting?: string, > comments?: string, > invitations?: string, > selfJoin?: boolean, > cardCovers?: boolean, > isTemplate?: boolean, > cardAging?: string, > calendarFeedEnabled?: boolean, > background?: string | null, > backgroundImage?: string | null, > backgroundTile?: boolean, > backgroundBrightness?: string, > canBePublic?: boolean, > canBeOrg?: boolean, > canBePrivate?: boolean, > canInvite?: string | boolean > } > ``` > **labelNames full type** > > ```ts theme={null} > { > } > ``` *** ### list `boards.list` List boards for a member **Risk:** `read` ```ts theme={null} await corsair.trello.api.boards.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `memberId` | `string` | No | — | | `filter` | `all \| closed \| members \| open \| organization \| public \| starred` | No | — | | `fields` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string, > desc?: string, > descData?: any | null, > closed?: boolean, > idOrganization?: string | null, > idEnterprise?: string | null, > pinned?: boolean, > url?: string, > shortUrl?: string, > prefs?: { > permissionLevel?: string, > hideVotes?: boolean, > voting?: string, > comments?: string, > invitations?: string, > selfJoin?: boolean, > cardCovers?: boolean, > isTemplate?: boolean, > cardAging?: string, > calendarFeedEnabled?: boolean, > background?: string | null, > backgroundImage?: string | null, > backgroundTile?: boolean, > backgroundBrightness?: string, > canBePublic?: boolean, > canBeOrg?: boolean, > canBePrivate?: boolean, > canInvite?: string | boolean > }, > labelNames?: { > }, > starred?: boolean, > memberships?: any[] > }[] > ``` *** ### update `boards.update` Update a board **Risk:** `write` ```ts theme={null} await corsair.trello.api.boards.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardId` | `string` | Yes | — | | `name` | `string` | No | — | | `desc` | `string` | No | — | | `closed` | `boolean` | No | — | | `subscribed` | `boolean` | No | — | | `idOrganization` | `string` | No | — | | `prefs_permissionLevel` | `org \| private \| public` | No | — | | `prefs_selfJoin` | `boolean` | No | — | | `prefs_cardCovers` | `boolean` | No | — | | `prefs_cardAging` | `pirate \| regular` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `desc` | `string` | No | — | | `descData` | `any` | No | — | | `closed` | `boolean` | No | — | | `idOrganization` | `string` | No | — | | `idEnterprise` | `string` | No | — | | `pinned` | `boolean` | No | — | | `url` | `string` | No | — | | `shortUrl` | `string` | No | — | | `prefs` | `object` | No | — | | `labelNames` | `object` | No | — | | `starred` | `boolean` | No | — | | `memberships` | `any[]` | No | — | > **prefs full type** > > ```ts theme={null} > { > permissionLevel?: string, > hideVotes?: boolean, > voting?: string, > comments?: string, > invitations?: string, > selfJoin?: boolean, > cardCovers?: boolean, > isTemplate?: boolean, > cardAging?: string, > calendarFeedEnabled?: boolean, > background?: string | null, > backgroundImage?: string | null, > backgroundTile?: boolean, > backgroundBrightness?: string, > canBePublic?: boolean, > canBeOrg?: boolean, > canBePrivate?: boolean, > canInvite?: string | boolean > } > ``` > **labelNames full type** > > ```ts theme={null} > { > } > ``` *** ## Cards ### create `cards.create` Create a new card **Risk:** `write` ```ts theme={null} await corsair.trello.api.cards.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `idList` | `string` | Yes | — | | `desc` | `string` | No | — | | `pos` | `number \| top \| bottom` | No | — | | `due` | `string` | No | — | | `start` | `string` | No | — | | `dueComplete` | `boolean` | No | — | | `idMembers` | `string[]` | No | — | | `idLabels` | `string[]` | No | — | | `idCardSource` | `string` | No | — | | `keepFromSource` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `badges` | `object` | No | — | | `checkItemStates` | `any[]` | No | — | | `closed` | `boolean` | No | — | | `dateLastActivity` | `string` | No | — | | `desc` | `string` | No | — | | `descData` | `any` | No | — | | `due` | `string` | No | — | | `dueComplete` | `boolean` | No | — | | `dueReminder` | `number` | No | — | | `email` | `string` | No | — | | `idBoard` | `string` | No | — | | `idChecklists` | `string[]` | No | — | | `idLabels` | `string[]` | No | — | | `idList` | `string` | No | — | | `idMembers` | `string[]` | No | — | | `idMembersVoted` | `string[]` | No | — | | `idShort` | `number` | No | — | | `idAttachmentCover` | `string` | No | — | | `labels` | `object[]` | No | — | | `manualCoverAttachment` | `boolean` | No | — | | `name` | `string` | No | — | | `pos` | `number` | No | — | | `shortLink` | `string` | No | — | | `shortUrl` | `string` | No | — | | `start` | `string` | No | — | | `subscribed` | `boolean` | No | — | | `url` | `string` | No | — | | `cover` | `any` | No | — | > **badges full type** > > ```ts theme={null} > { > votes?: number, > viewingMemberVoted?: boolean, > subscribed?: boolean, > fogbugz?: string, > checkItems?: number, > checkItemsChecked?: number, > comments?: number, > attachments?: number, > description?: boolean, > due?: string | null, > dueComplete?: boolean > } > ``` > **labels full type** > > ```ts theme={null} > { > id: string, > idBoard?: string, > name?: string, > color?: string | null > }[] > ``` *** ### delete `cards.delete` Delete a card **Risk:** `destructive` ```ts theme={null} await corsair.trello.api.cards.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_value` | `string` | No | — | *** ### get `cards.get` Get a card by ID **Risk:** `read` ```ts theme={null} await corsair.trello.api.cards.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `string` | Yes | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `badges` | `object` | No | — | | `checkItemStates` | `any[]` | No | — | | `closed` | `boolean` | No | — | | `dateLastActivity` | `string` | No | — | | `desc` | `string` | No | — | | `descData` | `any` | No | — | | `due` | `string` | No | — | | `dueComplete` | `boolean` | No | — | | `dueReminder` | `number` | No | — | | `email` | `string` | No | — | | `idBoard` | `string` | No | — | | `idChecklists` | `string[]` | No | — | | `idLabels` | `string[]` | No | — | | `idList` | `string` | No | — | | `idMembers` | `string[]` | No | — | | `idMembersVoted` | `string[]` | No | — | | `idShort` | `number` | No | — | | `idAttachmentCover` | `string` | No | — | | `labels` | `object[]` | No | — | | `manualCoverAttachment` | `boolean` | No | — | | `name` | `string` | No | — | | `pos` | `number` | No | — | | `shortLink` | `string` | No | — | | `shortUrl` | `string` | No | — | | `start` | `string` | No | — | | `subscribed` | `boolean` | No | — | | `url` | `string` | No | — | | `cover` | `any` | No | — | > **badges full type** > > ```ts theme={null} > { > votes?: number, > viewingMemberVoted?: boolean, > subscribed?: boolean, > fogbugz?: string, > checkItems?: number, > checkItemsChecked?: number, > comments?: number, > attachments?: number, > description?: boolean, > due?: string | null, > dueComplete?: boolean > } > ``` > **labels full type** > > ```ts theme={null} > { > id: string, > idBoard?: string, > name?: string, > color?: string | null > }[] > ``` *** ### list `cards.list` List cards in a list **Risk:** `read` ```ts theme={null} await corsair.trello.api.cards.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `filter` | `all \| closed \| none \| open \| visible` | No | — | | `fields` | `string` | No | — | | `limit` | `number` | No | — | | `before` | `string` | No | — | | `since` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > badges?: { > votes?: number, > viewingMemberVoted?: boolean, > subscribed?: boolean, > fogbugz?: string, > checkItems?: number, > checkItemsChecked?: number, > comments?: number, > attachments?: number, > description?: boolean, > due?: string | null, > dueComplete?: boolean > }, > checkItemStates?: any[] | null, > closed?: boolean, > dateLastActivity?: string, > desc?: string, > descData?: any | null, > due?: string | null, > dueComplete?: boolean, > dueReminder?: number | null, > email?: string | null, > idBoard?: string, > idChecklists?: string[], > idLabels?: string[], > idList?: string, > idMembers?: string[], > idMembersVoted?: string[], > idShort?: number, > idAttachmentCover?: string | null, > labels?: { > id: string, > idBoard?: string, > name?: string, > color?: string | null > }[], > manualCoverAttachment?: boolean, > name?: string, > pos?: number, > shortLink?: string, > shortUrl?: string, > start?: string | null, > subscribed?: boolean, > url?: string, > cover?: any | null > }[] > ``` *** ### move `cards.move` Move a card to a different list or board **Risk:** `write` ```ts theme={null} await corsair.trello.api.cards.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `string` | Yes | — | | `idList` | `string` | Yes | — | | `idBoard` | `string` | No | — | | `pos` | `number \| top \| bottom` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `badges` | `object` | No | — | | `checkItemStates` | `any[]` | No | — | | `closed` | `boolean` | No | — | | `dateLastActivity` | `string` | No | — | | `desc` | `string` | No | — | | `descData` | `any` | No | — | | `due` | `string` | No | — | | `dueComplete` | `boolean` | No | — | | `dueReminder` | `number` | No | — | | `email` | `string` | No | — | | `idBoard` | `string` | No | — | | `idChecklists` | `string[]` | No | — | | `idLabels` | `string[]` | No | — | | `idList` | `string` | No | — | | `idMembers` | `string[]` | No | — | | `idMembersVoted` | `string[]` | No | — | | `idShort` | `number` | No | — | | `idAttachmentCover` | `string` | No | — | | `labels` | `object[]` | No | — | | `manualCoverAttachment` | `boolean` | No | — | | `name` | `string` | No | — | | `pos` | `number` | No | — | | `shortLink` | `string` | No | — | | `shortUrl` | `string` | No | — | | `start` | `string` | No | — | | `subscribed` | `boolean` | No | — | | `url` | `string` | No | — | | `cover` | `any` | No | — | > **badges full type** > > ```ts theme={null} > { > votes?: number, > viewingMemberVoted?: boolean, > subscribed?: boolean, > fogbugz?: string, > checkItems?: number, > checkItemsChecked?: number, > comments?: number, > attachments?: number, > description?: boolean, > due?: string | null, > dueComplete?: boolean > } > ``` > **labels full type** > > ```ts theme={null} > { > id: string, > idBoard?: string, > name?: string, > color?: string | null > }[] > ``` *** ### update `cards.update` Update a card **Risk:** `write` ```ts theme={null} await corsair.trello.api.cards.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cardId` | `string` | Yes | — | | `name` | `string` | No | — | | `desc` | `string` | No | — | | `closed` | `boolean` | No | — | | `idMembers` | `string[]` | No | — | | `idAttachmentCover` | `string` | No | — | | `idList` | `string` | No | — | | `idLabels` | `string[]` | No | — | | `idBoard` | `string` | No | — | | `pos` | `number \| top \| bottom` | No | — | | `due` | `string` | No | — | | `start` | `string` | No | — | | `dueComplete` | `boolean` | No | — | | `subscribed` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `badges` | `object` | No | — | | `checkItemStates` | `any[]` | No | — | | `closed` | `boolean` | No | — | | `dateLastActivity` | `string` | No | — | | `desc` | `string` | No | — | | `descData` | `any` | No | — | | `due` | `string` | No | — | | `dueComplete` | `boolean` | No | — | | `dueReminder` | `number` | No | — | | `email` | `string` | No | — | | `idBoard` | `string` | No | — | | `idChecklists` | `string[]` | No | — | | `idLabels` | `string[]` | No | — | | `idList` | `string` | No | — | | `idMembers` | `string[]` | No | — | | `idMembersVoted` | `string[]` | No | — | | `idShort` | `number` | No | — | | `idAttachmentCover` | `string` | No | — | | `labels` | `object[]` | No | — | | `manualCoverAttachment` | `boolean` | No | — | | `name` | `string` | No | — | | `pos` | `number` | No | — | | `shortLink` | `string` | No | — | | `shortUrl` | `string` | No | — | | `start` | `string` | No | — | | `subscribed` | `boolean` | No | — | | `url` | `string` | No | — | | `cover` | `any` | No | — | > **badges full type** > > ```ts theme={null} > { > votes?: number, > viewingMemberVoted?: boolean, > subscribed?: boolean, > fogbugz?: string, > checkItems?: number, > checkItemsChecked?: number, > comments?: number, > attachments?: number, > description?: boolean, > due?: string | null, > dueComplete?: boolean > } > ``` > **labels full type** > > ```ts theme={null} > { > id: string, > idBoard?: string, > name?: string, > color?: string | null > }[] > ``` *** ## Checklists ### create `checklists.create` Create a checklist on a card **Risk:** `write` ```ts theme={null} await corsair.trello.api.checklists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `idCard` | `string` | Yes | — | | `name` | `string` | Yes | — | | `pos` | `number \| top \| bottom` | No | — | | `idChecklistSource` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `idBoard` | `string` | No | — | | `idCard` | `string` | No | — | | `name` | `string` | No | — | | `pos` | `number` | No | — | | `checkItems` | `object[]` | No | — | > **checkItems full type** > > ```ts theme={null} > { > id: string, > idChecklist?: string, > name?: string, > nameData?: any | null, > pos?: number, > state?: incomplete | complete, > due?: string | null, > dueReminder?: any | null, > idMember?: string | null > }[] > ``` *** ### delete `checklists.delete` Delete a checklist **Risk:** `destructive` ```ts theme={null} await corsair.trello.api.checklists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `checklistId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_value` | `string` | No | — | *** ### get `checklists.get` Get a checklist by ID **Risk:** `read` ```ts theme={null} await corsair.trello.api.checklists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `checklistId` | `string` | Yes | — | | `fields` | `string` | No | — | | `checkItems` | `string` | No | — | | `checkItem_fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `idBoard` | `string` | No | — | | `idCard` | `string` | No | — | | `name` | `string` | No | — | | `pos` | `number` | No | — | | `checkItems` | `object[]` | No | — | > **checkItems full type** > > ```ts theme={null} > { > id: string, > idChecklist?: string, > name?: string, > nameData?: any | null, > pos?: number, > state?: incomplete | complete, > due?: string | null, > dueReminder?: any | null, > idMember?: string | null > }[] > ``` *** ## Labels ### create `labels.create` Create a label on a board **Risk:** `write` ```ts theme={null} await corsair.trello.api.labels.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `color` | `string` | No | — | | `idBoard` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `idBoard` | `string` | No | — | | `name` | `string` | No | — | | `color` | `string` | No | — | *** ### delete `labels.delete` Delete a label **Risk:** `destructive` ```ts theme={null} await corsair.trello.api.labels.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `labelId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `_value` | `string` | No | — | *** ### list `labels.list` List labels on a board **Risk:** `read` ```ts theme={null} await corsair.trello.api.labels.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardId` | `string` | Yes | — | | `fields` | `string` | No | — | | `limit` | `number` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > idBoard?: string, > name?: string, > color?: string | null > }[] > ``` *** ### update `labels.update` Update a label **Risk:** `write` ```ts theme={null} await corsair.trello.api.labels.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `labelId` | `string` | Yes | — | | `name` | `string` | No | — | | `color` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `idBoard` | `string` | No | — | | `name` | `string` | No | — | | `color` | `string` | No | — | *** ## Lists ### archive `lists.archive` Archive (close) a list **Risk:** `write` ```ts theme={null} await corsair.trello.api.lists.archive({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `closed` | `boolean` | No | — | | `idBoard` | `string` | No | — | | `pos` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `softLimit` | `any` | No | — | *** ### create `lists.create` Create a new list on a board **Risk:** `write` ```ts theme={null} await corsair.trello.api.lists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `idBoard` | `string` | Yes | — | | `idListSource` | `string` | No | — | | `pos` | `number \| top \| bottom` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `closed` | `boolean` | No | — | | `idBoard` | `string` | No | — | | `pos` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `softLimit` | `any` | No | — | *** ### get `lists.get` Get a list by ID **Risk:** `read` ```ts theme={null} await corsair.trello.api.lists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `closed` | `boolean` | No | — | | `idBoard` | `string` | No | — | | `pos` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `softLimit` | `any` | No | — | *** ### list `lists.list` List all lists on a board **Risk:** `read` ```ts theme={null} await corsair.trello.api.lists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardId` | `string` | Yes | — | | `filter` | `all \| closed \| none \| open` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name?: string, > closed?: boolean, > idBoard?: string, > pos?: number, > subscribed?: boolean, > softLimit?: any | null > }[] > ``` *** ### update `lists.update` Update a list **Risk:** `write` ```ts theme={null} await corsair.trello.api.lists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `name` | `string` | No | — | | `closed` | `boolean` | No | — | | `idBoard` | `string` | No | — | | `pos` | `number \| top \| bottom` | No | — | | `subscribed` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `closed` | `boolean` | No | — | | `idBoard` | `string` | No | — | | `pos` | `number` | No | — | | `subscribed` | `boolean` | No | — | | `softLimit` | `any` | No | — | *** ## Members ### get `members.get` Get a member by ID or username **Risk:** `read` ```ts theme={null} await corsair.trello.api.members.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `memberId` | `string` | Yes | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `activityBlocked` | `boolean` | No | — | | `avatarHash` | `string` | No | — | | `avatarUrl` | `string` | No | — | | `bio` | `string` | No | — | | `confirmed` | `boolean` | No | — | | `email` | `string` | No | — | | `fullName` | `string` | No | — | | `idEnterprise` | `string` | No | — | | `idMemberReferrer` | `string` | No | — | | `idOrganizations` | `string[]` | No | — | | `initials` | `string` | No | — | | `memberType` | `string` | No | — | | `nonPublic` | `any` | No | — | | `nonPublicAvailable` | `boolean` | No | — | | `products` | `number[]` | No | — | | `url` | `string` | No | — | | `username` | `string` | No | — | *** ### list `members.list` List members of a board **Risk:** `read` ```ts theme={null} await corsair.trello.api.members.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `boardId` | `string` | Yes | — | | `filter` | `admins \| all \| none \| normal \| owners` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > bio?: string, > confirmed?: boolean, > email?: string | null, > fullName?: string, > idEnterprise?: string | null, > idMemberReferrer?: string | null, > idOrganizations?: string[], > initials?: string, > memberType?: string, > nonPublic?: any, > nonPublicAvailable?: boolean, > products?: number[], > url?: string, > username?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/trello/database Trello local sync: searchable entities, `.search()` filters, and operators. The Trello plugin syncs data locally. Use `corsair.trello.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Boards Path: `trello.db.boards.search` ```ts theme={null} const rows = await corsair.trello.db.boards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `desc` | `string` | equals, contains, startsWith, endsWith, in | | `closed` | `boolean` | equals | | `idOrganization` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `shortUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Cards Path: `trello.db.cards.search` ```ts theme={null} const rows = await corsair.trello.db.cards.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `desc` | `string` | equals, contains, startsWith, endsWith, in | | `closed` | `boolean` | equals | | `idBoard` | `string` | equals, contains, startsWith, endsWith, in | | `idList` | `string` | equals, contains, startsWith, endsWith, in | | `pos` | `number` | equals, gt, gte, lt, lte, in | | `due` | `string` | equals, contains, startsWith, endsWith, in | | `dueComplete` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `shortUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Labels Path: `trello.db.labels.search` ```ts theme={null} const rows = await corsair.trello.db.labels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `color` | `string` | equals, contains, startsWith, endsWith, in | | `idBoard` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `trello.db.lists.search` ```ts theme={null} const rows = await corsair.trello.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `closed` | `boolean` | equals | | `idBoard` | `string` | equals, contains, startsWith, endsWith, in | | `pos` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Members Path: `trello.db.members.search` ```ts theme={null} const rows = await corsair.trello.db.members.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `fullName` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `avatarUrl` | `string` | equals, contains, startsWith, endsWith, in | | `initials` | `string` | equals, contains, startsWith, endsWith, in | | `memberType` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/trello/get-credentials Step-by-step instructions for obtaining Trello API credentials. ## Authentication Method * **[`api_key`](/concepts/api-key)** - Trello API key + token ## API Key Setup ### Step 1: Get Your API Key 1. Log in to [Trello](https://trello.com) 2. Go to [trello.com/app-key](https://trello.com/app-key) 3. Copy your **API Key** ### Step 2: Generate a Token 1. On the same page, click the **Token** link 2. Authorize the app to access your Trello account 3. Copy the generated token ### Step 3: Store Credentials The plugin uses a combined `key|token` format: ```bash theme={null} pnpm corsair setup --plugin=trello api_key=your-api-key ``` > [!NOTE] > > Trello requires both an API key and a user token. Depending on your setup, you may need to configure the `trelloApiKey` option separately in the plugin options. ## Webhook Setup (Optional) ```bash theme={null} pnpm corsair setup --plugin=trello webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Key | All API calls | trello.com/app-key | | Token | All API calls | trello.com/app-key → Token link | | Webhook Secret | Webhook verification | Set when creating the webhook | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/trello/overview Kanban board tool for organizing tasks, cards, lists, and lightweight project management. Use **Trello** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 25 typed API operations * 5 synced entities (`boards`, `cards`, `labels`, `lists`, `members`) for fast `.search()` / `.list()` * 6 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/trello ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/trello ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/trello ``` ```bash bun theme={null} bun add corsair @corsair-dev/trello ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { trello } from '@corsair-dev/trello'; export const corsair = createCorsair({ plugins: [ trello(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/trello/get-credentials). ```ts theme={null} trello() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'trello', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List cards** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.trello.api.cards.list({ listId: '64a1b2c3d4e5f6a7b8c9d0e1' }); ``` **Create a card** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.trello.api.cards.create({ name: 'Follow up from Corsair', idList: '64a1b2c3d4e5f6a7b8c9d0e1' }); ``` See the full list on the [API](/plugins/trello/api) page. ## Query synced data Search synced cards without hitting Trello. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.trello.db.cards.search({ data: { closed: false }, limit: 50, }); ``` Synced entities: `boards`, `cards`, `labels`, `lists`, `members`. See [Database](/plugins/trello/database) for filters and operators. ## Webhooks Fires when a Trello card is created. ```ts theme={null} trello({ webhookHooks: { cards: { cardCreated: { after: async (ctx, result) => { console.log('Trello card created:', result.data?.action.data.card?.id); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/trello/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/trello/api)** > > Every `trello.api.*` operation with input and output types. > **[Database](/plugins/trello/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/trello/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/trello/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/trello/webhooks Trello incoming webhooks: event paths, payloads, and response data. The Trello plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/trello/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `cards` * `cardCreated` (`cards.cardCreated`) * `cardUpdated` (`cards.cardUpdated`) * `comments` * `commentCreated` (`comments.commentCreated`) * `lists` * `listCreated` (`lists.listCreated`) * `listUpdated` (`lists.listUpdated`) * `members` * `memberAddedToCard` (`members.memberAddedToCard`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Cards ### Card Created `cards.cardCreated` A card was created on a board **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `object` | Yes | — | | `model` | `object` | Yes | — | > **action full type** > > ```ts theme={null} > { > id: string, > idMemberCreator: string, > type: createCard, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > list?: { > id: string, > name?: string > }, > card?: { > id: string, > name?: string, > idList?: string, > idBoard?: string, > idShort?: number, > shortLink?: string, > desc?: string, > due?: string | null, > dueComplete?: boolean, > closed?: boolean, > pos?: number > } > } > } > ``` > **model full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: { > id: string, > idMemberCreator: string, > type: createCard, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > list?: { > id: string, > name?: string > }, > card?: { > id: string, > name?: string, > idList?: string, > idBoard?: string, > idShort?: number, > shortLink?: string, > desc?: string, > due?: string | null, > dueComplete?: boolean, > closed?: boolean, > pos?: number > } > } > }, > model: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} trello({ webhookHooks: { cards: { cardCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Card Updated `cards.cardUpdated` A card was updated (name, desc, due date, labels, etc.) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `object` | Yes | — | | `model` | `object` | Yes | — | > **action full type** > > ```ts theme={null} > { > id: string, > idMemberCreator: string, > type: updateCard, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > list?: { > id: string, > name?: string > }, > card?: { > id: string, > name?: string, > idList?: string, > idBoard?: string, > idShort?: number, > shortLink?: string, > desc?: string, > due?: string | null, > dueComplete?: boolean, > closed?: boolean, > pos?: number > }, > listBefore?: { > id: string, > name?: string > }, > listAfter?: { > id: string, > name?: string > }, > old?: { > } > } > } > ``` > **model full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: { > id: string, > idMemberCreator: string, > type: updateCard, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > list?: { > id: string, > name?: string > }, > card?: { > id: string, > name?: string, > idList?: string, > idBoard?: string, > idShort?: number, > shortLink?: string, > desc?: string, > due?: string | null, > dueComplete?: boolean, > closed?: boolean, > pos?: number > }, > listBefore?: { > id: string, > name?: string > }, > listAfter?: { > id: string, > name?: string > }, > old?: { > } > } > }, > model: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} trello({ webhookHooks: { cards: { cardUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Comments ### Comment Created `comments.commentCreated` A comment was added to a card **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `object` | Yes | — | | `model` | `object` | Yes | — | > **action full type** > > ```ts theme={null} > { > id: string, > idMemberCreator: string, > type: commentCard, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > card?: { > id: string, > name?: string, > idList?: string, > idBoard?: string, > idShort?: number, > shortLink?: string, > desc?: string, > due?: string | null, > dueComplete?: boolean, > closed?: boolean, > pos?: number > }, > list?: { > id: string, > name?: string > }, > text?: string, > textData?: any | null > } > } > ``` > **model full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: { > id: string, > idMemberCreator: string, > type: commentCard, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > card?: { > id: string, > name?: string, > idList?: string, > idBoard?: string, > idShort?: number, > shortLink?: string, > desc?: string, > due?: string | null, > dueComplete?: boolean, > closed?: boolean, > pos?: number > }, > list?: { > id: string, > name?: string > }, > text?: string, > textData?: any | null > } > }, > model: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} trello({ webhookHooks: { comments: { commentCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Lists ### List Created `lists.listCreated` A new list was created on a board **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `object` | Yes | — | | `model` | `object` | Yes | — | > **action full type** > > ```ts theme={null} > { > id: string, > idMemberCreator: string, > type: createList, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > list?: { > id: string, > name?: string > } > } > } > ``` > **model full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: { > id: string, > idMemberCreator: string, > type: createList, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > list?: { > id: string, > name?: string > } > } > }, > model: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} trello({ webhookHooks: { lists: { listCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### List Updated `lists.listUpdated` A list was updated (name, closed status, etc.) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `object` | Yes | — | | `model` | `object` | Yes | — | > **action full type** > > ```ts theme={null} > { > id: string, > idMemberCreator: string, > type: updateList, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > list?: { > id: string, > name?: string > }, > old?: { > } > } > } > ``` > **model full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: { > id: string, > idMemberCreator: string, > type: updateList, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > list?: { > id: string, > name?: string > }, > old?: { > } > } > }, > model: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} trello({ webhookHooks: { lists: { listUpdated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Members ### Member Added To Card `members.memberAddedToCard` A member was added to a card **Payload** | Name | Type | Required | Description | | - | - | - | - | | `action` | `object` | Yes | — | | `model` | `object` | Yes | — | > **action full type** > > ```ts theme={null} > { > id: string, > idMemberCreator: string, > type: addMemberToCard, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > card?: { > id: string, > name?: string, > idList?: string, > idBoard?: string, > idShort?: number, > shortLink?: string, > desc?: string, > due?: string | null, > dueComplete?: boolean, > closed?: boolean, > pos?: number > }, > idMember?: string, > member?: { > id: string, > username?: string, > fullName?: string, > avatarUrl?: string | null, > initials?: string > } > } > } > ``` > **model full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > action: { > id: string, > idMemberCreator: string, > type: addMemberToCard, > date: string, > memberCreator?: { > id: string, > activityBlocked?: boolean, > avatarHash?: string | null, > avatarUrl?: string | null, > fullName?: string, > idMemberReferrer?: string | null, > initials?: string, > nonPublicAvailable?: boolean, > username?: string > }, > data: { > board?: { > id: string, > name?: string, > shortLink?: string > }, > card?: { > id: string, > name?: string, > idList?: string, > idBoard?: string, > idShort?: number, > shortLink?: string, > desc?: string, > due?: string | null, > dueComplete?: boolean, > closed?: boolean, > pos?: number > }, > idMember?: string, > member?: { > id: string, > username?: string, > fullName?: string, > avatarUrl?: string | null, > initials?: string > } > } > }, > model: { > } > } > ``` **`webhookHooks` example** ```ts theme={null} trello({ webhookHooks: { members: { memberAddedToCard: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/tripadvisor/api API reference for Tripadvisor: every `tripadvisor.api.*` operation with input and output types. Every `tripadvisor.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Catalog ### locationsNearby `catalog.locationsNearby` Search nearby Tripadvisor catalog locations by coordinates or location ID **Risk:** `read` ```ts theme={null} await corsair.tripadvisor.api.catalog.locationsNearby({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `location_id` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `radius` | `number` | No | — | | `unit` | `MI \| KM` | No | — | | `sw_lat` | `number` | No | — | | `sw_lon` | `number` | No | — | | `ne_lat` | `number` | No | — | | `ne_lon` | `number` | No | — | | `category` | `RESTAURANT \| ATTRACTION \| HOTEL` | No | — | | `min_rating` | `number` | No | — | | `locale` | `string[]` | No | — | | `page` | `number` | No | — | | `size` | `number` | No | — | | `sort` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > bearing?: number, > distance_kilometers?: number, > distance_miles?: number, > location: { > addresses?: { > city?: string, > country_code?: string, > country_name?: string, > formatted?: string, > language?: string, > postal_code?: string, > state?: string, > street_address?: string, > street_address2?: string > }[], > coordinates?: { > latitude: number, > longitude: number > }, > descriptions: { > language: string, > value: string > }[], > geo: string, > geo_id: number, > id: number, > names: { > language: string, > value: string, > primary?: boolean > }[], > overall_rating?: { > count?: number, > icon_url?: string, > rating?: number > }, > urls?: { > android_intent?: string, > menu?: string, > official?: string, > tripadvisor?: { > main?: string, > photos?: string, > questions_answers?: string, > write_review?: string > } > } > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > page?: number, > size?: number, > total_elements?: number, > total_pages?: number > } > ``` *** ## Geo ### details `geo.details` Get factual and hierarchy details for a Tripadvisor geo **Risk:** `read` ```ts theme={null} await corsair.tripadvisor.api.geo.details({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `locale` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `abbreviation` | `string` | No | — | | `awards` | `object[]` | No | — | | `collections` | `object[]` | No | — | | `coordinates` | `object` | No | — | | `descriptions` | `object[]` | Yes | — | | `forum_faqs` | `object[]` | No | — | | `hierarchy` | `object` | No | — | | `id` | `number` | Yes | — | | `names` | `object[]` | Yes | — | | `suggested_itineraries` | `object[]` | No | — | | `type` | `object` | Yes | — | | `urls` | `object` | No | — | > **awards full type** > > ```ts theme={null} > { > category?: string, > geo?: string, > image?: { > key?: string, > url?: string > }, > name?: string, > type?: Certificate of Excellence | Travelers' Choice, > year?: number > }[] > ``` > **collections full type** > > ```ts theme={null} > { > id?: string, > title?: string, > url?: string > }[] > ``` > **coordinates full type** > > ```ts theme={null} > { > latitude: number, > longitude: number > } > ``` > **descriptions full type** > > ```ts theme={null} > { > language: string, > value: string > }[] > ``` > **forum\_faqs full type** > > ```ts theme={null} > { > answers?: { > text?: string, > title?: string > }[], > language?: string, > question?: string > }[] > ``` > **hierarchy full type** > > ```ts theme={null} > { > ancestors?: { > geo_id?: number, > name?: string, > rank?: number > }[] > } > ``` > **names full type** > > ```ts theme={null} > { > language: string, > value: string, > primary?: boolean > }[] > ``` > **suggested\_itineraries full type** > > ```ts theme={null} > { > itinerary?: { > day?: number, > description?: string, > location_ids?: { > id?: number, > rank?: number > }[] > }[], > trip_creation_method?: string, > trip_id?: number, > trip_interest_tags?: string[], > trip_title?: string, > trip_url?: string > }[] > ``` > **type full type** > > ```ts theme={null} > { > id: number, > name: string > } > ``` > **urls full type** > > ```ts theme={null} > { > flights?: string, > geo_page?: string, > hotels?: string, > restaurants?: string, > things_to_do?: string > } > ``` *** ## Location ### details `location.details` Get full details, ratings, rankings and awards for a Tripadvisor location **Risk:** `read` ```ts theme={null} await corsair.tripadvisor.api.location.details({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `locale` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `accommodation` | `object` | No | — | | `addresses` | `object[]` | No | — | | `attributes` | `object[]` | No | — | | `awards` | `object[]` | No | — | | `categories` | `object[]` | No | — | | `coordinates` | `object` | No | — | | `descriptions` | `object[]` | Yes | — | | `geo` | `string` | Yes | — | | `geo_id` | `number` | Yes | — | | `id` | `number` | Yes | — | | `names` | `object[]` | Yes | — | | `neighborhoods` | `object[]` | No | — | | `official_email` | `string` | No | — | | `opening_hours` | `object` | No | — | | `phone_numbers` | `object[]` | No | — | | `photos` | `object` | Yes | — | | `price_level` | `string` | No | — | | `rankings` | `object[]` | No | — | | `recommended_visit_length` | `number` | No | — | | `status` | `object` | Yes | — | | `traveler_ratings` | `object` | No | — | | `urls` | `object` | No | — | > **accommodation full type** > > ```ts theme={null} > { > brand?: string, > chain?: string, > prices?: { > currency?: string, > max_rate?: number, > min_rate?: number > }[], > room_count?: number, > star_rating?: number > } > ``` > **addresses full type** > > ```ts theme={null} > { > city?: string, > country_code?: string, > country_name?: string, > formatted?: string, > language?: string, > postal_code?: string, > state?: string, > street_address?: string, > street_address2?: string > }[] > ``` > **attributes full type** > > ```ts theme={null} > { > id?: string, > name?: string, > type?: string, > type_id?: string > }[] > ``` > **awards full type** > > ```ts theme={null} > { > category?: string, > geo?: string, > image?: { > key?: string, > url?: string > }, > name?: string, > type?: Certificate of Excellence | Travelers' Choice, > year?: number > }[] > ``` > **categories full type** > > ```ts theme={null} > { > display_name?: string, > hierarchy?: string, > id: string, > parent_category?: { > display_name?: string, > id?: string, > parent_category?: { > } > }, > top_level_category?: Accommodation | Experience | Attraction | Eat & Drink > }[] > ``` > **coordinates full type** > > ```ts theme={null} > { > latitude: number, > longitude: number > } > ``` > **descriptions full type** > > ```ts theme={null} > { > language: string, > value: string > }[] > ``` > **names full type** > > ```ts theme={null} > { > language: string, > value: string, > primary?: boolean > }[] > ``` > **neighborhoods full type** > > ```ts theme={null} > { > geo_id?: string, > name?: string > }[] > ``` > **opening\_hours full type** > > ```ts theme={null} > { > formatted?: string[], > periods?: { > closes?: string, > day_of_week?: Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday, > opens?: string > }[], > timezone?: string > } > ``` > **phone\_numbers full type** > > ```ts theme={null} > { > type: string, > value: string > }[] > ``` > **photos full type** > > ```ts theme={null} > { > total_count?: number > } > ``` > **rankings full type** > > ```ts theme={null} > { > category?: string, > category_id?: string, > display_text?: string, > geo?: string, > geo_id?: number, > rank?: number, > total?: number > }[] > ``` > **status full type** > > ```ts theme={null} > { > closed_date?: string, > reopen_date?: string, > value: OPEN | CLOSED | TEMPORARILY_CLOSED > } > ``` > **traveler\_ratings full type** > > ```ts theme={null} > { > breakdowns?: { > count?: number, > rating?: number, > rating_name?: string > }[], > language_counts?: { > count?: number, > language?: string > }[], > overall?: { > count?: number, > icon_url?: string, > rating?: number > }, > subratings?: { > count?: number, > icon_url?: string, > rating?: number, > type?: string, > type_name?: string > }[] > } > ``` > **urls full type** > > ```ts theme={null} > { > android_intent?: string, > menu?: string, > official?: string, > tripadvisor?: { > main?: string, > photos?: string, > questions_answers?: string, > write_review?: string > } > } > ``` *** ### photos `location.photos` Get photos for a Tripadvisor location **Risk:** `read` ```ts theme={null} await corsair.tripadvisor.api.location.photos({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `locale` | `string[]` | No | — | | `page` | `number` | No | — | | `size` | `number` | No | — | | `sort` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > caption?: string, > cv_metadata?: { > attractiveness_score?: number, > scene?: string > }, > id: number, > location_id: number, > photo: { > key?: string, > media_type?: string, > original_height?: number, > original_size_url?: string, > original_width?: number > }, > publish_ts: string, > source: { > name: Management | Traveler > }, > user?: { > avatar_url?: { > key?: string, > url?: string > }, > geo?: string, > geo_id?: number, > username?: string > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > page?: number, > size?: number, > total_elements?: number, > total_pages?: number > } > ``` *** ### reviews `location.reviews` Get traveler reviews for a Tripadvisor location **Risk:** `read` ```ts theme={null} await corsair.tripadvisor.api.location.reviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `rating_min` | `number` | No | — | | `trip_type` | `string` | No | — | | `published_after_ts` | `string` | No | — | | `sort_by` | `MOST_RECENT \| HIGHEST_RATED` | No | — | | `published_after_review_id` | `string` | No | — | | `language` | `string` | No | — | | `page` | `number` | No | — | | `size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > owner_response?: { > author_connection?: string, > avatar_url?: { > key?: string, > url?: string > }, > geo_id?: number, > id?: number, > publish_date?: string, > text?: { > language: string, > value: string, > primary?: boolean > }[], > username?: string > }, > photos?: { > key?: string, > media_type?: string, > original_height?: number, > original_size_url?: string, > original_width?: number > }[], > publish_ts: string, > rating: number, > rating_icon_url?: { > key?: string, > url?: string > }, > subratings: { > icon_url: { > key?: string, > url?: string > }, > rating: number, > type: string, > type_name: string > }[], > text: { > language: string, > value: string, > primary?: boolean > }[], > title: { > language: string, > value: string, > primary?: boolean > }[], > travel_date: string, > trip_type: BUSINESS | COUPLES | FAMILY | FRIENDS | SOLO | NONE, > url?: string, > user?: { > avatar_url?: { > key?: string, > url?: string > }, > geo?: string, > geo_id?: number, > username?: string > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > page?: number, > size?: number, > total_elements?: number, > total_pages?: number > } > ``` *** ## Locations ### nearby `locations.nearby` Find full location representations near an area; filter category HOTEL to list nearby hotels **Risk:** `read` ```ts theme={null} await corsair.tripadvisor.api.locations.nearby({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `location_id` | `string` | No | — | | `lat` | `number` | No | — | | `lon` | `number` | No | — | | `radius` | `number` | No | — | | `unit` | `MI \| KM` | No | — | | `sw_lat` | `number` | No | — | | `sw_lon` | `number` | No | — | | `ne_lat` | `number` | No | — | | `ne_lon` | `number` | No | — | | `category` | `RESTAURANT \| ATTRACTION \| HOTEL` | No | — | | `min_rating` | `number` | No | — | | `locale` | `string[]` | No | — | | `page` | `number` | No | — | | `size` | `number` | No | — | | `sort` | `string[]` | No | — | | `include_photo` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > bearing?: number, > distance_kilometers?: number, > distance_miles?: number, > location: { > accommodation?: { > brand?: string, > chain?: string, > prices?: { > currency?: string, > max_rate?: number, > min_rate?: number > }[], > room_count?: number, > star_rating?: number > }, > addresses?: { > city?: string, > country_code?: string, > country_name?: string, > formatted?: string, > language?: string, > postal_code?: string, > state?: string, > street_address?: string, > street_address2?: string > }[], > attributes?: { > id?: string, > name?: string, > type?: string, > type_id?: string > }[], > awards?: { > category?: string, > geo?: string, > image?: { > key?: string, > url?: string > }, > name?: string, > type?: Certificate of Excellence | Travelers' Choice, > year?: number > }[], > categories?: { > display_name?: string, > hierarchy?: string, > id: string, > parent_category?: { > display_name?: string, > id?: string, > parent_category?: { > } > }, > top_level_category?: Accommodation | Experience | Attraction | Eat & Drink > }[], > coordinates?: { > latitude: number, > longitude: number > }, > descriptions: { > language: string, > value: string > }[], > geo: string, > geo_id: number, > id: number, > names: { > language: string, > value: string, > primary?: boolean > }[], > neighborhoods?: { > geo_id?: string, > name?: string > }[], > official_email?: string, > opening_hours?: { > formatted?: string[], > periods?: { > closes?: string, > day_of_week?: Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday, > opens?: string > }[], > timezone?: string > }, > phone_numbers?: { > type: string, > value: string > }[], > photos: { > total_count?: number > }, > price_level?: string, > rankings?: { > category?: string, > category_id?: string, > display_text?: string, > geo?: string, > geo_id?: number, > rank?: number, > total?: number > }[], > recommended_visit_length?: number, > status: { > closed_date?: string, > reopen_date?: string, > value: OPEN | CLOSED | TEMPORARILY_CLOSED > }, > traveler_ratings?: { > breakdowns?: { > count?: number, > rating?: number, > rating_name?: string > }[], > language_counts?: { > count?: number, > language?: string > }[], > overall?: { > count?: number, > icon_url?: string, > rating?: number > }, > subratings?: { > count?: number, > icon_url?: string, > rating?: number, > type?: string, > type_name?: string > }[] > }, > urls?: { > android_intent?: string, > menu?: string, > official?: string, > tripadvisor?: { > main?: string, > photos?: string, > questions_answers?: string, > write_review?: string > } > } > }, > photo?: { > caption?: string, > cv_metadata?: { > attractiveness_score?: number, > scene?: string > }, > id: number, > location_id: number, > photo: { > key?: string, > media_type?: string, > original_height?: number, > original_size_url?: string, > original_width?: number > }, > publish_ts: string, > source: { > name: Management | Traveler > }, > user?: { > avatar_url?: { > key?: string, > url?: string > }, > geo?: string, > geo_id?: number, > username?: string > } > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > page?: number, > size?: number, > total_elements?: number, > total_pages?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/tripadvisor/database Tripadvisor local sync: searchable entities, `.search()` filters, and operators. The Tripadvisor plugin syncs data locally. Use `corsair.tripadvisor.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/tripadvisor/overview Search the Tripadvisor Terra catalog, read full location details, photos, reviews, nearby locations, and geo details. Use **Tripadvisor** through Corsair: one client, typed API calls. **What you get:** * 6 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/tripadvisor ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/tripadvisor ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/tripadvisor ``` ```bash bun theme={null} bun add corsair @corsair-dev/tripadvisor ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { tripadvisor } from '@corsair-dev/tripadvisor'; export const corsair = createCorsair({ plugins: [ tripadvisor(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} tripadvisor() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'tripadvisor', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`catalog.locationsNearby`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.tripadvisor.api.catalog.locationsNearby({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/tripadvisor/api) reference.* See the full list on the [API](/plugins/tripadvisor/api) page. ## What's next > **[API reference](/plugins/tripadvisor/api)** > > Every `tripadvisor.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/turso/api API reference for Turso: every `turso.api.*` operation with input and output types. Every `turso.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Changes ### listen `changes.listen` Listen to committed insert/update/delete events for a table in a Turso database **Risk:** `read` ```ts theme={null} await corsair.turso.api.changes.listen({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `databaseUrl` | `string` | Yes | Database-specific URL, e.g. [https://mydb-myorg.turso.io](https://mydb-myorg.turso.io) — NOT the platform API host | | `table` | `string` | Yes | Table to watch for committed changes | | `action` | `insert \| update \| delete` | Yes | Which committed action to stream: insert, update or delete | | `maxEvents` | `number` | Yes | Stop after this many events have been received | | `timeoutMs` | `number` | Yes | Stop listening after this many milliseconds | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > mode: stream, > table: string, > action: insert | update | delete, > events: { > table: string, > action: insert | update | delete, > receivedAt: string, > data?: { > } > }[], > stoppedBy: max_events | timeout | stream_closed > } | { > mode: health_check, > table: string, > action: insert | update | delete, > listenAvailable: false, > reason: string, > databaseReachable: boolean > } > ``` *** ## Regions ### closest `regions.closest` Get the closest Turso region based on client location, to minimize latency **Risk:** `read` ```ts theme={null} await corsair.turso.api.regions.closest({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `server` | `string` | Yes | Location code for the server that answered the request | | `client` | `string` | No | Location code for the requesting client | *** ## Tokens ### validate `tokens.validate` Validate a Turso API token and retrieve its expiration time (-1 when it never expires) **Risk:** `read` ```ts theme={null} await corsair.turso.api.tokens.validate({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `exp` | `number` | Yes | Token expiry in unix epoch seconds, or -1 when the token never expires | *** # Database Source: https://docs.corsair.dev/plugins/turso/database Turso local sync: searchable entities, `.search()` filters, and operators. The Turso plugin syncs data locally. Use `corsair.turso.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Change Events Path: `turso.db.changeEvents.search` ```ts theme={null} const rows = await corsair.turso.db.changeEvents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `databaseUrl` | `string` | equals, contains, startsWith, endsWith, in | | `table` | `string` | equals, contains, startsWith, endsWith, in | | `receivedAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/turso/overview Serverless SQLite databases on libSQL with global replication. Use **Turso** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 3 typed API operations * 1 synced entity (`changeEvents`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/turso ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/turso ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/turso ``` ```bash bun theme={null} bun add corsair @corsair-dev/turso ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { turso } from '@corsair-dev/turso'; export const corsair = createCorsair({ plugins: [ turso(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} turso() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'turso', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Validate the API token** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.turso.api.tokens.validate({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/turso/api) reference.* See the full list on the [API](/plugins/turso/api) page. ## Query synced data Search change events streamed by changes.listen without listening again. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.turso.db.changeEvents.search({ data: { table: 'users' }, limit: 20, }); ``` Synced entities: `changeEvents`. See [Database](/plugins/turso/database) for filters and operators. ## What's next > **[API reference](/plugins/turso/api)** > > Every `turso.api.*` operation with input and output types. > **[Database](/plugins/turso/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/twentyonerisk/api API reference for TwentyOne Risk: every `twentyonerisk.api.*` operation with input and output types. Every `twentyonerisk.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Organizations ### get `organizations.get` Retrieve organizations from the 21RISK OData API with optional filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.twentyonerisk.api.organizations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `$filter` | `string` | No | — | | `$top` | `number` | No | — | | `$skip` | `number` | No | — | | `$select` | `string` | No | — | | `$orderby` | `string` | No | — | | `$count` | `boolean \| true \| false` | No | — | | `$expand` | `string` | No | — | | `$skiptoken` | `string` | No | — | | `maxPageSizeInMb` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `value` | `object[]` | Yes | — | | `@odata.count` | `number` | No | — | | `@odata.nextLink` | `string` | No | — | | `@odata.context` | `string` | No | — | > **value full type** > > ```ts theme={null} > { > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/twentyonerisk/database TwentyOne Risk local sync: searchable entities, `.search()` filters, and operators. The TwentyOne Risk plugin syncs data locally. Use `corsair.twentyonerisk.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/twentyonerisk/overview Risk intelligence platform for compliance screening, fraud detection, and vendor due diligence. Use **TwentyOne Risk** through Corsair: one client, typed API calls. **What you get:** * 1 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/twentyonerisk ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/twentyonerisk ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/twentyonerisk ``` ```bash bun theme={null} bun add corsair @corsair-dev/twentyonerisk ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { twentyonerisk } from '@corsair-dev/twentyonerisk'; export const corsair = createCorsair({ plugins: [ twentyonerisk(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} twentyonerisk() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'twentyonerisk', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`organizations.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.twentyonerisk.api.organizations.get({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/twentyonerisk/api) reference.* See the full list on the [API](/plugins/twentyonerisk/api) page. ## What's next > **[API reference](/plugins/twentyonerisk/api)** > > Every `twentyonerisk.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/twilio/api API reference for Twilio: every `twilio.api.*` operation with input and output types. Every `twilio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Calls ### create `calls.create` Initiate an outbound phone call **Risk:** `write` ```ts theme={null} await corsair.twilio.api.calls.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `To` | `string` | Yes | — | | `From` | `string` | Yes | — | | `Url` | `string` | No | — | | `Twiml` | `string` | No | — | | `StatusCallback` | `string` | No | — | | `StatusCallbackMethod` | `GET \| POST` | No | — | | `StatusCallbackEvent` | `string[]` | No | — | | `Timeout` | `number` | No | — | | `Record` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sid` | `string` | Yes | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | | `account_sid` | `string` | Yes | — | | `to` | `string` | Yes | — | | `to_formatted` | `string` | No | — | | `from` | `string` | Yes | — | | `from_formatted` | `string` | No | — | | `phone_number_sid` | `string` | No | — | | `status` | `string` | Yes | — | | `start_time` | `string` | No | — | | `end_time` | `string` | No | — | | `duration` | `string` | No | — | | `price` | `string` | No | — | | `price_unit` | `string` | No | — | | `direction` | `string` | Yes | — | | `api_version` | `string` | No | — | | `uri` | `string` | Yes | — | | `subresource_uris` | `object` | No | — | > **subresource\_uris full type** > > ```ts theme={null} > { > } > ``` *** ### get `calls.get` Retrieve a call record by SID **Risk:** `read` ```ts theme={null} await corsair.twilio.api.calls.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `callSid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sid` | `string` | Yes | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | | `account_sid` | `string` | Yes | — | | `to` | `string` | Yes | — | | `to_formatted` | `string` | No | — | | `from` | `string` | Yes | — | | `from_formatted` | `string` | No | — | | `phone_number_sid` | `string` | No | — | | `status` | `string` | Yes | — | | `start_time` | `string` | No | — | | `end_time` | `string` | No | — | | `duration` | `string` | No | — | | `price` | `string` | No | — | | `price_unit` | `string` | No | — | | `direction` | `string` | Yes | — | | `api_version` | `string` | No | — | | `uri` | `string` | Yes | — | | `subresource_uris` | `object` | No | — | > **subresource\_uris full type** > > ```ts theme={null} > { > } > ``` *** ### list `calls.list` List call records with optional filters **Risk:** `read` ```ts theme={null} await corsair.twilio.api.calls.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `To` | `string` | No | — | | `From` | `string` | No | — | | `Status` | `string` | No | — | | `StartTime` | `string` | No | — | | `EndTime` | `string` | No | — | | `PageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `calls` | `object[]` | Yes | — | | `first_page_uri` | `string` | No | — | | `next_page_uri` | `string` | No | — | | `previous_page_uri` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `uri` | `string` | No | — | > **calls full type** > > ```ts theme={null} > { > sid: string, > date_created?: string | null, > date_updated?: string | null, > account_sid: string, > to: string, > to_formatted?: string, > from: string, > from_formatted?: string, > phone_number_sid?: string | null, > status: string, > start_time?: string | null, > end_time?: string | null, > duration?: string | null, > price?: string | null, > price_unit?: string | null, > direction: string, > api_version?: string, > uri: string, > subresource_uris?: { > } > }[] > ``` *** ## Messages ### get `messages.get` Retrieve a message by SID **Risk:** `read` ```ts theme={null} await corsair.twilio.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `messageSid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sid` | `string` | Yes | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | | `date_sent` | `string` | No | — | | `account_sid` | `string` | Yes | — | | `to` | `string` | Yes | — | | `from` | `string` | Yes | — | | `body` | `string` | No | — | | `status` | `string` | Yes | — | | `num_segments` | `string` | No | — | | `num_media` | `string` | No | — | | `direction` | `string` | Yes | — | | `api_version` | `string` | No | — | | `price` | `string` | No | — | | `price_unit` | `string` | No | — | | `error_code` | `number` | No | — | | `error_message` | `string` | No | — | | `uri` | `string` | Yes | — | | `subresource_uris` | `object` | No | — | > **subresource\_uris full type** > > ```ts theme={null} > { > } > ``` *** ### list `messages.list` List messages with optional filters **Risk:** `read` ```ts theme={null} await corsair.twilio.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `To` | `string` | No | — | | `From` | `string` | No | — | | `DateSent` | `string` | No | — | | `PageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | — | | `first_page_uri` | `string` | No | — | | `next_page_uri` | `string` | No | — | | `previous_page_uri` | `string` | No | — | | `page` | `number` | No | — | | `page_size` | `number` | No | — | | `uri` | `string` | No | — | > **messages full type** > > ```ts theme={null} > { > sid: string, > date_created?: string | null, > date_updated?: string | null, > date_sent?: string | null, > account_sid: string, > to: string, > from: string, > body?: string | null, > status: string, > num_segments?: string | null, > num_media?: string | null, > direction: string, > api_version?: string, > price?: string | null, > price_unit?: string | null, > error_code?: number | null, > error_message?: string | null, > uri: string, > subresource_uris?: { > } > }[] > ``` *** ### send `messages.send` Send an SMS or MMS message **Risk:** `write` ```ts theme={null} await corsair.twilio.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `To` | `string` | Yes | — | | `From` | `string` | Yes | — | | `Body` | `string` | No | — | | `MediaUrl` | `string[]` | No | — | | `StatusCallback` | `string` | No | — | | `MessagingServiceSid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sid` | `string` | Yes | — | | `date_created` | `string` | No | — | | `date_updated` | `string` | No | — | | `date_sent` | `string` | No | — | | `account_sid` | `string` | Yes | — | | `to` | `string` | Yes | — | | `from` | `string` | Yes | — | | `body` | `string` | No | — | | `status` | `string` | Yes | — | | `num_segments` | `string` | No | — | | `num_media` | `string` | No | — | | `direction` | `string` | Yes | — | | `api_version` | `string` | No | — | | `price` | `string` | No | — | | `price_unit` | `string` | No | — | | `error_code` | `number` | No | — | | `error_message` | `string` | No | — | | `uri` | `string` | Yes | — | | `subresource_uris` | `object` | No | — | > **subresource\_uris full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/twilio/database Twilio local sync: searchable entities, `.search()` filters, and operators. The Twilio plugin syncs data locally. Use `corsair.twilio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Calls Path: `twilio.db.calls.search` ```ts theme={null} const rows = await corsair.twilio.db.calls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `sid` | `string` | equals, contains, startsWith, endsWith, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `direction` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `string` | equals, contains, startsWith, endsWith, in | | `start_time` | `string` | equals, contains, startsWith, endsWith, in | | `end_time` | `string` | equals, contains, startsWith, endsWith, in | | `price` | `string` | equals, contains, startsWith, endsWith, in | | `price_unit` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `twilio.db.messages.search` ```ts theme={null} const rows = await corsair.twilio.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `sid` | `string` | equals, contains, startsWith, endsWith, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `direction` | `string` | equals, contains, startsWith, endsWith, in | | `date_sent` | `string` | equals, contains, startsWith, endsWith, in | | `price` | `string` | equals, contains, startsWith, endsWith, in | | `price_unit` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/twilio/overview Communications API for SMS, voice calls, WhatsApp messaging, and programmable telephony. Use **Twilio** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 6 typed API operations * 2 synced entities (`calls`, `messages`) for fast `.search()` / `.list()` * 3 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/twilio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/twilio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/twilio ``` ```bash bun theme={null} bun add corsair @corsair-dev/twilio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { twilio } from '@corsair-dev/twilio'; export const corsair = createCorsair({ plugins: [ twilio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} twilio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'twilio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List messages** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.twilio.api.messages.list({}); ``` **Send a message** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.twilio.api.messages.send({ To: '+15555550100', From: '+15555550101', Body: 'Hello from Corsair' }); ``` See the full list on the [API](/plugins/twilio/api) page. ## Query synced data Search synced messages without hitting Twilio. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.twilio.db.messages.search({ data: {}, limit: 50, }); ``` Synced entities: `calls`, `messages`. See [Database](/plugins/twilio/database) for filters and operators. ## Webhooks Fires when an inbound SMS arrives. ```ts theme={null} twilio({ webhookHooks: { message: { received: { after: async (ctx, result) => { console.log('Twilio message:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/twilio/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/twilio/api)** > > Every `twilio.api.*` operation with input and output types. > **[Database](/plugins/twilio/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/twilio/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/twilio/webhooks Twilio incoming webhooks: event paths, payloads, and response data. The Twilio plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/twilio/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `call` * `statusUpdate` (`call.statusUpdate`) * `message` * `received` (`message.received`) * `statusUpdate` (`message.statusUpdate`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Call ### Status Update `call.statusUpdate` A call status changed (ringing, in-progress, completed, etc.) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `CallSid` | `string` | Yes | — | | `AccountSid` | `string` | Yes | — | | `From` | `string` | Yes | — | | `To` | `string` | Yes | — | | `CallStatus` | `queued \| ringing \| in-progress \| completed \| busy \| no-answer \| canceled \| failed` | Yes | — | | `Direction` | `string` | No | — | | `Duration` | `string` | No | — | | `CallDuration` | `string` | No | — | | `ApiVersion` | `string` | No | — | | `Timestamp` | `string` | No | — | | `SequenceNumber` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > CallSid: string, > AccountSid: string, > From: string, > To: string, > CallStatus: queued | ringing | in-progress | completed | busy | no-answer | canceled | failed, > Direction?: string, > Duration?: string, > CallDuration?: string, > ApiVersion?: string, > Timestamp?: string, > SequenceNumber?: string > } > ``` **`webhookHooks` example** ```ts theme={null} twilio({ webhookHooks: { call: { statusUpdate: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Message ### Received `message.received` An incoming SMS/MMS message was received **Payload** | Name | Type | Required | Description | | - | - | - | - | | `MessageSid` | `string` | Yes | — | | `SmsSid` | `string` | No | — | | `AccountSid` | `string` | Yes | — | | `MessagingServiceSid` | `string` | No | — | | `From` | `string` | Yes | — | | `To` | `string` | Yes | — | | `Body` | `string` | Yes | — | | `NumMedia` | `string` | Yes | — | | `NumSegments` | `string` | No | — | | `SmsStatus` | `string` | No | — | | `ApiVersion` | `string` | No | — | | `FromCity` | `string` | No | — | | `FromState` | `string` | No | — | | `FromCountry` | `string` | No | — | | `FromZip` | `string` | No | — | | `ToCity` | `string` | No | — | | `ToState` | `string` | No | — | | `ToCountry` | `string` | No | — | | `ToZip` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > MessageSid: string, > SmsSid?: string, > AccountSid: string, > MessagingServiceSid?: string, > From: string, > To: string, > Body: string, > NumMedia: string, > NumSegments?: string, > SmsStatus?: string, > ApiVersion?: string, > FromCity?: string, > FromState?: string, > FromCountry?: string, > FromZip?: string, > ToCity?: string, > ToState?: string, > ToCountry?: string, > ToZip?: string > } > ``` **`webhookHooks` example** ```ts theme={null} twilio({ webhookHooks: { message: { received: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Status Update `message.statusUpdate` A message delivery status changed (sent, delivered, failed, etc.) **Payload** | Name | Type | Required | Description | | - | - | - | - | | `MessageSid` | `string` | Yes | — | | `AccountSid` | `string` | Yes | — | | `From` | `string` | Yes | — | | `To` | `string` | Yes | — | | `MessageStatus` | `accepted \| queued \| sending \| sent \| delivered \| undelivered \| failed \| receiving \| received \| read` | Yes | — | | `ErrorCode` | `string` | No | — | | `ErrorMessage` | `string` | No | — | | `ApiVersion` | `string` | No | — | > **Response data full type** > > ```ts theme={null} > { > MessageSid: string, > AccountSid: string, > From: string, > To: string, > MessageStatus: accepted | queued | sending | sent | delivered | undelivered | failed | receiving | received | read, > ErrorCode?: string, > ErrorMessage?: string, > ApiVersion?: string > } > ``` **`webhookHooks` example** ```ts theme={null} twilio({ webhookHooks: { message: { statusUpdate: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/twitter/api API reference for X (Twitter): every `twitter.api.*` operation with input and output types. Every `twitter.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Tweets ### create `tweets.create` Post a new tweet **Risk:** `write` ```ts theme={null} await corsair.twitter.api.tweets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | Tweet text content (max 280 weighted characters) | | `quoteTweetId` | `string` | No | ID of the tweet to quote | | `mediaIds` | `string[]` | No | Up to 4 media IDs to attach | | `replySettings` | `following \| mentionedUsers \| subscribers` | No | Restricts who can reply to this tweet | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > text: string > } > ``` *** ### createReply `tweets.createReply` Post a reply to an existing tweet **Risk:** `write` ```ts theme={null} await corsair.twitter.api.tweets.createReply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | Reply text content (max 280 weighted characters) | | `inReplyToTweetId` | `string` | Yes | ID of the tweet to reply to | | `excludeReplyUserIds` | `string[]` | No | User IDs to exclude from @mentioning in the reply | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > text: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/twitter/database X (Twitter) local sync: searchable entities, `.search()` filters, and operators. The X (Twitter) plugin syncs data locally. Use `corsair.twitter.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Tweets Path: `twitter.db.tweets.search` ```ts theme={null} const rows = await corsair.twitter.db.tweets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `authorId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `conversationId` | `string` | equals, contains, startsWith, endsWith, in | | `inReplyToUserId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/twitter/get-credentials Step-by-step instructions for obtaining Twitter/X OAuth 2.0 credentials. This guide walks you through obtaining OAuth 2.0 credentials for the Twitter plugin. ## Authentication Method The Twitter plugin uses OAuth 2.0 authentication. * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 user authentication ## OAuth 2.0 Setup ### Step 1: Create a Twitter Developer App 1. Go to [developer.twitter.com](https://developer.twitter.com/en/portal/dashboard) 2. Click **+ Add app** or **Create Project** 3. Fill in the app name and description 4. Select **OAuth 2.0** as the authentication type ### Step 2: Configure OAuth Settings 1. In your app settings, go to **User authentication settings** 2. Enable **OAuth 2.0** 3. Set **App permissions** to **Read and write** 4. Add your **Callback URI** (e.g., `http://localhost:` for CLI flow) 5. Add your **Website URL** 6. Click **Save** ### Step 3: Get Client Credentials 1. Go to **Keys and Tokens** 2. Copy the **OAuth 2.0 Client ID** and **Client Secret** 3. Store these securely **Storing Credentials:** Store your OAuth app credentials, then start the flow: ```bash theme={null} pnpm corsair setup --plugin=twitter client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=twitter ``` The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically. ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth 2.0 | Developer Portal → Keys and Tokens | | Client Secret | OAuth 2.0 | Developer Portal → Keys and Tokens | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/twitter/overview Social media platform for posts, timelines, users, and public conversation data via X API. Use **X (Twitter)** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 2 typed API operations * 1 synced entity (`tweets`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/twitter ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/twitter ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/twitter ``` ```bash bun theme={null} bun add corsair @corsair-dev/twitter ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { twitter } from '@corsair-dev/twitter'; export const corsair = createCorsair({ plugins: [ twitter(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your X (Twitter) OAuth app. Provider walkthrough: [Get Credentials](/plugins/twitter/get-credentials). ```ts theme={null} twitter() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'twitter', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **Read** *No read-style endpoint inferred; pick any operation from the [API](/plugins/twitter/api) reference.* **`tweets.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.twitter.api.tweets.create({}); ``` See the full list on the [API](/plugins/twitter/api) page. ## Query synced data Synced entities support `tenant.twitter.db..search()` and `.list()`: `tweets`. See [Database](/plugins/twitter/database) for filters and operators. ## What's next > **[API reference](/plugins/twitter/api)** > > Every `twitter.api.*` operation with input and output types. > **[Database](/plugins/twitter/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/twitter/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/twitterapiio/api API reference for TwitterAPI.io: every `twitterapiio.api.*` operation with input and output types. Every `twitterapiio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Api ### webhooks.addRule `api.webhooks.addRule` Create a new tweet filter rule for the webhook stream (inactive by default — call updateRule to activate) **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.api.webhooks.addRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag` | `string` | Yes | Custom label to identify this rule | | `value` | `string` | Yes | Filter expression (e.g. "from:elonmusk OR from:kaitoeasyapi"). Rules are inactive until updated with isActive: true. | | `intervalSeconds` | `number` | Yes | How often to check for new tweets matching this rule (seconds, 100–86400) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `string` | No | — | | `status` | `string` | No | — | | `msg` | `string` | No | — | *** ### webhooks.deleteRule `api.webhooks.deleteRule` Permanently delete a tweet filter rule **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.twitterapiio.api.api.webhooks.deleteRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ruleId` | `string` | Yes | ID of the rule to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `msg` | `string` | No | — | *** ### webhooks.getRules `api.webhooks.getRules` List all existing tweet filter rules **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.api.webhooks.getRules({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `rules` | `object[]` | No | — | | `status` | `string` | No | — | | `msg` | `string` | No | — | > **rules full type** > > ```ts theme={null} > { > rule_id: string, > tag: string, > value: string, > interval_seconds: number > }[] > ``` *** ### webhooks.updateRule `api.webhooks.updateRule` Update a tweet filter rule, including activating or deactivating it **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.api.webhooks.updateRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ruleId` | `string` | Yes | ID of the rule to update | | `tag` | `string` | Yes | Custom label | | `value` | `string` | Yes | Filter expression | | `intervalSeconds` | `number` | Yes | Check interval in seconds (100–86400) | | `isActive` | `boolean` | Yes | true to activate the rule, false to deactivate | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rule_id` | `string` | No | — | | `status` | `string` | No | — | | `msg` | `string` | No | — | *** ## Communities ### create `communities.create` Create a new Twitter community **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.communities.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ### delete `communities.delete` Delete a Twitter community **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.twitterapiio.api.communities.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `communityId` | `string` | Yes | — | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ### getById `communities.getById` Get community info by ID **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.communities.getById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `communityId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > memberCount?: number, > role?: string, > createdAt?: string, > isNsfw?: boolean, > adminResults?: any[], > moderatorResults?: any[], > rules?: any[], > primaryTopic?: any > } > ``` *** ### getMembers `communities.getMembers` Get members of a community **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.communities.getMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `communityId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `members` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **members full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### getModerators `communities.getModerators` Get moderators of a community **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.communities.getModerators({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `communityId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `members` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **members full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### getTweets `communities.getTweets` Get tweets posted in a community **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.communities.getTweets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `communityId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ### join `communities.join` Join a Twitter community **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.communities.join({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `communityId` | `string` | Yes | — | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ### leave `communities.leave` Leave a Twitter community **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.communities.leave({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `communityId` | `string` | Yes | — | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ### searchTweets `communities.searchTweets` Search tweets across all communities **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.communities.searchTweets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ## Lists ### getFollowers `lists.getFollowers` Get followers of a Twitter list **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.lists.getFollowers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `users` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **users full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### getMembers `lists.getMembers` Get members of a Twitter list **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.lists.getMembers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `users` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **users full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### getTweets `lists.getTweets` Get tweets from a Twitter list timeline **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.lists.getTweets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ## Replies ### get `replies.get` Get replies to a tweet, paginated by time range — stored independently in the replies table so engagement changes are tracked per reply **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.replies.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | — | | `sinceTime` | `string` | No | Unix timestamp in seconds | | `untilTime` | `string` | No | Unix timestamp in seconds | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `replies` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | | `message` | `string` | No | — | > **replies full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string, > url?: string, > inReplyToUsername?: string | null, > isLimitedReply?: boolean > }[] > ``` *** ### getV2 `replies.getV2` Get replies to a tweet (v2) with sort order control (Relevance, Latest, Likes) — stored independently in the replies table so engagement changes are tracked per reply **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.replies.getV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | — | | `queryType` | `Relevance \| Latest \| Likes` | No | Sort order for replies. Default is Relevance. | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `replies` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | | `message` | `string` | No | — | > **replies full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string, > url?: string, > inReplyToUsername?: string | null, > isLimitedReply?: boolean > }[] > ``` *** ## Stream ### addUser `stream.addUser` Add a Twitter user to the real-time tweet monitor stream **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.stream.addUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | Twitter/X handle to add to the real-time monitor stream | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `success \| error` | No | — | | `msg` | `string` | No | — | *** ### listUsers `stream.listUsers` List all Twitter users currently in the monitor stream **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.stream.listUsers({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `string[]` | No | Monitored Twitter usernames | | `status` | `string` | No | — | | `msg` | `string` | No | — | *** ### removeUser `stream.removeUser` Remove a Twitter user from the real-time tweet monitor stream **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.stream.removeUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | Twitter/X handle to remove from the monitor stream | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `success \| error` | No | — | | `msg` | `string` | No | — | *** ## Trends ### get `trends.get` Get trending topics by location (woeid) **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.trends.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `woeid` | `number` | No | Where On Earth ID. 1 = worldwide | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `trends` | `object[]` | No | — | > **trends full type** > > ```ts theme={null} > { > name: string, > tweetVolume?: number | null, > url?: string, > woeid?: number, > trendingAt?: string > }[] > ``` *** ## Tweets ### advancedSearch `tweets.advancedSearch` Search tweets using structured operators (keywords, users, dates, engagement thresholds, media filters, etc.) **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.tweets.advancedSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keywords` | `string[]` | No | Words that must all appear in tweets (AND logic) | | `exactPhrase` | `string` | No | Exact phrase that must appear in tweets | | `anyOf` | `string[]` | No | At least one of these words must appear (OR logic, minimum 2 items) | | `excludeKeywords` | `string[]` | No | Words that must not appear in tweets | | `hashtags` | `string[]` | No | Hashtags to search for (with or without leading #) | | `fromUsers` | `string[]` | No | Only tweets from these usernames | | `toUsers` | `string[]` | No | Only replies to these usernames | | `mentioningUsers` | `string[]` | No | Only tweets mentioning these usernames | | `language` | `am \| ar \| bg \| bn \| bo \| ca \| cs \| cy \| da \| de \| dv \| el \| en \| es \| et \| eu \| fa \| fi \| fr \| ga \| gl \| gu \| he \| hi \| hr \| hy \| id \| is \| it \| ja \| ka \| km \| kn \| ko \| lo \| lt \| lv \| ml \| mr \| my \| ne \| nl \| no \| or \| pa \| pl \| ps \| pt \| ro \| ru \| si \| sk \| sl \| sq \| sr \| sv \| sw \| ta \| te \| th \| tl \| tr \| ug \| uk \| ur \| vi \| zh` | No | ISO 639-1 language code (e.g. "en", "fr", "ja") | | `since` | `string` | No | Only tweets posted on or after this date (YYYY-MM-DD) | | `until` | `string` | No | Only tweets posted before this date (YYYY-MM-DD) | | `sinceTime` | `number` | No | Only tweets posted on or after this Unix timestamp (seconds) | | `untilTime` | `number` | No | Only tweets posted before this Unix timestamp (seconds) | | `replies` | `only \| exclude` | No | "only" to return only replies; "exclude" to omit replies | | `retweets` | `only \| exclude` | No | "only" to return only retweets; "exclude" to omit retweets | | `onlyLinks` | `boolean` | No | Only tweets containing links | | `onlyMedia` | `boolean` | No | Only tweets with media | | `onlyImages` | `boolean` | No | Only tweets with images | | `onlyVideos` | `boolean` | No | Only tweets with native video | | `minReplies` | `number` | No | Minimum number of replies | | `minLikes` | `number` | No | Minimum number of likes | | `minRetweets` | `number` | No | Minimum number of retweets | | `queryType` | `Latest \| Top` | No | Result ordering — "Latest" (default) or "Top" | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ### create `tweets.create` Post a new tweet or reply **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.tweets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweet` | `string` | Yes | Tweet text content | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | | `replyToTweetId` | `string` | No | Tweet ID to reply to | | `mediaIds` | `string[]` | No | Media IDs to attach | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ### delete `tweets.delete` Delete a tweet **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.twitterapiio.api.tweets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | — | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ### getByIds `tweets.getByIds` Fetch tweets by their IDs **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.tweets.getByIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetIds` | `string` | Yes | Comma-separated list of tweet IDs | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ### getQuotations `tweets.getQuotations` Get quote tweets for a tweet **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.tweets.getQuotations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ### getRetweeters `tweets.getRetweeters` Get users who retweeted a tweet **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.tweets.getRetweeters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `users` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **users full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### getThreadContext `tweets.getThreadContext` Get the full thread context for a tweet **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.tweets.getThreadContext({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ### getUserLastTweets `tweets.getUserLastTweets` Retrieve a user's most recent tweets by username **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.tweets.getUserLastTweets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ### getUserMentions `tweets.getUserMentions` Get tweets that mention a user **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.tweets.getUserMentions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ### getUserTimeline `tweets.getUserTimeline` Retrieve a user's tweet timeline by user ID **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.tweets.getUserTimeline({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ### like `tweets.like` Like a tweet **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.tweets.like({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | — | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ### retweet `tweets.retweet` Retweet a tweet **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.tweets.retweet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | — | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ### search `tweets.search` Search tweets with a raw query string **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.tweets.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `queryType` | `Top \| Latest \| Photos \| Videos` | No | Search type. Defaults to Top | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `tweets` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **tweets full type** > > ```ts theme={null} > { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }[] > ``` *** ### unlike `tweets.unlike` Remove a like from a tweet **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.tweets.unlike({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | — | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ## Users ### batchGetByIds `users.batchGetByIds` Batch fetch user profiles by user IDs **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.users.batchGetByIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userIds` | `string` | Yes | Comma-separated list of user IDs | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `data` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### checkFollowRelationship `users.checkFollowRelationship` Check if two users follow each other **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.users.checkFollowRelationship({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sourceUserName` | `string` | Yes | — | | `targetUserName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `isFollowing` | `boolean` | No | — | | `isFollowedBy` | `boolean` | No | — | *** ### follow `users.follow` Follow a user **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.users.follow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `followId` | `string` | Yes | User ID to follow | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** ### getByUsername `users.getByUsername` Get user profile by username **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.users.getByUsername({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > } > ``` *** ### getFollowers `users.getFollowers` Get a user's followers **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.users.getFollowers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `users` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **users full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### getFollowings `users.getFollowings` Get users that a user is following **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.users.getFollowings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `users` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **users full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### getMe `users.getMe` Get the authenticated account info **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.users.getMe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > } > ``` *** ### getVerifiedFollowers `users.getVerifiedFollowers` Get a user's verified (blue-check) followers **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.users.getVerifiedFollowers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `users` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **users full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### login `users.login` Authenticate a Twitter account via credentials and obtain a login cookie for v2 endpoints **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.users.login({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `userName` | `string` | Yes | Twitter username | | `email` | `string` | Yes | Account email address | | `password` | `string` | Yes | Account password | | `totpSecret` | `string` | No | TOTP secret for 2FA (from the account profile page) | | `proxy` | `string` | Yes | High-quality residential proxy URL (e.g. [http://user:pass@host:port](http://user:pass@host:port)) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `login_cookie` | `string` | No | — | | `status` | `string` | No | — | | `msg` | `string` | No | — | *** ### search `users.search` Search users by keyword **Risk:** `read` ```ts theme={null} await corsair.twitterapiio.api.users.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyword` | `string` | Yes | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `users` | `object[]` | No | — | | `next_cursor` | `string` | No | — | | `has_next_page` | `boolean` | No | — | > **users full type** > > ```ts theme={null} > { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }[] > ``` *** ### unfollow `users.unfollow` Unfollow a user **Risk:** `write` ```ts theme={null} await corsair.twitterapiio.api.users.unfollow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `followId` | `string` | Yes | User ID to unfollow | | `loginCookie` | `string` | Yes | Twitter login cookie from user\_login\_v2 | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `message` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/twitterapiio/database TwitterAPI.io local sync: searchable entities, `.search()` filters, and operators. The TwitterAPI.io plugin syncs data locally. Use `corsair.twitterapiio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Communities Path: `twitterapiio.db.communities.search` ```ts theme={null} const rows = await corsair.twitterapiio.db.communities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `memberCount` | `number` | equals, gt, gte, lt, lte, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `isNsfw` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `twitterapiio.db.lists.search` ```ts theme={null} const rows = await corsair.twitterapiio.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `memberCount` | `number` | equals, gt, gte, lt, lte, in | | `followerCount` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `isPrivate` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Replies Path: `twitterapiio.db.replies.search` ```ts theme={null} const rows = await corsair.twitterapiio.db.replies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `likeCount` | `number` | equals, gt, gte, lt, lte, in | | `retweetCount` | `number` | equals, gt, gte, lt, lte, in | | `replyCount` | `number` | equals, gt, gte, lt, lte, in | | `quoteCount` | `number` | equals, gt, gte, lt, lte, in | | `viewCount` | `number` | equals, gt, gte, lt, lte, in | | `bookmarkCount` | `number` | equals, gt, gte, lt, lte, in | | `lang` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `isRetweet` | `boolean` | equals | | `isQuote` | `boolean` | equals | | `isPinned` | `boolean` | equals | | `inReplyToStatusId` | `string` | equals, contains, startsWith, endsWith, in | | `inReplyToUserId` | `string` | equals, contains, startsWith, endsWith, in | | `quotedTweetId` | `string` | equals, contains, startsWith, endsWith, in | | `conversationId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `inReplyToUsername` | `string` | equals, contains, startsWith, endsWith, in | | `isLimitedReply` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Trends Path: `twitterapiio.db.trends.search` ```ts theme={null} const rows = await corsair.twitterapiio.db.trends.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `tweetVolume` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `woeid` | `number` | equals, gt, gte, lt, lte, in | | `trendingAt` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tweets Path: `twitterapiio.db.tweets.search` ```ts theme={null} const rows = await corsair.twitterapiio.db.tweets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `likeCount` | `number` | equals, gt, gte, lt, lte, in | | `retweetCount` | `number` | equals, gt, gte, lt, lte, in | | `replyCount` | `number` | equals, gt, gte, lt, lte, in | | `quoteCount` | `number` | equals, gt, gte, lt, lte, in | | `viewCount` | `number` | equals, gt, gte, lt, lte, in | | `bookmarkCount` | `number` | equals, gt, gte, lt, lte, in | | `lang` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `isRetweet` | `boolean` | equals | | `isQuote` | `boolean` | equals | | `isPinned` | `boolean` | equals | | `inReplyToStatusId` | `string` | equals, contains, startsWith, endsWith, in | | `inReplyToUserId` | `string` | equals, contains, startsWith, endsWith, in | | `quotedTweetId` | `string` | equals, contains, startsWith, endsWith, in | | `conversationId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `twitterapiio.db.users.search` ```ts theme={null} const rows = await corsair.twitterapiio.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `userName` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `followerCount` | `number` | equals, gt, gte, lt, lte, in | | `followingCount` | `number` | equals, gt, gte, lt, lte, in | | `profilePicture` | `string` | equals, contains, startsWith, endsWith, in | | `coverPicture` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `isBlueVerified` | `boolean` | equals | | `isGovernmentVerified` | `boolean` | equals | | `favouritesCount` | `number` | equals, gt, gte, lt, lte, in | | `statusesCount` | `number` | equals, gt, gte, lt, lte, in | | `mediaCount` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `isProtected` | `boolean` | equals | | `isSuspended` | `boolean` | equals | | `isUnavailable` | `boolean` | equals | | `website` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/twitterapiio/get-credentials Step-by-step instructions for obtaining TwitterAPI.io API keys and webhook secrets for the Corsair TwitterAPI.io plugin. This guide walks you through obtaining all required credentials for the TwitterAPI.io (`twitterapiio`) plugin. ## Authentication Method The TwitterAPI.io plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) — API key for the [twitterapi.io](https://twitterapi.io) service This provider is a third-party Twitter/X data API; it is separate from the official X Developer Platform. ## API Key ### Step 1: Create an Account and Key 1. Sign up or log in at [twitterapi.io](https://twitterapi.io) (or the provider’s current console URL). 2. Open **Dashboard** / **API Keys** / **Credentials**. 3. Generate a new API key and copy it. **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=twitterapiio api_key=your-api-key ``` Verify: ```bash theme={null} pnpm corsair auth --plugin=twitterapiio --credentials ``` ## Webhook Secret If you enable webhooks from TwitterAPI.io to your application, configure the signing secret the service provides for verifying requests (for example headers such as `x-twitterapiio-signature`). **Storing credentials:** ```bash theme={null} pnpm corsair setup --plugin=twitterapiio webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | API key | [`api_key`](/concepts/api-key) auth | TwitterAPI.io dashboard | | Webhook secret | Webhooks (if used) | Webhook / subscription settings | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/twitterapiio/overview Third-party X/Twitter data API for tweets, users, search, and social media analytics. Use **TwitterAPI.io** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 47 typed API operations * 6 synced entities (`communities`, `lists`, `replies`, `trends`, `tweets`, `users`) for fast `.search()` / `.list()` * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/twitterapiio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/twitterapiio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/twitterapiio ``` ```bash bun theme={null} bun add corsair @corsair-dev/twitterapiio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { twitterapiio } from '@corsair-dev/twitterapiio'; export const corsair = createCorsair({ plugins: [ twitterapiio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/twitterapiio/get-credentials). ```ts theme={null} twitterapiio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'twitterapiio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`api.webhooks.getRules`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.twitterapiio.api.api.webhooks.getRules({}); ``` **`api.webhooks.addRule`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.twitterapiio.api.api.webhooks.addRule({}); ``` See the full list on the [API](/plugins/twitterapiio/api) page. ## Query synced data Synced entities support `tenant.twitterapiio.db..search()` and `.list()`: `communities`, `lists`, `replies`, `trends`, `tweets`, `users`. See [Database](/plugins/twitterapiio/database) for filters and operators. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/twitterapiio/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/twitterapiio/api)** > > Every `twitterapiio.api.*` operation with input and output types. > **[Database](/plugins/twitterapiio/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/twitterapiio/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/twitterapiio/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/twitterapiio/webhooks TwitterAPI.io incoming webhooks: event paths, payloads, and response data. The TwitterAPI.io plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/twitterapiio/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `tweets` * `created` (`tweets.created`) * `filterMatch` (`tweets.filterMatch`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Tweets ### Created `tweets.created` A monitored user posted a new tweet **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `tweet.created` | Yes | — | | `data` | `object` | Yes | — | | `timestamp` | `string` | No | — | | `userId` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > tweet: { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }, > user?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: tweet.created, > data: { > tweet: { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }, > user?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > } > }, > timestamp?: string, > userId?: string > } > ``` **`webhookHooks` example** ```ts theme={null} twitterapiio({ webhookHooks: { tweets: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Filter Match `tweets.filterMatch` A tweet matched a configured filter rule **Payload** | Name | Type | Required | Description | | - | - | - | - | | `type` | `tweet.filter_match` | Yes | — | | `data` | `object` | Yes | — | | `timestamp` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > tweet: { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }, > user?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > matchedRules?: { > id?: string, > tag?: string, > value?: string > }[] > } > ``` > **Response data full type** > > ```ts theme={null} > { > type: tweet.filter_match, > data: { > tweet: { > id: string, > text: string, > author?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > createdAt?: string, > likeCount?: number, > retweetCount?: number, > replyCount?: number, > quoteCount?: number, > viewCount?: number | null, > bookmarkCount?: number, > lang?: string, > source?: string, > isRetweet?: boolean, > isQuote?: boolean, > isPinned?: boolean, > inReplyToStatusId?: string | null, > inReplyToUserId?: string | null, > quotedTweetId?: string | null, > media?: { > type?: string, > url?: string, > mediaUrlHttps?: string, > expandedUrl?: string, > width?: number, > height?: number, > altText?: string | null, > durationMs?: number | null > }[], > entities?: { > urls?: { > url?: string, > expandedUrl?: string, > displayUrl?: string > }[], > hashtags?: { > text?: string > }[], > userMentions?: { > id?: string, > name?: string, > screenName?: string > }[] > }, > conversationId?: string > }, > user?: { > id: string, > userName: string, > name: string, > followerCount?: number, > followingCount?: number, > profilePicture?: string | null, > coverPicture?: string | null, > description?: string | null, > location?: string | null, > isBlueVerified?: boolean, > isGovernmentVerified?: boolean, > favouritesCount?: number, > statusesCount?: number, > mediaCount?: number, > createdAt?: string, > isProtected?: boolean, > isSuspended?: boolean, > isUnavailable?: boolean, > pinnedTweetIds?: string[], > website?: string | null > }, > matchedRules?: { > id?: string, > tag?: string, > value?: string > }[] > }, > timestamp?: string > } > ``` **`webhookHooks` example** ```ts theme={null} twitterapiio({ webhookHooks: { tweets: { filterMatch: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/twochat/api API reference for TwoChat: every `twochat.api.*` operation with input and output types. Every `twochat.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getApiUsageInfo `account.getApiUsageInfo` Retrieve current API usage and account information. Use when you need to monitor your remaining quotas before sending more requests. **Risk:** `read` ```ts theme={null} await corsair.twochat.api.account.getApiUsageInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `account` | `object` | No | — | | `limits` | `object` | No | — | | `usage` | `object` | No | — | > **account full type** > > ```ts theme={null} > { > name?: string, > uuid?: string, > on_trial?: boolean, > blocked?: boolean, > created_at?: string, > expires_at?: string > } > ``` > **limits full type** > > ```ts theme={null} > { > requests_per_minute?: number > } > ``` > **usage full type** > > ```ts theme={null} > { > api_request_count?: number, > max_api_request_count?: number, > number_check_count?: number, > max_number_check_count?: number > } > ``` *** ### testApiKey `account.testApiKey` Validate your API key and retrieve account info. Use when confirming credentials before performing other operations. **Risk:** `read` ```ts theme={null} await corsair.twochat.api.account.testApiKey({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `account` | `object` | No | — | | `limits` | `object` | No | — | | `usage` | `object` | No | — | > **account full type** > > ```ts theme={null} > { > name?: string, > uuid?: string, > on_trial?: boolean, > blocked?: boolean, > created_at?: string, > expires_at?: string > } > ``` > **limits full type** > > ```ts theme={null} > { > requests_per_minute?: number > } > ``` > **usage full type** > > ```ts theme={null} > { > api_request_count?: number, > max_api_request_count?: number, > number_check_count?: number, > max_number_check_count?: number > } > ``` *** ## Contacts ### createContact `contacts.createContact` Create a new contact in your 2Chat account. Use after gathering and verifying first name and at least one contact detail (email, phone, or address). **Risk:** `write` ```ts theme={null} await corsair.twochat.api.contacts.createContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first_name` | `string` | Yes | First name of the new contact | | `last_name` | `string` | No | Last name of the new contact | | `profile_pic_url` | `string` | No | Publicly accessible URL to the contact profile picture | | `channel_uuid` | `string` | No | UUID of a WhatsApp channel — if provided the contact is also created on that WhatsApp account | | `contact_details` | `object[]` | Yes | At least one contact detail (email, phone, or address). Required. | > **contact\_details full type** > > ```ts theme={null} > { > type: E | A | PH | WAPH, > value: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `contact` | `object` | Yes | — | > **contact full type** > > ```ts theme={null} > { > uuid: string, > first_name: string, > last_name?: string, > name?: string, > channel_uuid?: string | null, > profile_pic_url?: string | null, > details?: { > type: E | A | PH | WAPH, > value: string, > id?: number, > created_at?: string | number, > updated_at?: string | number > }[], > contact_details?: { > type: E | A | PH | WAPH, > value: string, > id?: number, > created_at?: string | number, > updated_at?: string | number > }[], > last_updated?: string, > created_at?: string > } > ``` *** ### listContacts `contacts.listContacts` List all contacts in your 2Chat account. Use when you need to retrieve your contact list after confirming your account connection. **Risk:** `read` ```ts theme={null} await corsair.twochat.api.contacts.listContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_number` | `number` | Yes | Zero-based page number for pagination | | `results_per_page` | `number` | Yes | Number of contacts per page (1–100) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `page` | `number` | Yes | — | | `count` | `number` | Yes | — | | `contacts` | `object[]` | Yes | — | > **contacts full type** > > ```ts theme={null} > { > uuid: string, > first_name: string, > last_name?: string, > name?: string, > channel_uuid?: string | null, > profile_pic_url?: string | null, > details?: { > type: E | A | PH | WAPH, > value: string, > id?: number, > created_at?: string | number, > updated_at?: string | number > }[], > contact_details?: { > type: E | A | PH | WAPH, > value: string, > id?: number, > created_at?: string | number, > updated_at?: string | number > }[], > last_updated?: string, > created_at?: string > }[] > ``` *** ## Webhook Subscriptions ### listWebhooks `webhookSubscriptions.listWebhooks` List all configured webhook subscriptions for WhatsApp and phone call events. Returns details including webhook UUID, event type, channel UUID, callback URL, and creation timestamp. **Risk:** `read` ```ts theme={null} await corsair.twochat.api.webhookSubscriptions.listWebhooks({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `webhooks` | `object[]` | Yes | — | > **webhooks full type** > > ```ts theme={null} > { > uuid: string, > event_name: string, > channel_uuid?: string, > hook_url: string, > hook_params?: { > }, > created_at?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/twochat/database TwoChat local sync: searchable entities, `.search()` filters, and operators. The TwoChat plugin syncs data locally. Use `corsair.twochat.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `twochat.db.accounts.search` ```ts theme={null} const rows = await corsair.twochat.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `on_trial` | `boolean` | equals | | `blocked` | `boolean` | equals | | `requests_per_minute` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `twochat.db.contacts.search` ```ts theme={null} const rows = await corsair.twochat.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `first_name` | `string` | equals, contains, startsWith, endsWith, in | | `last_name` | `string` | equals, contains, startsWith, endsWith, in | | `profile_pic_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhook Subscriptions Path: `twochat.db.webhookSubscriptions.search` ```ts theme={null} const rows = await corsair.twochat.db.webhookSubscriptions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `event_name` | `string` | equals, contains, startsWith, endsWith, in | | `channel_uuid` | `string` | equals, contains, startsWith, endsWith, in | | `hook_url` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/twochat/overview WhatsApp Business API platform for messaging automation and customer chat workflows. Use **TwoChat** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 3 synced entities (`accounts`, `contacts`, `webhookSubscriptions`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/twochat ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/twochat ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/twochat ``` ```bash bun theme={null} bun add corsair @corsair-dev/twochat ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { twochat } from '@corsair-dev/twochat'; export const corsair = createCorsair({ plugins: [ twochat(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} twochat() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'twochat', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getApiUsageInfo`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.twochat.api.account.getApiUsageInfo({}); ``` **`contacts.createContact`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.twochat.api.contacts.createContact({}); ``` See the full list on the [API](/plugins/twochat/api) page. ## Query synced data Synced entities support `tenant.twochat.db..search()` and `.list()`: `accounts`, `contacts`, `webhookSubscriptions`. See [Database](/plugins/twochat/database) for filters and operators. ## What's next > **[API reference](/plugins/twochat/api)** > > Every `twochat.api.*` operation with input and output types. > **[Database](/plugins/twochat/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/typeform/api API reference for Typeform: every `typeform.api.*` operation with input and output types. Every `typeform.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Forms ### create `forms.create` Create a new form **Risk:** `write` ```ts theme={null} await corsair.typeform.api.forms.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | — | | `type` | `string` | No | — | | `fields` | `object[]` | No | — | | `logic` | `object[]` | No | — | | `theme` | `object` | No | — | | `settings` | `object` | No | — | | `workspace` | `object` | No | — | | `welcome_screens` | `object[]` | No | — | | `thankyou_screens` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > id?: string, > ref?: string, > type?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > fields?: any[], > choices?: any[], > randomize?: boolean, > hide_marks?: boolean, > button_text?: string, > description?: string, > allow_other_choice?: boolean, > alphabetical_order?: boolean, > vertical_alignment?: boolean, > allow_multiple_selection?: boolean > }, > validations?: { > required?: boolean, > max_value?: number, > min_value?: number, > max_length?: number, > min_length?: number > } > }[] > ``` > **logic full type** > > ```ts theme={null} > { > ref?: string, > type?: string, > actions?: any[] > }[] > ``` > **theme full type** > > ```ts theme={null} > { > href: string > } > ``` > **settings full type** > > ```ts theme={null} > { > is_trial?: boolean, > language?: string, > is_public?: boolean, > progress_bar?: string, > facebook_pixel?: string, > hide_navigation?: boolean, > google_analytics?: string, > autosave_progress?: boolean, > show_progress_bar?: boolean, > are_uploads_public?: boolean, > google_tag_manager?: string, > show_cookie_consent?: boolean, > free_form_navigation?: boolean, > show_question_number?: boolean, > pro_subdomain_enabled?: boolean, > show_time_to_complete?: boolean, > show_typeform_branding?: boolean, > show_key_hint_on_choices?: boolean, > redirect_after_submit_url?: string, > show_number_of_submissions?: boolean, > capabilities?: { > }, > notifications?: { > } > } > ``` > **workspace full type** > > ```ts theme={null} > { > href: string > } > ``` > **welcome\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > show_button?: boolean, > description?: string > } > }[] > ``` > **thankyou\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > button_mode?: string, > redirect_url?: string, > show_button?: boolean, > description?: string, > share_icons?: boolean > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | | `type` | `string` | No | — | | `created_at` | `string` | No | — | | `last_updated_at` | `string` | No | — | | `fields` | `object[]` | No | — | | `logic` | `object[]` | No | — | | `theme` | `object` | No | — | | `hidden` | `string[]` | No | — | | `settings` | `object` | No | — | | `variables` | `object` | No | — | | `workspace` | `object` | No | — | | `welcome_screens` | `object[]` | No | — | | `thankyou_screens` | `object[]` | No | — | | `_links` | `object` | No | — | | `cui_settings` | `object` | No | — | | `captcha` | `object` | No | — | | `meta` | `object` | No | — | | `links` | `object` | No | — | | `language` | `string` | No | — | | `duplicate_prevention` | `boolean` | No | — | > **fields full type** > > ```ts theme={null} > { > id?: string, > ref?: string, > type?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > fields?: any[], > choices?: any[], > randomize?: boolean, > hide_marks?: boolean, > button_text?: string, > description?: string, > allow_other_choice?: boolean, > alphabetical_order?: boolean, > vertical_alignment?: boolean, > allow_multiple_selection?: boolean > }, > validations?: { > required?: boolean, > max_value?: number, > min_value?: number, > max_length?: number, > min_length?: number > } > }[] > ``` > **logic full type** > > ```ts theme={null} > { > ref?: string, > type?: string, > actions?: any[] > }[] > ``` > **theme full type** > > ```ts theme={null} > { > href?: string > } > ``` > **settings full type** > > ```ts theme={null} > { > is_trial?: boolean, > language?: string, > is_public?: boolean, > progress_bar?: string, > facebook_pixel?: string, > hide_navigation?: boolean, > google_analytics?: string, > autosave_progress?: boolean, > show_progress_bar?: boolean, > are_uploads_public?: boolean, > google_tag_manager?: string, > show_cookie_consent?: boolean, > free_form_navigation?: boolean, > show_question_number?: boolean, > pro_subdomain_enabled?: boolean, > show_time_to_complete?: boolean, > show_typeform_branding?: boolean, > show_key_hint_on_choices?: boolean, > redirect_after_submit_url?: string, > show_number_of_submissions?: boolean, > capabilities?: { > }, > notifications?: { > } > } > ``` > **variables full type** > > ```ts theme={null} > { > } > ``` > **workspace full type** > > ```ts theme={null} > { > href?: string > } > ``` > **welcome\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > show_button?: boolean, > description?: string > } > }[] > ``` > **thankyou\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > button_mode?: string, > redirect_url?: string, > show_button?: boolean, > description?: string, > share_icons?: boolean > } > }[] > ``` > **\_links full type** > > ```ts theme={null} > { > } > ``` > **cui\_settings full type** > > ```ts theme={null} > { > } > ``` > **captcha full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` > **links full type** > > ```ts theme={null} > { > } > ``` *** ### delete `forms.delete` Permanently delete a form **Risk:** `destructive` ```ts theme={null} await corsair.typeform.api.forms.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | **Output:** `any` *** ### get `forms.get` Get a form by ID **Risk:** `read` ```ts theme={null} await corsair.typeform.api.forms.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | | `type` | `string` | No | — | | `created_at` | `string` | No | — | | `last_updated_at` | `string` | No | — | | `fields` | `object[]` | No | — | | `logic` | `object[]` | No | — | | `theme` | `object` | No | — | | `hidden` | `string[]` | No | — | | `settings` | `object` | No | — | | `variables` | `object` | No | — | | `workspace` | `object` | No | — | | `welcome_screens` | `object[]` | No | — | | `thankyou_screens` | `object[]` | No | — | | `_links` | `object` | No | — | | `cui_settings` | `object` | No | — | | `captcha` | `object` | No | — | | `meta` | `object` | No | — | | `links` | `object` | No | — | | `language` | `string` | No | — | | `duplicate_prevention` | `boolean` | No | — | > **fields full type** > > ```ts theme={null} > { > id?: string, > ref?: string, > type?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > fields?: any[], > choices?: any[], > randomize?: boolean, > hide_marks?: boolean, > button_text?: string, > description?: string, > allow_other_choice?: boolean, > alphabetical_order?: boolean, > vertical_alignment?: boolean, > allow_multiple_selection?: boolean > }, > validations?: { > required?: boolean, > max_value?: number, > min_value?: number, > max_length?: number, > min_length?: number > } > }[] > ``` > **logic full type** > > ```ts theme={null} > { > ref?: string, > type?: string, > actions?: any[] > }[] > ``` > **theme full type** > > ```ts theme={null} > { > href?: string > } > ``` > **settings full type** > > ```ts theme={null} > { > is_trial?: boolean, > language?: string, > is_public?: boolean, > progress_bar?: string, > facebook_pixel?: string, > hide_navigation?: boolean, > google_analytics?: string, > autosave_progress?: boolean, > show_progress_bar?: boolean, > are_uploads_public?: boolean, > google_tag_manager?: string, > show_cookie_consent?: boolean, > free_form_navigation?: boolean, > show_question_number?: boolean, > pro_subdomain_enabled?: boolean, > show_time_to_complete?: boolean, > show_typeform_branding?: boolean, > show_key_hint_on_choices?: boolean, > redirect_after_submit_url?: string, > show_number_of_submissions?: boolean, > capabilities?: { > }, > notifications?: { > } > } > ``` > **variables full type** > > ```ts theme={null} > { > } > ``` > **workspace full type** > > ```ts theme={null} > { > href?: string > } > ``` > **welcome\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > show_button?: boolean, > description?: string > } > }[] > ``` > **thankyou\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > button_mode?: string, > redirect_url?: string, > show_button?: boolean, > description?: string, > share_icons?: boolean > } > }[] > ``` > **\_links full type** > > ```ts theme={null} > { > } > ``` > **cui\_settings full type** > > ```ts theme={null} > { > } > ``` > **captcha full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` > **links full type** > > ```ts theme={null} > { > } > ``` *** ### getMessages `forms.getMessages` Get custom messages for a form **Risk:** `read` ```ts theme={null} await corsair.typeform.api.forms.getMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `block` | `string` | No | — | | `label` | `string` | No | — | *** ### list `forms.list` List all forms in the account **Risk:** `read` ```ts theme={null} await corsair.typeform.api.forms.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `search` | `string` | No | — | | `sort_by` | `created_at \| last_updated_at` | No | — | | `order_by` | `asc \| desc` | No | — | | `page_size` | `number` | No | — | | `workspace_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `page_count` | `number` | No | — | | `total_items` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > title?: string, > created_at?: string, > last_updated_at?: string, > settings?: { > is_public?: boolean > }, > theme?: { > href?: string > }, > _links?: { > } > }[] > ``` *** ### patch `forms.patch` Partially update a form using JSON Patch operations **Risk:** `write` ```ts theme={null} await corsair.typeform.api.forms.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > op: add | remove | replace | move | copy | test, > path: string, > value?: any, > from?: string > }[] > ``` **Output:** `any` *** ### update `forms.update` Replace a form with a new version (PUT) **Risk:** `write` ```ts theme={null} await corsair.typeform.api.forms.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | | `title` | `string` | No | — | | `type` | `string` | No | — | | `fields` | `object[]` | No | — | | `logic` | `object[]` | No | — | | `theme` | `object` | No | — | | `hidden` | `string[]` | No | — | | `settings` | `object` | No | — | | `variables` | `object` | No | — | | `workspace` | `object` | No | — | | `welcome_screens` | `object[]` | No | — | | `thankyou_screens` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > id?: string, > ref?: string, > type?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > fields?: any[], > choices?: any[], > randomize?: boolean, > hide_marks?: boolean, > button_text?: string, > description?: string, > allow_other_choice?: boolean, > alphabetical_order?: boolean, > vertical_alignment?: boolean, > allow_multiple_selection?: boolean > }, > validations?: { > required?: boolean, > max_value?: number, > min_value?: number, > max_length?: number, > min_length?: number > } > }[] > ``` > **logic full type** > > ```ts theme={null} > { > ref?: string, > type?: string, > actions?: any[] > }[] > ``` > **theme full type** > > ```ts theme={null} > { > href: string > } > ``` > **settings full type** > > ```ts theme={null} > { > is_trial?: boolean, > language?: string, > is_public?: boolean, > progress_bar?: string, > facebook_pixel?: string, > hide_navigation?: boolean, > google_analytics?: string, > autosave_progress?: boolean, > show_progress_bar?: boolean, > are_uploads_public?: boolean, > google_tag_manager?: string, > show_cookie_consent?: boolean, > free_form_navigation?: boolean, > show_question_number?: boolean, > pro_subdomain_enabled?: boolean, > show_time_to_complete?: boolean, > show_typeform_branding?: boolean, > show_key_hint_on_choices?: boolean, > redirect_after_submit_url?: string, > show_number_of_submissions?: boolean, > capabilities?: { > }, > notifications?: { > } > } > ``` > **variables full type** > > ```ts theme={null} > { > } > ``` > **workspace full type** > > ```ts theme={null} > { > href: string > } > ``` > **welcome\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > show_button?: boolean, > description?: string > } > }[] > ``` > **thankyou\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > button_mode?: string, > redirect_url?: string, > show_button?: boolean, > description?: string, > share_icons?: boolean > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `title` | `string` | No | — | | `type` | `string` | No | — | | `created_at` | `string` | No | — | | `last_updated_at` | `string` | No | — | | `fields` | `object[]` | No | — | | `logic` | `object[]` | No | — | | `theme` | `object` | No | — | | `hidden` | `string[]` | No | — | | `settings` | `object` | No | — | | `variables` | `object` | No | — | | `workspace` | `object` | No | — | | `welcome_screens` | `object[]` | No | — | | `thankyou_screens` | `object[]` | No | — | | `_links` | `object` | No | — | | `cui_settings` | `object` | No | — | | `captcha` | `object` | No | — | | `meta` | `object` | No | — | | `links` | `object` | No | — | | `language` | `string` | No | — | | `duplicate_prevention` | `boolean` | No | — | > **fields full type** > > ```ts theme={null} > { > id?: string, > ref?: string, > type?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > fields?: any[], > choices?: any[], > randomize?: boolean, > hide_marks?: boolean, > button_text?: string, > description?: string, > allow_other_choice?: boolean, > alphabetical_order?: boolean, > vertical_alignment?: boolean, > allow_multiple_selection?: boolean > }, > validations?: { > required?: boolean, > max_value?: number, > min_value?: number, > max_length?: number, > min_length?: number > } > }[] > ``` > **logic full type** > > ```ts theme={null} > { > ref?: string, > type?: string, > actions?: any[] > }[] > ``` > **theme full type** > > ```ts theme={null} > { > href?: string > } > ``` > **settings full type** > > ```ts theme={null} > { > is_trial?: boolean, > language?: string, > is_public?: boolean, > progress_bar?: string, > facebook_pixel?: string, > hide_navigation?: boolean, > google_analytics?: string, > autosave_progress?: boolean, > show_progress_bar?: boolean, > are_uploads_public?: boolean, > google_tag_manager?: string, > show_cookie_consent?: boolean, > free_form_navigation?: boolean, > show_question_number?: boolean, > pro_subdomain_enabled?: boolean, > show_time_to_complete?: boolean, > show_typeform_branding?: boolean, > show_key_hint_on_choices?: boolean, > redirect_after_submit_url?: string, > show_number_of_submissions?: boolean, > capabilities?: { > }, > notifications?: { > } > } > ``` > **variables full type** > > ```ts theme={null} > { > } > ``` > **workspace full type** > > ```ts theme={null} > { > href?: string > } > ``` > **welcome\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > show_button?: boolean, > description?: string > } > }[] > ``` > **thankyou\_screens full type** > > ```ts theme={null} > { > ref?: string, > title?: string, > attachment?: { > href?: string, > type?: string, > scale?: number, > properties?: { > } > }, > properties?: { > button_text?: string, > button_mode?: string, > redirect_url?: string, > show_button?: boolean, > description?: string, > share_icons?: boolean > } > }[] > ``` > **\_links full type** > > ```ts theme={null} > { > } > ``` > **cui\_settings full type** > > ```ts theme={null} > { > } > ``` > **captcha full type** > > ```ts theme={null} > { > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` > **links full type** > > ```ts theme={null} > { > } > ``` *** ### updateMessages `forms.updateMessages` Update custom messages for a form **Risk:** `write` ```ts theme={null} await corsair.typeform.api.forms.updateMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | | `label_button_submit` | `string` | No | — | | `label_error_required` | `string` | No | — | | `label_buttonHint_default` | `string` | No | — | | `block_shortText_placeholder` | `string` | No | — | | `label_buttonNoAnswer_default` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `message` | `string` | No | — | | `success` | `boolean` | No | — | *** ## Images ### create `images.create` Upload a new image **Risk:** `write` ```ts theme={null} await corsair.typeform.api.images.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_name` | `string` | Yes | — | | `url` | `string` | No | — | | `image` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `src` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `avg_color` | `string` | No | — | | `file_name` | `string` | No | — | | `has_alpha` | `boolean` | No | — | | `media_type` | `string` | No | — | *** ### delete `images.delete` Permanently delete an image **Risk:** `destructive` ```ts theme={null} await corsair.typeform.api.images.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image_id` | `string` | Yes | — | **Output:** `any` *** ### getBackgroundBySize `images.getBackgroundBySize` Get a background image at a specific size **Risk:** `read` ```ts theme={null} await corsair.typeform.api.images.getBackgroundBySize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image_id` | `string` | Yes | — | | `size` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `src` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `avg_color` | `string` | No | — | | `file_name` | `string` | No | — | | `has_alpha` | `boolean` | No | — | | `media_type` | `string` | No | — | *** ### getBySize `images.getBySize` Get an image at a specific size **Risk:** `read` ```ts theme={null} await corsair.typeform.api.images.getBySize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image_id` | `string` | Yes | — | | `size` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `src` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `avg_color` | `string` | No | — | | `file_name` | `string` | No | — | | `has_alpha` | `boolean` | No | — | | `media_type` | `string` | No | — | *** ### getChoiceImageBySize `images.getChoiceImageBySize` Get a choice image at a specific size **Risk:** `read` ```ts theme={null} await corsair.typeform.api.images.getChoiceImageBySize({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `image_id` | `string` | Yes | — | | `size` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `src` | `string` | No | — | | `width` | `number` | No | — | | `height` | `number` | No | — | | `avg_color` | `string` | No | — | | `file_name` | `string` | No | — | | `has_alpha` | `boolean` | No | — | | `media_type` | `string` | No | — | *** ### list `images.list` List all images in the account **Risk:** `read` ```ts theme={null} await corsair.typeform.api.images.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > src?: string, > width?: number, > height?: number, > avg_color?: string, > file_name?: string, > has_alpha?: boolean, > media_type?: string > }[] > ``` *** ## Me ### get `me.get` Get information about the authenticated Typeform account **Risk:** `read` ```ts theme={null} await corsair.typeform.api.me.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `owner_info` | `object` | No | — | > **owner\_info full type** > > ```ts theme={null} > { > } > ``` *** ## Responses ### delete `responses.delete` Delete specific responses from a form **Risk:** `destructive` ```ts theme={null} await corsair.typeform.api.responses.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | | `included_response_ids` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `description` | `string` | No | — | *** ### getAllFiles `responses.getAllFiles` Get a ZIP archive of all files uploaded in responses **Risk:** `read` ```ts theme={null} await corsair.typeform.api.responses.getAllFiles({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | **Output:** `any` *** ### list `responses.list` List responses submitted to a form **Risk:** `read` ```ts theme={null} await corsair.typeform.api.responses.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | | `sort` | `string` | No | — | | `after` | `string` | No | — | | `query` | `string` | No | — | | `since` | `string` | No | — | | `until` | `string` | No | — | | `before` | `string` | No | — | | `fields` | `string[]` | No | — | | `page_size` | `number` | No | — | | `response_type` | `string[]` | No | — | | `answered_fields` | `string[]` | No | — | | `excluded_response_ids` | `string` | No | — | | `included_response_ids` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `page_count` | `number` | No | — | | `total_items` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > token?: string, > response_id?: string, > submitted_at?: string, > landed_at?: string, > answers?: { > type?: string, > text?: string, > email?: string, > url?: string, > date?: string, > number?: number, > boolean?: boolean, > phone_number?: string, > file_url?: string, > choice?: { > id?: string, > ref?: string, > label?: string, > other?: string > }, > choices?: { > ids?: string[], > refs?: string[], > labels?: string[], > other?: string > }, > field?: { > id?: string, > ref?: string, > type?: string > }, > payment?: { > }, > multi_format?: { > } > }[], > calculated?: { > score?: number > }, > metadata?: { > browser?: string, > referer?: string, > platform?: string, > network_id?: string, > user_agent?: string > }, > hidden?: { > }, > variables?: { > key?: string, > type?: string, > text?: string, > number?: number > }[] > }[] > ``` *** ## Themes ### create `themes.create` Create a new theme **Risk:** `write` ```ts theme={null} await corsair.typeform.api.themes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `font` | `string` | Yes | — | | `colors` | `object` | Yes | — | | `fields` | `object` | Yes | — | | `name` | `string` | No | — | | `background` | `object` | No | — | | `rounded_corners` | `string` | No | — | | `has_transparent_button` | `boolean` | No | — | > **colors full type** > > ```ts theme={null} > { > answer?: string, > button?: string, > question?: string, > background?: string > } > ``` > **fields full type** > > ```ts theme={null} > { > alignment?: left | center, > font_size?: small | medium | large > } > ``` > **background full type** > > ```ts theme={null} > { > href?: string, > layout?: fullscreen | repeat | no-repeat, > brightness?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `font` | `string` | No | — | | `visibility` | `string` | No | — | | `rounded_corners` | `string` | No | — | | `has_transparent_button` | `boolean` | No | — | | `colors` | `object` | No | — | | `background` | `object` | No | — | | `fields` | `object` | No | — | | `screens` | `object` | No | — | > **colors full type** > > ```ts theme={null} > { > answer?: string, > button?: string, > question?: string, > background?: string > } > ``` > **background full type** > > ```ts theme={null} > { > href?: string, > layout?: fullscreen | repeat | no-repeat, > brightness?: number > } > ``` > **fields full type** > > ```ts theme={null} > { > alignment?: left | center, > font_size?: small | medium | large > } > ``` > **screens full type** > > ```ts theme={null} > { > } > ``` *** ### delete `themes.delete` Permanently delete a theme **Risk:** `destructive` ```ts theme={null} await corsair.typeform.api.themes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `theme_id` | `string` | Yes | — | **Output:** `any` *** ### get `themes.get` Get a theme by ID **Risk:** `read` ```ts theme={null} await corsair.typeform.api.themes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `theme_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `font` | `string` | No | — | | `visibility` | `string` | No | — | | `rounded_corners` | `string` | No | — | | `has_transparent_button` | `boolean` | No | — | | `colors` | `object` | No | — | | `background` | `object` | No | — | | `fields` | `object` | No | — | | `screens` | `object` | No | — | > **colors full type** > > ```ts theme={null} > { > answer?: string, > button?: string, > question?: string, > background?: string > } > ``` > **background full type** > > ```ts theme={null} > { > href?: string, > layout?: fullscreen | repeat | no-repeat, > brightness?: number > } > ``` > **fields full type** > > ```ts theme={null} > { > alignment?: left | center, > font_size?: small | medium | large > } > ``` > **screens full type** > > ```ts theme={null} > { > } > ``` *** ### list `themes.list` List all themes **Risk:** `read` ```ts theme={null} await corsair.typeform.api.themes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | No | — | | `page_count` | `number` | No | — | | `total_items` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > name?: string, > font?: string, > visibility?: string, > rounded_corners?: string, > has_transparent_button?: boolean, > colors?: { > answer?: string, > button?: string, > question?: string, > background?: string > }, > background?: { > href?: string, > layout?: fullscreen | repeat | no-repeat, > brightness?: number > }, > fields?: { > alignment?: left | center, > font_size?: small | medium | large > }, > screens?: { > } > }[] > ``` *** ### patch `themes.patch` Partially update a theme **Risk:** `write` ```ts theme={null} await corsair.typeform.api.themes.patch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `theme_id` | `string` | Yes | — | | `font` | `string` | No | — | | `name` | `string` | No | — | | `colors` | `object` | No | — | | `fields` | `object` | No | — | | `screens` | `object` | No | — | | `background` | `object` | No | — | | `rounded_corners` | `string` | No | — | | `has_transparent_button` | `boolean` | No | — | > **colors full type** > > ```ts theme={null} > { > answer?: string, > button?: string, > question?: string, > background?: string > } > ``` > **fields full type** > > ```ts theme={null} > { > alignment?: left | center, > font_size?: small | medium | large > } > ``` > **screens full type** > > ```ts theme={null} > { > font_size?: string, > alignment?: string > } > ``` > **background full type** > > ```ts theme={null} > { > href?: string, > layout?: fullscreen | repeat | no-repeat, > brightness?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `font` | `string` | No | — | | `visibility` | `string` | No | — | | `rounded_corners` | `string` | No | — | | `has_transparent_button` | `boolean` | No | — | | `colors` | `object` | No | — | | `background` | `object` | No | — | | `fields` | `object` | No | — | | `screens` | `object` | No | — | > **colors full type** > > ```ts theme={null} > { > answer?: string, > button?: string, > question?: string, > background?: string > } > ``` > **background full type** > > ```ts theme={null} > { > href?: string, > layout?: fullscreen | repeat | no-repeat, > brightness?: number > } > ``` > **fields full type** > > ```ts theme={null} > { > alignment?: left | center, > font_size?: small | medium | large > } > ``` > **screens full type** > > ```ts theme={null} > { > } > ``` *** ### update `themes.update` Replace a theme with a new version (PUT) **Risk:** `write` ```ts theme={null} await corsair.typeform.api.themes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `theme_id` | `string` | Yes | — | | `font` | `string` | Yes | — | | `name` | `string` | Yes | — | | `colors` | `object` | Yes | — | | `fields` | `object` | No | — | | `screens` | `object` | No | — | | `background` | `object` | No | — | | `rounded_corners` | `string` | No | — | | `has_transparent_button` | `boolean` | No | — | > **colors full type** > > ```ts theme={null} > { > answer?: string, > button?: string, > question?: string, > background?: string > } > ``` > **fields full type** > > ```ts theme={null} > { > alignment?: left | center, > font_size?: small | medium | large > } > ``` > **screens full type** > > ```ts theme={null} > { > font_size?: string, > alignment?: string > } > ``` > **background full type** > > ```ts theme={null} > { > href?: string, > layout?: fullscreen | repeat | no-repeat, > brightness?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `font` | `string` | No | — | | `visibility` | `string` | No | — | | `rounded_corners` | `string` | No | — | | `has_transparent_button` | `boolean` | No | — | | `colors` | `object` | No | — | | `background` | `object` | No | — | | `fields` | `object` | No | — | | `screens` | `object` | No | — | > **colors full type** > > ```ts theme={null} > { > answer?: string, > button?: string, > question?: string, > background?: string > } > ``` > **background full type** > > ```ts theme={null} > { > href?: string, > layout?: fullscreen | repeat | no-repeat, > brightness?: number > } > ``` > **fields full type** > > ```ts theme={null} > { > alignment?: left | center, > font_size?: small | medium | large > } > ``` > **screens full type** > > ```ts theme={null} > { > } > ``` *** ## Videos ### upload `videos.upload` Get a signed URL to upload a video for a form field **Risk:** `write` ```ts theme={null} await corsair.typeform.api.videos.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | | `field_id` | `string` | Yes | — | | `language` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `upload_url` | `string` | No | — | | `transcode_status` | `string` | No | — | *** ## Webhooks Config ### createOrUpdate `webhooksConfig.createOrUpdate` Create or update a webhook configuration **Risk:** `write` ```ts theme={null} await corsair.typeform.api.webhooksConfig.createOrUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | | `tag` | `string` | Yes | — | | `url` | `string` | Yes | — | | `enabled` | `boolean` | No | — | | `secret` | `string` | No | — | | `verify_ssl` | `boolean` | No | — | | `event_types` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `tag` | `string` | No | — | | `url` | `string` | No | — | | `secret` | `string` | No | — | | `enabled` | `boolean` | No | — | | `form_id` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `verify_ssl` | `boolean` | No | — | | `event_types` | `string[]` | No | — | *** ### delete `webhooksConfig.delete` Delete a webhook configuration **Risk:** `destructive` ```ts theme={null} await corsair.typeform.api.webhooksConfig.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | *** ### get `webhooksConfig.get` Get a webhook configuration by tag **Risk:** `read` ```ts theme={null} await corsair.typeform.api.webhooksConfig.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | | `tag` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `tag` | `string` | No | — | | `url` | `string` | No | — | | `secret` | `string` | No | — | | `enabled` | `boolean` | No | — | | `form_id` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | | `verify_ssl` | `boolean` | No | — | | `event_types` | `string[]` | No | — | *** ### list `webhooksConfig.list` List all webhook configurations for a form **Risk:** `read` ```ts theme={null} await corsair.typeform.api.webhooksConfig.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `form_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | No | — | > **webhooks full type** > > ```ts theme={null} > { > id?: string, > tag?: string, > url?: string, > secret?: string, > enabled?: boolean, > form_id?: string, > created_at?: string, > updated_at?: string, > verify_ssl?: boolean, > event_types?: string[] > }[] > ``` *** ## Workspaces ### create `workspaces.create` Create a new workspace **Risk:** `write` ```ts theme={null} await corsair.typeform.api.workspaces.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `self` | `object` | No | — | | `forms` | `object` | No | — | | `shared` | `boolean` | No | — | | `default` | `boolean` | No | — | | `members` | `object[]` | No | — | | `account_id` | `string` | No | — | > **self full type** > > ```ts theme={null} > { > href?: string > } > ``` > **forms full type** > > ```ts theme={null} > { > href?: string, > count?: number > } > ``` > **members full type** > > ```ts theme={null} > { > name?: string, > role?: string, > email?: string > }[] > ``` *** ### createForAccount `workspaces.createForAccount` Create a new workspace within a specific account **Risk:** `write` ```ts theme={null} await corsair.typeform.api.workspaces.createForAccount({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `account_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `name` | `string` | No | — | | `self` | `object` | No | — | | `forms` | `object` | No | — | | `shared` | `boolean` | No | — | | `default` | `boolean` | No | — | | `members` | `object[]` | No | — | | `account_id` | `string` | No | — | > **self full type** > > ```ts theme={null} > { > href?: string > } > ``` > **forms full type** > > ```ts theme={null} > { > href?: string, > count?: number > } > ``` > **members full type** > > ```ts theme={null} > { > name?: string, > role?: string, > email?: string > }[] > ``` *** ### delete `workspaces.delete` Permanently delete a workspace **Risk:** `destructive` ```ts theme={null} await corsair.typeform.api.workspaces.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | **Output:** `any` *** ### get `workspaces.get` Get a workspace by ID **Risk:** `read` ```ts theme={null} await corsair.typeform.api.workspaces.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `href` | `string` | No | — | | `name` | `string` | No | — | | `forms` | `object` | No | — | | `members` | `object[]` | No | — | | `shared` | `boolean` | No | — | | `default` | `boolean` | No | — | | `account_id` | `string` | No | — | > **forms full type** > > ```ts theme={null} > { > href?: string, > count?: number > } > ``` > **members full type** > > ```ts theme={null} > { > name?: string, > role?: string, > email?: string > }[] > ``` *** ### list `workspaces.list` List all workspaces **Risk:** `read` ```ts theme={null} await corsair.typeform.api.workspaces.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `search` | `string` | No | — | | `page_size` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `workspaces` | `object[]` | No | — | > **workspaces full type** > > ```ts theme={null} > { > id?: string, > href?: string, > name?: string, > forms?: { > href?: string, > count?: number > }, > members?: { > name?: string, > role?: string, > email?: string > }[], > shared?: boolean, > default?: boolean, > account_id?: string > }[] > ``` *** ### update `workspaces.update` Update a workspace using JSON Patch operations **Risk:** `write` ```ts theme={null} await corsair.typeform.api.workspaces.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `workspace_id` | `string` | Yes | — | | `operations` | `object[]` | Yes | — | > **operations full type** > > ```ts theme={null} > { > op: add | remove | replace | move | copy | test, > path: string, > value?: any, > from?: string > }[] > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/typeform/database Typeform local sync: searchable entities, `.search()` filters, and operators. The Typeform plugin syncs data locally. Use `corsair.typeform.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Forms Path: `typeform.db.forms.search` ```ts theme={null} const rows = await corsair.typeform.db.forms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Images Path: `typeform.db.images.search` ```ts theme={null} const rows = await corsair.typeform.db.images.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `src` | `string` | equals, contains, startsWith, endsWith, in | | `width` | `number` | equals, gt, gte, lt, lte, in | | `height` | `number` | equals, gt, gte, lt, lte, in | | `avg_color` | `string` | equals, contains, startsWith, endsWith, in | | `file_name` | `string` | equals, contains, startsWith, endsWith, in | | `has_alpha` | `boolean` | equals | | `media_type` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Responses Path: `typeform.db.responses.search` ```ts theme={null} const rows = await corsair.typeform.db.responses.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `response_id` | `string` | equals, contains, startsWith, endsWith, in | | `form_id` | `string` | equals, contains, startsWith, endsWith, in | | `submitted_at` | `string` | equals, contains, startsWith, endsWith, in | | `landed_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Themes Path: `typeform.db.themes.search` ```ts theme={null} const rows = await corsair.typeform.db.themes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `font` | `string` | equals, contains, startsWith, endsWith, in | | `visibility` | `string` | equals, contains, startsWith, endsWith, in | | `rounded_corners` | `string` | equals, contains, startsWith, endsWith, in | | `has_transparent_button` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhook Configs Path: `typeform.db.webhookConfigs.search` ```ts theme={null} const rows = await corsair.typeform.db.webhookConfigs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `enabled` | `boolean` | equals | | `form_id` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | | `verify_ssl` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workspaces Path: `typeform.db.workspaces.search` ```ts theme={null} const rows = await corsair.typeform.db.workspaces.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `shared` | `boolean` | equals | | `default` | `boolean` | equals | | `account_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/typeform/get-credentials Step-by-step instructions for obtaining Typeform OAuth 2.0 credentials. ## Authentication Method * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 user authentication ## OAuth 2.0 Setup ### Step 1: Create a Typeform App 1. Log in to [admin.typeform.com](https://admin.typeform.com) 2. Go to **User menu** → **Developer Apps** 3. Click **Register a new application** 4. Fill in your app name and description 5. Add a **Redirect URI** (e.g., `http://localhost:` for CLI flow) 6. Click **Register Application** ### Step 2: Get Client Credentials 1. After registration, copy the **Client ID** and **Client Secret** 2. Store these securely **Storing Credentials:** ```bash theme={null} pnpm corsair setup --plugin=typeform client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=typeform ``` ## Webhook Setup (Optional) Typeform webhooks can be configured per-form via the API or dashboard. ```bash theme={null} pnpm corsair setup --plugin=typeform webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth 2.0 | Developer Apps → App settings | | Client Secret | OAuth 2.0 | Developer Apps → App settings | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/typeform/overview Conversational form builder for surveys, quizzes, lead capture, and interactive questionnaires. Use **Typeform** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 35 typed API operations * 6 synced entities (`forms`, `images`, `responses`, `themes`, `webhookConfigs`, `workspaces`) for fast `.search()` / `.list()` * 1 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/typeform ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/typeform ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/typeform ``` ```bash bun theme={null} bun add corsair @corsair-dev/typeform ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { typeform } from '@corsair-dev/typeform'; export const corsair = createCorsair({ plugins: [ typeform(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Typeform OAuth app. Provider walkthrough: [Get Credentials](/plugins/typeform/get-credentials). ```ts theme={null} typeform() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'typeform', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`forms.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.typeform.api.forms.get({}); ``` **`forms.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.typeform.api.forms.create({}); ``` See the full list on the [API](/plugins/typeform/api) page. ## Query synced data Synced entities support `tenant.typeform.db..search()` and `.list()`: `forms`, `images`, `responses`, `themes`, `webhookConfigs`, `workspaces`. See [Database](/plugins/typeform/database) for filters and operators. ## Webhooks This plugin registers **1** webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/typeform/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/typeform/api)** > > Every `typeform.api.*` operation with input and output types. > **[Database](/plugins/typeform/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/typeform/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/typeform/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/typeform/webhooks Typeform incoming webhooks: event paths, payloads, and response data. The Typeform plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/typeform/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `forms` * `formResponse` (`forms.formResponse`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Forms ### Form Response `forms.formResponse` A form was submitted — Typeform delivers the full response payload **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event_id` | `string` | Yes | — | | `event_type` | `string` | Yes | — | | `form_response` | `object` | Yes | — | > **form\_response full type** > > ```ts theme={null} > { > form_id: string, > token: string, > submitted_at: string, > landed_at: string, > hidden?: { > }, > calculated?: { > score?: number > }, > definition?: { > id?: string, > title?: string, > fields?: { > }[] > }, > answers?: { > }[], > variables?: { > key?: string, > type?: string, > text?: string, > number?: number > }[], > metadata?: { > browser?: string, > referer?: string, > platform?: string, > network_id?: string, > user_agent?: string > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > event_id: string, > event_type: string, > form_response: { > form_id: string, > token: string, > submitted_at: string, > landed_at: string, > hidden?: { > }, > calculated?: { > score?: number > }, > definition?: { > id?: string, > title?: string, > fields?: { > }[] > }, > answers?: { > }[], > variables?: { > key?: string, > type?: string, > text?: string, > number?: number > }[], > metadata?: { > browser?: string, > referer?: string, > platform?: string, > network_id?: string, > user_agent?: string > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} typeform({ webhookHooks: { forms: { formResponse: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/unione/api API reference for UniOne: every `unione.api.*` operation with input and output types. Every `unione.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Domain ### delete `domain.delete` Tool to delete a sender domain from the account. Use only when you are certain: the domain must be re-added and re-verified to send from it again. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.unione.api.domain.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ### manage `domain.manage` Tool to inspect and verify sender domains: fetch DNS records, trigger a verification or DKIM check, or list domains. Deleting a domain is a separate tool. **Risk:** `write` ```ts theme={null} await corsair.unione.api.domain.manage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `action` | `get_dns_records \| validate_verification \| validate_dkim \| list` | Yes | — | | `domain` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `domain` | `string` | No | — | | `verification-record` | `any` | No | — | | `dkim` | `any` | No | — | | `domains` | `object[]` | No | — | > **domains full type** > > ```ts theme={null} > { > domain: string, > verification-record?: { > value?: string, > status?: string > }, > dkim?: { > key?: string, > status?: string > } > }[] > ``` *** ## Email ### list `email.list` Tool to start an export of email events in a time range. Creates an asynchronous event dump and returns a dump\_id; poll eventDump.get for the download URLs. It does not return events directly. **Risk:** `write` ```ts theme={null} await corsair.unione.api.email.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `string` | Yes | — | | `end_time` | `string` | No | — | | `limit` | `number` | No | — | | `all_projects` | `boolean` | No | — | | `filter` | `object` | No | — | | `dump_fields` | `string[]` | No | — | | `format` | `csv \| csv_gzip` | No | — | > **filter full type** > > ```ts theme={null} > { > job_id?: string, > status?: string, > delivery_status?: string, > email?: string, > email_from?: string, > domain?: string, > campaign_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `dump_id` | `string` | No | — | *** ### schedule `email.schedule` Tool to send a transactional email at a future time, at most 24 hours ahead. Same as email.send plus a send\_at timestamp. **Risk:** `write` ```ts theme={null} await corsair.unione.api.email.schedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recipients` | `object[]` | Yes | — | | `from_email` | `string` | Yes | — | | `subject` | `string` | Yes | — | | `from_name` | `string` | No | — | | `reply_to` | `string` | No | — | | `reply_to_name` | `string` | No | — | | `body` | `object` | No | — | | `template_id` | `string` | No | — | | `tags` | `string[]` | No | — | | `template_engine` | `string` | No | — | | `global_substitutions` | `object` | No | — | | `global_metadata` | `object` | No | — | | `track_links` | `number` | No | — | | `track_read` | `number` | No | — | | `send_at` | `string` | Yes | — | > **recipients full type** > > ```ts theme={null} > { > email: string, > substitutions?: { > }, > metadata?: { > } > }[] > ``` > **body full type** > > ```ts theme={null} > { > html?: string, > plaintext?: string, > amp?: string > } > ``` > **global\_substitutions full type** > > ```ts theme={null} > { > } > ``` > **global\_metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `job_id` | `string` | No | — | | `emails` | `string[]` | No | — | | `failed_emails` | `object` | No | — | > **failed\_emails full type** > > ```ts theme={null} > { > } > ``` *** ### send `email.send` Tool to send a transactional email immediately. Requires recipients, from\_email, subject, and either a body or a template\_id. **Risk:** `write` ```ts theme={null} await corsair.unione.api.email.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `recipients` | `object[]` | Yes | — | | `from_email` | `string` | Yes | — | | `subject` | `string` | Yes | — | | `from_name` | `string` | No | — | | `reply_to` | `string` | No | — | | `reply_to_name` | `string` | No | — | | `body` | `object` | No | — | | `template_id` | `string` | No | — | | `tags` | `string[]` | No | — | | `template_engine` | `string` | No | — | | `global_substitutions` | `object` | No | — | | `global_metadata` | `object` | No | — | | `track_links` | `number` | No | — | | `track_read` | `number` | No | — | > **recipients full type** > > ```ts theme={null} > { > email: string, > substitutions?: { > }, > metadata?: { > } > }[] > ``` > **body full type** > > ```ts theme={null} > { > html?: string, > plaintext?: string, > amp?: string > } > ``` > **global\_substitutions full type** > > ```ts theme={null} > { > } > ``` > **global\_metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `job_id` | `string` | No | — | | `emails` | `string[]` | No | — | | `failed_emails` | `object` | No | — | > **failed\_emails full type** > > ```ts theme={null} > { > } > ``` *** ### statistics `email.statistics` Tool to start a per-day aggregate export of send statistics. Creates an asynchronous event dump and returns a dump\_id; poll eventDump.get for the result. It does not return statistics directly. **Risk:** `write` ```ts theme={null} await corsair.unione.api.email.statistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `string` | Yes | — | | `end_time` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `dump_id` | `string` | No | — | *** ### subscribe `email.subscribe` Tool to resubscribe a recipient who previously unsubscribed. Use when you need to restore a user subscription status after they opt in again. **Risk:** `write` ```ts theme={null} await corsair.unione.api.email.subscribe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from_email` | `string` | Yes | — | | `to_email` | `string` | Yes | — | | `from_name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ### unsubscribe `email.unsubscribe` Tool to unsubscribe an email from future emails. Use when you need to stop all further transactional emails. **Risk:** `write` ```ts theme={null} await corsair.unione.api.email.unsubscribe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `created` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ## Email Validation ### batch `emailValidation.batch` Tool to validate a list of email addresses. UniOne has no bulk method, so each address costs one validation from the account quota. Addresses that fail are returned with status "error" rather than failing the whole batch. **Risk:** `read` ```ts theme={null} await corsair.unione.api.emailValidation.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `emails` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > status?: string, > email?: string, > result?: string, > cause?: string, > validity?: number, > local_part?: string, > domain?: string, > mx_found?: boolean, > mx_record?: string | number, > did_you_mean?: string, > processed_at?: string > }[] > ``` *** ## Event Dump ### create `eventDump.create` Tool to create an asynchronous CSV event dump. Use when you need to export transactional email events for a specified time window. **Risk:** `write` ```ts theme={null} await corsair.unione.api.eventDump.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `start_time` | `string` | Yes | — | | `end_time` | `string` | No | — | | `limit` | `number` | No | — | | `all_projects` | `boolean` | No | — | | `filter` | `object` | No | — | | `dump_fields` | `string[]` | No | — | | `aggregate` | `string` | No | — | | `delimiter` | `string` | No | — | | `format` | `csv \| csv_gzip` | No | — | > **filter full type** > > ```ts theme={null} > { > job_id?: string, > status?: string, > delivery_status?: string, > email?: string, > email_from?: string, > domain?: string, > campaign_id?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `dump_id` | `string` | No | — | *** ### createForJob `eventDump.createForJob` Tool to export the delivery events of one send job. UniOne has no method that reads a job directly, so this creates an event dump filtered by job\_id and returns a dump\_id to poll with eventDump.get. **Risk:** `write` ```ts theme={null} await corsair.unione.api.eventDump.createForJob({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | | `start_time` | `string` | No | — | | `end_time` | `string` | No | — | | `email` | `string` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `dump_id` | `string` | No | — | *** ### delete `eventDump.delete` Tool to delete an event dump file and remove it from the queue or storage. Use when you need to clean up an existing event dump by its dump\_id. **Risk:** `destructive` ```ts theme={null} await corsair.unione.api.eventDump.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dump_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ### get `eventDump.get` Tool to retrieve the status and download URLs of an event dump. Use when you need to check if a dump is ready and get its files. **Risk:** `read` ```ts theme={null} await corsair.unione.api.eventDump.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `dump_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `event_dump` | `object` | No | — | > **event\_dump full type** > > ```ts theme={null} > { > dump_id: string, > dump_status?: string, > files?: { > url: string, > size?: number > }[] > } > ``` *** ### list `eventDump.list` Tool to retrieve the full list of event dumps. Use when you need to view all existing event-dump tasks. **Risk:** `read` ```ts theme={null} await corsair.unione.api.eventDump.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `event_dumps` | `object[]` | No | — | > **event\_dumps full type** > > ```ts theme={null} > { > dump_id: string, > dump_status?: string, > files?: { > url: string, > size?: number > }[] > }[] > ``` *** ## Suppression ### delete `suppression.delete` Tool to remove an email from the suppression list. Use when you need to re-enable sending emails to an address that was previously unsubscribed or suppressed. **Risk:** `write` ```ts theme={null} await corsair.unione.api.suppression.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ### get `suppression.get` Tool to check if an email is suppressed and retrieve the reason and date. Use when verifying why an email cannot receive messages. **Risk:** `read` ```ts theme={null} await corsair.unione.api.suppression.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `all_projects` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `email` | `string` | No | — | | `suppressions` | `object[]` | No | — | > **suppressions full type** > > ```ts theme={null} > { > email?: string, > project_id?: string, > cause?: string, > source?: string, > is_deletable?: boolean, > created?: string > }[] > ``` *** ### list `suppression.list` Tool to return the suppression list since a given date. Use when auditing bounced, unsubscribed, or blocked recipients. **Risk:** `read` ```ts theme={null} await corsair.unione.api.suppression.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cause` | `string` | No | — | | `source` | `string` | No | — | | `start_time` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `count` | `number` | No | — | | `suppressions` | `object[]` | No | — | | `cursor` | `string` | No | — | > **suppressions full type** > > ```ts theme={null} > { > email?: string, > project_id?: string, > cause?: string, > source?: string, > is_deletable?: boolean, > created?: string > }[] > ``` *** ## System ### info `system.info` Tool to retrieve account details and the current billing period: emails included and sent, validations included and used. Use before sending large campaigns. **Risk:** `read` ```ts theme={null} await corsair.unione.api.system.info({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `user_id` | `number` | No | — | | `email` | `string` | No | — | | `project_id` | `string` | No | — | | `project_name` | `string` | No | — | | `project_accounting` | `object` | No | — | | `accounting` | `object` | No | — | > **project\_accounting full type** > > ```ts theme={null} > { > email_counter?: number, > email_counter_limit?: number, > email_counter_mode?: any > } > ``` > **accounting full type** > > ```ts theme={null} > { > period_start?: string, > period_end?: string, > emails_included?: number, > emails_sent?: number, > validations_included?: number, > validations_used?: number > } > ``` *** ### ping `system.ping` Tool to check API connectivity and that the API key is accepted. Use as a health check before a batch of operations. **Risk:** `read` ```ts theme={null} await corsair.unione.api.system.ping({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ## Tag ### delete `tag.delete` Tool to delete a specific tag. Use when you have confirmed the tag ID you wish to remove. **Risk:** `destructive` ```ts theme={null} await corsair.unione.api.tag.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tag_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ### list `tag.list` Tool to retrieve all user-defined tags. Use when you need to fetch the full list of tags after authentication. **Risk:** `read` ```ts theme={null} await corsair.unione.api.tag.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `tags` | `object[]` | No | — | > **tags full type** > > ```ts theme={null} > { > tag_id: number, > tag: string > }[] > ``` *** ## Template ### delete `template.delete` Tool to delete a template by ID. Use when you need to permanently remove a template from the account. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.unione.api.template.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ### get `template.get` Tool to get template properties by ID. Use when you need to retrieve the full template configuration and content for a specific template. **Risk:** `read` ```ts theme={null} await corsair.unione.api.template.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `template` | `object` | No | — | > **template full type** > > ```ts theme={null} > { > id?: string, > name?: string, > editor_type?: string, > template_engine?: string, > global_substitutions?: { > }, > global_metadata?: { > }, > body?: { > html?: string, > plaintext?: string, > amp?: string > }, > subject?: string, > from_email?: string, > from_name?: string, > reply_to?: string, > reply_to_name?: string, > track_links?: number, > track_read?: number, > headers?: { > }, > attachments?: { > type: string, > name: string, > content: string > }[], > inline_attachments?: { > type: string, > name: string, > content: string > }[] > } > ``` *** ### list `template.list` Tool to list email templates. Use when you need to retrieve available templates for transactional emails. **Risk:** `read` ```ts theme={null} await corsair.unione.api.template.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `templates` | `object[]` | No | — | > **templates full type** > > ```ts theme={null} > { > id?: string, > name?: string, > editor_type?: string, > template_engine?: string, > global_substitutions?: { > }, > global_metadata?: { > }, > body?: { > html?: string, > plaintext?: string, > amp?: string > }, > subject?: string, > from_email?: string, > from_name?: string, > reply_to?: string, > reply_to_name?: string, > track_links?: number, > track_read?: number, > headers?: { > }, > attachments?: { > type: string, > name: string, > content: string > }[], > inline_attachments?: { > type: string, > name: string, > content: string > }[] > }[] > ``` *** ### set `template.set` Tool to set or update an email template. Use when you need to create or modify transactional email templates before sending messages. **Risk:** `write` ```ts theme={null} await corsair.unione.api.template.set({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `template` | `object` | Yes | — | > **template full type** > > ```ts theme={null} > { > id?: string, > name?: string, > editor_type?: string, > template_engine?: string, > global_substitutions?: { > }, > global_metadata?: { > }, > body?: { > html?: string, > plaintext?: string, > amp?: string > }, > subject?: string, > from_email?: string, > from_name?: string, > reply_to?: string, > reply_to_name?: string, > track_links?: number, > track_read?: number, > headers?: { > }, > attachments?: { > type: string, > name: string, > content: string > }[], > inline_attachments?: { > type: string, > name: string, > content: string > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `template` | `object` | No | — | > **template full type** > > ```ts theme={null} > { > id?: string, > name?: string, > editor_type?: string, > template_engine?: string, > global_substitutions?: { > }, > global_metadata?: { > }, > body?: { > html?: string, > plaintext?: string, > amp?: string > }, > subject?: string, > from_email?: string, > from_name?: string, > reply_to?: string, > reply_to_name?: string, > track_links?: number, > track_read?: number, > headers?: { > }, > attachments?: { > type: string, > name: string, > content: string > }[], > inline_attachments?: { > type: string, > name: string, > content: string > }[] > } > ``` *** ## Webhook ### delete `webhook.delete` Tool to delete a webhook event notification handler by its URL. Use when you need to stop receiving callback notifications for a specific webhook. **Risk:** `destructive` ```ts theme={null} await corsair.unione.api.webhook.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | *** ### get `webhook.get` Tool to retrieve webhook configuration by its URL. Use when you need to check the current settings of an event notification handler. **Risk:** `read` ```ts theme={null} await corsair.unione.api.webhook.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `object` | `object` | No | — | > **object full type** > > ```ts theme={null} > { > id?: string | number | null, > url: string, > status?: string | null, > event_format?: string | null, > delivery_info?: number | null, > single_event?: number | null, > max_parallel?: number | null, > updated_at?: string | null, > events?: { > spam_block?: string[] | null, > email_status?: string[] | null > } | null > } > ``` *** ### list `webhook.list` Tool to list every webhook configured on the account. Use when you need to see all event notification handlers and their settings. **Risk:** `read` ```ts theme={null} await corsair.unione.api.webhook.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `objects` | `object[]` | No | — | > **objects full type** > > ```ts theme={null} > { > id?: string | number | null, > url: string, > status?: string | null, > event_format?: string | null, > delivery_info?: number | null, > single_event?: number | null, > max_parallel?: number | null, > updated_at?: string | null, > events?: { > spam_block?: string[] | null, > email_status?: string[] | null > } | null > }[] > ``` *** ### set `webhook.set` Tool to set or edit a webhook event notification handler. Use when you need to configure your webhook for event callbacks. **Risk:** `write` ```ts theme={null} await corsair.unione.api.webhook.set({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `status` | `string` | No | — | | `event_format` | `string` | No | — | | `delivery_info` | `number` | No | — | | `single_event` | `number` | No | — | | `max_parallel` | `number` | No | — | | `events` | `object` | No | — | > **events full type** > > ```ts theme={null} > { > spam_block?: string[] | null, > email_status?: string[] | null > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `object` | `object` | No | — | > **object full type** > > ```ts theme={null} > { > id?: string | number | null, > url: string, > status?: string | null, > event_format?: string | null, > delivery_info?: number | null, > single_event?: number | null, > max_parallel?: number | null, > updated_at?: string | null, > events?: { > spam_block?: string[] | null, > email_status?: string[] | null > } | null > } > ``` *** ### types `webhook.types` Tool to list the event names accepted by webhook.set. Returns a static list published in the UniOne callback docs; it makes no API call. **Risk:** `read` ```ts theme={null} await corsair.unione.api.webhook.types({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `email_status` | `string[]` | Yes | — | | `spam_block` | `string[]` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/unione/database UniOne local sync: searchable entities, `.search()` filters, and operators. The UniOne plugin syncs data locally. Use `corsair.unione.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Account Path: `unione.db.account.search` ```ts theme={null} const rows = await corsair.unione.db.account.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `project_name` | `string` | equals, contains, startsWith, endsWith, in | | `emails_included` | `number` | equals, gt, gte, lt, lte, in | | `emails_sent` | `number` | equals, gt, gte, lt, lte, in | | `validations_included` | `number` | equals, gt, gte, lt, lte, in | | `validations_used` | `number` | equals, gt, gte, lt, lte, in | | `period_start` | `string` | equals, contains, startsWith, endsWith, in | | `period_end` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Domains Path: `unione.db.domains.search` ```ts theme={null} const rows = await corsair.unione.db.domains.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `verification_status` | `string` | equals, contains, startsWith, endsWith, in | | `verification_value` | `string` | equals, contains, startsWith, endsWith, in | | `dkim_status` | `string` | equals, contains, startsWith, endsWith, in | | `dkim_key` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Event Dumps Path: `unione.db.eventDumps.search` ```ts theme={null} const rows = await corsair.unione.db.eventDumps.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `dump_id` | `string` | equals, contains, startsWith, endsWith, in | | `dump_status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Suppressions Path: `unione.db.suppressions.search` ```ts theme={null} const rows = await corsair.unione.db.suppressions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `project_id` | `string` | equals, contains, startsWith, endsWith, in | | `cause` | `string` | equals, contains, startsWith, endsWith, in | | `source` | `string` | equals, contains, startsWith, endsWith, in | | `is_deletable` | `boolean` | equals | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `unione.db.tags.search` ```ts theme={null} const rows = await corsair.unione.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `tag_id` | `number` | equals, gt, gte, lt, lte, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Templates Path: `unione.db.templates.search` ```ts theme={null} const rows = await corsair.unione.db.templates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `from_email` | `string` | equals, contains, startsWith, endsWith, in | | `from_name` | `string` | equals, contains, startsWith, endsWith, in | | `editor_type` | `string` | equals, contains, startsWith, endsWith, in | | `template_engine` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `unione.db.webhooks.search` ```ts theme={null} const rows = await corsair.unione.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `event_format` | `string` | equals, contains, startsWith, endsWith, in | | `delivery_info` | `number` | equals, gt, gte, lt, lte, in | | `single_event` | `number` | equals, gt, gte, lt, lte, in | | `max_parallel` | `number` | equals, gt, gte, lt, lte, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/unione/overview Transactional email service for sending bulk mail, templates, and deliverability management. Use **UniOne** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 30 typed API operations * 7 synced entities (`account`, `domains`, `eventDumps`, `suppressions`, `tags`, `templates`, and 1 more) for fast `.search()` / `.list()` * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/unione ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/unione ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/unione ``` ```bash bun theme={null} bun add corsair @corsair-dev/unione ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { unione } from '@corsair-dev/unione'; export const corsair = createCorsair({ plugins: [ unione(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} unione() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'unione', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`emailValidation.batch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.unione.api.emailValidation.batch({}); ``` **`domain.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.unione.api.domain.delete({}); ``` See the full list on the [API](/plugins/unione/api) page. ## Query synced data Synced entities support `tenant.unione.db..search()` and `.list()`: `account`, `domains`, `eventDumps`, `suppressions`, `tags`, `templates`, `webhooks`. See [Database](/plugins/unione/database) for filters and operators. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/unione/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/unione/api)** > > Every `unione.api.*` operation with input and output types. > **[Database](/plugins/unione/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/unione/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/unione/webhooks UniOne incoming webhooks: event paths, payloads, and response data. The UniOne plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/unione/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `emailStatus` (`emailStatus`) * `spamBlock` (`spamBlock`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Email Status ### Email Status `emailStatus` Transactional email status events from UniOne **Payload** | Name | Type | Required | Description | | - | - | - | - | | `auth` | `string` | No | — | | `events_by_user` | `object[]` | No | — | > **events\_by\_user full type** > > ```ts theme={null} > { > user_id?: string | number, > project_id?: string, > project_name?: string, > events?: { > event_name: string, > event_data?: { > job_id?: string, > email?: string, > status?: string, > event_time?: string > } > }[] > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > auth?: string, > events_by_user?: { > user_id?: string | number, > project_id?: string, > project_name?: string, > events?: { > event_name: string, > event_data?: { > job_id?: string, > email?: string, > status?: string, > event_time?: string > } > }[] > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} unione({ webhookHooks: { emailStatus: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Spam Block ### Spam Block `spamBlock` SMTP spam-block events from UniOne **Payload** | Name | Type | Required | Description | | - | - | - | - | | `auth` | `string` | No | — | | `events_by_user` | `object[]` | No | — | > **events\_by\_user full type** > > ```ts theme={null} > { > user_id?: string | number, > project_id?: string, > project_name?: string, > events?: { > event_name: string, > event_data?: { > job_id?: string, > email?: string, > status?: string, > event_time?: string > } > }[] > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > auth?: string, > events_by_user?: { > user_id?: string | number, > project_id?: string, > project_name?: string, > events?: { > event_name: string, > event_data?: { > job_id?: string, > email?: string, > status?: string, > event_time?: string > } > }[] > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} unione({ webhookHooks: { spamBlock: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/uniswapapi/api API reference for Uniswap: every `uniswapapi.api.*` operation with input and output types. Every `uniswapapi.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Approval ### check `approval.check` Check if a wallet has the required token approval for a swap **Risk:** `read` ```ts theme={null} await corsair.uniswapapi.api.approval.check({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | Yes | Token contract address | | `amount` | `string` | Yes | Amount to check approval for | | `walletAddress` | `string` | Yes | Wallet address to check | | `chainId` | `number` | Yes | Chain ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `approval` | `object` | No | — | | `cancel` | `object` | No | — | | `gasFee` | `string` | No | — | | `cancelGasFee` | `string` | No | — | > **approval full type** > > ```ts theme={null} > { > to: string, > from?: string, > data: string, > value: string, > chainId: number, > gasLimit?: string, > maxFeePerGas?: string, > maxPriorityFeePerGas?: string, > gasPrice?: string > } > ``` > **cancel full type** > > ```ts theme={null} > { > to: string, > from?: string, > data: string, > value: string, > chainId: number, > gasLimit?: string, > maxFeePerGas?: string, > maxPriorityFeePerGas?: string, > gasPrice?: string > } > ``` *** ## Delegation ### check `delegation.check` Check wallet delegation status for smart contract wallets across chains **Risk:** `read` ```ts theme={null} await corsair.uniswapapi.api.delegation.check({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `walletAddresses` | `string[]` | Yes | Wallet addresses to check delegation for | | `chainIds` | `number[]` | Yes | Chain IDs to check delegation status for | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `delegationDetails` | `object` | Yes | — | > **delegationDetails full type** > > ```ts theme={null} > { > } > ``` *** ## Order ### getStatus `order.getStatus` Get the status and details of a gasless UniswapX order **Risk:** `read` ```ts theme={null} await corsair.uniswapapi.api.order.getStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `orderId` | `string` | No | Single UniswapX order ID | | `orderIds` | `string[]` | No | Multiple UniswapX order IDs | | `orderStatus` | `open \| expired \| error \| cancelled \| filled \| unverified \| insufficient-funds` | No | Filter orders by status | | `swapper` | `string` | No | Filter orders by swapper address | | `filler` | `string` | No | Filter orders by filler address | | `limit` | `number` | No | Maximum number of orders to return per page | | `cursor` | `string` | No | Pagination cursor from a previous response | | `sortKey` | `createdAt` | No | Field to sort results by | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `orders` | `object[]` | Yes | — | | `cursor` | `string` | No | — | > **orders full type** > > ```ts theme={null} > { > orderId: string, > orderStatus: open | expired | error | cancelled | filled | unverified | insufficient-funds, > chainId: number, > type: DutchLimit | Dutch | Dutch_V2 | Dutch_V3 | Priority, > encodedOrder?: string, > signature?: string, > nonce?: string, > quoteId?: string, > swapper?: string, > txHash?: string > }[] > ``` *** ## Quote ### get `quote.get` Get a swap/bridge/wrap quote with route and estimated gas **Risk:** `read` ```ts theme={null} await corsair.uniswapapi.api.quote.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `EXACT_INPUT \| EXACT_OUTPUT` | Yes | Swap type | | `tokenIn` | `string` | Yes | Input token contract address | | `tokenInChainId` | `number` | Yes | Input token chain ID | | `tokenOut` | `string` | Yes | Output token contract address | | `tokenOutChainId` | `number` | Yes | Output token chain ID | | `amount` | `string` | Yes | Token amount (in smallest unit) | | `swapper` | `string` | Yes | Address of the swapper wallet | | `slippageTolerance` | `number` | No | Slippage tolerance as a percentage (e.g. 0.5 = 0.5%) | | `autoSlippage` | `DEFAULT` | No | Let the API compute slippage automatically; cannot be combined with slippageTolerance | | `urgency` | `normal \| fast \| urgent` | No | Trade urgency | | `recipient` | `string` | No | Recipient address, if different from swapper | | `protocols` | `string[]` | No | Protocols to route through | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `routing` | `CLASSIC \| DUTCH_LIMIT \| DUTCH_V2 \| DUTCH_V3 \| BRIDGE \| LIMIT_ORDER \| PRIORITY \| WRAP \| UNWRAP \| CHAINED` | Yes | — | | `quote` | `object` | Yes | — | | `permitData` | `object` | No | — | | `quoteId` | `string` | No | — | | `tokenIn` | `string` | No | — | | `tokenOut` | `string` | No | — | | `amountIn` | `string` | No | — | | `amountOut` | `string` | No | — | | `swapper` | `string` | No | — | | `gasEstimate` | `string` | No | — | | `gasFee` | `string` | No | — | | `gasFeeUSD` | `string` | No | — | | `route` | `object[]` | No | — | | `routeString` | `string` | No | — | > **quote full type** > > ```ts theme={null} > { > } > ``` > **permitData full type** > > ```ts theme={null} > { > } > ``` > **route full type** > > ```ts theme={null} > { > }[][] > ``` *** ## Swap ### create `swap.create` Create swap calldata (unsigned transaction) for broadcast **Risk:** `write` ```ts theme={null} await corsair.uniswapapi.api.swap.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `quote` | `object` | Yes | The quote object returned from /v1/quote | | `signature` | `string` | No | Signed Permit2 message; required when the quote returned permitData | | `permitData` | `object` | No | Permit2 message from the quote; must be sent together with its signature | | `refreshGasPrice` | `boolean` | No | Whether to refresh gas price | | `simulateTransaction` | `boolean` | No | Whether to simulate the transaction | > **quote full type** > > ```ts theme={null} > { > } > ``` > **permitData full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `swap` | `object` | Yes | — | | `gasFee` | `string` | No | — | > **swap full type** > > ```ts theme={null} > { > to: string, > from?: string, > data: string, > value: string, > chainId: number, > gasLimit?: string, > maxFeePerGas?: string, > maxPriorityFeePerGas?: string, > gasPrice?: string > } > ``` *** ### getStatus `swap.getStatus` Get swap status (PENDING, SUCCESS, NOT\_FOUND, FAILED, EXPIRED) by tx or userOp hash **Risk:** `read` ```ts theme={null} await corsair.uniswapapi.api.swap.getStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `txHashes` | `string[]` | No | On-chain transaction hashes to query | | `userOpHashes` | `string[]` | No | ERC-4337 userOperation hashes to query | | `chainId` | `number` | Yes | Chain ID the transactions belong to | | `swapper` | `string` | No | Filter results by swapper address | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `swaps` | `object[]` | Yes | — | > **swaps full type** > > ```ts theme={null} > { > status: PENDING | SUCCESS | NOT_FOUND | FAILED | EXPIRED, > swapType?: CLASSIC | DUTCH_LIMIT | DUTCH_V2 | DUTCH_V3 | BRIDGE | LIMIT_ORDER | PRIORITY | WRAP | UNWRAP | CHAINED, > txHash?: string, > userOpHash?: string, > swapId?: string, > hashType?: TX | USER_OP > }[] > ``` *** ## Swappable Tokens ### get `swappableTokens.get` List tokens and chains a source token can be swapped or bridged to **Risk:** `read` ```ts theme={null} await corsair.uniswapapi.api.swappableTokens.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tokenIn` | `string` | Yes | Source token contract address | | `tokenInChainId` | `number` | Yes | Source token chain ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `tokens` | `object[]` | Yes | — | > **tokens full type** > > ```ts theme={null} > { > address: string, > chainId: number, > name: string, > symbol: string, > decimals: number, > project?: { > logo?: { > } | null, > safetyLevel?: string, > isSpam?: boolean > }, > isSpam?: boolean > }[] > ``` *** ## Transaction ### encode7702 `transaction.encode7702` Batch transactions into one for EIP-7702 smart contract wallet execution **Risk:** `write` ```ts theme={null} await corsair.uniswapapi.api.transaction.encode7702({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `calls` | `object[]` | Yes | Transactions to encode; all calls must share the same chainId | | `smartContractDelegationAddress` | `string` | Yes | Smart contract delegation implementation address to use | | `walletAddress` | `string` | Yes | Wallet address the transactions are encoded for | > **calls full type** > > ```ts theme={null} > { > to: string, > from?: string, > data: string, > value: string, > chainId: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `requestId` | `string` | Yes | — | | `encoded` | `object` | Yes | — | > **encoded full type** > > ```ts theme={null} > { > to: string, > from?: string, > data: string, > value: string, > chainId: number, > gasLimit?: string, > maxFeePerGas?: string, > maxPriorityFeePerGas?: string, > gasPrice?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/uniswapapi/database Uniswap local sync: searchable entities, `.search()` filters, and operators. The Uniswap plugin syncs data locally. Use `corsair.uniswapapi.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Approval Path: `uniswapapi.db.approval.search` ```ts theme={null} const rows = await corsair.uniswapapi.db.approval.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `walletAddress` | `string` | equals, contains, startsWith, endsWith, in | | `token` | `string` | equals, contains, startsWith, endsWith, in | | `amount` | `string` | equals, contains, startsWith, endsWith, in | | `chainId` | `number` | equals, gt, gte, lt, lte, in | | `approvalNeeded` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Gasless Order Path: `uniswapapi.db.gaslessOrder.search` ```ts theme={null} const rows = await corsair.uniswapapi.db.gaslessOrder.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `orderId` | `string` | equals, contains, startsWith, endsWith, in | | `orderHash` | `string` | equals, contains, startsWith, endsWith, in | | `orderStatus` | `string` | equals, contains, startsWith, endsWith, in | | `chainId` | `number` | equals, gt, gte, lt, lte, in | | `swapper` | `string` | equals, contains, startsWith, endsWith, in | | `txHash` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Quote Path: `uniswapapi.db.quote.search` ```ts theme={null} const rows = await corsair.uniswapapi.db.quote.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `requestId` | `string` | equals, contains, startsWith, endsWith, in | | `quoteId` | `string` | equals, contains, startsWith, endsWith, in | | `tokenIn` | `string` | equals, contains, startsWith, endsWith, in | | `tokenOut` | `string` | equals, contains, startsWith, endsWith, in | | `tokenInChainId` | `number` | equals, gt, gte, lt, lte, in | | `tokenOutChainId` | `number` | equals, gt, gte, lt, lte, in | | `amountIn` | `string` | equals, contains, startsWith, endsWith, in | | `amountOut` | `string` | equals, contains, startsWith, endsWith, in | | `swapper` | `string` | equals, contains, startsWith, endsWith, in | | `gasEstimate` | `string` | equals, contains, startsWith, endsWith, in | | `gasFeeUSD` | `string` | equals, contains, startsWith, endsWith, in | | `gasFeeQuote` | `string` | equals, contains, startsWith, endsWith, in | | `routeString` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Swap Status Path: `uniswapapi.db.swapStatus.search` ```ts theme={null} const rows = await corsair.uniswapapi.db.swapStatus.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `txHash` | `string` | equals, contains, startsWith, endsWith, in | | `chainId` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Token Path: `uniswapapi.db.token.search` ```ts theme={null} const rows = await corsair.uniswapapi.db.token.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `chainId` | `number` | equals, gt, gte, lt, lte, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `decimals` | `number` | equals, gt, gte, lt, lte, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `buyFeeBps` | `string` | equals, contains, startsWith, endsWith, in | | `sellFeeBps` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/uniswapapi/overview Decentralized exchange protocol API for token swaps, pools, and on-chain liquidity data. Use **Uniswap** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 8 typed API operations * 5 synced entities (`approval`, `gaslessOrder`, `quote`, `swapStatus`, `token`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/uniswapapi ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/uniswapapi ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/uniswapapi ``` ```bash bun theme={null} bun add corsair @corsair-dev/uniswapapi ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { uniswapapi } from '@corsair-dev/uniswapapi'; export const corsair = createCorsair({ plugins: [ uniswapapi(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} uniswapapi() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'uniswapapi', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`approval.check`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.uniswapapi.api.approval.check({}); ``` **`swap.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.uniswapapi.api.swap.create({}); ``` See the full list on the [API](/plugins/uniswapapi/api) page. ## Query synced data Synced entities support `tenant.uniswapapi.db..search()` and `.list()`: `approval`, `gaslessOrder`, `quote`, `swapStatus`, `token`. See [Database](/plugins/uniswapapi/database) for filters and operators. ## What's next > **[API reference](/plugins/uniswapapi/api)** > > Every `uniswapapi.api.*` operation with input and output types. > **[Database](/plugins/uniswapapi/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/updownio/api API reference for Updown.io: every `updownio.api.*` operation with input and output types. Every `updownio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Checks ### list `checks.list` List all monitoring checks on the account **Risk:** `read` ```ts theme={null} await corsair.updownio.api.checks.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > token: string, > url?: string | null, > type?: string | null, > alias?: string | null, > last_status?: number | null, > uptime?: number | null, > down?: boolean | null, > down_since?: string | null, > up_since?: string | null, > error?: string | null, > period?: number | null, > apdex_t?: number | null, > string_match?: string | null, > enabled?: boolean | null, > published?: boolean | null, > disabled_locations?: string[] | null, > recipients?: string[] | null, > last_check_at?: string | null, > next_check_at?: string | null, > created_at?: string | null, > mute_until?: string | null, > favicon_url?: string | null, > custom_headers?: { > } | null, > http_verb?: string | null, > http_body?: string | null, > ssl?: { > tested_at?: string | null, > expires_at?: string | null, > valid?: boolean | null, > error?: string | null, > cert?: { > subject?: string | null, > subject_org?: string | null, > san?: string[] | null, > issuer?: string | null, > issuer_org?: string | null, > from?: string | null, > to?: string | null, > algorithm?: string | null > } | null > } | null, > domain?: { > tested_at?: string | null, > expires_at?: string | null, > remaining_days?: number | null, > source?: string | null > } | null > }[] > ``` *** ## Nodes ### list `nodes.list` List all Updown.io monitoring and webhook nodes **Risk:** `read` ```ts theme={null} await corsair.updownio.api.nodes.list({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### listIps `nodes.listIps` List all Updown.io node IP addresses **Risk:** `read` ```ts theme={null} await corsair.updownio.api.nodes.listIps({}); ``` **Input:** *empty object* **Output:** `(string \| string)[]` *** ### listIpv4 `nodes.listIpv4` List all Updown.io node IPv4 addresses **Risk:** `read` ```ts theme={null} await corsair.updownio.api.nodes.listIpv4({}); ``` **Input:** *empty object* **Output:** `string[]` *** ### listIpv6 `nodes.listIpv6` List all Updown.io node IPv6 addresses **Risk:** `read` ```ts theme={null} await corsair.updownio.api.nodes.listIpv6({}); ``` **Input:** *empty object* **Output:** `string[]` *** # Database Source: https://docs.corsair.dev/plugins/updownio/database Updown.io local sync: searchable entities, `.search()` filters, and operators. The Updown.io plugin syncs data locally. Use `corsair.updownio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Checks Path: `updownio.db.checks.search` ```ts theme={null} const rows = await corsair.updownio.db.checks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `token` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `last_status` | `number` | equals, gt, gte, lt, lte, in | | `uptime` | `number` | equals, gt, gte, lt, lte, in | | `down` | `boolean` | equals | | `down_since` | `string` | equals, contains, startsWith, endsWith, in | | `up_since` | `string` | equals, contains, startsWith, endsWith, in | | `error` | `string` | equals, contains, startsWith, endsWith, in | | `period` | `number` | equals, gt, gte, lt, lte, in | | `apdex_t` | `number` | equals, gt, gte, lt, lte, in | | `string_match` | `string` | equals, contains, startsWith, endsWith, in | | `enabled` | `boolean` | equals | | `published` | `boolean` | equals | | `last_check_at` | `string` | equals, contains, startsWith, endsWith, in | | `next_check_at` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `mute_until` | `string` | equals, contains, startsWith, endsWith, in | | `favicon_url` | `string` | equals, contains, startsWith, endsWith, in | | `http_verb` | `string` | equals, contains, startsWith, endsWith, in | | `http_body` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Nodes Path: `updownio.db.nodes.search` ```ts theme={null} const rows = await corsair.updownio.db.nodes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ip` | `string` | equals, contains, startsWith, endsWith, in | | `ip6` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `country_code` | `string` | equals, contains, startsWith, endsWith, in | | `lat` | `number` | equals, gt, gte, lt, lte, in | | `lng` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/updownio/overview Website and API uptime monitoring - read your checks and the monitoring node addresses to allowlist. Use **Updown.io** through Corsair: one client, typed API calls, local DB sync. All five operations are read-only catalog endpoints backed by the Updown.io API. **What you get:** * 5 typed API operations * 2 synced entities (`checks`, `nodes`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/updownio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/updownio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/updownio ``` ```bash bun theme={null} bun add corsair @corsair-dev/updownio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { updownio } from '@corsair-dev/updownio'; export const corsair = createCorsair({ plugins: [ updownio(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} updownio() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'updownio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`checks.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.updownio.api.checks.list({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/updownio/api) reference.* See the full list on the [API](/plugins/updownio/api) page. ## Query synced data Synced entities support `tenant.updownio.db..search()` and `.list()`: `checks`, `nodes`. See [Database](/plugins/updownio/database) for filters and operators. ## What's next > **[API reference](/plugins/updownio/api)** > > Every `updownio.api.*` operation with input and output types. > **[Database](/plugins/updownio/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/uploadcare/api API reference for Uploadcare: every `uploadcare.api.*` operation with input and output types. Every `uploadcare.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Addons ### clamavStatus `addons.clamavStatus` Check ClamAV scan status **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.addons.clamavStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `in_progress \| error \| done \| unknown` | Yes | — | *** ### executeClamav `addons.executeClamav` Start a ClamAV virus scan **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.addons.executeClamav({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target` | `string` | Yes | — | | `params` | `object` | No | — | > **params full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | *** ### rekognitionModerationStatus `addons.rekognitionModerationStatus` Check AWS Rekognition moderation job status **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.addons.rekognitionModerationStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `in_progress \| error \| done \| unknown` | Yes | — | *** ### rekognitionStatus `addons.rekognitionStatus` Check AWS Rekognition labels job status **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.addons.rekognitionStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `in_progress \| error \| done \| unknown` | Yes | — | *** ### removeBgStatus `addons.removeBgStatus` Check Remove.bg add-on status **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.addons.removeBgStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `request_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `in_progress \| error \| done \| unknown` | Yes | — | *** ## Cdn ### mirror `cdn.mirror` CDN URL for a horizontally mirrored image **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.cdn.mirror({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | *** ### rotate `cdn.rotate` CDN URL for a counterclockwise rotated image **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.cdn.rotate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `degrees` | `90 \| 180 \| 270` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | *** ## Files ### batchDelete `files.batchDelete` Delete up to 100 files; problems lists invalid UUIDs **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.files.batchDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `problems` | `object` | No | — | | `result` | `object[]` | No | — | > **problems full type** > > ```ts theme={null} > { > } > ``` > **result full type** > > ```ts theme={null} > { > uuid: string, > datetime_removed?: string | null, > datetime_stored?: string | null, > datetime_uploaded?: string, > is_image?: boolean, > is_ready?: boolean, > mime_type?: string, > original_file_url?: string | null, > original_filename?: string, > size?: number, > url?: string, > variations?: { > } | null, > content_info?: { > }, > metadata?: { > }, > appdata?: { > }, > tags?: string[] > }[] > ``` *** ### batchStore `files.batchStore` Store up to 100 files in one request **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.files.batchStore({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `problems` | `object` | No | — | | `result` | `object[]` | No | — | > **problems full type** > > ```ts theme={null} > { > } > ``` > **result full type** > > ```ts theme={null} > { > uuid: string, > datetime_removed?: string | null, > datetime_stored?: string | null, > datetime_uploaded?: string, > is_image?: boolean, > is_ready?: boolean, > mime_type?: string, > original_file_url?: string | null, > original_filename?: string, > size?: number, > url?: string, > variations?: { > } | null, > content_info?: { > }, > metadata?: { > }, > appdata?: { > }, > tags?: string[] > }[] > ``` *** ### copyLocal `files.copyLocal` Copy a file to local storage in the same project **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.files.copyLocal({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `source` | `string` | Yes | — | | `store` | `boolean` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `result` | `object` | No | — | > **result full type** > > ```ts theme={null} > { > uuid: string, > datetime_removed?: string | null, > datetime_stored?: string | null, > datetime_uploaded?: string, > is_image?: boolean, > is_ready?: boolean, > mime_type?: string, > original_file_url?: string | null, > original_filename?: string, > size?: number, > url?: string, > variations?: { > } | null, > content_info?: { > }, > metadata?: { > }, > appdata?: { > }, > tags?: string[] > } > ``` *** ### delete `files.delete` Delete a stored file by UUID **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `include` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `datetime_removed` | `string` | No | — | | `datetime_stored` | `string` | No | — | | `datetime_uploaded` | `string` | No | — | | `is_image` | `boolean` | No | — | | `is_ready` | `boolean` | No | — | | `mime_type` | `string` | No | — | | `original_file_url` | `string` | No | — | | `original_filename` | `string` | No | — | | `size` | `number` | No | — | | `url` | `string` | No | — | | `variations` | `object` | No | — | | `content_info` | `object` | No | — | | `metadata` | `object` | No | — | | `appdata` | `object` | No | — | | `tags` | `string[]` | No | — | > **variations full type** > > ```ts theme={null} > { > } > ``` > **content\_info full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **appdata full type** > > ```ts theme={null} > { > } > ``` *** ### deleteMetadataKey `files.deleteMetadataKey` Delete a metadata key from a file **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.files.deleteMetadataKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `files.get` Get file info by UUID (official REST v0.7) **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `include` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `datetime_removed` | `string` | No | — | | `datetime_stored` | `string` | No | — | | `datetime_uploaded` | `string` | No | — | | `is_image` | `boolean` | No | — | | `is_ready` | `boolean` | No | — | | `mime_type` | `string` | No | — | | `original_file_url` | `string` | No | — | | `original_filename` | `string` | No | — | | `size` | `number` | No | — | | `url` | `string` | No | — | | `variations` | `object` | No | — | | `content_info` | `object` | No | — | | `metadata` | `object` | No | — | | `appdata` | `object` | No | — | | `tags` | `string[]` | No | — | > **variations full type** > > ```ts theme={null} > { > } > ``` > **content\_info full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **appdata full type** > > ```ts theme={null} > { > } > ``` *** ### getMetadata `files.getMetadata` Get all metadata key-value pairs for a file **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.files.getMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### getMetadataKey `files.getMetadataKey` Get one metadata value by key **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.files.getMetadataKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `key` | `string` | Yes | — | **Output:** `string` *** ### list `files.list` List files with pagination, stored/removed filters **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `removed` | `boolean` | No | — | | `stored` | `boolean` | No | — | | `limit` | `number` | No | — | | `ordering` | `datetime_uploaded \| -datetime_uploaded` | No | — | | `from` | `string` | No | — | | `include` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `total` | `number` | No | — | | `totals` | `object` | No | — | | `per_page` | `number` | No | — | | `results` | `object[]` | Yes | — | > **totals full type** > > ```ts theme={null} > { > removed?: number, > stored?: number, > unstored?: number > } > ``` > **results full type** > > ```ts theme={null} > { > uuid: string, > datetime_removed?: string | null, > datetime_stored?: string | null, > datetime_uploaded?: string, > is_image?: boolean, > is_ready?: boolean, > mime_type?: string, > original_file_url?: string | null, > original_filename?: string, > size?: number, > url?: string, > variations?: { > } | null, > content_info?: { > }, > metadata?: { > }, > appdata?: { > }, > tags?: string[] > }[] > ``` *** ### store `files.store` Permanently store a file by UUID **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.files.store({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `include` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `datetime_removed` | `string` | No | — | | `datetime_stored` | `string` | No | — | | `datetime_uploaded` | `string` | No | — | | `is_image` | `boolean` | No | — | | `is_ready` | `boolean` | No | — | | `mime_type` | `string` | No | — | | `original_file_url` | `string` | No | — | | `original_filename` | `string` | No | — | | `size` | `number` | No | — | | `url` | `string` | No | — | | `variations` | `object` | No | — | | `content_info` | `object` | No | — | | `metadata` | `object` | No | — | | `appdata` | `object` | No | — | | `tags` | `string[]` | No | — | > **variations full type** > > ```ts theme={null} > { > } > ``` > **content\_info full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **appdata full type** > > ```ts theme={null} > { > } > ``` *** ### updateMetadataKey `files.updateMetadataKey` Set a metadata key on a file **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.files.updateMetadataKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `key` | `string` | Yes | — | | `value` | `string` | Yes | — | **Output:** `string` *** ## Groups ### delete `groups.delete` Delete a group (files are not deleted) **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.groups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `groups.get` Get group info by ID **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.groups.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `datetime_created` | `string` | No | — | | `files_count` | `number` | No | — | | `cdn_url` | `string` | No | — | | `url` | `string` | No | — | | `files` | `lazy[]` | No | — | *** ### list `groups.list` List file groups **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.groups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | No | — | | `limit` | `number` | No | — | | `ordering` | `datetime_created \| -datetime_created` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next` | `string` | No | — | | `previous` | `string` | No | — | | `total` | `number` | No | — | | `per_page` | `number` | No | — | | `results` | `object[]` | Yes | — | > **results full type** > > ```ts theme={null} > { > id: string, > datetime_created?: string | null, > files_count?: number, > cdn_url?: string, > url?: string, > files?: lazy[] | null > }[] > ``` *** ## Project ### get `project.get` Get current project info **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.project.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `pub_key` | `string` | No | — | | `collaborators` | `object[]` | No | — | > **collaborators full type** > > ```ts theme={null} > { > email?: string, > name?: string > }[] > ``` *** ## Upload ### createGroup `upload.createGroup` Create a file group via Upload API **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.upload.createGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `files` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `datetime_created` | `string` | No | — | | `files_count` | `number` | No | — | | `cdn_url` | `string` | No | — | | `url` | `string` | No | — | | `files` | `lazy[]` | No | — | *** ### fileInfo `upload.fileInfo` Get uploaded file info from Upload API **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.upload.fileInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | No | — | | `file_id` | `string` | No | — | | `size` | `number` | No | — | | `original_filename` | `string` | No | — | | `filename` | `string` | No | — | | `mime_type` | `string` | No | — | | `is_image` | `boolean` | No | — | | `is_stored` | `boolean` | No | — | *** ### fromUrl `upload.fromUrl` Upload a file from a public URL **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.upload.fromUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `source_url` | `string` | Yes | — | | `store` | `0 \| 1 \| auto` | No | — | | `filename` | `string` | No | — | | `check_URL_duplicates` | `0 \| 1` | No | — | | `save_URL_duplicates` | `0 \| 1` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `token` | `string` | No | — | | `uuid` | `string` | No | — | | `file_id` | `string` | No | — | *** ### fromUrlStatus `upload.fromUrlStatus` Check from-URL upload status **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.upload.fromUrlStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `token` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | — | | `uuid` | `string` | No | — | | `file_id` | `string` | No | — | | `error` | `string` | No | — | *** ### groupInfo `upload.groupInfo` Get file group info from Upload API **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.upload.groupInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `group_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `datetime_created` | `string` | No | — | | `files_count` | `number` | No | — | | `cdn_url` | `string` | No | — | | `url` | `string` | No | — | | `files` | `lazy[]` | No | — | *** ### startMultipart `upload.startMultipart` Start multipart upload for files over 100MB **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.upload.startMultipart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `filename` | `string` | Yes | — | | `size` | `number` | Yes | — | | `content_type` | `string` | Yes | — | | `store` | `0 \| 1 \| auto` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | Yes | — | | `parts` | `string[]` | Yes | — | *** ## Webhooks ### create `webhooks.create` Create a webhook subscription **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target_url` | `string` | Yes | — | | `event` | `string` | Yes | — | | `is_active` | `boolean` | No | — | | `signing_secret` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | | `event` | `string` | No | — | | `target_url` | `string` | No | — | | `project` | `number` | No | — | | `is_active` | `boolean` | No | — | | `signing_secret` | `string` | No | — | *** ### delete `webhooks.delete` Delete a webhook by ID **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.webhooks.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### deleteByUrl `webhooks.deleteByUrl` Unsubscribe a webhook by target URL **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.webhooks.deleteByUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `target_url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### list `webhooks.list` List project webhooks **Risk:** `read` ```ts theme={null} await corsair.uploadcare.api.webhooks.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > created?: string, > updated?: string, > event?: string, > target_url?: string, > project?: number, > is_active?: boolean, > signing_secret?: string | null > }[] > ``` *** ### update `webhooks.update` Update a webhook **Risk:** `write` ```ts theme={null} await corsair.uploadcare.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webhook_id` | `number` | Yes | — | | `target_url` | `string` | No | — | | `event` | `string` | No | — | | `is_active` | `boolean` | No | — | | `signing_secret` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `created` | `string` | No | — | | `updated` | `string` | No | — | | `event` | `string` | No | — | | `target_url` | `string` | No | — | | `project` | `number` | No | — | | `is_active` | `boolean` | No | — | | `signing_secret` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/uploadcare/database Uploadcare local sync: searchable entities, `.search()` filters, and operators. The Uploadcare plugin syncs data locally. Use `corsair.uploadcare.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Uploadcare File Path: `uploadcare.db.UploadcareFile.search` ```ts theme={null} const rows = await corsair.uploadcare.db.UploadcareFile.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `datetime_uploaded` | `string` | equals, contains, startsWith, endsWith, in | | `datetime_stored` | `string` | equals, contains, startsWith, endsWith, in | | `datetime_removed` | `string` | equals, contains, startsWith, endsWith, in | | `is_image` | `boolean` | equals | | `is_ready` | `boolean` | equals | | `mime_type` | `string` | equals, contains, startsWith, endsWith, in | | `original_filename` | `string` | equals, contains, startsWith, endsWith, in | | `original_file_url` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Uploadcare Group Path: `uploadcare.db.UploadcareGroup.search` ```ts theme={null} const rows = await corsair.uploadcare.db.UploadcareGroup.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `datetime_created` | `string` | equals, contains, startsWith, endsWith, in | | `files_count` | `number` | equals, gt, gte, lt, lte, in | | `cdn_url` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/uploadcare/overview Uploadcare plugin for Corsair Use **Uploadcare** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 33 typed API operations * 2 synced entities (`UploadcareFile`, `UploadcareGroup`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/uploadcare ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/uploadcare ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/uploadcare ``` ```bash bun theme={null} bun add corsair @corsair-dev/uploadcare ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { uploadcare } from '@corsair-dev/uploadcare'; export const corsair = createCorsair({ plugins: [ uploadcare(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} uploadcare() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'uploadcare', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`addons.clamavStatus`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.uploadcare.api.addons.clamavStatus({}); ``` **`addons.executeClamav`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.uploadcare.api.addons.executeClamav({}); ``` See the full list on the [API](/plugins/uploadcare/api) page. ## Query synced data Synced entities support `tenant.uploadcare.db..search()` and `.list()`: `UploadcareFile`, `UploadcareGroup`. See [Database](/plugins/uploadcare/database) for filters and operators. ## What's next > **[API reference](/plugins/uploadcare/api)** > > Every `uploadcare.api.*` operation with input and output types. > **[Database](/plugins/uploadcare/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/vapi/api API reference for Vapi: every `vapi.api.*` operation with input and output types. Every `vapi.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Assistants ### create `assistants.create` Create a new Vapi assistant **Risk:** `write` ```ts theme={null} await corsair.vapi.api.assistants.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `model` | `object` | No | — | | `voice` | `object` | No | — | | `transcriber` | `object` | No | — | | `firstMessage` | `string` | No | — | | `systemPrompt` | `string` | No | — | | `endCallMessage` | `string` | No | — | | `endCallPhrases` | `string[]` | No | — | | `metadata` | `object` | No | — | | `serverUrl` | `string` | No | — | | `serverUrlSecret` | `string` | No | — | | `analysisPlan` | `object` | No | — | | `artifactPlan` | `object` | No | — | | `messagePlan` | `object` | No | — | | `startSpeakingPlan` | `object` | No | — | | `stopSpeakingPlan` | `object` | No | — | | `hipaaEnabled` | `boolean` | No | — | | `clientMessages` | `string[]` | No | — | | `serverMessages` | `string[]` | No | — | | `silenceTimeoutSeconds` | `number` | No | — | | `maxDurationSeconds` | `number` | No | — | | `backgroundSound` | `string` | No | — | | `backchannelingEnabled` | `boolean` | No | — | | `backgroundDenoisingEnabled` | `boolean` | No | — | | `modelOutputInMessagesEnabled` | `boolean` | No | — | > **model full type** > > ```ts theme={null} > { > } > ``` > **voice full type** > > ```ts theme={null} > { > } > ``` > **transcriber full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **analysisPlan full type** > > ```ts theme={null} > { > } > ``` > **artifactPlan full type** > > ```ts theme={null} > { > } > ``` > **messagePlan full type** > > ```ts theme={null} > { > } > ``` > **startSpeakingPlan full type** > > ```ts theme={null} > { > } > ``` > **stopSpeakingPlan full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `name` | `string` | No | — | | `model` | `object` | No | — | | `voice` | `object` | No | — | | `transcriber` | `object` | No | — | | `firstMessage` | `string` | No | — | | `systemPrompt` | `string` | No | — | | `endCallMessage` | `string` | No | — | | `endCallPhrases` | `string[]` | No | — | | `metadata` | `object` | No | — | | `serverUrl` | `string` | No | — | | `hipaaEnabled` | `boolean` | No | — | > **model full type** > > ```ts theme={null} > { > } > ``` > **voice full type** > > ```ts theme={null} > { > } > ``` > **transcriber full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `assistants.delete` Delete a Vapi assistant **Risk:** `destructive` ```ts theme={null} await corsair.vapi.api.assistants.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `assistants.get` Retrieve a Vapi assistant by ID **Risk:** `read` ```ts theme={null} await corsair.vapi.api.assistants.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `name` | `string` | No | — | | `model` | `object` | No | — | | `voice` | `object` | No | — | | `transcriber` | `object` | No | — | | `firstMessage` | `string` | No | — | | `systemPrompt` | `string` | No | — | | `endCallMessage` | `string` | No | — | | `endCallPhrases` | `string[]` | No | — | | `metadata` | `object` | No | — | | `serverUrl` | `string` | No | — | | `hipaaEnabled` | `boolean` | No | — | > **model full type** > > ```ts theme={null} > { > } > ``` > **voice full type** > > ```ts theme={null} > { > } > ``` > **transcriber full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `assistants.list` List all Vapi assistants **Risk:** `read` ```ts theme={null} await corsair.vapi.api.assistants.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `createdAtGt` | `string` | No | — | | `createdAtLt` | `string` | No | — | | `createdAtGe` | `string` | No | — | | `createdAtLe` | `string` | No | — | | `updatedAtGt` | `string` | No | — | | `updatedAtLt` | `string` | No | — | | `updatedAtGe` | `string` | No | — | | `updatedAtLe` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > createdAt?: string, > updatedAt?: string, > name?: string | null, > model?: { > }, > voice?: { > }, > transcriber?: { > }, > firstMessage?: string | null, > systemPrompt?: string | null, > endCallMessage?: string | null, > endCallPhrases?: string[], > metadata?: { > }, > serverUrl?: string | null, > hipaaEnabled?: boolean > }[] > ``` *** ### update `assistants.update` Update a Vapi assistant **Risk:** `write` ```ts theme={null} await corsair.vapi.api.assistants.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `model` | `object` | No | — | | `voice` | `object` | No | — | | `transcriber` | `object` | No | — | | `firstMessage` | `string` | No | — | | `systemPrompt` | `string` | No | — | | `endCallMessage` | `string` | No | — | | `endCallPhrases` | `string[]` | No | — | | `metadata` | `object` | No | — | | `serverUrl` | `string` | No | — | | `serverUrlSecret` | `string` | No | — | | `analysisPlan` | `object` | No | — | | `artifactPlan` | `object` | No | — | | `messagePlan` | `object` | No | — | | `startSpeakingPlan` | `object` | No | — | | `stopSpeakingPlan` | `object` | No | — | | `hipaaEnabled` | `boolean` | No | — | | `clientMessages` | `string[]` | No | — | | `serverMessages` | `string[]` | No | — | | `silenceTimeoutSeconds` | `number` | No | — | | `maxDurationSeconds` | `number` | No | — | | `backgroundSound` | `string` | No | — | | `backchannelingEnabled` | `boolean` | No | — | | `backgroundDenoisingEnabled` | `boolean` | No | — | | `modelOutputInMessagesEnabled` | `boolean` | No | — | | `id` | `string` | Yes | — | > **model full type** > > ```ts theme={null} > { > } > ``` > **voice full type** > > ```ts theme={null} > { > } > ``` > **transcriber full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` > **analysisPlan full type** > > ```ts theme={null} > { > } > ``` > **artifactPlan full type** > > ```ts theme={null} > { > } > ``` > **messagePlan full type** > > ```ts theme={null} > { > } > ``` > **startSpeakingPlan full type** > > ```ts theme={null} > { > } > ``` > **stopSpeakingPlan full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `name` | `string` | No | — | | `model` | `object` | No | — | | `voice` | `object` | No | — | | `transcriber` | `object` | No | — | | `firstMessage` | `string` | No | — | | `systemPrompt` | `string` | No | — | | `endCallMessage` | `string` | No | — | | `endCallPhrases` | `string[]` | No | — | | `metadata` | `object` | No | — | | `serverUrl` | `string` | No | — | | `hipaaEnabled` | `boolean` | No | — | > **model full type** > > ```ts theme={null} > { > } > ``` > **voice full type** > > ```ts theme={null} > { > } > ``` > **transcriber full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Calls ### create `calls.create` Create (initiate) a new Vapi call **Risk:** `write` ```ts theme={null} await corsair.vapi.api.calls.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `assistantId` | `string` | No | — | | `assistant` | `object` | No | — | | `assistantOverrides` | `object` | No | — | | `squadId` | `string` | No | — | | `squad` | `object` | No | — | | `phoneNumberId` | `string` | No | — | | `phoneNumber` | `object` | No | — | | `customerId` | `string` | No | — | | `customer` | `object` | No | — | | `name` | `string` | No | — | | `metadata` | `object` | No | — | | `scheduledAt` | `string` | No | — | > **assistant full type** > > ```ts theme={null} > { > } > ``` > **assistantOverrides full type** > > ```ts theme={null} > { > } > ``` > **squad full type** > > ```ts theme={null} > { > } > ``` > **phoneNumber full type** > > ```ts theme={null} > { > } > ``` > **customer full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `endedReason` | `string` | No | — | | `assistantId` | `string` | No | — | | `phoneNumberId` | `string` | No | — | | `squadId` | `string` | No | — | | `startedAt` | `string` | No | — | | `endedAt` | `string` | No | — | | `cost` | `number` | No | — | | `messages` | `object[]` | No | — | | `artifact` | `object` | No | — | | `analysis` | `object` | No | — | | `metadata` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` > **artifact full type** > > ```ts theme={null} > { > } > ``` > **analysis full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `calls.delete` Delete a Vapi call **Risk:** `destructive` ```ts theme={null} await corsair.vapi.api.calls.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `calls.get` Retrieve a Vapi call by ID **Risk:** `read` ```ts theme={null} await corsair.vapi.api.calls.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `endedReason` | `string` | No | — | | `assistantId` | `string` | No | — | | `phoneNumberId` | `string` | No | — | | `squadId` | `string` | No | — | | `startedAt` | `string` | No | — | | `endedAt` | `string` | No | — | | `cost` | `number` | No | — | | `messages` | `object[]` | No | — | | `artifact` | `object` | No | — | | `analysis` | `object` | No | — | | `metadata` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` > **artifact full type** > > ```ts theme={null} > { > } > ``` > **analysis full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `calls.list` List all Vapi calls with optional filters **Risk:** `read` ```ts theme={null} await corsair.vapi.api.calls.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `createdAtGt` | `string` | No | — | | `createdAtLt` | `string` | No | — | | `createdAtGe` | `string` | No | — | | `createdAtLe` | `string` | No | — | | `updatedAtGt` | `string` | No | — | | `updatedAtLt` | `string` | No | — | | `updatedAtGe` | `string` | No | — | | `updatedAtLe` | `string` | No | — | | `id` | `string` | No | — | | `assistantId` | `string` | No | — | | `phoneNumberId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > createdAt?: string, > updatedAt?: string, > type?: string, > status?: string, > endedReason?: string | null, > assistantId?: string | null, > phoneNumberId?: string | null, > squadId?: string | null, > startedAt?: string | null, > endedAt?: string | null, > cost?: number, > messages?: { > }[], > artifact?: { > }, > analysis?: { > }, > metadata?: { > } > }[] > ``` *** ### update `calls.update` Update a Vapi call **Risk:** `write` ```ts theme={null} await corsair.vapi.api.calls.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `assistantOverrides` | `object` | No | — | | `metadata` | `object` | No | — | > **assistantOverrides full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `type` | `string` | No | — | | `status` | `string` | No | — | | `endedReason` | `string` | No | — | | `assistantId` | `string` | No | — | | `phoneNumberId` | `string` | No | — | | `squadId` | `string` | No | — | | `startedAt` | `string` | No | — | | `endedAt` | `string` | No | — | | `cost` | `number` | No | — | | `messages` | `object[]` | No | — | | `artifact` | `object` | No | — | | `analysis` | `object` | No | — | | `metadata` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` > **artifact full type** > > ```ts theme={null} > { > } > ``` > **analysis full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Files ### delete `files.delete` Delete a Vapi file **Risk:** `destructive` ```ts theme={null} await corsair.vapi.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `files.get` Retrieve a Vapi file by ID **Risk:** `read` ```ts theme={null} await corsair.vapi.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `name` | `string` | No | — | | `originalName` | `string` | No | — | | `mimeType` | `string` | No | — | | `size` | `number` | No | — | | `status` | `string` | No | — | | `url` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `files.list` List all Vapi files **Risk:** `read` ```ts theme={null} await corsair.vapi.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `createdAtGt` | `string` | No | — | | `createdAtLt` | `string` | No | — | | `createdAtGe` | `string` | No | — | | `createdAtLe` | `string` | No | — | | `updatedAtGt` | `string` | No | — | | `updatedAtLt` | `string` | No | — | | `updatedAtGe` | `string` | No | — | | `updatedAtLe` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > createdAt?: string, > updatedAt?: string, > name?: string, > originalName?: string, > mimeType?: string, > size?: number, > status?: string, > url?: string, > metadata?: { > } > }[] > ``` *** ### update `files.update` Update a Vapi file **Risk:** `write` ```ts theme={null} await corsair.vapi.api.files.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `name` | `string` | No | — | | `originalName` | `string` | No | — | | `mimeType` | `string` | No | — | | `size` | `number` | No | — | | `status` | `string` | No | — | | `url` | `string` | No | — | | `metadata` | `object` | No | — | > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Knowledge Bases ### create `knowledgeBases.create` Create a new Vapi knowledge base **Risk:** `write` ```ts theme={null} await corsair.vapi.api.knowledgeBases.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `provider` | `string` | Yes | — | | `server` | `object` | No | — | | `name` | `string` | No | — | > **server full type** > > ```ts theme={null} > { > url: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `provider` | `string` | No | — | | `name` | `string` | No | — | | `server` | `object` | No | — | > **server full type** > > ```ts theme={null} > { > } > ``` *** ### delete `knowledgeBases.delete` Delete a Vapi knowledge base **Risk:** `destructive` ```ts theme={null} await corsair.vapi.api.knowledgeBases.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `knowledgeBases.get` Retrieve a Vapi knowledge base by ID **Risk:** `read` ```ts theme={null} await corsair.vapi.api.knowledgeBases.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `provider` | `string` | No | — | | `name` | `string` | No | — | | `server` | `object` | No | — | > **server full type** > > ```ts theme={null} > { > } > ``` *** ### list `knowledgeBases.list` List all Vapi knowledge bases **Risk:** `read` ```ts theme={null} await corsair.vapi.api.knowledgeBases.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `createdAtGt` | `string` | No | — | | `createdAtLt` | `string` | No | — | | `createdAtGe` | `string` | No | — | | `createdAtLe` | `string` | No | — | | `updatedAtGt` | `string` | No | — | | `updatedAtLt` | `string` | No | — | | `updatedAtGe` | `string` | No | — | | `updatedAtLe` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > createdAt?: string, > updatedAt?: string, > provider?: string, > name?: string | null, > server?: { > } > }[] > ``` *** ### update `knowledgeBases.update` Update a Vapi knowledge base **Risk:** `write` ```ts theme={null} await corsair.vapi.api.knowledgeBases.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `provider` | `string` | No | — | | `name` | `string` | No | — | | `server` | `object` | No | — | > **server full type** > > ```ts theme={null} > { > } > ``` *** ## Phone Numbers ### create `phoneNumbers.create` Create a new Vapi phone number **Risk:** `write` ```ts theme={null} await corsair.vapi.api.phoneNumbers.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `provider` | `twilio \| vonage \| vapi \| telnyx` | No | — | | `number` | `string` | No | — | | `twilioAccountSid` | `string` | No | — | | `twilioAuthToken` | `string` | No | — | | `vonageApiKey` | `string` | No | — | | `vonageApiSecret` | `string` | No | — | | `name` | `string` | No | — | | `assistantId` | `string` | No | — | | `squadId` | `string` | No | — | | `serverUrl` | `string` | No | — | | `serverUrlSecret` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `provider` | `string` | No | — | | `number` | `string` | No | — | | `name` | `string` | No | — | | `assistantId` | `string` | No | — | | `squadId` | `string` | No | — | | `serverUrl` | `string` | No | — | *** ### delete `phoneNumbers.delete` Delete a Vapi phone number **Risk:** `destructive` ```ts theme={null} await corsair.vapi.api.phoneNumbers.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `phoneNumbers.get` Retrieve a Vapi phone number by ID **Risk:** `read` ```ts theme={null} await corsair.vapi.api.phoneNumbers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `provider` | `string` | No | — | | `number` | `string` | No | — | | `name` | `string` | No | — | | `assistantId` | `string` | No | — | | `squadId` | `string` | No | — | | `serverUrl` | `string` | No | — | *** ### list `phoneNumbers.list` List all Vapi phone numbers **Risk:** `read` ```ts theme={null} await corsair.vapi.api.phoneNumbers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `createdAtGt` | `string` | No | — | | `createdAtLt` | `string` | No | — | | `createdAtGe` | `string` | No | — | | `createdAtLe` | `string` | No | — | | `updatedAtGt` | `string` | No | — | | `updatedAtLt` | `string` | No | — | | `updatedAtGe` | `string` | No | — | | `updatedAtLe` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > createdAt?: string, > updatedAt?: string, > provider?: string, > number?: string, > name?: string | null, > assistantId?: string | null, > squadId?: string | null, > serverUrl?: string | null > }[] > ``` *** ### update `phoneNumbers.update` Update a Vapi phone number **Risk:** `write` ```ts theme={null} await corsair.vapi.api.phoneNumbers.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `assistantId` | `string` | No | — | | `squadId` | `string` | No | — | | `serverUrl` | `string` | No | — | | `serverUrlSecret` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `provider` | `string` | No | — | | `number` | `string` | No | — | | `name` | `string` | No | — | | `assistantId` | `string` | No | — | | `squadId` | `string` | No | — | | `serverUrl` | `string` | No | — | *** ## Squads ### create `squads.create` Create a new Vapi squad **Risk:** `write` ```ts theme={null} await corsair.vapi.api.squads.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `members` | `object[]` | No | — | | `membersOverrides` | `object` | No | — | | `metadata` | `object` | No | — | > **members full type** > > ```ts theme={null} > { > }[] > ``` > **membersOverrides full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `name` | `string` | No | — | | `members` | `object[]` | No | — | | `metadata` | `object` | No | — | > **members full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `squads.delete` Delete a Vapi squad **Risk:** `destructive` ```ts theme={null} await corsair.vapi.api.squads.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `squads.get` Retrieve a Vapi squad by ID **Risk:** `read` ```ts theme={null} await corsair.vapi.api.squads.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `name` | `string` | No | — | | `members` | `object[]` | No | — | | `metadata` | `object` | No | — | > **members full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `squads.list` List all Vapi squads **Risk:** `read` ```ts theme={null} await corsair.vapi.api.squads.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `createdAtGt` | `string` | No | — | | `createdAtLt` | `string` | No | — | | `createdAtGe` | `string` | No | — | | `createdAtLe` | `string` | No | — | | `updatedAtGt` | `string` | No | — | | `updatedAtLt` | `string` | No | — | | `updatedAtGe` | `string` | No | — | | `updatedAtLe` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > createdAt?: string, > updatedAt?: string, > name?: string | null, > members?: { > }[], > metadata?: { > } > }[] > ``` *** ### update `squads.update` Update a Vapi squad **Risk:** `write` ```ts theme={null} await corsair.vapi.api.squads.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `members` | `object[]` | No | — | | `membersOverrides` | `object` | No | — | | `metadata` | `object` | No | — | | `id` | `string` | Yes | — | > **members full type** > > ```ts theme={null} > { > }[] > ``` > **membersOverrides full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `name` | `string` | No | — | | `members` | `object[]` | No | — | | `metadata` | `object` | No | — | > **members full type** > > ```ts theme={null} > { > }[] > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ## Tools ### create `tools.create` Create a new Vapi tool **Risk:** `write` ```ts theme={null} await corsair.vapi.api.tools.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `async` | `boolean` | No | — | | `messages` | `object[]` | No | — | | `function` | `object` | No | — | | `server` | `object` | No | — | | `metadata` | `object` | No | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` > **function full type** > > ```ts theme={null} > { > } > ``` > **server full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `type` | `string` | No | — | | `function` | `object` | No | — | | `server` | `object` | No | — | | `metadata` | `object` | No | — | > **function full type** > > ```ts theme={null} > { > } > ``` > **server full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### delete `tools.delete` Delete a Vapi tool **Risk:** `destructive` ```ts theme={null} await corsair.vapi.api.tools.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ### get `tools.get` Retrieve a Vapi tool by ID **Risk:** `read` ```ts theme={null} await corsair.vapi.api.tools.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `type` | `string` | No | — | | `function` | `object` | No | — | | `server` | `object` | No | — | | `metadata` | `object` | No | — | > **function full type** > > ```ts theme={null} > { > } > ``` > **server full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** ### list `tools.list` List all Vapi tools **Risk:** `read` ```ts theme={null} await corsair.vapi.api.tools.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `createdAtGt` | `string` | No | — | | `createdAtLt` | `string` | No | — | | `createdAtGe` | `string` | No | — | | `createdAtLe` | `string` | No | — | | `updatedAtGt` | `string` | No | — | | `updatedAtLt` | `string` | No | — | | `updatedAtGe` | `string` | No | — | | `updatedAtLe` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > orgId?: string, > createdAt?: string, > updatedAt?: string, > type?: string, > function?: { > }, > server?: { > }, > metadata?: { > } > }[] > ``` *** ### update `tools.update` Update a Vapi tool **Risk:** `write` ```ts theme={null} await corsair.vapi.api.tools.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `async` | `boolean` | No | — | | `messages` | `object[]` | No | — | | `function` | `object` | No | — | | `server` | `object` | No | — | | `metadata` | `object` | No | — | | `id` | `string` | Yes | — | > **messages full type** > > ```ts theme={null} > { > }[] > ``` > **function full type** > > ```ts theme={null} > { > } > ``` > **server full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `orgId` | `string` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | | `type` | `string` | No | — | | `function` | `object` | No | — | | `server` | `object` | No | — | | `metadata` | `object` | No | — | > **function full type** > > ```ts theme={null} > { > } > ``` > **server full type** > > ```ts theme={null} > { > } > ``` > **metadata full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/vapi/database Vapi local sync: searchable entities, `.search()` filters, and operators. The Vapi plugin syncs data locally. Use `corsair.vapi.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Assistants Path: `vapi.db.assistants.search` ```ts theme={null} const rows = await corsair.vapi.db.assistants.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `orgId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `firstMessage` | `string` | equals, contains, startsWith, endsWith, in | | `serverUrl` | `string` | equals, contains, startsWith, endsWith, in | | `hipaaEnabled` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Calls Path: `vapi.db.calls.search` ```ts theme={null} const rows = await corsair.vapi.db.calls.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `orgId` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `endedReason` | `string` | equals, contains, startsWith, endsWith, in | | `assistantId` | `string` | equals, contains, startsWith, endsWith, in | | `phoneNumberId` | `string` | equals, contains, startsWith, endsWith, in | | `squadId` | `string` | equals, contains, startsWith, endsWith, in | | `cost` | `number` | equals, gt, gte, lt, lte, in | | `startedAt` | `date` | equals, before, after, between | | `endedAt` | `date` | equals, before, after, between | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Files Path: `vapi.db.files.search` ```ts theme={null} const rows = await corsair.vapi.db.files.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `orgId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `originalName` | `string` | equals, contains, startsWith, endsWith, in | | `mimeType` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Knowledge Bases Path: `vapi.db.knowledgeBases.search` ```ts theme={null} const rows = await corsair.vapi.db.knowledgeBases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `orgId` | `string` | equals, contains, startsWith, endsWith, in | | `provider` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Phone Numbers Path: `vapi.db.phoneNumbers.search` ```ts theme={null} const rows = await corsair.vapi.db.phoneNumbers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `orgId` | `string` | equals, contains, startsWith, endsWith, in | | `provider` | `string` | equals, contains, startsWith, endsWith, in | | `number` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `assistantId` | `string` | equals, contains, startsWith, endsWith, in | | `squadId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Squads Path: `vapi.db.squads.search` ```ts theme={null} const rows = await corsair.vapi.db.squads.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `orgId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tools Path: `vapi.db.tools.search` ```ts theme={null} const rows = await corsair.vapi.db.tools.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `orgId` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/vapi/get-credentials Step-by-step instructions for obtaining Vapi API keys and webhook secrets. This guide walks you through obtaining all required credentials for the Vapi plugin. ## Authentication Method The Vapi plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) - API key authentication ## API Key Setup ### Step 1: Get API Key 1. Log in to your [Vapi dashboard](https://dashboard.vapi.ai) 2. Click on your account name in the top-right corner 3. Go to **Organization** → **API Keys** 4. Click **Create API Key** 5. Give your key a name (e.g., "Corsair Integration") 6. Copy the API key immediately 7. **Important**: Store the key securely — you won't be able to see it again **Storing Credentials:** The preferred method is to store the API key in the database using the keys API: ```ts theme={null} await corsair .withTenant('default') .vapi.keys.setApiKey('your-api-key'); ``` Alternatively, you can provide the key directly in the plugin configuration: ```ts corsair.ts theme={null} vapi({ key: process.env.VAPI_API_KEY, }) ``` Or store it with the Corsair CLI: ```bash theme={null} pnpm corsair setup --plugin=vapi api_key=your-api-key ``` ## Webhook Secret Vapi uses a **shared secret** header (`x-vapi-secret`) rather than an HMAC signature. You choose the secret value and configure it in both your Vapi server URL settings and Corsair. ### Step 1: Configure Webhook URL in Vapi 1. In the [Vapi dashboard](https://dashboard.vapi.ai), go to **Settings** → **Webhooks** (or configure per-assistant via `serverUrl`) 2. Set the **Server URL** to your webhook endpoint (e.g., `https://yourapp.com/api/webhook`) 3. Set the **Server URL Secret** to a strong random string — this is the shared secret Vapi will send as the `x-vapi-secret` header on every request ### Step 2: Store the Secret in Corsair **Preferred method** — store in the database: ```ts theme={null} await corsair .withTenant('default') .vapi.keys.setWebhookSignature('your-webhook-secret'); ``` Or pass it directly in the plugin configuration: ```ts corsair.ts theme={null} vapi({ webhookSecret: process.env.VAPI_WEBHOOK_SECRET, }) ``` Or use the CLI: ```bash theme={null} pnpm corsair setup --plugin=vapi webhook_signature=your-webhook-secret ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Key | API calls | Dashboard → Organization → API Keys | | Webhook Secret | Incoming webhooks | Your own value — set in Vapi's Server URL Secret field | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/vapi/overview Voice AI platform for building phone call agents with LLMs and speech recognition. Use **Vapi** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 34 typed API operations * 7 synced entities (`assistants`, `calls`, `files`, `knowledgeBases`, `phoneNumbers`, `squads`, and 1 more) for fast `.search()` / `.list()` * 6 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/vapi ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/vapi ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/vapi ``` ```bash bun theme={null} bun add corsair @corsair-dev/vapi ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { vapi } from '@corsair-dev/vapi'; export const corsair = createCorsair({ plugins: [ vapi(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/vapi/get-credentials). ```ts theme={null} vapi() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'vapi', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`assistants.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.vapi.api.assistants.get({}); ``` **`assistants.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.vapi.api.assistants.create({}); ``` See the full list on the [API](/plugins/vapi/api) page. ## Query synced data Synced entities support `tenant.vapi.db..search()` and `.list()`: `assistants`, `calls`, `files`, `knowledgeBases`, `phoneNumbers`, `squads`, `tools`. See [Database](/plugins/vapi/database) for filters and operators. ## Webhooks This plugin registers **6** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/vapi/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/vapi/api)** > > Every `vapi.api.*` operation with input and output types. > **[Database](/plugins/vapi/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/vapi/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/vapi/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/vapi/webhooks Vapi incoming webhooks: event paths, payloads, and response data. The Vapi plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/vapi/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `client` * `workflowNodeStarted` (`client.workflowNodeStarted`) * `server` * `assistantRequest` (`server.assistantRequest`) * `endOfCallReport` (`server.endOfCallReport`) * `statusUpdate` (`server.statusUpdate`) * `toolCalls` (`server.toolCalls`) * `transferDestinationRequest` (`server.transferDestinationRequest`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Client ### Workflow Node Started `client.workflowNodeStarted` Sent when the active workflow node changes **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > type: workflow.node.started, > call: { > id: string, > orgId?: string, > type?: string, > status?: string, > endedReason?: string | null, > assistantId?: string | null, > phoneNumberId?: string | null, > startedAt?: string | null, > endedAt?: string | null, > cost?: number, > messages?: { > }[], > artifact?: { > }, > analysis?: { > } > }, > node?: { > }, > timestamp?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > } > ``` **`webhookHooks` example** ```ts theme={null} vapi({ webhookHooks: { client: { workflowNodeStarted: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Server ### Assistant Request `server.assistantRequest` Sent to fetch assistant configuration for an incoming call **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > type: assistant-request, > call: { > id: string, > orgId?: string, > type?: string, > status?: string, > endedReason?: string | null, > assistantId?: string | null, > phoneNumberId?: string | null, > startedAt?: string | null, > endedAt?: string | null, > cost?: number, > messages?: { > }[], > artifact?: { > }, > analysis?: { > } > }, > phoneNumber?: { > }, > customer?: { > }, > timestamp?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > assistant?: { > }, > assistantId?: string, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} vapi({ webhookHooks: { server: { assistantRequest: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### End Of Call Report `server.endOfCallReport` Sent at the end of a call with transcript, summary, and analysis **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > type: end-of-call-report, > call: { > id: string, > orgId?: string, > type?: string, > status?: string, > endedReason?: string | null, > assistantId?: string | null, > phoneNumberId?: string | null, > startedAt?: string | null, > endedAt?: string | null, > cost?: number, > messages?: { > }[], > artifact?: { > }, > analysis?: { > } > }, > endedReason?: string, > transcript?: string, > summary?: string, > messages?: { > }[], > analysis?: { > }, > artifact?: { > }, > timestamp?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > } > ``` **`webhookHooks` example** ```ts theme={null} vapi({ webhookHooks: { server: { endOfCallReport: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Status Update `server.statusUpdate` Sent when the call status changes **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > type: status-update, > call: { > id: string, > orgId?: string, > type?: string, > status?: string, > endedReason?: string | null, > assistantId?: string | null, > phoneNumberId?: string | null, > startedAt?: string | null, > endedAt?: string | null, > cost?: number, > messages?: { > }[], > artifact?: { > }, > analysis?: { > } > }, > status: string, > timestamp?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > } > ``` **`webhookHooks` example** ```ts theme={null} vapi({ webhookHooks: { server: { statusUpdate: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Tool Calls `server.toolCalls` Triggered when the assistant makes tool calls during a call **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > type: tool-calls, > call: { > id: string, > orgId?: string, > type?: string, > status?: string, > endedReason?: string | null, > assistantId?: string | null, > phoneNumberId?: string | null, > startedAt?: string | null, > endedAt?: string | null, > cost?: number, > messages?: { > }[], > artifact?: { > }, > analysis?: { > } > }, > toolCallList: { > id: string, > type: function, > function: { > name: string, > arguments: string > } > }[], > toolWithToolCallList?: { > }[], > timestamp?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > results: { > toolCallId: string, > result: string > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} vapi({ webhookHooks: { server: { toolCalls: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Transfer Destination Request `server.transferDestinationRequest` Triggered when processing a transfer destination request **Payload** | Name | Type | Required | Description | | - | - | - | - | | `message` | `object` | Yes | — | > **message full type** > > ```ts theme={null} > { > type: transfer-destination-request, > call: { > id: string, > orgId?: string, > type?: string, > status?: string, > endedReason?: string | null, > assistantId?: string | null, > phoneNumberId?: string | null, > startedAt?: string | null, > endedAt?: string | null, > cost?: number, > messages?: { > }[], > artifact?: { > }, > analysis?: { > } > }, > timestamp?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > destination?: { > }, > error?: string > } > ``` **`webhookHooks` example** ```ts theme={null} vapi({ webhookHooks: { server: { transferDestinationRequest: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/vaquill/api API reference for Vaquill: every `vaquill.api.*` operation with input and output types. Every `vaquill.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### creditsBalance `account.creditsBalance` Get your credit balance **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.account.creditsBalance({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `creditsRemaining` | `number` | No | — | | `usdRemaining` | `number` | No | — | | `bySource` | `any` | No | — | | `nextExpiry` | `object` | No | — | | `plan` | `string` | No | — | | `totalPurchased` | `number` | No | — | | `totalConsumed` | `number` | No | — | | `rateLimit` | `any` | No | — | | `asOf` | `string` | No | — | > **nextExpiry full type** > > ```ts theme={null} > { > at?: string, > credits?: number > } > ``` *** ### creditsPricing `account.creditsPricing` Get API credit pricing **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.account.creditsPricing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `region` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `dollarPerCredit` | `number` | No | — | | `minCredits` | `number` | No | — | | `maxCredits` | `number` | No | — | | `costs` | `any` | No | — | *** ## Alerts ### boards `alerts.boards` List watchable law-change boards **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.alerts.boards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `corpusType` | `string` | No | — | | `state` | `federal \| al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > boards: { > corpusType: string, > state?: string | null, > label?: string, > cadence?: string, > scopable?: boolean, > scopeBrowseCorpus?: string | null > }[], > total?: number, > hasMore?: boolean > } > ``` > **meta full type** > > ```ts theme={null} > { > processingTimeMs?: number, > creditsConsumed?: number > } > ``` *** ### watchChangeDiff `alerts.watchChangeDiff` Old-vs-new text for one change **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.alerts.watchChangeDiff({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watch_id` | `string` | Yes | — | | `change_id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `any` | No | — | > **data full type** > > ```ts theme={null} > { > changeId?: string | number, > changeKind?: string | null, > beforeText?: string | null, > afterText?: string | null, > hasBefore?: boolean, > hasAfter?: boolean > } > ``` *** ### watchChanges `alerts.watchChanges` List what changed on a watch's source **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.alerts.watchChanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watch_id` | `string` | Yes | — | | `limit` | `number` | No | — | | `sinceId` | `number` | No | — | | `beforeId` | `number` | No | — | | `since` | `string` | No | — | | `changeKind` | `added \| amended \| removed[]` | No | — | | `order` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > changes: { > id: number, > refreshLogId?: number | null, > corpusType?: string | null, > state?: string | null, > changeKind?: string | null, > actId?: string | null, > citation?: string | null, > title?: string | null, > detectedAt?: string | null, > hasDiff?: boolean > }[] > } > ``` > **meta full type** > > ```ts theme={null} > { > processingTimeMs?: number, > creditsConsumed?: number, > cursor?: number | null, > hasMore?: boolean > } > ``` *** ### watchDeliveries `alerts.watchDeliveries` List delivery history for a watch **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.alerts.watchDeliveries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watch_id` | `string` | Yes | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `meta` | `any` | No | — | > **data full type** > > ```ts theme={null} > { > deliveries: { > deliveryId?: string | null, > status?: string | null, > firedAt?: string | null > }[] > } > ``` *** ### watchesCreate `alerts.watchesCreate` Create a board watch for law-change alerts **Risk:** `write` ```ts theme={null} await corsair.vaquill.api.alerts.watchesCreate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `corpusType` | `string` | Yes | — | | `state` | `federal \| al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | | `channel` | `webhook \| email \| both` | No | — | | `webhookUrl` | `string` | No | — | | `webhookSecret` | `string` | No | — | | `emailAddress` | `string` | No | — | | `scope` | `object` | No | — | | `webhookAuth` | `object` | No | — | > **scope full type** > > ```ts theme={null} > { > } > ``` > **webhookAuth full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > watch?: { > id: string | number, > corpusType?: string, > state?: string | null, > channel?: string, > isActive?: boolean, > scope?: { > } | null, > createdAt?: string | null > } | null > } > ``` *** ### watchesDelete `alerts.watchesDelete` Delete a board watch **Risk:** `destructive` ```ts theme={null} await corsair.vaquill.api.alerts.watchesDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watch_id` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ### watchesList `alerts.watchesList` List your board watches **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.alerts.watchesList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `meta` | `any` | No | — | > **data full type** > > ```ts theme={null} > { > watches?: { > id: string | number, > corpusType?: string, > state?: string | null, > channel?: string, > isActive?: boolean, > scope?: { > } | null, > createdAt?: string | null > }[], > total?: number, > hasMore?: boolean > } > ``` *** ### watchesTest `alerts.watchesTest` Send a test delivery for a watch **Risk:** `write` ```ts theme={null} await corsair.vaquill.api.alerts.watchesTest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watch_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `any` | No | — | *** ### watchesUpdate `alerts.watchesUpdate` Update a board watch **Risk:** `write` ```ts theme={null} await corsair.vaquill.api.alerts.watchesUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watch_id` | `string` | Yes | — | | `isActive` | `boolean` | No | — | | `webhookUrl` | `string` | No | — | | `webhookSecret` | `string` | No | — | | `scope` | `object` | No | — | | `emailAddress` | `string` | No | — | | `webhookAuth` | `object` | No | — | > **scope full type** > > ```ts theme={null} > { > } > ``` > **webhookAuth full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > watch?: { > id: string | number, > corpusType?: string, > state?: string | null, > channel?: string, > isActive?: boolean, > scope?: { > } | null, > createdAt?: string | null > } | null > } > ``` *** ## Session Laws ### batch `sessionLaws.batch` Get many state session laws at once, by id or citation **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.sessionLaws.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | | `jurisdiction` | `al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | | `includeBody` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `laws` | `object[]` | Yes | — | | `resolved` | `any[]` | No | — | | `notFound` | `string[]` | No | — | | `count` | `number` | No | — | | `deduped` | `number` | No | — | | `creditsConsumed` | `number` | No | — | | `processingTimeMs` | `number` | No | — | > **laws full type** > > ```ts theme={null} > { > sessionLawId: string, > jurisdiction?: string, > citation?: string | null, > citableAs?: string | null, > citationShort?: string | null, > session?: string | null, > series?: string | null, > instrumentType?: string | null, > number?: string | null, > title?: string | null, > shortTitle?: string | null, > approvedDate?: string | null, > effectiveFirst?: string | null, > effectiveLast?: string | null, > enactmentOutcome?: string | null, > isLaw?: boolean | null, > textStatus?: string | null, > charCount?: number | null, > updatedAt?: string | null > }[] > ``` *** ### body `sessionLaws.body` Get a state session law's text **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.sessionLaws.body({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_law_id` | `string` | Yes | — | | `cursor` | `string` | No | — | | `startChar` | `number` | No | — | | `expectTextSha256` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sessionLawId` | `string` | Yes | — | | `citation` | `string` | No | — | | `jurisdiction` | `string` | No | — | | `session` | `string` | No | — | | `approvedDate` | `string` | No | — | | `sourceUrl` | `string` | No | — | | `available` | `boolean` | No | — | | `reason` | `string` | No | — | | `textStatus` | `string` | No | — | | `withheldReason` | `string` | No | — | | `text` | `string` | No | — | | `creditsConsumed` | `number` | No | — | | `processingTimeMs` | `number` | No | — | *** ### changes `sessionLaws.changes` Feed of changes to the session-law registry **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.sessionLaws.changes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sinceId` | `number` | No | — | | `jurisdiction` | `al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `changes` | `object[]` | Yes | — | | `count` | `number` | No | — | | `cursor` | `number` | No | — | | `hasMore` | `boolean` | No | — | | `creditsConsumed` | `number` | No | — | | `processingTimeMs` | `number` | No | — | > **changes full type** > > ```ts theme={null} > { > id: number, > jurisdiction?: string | null, > changeKind?: string | null, > sessionLawId?: string | null, > citation?: string | null, > title?: string | null, > detectedAt?: string | null > }[] > ``` *** ### get `sessionLaws.get` Get a state session law, by id or by citation **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.sessionLaws.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `session_law_id` | `string` | Yes | — | | `jurisdiction` | `al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sessionLawId` | `string` | No | — | | `lawId` | `string` | No | — | | `jurisdiction` | `string` | No | — | | `citation` | `string` | No | — | | `citableAs` | `string` | No | — | | `citationShort` | `string` | No | — | | `session` | `string` | No | — | | `series` | `string` | No | — | | `instrumentType` | `string` | No | — | | `title` | `string` | No | — | | `shortTitle` | `string` | No | — | | `approvedDate` | `string` | No | — | | `effectiveDates` | `any[]` | No | — | | `codeSectionsAffected` | `any[]` | No | — | | `sourceUrl` | `string` | No | — | | `textStatus` | `string` | No | — | | `creditsConsumed` | `number` | No | — | | `processingTimeMs` | `number` | No | — | *** ### list `sessionLaws.list` List a state's session laws **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.sessionLaws.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jurisdiction` | `al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | Yes | — | | `session` | `string` | No | — | | `series` | `string` | No | — | | `instrumentType` | `string` | No | — | | `approvedFrom` | `string` | No | — | | `approvedTo` | `string` | No | — | | `effectiveFrom` | `string` | No | — | | `effectiveTo` | `string` | No | — | | `hasText` | `boolean` | No | — | | `textStatus` | `held \| withheld \| not_held \| pending` | No | — | | `isLaw` | `boolean` | No | — | | `enactmentOutcome` | `string` | No | — | | `updatedSince` | `string` | No | — | | `q` | `string` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `count` | `number` | No | — | | `nextCursor` | `string` | No | — | | `hasMore` | `boolean` | No | — | | `coverage` | `any` | No | — | | `creditsConsumed` | `number` | No | — | | `processingTimeMs` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > sessionLawId: string, > jurisdiction?: string, > citation?: string | null, > citableAs?: string | null, > citationShort?: string | null, > session?: string | null, > series?: string | null, > instrumentType?: string | null, > number?: string | null, > title?: string | null, > shortTitle?: string | null, > approvedDate?: string | null, > effectiveFirst?: string | null, > effectiveLast?: string | null, > enactmentOutcome?: string | null, > isLaw?: boolean | null, > textStatus?: string | null, > charCount?: number | null, > updatedAt?: string | null > }[] > ``` *** ### search `sessionLaws.search` Search the text of state session laws **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.sessionLaws.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `jurisdiction` | `al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | | `session` | `string` | No | — | | `series` | `string` | No | — | | `instrumentType` | `string` | No | — | | `approvedFrom` | `string` | No | — | | `approvedTo` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | No | — | | `parsed` | `any` | No | — | | `results` | `object[]` | Yes | — | | `count` | `number` | No | — | | `offset` | `number` | No | — | | `limit` | `number` | No | — | | `hasMore` | `boolean` | No | — | | `creditsConsumed` | `number` | No | — | | `processingTimeMs` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > sessionLawId: string, > jurisdiction?: string, > citation?: string | null, > citableAs?: string | null, > citationShort?: string | null, > session?: string | null, > series?: string | null, > instrumentType?: string | null, > number?: string | null, > title?: string | null, > shortTitle?: string | null, > approvedDate?: string | null, > effectiveFirst?: string | null, > effectiveLast?: string | null, > enactmentOutcome?: string | null, > isLaw?: boolean | null, > textStatus?: string | null, > charCount?: number | null, > updatedAt?: string | null > }[] > ``` *** ## Statutes ### count `statutes.count` Count statute sections matching a scope **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.count({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `corpusType` | `USC \| CFR \| STATE \| CONSTITUTION \| FEDERAL_LOCAL_RULES \| FEDERAL_RULES \| STATE_CONSTITUTION \| STATE_RULES \| EXECUTIVE_ACTION \| REGULATION \| FEDERAL_REGISTER \| FEDERAL_REGISTER_NOTICE \| AGENCY_GUIDANCE \| SENTENCING_GUIDELINES \| US_TAX_TREATY \| STATE_AGENCY_GUIDANCE \| STATE_AG_OPINION \| SESSION_LAW \| STATE_REGISTER \| STATUTE_COMPILATION \| AGENCY_ADJUDICATION \| CFR_ANNUAL \| USC_ANNUAL \| USC \| CFR \| STATE \| CONSTITUTION \| FEDERAL_LOCAL_RULES \| FEDERAL_RULES \| STATE_CONSTITUTION \| STATE_RULES \| EXECUTIVE_ACTION \| REGULATION \| FEDERAL_REGISTER \| FEDERAL_REGISTER_NOTICE \| AGENCY_GUIDANCE \| SENTENCING_GUIDELINES \| US_TAX_TREATY \| STATE_AGENCY_GUIDANCE \| STATE_AG_OPINION \| SESSION_LAW \| STATE_REGISTER \| STATUTE_COMPILATION \| AGENCY_ADJUDICATION \| CFR_ANNUAL \| USC_ANNUAL[]` | No | — | | `state` | `federal \| al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy \| federal \| al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy[]` | No | — | | `code` | `string \| string[]` | No | — | | `article` | `string \| string[]` | No | — | | `titleNumber` | `number` | No | — | | `chapter` | `string \| string[]` | No | — | | `part` | `string \| string[]` | No | — | | `actStatus` | `abolished \| deleted \| expired \| in_force \| inactive \| non_precedential \| not_funded \| not_yet_effective \| omitted \| proposed \| recodified \| recompiled \| rejected \| relocated \| removed \| renumbered \| repealed \| rescinded \| reserved \| revoked \| superseded \| terminated \| transferred \| unconstitutional \| vacant \| vacated \| vetoed \| withdrawn \| abolished \| deleted \| expired \| in_force \| inactive \| non_precedential \| not_funded \| not_yet_effective \| omitted \| proposed \| recodified \| recompiled \| rejected \| relocated \| removed \| renumbered \| repealed \| rescinded \| reserved \| revoked \| superseded \| terminated \| transferred \| unconstitutional \| vacant \| vacated \| vetoed \| withdrawn[]` | No | — | | `excludeRepealed` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `isExact` | `boolean` | No | — | | `scope` | `object` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **scope full type** > > ```ts theme={null} > { > } > ``` *** ### coverage `statutes.coverage` List the covered corpora and jurisdictions **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.coverage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > corpusTypes: { > token: string, > description?: string, > scope?: string > }[], > jurisdictions: { > code: string, > name?: string, > kind?: string, > sectionCount?: number, > hasData?: boolean, > statusBreakdown?: { > } > }[] > } > ``` *** ### divisions `statutes.divisions` Browse the statutory hierarchy of a corpus **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.divisions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `corpusType` | `USC \| CFR \| STATE \| REGULATION \| CONSTITUTION \| STATE_CONSTITUTION \| FEDERAL_RULES` | Yes | — | | `state` | `al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | | `titleNumber` | `number` | No | — | | `code` | `string` | No | — | | `chapter` | `string` | No | — | | `part` | `string` | No | — | | `article` | `string` | No | — | | `excludeRepealed` | `boolean` | No | — | | `actStatus` | `abolished \| deleted \| expired \| in_force \| inactive \| non_precedential \| not_funded \| not_yet_effective \| omitted \| proposed \| recodified \| recompiled \| rejected \| relocated \| removed \| renumbered \| repealed \| rescinded \| reserved \| revoked \| superseded \| terminated \| transferred \| unconstitutional \| vacant \| vacated \| vetoed \| withdrawn` | No | — | | `cursor` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `corpusType` | `string` | Yes | — | | `level` | `string` | No | — | | `parentLabel` | `string` | No | — | | `divisions` | `object[]` | Yes | — | | `count` | `number` | No | — | | `truncated` | `boolean` | No | — | | `nextCursor` | `string` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **divisions full type** > > ```ts theme={null} > { > identifier: string, > name?: string, > kind?: string, > isLeaf?: boolean, > actId?: string > }[] > ``` *** ### enactments `statutes.enactments` List the session-law enactments behind a section **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.enactments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `act_id` | `string` | Yes | Section identifier, as returned on a search hit or by the citation resolver. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `actId` | `string` | Yes | — | | `jurisdiction` | `string` | No | — | | `supported` | `boolean` | No | — | | `reason` | `string` | No | — | | `enactments` | `object[]` | Yes | — | | `count` | `number` | No | — | | `truncated` | `boolean` | No | — | | `creditsConsumed` | `number` | No | — | | `processingTimeMs` | `number` | No | — | > **enactments full type** > > ```ts theme={null} > { > sessionLawId?: string | null, > href?: string | null, > citation?: string | null, > title?: string | null, > approvedDate?: string | null, > action?: string | null, > matchQuality?: string | null, > textStatus?: string | null > }[] > ``` *** ### extractCitations `statutes.extractCitations` Find the citations in a text and optionally resolve each **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.extractCitations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `state` | `al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | | `resolve` | `boolean` | No | — | | `includeUnresolved` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `citations` | `object[]` | Yes | — | | `counts` | `object` | No | — | | `truncated` | `boolean` | No | — | | `textChars` | `number` | No | — | | `extractorVersion` | `string` | No | — | | `creditsConsumed` | `number` | No | — | | `processingTimeMs` | `number` | No | — | > **citations full type** > > ```ts theme={null} > { > citation: string, > resolved?: boolean, > section?: { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } | null > }[] > ``` > **counts full type** > > ```ts theme={null} > { > } > ``` *** ### resolve `statutes.resolve` Resolve Bluebook citations to statute sections **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.resolve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `citations` | `string[]` | Yes | — | | `state` | `al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | | `corpusType` | `CONSTITUTION \| REGULATION \| STATE \| STATE_CONSTITUTION \| STATE_RULES` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `resolvedCount` | `number` | No | — | | `count` | `number` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > resolved: boolean, > inputCitation: string, > section?: { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } | null, > subsection?: any > }[] > ``` *** ### resolveCitation `statutes.resolveCitation` Resolve a single Bluebook citation to its section **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.resolveCitation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cite` | `string` | Yes | — | | `state` | `al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy` | No | — | | `corpusType` | `CONSTITUTION \| REGULATION \| STATE \| STATE_CONSTITUTION \| STATE_RULES` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `resolved` | `boolean` | Yes | — | | `inputCitation` | `string` | No | — | | `section` | `object` | No | — | | `subsection` | `any` | No | — | | `matchLevel` | `string` | No | — | | `missReason` | `string` | No | — | | `candidates` | `any[]` | No | — | | `creditsConsumed` | `number` | No | — | | `processingTimeMs` | `number` | No | — | > **section full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } > ``` *** ### search `statutes.search` Search US statutes, regulations, court rules and guidance **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `corpusType` | `USC \| CFR \| STATE \| CONSTITUTION \| FEDERAL_LOCAL_RULES \| FEDERAL_RULES \| STATE_CONSTITUTION \| STATE_RULES \| EXECUTIVE_ACTION \| REGULATION \| FEDERAL_REGISTER \| FEDERAL_REGISTER_NOTICE \| AGENCY_GUIDANCE \| SENTENCING_GUIDELINES \| US_TAX_TREATY \| STATE_AGENCY_GUIDANCE \| STATE_AG_OPINION \| SESSION_LAW \| STATE_REGISTER \| STATUTE_COMPILATION \| AGENCY_ADJUDICATION \| CFR_ANNUAL \| USC_ANNUAL \| USC \| CFR \| STATE \| CONSTITUTION \| FEDERAL_LOCAL_RULES \| FEDERAL_RULES \| STATE_CONSTITUTION \| STATE_RULES \| EXECUTIVE_ACTION \| REGULATION \| FEDERAL_REGISTER \| FEDERAL_REGISTER_NOTICE \| AGENCY_GUIDANCE \| SENTENCING_GUIDELINES \| US_TAX_TREATY \| STATE_AGENCY_GUIDANCE \| STATE_AG_OPINION \| SESSION_LAW \| STATE_REGISTER \| STATUTE_COMPILATION \| AGENCY_ADJUDICATION \| CFR_ANNUAL \| USC_ANNUAL[]` | No | — | | `state` | `federal \| al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy \| federal \| al \| ak \| az \| ar \| as \| ca \| co \| ct \| de \| dc \| fl \| ga \| gu \| hi \| id \| il \| in \| ia \| ks \| ky \| la \| me \| md \| ma \| mi \| mn \| ms \| mo \| mp \| mt \| ne \| nv \| nh \| nj \| nm \| ny \| nc \| nd \| oh \| ok \| or \| pa \| pr \| ri \| sc \| sd \| tn \| tx \| ut \| vt \| va \| vi \| wa \| wv \| wi \| wy[]` | No | — | | `code` | `string \| string[]` | No | — | | `article` | `string \| string[]` | No | — | | `yearFrom` | `number` | No | — | | `yearTo` | `number` | No | — | | `excludeRepealed` | `boolean` | No | — | | `actStatus` | `abolished \| deleted \| expired \| in_force \| inactive \| non_precedential \| not_funded \| not_yet_effective \| omitted \| proposed \| recodified \| recompiled \| rejected \| relocated \| removed \| renumbered \| repealed \| rescinded \| reserved \| revoked \| superseded \| terminated \| transferred \| unconstitutional \| vacant \| vacated \| vetoed \| withdrawn \| abolished \| deleted \| expired \| in_force \| inactive \| non_precedential \| not_funded \| not_yet_effective \| omitted \| proposed \| recodified \| recompiled \| rejected \| relocated \| removed \| renumbered \| repealed \| rescinded \| reserved \| revoked \| superseded \| terminated \| transferred \| unconstitutional \| vacant \| vacated \| vetoed \| withdrawn[]` | No | — | | `changedSince` | `string` | No | — | | `agency` | `string \| string[]` | No | — | | `source` | `string` | No | — | | `fields` | `string \| string[]` | No | — | | `documentType` | `final \| proposed \| presidential` | No | — | | `publishedFrom` | `string` | No | — | | `publishedTo` | `string` | No | — | | `titleNumber` | `number` | No | — | | `chapter` | `string \| string[]` | No | — | | `part` | `string \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `includeBody` | `boolean` | No | — | | `excerptChars` | `number` | No | — | | `matchType` | `any \| all \| phrase` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | Yes | — | | `count` | `number` | No | — | | `total` | `number` | No | — | | `offset` | `number` | No | — | | `hasMore` | `boolean` | No | — | | `noGoodMatch` | `boolean` | No | — | | `matchQuality` | `string` | No | — | | `citationMissReason` | `string` | No | — | | `rankingDegraded` | `boolean` | No | — | | `query` | `string` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **results full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > title?: string | null, > corpusType?: string, > state?: string | null, > excerpt?: string | null, > body?: string | null, > goodLawStatus?: string | null > }[] > ``` *** ### section `statutes.section` Get a statute section by id **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.section({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `act_id` | `string` | Yes | Section identifier, as returned on a search hit or by the citation resolver. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `section` | `object` | Yes | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **section full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } > ``` *** ### sectionBody `statutes.sectionBody` Get a section's full text **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.sectionBody({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `act_id` | `string` | Yes | Section identifier, as returned on a search hit or by the citation resolver. | | `format` | `all \| both \| html \| markdown \| plain \| content \| operative` | No | — | | `structured` | `boolean` | No | — | | `asOf` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `actId` | `string` | Yes | — | | `plain` | `string` | No | — | | `html` | `string` | No | — | | `content` | `string` | No | — | | `operative` | `string` | No | — | | `markdown` | `string` | No | — | | `subsections` | `any[]` | No | — | | `tables` | `any[]` | No | — | | `figures` | `any[]` | No | — | | `note` | `string` | No | — | | `source` | `string` | No | — | | `sourceUrl` | `string` | No | — | | `available` | `boolean` | No | — | | `asOf` | `any` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | *** ### sectionChanges `statutes.sectionChanges` Get a section's amendment history **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.sectionChanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `act_id` | `string` | Yes | Section identifier, as returned on a search hit or by the citation resolver. | | `limit` | `number` | No | — | | `sinceId` | `number` | No | — | | `beforeId` | `number` | No | — | | `changeKind` | `added \| amended \| removed[]` | No | — | | `order` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `actId` | `string` | Yes | — | | `section` | `object` | No | — | | `changes` | `object[]` | Yes | — | | `total` | `number` | No | — | | `hasMore` | `boolean` | No | — | | `cursor` | `number` | No | — | | `observedFrom` | `string` | No | — | | `coverage` | `string` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **section full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } > ``` > **changes full type** > > ```ts theme={null} > { > id: number, > changeKind?: string, > detectedAt?: string, > citation?: string, > displayCitation?: string | null, > title?: string | null, > hasDiff?: boolean, > corpusType?: string, > state?: string | null > }[] > ``` *** ### sectionCitedBy `statutes.sectionCitedBy` Get sections citing this one **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.sectionCitedBy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `act_id` | `string` | Yes | Section identifier, as returned on a search hit or by the citation resolver. | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `section` | `object` | Yes | — | | `citers` | `object[]` | Yes | — | | `total` | `number` | No | — | | `truncated` | `boolean` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **section full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } > ``` > **citers full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > title?: string | null, > corpusType?: string, > state?: string | null, > excerpt?: string | null, > body?: string | null, > goodLawStatus?: string | null > }[] > ``` *** ### sectionCrossState `statutes.sectionCrossState` Compare a provision across states **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.sectionCrossState({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `act_id` | `string` | Yes | Section identifier, as returned on a search hit or by the citation resolver. | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `section` | `object` | Yes | — | | `neighbors` | `object[]` | Yes | — | | `statesCovered` | `number` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **section full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } > ``` > **neighbors full type** > > ```ts theme={null} > { > section?: { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } | null, > state?: string, > similarity?: number > }[] > ``` *** ### sectionDefinitions `statutes.sectionDefinitions` Get the defined terms governing a section **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.sectionDefinitions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `act_id` | `string` | Yes | Section identifier, as returned on a search hit or by the citation resolver. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `section` | `object` | Yes | — | | `definitionsSection` | `object` | No | — | | `terms` | `object[]` | Yes | — | | `total` | `number` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **section full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } > ``` > **definitionsSection full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } > ``` > **terms full type** > > ```ts theme={null} > { > term: string, > definition?: string | null > }[] > ``` *** ### sectionRelated `statutes.sectionRelated` Get the neighbouring sections in statutory order **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.sectionRelated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `act_id` | `string` | Yes | Section identifier, as returned on a search hit or by the citation resolver. | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `section` | `object` | Yes | — | | `previous` | `object[]` | Yes | — | | `next` | `object[]` | Yes | — | | `container` | `string` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **section full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > } > ``` > **previous full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > }[] > ``` > **next full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > }[] > ``` *** ### sections `statutes.sections` Get statute sections in batch by ids **Risk:** `read` ```ts theme={null} await corsair.vaquill.api.statutes.sections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `actIds` | `string[]` | Yes | — | | `includeBody` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sections` | `object[]` | Yes | — | | `notFound` | `string[]` | No | — | | `notFoundDetail` | `any[]` | No | — | | `count` | `number` | No | — | | `processingTimeMs` | `number` | No | — | | `creditsConsumed` | `number` | No | — | > **sections full type** > > ```ts theme={null} > { > actId: string, > citation?: string, > citationShort?: string | null, > title?: string | null, > corpusType?: string, > state?: string | null, > year?: number | null, > excerpt?: string | null, > body?: string | null, > titleNumber?: string | number | null, > titleName?: string | null, > chapter?: string | null, > chapterName?: string | null, > sectionNumber?: string | null, > sectionTitle?: string | null, > displayPath?: string | null, > actStatus?: string | null, > goodLawStatus?: string | null, > effectiveDate?: string | null, > wordCount?: number | null, > htmlUrl?: string | null, > textUrl?: string | null > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/vaquill/database Vaquill local sync: searchable entities, `.search()` filters, and operators. The Vaquill plugin syncs data locally. Use `corsair.vaquill.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Search Results Path: `vaquill.db.searchResults.search` ```ts theme={null} const rows = await corsair.vaquill.db.searchResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `actId` | `string` | equals, contains, startsWith, endsWith, in | | `citation` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `corpusType` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `excerpt` | `string` | equals, contains, startsWith, endsWith, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `actStatus` | `string` | equals, contains, startsWith, endsWith, in | | `goodLawStatus` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/vaquill/overview US primary law as an API. Search statutes, regulations and court rules, resolve citations, and read section text, histories and cross-state equivalents. Use **Vaquill** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 33 typed API operations * 1 synced entity (`searchResults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/vaquill ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/vaquill ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/vaquill ``` ```bash bun theme={null} bun add corsair @corsair-dev/vaquill ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { vaquill } from '@corsair-dev/vaquill'; export const corsair = createCorsair({ plugins: [ vaquill(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} vaquill() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'vaquill', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.creditsBalance`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.vaquill.api.account.creditsBalance({}); ``` **`alerts.watchesCreate`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.vaquill.api.alerts.watchesCreate({}); ``` See the full list on the [API](/plugins/vaquill/api) page. ## Query synced data Synced entities support `tenant.vaquill.db..search()` and `.list()`: `searchResults`. See [Database](/plugins/vaquill/database) for filters and operators. ## What's next > **[API reference](/plugins/vaquill/api)** > > Every `vaquill.api.*` operation with input and output types. > **[Database](/plugins/vaquill/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/vercel/api API reference for Vercel: every `vercel.api.*` operation with input and output types. Every `vercel.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Aliases ### assignAlias `aliases.assignAlias` Assign an alias **Risk:** `write` ```ts theme={null} await corsair.vercel.api.aliases.assignAlias({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `deploymentId` | `string` | Yes | — | | `alias` | `string` | Yes | — | | `redirect` | `string` | No | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `alias` | `string` | Yes | — | | `created` | `string` | Yes | — | | `oldDeploymentId` | `string` | No | — | *** ### getAliases `aliases.getAliases` Get all aliases **Risk:** `read` ```ts theme={null} await corsair.vercel.api.aliases.getAliases({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `until` | `number` | No | — | | `since` | `number` | No | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `aliases` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **aliases full type** > > ```ts theme={null} > { > uid: string, > alias: string, > created: string, > createdAt: number, > deploymentId?: string | null, > projectId?: string | null, > redirect?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count: number, > next?: number | null, > prev?: number | null > } > ``` *** ## Deployments ### createDeployment `deployments.createDeployment` Create a deployment **Risk:** `write` ```ts theme={null} await corsair.vercel.api.deployments.createDeployment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `project` | `string` | No | — | | `target` | `production \| staging` | No | — | | `gitSource` | `object` | No | — | | `files` | `any[]` | No | — | | `meta` | `object` | No | — | | `env` | `object` | No | — | | `teamId` | `string` | No | — | > **gitSource full type** > > ```ts theme={null} > { > type: github | gitlab | bitbucket, > ref?: string, > repoId?: string | number, > sha?: string > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` > **env full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | | `created` | `number` | Yes | — | | `readyState` | `string` | Yes | — | | `type` | `LAMBDAS \| PREBUILT \| STATIC \| string` | Yes | — | | `creator` | `object` | No | — | | `meta` | `object` | No | — | | `target` | `production \| staging \| string` | No | — | | `aliasError` | `object` | No | — | | `aliasAssigned` | `number` | No | — | | `inspectorUrl` | `string` | No | — | > **creator full type** > > ```ts theme={null} > { > uid: string, > email: string, > username: string > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` > **aliasError full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` *** ### getDeployment `deployments.getDeployment` Get deployment details **Risk:** `read` ```ts theme={null} await corsair.vercel.api.deployments.getDeployment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `idOrUrl` | `string` | Yes | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | Yes | — | | `name` | `string` | Yes | — | | `url` | `string` | Yes | — | | `created` | `number` | Yes | — | | `readyState` | `string` | Yes | — | | `type` | `LAMBDAS \| PREBUILT \| STATIC \| string` | Yes | — | | `creator` | `object` | No | — | | `meta` | `object` | No | — | | `target` | `production \| staging \| string` | No | — | | `aliasError` | `object` | No | — | | `aliasAssigned` | `number` | No | — | | `inspectorUrl` | `string` | No | — | > **creator full type** > > ```ts theme={null} > { > uid: string, > email: string, > username: string > } > ``` > **meta full type** > > ```ts theme={null} > { > } > ``` > **aliasError full type** > > ```ts theme={null} > { > code: string, > message: string > } > ``` *** ### getDeployments `deployments.getDeployments` Get all deployments **Risk:** `read` ```ts theme={null} await corsair.vercel.api.deployments.getDeployments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | No | — | | `limit` | `number` | No | — | | `until` | `number` | No | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deployments` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **deployments full type** > > ```ts theme={null} > { > uid: string, > name: string, > url: string, > created: number, > readyState: string, > type: LAMBDAS | PREBUILT | STATIC | string, > creator?: { > uid: string, > email: string, > username: string > } | null, > meta?: { > } | null, > target?: production | staging | string | null, > aliasError?: { > code: string, > message: string > } | null, > aliasAssigned?: number | null, > inspectorUrl?: string | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count: number, > next?: number | null, > prev?: number | null > } > ``` *** ## Domains ### getDomains `domains.getDomains` Get all domains **Risk:** `read` ```ts theme={null} await corsair.vercel.api.domains.getDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `until` | `number` | No | — | | `since` | `number` | No | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domains` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **domains full type** > > ```ts theme={null} > { > id: string, > name: string, > createdAt: number, > boughtAt?: number | null, > expiresAt?: number | null, > transferredAt?: number | null, > verified: boolean, > nameservers: string[], > intendedNameservers: string[] > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count: number, > next?: number | null, > prev?: number | null > } > ``` *** ### getProjectDomains `domains.getProjectDomains` Get project domains **Risk:** `read` ```ts theme={null} await corsair.vercel.api.domains.getProjectDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `idOrName` | `string` | Yes | — | | `limit` | `number` | No | — | | `until` | `number` | No | — | | `since` | `number` | No | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domains` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **domains full type** > > ```ts theme={null} > { > name: string, > apexName: string, > projectId: string, > redirect?: string | null, > redirectStatusCode?: number | null, > gitBranch?: string | null, > updatedAt: number, > createdAt: number, > verified: boolean > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count: number, > next?: number | null, > prev?: number | null > } > ``` *** ## Envs ### createEnvVariable `envs.createEnvVariable` Create an environment variable for a project (supports plain, secret, encrypted, and sensitive types) **Risk:** `write` ```ts theme={null} await corsair.vercel.api.envs.createEnvVariable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `idOrName` | `string` | Yes | — | | `key` | `string` | Yes | — | | `value` | `string` | Yes | — | | `type` | `plain \| secret \| encrypted \| sensitive` | Yes | — | | `target` | `production \| preview \| development[]` | Yes | — | | `gitBranch` | `string` | No | — | | `comment` | `string` | No | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `key` | `string` | Yes | — | | `value` | `string` | Yes | — | | `type` | `plain \| secret \| encrypted \| sensitive` | Yes | — | | `target` | `production \| preview \| development[]` | Yes | — | | `gitBranch` | `string` | No | — | | `configurationId` | `string` | No | — | | `createdAt` | `number` | Yes | — | | `updatedAt` | `number` | Yes | — | | `createdBy` | `string` | No | — | | `updatedBy` | `string` | No | — | *** ### getEnvVariables `envs.getEnvVariables` Get environment variables for a project (may include secret/sensitive values) **Risk:** `read` ```ts theme={null} await corsair.vercel.api.envs.getEnvVariables({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `idOrName` | `string` | Yes | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `envs` | `object[]` | No | — | > **envs full type** > > ```ts theme={null} > { > id: string, > key: string, > value: string, > type: plain | secret | encrypted | sensitive, > target: production | preview | development[], > gitBranch?: string | null, > configurationId?: string | null, > createdAt: number, > updatedAt: number, > createdBy?: string | null, > updatedBy?: string | null > }[] > ``` *** ## Projects ### getProject `projects.getProject` Get project details **Risk:** `read` ```ts theme={null} await corsair.vercel.api.projects.getProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `idOrName` | `string` | Yes | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `accountId` | `string` | Yes | — | | `createdAt` | `number` | Yes | — | | `updatedAt` | `number` | Yes | — | | `framework` | `string` | No | — | | `link` | `object` | No | — | | `latestDeployments` | `any[]` | No | — | | `targets` | `object` | No | — | > **link full type** > > ```ts theme={null} > { > type: string, > repo: string, > repoId?: number, > org?: string | null, > gitCredentialId?: string | null, > productionBranch?: string | null, > createdAt?: number | null, > updatedAt?: number | null, > deployHooks?: any[] | null > } > ``` > **targets full type** > > ```ts theme={null} > { > } > ``` *** ### getProjects `projects.getProjects` Get all projects **Risk:** `read` ```ts theme={null} await corsair.vercel.api.projects.getProjects({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `until` | `number` | No | — | | `since` | `number` | No | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projects` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **projects full type** > > ```ts theme={null} > { > id: string, > name: string, > accountId: string, > createdAt: number, > updatedAt: number, > framework?: string | null, > link?: { > type: string, > repo: string, > repoId?: number, > org?: string | null, > gitCredentialId?: string | null, > productionBranch?: string | null, > createdAt?: number | null, > updatedAt?: number | null, > deployHooks?: any[] | null > } | null, > latestDeployments?: any[] | null, > targets?: { > } | null > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count: number, > next?: number | null, > prev?: number | null > } > ``` *** ## Teams ### getTeams `teams.getTeams` Get all teams **Risk:** `read` ```ts theme={null} await corsair.vercel.api.teams.getTeams({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `teams` | `object[]` | Yes | — | | `pagination` | `object` | Yes | — | > **teams full type** > > ```ts theme={null} > { > id: string, > slug: string, > name: string, > createdAt: number, > updatedAt?: number | null, > avatar?: string | null, > membership: { > uid: string, > role: OWNER | MEMBER | DEVELOPER | BILLING | VIEWER | string, > createdAt: number > } > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > count: number, > next?: number | null, > prev?: number | null > } > ``` *** ## Webhooks ### createWebhook `webhooks.createWebhook` Create a webhook **Risk:** `write` ```ts theme={null} await corsair.vercel.api.webhooks.createWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `events` | `(deployment.created \| deployment.succeeded \| deployment.ready \| deployment.error \| deployment.canceled \| deployment.promoted \| project.created \| project.removed \| domain.created \| integration-configuration.scope-change-confirmed \| integration-configuration.removed \| integration-configuration.permission-upgraded \| string)[]` | Yes | — | | `projectIds` | `string[]` | No | — | | `teamId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `url` | `string` | Yes | — | | `events` | `(deployment.created \| deployment.succeeded \| deployment.ready \| deployment.error \| deployment.canceled \| deployment.promoted \| project.created \| project.removed \| domain.created \| integration-configuration.scope-change-confirmed \| integration-configuration.removed \| integration-configuration.permission-upgraded \| string)[]` | Yes | — | | `ownerId` | `string` | Yes | — | | `projectIds` | `string[]` | No | — | | `createdAt` | `number` | Yes | — | | `updatedAt` | `number` | Yes | — | *** ### getWebhooks `webhooks.getWebhooks` Get all webhooks **Risk:** `read` ```ts theme={null} await corsair.vercel.api.webhooks.getWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `teamId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > url: string, > events: ( > deployment.created | deployment.succeeded | deployment.ready | deployment.error | deployment.canceled | deployment.promoted | project.created | project.removed | domain.created | integration-configuration.scope-change-confirmed | integration-configuration.removed | integration-configuration.permission-upgraded | string > )[], > ownerId: string, > projectIds?: string[], > createdAt: number, > updatedAt: number > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/vercel/database Vercel local sync: searchable entities, `.search()` filters, and operators. The Vercel plugin syncs data locally. Use `corsair.vercel.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Aliases Path: `vercel.db.aliases.search` ```ts theme={null} const rows = await corsair.vercel.db.aliases.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uid` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `deploymentId` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `redirect` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Deployments Path: `vercel.db.deployments.search` ```ts theme={null} const rows = await corsair.vercel.db.deployments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `number` | equals, gt, gte, lt, lte, in | | `readyState` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `target` | `string` | equals, contains, startsWith, endsWith, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Domains Path: `vercel.db.domains.search` ```ts theme={null} const rows = await corsair.vercel.db.domains.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `boughtAt` | `number` | equals, gt, gte, lt, lte, in | | `expiresAt` | `number` | equals, gt, gte, lt, lte, in | | `transferredAt` | `number` | equals, gt, gte, lt, lte, in | | `verified` | `boolean` | equals | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Envs Path: `vercel.db.envs.search` ```ts theme={null} const rows = await corsair.vercel.db.envs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | | `value` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `number` | equals, gt, gte, lt, lte, in | | `projectId` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Projects Path: `vercel.db.projects.search` ```ts theme={null} const rows = await corsair.vercel.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `accountId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `number` | equals, gt, gte, lt, lte, in | | `framework` | `string` | equals, contains, startsWith, endsWith, in | | `teamId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Teams Path: `vercel.db.teams.search` ```ts theme={null} const rows = await corsair.vercel.db.teams.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `number` | equals, gt, gte, lt, lte, in | | `updatedAt` | `number` | equals, gt, gte, lt, lte, in | | `avatar` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/vercel/get-credentials How to obtain and configure your Vercel Access Token and Webhook Secret. ## Vercel Access Token To authenticate with the Vercel API, you need a Personal Access Token or a Team Access Token. **1. Go to Vercel Settings** Log in to your Vercel dashboard and navigate to **Settings** > **Tokens**. **2. Create a new token** Click the **Create Token** button. Give it a descriptive name (e.g., "Corsair Integration"). **3. Select Scope** Choose the appropriate scope for your token. You can select **Full Account** for access to all personal projects, or select a **Specific Team** if you want to limit access to a team's resources. **4. Copy the token** Copy the generated token immediately, as you won't be able to see it again. ### Storing the token Once you have your token, store it using the Corsair CLI: ```bash theme={null} pnpm corsair setup --plugin=vercel api_key=your_vercel_token ``` ## Securing Webhooks (Optional) If you configure Vercel webhooks to point to your Corsair endpoint, it is highly recommended to set a Webhook Secret to verify incoming payloads. 1. When you create a webhook in Vercel, it will provide a **Secret**. 2. Pass this secret directly when initializing the Vercel plugin: ```ts corsair.ts theme={null} import { vercel } from '@corsair-dev/vercel'; export const corsair = createCorsair({ plugins: [ vercel({ webhookSecret: process.env.VERCEL_WEBHOOK_SECRET }) ], }); ``` # Overview Source: https://docs.corsair.dev/plugins/vercel/overview Frontend cloud platform for deploying sites, serverless functions, and edge web applications. Use **Vercel** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 14 typed API operations * 6 synced entities (`aliases`, `deployments`, `domains`, `envs`, `projects`, `teams`) for fast `.search()` / `.list()` * 4 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/vercel ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/vercel ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/vercel ``` ```bash bun theme={null} bun add corsair @corsair-dev/vercel ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { vercel } from '@corsair-dev/vercel'; export const corsair = createCorsair({ plugins: [ vercel(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/vercel/get-credentials). ```ts theme={null} vercel() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'vercel', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`aliases.getAliases`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.vercel.api.aliases.getAliases({}); ``` **`aliases.assignAlias`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.vercel.api.aliases.assignAlias({}); ``` See the full list on the [API](/plugins/vercel/api) page. ## Query synced data Synced entities support `tenant.vercel.db..search()` and `.list()`: `aliases`, `deployments`, `domains`, `envs`, `projects`, `teams`. See [Database](/plugins/vercel/database) for filters and operators. ## Webhooks This plugin registers **4** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/vercel/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/vercel/api)** > > Every `vercel.api.*` operation with input and output types. > **[Database](/plugins/vercel/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/vercel/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/vercel/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/vercel/webhooks Vercel incoming webhooks: event paths, payloads, and response data. The Vercel plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/vercel/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `deploymentCreated` (`deploymentCreated`) * `deploymentError` (`deploymentError`) * `deploymentSucceeded` (`deploymentSucceeded`) * `projectCreated` (`projectCreated`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Deployment Created ### Deployment Created `deploymentCreated` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} vercel({ webhookHooks: { deploymentCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Deployment Error ### Deployment Error `deploymentError` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} vercel({ webhookHooks: { deploymentError: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Deployment Succeeded ### Deployment Succeeded `deploymentSucceeded` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} vercel({ webhookHooks: { deploymentSucceeded: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** ## Project Created ### Project Created `projectCreated` **Payload:** `unknown` **`webhookHooks` example** ```ts theme={null} vercel({ webhookHooks: { projectCreated: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/veriphone/api API reference for Veriphone: every `veriphone.api.*` operation with input and output types. Every `veriphone.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Coverage ### coverage `coverage` List countries where Current (mode=current) lookups are available **Risk:** `read` ```ts theme={null} await corsair.veriphone.api.coverage({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `countries` | `object[]` | Yes | — | | `updatedAt` | `string` | No | — | > **countries full type** > > ```ts theme={null} > { > iso: string, > covered: boolean > }[] > ``` *** ## Credits ### credits `credits` Get the account credit balance and usage by lookup mode **Risk:** `read` ```ts theme={null} await corsair.veriphone.api.credits({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `counter` | `number` | Yes | — | | `active` | `boolean` | Yes | — | | `payg` | `number` | Yes | — | | `limit` | `number` | Yes | — | | `plan` | `string` | Yes | — | | `renew` | `number` | Yes | — | | `last_reset` | `object` | No | — | | `usage` | `object` | No | — | > **last\_reset full type** > > ```ts theme={null} > string | { > seconds: number, > nanos: number > } > ``` > **usage full type** > > ```ts theme={null} > { > static?: { > count: number, > credits: number > }, > current?: { > count: number, > credits: number > } > } > ``` *** ## Get Example Phone Number ### getExamplePhoneNumber `getExamplePhoneNumber` Tool to retrieve an example phone number for a specified country and type. Use after confirming the country code. Example: 'Get an example mobile number for US'. **Risk:** `read` ```ts theme={null} await corsair.veriphone.api.getExamplePhoneNumber({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `country_code` | `string` | Yes | ISO 3166-1 alpha-2 country code, e.g. US. Confirm it before calling. | | `type` | `mobile \| fixed_line \| toll_free \| premium_rate \| shared_cost \| voip` | No | Example number line type. Defaults to mobile when omitted. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `success \| error` | Yes | — | | `phone_type` | `string` | Yes | — | | `country_code` | `string` | Yes | — | | `country_prefix` | `string` | No | — | | `international_number` | `string` | No | — | | `local_number` | `string` | No | — | | `e164` | `string` | No | — | | `E164` | `string` | No | — | *** ## Verify Phone Number ### verifyPhoneNumber `verifyPhoneNumber` Tool to verify if a phone number is valid. Use when you need to confirm formatting, region, and carrier details. **Risk:** `write` ```ts theme={null} await corsair.veriphone.api.verifyPhoneNumber({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phone` | `string` | Yes | Phone number to verify. International E.164 format recommended. | | `default_country` | `string` | No | ISO 3166-1 alpha-2 country code used when the number has no international prefix. | | `mode` | `static \| current` | No | static (default, 1 credit) or current (live registry lookup, 10 credits). | | `record` | `boolean` | No | true to save the result to the account verification history. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `success \| error \| syntax-error` | Yes | — | | `phone_valid` | `boolean` | Yes | — | | `phone` | `string` | No | — | | `reason` | `too_short \| too_long \| invalid_length \| invalid_country_code \| unrecognized_range \| not_a_number` | No | — | | `phone_type` | `mobile \| fixed_line \| fixed_line_or_mobile \| toll_free \| premium_rate \| shared_cost \| voip \| short_code \| emergency \| unknown` | No | — | | `shortcode_cost` | `toll_free \| standard_rate \| premium_rate \| unknown` | No | — | | `carrier` | `string` | No | — | | `phone_region` | `string` | No | — | | `country` | `string` | No | — | | `country_code` | `string` | No | — | | `country_prefix` | `string` | No | — | | `international_number` | `string` | No | — | | `local_number` | `string` | No | — | | `e164` | `string` | No | — | | `timezone` | `string[]` | No | — | | `geographical` | `boolean` | No | — | | `mode` | `string` | No | — | | `original_carrier` | `string` | No | — | | `original_line_type` | `string` | No | — | | `original_mccmnc` | `string` | No | — | | `current_carrier` | `string` | No | — | | `current_line_type` | `string` | No | — | | `current_mccmnc` | `string` | No | — | | `current_lookup` | `string` | No | — | | `ported` | `boolean` | No | — | | `carrier_data_source` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/veriphone/database Veriphone local sync: searchable entities, `.search()` filters, and operators. The Veriphone plugin syncs data locally. Use `corsair.veriphone.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/veriphone/overview Veriphone plugin for Corsair Use **Veriphone** through Corsair: one client, typed API calls. **What you get:** * 4 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/veriphone ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/veriphone ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/veriphone ``` ```bash bun theme={null} bun add corsair @corsair-dev/veriphone ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { veriphone } from '@corsair-dev/veriphone'; export const corsair = createCorsair({ plugins: [ veriphone(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} veriphone() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'veriphone', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`coverage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.veriphone.api.coverage({}); ``` **`verifyPhoneNumber`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.veriphone.api.verifyPhoneNumber({}); ``` See the full list on the [API](/plugins/veriphone/api) page. ## What's next > **[API reference](/plugins/veriphone/api)** > > Every `veriphone.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/vestaboard/api API reference for Vestaboard: every `vestaboard.api.*` operation with input and output types. Every `vestaboard.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Subscriptions ### list `subscriptions.list` List Vestaboard subscriptions accessible with the current API key and secret **Risk:** `read` ```ts theme={null} await corsair.vestaboard.api.subscriptions.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `subscriptions` | `object[]` | Yes | — | > **subscriptions full type** > > ```ts theme={null} > { > id: string, > boardId: string > }[] > ``` *** ### postMessage `subscriptions.postMessage` Send text or a 6x22 character grid to a Vestaboard subscription **Risk:** `write` ```ts theme={null} await corsair.vestaboard.api.subscriptions.postMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `string` | Yes | — | | `text` | `string` | No | — | | `characters` | `number[][]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `text` | `string` | Yes | — | | `created` | `string` | Yes | — | | `muted` | `boolean` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/vestaboard/database Vestaboard local sync: searchable entities, `.search()` filters, and operators. The Vestaboard plugin syncs data locally. Use `corsair.vestaboard.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Messages Path: `vestaboard.db.messages.search` ```ts theme={null} const rows = await corsair.vestaboard.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `created` | `string` | equals, contains, startsWith, endsWith, in | | `muted` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Subscriptions Path: `vestaboard.db.subscriptions.search` ```ts theme={null} const rows = await corsair.vestaboard.db.subscriptions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `boardId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/vestaboard/overview Split-flap display API for sending messages to mechanical message boards and signage. Use **Vestaboard** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 2 typed API operations * 2 synced entities (`messages`, `subscriptions`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/vestaboard ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/vestaboard ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/vestaboard ``` ```bash bun theme={null} bun add corsair @corsair-dev/vestaboard ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { vestaboard } from '@corsair-dev/vestaboard'; export const corsair = createCorsair({ plugins: [ vestaboard(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} vestaboard() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'vestaboard', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`subscriptions.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.vestaboard.api.subscriptions.list({}); ``` **`subscriptions.postMessage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.vestaboard.api.subscriptions.postMessage({}); ``` See the full list on the [API](/plugins/vestaboard/api) page. ## Query synced data Synced entities support `tenant.vestaboard.db..search()` and `.list()`: `messages`, `subscriptions`. See [Database](/plugins/vestaboard/database) for filters and operators. ## What's next > **[API reference](/plugins/vestaboard/api)** > > Every `vestaboard.api.*` operation with input and output types. > **[Database](/plugins/vestaboard/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/waboxapp/api API reference for Waboxapp: every `waboxapp.api.*` operation with input and output types. Every `waboxapp.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### getStatus `accounts.getStatus` Get WhatsApp session status **Risk:** `read` ```ts theme={null} await corsair.waboxapp.api.accounts.getStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `uid` | `string` | No | — | | `hook_url` | `string` | No | — | | `alias` | `string` | No | — | | `platform` | `string` | No | — | | `battery` | `string` | No | — | | `plugged` | `string` | No | — | | `locale` | `string` | No | — | | `error` | `string` | No | — | *** ## Messages ### sendChat `messages.sendChat` Send a WhatsApp text message **Risk:** `write` ```ts theme={null} await corsair.waboxapp.api.messages.sendChat({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | No | — | | `to` | `string` | Yes | — | | `custom_uid` | `string` | No | — | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `custom_uid` | `string \| number` | No | — | | `error` | `string` | No | — | *** ### sendImage `messages.sendImage` Send a WhatsApp image by URL **Risk:** `write` ```ts theme={null} await corsair.waboxapp.api.messages.sendImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | No | — | | `to` | `string` | Yes | — | | `custom_uid` | `string` | No | — | | `url` | `string` | Yes | — | | `caption` | `string` | No | — | | `description` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `custom_uid` | `string \| number` | No | — | | `error` | `string` | No | — | *** ### sendLink `messages.sendLink` Send a WhatsApp link preview **Risk:** `write` ```ts theme={null} await corsair.waboxapp.api.messages.sendLink({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | No | — | | `to` | `string` | Yes | — | | `custom_uid` | `string` | No | — | | `url` | `string` | Yes | — | | `caption` | `string` | No | — | | `description` | `string` | No | — | | `url_thumb` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `custom_uid` | `string \| number` | No | — | | `error` | `string` | No | — | *** ### sendMedia `messages.sendMedia` Send a WhatsApp media file by URL **Risk:** `write` ```ts theme={null} await corsair.waboxapp.api.messages.sendMedia({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `uid` | `string` | No | — | | `to` | `string` | Yes | — | | `custom_uid` | `string` | No | — | | `url` | `string` | Yes | — | | `caption` | `string` | No | — | | `description` | `string` | No | — | | `url_thumb` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | | `custom_uid` | `string \| number` | No | — | | `error` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/waboxapp/database Waboxapp local sync: searchable entities, `.search()` filters, and operators. The Waboxapp plugin syncs data locally. Use `corsair.waboxapp.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `waboxapp.db.accounts.search` ```ts theme={null} const rows = await corsair.waboxapp.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `success` | `boolean` | equals | | `uid` | `string` | equals, contains, startsWith, endsWith, in | | `hook_url` | `string` | equals, contains, startsWith, endsWith, in | | `alias` | `string` | equals, contains, startsWith, endsWith, in | | `platform` | `string` | equals, contains, startsWith, endsWith, in | | `battery` | `string` | equals, contains, startsWith, endsWith, in | | `plugged` | `string` | equals, contains, startsWith, endsWith, in | | `locale` | `string` | equals, contains, startsWith, endsWith, in | | `error` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `waboxapp.db.messages.search` ```ts theme={null} const rows = await corsair.waboxapp.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `success` | `boolean` | equals | | `error` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/waboxapp/overview Waboxapp plugin for Corsair Use **Waboxapp** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 2 synced entities (`accounts`, `messages`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/waboxapp ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/waboxapp ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/waboxapp ``` ```bash bun theme={null} bun add corsair @corsair-dev/waboxapp ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { waboxapp } from '@corsair-dev/waboxapp'; export const corsair = createCorsair({ plugins: [ waboxapp(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} waboxapp() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'waboxapp', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.getStatus`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.waboxapp.api.accounts.getStatus({}); ``` **`messages.sendChat`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.waboxapp.api.messages.sendChat({}); ``` See the full list on the [API](/plugins/waboxapp/api) page. ## Query synced data Synced entities support `tenant.waboxapp.db..search()` and `.list()`: `accounts`, `messages`. See [Database](/plugins/waboxapp/database) for filters and operators. ## What's next > **[API reference](/plugins/waboxapp/api)** > > Every `waboxapp.api.*` operation with input and output types. > **[Database](/plugins/waboxapp/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/wakatime/api API reference for WakaTime: every `wakatime.api.*` operation with input and output types. Every `wakatime.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Users ### current `users.current` Get the current WakaTime user **Risk:** `read` ```ts theme={null} await corsair.wakatime.api.users.current({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > username?: string, > display_name?: string, > email?: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/wakatime/database WakaTime local sync: searchable entities, `.search()` filters, and operators. The WakaTime plugin syncs data locally. Use `corsair.wakatime.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/wakatime/overview Developer time tracker for coding activity, project stats, and programming productivity metrics. Use **WakaTime** through Corsair: one client, typed API calls. **What you get:** * 1 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/wakatime ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/wakatime ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/wakatime ``` ```bash bun theme={null} bun add corsair @corsair-dev/wakatime ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { wakatime } from '@corsair-dev/wakatime'; export const corsair = createCorsair({ plugins: [ wakatime(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} wakatime() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'wakatime', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`users.current`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.wakatime.api.users.current({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/wakatime/api) reference.* See the full list on the [API](/plugins/wakatime/api) page. ## What's next > **[API reference](/plugins/wakatime/api)** > > Every `wakatime.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/webflow/api API reference for Webflow: every `webflow.api.*` operation with input and output types. Every `webflow.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Assets ### createAssetFolder `assets.createAssetFolder` Create a new asset folder within a site **Risk:** `write` ```ts theme={null} await corsair.webflow.api.assets.createAssetFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteAsset `assets.deleteAsset` Permanently delete an asset from a site **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.webflow.api.assets.deleteAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | Yes | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAsset `assets.getAsset` Get details about a specific asset including content type, size, and hosted URLs **Risk:** `read` ```ts theme={null} await corsair.webflow.api.assets.getAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | Yes | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getAssetFolder `assets.getAssetFolder` Get details about a specific asset folder including its assets and parent folder **Risk:** `read` ```ts theme={null} await corsair.webflow.api.assets.getAssetFolder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | Yes | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAssetFolders `assets.listAssetFolders` List all asset folders within a site **Risk:** `read` ```ts theme={null} await corsair.webflow.api.assets.listAssetFolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listAssets `assets.listAssets` List all assets uploaded to a site with pagination **Risk:** `read` ```ts theme={null} await corsair.webflow.api.assets.listAssets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### uploadAsset `assets.uploadAsset` Register an asset upload and receive a pre-signed S3 upload URL. The file itself is uploaded to S3 in a second step **Risk:** `write` ```ts theme={null} await corsair.webflow.api.assets.uploadAsset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Collection Fields ### createCollectionField `collectionFields.createCollectionField` Create a custom field in a collection. Fields must be created one at a time **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionFields.createCollectionField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteCollectionField `collectionFields.deleteCollectionField` Permanently delete a custom field from a collection schema **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.webflow.api.collectionFields.deleteCollectionField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | Yes | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateCollectionField `collectionFields.updateCollectionField` Update a custom field's display name, help text, or required status **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionFields.updateCollectionField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | Yes | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Collection Items ### createBulkCollectionItems `collectionItems.createBulkCollectionItems` Create up to 100 collection items in a single request across multiple locales **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.createBulkCollectionItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createCollectionItem `collectionItems.createCollectionItem` Create a staged item in a collection. Field data keys must use the collection schema field slugs **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.createCollectionItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### createLiveCollectionItem `collectionItems.createLiveCollectionItem` Create an item published immediately to the live site, bypassing the staged workflow **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.createLiveCollectionItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteCollectionItem `collectionItems.deleteCollectionItem` Permanently delete a single item from a collection **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.webflow.api.collectionItems.deleteCollectionItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | Yes | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteCollectionItems `collectionItems.deleteCollectionItems` Delete multiple collection items in a single request **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.webflow.api.collectionItems.deleteCollectionItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCollectionItem `collectionItems.getCollectionItem` Get a single staged collection item by id **Risk:** `read` ```ts theme={null} await corsair.webflow.api.collectionItems.getCollectionItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | Yes | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getLiveCollectionItem `collectionItems.getLiveCollectionItem` Get the published version of a collection item **Risk:** `read` ```ts theme={null} await corsair.webflow.api.collectionItems.getLiveCollectionItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | Yes | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listCollectionItems `collectionItems.listCollectionItems` List items in a collection with pagination and filtering **Risk:** `read` ```ts theme={null} await corsair.webflow.api.collectionItems.listCollectionItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### publishCollectionItems `collectionItems.publishCollectionItems` Publish staged collection items to the live site **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.publishCollectionItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### unpublishLiveCollectionItem `collectionItems.unpublishLiveCollectionItem` Unpublish a live item and revert it to draft status. The item stays in the collection **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.unpublishLiveCollectionItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | Yes | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### unpublishLiveCollectionItems `collectionItems.unpublishLiveCollectionItems` Unpublish up to 100 live items and set them to draft. Items stay in the collection **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.unpublishLiveCollectionItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateCollectionItem `collectionItems.updateCollectionItem` Update a staged collection item's field values, draft status, or archive status **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.updateCollectionItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | Yes | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateCollectionItemLegacy `collectionItems.updateCollectionItemLegacy` Deprecated: update staged collection items via the bulk items endpoint. Use updateCollectionItem instead **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.updateCollectionItemLegacy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateLiveCollectionItem `collectionItems.updateLiveCollectionItem` Update a live collection item, publishing changes immediately to the production site **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.updateLiveCollectionItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | Yes | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateLiveCollectionItems `collectionItems.updateLiveCollectionItems` Update up to 100 published items in a collection **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collectionItems.updateLiveCollectionItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Collections ### createCollection `collections.createCollection` Create a new CMS collection in a site **Risk:** `write` ```ts theme={null} await corsair.webflow.api.collections.createCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### deleteCollection `collections.deleteCollection` Permanently delete a collection and all its items **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.webflow.api.collections.deleteCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getCollection `collections.getCollection` Get a collection including its full field schema **Risk:** `read` ```ts theme={null} await corsair.webflow.api.collections.getCollection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listCollections `collections.listCollections` List all CMS collections for a site **Risk:** `read` ```ts theme={null} await corsair.webflow.api.collections.listCollections({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Comments ### listCommentThreads `comments.listCommentThreads` List all comment threads for a site. New comments may take up to 5 minutes to appear **Risk:** `read` ```ts theme={null} await corsair.webflow.api.comments.listCommentThreads({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Components ### getComponentProperties `components.getComponentProperties` Get the default property values of a component definition **Risk:** `read` ```ts theme={null} await corsair.webflow.api.components.getComponentProperties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | Yes | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Ecommerce ### fulfillOrder `ecommerce.fulfillOrder` Mark an order as fulfilled **Risk:** `write` ```ts theme={null} await corsair.webflow.api.ecommerce.fulfillOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | Yes | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getItemInventory `ecommerce.getItemInventory` Get current inventory levels for a SKU item **Risk:** `read` ```ts theme={null} await corsair.webflow.api.ecommerce.getItemInventory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | Yes | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getOrder `ecommerce.getOrder` Get detailed information about a specific order including customer, items, and payment status **Risk:** `read` ```ts theme={null} await corsair.webflow.api.ecommerce.getOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | Yes | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listOrders `ecommerce.listOrders` List all orders for a site with status filtering and pagination **Risk:** `read` ```ts theme={null} await corsair.webflow.api.ecommerce.listOrders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### refundOrder `ecommerce.refundOrder` Refund an order, reversing the Stripe charge and setting the order status to refunded **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.webflow.api.ecommerce.refundOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | Yes | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### unfulfillOrder `ecommerce.unfulfillOrder` Mark a previously fulfilled order as unfulfilled **Risk:** `write` ```ts theme={null} await corsair.webflow.api.ecommerce.unfulfillOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | Yes | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateItemInventory `ecommerce.updateItemInventory` Update inventory levels for a SKU item, either directly or incrementally **Risk:** `write` ```ts theme={null} await corsair.webflow.api.ecommerce.updateItemInventory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | Yes | — | | `field_id` | `string` | No | — | | `item_id` | `string` | Yes | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateOrder `ecommerce.updateOrder` Update specific fields of an existing order such as fulfillment details and internal notes **Risk:** `write` ```ts theme={null} await corsair.webflow.api.ecommerce.updateOrder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | Yes | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Forms ### listFormSubmissions `forms.listFormSubmissions` List form submissions for a site with pagination and optional filtering by form element id **Risk:** `read` ```ts theme={null} await corsair.webflow.api.forms.listFormSubmissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Pages ### getPage `pages.getPage` Get page metadata including title, slug, SEO and Open Graph settings **Risk:** `read` ```ts theme={null} await corsair.webflow.api.pages.getPage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | Yes | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getPageDom `pages.getPageDom` Get page content nodes for a static page, including text, image, form, search-button, and component-instance nodes. This is not the complete DOM **Risk:** `read` ```ts theme={null} await corsair.webflow.api.pages.getPageDom({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | Yes | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listPages `pages.listPages` List all static and CMS-driven pages for a site **Risk:** `read` ```ts theme={null} await corsair.webflow.api.pages.listPages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updatePageMetadata `pages.updatePageMetadata` Update page-level metadata including SEO and Open Graph fields **Risk:** `write` ```ts theme={null} await corsair.webflow.api.pages.updatePageMetadata({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | Yes | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Sites ### getCustomDomains `sites.getCustomDomains` List all custom domains configured for a site **Risk:** `read` ```ts theme={null} await corsair.webflow.api.sites.getCustomDomains({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### getSite `sites.getSite` Get detailed information about a specific site **Risk:** `read` ```ts theme={null} await corsair.webflow.api.sites.getSite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listSites `sites.listSites` List all Webflow sites accessible to the authenticated user **Risk:** `read` ```ts theme={null} await corsair.webflow.api.sites.listSites({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### publishSite `sites.publishSite` Publish a site, making staged changes live. Rate limited to 1 successful publish per minute **Risk:** `write` ```ts theme={null} await corsair.webflow.api.sites.publishSite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### updateSite `sites.updateSite` Update site properties such as name and parent folder (Enterprise workspaces only) **Risk:** `write` ```ts theme={null} await corsair.webflow.api.sites.updateSite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Token ### getTokenAuthorizedBy `token.getTokenAuthorizedBy` Get information about the user who authorized the access token **Risk:** `read` ```ts theme={null} await corsair.webflow.api.token.getTokenAuthorizedBy({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ## Webhooks ### deleteWebhook `webhooks.deleteWebhook` Remove a webhook by id **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.webflow.api.webhooks.deleteWebhook({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | No | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | Yes | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** ### listWebhooks `webhooks.listWebhooks` List all app-created webhooks registered for a site **Risk:** `read` ```ts theme={null} await corsair.webflow.api.webhooks.listWebhooks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `site_id` | `string` | Yes | — | | `collection_id` | `string` | No | — | | `field_id` | `string` | No | — | | `item_id` | `string` | No | — | | `asset_id` | `string` | No | — | | `asset_folder_id` | `string` | No | — | | `page_id` | `string` | No | — | | `component_id` | `string` | No | — | | `order_id` | `string` | No | — | | `webhook_id` | `string` | No | — | | `body` | `any` | No | — | | `query` | `object` | No | — | | `headers` | `object` | No | — | | `baseUrl` | `string` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `any` *** # Database Source: https://docs.corsair.dev/plugins/webflow/database Webflow local sync: searchable entities, `.search()` filters, and operators. The Webflow plugin syncs data locally. Use `corsair.webflow.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Asset Folders Path: `webflow.db.assetFolders.search` ```ts theme={null} const rows = await corsair.webflow.db.assetFolders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `parentFolder` | `string` | equals, contains, startsWith, endsWith, in | | `siteId` | `string` | equals, contains, startsWith, endsWith, in | | `createdOn` | `string` | equals, contains, startsWith, endsWith, in | | `lastUpdated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Assets Path: `webflow.db.assets.search` ```ts theme={null} const rows = await corsair.webflow.db.assets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `contentType` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `number` | equals, gt, gte, lt, lte, in | | `siteId` | `string` | equals, contains, startsWith, endsWith, in | | `hostedUrl` | `string` | equals, contains, startsWith, endsWith, in | | `originalFileName` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `createdOn` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Collection Items Path: `webflow.db.collectionItems.search` ```ts theme={null} const rows = await corsair.webflow.db.collectionItems.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `collectionId` | `string` | equals, contains, startsWith, endsWith, in | | `cmsLocaleId` | `string` | equals, contains, startsWith, endsWith, in | | `lastPublished` | `string` | equals, contains, startsWith, endsWith, in | | `lastUpdated` | `string` | equals, contains, startsWith, endsWith, in | | `createdOn` | `string` | equals, contains, startsWith, endsWith, in | | `isArchived` | `boolean` | equals | | `isDraft` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Collections Path: `webflow.db.collections.search` ```ts theme={null} const rows = await corsair.webflow.db.collections.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `siteId` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `singularName` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `createdOn` | `string` | equals, contains, startsWith, endsWith, in | | `lastUpdated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Orders Path: `webflow.db.orders.search` ```ts theme={null} const rows = await corsair.webflow.db.orders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `orderId` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `acceptedOn` | `string` | equals, contains, startsWith, endsWith, in | | `fulfilledOn` | `string` | equals, contains, startsWith, endsWith, in | | `refundedOn` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Pages Path: `webflow.db.pages.search` ```ts theme={null} const rows = await corsair.webflow.db.pages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `siteId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `parentId` | `string` | equals, contains, startsWith, endsWith, in | | `collectionId` | `string` | equals, contains, startsWith, endsWith, in | | `createdOn` | `string` | equals, contains, startsWith, endsWith, in | | `lastUpdated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sites Path: `webflow.db.sites.search` ```ts theme={null} const rows = await corsair.webflow.db.sites.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `displayName` | `string` | equals, contains, startsWith, endsWith, in | | `shortName` | `string` | equals, contains, startsWith, endsWith, in | | `previewUrl` | `string` | equals, contains, startsWith, endsWith, in | | `timeZone` | `string` | equals, contains, startsWith, endsWith, in | | `lastPublished` | `string` | equals, contains, startsWith, endsWith, in | | `createdOn` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `webflow.db.webhooks.search` ```ts theme={null} const rows = await corsair.webflow.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `triggerType` | `string` | equals, contains, startsWith, endsWith, in | | `siteId` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `workspaceId` | `string` | equals, contains, startsWith, endsWith, in | | `createdOn` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/webflow/overview Visual web design platform for building, hosting, and managing responsive marketing sites. Use **Webflow** through Corsair: one client, typed API calls, local DB sync. Webflow exposes site, CMS collection, asset, page, ecommerce, and webhook workflows for the no-code website platform. Use Corsair permissions for destructive actions such as deleting collections, items, assets, or webhooks, and for refunding orders. **What you get:** * 52 typed API operations * 8 synced entities (`assetFolders`, `assets`, `collectionItems`, `collections`, `orders`, `pages`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/webflow ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/webflow ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/webflow ``` ```bash bun theme={null} bun add corsair @corsair-dev/webflow ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { webflow } from '@corsair-dev/webflow'; export const corsair = createCorsair({ plugins: [ webflow(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} webflow() ``` More: [API Key](/concepts/api-key) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Webflow OAuth app. ```ts theme={null} webflow({ authType: 'oauth_2', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'webflow', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`assets.getAsset`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.webflow.api.assets.getAsset({}); ``` **`assets.createAssetFolder`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.webflow.api.assets.createAssetFolder({}); ``` See the full list on the [API](/plugins/webflow/api) page. ## Query synced data Synced entities support `tenant.webflow.db..search()` and `.list()`: `assetFolders`, `assets`, `collectionItems`, `collections`, `orders`, `pages`, `sites`, `webhooks`. See [Database](/plugins/webflow/database) for filters and operators. ## What's next > **[API reference](/plugins/webflow/api)** > > Every `webflow.api.*` operation with input and output types. > **[Database](/plugins/webflow/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/webscrapingai/api API reference for WebScraping.AI: every `webscrapingai.api.*` operation with input and output types. Every `webscrapingai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getInfo `account.getInfo` Return account quota and credit information **Risk:** `read` ```ts theme={null} await corsair.webscrapingai.api.account.getInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `email` | `string` | Yes | — | | `remaining_api_calls` | `number` | No | — | | `remaining_monthly_credits` | `number` | No | — | | `remaining_payg_credits` | `number` | No | — | | `remaining_total_credits` | `number` | No | — | | `resets_at` | `number` | No | — | *** ## Ai ### askQuestion `ai.askQuestion` Answer a question using the content of a web page **Risk:** `read` ```ts theme={null} await corsair.webscrapingai.api.ai.askQuestion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `js` | `boolean` | No | — | | `js_timeout` | `number` | No | — | | `timeout` | `number` | No | — | | `wait_for` | `string` | No | — | | `proxy` | `datacenter \| residential \| stealth` | No | — | | `country` | `string` | No | — | | `device` | `desktop \| mobile \| tablet` | No | — | | `headers` | `object` | No | — | | `js_script` | `string` | No | — | | `custom_proxy` | `string` | No | — | | `error_on_404` | `boolean` | No | — | | `error_on_redirect` | `boolean` | No | — | | `question` | `string` | Yes | — | > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `string` *** ### extractFields `ai.extractFields` Extract requested fields from a web page as structured JSON **Risk:** `read` ```ts theme={null} await corsair.webscrapingai.api.ai.extractFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `js` | `boolean` | No | — | | `js_timeout` | `number` | No | — | | `timeout` | `number` | No | — | | `wait_for` | `string` | No | — | | `proxy` | `datacenter \| residential \| stealth` | No | — | | `country` | `string` | No | — | | `device` | `desktop \| mobile \| tablet` | No | — | | `headers` | `object` | No | — | | `js_script` | `string` | No | — | | `custom_proxy` | `string` | No | — | | `error_on_404` | `boolean` | No | — | | `error_on_redirect` | `boolean` | No | — | | `fields` | `object` | Yes | — | > **headers full type** > > ```ts theme={null} > { > } > ``` > **fields full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** ## Scraping ### getHtml `scraping.getHtml` Return the rendered HTML of a web page **Risk:** `read` ```ts theme={null} await corsair.webscrapingai.api.scraping.getHtml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `js` | `boolean` | No | — | | `js_timeout` | `number` | No | — | | `timeout` | `number` | No | — | | `wait_for` | `string` | No | — | | `proxy` | `datacenter \| residential \| stealth` | No | — | | `country` | `string` | No | — | | `device` | `desktop \| mobile \| tablet` | No | — | | `headers` | `object` | No | — | | `js_script` | `string` | No | — | | `custom_proxy` | `string` | No | — | | `error_on_404` | `boolean` | No | — | | `error_on_redirect` | `boolean` | No | — | > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `string` *** ### getSelectedHtml `scraping.getSelectedHtml` Return HTML matching one CSS selector **Risk:** `read` ```ts theme={null} await corsair.webscrapingai.api.scraping.getSelectedHtml({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `js` | `boolean` | No | — | | `js_timeout` | `number` | No | — | | `timeout` | `number` | No | — | | `wait_for` | `string` | No | — | | `proxy` | `datacenter \| residential \| stealth` | No | — | | `country` | `string` | No | — | | `device` | `desktop \| mobile \| tablet` | No | — | | `headers` | `object` | No | — | | `js_script` | `string` | No | — | | `custom_proxy` | `string` | No | — | | `error_on_404` | `boolean` | No | — | | `error_on_redirect` | `boolean` | No | — | | `selector` | `string` | Yes | — | > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `string` *** ### getSelectedMultiple `scraping.getSelectedMultiple` Return HTML matching multiple CSS selectors **Risk:** `read` ```ts theme={null} await corsair.webscrapingai.api.scraping.getSelectedMultiple({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `js` | `boolean` | No | — | | `js_timeout` | `number` | No | — | | `timeout` | `number` | No | — | | `wait_for` | `string` | No | — | | `proxy` | `datacenter \| residential \| stealth` | No | — | | `country` | `string` | No | — | | `device` | `desktop \| mobile \| tablet` | No | — | | `headers` | `object` | No | — | | `js_script` | `string` | No | — | | `custom_proxy` | `string` | No | — | | `error_on_404` | `boolean` | No | — | | `error_on_redirect` | `boolean` | No | — | | `selectors` | `string[]` | Yes | — | > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > string | string[] | { > } > ``` *** ### getText `scraping.getText` Return clean text or Markdown extracted from a web page **Risk:** `read` ```ts theme={null} await corsair.webscrapingai.api.scraping.getText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `js` | `boolean` | No | — | | `js_timeout` | `number` | No | — | | `timeout` | `number` | No | — | | `wait_for` | `string` | No | — | | `proxy` | `datacenter \| residential \| stealth` | No | — | | `country` | `string` | No | — | | `device` | `desktop \| mobile \| tablet` | No | — | | `headers` | `object` | No | — | | `js_script` | `string` | No | — | | `custom_proxy` | `string` | No | — | | `error_on_404` | `boolean` | No | — | | `error_on_redirect` | `boolean` | No | — | | `text_format` | `plain \| json \| xml` | No | — | | `return_links` | `boolean` | No | — | > **headers full type** > > ```ts theme={null} > { > } > ``` **Output:** `object` > **Output full type** > > ```ts theme={null} > string | { > title?: string, > description?: string | null, > content: string > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/webscrapingai/database WebScraping.AI local sync: searchable entities, `.search()` filters, and operators. The WebScraping.AI plugin syncs data locally. Use `corsair.webscrapingai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/webscrapingai/overview WebScraping.AI plugin for Corsair Use **WebScraping.AI** through Corsair: one client, typed API calls. **What you get:** * 7 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/webscrapingai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/webscrapingai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/webscrapingai ``` ```bash bun theme={null} bun add corsair @corsair-dev/webscrapingai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { webscrapingai } from '@corsair-dev/webscrapingai'; export const corsair = createCorsair({ plugins: [ webscrapingai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} webscrapingai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'webscrapingai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getInfo`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.webscrapingai.api.account.getInfo({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/webscrapingai/api) reference.* See the full list on the [API](/plugins/webscrapingai/api) page. ## What's next > **[API reference](/plugins/webscrapingai/api)** > > Every `webscrapingai.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/webvizio/api API reference for Webvizio: every `webvizio.api.*` operation with input and output types. Every `webvizio.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Projects ### list `projects.list` List all available Webvizio projects **Risk:** `read` ```ts theme={null} await corsair.webvizio.api.projects.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > uuid: string, > name: string, > id?: number, > externalId?: string | null, > screenshot?: string | null, > url?: string | null, > createdAt?: string | null, > updatedAt?: string | null > }[] > ``` *** ## Webhooks ### list `webhooks.list` List all configured Webvizio webhook subscriptions **Risk:** `read` ```ts theme={null} await corsair.webvizio.api.webhooks.list({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: number, > url: string, > event: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/webvizio/database Webvizio local sync: searchable entities, `.search()` filters, and operators. The Webvizio plugin syncs data locally. Use `corsair.webvizio.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Projects Path: `webvizio.db.projects.search` ```ts theme={null} const rows = await corsair.webvizio.db.projects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `externalId` | `string` | equals, contains, startsWith, endsWith, in | | `screenshot` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `webvizio.db.webhooks.search` ```ts theme={null} const rows = await corsair.webvizio.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `event` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/webvizio/overview Website feedback tool for visual bug reports, annotations, and client review workflows. Use **Webvizio** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 2 typed API operations * 2 synced entities (`projects`, `webhooks`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/webvizio ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/webvizio ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/webvizio ``` ```bash bun theme={null} bun add corsair @corsair-dev/webvizio ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { webvizio } from '@corsair-dev/webvizio'; export const corsair = createCorsair({ plugins: [ webvizio({ authType: 'api_key', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} webvizio({ authType: 'api_key', }) ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'webvizio', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`projects.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.webvizio.api.projects.list({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/webvizio/api) reference.* See the full list on the [API](/plugins/webvizio/api) page. ## Query synced data Synced entities support `tenant.webvizio.db..search()` and `.list()`: `projects`, `webhooks`. See [Database](/plugins/webvizio/database) for filters and operators. ## What's next > **[API reference](/plugins/webvizio/api)** > > Every `webvizio.api.*` operation with input and output types. > **[Database](/plugins/webvizio/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/whatsapp/api API reference for WhatsApp: every `whatsapp.api.*` operation with input and output types. Every `whatsapp.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Business Profiles ### get `businessProfiles.get` Retrieve WhatsApp Business Profile information **Risk:** `read` ```ts theme={null} await corsair.whatsapp.api.businessProfiles.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phoneNumberId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > about?: string, > address?: string, > description?: string, > email?: string, > profile_picture_url?: string, > websites?: string[], > vertical?: string > }[] > ``` *** ## Media ### getInfo `media.getInfo` Get information about uploaded media **Risk:** `read` ```ts theme={null} await corsair.whatsapp.api.media.getInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mediaId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `messaging_product` | `whatsapp` | Yes | — | | `url` | `string` | Yes | — | | `mime_type` | `string` | Yes | — | | `sha256` | `string` | Yes | — | | `file_size` | `number` | No | — | | `id` | `string` | Yes | — | *** ### upload `media.upload` Upload media to WhatsApp servers **Risk:** `write` ```ts theme={null} await corsair.whatsapp.api.media.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phoneNumberId` | `string` | No | — | | `file` | `string` | Yes | — | | `type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | *** ## Messages ### markRead `messages.markRead` Mark an incoming WhatsApp message as read **Risk:** `write` ```ts theme={null} await corsair.whatsapp.api.messages.markRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phoneNumberId` | `string` | No | — | | `messageId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### send `messages.send` Send a text, media, template, or interactive WhatsApp message **Risk:** `write` ```ts theme={null} await corsair.whatsapp.api.messages.send({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > phoneNumberId?: string, > messaging_product: whatsapp, > recipient_type?: individual, > to: string, > context?: { > message_id: string > }, > type: text, > text: { > preview_url?: boolean, > body: string > } > } | { > phoneNumberId?: string, > messaging_product: whatsapp, > recipient_type?: individual, > to: string, > context?: { > message_id: string > }, > type: image, > image: { > id?: string, > link?: string, > caption?: string, > filename?: string > } > } | { > phoneNumberId?: string, > messaging_product: whatsapp, > recipient_type?: individual, > to: string, > context?: { > message_id: string > }, > type: audio, > audio: { > id?: string, > link?: string > } > } | { > phoneNumberId?: string, > messaging_product: whatsapp, > recipient_type?: individual, > to: string, > context?: { > message_id: string > }, > type: document, > document: { > id?: string, > link?: string, > caption?: string, > filename?: string > } > } | { > phoneNumberId?: string, > messaging_product: whatsapp, > recipient_type?: individual, > to: string, > context?: { > message_id: string > }, > type: video, > video: { > id?: string, > link?: string, > caption?: string > } > } | { > phoneNumberId?: string, > messaging_product: whatsapp, > recipient_type?: individual, > to: string, > context?: { > message_id: string > }, > type: template, > template: { > name: string, > language: { > code: string, > policy?: deterministic > }, > components?: { > }[] > } > } | { > phoneNumberId?: string, > messaging_product: whatsapp, > recipient_type?: individual, > to: string, > context?: { > message_id: string > }, > type: interactive, > interactive: { > type: button | list | product | product_list | flow, > body?: { > text?: string > } > } > } | { > phoneNumberId?: string, > messaging_product: whatsapp, > recipient_type?: individual, > to: string, > context?: { > message_id: string > }, > type: location, > location: { > longitude: number, > latitude: number, > name?: string, > address?: string > } > } | { > phoneNumberId?: string, > messaging_product: whatsapp, > recipient_type?: individual, > to: string, > context?: { > message_id: string > }, > type: contacts, > contacts: { > name: { > formatted_name: string, > first_name?: string > }, > phones?: { > phone?: string, > type?: string, > wa_id?: string > }[] > }[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `messaging_product` | `whatsapp` | Yes | — | | `contacts` | `object[]` | Yes | — | | `messages` | `object[]` | Yes | — | > **contacts full type** > > ```ts theme={null} > { > input: string, > wa_id: string > }[] > ``` > **messages full type** > > ```ts theme={null} > { > id: string, > message_status?: string > }[] > ``` *** ## Message Templates ### create `messageTemplates.create` Create a new message template **Risk:** `write` ```ts theme={null} await corsair.whatsapp.api.messageTemplates.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `businessAccountId` | `string` | No | — | | `name` | `string` | Yes | — | | `language` | `string` | Yes | — | | `category` | `string` | Yes | — | | `components` | `object[]` | Yes | — | > **components full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `status` | `string` | No | — | | `category` | `string` | No | — | *** ### delete `messageTemplates.delete` Delete a message template by name **Risk:** `write` ```ts theme={null} await corsair.whatsapp.api.messageTemplates.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `businessAccountId` | `string` | No | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | Yes | — | *** ### getStatus `messageTemplates.getStatus` Get the status of a message template **Risk:** `read` ```ts theme={null} await corsair.whatsapp.api.messageTemplates.getStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `businessAccountId` | `string` | No | — | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### list `messageTemplates.list` List all message templates **Risk:** `read` ```ts theme={null} await corsair.whatsapp.api.messageTemplates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `businessAccountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ## Phone Numbers ### get `phoneNumbers.get` Validate credentials and retrieve phone number health **Risk:** `read` ```ts theme={null} await corsair.whatsapp.api.phoneNumbers.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `phoneNumberId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `display_phone_number` | `string` | No | — | | `verified_name` | `string` | No | — | | `quality_rating` | `string` | No | — | | `code_verification_status` | `string` | No | — | | `platform_type` | `string` | No | — | | `throughput` | `object` | No | — | > **throughput full type** > > ```ts theme={null} > { > level?: string > } > ``` *** ### list `phoneNumbers.list` List all phone numbers for the WhatsApp Business Account **Risk:** `read` ```ts theme={null} await corsair.whatsapp.api.phoneNumbers.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `businessAccountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > display_phone_number?: string, > verified_name?: string, > quality_rating?: string, > code_verification_status?: string, > platform_type?: string, > throughput?: { > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/whatsapp/database WhatsApp local sync: searchable entities, `.search()` filters, and operators. The WhatsApp plugin syncs data locally. Use `corsair.whatsapp.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Business Profiles Path: `whatsapp.db.businessProfiles.search` ```ts theme={null} const rows = await corsair.whatsapp.db.businessProfiles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `phoneNumberId` | `string` | equals, contains, startsWith, endsWith, in | | `about` | `string` | equals, contains, startsWith, endsWith, in | | `address` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `profile_picture_url` | `string` | equals, contains, startsWith, endsWith, in | | `vertical` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `whatsapp.db.contacts.search` ```ts theme={null} const rows = await corsair.whatsapp.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `waId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `whatsapp.db.messages.search` ```ts theme={null} const rows = await corsair.whatsapp.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `from` | `string` | equals, contains, startsWith, endsWith, in | | `to` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `phoneNumberId` | `string` | equals, contains, startsWith, endsWith, in | | `businessAccountId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Phone Numbers Path: `whatsapp.db.phoneNumbers.search` ```ts theme={null} const rows = await corsair.whatsapp.db.phoneNumbers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `display_phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `verified_name` | `string` | equals, contains, startsWith, endsWith, in | | `quality_rating` | `string` | equals, contains, startsWith, endsWith, in | | `code_verification_status` | `string` | equals, contains, startsWith, endsWith, in | | `platform_type` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/whatsapp/overview Messaging platform API for business conversations, templates, media, and customer notifications. Use **WhatsApp** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 11 typed API operations * 4 synced entities (`businessProfiles`, `contacts`, `messages`, `phoneNumbers`) for fast `.search()` / `.list()` * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/whatsapp ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/whatsapp ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/whatsapp ``` ```bash bun theme={null} bun add corsair @corsair-dev/whatsapp ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { whatsapp } from '@corsair-dev/whatsapp'; export const corsair = createCorsair({ plugins: [ whatsapp(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} whatsapp() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'whatsapp', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`businessProfiles.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.whatsapp.api.businessProfiles.get({}); ``` **`media.upload`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.whatsapp.api.media.upload({}); ``` See the full list on the [API](/plugins/whatsapp/api) page. ## Query synced data Synced entities support `tenant.whatsapp.db..search()` and `.list()`: `businessProfiles`, `contacts`, `messages`, `phoneNumbers`. See [Database](/plugins/whatsapp/database) for filters and operators. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/whatsapp/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/whatsapp/api)** > > Every `whatsapp.api.*` operation with input and output types. > **[Database](/plugins/whatsapp/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/whatsapp/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/whatsapp/webhooks WhatsApp incoming webhooks: event paths, payloads, and response data. The WhatsApp plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/whatsapp/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `messages` * `received` (`messages.received`) * `statusChanged` (`messages.statusChanged`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Messages ### Received `messages.received` Incoming WhatsApp messages from customers **Payload** | Name | Type | Required | Description | | - | - | - | - | | `businessAccountId` | `string` | Yes | — | | `phoneNumberId` | `string` | Yes | — | | `displayPhoneNumber` | `string` | Yes | — | | `contacts` | `object[]` | Yes | — | | `messages` | `object[]` | Yes | — | > **contacts full type** > > ```ts theme={null} > { > wa_id: string, > profile?: { > name?: string > } > }[] > ``` > **messages full type** > > ```ts theme={null} > { > id: string, > from: string, > timestamp: string, > type: string, > context?: { > from?: string, > id?: string, > referred_product?: { > } > }, > text?: { > body: string > }, > image?: { > caption?: string > }, > audio?: { > }, > document?: { > caption?: string > }, > video?: { > caption?: string > }, > sticker?: { > }, > location?: { > }, > contacts?: { > }[], > interactive?: { > button_reply?: { > title?: string > }, > list_reply?: { > title?: string > } > }, > button?: { > text?: string > }, > order?: { > }, > referral?: { > }, > errors?: { > }[] > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > businessAccountId: string, > phoneNumberId: string, > displayPhoneNumber: string, > contacts: { > wa_id: string, > profile?: { > name?: string > } > }[], > messages: { > id: string, > from: string, > timestamp: string, > type: string, > context?: { > from?: string, > id?: string, > referred_product?: { > } > }, > text?: { > body: string > }, > image?: { > caption?: string > }, > audio?: { > }, > document?: { > caption?: string > }, > video?: { > caption?: string > }, > sticker?: { > }, > location?: { > }, > contacts?: { > }[], > interactive?: { > button_reply?: { > title?: string > }, > list_reply?: { > title?: string > } > }, > button?: { > text?: string > }, > order?: { > }, > referral?: { > }, > errors?: { > }[] > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} whatsapp({ webhookHooks: { messages: { received: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Status Changed `messages.statusChanged` WhatsApp sent, delivered, read, failed, deleted, or error updates **Payload** | Name | Type | Required | Description | | - | - | - | - | | `businessAccountId` | `string` | Yes | — | | `phoneNumberId` | `string` | Yes | — | | `displayPhoneNumber` | `string` | Yes | — | | `statuses` | `object[]` | Yes | — | | `errors` | `object[]` | Yes | — | > **statuses full type** > > ```ts theme={null} > { > id: string, > status: sent | delivered | read | failed | deleted, > timestamp: string, > recipient_id?: string, > conversation?: { > }, > pricing?: { > }, > errors?: { > code?: number, > title?: string, > message?: string, > error_data?: { > details?: string > } > }[] > }[] > ``` > **errors full type** > > ```ts theme={null} > { > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > businessAccountId: string, > phoneNumberId: string, > displayPhoneNumber: string, > statuses: { > id: string, > status: sent | delivered | read | failed | deleted, > timestamp: string, > recipient_id?: string, > conversation?: { > }, > pricing?: { > }, > errors?: { > code?: number, > title?: string, > message?: string, > error_data?: { > details?: string > } > }[] > }[], > errors: { > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} whatsapp({ webhookHooks: { messages: { statusChanged: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/whautomate/api API reference for Whautomate: every `whautomate.api.*` operation with input and output types. Every `whautomate.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getAccountInfo `account.getAccountInfo` Fetch account name and owner email **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.account.getAccountInfo({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `ownerEmail` | `string` | No | — | | `apiHost` | `string` | No | — | *** ## Broadcasts ### getBroadcastById `broadcasts.getBroadcastById` Fetch a single broadcast by ID **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.broadcasts.getBroadcastById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `status` | `string` | Yes | — | | `segmentId` | `string` | No | — | | `messageTemplate` | `string` | No | — | | `scheduledAt` | `string` | No | — | | `sentAt` | `string` | No | — | | `stats` | `object` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **stats full type** > > ```ts theme={null} > { > total?: number, > sent?: number, > delivered?: number, > read?: number, > failed?: number > } > ``` *** ### getBroadcasts `broadcasts.getBroadcasts` List broadcasts with status and date filters **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.broadcasts.getBroadcasts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | | `status` | `draft \| scheduled \| sending \| sent \| failed` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > status: string, > segmentId?: string | null, > messageTemplate?: string, > scheduledAt?: string | null, > sentAt?: string | null, > stats?: { > total?: number, > sent?: number, > delivered?: number, > read?: number, > failed?: number > }, > createdAt?: string, > updatedAt?: string > }[] | { > data: { > id: string, > name: string, > status: string, > segmentId?: string | null, > messageTemplate?: string, > scheduledAt?: string | null, > sentAt?: string | null, > stats?: { > total?: number, > sent?: number, > delivered?: number, > read?: number, > failed?: number > }, > createdAt?: string, > updatedAt?: string > }[], > pagination?: { > page?: number, > limit?: number, > total?: number, > totalPages?: number > } > } > ``` *** ## Contacts ### addContact `contacts.addContact` Create a new contact **Risk:** `write` ```ts theme={null} await corsair.whautomate.api.contacts.addContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `phoneNumber` | `string` | Yes | — | | `location` | `object` | Yes | — | | `email` | `string` | No | — | | `avatar` | `string` | No | — | | `segmentId` | `string` | No | — | | `stage` | `string` | No | — | | `notes` | `string` | No | — | | `tags` | `string[]` | No | — | | `customFields` | `object` | No | — | > **location full type** > > ```ts theme={null} > { > id: string, > title?: string > } > ``` > **customFields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `phoneNumber` | `string` | No | — | | `phone` | `string` | No | — | | `email` | `string` | No | — | | `avatar` | `string` | No | — | | `segmentId` | `string` | No | — | | `location` | `object` | No | — | | `stage` | `string` | No | — | | `notes` | `string` | No | — | | `tags` | `string[]` | No | — | | `customFields` | `object` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | > **location full type** > > ```ts theme={null} > { > id: string, > title?: string > } > ``` > **customFields full type** > > ```ts theme={null} > { > } > ``` *** ### getContacts `contacts.getContacts` List contacts with pagination and filters **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.contacts.getContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `search` | `string` | No | — | | `segmentId` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > phoneNumber?: string | null, > phone?: string | null, > email?: string | null, > avatar?: string | null, > segmentId?: string | null, > location?: { > id: string, > title?: string > }, > stage?: string | null, > notes?: string | null, > tags?: string[], > customFields?: { > } | null, > createdAt?: string, > updatedAt?: string > }[] | { > data: { > id: string, > name: string, > phoneNumber?: string | null, > phone?: string | null, > email?: string | null, > avatar?: string | null, > segmentId?: string | null, > location?: { > id: string, > title?: string > }, > stage?: string | null, > notes?: string | null, > tags?: string[], > customFields?: { > } | null, > createdAt?: string, > updatedAt?: string > }[], > pagination?: { > page?: number, > limit?: number, > total?: number, > totalPages?: number > } > } > ``` *** ### getMessagesOfContact `contacts.getMessagesOfContact` Get chat messages for a contact with pagination and date filters **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.contacts.getMessagesOfContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `contactId` | `string` | Yes | — | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > contactId?: string, > contact?: any, > channel?: string, > isIncoming?: boolean, > direction?: string, > text?: string, > content?: string, > type?: string, > status?: string, > mediaUrl?: string | null, > timestamp?: string, > createdAt?: string > }[] | { > data: { > id: string, > contactId?: string, > contact?: any, > channel?: string, > isIncoming?: boolean, > direction?: string, > text?: string, > content?: string, > type?: string, > status?: string, > mediaUrl?: string | null, > timestamp?: string, > createdAt?: string > }[], > pagination?: { > page?: number, > limit?: number, > total?: number, > totalPages?: number > } > } > ``` *** ## Segments ### deleteSegment `segments.deleteSegment` Delete a segment by ID **Risk:** `destructive` ```ts theme={null} await corsair.whautomate.api.segments.deleteSegment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `success` | `boolean` | No | — | *** ### getSegments `segments.getSegments` List segments with name filter and pagination **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.segments.getSegments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `name` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > contactCount?: number, > createdAt?: string, > updatedAt?: string > }[] | { > data: { > id: string, > name: string, > contactCount?: number, > createdAt?: string, > updatedAt?: string > }[], > pagination?: { > page?: number, > limit?: number, > total?: number, > totalPages?: number > } > } > ``` *** ## Service Categories ### deleteServiceCategory `serviceCategories.deleteServiceCategory` Delete a service category by ID **Risk:** `destructive` ```ts theme={null} await corsair.whautomate.api.serviceCategories.deleteServiceCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `success` | `boolean` | No | — | *** ### getServiceCategories `serviceCategories.getServiceCategories` List service categories with pagination **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.serviceCategories.getServiceCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > createdAt?: string, > updatedAt?: string > }[] | { > data: { > id: string, > name: string, > description?: string | null, > createdAt?: string, > updatedAt?: string > }[], > pagination?: { > page?: number, > limit?: number, > total?: number, > totalPages?: number > } > } > ``` *** ## Services ### getServiceById `services.getServiceById` Fetch a single service by ID **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.services.getServiceById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `price` | `number` | No | — | | `duration` | `number` | No | — | | `categoryId` | `string` | No | — | | `isActive` | `boolean` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### getServices `services.getServices` List services with filters **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.services.getServices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `categoryId` | `string` | No | — | | `search` | `string` | No | — | | `isActive` | `boolean` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null, > price?: number, > duration?: number, > categoryId?: string | null, > isActive?: boolean, > createdAt?: string, > updatedAt?: string > }[] | { > data: { > id: string, > name: string, > description?: string | null, > price?: number, > duration?: number, > categoryId?: string | null, > isActive?: boolean, > createdAt?: string, > updatedAt?: string > }[], > pagination?: { > page?: number, > limit?: number, > total?: number, > totalPages?: number > } > } > ``` *** ### updateService `services.updateService` Update service name, pricing, duration, and active status **Risk:** `write` ```ts theme={null} await corsair.whautomate.api.services.updateService({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `price` | `number` | No | — | | `duration` | `number` | No | — | | `categoryId` | `string` | No | — | | `isActive` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `price` | `number` | No | — | | `duration` | `number` | No | — | | `categoryId` | `string` | No | — | | `isActive` | `boolean` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ## Staff ### getStaffAvailabilityBlocks `staff.getStaffAvailabilityBlocks` Get staff availability blocks by date range **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.staff.getStaffAvailabilityBlocks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `staffId` | `string` | Yes | — | | `startDate` | `string` | No | — | | `endDate` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > staff: { > id: string, > firstName: string, > lastName: string > }, > date: string, > slots: { > start?: string, > end?: string, > startTime?: string, > endTime?: string, > startTimeUTC?: string, > endTimeUTC?: string, > available?: boolean > }[], > createdAt?: string, > updatedAt?: string > }[] > ``` *** ### getStaffById `staff.getStaffById` Fetch a single staff member by ID **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.staff.getStaffById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `firstName` | `string` | Yes | — | | `lastName` | `string` | Yes | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `avatar` | `string` | No | — | | `role` | `string` | No | — | | `active` | `boolean` | No | — | | `locations` | `string[]` | No | — | | `createdAt` | `string` | No | — | | `updatedAt` | `string` | No | — | *** ### getStaffs `staff.getStaffs` List staff members with pagination and search **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.staff.getStaffs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | | `search` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > id: string, > firstName: string, > lastName: string, > email?: string | null, > phone?: string | null, > avatar?: string | null, > role?: string | null, > active?: boolean, > locations?: string[], > createdAt?: string, > updatedAt?: string > }[] | { > data: { > id: string, > firstName: string, > lastName: string, > email?: string | null, > phone?: string | null, > avatar?: string | null, > role?: string | null, > active?: boolean, > locations?: string[], > createdAt?: string, > updatedAt?: string > }[], > pagination?: { > page?: number, > limit?: number, > total?: number, > totalPages?: number > } > } > ``` *** ## Webhooks ### getAllWebhooks `webhooks.getAllWebhooks` Retrieve registered webhooks **Risk:** `read` ```ts theme={null} await corsair.whautomate.api.webhooks.getAllWebhooks({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > url: string, > events: string[], > isActive: boolean, > createdAt?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/whautomate/database Whautomate local sync: searchable entities, `.search()` filters, and operators. The Whautomate plugin syncs data locally. Use `corsair.whautomate.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/whautomate/overview Whautomate plugin for Corsair Use **Whautomate** through Corsair: one client, typed API calls. **What you get:** * 17 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/whautomate ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/whautomate ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/whautomate ``` ```bash bun theme={null} bun add corsair @corsair-dev/whautomate ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { whautomate } from '@corsair-dev/whautomate'; export const corsair = createCorsair({ plugins: [ whautomate(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} whautomate() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'whautomate', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getAccountInfo`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.whautomate.api.account.getAccountInfo({}); ``` **`contacts.addContact`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.whautomate.api.contacts.addContact({}); ``` See the full list on the [API](/plugins/whautomate/api) page. ## What's next > **[API reference](/plugins/whautomate/api)** > > Every `whautomate.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/whoisfreaks/api API reference for Whoisfreaks: every `whoisfreaks.api.*` operation with input and output types. Every `whoisfreaks.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Asn Whois ### lookup `asnWhois.lookup` Fetch WHOIS data for an autonomous system number **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.asnWhois.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `asn` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `asn` | `object` | No | — | > **asn full type** > > ```ts theme={null} > { > } > ``` *** ## Availability ### bulkCheck `availability.bulkCheck` Check availability for up to 100 domains or TLDs at once **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.availability.bulkCheck({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `domainNames` | `string[]` | No | — | | `tld` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulk_domain_availability_response` | `object[]` | No | — | > **bulk\_domain\_availability\_response full type** > > ```ts theme={null} > { > domain?: string, > availability?: string, > message?: string > }[] > ``` *** ### check `availability.check` Check whether a domain is available for registration **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.availability.check({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `sug` | `boolean` | Yes | — | | `count` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `availability` | `string` | No | — | | `message` | `string` | No | — | | `domain_available_response` | `object[]` | No | — | > **domain\_available\_response full type** > > ```ts theme={null} > { > domain?: string, > availability?: string, > message?: string > }[] > ``` *** ## Bulk Whois ### lookup `bulkWhois.lookup` Fetch WHOIS records for up to 100 domains at once **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.bulkWhois.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainNames` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulk_whois_response` | `object[]` | No | — | > **bulk\_whois\_response full type** > > ```ts theme={null} > { > status?: boolean, > domain_name?: string, > query_time?: string, > whois_server?: string, > domain_registered?: string, > secure_dns?: boolean, > domain_handle?: string, > create_date?: string, > update_date?: string, > expiry_date?: string, > name_servers?: string[], > domain_status?: string[] > }[] > ``` *** ## Dns ### bulk `dns.bulk` Fetch DNS records for up to 100 domains and IPs at once **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.dns.bulk({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainNames` | `string[]` | No | — | | `ipAddresses` | `string[]` | No | — | | `type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `bulk_dns_info` | `object[]` | No | — | > **bulk\_dns\_info full type** > > ```ts theme={null} > { > domainName?: string, > ipAddress?: string, > queryTime?: string, > status?: boolean, > dnsTypes?: { > } > }[] > ``` *** ### historical `dns.historical` Fetch historical DNS records for a domain **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.dns.historical({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainName` | `string` | Yes | — | | `type` | `string` | Yes | — | | `page` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalPages` | `number` | No | — | | `currenPage` | `number` | No | — | | `totalRecords` | `number` | No | — | | `historicalDns` | `object[]` | No | — | > **historicalDns full type** > > ```ts theme={null} > { > domainName?: string, > ipAddress?: string, > queryTime?: string, > status?: boolean, > dnsTypes?: { > } > }[] > ``` *** ### live `dns.live` Fetch live DNS records for a domain or IP **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.dns.live({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainName` | `string` | No | — | | `ipAddress` | `string` | No | — | | `type` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domainName` | `string` | No | — | | `ipAddress` | `string` | No | — | | `queryTime` | `string` | No | — | | `status` | `boolean` | No | — | | `dnsTypes` | `object` | No | — | > **dnsTypes full type** > > ```ts theme={null} > { > } > ``` *** ### reverse `dns.reverse` Find domains pointing at an IP or record value **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.dns.reverse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `value` | `string` | Yes | — | | `type` | `a \| mx \| cname \| ns \| aaaa \| txt \| soa` | Yes | — | | `exact` | `boolean` | Yes | — | | `page` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `totalRecords` | `number` | No | — | | `totalPages` | `number` | No | — | | `currentPage` | `number` | No | — | | `reverseDnsRecords` | `object[]` | No | — | > **reverseDnsRecords full type** > > ```ts theme={null} > { > domainName?: string, > ipAddress?: string, > queryTime?: string, > status?: boolean, > dnsTypes?: { > } > }[] > ``` *** ## Domainer ### filesStatus `domainer.filesStatus` Check availability and update status of domain data files **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.domainer.filesStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `newly` | `any` | No | — | | `expired` | `any` | No | — | | `cleaned_expired` | `any` | No | — | | `dropped` | `any` | No | — | | `dropped_with_backlinks` | `any` | No | — | | `database_updates` | `any` | No | — | *** ## Domain Reputation ### lookup `domainReputation.lookup` Assess threat reputation and trust score of a domain **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.domainReputation.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `assessed_at` | `string` | No | — | | `version` | `string` | No | — | | `processing_time_ms` | `number` | No | — | | `risk_category` | `object` | No | — | | `dga_score` | `object` | No | — | > **risk\_category full type** > > ```ts theme={null} > { > } > ``` > **dga\_score full type** > > ```ts theme={null} > { > } > ``` *** ## Geolocation ### bulkLookup `geolocation.bulkLookup` Look up geolocation data for up to 100 IPs at once **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.geolocation.bulkLookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ips` | `string[]` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > ip?: string, > location?: { > }, > country_metadata?: { > }, > network?: { > }, > currency?: { > } > }[] > ``` *** ### lookup `geolocation.lookup` Look up geolocation data for an IP address **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.geolocation.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | No | — | | `location` | `object` | No | — | | `country_metadata` | `object` | No | — | | `network` | `object` | No | — | | `currency` | `object` | No | — | > **location full type** > > ```ts theme={null} > { > } > ``` > **country\_metadata full type** > > ```ts theme={null} > { > } > ``` > **network full type** > > ```ts theme={null} > { > } > ``` > **currency full type** > > ```ts theme={null} > { > } > ``` *** ## Ip Reputation ### bulkLookup `ipReputation.bulkLookup` Fetch threat reputation for up to 100 IPs at once **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.ipReputation.bulkLookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ips` | `string[]` | Yes | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > ip?: string, > location?: { > }, > network?: { > }, > asn?: { > }, > security?: { > } > }[] > ``` *** ### lookup `ipReputation.lookup` Fetch threat reputation for an IP address **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.ipReputation.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | No | — | | `location` | `object` | No | — | | `network` | `object` | No | — | | `asn` | `object` | No | — | | `security` | `object` | No | — | > **location full type** > > ```ts theme={null} > { > } > ``` > **network full type** > > ```ts theme={null} > { > } > ``` > **asn full type** > > ```ts theme={null} > { > } > ``` > **security full type** > > ```ts theme={null} > { > } > ``` *** ## Ip Whois ### lookup `ipWhois.lookup` Fetch WHOIS data for an IP address **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.ipWhois.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ip` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `ip_address` | `string` | No | — | | `as_number` | `string` | No | — | | `query_time` | `string` | No | — | | `whois_server` | `string` | No | — | | `whois_raw_response` | `string` | No | — | *** ## Ssl ### lookup `ssl.lookup` Fetch the live SSL certificate for a domain **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.ssl.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainName` | `string` | Yes | — | | `chain` | `boolean` | Yes | — | | `sslRaw` | `boolean` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domainName` | `string` | No | — | | `queryTime` | `string` | No | — | | `sslCertificates` | `object[]` | No | — | | `sslRaw` | `string` | No | — | > **sslCertificates full type** > > ```ts theme={null} > { > }[] > ``` *** ## Subdomains ### lookup `subdomains.lookup` Enumerate subdomains of a domain **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.subdomains.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | Yes | — | | `after` | `string` | No | — | | `before` | `string` | No | — | | `status` | `active \| inactive` | No | — | | `page` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `domain` | `string` | No | — | | `status` | `boolean` | No | — | | `current_page` | `number` | No | — | | `total_pages` | `number` | No | — | | `query_time` | `string` | No | — | | `total_records` | `number` | No | — | | `subdomains` | `object[]` | No | — | > **subdomains full type** > > ```ts theme={null} > { > }[] > ``` *** ## Typosquatting ### lookup `typosquatting.lookup` Find typo-squat domain variants of a brand keyword **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.typosquatting.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyword` | `string` | No | — | | `pattern` | `string` | No | — | | `pageToken` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `totalRecords` | `number` | No | — | | `currentPage` | `number` | No | — | | `totalPages` | `number` | No | — | | `hasNextPage` | `boolean` | No | — | | `nextPageToken` | `string` | No | — | *** ## Whois History ### lookup `whoisHistory.lookup` Fetch historical WHOIS records for a domain **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.whoisHistory.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainName` | `string` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `whois` | `string` | No | — | | `total_records` | `string \| number` | No | — | | `total_Result` | `number` | No | — | | `total_Pages` | `number` | No | — | | `current_Page` | `number` | No | — | | `whois_domains_historical` | `object[]` | No | — | > **whois\_domains\_historical full type** > > ```ts theme={null} > { > status?: boolean, > domain_name?: string, > query_time?: string, > whois_server?: string, > domain_registered?: string, > secure_dns?: boolean, > domain_handle?: string, > create_date?: string, > update_date?: string, > expiry_date?: string, > name_servers?: string[], > domain_status?: string[] > }[] > ``` *** ## Whois Live ### lookupV2 `whoisLive.lookupV2` Fetch real-time WHOIS information for a domain **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.whoisLive.lookupV2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `domainName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `boolean` | No | — | | `domain_name` | `string` | No | — | | `query_time` | `string` | No | — | | `whois_server` | `string` | No | — | | `domain_registered` | `string` | No | — | | `secure_dns` | `boolean` | No | — | | `domain_handle` | `string` | No | — | | `create_date` | `string` | No | — | | `update_date` | `string` | No | — | | `expiry_date` | `string` | No | — | | `name_servers` | `string[]` | No | — | | `domain_status` | `string[]` | No | — | *** ## Whois Reverse ### lookup `whoisReverse.lookup` Search WHOIS records by keyword across domains **Risk:** `read` ```ts theme={null} await corsair.whoisfreaks.api.whoisReverse.lookup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keyword` | `string` | Yes | — | | `page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Total_Result` | `number` | No | — | | `Total_Pages` | `number` | No | — | | `Current_Page` | `number` | No | — | | `whois_domains_historical` | `object[]` | No | — | > **whois\_domains\_historical full type** > > ```ts theme={null} > { > status?: boolean, > domain_name?: string, > query_time?: string, > whois_server?: string, > domain_registered?: string, > secure_dns?: boolean, > domain_handle?: string, > create_date?: string, > update_date?: string, > expiry_date?: string, > name_servers?: string[], > domain_status?: string[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/whoisfreaks/database Whoisfreaks local sync: searchable entities, `.search()` filters, and operators. The Whoisfreaks plugin syncs data locally. Use `corsair.whoisfreaks.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/whoisfreaks/overview Whoisfreaks plugin for Corsair Use **Whoisfreaks** through Corsair: one client, typed API calls. **What you get:** * 21 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/whoisfreaks ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/whoisfreaks ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/whoisfreaks ``` ```bash bun theme={null} bun add corsair @corsair-dev/whoisfreaks ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { whoisfreaks } from '@corsair-dev/whoisfreaks'; export const corsair = createCorsair({ plugins: [ whoisfreaks(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} whoisfreaks() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'whoisfreaks', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`asnWhois.lookup`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.whoisfreaks.api.asnWhois.lookup({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/whoisfreaks/api) reference.* See the full list on the [API](/plugins/whoisfreaks/api) page. ## What's next > **[API reference](/plugins/whoisfreaks/api)** > > Every `whoisfreaks.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/winstonai/api API reference for Winston AI: every `winstonai.api.*` operation with input and output types. Every `winstonai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Detect ### aiImage `detect.aiImage` Score whether a public image URL was created by a human or generated by AI **Risk:** `read` ```ts theme={null} await corsair.winstonai.api.detect.aiImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | — | | `version` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `score` | `number` | Yes | — | | `human_probability` | `number` | No | — | | `ai_probability` | `number` | No | — | | `version` | `string` | No | — | | `mime_type` | `string` | No | — | | `credits_used` | `number` | No | — | | `credits_remaining` | `number` | No | — | *** ### aiText `detect.aiText` Score whether text, a public file, or a website was written by a human or generated by AI **Risk:** `read` ```ts theme={null} await corsair.winstonai.api.detect.aiText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | — | | `file` | `string` | No | — | | `website` | `string` | No | — | | `version` | `string` | No | — | | `sentences` | `boolean` | No | — | | `language` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | | `score` | `number` | Yes | — | | `sentences` | `object[]` | No | — | | `input` | `string` | No | — | | `attack_detected` | `object` | No | — | | `readability_score` | `number` | No | — | | `credits_used` | `number` | No | — | | `credits_remaining` | `number` | No | — | | `version` | `string` | No | — | | `language` | `string` | No | — | > **sentences full type** > > ```ts theme={null} > { > text: string, > score: number > }[] > ``` > **attack\_detected full type** > > ```ts theme={null} > { > zero_width_space?: boolean, > homoglyph_attack?: boolean > } > ``` *** ### plagiarism `detect.plagiarism` Scan text, a public file, or a website for matching sources on the web **Risk:** `read` ```ts theme={null} await corsair.winstonai.api.detect.plagiarism({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | — | | `file` | `string` | No | — | | `website` | `string` | No | — | | `excluded_sources` | `string[]` | No | — | | `language` | `string` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | | `scanInformation` | `object` | No | — | | `result` | `object` | No | — | | `sources` | `object[]` | No | — | | `attackDetected` | `object` | No | — | | `text` | `string` | No | — | | `credits_used` | `number` | No | — | | `credits_remaining` | `number` | No | — | > **scanInformation full type** > > ```ts theme={null} > { > service?: string, > scanTime?: string, > inputType?: string, > language?: string > } > ``` > **result full type** > > ```ts theme={null} > { > score?: number, > sourceCounts?: number, > textWordCounts?: number, > totalPlagiarismWords?: number, > identicalWordCounts?: number, > similarWordCounts?: number > } > ``` > **sources full type** > > ```ts theme={null} > { > score?: number, > canAccess?: boolean, > url?: string, > title?: string, > plagiarismWords?: number, > identicalWordCounts?: number, > similarWordCounts?: number, > totalNumberOfWords?: number, > author?: string | null, > description?: string | null, > publishedDate?: number | null, > source?: string | null, > citation?: boolean, > plagiarismFound?: { > startIndex?: number, > endIndex?: number, > sequence?: string | null > }[], > is_excluded?: boolean > }[] > ``` > **attackDetected full type** > > ```ts theme={null} > { > zero_width_space?: boolean, > homoglyph_attack?: boolean > } > ``` *** ## Text ### compare `text.compare` Compare two texts and return similarity scores **Risk:** `read` ```ts theme={null} await corsair.winstonai.api.text.compare({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `first_text` | `string` | Yes | — | | `second_text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `number` | No | — | | `similarity_score` | `number` | Yes | — | | `first_text` | `object` | No | — | | `second_text` | `object` | No | — | | `credits_used` | `number` | No | — | | `credits_remaining` | `number` | No | — | > **first\_text full type** > > ```ts theme={null} > { > total_word_count?: number, > matching_word_count?: number, > similarity_percentage?: number, > items?: { > type?: string, > word_count?: number, > index_start?: number, > length?: number > }[] > } > ``` > **second\_text full type** > > ```ts theme={null} > { > total_word_count?: number, > matching_word_count?: number, > similarity_percentage?: number, > items?: { > type?: string, > word_count?: number, > index_start?: number, > length?: number > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/winstonai/database Winston AI local sync: searchable entities, `.search()` filters, and operators. The Winston AI plugin syncs data locally. Use `corsair.winstonai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/winstonai/overview Winston AI plugin for Corsair Use **Winston AI** through Corsair: one client, typed API calls. **What you get:** * 4 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/winstonai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/winstonai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/winstonai ``` ```bash bun theme={null} bun add corsair @corsair-dev/winstonai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { winstonai } from '@corsair-dev/winstonai'; export const corsair = createCorsair({ plugins: [ winstonai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} winstonai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'winstonai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`detect.aiImage`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.winstonai.api.detect.aiImage({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/winstonai/api) reference.* See the full list on the [API](/plugins/winstonai/api) page. ## What's next > **[API reference](/plugins/winstonai/api)** > > Every `winstonai.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/witai/api API reference for Wit.ai: every `witai.api.*` operation with input and output types. Every `witai.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Apps ### createApp `apps.createApp` Create a new Wit.ai app **Risk:** `write` ```ts theme={null} await corsair.witai.api.apps.createApp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the app | | `lang` | `string` | Yes | Language code, e.g. "en" | | `private` | `boolean \| string` | No | Whether the app is private | | `timezone` | `string` | No | Timezone, e.g. "America/Los\_Angeles" | | `desc` | `string` | No | Description of the app | **Output** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `string` | Yes | — | | `access_token` | `string` | No | — | *** ### deleteApp `apps.deleteApp` Delete a specific Wit.ai app **Risk:** `destructive` ```ts theme={null} await corsair.witai.api.apps.deleteApp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `string` | Yes | The Wit.ai app ID to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `string` | No | — | | `success` | `boolean` | No | — | *** ### exportApp `apps.exportApp` Export Wit.ai app data as a ZIP backup **Risk:** `read` ```ts theme={null} await corsair.witai.api.apps.exportApp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `string` | Yes | The Wit.ai app ID to export | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uri` | `string` | No | — | *** ### getApp `apps.getApp` Retrieve metadata and settings of a Wit.ai app **Risk:** `read` ```ts theme={null} await corsair.witai.api.apps.getApp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `string` | Yes | The Wit.ai app ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `lang` | `string` | No | — | | `private` | `boolean \| string` | No | — | | `timezone` | `string` | No | — | | `desc` | `string` | No | — | | `will_train_at` | `string` | No | — | | `last_trained_at` | `string` | No | — | | `last_training_duration_secs` | `number` | No | — | | `training_status` | `string` | No | — | | `created_at` | `string` | No | — | | `updated_at` | `string` | No | — | *** ### listApps `apps.listApps` List all Wit.ai apps for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.witai.api.apps.listApps({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Max apps to return (default 100) | | `offset` | `number` | No | Pagination offset | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > lang?: string, > private?: boolean | string, > timezone?: string, > desc?: string, > will_train_at?: string | null, > last_trained_at?: string | null, > last_training_duration_secs?: number, > training_status?: string, > created_at?: string, > updated_at?: string > }[] > ``` *** ### listTags `apps.listTags` List all tag groups (versions) for a Wit.ai app **Risk:** `read` ```ts theme={null} await corsair.witai.api.apps.listTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `string` | Yes | The Wit.ai app ID | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > desc?: string | null, > created_at?: string, > updated_at?: string > }[] > ``` *** ### updateApp `apps.updateApp` Update an existing Wit.ai app **Risk:** `write` ```ts theme={null} await corsair.witai.api.apps.updateApp({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `app_id` | `string` | Yes | The Wit.ai app ID to update | | `name` | `string` | No | New name | | `lang` | `string` | No | Language code | | `private` | `boolean \| string` | No | Whether the app is private | | `timezone` | `string` | No | Timezone | | `desc` | `string` | No | Description | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sent` | `boolean` | No | — | | `n` | `number` | No | — | | `deleted` | `string \| number` | No | — | | `success` | `boolean` | No | — | *** ## Entities ### addKeyword `entities.addKeyword` Add a keyword with optional synonyms to an entity **Risk:** `write` ```ts theme={null} await corsair.witai.api.entities.addKeyword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `string` | Yes | Entity name | | `keyword` | `string` | Yes | Keyword to add | | `synonyms` | `string[]` | No | Optional synonyms for the keyword | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `roles` | `object[]` | No | — | | `lookups` | `string[]` | No | — | | `keywords` | `object[]` | No | — | > **roles full type** > > ```ts theme={null} > { > id?: string, > name: string > }[] > ``` > **keywords full type** > > ```ts theme={null} > { > keyword: string, > synonyms?: string[] > }[] > ``` *** ### addSynonym `entities.addSynonym` Add a synonym to a keyword in an entity **Risk:** `write` ```ts theme={null} await corsair.witai.api.entities.addSynonym({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `string` | Yes | Entity name | | `keyword` | `string` | Yes | Keyword to add synonym to | | `synonym` | `string` | Yes | Synonym to add | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `roles` | `object[]` | No | — | | `lookups` | `string[]` | No | — | | `keywords` | `object[]` | No | — | > **roles full type** > > ```ts theme={null} > { > id?: string, > name: string > }[] > ``` > **keywords full type** > > ```ts theme={null} > { > keyword: string, > synonyms?: string[] > }[] > ``` *** ### createEntity `entities.createEntity` Create a new entity in Wit.ai **Risk:** `write` ```ts theme={null} await corsair.witai.api.entities.createEntity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the new entity | | `roles` | `string[]` | No | Optional role names for the entity | | `lookups` | `string[]` | No | Optional lookup strategies (e.g. keywords, free-text) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `roles` | `object[]` | No | — | | `lookups` | `string[]` | No | — | | `keywords` | `object[]` | No | — | > **roles full type** > > ```ts theme={null} > { > id?: string, > name: string > }[] > ``` > **keywords full type** > > ```ts theme={null} > { > keyword: string, > synonyms?: string[] > }[] > ``` *** ### deleteEntity `entities.deleteEntity` Permanently delete an entity by name **Risk:** `destructive` ```ts theme={null} await corsair.witai.api.entities.deleteEntity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `string` | Yes | Entity name to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sent` | `boolean` | No | — | | `n` | `number` | No | — | | `deleted` | `string \| number` | No | — | | `success` | `boolean` | No | — | *** ### deleteKeyword `entities.deleteKeyword` Delete a keyword from an entity **Risk:** `destructive` ```ts theme={null} await corsair.witai.api.entities.deleteKeyword({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `string` | Yes | Entity name | | `keyword` | `string` | Yes | Keyword to delete | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > sent?: boolean, > n?: number, > deleted?: string | number, > success?: boolean > } | { > id: string, > name: string, > roles?: { > id?: string, > name: string > }[], > lookups?: string[], > keywords?: { > keyword: string, > synonyms?: string[] > }[] > } > ``` *** ### deleteRole `entities.deleteRole` Delete a specific role from an entity **Risk:** `destructive` ```ts theme={null} await corsair.witai.api.entities.deleteRole({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `string` | Yes | Entity name | | `role` | `string` | Yes | Role name to delete | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > sent?: boolean, > n?: number, > deleted?: string | number, > success?: boolean > } | { > id: string, > name: string, > roles?: { > id?: string, > name: string > }[], > lookups?: string[], > keywords?: { > keyword: string, > synonyms?: string[] > }[] > } > ``` *** ### deleteSynonym `entities.deleteSynonym` Delete a synonym from a keyword in an entity **Risk:** `destructive` ```ts theme={null} await corsair.witai.api.entities.deleteSynonym({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `string` | Yes | Entity name | | `keyword` | `string` | Yes | Keyword name | | `synonym` | `string` | Yes | Synonym to delete | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > sent?: boolean, > n?: number, > deleted?: string | number, > success?: boolean > } | { > id: string, > name: string, > roles?: { > id?: string, > name: string > }[], > lookups?: string[], > keywords?: { > keyword: string, > synonyms?: string[] > }[] > } > ``` *** ### getEntity `entities.getEntity` Retrieve details of a specific entity **Risk:** `read` ```ts theme={null} await corsair.witai.api.entities.getEntity({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `entity` | `string` | Yes | Entity name or ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `roles` | `object[]` | No | — | | `lookups` | `string[]` | No | — | | `keywords` | `object[]` | No | — | > **roles full type** > > ```ts theme={null} > { > id?: string, > name: string > }[] > ``` > **keywords full type** > > ```ts theme={null} > { > keyword: string, > synonyms?: string[] > }[] > ``` *** ### listEntities `entities.listEntities` List all entities in the Wit.ai app **Risk:** `read` ```ts theme={null} await corsair.witai.api.entities.listEntities({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > roles?: { > id?: string, > name: string > }[], > lookups?: string[], > keywords?: { > keyword: string, > synonyms?: string[] > }[] > }[] > ``` *** ## Intents ### createIntent `intents.createIntent` Create a new intent in Wit.ai **Risk:** `write` ```ts theme={null} await corsair.witai.api.intents.createIntent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the new intent | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `entities` | `object[]` | No | — | > **entities full type** > > ```ts theme={null} > { > id?: string, > name?: string, > role?: string, > start?: number, > end?: number, > body?: string, > confidence?: number, > entities?: any[], > value?: any, > type?: string > }[] > ``` *** ### deleteIntent `intents.deleteIntent` Permanently delete an intent by name **Risk:** `destructive` ```ts theme={null} await corsair.witai.api.intents.deleteIntent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `intent` | `string` | Yes | Intent name to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sent` | `boolean` | No | — | | `n` | `number` | No | — | | `deleted` | `string \| number` | No | — | | `success` | `boolean` | No | — | *** ### getIntent `intents.getIntent` Retrieve details of a specific intent **Risk:** `read` ```ts theme={null} await corsair.witai.api.intents.getIntent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `intent` | `string` | Yes | Intent name or ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `entities` | `object[]` | No | — | > **entities full type** > > ```ts theme={null} > { > id?: string, > name?: string, > role?: string, > start?: number, > end?: number, > body?: string, > confidence?: number, > entities?: any[], > value?: any, > type?: string > }[] > ``` *** ### listIntents `intents.listIntents` List all intents in the Wit.ai app **Risk:** `read` ```ts theme={null} await corsair.witai.api.intents.listIntents({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > entities?: { > id?: string, > name?: string, > role?: string, > start?: number, > end?: number, > body?: string, > confidence?: number, > entities?: any[], > value?: any, > type?: string > }[] > }[] > ``` *** ## Message ### detectLanguage `message.detectLanguage` Detect the language of a given text input **Risk:** `read` ```ts theme={null} await corsair.witai.api.message.detectLanguage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Text whose language should be detected | | `n` | `number` | No | Number of locales to return | **Output** | Name | Type | Required | Description | | - | - | - | - | | `detected_locales` | `object[]` | Yes | — | > **detected\_locales full type** > > ```ts theme={null} > { > locale: string, > confidence?: number > }[] > ``` *** ### getMessage `message.getMessage` Analyze text to extract intents, entities, and traits **Risk:** `read` ```ts theme={null} await corsair.witai.api.message.getMessage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Text to analyze for intents, entities, and traits | | `n` | `number` | No | Max number of n-best intents/traits to return | | `tag` | `string` | No | App version tag to use | | `context` | `string` | No | JSON context object (location, reference\_time, etc.) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `intents` | `object[]` | No | — | | `entities` | `object` | No | — | | `traits` | `object` | No | — | > **intents full type** > > ```ts theme={null} > { > id?: string, > name: string, > confidence?: number > }[] > ``` > **entities full type** > > ```ts theme={null} > { > } > ``` > **traits full type** > > ```ts theme={null} > { > } > ``` *** ## Traits ### addValue `traits.addValue` Add a new value to an existing trait **Risk:** `write` ```ts theme={null} await corsair.witai.api.traits.addValue({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `trait` | `string` | Yes | Trait name | | `value` | `string` | Yes | Value to add | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `values` | `object[]` | No | — | > **values full type** > > ```ts theme={null} > { > id?: string, > value: string > }[] > ``` *** ### createTrait `traits.createTrait` Create a new trait in Wit.ai **Risk:** `write` ```ts theme={null} await corsair.witai.api.traits.createTrait({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | Name of the new trait | | `values` | `string[]` | No | Initial values for the trait | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `values` | `object[]` | No | — | > **values full type** > > ```ts theme={null} > { > id?: string, > value: string > }[] > ``` *** ### deleteTrait `traits.deleteTrait` Delete a trait by name **Risk:** `destructive` ```ts theme={null} await corsair.witai.api.traits.deleteTrait({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `trait` | `string` | Yes | Trait name to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sent` | `boolean` | No | — | | `n` | `number` | No | — | | `deleted` | `string \| number` | No | — | | `success` | `boolean` | No | — | *** ### getTrait `traits.getTrait` Retrieve details of a specific trait **Risk:** `read` ```ts theme={null} await corsair.witai.api.traits.getTrait({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `trait` | `string` | Yes | Trait name or ID | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `values` | `object[]` | No | — | > **values full type** > > ```ts theme={null} > { > id?: string, > value: string > }[] > ``` *** ### listTraits `traits.listTraits` List all traits in the Wit.ai app **Risk:** `read` ```ts theme={null} await corsair.witai.api.traits.listTraits({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > name: string, > values?: { > id?: string, > value: string > }[] > }[] > ``` *** ## Utterances ### createUtterances `utterances.createUtterances` Add training utterances to the Wit.ai app (rate limit: 200/min) **Risk:** `write` ```ts theme={null} await corsair.witai.api.utterances.createUtterances({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `utterances` | `object[]` | Yes | Utterances to add (rate limit: 200 samples/min) | > **utterances full type** > > ```ts theme={null} > { > text: string, > intent?: string, > entities?: { > entity: string, > start: number, > end: number, > body: string, > entities?: any[] > }[], > traits?: { > trait: string, > value: string > }[] > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `sent` | `boolean` | No | — | | `n` | `number` | No | — | | `deleted` | `string \| number` | No | — | | `success` | `boolean` | No | — | *** ### deleteUtterances `utterances.deleteUtterances` Delete validated utterances from the Wit.ai app **Risk:** `destructive` ```ts theme={null} await corsair.witai.api.utterances.deleteUtterances({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `texts` | `string[]` | Yes | Utterance texts to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sent` | `boolean` | No | — | | `n` | `number` | No | — | | `deleted` | `string \| number` | No | — | | `success` | `boolean` | No | — | *** ### listUtterances `utterances.listUtterances` List training utterances from the Wit.ai app **Risk:** `read` ```ts theme={null} await corsair.witai.api.utterances.listUtterances({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Max utterances to return | | `offset` | `number` | No | Pagination offset | | `intent_id` | `string` | No | Filter by intent ID | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id?: string, > text: string, > intent?: { > id?: string, > name: string > } | null, > entities?: { > id?: string, > name?: string, > role?: string, > start?: number, > end?: number, > body?: string, > confidence?: number, > entities?: any[], > value?: any, > type?: string > }[], > traits?: { > id?: string, > value: string, > confidence?: number > }[] > }[] > ``` *** ## Voices ### getVoice `voices.getVoice` Retrieve details for a specific text-to-speech voice **Risk:** `read` ```ts theme={null} await corsair.witai.api.voices.getVoice({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `voice` | `string` | Yes | Voice name to retrieve details for | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `locale` | `string` | No | — | | `gender` | `string` | No | — | | `styles` | `object[]` | No | — | | `supported_features` | `string[]` | No | — | > **styles full type** > > ```ts theme={null} > { > name: string, > speed?: string[], > pitch?: string[] > }[] > ``` *** ### listVoices `voices.listVoices` List all available text-to-speech voices grouped by locale **Risk:** `read` ```ts theme={null} await corsair.witai.api.voices.listVoices({}); ``` **Input:** *empty object* **Output:** `object` > **Output full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/witai/database Wit.ai local sync: searchable entities, `.search()` filters, and operators. The Wit.ai plugin syncs data locally. Use `corsair.witai.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Apps Path: `witai.db.apps.search` ```ts theme={null} const rows = await corsair.witai.db.apps.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `lang` | `string` | equals, contains, startsWith, endsWith, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `desc` | `string` | equals, contains, startsWith, endsWith, in | | `will_train_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_trained_at` | `string` | equals, contains, startsWith, endsWith, in | | `last_training_duration_secs` | `number` | equals, gt, gte, lt, lte, in | | `training_status` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Entities Path: `witai.db.entities.search` ```ts theme={null} const rows = await corsair.witai.db.entities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Intents Path: `witai.db.intents.search` ```ts theme={null} const rows = await corsair.witai.db.intents.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tags Path: `witai.db.tags.search` ```ts theme={null} const rows = await corsair.witai.db.tags.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `desc` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `updated_at` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Traits Path: `witai.db.traits.search` ```ts theme={null} const rows = await corsair.witai.db.traits.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Utterances Path: `witai.db.utterances.search` ```ts theme={null} const rows = await corsair.witai.db.utterances.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Voices Path: `witai.db.voices.search` ```ts theme={null} const rows = await corsair.witai.db.voices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `locale` | `string` | equals, contains, startsWith, endsWith, in | | `gender` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/witai/overview Natural language understanding platform for intent detection and conversational app building. Use **Wit.ai** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 32 typed API operations * 7 synced entities (`apps`, `entities`, `intents`, `tags`, `traits`, `utterances`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/witai ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/witai ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/witai ``` ```bash bun theme={null} bun add corsair @corsair-dev/witai ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { witai } from '@corsair-dev/witai'; export const corsair = createCorsair({ plugins: [ witai(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} witai() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'witai', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`apps.exportApp`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.witai.api.apps.exportApp({}); ``` **`apps.createApp`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.witai.api.apps.createApp({}); ``` See the full list on the [API](/plugins/witai/api) page. ## Query synced data Synced entities support `tenant.witai.db..search()` and `.list()`: `apps`, `entities`, `intents`, `tags`, `traits`, `utterances`, `voices`. See [Database](/plugins/witai/database) for filters and operators. ## What's next > **[API reference](/plugins/witai/api)** > > Every `witai.api.*` operation with input and output types. > **[Database](/plugins/witai/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/wix/api API reference for Wix: every `wix.api.*` operation with input and output types. Every `wix.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Automations ### bulkUpdateStorageItemTags `automations.bulkUpdateStorageItemTags` Tool to bulk update tags on multiple storage items in Wix automations. Use when you need to set public and/or private tags on multiple storage items at once. Requires 'Set Up Automations' permission. **Risk:** `write` ```ts theme={null} await corsair.wix.api.automations.bulkUpdateStorageItemTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `itemIds` | `string[]` | Yes | — | | `assignTags` | `string[]` | No | — | | `unassignTags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### bulkUpdateStorageItemTagsByFilter `automations.bulkUpdateStorageItemTagsByFilter` Tool to bulk update tags on storage items matching filter criteria. Use when you need to add or remove tags from multiple storage items at once based on filter conditions. If a tag appears in both assign and unassign, it will be assigned. This operation is asynchronous and triggers the Storage Item Tags Modified event. **Risk:** `write` ```ts theme={null} await corsair.wix.api.automations.bulkUpdateStorageItemTagsByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | | `assignTags` | `string[]` | No | — | | `unassignTags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `jobId` | `string` | No | — | *** ### cancelEvent `automations.cancelEvent` Tool to cancel any remaining automation actions for a trigger and external entity. Use when you need to stop automation workflows that are no longer relevant (e.g., after an invoice is paid or a form submission is processed). **Risk:** `write` ```ts theme={null} await corsair.wix.api.automations.cancelEvent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `triggerId` | `string` | No | — | | `externalEntityId` | `string` | No | — | **Output:** *empty object* *** ## Benefits ### bulkDeleteBenefitItems `benefits.bulkDeleteBenefitItems` Tool to bulk delete benefit items from Wix Benefit Programs. Use when you need to remove multiple benefit items at once by providing their IDs. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.benefits.bulkDeleteBenefitItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkDeleteBenefitItemsByFilter `benefits.bulkDeleteBenefitItemsByFilter` Tool to bulk delete benefit program items by filter criteria. Use when you need to delete multiple items matching specific conditions within a namespace. If no filter is provided, this may delete all items in the namespace. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.benefits.bulkDeleteBenefitItemsByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `namespace` | `string` | No | — | | `filter` | `lazy` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkDeletePoolDefinitions `benefits.bulkDeletePoolDefinitions` Tool to bulk delete pool definitions from Wix Benefit Programs. Use when you need to remove multiple pool definitions by their IDs in a single operation. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.benefits.bulkDeletePoolDefinitions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### deleteProgramDefinition `benefits.deleteProgramDefinition` Tool to delete a program definition from Wix Benefit Programs. Use when you need to permanently remove a benefit program definition by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.benefits.deleteProgramDefinition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `definitionId` | `string` | Yes | — | **Output:** *empty object* *** ## Billing ### bulkDeleteBillableItems `billing.bulkDeleteBillableItems` Tool to bulk delete billable items in Wix. Use when you need to remove multiple billable items at once by providing their IDs. This triggers a Billable Item Deleted event in the Wix system. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.billing.bulkDeleteBillableItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkUpdateBillableItems `billing.bulkUpdateBillableItems` Tool to bulk update billable items in Wix. Use when you need to modify multiple billable items at once. Each item requires its ID, current revision number, and the fields to update. **Risk:** `write` ```ts theme={null} await corsair.wix.api.billing.bulkUpdateBillableItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `updates` | `object[]` | Yes | — | > **updates full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### createTaxRegion `billing.createTaxRegion` Tool to create a tax region in Wix using the Tax Regions API. Use when you need to define a location-specific tax treatment by country and subdivision with an associated tax calculator. **Risk:** `write` ```ts theme={null} await corsair.wix.api.billing.createTaxRegion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `country` | `string` | Yes | — | | `subdivision` | `string` | No | — | | `taxCalculator` | `object` | No | — | > **taxCalculator full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ### deleteReceiptPreset `billing.deleteReceiptPreset` Tool to permanently delete a receipt preset from Wix. Use when you need to remove a receipt preset by its ID. This triggers a Receipt Preset Deleted event in the Wix system. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.billing.deleteReceiptPreset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `presetId` | `string` | Yes | — | **Output:** *empty object* *** ### listDefaultTaxGroups `billing.listDefaultTaxGroups` Tool to retrieve the list of default tax groups for a Wix site. Use when you need to fetch the default tax groups that are inherited by apps installed on the site. **Risk:** `read` ```ts theme={null} await corsair.wix.api.billing.listDefaultTaxGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taxGroups` | `object[]` | No | — | > **taxGroups full type** > > ```ts theme={null} > { > id?: string, > name?: string, > revision?: string > }[] > ``` *** ### listDefaultTaxGroupsByAppIds `billing.listDefaultTaxGroupsByAppIds` Tool to retrieve default tax groups for specific Wix apps by their app IDs. Use when you need to fetch predefined tax groups that are automatically assigned to products from specific apps. **Risk:** `read` ```ts theme={null} await corsair.wix.api.billing.listDefaultTaxGroupsByAppIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `appIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `taxGroups` | `object[]` | No | — | > **taxGroups full type** > > ```ts theme={null} > { > id?: string, > name?: string, > revision?: string > }[] > ``` *** ### listManualTaxMappings `billing.listManualTaxMappings` Tool to retrieve up to 1,000 manual tax mappings from Wix. Use when you need to list custom tax rate configurations for specific tax group and region combinations. Results are sorted by createdDate in ascending order. **Risk:** `read` ```ts theme={null} await corsair.wix.api.billing.listManualTaxMappings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `manualTaxMappings` | `object[]` | No | — | | `mappings` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **manualTaxMappings full type** > > ```ts theme={null} > { > id?: string, > taxGroupId?: string, > taxRate?: string > }[] > ``` > **mappings full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryManualTaxMappings `billing.queryManualTaxMappings` Tool to retrieve a list of up to 100 manual tax mappings with optional paging, filtering, and sorting. Use when you need to query custom tax rate configurations for specific tax group and region combinations from a Wix store. **Risk:** `read` ```ts theme={null} await corsair.wix.api.billing.queryManualTaxMappings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `manualTaxMappings` | `object[]` | No | — | | `mappings` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **manualTaxMappings full type** > > ```ts theme={null} > { > id?: string, > taxGroupId?: string, > taxRate?: string > }[] > ``` > **mappings full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryTaxGroups `billing.queryTaxGroups` Tool to retrieve a list of up to 100 tax groups with optional paging, filtering, and sorting. Only returns tax groups created by the site, not default tax groups. Use when you need to fetch custom tax group configurations from a Wix site. **Risk:** `read` ```ts theme={null} await corsair.wix.api.billing.queryTaxGroups({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `taxGroups` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **taxGroups full type** > > ```ts theme={null} > { > id?: string, > name?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### setDefaultReceiptPreset `billing.setDefaultReceiptPreset` Tool to set a receipt preset as the default in Wix. Use when you need to designate a specific receipt preset as the default for receipt generation. **Risk:** `write` ```ts theme={null} await corsair.wix.api.billing.setDefaultReceiptPreset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `presetId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ### updateReceiptPreset `billing.updateReceiptPreset` Tool to update a receipt preset in Wix. Use when you need to modify receipt preset settings including name, custom fields, display settings, or extended fields. Requires the current revision number to prevent conflicting changes. Triggers a Receipt Preset Updated event. **Risk:** `write` ```ts theme={null} await corsair.wix.api.billing.updateReceiptPreset({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `presetId` | `string` | Yes | — | | `revision` | `string` | No | — | | `preset` | `object` | No | — | > **preset full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `revision` | `string` | No | — | *** ## Bookings ### bulkDeleteServices `bookings.bulkDeleteServices` Tool to bulk delete services from Wix Bookings. Use when you need to remove multiple services at once by providing their IDs. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.bookings.bulkDeleteServices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkDeleteServicesByFilter `bookings.bulkDeleteServicesByFilter` Tool to bulk delete booking services by filter criteria. The operation succeeds even if individual services can be deleted, with failure information returned in bulkActionMetadata. Triggers Service Deleted webhook for each successfully deleted service. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.bookings.bulkDeleteServicesByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### countExtendedBookings `bookings.countExtendedBookings` Tool to count extended bookings matching specified filter criteria. Use when you need to get the total number of bookings without retrieving the full booking data. Note: unlike query endpoints, the filter is sent at the top level of the body, not wrapped in a query envelope. **Risk:** `read` ```ts theme={null} await corsair.wix.api.bookings.countExtendedBookings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | *** ### deleteAddOnGroup `bookings.deleteAddOnGroup` Tool to delete an add-on group from a Wix Bookings service. Use when you need to remove an add-on group from a specific service by providing the service ID and add-on group ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.bookings.deleteAddOnGroup({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `serviceId` | `string` | Yes | — | | `addOnGroupId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteService `bookings.deleteService` Tool to delete a service from Wix Bookings. Use when you need to remove a single service by its ID. Triggers a Service Deleted event upon success. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.bookings.deleteService({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `serviceId` | `string` | Yes | — | **Output:** *empty object* *** ### listSessions `bookings.listSessions` Tool to retrieve calendar sessions from Wix Bookings with filtering, sorting, and pagination. Use when you need to list booking sessions, event instances, or availability slots. Note: This endpoint is deprecated and may be replaced with newer Calendar V3 APIs. **Risk:** `read` ```ts theme={null} await corsair.wix.api.bookings.listSessions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `sessions` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **sessions full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryCategories `bookings.queryCategories` Tool to retrieve bookings service categories with optional filtering, sorting, and pagination. Use when you need to fetch categories that organize booking services in Wix Bookings. **Risk:** `read` ```ts theme={null} await corsair.wix.api.bookings.queryCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `categories` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **categories full type** > > ```ts theme={null} > { > id?: string, > revision?: string, > name?: string, > createdDate?: string, > updatedDate?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryExtendedBookings `bookings.queryExtendedBookings` Tool to retrieve up to 100 extended bookings with advanced filtering, sorting, and pagination. Use when you need to search for specific bookings with attendance details and customer action permissions. Default behavior returns 50 bookings sorted by id in ascending order. **Risk:** `read` ```ts theme={null} await corsair.wix.api.bookings.queryExtendedBookings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `extendedBookings` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **extendedBookings full type** > > ```ts theme={null} > { > booking?: { > id?: string, > status?: string > } > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### updateStaffMemberTagsByFilter `bookings.updateStaffMemberTagsByFilter` Tool to bulk update tags on Wix Bookings staff members by filter criteria. Use when you need to add or remove tags from multiple staff members matching specific conditions. If a tag appears in both assign and unassign, it will be assigned. **Risk:** `write` ```ts theme={null} await corsair.wix.api.bookings.updateStaffMemberTagsByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | | `assignTags` | `string[]` | No | — | | `unassignTags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ## Cms ### addSpecialPermissions `cms.addSpecialPermissions` Tool to add special permissions to a Wix data collection for a specific user or role. Use when you need to grant CRUD permissions (insert, update, remove, read) to a user or role for a specific collection. **Risk:** `write` ```ts theme={null} await corsair.wix.api.cms.addSpecialPermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `collectionId` | `string` | Yes | — | | `permissions` | `object[]` | No | — | > **permissions full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` **Output:** *empty object* *** ### cancelTask `cms.cancelTask` Tool to cancel a background task in Wix CMS. Use when you need to stop a running background task that is no longer needed. **Risk:** `write` ```ts theme={null} await corsair.wix.api.cms.cancelTask({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `taskId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteDataCollectionField `cms.deleteDataCollectionField` Tool to delete a field from a Wix data collection. Use when you need to remove a field from a collection's structure, which also removes all associated values. The operation is idempotent and succeeds even if the collection or field doesn't exist. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.cms.deleteDataCollectionField({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `collectionId` | `string` | Yes | — | | `fieldId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteUserDefinedFields `cms.deleteUserDefinedFields` Tool to delete user defined fields from a data extension schema in Wix. Use when you need to remove custom fields from a schema by providing the schema ID and field keys. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.cms.deleteUserDefinedFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `schemaId` | `string` | Yes | — | | `fieldKeys` | `string[]` | Yes | — | **Output:** *empty object* *** ## Community ### bulkUpdateReviewModerationStatus `community.bulkUpdateReviewModerationStatus` Tool to bulk update the moderation status of multiple reviews at once. All filtered reviews are updated to the same moderation status. Use when you need to moderate multiple reviews efficiently instead of updating them one by one. **Risk:** `write` ```ts theme={null} await corsair.wix.api.community.bulkUpdateReviewModerationStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `moderationStatus` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### checkContent `community.checkContent` Tool to check content text against Wix moderation rules. Use when you need to validate user-submitted content for policy violations before publishing or to determine if content requires moderation. **Risk:** `read` ```ts theme={null} await corsair.wix.api.community.checkContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `text` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `verdict` | `string` | No | — | *** ### deleteFaqCategory `community.deleteFaqCategory` Tool to delete an FAQ category from the Wix site. Deleting a category permanently removes it and all associated questions from the FAQ page. Triggers a Category Deleted event. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.community.deleteFaqCategory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `categoryId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteQuestionEntry `community.deleteQuestionEntry` Tool to delete a question entry from Wix FAQ app. Use when you need to permanently remove a FAQ question entry by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.community.deleteQuestionEntry({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `questionId` | `string` | Yes | — | **Output:** *empty object* *** ### listGroupRequests `community.listGroupRequests` Tool to list group requests across a Wix site. Use when you need to retrieve pending or processed requests for group creation. Only admins can see create group requests; members can access their own requests. **Risk:** `read` ```ts theme={null} await corsair.wix.api.community.listGroupRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `groupRequests` | `object[]` | No | — | | `requests` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **groupRequests full type** > > ```ts theme={null} > { > id?: string, > status?: string > }[] > ``` > **requests full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryGroupRequests `community.queryGroupRequests` Tool to query group creation requests with filtering, sorting, and pagination. Use when you need to retrieve pending, approved, or rejected group requests from site members. **Risk:** `read` ```ts theme={null} await corsair.wix.api.community.queryGroupRequests({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `groupRequests` | `object[]` | No | — | | `requests` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **groupRequests full type** > > ```ts theme={null} > { > id?: string, > status?: string > }[] > ``` > **requests full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryModerationRules `community.queryModerationRules` Tool to retrieve moderation rules with optional filtering, sorting, and pagination. Use when you need to fetch rules that manage user-generated content moderation on a Wix site. Returns up to 1000 rules per request. **Risk:** `read` ```ts theme={null} await corsair.wix.api.community.queryModerationRules({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `rules` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **rules full type** > > ```ts theme={null} > { > id?: string, > namespace?: string, > name?: string, > enabled?: boolean > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### updateModerationRule `community.updateModerationRule` Tool to update a moderation rule in Wix Community Feedback Moderation. Use when you need to modify an existing rule's settings such as name, enabled status, or configuration. Requires the current revision number to prevent conflicts. **Risk:** `write` ```ts theme={null} await corsair.wix.api.community.updateModerationRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ruleId` | `string` | Yes | — | | `revision` | `string` | No | — | | `rule` | `object` | No | — | > **rule full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `revision` | `string` | No | — | *** ### updateQuestionEntryLabels `community.updateQuestionEntryLabels` Tool to set labels for a Wix FAQ question entry. Use when a question entry is updated and you need to modify its labels. This operation replaces all existing labels with the provided list. **Risk:** `write` ```ts theme={null} await corsair.wix.api.community.updateQuestionEntryLabels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `questionId` | `string` | Yes | — | | `labels` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ### updateReviewModerationStatus `community.updateReviewModerationStatus` Tool to update the moderation status of a review. Use when you need to approve, reject, or change the moderation status of a specific review. **Risk:** `write` ```ts theme={null} await corsair.wix.api.community.updateReviewModerationStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `reviewId` | `string` | Yes | — | | `moderationStatus` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | *** ## Contacts ### addLabels `contacts.addLabels` Tool to add labels to a Wix contact using the Labels API. Use when you need to categorize or tag contacts with specific labels like 'contacts.customers' or 'contacts.contacted-me'. **Risk:** `write` ```ts theme={null} await corsair.wix.api.contacts.addLabels({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `contactId` | `string` | Yes | — | | `labelKeys` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `revision` | `string` | No | — | *** ### bulkUpdate `contacts.bulkUpdate` Tool to bulk update multiple contacts with specified field values. Use when you need to update the same field(s) across multiple contacts matching a filter or search criteria. Only fields specified in fieldMask.paths will be updated. **Risk:** `write` ```ts theme={null} await corsair.wix.api.contacts.bulkUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `info` | `object` | No | — | | `filter` | `lazy` | No | — | | `search` | `string` | No | — | | `fieldMask` | `object` | Yes | — | > **info full type** > > ```ts theme={null} > { > id?: string, > revision?: string > } > ``` > **fieldMask full type** > > ```ts theme={null} > { > paths: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### list `contacts.list` Tool to retrieve a list of up to 1,000 contacts per request from Wix. Use when you need to fetch contact information with support for pagination and field filtering. **Risk:** `read` ```ts theme={null} await corsair.wix.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fieldsets` | `string[]` | No | — | | `fields` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **contacts full type** > > ```ts theme={null} > { > id?: string, > revision?: string | number, > createdDate?: string, > updatedDate?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### listFacets `contacts.listFacets` Tool to list facets from the site's Contact List. Facets include labels, subscription statuses (email and SMS), and membership statuses. Use when you need to retrieve available contact categorization options with their counts. **Risk:** `read` ```ts theme={null} await corsair.wix.api.contacts.listFacets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `facets` | `object[]` | No | — | > **facets full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### query `contacts.query` Tool to retrieve up to 1,000 Wix contacts with advanced filtering, sorting, and pagination. Use when you need to search for specific contacts or retrieve contacts with custom field selections. **Risk:** `read` ```ts theme={null} await corsair.wix.api.contacts.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `contacts` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **contacts full type** > > ```ts theme={null} > { > id?: string, > revision?: string | number, > createdDate?: string, > updatedDate?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryFacets `contacts.queryFacets` Tool to retrieve facets from the site's contact list by filter. Facets include labels and subscription statuses with aggregated contact counts. Use when you need to get contact segmentation data. **Risk:** `read` ```ts theme={null} await corsair.wix.api.contacts.queryFacets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `facets` | `object[]` | No | — | > **facets full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### unlabel `contacts.unlabel` Tool to remove labels from a contact in the Wix CRM system. Use when you need to unlabel a contact by removing specific label keys. This triggers a Contact Updated event in the Wix system. **Risk:** `write` ```ts theme={null} await corsair.wix.api.contacts.unlabel({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `contactId` | `string` | Yes | — | | `labelKeys` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `revision` | `string` | No | — | *** ## Events ### bulkDeleteRsvpsByFilter `events.bulkDeleteRsvpsByFilter` Tool to bulk delete event RSVPs by filter criteria. Use when you need to remove multiple RSVPs matching specific conditions. If no filter is provided, this may delete all RSVPs. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.events.bulkDeleteRsvpsByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkDeleteTicketDefinitions `events.bulkDeleteTicketDefinitions` Tool to bulk delete ticket definitions by filter criteria for Wix Events. Use when you need to delete multiple ticket definitions matching specific conditions. Requires 'Manage Ticket Definitions' permission. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.events.bulkDeleteTicketDefinitions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkUnassignFromCategories `events.bulkUnassignFromCategories` Tool to unassign an event from multiple categories in Wix Events. Use when you need to remove an event from one or more categories by providing the event ID and category IDs. **Risk:** `write` ```ts theme={null} await corsair.wix.api.events.bulkUnassignFromCategories({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `eventId` | `string` | Yes | — | | `categoryIds` | `string[]` | Yes | — | **Output:** *empty object* *** ### deleteScheduleBookmark `events.deleteScheduleBookmark` Tool to remove a bookmark from a schedule item in Wix Events. Use when you need to delete a user's saved bookmark for a specific event schedule item. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.events.deleteScheduleBookmark({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `scheduleId` | `string` | Yes | — | | `bookmarkId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteScheduleItem `events.deleteScheduleItem` Tool to delete schedule items from a Wix event. Use when you need to remove one or more schedule items from an event's draft schedule. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.events.deleteScheduleItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `eventId` | `string` | Yes | — | | `scheduleItemIds` | `string[]` | No | — | **Output:** *empty object* *** ### deleteTicketCheckIn `events.deleteTicketCheckIn` Tool to delete ticket check-in records for Wix Events. Use when you need to remove check-in status for one or more tickets at an event. **Risk:** `write` ```ts theme={null} await corsair.wix.api.events.deleteTicketCheckIn({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `eventId` | `string` | No | — | | `ticketIds` | `string[]` | No | — | **Output:** *empty object* *** ### deleteTicketReservation `events.deleteTicketReservation` Tool to delete a ticket reservation from Wix Events. Use when you need to remove a ticket reservation that is no longer needed or valid. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.events.deleteTicketReservation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `reservationId` | `string` | Yes | — | **Output:** *empty object* *** ### discardDraft `events.discardDraft` Tool to discard all changes to a draft schedule for a Wix event. Use when you need to revert all unsaved changes and restore the schedule to its published state. Requires 'Manage Events - all permissions' scope. **Risk:** `write` ```ts theme={null} await corsair.wix.api.events.discardDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `eventId` | `string` | Yes | — | **Output:** *empty object* *** ### find `events.find` Tool to find a Wix event by ID or slug. Use when you need to retrieve event details. Note: This endpoint is deprecated and will be replaced by Events V3 Get Event. **Risk:** `read` ```ts theme={null} await corsair.wix.api.events.find({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `eventId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `title` | `string` | No | — | *** ### publishDraft `events.publishDraft` Tool to publish a draft schedule for a Wix event. Use when you need to make all draft changes live and visible to site visitors. Requires Manage Events - all permissions scope. **Risk:** `write` ```ts theme={null} await corsair.wix.api.events.publishDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `eventId` | `string` | Yes | — | **Output:** *empty object* *** ### queryEventsGraphql `events.queryEventsGraphql` Tool to query events using the deprecated eventsEvents GraphQL endpoint. Returns event items and pagination info. Note: This endpoint is deprecated and will be replaced with Events V3 Query Events endpoint. **Risk:** `read` ```ts theme={null} await corsair.wix.api.events.queryEventsGraphql({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `query` | `string` | Yes | — | | `variables` | `object` | No | — | | `filter` | `lazy` | No | — | > **variables full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | No | — | | `errors` | `object[]` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **errors full type** > > ```ts theme={null} > { > }[] > ``` *** ### rescheduleDraft `events.rescheduleDraft` Tool to reschedule all draft schedule items for an event at once. Use when you need to adjust the time of multiple draft schedule items simultaneously by specifying a new time zone. **Risk:** `write` ```ts theme={null} await corsair.wix.api.events.rescheduleDraft({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `eventId` | `string` | Yes | — | | `timeZone` | `string` | No | — | **Output:** *empty object* *** ## Forms ### bulkDeleteSchemas `forms.bulkDeleteSchemas` Tool to bulk delete form schemas from Wix Forms. Use when you need to remove multiple forms by their IDs in a single operation. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.forms.bulkDeleteSchemas({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `formIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### queryDeletedForms `forms.queryDeletedForms` Tool to retrieve deleted form schemas from the trash bin for a specified namespace. Use when you need to query forms that have been deleted but not permanently removed. Requires namespace filter. **Risk:** `read` ```ts theme={null} await corsair.wix.api.forms.queryDeletedForms({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `forms` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **forms full type** > > ```ts theme={null} > { > id?: string, > namespace?: string, > name?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryFormsSubmissions `forms.queryFormsSubmissions` Tool to retrieve form submissions from a specified namespace with optional pagination. Use when you need to query form submissions from Wix Forms or other form apps. The namespace filter is required. **Risk:** `read` ```ts theme={null} await corsair.wix.api.forms.queryFormsSubmissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `submissions` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **submissions full type** > > ```ts theme={null} > { > id?: string, > formId?: string, > namespace?: string, > status?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### querySubmissionsByNamespace `forms.querySubmissionsByNamespace` Tool to retrieve form submissions from a specified namespace with advanced filtering, sorting, and pagination. Use when you need to query submissions with specific criteria like status, date ranges, or visibility. Namespace filter is required using \$eq operator. **Risk:** `read` ```ts theme={null} await corsair.wix.api.forms.querySubmissionsByNamespace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `submissions` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **submissions full type** > > ```ts theme={null} > { > id?: string, > formId?: string, > namespace?: string, > status?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### removeDeletedFields `forms.removeDeletedFields` Tool to permanently remove deleted fields from a Wix form schema. Use when you need to clean up deleted fields from a form. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.forms.removeDeletedFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `formId` | `string` | Yes | — | | `fieldsIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `revision` | `string` | No | — | *** ## Marketing ### deleteLoyaltyCoupon `marketing.deleteLoyaltyCoupon` Tool to delete a loyalty coupon from the Wix Loyalty Program. Note that deleting a loyalty coupon does not affect the functionality of the corresponding discount coupon itself. Use when you need to remove a loyalty coupon by its unique identifier. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.marketing.deleteLoyaltyCoupon({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `couponId` | `string` | Yes | — | | `revision` | `string` | Yes | — | **Output:** *empty object* *** ### deleteSenderDetails `marketing.deleteSenderDetails` Tool to delete sender details from Wix email marketing. Use when you need to remove a sender from the available senders list. Note: You cannot delete a default sender - you must first create a new sender and mark it as default before deleting the original. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.marketing.deleteSenderDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `senderId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteSenderEmail `marketing.deleteSenderEmail` Tool to delete a sender email from Wix Marketing. Use when you need to remove a specific sender email by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.marketing.deleteSenderEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `emailId` | `string` | Yes | — | **Output:** *empty object* *** ### enablePointsExpiration `marketing.enablePointsExpiration` Tool to enable points expiration for a Wix loyalty program. Use when you need to activate the points expiration feature, which changes the pointsExpiration status to ENABLED. **Risk:** `write` ```ts theme={null} await corsair.wix.api.marketing.enablePointsExpiration({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `programId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `pointsExpiration` | `string` | No | — | *** ### getCurrentMemberCoupons `marketing.getCurrentMemberCoupons` Tool to retrieve loyalty coupons for the currently authenticated member. Use when you need to fetch loyalty program coupons for the logged-in member. Requires visitor or member authentication. **Risk:** `read` ```ts theme={null} await corsair.wix.api.marketing.getCurrentMemberCoupons({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `coupons` | `object[]` | No | — | > **coupons full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### getSenderDetails `marketing.getSenderDetails` Tool to retrieve sender details for email marketing campaigns. Use when you need to fetch the sender name and email address. Note: This endpoint is deprecated and has been superseded by the Get Default Sender Details endpoint. **Risk:** `read` ```ts theme={null} await corsair.wix.api.marketing.getSenderDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | — | | `email` | `string` | No | — | *** ### listCampaigns `marketing.listCampaigns` Tool to retrieve a list of email marketing campaigns, ordered by date\_updated in descending order. Use when you need to get campaigns from Wix Email Marketing with optional filtering by status, visibility, or distribution status. **Risk:** `read` ```ts theme={null} await corsair.wix.api.marketing.listCampaigns({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `status` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `campaigns` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **campaigns full type** > > ```ts theme={null} > { > campaignId?: string, > title?: string, > status?: string, > visibilityStatus?: string, > dateCreated?: string, > dateUpdated?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryLoyaltyCheckoutDiscounts `marketing.queryLoyaltyCheckoutDiscounts` Tool to retrieve loyalty checkout discounts with filtering, sorting, and pagination. Use when you need to query discounts applied at checkout using loyalty points. **Risk:** `read` ```ts theme={null} await corsair.wix.api.marketing.queryLoyaltyCheckoutDiscounts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `loyaltyCheckoutDiscounts` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **loyaltyCheckoutDiscounts full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### updateReferralProgram `marketing.updateReferralProgram` Tool to update a site's referral program configuration including name, rewards, and email settings. Use when you need to modify an existing referral program. The revision field is required to prevent conflicting updates. **Risk:** `write` ```ts theme={null} await corsair.wix.api.marketing.updateReferralProgram({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `revision` | `string` | No | — | | `program` | `object` | No | — | > **program full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `program` | `object` | No | — | > **program full type** > > ```ts theme={null} > { > } > ``` *** ## Media ### generateFilesDownloadUrl `media.generateFilesDownloadUrl` Tool to generate download URLs for files in Wix Media Manager. Use when you need to create a permanent download URL for one or multiple files (up to 1000). Returns a download URL for a compressed file containing all requested files. **Risk:** `read` ```ts theme={null} await corsair.wix.api.media.generateFilesDownloadUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `fileIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `downloadUrl` | `string` | No | — | *** ### generateFileUploadUrl `media.generateFileUploadUrl` Tool to generate an upload URL for uploading files to Wix Media Manager. Use when you need to upload a file to Wix. Note: Files are not immediately available after upload and require processing time. For files larger than 10MB or poor network conditions, use Generate File Resumable Upload URL instead. **Risk:** `write` ```ts theme={null} await corsair.wix.api.media.generateFileUploadUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `fileName` | `string` | No | — | | `mimeType` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uploadUrl` | `string` | No | — | *** ### importFile `media.importFile` Tool to import a file to Wix Media Manager using an external URL. Use when you need to add a file from an external source to the Media Manager. Note: imported files take time to process and are not immediately available (state=PENDING initially). **Risk:** `write` ```ts theme={null} await corsair.wix.api.media.importFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `url` | `string` | Yes | — | | `fileName` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `state` | `string` | No | — | *** ## Members ### get `members.get` Tool to retrieve a member by ID from Wix Members. Use when you need to fetch detailed information about a specific member. Note: Private members (default privacy status) are not returned for site visitor or member calls. **Risk:** `read` ```ts theme={null} await corsair.wix.api.members.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `memberId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `contactId` | `string` | No | — | | `status` | `string` | No | — | *** ### getMembersCustomFieldApplications `members.getMembersCustomFieldApplications` Tool to retrieve custom field applications for specified members. Use when you need to check which custom field applications apply to specific members. **Risk:** `read` ```ts theme={null} await corsair.wix.api.members.getMembersCustomFieldApplications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `memberIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `applications` | `object[]` | No | — | > **applications full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### getPrivacySettings `members.getPrivacySettings` Tool to retrieve member privacy settings for a Wix site. Use when you need to check what privacy settings are currently configured, including whether members can make their profiles public. **Risk:** `read` ```ts theme={null} await corsair.wix.api.members.getPrivacySettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `publicProfile` | `boolean` | No | — | *** ### getRolesCustomFieldApplications `members.getRolesCustomFieldApplications` Tool to retrieve custom field applications for specified roles. Use when you need to check which custom field applications apply to specific member roles. **Risk:** `read` ```ts theme={null} await corsair.wix.api.members.getRolesCustomFieldApplications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `roleIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `applications` | `object[]` | No | — | > **applications full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### getRolesInfo `members.getRolesInfo` Tool to retrieve all available roles in the requesting Wix account, including predefined and custom roles. Use when you need to list all roles configured for the account. **Risk:** `read` ```ts theme={null} await corsair.wix.api.members.getRolesInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `roles` | `object[]` | No | — | > **roles full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### listCustomFields `members.listCustomFields` Tool to retrieve a list of custom fields and fields provided by the Members Area. Use when you need to fetch available custom field definitions for member profiles. Fields are ordered by section and creation date. **Risk:** `read` ```ts theme={null} await corsair.wix.api.members.listCustomFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `object[]` | No | — | | `customFields` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **fields full type** > > ```ts theme={null} > { > id?: string, > name?: string, > key?: string > }[] > ``` > **customFields full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### listFollowing `members.listFollowing` Tool to retrieve the list of members followed by a given member in Wix Members. Use when you need to see which members a specific member is following. Note: This API is in Developer Preview and may be subject to change. **Risk:** `read` ```ts theme={null} await corsair.wix.api.members.listFollowing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `memberId` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `memberIds` | `string[]` | No | — | | `members` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **members full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### listMyFollowers `members.listMyFollowers` Tool to retrieve the list of members who are following the current authenticated member in Wix Members. Use when you need to see which members follow the current user. **Risk:** `read` ```ts theme={null} await corsair.wix.api.members.listMyFollowers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `memberIds` | `string[]` | No | — | | `members` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **members full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### logout `members.logout` Tool to terminate a member's session and clear authentication cookies. Use when you need to log out a user from their Wix session. When postLogoutRedirectUri is provided, returns a 302 redirect response. **Risk:** `write` ```ts theme={null} await corsair.wix.api.members.logout({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `postLogoutRedirectUri` | `string` | No | — | **Output:** *empty object* *** ### register `members.register` Tool to register a new member account on Wix site. Use when you need to create a new member with email and password authentication. Returns a session token that can be used to obtain access and refresh tokens. **Risk:** `write` ```ts theme={null} await corsair.wix.api.members.register({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `loginId` | `object` | Yes | — | | `password` | `string` | Yes | — | | `profile` | `object` | No | — | > **loginId full type** > > ```ts theme={null} > { > email: string > } > ``` > **profile full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `sessionToken` | `string` | No | — | | `member` | `object` | No | — | > **member full type** > > ```ts theme={null} > { > } > ``` *** ### sendRecoveryEmail `members.sendRecoveryEmail` Tool to send a password recovery email to a Wix member with a link to reset their password. Use when a member needs to reset their password. The site must be published for this to work. Site owners will reset their Wix account password instead of site-specific password. **Risk:** `write` ```ts theme={null} await corsair.wix.api.members.sendRecoveryEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `email` | `string` | Yes | — | **Output:** *empty object* *** ## Multilingual ### bulkDeleteTranslationContent `multilingual.bulkDeleteTranslationContent` Tool to bulk delete translation content by IDs. Use when you need to delete multiple translation content items in a single operation. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.multilingual.bulkDeleteTranslationContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkUpdateTranslationContentByKey `multilingual.bulkUpdateTranslationContentByKey` Tool to bulk update translation content by composite key (schemaId, entityId, locale). Use when updating translatable fields for multiple content items identified by their schema, entity, and locale combination. Triggers Content Updated event on success. **Risk:** `write` ```ts theme={null} await corsair.wix.api.multilingual.bulkUpdateTranslationContentByKey({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `items` | `object[]` | Yes | — | > **items full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ## Orders ### bulkDeleteAbandonedCheckouts `orders.bulkDeleteAbandonedCheckouts` Tool to bulk delete abandoned checkouts from Wix e-commerce. Use when you need to remove multiple abandoned checkouts by their IDs. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.orders.bulkDeleteAbandonedCheckouts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkUpdate `orders.bulkUpdate` Tool to bulk update properties of up to 100 e-commerce orders. Use when you need to update order fields like archived status, buyer information, billing/shipping addresses, or custom fields. To remove a field, pass null; note that buyerInfo and contactDetails cannot be removed. **Risk:** `write` ```ts theme={null} await corsair.wix.api.orders.bulkUpdate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `orders` | `object[]` | Yes | — | > **orders full type** > > ```ts theme={null} > { > order: { > id?: string, > revision?: string, > status?: string | null > } > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkUpdateTags `orders.bulkUpdateTags` Tool to synchronously update tags on multiple orders by list of order IDs. Use when you need to add or remove tags from multiple orders at once. If a tag appears in both assignTags and unassignTags, it will be assigned. **Risk:** `write` ```ts theme={null} await corsair.wix.api.orders.bulkUpdateTags({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `orderIds` | `string[]` | Yes | — | | `assignTags` | `string[]` | No | — | | `unassignTags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### listInvoicesByOrderIds `orders.listInvoicesByOrderIds` Tool to retrieve invoice IDs and external app IDs for multiple orders. Use when you need to get invoice information associated with one or more Wix eCommerce orders. **Risk:** `read` ```ts theme={null} await corsair.wix.api.orders.listInvoicesByOrderIds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `orderIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `invoicesForOrder` | `object[]` | No | — | > **invoicesForOrder full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### query `orders.query` Tool to retrieve e-commerce orders with advanced filtering, sorting, and pagination. Use when you need to search for specific orders or retrieve order lists. Default behavior excludes orders with status 'INITIALIZED'. **Risk:** `read` ```ts theme={null} await corsair.wix.api.orders.query({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `orders` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **orders full type** > > ```ts theme={null} > { > id?: string, > revision?: string, > status?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### removeTip `orders.removeTip` Tool to remove a tip from an existing eCommerce order. Use when you need to remove tip charges that were previously added to an order. **Risk:** `write` ```ts theme={null} await corsair.wix.api.orders.removeTip({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `orderId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `revision` | `string` | No | — | *** ## Portfolio ### deleteProject `portfolio.deleteProject` Tool to delete a project from Wix Portfolio. Use when you need to remove a specific project by its ID. Note: This operation may return an empty success response when the Portfolio app is not installed. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.portfolio.deleteProject({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `projectId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteProjectItem `portfolio.deleteProjectItem` Tool to delete a project item from the Wix Portfolio. Use when you need to permanently remove a portfolio project item by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.portfolio.deleteProjectItem({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `itemId` | `string` | Yes | — | **Output:** *empty object* *** ## Restaurants ### bulkDeleteModifiers `restaurants.bulkDeleteModifiers` Tool to bulk delete item modifiers from Wix Restaurants Menus. Use when you need to remove multiple item modifiers at once by providing their IDs. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.restaurants.bulkDeleteModifiers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkDeleteNotificationRecipients `restaurants.bulkDeleteNotificationRecipients` Tool to bulk delete notification recipients for Wix Restaurants online orders. Use when you need to remove multiple recipients at once by providing their IDs. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.restaurants.bulkDeleteNotificationRecipients({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkDeleteVariants `restaurants.bulkDeleteVariants` Tool to bulk delete item variants from Wix Restaurants menus. Use when you need to remove multiple menu item variants at once. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.restaurants.bulkDeleteVariants({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### calculateFirstAvailableSlots `restaurants.calculateFirstAvailableSlots` Tool to calculate and retrieve the first available time slot of each fulfillment type for each specified menu. Use when you need to check availability for restaurant operations. Note: Developer Preview status - API is subject to change. **Risk:** `read` ```ts theme={null} await corsair.wix.api.restaurants.calculateFirstAvailableSlots({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `menuIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `slots` | `object[]` | No | — | > **slots full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### deleteMenu `restaurants.deleteMenu` Tool to delete a menu from Wix Restaurants. Use when you need to permanently remove a menu by its ID. The endpoint implements idempotent DELETE behavior. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.restaurants.deleteMenu({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `menuId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteServiceFeeRule `restaurants.deleteServiceFeeRule` Tool to delete a service fee rule from Wix Restaurants Online Orders. Use when you need to remove a specific rule by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.restaurants.deleteServiceFeeRule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ruleId` | `string` | Yes | — | **Output:** *empty object* *** ### listCatalogs `restaurants.listCatalogs` Tool to retrieve a list of restaurant catalogs from Wix Restaurants. Use when you need to get all catalogs for a restaurant location. Note: This API is deprecated and has been replaced with the Menus API. **Risk:** `read` ```ts theme={null} await corsair.wix.api.restaurants.listCatalogs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `catalogs` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **catalogs full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ## Sites ### checkDomainAvailability `sites.checkDomainAvailability` Tool to check if a domain name is available for purchase. Use when you need to verify domain availability before registration. Returns an availability object with a boolean indicating if the domain can be purchased. **Risk:** `read` ```ts theme={null} await corsair.wix.api.sites.checkDomainAvailability({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `domainName` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `available` | `boolean` | No | — | | `domainName` | `string` | No | — | *** ### getFolderBySite `sites.getFolderBySite` Tool to retrieve folder information for a specific site by site ID. Use when you need to get the parent folder details of a site. Note: If the specified site is at root level, the returned folder object will be empty. **Risk:** `read` ```ts theme={null} await corsair.wix.api.sites.getFolderBySite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `targetSiteId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `folder` | `object` | No | — | > **folder full type** > > ```ts theme={null} > { > } > ``` *** ### getProperties `sites.getProperties` Tool to retrieve current snapshot of a site's properties including business profile, contact information, and business schedule. Use when you need to fetch site-level business information, contact details, or operating hours. **Risk:** `read` ```ts theme={null} await corsair.wix.api.sites.getProperties({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `businessProfile` | `object` | No | — | | `businessContact` | `object` | No | — | | `businessSchedule` | `object` | No | — | > **businessProfile full type** > > ```ts theme={null} > { > } > ``` > **businessContact full type** > > ```ts theme={null} > { > } > ``` > **businessSchedule full type** > > ```ts theme={null} > { > } > ``` *** ### getSitePluginsPlacementStatus `sites.getSitePluginsPlacementStatus` Tool to get the placement status of your app's site plugins on the user's site. Use when you need to check whether your plugins are currently placed in slots on the user's site. **Risk:** `read` ```ts theme={null} await corsair.wix.api.sites.getSitePluginsPlacementStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `placements` | `object[]` | No | — | > **placements full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### queryFolders `sites.queryFolders` Tool to retrieve a list of site folders with optional paging, filtering, and sorting. Use when you need to organize and manage Wix sites by folders in an account. **Risk:** `read` ```ts theme={null} await corsair.wix.api.sites.queryFolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `folders` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **folders full type** > > ```ts theme={null} > { > id?: string, > name?: string, > createdDate?: string, > updatedDate?: string, > siteCount?: number, > parentId?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryLocations `sites.queryLocations` Tool to retrieve business locations with filtering, sorting, and pagination. Use when you need to search for specific locations or list all locations for a site. **Risk:** `read` ```ts theme={null} await corsair.wix.api.sites.queryLocations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `locations` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **locations full type** > > ```ts theme={null} > { > id?: string, > name?: string, > status?: string, > timeZone?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### updateBusinessContact `sites.updateBusinessContact` Tool to update a site's business contact information including email, phone, fax, and address. Use when you need to modify the public business contact details displayed on a Wix site. Requires Manage Business Contact permission scope. **Risk:** `write` ```ts theme={null} await corsair.wix.api.sites.updateBusinessContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `businessContact` | `object` | No | — | > **businessContact full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `businessContact` | `object` | No | — | > **businessContact full type** > > ```ts theme={null} > { > } > ``` *** ### updateBusinessProfile `sites.updateBusinessProfile` Tool to update a site's business profile including display name, description, logo, and business name. Use when you need to modify public business information. Only fields specified in the fields.paths array are updated. **Risk:** `write` ```ts theme={null} await corsair.wix.api.sites.updateBusinessProfile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `businessProfile` | `object` | No | — | | `fields` | `object` | No | — | > **businessProfile full type** > > ```ts theme={null} > { > } > ``` > **fields full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `businessProfile` | `object` | No | — | > **businessProfile full type** > > ```ts theme={null} > { > } > ``` *** ### updateBusinessSchedule `sites.updateBusinessSchedule` Tool to update a site's business schedule including regular operating hours and special exceptions. Use when you need to set or modify business hours, add holiday closures, or define special event hours. The update replaces the entire schedule, so include all desired periods in each request. **Risk:** `write` ```ts theme={null} await corsair.wix.api.sites.updateBusinessSchedule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `businessSchedule` | `object` | No | — | > **businessSchedule full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `businessSchedule` | `object` | No | — | > **businessSchedule full type** > > ```ts theme={null} > { > } > ``` *** ### updateLocaleSettings `sites.updateLocaleSettings` Tool to update a Wix site's locale configuration settings including auto-redirect behavior. Use when you need to modify locale settings such as enabling or disabling automatic visitor redirection based on language preferences. Note: This action cannot update a site's multilingual mode; use the Set Multilingual Mode action for that. **Risk:** `write` ```ts theme={null} await corsair.wix.api.sites.updateLocaleSettings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `localeSettings` | `object` | No | — | > **localeSettings full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `localeSettings` | `object` | No | — | > **localeSettings full type** > > ```ts theme={null} > { > } > ``` *** ## Stores ### bulkCreateProductsWithInventory `stores.bulkCreateProductsWithInventory` Tool to bulk create products with inventory in Wix. Use when you need to create multiple products with pricing and stock information in a single request. Supports up to 100 products per request. Physical products require physical\_properties. **Risk:** `write` ```ts theme={null} await corsair.wix.api.stores.bulkCreateProductsWithInventory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `products` | `object[]` | Yes | — | > **products full type** > > ```ts theme={null} > { > id?: string, > revision?: string, > name?: string, > slug?: string, > visible?: boolean, > createdDate?: string, > updatedDate?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkDeleteBrands `stores.bulkDeleteBrands` Tool to delete multiple brands from the Wix Stores catalog. When a brand is deleted, it's automatically removed from all products that reference it. Use when you need to remove multiple brands at once. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.stores.bulkDeleteBrands({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkDeleteInventoryItems `stores.bulkDeleteInventoryItems` Tool to bulk delete inventory items from the Wix Stores catalog. Accepts non-existent IDs without error. Use when you need to remove multiple inventory items at once. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.stores.bulkDeleteInventoryItems({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkDeleteProducts `stores.bulkDeleteProducts` Tool to bulk delete products from the Wix Stores catalog. Use when you need to permanently remove multiple products by their IDs. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.stores.bulkDeleteProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkGetOrCreateBrands `stores.bulkGetOrCreateBrands` Tool to bulk retrieve or create brands in Wix Stores catalog. Retrieves multiple brands by name, or creates them if they don't exist. Use when you need to ensure specific brands exist in the catalog. **Risk:** `write` ```ts theme={null} await corsair.wix.api.stores.bulkGetOrCreateBrands({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `names` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `brands` | `object[]` | No | — | > **brands full type** > > ```ts theme={null} > { > id?: string, > name?: string > }[] > ``` *** ### bulkRemoveInfoSectionsByFilter `stores.bulkRemoveInfoSectionsByFilter` Tool to bulk remove info sections from products matching a filter expression. Use when you need to detach information sections from multiple products based on specific criteria like visibility status, creation date, or other product attributes. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.stores.bulkRemoveInfoSectionsByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | | `infoSectionIds` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkUpdateCustomizations `stores.bulkUpdateCustomizations` Tool to bulk update multiple customizations in Wix Stores Catalog V3. Use when you need to update properties of existing customizations such as name, type, choices, or settings. Each update requires the current revision number to prevent conflicts. **Risk:** `write` ```ts theme={null} await corsair.wix.api.stores.bulkUpdateCustomizations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `updates` | `object[]` | Yes | — | > **updates full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkUpdateInventoryItemsByFilter `stores.bulkUpdateInventoryItemsByFilter` Tool to bulk update inventory items by filter criteria. Updates multiple inventory items matching the specified filter (e.g., by productId). Use when you need to change inventory tracking settings, stock status, or quantities for multiple items at once. **Risk:** `write` ```ts theme={null} await corsair.wix.api.stores.bulkUpdateInventoryItemsByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | | `update` | `object` | No | — | > **update full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### bulkUpdateProductsByFilter `stores.bulkUpdateProductsByFilter` Tool to bulk update multiple products matching filter criteria in Wix Stores. Use when you need to update the same field(s) across multiple products matching specific conditions. Cannot update slug, options, modifiers, or variantsInfo fields. **Risk:** `write` ```ts theme={null} await corsair.wix.api.stores.bulkUpdateProductsByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | | `update` | `object` | No | — | | `fields` | `string[]` | No | — | > **update full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### deleteBackInStockNotification `stores.deleteBackInStockNotification` Tool to delete a back in stock notification request from Wix e-commerce. Use when you need to remove a customer request to be notified when a product comes back in stock. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.stores.deleteBackInStockNotification({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `notificationId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteCustomization `stores.deleteCustomization` Tool to delete a customization from the Wix Stores catalog. Use when you need to permanently remove a customization option by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.stores.deleteCustomization({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `customizationId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteInfoSection `stores.deleteInfoSection` Tool to delete an info section from the Wix Stores catalog. Use when you need to permanently remove a specific info section by its ID. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.stores.deleteInfoSection({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `infoSectionId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteProductOptions `stores.deleteProductOptions` Tool to delete all options from a Wix product. Use when you need to remove all product options (like Color, Size) and reset the product to a single default variant. Only works when variant management is disabled. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.stores.deleteProductOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `productId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `revision` | `string` | No | — | *** ### getCollectionBySlug `stores.getCollectionBySlug` Tool to retrieve a Wix Stores collection by its slug. Use when you need to fetch collection details using the collection's URL-friendly identifier instead of its ID. **Risk:** `read` ```ts theme={null} await corsair.wix.api.stores.getCollectionBySlug({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `slug` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `slug` | `string` | No | — | | `name` | `string` | No | — | *** ### listCurrencies `stores.listCurrencies` Tool to retrieve the list of available currencies from Wix Currency Converter. Use when you need to get all supported currencies with their ISO codes and symbols. **Risk:** `read` ```ts theme={null} await corsair.wix.api.stores.listCurrencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `currencies` | `object[]` | No | — | > **currencies full type** > > ```ts theme={null} > { > code?: string, > symbol?: string > }[] > ``` *** ### queryCoupons `stores.queryCoupons` Tool to retrieve a list of up to 100 coupons with optional paging, filtering, and sorting. Use when you need to fetch coupons from a Wix store. **Risk:** `read` ```ts theme={null} await corsair.wix.api.stores.queryCoupons({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `coupons` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **coupons full type** > > ```ts theme={null} > { > id?: string, > expired?: boolean, > specification?: { > code?: string, > name?: string, > active?: boolean > } > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### queryInventory `stores.queryInventory` Tool to retrieve a list of up to 1000 inventory items with optional paging, filtering, and sorting. Manages inventory per variant including stock quantities, availability status, and preorder information. Use when you need to fetch inventory data from a Wix Stores Catalog V3 site. **Risk:** `read` ```ts theme={null} await corsair.wix.api.stores.queryInventory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `fieldsets` | `string[]` | No | — | | `search` | `string` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `inventoryItems` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **inventoryItems full type** > > ```ts theme={null} > { > id?: string, > revision?: string, > variantId?: string, > productId?: string, > locationId?: string, > trackQuantity?: boolean, > inStock?: boolean, > quantity?: number, > availabilityStatus?: string, > createdDate?: string, > updatedDate?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### searchProducts `stores.searchProducts` Tool to search products in the Wix store catalog using text search, filters, and sorting. Returns up to 100 products per request with cursor-based pagination. Use when you need to find specific products or retrieve products matching certain criteria. **Risk:** `read` ```ts theme={null} await corsair.wix.api.stores.searchProducts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | No | — | | `sort` | `object[]` | No | — | | `paging` | `object` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | | `fields` | `string[]` | No | — | | `search` | `object` | No | — | > **sort full type** > > ```ts theme={null} > { > fieldName: string, > order?: ASC | DESC > }[] > ``` > **paging full type** > > ```ts theme={null} > { > limit?: number, > offset?: number > } > ``` > **search full type** > > ```ts theme={null} > string | { > search?: { > expression?: string > }, > expression?: string, > filter?: lazy, > sort?: { > fieldName: string, > order?: ASC | DESC > }[], > paging?: { > limit?: number, > offset?: number > } > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `products` | `object[]` | No | — | | `pagingMetadata` | `object` | No | — | > **products full type** > > ```ts theme={null} > { > id?: string, > revision?: string, > name?: string, > slug?: string, > visible?: boolean, > createdDate?: string, > updatedDate?: string > }[] > ``` > **pagingMetadata full type** > > ```ts theme={null} > { > count?: number, > offset?: number, > total?: number, > tooManyToCount?: boolean > } > ``` *** ### setCustomizationChoices `stores.setCustomizationChoices` Tool to set choices for a customization in Wix stores catalog. Use when you need to replace all existing choices with a new set of choices for a customization. This operation requires a valid GUID customization ID and at least one choice with a name. **Risk:** `write` ```ts theme={null} await corsair.wix.api.stores.setCustomizationChoices({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `customizationId` | `string` | Yes | — | | `choices` | `object[]` | Yes | — | > **choices full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `revision` | `string` | No | — | *** ### updateInventoryVariants `stores.updateInventoryVariants` Tool to update product inventory including quantity, stock status, and tracking settings per variant. Use when you need to modify inventory levels or stock configuration. The revision field must match the current value to prevent conflicts. **Risk:** `write` ```ts theme={null} await corsair.wix.api.stores.updateInventoryVariants({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `updates` | `object[]` | Yes | — | > **updates full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ## System ### bulkDeleteReportsByFilter `system.bulkDeleteReportsByFilter` Tool to bulk delete reports from the dashboard by filter criteria. Use when you need to remove multiple reports matching specific conditions. Triggers a Report Deleted event for each removed report. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.system.bulkDeleteReportsByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** ### deleteSecret `system.deleteSecret` Tool to delete a secret from Wix Secrets Vault. Use when you need to permanently remove a secret by its GUID identifier. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.system.deleteSecret({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `secretId` | `string` | Yes | — | **Output:** *empty object* *** ### deleteUserFavorite `system.deleteUserFavorite` Tool to remove a dashboard page from the current user's list of favorite pages. Use when you need to delete a specific favorite from the user's dashboard. The API exhibits idempotent behavior - returns success even if the favorite doesn't exist. **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.wix.api.system.deleteUserFavorite({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `pageId` | `string` | Yes | — | **Output:** *empty object* *** ### getAppInstance `system.getAppInstance` Tool to retrieve the current app instance details and associated site information. Use when you need to fetch app configuration, permissions, or site details. **Risk:** `read` ```ts theme={null} await corsair.wix.api.system.getAppInstance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `instanceId` | `string` | No | — | | `appId` | `string` | No | — | | `siteId` | `string` | No | — | *** ### getPurchaseHistory `system.getPurchaseHistory` Tool to retrieve purchase history for your app on a site. Use when you need to view past purchases and verify upgrades. Note: The response does not include cancellation details. Site context is automatically derived from authentication. **Risk:** `read` ```ts theme={null} await corsair.wix.api.system.getPurchaseHistory({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `purchases` | `object[]` | No | — | > **purchases full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### listAppPermissions `system.listAppPermissions` Tool to retrieve all permissions for a specified Wix app. Use when you need to list the permissions your app requests when users install it on a site. **Risk:** `read` ```ts theme={null} await corsair.wix.api.system.listAppPermissions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `appId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `permissions` | `object[]` | No | — | > **permissions full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### listAppPlansByAppId `system.listAppPlansByAppId` Tool to retrieve app plans by application ID, including pricing, tax settings, and currency details. Use when you need to fetch pricing plans for a specific Wix app. Note: Only returns activated plans; externally managed plans are excluded. For yearly plans, returns monthly payment amount (multiply by 12 for total). **Risk:** `read` ```ts theme={null} await corsair.wix.api.system.listAppPlansByAppId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `appId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `plans` | `object[]` | No | — | > **plans full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` *** ### updateOperationGroupTagsByFilter `system.updateOperationGroupTagsByFilter` Tool to bulk update tags on operation groups using filter criteria. Use when you need to add or remove tags from multiple operation groups matching specific conditions. If a tag appears in both assign and unassign, it will be assigned. **Risk:** `write` ```ts theme={null} await corsair.wix.api.system.updateOperationGroupTagsByFilter({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `siteId` | `string` | No | — | | `accountId` | `string` | No | — | | `filter` | `lazy` | Yes | — | | `assignTags` | `string[]` | No | — | | `unassignTags` | `string[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object[]` | No | — | | `bulkActionMetadata` | `object` | No | — | > **results full type** > > ```ts theme={null} > { > id?: string, > revision?: string > }[] > ``` > **bulkActionMetadata full type** > > ```ts theme={null} > { > totalSuccesses?: number, > totalFailures?: number, > undetailedFailures?: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/wix/database Wix local sync: searchable entities, `.search()` filters, and operators. The Wix plugin syncs data locally. Use `corsair.wix.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Booking Categories Path: `wix.db.bookingCategories.search` ```ts theme={null} const rows = await corsair.wix.db.bookingCategories.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `revision` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `updatedDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Brands Path: `wix.db.brands.search` ```ts theme={null} const rows = await corsair.wix.db.brands.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Campaigns Path: `wix.db.campaigns.search` ```ts theme={null} const rows = await corsair.wix.db.campaigns.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `campaignId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `visibilityStatus` | `string` | equals, contains, startsWith, endsWith, in | | `dateCreated` | `string` | equals, contains, startsWith, endsWith, in | | `dateUpdated` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `wix.db.contacts.search` ```ts theme={null} const rows = await corsair.wix.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `updatedDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Coupons Path: `wix.db.coupons.search` ```ts theme={null} const rows = await corsair.wix.db.coupons.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `expired` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Currencies Path: `wix.db.currencies.search` ```ts theme={null} const rows = await corsair.wix.db.currencies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `code` | `string` | equals, contains, startsWith, endsWith, in | | `symbol` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Custom Fields Path: `wix.db.customFields.search` ```ts theme={null} const rows = await corsair.wix.db.customFields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `key` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Extended Bookings Path: `wix.db.extendedBookings.search` ```ts theme={null} const rows = await corsair.wix.db.extendedBookings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Forms Path: `wix.db.forms.search` ```ts theme={null} const rows = await corsair.wix.db.forms.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `namespace` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `revision` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Form Submissions Path: `wix.db.formSubmissions.search` ```ts theme={null} const rows = await corsair.wix.db.formSubmissions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `formId` | `string` | equals, contains, startsWith, endsWith, in | | `namespace` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Group Requests Path: `wix.db.groupRequests.search` ```ts theme={null} const rows = await corsair.wix.db.groupRequests.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Inventory Items Path: `wix.db.inventoryItems.search` ```ts theme={null} const rows = await corsair.wix.db.inventoryItems.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `revision` | `string` | equals, contains, startsWith, endsWith, in | | `variantId` | `string` | equals, contains, startsWith, endsWith, in | | `productId` | `string` | equals, contains, startsWith, endsWith, in | | `locationId` | `string` | equals, contains, startsWith, endsWith, in | | `trackQuantity` | `boolean` | equals | | `inStock` | `boolean` | equals | | `quantity` | `number` | equals, gt, gte, lt, lte, in | | `availabilityStatus` | `string` | equals, contains, startsWith, endsWith, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `updatedDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Locations Path: `wix.db.locations.search` ```ts theme={null} const rows = await corsair.wix.db.locations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `timeZone` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Manual Tax Mappings Path: `wix.db.manualTaxMappings.search` ```ts theme={null} const rows = await corsair.wix.db.manualTaxMappings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `taxGroupId` | `string` | equals, contains, startsWith, endsWith, in | | `taxRate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Moderation Rules Path: `wix.db.moderationRules.search` ```ts theme={null} const rows = await corsair.wix.db.moderationRules.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `namespace` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `enabled` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Orders Path: `wix.db.orders.search` ```ts theme={null} const rows = await corsair.wix.db.orders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `revision` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Products Path: `wix.db.products.search` ```ts theme={null} const rows = await corsair.wix.db.products.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `revision` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `slug` | `string` | equals, contains, startsWith, endsWith, in | | `visible` | `boolean` | equals | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `updatedDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Site Folders Path: `wix.db.siteFolders.search` ```ts theme={null} const rows = await corsair.wix.db.siteFolders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `createdDate` | `string` | equals, contains, startsWith, endsWith, in | | `updatedDate` | `string` | equals, contains, startsWith, endsWith, in | | `siteCount` | `number` | equals, gt, gte, lt, lte, in | | `parentId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tax Groups Path: `wix.db.taxGroups.search` ```ts theme={null} const rows = await corsair.wix.db.taxGroups.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `revision` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/wix/overview Wix plugin for Corsair Use **Wix** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 143 typed API operations * 19 synced entities (`bookingCategories`, `brands`, `campaigns`, `contacts`, `coupons`, `currencies`, and 13 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/wix ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/wix ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/wix ``` ```bash bun theme={null} bun add corsair @corsair-dev/wix ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { wix } from '@corsair-dev/wix'; export const corsair = createCorsair({ plugins: [ wix(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Wix OAuth app. ```ts theme={null} wix() ``` More: [OAuth 2.0](/concepts/oauth) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. ```ts theme={null} wix({ authType: 'api_key', }) ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'wix', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`billing.listDefaultTaxGroups`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.wix.api.billing.listDefaultTaxGroups({}); ``` **`automations.bulkUpdateStorageItemTags`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.wix.api.automations.bulkUpdateStorageItemTags({}); ``` See the full list on the [API](/plugins/wix/api) page. ## Query synced data Synced entities support `tenant.wix.db..search()` and `.list()`: `bookingCategories`, `brands`, `campaigns`, `contacts`, `coupons`, `currencies`, `customFields`, `extendedBookings`, `forms`, `formSubmissions`, `groupRequests`, `inventoryItems`, `locations`, `manualTaxMappings`, `moderationRules`, `orders`, `products`, `siteFolders`, `taxGroups`. See [Database](/plugins/wix/database) for filters and operators. ## What's next > **[API reference](/plugins/wix/api)** > > Every `wix.api.*` operation with input and output types. > **[Database](/plugins/wix/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/wiza/api API reference for Wiza: every `wiza.api.*` operation with input and output types. Every `wiza.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Credits ### get `credits.get` Get the number of remaining API credits (emails, phones, exports) in your Wiza account **Risk:** `read` ```ts theme={null} await corsair.wiza.api.credits.get({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `credits` | `object` | Yes | — | > **credits full type** > > ```ts theme={null} > { > email_credits: number | unlimited, > phone_credits: number | unlimited, > export_credits?: number, > api_credits?: number > } > ``` *** ## Individual Reveals ### get `individualReveals.get` Get the status and enriched results of an individual reveal by ID **Risk:** `read` ```ts theme={null} await corsair.wiza.api.individualReveals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `object` | Yes | — | | `type` | `string` | No | — | | `data` | `object` | Yes | — | > **status full type** > > ```ts theme={null} > { > code: number, > message?: string > } > ``` > **data full type** > > ```ts theme={null} > { > id: number, > status: queued | resolving | finished | failed, > is_complete: boolean, > name?: string | null, > company?: string | null, > enrichment_level?: string, > linkedin_profile_url?: string | null, > title?: string | null, > location?: string | null, > email?: string | null, > email_type?: string | null, > email_status?: string | null, > emails?: { > email: string, > email_type?: string, > email_status?: string > }[], > mobile_phone?: string | null, > phone_number?: string | null, > phone_status?: string | null, > phones?: { > number: string, > pretty_number?: string, > type?: string > }[], > company_domain?: string | null, > company_industry?: string | null, > company_size?: number | null, > company_size_range?: string | null, > company_linkedin?: string | null, > company_location?: string | null, > credits?: any > } > ``` *** ### start `individualReveals.start` Start an individual reveal to enrich a single contact in real time (consumes credits) **Risk:** `write` ```ts theme={null} await corsair.wiza.api.individualReveals.start({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `individual_reveal` | `object` | Yes | — | | `enrichment_level` | `none \| partial \| phone \| full` | Yes | — | | `email_options` | `object` | No | — | | `callback_url` | `string` | No | — | > **individual\_reveal full type** > > ```ts theme={null} > { > profile_url?: string, > full_name?: string, > company?: string, > domain?: string, > email?: string > } > ``` > **email\_options full type** > > ```ts theme={null} > { > accept_work?: boolean, > accept_personal?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `object` | Yes | — | | `type` | `string` | No | — | | `data` | `object` | Yes | — | > **status full type** > > ```ts theme={null} > { > code: number, > message?: string > } > ``` > **data full type** > > ```ts theme={null} > { > id: number, > status: queued | resolving | finished | failed, > is_complete: boolean > } > ``` *** ## Lists ### get `lists.get` Get the processing status and details of a list by ID **Risk:** `read` ```ts theme={null} await corsair.wiza.api.lists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string \| number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `object` | Yes | — | | `type` | `string` | No | — | | `data` | `object` | Yes | — | > **status full type** > > ```ts theme={null} > { > code: number, > message?: string > } > ``` > **data full type** > > ```ts theme={null} > { > id: number, > name?: string, > status: string, > stats?: any, > finished_at?: string | null, > created_at?: string, > enrichment_level?: string, > email_options?: any, > report_type?: string > } > ``` *** ## Prospects ### search `prospects.search` Search for prospects matching filters (job title, location, company, industry) **Risk:** `read` ```ts theme={null} await corsair.wiza.api.prospects.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `size` | `number` | No | — | | `filters` | `object` | Yes | — | > **filters full type** > > ```ts theme={null} > { > first_name?: string[], > last_name?: string[], > job_title?: { > v: string, > s?: i | e, > b?: city | state | country > }[], > job_title_level?: string[], > job_role?: string[], > location?: { > v: string, > s?: i | e, > b?: city | state | country > }[], > skill?: string[], > job_company?: { > v: string, > s?: i | e, > b?: city | state | country > }[], > past_company?: { > v: string, > s?: i | e, > b?: city | state | country > }[], > company_location?: { > v: string, > s?: i | e, > b?: city | state | country > }[], > company_industry?: { > v: string, > s?: i | e, > b?: city | state | country > }[], > company_size?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `object` | Yes | — | | `data` | `object` | Yes | — | > **status full type** > > ```ts theme={null} > { > code: number, > message?: string > } > ``` > **data full type** > > ```ts theme={null} > { > total: number, > profiles?: { > full_name?: string | null, > linkedin_url?: string | null, > industry?: string | null, > job_title?: string | null, > job_title_role?: string | null, > job_title_sub_role?: string | null, > job_company_name?: string | null, > job_company_website?: string | null, > location_name?: string | null > }[] > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/wiza/database Wiza local sync: searchable entities, `.search()` filters, and operators. The Wiza plugin syncs data locally. Use `corsair.wiza.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Lists Path: `wiza.db.lists.search` ```ts theme={null} const rows = await corsair.wiza.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `enrichment_level` | `string` | equals, contains, startsWith, endsWith, in | | `report_type` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `finished_at` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Prospects Path: `wiza.db.prospects.search` ```ts theme={null} const rows = await corsair.wiza.db.prospects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `linkedin_url` | `string` | equals, contains, startsWith, endsWith, in | | `full_name` | `string` | equals, contains, startsWith, endsWith, in | | `job_title` | `string` | equals, contains, startsWith, endsWith, in | | `job_company_name` | `string` | equals, contains, startsWith, endsWith, in | | `industry` | `string` | equals, contains, startsWith, endsWith, in | | `location_name` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Reveals Path: `wiza.db.reveals.search` ```ts theme={null} const rows = await corsair.wiza.db.reveals.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `is_complete` | `boolean` | equals | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `company` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `linkedin_profile_url` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `email_status` | `string` | equals, contains, startsWith, endsWith, in | | `mobile_phone` | `string` | equals, contains, startsWith, endsWith, in | | `phone_number` | `string` | equals, contains, startsWith, endsWith, in | | `company_domain` | `string` | equals, contains, startsWith, endsWith, in | | `company_industry` | `string` | equals, contains, startsWith, endsWith, in | | `enrichment_level` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/wiza/overview LinkedIn prospecting tool for finding verified emails and exporting lead contact lists. Use **Wiza** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 5 typed API operations * 3 synced entities (`lists`, `prospects`, `reveals`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/wiza ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/wiza ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/wiza ``` ```bash bun theme={null} bun add corsair @corsair-dev/wiza ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { wiza } from '@corsair-dev/wiza'; export const corsair = createCorsair({ plugins: [ wiza(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} wiza() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'wiza', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`credits.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.wiza.api.credits.get({}); ``` **`individualReveals.start`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.wiza.api.individualReveals.start({}); ``` See the full list on the [API](/plugins/wiza/api) page. ## Query synced data Synced entities support `tenant.wiza.db..search()` and `.list()`: `lists`, `prospects`, `reveals`. See [Database](/plugins/wiza/database) for filters and operators. ## What's next > **[API reference](/plugins/wiza/api)** > > Every `wiza.api.*` operation with input and output types. > **[Database](/plugins/wiza/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/workday/api API reference for Workday: every `workday.api.*` operation with input and output types. Every `workday.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Absence ### getAbsenceBalance `absence.getAbsenceBalance` Retrieves an absence balance by ID (Absence Management v5). **Risk:** `read` ```ts theme={null} await corsair.workday.api.absence.getAbsenceBalance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `absencePlan` | `string \| number \| boolean \| string[]` | No | — | | `effective` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ## Assignment ### getAssignmentChangeGroupCostCenters `assignment.getAssignmentChangeGroupCostCenters` Retrieves cost center prompt values for org assignment changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.assignment.getAssignmentChangeGroupCostCenters({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `organizationType` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getAssignmentChangeGroupJobs `assignment.getAssignmentChangeGroupJobs` Retrieves job prompt values for org assignment changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.assignment.getAssignmentChangeGroupJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `organizationType` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getAssignmentTypes `assignment.getAssignmentTypes` Retrieves assignment type prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.assignment.getAssignmentTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Balances ### listBalances `balances.listBalances` Lists absence balances (Absence Management v5). **Risk:** `read` ```ts theme={null} await corsair.workday.api.balances.listBalances({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `category` | `string \| number \| boolean \| string[]` | No | — | | `effective` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Business ### createBusinessTitleChange `business.createBusinessTitleChange` Creates a business title change for a worker (Common API v1). **Risk:** `write` ```ts theme={null} await corsair.workday.api.business.createBusinessTitleChange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getBusinessTitleChange `business.getBusinessTitleChange` Retrieves a business title change instance by ID (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.business.getBusinessTitleChange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getBusinessTitleChangeForWorker `business.getBusinessTitleChangeForWorker` Retrieves a business title change for a specific worker (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.business.getBusinessTitleChangeForWorker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `subresourceID` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ## Candidate ### getCandidateAvailabilityTemplate `candidate.getCandidateAvailabilityTemplate` Retrieves candidate availability template for a job posting (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.candidate.getCandidateAvailabilityTemplate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ## Collection ### getCollectionOfJobs `collection.getCollectionOfJobs` Retrieves a paginated collection of jobs (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.collection.getCollectionOfJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getCollectionOfPayroll `collection.getCollectionOfPayroll` Retrieves a collection of payroll inputs (Payroll v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.collection.getCollectionOfPayroll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `startDate` | `string \| number \| boolean \| string[]` | No | — | | `endDate` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `payComponent` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Company ### getCompanyInsiderTypes `company.getCompanyInsiderTypes` Retrieves company insider type prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.company.getCompanyInsiderTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Contingent ### getContingentWorkerTypes `contingent.getContingentWorkerTypes` Retrieves contingent worker type prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.contingent.getContingentWorkerTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Countries ### listCountries `countries.listCountries` Retrieves country values for recruiting (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.countries.listCountries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Country ### getCountryInfo `country.getCountryInfo` Retrieves country info (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.country.getCountryInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ## Currencies ### getCurrencies `currencies.getCurrencies` Retrieves currency prompt values for job changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.currencies.getCurrencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Current ### getCurrentUser `current.getCurrentUser` Retrieves the authenticated worker profile (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.current.getCurrentUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ## Grants ### getGrants `grants.getGrants` Retrieves grant prompt values for org assignment changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.grants.getGrants({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `organizationType` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Headcount ### getHeadcountOptions `headcount.getHeadcountOptions` Retrieves headcount option prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.headcount.getHeadcountOptions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## History ### getHistoryInstanceForWorker `history.getHistoryInstanceForWorker` Retrieves a history instance for a worker (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.history.getHistoryInstanceForWorker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `subresourceID` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getHistoryItemsForWorker `history.getHistoryItemsForWorker` Retrieves history items for a worker (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.history.getHistoryItemsForWorker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Holiday ### getHolidayEvents `holiday.getHolidayEvents` Retrieves holiday events for workers/time period (Person v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.holiday.getHolidayEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `fromDate` | `string \| number \| boolean \| string[]` | No | — | | `toDate` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Interview ### getInterview `interview.getInterview` Retrieves an interview by ID (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.interview.getInterview({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getInterviewFeedback2 `interview.getInterviewFeedback2` Retrieves interview feedback (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.interview.getInterviewFeedback2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Interviews ### listInterviews `interviews.listInterviews` Lists interviews (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.interviews.listInterviews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Job ### createJobChange `job.createJobChange` Initiates a job change for a worker (Staffing v6). **Risk:** `write` ```ts theme={null} await corsair.workday.api.job.createJobChange({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getJobById `job.getJobById` Retrieves a single job instance by ID (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getJobChangeFrequencies `job.getJobChangeFrequencies` Retrieves frequency prompt values for job changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobChangeFrequencies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobChangeLocationInfo `job.getJobChangeLocationInfo` Retrieves location info for a job change (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobChangeLocationInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getJobChangePosition `job.getJobChangePosition` Retrieves position details for a job change (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobChangePosition({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getJobChangeReasonInstance `job.getJobChangeReasonInstance` Retrieves a job change reason instance (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobChangeReasonInstance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getJobChangeReasons `job.getJobChangeReasons` Retrieves job change reasons collection (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobChangeReasons({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobChangeReasonValues `job.getJobChangeReasonValues` Retrieves job change reason prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobChangeReasonValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobChangesGroupTemplates `job.getJobChangesGroupTemplates` Retrieves job change templates (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobChangesGroupTemplates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobChangesJobValues `job.getJobChangesJobValues` Retrieves job prompt values for job changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobChangesJobValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobChangesWorkerValues `job.getJobChangesWorkerValues` Retrieves worker prompt values for job changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobChangesWorkerValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobClassifications `job.getJobClassifications` Retrieves job classification prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobClassifications({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobPosting `job.getJobPosting` Retrieves a job posting including description (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobPosting({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getJobPostingQuestionnaire `job.getJobPostingQuestionnaire` Retrieves questionnaires for a job posting (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobPostingQuestionnaire({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobProfilesValues `job.getJobProfilesValues` Retrieves job profile prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobProfilesValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobRequisitionValues `job.getJobRequisitionValues` Retrieves job requisition prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobRequisitionValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getJobWorkspace `job.getJobWorkspace` Retrieves a workspace for a job (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobWorkspace({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `subresourceID` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getJobWorkspaces `job.getJobWorkspaces` Retrieves workspaces for a job (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.getJobWorkspaces({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### listJobPostings `job.listJobPostings` Lists job postings (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.job.listJobPostings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `jobRequisition` | `string \| number \| boolean \| string[]` | No | — | | `category` | `string \| number \| boolean \| string[]` | No | — | | `id` | `string \| number \| boolean \| string[]` | No | — | | `jobSite` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### updateJobChangeBusinessTitle `job.updateJobChangeBusinessTitle` Partially updates business title on a job change (Staffing v6). **Risk:** `write` ```ts theme={null} await corsair.workday.api.job.updateJobChangeBusinessTitle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `subresourceID` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ## Jobs ### listJobs `jobs.listJobs` Lists jobs (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.jobs.listJobs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Leave ### getLeaveStatusValues `leave.getLeaveStatusValues` Retrieves leave status prompt values (Absence Management v5). **Risk:** `read` ```ts theme={null} await corsair.workday.api.leave.getLeaveStatusValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Message ### updateMessageTemplateById `message.updateMessageTemplateById` Updates a message template by ID (Recruiting v4). **Risk:** `write` ```ts theme={null} await corsair.workday.api.message.updateMessageTemplateById({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ## My ### getMyJobPostings `my.getMyJobPostings` Retrieves job postings for the authenticated recruiter (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.my.getMyJobPostings({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string \| number \| boolean \| string[]` | No | — | | `supervisoryOrganization` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Organization ### getOrganizationAssignmentBusinessUnits `organization.getOrganizationAssignmentBusinessUnits` Retrieves business unit prompt values for org assignment changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.organization.getOrganizationAssignmentBusinessUnits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `organizationType` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getOrganizationAssignmentCustoms `organization.getOrganizationAssignmentCustoms` Retrieves custom org assignment prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.organization.getOrganizationAssignmentCustoms({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `organizationType` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getOrganizationAssignmentFunds `organization.getOrganizationAssignmentFunds` Retrieves fund prompt values for org assignment changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.organization.getOrganizationAssignmentFunds({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `organizationType` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getOrganizationAssignmentRegions `organization.getOrganizationAssignmentRegions` Retrieves region prompt values for org assignment changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.organization.getOrganizationAssignmentRegions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `organizationType` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getOrganizationAssignmentWorkers `organization.getOrganizationAssignmentWorkers` Retrieves worker prompt values for org assignment changes (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.organization.getOrganizationAssignmentWorkers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `organizationType` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Pay ### getPayGroupByJobId `pay.getPayGroupByJobId` Retrieves the pay group for a job (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.pay.getPayGroupByJobId({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getPaySlipInstancesForWorker `pay.getPaySlipInstancesForWorker` Retrieves a pay slip instance for a worker (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.pay.getPaySlipInstancesForWorker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `subresourceID` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getPaySlipsForWorker `pay.getPaySlipsForWorker` Retrieves pay slips for a worker (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.pay.getPaySlipsForWorker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Payroll ### createPayrollInputs `payroll.createPayrollInputs` Creates payroll inputs (Payroll v1). **Risk:** `write` ```ts theme={null} await corsair.workday.api.payroll.createPayrollInputs({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getPayrollInputInstance `payroll.getPayrollInputInstance` Retrieves a payroll input by ID (Payroll v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.payroll.getPayrollInputInstance({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### updateAnExistingPayroll `payroll.updateAnExistingPayroll` Partially updates a payroll input (Payroll v1). **Risk:** `write` ```ts theme={null} await corsair.workday.api.payroll.updateAnExistingPayroll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ## Proposed ### getProposedPositionValues `proposed.getProposedPositionValues` Retrieves proposed position prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.proposed.getProposedPositionValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Prospect ### getProspect `prospect.getProspect` Retrieves a prospect (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.prospect.getProspect({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getProspectEducations `prospect.getProspectEducations` Retrieves prospect educations (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.prospect.getProspectEducations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getProspectExperiences `prospect.getProspectExperiences` Retrieves prospect experiences (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.prospect.getProspectExperiences({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getProspectResumeAttachments `prospect.getProspectResumeAttachments` Retrieves prospect resume attachments (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.prospect.getProspectResumeAttachments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getProspectSkills `prospect.getProspectSkills` Retrieves prospect skills (Recruiting v4). **Risk:** `read` ```ts theme={null} await corsair.workday.api.prospect.getProspectSkills({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Supervisory ### getSupervisoryOrgValues `supervisory.getSupervisoryOrgValues` Retrieves supervisory organization prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.supervisory.getSupervisoryOrgValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Time ### createTimeOffRequest `time.createTimeOffRequest` Creates a time off request (Absence Management v5). **Risk:** `write` ```ts theme={null} await corsair.workday.api.time.createTimeOffRequest({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getTimeOffEntriesForWorker `time.getTimeOffEntriesForWorker` Retrieves time off entries for a worker (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.time.getTimeOffEntriesForWorker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getTimeOffPlansForWorker `time.getTimeOffPlansForWorker` Retrieves time off plans for a worker (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.time.getTimeOffPlansForWorker({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getTimeOffStatusValues `time.getTimeOffStatusValues` Retrieves time off status prompt values (Absence Management v5). **Risk:** `read` ```ts theme={null} await corsair.workday.api.time.getTimeOffStatusValues({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getTimeTypes `time.getTimeTypes` Retrieves time type prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.time.getTimeTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Work ### getWorkStudyAwards `work.getWorkStudyAwards` Retrieves work study award prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.work.getWorkStudyAwards({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Worker ### getWorkerBusinessTitleChanges `worker.getWorkerBusinessTitleChanges` Retrieves business title changes for a worker (Common API v1). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.getWorkerBusinessTitleChanges({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getWorkerEligibleAbsenceTypes `worker.getWorkerEligibleAbsenceTypes` Retrieves eligible absence types for a worker (Absence Management v5). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.getWorkerEligibleAbsenceTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `effective` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getWorkerInfo `worker.getWorkerInfo` Retrieves worker staffing information (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.getWorkerInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getWorkerLeavesOfAbsence `worker.getWorkerLeavesOfAbsence` Retrieves leaves of absence for a worker (Absence Management v5). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.getWorkerLeavesOfAbsence({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `fromDate` | `string \| number \| boolean \| string[]` | No | — | | `toDate` | `string \| number \| boolean \| string[]` | No | — | | `status` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getWorkerServiceDates `worker.getWorkerServiceDates` Retrieves service dates for a worker (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.getWorkerServiceDates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getWorkerStaffingInformation `worker.getWorkerStaffingInformation` Retrieves current staffing information for a worker (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.getWorkerStaffingInformation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ### getWorkerTimeOffDetails `worker.getWorkerTimeOffDetails` Retrieves time off details for a worker (Absence Management v5). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.getWorkerTimeOffDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `fromDate` | `string \| number \| boolean \| string[]` | No | — | | `toDate` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getWorkerTypes `worker.getWorkerTypes` Retrieves worker type prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.getWorkerTypes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### getWorkerValidTimeOffDates `worker.getWorkerValidTimeOffDates` Retrieves valid time off dates for a worker (Absence Management v5). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.getWorkerValidTimeOffDates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `fromDate` | `string \| number \| boolean \| string[]` | No | — | | `toDate` | `string \| number \| boolean \| string[]` | No | — | | `timeOffType` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ### retrieveWorkerLeaveOfAbsenceSubresource `worker.retrieveWorkerLeaveOfAbsenceSubresource` Retrieves a leave of absence subresource (Absence Management v5). **Risk:** `read` ```ts theme={null} await corsair.workday.api.worker.retrieveWorkerLeaveOfAbsenceSubresource({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ID` | `string` | Yes | — | | `id` | `string` | No | — | | `workerId` | `string` | No | — | | `subresourceID` | `string` | Yes | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `descriptor` | `string` | No | — | | `href` | `string` | No | — | *** ## Workers ### getWorkersCollectionStaffing `workers.getWorkersCollectionStaffing` Retrieves workers with staffing information (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.workers.getWorkersCollectionStaffing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `includeTerminatedWorkers` | `string \| number \| boolean \| string[]` | No | — | | `search` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** ## Workspace ### getWorkspaceInstances `workspace.getWorkspaceInstances` Retrieves workspace prompt values (Staffing v6). **Risk:** `read` ```ts theme={null} await corsair.workday.api.workspace.getWorkspaceInstances({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `effectiveDate` | `string \| number \| boolean \| string[]` | No | — | | `event` | `string \| number \| boolean \| string[]` | No | — | | `job` | `string \| number \| boolean \| string[]` | No | — | | `location` | `string \| number \| boolean \| string[]` | No | — | | `manager` | `string \| number \| boolean \| string[]` | No | — | | `staffingEvent` | `string \| number \| boolean \| string[]` | No | — | | `worker` | `string \| number \| boolean \| string[]` | No | — | | `limit` | `number` | No | — | | `offset` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | No | — | | `total` | `number` | No | — | > **data full type** > > ```ts theme={null} > { > id?: string, > descriptor?: string, > href?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/workday/database Workday local sync: searchable entities, `.search()` filters, and operators. The Workday plugin syncs data locally. Use `corsair.workday.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Absence Balances Path: `workday.db.absenceBalances.search` ```ts theme={null} const rows = await corsair.workday.db.absenceBalances.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `descriptor` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | | `unitOfTime` | `string` | equals, contains, startsWith, endsWith, in | | `effectiveDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Interviews Path: `workday.db.interviews.search` ```ts theme={null} const rows = await corsair.workday.db.interviews.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `descriptor` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `interviewDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Job Postings Path: `workday.db.jobPostings.search` ```ts theme={null} const rows = await corsair.workday.db.jobPostings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `descriptor` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `jobDescription` | `string` | equals, contains, startsWith, endsWith, in | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `endDate` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Job Requisitions Path: `workday.db.jobRequisitions.search` ```ts theme={null} const rows = await corsair.workday.db.jobRequisitions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `descriptor` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `numberOfOpenings` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Jobs Path: `workday.db.jobs.search` ```ts theme={null} const rows = await corsair.workday.db.jobs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `descriptor` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | | `businessTitle` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payroll Inputs Path: `workday.db.payrollInputs.search` ```ts theme={null} const rows = await corsair.workday.db.payrollInputs.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `descriptor` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | | `startDate` | `string` | equals, contains, startsWith, endsWith, in | | `endDate` | `string` | equals, contains, startsWith, endsWith, in | | `comment` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Prospects Path: `workday.db.prospects.search` ```ts theme={null} const rows = await corsair.workday.db.prospects.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `descriptor` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Workers Path: `workday.db.workers.search` ```ts theme={null} const rows = await corsair.workday.db.workers.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `descriptor` | `string` | equals, contains, startsWith, endsWith, in | | `href` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `date` | equals, before, after, between | | `businessTitle` | `string` | equals, contains, startsWith, endsWith, in | | `primaryWorkEmail` | `string` | equals, contains, startsWith, endsWith, in | | `primaryWorkPhone` | `string` | equals, contains, startsWith, endsWith, in | | `workerID` | `string` | equals, contains, startsWith, endsWith, in | | `employeeID` | `string` | equals, contains, startsWith, endsWith, in | | `isManager` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/workday/overview Enterprise HR and finance cloud suite for workers, payroll, and organizational data. Use **Workday** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 85 typed API operations * 8 synced entities (`absenceBalances`, `interviews`, `jobPostings`, `jobRequisitions`, `jobs`, `payrollInputs`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/workday ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/workday ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/workday ``` ```bash bun theme={null} bun add corsair @corsair-dev/workday ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { workday } from '@corsair-dev/workday'; export const corsair = createCorsair({ plugins: [ workday({ host: 'wd2-impl-services1.workday.com', tenant: 'acme', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Workday OAuth app. Pass Workday’s **API hostname** and **tenant name** too — they go in Workday URLs (`https://{host}/ccx/oauth2/{tenant}/…`). That’s not the same as `corsair.withTenant()` ([Multi-tenancy](/concepts/multi-tenancy)). See Workday’s docs: [token endpoint shape](https://doc.workday.com/adaptive-planning/en-us/workday-adaptive-planning-documentation/integration/managing-data-integration/api-documentation/understanding-the-adaptive-planning-rest-api/bit1623710301264.html). ```ts theme={null} workday({ host: 'wd2-impl-services1.workday.com', tenant: 'acme', }) ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'workday', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`absence.getAbsenceBalance`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.workday.api.absence.getAbsenceBalance({}); ``` **`business.createBusinessTitleChange`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.workday.api.business.createBusinessTitleChange({}); ``` See the full list on the [API](/plugins/workday/api) page. ## Query synced data Synced entities support `tenant.workday.db..search()` and `.list()`: `absenceBalances`, `interviews`, `jobPostings`, `jobRequisitions`, `jobs`, `payrollInputs`, `prospects`, `workers`. See [Database](/plugins/workday/database) for filters and operators. ## What's next > **[API reference](/plugins/workday/api)** > > Every `workday.api.*` operation with input and output types. > **[Database](/plugins/workday/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/workiom/api API reference for Workiom: every `workiom.api.*` operation with input and output types. Every `workiom.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Apps ### getAll `apps.getAll` List Workiom apps via GET /api/services/app/Apps/GetAll **Risk:** `read` ```ts theme={null} await corsair.workiom.api.apps.getAll({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `totalCount` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > name?: string, > description?: string > }[] > ``` *** ## Lists ### get `lists.get` Get a list's fields, views, and filters via GET /api/services/app/Lists/Get **Risk:** `read` ```ts theme={null} await corsair.workiom.api.lists.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `expand` | `Fields \| Views \| Filters[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `appId` | `string` | No | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `fields` | `object[]` | No | — | | `views` | `object[]` | No | — | | `filters` | `object[]` | No | — | > **fields full type** > > ```ts theme={null} > { > id: number, > name: string, > description?: string, > dataType?: number > }[] > ``` > **views full type** > > ```ts theme={null} > { > id?: number, > name?: string, > listId?: string, > isDefault?: boolean, > viewType?: number, > filters?: { > fieldId: number, > operator: number, > value?: any > }[] > }[] > ``` > **filters full type** > > ```ts theme={null} > { > fieldId: number, > operator: number, > value?: any > }[] > ``` *** ### getAll `lists.getAll` Get all lists in a Workiom app via GET /api/services/app/Lists/GetAll **Risk:** `read` ```ts theme={null} await corsair.workiom.api.lists.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `appId` | `string` | Yes | Workiom app UUID from the app URL or Apps/GetAll | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `totalCount` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > id: string, > appId?: string, > name: string, > description?: string, > fields?: { > id: number, > name: string, > description?: string, > dataType?: number > }[], > views?: { > id?: number, > name?: string, > listId?: string, > isDefault?: boolean, > viewType?: number, > filters?: { > fieldId: number, > operator: number, > value?: any > }[] > }[], > filters?: { > fieldId: number, > operator: number, > value?: any > }[] > }[] > ``` *** ## Records ### create `records.create` Create a list record via POST /api/services/app/Data/Create?listId= **Risk:** `write` ```ts theme={null} await corsair.workiom.api.records.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `record` | `object` | Yes | Field ID keys to values, per list metadata | > **record full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | No | — | *** ### getAll `records.getAll` Get list records with sort, pagination, and filters via POST /api/services/app/Data/All **Risk:** `read` ```ts theme={null} await corsair.workiom.api.records.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `sorting` | `string` | No | Official sort string, e.g. '11284 ASC' or '11284 DESC' | | `maxResultCount` | `number` | No | — | | `skipCount` | `number` | No | — | | `filters` | `object[]` | No | — | > **filters full type** > > ```ts theme={null} > { > fieldId: number, > operator: number, > value?: any > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `totalCount` | `number` | Yes | — | | `summary` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > _id?: string > }[] > ``` > **summary full type** > > ```ts theme={null} > { > } > ``` *** ### update `records.update` Replace a list record via PUT /api/services/app/Data/Update?listId=\&id= **Risk:** `write` ```ts theme={null} await corsair.workiom.api.records.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `listId` | `string` | Yes | — | | `id` | `string` | Yes | — | | `record` | `object` | Yes | Full record body; PUT replaces the record | > **record full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `_id` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/workiom/database Workiom local sync: searchable entities, `.search()` filters, and operators. The Workiom plugin syncs data locally. Use `corsair.workiom.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Apps Path: `workiom.db.apps.search` ```ts theme={null} const rows = await corsair.workiom.db.apps.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Fields Path: `workiom.db.fields.search` ```ts theme={null} const rows = await corsair.workiom.db.fields.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `dataType` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Filters Path: `workiom.db.filters.search` ```ts theme={null} const rows = await corsair.workiom.db.filters.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `fieldId` | `number` | equals, gt, gte, lt, lte, in | | `operator` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Lists Path: `workiom.db.lists.search` ```ts theme={null} const rows = await corsair.workiom.db.lists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `appId` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Record Pages Path: `workiom.db.recordPages.search` ```ts theme={null} const rows = await corsair.workiom.db.recordPages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `totalCount` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Records Path: `workiom.db.records.search` ```ts theme={null} const rows = await corsair.workiom.db.records.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Views Path: `workiom.db.views.search` ```ts theme={null} const rows = await corsair.workiom.db.views.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `listId` | `string` | equals, contains, startsWith, endsWith, in | | `isDefault` | `boolean` | equals | | `viewType` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/workiom/overview No-code work management platform combining databases, automations, and team workflows. Use **Workiom** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 6 typed API operations * 7 synced entities (`apps`, `fields`, `filters`, `lists`, `recordPages`, `records`, and 1 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/workiom ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/workiom ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/workiom ``` ```bash bun theme={null} bun add corsair @corsair-dev/workiom ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { workiom } from '@corsair-dev/workiom'; export const corsair = createCorsair({ plugins: [ workiom(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} workiom() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'workiom', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`apps.getAll`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.workiom.api.apps.getAll({}); ``` **`records.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.workiom.api.records.create({}); ``` See the full list on the [API](/plugins/workiom/api) page. ## Query synced data Synced entities support `tenant.workiom.db..search()` and `.list()`: `apps`, `fields`, `filters`, `lists`, `recordPages`, `records`, `views`. See [Database](/plugins/workiom/database) for filters and operators. ## What's next > **[API reference](/plugins/workiom/api)** > > Every `workiom.api.*` operation with input and output types. > **[Database](/plugins/workiom/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/worldnewsapi/api API reference for World News API: every `worldnewsapi.api.*` operation with input and output types. Every `worldnewsapi.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## News ### extractNews `news.extractNews` Extract a news article from a website to a well-structured JSON object, including title, text, images, videos, publish date, authors, language, and sentiment. **Risk:** `read` ```ts theme={null} await corsair.worldnewsapi.api.news.extractNews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the news article to extract into structured data. | | `analyze` | `boolean` | No | Whether to analyze the extracted news (extract named entities, detect sentiment, etc.). Defaults to false. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `text` | `string` | No | — | | `url` | `string` | No | — | | `image` | `string` | No | — | | `images` | `object[]` | No | — | | `video` | `string` | No | — | | `videos` | `object[]` | No | — | | `publish_date` | `string` | No | — | | `author` | `string` | No | — | | `authors` | `string \| null[]` | No | — | | `language` | `string` | No | — | | `source_country` | `string` | No | — | | `sentiment` | `number` | No | — | | `entities` | `object[]` | No | — | > **images full type** > > ```ts theme={null} > { > title?: string, > url: string, > width?: number, > height?: number > }[] > ``` > **videos full type** > > ```ts theme={null} > { > title?: string, > url: string, > summary?: string, > duration?: number, > thumbnail?: string > }[] > ``` > **entities full type** > > ```ts theme={null} > { > name: string, > type: string, > sentiment?: number > }[] > ``` *** ### extractNewsLinks `news.extractNewsLinks` Extract news article links from a website or webpage, with optional filtering by URL prefix and subdomain inclusion. **Risk:** `read` ```ts theme={null} await corsair.worldnewsapi.api.news.extractNewsLinks({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The webpage or site URL from which news article links should be extracted. | | `analyze` | `boolean` | No | Whether to analyze extracted links. Defaults to false. | | `prefix` | `string` | No | The prefix that discovered news links must start with. | | `subDomain` | `boolean` | No | Whether to include links to news articles on sub-domains. Defaults to true. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `status` | `string` | No | — | | `news_links` | `string[]` | Yes | — | *** ### getGeoCoordinates `news.getGeoCoordinates` Retrieve latitude and longitude of a location name to fill the location-filter parameter in news search operations. **Risk:** `read` ```ts theme={null} await corsair.worldnewsapi.api.news.getGeoCoordinates({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `location` | `string` | Yes | The address or location name to geocode (e.g., "Tokyo, Japan" or "Mumbai, India"). | **Output** | Name | Type | Required | Description | | - | - | - | - | | `latitude` | `number` | Yes | — | | `longitude` | `number` | Yes | — | | `city` | `string` | No | — | *** ### newsWebsiteToRssFeed `news.newsWebsiteToRssFeed` Convert any news website page into an RSS feed with the latest news from that page. **Risk:** `read` ```ts theme={null} await corsair.worldnewsapi.api.news.newsWebsiteToRssFeed({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | The URL of the news website/page to convert into an RSS 2.0 feed. | | `extractNews` | `boolean` | No | Whether to extract full article text/data for each item in the feed (costs additional quota). Defaults to false. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | No | — | | `link` | `string` | No | — | | `description` | `string` | No | — | | `pubDate` | `string` | No | — | | `lastBuildDate` | `string` | No | — | | `language` | `string` | No | — | | `items` | `object[]` | Yes | — | | `rawXml` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > title?: string, > link?: string, > guid?: string, > pubDate?: string, > description?: string, > author?: string, > category?: string, > enclosureUrl?: string > }[] > ``` *** ### searchNews `news.searchNews` Search and filter news by text, date, location, category, language, and more. **Risk:** `read` ```ts theme={null} await corsair.worldnewsapi.api.news.searchNews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | No | Search query text. Supports implicit AND, OR, negation with -, parentheses, and quotes for exact phrases. | | `textMatchIndexes` | `string` | No | Where to search for text: "title", "content", or "title,content". | | `sourceCountry` | `string` | No | Filter by 2-letter ISO 3166 country code. | | `language` | `string` | No | Filter by 2-letter ISO 639-1 language code. | | `minSentiment` | `number` | No | Minimum sentiment score between -1.0 (very negative) and 1.0 (very positive). | | `maxSentiment` | `number` | No | Maximum sentiment score between -1.0 and 1.0. | | `earliestPublishDate` | `string` | No | Filter for news published on or after this timestamp (YYYY-MM-DD HH:MM:SS or YYYY-MM-DD). | | `latestPublishDate` | `string` | No | Filter for news published on or before this timestamp (YYYY-MM-DD HH:MM:SS or YYYY-MM-DD). | | `newsSources` | `string` | No | Comma-separated list of up to 10 news sources (e.g., "bbc.co.uk,nytimes.com"). | | `authors` | `string` | No | Comma-separated list of author names. | | `categories` | `string` | No | Comma-separated categories (politics, sports, business, technology, entertainment, health, science, etc.). | | `entities` | `string` | No | Filter by semantic entities (e.g., "ORG:Tesla,PER:Elon Musk"). | | `locationFilter` | `string` | No | Filter by geographic radius in the format "latitude,longitude,radius in km" (radius: 1-100). | | `sort` | `string` | No | Sort criteria, typically "publish-time". | | `sortDirection` | `ASC \| DESC` | No | Sort direction: "ASC" or "DESC". Defaults to DESC for publish-time. | | `offset` | `number` | No | Number of results to skip for pagination. | | `number` | `number` | No | Number of results to return (1-100). Defaults to 10. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `offset` | `number` | Yes | — | | `number` | `number` | Yes | — | | `available` | `number` | Yes | — | | `news` | `object[]` | Yes | — | > **news full type** > > ```ts theme={null} > { > id: number, > title: string, > text?: string, > summary?: string | null, > url: string, > image?: string | null, > video?: string | null, > publish_date?: string, > author?: string | null, > authors?: string | null[], > category?: string, > language?: string, > source_country?: string, > sentiment?: number > }[] > ``` *** ### searchNewsSources `news.searchNewsSources` Search whether a news source is being monitored by the World News API. **Risk:** `read` ```ts theme={null} await corsair.worldnewsapi.api.news.searchNewsSources({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | The (partial) name of the news source to search for (e.g. "bbc", "reuters", "times"). | **Output** | Name | Type | Required | Description | | - | - | - | - | | `available` | `number` | Yes | — | | `sources` | `object[]` | Yes | — | > **sources full type** > > ```ts theme={null} > { > name: string, > url: string, > language?: string, > country?: string > }[] > ``` *** ### topNews `news.topNews` Get the top news from a country in a specific language for a given date. The top news are clustered from multiple sources in the specified country. **Risk:** `read` ```ts theme={null} await corsair.worldnewsapi.api.news.topNews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `sourceCountry` | `string` | Yes | The 2-letter ISO 3166 country code for which top news should be retrieved (e.g., "us", "in", "gb"). | | `language` | `string` | Yes | The 2-letter ISO 639-1 language code of the top news (e.g., "en", "es", "fr"). | | `date` | `string` | No | The date for which the top news should be retrieved (YYYY-MM-DD). Defaults to today. | | `headlinesOnly` | `boolean` | No | Whether to only return basic headline fields (id, title, url). Defaults to false. | | `maxNewsPerCluster` | `number` | No | How many news articles to return per story cluster. Default is 1. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `top_news` | `object[]` | Yes | — | | `language` | `string` | No | — | | `country` | `string` | No | — | > **top\_news full type** > > ```ts theme={null} > { > news: { > id: number, > title: string, > text?: string, > summary?: string | null, > url: string, > image?: string | null, > video?: string | null, > publish_date?: string, > author?: string | null, > authors?: string | null[], > category?: string, > language?: string, > source_country?: string, > sentiment?: number > }[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/worldnewsapi/database World News API local sync: searchable entities, `.search()` filters, and operators. The World News API plugin syncs data locally. Use `corsair.worldnewsapi.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Articles Path: `worldnewsapi.db.articles.search` ```ts theme={null} const rows = await corsair.worldnewsapi.db.articles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `image` | `string` | equals, contains, startsWith, endsWith, in | | `video` | `string` | equals, contains, startsWith, endsWith, in | | `publish_date` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `source_country` | `string` | equals, contains, startsWith, endsWith, in | | `sentiment` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Extracted Articles Path: `worldnewsapi.db.extractedArticles.search` ```ts theme={null} const rows = await corsair.worldnewsapi.db.extractedArticles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `text` | `string` | equals, contains, startsWith, endsWith, in | | `image` | `string` | equals, contains, startsWith, endsWith, in | | `video` | `string` | equals, contains, startsWith, endsWith, in | | `publish_date` | `string` | equals, contains, startsWith, endsWith, in | | `author` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `source_country` | `string` | equals, contains, startsWith, endsWith, in | | `sentiment` | `number` | equals, gt, gte, lt, lte, in | | `extractedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Geo Coordinates Path: `worldnewsapi.db.geoCoordinates.search` ```ts theme={null} const rows = await corsair.worldnewsapi.db.geoCoordinates.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `latitude` | `number` | equals, gt, gte, lt, lte, in | | `longitude` | `number` | equals, gt, gte, lt, lte, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `resolvedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sources Path: `worldnewsapi.db.sources.search` ```ts theme={null} const rows = await corsair.worldnewsapi.db.sources.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `searchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/worldnewsapi/overview Global news aggregation API for headlines, articles, and searchable current events data. Use **World News API** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 7 typed API operations * 4 synced entities (`articles`, `extractedArticles`, `geoCoordinates`, `sources`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/worldnewsapi ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/worldnewsapi ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/worldnewsapi ``` ```bash bun theme={null} bun add corsair @corsair-dev/worldnewsapi ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { worldnewsapi } from '@corsair-dev/worldnewsapi'; export const corsair = createCorsair({ plugins: [ worldnewsapi(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} worldnewsapi() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'worldnewsapi', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`news.extractNews`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.worldnewsapi.api.news.extractNews({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/worldnewsapi/api) reference.* See the full list on the [API](/plugins/worldnewsapi/api) page. ## Query synced data Synced entities support `tenant.worldnewsapi.db..search()` and `.list()`: `articles`, `extractedArticles`, `geoCoordinates`, `sources`. See [Database](/plugins/worldnewsapi/database) for filters and operators. ## What's next > **[API reference](/plugins/worldnewsapi/api)** > > Every `worldnewsapi.api.*` operation with input and output types. > **[Database](/plugins/worldnewsapi/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/writer/api API reference for Writer: every `writer.api.*` operation with input and output types. Every `writer.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Applications ### list `applications.list` List no-code applications **Risk:** `read` ```ts theme={null} await corsair.writer.api.applications.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `before` | `string` | No | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `search` | `string` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string > }[] > ``` *** ## Chat ### create `chat.create` Generate chat completions **Risk:** `write` ```ts theme={null} await corsair.writer.api.chat.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `messages` | `object[]` | Yes | — | | `temperature` | `number` | No | — | | `stream` | `false` | No | — | > **messages full type** > > ```ts theme={null} > { > role: user | assistant | system, > content: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `object` | `chat.completion` | Yes | — | | `choices` | `object[]` | Yes | — | | `created` | `number` | Yes | — | | `model` | `string` | Yes | — | | `usage` | `object` | No | — | > **choices full type** > > ```ts theme={null} > { > index: number, > finish_reason?: string | null, > message: { > role: string, > content?: string | null > } > }[] > ``` > **usage full type** > > ```ts theme={null} > { > prompt_tokens: number, > total_tokens: number, > completion_tokens: number > } > ``` *** ## Completions ### create `completions.create` Generate text completions **Risk:** `write` ```ts theme={null} await corsair.writer.api.completions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `prompt` | `string` | Yes | — | | `max_tokens` | `number` | No | — | | `temperature` | `number` | No | — | | `top_p` | `number` | No | — | | `stop` | `string \| string[]` | No | — | | `best_of` | `number` | No | — | | `random_seed` | `number` | No | — | | `stream` | `false` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `choices` | `object[]` | Yes | — | | `model` | `string` | Yes | — | > **choices full type** > > ```ts theme={null} > { > text: string, > log_probs?: any | null > }[] > ``` *** ## Files ### delete `files.delete` Delete file **Risk:** `destructive` ```ts theme={null} await corsair.writer.api.files.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `deleted` | `boolean` | No | — | *** ### download `files.download` Download file contents **Risk:** `read` ```ts theme={null} await corsair.writer.api.files.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | **Output:** `any` *** ### get `files.get` Get file details **Risk:** `read` ```ts theme={null} await corsair.writer.api.files.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | *** ### list `files.list` List uploaded files **Risk:** `read` ```ts theme={null} await corsair.writer.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `before` | `string` | No | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `graph_id` | `string` | No | — | | `status` | `in_progress \| completed \| failed` | No | — | | `file_types` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name?: string, > status?: string > }[] > ``` *** ### upload `files.upload` Upload file **Risk:** `write` ```ts theme={null} await corsair.writer.api.files.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | Yes | — | | `contentType` | `string` | Yes | — | | `filename` | `string` | Yes | — | | `graphId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | *** ## Knowledge Graphs ### addFile `knowledgeGraphs.addFile` Add file to graph **Risk:** `write` ```ts theme={null} await corsair.writer.api.knowledgeGraphs.addFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `graph_id` | `string` | Yes | — | | `file_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `status` | `string` | No | — | *** ### askQuestion `knowledgeGraphs.askQuestion` Ask question to knowledge graph **Risk:** `read` ```ts theme={null} await corsair.writer.api.knowledgeGraphs.askQuestion({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `graph_ids` | `string[]` | Yes | — | | `question` | `string` | Yes | — | | `stream` | `false` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `question` | `string` | Yes | — | | `answer` | `string` | Yes | — | | `sources` | `any[]` | No | — | *** ### create `knowledgeGraphs.create` Create knowledge graph **Risk:** `write` ```ts theme={null} await corsair.writer.api.knowledgeGraphs.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `description` | `string` | No | — | | `team_ids` | `number[]` | No | — | | `urls` | `any[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | *** ### delete `knowledgeGraphs.delete` Delete knowledge graph **Risk:** `destructive` ```ts theme={null} await corsair.writer.api.knowledgeGraphs.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `graph_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `deleted` | `boolean` | No | — | *** ### list `knowledgeGraphs.list` List knowledge graphs **Risk:** `read` ```ts theme={null} await corsair.writer.api.knowledgeGraphs.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `before` | `string` | No | — | | `after` | `string` | No | — | | `limit` | `number` | No | — | | `order` | `asc \| desc` | No | — | | `team_ids` | `number[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | No | — | | `first_id` | `string` | No | — | | `last_id` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > id: string, > name: string, > description?: string | null > }[] > ``` *** ### removeFile `knowledgeGraphs.removeFile` Remove file from graph **Risk:** `destructive` ```ts theme={null} await corsair.writer.api.knowledgeGraphs.removeFile({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `graph_id` | `string` | Yes | — | | `file_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `deleted` | `boolean` | No | — | *** ### retrieve `knowledgeGraphs.retrieve` Retrieve knowledge graph **Risk:** `read` ```ts theme={null} await corsair.writer.api.knowledgeGraphs.retrieve({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `graph_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | *** ### update `knowledgeGraphs.update` Update knowledge graph **Risk:** `write` ```ts theme={null} await corsair.writer.api.knowledgeGraphs.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `graph_id` | `string` | Yes | — | | `name` | `string` | No | — | | `description` | `string` | No | — | | `team_ids` | `number[]` | No | — | | `urls` | `any[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `name` | `string` | Yes | — | | `description` | `string` | No | — | *** ## Models ### list `models.list` List available models **Risk:** `read` ```ts theme={null} await corsair.writer.api.models.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `models` | `object[]` | Yes | — | > **models full type** > > ```ts theme={null} > { > id: string, > name: string > }[] > ``` *** ## Tools ### analyzeImages `tools.analyzeImages` Analyze images with vision models **Risk:** `write` ```ts theme={null} await corsair.writer.api.tools.analyzeImages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `model` | `string` | Yes | — | | `input` | `any[]` | Yes | — | | `stream` | `false` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `choices` | `any[]` | No | — | *** ### detectAiContent `tools.detectAiContent` Detect AI-generated content likelihood **Risk:** `read` ```ts theme={null} await corsair.writer.api.tools.detectAiContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organizationId` | `number` | Yes | — | | `text` | `string` | Yes | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > label?: string, > confidence?: number > }[] | any > ``` *** ### medicalComprehend `tools.medicalComprehend` Extract structured medical entities from text **Risk:** `write` ```ts theme={null} await corsair.writer.api.tools.medicalComprehend({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `model` | `string` | No | — | **Output:** `any` *** ### parsePdf `tools.parsePdf` Parse PDF file **Risk:** `read` ```ts theme={null} await corsair.writer.api.tools.parsePdf({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file_id` | `string` | Yes | — | | `format` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `content` | `string` | No | — | | `markdown` | `string` | No | — | *** ### translateText `tools.translateText` Translate text between languages **Risk:** `write` ```ts theme={null} await corsair.writer.api.tools.translateText({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | — | | `target_language` | `string` | Yes | — | | `source_language` | `string` | No | — | | `formality` | `string` | No | — | | `mask_profanity` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `translation` | `string` | No | — | | `translated_text` | `string` | No | — | *** ### webSearch `tools.webSearch` Search the web **Risk:** `read` ```ts theme={null} await corsair.writer.api.tools.webSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `any[]` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/writer/database Writer local sync: searchable entities, `.search()` filters, and operators. The Writer plugin syncs data locally. Use `corsair.writer.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/writer/overview Writer plugin for Corsair Use **Writer** through Corsair: one client, typed API calls. **What you get:** * 23 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/writer ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/writer ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/writer ``` ```bash bun theme={null} bun add corsair @corsair-dev/writer ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { writer } from '@corsair-dev/writer'; export const corsair = createCorsair({ plugins: [ writer(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} writer() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'writer', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`applications.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.writer.api.applications.list({}); ``` **`chat.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.writer.api.chat.create({}); ``` See the full list on the [API](/plugins/writer/api) page. ## What's next > **[API reference](/plugins/writer/api)** > > Every `writer.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/xero/api API reference for Xero: every `xero.api.*` operation with input and output types. Every `xero.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Accounts ### get `accounts.get` Retrieve a specific account from Xero chart of accounts **Risk:** `read` ```ts theme={null} await corsair.xero.api.accounts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `accountId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Accounts` | `object[]` | Yes | — | > **Accounts full type** > > ```ts theme={null} > { > AccountID: string, > Code?: string, > Name: string, > Type: string, > Status?: string, > Description?: string, > TaxType?: string, > Class?: string, > BankAccountNumber?: string, > CurrencyCode?: string > }[] > ``` *** ### list `accounts.list` Retrieve chart of accounts from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.accounts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Accounts` | `object[]` | Yes | — | > **Accounts full type** > > ```ts theme={null} > { > AccountID: string, > Code?: string, > Name: string, > Type: string, > Status?: string, > Description?: string, > TaxType?: string, > Class?: string, > BankAccountNumber?: string, > CurrencyCode?: string > }[] > ``` *** ## Assets ### get `assets.get` Retrieve a specific asset by ID from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.assets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `assetId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `assetId` | `string` | No | — | | `assetName` | `string` | No | — | | `assetNumber` | `string` | No | — | | `purchaseDate` | `string` | No | — | | `purchasePrice` | `number` | No | — | | `assetStatus` | `string` | No | — | | `bookValue` | `number` | No | — | *** ### list `assets.list` Retrieve fixed assets from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.assets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | | `status` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ## Attachments ### list `attachments.list` List all attachments for a specific entity in Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.attachments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `endpoint` | `Invoices \| Contacts \| ManualJournals \| PurchaseOrders \| BankTransactions` | Yes | — | | `entityId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Attachments` | `object[]` | Yes | — | > **Attachments full type** > > ```ts theme={null} > { > AttachmentID: string, > FileName: string, > Url?: string, > MimeType?: string, > ContentLength?: number > }[] > ``` *** ### upload `attachments.upload` Upload a file attachment to a Xero entity **Risk:** `write` ```ts theme={null} await corsair.xero.api.attachments.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `endpoint` | `Invoices \| Contacts \| ManualJournals \| PurchaseOrders \| BankTransactions` | Yes | — | | `entityId` | `string` | Yes | — | | `fileName` | `string` | Yes | — | | `mimeType` | `string` | No | — | | `fileContent` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Attachments` | `object[]` | Yes | — | > **Attachments full type** > > ```ts theme={null} > { > AttachmentID: string, > FileName: string, > Url?: string, > MimeType?: string, > ContentLength?: number > }[] > ``` *** ## Bank Transactions ### create `bankTransactions.create` Create a bank transaction in Xero (SPEND or RECEIVE) **Risk:** `write` ```ts theme={null} await corsair.xero.api.bankTransactions.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `Type` | `SPEND \| RECEIVE \| RECEIVE-TRANSFER \| SPEND-TRANSFER \| RECEIVE-OVERPAYMENT \| RECEIVE-PREPAYMENT \| SPEND-OVERPAYMENT \| SPEND-PREPAYMENT` | Yes | — | | `Contact` | `object` | Yes | — | | `BankAccount` | `object` | Yes | — | | `LineItems` | `object[]` | Yes | — | | `Date` | `string` | No | — | | `Reference` | `string` | No | — | > **Contact full type** > > ```ts theme={null} > { > ContactID?: string, > Name?: string > } > ``` > **BankAccount full type** > > ```ts theme={null} > { > AccountID?: string, > Code?: string > } > ``` > **LineItems full type** > > ```ts theme={null} > { > Description: string, > Quantity?: number, > UnitAmount: number, > AccountCode?: string, > TaxType?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `BankTransactions` | `object[]` | Yes | — | > **BankTransactions full type** > > ```ts theme={null} > { > BankTransactionID: string, > Type: SPEND | RECEIVE | RECEIVE-TRANSFER | SPEND-TRANSFER | RECEIVE-OVERPAYMENT | RECEIVE-PREPAYMENT | SPEND-OVERPAYMENT | SPEND-PREPAYMENT, > Contact?: { > ContactID?: string, > Name?: string > }, > BankAccount: { > AccountID: string, > Code?: string, > Name?: string > }, > Date?: string, > Status?: string, > LineAmountTypes?: string, > SubTotal?: number, > TotalTax?: number, > Total?: number, > UpdatedDateUTC?: string > }[] > ``` *** ### list `bankTransactions.list` Retrieve bank transactions from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.bankTransactions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | | `bankAccountID` | `string` | No | — | | `since` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `BankTransactions` | `object[]` | Yes | — | > **BankTransactions full type** > > ```ts theme={null} > { > BankTransactionID: string, > Type: SPEND | RECEIVE | RECEIVE-TRANSFER | SPEND-TRANSFER | RECEIVE-OVERPAYMENT | RECEIVE-PREPAYMENT | SPEND-OVERPAYMENT | SPEND-PREPAYMENT, > Contact?: { > ContactID?: string, > Name?: string > }, > BankAccount: { > AccountID: string, > Code?: string, > Name?: string > }, > Date?: string, > Status?: string, > LineAmountTypes?: string, > SubTotal?: number, > TotalTax?: number, > Total?: number, > UpdatedDateUTC?: string > }[] > ``` *** ## Budgets ### get `budgets.get` Retrieve a budget from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.budgets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `budgetId` | `string` | No | — | | `dateFrom` | `string` | No | — | | `dateTo` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Budgets` | `object[]` | Yes | — | > **Budgets full type** > > ```ts theme={null} > { > BudgetID?: string, > Type?: string, > Description?: string, > UpdatedDateUTC?: string, > BudgetLines?: { > }[] > }[] > ``` *** ## Connections ### get `connections.get` List active Xero tenant connections **Risk:** `read` ```ts theme={null} await corsair.xero.api.connections.get({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > id: string, > tenantId: string, > tenantType: string, > tenantName?: string, > createdDateUtc?: string, > updatedDateUtc?: string > }[] > ``` *** ## Contacts ### create `contacts.create` Create a new contact in Xero **Risk:** `write` ```ts theme={null} await corsair.xero.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `Name` | `string` | Yes | — | | `FirstName` | `string` | No | — | | `LastName` | `string` | No | — | | `EmailAddress` | `string` | No | — | | `AccountNumber` | `string` | No | — | | `ContactNumber` | `string` | No | — | | `TaxNumber` | `string` | No | — | | `BankAccountDetails` | `string` | No | — | | `IsSupplier` | `boolean` | No | — | | `IsCustomer` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Contacts` | `object[]` | Yes | — | > **Contacts full type** > > ```ts theme={null} > { > ContactID: string, > ContactNumber?: string, > AccountNumber?: string, > ContactStatus?: string, > Name: string, > FirstName?: string, > LastName?: string, > EmailAddress?: string, > BankAccountDetails?: string, > TaxNumber?: string, > IsSupplier?: boolean, > IsCustomer?: boolean, > UpdatedDateUTC?: string > }[] > ``` *** ### list `contacts.list` Retrieve a list of contacts from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | | `searchTerm` | `string` | No | — | | `includeArchived` | `boolean` | No | — | | `summaryOnly` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Contacts` | `object[]` | Yes | — | > **Contacts full type** > > ```ts theme={null} > { > ContactID: string, > ContactNumber?: string, > AccountNumber?: string, > ContactStatus?: string, > Name: string, > FirstName?: string, > LastName?: string, > EmailAddress?: string, > BankAccountDetails?: string, > TaxNumber?: string, > IsSupplier?: boolean, > IsCustomer?: boolean, > UpdatedDateUTC?: string > }[] > ``` *** ### update `contacts.update` Update an existing contact in Xero **Risk:** `write` ```ts theme={null} await corsair.xero.api.contacts.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `contactId` | `string` | Yes | — | | `Name` | `string` | No | — | | `FirstName` | `string` | No | — | | `LastName` | `string` | No | — | | `EmailAddress` | `string` | No | — | | `AccountNumber` | `string` | No | — | | `ContactNumber` | `string` | No | — | | `TaxNumber` | `string` | No | — | | `BankAccountDetails` | `string` | No | — | | `IsSupplier` | `boolean` | No | — | | `IsCustomer` | `boolean` | No | — | | `ContactStatus` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Contacts` | `object[]` | Yes | — | > **Contacts full type** > > ```ts theme={null} > { > ContactID: string, > ContactNumber?: string, > AccountNumber?: string, > ContactStatus?: string, > Name: string, > FirstName?: string, > LastName?: string, > EmailAddress?: string, > BankAccountDetails?: string, > TaxNumber?: string, > IsSupplier?: boolean, > IsCustomer?: boolean, > UpdatedDateUTC?: string > }[] > ``` *** ## Credit Notes ### list `creditNotes.list` Retrieve list of credit notes from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.creditNotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `CreditNotes` | `object[]` | Yes | — | > **CreditNotes full type** > > ```ts theme={null} > { > CreditNoteID: string, > CreditNoteNumber?: string, > Type?: string, > Status?: string, > Total?: number, > RemainingCredit?: number, > Contact?: { > ContactID: string, > Name?: string > }, > UpdatedDateUTC?: string > }[] > ``` *** ## Files ### list `files.list` Retrieve files from Xero Files **Risk:** `read` ```ts theme={null} await corsair.xero.api.files.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Items` | `object[]` | Yes | — | | `TotalCount` | `number` | No | — | > **Items full type** > > ```ts theme={null} > { > Id: string, > Name: string, > Size?: number, > MimeType?: string, > CreatedDateUtc?: string > }[] > ``` *** ### listFolders `files.listFolders` Retrieve folders from Xero Files **Risk:** `read` ```ts theme={null} await corsair.xero.api.files.listFolders({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > Id: string, > Name: string, > FileCount?: number, > IsInbox?: boolean > }[] > ``` *** ## Invoices ### create `invoices.create` Create a new invoice in Xero (sales invoice or bill) **Risk:** `write` ```ts theme={null} await corsair.xero.api.invoices.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `Type` | `ACCREC \| ACCPAY` | Yes | — | | `Contact` | `object` | Yes | — | | `LineItems` | `object[]` | Yes | — | | `Date` | `string` | No | — | | `DueDate` | `string` | No | — | | `InvoiceNumber` | `string` | No | — | | `Reference` | `string` | No | — | | `Status` | `DRAFT \| SUBMITTED \| AUTHORISED` | No | — | | `CurrencyCode` | `string` | No | — | > **Contact full type** > > ```ts theme={null} > { > ContactID?: string, > Name?: string, > ContactNumber?: string > } > ``` > **LineItems full type** > > ```ts theme={null} > { > Description?: string, > Quantity?: number, > UnitAmount?: number, > ItemCode?: string, > AccountCode?: string, > TaxType?: string, > DiscountRate?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Invoices` | `object[]` | Yes | — | > **Invoices full type** > > ```ts theme={null} > { > InvoiceID: string, > Type: string, > InvoiceNumber?: string, > Reference?: string, > Status?: string, > Date?: string, > DueDate?: string, > CurrencyCode?: string, > CurrencyRate?: number, > SubTotal?: number, > TotalTax?: number, > Total?: number, > AmountDue?: number, > AmountPaid?: number, > Contact?: { > ContactID: string, > Name?: string > }, > LineItems?: { > }[], > UpdatedDateUTC?: string > }[] > ``` *** ### get `invoices.get` Retrieve a specific invoice by ID from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.invoices.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `invoiceId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Invoices` | `object[]` | Yes | — | > **Invoices full type** > > ```ts theme={null} > { > InvoiceID: string, > Type: string, > InvoiceNumber?: string, > Reference?: string, > Status?: string, > Date?: string, > DueDate?: string, > CurrencyCode?: string, > CurrencyRate?: number, > SubTotal?: number, > TotalTax?: number, > Total?: number, > AmountDue?: number, > AmountPaid?: number, > Contact?: { > ContactID: string, > Name?: string > }, > LineItems?: { > }[], > UpdatedDateUTC?: string > }[] > ``` *** ### list `invoices.list` Retrieve a list of invoices from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.invoices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | | `Ids` | `string[]` | No | — | | `InvoiceNumbers` | `string[]` | No | — | | `ContactIDs` | `string[]` | No | — | | `Statuses` | `string[]` | No | — | | `summaryOnly` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Invoices` | `object[]` | Yes | — | > **Invoices full type** > > ```ts theme={null} > { > InvoiceID: string, > Type: string, > InvoiceNumber?: string, > Reference?: string, > Status?: string, > Date?: string, > DueDate?: string, > CurrencyCode?: string, > CurrencyRate?: number, > SubTotal?: number, > TotalTax?: number, > Total?: number, > AmountDue?: number, > AmountPaid?: number, > Contact?: { > ContactID: string, > Name?: string > }, > LineItems?: { > }[], > UpdatedDateUTC?: string > }[] > ``` *** ### update `invoices.update` Update an existing invoice in Xero **Risk:** `write` ```ts theme={null} await corsair.xero.api.invoices.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `invoiceId` | `string` | Yes | — | | `Contact` | `object` | No | — | | `LineItems` | `object[]` | No | — | | `Status` | `DRAFT \| SUBMITTED \| AUTHORISED \| VOIDED` | No | — | | `DueDate` | `string` | No | — | | `Reference` | `string` | No | — | > **Contact full type** > > ```ts theme={null} > { > ContactID?: string, > Name?: string > } > ``` > **LineItems full type** > > ```ts theme={null} > { > Description?: string, > Quantity?: number, > UnitAmount?: number, > ItemCode?: string, > AccountCode?: string, > TaxType?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Invoices` | `object[]` | Yes | — | > **Invoices full type** > > ```ts theme={null} > { > InvoiceID: string, > Type: string, > InvoiceNumber?: string, > Reference?: string, > Status?: string, > Date?: string, > DueDate?: string, > CurrencyCode?: string, > CurrencyRate?: number, > SubTotal?: number, > TotalTax?: number, > Total?: number, > AmountDue?: number, > AmountPaid?: number, > Contact?: { > ContactID: string, > Name?: string > }, > LineItems?: { > }[], > UpdatedDateUTC?: string > }[] > ``` *** ## Items ### create `items.create` Create an inventory item in Xero **Risk:** `write` ```ts theme={null} await corsair.xero.api.items.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `Code` | `string` | Yes | — | | `Name` | `string` | No | — | | `Description` | `string` | No | — | | `PurchaseDescription` | `string` | No | — | | `PurchaseDetails` | `object` | No | — | | `SalesDetails` | `object` | No | — | | `IsTrackedAsInventory` | `boolean` | No | — | | `InventoryAssetAccountCode` | `string` | No | — | > **PurchaseDetails full type** > > ```ts theme={null} > { > UnitPrice?: number, > AccountCode?: string, > TaxType?: string > } > ``` > **SalesDetails full type** > > ```ts theme={null} > { > UnitPrice?: number, > AccountCode?: string, > TaxType?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Items` | `object[]` | Yes | — | > **Items full type** > > ```ts theme={null} > { > ItemID: string, > Code: string, > Name?: string, > Description?: string, > PurchaseDescription?: string, > PurchaseDetails?: { > }, > SalesDetails?: { > }, > IsSold?: boolean, > IsPurchased?: boolean, > IsTrackedAsInventory?: boolean, > TotalCostPool?: number, > QuantityOnHand?: number, > UpdatedDateUTC?: string > }[] > ``` *** ### get `items.get` Retrieve a specific item by ID from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.items.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `itemId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Items` | `object[]` | Yes | — | > **Items full type** > > ```ts theme={null} > { > ItemID: string, > Code: string, > Name?: string, > Description?: string, > PurchaseDescription?: string, > PurchaseDetails?: { > }, > SalesDetails?: { > }, > IsSold?: boolean, > IsPurchased?: boolean, > IsTrackedAsInventory?: boolean, > TotalCostPool?: number, > QuantityOnHand?: number, > UpdatedDateUTC?: string > }[] > ``` *** ### list `items.list` Retrieve items (inventory/products) from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.items.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Items` | `object[]` | Yes | — | > **Items full type** > > ```ts theme={null} > { > ItemID: string, > Code: string, > Name?: string, > Description?: string, > PurchaseDescription?: string, > PurchaseDetails?: { > }, > SalesDetails?: { > }, > IsSold?: boolean, > IsPurchased?: boolean, > IsTrackedAsInventory?: boolean, > TotalCostPool?: number, > QuantityOnHand?: number, > UpdatedDateUTC?: string > }[] > ``` *** ## Journals ### list `journals.list` Retrieve journals from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.journals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | | `offset` | `number` | No | — | | `paymentsOnly` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Journals` | `object[]` | Yes | — | > **Journals full type** > > ```ts theme={null} > { > JournalID: string, > JournalDate: string, > JournalNumber: number, > CreatedDateUTC: string, > JournalLines?: { > }[] > }[] > ``` *** ## Manual Journals ### get `manualJournals.get` Retrieve a specific manual journal by ID from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.manualJournals.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `manualJournalId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ManualJournals` | `object[]` | Yes | — | > **ManualJournals full type** > > ```ts theme={null} > { > ManualJournalID: string, > Narration: string, > Date?: string, > Status?: string, > Lines?: { > }[] > }[] > ``` *** ### list `manualJournals.list` Retrieve manual journals from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.manualJournals.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ManualJournals` | `object[]` | Yes | — | > **ManualJournals full type** > > ```ts theme={null} > { > ManualJournalID: string, > Narration: string, > Date?: string, > Status?: string > }[] > ``` *** ## Organisations ### get `organisations.get` Retrieve organisation details from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.organisations.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Organisations` | `object[]` | Yes | — | > **Organisations full type** > > ```ts theme={null} > { > OrganisationID?: string, > Name: string, > LegalName?: string, > PaysTax?: boolean, > Version?: string, > OrganisationType?: string, > BaseCurrency?: string, > CountryCode?: string, > Timezone?: string, > SalesTaxBasis?: string, > SalesTaxPeriod?: string > }[] > ``` *** ## Payments ### create `payments.create` Create a payment linking invoice and bank account in Xero **Risk:** `write` ```ts theme={null} await corsair.xero.api.payments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `Invoice` | `object` | Yes | — | | `Account` | `object` | Yes | — | | `Amount` | `number` | Yes | — | | `Date` | `string` | No | — | | `Reference` | `string` | No | — | > **Invoice full type** > > ```ts theme={null} > { > InvoiceID?: string, > InvoiceNumber?: string > } > ``` > **Account full type** > > ```ts theme={null} > { > AccountID?: string, > Code?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `Payments` | `object[]` | Yes | — | > **Payments full type** > > ```ts theme={null} > { > PaymentID: string, > Date?: string, > Amount?: number, > Reference?: string, > CurrencyRate?: number, > PaymentType?: string, > Status?: string, > UpdatedDateUTC?: string, > Invoice?: { > InvoiceID: string, > InvoiceNumber?: string > }, > Account?: { > AccountID: string, > Code?: string > } > }[] > ``` *** ### list `payments.list` Retrieve list of payments from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.payments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Payments` | `object[]` | Yes | — | > **Payments full type** > > ```ts theme={null} > { > PaymentID: string, > Date?: string, > Amount?: number, > Reference?: string, > CurrencyRate?: number, > PaymentType?: string, > Status?: string, > UpdatedDateUTC?: string, > Invoice?: { > InvoiceID: string, > InvoiceNumber?: string > }, > Account?: { > AccountID: string, > Code?: string > } > }[] > ``` *** ## Projects ### get `projects.get` Retrieve a specific project by ID from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.projects.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `projectId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `projectId` | `string` | Yes | — | | `contactId` | `string` | No | — | | `name` | `string` | Yes | — | | `currencyCode` | `string` | No | — | | `deadlineUtc` | `string` | No | — | | `totalTaskAmount` | `number` | No | — | | `totalExpenseAmount` | `number` | No | — | | `estimateAmount` | `number` | No | — | | `status` | `string` | No | — | *** ### list `projects.list` Retrieve projects from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.projects.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | | `contactId` | `string` | No | — | | `states` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `items` | `object[]` | Yes | — | | `pagination` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > projectId: string, > name: string, > contactId?: string, > status?: string > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` *** ## Purchase Orders ### create `purchaseOrders.create` Create a purchase order in Xero **Risk:** `write` ```ts theme={null} await corsair.xero.api.purchaseOrders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `Contact` | `object` | Yes | — | | `LineItems` | `object[]` | Yes | — | | `Date` | `string` | No | — | | `DeliveryDate` | `string` | No | — | | `Reference` | `string` | No | — | | `Status` | `DRAFT \| SUBMITTED \| AUTHORISED \| BILLED` | No | — | > **Contact full type** > > ```ts theme={null} > { > ContactID?: string, > Name?: string > } > ``` > **LineItems full type** > > ```ts theme={null} > { > Description?: string, > Quantity?: number, > UnitAmount?: number, > ItemCode?: string, > AccountCode?: string, > TaxType?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `PurchaseOrders` | `object[]` | Yes | — | > **PurchaseOrders full type** > > ```ts theme={null} > { > PurchaseOrderID: string, > PurchaseOrderNumber?: string, > Date?: string, > DeliveryDate?: string, > Reference?: string, > Status?: string, > Total?: number, > SubTotal?: number, > TotalTax?: number, > Contact?: { > ContactID: string, > Name?: string > }, > UpdatedDateUTC?: string > }[] > ``` *** ### get `purchaseOrders.get` Retrieve a specific purchase order by ID from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.purchaseOrders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `purchaseOrderId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `PurchaseOrders` | `object[]` | Yes | — | > **PurchaseOrders full type** > > ```ts theme={null} > { > PurchaseOrderID: string, > PurchaseOrderNumber?: string, > Date?: string, > DeliveryDate?: string, > Reference?: string, > Status?: string, > Total?: number, > SubTotal?: number, > TotalTax?: number, > Contact?: { > ContactID: string, > Name?: string > }, > UpdatedDateUTC?: string > }[] > ``` *** ### list `purchaseOrders.list` Retrieve list of purchase orders from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.purchaseOrders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | | `status` | `string` | No | — | | `dateFrom` | `string` | No | — | | `dateTo` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `PurchaseOrders` | `object[]` | Yes | — | > **PurchaseOrders full type** > > ```ts theme={null} > { > PurchaseOrderID: string, > PurchaseOrderNumber?: string, > Date?: string, > DeliveryDate?: string, > Reference?: string, > Status?: string, > Total?: number, > SubTotal?: number, > TotalTax?: number, > Contact?: { > ContactID: string, > Name?: string > }, > UpdatedDateUTC?: string > }[] > ``` *** ## Quotes ### list `quotes.list` Retrieve a list of quotes from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.quotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | | `dateFrom` | `string` | No | — | | `dateTo` | `string` | No | — | | `expiryDateFrom` | `string` | No | — | | `expiryDateTo` | `string` | No | — | | `status` | `string` | No | — | | `contactID` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Quotes` | `object[]` | Yes | — | > **Quotes full type** > > ```ts theme={null} > { > QuoteID: string, > QuoteNumber?: string, > Reference?: string, > Status?: string, > Total?: number, > SubTotal?: number, > TotalTax?: number, > Date?: string, > ExpiryDate?: string, > Contact?: { > ContactID: string, > Name?: string > }, > UpdatedDateUTC?: string > }[] > ``` *** ## Reports ### getBalanceSheet `reports.getBalanceSheet` Retrieve Balance Sheet report from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.reports.getBalanceSheet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `date` | `string` | No | — | | `periods` | `number` | No | — | | `timeframe` | `MONTH \| QUARTER \| YEAR` | No | — | | `trackingCategoryID` | `string` | No | — | | `trackingOptionID` | `string` | No | — | | `paymentsOnly` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Reports` | `object[]` | Yes | — | > **Reports full type** > > ```ts theme={null} > { > ReportID?: string, > ReportName?: string, > ReportType?: string, > ReportDate?: string, > Rows?: { > }[] > }[] > ``` *** ### getProfitLoss `reports.getProfitLoss` Retrieve Profit & Loss report from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.reports.getProfitLoss({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tenantId` | `string` | No | — | | `fromDate` | `string` | No | — | | `toDate` | `string` | No | — | | `periods` | `number` | No | — | | `timeframe` | `MONTH \| QUARTER \| YEAR` | No | — | | `trackingCategoryID` | `string` | No | — | | `trackingOptionID` | `string` | No | — | | `paymentsOnly` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `Reports` | `object[]` | Yes | — | > **Reports full type** > > ```ts theme={null} > { > ReportID?: string, > ReportName?: string, > ReportType?: string, > ReportDate?: string, > Rows?: { > }[] > }[] > ``` *** ## Tax Rates ### list `taxRates.list` Retrieve tax rates from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.taxRates.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `TaxRates` | `object[]` | Yes | — | > **TaxRates full type** > > ```ts theme={null} > { > Name: string, > TaxType: string, > Status?: string, > EffectiveRate?: number, > CanApplyToAssets?: boolean, > CanApplyToEquity?: boolean, > CanApplyToExpenses?: boolean, > CanApplyToLiabilities?: boolean, > CanApplyToRevenue?: boolean > }[] > ``` *** ## Tracking Categories ### list `trackingCategories.list` Retrieve tracking categories from Xero **Risk:** `read` ```ts theme={null} await corsair.xero.api.trackingCategories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `pageSize` | `number` | No | — | | `where` | `string` | No | — | | `order` | `string` | No | — | | `tenantId` | `string` | No | — | | `includeArchived` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `TrackingCategories` | `object[]` | Yes | — | > **TrackingCategories full type** > > ```ts theme={null} > { > TrackingCategoryID: string, > Name: string, > Status?: string, > Options?: { > TrackingOptionID?: string, > Name: string, > Status?: string > }[] > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/xero/database Xero local sync: searchable entities, `.search()` filters, and operators. The Xero plugin syncs data locally. Use `corsair.xero.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Accounts Path: `xero.db.accounts.search` ```ts theme={null} const rows = await corsair.xero.db.accounts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `AccountID` | `string` | equals, contains, startsWith, endsWith, in | | `Code` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `Type` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `TaxType` | `string` | equals, contains, startsWith, endsWith, in | | `Class` | `string` | equals, contains, startsWith, endsWith, in | | `BankAccountNumber` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencyCode` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Bank Transactions Path: `xero.db.bankTransactions.search` ```ts theme={null} const rows = await corsair.xero.db.bankTransactions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `BankTransactionID` | `string` | equals, contains, startsWith, endsWith, in | | `Date` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `LineAmountTypes` | `string` | equals, contains, startsWith, endsWith, in | | `SubTotal` | `number` | equals, gt, gte, lt, lte, in | | `TotalTax` | `number` | equals, gt, gte, lt, lte, in | | `Total` | `number` | equals, gt, gte, lt, lte, in | | `UpdatedDateUTC` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `xero.db.contacts.search` ```ts theme={null} const rows = await corsair.xero.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ContactID` | `string` | equals, contains, startsWith, endsWith, in | | `ContactNumber` | `string` | equals, contains, startsWith, endsWith, in | | `AccountNumber` | `string` | equals, contains, startsWith, endsWith, in | | `ContactStatus` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `FirstName` | `string` | equals, contains, startsWith, endsWith, in | | `LastName` | `string` | equals, contains, startsWith, endsWith, in | | `EmailAddress` | `string` | equals, contains, startsWith, endsWith, in | | `BankAccountDetails` | `string` | equals, contains, startsWith, endsWith, in | | `TaxNumber` | `string` | equals, contains, startsWith, endsWith, in | | `IsSupplier` | `boolean` | equals | | `IsCustomer` | `boolean` | equals | | `UpdatedDateUTC` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Credit Notes Path: `xero.db.creditNotes.search` ```ts theme={null} const rows = await corsair.xero.db.creditNotes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `CreditNoteID` | `string` | equals, contains, startsWith, endsWith, in | | `CreditNoteNumber` | `string` | equals, contains, startsWith, endsWith, in | | `Type` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `Total` | `number` | equals, gt, gte, lt, lte, in | | `RemainingCredit` | `number` | equals, gt, gte, lt, lte, in | | `UpdatedDateUTC` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invoices Path: `xero.db.invoices.search` ```ts theme={null} const rows = await corsair.xero.db.invoices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `InvoiceID` | `string` | equals, contains, startsWith, endsWith, in | | `Type` | `string` | equals, contains, startsWith, endsWith, in | | `InvoiceNumber` | `string` | equals, contains, startsWith, endsWith, in | | `Reference` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `Date` | `string` | equals, contains, startsWith, endsWith, in | | `DueDate` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencyCode` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencyRate` | `number` | equals, gt, gte, lt, lte, in | | `SubTotal` | `number` | equals, gt, gte, lt, lte, in | | `TotalTax` | `number` | equals, gt, gte, lt, lte, in | | `Total` | `number` | equals, gt, gte, lt, lte, in | | `AmountDue` | `number` | equals, gt, gte, lt, lte, in | | `AmountPaid` | `number` | equals, gt, gte, lt, lte, in | | `UpdatedDateUTC` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Items Path: `xero.db.items.search` ```ts theme={null} const rows = await corsair.xero.db.items.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `ItemID` | `string` | equals, contains, startsWith, endsWith, in | | `Code` | `string` | equals, contains, startsWith, endsWith, in | | `Name` | `string` | equals, contains, startsWith, endsWith, in | | `Description` | `string` | equals, contains, startsWith, endsWith, in | | `PurchaseDescription` | `string` | equals, contains, startsWith, endsWith, in | | `IsSold` | `boolean` | equals | | `IsPurchased` | `boolean` | equals | | `IsTrackedAsInventory` | `boolean` | equals | | `TotalCostPool` | `number` | equals, gt, gte, lt, lte, in | | `QuantityOnHand` | `number` | equals, gt, gte, lt, lte, in | | `UpdatedDateUTC` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Payments Path: `xero.db.payments.search` ```ts theme={null} const rows = await corsair.xero.db.payments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `PaymentID` | `string` | equals, contains, startsWith, endsWith, in | | `Date` | `string` | equals, contains, startsWith, endsWith, in | | `Amount` | `number` | equals, gt, gte, lt, lte, in | | `Reference` | `string` | equals, contains, startsWith, endsWith, in | | `CurrencyRate` | `number` | equals, gt, gte, lt, lte, in | | `PaymentType` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `UpdatedDateUTC` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Purchase Orders Path: `xero.db.purchaseOrders.search` ```ts theme={null} const rows = await corsair.xero.db.purchaseOrders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `PurchaseOrderID` | `string` | equals, contains, startsWith, endsWith, in | | `PurchaseOrderNumber` | `string` | equals, contains, startsWith, endsWith, in | | `Date` | `string` | equals, contains, startsWith, endsWith, in | | `DeliveryDate` | `string` | equals, contains, startsWith, endsWith, in | | `Reference` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `Total` | `number` | equals, gt, gte, lt, lte, in | | `SubTotal` | `number` | equals, gt, gte, lt, lte, in | | `TotalTax` | `number` | equals, gt, gte, lt, lte, in | | `UpdatedDateUTC` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Quotes Path: `xero.db.quotes.search` ```ts theme={null} const rows = await corsair.xero.db.quotes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `QuoteID` | `string` | equals, contains, startsWith, endsWith, in | | `QuoteNumber` | `string` | equals, contains, startsWith, endsWith, in | | `Reference` | `string` | equals, contains, startsWith, endsWith, in | | `Status` | `string` | equals, contains, startsWith, endsWith, in | | `Total` | `number` | equals, gt, gte, lt, lte, in | | `SubTotal` | `number` | equals, gt, gte, lt, lte, in | | `TotalTax` | `number` | equals, gt, gte, lt, lte, in | | `Date` | `string` | equals, contains, startsWith, endsWith, in | | `ExpiryDate` | `string` | equals, contains, startsWith, endsWith, in | | `UpdatedDateUTC` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/xero/overview Xero plugin for Corsair Use **Xero** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 39 typed API operations * 9 synced entities (`accounts`, `bankTransactions`, `contacts`, `creditNotes`, `invoices`, `items`, and 3 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/xero ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/xero ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/xero ``` ```bash bun theme={null} bun add corsair @corsair-dev/xero ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { xero } from '@corsair-dev/xero'; export const corsair = createCorsair({ plugins: [ xero(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Xero OAuth app. ```ts theme={null} xero() ``` More: [OAuth 2.0](/concepts/oauth) **API Key** No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key. ```ts theme={null} xero({ authType: 'api_key', }) ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'xero', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`accounts.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.xero.api.accounts.get({}); ``` **`attachments.upload`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.xero.api.attachments.upload({}); ``` See the full list on the [API](/plugins/xero/api) page. ## Query synced data Synced entities support `tenant.xero.db..search()` and `.list()`: `accounts`, `bankTransactions`, `contacts`, `creditNotes`, `invoices`, `items`, `payments`, `purchaseOrders`, `quotes`. See [Database](/plugins/xero/database) for filters and operators. ## What's next > **[API reference](/plugins/xero/api)** > > Every `xero.api.*` operation with input and output types. > **[Database](/plugins/xero/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/xquik/api API reference for Xquik: every `xquik.api.*` operation with input and output types. Every `xquik.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Media ### download `media.download` Download images and videos from one or more tweets **Risk:** `read` ```ts theme={null} await corsair.xquik.api.media.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | No | — | | `tweetIds` | `string[]` | No | — | | `tweetInput` | `string` | No | — | | `tweetUrl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `cacheHit` | `boolean` | No | — | | `galleryUrl` | `string` | No | — | | `totalMedia` | `number` | No | — | | `totalTweets` | `number` | No | — | | `tweetId` | `string` | No | — | *** ### uploadFromUrl `media.uploadFromUrl` Upload public media URLs for use in Xquik tweet creation **Risk:** `write` ```ts theme={null} await corsair.xquik.api.media.uploadFromUrl({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | — | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `mediaId` | `string` | Yes | — | | `mediaUrl` | `string` | Yes | — | | `success` | `true` | Yes | — | *** ## Trends ### get `trends.get` Get trending X topics by WOEID region **Risk:** `read` ```ts theme={null} await corsair.xquik.api.trends.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | No | — | | `woeid` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `number` | Yes | — | | `trends` | `object[]` | Yes | — | | `woeid` | `number` | Yes | — | > **trends full type** > > ```ts theme={null} > { > description?: string, > name: string, > query?: string, > rank?: number > }[] > ``` *** ## Tweets ### batch `tweets.batch` Fetch up to 100 tweets by ID **Risk:** `read` ```ts theme={null} await corsair.xquik.api.tweets.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `has_next_page` | `boolean` | Yes | — | | `next_cursor` | `string` | No | — | | `tweets` | `object[]` | Yes | — | > **tweets full type** > > ```ts theme={null} > { > author?: { > coverPicture?: string, > createdAt?: string, > description?: string, > followers?: number, > following?: number, > id: string, > location?: string, > name: string, > profilePicture?: string, > statusesCount?: number, > username: string, > verified?: boolean > }, > bookmarkCount?: number, > conversationId?: string, > createdAt?: string, > entities?: { > }, > id: string, > inReplyToId?: string, > inReplyToUserId?: string, > inReplyToUsername?: string, > isLimitedReply?: boolean, > isNoteTweet?: boolean, > isQuoteStatus?: boolean, > isReply?: boolean, > lang?: string, > likeCount?: number, > media?: { > mediaUrl?: string, > type?: animated_gif | photo | video, > url?: string > }[], > quoteCount?: number, > replyCount?: number, > retweetCount?: number, > source?: string, > text: string, > type?: string, > url?: string, > viewCount?: number > }[] > ``` *** ### create `tweets.create` Create a tweet or reply from a connected X account **Risk:** `write` ```ts theme={null} await corsair.xquik.api.tweets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | — | | `attachment_url` | `string` | No | — | | `community_id` | `string` | No | — | | `is_note_tweet` | `boolean` | No | — | | `media` | `string[]` | No | — | | `reply_to_tweet_id` | `string` | No | — | | `text` | `string` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > success: true, > tweetId: string > } | { > charged: boolean, > error: x_write_unconfirmed, > message?: string, > retryable: false, > status: pending_confirmation, > writeActionId: string > } > ``` *** ### delete `tweets.delete` Delete a tweet from a connected X account **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.xquik.api.tweets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### get `tweets.get` Get a tweet with full text, author, metrics, and media **Risk:** `read` ```ts theme={null} await corsair.xquik.api.tweets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `author` | `object` | No | — | | `tweet` | `object` | Yes | — | > **author full type** > > ```ts theme={null} > { > followers: number, > id: string, > profilePicture?: string, > username: string, > verified: boolean > } > ``` > **tweet full type** > > ```ts theme={null} > { > bookmarkCount: number, > conversationId?: string, > createdAt?: string, > entities?: { > }, > id: string, > isNoteTweet?: boolean, > isQuoteStatus?: boolean, > isReply?: boolean, > likeCount: number, > media?: { > mediaUrl?: string, > type?: animated_gif | photo | video, > url?: string > }[], > quoteCount: number, > replyCount: number, > retweetCount: number, > source?: string, > text: string, > viewCount: number > } > ``` *** ### like `tweets.like` Like a tweet from a connected X account **Risk:** `write` ```ts theme={null} await corsair.xquik.api.tweets.like({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### retweet `tweets.retweet` Retweet a tweet from a connected X account **Risk:** `write` ```ts theme={null} await corsair.xquik.api.tweets.retweet({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### search `tweets.search` Search tweets with X query operators and pagination **Risk:** `read` ```ts theme={null} await corsair.xquik.api.tweets.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `anyWords` | `string` | No | — | | `cashtags` | `string` | No | — | | `conversationId` | `string` | No | — | | `exactPhrase` | `string` | No | — | | `excludeWords` | `string` | No | — | | `fromUser` | `string` | No | — | | `hashtags` | `string` | No | — | | `inReplyToTweetId` | `string` | No | — | | `language` | `string` | No | — | | `mediaType` | `gifs \| images \| links \| media \| none \| videos` | No | — | | `mentioning` | `string` | No | — | | `minFaves` | `number` | No | — | | `minQuotes` | `number` | No | — | | `minReplies` | `number` | No | — | | `minRetweets` | `number` | No | — | | `quotes` | `exclude \| include \| only` | No | — | | `quotesOfTweetId` | `string` | No | — | | `replies` | `exclude \| include \| only` | No | — | | `retweets` | `exclude \| include \| only` | No | — | | `retweetsOfTweetId` | `string` | No | — | | `sinceDate` | `string` | No | — | | `toUser` | `string` | No | — | | `untilDate` | `string` | No | — | | `url` | `string` | No | — | | `verifiedOnly` | `boolean` | No | — | | `cursor` | `string` | No | — | | `limit` | `number` | No | — | | `q` | `string` | Yes | — | | `queryType` | `Latest \| Top` | No | — | | `sinceTime` | `string` | No | — | | `untilTime` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `has_next_page` | `boolean` | Yes | — | | `next_cursor` | `string` | No | — | | `tweets` | `object[]` | Yes | — | > **tweets full type** > > ```ts theme={null} > { > author?: { > coverPicture?: string, > createdAt?: string, > description?: string, > followers?: number, > following?: number, > id: string, > location?: string, > name: string, > profilePicture?: string, > statusesCount?: number, > username: string, > verified?: boolean > }, > bookmarkCount?: number, > conversationId?: string, > createdAt?: string, > entities?: { > }, > id: string, > inReplyToId?: string, > inReplyToUserId?: string, > inReplyToUsername?: string, > isLimitedReply?: boolean, > isNoteTweet?: boolean, > isQuoteStatus?: boolean, > isReply?: boolean, > lang?: string, > likeCount?: number, > media?: { > mediaUrl?: string, > type?: animated_gif | photo | video, > url?: string > }[], > quoteCount?: number, > replyCount?: number, > retweetCount?: number, > source?: string, > text: string, > type?: string, > url?: string, > viewCount?: number > }[] > ``` *** ### unlike `tweets.unlike` Remove a like from a connected X account **Risk:** `write` ```ts theme={null} await corsair.xquik.api.tweets.unlike({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ## Users ### batch `users.batch` Look up up to 100 X users by ID **Risk:** `read` ```ts theme={null} await corsair.xquik.api.users.batch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `has_next_page` | `boolean` | Yes | — | | `next_cursor` | `string` | No | — | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > coverPicture?: string, > createdAt?: string, > description?: string, > followers?: number, > following?: number, > id: string, > location?: string, > name: string, > profilePicture?: string, > statusesCount?: number, > username: string, > verified?: boolean > }[] > ``` *** ### follow `users.follow` Follow an X user from a connected account **Risk:** `write` ```ts theme={null} await corsair.xquik.api.users.follow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### followers `users.followers` List followers of an X user **Risk:** `read` ```ts theme={null} await corsair.xquik.api.users.followers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `cursor` | `string` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `has_next_page` | `boolean` | Yes | — | | `next_cursor` | `string` | No | — | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > coverPicture?: string, > createdAt?: string, > description?: string, > followers?: number, > following?: number, > id: string, > location?: string, > name: string, > profilePicture?: string, > statusesCount?: number, > username: string, > verified?: boolean > }[] > ``` *** ### following `users.following` List accounts an X user follows **Risk:** `read` ```ts theme={null} await corsair.xquik.api.users.following({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `cursor` | `string` | No | — | | `pageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `has_next_page` | `boolean` | Yes | — | | `next_cursor` | `string` | No | — | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > coverPicture?: string, > createdAt?: string, > description?: string, > followers?: number, > following?: number, > id: string, > location?: string, > name: string, > profilePicture?: string, > statusesCount?: number, > username: string, > verified?: boolean > }[] > ``` *** ### get `users.get` Get an X user profile by username or user ID **Risk:** `read` ```ts theme={null} await corsair.xquik.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `coverPicture` | `string` | No | — | | `createdAt` | `string` | No | — | | `description` | `string` | No | — | | `followers` | `number` | No | — | | `following` | `number` | No | — | | `id` | `string` | Yes | — | | `location` | `string` | No | — | | `name` | `string` | Yes | — | | `profilePicture` | `string` | No | — | | `statusesCount` | `number` | No | — | | `username` | `string` | Yes | — | | `verified` | `boolean` | No | — | *** ### search `users.search` Search X users by name or username **Risk:** `read` ```ts theme={null} await corsair.xquik.api.users.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | — | | `q` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `has_next_page` | `boolean` | Yes | — | | `next_cursor` | `string` | No | — | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > coverPicture?: string, > createdAt?: string, > description?: string, > followers?: number, > following?: number, > id: string, > location?: string, > name: string, > profilePicture?: string, > statusesCount?: number, > username: string, > verified?: boolean > }[] > ``` *** ### tweets `users.tweets` List recent tweets posted by an X user **Risk:** `read` ```ts theme={null} await corsair.xquik.api.users.tweets({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `cursor` | `string` | No | — | | `pageSize` | `number` | No | — | | `anyWords` | `string` | No | — | | `cashtags` | `string` | No | — | | `conversationId` | `string` | No | — | | `exactPhrase` | `string` | No | — | | `excludeWords` | `string` | No | — | | `fromUser` | `string` | No | — | | `hashtags` | `string` | No | — | | `inReplyToTweetId` | `string` | No | — | | `language` | `string` | No | — | | `mediaType` | `gifs \| images \| links \| media \| none \| videos` | No | — | | `mentioning` | `string` | No | — | | `minFaves` | `number` | No | — | | `minQuotes` | `number` | No | — | | `minReplies` | `number` | No | — | | `minRetweets` | `number` | No | — | | `quotes` | `exclude \| include \| only` | No | — | | `quotesOfTweetId` | `string` | No | — | | `replies` | `exclude \| include \| only` | No | — | | `retweets` | `exclude \| include \| only` | No | — | | `retweetsOfTweetId` | `string` | No | — | | `sinceDate` | `string` | No | — | | `toUser` | `string` | No | — | | `untilDate` | `string` | No | — | | `url` | `string` | No | — | | `verifiedOnly` | `boolean` | No | — | | `includeParentTweet` | `boolean` | No | — | | `includeReplies` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `has_next_page` | `boolean` | Yes | — | | `next_cursor` | `string` | No | — | | `tweets` | `object[]` | Yes | — | > **tweets full type** > > ```ts theme={null} > { > author?: { > coverPicture?: string, > createdAt?: string, > description?: string, > followers?: number, > following?: number, > id: string, > location?: string, > name: string, > profilePicture?: string, > statusesCount?: number, > username: string, > verified?: boolean > }, > bookmarkCount?: number, > conversationId?: string, > createdAt?: string, > entities?: { > }, > id: string, > inReplyToId?: string, > inReplyToUserId?: string, > inReplyToUsername?: string, > isLimitedReply?: boolean, > isNoteTweet?: boolean, > isQuoteStatus?: boolean, > isReply?: boolean, > lang?: string, > likeCount?: number, > media?: { > mediaUrl?: string, > type?: animated_gif | photo | video, > url?: string > }[], > quoteCount?: number, > replyCount?: number, > retweetCount?: number, > source?: string, > text: string, > type?: string, > url?: string, > viewCount?: number > }[] > ``` *** ### unfollow `users.unfollow` Unfollow an X user from a connected account **Risk:** `write` ```ts theme={null} await corsair.xquik.api.users.unfollow({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ## Webhooks ### create `webhooks.create` Create an Xquik webhook endpoint subscription **Risk:** `write` ```ts theme={null} await corsair.xquik.api.webhooks.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `eventTypes` | `tweet.new \| tweet.quote \| tweet.reply \| tweet.retweet[]` | Yes | — | | `url` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdAt` | `string` | Yes | — | | `eventTypes` | `tweet.new \| tweet.quote \| tweet.reply \| tweet.retweet[]` | Yes | — | | `id` | `string` | Yes | — | | `isActive` | `boolean` | Yes | — | | `url` | `string` | Yes | — | | `secret` | `string` | Yes | — | *** ### deactivate `webhooks.deactivate` Deactivate an Xquik webhook endpoint **Risk:** `write` ```ts theme={null} await corsair.xquik.api.webhooks.deactivate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `true` | Yes | — | *** ### deliveries `webhooks.deliveries` List delivery attempts for an Xquik webhook endpoint **Risk:** `read` ```ts theme={null} await corsair.xquik.api.webhooks.deliveries({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deliveries` | `object[]` | Yes | — | > **deliveries full type** > > ```ts theme={null} > { > attempts: number, > createdAt: string, > deliveredAt?: string, > id: string, > lastError?: string, > lastStatusCode?: number, > status: string, > streamEventId: string > }[] > ``` *** ### list `webhooks.list` List configured Xquik webhook endpoints **Risk:** `read` ```ts theme={null} await corsair.xquik.api.webhooks.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `webhooks` | `object[]` | Yes | — | > **webhooks full type** > > ```ts theme={null} > { > createdAt: string, > eventTypes: tweet.new | tweet.quote | tweet.reply | tweet.retweet[], > id: string, > isActive: boolean, > url: string > }[] > ``` *** ### test `webhooks.test` Send a test delivery to an Xquik webhook endpoint **Risk:** `write` ```ts theme={null} await corsair.xquik.api.webhooks.test({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `error` | `string` | No | — | | `statusCode` | `number` | Yes | — | | `success` | `boolean` | Yes | — | *** ### update `webhooks.update` Update a Xquik webhook URL, event types, or active state **Risk:** `write` ```ts theme={null} await corsair.xquik.api.webhooks.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `eventTypes` | `tweet.new \| tweet.quote \| tweet.reply \| tweet.retweet[]` | No | — | | `id` | `string` | Yes | — | | `isActive` | `boolean` | No | — | | `url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `createdAt` | `string` | Yes | — | | `eventTypes` | `tweet.new \| tweet.quote \| tweet.reply \| tweet.retweet[]` | Yes | — | | `id` | `string` | Yes | — | | `isActive` | `boolean` | Yes | — | | `url` | `string` | Yes | — | *** ## Write Actions ### get `writeActions.get` Check the status of a pending Xquik write action **Risk:** `read` ```ts theme={null} await corsair.xquik.api.writeActions.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `action` | `string` | Yes | — | | `charged` | `boolean` | Yes | — | | `confirmationAttempts` | `number` | No | — | | `confirmationCheckedAt` | `string` | No | — | | `confirmationSource` | `string` | No | — | | `confirmedAt` | `string` | No | — | | `createdAt` | `string` | Yes | — | | `message` | `string` | No | — | | `messageId` | `string` | No | — | | `retryable` | `boolean` | Yes | — | | `sendDispatched` | `boolean` | Yes | — | | `sendDispatchedAt` | `string` | No | — | | `status` | `failed \| pending_confirmation \| success` | Yes | — | | `targetId` | `string` | No | — | | `tweetId` | `string` | No | — | | `writeActionId` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/xquik/database Xquik local sync: searchable entities, `.search()` filters, and operators. The Xquik plugin syncs data locally. Use `corsair.xquik.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Deliveries Path: `xquik.db.deliveries.search` ```ts theme={null} const rows = await corsair.xquik.db.deliveries.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `attempts` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `deliveredAt` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `lastError` | `string` | equals, contains, startsWith, endsWith, in | | `lastStatusCode` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `streamEventId` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Events Path: `xquik.db.events.search` ```ts theme={null} const rows = await corsair.xquik.db.events.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `deliveryId` | `string` | equals, contains, startsWith, endsWith, in | | `occurredAt` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `schemaVersion` | `string` | equals, contains, startsWith, endsWith, in | | `streamEventId` | `string` | equals, contains, startsWith, endsWith, in | | `timestamp` | `string` | equals, contains, startsWith, endsWith, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tweets Path: `xquik.db.tweets.search` ```ts theme={null} const rows = await corsair.xquik.db.tweets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `xquik.db.users.search` ```ts theme={null} const rows = await corsair.xquik.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `coverPicture` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `followers` | `number` | equals, gt, gte, lt, lte, in | | `following` | `number` | equals, gt, gte, lt, lte, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `profilePicture` | `string` | equals, contains, startsWith, endsWith, in | | `statusesCount` | `number` | equals, gt, gte, lt, lte, in | | `username` | `string` | equals, contains, startsWith, endsWith, in | | `verified` | `boolean` | equals | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webhooks Path: `xquik.db.webhooks.search` ```ts theme={null} const rows = await corsair.xquik.db.webhooks.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `isActive` | `boolean` | equals | | `url` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/xquik/get-credentials Step-by-step instructions for connecting Xquik API keys and webhook secrets to Corsair. This guide shows how to connect Xquik to Corsair with API key authentication. ## Authentication Method The Xquik plugin uses API key authentication. * **[`api_key`](/concepts/api-key)** (default) - sends the key as the `x-api-key` header ## API Key Setup ### Step 1: Create an API Key 1. Sign in to the [Xquik dashboard](https://dashboard.xquik.com). 2. Open the API keys area. 3. Create a key for your Corsair integration. 4. Copy the key and store it securely. ### Step 2: Store the Key in Corsair Use the Corsair CLI: ```bash theme={null} pnpm corsair setup --plugin=xquik api_key=your-xquik-api-key ``` Or pass the key directly in code: ```ts corsair.ts theme={null} xquik({ key: process.env.XQUIK_API_KEY, }) ``` ## Webhook Secret When you create an Xquik webhook endpoint, Xquik returns the HMAC signing secret once in the create response. Store that value in Corsair so incoming deliveries can be verified. ```bash theme={null} pnpm corsair setup --plugin=xquik webhook_signature=your-xquik-webhook-secret ``` Or pass it directly in code: ```ts corsair.ts theme={null} xquik({ webhookSecret: process.env.XQUIK_WEBHOOK_SECRET, }) ``` Xquik webhook deliveries include `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce` headers. The plugin verifies the signature over the raw request body before handling monitor events. ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | API Key | API calls | Xquik dashboard API keys | | Webhook Secret | Incoming webhooks | Returned when creating an Xquik webhook endpoint | For the public REST API surface, see the [Xquik API overview](https://docs.xquik.com/api-reference/overview). # Overview Source: https://docs.corsair.dev/plugins/xquik/overview X/Twitter automation API for searching tweets, managing webhooks, and social account actions. Use **Xquik** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 26 typed API operations * 5 synced entities (`deliveries`, `events`, `tweets`, `users`, `webhooks`) for fast `.search()` / `.list()` * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/xquik ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/xquik ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/xquik ``` ```bash bun theme={null} bun add corsair @corsair-dev/xquik ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { xquik } from '@corsair-dev/xquik'; export const corsair = createCorsair({ plugins: [ xquik(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. Provider walkthrough: [Get Credentials](/plugins/xquik/get-credentials). ```ts theme={null} xquik() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'xquik', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`media.download`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.xquik.api.media.download({}); ``` **`media.uploadFromUrl`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.xquik.api.media.uploadFromUrl({}); ``` See the full list on the [API](/plugins/xquik/api) page. ## Query synced data Synced entities support `tenant.xquik.db..search()` and `.list()`: `deliveries`, `events`, `tweets`, `users`, `webhooks`. See [Database](/plugins/xquik/database) for filters and operators. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/xquik/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/xquik/api)** > > Every `xquik.api.*` operation with input and output types. > **[Database](/plugins/xquik/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/xquik/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/xquik/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/xquik/webhooks Xquik incoming webhooks: event paths, payloads, and response data. The Xquik plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/xquik/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `events` * `monitor` (`events.monitor`) * `test` (`events.test`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Events ### Monitor `events.monitor` Handle a signed Xquik monitor event delivery **Payload** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `deliveryId` | `string` | No | — | | `eventType` | `tweet.new \| tweet.quote \| tweet.reply \| tweet.retweet \| webhook.test` | Yes | — | | `occurredAt` | `string` | No | — | | `query` | `string` | No | — | | `schemaVersion` | `string` | No | — | | `streamEventId` | `string` | No | — | | `timestamp` | `string` | No | — | | `username` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > data: { > }, > deliveryId?: string, > eventType: tweet.new | tweet.quote | tweet.reply | tweet.retweet | webhook.test, > occurredAt?: string, > query?: string, > schemaVersion?: string, > streamEventId?: string, > timestamp?: string, > username?: string > } > ``` **`webhookHooks` example** ```ts theme={null} xquik({ webhookHooks: { events: { monitor: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Test `events.test` Handle a signed Xquik test webhook delivery **Payload** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object` | Yes | — | | `deliveryId` | `string` | No | — | | `eventType` | `tweet.new \| tweet.quote \| tweet.reply \| tweet.retweet \| webhook.test` | Yes | — | | `occurredAt` | `string` | No | — | | `query` | `string` | No | — | | `schemaVersion` | `string` | No | — | | `streamEventId` | `string` | No | — | | `timestamp` | `string` | No | — | | `username` | `string` | No | — | > **data full type** > > ```ts theme={null} > { > } > ``` > **Response data full type** > > ```ts theme={null} > { > data: { > }, > deliveryId?: string, > eventType: tweet.new | tweet.quote | tweet.reply | tweet.retweet | webhook.test, > occurredAt?: string, > query?: string, > schemaVersion?: string, > streamEventId?: string, > timestamp?: string, > username?: string > } > ``` **`webhookHooks` example** ```ts theme={null} xquik({ webhookHooks: { events: { test: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/youcom/api API reference for You.com: every `youcom.api.*` operation with input and output types. Every `youcom.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Yousearch ### youSearch `yousearch.youSearch` Search the web using You.com's search API. Returns LLM-ready web results and news articles. **Risk:** `read` ```ts theme={null} await corsair.youcom.api.yousearch.youSearch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | — | | `count` | `number` | No | — | | `freshness` | `day \| week \| month \| year \| string` | No | — | | `offset` | `number` | No | — | | `country` | `AR \| AU \| AT \| BE \| BR \| CA \| CL \| DK \| FI \| FR \| DE \| HK \| IN \| ID \| IT \| JP \| KR \| MY \| MX \| NL \| NZ \| NO \| CN \| PL \| PT \| PH \| RU \| SA \| ZA \| ES \| SE \| CH \| TW \| TR \| GB \| US` | No | — | | `language` | `AR \| EU \| BN \| BG \| CA \| ZH-HANS \| ZH-HANT \| HR \| CS \| DA \| NL \| EN \| EN-GB \| ET \| FI \| FR \| GL \| DE \| EL \| GU \| HE \| HI \| HU \| IS \| IT \| JA \| KN \| KO \| LV \| LT \| MS \| ML \| MR \| NB \| PL \| PT-BR \| PT-PT \| PA \| RO \| RU \| SR \| SK \| SL \| ES \| SV \| TA \| TE \| TH \| TR \| UK \| VI` | No | — | | `safesearch` | `off \| moderate \| strict` | No | — | | `livecrawl` | `web \| news \| all` | No | — | | `livecrawl_formats` | `html \| markdown[]` | No | — | | `include_domains` | `string[]` | No | — | | `exclude_domains` | `string[]` | No | — | | `boost_domains` | `string[]` | No | — | | `crawl_timeout` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `results` | `object` | Yes | — | | `metadata` | `object` | Yes | — | > **results full type** > > ```ts theme={null} > { > web?: { > url: string, > title: string, > description?: string, > snippets?: string[], > thumbnail_url?: string, > page_age?: string, > contents?: { > html?: string, > markdown?: string > }, > favicon_url?: string > }[], > news?: { > title: string, > description?: string, > page_age?: string, > thumbnail_url?: string, > url: string, > contents?: { > html?: string, > markdown?: string > } > }[] > } > ``` > **metadata full type** > > ```ts theme={null} > { > search_uuid: string, > query: string, > latency: number > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/youcom/database You.com local sync: searchable entities, `.search()` filters, and operators. The You.com plugin syncs data locally. Use `corsair.youcom.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Search Results Path: `youcom.db.searchResults.search` ```ts theme={null} const rows = await corsair.youcom.db.searchResults.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `thumbnail_url` | `string` | equals, contains, startsWith, endsWith, in | | `page_age` | `string` | equals, contains, startsWith, endsWith, in | | `favicon_url` | `string` | equals, contains, startsWith, endsWith, in | | `query` | `string` | equals, contains, startsWith, endsWith, in | | `searchedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/youcom/overview AI search engine API for web answers, citations, and research-oriented query results. Use **You.com** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 1 typed API operations * 1 synced entity (`searchResults`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/youcom ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/youcom ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/youcom ``` ```bash bun theme={null} bun add corsair @corsair-dev/youcom ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { youcom } from '@corsair-dev/youcom'; export const corsair = createCorsair({ plugins: [ youcom(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} youcom() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'youcom', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`yousearch.youSearch`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.youcom.api.yousearch.youSearch({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/youcom/api) reference.* See the full list on the [API](/plugins/youcom/api) page. ## Query synced data Synced entities support `tenant.youcom.db..search()` and `.list()`: `searchResults`. See [Database](/plugins/youcom/database) for filters and operators. ## What's next > **[API reference](/plugins/youcom/api)** > > Every `youcom.api.*` operation with input and output types. > **[Database](/plugins/youcom/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/youtube/api API reference for YouTube: every `youtube.api.*` operation with input and output types. Every `youtube.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Captions ### list `captions.list` List caption tracks for a video **Risk:** `read` ```ts theme={null} await corsair.youtube.api.captions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | The YouTube video ID to list captions for | | `part` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `eventId` | `string` | No | — | | `visitorId` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > videoId?: string, > lastUpdated?: string, > trackKind?: string, > language?: string, > name?: string, > audioTrackType?: string, > isCC?: boolean, > isLarge?: boolean, > isEasyReader?: boolean, > isDraft?: boolean, > isAutoSynced?: boolean, > status?: string > } > }[] > ``` *** ### load `captions.load` Download a caption track **Risk:** `read` ```ts theme={null} await corsair.youtube.api.captions.load({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The caption track ID to download | | `tfmt` | `string` | No | Caption format (srt, vtt, etc.) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `captions_text` | `string` | No | — | *** ### update `captions.update` Update a caption track **Risk:** `write` ```ts theme={null} await corsair.youtube.api.captions.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The caption track ID to update | | `snippet` | `object` | Yes | Updated caption snippet | > **snippet full type** > > ```ts theme={null} > { > isDraft?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > videoId?: string, > lastUpdated?: string, > trackKind?: string, > language?: string, > name?: string, > audioTrackType?: string, > isCC?: boolean, > isLarge?: boolean, > isEasyReader?: boolean, > isDraft?: boolean, > isAutoSynced?: boolean, > status?: string > } > ``` *** ## Channels ### getActivities `channels.getActivities` Get a channel's activity feed **Risk:** `read` ```ts theme={null} await corsair.youtube.api.channels.getActivities({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channelId` | `string` | Yes | The channel ID to get activities for | | `part` | `string` | No | — | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | | `publishedAfter` | `string` | No | RFC 3339 datetime - only return activities after this time | | `publishedBefore` | `string` | No | RFC 3339 datetime - only return activities before this time | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > channelId?: string, > title?: string, > description?: string, > publishedAt?: string, > type?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > } > }, > contentDetails?: { > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### getIdByHandle `channels.getIdByHandle` Get channel ID by handle **Risk:** `read` ```ts theme={null} await corsair.youtube.api.channels.getIdByHandle({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_handle` | `string` | Yes | YouTube channel handle (e.g. @channelname) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `channels` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > customUrl?: string, > publishedAt?: string, > country?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > } > }, > statistics?: { > viewCount?: string, > subscriberCount?: string, > videoCount?: string, > hiddenSubscriberCount?: boolean > }, > contentDetails?: { > relatedPlaylists?: { > uploads?: string, > likes?: string > } > }, > brandingSettings?: { > channel?: { > title?: string, > description?: string, > keywords?: string > } > } > }[] > ``` > **channels full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > customUrl?: string, > publishedAt?: string, > country?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > } > }, > statistics?: { > viewCount?: string, > subscriberCount?: string, > videoCount?: string, > hiddenSubscriberCount?: boolean > }, > contentDetails?: { > relatedPlaylists?: { > uploads?: string, > likes?: string > } > }, > brandingSettings?: { > channel?: { > title?: string, > description?: string, > keywords?: string > } > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### getStatistics `channels.getStatistics` Get channel statistics and details **Risk:** `read` ```ts theme={null} await corsair.youtube.api.channels.getStatistics({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | Channel ID(s), comma-separated | | `mine` | `boolean` | No | Get statistics for the authenticated user's channel | | `part` | `string` | No | — | | `forHandle` | `string` | No | Channel handle (e.g. @channelname) | | `forUsername` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `channels` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > customUrl?: string, > publishedAt?: string, > country?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > } > }, > statistics?: { > viewCount?: string, > subscriberCount?: string, > videoCount?: string, > hiddenSubscriberCount?: boolean > }, > contentDetails?: { > relatedPlaylists?: { > uploads?: string, > likes?: string > } > }, > brandingSettings?: { > channel?: { > title?: string, > description?: string, > keywords?: string > } > } > }[] > ``` > **channels full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > customUrl?: string, > publishedAt?: string, > country?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > } > }, > statistics?: { > viewCount?: string, > subscriberCount?: string, > videoCount?: string, > hiddenSubscriberCount?: boolean > }, > contentDetails?: { > relatedPlaylists?: { > uploads?: string, > likes?: string > } > }, > brandingSettings?: { > channel?: { > title?: string, > description?: string, > keywords?: string > } > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### update `channels.update` Update channel branding settings **Risk:** `write` ```ts theme={null} await corsair.youtube.api.channels.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The channel ID to update | | `part` | `string` | No | — | | `brandingSettings` | `object` | No | — | | `localizations` | `object` | No | — | | `onBehalfOfContentOwner` | `string` | No | — | > **brandingSettings full type** > > ```ts theme={null} > { > channel?: { > title?: string, > description?: string, > keywords?: string, > country?: string > } > } > ``` > **localizations full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | | `statistics` | `object` | No | — | | `brandingSettings` | `object` | No | — | | `localizations` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > title?: string, > description?: string, > customUrl?: string, > publishedAt?: string, > country?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > } > } > ``` > **statistics full type** > > ```ts theme={null} > { > viewCount?: string, > subscriberCount?: string, > videoCount?: string > } > ``` > **brandingSettings full type** > > ```ts theme={null} > { > } > ``` > **localizations full type** > > ```ts theme={null} > { > } > ``` *** ## Channel Sections ### create `channelSections.create` Create a new channel section **Risk:** `write` ```ts theme={null} await corsair.youtube.api.channelSections.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `snippet` | `object` | Yes | Section snippet | | `contentDetails` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > type: allPlaylists | completedEvents | liveEvents | multipleChannels | multiplePlaylists | popularUploads | recentUploads | singlePlaylist | subscriptions | upcomingEvents, > title?: string, > position?: number > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > channels?: string[], > playlists?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | | `contentDetails` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > type?: string, > title?: string, > position?: number, > channelId?: string > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > playlists?: string[], > channels?: string[] > } > ``` *** ### delete `channelSections.delete` Delete a channel section **Risk:** `destructive` ```ts theme={null} await corsair.youtube.api.channelSections.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the channel section to delete | | `onBehalfOfContentOwner` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | | `channel_section_id` | `string` | No | — | | `http_status` | `number` | No | — | | `error` | `string` | No | — | *** ### list `channelSections.list` List channel sections **Risk:** `read` ```ts theme={null} await corsair.youtube.api.channelSections.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `part` | `string` | Yes | Comma-separated list of parts (snippet,contentDetails) | | `hl` | `string` | No | — | | `id` | `string` | No | Section ID(s), comma-separated | | `mine` | `boolean` | No | — | | `channelId` | `string` | No | — | | `onBehalfOfContentOwner` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `eventId` | `string` | No | — | | `visitorId` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > type?: string, > title?: string, > position?: number, > channelId?: string > }, > contentDetails?: { > playlists?: string[], > channels?: string[] > } > }[] > ``` *** ### update `channelSections.update` Update a channel section **Risk:** `write` ```ts theme={null} await corsair.youtube.api.channelSections.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the channel section to update | | `snippet` | `object` | No | — | | `contentDetails` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > type?: string, > title?: string, > position?: number > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > playlists?: string[], > channels?: string[] > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | | `contentDetails` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > type?: string, > title?: string, > position?: number, > channelId?: string > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > playlists?: string[], > channels?: string[] > } > ``` *** ## Comments ### createReply `comments.createReply` Post a reply to a comment **Risk:** `write` ```ts theme={null} await corsair.youtube.api.comments.createReply({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `parentId` | `string` | Yes | The ID of the parent comment thread to reply to | | `textOriginal` | `string` | Yes | The reply text | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > videoId?: string, > textDisplay?: string, > textOriginal?: string, > authorDisplayName?: string, > authorProfileImageUrl?: string, > authorChannelUrl?: string, > authorChannelId?: { > value?: string > }, > likeCount?: number, > publishedAt?: string, > updatedAt?: string, > parentId?: string, > canRate?: boolean, > viewerRating?: string > } > ``` *** ### delete `comments.delete` Delete a comment **Risk:** `destructive` ```ts theme={null} await corsair.youtube.api.comments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the comment to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | | `comment_id` | `string` | No | — | | `http_status` | `number` | No | — | | `error` | `string` | No | — | *** ### list `comments.list` List comments **Risk:** `read` ```ts theme={null} await corsair.youtube.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | Comment ID(s), comma-separated | | `part` | `string` | No | — | | `parentId` | `string` | No | Parent comment thread ID to list replies for | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | | `textFormat` | `html \| plainText` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > videoId?: string, > textDisplay?: string, > textOriginal?: string, > authorDisplayName?: string, > authorProfileImageUrl?: string, > authorChannelUrl?: string, > authorChannelId?: { > value?: string > }, > likeCount?: number, > publishedAt?: string, > updatedAt?: string, > parentId?: string, > canRate?: boolean, > viewerRating?: string > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### markSpam `comments.markSpam` Mark a comment as spam **Risk:** `write` ```ts theme={null} await corsair.youtube.api.comments.markSpam({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the comment to mark as spam | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `comment_ids` | `string[]` | No | — | | `http_status` | `number` | No | — | *** ### post `comments.post` Post a comment on a video **Risk:** `write` ```ts theme={null} await corsair.youtube.api.comments.post({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | The ID of the video to comment on | | `channelId` | `string` | Yes | The channel ID that owns the video | | `textOriginal` | `string` | Yes | The comment text | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > channelId?: string, > videoId?: string, > totalReplyCount?: number, > isPublic?: boolean, > topLevelComment?: { > id?: string, > etag?: string, > kind?: string, > snippet?: { > videoId?: string, > textDisplay?: string, > textOriginal?: string, > authorDisplayName?: string, > authorProfileImageUrl?: string, > authorChannelUrl?: string, > authorChannelId?: { > value?: string > }, > likeCount?: number, > publishedAt?: string, > updatedAt?: string, > parentId?: string, > canRate?: boolean, > viewerRating?: string > } > } > } > ``` *** ### setModerationStatus `comments.setModerationStatus` Set moderation status for a comment **Risk:** `write` ```ts theme={null} await corsair.youtube.api.comments.setModerationStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the comment to moderate | | `moderationStatus` | `heldForReview \| published \| rejected` | Yes | The moderation status to set | | `banAuthor` | `boolean` | No | Ban the author from the channel | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | *** ### threadsList `comments.threadsList` List comment threads (deprecated) **Risk:** `read` ```ts theme={null} await corsair.youtube.api.comments.threadsList({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `part` | `string` | No | — | | `order` | `time \| relevance` | No | — | | `videoId` | `string` | No | — | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | | `textFormat` | `html \| plainText` | No | — | | `searchTerms` | `string` | No | — | | `allThreadsRelatedToChannelId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > channelId?: string, > videoId?: string, > totalReplyCount?: number, > isPublic?: boolean, > topLevelComment?: { > id?: string, > etag?: string, > kind?: string, > snippet?: { > videoId?: string, > textDisplay?: string, > textOriginal?: string, > authorDisplayName?: string, > authorProfileImageUrl?: string, > authorChannelUrl?: string, > authorChannelId?: { > value?: string > }, > likeCount?: number, > publishedAt?: string, > updatedAt?: string, > parentId?: string, > canRate?: boolean, > viewerRating?: string > } > } > }, > replies?: { > comments?: { > id?: string, > etag?: string, > kind?: string, > snippet?: { > videoId?: string, > textDisplay?: string, > textOriginal?: string, > authorDisplayName?: string, > authorProfileImageUrl?: string, > authorChannelUrl?: string, > authorChannelId?: { > value?: string > }, > likeCount?: number, > publishedAt?: string, > updatedAt?: string, > parentId?: string, > canRate?: boolean, > viewerRating?: string > } > }[] > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### threadsList2 `comments.threadsList2` List comment threads **Risk:** `read` ```ts theme={null} await corsair.youtube.api.comments.threadsList2({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `part` | `string` | Yes | Comma-separated list of parts | | `order` | `time \| relevance` | No | — | | `videoId` | `string` | No | — | | `channelId` | `string` | No | — | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | | `textFormat` | `html \| plainText` | No | — | | `searchTerms` | `string` | No | — | | `moderationStatus` | `heldForReview \| likelySpam \| published \| rejected` | No | — | | `allThreadsRelatedToChannelId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > channelId?: string, > videoId?: string, > totalReplyCount?: number, > isPublic?: boolean, > topLevelComment?: { > id?: string, > etag?: string, > kind?: string, > snippet?: { > videoId?: string, > textDisplay?: string, > textOriginal?: string, > authorDisplayName?: string, > authorProfileImageUrl?: string, > authorChannelUrl?: string, > authorChannelId?: { > value?: string > }, > likeCount?: number, > publishedAt?: string, > updatedAt?: string, > parentId?: string, > canRate?: boolean, > viewerRating?: string > } > } > }, > replies?: { > comments?: { > id?: string, > etag?: string, > kind?: string, > snippet?: { > videoId?: string, > textDisplay?: string, > textOriginal?: string, > authorDisplayName?: string, > authorProfileImageUrl?: string, > authorChannelUrl?: string, > authorChannelId?: { > value?: string > }, > likeCount?: number, > publishedAt?: string, > updatedAt?: string, > parentId?: string, > canRate?: boolean, > viewerRating?: string > } > }[] > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### update `comments.update` Update a comment **Risk:** `write` ```ts theme={null} await corsair.youtube.api.comments.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the comment to update | | `textOriginal` | `string` | Yes | The updated comment text | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > videoId?: string, > textDisplay?: string, > textOriginal?: string, > authorDisplayName?: string, > authorProfileImageUrl?: string, > authorChannelUrl?: string, > authorChannelId?: { > value?: string > }, > likeCount?: number, > publishedAt?: string, > updatedAt?: string, > parentId?: string, > canRate?: boolean, > viewerRating?: string > } > ``` *** ## I18n ### listLanguages `i18n.listLanguages` List supported i18n languages **Risk:** `read` ```ts theme={null} await corsair.youtube.api.i18n.listLanguages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hl` | `string` | No | Language to use for the response | | `part` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > hl?: string, > name?: string > } > }[] > ``` *** ### listRegions `i18n.listRegions` List supported i18n regions **Risk:** `read` ```ts theme={null} await corsair.youtube.api.i18n.listRegions({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hl` | `string` | No | — | | `part` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > gl?: string, > name?: string > } > }[] > ``` *** ## Live Chat ### listMessages `liveChat.listMessages` List messages in a live chat **Risk:** `read` ```ts theme={null} await corsair.youtube.api.liveChat.listMessages({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `liveChatId` | `string` | Yes | The ID of the live chat to list messages for | | `hl` | `string` | No | — | | `part` | `string` | No | — | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | | `profileImageSize` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `offlineAt` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `activePollItem` | `any` | No | — | | `pollingIntervalMillis` | `number` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > type?: string, > liveChatId?: string, > authorChannelId?: string, > publishedAt?: string, > hasDisplayContent?: boolean, > displayMessage?: string, > textMessageDetails?: { > messageText?: string > } > }, > authorDetails?: { > channelId?: string, > channelUrl?: string, > displayName?: string, > profileImageUrl?: string, > isVerified?: boolean, > isChatOwner?: boolean, > isChatModerator?: boolean > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### listSuperChatEvents `liveChat.listSuperChatEvents` List Super Chat events **Risk:** `read` ```ts theme={null} await corsair.youtube.api.liveChat.listSuperChatEvents({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hl` | `string` | No | — | | `part` | `string` | No | — | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > snippet?: { > displayString?: string, > amountMicros?: string, > currency?: string, > channelId?: string, > createdAt?: string > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ## Playlist Images ### list `playlistImages.list` List playlist images **Risk:** `read` ```ts theme={null} await corsair.youtube.api.playlistImages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `part` | `string` | No | — | | `parent` | `string` | No | The parent playlist ID | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | | `onBehalfOfContentOwner` | `string` | No | — | | `onBehalfOfContentOwnerChannel` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > kind?: string, > snippet?: { > type?: string, > width?: number, > height?: number, > url?: string > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ## Playlist Items ### add `playlistItems.add` Add a video to a playlist **Risk:** `write` ```ts theme={null} await corsair.youtube.api.playlistItems.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | The YouTube video ID to add to the playlist | | `playlistId` | `string` | Yes | The ID of the playlist to add the video to | | `position` | `number` | No | Zero-based position to insert the video | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | | `status` | `object` | No | — | | `contentDetails` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > title?: string, > description?: string, > position?: number, > channelId?: string, > channelTitle?: string, > playlistId?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > resourceId?: { > kind?: string, > videoId?: string, > channelId?: string, > playlistId?: string > }, > videoOwnerChannelId?: string, > videoOwnerChannelTitle?: string > } > ``` > **status full type** > > ```ts theme={null} > { > privacyStatus?: string > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > videoId?: string, > videoPublishedAt?: string, > note?: string, > startAt?: string, > endAt?: string > } > ``` *** ### delete `playlistItems.delete` Remove an item from a playlist **Risk:** `destructive` ```ts theme={null} await corsair.youtube.api.playlistItems.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the playlist item to delete | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | | `playlist_item_id` | `string` | No | — | | `http_status` | `number` | No | — | | `error` | `string` | No | — | *** ### list `playlistItems.list` List items in a playlist **Risk:** `read` ```ts theme={null} await corsair.youtube.api.playlistItems.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `playlistId` | `string` | Yes | The ID of the playlist to list items for | | `part` | `string` | No | — | | `fields` | `string` | No | — | | `videoId` | `string` | No | Filter by video ID | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | | `onBehalfOfContentOwner` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | | `eventId` | `string` | No | — | | `visitorId` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > position?: number, > channelId?: string, > channelTitle?: string, > playlistId?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > resourceId?: { > kind?: string, > videoId?: string, > channelId?: string, > playlistId?: string > }, > videoOwnerChannelId?: string, > videoOwnerChannelTitle?: string > }, > status?: { > privacyStatus?: string > }, > contentDetails?: { > videoId?: string, > videoPublishedAt?: string, > note?: string, > startAt?: string, > endAt?: string > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### update `playlistItems.update` Update a playlist item **Risk:** `write` ```ts theme={null} await corsair.youtube.api.playlistItems.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the playlist item to update | | `snippet` | `object` | Yes | Updated snippet | | `part` | `string` | No | — | | `contentDetails` | `object` | No | — | | `onBehalfOfContentOwner` | `string` | No | — | > **snippet full type** > > ```ts theme={null} > { > playlistId: string, > resourceId?: { > kind?: string, > videoId?: string, > channelId?: string, > playlistId?: string > }, > position?: number > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > note?: string, > startAt?: string, > endAt?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | | `status` | `object` | No | — | | `contentDetails` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > title?: string, > description?: string, > position?: number, > channelId?: string, > channelTitle?: string, > playlistId?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > resourceId?: { > kind?: string, > videoId?: string, > channelId?: string, > playlistId?: string > }, > videoOwnerChannelId?: string, > videoOwnerChannelTitle?: string > } > ``` > **status full type** > > ```ts theme={null} > { > privacyStatus?: string > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > videoId?: string, > videoPublishedAt?: string, > note?: string, > startAt?: string, > endAt?: string > } > ``` *** ## Playlists ### create `playlists.create` Create a new playlist **Risk:** `write` ```ts theme={null} await corsair.youtube.api.playlists.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | Playlist title (max 150 characters) | | `description` | `string` | No | Playlist description | | `privacyStatus` | `public \| private \| unlisted` | No | Privacy status of the playlist | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | | `status` | `object` | No | — | | `contentDetails` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > title?: string, > description?: string, > channelId?: string, > channelTitle?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > localized?: { > title?: string, > description?: string > } > } > ``` > **status full type** > > ```ts theme={null} > { > privacyStatus?: string > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > itemCount?: number > } > ``` *** ### delete `playlists.delete` Delete a playlist **Risk:** `destructive` ```ts theme={null} await corsair.youtube.api.playlists.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the playlist to delete | | `confirmDelete` | `boolean` | Yes | Confirm that you want to delete the playlist | | `onBehalfOfContentOwner` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | | `playlist_id` | `string` | No | — | | `http_status` | `number` | No | — | | `error` | `string` | No | — | *** ### list `playlists.list` List the authenticated user's playlists **Risk:** `read` ```ts theme={null} await corsair.youtube.api.playlists.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `part` | `string` | No | Comma-separated list of resource parts (snippet,status,contentDetails) | | `pageToken` | `string` | No | Token for the next page of results | | `maxResults` | `number` | No | Maximum number of results to return (1-50) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > channelId?: string, > channelTitle?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > localized?: { > title?: string, > description?: string > } > }, > status?: { > privacyStatus?: string > }, > contentDetails?: { > itemCount?: number > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### update `playlists.update` Update an existing playlist **Risk:** `write` ```ts theme={null} await corsair.youtube.api.playlists.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the playlist to update | | `snippet` | `object` | Yes | Updated snippet fields | | `part` | `string` | No | Comma-separated list of parts to update | | `status` | `object` | No | — | | `onBehalfOfContentOwner` | `string` | No | — | > **snippet full type** > > ```ts theme={null} > { > title?: string, > description?: string > } > ``` > **status full type** > > ```ts theme={null} > { > privacyStatus?: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | | `status` | `object` | No | — | | `contentDetails` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > title?: string, > description?: string, > channelId?: string, > channelTitle?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > localized?: { > title?: string, > description?: string > } > } > ``` > **status full type** > > ```ts theme={null} > { > privacyStatus?: string > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > itemCount?: number > } > ``` *** ## Search ### youtube `search.youtube` Search YouTube for videos, channels, and playlists **Risk:** `read` ```ts theme={null} await corsair.youtube.api.search.youtube({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Search query | | `part` | `string` | No | — | | `type` | `string` | No | Resource type to search (video, channel, playlist) | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `regionCode` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: { > kind?: string, > videoId?: string, > channelId?: string, > playlistId?: string > }, > etag?: string, > kind?: string, > snippet?: { > publishedAt?: string, > channelId?: string, > title?: string, > description?: string, > channelTitle?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > liveBroadcastContent?: string > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ## Subscriptions ### list `subscriptions.list` List the authenticated user's subscriptions **Risk:** `read` ```ts theme={null} await corsair.youtube.api.subscriptions.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `part` | `string` | No | — | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > publishedAt?: string, > title?: string, > description?: string, > channelId?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > resourceId?: { > kind?: string, > videoId?: string, > channelId?: string, > playlistId?: string > }, > channelTitle?: string > }, > contentDetails?: { > totalItemCount?: number, > newItemCount?: number, > activityType?: string > }, > subscriberSnippet?: { > title?: string, > description?: string, > channelId?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > } > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### subscribe `subscriptions.subscribe` Subscribe to a YouTube channel **Risk:** `write` ```ts theme={null} await corsair.youtube.api.subscriptions.subscribe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channelId` | `string` | Yes | The ID of the channel to subscribe to | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | | `contentDetails` | `object` | No | — | | `subscriberSnippet` | `object` | No | — | | `already_subscribed` | `boolean` | No | — | > **snippet full type** > > ```ts theme={null} > { > publishedAt?: string, > title?: string, > description?: string, > channelId?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > resourceId?: { > kind?: string, > videoId?: string, > channelId?: string, > playlistId?: string > }, > channelTitle?: string > } > ``` > **contentDetails full type** > > ```ts theme={null} > { > totalItemCount?: number, > newItemCount?: number > } > ``` > **subscriberSnippet full type** > > ```ts theme={null} > { > title?: string, > channelId?: string > } > ``` *** ### unsubscribe `subscriptions.unsubscribe` Unsubscribe from a YouTube channel **Risk:** `destructive` ```ts theme={null} await corsair.youtube.api.subscriptions.unsubscribe({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subscriptionId` | `string` | Yes | The ID of the subscription to remove | **Output** | Name | Type | Required | Description | | - | - | - | - | | `unsubscribed` | `boolean` | No | — | | `subscription_id` | `string` | No | — | | `http_status` | `number` | No | — | | `error` | `string` | No | — | *** ## Video Actions ### getRating `videoActions.getRating` Get the authenticated user's rating for a video **Risk:** `read` ```ts theme={null} await corsair.youtube.api.videoActions.getRating({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The YouTube video ID to get the rating for | | `onBehalfOfContentOwner` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | > **items full type** > > ```ts theme={null} > { > videoId?: string, > rating?: string > }[] > ``` *** ### listAbuseReasons `videoActions.listAbuseReasons` List available video abuse report reasons **Risk:** `read` ```ts theme={null} await corsair.youtube.api.videoActions.listAbuseReasons({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hl` | `string` | No | Language for the response | | `part` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `eventId` | `string` | No | — | | `visitorId` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > label?: string, > secondaryReasons?: { > id?: string, > label?: string > }[] > }[] > ``` *** ### rate `videoActions.rate` Rate a video (like, dislike, or remove rating) **Risk:** `write` ```ts theme={null} await corsair.youtube.api.videoActions.rate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The YouTube video ID to rate | | `rating` | `like \| dislike \| none` | Yes | The rating to apply | **Output** | Name | Type | Required | Description | | - | - | - | - | | `rating` | `string` | No | — | | `success` | `boolean` | No | — | | `video_id` | `string` | No | — | | `http_status` | `number` | No | — | *** ### reportAbuse `videoActions.reportAbuse` Report a video for abuse **Risk:** `write` ```ts theme={null} await corsair.youtube.api.videoActions.reportAbuse({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | The YouTube video ID to report | | `reasonId` | `string` | Yes | The ID of the abuse reason | | `comments` | `string` | No | Additional comments about the abuse | | `language` | `string` | No | — | | `secondaryReasonId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `message` | `string` | No | — | | `http_status` | `number` | No | — | *** ### updateThumbnail `videoActions.updateThumbnail` Update the thumbnail for a video **Risk:** `write` ```ts theme={null} await corsair.youtube.api.videoActions.updateThumbnail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | The ID of the video to update the thumbnail for | | `thumbnailUrl` | `string` | Yes | URL of the new thumbnail image | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `eventId` | `string` | No | — | | `visitorId` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > url?: string, > width?: number, > height?: number > }[] > ``` *** ## Video Categories ### list `videoCategories.list` List video categories **Risk:** `read` ```ts theme={null} await corsair.youtube.api.videoCategories.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `hl` | `string` | No | — | | `id` | `string` | No | Category ID(s), comma-separated | | `part` | `string` | No | — | | `regionCode` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > channelId?: string, > title?: string, > assignable?: boolean > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ## Videos ### delete `videos.delete` Delete a video **Risk:** `destructive` ```ts theme={null} await corsair.youtube.api.videos.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `videoId` | `string` | Yes | The ID of the video to delete | | `confirmDelete` | `boolean` | Yes | Confirm that you want to delete the video | | `onBehalfOfContentOwner` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `deleted` | `boolean` | No | — | | `video_id` | `string` | No | — | | `http_status` | `number` | No | — | | `error` | `string` | No | — | *** ### get `videos.get` Get details for a single video **Risk:** `read` ```ts theme={null} await corsair.youtube.api.videos.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | The YouTube video ID | | `part` | `string` | No | Comma-separated list of resource parts | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > channelId?: string, > channelTitle?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > tags?: string[], > categoryId?: string, > defaultLanguage?: string, > liveBroadcastContent?: string > }, > status?: { > privacyStatus?: string, > uploadStatus?: string, > publishAt?: string, > license?: string, > embeddable?: boolean, > publicStatsViewable?: boolean > }, > statistics?: { > viewCount?: string, > likeCount?: string, > dislikeCount?: string, > favoriteCount?: string, > commentCount?: string > }, > contentDetails?: { > duration?: string, > dimension?: string, > definition?: string, > caption?: string, > licensedContent?: boolean > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### getBatch `videos.getBatch` Get details for multiple videos in one request **Risk:** `read` ```ts theme={null} await corsair.youtube.api.videos.getBatch({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string[]` | Yes | Array of YouTube video IDs to retrieve (max 50) | | `hl` | `string` | No | Language for localized metadata | | `parts` | `string[]` | No | Resource parts to include | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `found_count` | `number` | No | — | | `not_found_count` | `number` | No | — | | `requested_count` | `number` | No | — | | `not_found_video_ids` | `string[]` | No | — | | `requested_video_ids` | `string[]` | No | — | | `partial_failure` | `boolean` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > channelId?: string, > channelTitle?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > tags?: string[], > categoryId?: string, > defaultLanguage?: string, > liveBroadcastContent?: string > }, > status?: { > privacyStatus?: string, > uploadStatus?: string, > publishAt?: string, > license?: string, > embeddable?: boolean, > publicStatsViewable?: boolean > }, > statistics?: { > viewCount?: string, > likeCount?: string, > dislikeCount?: string, > favoriteCount?: string, > commentCount?: string > }, > contentDetails?: { > duration?: string, > dimension?: string, > definition?: string, > caption?: string, > licensedContent?: boolean > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### list `videos.list` List videos for a channel **Risk:** `read` ```ts theme={null} await corsair.youtube.api.videos.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `mine` | `boolean` | No | List videos for the authenticated user | | `channelId` | `string` | No | Filter by channel ID | | `part` | `string` | No | — | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `regionCode` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > channelId?: string, > channelTitle?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > tags?: string[], > categoryId?: string, > defaultLanguage?: string, > liveBroadcastContent?: string > }, > status?: { > privacyStatus?: string, > uploadStatus?: string, > publishAt?: string, > license?: string, > embeddable?: boolean, > publicStatsViewable?: boolean > }, > statistics?: { > viewCount?: string, > likeCount?: string, > dislikeCount?: string, > favoriteCount?: string, > commentCount?: string > }, > contentDetails?: { > duration?: string, > dimension?: string, > definition?: string, > caption?: string, > licensedContent?: boolean > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### listMostPopular `videos.listMostPopular` List most popular videos on YouTube **Risk:** `read` ```ts theme={null} await corsair.youtube.api.videos.listMostPopular({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `part` | `string` | No | — | | `chart` | `string` | No | Chart to use (mostPopular) | | `pageToken` | `string` | No | — | | `maxResults` | `number` | No | — | | `regionCode` | `string` | No | — | | `videoCategoryId` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `items` | `object[]` | No | — | | `pageInfo` | `object` | No | — | | `regionCode` | `string` | No | — | | `nextPageToken` | `string` | No | — | | `prevPageToken` | `string` | No | — | > **items full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > channelId?: string, > channelTitle?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > tags?: string[], > categoryId?: string, > defaultLanguage?: string, > liveBroadcastContent?: string > }, > status?: { > privacyStatus?: string, > uploadStatus?: string, > publishAt?: string, > license?: string, > embeddable?: boolean, > publicStatsViewable?: boolean > }, > statistics?: { > viewCount?: string, > likeCount?: string, > dislikeCount?: string, > favoriteCount?: string, > commentCount?: string > }, > contentDetails?: { > duration?: string, > dimension?: string, > definition?: string, > caption?: string, > licensedContent?: boolean > } > }[] > ``` > **pageInfo full type** > > ```ts theme={null} > { > totalResults?: number, > resultsPerPage?: number > } > ``` *** ### update `videos.update` Update video metadata **Risk:** `write` ```ts theme={null} await corsair.youtube.api.videos.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `video_id` | `string` | Yes | The ID of the video to update | | `title` | `string` | No | Updated video title | | `description` | `string` | No | Updated video description | | `tags` | `string[]` | No | Updated video tags | | `categoryId` | `string` | No | Updated category ID | | `privacy_status` | `string` | No | Updated privacy status (public, private, unlisted) | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `etag` | `string` | No | — | | `kind` | `string` | No | — | | `snippet` | `object` | No | — | | `status` | `object` | No | — | | `statistics` | `object` | No | — | > **snippet full type** > > ```ts theme={null} > { > title?: string, > description?: string, > channelId?: string, > channelTitle?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > tags?: string[], > categoryId?: string, > defaultLanguage?: string, > liveBroadcastContent?: string > } > ``` > **status full type** > > ```ts theme={null} > { > privacyStatus?: string, > uploadStatus?: string > } > ``` > **statistics full type** > > ```ts theme={null} > { > viewCount?: string, > likeCount?: string > } > ``` *** ### upload `videos.upload` Upload a new video **Risk:** `write` ```ts theme={null} await corsair.youtube.api.videos.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | Video title | | `categoryId` | `string` | Yes | Video category ID | | `description` | `string` | Yes | Video description | | `privacyStatus` | `public \| private \| unlisted` | Yes | Privacy status | | `tags` | `string[]` | Yes | Video tags | | `videoFilePath` | `object` | Yes | Video file reference | > **videoFilePath full type** > > ```ts theme={null} > { > name?: string, > content_type?: string, > s3_key?: string, > s3_url?: string, > storage_type?: string, > content_length?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `response_data` | `any` | No | — | *** ### uploadMultipart `videos.uploadMultipart` Upload a new video using multipart upload **Risk:** `write` ```ts theme={null} await corsair.youtube.api.videos.uploadMultipart({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `title` | `string` | Yes | Video title | | `videoFile` | `object` | Yes | Video file reference | | `categoryId` | `string` | Yes | Video category ID | | `description` | `string` | Yes | Video description | | `privacyStatus` | `public \| private \| unlisted` | Yes | Privacy status | | `tags` | `string[]` | No | Video tags | > **videoFile full type** > > ```ts theme={null} > { > name?: string, > content_type?: string, > s3_key?: string, > s3_url?: string, > storage_type?: string, > content_length?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `video` | `object` | No | — | > **video full type** > > ```ts theme={null} > { > id?: string, > etag?: string, > kind?: string, > snippet?: { > title?: string, > description?: string, > channelId?: string, > channelTitle?: string, > publishedAt?: string, > thumbnails?: { > default?: { > url?: string, > width?: number, > height?: number > }, > medium?: { > url?: string, > width?: number, > height?: number > }, > high?: { > url?: string, > width?: number, > height?: number > }, > standard?: { > url?: string, > width?: number, > height?: number > }, > maxres?: { > url?: string, > width?: number, > height?: number > } > }, > tags?: string[], > categoryId?: string, > defaultLanguage?: string, > liveBroadcastContent?: string > }, > status?: { > privacyStatus?: string, > uploadStatus?: string, > publishAt?: string, > license?: string, > embeddable?: boolean, > publicStatsViewable?: boolean > }, > statistics?: { > viewCount?: string, > likeCount?: string, > dislikeCount?: string, > favoriteCount?: string, > commentCount?: string > }, > contentDetails?: { > duration?: string, > dimension?: string, > definition?: string, > caption?: string, > licensedContent?: boolean > } > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/youtube/database YouTube local sync: searchable entities, `.search()` filters, and operators. The YouTube plugin syncs data locally. Use `corsair.youtube.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Activities Path: `youtube.db.activities.search` ```ts theme={null} const rows = await corsair.youtube.db.activities.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `channelId` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `string` | equals, contains, startsWith, endsWith, in | | `publishedAt` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Captions Path: `youtube.db.captions.search` ```ts theme={null} const rows = await corsair.youtube.db.captions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `videoId` | `string` | equals, contains, startsWith, endsWith, in | | `language` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `isDraft` | `boolean` | equals | | `trackKind` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Channels Path: `youtube.db.channels.search` ```ts theme={null} const rows = await corsair.youtube.db.channels.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `customUrl` | `string` | equals, contains, startsWith, endsWith, in | | `publishedAt` | `string` | equals, contains, startsWith, endsWith, in | | `subscriberCount` | `string` | equals, contains, startsWith, endsWith, in | | `videoCount` | `string` | equals, contains, startsWith, endsWith, in | | `viewCount` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Comments Path: `youtube.db.comments.search` ```ts theme={null} const rows = await corsair.youtube.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `videoId` | `string` | equals, contains, startsWith, endsWith, in | | `parentId` | `string` | equals, contains, startsWith, endsWith, in | | `textDisplay` | `string` | equals, contains, startsWith, endsWith, in | | `textOriginal` | `string` | equals, contains, startsWith, endsWith, in | | `authorDisplayName` | `string` | equals, contains, startsWith, endsWith, in | | `authorChannelId` | `string` | equals, contains, startsWith, endsWith, in | | `likeCount` | `number` | equals, gt, gte, lt, lte, in | | `publishedAt` | `string` | equals, contains, startsWith, endsWith, in | | `updatedAt` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Playlist Items Path: `youtube.db.playlistItems.search` ```ts theme={null} const rows = await corsair.youtube.db.playlistItems.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `playlistId` | `string` | equals, contains, startsWith, endsWith, in | | `videoId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `position` | `number` | equals, gt, gte, lt, lte, in | | `publishedAt` | `string` | equals, contains, startsWith, endsWith, in | | `channelId` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Playlists Path: `youtube.db.playlists.search` ```ts theme={null} const rows = await corsair.youtube.db.playlists.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `channelId` | `string` | equals, contains, startsWith, endsWith, in | | `privacyStatus` | `string` | equals, contains, startsWith, endsWith, in | | `itemCount` | `number` | equals, gt, gte, lt, lte, in | | `publishedAt` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Subscriptions Path: `youtube.db.subscriptions.search` ```ts theme={null} const rows = await corsair.youtube.db.subscriptions.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `channelId` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `publishedAt` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Videos Path: `youtube.db.videos.search` ```ts theme={null} const rows = await corsair.youtube.db.videos.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `channelId` | `string` | equals, contains, startsWith, endsWith, in | | `publishedAt` | `string` | equals, contains, startsWith, endsWith, in | | `privacyStatus` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `string` | equals, contains, startsWith, endsWith, in | | `viewCount` | `string` | equals, contains, startsWith, endsWith, in | | `likeCount` | `string` | equals, contains, startsWith, endsWith, in | | `commentCount` | `string` | equals, contains, startsWith, endsWith, in | | `categoryId` | `string` | equals, contains, startsWith, endsWith, in | | `defaultThumbnailUrl` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/youtube/get-credentials Step-by-step instructions for obtaining Google OAuth 2.0 credentials for the YouTube Data API (same Google Cloud flow as Gmail and other Google plugins). This guide walks you through obtaining all required credentials for the YouTube plugin. ## Authentication Method The YouTube plugin uses OAuth 2.0 authentication exclusively. * **[`oauth_2`](/concepts/oauth)** (default) — OAuth 2.0 for the **YouTube Data API v3** The steps match other Google integrations (Gmail, Google Calendar, Drive, and Sheets): you create an OAuth client in **Google Cloud**, enable the **YouTube Data API v3**, add redirect URIs, then store `client_id` and `client_secret` and run the Corsair auth flow. You can use the **same Google Cloud project** as your other Google OAuth apps if you add the YouTube API and the right scopes to the consent screen. ## OAuth 2.0 Setup ### Step 1: Create or select a Google Cloud project 1. Go to [Google Cloud Console](https://console.cloud.google.com/). 2. Create a new project or select an existing one (the same project you use for Gmail/Drive/Calendar is fine if you prefer one OAuth app for all Google services). ### Step 2: Enable YouTube Data API v3 1. Open **APIs & Services** → **Library**. 2. Search for **YouTube Data API v3**. 3. Open it and click **Enable**. ### Step 3: Configure the OAuth consent screen 1. Go to **APIs & Services** → **OAuth consent screen**. 2. Choose **External** (or **Internal** for Workspace-only apps) and complete the required fields. 3. On **Scopes**, add the YouTube scopes your app needs. Examples (add only what you use): * `https://www.googleapis.com/auth/youtube.readonly` — read-only access to channel and video metadata the API allows. * `https://www.googleapis.com/auth/youtube` — manage your YouTube account (upload, edit, etc.; broad). * `https://www.googleapis.com/auth/youtube.force-ssl` — account access over HTTPS (often used with full channel management). Refer to [YouTube Data API authorization scopes](https://developers.google.com/youtube/v3/guides/auth/installed-apps#identify-access-scopes) for the full list. ### Step 4: Create OAuth 2.0 credentials 1. Go to **APIs & Services** → **Credentials**. 2. Click **Create credentials** → **OAuth client ID**. 3. Choose **Web application** (or the client type Corsair expects for your deployment). 4. Under **Authorized redirect URIs**, add the callback URL your app uses for YouTube OAuth (the same pattern as Gmail or Calendar — e.g. `https://yourapp.com/auth/youtube/callback` or whatever you configured in Corsair). 5. Create the client and copy the **Client ID** and **Client secret**. **Storing credentials and authorizing:** ```bash theme={null} pnpm corsair setup --plugin=youtube client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=youtube ``` Open the authorization URL from the CLI, sign in with Google, and approve access. Tokens are stored for Corsair to use. Verify: ```bash theme={null} pnpm corsair auth --plugin=youtube --credentials ``` ## Required Credentials Summary | Credential | Required for | Where to find | | - | - | - | | Client ID | [`oauth_2`](/concepts/oauth) | Google Cloud Console → APIs & Services → Credentials | | Client secret | [`oauth_2`](/concepts/oauth) | Same page | | Access / refresh tokens | After OAuth | Issued when you complete `pnpm corsair auth --plugin=youtube` | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). For Google OAuth setup shared across products, you can also align with [Gmail Get Credentials](/plugins/gmail/get-credentials) and [Google Calendar Get Credentials](/plugins/googlecalendar/get-credentials) — the Cloud project and OAuth client pattern is the same; only the enabled API and scopes differ. # Overview Source: https://docs.corsair.dev/plugins/youtube/overview Video platform for uploading, managing channels, playlists, analytics, and content metadata. Use **YouTube** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 51 typed API operations * 8 synced entities (`activities`, `captions`, `channels`, `comments`, `playlistItems`, `playlists`, and 2 more) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/youtube ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/youtube ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/youtube ``` ```bash bun theme={null} bun add corsair @corsair-dev/youtube ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { youtube } from '@corsair-dev/youtube'; export const corsair = createCorsair({ plugins: [ youtube(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your YouTube OAuth app. Provider walkthrough: [Get Credentials](/plugins/youtube/get-credentials). ```ts theme={null} youtube() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'youtube', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`captions.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.youtube.api.captions.list({}); ``` **`captions.update`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.youtube.api.captions.update({}); ``` See the full list on the [API](/plugins/youtube/api) page. ## Query synced data Synced entities support `tenant.youtube.db..search()` and `.list()`: `activities`, `captions`, `channels`, `comments`, `playlistItems`, `playlists`, `subscriptions`, `videos`. See [Database](/plugins/youtube/database) for filters and operators. ## What's next > **[API reference](/plugins/youtube/api)** > > Every `youtube.api.*` operation with input and output types. > **[Database](/plugins/youtube/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/youtube/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # API Source: https://docs.corsair.dev/plugins/zendesk/api API reference for Zendesk: every `zendesk.api.*` operation with input and output types. Every `zendesk.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Comments ### list `comments.list` List comments for a specific ticket **Risk:** `read` ```ts theme={null} await corsair.zendesk.api.comments.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ticket_id` | `number` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `comments` | `object[]` | Yes | — | | `next_page` | `string` | No | — | | `previous_page` | `string` | No | — | | `count` | `number` | No | — | > **comments full type** > > ```ts theme={null} > { > id: number, > type?: string | null, > body?: string | null, > html_body?: string | null, > plain_body?: string | null, > public?: boolean | null, > author_id?: number | null, > attachments?: any[] | null, > created_at?: string | null > }[] > ``` *** ## Tickets ### create `tickets.create` Create a new ticket **Risk:** `write` ```ts theme={null} await corsair.zendesk.api.tickets.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `subject` | `string` | No | — | | `description` | `string` | No | — | | `comment` | `object` | No | — | | `status` | `string` | No | — | | `priority` | `string` | No | — | | `requester_id` | `number` | No | — | | `assignee_id` | `number` | No | — | | `group_id` | `number` | No | — | | `organization_id` | `number` | No | — | | `tags` | `string[]` | No | — | > **comment full type** > > ```ts theme={null} > { > body: string, > public?: boolean, > author_id?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ticket` | `object` | Yes | — | > **ticket full type** > > ```ts theme={null} > { > id: number, > url?: string | null, > external_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > type?: string | null, > subject?: string | null, > raw_subject?: string | null, > description?: string | null, > priority?: string | null, > status?: string | null, > recipient?: string | null, > requester_id?: number | null, > submitter_id?: number | null, > assignee_id?: number | null, > organization_id?: number | null, > group_id?: number | null, > collaborator_ids?: number[] | null, > follower_ids?: number[] | null, > email_cc_ids?: number[] | null, > forum_topic_id?: number | null, > problem_id?: number | null, > has_incidents?: boolean | null, > is_public?: boolean | null, > due_at?: string | null, > tags?: string[] | null > } > ``` *** ### delete `tickets.delete` Delete a ticket by its ID **Risk:** `destructive` ```ts theme={null} await corsair.zendesk.api.tickets.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | *** ### get `tickets.get` Retrieve a ticket by its ID **Risk:** `read` ```ts theme={null} await corsair.zendesk.api.tickets.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `ticket` | `object` | Yes | — | > **ticket full type** > > ```ts theme={null} > { > id: number, > url?: string | null, > external_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > type?: string | null, > subject?: string | null, > raw_subject?: string | null, > description?: string | null, > priority?: string | null, > status?: string | null, > recipient?: string | null, > requester_id?: number | null, > submitter_id?: number | null, > assignee_id?: number | null, > organization_id?: number | null, > group_id?: number | null, > collaborator_ids?: number[] | null, > follower_ids?: number[] | null, > email_cc_ids?: number[] | null, > forum_topic_id?: number | null, > problem_id?: number | null, > has_incidents?: boolean | null, > is_public?: boolean | null, > due_at?: string | null, > tags?: string[] | null > } > ``` *** ### list `tickets.list` List tickets with pagination **Risk:** `read` ```ts theme={null} await corsair.zendesk.api.tickets.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `sort_by` | `string` | No | — | | `sort_order` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `tickets` | `object[]` | Yes | — | | `next_page` | `string` | No | — | | `previous_page` | `string` | No | — | | `count` | `number` | No | — | > **tickets full type** > > ```ts theme={null} > { > id: number, > url?: string | null, > external_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > type?: string | null, > subject?: string | null, > raw_subject?: string | null, > description?: string | null, > priority?: string | null, > status?: string | null, > recipient?: string | null, > requester_id?: number | null, > submitter_id?: number | null, > assignee_id?: number | null, > organization_id?: number | null, > group_id?: number | null, > collaborator_ids?: number[] | null, > follower_ids?: number[] | null, > email_cc_ids?: number[] | null, > forum_topic_id?: number | null, > problem_id?: number | null, > has_incidents?: boolean | null, > is_public?: boolean | null, > due_at?: string | null, > tags?: string[] | null > }[] > ``` *** ### update `tickets.update` Update an existing ticket **Risk:** `write` ```ts theme={null} await corsair.zendesk.api.tickets.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `subject` | `string` | No | — | | `status` | `string` | No | — | | `priority` | `string` | No | — | | `requester_id` | `number` | No | — | | `assignee_id` | `number` | No | — | | `comment` | `object` | No | — | | `tags` | `string[]` | No | — | > **comment full type** > > ```ts theme={null} > { > body: string, > public?: boolean, > author_id?: number > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `ticket` | `object` | Yes | — | > **ticket full type** > > ```ts theme={null} > { > id: number, > url?: string | null, > external_id?: string | null, > created_at?: string | null, > updated_at?: string | null, > type?: string | null, > subject?: string | null, > raw_subject?: string | null, > description?: string | null, > priority?: string | null, > status?: string | null, > recipient?: string | null, > requester_id?: number | null, > submitter_id?: number | null, > assignee_id?: number | null, > organization_id?: number | null, > group_id?: number | null, > collaborator_ids?: number[] | null, > follower_ids?: number[] | null, > email_cc_ids?: number[] | null, > forum_topic_id?: number | null, > problem_id?: number | null, > has_incidents?: boolean | null, > is_public?: boolean | null, > due_at?: string | null, > tags?: string[] | null > } > ``` *** ## Users ### create `users.create` Create a new user **Risk:** `write` ```ts theme={null} await corsair.zendesk.api.users.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `name` | `string` | Yes | — | | `email` | `string` | Yes | — | | `role` | `string` | No | — | | `external_id` | `string` | No | — | | `active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: number, > url?: string | null, > name: string, > email?: string | null, > created_at?: string | null, > updated_at?: string | null, > time_zone?: string | null, > iana_time_zone?: string | null, > phone?: string | null, > shared_phone?: boolean | null, > locale_id?: number | null, > locale?: string | null, > organization_id?: number | null, > role?: string | null, > verified?: boolean | null, > external_id?: string | null, > tags?: string[] | null, > active?: boolean | null > } > ``` *** ### delete `users.delete` Delete a user by their ID **Risk:** `destructive` ```ts theme={null} await corsair.zendesk.api.users.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | *** ### get `users.get` Retrieve a user by their ID **Risk:** `read` ```ts theme={null} await corsair.zendesk.api.users.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: number, > url?: string | null, > name: string, > email?: string | null, > created_at?: string | null, > updated_at?: string | null, > time_zone?: string | null, > iana_time_zone?: string | null, > phone?: string | null, > shared_phone?: boolean | null, > locale_id?: number | null, > locale?: string | null, > organization_id?: number | null, > role?: string | null, > verified?: boolean | null, > external_id?: string | null, > tags?: string[] | null, > active?: boolean | null > } > ``` *** ### list `users.list` List users with pagination **Risk:** `read` ```ts theme={null} await corsair.zendesk.api.users.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `role` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | | `next_page` | `string` | No | — | | `previous_page` | `string` | No | — | | `count` | `number` | No | — | > **users full type** > > ```ts theme={null} > { > id: number, > url?: string | null, > name: string, > email?: string | null, > created_at?: string | null, > updated_at?: string | null, > time_zone?: string | null, > iana_time_zone?: string | null, > phone?: string | null, > shared_phone?: boolean | null, > locale_id?: number | null, > locale?: string | null, > organization_id?: number | null, > role?: string | null, > verified?: boolean | null, > external_id?: string | null, > tags?: string[] | null, > active?: boolean | null > }[] > ``` *** ### update `users.update` Update an existing user **Risk:** `write` ```ts theme={null} await corsair.zendesk.api.users.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | Yes | — | | `name` | `string` | No | — | | `email` | `string` | No | — | | `role` | `string` | No | — | | `external_id` | `string` | No | — | | `active` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `user` | `object` | Yes | — | > **user full type** > > ```ts theme={null} > { > id: number, > url?: string | null, > name: string, > email?: string | null, > created_at?: string | null, > updated_at?: string | null, > time_zone?: string | null, > iana_time_zone?: string | null, > phone?: string | null, > shared_phone?: boolean | null, > locale_id?: number | null, > locale?: string | null, > organization_id?: number | null, > role?: string | null, > verified?: boolean | null, > external_id?: string | null, > tags?: string[] | null, > active?: boolean | null > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/zendesk/database Zendesk local sync: searchable entities, `.search()` filters, and operators. The Zendesk plugin syncs data locally. Use `corsair.zendesk.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Comments Path: `zendesk.db.comments.search` ```ts theme={null} const rows = await corsair.zendesk.db.comments.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `ticketId` | `number` | equals, gt, gte, lt, lte, in | | `body` | `string` | equals, contains, startsWith, endsWith, in | | `authorId` | `number` | equals, gt, gte, lt, lte, in | | `public` | `boolean` | equals | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Tickets Path: `zendesk.db.tickets.search` ```ts theme={null} const rows = await corsair.zendesk.db.tickets.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `string` | equals, contains, startsWith, endsWith, in | | `requesterId` | `number` | equals, gt, gte, lt, lte, in | | `assigneeId` | `number` | equals, gt, gte, lt, lte, in | | `organizationId` | `number` | equals, gt, gte, lt, lte, in | | `groupId` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Users Path: `zendesk.db.users.search` ```ts theme={null} const rows = await corsair.zendesk.db.users.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `role` | `string` | equals, contains, startsWith, endsWith, in | | `active` | `boolean` | equals | | `timeZone` | `string` | equals, contains, startsWith, endsWith, in | | `locale` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | | `updatedAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/zendesk/overview Customer support platform for tickets, help centers, chat, and service team workflows. Use **Zendesk** through Corsair: one client, typed API calls, local DB sync. **What you get:** * 11 typed API operations * 3 synced entities (`comments`, `tickets`, `users`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/zendesk ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/zendesk ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/zendesk ``` ```bash bun theme={null} bun add corsair @corsair-dev/zendesk ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { zendesk } from '@corsair-dev/zendesk'; export const corsair = createCorsair({ plugins: [ zendesk(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} zendesk() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'zendesk', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`comments.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zendesk.api.comments.list({}); ``` **`tickets.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zendesk.api.tickets.create({}); ``` See the full list on the [API](/plugins/zendesk/api) page. ## Query synced data Synced entities support `tenant.zendesk.db..search()` and `.list()`: `comments`, `tickets`, `users`. See [Database](/plugins/zendesk/database) for filters and operators. ## What's next > **[API reference](/plugins/zendesk/api)** > > Every `zendesk.api.*` operation with input and output types. > **[Database](/plugins/zendesk/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/zenserp/api API reference for Zenserp: every `zenserp.api.*` operation with input and output types. Every `zenserp.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Account ### getStatus `account.getStatus` Return the remaining request quota for the API key **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.account.getStatus({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `remaining_requests` | `number` | Yes | — | *** ## Batches ### list `batches.list` List submitted Zenserp batches **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.batches.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `limit` | `number` | No | — | **Output:** `object` > **Output full type** > > ```ts theme={null} > { > }[] | { > data: { > }[] > } > ``` *** ## Metadata ### listCountries `metadata.listCountries` List supported Google country parameters **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.metadata.listCountries({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string, > value?: string, > code?: string > }[] > ``` *** ### listLanguages `metadata.listLanguages` List supported Google interface languages **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.metadata.listLanguages({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string, > value?: string, > code?: string > }[] > ``` *** ### listLocations `metadata.listLocations` List supported geolocation targets **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.metadata.listLocations({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | — | **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string, > canonical_name?: string, > country_code?: string > }[] > ``` *** ### listSearchEngines `metadata.listSearchEngines` List supported search-engine domains **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.metadata.listSearchEngines({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > name?: string, > domain?: string > }[] > ``` *** ## Search ### bing `search.bing` Search Bing and return structured SERP data **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.search.bing({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | Yes | — | | `organic` | `object[]` | No | — | | `paid` | `object[]` | No | — | | `images` | `object[]` | No | — | | `related_searches` | `object[]` | No | — | | `pagination` | `object` | No | — | | `number_of_results` | `number` | No | — | | `knowledge_graph` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **organic full type** > > ```ts theme={null} > { > }[] > ``` > **paid full type** > > ```ts theme={null} > { > }[] > ``` > **images full type** > > ```ts theme={null} > { > }[] > ``` > **related\_searches full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` > **knowledge\_graph full type** > > ```ts theme={null} > { > } > ``` *** ### google `search.google` Search Google and return structured SERP data **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.search.google({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | Yes | — | | `organic` | `object[]` | No | — | | `paid` | `object[]` | No | — | | `images` | `object[]` | No | — | | `related_searches` | `object[]` | No | — | | `pagination` | `object` | No | — | | `number_of_results` | `number` | No | — | | `knowledge_graph` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **organic full type** > > ```ts theme={null} > { > }[] > ``` > **paid full type** > > ```ts theme={null} > { > }[] > ``` > **images full type** > > ```ts theme={null} > { > }[] > ``` > **related\_searches full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` > **knowledge\_graph full type** > > ```ts theme={null} > { > } > ``` *** ### reverseImage `search.reverseImage` Run a Google reverse-image search for a public image URL **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.search.reverseImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `imageUrl` | `string` | Yes | — | | `location` | `string` | No | — | | `gl` | `string` | No | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | Yes | — | | `organic` | `object[]` | No | — | | `paid` | `object[]` | No | — | | `images` | `object[]` | No | — | | `related_searches` | `object[]` | No | — | | `pagination` | `object` | No | — | | `number_of_results` | `number` | No | — | | `knowledge_graph` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **organic full type** > > ```ts theme={null} > { > }[] > ``` > **paid full type** > > ```ts theme={null} > { > }[] > ``` > **images full type** > > ```ts theme={null} > { > }[] > ``` > **related\_searches full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` > **knowledge\_graph full type** > > ```ts theme={null} > { > } > ``` *** ### yandex `search.yandex` Search Yandex and return structured SERP data **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.search.yandex({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | — | | `location` | `string` | No | — | | `hl` | `string` | No | — | | `gl` | `string` | No | — | | `device` | `desktop \| tablet \| mobile` | No | — | | `num` | `number` | No | — | | `start` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | Yes | — | | `organic` | `object[]` | No | — | | `paid` | `object[]` | No | — | | `images` | `object[]` | No | — | | `related_searches` | `object[]` | No | — | | `pagination` | `object` | No | — | | `number_of_results` | `number` | No | — | | `knowledge_graph` | `object` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **organic full type** > > ```ts theme={null} > { > }[] > ``` > **paid full type** > > ```ts theme={null} > { > }[] > ``` > **images full type** > > ```ts theme={null} > { > }[] > ``` > **related\_searches full type** > > ```ts theme={null} > { > }[] > ``` > **pagination full type** > > ```ts theme={null} > { > } > ``` > **knowledge\_graph full type** > > ```ts theme={null} > { > } > ``` *** ## Shopping ### getProduct `shopping.getProduct` Retrieve Google Shopping product details **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.shopping.getProduct({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `productId` | `string` | Yes | — | | `location` | `string` | No | — | | `gl` | `string` | No | — | | `hl` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `query` | `object` | Yes | — | | `title` | `string` | Yes | — | | `description` | `string` | No | — | | `image` | `string` | No | — | | `reviews` | `object[]` | No | — | | `specifications` | `object[]` | No | — | | `sellers` | `object[]` | No | — | > **query full type** > > ```ts theme={null} > { > } > ``` > **reviews full type** > > ```ts theme={null} > { > }[] > ``` > **specifications full type** > > ```ts theme={null} > { > }[] > ``` > **sellers full type** > > ```ts theme={null} > { > }[] > ``` *** ## Trends ### get `trends.get` Retrieve Google Trends data for one or more keywords **Risk:** `read` ```ts theme={null} await corsair.zenserp.api.trends.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `keywords` | `string[]` | Yes | — | | `location` | `string` | No | — | | `timeframe` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `json` | `object` | Yes | — | | `html` | `string` | No | — | > **json full type** > > ```ts theme={null} > { > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/zenserp/database Zenserp local sync: searchable entities, `.search()` filters, and operators. The Zenserp plugin syncs data locally. Use `corsair.zenserp.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/zenserp/overview Zenserp plugin for Corsair Use **Zenserp** through Corsair: one client, typed API calls. **What you get:** * 12 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/zenserp ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/zenserp ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/zenserp ``` ```bash bun theme={null} bun add corsair @corsair-dev/zenserp ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { zenserp } from '@corsair-dev/zenserp'; export const corsair = createCorsair({ plugins: [ zenserp(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/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. ```ts theme={null} zenserp() ``` More: [API Key](/concepts/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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'zenserp', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`account.getStatus`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zenserp.api.account.getStatus({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/zenserp/api) reference.* See the full list on the [API](/plugins/zenserp/api) page. ## What's next > **[API reference](/plugins/zenserp/api)** > > Every `zenserp.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/zohobigin/api API reference for Zoho Bigin: every `zohobigin.api.*` operation with input and output types. Every `zohobigin.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Attachments ### delete `attachments.delete` Delete attachment **Risk:** `destructive` ```ts theme={null} await corsair.zohobigin.api.attachments.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `attachmentId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### download `attachments.download` Download attachment **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.attachments.download({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `attachmentId` | `string` | Yes | — | **Output:** `any` *** ### get `attachments.get` Get attachments **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.attachments.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `info` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > } > ``` *** ### upload `attachments.upload` Upload attachment **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.attachments.upload({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `file` | `any` | No | — | | `attachmentUrl` | `string` | No | — | | `attachment_url` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ## Bulk ### createReadJob `bulk.createReadJob` Create bulk read job **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.bulk.createReadJob({}); ``` **Input:** `object` > **Input full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### downloadReadResult `bulk.downloadReadResult` Download bulk read result **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.bulk.downloadReadResult({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output:** `any` *** ### getReadJobStatus `bulk.getReadJobStatus` Get bulk read job status **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.bulk.getReadJobStatus({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `job_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ## Metadata ### getCustomView `metadata.getCustomView` Get custom view **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.metadata.getCustomView({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `viewId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `custom_views` | `object[]` | Yes | — | > **custom\_views full type** > > ```ts theme={null} > { > }[] > ``` *** ### getCustomViews `metadata.getCustomViews` Get custom views **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.metadata.getCustomViews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `custom_views` | `object[]` | Yes | — | > **custom\_views full type** > > ```ts theme={null} > { > }[] > ``` *** ### getFields `metadata.getFields` Get fields **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.metadata.getFields({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `fields` | `object[]` | Yes | — | > **fields full type** > > ```ts theme={null} > { > }[] > ``` *** ### getLayout `metadata.getLayout` Get layout **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.metadata.getLayout({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `layoutId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `layouts` | `object[]` | Yes | — | > **layouts full type** > > ```ts theme={null} > { > }[] > ``` *** ### getLayouts `metadata.getLayouts` Get layouts **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.metadata.getLayouts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `layouts` | `object[]` | Yes | — | > **layouts full type** > > ```ts theme={null} > { > }[] > ``` *** ### getModule `metadata.getModule` Get module metadata **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.metadata.getModule({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `modules` | `object[]` | Yes | — | > **modules full type** > > ```ts theme={null} > { > }[] > ``` *** ### getModules `metadata.getModules` Get modules **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.metadata.getModules({}); ``` **Input:** `void` **Output** | Name | Type | Required | Description | | - | - | - | - | | `modules` | `object[]` | Yes | — | > **modules full type** > > ```ts theme={null} > { > }[] > ``` *** ### getRelatedLists `metadata.getRelatedLists` Get related lists **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.metadata.getRelatedLists({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `related_lists` | `object[]` | Yes | — | > **related\_lists full type** > > ```ts theme={null} > { > }[] > ``` *** ## Notes ### create `notes.create` Create notes **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.notes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > Note_Title?: string, > Note_Content: string, > Parent_Id?: string, > se_module?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### createRecordNotes `notes.createRecordNotes` Create record notes **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.notes.createRecordNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > Note_Title?: string, > Note_Content: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### delete `notes.delete` Delete notes **Risk:** `destructive` ```ts theme={null} await corsair.zohobigin.api.notes.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### deleteRecordNote `notes.deleteRecordNote` Delete record note **Risk:** `destructive` ```ts theme={null} await corsair.zohobigin.api.notes.deleteRecordNote({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `noteId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### getAll `notes.getAll` Get all notes **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.notes.getAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `info` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > } > ``` *** ### getRecordNotes `notes.getRecordNotes` Get record notes **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.notes.getRecordNotes({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `info` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > } > ``` *** ### update `notes.update` Update note **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.notes.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `noteId` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > Note_Title?: string, > Note_Content: string > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ## Notifications ### disable `notifications.disable` Disable notifications **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.notifications.disable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `channel_ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### enable `notifications.enable` Enable notifications **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.notifications.enable({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watch` | `object[]` | Yes | — | > **watch full type** > > ```ts theme={null} > { > channel_id: string, > events: string[], > token?: string, > notify_url: string, > channel_expiry?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### getDetails `notifications.getDetails` Get notification details **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.notifications.getDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | No | — | | `channel_id` | `string` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `watch` | `object[]` | Yes | — | | `info` | `object` | No | — | > **watch full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > } > ``` *** ### updateDetails `notifications.updateDetails` Update notification details **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.notifications.updateDetails({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watch` | `object[]` | Yes | — | > **watch full type** > > ```ts theme={null} > { > channel_id: string, > events: string[], > token?: string, > notify_url: string, > channel_expiry?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### updateInfo `notifications.updateInfo` Update notification info **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.notifications.updateInfo({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `watch` | `object[]` | Yes | — | > **watch full type** > > ```ts theme={null} > { > channel_id: string, > events: string[], > token?: string, > notify_url: string, > channel_expiry?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ## Records ### add `records.add` Add records to module **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.records.add({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | Target module API name e.g. Contacts, Pipelines, Accounts | | `data` | `object[]` | Yes | Array of record objects to insert | | `trigger` | `string[]` | No | Triggers such as approval, workflow, blueprint | > **data full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### count `records.count` Count records **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.records.count({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `cvid` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `count` | `string \| number` | Yes | — | *** ### delete `records.delete` Delete multiple records **Risk:** `destructive` ```ts theme={null} await corsair.zohobigin.api.records.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### deletePhoto `records.deletePhoto` Delete record photo **Risk:** `destructive` ```ts theme={null} await corsair.zohobigin.api.records.deletePhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `message` | `string` | Yes | — | | `status` | `string` | Yes | — | *** ### deleteRecord `records.deleteRecord` Delete single record **Risk:** `destructive` ```ts theme={null} await corsair.zohobigin.api.records.deleteRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### downloadPhoto `records.downloadPhoto` Download record photo **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.records.downloadPhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output:** `any` *** ### get `records.get` Get records from module **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.records.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `fields` | `string` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `sort_by` | `string` | No | — | | `sort_order` | `asc \| desc` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `info` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > per_page?: number, > count?: number, > page?: number, > more_records?: boolean > } > ``` *** ### getDeleted `records.getDeleted` Get deleted records **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.records.getDeleted({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `type` | `all \| recycle \| permanent` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `info` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > } > ``` *** ### getPipelines `records.getPipelines` Get team pipelines **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.records.getPipelines({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `info` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > per_page?: number, > count?: number, > page?: number, > more_records?: boolean > } > ``` *** ### getRecord `records.getRecord` Get single record **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.records.getRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` *** ### getRelated `records.getRelated` Get related records **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.records.getRelated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `relatedList` | `string` | Yes | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `fields` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `info` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > per_page?: number, > count?: number, > page?: number, > more_records?: boolean > } > ``` *** ### search `records.search` Search records **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.records.search({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `criteria` | `string` | No | — | | `email` | `string` | No | — | | `phone` | `string` | No | — | | `word` | `string` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | | `info` | `object` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > per_page?: number, > count?: number, > page?: number, > more_records?: boolean > } > ``` *** ### update `records.update` Update multiple records **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.records.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }& { > id: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### updateRecord `records.updateRecord` Update single record **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.records.updateRecord({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `id` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### updateRelated `records.updateRelated` Update related records **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.records.updateRelated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `relatedList` | `string` | Yes | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### uploadPhoto `records.uploadPhoto` Upload record photo **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.records.uploadPhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `id` | `string` | Yes | — | | `file` | `any` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `message` | `string` | Yes | — | | `status` | `string` | Yes | — | *** ### upsert `records.upsert` Upsert records **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.records.upsert({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `data` | `object[]` | Yes | — | | `duplicate_check_fields` | `string[]` | No | — | > **data full type** > > ```ts theme={null} > { > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ## Tags ### addToRecords `tags.addToRecords` Add tags to records **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.tags.addToRecords({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `tags` | `object[]` | Yes | — | | `overWrite` | `boolean` | No | — | > **tags full type** > > ```ts theme={null} > { > name: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### create `tags.create` Create tags **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.tags.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `tags` | `object[]` | Yes | — | > **tags full type** > > ```ts theme={null} > { > name: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `tags` | `object[]` | Yes | — | > **tags full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ### delinkRelated `tags.delinkRelated` Delink related records **Risk:** `destructive` ```ts theme={null} await corsair.zohobigin.api.tags.delinkRelated({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `module` | `string` | Yes | — | | `recordId` | `string` | Yes | — | | `relatedList` | `string` | Yes | — | | `relatedRecordId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > code: string, > details: { > }, > message: string, > status: string > }[] > ``` *** ## Users ### getOrganization `users.getOrganization` Get organization details **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.users.getOrganization({}); ``` **Input:** `void` **Output** | Name | Type | Required | Description | | - | - | - | - | | `org` | `object[]` | Yes | — | > **org full type** > > ```ts theme={null} > { > }[] > ``` *** ### getProfiles `users.getProfiles` Get profiles **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.users.getProfiles({}); ``` **Input:** `void` **Output** | Name | Type | Required | Description | | - | - | - | - | | `profiles` | `object[]` | Yes | — | > **profiles full type** > > ```ts theme={null} > { > }[] > ``` *** ### getRoles `users.getRoles` Get roles **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.users.getRoles({}); ``` **Input:** `void` **Output** | Name | Type | Required | Description | | - | - | - | - | | `roles` | `object[]` | Yes | — | > **roles full type** > > ```ts theme={null} > { > }[] > ``` *** ### getUser `users.getUser` Get user **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.users.getUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > }[] > ``` *** ### getUsers `users.getUsers` Get users **Risk:** `read` ```ts theme={null} await corsair.zohobigin.api.users.getUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `ActiveUsers \| DeactiveUsers \| AdminUsers \| AllUsers` | No | — | | `page` | `number` | No | — | | `per_page` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | | `info` | `object` | No | — | > **users full type** > > ```ts theme={null} > { > }[] > ``` > **info full type** > > ```ts theme={null} > { > } > ``` *** ### updateUser `users.updateUser` Update user **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.users.updateUser({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > }[] > ``` *** ### updateUsers `users.updateUsers` Update users **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.users.updateUsers({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > }& { > id: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `users` | `object[]` | Yes | — | > **users full type** > > ```ts theme={null} > { > }[] > ``` *** ### uploadOrgPhoto `users.uploadOrgPhoto` Upload organization photo **Risk:** `write` ```ts theme={null} await corsair.zohobigin.api.users.uploadOrgPhoto({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `file` | `any` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `string` | Yes | — | | `message` | `string` | Yes | — | | `status` | `string` | Yes | — | *** # Database Source: https://docs.corsair.dev/plugins/zohobigin/database Zoho Bigin local sync: searchable entities, `.search()` filters, and operators. The Zoho Bigin plugin syncs data locally. Use `corsair.zohobigin.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). # Overview Source: https://docs.corsair.dev/plugins/zohobigin/overview Zoho Bigin plugin for Corsair Use **Zoho Bigin** through Corsair: one client, typed API calls. **What you get:** * 55 typed API operations ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/zohobigin ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/zohobigin ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/zohobigin ``` ```bash bun theme={null} bun add corsair @corsair-dev/zohobigin ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { zohobigin } from '@corsair-dev/zohobigin'; export const corsair = createCorsair({ plugins: [ zohobigin(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Zoho Bigin OAuth app. ```ts theme={null} zohobigin() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'zohobigin', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`attachments.download`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zohobigin.api.attachments.download({}); ``` **`attachments.delete`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zohobigin.api.attachments.delete({}); ``` See the full list on the [API](/plugins/zohobigin/api) page. ## What's next > **[API reference](/plugins/zohobigin/api)** > > Every `zohobigin.api.*` operation with input and output types. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/zohoinventory/api API reference for Zoho Inventory: every `zohoinventory.api.*` operation with input and output types. Every `zohoinventory.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Bills ### create `bills.create` Create a bill **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.bills.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `vendor_id` | `string` | Yes | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > item_id?: string, > name?: string, > description?: string, > rate?: number, > quantity?: number, > unit?: string, > tax_id?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `bill` | `object` | No | — | > **bill full type** > > ```ts theme={null} > { > } > ``` *** ### list `bills.list` List bills **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.bills.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `bills` | `object[]` | Yes | — | | `page_context` | `object` | No | — | > **bills full type** > > ```ts theme={null} > { > }[] > ``` > **page\_context full type** > > ```ts theme={null} > { > page?: number, > per_page?: number, > has_more_page?: boolean, > report_name?: string, > applied_filter?: string, > sort_column?: string, > sort_order?: string > } > ``` *** ## Composite Items ### delete `compositeItems.delete` Delete a composite item \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.compositeItems.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `composite_item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ## Contacts ### create `contacts.create` Create a contact **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.contacts.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `contact_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `contact` | `object` | No | — | > **contact full type** > > ```ts theme={null} > { > contact_id: string, > contact_name: string, > company_name?: string, > contact_type?: string, > status?: string, > email?: string, > currency_code?: string, > outstanding_receivable_amount?: number, > outstanding_payable_amount?: number > } > ``` *** ### createPerson `contacts.createPerson` Create a contact person **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.contacts.createPerson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `contact_id` | `string` | Yes | — | | `first_name` | `string` | No | — | | `last_name` | `string` | No | — | | `email` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `contact_person` | `object` | No | — | > **contact\_person full type** > > ```ts theme={null} > { > } > ``` *** ### deactivate `contacts.deactivate` Mark a contact inactive **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.contacts.deactivate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### delete `contacts.delete` Delete a contact \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.contacts.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### deletePerson `contacts.deletePerson` Delete a contact person \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.contacts.deletePerson({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `contact_person_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### email `contacts.email` Email a contact **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.contacts.email({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `contact_id` | `string` | Yes | — | | `to_mail_ids` | `string[]` | No | — | | `cc_mail_ids` | `string[]` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### emailStatement `contacts.emailStatement` Email a contact statement **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.contacts.emailStatement({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `contact_id` | `string` | Yes | — | | `to_mail_ids` | `string[]` | No | — | | `cc_mail_ids` | `string[]` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### get `contacts.get` Get a contact **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.contacts.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `contact` | `object` | No | — | > **contact full type** > > ```ts theme={null} > { > contact_id: string, > contact_name: string, > company_name?: string, > contact_type?: string, > status?: string, > email?: string, > currency_code?: string, > outstanding_receivable_amount?: number, > outstanding_payable_amount?: number > } > ``` *** ### getAddress `contacts.getAddress` Get a contact address **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.contacts.getAddress({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `contact_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### list `contacts.list` List contacts **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.contacts.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search_text` | `string` | No | — | | `contact_type` | `customer \| vendor \| all` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `contacts` | `object[]` | Yes | — | | `page_context` | `object` | No | — | > **contacts full type** > > ```ts theme={null} > { > contact_id: string, > contact_name: string, > company_name?: string, > contact_type?: string, > status?: string, > email?: string, > currency_code?: string, > outstanding_receivable_amount?: number, > outstanding_payable_amount?: number > }[] > ``` > **page\_context full type** > > ```ts theme={null} > { > page?: number, > per_page?: number, > has_more_page?: boolean, > report_name?: string, > applied_filter?: string, > sort_column?: string, > sort_order?: string > } > ``` *** ## Credit Notes ### addComment `creditNotes.addComment` Add a credit note comment **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.creditNotes.addComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `creditnote_id` | `string` | Yes | — | | `description` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `comment` | `object` | No | — | > **comment full type** > > ```ts theme={null} > { > } > ``` *** ### applyCredits `creditNotes.applyCredits` Apply credit note credits to invoices **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.creditNotes.applyCredits({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `creditnote_id` | `string` | Yes | — | | `invoices` | `object[]` | Yes | — | > **invoices full type** > > ```ts theme={null} > { > invoice_id: string, > amount_applied: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### create `creditNotes.create` Create a credit note **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.creditNotes.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `customer_id` | `string` | Yes | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > item_id?: string, > name?: string, > description?: string, > rate?: number, > quantity?: number, > unit?: string, > tax_id?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `creditnote` | `object` | No | — | > **creditnote full type** > > ```ts theme={null} > { > creditnote_id: string, > creditnote_number?: string, > customer_id?: string, > status?: string, > total?: number, > balance?: number > } > ``` *** ### email `creditNotes.email` Email a credit note **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.creditNotes.email({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `creditnote_id` | `string` | Yes | — | | `to_mail_ids` | `string[]` | No | — | | `cc_mail_ids` | `string[]` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### get `creditNotes.get` Get a credit note **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.creditNotes.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `creditnote_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `creditnote` | `object` | No | — | > **creditnote full type** > > ```ts theme={null} > { > creditnote_id: string, > creditnote_number?: string, > customer_id?: string, > status?: string, > total?: number, > balance?: number > } > ``` *** ### getEmailContent `creditNotes.getEmailContent` Get credit note email content **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.creditNotes.getEmailContent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `creditnote_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### list `creditNotes.list` List credit notes **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.creditNotes.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search_text` | `string` | No | — | | `status` | `string` | No | — | | `customer_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `creditnotes` | `object[]` | Yes | — | | `page_context` | `object` | No | — | > **creditnotes full type** > > ```ts theme={null} > { > creditnote_id: string, > creditnote_number?: string, > customer_id?: string, > status?: string, > total?: number, > balance?: number > }[] > ``` > **page\_context full type** > > ```ts theme={null} > { > page?: number, > per_page?: number, > has_more_page?: boolean, > report_name?: string, > applied_filter?: string, > sort_column?: string, > sort_order?: string > } > ``` *** ## Currencies ### list `currencies.list` List currencies **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.currencies.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `currencies` | `object[]` | Yes | — | > **currencies full type** > > ```ts theme={null} > { > }[] > ``` *** ## Customer Payments ### create `customerPayments.create` Create a customer payment **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.customerPayments.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `customer_id` | `string` | Yes | — | | `amount` | `number` | Yes | — | | `invoices` | `object[]` | No | — | > **invoices full type** > > ```ts theme={null} > { > invoice_id: string, > amount_applied?: number > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `payment` | `object` | No | — | > **payment full type** > > ```ts theme={null} > { > } > ``` *** ## Invoices ### addAttachment `invoices.addAttachment` Upload an invoice attachment **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.invoices.addAttachment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | | `filename` | `string` | Yes | — | | `content_base64` | `string` | Yes | — | | `content_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### addComment `invoices.addComment` Add an invoice comment **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.invoices.addComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | | `description` | `string` | Yes | — | | `show_comment_to_clients` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `comment` | `object` | No | — | > **comment full type** > > ```ts theme={null} > { > } > ``` *** ### bulkEmail `invoices.bulkEmail` Bulk email invoices **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.invoices.bulkEmail({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_ids` | `string[]` | Yes | — | | `contact_id` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### bulkExport `invoices.bulkExport` Bulk export invoices as PDF **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.invoices.bulkExport({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `content_type` | `string` | No | — | | `content_base64` | `string` | No | — | *** ### bulkPrint `invoices.bulkPrint` Bulk print invoices as PDF **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.invoices.bulkPrint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `content_type` | `string` | No | — | | `content_base64` | `string` | No | — | *** ### cancelWriteOff `invoices.cancelWriteOff` Cancel an invoice write-off **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.invoices.cancelWriteOff({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### create `invoices.create` Create an invoice **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.invoices.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `customer_id` | `string` | Yes | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > item_id?: string, > name?: string, > description?: string, > rate?: number, > quantity?: number, > unit?: string, > tax_id?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `invoice` | `object` | No | — | > **invoice full type** > > ```ts theme={null} > { > invoice_id: string, > invoice_number?: string, > customer_id?: string, > customer_name?: string, > status?: string, > date?: string, > total?: number, > balance?: number > } > ``` *** ### delete `invoices.delete` Delete an invoice \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.invoices.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### deleteAttachment `invoices.deleteAttachment` Delete an invoice attachment \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.invoices.deleteAttachment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### deleteComment `invoices.deleteComment` Delete an invoice comment \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.invoices.deleteComment({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | | `comment_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### disablePaymentReminder `invoices.disablePaymentReminder` Disable invoice payment reminders **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.invoices.disablePaymentReminder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### email `invoices.email` Email an invoice **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.invoices.email({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | | `to_mail_ids` | `string[]` | No | — | | `cc_mail_ids` | `string[]` | No | — | | `subject` | `string` | No | — | | `body` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### enablePaymentReminder `invoices.enablePaymentReminder` Enable invoice payment reminders **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.invoices.enablePaymentReminder({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### list `invoices.list` List invoices **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.invoices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `invoices` | `object[]` | Yes | — | | `page_context` | `object` | No | — | > **invoices full type** > > ```ts theme={null} > { > invoice_id: string, > invoice_number?: string, > customer_id?: string, > customer_name?: string, > status?: string, > date?: string, > total?: number, > balance?: number > }[] > ``` > **page\_context full type** > > ```ts theme={null} > { > page?: number, > per_page?: number, > has_more_page?: boolean, > report_name?: string, > applied_filter?: string, > sort_column?: string, > sort_order?: string > } > ``` *** ### listPayments `invoices.listPayments` List payments on an invoice **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.invoices.listPayments({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `invoice_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `payments` | `object[]` | Yes | — | > **payments full type** > > ```ts theme={null} > { > }[] > ``` *** ## Item Groups ### create `itemGroups.create` Create an item group **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.itemGroups.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `group_name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `itemgroup` | `object` | No | — | > **itemgroup full type** > > ```ts theme={null} > { > } > ``` *** ### deactivate `itemGroups.deactivate` Mark an item group inactive **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.itemGroups.deactivate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `itemgroup_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### delete `itemGroups.delete` Delete an item group \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.itemGroups.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `itemgroup_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### list `itemGroups.list` List item groups **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.itemGroups.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `itemgroups` | `object[]` | Yes | — | | `page_context` | `object` | No | — | > **itemgroups full type** > > ```ts theme={null} > { > }[] > ``` > **page\_context full type** > > ```ts theme={null} > { > page?: number, > per_page?: number, > has_more_page?: boolean, > report_name?: string, > applied_filter?: string, > sort_column?: string, > sort_order?: string > } > ``` *** ## Items ### create `items.create` Create an inventory item **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.items.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `name` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `item` | `object` | No | — | > **item full type** > > ```ts theme={null} > { > item_id: string, > name: string, > sku?: string, > status?: string, > rate?: number, > purchase_rate?: number, > item_type?: string, > product_type?: string, > stock_on_hand?: number, > available_stock?: number, > description?: string > } > ``` *** ### deactivate `items.deactivate` Mark an item inactive **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.items.deactivate({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### delete `items.delete` Delete an item \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.items.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### deleteImage `items.deleteImage` Delete an item image \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.items.deleteImage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `item_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### list `items.list` List inventory items **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.items.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `items` | `object[]` | Yes | — | | `page_context` | `object` | No | — | > **items full type** > > ```ts theme={null} > { > item_id: string, > name: string, > sku?: string, > status?: string, > rate?: number, > purchase_rate?: number, > item_type?: string, > product_type?: string, > stock_on_hand?: number, > available_stock?: number, > description?: string > }[] > ``` > **page\_context full type** > > ```ts theme={null} > { > page?: number, > per_page?: number, > has_more_page?: boolean, > report_name?: string, > applied_filter?: string, > sort_column?: string, > sort_order?: string > } > ``` *** ## Organizations ### list `organizations.list` List organizations the user can access **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.organizations.list({}); ``` **Input:** *empty object* **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `organizations` | `object[]` | Yes | — | > **organizations full type** > > ```ts theme={null} > { > organization_id: string, > name: string, > is_default_org?: boolean, > contact_name?: string, > email?: string, > is_org_active?: boolean, > currency_code?: string, > currency_id?: string, > currency_symbol?: string, > time_zone?: string, > language_code?: string, > fiscal_year_start_month?: number > }[] > ``` *** ## Packages ### bulkPrint `packages.bulkPrint` Bulk print package slips as PDF **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.packages.bulkPrint({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `package_ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `content_type` | `string` | No | — | | `content_base64` | `string` | No | — | *** ### create `packages.create` Create a package for a sales order **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.packages.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `salesorder_id` | `string` | Yes | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > item_id?: string, > name?: string, > description?: string, > rate?: number, > quantity?: number, > unit?: string, > tax_id?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `package` | `object` | No | — | > **package full type** > > ```ts theme={null} > { > } > ``` *** ### delete `packages.delete` Delete a package \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.packages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `package_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ## Purchase Orders ### create `purchaseOrders.create` Create a purchase order **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.purchaseOrders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `vendor_id` | `string` | Yes | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > item_id?: string, > name?: string, > description?: string, > rate?: number, > quantity?: number, > unit?: string, > tax_id?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `purchaseorder` | `object` | No | — | > **purchaseorder full type** > > ```ts theme={null} > { > } > ``` *** ### list `purchaseOrders.list` List purchase orders **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.purchaseOrders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `purchaseorders` | `object[]` | Yes | — | | `page_context` | `object` | No | — | > **purchaseorders full type** > > ```ts theme={null} > { > }[] > ``` > **page\_context full type** > > ```ts theme={null} > { > page?: number, > per_page?: number, > has_more_page?: boolean, > report_name?: string, > applied_filter?: string, > sort_column?: string, > sort_order?: string > } > ``` *** ## Sales Orders ### bulkDelete `salesOrders.bulkDelete` Bulk delete sales orders \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.salesOrders.bulkDelete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `salesorder_ids` | `string[]` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### create `salesOrders.create` Create a sales order **Risk:** `write` ```ts theme={null} await corsair.zohoinventory.api.salesOrders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `customer_id` | `string` | Yes | — | | `line_items` | `object[]` | No | — | > **line\_items full type** > > ```ts theme={null} > { > item_id?: string, > name?: string, > description?: string, > rate?: number, > quantity?: number, > unit?: string, > tax_id?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `salesorder` | `object` | No | — | > **salesorder full type** > > ```ts theme={null} > { > salesorder_id: string, > salesorder_number?: string, > customer_id?: string, > customer_name?: string, > status?: string, > date?: string, > total?: number > } > ``` *** ### delete `salesOrders.delete` Delete a sales order \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohoinventory.api.salesOrders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `salesorder_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | *** ### get `salesOrders.get` Get a sales order **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.salesOrders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `salesorder_id` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `salesorder` | `object` | No | — | > **salesorder full type** > > ```ts theme={null} > { > salesorder_id: string, > salesorder_number?: string, > customer_id?: string, > customer_name?: string, > status?: string, > date?: string, > total?: number > } > ``` *** ### list `salesOrders.list` List sales orders **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.salesOrders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | | `page` | `number` | No | — | | `per_page` | `number` | No | — | | `search_text` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `salesorders` | `object[]` | Yes | — | | `page_context` | `object` | No | — | > **salesorders full type** > > ```ts theme={null} > { > salesorder_id: string, > salesorder_number?: string, > customer_id?: string, > customer_name?: string, > status?: string, > date?: string, > total?: number > }[] > ``` > **page\_context full type** > > ```ts theme={null} > { > page?: number, > per_page?: number, > has_more_page?: boolean, > report_name?: string, > applied_filter?: string, > sort_column?: string, > sort_order?: string > } > ``` *** ## Users ### getCurrent `users.getCurrent` Get the current authenticated user **Risk:** `read` ```ts theme={null} await corsair.zohoinventory.api.users.getCurrent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `organization_id` | `string` | Yes | Zoho Inventory organization\_id (query on every org-scoped call). | **Output** | Name | Type | Required | Description | | - | - | - | - | | `code` | `number` | No | — | | `message` | `string` | No | — | | `user` | `object` | No | — | > **user full type** > > ```ts theme={null} > { > user_id: string, > name: string, > email: string, > user_role?: string, > status?: string, > is_current_user?: boolean > } > ``` *** # Database Source: https://docs.corsair.dev/plugins/zohoinventory/database Zoho Inventory local sync: searchable entities, `.search()` filters, and operators. The Zoho Inventory plugin syncs data locally. Use `corsair.zohoinventory.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Contacts Path: `zohoinventory.db.contacts.search` ```ts theme={null} const rows = await corsair.zohoinventory.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `contact_id` | `string` | equals, contains, startsWith, endsWith, in | | `contact_name` | `string` | equals, contains, startsWith, endsWith, in | | `company_name` | `string` | equals, contains, startsWith, endsWith, in | | `contact_type` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `currency_code` | `string` | equals, contains, startsWith, endsWith, in | | `outstanding_receivable_amount` | `number` | equals, gt, gte, lt, lte, in | | `outstanding_payable_amount` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Credit Notes Path: `zohoinventory.db.creditNotes.search` ```ts theme={null} const rows = await corsair.zohoinventory.db.creditNotes.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `creditnote_id` | `string` | equals, contains, startsWith, endsWith, in | | `creditnote_number` | `string` | equals, contains, startsWith, endsWith, in | | `customer_id` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `total` | `number` | equals, gt, gte, lt, lte, in | | `balance` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Invoices Path: `zohoinventory.db.invoices.search` ```ts theme={null} const rows = await corsair.zohoinventory.db.invoices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `invoice_id` | `string` | equals, contains, startsWith, endsWith, in | | `invoice_number` | `string` | equals, contains, startsWith, endsWith, in | | `customer_id` | `string` | equals, contains, startsWith, endsWith, in | | `customer_name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `total` | `number` | equals, gt, gte, lt, lte, in | | `balance` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Items Path: `zohoinventory.db.items.search` ```ts theme={null} const rows = await corsair.zohoinventory.db.items.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `item_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `sku` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `rate` | `number` | equals, gt, gte, lt, lte, in | | `purchase_rate` | `number` | equals, gt, gte, lt, lte, in | | `item_type` | `string` | equals, contains, startsWith, endsWith, in | | `product_type` | `string` | equals, contains, startsWith, endsWith, in | | `stock_on_hand` | `number` | equals, gt, gte, lt, lte, in | | `available_stock` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Organizations Path: `zohoinventory.db.organizations.search` ```ts theme={null} const rows = await corsair.zohoinventory.db.organizations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `organization_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `contact_name` | `string` | equals, contains, startsWith, endsWith, in | | `email` | `string` | equals, contains, startsWith, endsWith, in | | `is_default_org` | `boolean` | equals | | `language_code` | `string` | equals, contains, startsWith, endsWith, in | | `fiscal_year_start_month` | `number` | equals, gt, gte, lt, lte, in | | `account_created_date` | `string` | equals, contains, startsWith, endsWith, in | | `time_zone` | `string` | equals, contains, startsWith, endsWith, in | | `is_org_active` | `boolean` | equals | | `currency_id` | `string` | equals, contains, startsWith, endsWith, in | | `currency_code` | `string` | equals, contains, startsWith, endsWith, in | | `currency_symbol` | `string` | equals, contains, startsWith, endsWith, in | | `currency_format` | `string` | equals, contains, startsWith, endsWith, in | | `price_precision` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Sales Orders Path: `zohoinventory.db.salesOrders.search` ```ts theme={null} const rows = await corsair.zohoinventory.db.salesOrders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `salesorder_id` | `string` | equals, contains, startsWith, endsWith, in | | `salesorder_number` | `string` | equals, contains, startsWith, endsWith, in | | `customer_id` | `string` | equals, contains, startsWith, endsWith, in | | `customer_name` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `date` | `string` | equals, contains, startsWith, endsWith, in | | `total` | `number` | equals, gt, gte, lt, lte, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/zohoinventory/overview Track stock, manage orders, and sync inventory across sales channels Use **Zoho Inventory** through Corsair: one client, typed API calls, local DB sync. Zoho Inventory uses regional datacenters. Pass `region` (`us` default, plus `eu`, `in`, `au`, `jp`, `ca`, `cn`, `sa`). API hosts are `www.zohoapis.*`. OAuth hosts are `accounts.zoho.*` except Canada, which uses `accounts.zohocloud.ca`. ```ts theme={null} zohoinventory({ region: 'eu' }) ``` Org-scoped calls send `organization_id` as a query parameter. Discover orgs with `organizations.list`, or use post-OAuth tenant linking (`tenant_external_id`). Optional `apiDomain` must be an HTTPS `zohoapis.*` origin. **What you get:** * 58 typed API operations * 6 synced entities (`contacts`, `creditNotes`, `invoices`, `items`, `organizations`, `salesOrders`) for fast `.search()` / `.list()` ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/zohoinventory ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/zohoinventory ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/zohoinventory ``` ```bash bun theme={null} bun add corsair @corsair-dev/zohoinventory ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { zohoinventory } from '@corsair-dev/zohoinventory'; export const corsair = createCorsair({ plugins: [ zohoinventory({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Zoho Inventory** — your tenants connect through Hub when they sign in. ```ts theme={null} zohoinventory({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Zoho Inventory OAuth app. ```ts theme={null} zohoinventory() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'zohoinventory', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`bills.list`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zohoinventory.api.bills.list({}); ``` **`bills.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zohoinventory.api.bills.create({}); ``` See the full list on the [API](/plugins/zohoinventory/api) page. ## Query synced data Synced entities support `tenant.zohoinventory.db..search()` and `.list()`: `contacts`, `creditNotes`, `invoices`, `items`, `organizations`, `salesOrders`. See [Database](/plugins/zohoinventory/database) for filters and operators. ## What's next > **[API reference](/plugins/zohoinventory/api)** > > Every `zohoinventory.api.*` operation with input and output types. > **[Database](/plugins/zohoinventory/database)** > > Synced entities, search filters, and operators. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # API Source: https://docs.corsair.dev/plugins/zohomail/api API reference for Zoho Mail: every `zohomail.api.*` operation with input and output types. Every `zohomail.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Folders ### create `folders.create` Create a new folder **Risk:** `write` ```ts theme={null} await corsair.zohomail.api.folders.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `folderName` | `string` | Yes | — | | `parentFolderId` | `string` | No | Parent folder ID for creating a sub-folder. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | No | — | | `folderName` | `string` | No | — | | `path` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `previousFolderId` | `string` | No | — | | `folderType` | `string` | No | — | | `isArchived` | `string \| boolean` | No | — | | `imapAccess` | `string \| boolean` | No | — | | `unreadCount` | `string \| number` | No | — | | `messageCount` | `string \| number` | No | — | | `URI` | `string` | No | — | *** ### delete `folders.delete` Delete a folder along with its emails and sub-folders \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohomail.api.folders.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `folderId` | `string` | Yes | — | **Output:** `void` *** ### get `folders.get` Get a specific folder **Risk:** `read` ```ts theme={null} await corsair.zohomail.api.folders.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `folderId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | No | — | | `folderName` | `string` | No | — | | `path` | `string` | No | — | | `parentFolderId` | `string` | No | — | | `previousFolderId` | `string` | No | — | | `folderType` | `string` | No | — | | `isArchived` | `string \| boolean` | No | — | | `imapAccess` | `string \| boolean` | No | — | | `unreadCount` | `string \| number` | No | — | | `messageCount` | `string \| number` | No | — | | `URI` | `string` | No | — | *** ### list `folders.list` List all mail folders **Risk:** `read` ```ts theme={null} await corsair.zohomail.api.folders.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | **Output** | Name | Type | Required | Description | | - | - | - | - | | `folders` | `object[]` | Yes | — | > **folders full type** > > ```ts theme={null} > { > folderId?: string, > folderName?: string, > path?: string, > parentFolderId?: string, > previousFolderId?: string, > folderType?: string, > isArchived?: string | boolean, > imapAccess?: string | boolean, > unreadCount?: string | number, > messageCount?: string | number, > URI?: string > }[] > ``` *** ### update `folders.update` Rename, mark all emails read, or empty a folder **Risk:** `write` ```ts theme={null} await corsair.zohomail.api.folders.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `folderId` | `string` | Yes | — | | `mode` | `rename \| markAsRead \| emptyFolder` | Yes | — | | `folderName` | `string` | No | New folder name. Required when mode = rename. | **Output:** `void` *** ## Messages ### delete `messages.delete` Permanently delete an email \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.zohomail.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `folderId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | **Output:** `void` *** ### get `messages.get` Get a specific email with its content **Risk:** `read` ```ts theme={null} await corsair.zohomail.api.messages.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `folderId` | `string` | Yes | — | | `messageId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `string` | No | — | | `threadId` | `string` | No | — | | `folderId` | `string` | No | — | | `subject` | `string` | No | — | | `summary` | `string` | No | — | | `fromAddress` | `string` | No | — | | `toAddress` | `string` | No | — | | `ccAddress` | `string` | No | — | | `sender` | `string` | No | — | | `sentDateInGMT` | `string` | No | — | | `receivedTime` | `string` | No | — | | `size` | `string` | No | — | | `hasAttachment` | `string` | No | — | | `hasInline` | `string` | No | — | | `status` | `string` | No | — | | `status2` | `string` | No | — | | `flagid` | `string` | No | — | | `priority` | `string` | No | — | | `calendarType` | `string` | No | — | | `threadCount` | `string` | No | — | | `content` | `string` | No | — | | `mailFormat` | `string` | No | — | | `returnPath` | `string` | No | — | | `bccAddress` | `string` | No | — | | `replyTo` | `string` | No | — | *** ### list `messages.list` List emails in a folder **Risk:** `read` ```ts theme={null} await corsair.zohomail.api.messages.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `folderId` | `string` | No | Folder to list emails from. Defaults to the Inbox when omitted. | | `start` | `number` | No | Starting sequence number (default 1). | | `limit` | `number` | No | Number of emails to retrieve, 1-200 (default 10). | | `status` | `read \| unread \| all` | No | — | | `sortBy` | `date \| messageId \| size` | No | — | | `sortorder` | `boolean` | No | true = ascending, false = descending (default). | | `includeto` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `messages` | `object[]` | Yes | — | > **messages full type** > > ```ts theme={null} > { > messageId?: string, > threadId?: string, > folderId?: string, > subject?: string, > summary?: string, > fromAddress?: string, > toAddress?: string, > ccAddress?: string, > sender?: string, > sentDateInGMT?: string, > receivedTime?: string, > size?: string, > hasAttachment?: string, > hasInline?: string, > status?: string, > status2?: string, > flagid?: string, > priority?: string, > calendarType?: string, > threadCount?: string > }[] > ``` *** ### markRead `messages.markRead` Mark emails as read **Risk:** `write` ```ts theme={null} await corsair.zohomail.api.messages.markRead({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `messageId` | `string[]` | Yes | — | **Output:** `void` *** ### markUnread `messages.markUnread` Mark emails as unread **Risk:** `write` ```ts theme={null} await corsair.zohomail.api.messages.markUnread({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `messageId` | `string[]` | Yes | — | **Output:** `void` *** ### move `messages.move` Move emails to another folder **Risk:** `write` ```ts theme={null} await corsair.zohomail.api.messages.move({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `messageId` | `string[]` | Yes | Message IDs to move. | | `destfolderId` | `string` | Yes | Destination folder ID. | **Output:** `void` *** ### send `messages.send` Send an email to one or more recipients **Risk:** `write` ```ts theme={null} await corsair.zohomail.api.messages.send({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `accountId` | `string` | No | Zoho Mail accountId. When omitted, the first account on the authenticated user is resolved automatically. | | `fromAddress` | `string` | Yes | Sender address; must belong to the authenticated account. | | `toAddress` | `string` | Yes | Recipient address(es), comma-separated. | | `ccAddress` | `string` | No | — | | `bccAddress` | `string` | No | — | | `subject` | `string` | No | — | | `content` | `string` | No | — | | `mailFormat` | `html \| plaintext` | No | — | | `askReceipt` | `yes \| no` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `string` | No | — | | `threadId` | `string` | No | — | | `folderId` | `string` | No | — | | `subject` | `string` | No | — | | `summary` | `string` | No | — | | `fromAddress` | `string` | No | — | | `toAddress` | `string` | No | — | | `ccAddress` | `string` | No | — | | `sender` | `string` | No | — | | `sentDateInGMT` | `string` | No | — | | `receivedTime` | `string` | No | — | | `size` | `string` | No | — | | `hasAttachment` | `string` | No | — | | `hasInline` | `string` | No | — | | `status` | `string` | No | — | | `status2` | `string` | No | — | | `flagid` | `string` | No | — | | `priority` | `string` | No | — | | `calendarType` | `string` | No | — | | `threadCount` | `string` | No | — | *** # Database Source: https://docs.corsair.dev/plugins/zohomail/database Zoho Mail local sync: searchable entities, `.search()` filters, and operators. The Zoho Mail plugin syncs data locally. Use `corsair.zohomail.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Folders Path: `zohomail.db.folders.search` ```ts theme={null} const rows = await corsair.zohomail.db.folders.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `folderId` | `string` | equals, contains, startsWith, endsWith, in | | `folderName` | `string` | equals, contains, startsWith, endsWith, in | | `path` | `string` | equals, contains, startsWith, endsWith, in | | `parentFolderId` | `string` | equals, contains, startsWith, endsWith, in | | `folderType` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Messages Path: `zohomail.db.messages.search` ```ts theme={null} const rows = await corsair.zohomail.db.messages.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `messageId` | `string` | equals, contains, startsWith, endsWith, in | | `threadId` | `string` | equals, contains, startsWith, endsWith, in | | `folderId` | `string` | equals, contains, startsWith, endsWith, in | | `subject` | `string` | equals, contains, startsWith, endsWith, in | | `summary` | `string` | equals, contains, startsWith, endsWith, in | | `fromAddress` | `string` | equals, contains, startsWith, endsWith, in | | `toAddress` | `string` | equals, contains, startsWith, endsWith, in | | `ccAddress` | `string` | equals, contains, startsWith, endsWith, in | | `sender` | `string` | equals, contains, startsWith, endsWith, in | | `sentDateInGMT` | `string` | equals, contains, startsWith, endsWith, in | | `receivedTime` | `string` | equals, contains, startsWith, endsWith, in | | `size` | `string` | equals, contains, startsWith, endsWith, in | | `hasAttachment` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `flagid` | `string` | equals, contains, startsWith, endsWith, in | | `priority` | `string` | equals, contains, startsWith, endsWith, in | | `content` | `string` | equals, contains, startsWith, endsWith, in | | `createdAt` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/zohomail/get-credentials Step-by-step instructions for obtaining Zoho Mail OAuth 2.0 credentials. This guide walks you through obtaining all required credentials for the Zoho Mail plugin. ## Authentication Method The Zoho Mail plugin uses OAuth 2.0 authentication exclusively. * **[`oauth_2`](/concepts/oauth)** (default) - OAuth 2.0 authentication ## Pick your region first Zoho runs region-specific datacenters. The OAuth (`accounts.zoho.*`) and Mail API (`mail.zoho.*`) hosts share the same top-level domain, and tokens issued in one region do **not** work in another. Register the plugin with the matching `region`: | Region | Domain | `region` value | | - | - | - | | United States | `zoho.com` | `'us'` (default) | | Europe | `zoho.eu` | `'eu'` | | India | `zoho.in` | `'in'` | | Australia | `zoho.com.au` | `'au'` | | Japan | `zoho.jp` | `'jp'` | | China | `zoho.com.cn` | `'cn'` | ```ts corsair.ts theme={null} zohomail({ region: 'eu' }) ``` Create the credentials below in the **same region's** API console (for example `https://api-console.zoho.eu` for the EU). ## OAuth 2.0 Setup ### Step 1: Create a Server-based Application 1. Go to the [Zoho API Console](https://api-console.zoho.com/) for your region 2. Click **Add Client** → **Server-based Applications** 3. Fill in: * **Client Name**: your application name * **Homepage URL**: your application URL * **Authorized Redirect URIs**: your callback URL (e.g. `https://yourapp.com/auth/zohomail/callback`) 4. Click **Create** 5. Copy the **Client ID** and **Client Secret** ### Step 2: Authorize the required scopes The plugin requests these scopes during the OAuth flow: * `ZohoMail.messages.ALL` — read, send, move, delete, and flag emails * `ZohoMail.folders.ALL` — list, create, update, and delete folders * `ZohoMail.accounts.READ` — resolve the account ID for the authenticated user Request `access_type=offline` so Zoho returns a **refresh token** (the plugin refreshes the access token automatically as it expires). > [!TIP] > > For quick local testing you can use the **Self Client** option in the API Console > to mint an authorization code, then exchange it for access and refresh tokens > without standing up a redirect endpoint. ### Step 3: Store credentials The preferred method is to store OAuth credentials in the database using the keys API: ```ts theme={null} await corsair.withTenant('default').keys.zohomail.setClientId('your-client-id'); await corsair.withTenant('default').keys.zohomail.setClientSecret('your-client-secret'); await corsair.withTenant('default').zohomail.keys.setAccessToken('your-access-token'); await corsair.withTenant('default').zohomail.keys.setRefreshToken('your-refresh-token'); ``` Alternatively, you can provide credentials directly in the plugin configuration: ```ts corsair.ts theme={null} zohomail({ authType: "oauth_2", region: "us", credentials: { clientId: process.env.ZOHO_CLIENT_ID, clientSecret: process.env.ZOHO_CLIENT_SECRET, accessToken: process.env.ZOHO_ACCESS_TOKEN, refreshToken: process.env.ZOHO_REFRESH_TOKEN, }, }) ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth 2.0 | Zoho API Console → your app | | Client Secret | OAuth 2.0 | Zoho API Console → your app | | Access Token | OAuth 2.0 | Obtained automatically after OAuth flow | | Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow (requires `access_type=offline`) | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/zohomail/overview Business email service for sending, reading, organizing messages, and mailbox management. Use **Zoho Mail** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. Zoho Mail runs region-specific datacenters. Pass `region` to the plugin factory (`'us'` default, plus `'eu'`, `'in'`, `'au'`, `'jp'`, `'cn'`) so the correct `accounts.zoho.*` and `mail.zoho.*` hosts are used: ```ts theme={null} zohomail({ region: 'eu' }) ``` Every Zoho Mail call is scoped to an `accountId`. Pass it explicitly, or omit it and the plugin resolves the first account on the authenticated user automatically (cached for the rest of the session). **What you get:** * 12 typed API operations * 2 synced entities (`folders`, `messages`) for fast `.search()` / `.list()` * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/zohomail ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/zohomail ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/zohomail ``` ```bash bun theme={null} bun add corsair @corsair-dev/zohomail ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { zohomail } from '@corsair-dev/zohomail'; export const corsair = createCorsair({ plugins: [ zohomail({ authType: 'managed', }), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **Managed OAuth (Recommended)** No setup required. Corsair hosts the OAuth app for **Zoho Mail** — your tenants connect through Hub when they sign in. Provider walkthrough: [Get Credentials](/plugins/zohomail/get-credentials). ```ts theme={null} zohomail({ authType: 'managed', }) ``` More: [Managed OAuth](/concepts/auth#managed) **OAuth 2.0** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Zoho Mail OAuth app. Provider walkthrough: [Get Credentials](/plugins/zohomail/get-credentials). ```ts theme={null} zohomail() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'zohomail', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`folders.get`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zohomail.api.folders.get({}); ``` **`folders.create`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zohomail.api.folders.create({}); ``` See the full list on the [API](/plugins/zohomail/api) page. ## Query synced data Synced entities support `tenant.zohomail.db..search()` and `.list()`: `folders`, `messages`. See [Database](/plugins/zohomail/database) for filters and operators. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/zohomail/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/zohomail/api)** > > Every `zohomail.api.*` operation with input and output types. > **[Database](/plugins/zohomail/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/zohomail/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/zohomail/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/zohomail/webhooks Zoho Mail incoming webhooks: event paths, payloads, and response data. The Zoho Mail plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/zohomail/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `challenge` * `handshake` (`challenge.handshake`) * `messages` * `received` (`messages.received`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Challenge ### Handshake `challenge.handshake` Zoho Mail initial webhook handshake via x-hook-secret header **Payload:** *empty object* > **Response data full type** > > ```ts theme={null} > { > hookSecret: string > } > ``` **`webhookHooks` example** ```ts theme={null} zohomail({ webhookHooks: { challenge: { handshake: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Messages ### Received `messages.received` A new email was received in the mailbox **Payload** | Name | Type | Required | Description | | - | - | - | - | | `messageId` | `string` | No | — | | `folderId` | `string` | No | — | | `subject` | `string` | No | — | | `summary` | `string` | No | — | | `html` | `string` | No | — | | `fromAddress` | `string` | No | — | | `toAddress` | `string` | No | — | | `ccAddress` | `string` | No | — | | `sender` | `string` | No | — | | `sentDateInGMT` | `string` | No | — | | `receivedTime` | `string` | No | — | | `size` | `string \| number` | No | — | > **Response data full type** > > ```ts theme={null} > { > messageId?: string, > folderId?: string, > subject?: string, > summary?: string, > html?: string, > fromAddress?: string, > toAddress?: string, > ccAddress?: string, > sender?: string, > sentDateInGMT?: string, > receivedTime?: string, > size?: string | number > } > ``` **`webhookHooks` example** ```ts theme={null} zohomail({ webhookHooks: { messages: { received: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/zoom/api API reference for Zoom: every `zoom.api.*` operation with input and output types. Every `zoom.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Archive Files ### list `archiveFiles.list` List all archived meeting or webinar files **Risk:** `read` ```ts theme={null} await corsair.zoom.api.archiveFiles.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_size` | `number` | No | — | | `next_page_token` | `string` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `type` | `number` | No | — | | `query_date_type` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_page_token` | `string` | No | — | | `page_size` | `number` | No | — | | `total_records` | `number` | No | — | | `from` | `string` | No | — | | `to` | `string` | No | — | | `meetings` | `object[]` | No | — | > **meetings full type** > > ```ts theme={null} > { > id?: string, > meeting_id?: string, > topic?: string, > type?: number, > start_time?: string, > file_count?: number, > file_size?: number, > status?: string, > archive_files?: { > }[] > }[] > ``` *** ## Devices ### list `devices.list` List all Zoom devices **Risk:** `read` ```ts theme={null} await corsair.zoom.api.devices.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_size` | `number` | No | — | | `next_page_token` | `string` | No | — | | `search_text` | `string` | No | — | | `platform_os` | `string` | No | — | | `device_vendor` | `string` | No | — | | `device_model` | `string` | No | — | | `device_status` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_page_token` | `string` | No | — | | `page_size` | `number` | No | — | | `total_records` | `number` | No | — | | `devices` | `object[]` | No | — | > **devices full type** > > ```ts theme={null} > { > id?: string, > device_name?: string, > manufacturer?: string, > model?: string, > platform_os?: string, > device_status?: number, > mac_address?: string, > serial_number?: string, > last_online?: string, > tag?: string, > enrollment_token?: string > }[] > ``` *** ## Meetings ### addRegistrant `meetings.addRegistrant` Add a registrant to a meeting **Risk:** `write` ```ts theme={null} await corsair.zoom.api.meetings.addRegistrant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | | `email` | `string` | Yes | — | | `first_name` | `string` | Yes | — | | `last_name` | `string` | No | — | | `auto_approve` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `registrant_id` | `string` | No | — | | `id` | `number` | No | — | | `topic` | `string` | No | — | | `start_time` | `string` | No | — | | `join_url` | `string` | No | — | *** ### create `meetings.create` Create a new meeting for the authenticated user **Risk:** `write` ```ts theme={null} await corsair.zoom.api.meetings.create({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `topic` | `string` | No | — | | `type` | `number` | No | — | | `start_time` | `string` | No | — | | `duration` | `number` | No | — | | `timezone` | `string` | No | — | | `agenda` | `string` | No | — | | `password` | `string` | No | — | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > host_video?: boolean, > participant_video?: boolean, > cn_meeting?: boolean, > in_meeting?: boolean, > join_before_host?: boolean, > mute_upon_entry?: boolean, > watermark?: boolean, > use_pmi?: boolean, > approval_type?: number, > audio?: string, > auto_recording?: string, > waiting_room?: boolean > } > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `uuid` | `string` | No | — | | `host_id` | `string` | No | — | | `topic` | `string` | No | — | | `type` | `number` | No | — | | `status` | `string` | No | — | | `start_time` | `string` | No | — | | `duration` | `number` | No | — | | `timezone` | `string` | No | — | | `agenda` | `string` | No | — | | `created_at` | `string` | No | — | | `join_url` | `string` | No | — | | `password` | `string` | No | — | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > host_video?: boolean, > participant_video?: boolean, > cn_meeting?: boolean, > in_meeting?: boolean, > join_before_host?: boolean, > mute_upon_entry?: boolean, > watermark?: boolean, > use_pmi?: boolean, > approval_type?: number, > audio?: string, > auto_recording?: string, > waiting_room?: boolean > } > ``` *** ### get `meetings.get` Get details of a specific meeting **Risk:** `read` ```ts theme={null} await corsair.zoom.api.meetings.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `uuid` | `string` | No | — | | `host_id` | `string` | No | — | | `topic` | `string` | No | — | | `type` | `number` | No | — | | `status` | `string` | No | — | | `start_time` | `string` | No | — | | `duration` | `number` | No | — | | `timezone` | `string` | No | — | | `agenda` | `string` | No | — | | `created_at` | `string` | No | — | | `join_url` | `string` | No | — | | `password` | `string` | No | — | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > host_video?: boolean, > participant_video?: boolean, > cn_meeting?: boolean, > in_meeting?: boolean, > join_before_host?: boolean, > mute_upon_entry?: boolean, > watermark?: boolean, > use_pmi?: boolean, > approval_type?: number, > audio?: string, > auto_recording?: string, > waiting_room?: boolean > } > ``` *** ### getSummary `meetings.getSummary` Get the AI-generated summary of a meeting **Risk:** `read` ```ts theme={null} await corsair.zoom.api.meetings.getSummary({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `meeting_host_id` | `string` | No | — | | `meeting_host_email` | `string` | No | — | | `meeting_uuid` | `string` | No | — | | `meeting_id` | `number` | No | — | | `meeting_topic` | `string` | No | — | | `meeting_start_time` | `string` | No | — | | `meeting_end_time` | `string` | No | — | | `summary_start_time` | `string` | No | — | | `summary_end_time` | `string` | No | — | | `summary_created_time` | `string` | No | — | | `summary_last_modified_time` | `string` | No | — | | `summary_title` | `string` | No | — | | `summary_overview` | `string` | No | — | | `summary_details` | `object[]` | No | — | | `next_steps` | `string[]` | No | — | | `edited_summary` | `object` | No | — | > **summary\_details full type** > > ```ts theme={null} > { > }[] > ``` > **edited\_summary full type** > > ```ts theme={null} > { > } > ``` *** ### list `meetings.list` List all meetings for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.zoom.api.meetings.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | — | | `page_size` | `number` | No | — | | `next_page_token` | `string` | No | — | | `page_number` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | No | — | | `page_number` | `number` | No | — | | `page_size` | `number` | No | — | | `total_records` | `number` | No | — | | `next_page_token` | `string` | No | — | | `meetings` | `object[]` | No | — | > **meetings full type** > > ```ts theme={null} > { > id?: number, > uuid?: string, > host_id?: string, > topic?: string, > type?: number, > status?: string, > start_time?: string, > duration?: number, > timezone?: string, > agenda?: string, > created_at?: string, > join_url?: string, > password?: string, > settings?: { > host_video?: boolean, > participant_video?: boolean, > cn_meeting?: boolean, > in_meeting?: boolean, > join_before_host?: boolean, > mute_upon_entry?: boolean, > watermark?: boolean, > use_pmi?: boolean, > approval_type?: number, > audio?: string, > auto_recording?: string, > waiting_room?: boolean > } > }[] > ``` *** ### update `meetings.update` Update a meeting **Risk:** `write` ```ts theme={null} await corsair.zoom.api.meetings.update({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | | `topic` | `string` | No | — | | `type` | `number` | No | — | | `start_time` | `string` | No | — | | `duration` | `number` | No | — | | `timezone` | `string` | No | — | | `agenda` | `string` | No | — | | `password` | `string` | No | — | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > host_video?: boolean, > participant_video?: boolean, > cn_meeting?: boolean, > in_meeting?: boolean, > join_before_host?: boolean, > mute_upon_entry?: boolean, > watermark?: boolean, > use_pmi?: boolean, > approval_type?: number, > audio?: string, > auto_recording?: string, > waiting_room?: boolean > } > ``` **Output:** *empty object* *** ## Participants ### getPastMeeting `participants.getPastMeeting` Get participants of a past meeting **Risk:** `read` ```ts theme={null} await corsair.zoom.api.participants.getPastMeeting({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | | `page_size` | `number` | No | — | | `next_page_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_page_token` | `string` | No | — | | `page_count` | `number` | No | — | | `page_size` | `number` | No | — | | `total_records` | `number` | No | — | | `participants` | `object[]` | No | — | > **participants full type** > > ```ts theme={null} > { > id?: string, > user_id?: string, > user_name?: string, > device?: string, > ip_address?: string, > location?: string, > network_type?: string, > microphone?: string, > speaker?: string, > camera?: string, > data_center?: string, > connection_type?: string, > join_time?: string, > leave_time?: string, > share_application?: boolean, > share_desktop?: boolean, > share_whiteboard?: boolean, > recording?: boolean, > status?: string > }[] > ``` *** ## Recordings ### deleteMeeting `recordings.deleteMeeting` Delete cloud recordings for a meeting **Risk:** `destructive` ```ts theme={null} await corsair.zoom.api.recordings.deleteMeeting({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | | `action` | `string` | No | — | **Output:** *empty object* *** ### getMeeting `recordings.getMeeting` Get cloud recordings for a specific meeting **Risk:** `read` ```ts theme={null} await corsair.zoom.api.recordings.getMeeting({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `meetingId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `uuid` | `string` | No | — | | `id` | `number` | No | — | | `account_id` | `string` | No | — | | `host_id` | `string` | No | — | | `topic` | `string` | No | — | | `type` | `number` | No | — | | `start_time` | `string` | No | — | | `timezone` | `string` | No | — | | `duration` | `number` | No | — | | `total_size` | `number` | No | — | | `recording_count` | `number` | No | — | | `recording_files` | `object[]` | No | — | | `password` | `string` | No | — | | `share_url` | `string` | No | — | > **recording\_files full type** > > ```ts theme={null} > { > id?: string, > meeting_id?: string, > recording_type?: string, > file_type?: string, > file_size?: number, > play_url?: string, > download_url?: string, > status?: string, > recording_start?: string, > recording_end?: string > }[] > ``` *** ### listAll `recordings.listAll` List all cloud recordings for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.zoom.api.recordings.listAll({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | No | — | | `to` | `string` | No | — | | `page_size` | `number` | No | — | | `next_page_token` | `string` | No | — | | `mc` | `string` | No | — | | `trash` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `from` | `string` | No | — | | `to` | `string` | No | — | | `page_count` | `number` | No | — | | `page_size` | `number` | No | — | | `total_records` | `number` | No | — | | `next_page_token` | `string` | No | — | | `meetings` | `object[]` | No | — | > **meetings full type** > > ```ts theme={null} > { > uuid?: string, > id?: number, > account_id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > timezone?: string, > duration?: number, > total_size?: number, > recording_count?: number, > recording_files?: { > id?: string, > meeting_id?: string, > recording_type?: string, > file_type?: string, > file_size?: number, > play_url?: string, > download_url?: string, > status?: string, > recording_start?: string, > recording_end?: string > }[] > }[] > ``` *** ## Reports ### dailyUsage `reports.dailyUsage` Get the daily usage report for a given month **Risk:** `read` ```ts theme={null} await corsair.zoom.api.reports.dailyUsage({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `month` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `year` | `number` | No | — | | `month` | `number` | No | — | | `dates` | `object[]` | No | — | > **dates full type** > > ```ts theme={null} > { > date?: string, > new_user?: number, > meetings?: number, > participants?: number, > meeting_minutes?: number > }[] > ``` *** ## Webinars ### addRegistrant `webinars.addRegistrant` Add a registrant to a webinar **Risk:** `write` ```ts theme={null} await corsair.zoom.api.webinars.addRegistrant({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webinarId` | `string` | Yes | — | | `email` | `string` | Yes | — | | `first_name` | `string` | Yes | — | | `last_name` | `string` | No | — | | `auto_approve` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | No | — | | `topic` | `string` | No | — | | `start_time` | `string` | No | — | | `join_url` | `string` | No | — | | `registrant_id` | `string` | No | — | *** ### get `webinars.get` Get details of a specific webinar **Risk:** `read` ```ts theme={null} await corsair.zoom.api.webinars.get({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webinarId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `id` | `number` | No | — | | `uuid` | `string` | No | — | | `host_id` | `string` | No | — | | `topic` | `string` | No | — | | `type` | `number` | No | — | | `status` | `string` | No | — | | `start_time` | `string` | No | — | | `duration` | `number` | No | — | | `timezone` | `string` | No | — | | `agenda` | `string` | No | — | | `created_at` | `string` | No | — | | `join_url` | `string` | No | — | | `password` | `string` | No | — | | `settings` | `object` | No | — | > **settings full type** > > ```ts theme={null} > { > host_video?: boolean, > panelists_video?: boolean, > practice_session?: boolean, > hd_video?: boolean, > approval_type?: number, > audio?: string, > auto_recording?: string, > enforce_login?: boolean, > registrants_restrict_number?: number, > meeting_authentication?: boolean > } > ``` *** ### list `webinars.list` List all webinars for the authenticated user **Risk:** `read` ```ts theme={null} await corsair.zoom.api.webinars.list({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `page_size` | `number` | No | — | | `page_number` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `page_count` | `number` | No | — | | `page_number` | `number` | No | — | | `page_size` | `number` | No | — | | `total_records` | `number` | No | — | | `next_page_token` | `string` | No | — | | `webinars` | `object[]` | No | — | > **webinars full type** > > ```ts theme={null} > { > id?: number, > uuid?: string, > host_id?: string, > topic?: string, > type?: number, > status?: string, > start_time?: string, > duration?: number, > timezone?: string, > agenda?: string, > created_at?: string, > join_url?: string, > password?: string, > settings?: { > host_video?: boolean, > panelists_video?: boolean, > practice_session?: boolean, > hd_video?: boolean, > approval_type?: number, > audio?: string, > auto_recording?: string, > enforce_login?: boolean, > registrants_restrict_number?: number, > meeting_authentication?: boolean > } > }[] > ``` *** ### listParticipants `webinars.listParticipants` List participants of a past webinar **Risk:** `read` ```ts theme={null} await corsair.zoom.api.webinars.listParticipants({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `webinarId` | `string` | Yes | — | | `page_size` | `number` | No | — | | `next_page_token` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `next_page_token` | `string` | No | — | | `page_count` | `number` | No | — | | `page_size` | `number` | No | — | | `total_records` | `number` | No | — | | `participants` | `object[]` | No | — | > **participants full type** > > ```ts theme={null} > { > id?: string, > user_id?: string, > user_name?: string, > device?: string, > ip_address?: string, > location?: string, > network_type?: string, > microphone?: string, > speaker?: string, > camera?: string, > data_center?: string, > connection_type?: string, > join_time?: string, > leave_time?: string, > share_application?: boolean, > share_desktop?: boolean, > share_whiteboard?: boolean, > recording?: boolean, > status?: string > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/zoom/database Zoom local sync: searchable entities, `.search()` filters, and operators. The Zoom plugin syncs data locally. Use `corsair.zoom.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Archive Files Path: `zoom.db.archiveFiles.search` ```ts theme={null} const rows = await corsair.zoom.db.archiveFiles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `meeting_id` | `string` | equals, contains, startsWith, endsWith, in | | `topic` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | | `start_time` | `string` | equals, contains, startsWith, endsWith, in | | `file_count` | `number` | equals, gt, gte, lt, lte, in | | `file_size` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Devices Path: `zoom.db.devices.search` ```ts theme={null} const rows = await corsair.zoom.db.devices.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `device_name` | `string` | equals, contains, startsWith, endsWith, in | | `manufacturer` | `string` | equals, contains, startsWith, endsWith, in | | `model` | `string` | equals, contains, startsWith, endsWith, in | | `platform_os` | `string` | equals, contains, startsWith, endsWith, in | | `device_status` | `number` | equals, gt, gte, lt, lte, in | | `mac_address` | `string` | equals, contains, startsWith, endsWith, in | | `serial_number` | `string` | equals, contains, startsWith, endsWith, in | | `last_online` | `string` | equals, contains, startsWith, endsWith, in | | `tag` | `string` | equals, contains, startsWith, endsWith, in | | `enrollment_token` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Meetings Path: `zoom.db.meetings.search` ```ts theme={null} const rows = await corsair.zoom.db.meetings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `host_id` | `string` | equals, contains, startsWith, endsWith, in | | `topic` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `start_time` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `agenda` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `join_url` | `string` | equals, contains, startsWith, endsWith, in | | `password` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Participants Path: `zoom.db.participants.search` ```ts theme={null} const rows = await corsair.zoom.db.participants.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `user_id` | `string` | equals, contains, startsWith, endsWith, in | | `user_name` | `string` | equals, contains, startsWith, endsWith, in | | `device` | `string` | equals, contains, startsWith, endsWith, in | | `ip_address` | `string` | equals, contains, startsWith, endsWith, in | | `location` | `string` | equals, contains, startsWith, endsWith, in | | `network_type` | `string` | equals, contains, startsWith, endsWith, in | | `microphone` | `string` | equals, contains, startsWith, endsWith, in | | `speaker` | `string` | equals, contains, startsWith, endsWith, in | | `camera` | `string` | equals, contains, startsWith, endsWith, in | | `data_center` | `string` | equals, contains, startsWith, endsWith, in | | `connection_type` | `string` | equals, contains, startsWith, endsWith, in | | `join_time` | `string` | equals, contains, startsWith, endsWith, in | | `leave_time` | `string` | equals, contains, startsWith, endsWith, in | | `share_application` | `boolean` | equals | | `share_desktop` | `boolean` | equals | | `share_whiteboard` | `boolean` | equals | | `recording` | `boolean` | equals | | `status` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Recordings Path: `zoom.db.recordings.search` ```ts theme={null} const rows = await corsair.zoom.db.recordings.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `meeting_id` | `string` | equals, contains, startsWith, endsWith, in | | `recording_type` | `string` | equals, contains, startsWith, endsWith, in | | `file_type` | `string` | equals, contains, startsWith, endsWith, in | | `file_size` | `number` | equals, gt, gte, lt, lte, in | | `play_url` | `string` | equals, contains, startsWith, endsWith, in | | `download_url` | `string` | equals, contains, startsWith, endsWith, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `recording_start` | `string` | equals, contains, startsWith, endsWith, in | | `recording_end` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Webinars Path: `zoom.db.webinars.search` ```ts theme={null} const rows = await corsair.zoom.db.webinars.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `number` | equals, gt, gte, lt, lte, in | | `uuid` | `string` | equals, contains, startsWith, endsWith, in | | `host_id` | `string` | equals, contains, startsWith, endsWith, in | | `topic` | `string` | equals, contains, startsWith, endsWith, in | | `type` | `number` | equals, gt, gte, lt, lte, in | | `status` | `string` | equals, contains, startsWith, endsWith, in | | `start_time` | `string` | equals, contains, startsWith, endsWith, in | | `duration` | `number` | equals, gt, gte, lt, lte, in | | `timezone` | `string` | equals, contains, startsWith, endsWith, in | | `agenda` | `string` | equals, contains, startsWith, endsWith, in | | `created_at` | `string` | equals, contains, startsWith, endsWith, in | | `join_url` | `string` | equals, contains, startsWith, endsWith, in | | `password` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Get Credentials Source: https://docs.corsair.dev/plugins/zoom/get-credentials Step-by-step instructions for obtaining Zoom OAuth credentials. ## Authentication Method * **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 ## OAuth App Setup ### Step 1: Create a Zoom App 1. Log in to the [Zoom Marketplace](https://marketplace.zoom.us) 2. Click **Develop** → **Build App** 3. Choose **OAuth** as the app type 4. Fill in the app name and click **Create** ### Step 2: Configure OAuth Settings 1. In your app settings, go to **OAuth** 2. Add a redirect URL (e.g., `http://localhost:3456/callback`) 3. Copy your **Client ID** and **Client Secret** ### Step 3: Store Credentials ```bash theme={null} pnpm corsair setup --plugin=zoom client_id=your-client-id client_secret=your-client-secret ``` ### Step 4: Authorize ```bash theme={null} pnpm corsair auth --plugin=zoom ``` This opens a browser window to complete the OAuth flow. Tokens are saved automatically. ## Webhook Setup (Optional) 1. In your Zoom app, go to **Feature** → **Event Subscriptions** 2. Add a subscription and configure your endpoint URL 3. Copy the **Secret Token** ```bash theme={null} pnpm corsair setup --plugin=zoom webhook_signature=your-secret-token ``` ## Required Credentials Summary | Credential | Required For | Where to Find | | - | - | - | | Client ID | OAuth flow | Zoom Marketplace → App credentials | | Client Secret | OAuth flow | Zoom Marketplace → App credentials | | Webhook Secret Token | Webhook verification | App → Event Subscriptions | For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). # Overview Source: https://docs.corsair.dev/plugins/zoom/overview Video conferencing platform for meetings, webinars, recordings, and calendar scheduling. Use **Zoom** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 17 typed API operations * 6 synced entities (`archiveFiles`, `devices`, `meetings`, `participants`, `recordings`, `webinars`) for fast `.search()` / `.list()` * 8 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/zoom ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/zoom ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/zoom ``` ```bash bun theme={null} bun add corsair @corsair-dev/zoom ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { zoom } from '@corsair-dev/zoom'; export const corsair = createCorsair({ plugins: [ zoom(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your Zoom OAuth app. Provider walkthrough: [Get Credentials](/plugins/zoom/get-credentials). ```ts theme={null} zoom() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'zoom', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **List meetings** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zoom.api.meetings.list({}); ``` **Create a meeting** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zoom.api.meetings.create({ topic: 'Corsair standup', duration: 30 }); ``` See the full list on the [API](/plugins/zoom/api) page. ## Query synced data Search synced meetings without hitting Zoom. ```ts theme={null} const tenant = corsair.withTenant('acme'); const rows = await tenant.zoom.db.meetings.search({ data: {}, limit: 50, }); ``` Synced entities: `archiveFiles`, `devices`, `meetings`, `participants`, `recordings`, `webinars`. See [Database](/plugins/zoom/database) for filters and operators. ## Webhooks Fires when a Zoom meeting is created. ```ts theme={null} zoom({ webhookHooks: { meetings: { created: { after: async (ctx, result) => { console.log('Zoom meeting created:', result.data); } }, }, }, }) ``` Mount your framework handler once (see [Frameworks](/frameworks/next)), then point the provider at that URL. Full event list: [Webhooks](/plugins/zoom/webhooks). Concepts: [Webhooks](/concepts/webhooks), [Hooks](/concepts/hooks). ## What's next > **[API reference](/plugins/zoom/api)** > > Every `zoom.api.*` operation with input and output types. > **[Database](/plugins/zoom/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/zoom/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. > **[Get credentials](/plugins/zoom/get-credentials)** > > Provider-console walkthrough for keys and OAuth apps. # Webhooks Source: https://docs.corsair.dev/plugins/zoom/webhooks Zoom incoming webhooks: event paths, payloads, and response data. The Zoom plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/zoom/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `meetings` * `cancelled` (`meetings.cancelled`) * `created` (`meetings.created`) * `ended` (`meetings.ended`) * `participantJoined` (`meetings.participantJoined`) * `participantLeft` (`meetings.participantLeft`) * `started` (`meetings.started`) * `recordings` * `completed` (`recordings.completed`) * `webinars` * `started` (`webinars.started`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Meetings ### Cancelled `meetings.cancelled` A meeting has been cancelled or deleted **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `meeting.deleted` | Yes | — | | `event_ts` | `number` | No | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > }, > operator?: string, > operator_id?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: meeting.deleted, > event_ts?: number, > payload: { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > }, > operator?: string, > operator_id?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} zoom({ webhookHooks: { meetings: { cancelled: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Created `meetings.created` A meeting has been created **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `meeting.created` | Yes | — | | `event_ts` | `number` | No | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > }, > operator?: string, > operator_id?: string > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: meeting.created, > event_ts?: number, > payload: { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > }, > operator?: string, > operator_id?: string > } > } > ``` **`webhookHooks` example** ```ts theme={null} zoom({ webhookHooks: { meetings: { created: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Ended `meetings.ended` A meeting has ended **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `meeting.ended` | Yes | — | | `event_ts` | `number` | No | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: meeting.ended, > event_ts?: number, > payload: { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} zoom({ webhookHooks: { meetings: { ended: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Participant Joined `meetings.participantJoined` A participant joined a meeting **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `meeting.participant_joined` | Yes | — | | `event_ts` | `number` | No | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string, > participant?: { > user_id?: string, > user_name?: string, > id?: string, > join_time?: string, > leave_time?: string, > leave_reason?: string > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: meeting.participant_joined, > event_ts?: number, > payload: { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string, > participant?: { > user_id?: string, > user_name?: string, > id?: string, > join_time?: string, > leave_time?: string, > leave_reason?: string > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} zoom({ webhookHooks: { meetings: { participantJoined: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Participant Left `meetings.participantLeft` A participant left a meeting **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `meeting.participant_left` | Yes | — | | `event_ts` | `number` | No | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string, > participant?: { > user_id?: string, > user_name?: string, > id?: string, > join_time?: string, > leave_time?: string, > leave_reason?: string > } > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: meeting.participant_left, > event_ts?: number, > payload: { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string, > participant?: { > user_id?: string, > user_name?: string, > id?: string, > join_time?: string, > leave_time?: string, > leave_reason?: string > } > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} zoom({ webhookHooks: { meetings: { participantLeft: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Started `meetings.started` A meeting has started **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `meeting.started` | Yes | — | | `event_ts` | `number` | No | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: meeting.started, > event_ts?: number, > payload: { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} zoom({ webhookHooks: { meetings: { started: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Recordings ### Completed `recordings.completed` A cloud recording has completed processing **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `recording.completed` | Yes | — | | `event_ts` | `number` | No | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > account_id?: string, > object: { > uuid?: string, > id?: number, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > timezone?: string, > duration?: number, > total_size?: number, > recording_count?: number, > share_url?: string, > password?: string, > recording_files?: { > id?: string, > meeting_id?: string, > recording_start?: string, > recording_end?: string, > file_type?: string, > file_size?: number, > play_url?: string, > download_url?: string, > status?: string, > recording_type?: string > }[] > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: recording.completed, > event_ts?: number, > payload: { > account_id?: string, > object: { > uuid?: string, > id?: number, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > timezone?: string, > duration?: number, > total_size?: number, > recording_count?: number, > share_url?: string, > password?: string, > recording_files?: { > id?: string, > meeting_id?: string, > recording_start?: string, > recording_end?: string, > file_type?: string, > file_size?: number, > play_url?: string, > download_url?: string, > status?: string, > recording_type?: string > }[] > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} zoom({ webhookHooks: { recordings: { completed: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ## Webinars ### Started `webinars.started` A webinar has started **Payload** | Name | Type | Required | Description | | - | - | - | - | | `event` | `webinar.started` | Yes | — | | `event_ts` | `number` | No | — | | `payload` | `object` | Yes | — | > **payload full type** > > ```ts theme={null} > { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > } > } > ``` > **Response data full type** > > ```ts theme={null} > { > event: webinar.started, > event_ts?: number, > payload: { > account_id?: string, > object: { > uuid?: string, > id?: string, > host_id?: string, > topic?: string, > type?: number, > start_time?: string, > duration?: number, > timezone?: string > } > } > } > ``` **`webhookHooks` example** ```ts theme={null} zoom({ webhookHooks: { webinars: { started: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # API Source: https://docs.corsair.dev/plugins/zoominfo/api API reference for ZoomInfo: every `zoominfo.api.*` operation with input and output types. Every `zoominfo.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas. > [!NOTE] > > **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Zoominfo ### enrichCompany `zoominfo.enrichCompany` Enrich up to 25 companies from partial identifiers **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.enrichCompany({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `matchCompanyInput` | `object[]` | Yes | — | | `outputFields` | `string[]` | No | — | > **matchCompanyInput full type** > > ```ts theme={null} > { > companyId?: number | string, > companyName?: string, > companyWebsite?: string, > companyTicker?: string, > companyPhone?: string, > companyFax?: string, > companyStreet?: string, > companyCity?: string, > companyState?: string, > companyZipCode?: string, > companyCountry?: string, > ipAddress?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > outputFields?: string[][], > result: { > input?: { > }, > data: { > id?: number, > name?: string, > website?: string, > ticker?: string, > domainList?: string[], > logo?: string, > revenue?: number, > employeeCount?: number, > phone?: string, > street?: string, > city?: string, > state?: string, > zipCode?: string, > country?: string, > companyStatus?: string > }[] > }[] > } > ``` *** ### enrichContact `zoominfo.enrichContact` Enrich up to 25 contacts from partial identifiers **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.enrichContact({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `matchPersonInput` | `object[]` | Yes | — | | `outputFields` | `string[]` | No | — | > **matchPersonInput full type** > > ```ts theme={null} > { > personId?: number | string, > firstName?: string, > lastName?: string, > fullName?: string, > emailAddress?: string, > hashedEmail?: string, > phone?: string, > jobTitle?: string, > companyId?: number | string, > companyName?: string, > companyWebsite?: string > }[] > ``` **Output** | Name | Type | Required | Description | | - | - | - | - | | `success` | `boolean` | No | — | | `data` | `object` | Yes | — | > **data full type** > > ```ts theme={null} > { > outputFields?: string[][], > result: { > input?: { > }, > data: { > id?: number, > firstName?: string, > middleName?: string, > lastName?: string, > email?: string, > phone?: string, > mobilePhone?: string, > jobTitle?: string, > contactAccuracyScore?: number, > lastUpdatedDate?: string, > validDate?: string, > companyId?: number, > companyName?: string, > companyWebsite?: string > }[] > }[] > } > ``` *** ### enrichIntent `zoominfo.enrichIntent` Fetch intent signals for one company **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.enrichIntent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rpp` | `number` | No | — | | `page` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortOrder` | `asc \| ascending \| desc \| descending` | No | Defaults to desc. | | `companyId` | `number \| string` | No | — | | `companyName` | `string` | No | — | | `companyWebsite` | `string` | No | — | | `topics` | `string[]` | No | — | | `signalStartDate` | `string` | No | — | | `signalEndDate` | `string` | No | — | | `signalScoreMin` | `number` | No | — | | `signalScoreMax` | `number` | No | — | | `audienceStrengthMin` | `A \| B \| C \| D \| E` | No | — | | `audienceStrengthMax` | `A \| B \| C \| D \| E` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > category?: string, > topic?: string, > signalScore?: number, > audienceStrength?: string, > newSignal?: boolean, > signalDate?: string, > trend?: number, > recommendedContacts?: { > id?: number, > firstName?: string, > lastName?: string, > jobTitle?: string, > jobFunction?: { > name?: string, > department?: string > }[] > }[], > company?: { > id?: number, > name?: string, > website?: string, > hasOtherTopicConsumption?: boolean > } > }[] > ``` *** ### enrichLocation `zoominfo.enrichLocation` Fetch every known office location for one company **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.enrichLocation({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rpp` | `number` | No | — | | `page` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortOrder` | `asc \| ascending \| desc \| descending` | No | Defaults to desc. | | `companyId` | `string` | No | — | | `companyName` | `string` | No | — | | `companyWebsite` | `string` | No | — | | `street` | `string` | No | — | | `city` | `string` | No | — | | `state` | `string` | No | — | | `zipCode` | `string` | No | — | | `country` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > phone?: string, > fax?: string, > street?: string, > city?: string, > state?: string, > zipCode?: string, > country?: string, > company?: { > id?: number, > name?: string, > addressStatus?: string, > subUnitType?: string, > locationName?: string, > locationEmployeeCount?: number > } > }[] > ``` *** ### enrichNews `zoominfo.enrichNews` Fetch news articles for one company **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.enrichNews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `companyId` | `number \| string` | No | — | | `companyName` | `string` | No | — | | `companyWebsite` | `string` | No | — | | `categories` | `string[]` | No | — | | `url` | `string[]` | No | — | | `pageDateMin` | `string` | No | — | | `pageDateMax` | `string` | No | — | | `limit` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > domain?: string, > title?: string, > url?: string, > imageUrl?: string, > pageDate?: string, > description?: string, > categories?: string[], > company?: { > id?: number, > name?: string > }[] > }[] > ``` *** ### enrichScoop `zoominfo.enrichScoop` Fetch Scoops for one company **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.enrichScoop({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rpp` | `number` | No | — | | `page` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortOrder` | `asc \| ascending \| desc \| descending` | No | Defaults to desc. | | `companyId` | `number \| string` | No | — | | `companyName` | `string` | No | — | | `companyWebsite` | `string` | No | — | | `scoopType` | `string` | No | — | | `scoopTopic` | `string` | No | — | | `department` | `string` | No | — | | `publishedStartDate` | `string` | No | — | | `publishedEndDate` | `string` | No | — | | `updatedSinceCreation` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > publishedDate?: string, > originalPublishedDate?: string, > linkText?: string, > link?: string, > description?: string, > updateText?: string, > topics?: any[], > types?: { > id?: number, > type?: string > }[], > contacts?: any[], > company?: { > id?: number, > name?: string > } > }[] > ``` *** ### enrichTechnology `zoominfo.enrichTechnology` Fetch the technologies detected in one company's stack **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.enrichTechnology({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rpp` | `number` | No | — | | `page` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortOrder` | `asc \| ascending \| desc \| descending` | No | Defaults to desc. | | `companyId` | `number \| string` | No | — | | `companyName` | `string` | No | — | | `companyWebsite` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > tag?: string, > categoryParent?: string, > category?: string, > vendor?: string, > product?: string, > attribute?: string, > website?: string, > logo?: string, > domain?: string, > createdTime?: string, > modifiedTime?: string, > description?: string > }[] > ``` *** ### getCompanySearchInputFields `zoominfo.getCompanySearchInputFields` List the company search filters this account may use **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.getCompanySearchInputFields({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > fieldName: string, > fieldType?: string, > description?: string, > accessGranted?: string > }[] > ``` *** ### getContactSearchInputFields `zoominfo.getContactSearchInputFields` List the contact search filters this account may use **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.getContactSearchInputFields({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > fieldName: string, > fieldType?: string, > description?: string, > accessGranted?: string > }[] > ``` *** ### getIntentSearchInputFields `zoominfo.getIntentSearchInputFields` List the intent search filters this account may use **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.getIntentSearchInputFields({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > fieldName: string, > fieldType?: string, > description?: string, > accessGranted?: string > }[] > ``` *** ### getNewsSearchInputFields `zoominfo.getNewsSearchInputFields` List the news search filters this account may use **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.getNewsSearchInputFields({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > fieldName: string, > fieldType?: string, > description?: string, > accessGranted?: string > }[] > ``` *** ### getScoopSearchInputFields `zoominfo.getScoopSearchInputFields` List the scoop search filters this account may use **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.getScoopSearchInputFields({}); ``` **Input:** *empty object* **Output:** `object[]` > **Output full type** > > ```ts theme={null} > { > fieldName: string, > fieldType?: string, > description?: string, > accessGranted?: string > }[] > ``` *** ### searchCompanies `zoominfo.searchCompanies` Search companies by firmographics, location and technology **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.searchCompanies({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rpp` | `number` | No | — | | `page` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortOrder` | `asc \| ascending \| desc \| descending` | No | Defaults to desc. | | `companyDescription` | `string` | No | — | | `companyType` | `string` | No | — | | `companyRanking` | `string` | No | — | | `companyStructureIncludedSubUnitTypes` | `string` | No | — | | `subUnitTypes` | `string` | No | — | | `address` | `string` | No | — | | `street` | `string` | No | — | | `state` | `string` | No | — | | `zipCode` | `string` | No | — | | `country` | `string` | No | — | | `continent` | `string` | No | — | | `metroRegion` | `string` | No | — | | `excludedRegions` | `string` | No | — | | `zipCodeRadiusMiles` | `string` | No | — | | `locationSearchType` | `PersonOrHQ \| PersonAndHQ \| Person \| HQ \| PersonThenHQ` | No | — | | `hashTagString` | `string` | No | — | | `techAttributeTagList` | `string` | No | — | | `primaryIndustriesOnly` | `boolean` | No | — | | `industryCodes` | `string` | No | — | | `industryKeywords` | `string` | No | — | | `sicCodes` | `string` | No | — | | `naicsCodes` | `string` | No | — | | `revenue` | `string` | No | — | | `revenueMin` | `number` | No | — | | `revenueMax` | `number` | No | — | | `employeeCount` | `string` | No | — | | `employeeRangeMin` | `string` | No | — | | `employeeRangeMax` | `string` | No | — | | `fundingAmountMin` | `number` | No | — | | `fundingAmountMax` | `number` | No | — | | `fundingStartDate` | `string` | No | — | | `fundingEndDate` | `string` | No | — | | `oneYearEmployeeGrowthRateMin` | `string` | No | — | | `oneYearEmployeeGrowthRateMax` | `string` | No | — | | `twoYearEmployeeGrowthRateMin` | `string` | No | — | | `twoYearEmployeeGrowthRateMax` | `string` | No | — | | `zoominfoContactsMin` | `string` | No | — | | `zoominfoContactsMax` | `string` | No | — | | `companyId` | `string` | No | — | | `companyName` | `string` | No | — | | `companyWebsite` | `string` | No | — | | `parentId` | `string` | No | — | | `ultimateParentId` | `string` | No | — | | `companyTicker` | `string[]` | No | — | | `certified` | `0 \| 1` | No | — | | `excludeDefunctCompanies` | `boolean` | No | — | | `businessModel` | `B2C \| B2B \| B2G[]` | No | — | | `engagementStartDate` | `string` | No | — | | `engagementEndDate` | `string` | No | — | | `engagementType` | `email \| phone \| online meeting[]` | No | — | | `marketingDepartmentBudgetMin` | `number` | No | — | | `marketingDepartmentBudgetMax` | `number` | No | — | | `financeDepartmentBudgetMin` | `number` | No | — | | `financeDepartmentBudgetMax` | `number` | No | — | | `itDepartmentBudgetMin` | `number` | No | — | | `itDepartmentBudgetMax` | `number` | No | — | | `hrDepartmentBudgetMin` | `number` | No | — | | `hrDepartmentBudgetMax` | `number` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > name?: string > }[] > ``` *** ### searchContacts `zoominfo.searchContacts` Search contacts by name, title, seniority and company **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.searchContacts({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rpp` | `number` | No | — | | `page` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortOrder` | `asc \| ascending \| desc \| descending` | No | Defaults to desc. | | `companyDescription` | `string` | No | — | | `companyType` | `string` | No | — | | `companyRanking` | `string` | No | — | | `companyStructureIncludedSubUnitTypes` | `string` | No | — | | `subUnitTypes` | `string` | No | — | | `address` | `string` | No | — | | `street` | `string` | No | — | | `state` | `string` | No | — | | `zipCode` | `string` | No | — | | `country` | `string` | No | — | | `continent` | `string` | No | — | | `metroRegion` | `string` | No | — | | `excludedRegions` | `string` | No | — | | `zipCodeRadiusMiles` | `string` | No | — | | `locationSearchType` | `PersonOrHQ \| PersonAndHQ \| Person \| HQ \| PersonThenHQ` | No | — | | `hashTagString` | `string` | No | — | | `techAttributeTagList` | `string` | No | — | | `primaryIndustriesOnly` | `boolean` | No | — | | `industryCodes` | `string` | No | — | | `industryKeywords` | `string` | No | — | | `sicCodes` | `string` | No | — | | `naicsCodes` | `string` | No | — | | `revenue` | `string` | No | — | | `revenueMin` | `number` | No | — | | `revenueMax` | `number` | No | — | | `employeeCount` | `string` | No | — | | `employeeRangeMin` | `string` | No | — | | `employeeRangeMax` | `string` | No | — | | `fundingAmountMin` | `number` | No | — | | `fundingAmountMax` | `number` | No | — | | `fundingStartDate` | `string` | No | — | | `fundingEndDate` | `string` | No | — | | `oneYearEmployeeGrowthRateMin` | `string` | No | — | | `oneYearEmployeeGrowthRateMax` | `string` | No | — | | `twoYearEmployeeGrowthRateMin` | `string` | No | — | | `twoYearEmployeeGrowthRateMax` | `string` | No | — | | `zoominfoContactsMin` | `string` | No | — | | `zoominfoContactsMax` | `string` | No | — | | `companyId` | `string` | No | — | | `companyName` | `string` | No | — | | `companyWebsite` | `string` | No | — | | `parentId` | `string` | No | — | | `ultimateParentId` | `string` | No | — | | `personId` | `string` | No | — | | `emailAddress` | `string` | No | — | | `hashedEmail` | `string` | No | — | | `fullName` | `string` | No | — | | `firstName` | `string` | No | — | | `middleInitial` | `string` | No | — | | `lastName` | `string` | No | — | | `jobTitle` | `string` | No | — | | `excludeJobTitle` | `string` | No | — | | `managementLevel` | `string` | No | — | | `excludeManagementLevel` | `string` | No | — | | `department` | `string` | No | — | | `jobFunction` | `string` | No | — | | `boardMember` | `include \| exclude \| only` | No | — | | `hasBeenNotified` | `include \| exclude \| only` | No | — | | `companyPastOrPresent` | `present \| past \| pastAndPresent` | No | — | | `excludePartialProfiles` | `boolean` | No | — | | `executivesOnly` | `boolean` | No | — | | `requiredFields` | `string` | No | — | | `contactAccuracyScoreMin` | `string` | No | — | | `contactAccuracyScoreMax` | `string` | No | — | | `lastUpdatedInMonths` | `number` | No | — | | `school` | `string` | No | — | | `degree` | `string` | No | — | | `locationCompanyId` | `string[]` | No | — | | `companyTicker` | `string[]` | No | — | | `exactJobTitle` | `string` | No | — | | `yearsOfExperience` | `string` | No | — | | `phone` | `string[]` | No | — | | `supplementalEmail` | `string[]` | No | — | | `webReferences` | `string[]` | No | — | | `techSkills` | `string[]` | No | — | | `buyingGroup` | `string[]` | No | — | | `lastUpdatedDateAfter` | `string` | No | — | | `validDateAfter` | `string` | No | — | | `positionStartDateMin` | `string` | No | — | | `positionStartDateMax` | `string` | No | — | | `engagementStartDate` | `string` | No | — | | `engagementEndDate` | `string` | No | — | | `engagementType` | `email \| phone \| online meeting[]` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > firstName?: string, > middleName?: string, > lastName?: string, > validDate?: string, > lastUpdatedDate?: string, > jobTitle?: string, > contactAccuracyScore?: number, > hasEmail?: boolean, > hasSupplementalEmail?: boolean, > hasDirectPhone?: boolean, > hasMobilePhone?: boolean, > hasCompanyIndustry?: boolean, > hasCompanyPhone?: boolean, > hasCompanyStreet?: boolean, > hasCompanyState?: boolean, > hasCompanyZipCode?: boolean, > hasCompanyCountry?: boolean, > hasCompanyRevenue?: boolean, > hasCompanyEmployeeCount?: boolean, > company?: { > id?: number, > name?: string > } > }[] > ``` *** ### searchIntent `zoominfo.searchIntent` Search companies showing buying intent on given topics **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.searchIntent({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rpp` | `number` | No | — | | `page` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortOrder` | `asc \| ascending \| desc \| descending` | No | Defaults to desc. | | `companyDescription` | `string` | No | — | | `companyType` | `string` | No | — | | `companyRanking` | `string` | No | — | | `companyStructureIncludedSubUnitTypes` | `string` | No | — | | `subUnitTypes` | `string` | No | — | | `address` | `string` | No | — | | `street` | `string` | No | — | | `state` | `string` | No | — | | `zipCode` | `string` | No | — | | `country` | `string` | No | — | | `continent` | `string` | No | — | | `metroRegion` | `string` | No | — | | `excludedRegions` | `string` | No | — | | `zipCodeRadiusMiles` | `string` | No | — | | `locationSearchType` | `PersonOrHQ \| PersonAndHQ \| Person \| HQ \| PersonThenHQ` | No | — | | `hashTagString` | `string` | No | — | | `techAttributeTagList` | `string` | No | — | | `primaryIndustriesOnly` | `boolean` | No | — | | `industryCodes` | `string` | No | — | | `industryKeywords` | `string` | No | — | | `sicCodes` | `string` | No | — | | `naicsCodes` | `string` | No | — | | `revenue` | `string` | No | — | | `revenueMin` | `number` | No | — | | `revenueMax` | `number` | No | — | | `employeeCount` | `string` | No | — | | `employeeRangeMin` | `string` | No | — | | `employeeRangeMax` | `string` | No | — | | `fundingAmountMin` | `number` | No | — | | `fundingAmountMax` | `number` | No | — | | `fundingStartDate` | `string` | No | — | | `fundingEndDate` | `string` | No | — | | `oneYearEmployeeGrowthRateMin` | `string` | No | — | | `oneYearEmployeeGrowthRateMax` | `string` | No | — | | `twoYearEmployeeGrowthRateMin` | `string` | No | — | | `twoYearEmployeeGrowthRateMax` | `string` | No | — | | `zoominfoContactsMin` | `string` | No | — | | `zoominfoContactsMax` | `string` | No | — | | `topics` | `string[]` | No | — | | `signalStartDate` | `string` | No | — | | `signalEndDate` | `string` | No | — | | `signalScoreMin` | `number` | No | — | | `signalScoreMax` | `number` | No | — | | `audienceStrengthMin` | `A \| B \| C \| D \| E` | No | — | | `audienceStrengthMax` | `A \| B \| C \| D \| E` | No | — | | `certified` | `0 \| 1` | No | — | | `excludeDefunctCompanies` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: string, > category?: string, > topic?: string, > signalScore?: number, > audienceStrength?: string, > newSignal?: boolean, > signalDate?: string, > trend?: number, > recommendedContacts?: { > id?: number, > firstName?: string, > lastName?: string, > jobTitle?: string, > jobFunction?: { > name?: string, > department?: string > }[] > }[], > company?: { > id?: number, > name?: string, > website?: string, > hasOtherTopicConsumption?: boolean > } > }[] > ``` *** ### searchNews `zoominfo.searchNews` Search news articles by category and publish date **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.searchNews({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rpp` | `number` | No | — | | `page` | `number` | No | — | | `categories` | `string[]` | No | — | | `pageDateMin` | `string` | No | — | | `pageDateMax` | `string` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > domain?: string, > title?: string, > url?: string, > imageUrl?: string, > pageDate?: string, > description?: string, > categories?: string[], > company?: { > id?: number, > name?: string > }[] > }[] > ``` *** ### searchScoops `zoominfo.searchScoops` Search Scoops, ZoomInfo research notes about companies **Risk:** `read` ```ts theme={null} await corsair.zoominfo.api.zoominfo.searchScoops({}); ``` **Input** | Name | Type | Required | Description | | - | - | - | - | | `rpp` | `number` | No | — | | `page` | `number` | No | — | | `sortBy` | `string` | No | — | | `sortOrder` | `asc \| ascending \| desc \| descending` | No | Defaults to desc. | | `companyDescription` | `string` | No | — | | `companyType` | `string` | No | — | | `companyRanking` | `string` | No | — | | `companyStructureIncludedSubUnitTypes` | `string` | No | — | | `subUnitTypes` | `string` | No | — | | `address` | `string` | No | — | | `street` | `string` | No | — | | `state` | `string` | No | — | | `zipCode` | `string` | No | — | | `country` | `string` | No | — | | `continent` | `string` | No | — | | `metroRegion` | `string` | No | — | | `excludedRegions` | `string` | No | — | | `zipCodeRadiusMiles` | `string` | No | — | | `locationSearchType` | `PersonOrHQ \| PersonAndHQ \| Person \| HQ \| PersonThenHQ` | No | — | | `hashTagString` | `string` | No | — | | `techAttributeTagList` | `string` | No | — | | `primaryIndustriesOnly` | `boolean` | No | — | | `industryCodes` | `string` | No | — | | `industryKeywords` | `string` | No | — | | `sicCodes` | `string` | No | — | | `naicsCodes` | `string` | No | — | | `revenue` | `string` | No | — | | `revenueMin` | `number` | No | — | | `revenueMax` | `number` | No | — | | `employeeCount` | `string` | No | — | | `employeeRangeMin` | `string` | No | — | | `employeeRangeMax` | `string` | No | — | | `fundingAmountMin` | `number` | No | — | | `fundingAmountMax` | `number` | No | — | | `fundingStartDate` | `string` | No | — | | `fundingEndDate` | `string` | No | — | | `oneYearEmployeeGrowthRateMin` | `string` | No | — | | `oneYearEmployeeGrowthRateMax` | `string` | No | — | | `twoYearEmployeeGrowthRateMin` | `string` | No | — | | `twoYearEmployeeGrowthRateMax` | `string` | No | — | | `zoominfoContactsMin` | `string` | No | — | | `zoominfoContactsMax` | `string` | No | — | | `companyId` | `string` | No | — | | `companyName` | `string` | No | — | | `companyWebsite` | `string` | No | — | | `parentId` | `string` | No | — | | `ultimateParentId` | `string` | No | — | | `personId` | `string` | No | — | | `emailAddress` | `string` | No | — | | `hashedEmail` | `string` | No | — | | `fullName` | `string` | No | — | | `firstName` | `string` | No | — | | `middleInitial` | `string` | No | — | | `lastName` | `string` | No | — | | `jobTitle` | `string` | No | — | | `excludeJobTitle` | `string` | No | — | | `managementLevel` | `string` | No | — | | `excludeManagementLevel` | `string` | No | — | | `department` | `string` | No | — | | `jobFunction` | `string` | No | — | | `boardMember` | `include \| exclude \| only` | No | — | | `hasBeenNotified` | `include \| exclude \| only` | No | — | | `companyPastOrPresent` | `present \| past \| pastAndPresent` | No | — | | `excludePartialProfiles` | `boolean` | No | — | | `executivesOnly` | `boolean` | No | — | | `requiredFields` | `string` | No | — | | `contactAccuracyScoreMin` | `string` | No | — | | `contactAccuracyScoreMax` | `string` | No | — | | `lastUpdatedInMonths` | `number` | No | — | | `school` | `string` | No | — | | `degree` | `string` | No | — | | `locationCompanyId` | `string[]` | No | — | | `scoopId` | `string` | No | — | | `scoopType` | `string` | No | — | | `scoopTopic` | `string` | No | — | | `description` | `string` | No | — | | `publishedStartDate` | `string` | No | — | | `publishedEndDate` | `string` | No | — | | `updatedSinceCreation` | `boolean` | No | — | | `certified` | `0 \| 1` | No | — | | `excludeDefunctCompanies` | `boolean` | No | — | **Output** | Name | Type | Required | Description | | - | - | - | - | | `maxResults` | `number` | No | — | | `totalResults` | `number` | No | — | | `currentPage` | `number` | No | — | | `data` | `object[]` | Yes | — | > **data full type** > > ```ts theme={null} > { > id: number, > publishedDate?: string, > originalPublishedDate?: string, > linkText?: string, > link?: string, > description?: string, > updateText?: string, > topics?: any[], > types?: { > id?: number, > type?: string > }[], > contacts?: any[], > company?: { > id?: number, > name?: string > } > }[] > ``` *** # Database Source: https://docs.corsair.dev/plugins/zoominfo/database ZoomInfo local sync: searchable entities, `.search()` filters, and operators. The ZoomInfo plugin syncs data locally. Use `corsair.zoominfo.db..search({ data, limit?, offset? })` with the filters listed per entity. > [!NOTE] > > **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy). ## Companies Path: `zoominfo.db.companies.search` ```ts theme={null} const rows = await corsair.zoominfo.db.companies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `name` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `ticker` | `string` | equals, contains, startsWith, endsWith, in | | `revenue` | `number` | equals, gt, gte, lt, lte, in | | `employeeCount` | `number` | equals, gt, gte, lt, lte, in | | `numberOfContactsInZoomInfo` | `number` | equals, gt, gte, lt, lte, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `street` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `zipCode` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `companyStatus` | `string` | equals, contains, startsWith, endsWith, in | | `logo` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Contacts Path: `zoominfo.db.contacts.search` ```ts theme={null} const rows = await corsair.zoominfo.db.contacts.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `firstName` | `string` | equals, contains, startsWith, endsWith, in | | `middleName` | `string` | equals, contains, startsWith, endsWith, in | | `lastName` | `string` | equals, contains, startsWith, endsWith, in | | `jobTitle` | `string` | equals, contains, startsWith, endsWith, in | | `contactAccuracyScore` | `number` | equals, gt, gte, lt, lte, in | | `hasEmail` | `boolean` | equals | | `hasSupplementalEmail` | `boolean` | equals | | `hasDirectPhone` | `boolean` | equals | | `hasMobilePhone` | `boolean` | equals | | `validDate` | `date` | equals, before, after, between | | `lastUpdatedDate` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Intent Signals Path: `zoominfo.db.intentSignals.search` ```ts theme={null} const rows = await corsair.zoominfo.db.intentSignals.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `topic` | `string` | equals, contains, startsWith, endsWith, in | | `signalScore` | `number` | equals, gt, gte, lt, lte, in | | `audienceStrength` | `string` | equals, contains, startsWith, endsWith, in | | `newSignal` | `boolean` | equals | | `signalDate` | `date` | equals, before, after, between | | `trend` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Locations Path: `zoominfo.db.locations.search` ```ts theme={null} const rows = await corsair.zoominfo.db.locations.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `street` | `string` | equals, contains, startsWith, endsWith, in | | `city` | `string` | equals, contains, startsWith, endsWith, in | | `state` | `string` | equals, contains, startsWith, endsWith, in | | `zipCode` | `string` | equals, contains, startsWith, endsWith, in | | `country` | `string` | equals, contains, startsWith, endsWith, in | | `phone` | `string` | equals, contains, startsWith, endsWith, in | | `fax` | `string` | equals, contains, startsWith, endsWith, in | | `addressStatus` | `string` | equals, contains, startsWith, endsWith, in | | `subUnitType` | `string` | equals, contains, startsWith, endsWith, in | | `locationName` | `string` | equals, contains, startsWith, endsWith, in | | `locationEmployeeCount` | `number` | equals, gt, gte, lt, lte, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## News Articles Path: `zoominfo.db.newsArticles.search` ```ts theme={null} const rows = await corsair.zoominfo.db.newsArticles.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `url` | `string` | equals, contains, startsWith, endsWith, in | | `title` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `imageUrl` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `pageDate` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Scoops Path: `zoominfo.db.scoops.search` ```ts theme={null} const rows = await corsair.zoominfo.db.scoops.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | | `link` | `string` | equals, contains, startsWith, endsWith, in | | `linkText` | `string` | equals, contains, startsWith, endsWith, in | | `updateText` | `string` | equals, contains, startsWith, endsWith, in | | `publishedDate` | `date` | equals, before, after, between | | `originalPublishedDate` | `date` | equals, before, after, between | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** ## Technologies Path: `zoominfo.db.technologies.search` ```ts theme={null} const rows = await corsair.zoominfo.db.technologies.search({ data: { /* filters below */ }, limit: 100, offset: 0, }); ``` ### Searchable filters | Field | Type | Operators | | - | - | - | | `entity_id` | `string` | equals, contains, startsWith, endsWith, in | | `id` | `string` | equals, contains, startsWith, endsWith, in | | `vendor` | `string` | equals, contains, startsWith, endsWith, in | | `product` | `string` | equals, contains, startsWith, endsWith, in | | `category` | `string` | equals, contains, startsWith, endsWith, in | | `categoryParent` | `string` | equals, contains, startsWith, endsWith, in | | `attribute` | `string` | equals, contains, startsWith, endsWith, in | | `website` | `string` | equals, contains, startsWith, endsWith, in | | `domain` | `string` | equals, contains, startsWith, endsWith, in | | `logo` | `string` | equals, contains, startsWith, endsWith, in | | `description` | `string` | equals, contains, startsWith, endsWith, in | *Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).* *** # Overview Source: https://docs.corsair.dev/plugins/zoominfo/overview B2B contact database for sales intelligence, company data, and prospecting workflows. Use **ZoomInfo** through Corsair: one client, typed API calls, local DB sync, and incoming webhooks. **What you get:** * 17 typed API operations * 7 synced entities (`companies`, `contacts`, `intentSignals`, `locations`, `newsArticles`, `scoops`, and 1 more) for fast `.search()` / `.list()` * 2 incoming webhook event types ## Setup **1. Install** ```bash npm theme={null} npm install corsair @corsair-dev/zoominfo ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/zoominfo ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/zoominfo ``` ```bash bun theme={null} bun add corsair @corsair-dev/zoominfo ``` **2. Add the plugin** ```ts corsair.ts theme={null} import Database from 'better-sqlite3'; import { createCorsair } from 'corsair'; import { zoominfo } from '@corsair-dev/zoominfo'; export const corsair = createCorsair({ plugins: [ zoominfo(), ], database: new Database('corsair.db'), kek: process.env.CORSAIR_KEK!, hub: { projectApiKey: process.env.CORSAIR_API_KEY!, signingSecret: process.env.CORSAIR_SIGNING_SECRET!, }, }); ``` Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](/quick-start) for KEK + Hub keys, and [Multi-tenancy](/concepts/multi-tenancy) for account isolation. **3. Choose authentication** **OAuth 2.0 (Recommended)** Open [hub.corsair.dev](https://hub.corsair.dev/dashboard), navigate to your project, and enter the **client ID** and **client secret** from your ZoomInfo OAuth app. ```ts theme={null} zoominfo() ``` More: [OAuth 2.0](/concepts/oauth) **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](/management/connect). ```ts theme={null} const { connectUrl } = await corsair.manage.connect.createLink({ plugin: 'zoominfo', tenantId: 'acme', }); // redirect the user's browser to connectUrl ``` ## Example API calls **`zoominfo.enrichCompany`** ```ts theme={null} const tenant = corsair.withTenant('acme'); await tenant.zoominfo.api.zoominfo.enrichCompany({}); ``` **Write** *No write-style endpoint inferred; pick any operation from the [API](/plugins/zoominfo/api) reference.* See the full list on the [API](/plugins/zoominfo/api) page. ## Query synced data Synced entities support `tenant.zoominfo.db..search()` and `.list()`: `companies`, `contacts`, `intentSignals`, `locations`, `newsArticles`, `scoops`, `technologies`. See [Database](/plugins/zoominfo/database) for filters and operators. ## Webhooks This plugin registers **2** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory. See [Webhooks](/plugins/zoominfo/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for routing. ## What's next > **[API reference](/plugins/zoominfo/api)** > > Every `zoominfo.api.*` operation with input and output types. > **[Database](/plugins/zoominfo/database)** > > Synced entities, search filters, and operators. > **[Webhooks](/plugins/zoominfo/webhooks)** > > Event paths, payloads, and `webhookHooks` examples. > **[Connect / OAuth](/management/connect)** > > createLink, Hub delivery, and tenant connect flows. > **[Use with agents](/mcp-adapters/mcp-adapters)** > > Expose this plugin's operations as MCP tools. # Webhooks Source: https://docs.corsair.dev/plugins/zoominfo/webhooks ZoomInfo incoming webhooks: event paths, payloads, and response data. The ZoomInfo plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](/plugins/zoominfo/overview) for setup context and the exact URL shape). > [!NOTE] > > **New to Corsair?** See [webhooks](/concepts/webhooks) and [hooks](/concepts/hooks). ## Webhook map * `zoominfo` * `companyUpdate` (`zoominfo.companyUpdate`) * `contactUpdate` (`zoominfo.contactUpdate`) ## HTTP handler setup ```ts app/api/webhook/route.ts theme={null} import { processWebhook } from "corsair"; import { corsair } from "@/server/corsair"; export async function POST(request: Request) { const headers = Object.fromEntries(request.headers); const body = await request.json(); const result = await processWebhook(corsair, headers, body); return result.response; } ``` ## Events ## Zoominfo ### Company Update `zoominfo.companyUpdate` A company you have enriched was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookDetails` | `object` | Yes | — | | `data` | `object[]` | Yes | — | > **webhookDetails full type** > > ```ts theme={null} > { > id: string, > title?: string, > objectType: string, > eventType: string > } > ``` > **data full type** > > ```ts theme={null} > { > id: string | number, > name?: string, > website?: string, > changedAttributes?: string[] > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > webhookDetails: { > id: string, > title?: string, > objectType: string, > eventType: string > }, > data: { > id: string | number, > name?: string, > website?: string, > changedAttributes?: string[] > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} zoominfo({ webhookHooks: { zoominfo: { companyUpdate: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** ### Contact Update `zoominfo.contactUpdate` A contact you have enriched was updated **Payload** | Name | Type | Required | Description | | - | - | - | - | | `webhookDetails` | `object` | Yes | — | | `data` | `object[]` | Yes | — | > **webhookDetails full type** > > ```ts theme={null} > { > id: string, > title?: string, > objectType: string, > eventType: string > } > ``` > **data full type** > > ```ts theme={null} > { > id: string | number, > firstName?: string, > lastName?: string, > email?: string, > changedAttributes?: string[] > }[] > ``` > **Response data full type** > > ```ts theme={null} > { > webhookDetails: { > id: string, > title?: string, > objectType: string, > eventType: string > }, > data: { > id: string | number, > firstName?: string, > lastName?: string, > email?: string, > changedAttributes?: string[] > }[] > } > ``` **`webhookHooks` example** ```ts theme={null} zoominfo({ webhookHooks: { zoominfo: { contactUpdate: { before(ctx, args) { return { ctx, args }; }, after(ctx, response) { }, }, }, }, }) ``` *** # Quick start Source: https://docs.corsair.dev/quick-start A working integration in five steps, powered by Hub. Hub hosts the OAuth connect, approval, and webhook surfaces, so there are no connect pages, callback routes, or per-environment redirect URIs to build. Credentials are encrypted and stored in your own database. Hub stores none. ```bash Set up with your agent theme={null} npx skills add https://github.com/corsairdev/corsair --skill corsair ``` **Step 1** ## Install ```bash npm theme={null} npm install corsair @corsair-dev/github ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/github ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/github ``` ```bash bun theme={null} bun add corsair @corsair-dev/github ``` > [!TIP] > > `@corsair-dev/github` is one plugin. Every service is its own `@corsair-dev/*` package. Find the one you need, and its exact install id, in the [**Plugins**](/guides/plugins) catalog. **Step 2** ## Set your environment Create a project in the [Hub dashboard](https://hub.corsair.dev/dashboard) and copy the **development** API key and signing secret. Then generate a KEK. Corsair encrypts every stored credential with it: bash
    `openssl rand -base64 32`
    .env Regenerate
    
    ```bash .env theme={null}
    CORSAIR_KEK=your-generated-kek
    CORSAIR_API_KEY=ck_dev_...
    CORSAIR_SIGNING_SECRET=...
    ```
    
    > [!WARNING]
    >
    > Keep your KEK safe. Lose it and you lose access to every stored credential. Treat it like a root password.
    
    **Step 3**
    
    ## Create the database
    
    Corsair stores data in five tables. SQLite is the fastest way to start:
    
    ```bash npm theme={null}
    npm install better-sqlite3
    ```
    
    ```bash yarn theme={null}
    yarn add better-sqlite3
    ```
    
    ```bash pnpm theme={null}
    pnpm install better-sqlite3
    ```
    
    ```bash bun theme={null}
    bun add better-sqlite3
    ```
    
    > **View migration SQL**
    >
    > ```sql migration.sql theme={null}
    > CREATE TABLE IF NOT EXISTS corsair_integrations (
    >     id TEXT PRIMARY KEY,
    >     created_at INTEGER NOT NULL,
    >     updated_at INTEGER NOT NULL,
    >     name TEXT NOT NULL,
    >     config TEXT NOT NULL DEFAULT '{}',
    >     dek TEXT NULL
    > );
    >
    > CREATE TABLE IF NOT EXISTS corsair_accounts (
    >     id TEXT PRIMARY KEY,
    >     created_at INTEGER NOT NULL,
    >     updated_at INTEGER NOT NULL,
    >     tenant_id TEXT NOT NULL,
    >     integration_id TEXT NOT NULL,
    >     config TEXT NOT NULL DEFAULT '{}',
    >     dek TEXT NULL,
    >     FOREIGN KEY (integration_id) REFERENCES corsair_integrations(id)
    > );
    >
    > CREATE TABLE IF NOT EXISTS corsair_entities (
    >     id TEXT PRIMARY KEY,
    >     created_at INTEGER NOT NULL,
    >     updated_at INTEGER NOT NULL,
    >     account_id TEXT NOT NULL,
    >     entity_id TEXT NOT NULL,
    >     entity_type TEXT NOT NULL,
    >     version TEXT NOT NULL,
    >     data TEXT NOT NULL DEFAULT '{}',
    >     FOREIGN KEY (account_id) REFERENCES corsair_accounts(id)
    > );
    >
    > CREATE TABLE IF NOT EXISTS corsair_events (
    >     id TEXT PRIMARY KEY,
    >     created_at INTEGER NOT NULL,
    >     updated_at INTEGER NOT NULL,
    >     account_id TEXT NOT NULL,
    >     event_type TEXT NOT NULL,
    >     payload TEXT NOT NULL DEFAULT '{}',
    >     status TEXT,
    >     FOREIGN KEY (account_id) REFERENCES corsair_accounts(id)
    > );
    >
    > CREATE TABLE IF NOT EXISTS corsair_permissions (
    >     id TEXT PRIMARY KEY,
    >     created_at INTEGER NOT NULL,
    >     updated_at INTEGER NOT NULL,
    >     token TEXT NOT NULL,
    >     plugin TEXT NOT NULL,
    >     endpoint TEXT NOT NULL,
    >     args TEXT NOT NULL,
    >     tenant_id TEXT NOT NULL,
    >     status TEXT NOT NULL DEFAULT 'pending',
    >     expires_at TEXT NOT NULL,
    >     error TEXT
    > );
    > ```
    
    **macOS / Linux**
    
    ```bash theme={null}
    sqlite3 corsair.db < migration.sql
    ```
    
    **Windows (PowerShell)**
    
    PowerShell syntax
    
    Bash redirection and \$VAR env vars do not work in PowerShell.
    Use the Windows commands shown in this tab instead.
    
    ```powershell theme={null}
    Get-Content migration.sql | sqlite3 corsair.db
    ```
    
    Using Postgres, Drizzle, or Prisma instead? See [Database](/concepts/database) for each option.
    
    **Step 4**
    
    ## Configure Corsair
    
    Wire your database, KEK, and Hub keys together in `src/server/corsair.ts`:
    
    ```ts src/server/corsair.ts theme={null}
    import Database from 'better-sqlite3';
    import { createCorsair } from 'corsair';
    import { github } from '@corsair-dev/github';
    
    const db = new Database('corsair.db');
    
    export const corsair = createCorsair({
        plugins: [github({ authType: 'managed' })],
        database: db,
        kek: process.env.CORSAIR_KEK!,
        multiTenancy: true, // gives every user their own credentials; enables corsair.withTenant(id)
        hub: {
            projectApiKey: process.env.CORSAIR_API_KEY!,
            signingSecret: process.env.CORSAIR_SIGNING_SECRET!,
        },
    });
    ```
    
    Mount the handler once. It serves Hub delivery and the management API. In development, Hub auto-detects your localhost delivery URL:
    
    ```ts app/api/corsair/[[...path]]/route.ts theme={null}
    import { toNextJsHandler } from 'corsair';
    import { corsair } from '@/server/corsair';
    
    export const { GET, POST, OPTIONS } = toNextJsHandler(corsair, {
        basePath: '/api/corsair',
    });
    ```
    
    > [!NOTE]
    >
    > This quick-start uses Next.js. The instance above is the same on every framework; only the mount line changes. See [Frameworks](/frameworks/next) for Express, Node, SvelteKit, Hono, and the rest.
    
    Add more plugins later, like `slack()`, `linear()`, or `gmail()`, by appending to the array.
    
    **Step 5**
    
    ## Connect and call
    
    Mint a connect link and send the user to it. Hub hosts the connect page and delivers the result back to your app, with no connect page or OAuth callback to build:
    
    ```ts connect.ts theme={null}
    const { connectUrl } = await corsair.manage.connect.createLink({
        plugin: 'github',
        tenantId: 'acme',
    });
    // redirect the user's browser to connectUrl
    ```
    
    Once connected, call any endpoint. Responses are also cached in your database for instant reads:
    
    ```ts usage.ts theme={null}
    const repos = await corsair.github.api.repositories.list({});
    ```
    
    Want an agent to call endpoints on its own? See [MCP Adapters](/mcp-adapters/mcp-adapters).
    
    **Step 6**
    
    ## Run it
    
    ```bash theme={null}
    npm run dev
    ```
    
    Load your app so the mounted route gets its first hit. That request registers your delivery URL with Hub, and the **App sync** dot in the dashboard header turns green. A green dot means Hub can reach your app and the connect flow is live.
    
    ## What's next
    
    > **[Use with AI](/mcp-adapters/mcp-adapters)**
    >
    > Give an agent the three Corsair tools and let it discover and call any endpoint.
    
    > **[Hub overview](/hub/overview)**
    >
    > How the relay works, and why Hub stores none of your credentials.
    
    > **[Environments](/hub/environments)**
    >
    > Development vs production keys. Switch to production when you deploy.
    
    > **[Multi-tenancy](/concepts/multi-tenancy)**
    >
    > Building a product? Flip one flag and every user gets their own data and credentials.
    
    > **[Database options](/concepts/database)**
    >
    > Postgres, Drizzle, Prisma, and the five tables Corsair uses.
    
    > **[Provisioning](/concepts/provisioning)**
    >
    > Seed credentials and provision tenants from the `corsair` CLI or `setupCorsair`.
    
    
    # Agent
    Source: https://docs.corsair.dev/use-cases/agents
    
    Expose every integration as tools over MCP so an LLM can pick the operation from a plain-English instruction.
    
    An agent is for when you don't know at build time which endpoint to call. The user writes "reply to issue #458 saying this is a duplicate, then close it and link them to the root issue", which is four operations you never wired up.
    
    Instead of hardcoding calls, you expose Corsair over MCP and let the model discover and run them.
    
    **Pattern:** expose Corsair as MCP tools, the LLM plans, then tools execute against your Corsair instance.
    
    ## The three tools
    
    Every MCP adapter exposes the same three tools, regardless of how many plugins you've installed:
    
    | Tool | What it does |
    | - | - |
    | `list_operations` | Discover every available endpoint |
    | `get_schema` | Inspect parameters for one endpoint |
    | `run_script` | Execute a JS snippet with `corsair` in scope |
    
    The model calls them in that order: discover, inspect, execute. This is why you don't register a tool per endpoint. Adding `slack()` to your plugin list makes every Slack operation reachable with no code change and no redeploy of tool definitions.
    
    ## Pick your surface
    
    Two different things get called "an agent". They share the tool layer but the wiring differs.
    
    **Chatbot in your app**
    
    A chat box inside your product, hitting your own model calls. Expose Corsair as an MCP endpoint, then connect to it from the AI framework you already use:
    
    ```ts server.ts theme={null}
    import express from 'express';
    import { createBaseMcpServer, createMcpRouter } from '@corsair-dev/mcp';
    import { corsair } from './corsair';
    
    const app = express();
    app.use(express.json());
    
    app.use('/mcp', createMcpRouter(() => createBaseMcpServer({ corsair })));
    
    app.listen(3000);
    ```
    
    ```ts agent.ts theme={null}
    import { generateText, stepCountIs } from 'ai';
    import { anthropic } from '@ai-sdk/anthropic';
    import { createVercelAiMcpClient } from '@corsair-dev/mcp';
    
    const client = await createVercelAiMcpClient({ url: 'http://localhost:3000/mcp' });
    
    const { text } = await generateText({
        model: anthropic('claude-sonnet-4-6'),
        tools: await client.tools(),
        prompt: 'Close issue #458 in acme/app as a duplicate of #12 and leave a comment.',
        stopWhen: stepCountIs(10),
    });
    
    await client.close();
    ```
    
    Adapters for [Vercel AI](/mcp-adapters/vercel-ai), [Anthropic](/mcp-adapters/anthropic-sdk), [OpenAI Agents](/mcp-adapters/openai), and [Mastra](/mcp-adapters/mastra) all take the same tools.
    
    **Coding agent harness**
    
    Cursor, Claude Code, or Codex calling your integrations while you work. No app code, just a stdio MCP server entry in the harness config.
    
    Setup per harness is in [Coding agents](/mcp-adapters/coding-agents).
    
    If the user asked for "a chatbot in my app", they want the first tab. Don't hand them a stdio config.
    
    ## Guardrails
    
    An agent picks its own operations, so the permission layer is the real control surface, not your prompt. Set a mode per plugin:
    
    ```ts corsair.ts theme={null}
    github({
        permissions: {
            mode: 'cautious',
            overrides: {
                'comments.delete': 'deny',
            },
        },
    })
    ```
    
    | Mode | Read | Write | Destructive |
    | - | - | - | - |
    | `open` | allow | allow | allow |
    | `cautious` | allow | allow | require\_approval |
    | `strict` | allow | require\_approval | deny |
    | `readonly` | allow | deny | deny |
    
    `cautious` is the right default for agent workloads. Reads and writes flow, destructive calls block on a human. A `require_approval` call writes a pending row and waits, so you can approve from your own UI. Details in [Permissions](/concepts/permissions).
    
    > [!WARNING]
    >
    > Prompt instructions are not a security boundary. If an operation must never happen, set it to `deny`. Don't ask the model not to call it.
    
    ## Sharing state with the rest of your app
    
    Use the same `corsair` instance you built for the dashboard. Because `run_script` executes against it, every action the agent takes upserts into the same `corsair_entities` rows your pages read, so a chat command is reflected on the dashboard on the next read, with no extra syncing.
    
    Scope the instance per tenant so a user's agent can only reach that user's connections:
    
    ```ts theme={null}
    const tenant = corsair.withTenant(session.user.orgId);
    ```
    
    ## Checklist
    
    * The MCP server wraps your existing `corsair` instance, not a new one.
    * Permissions are set per plugin, with destructive endpoints denied or gated.
    * Tool calls are tenant-scoped.
    * The step cap is set (`stopWhen`), or tool-calling loops may never terminate.
    
    ## What's next
    
    > **[MCP adapters](/mcp-adapters/mcp-adapters)**
    >
    > Every framework adapter and the tools they expose.
    
    > **[Permissions](/concepts/permissions)**
    >
    > Modes, overrides, and the approval flow.
    
    > **[Pair it with a dashboard](/use-cases/dashboards)**
    >
    > Chat for the long tail, UI for the common actions.
    
    > **[Knowledge base](/use-cases/knowledge-base)**
    >
    > Give the agent synced data to search before it acts.
    
    
    # Dashboard
    Source: https://docs.corsair.dev/use-cases/dashboards
    
    Render synced integration data from your own database, and act on it with live API calls.
    
    A dashboard reads from `.db` and writes through `.api`. Page loads never touch the third-party service, so they're fast and can't be rate limited. A button that creates an issue or sends a message goes straight to the live API.
    
    This is the most common shape, and the one to reach for whenever the ask sounds like "show me my…".
    
    **Pattern:** read `.db` to render, `.api` to mutate or refresh, then read `.db` again.
    
    ## The read path
    
    Query the plugin's entity types directly. Nothing here makes a network call:
    
    ```ts src/server/feed.ts theme={null}
    import { corsair } from './corsair';
    
    const tenant = corsair.withTenant('acme');
    
    export async function getFeed() {
        const [issues, pullRequests] = await Promise.all([
            tenant.github.db.issues.search({
                data: { state: 'open' },
                limit: 50,
            }),
            tenant.github.db.pullRequests.search({
                data: { state: 'open' },
                limit: 50,
            }),
        ]);
    
        return { issues, pullRequests };
    }
    ```
    
    Entity data lives on `.data` in camelCase, typed from the plugin's schema:
    
    ```ts theme={null}
    issues[0]?.data.title;
    issues[0]?.data.user?.login;
    ```
    
    `search` accepts `entity_id`, a `data` object for top-level JSON fields, plus `limit` and `offset`. All filters combine with AND. String fields support `contains`, `startsWith`, `endsWith`, and `in`; numbers and dates support ranges. Each plugin's filterable fields are listed in its database reference, such as [GitHub](/plugins/github/database).
    
    > [!NOTE]
    >
    > `search` has no sort option. Order results in your own code after reading, or query `corsair_entities` directly with your ORM if you need SQL-level sorting and pagination.
    
    ## The write path
    
    Mutations and refreshes use `.api`. Corsair upserts the response into your database as part of the call, so the next `.db` read already reflects it:
    
    ```ts src/server/actions.ts theme={null}
    export async function closeIssue(issueNumber: number) {
        await tenant.github.api.issues.update({
            owner: 'acme',
            repo: 'app',
            issueNumber,
            state: 'closed',
        });
    
        // already current — no manual cache invalidation
        return tenant.github.db.issues.search({ data: { state: 'open' } });
    }
    ```
    
    ## Refresh buttons
    
    A refresh is just a list call against `.api`. Because every response is upserted, you don't wire up any sync logic. You call the endpoint and re-read:
    
    ```ts src/server/refresh.ts theme={null}
    export async function refresh() {
        await Promise.all([
            tenant.github.api.issues.list({
                owner: 'acme',
                repo: 'app',
                state: 'open',
                sort: 'updated',
                direction: 'desc',
                perPage: 50,
            }),
            tenant.github.api.pullRequests.list({
                owner: 'acme',
                repo: 'app',
                state: 'open',
                perPage: 50,
            }),
        ]);
    
        return getFeed();
    }
    ```
    
    To show "last synced 4 minutes ago", keep that timestamp in one of your own tables. It's app state, not integration data, so it doesn't belong in `corsair_entities`:
    
    ```ts theme={null}
    await db
        .insert(syncState)
        .values({ key: 'acme/app', lastSyncedAt: new Date() })
        .onConflictDoUpdate({
            target: syncState.key,
            set: { lastSyncedAt: new Date() },
        });
    ```
    
    > [!TIP]
    >
    > Prefer webhooks over a refresh button where the plugin supports them. Rows update the moment something changes upstream and the page is current with no user action. See [Webhooks](/concepts/webhooks).
    
    ## Adding your own columns
    
    Integration data is rarely enough on its own. To attach private notes, tags, or review state, put them in your own table and reference `corsair_entities.id`:
    
    ```sql theme={null}
    CREATE TABLE issue_notes (
        id UUID PRIMARY KEY,
        entity_id TEXT NOT NULL REFERENCES corsair_entities(id),
        body TEXT NOT NULL
    );
    ```
    
    Your notes stay yours; the integration side of the join keeps updating itself. Full example in [Database](/concepts/database#join-to-your-own-tables).
    
    ## Checklist
    
    A dashboard is wired correctly when:
    
    * Page loads and lists read from `.db` only, with no `.api` call on render.
    * Creates, updates, and deletes go through `.api`.
    * Refresh calls `.api`, then re-reads `.db`, rather than merging responses into UI state by hand.
    * App-specific fields live in your tables, keyed to `corsair_entities.id`.
    * Every read and write is scoped with `withTenant()`.
    
    ## What's next
    
    > **[Vibe code a dashboard](/guides/dashboard)**
    >
    > Scaffold a T3 app and have an agent build the whole UI from one prompt.
    
    > **[Add a chat command bar](/use-cases/agents)**
    >
    > Let people type "close #458 as duplicate" instead of clicking.
    
    > **[Keep it live with webhooks](/concepts/webhooks)**
    >
    > Update rows on upstream changes instead of polling.
    
    > **[React client](/adapters/react)**
    >
    > Connection status and connect links as hooks.
    
    
    # Knowledge base
    Source: https://docs.corsair.dev/use-cases/knowledge-base
    
    Treat everything you've synced as one searchable corpus and answer questions from it.
    
    Once a few plugins are connected, `corsair_entities` holds your Slack messages, GitHub issues, Notion pages, and Gmail threads in one table with one shape. That's a corpus you can search.
    
    Ask "what's happening with the Peterson report?" and you can look across every synced service at once, then hand the matches to a model as grounding, instead of calling six search APIs and reconciling six response formats.
    
    **Pattern:** search `.db` across entity types, rank in your code, then feed matches to the model as context.
    
    ## Searching one entity type
    
    Use the typed client when you know where to look. String fields support `contains`, which compiles to a SQL `LIKE '%value%'`:
    
    ```ts theme={null}
    const tenant = corsair.withTenant('acme');
    
    const issues = await tenant.github.db.issues.search({
        data: { title: { contains: 'peterson' } },
        limit: 25,
    });
    ```
    
    Filters combine with AND, so you can narrow by more than text:
    
    ```ts theme={null}
    const messages = await tenant.slack.db.messages.search({
        data: {
            text: { contains: 'peterson' },
            channel: 'C01234567',
        },
        limit: 50,
    });
    ```
    
    ## Searching across services
    
    The typed clients are scoped to one entity type at a time. To sweep the whole corpus, fan out and merge:
    
    ```ts src/server/search.ts theme={null}
    export async function searchEverything(query: string) {
        const tenant = corsair.withTenant('acme');
    
        const [issues, comments, messages, pages] = await Promise.all([
            tenant.github.db.issues.search({ data: { title: { contains: query } }, limit: 25 }),
            tenant.github.db.comments.search({ data: { body: { contains: query } }, limit: 25 }),
            tenant.slack.db.messages.search({ data: { text: { contains: query } }, limit: 25 }),
            tenant.notion.db.pages.search({ data: { title: { contains: query } }, limit: 25 }),
        ]);
    
        return [
            ...issues.map((r) => ({ source: 'github-issue', text: r.data.title, url: r.data.htmlUrl, at: r.updatedAt })),
            ...comments.map((r) => ({ source: 'github-comment', text: r.data.body, url: r.data.htmlUrl, at: r.updatedAt })),
            ...messages.map((r) => ({ source: 'slack', text: r.data.text, url: undefined, at: r.updatedAt })),
            ...pages.map((r) => ({ source: 'notion', text: r.data.title, url: r.data.url, at: r.updatedAt })),
        ].sort((a, b) => (b.at?.getTime() ?? 0) - (a.at?.getTime() ?? 0));
    }
    ```
    
    For a genuinely open-ended sweep, query `corsair_entities` directly with your own ORM. It's one table, so a single statement covers every service and entity type at once, which is useful when you don't want to enumerate the plugins up front:
    
    ```sql theme={null}
    SELECT entity_type, entity_id, data, updated_at
    FROM corsair_entities
    WHERE account_id = ANY($1) -- this tenant's account ids
      AND data::text ILIKE '%peterson report%'
    ORDER BY updated_at DESC
    LIMIT 50;
    ```
    
    Scope that query to the tenant's `account_id` values. The typed clients do this for you; raw SQL does not.
    
    ## Grounding a model
    
    Retrieval is the whole trick. Pass matches in as context and require citations back to the source URL:
    
    ```ts theme={null}
    const matches = await searchEverything('peterson report');
    
    const { text } = await generateText({
        model: anthropic('claude-sonnet-4-6'),
        prompt: [
            'Answer using only the context below. Cite the source URL for each claim.',
            '',
            ...matches.slice(0, 30).map((m) => `[${m.source}] ${m.url ?? ''}\n${m.text}`),
            '',
            'Question: what is happening with the Peterson report?',
        ].join('\n'),
    });
    ```
    
    Because rows are kept current by API calls and webhooks, answers reflect the present state rather than whenever you last built an index.
    
    ## Filling the corpus
    
    Search only finds what's been synced. Two ways rows get there:
    
    1. **Backfill.** Call `.api` list endpoints once per source. Every response is upserted, so a paginated crawl populates the table.
    2. **Stay fresh.** Register webhooks so upstream changes update the same rows in place. See [Webhooks](/concepts/webhooks).
    
    ```ts theme={null}
    // backfill, then let webhooks maintain it
    for (let page = 1; ; page++) {
        const batch = await tenant.slack.api.messages.list({ channel, limit: 200, page });
        if (batch.length < 200) break;
    }
    ```
    
    ## Know the limits
    
    > [!WARNING]
    >
    > `contains` is substring matching, not semantic search. It won't match synonyms, handle typos, or rank by relevance.
    
    That's fine for names, IDs, and known phrases. For conceptual questions, keep embeddings in your own table keyed to `corsair_entities.id`, and use Corsair search to fetch the current text for whatever your vector query returns. The row your embedding points at keeps updating itself, so you re-embed on change rather than rebuilding from scratch.
    
    One more constraint. `search` filters top-level `data` fields only, and has no sort option. Order results in your code, or use SQL.
    
    ## Checklist
    
    * Reads go through `.db`, never `.api`, so questions don't burn rate limit.
    * Raw `corsair_entities` queries are filtered to the tenant's accounts.
    * Answers cite source URLs from the entity data.
    * The corpus is backfilled once and maintained by webhooks.
    * Semantic needs are handled with embeddings alongside, not by `contains`.
    
    ## What's next
    
    > **[Database](/concepts/database)**
    >
    > The entity table, and how to join it to your own.
    
    > **[Give it to an agent](/use-cases/agents)**
    >
    > Let the model search and then act on what it finds.
    
    > **[Webhooks](/concepts/webhooks)**
    >
    > Keep the corpus current without polling.
    
    > **[Multi-tenancy](/concepts/multi-tenancy)**
    >
    > Keep each customer's corpus isolated.
    
    
    # Use cases
    Source: https://docs.corsair.dev/use-cases/overview
    
    The four shapes an app built on Corsair takes, and how to pick between them.
    
    Almost everything built on Corsair is one of four shapes, or a combination of them. Each shape uses the same setup and the same two namespaces. What changes is where the data flows.
    
    > **[Dashboard](/use-cases/dashboards)**
    >
    > Render synced data from your database, act on it with live API calls.
    
    > **[Agent](/use-cases/agents)**
    >
    > Hand an LLM the whole integration surface as tools and let it decide.
    
    > **[Knowledge base](/use-cases/knowledge-base)**
    >
    > Search everything you've synced and answer questions from it.
    
    > **[Workflow](/use-cases/workflows)**
    >
    > An event in one service triggers actions in another.
    
    ## The one contract
    
    Every shape rests on the same rule. Each plugin exposes two namespaces:
    
    ```
    corsair..db    — reads from your database (no network, instant)
    corsair..api   — calls the live third-party API
    ```
    
    Both follow the same path: `corsair..[db|api]..(args)`.
    
    | Doing this | Use |
    | - | - |
    | Rendering UI, lists, search, detail pages | `.db` |
    | Creating, updating, deleting | `.api` |
    | User-triggered refresh or sync | `.api`, then re-read from `.db` |
    
    Every `.api` response is upserted into your database automatically, and webhooks update the same rows in place. That's why `.db` is the default for reads. It isn't a cache you maintain, it's a table Corsair keeps current. See [Database](/concepts/database).
    
    ```ts theme={null}
    const tenant = corsair.withTenant('acme');
    
    // write through the API — the row is updated for you
    await tenant.github.api.issues.create({ owner: 'acme', repo: 'app', title: 'Bug' });
    
    // read from your own database — no rate limits
    const issues = await tenant.github.db.issues.search({ data: { state: 'open' } });
    ```
    
    Everything else on this page is a variation on which side of that line your feature sits.
    
    ## Picking a shape
    
    | If the user's ask sounds like… | Build a |
    | - | - |
    | "show me", "list", "a page for", "a dashboard" | [Dashboard](/use-cases/dashboards) |
    | "tell it to", "just ask it", "a chatbot that can" | [Agent](/use-cases/agents) |
    | "what's happening with", "search across", "ask questions about" | [Knowledge base](/use-cases/knowledge-base) |
    | "when X happens, do Y", "automatically" | [Workflow](/use-cases/workflows) |
    
    The deciding question is **who chooses the operation**. If you know at build time which endpoint to call, it's a dashboard, knowledge base, or workflow, all plain TypeScript. If the operation is only known at runtime from a human sentence, it's an agent, and you expose tools over MCP instead of hardcoding calls.
    
    ## Combining shapes
    
    Most real apps are two or three of these. A GitHub review tool might list open PRs (dashboard), let you say "close #458 as a duplicate" (agent), and post to Slack when a PR is merged (workflow).
    
    When you combine them, they share one foundation. Build it once:
    
    ### One `corsair.ts`
    
    A single `createCorsair` call listing every plugin you need.
    
    ### One handler route
    
    The management and Hub delivery endpoint, mounted once.
    
    ### One connection per tenant
    
    A plugin connected for a tenant is available to every shape in the app.
    
    Do not create a second Corsair instance for the chat feature, and don't connect the same plugin twice. The agent reads and writes the same `corsair_entities` rows the dashboard renders, which is what lets a chat command show up on the page immediately.
    
    > [!NOTE]
    >
    > The shapes differ in reads, not in setup. If you've finished [Quick Start](/quick-start), you already have everything all four need.
    
    ## Shared setup
    
    Every use case assumes this much is done:
    
    **Step 1**
    
    ## Install and configure
    
    `createCorsair({ plugins, database, kek, hub })` in `src/server/corsair.ts`, with the five tables migrated. Full walkthrough in [Quick Start](/quick-start).
    
    **Step 2**
    
    ## Mount the handler
    
    One route serves the management API and Hub delivery. Every framework is covered in [Handlers](/adapters/handlers).
    
    **Step 3**
    
    ## Connect a tenant
    
    Mint a link with `corsair.manage.connect.createLink({ plugin, tenantId })` and send the user to it. See [Connect](/management/connect).
    
    Then scope your calls with `withTenant()` and start reading. Multi-tenant details are in [Multi-tenancy](/concepts/multi-tenancy).
    
    ## What's next
    
    > **[Quick Start](/quick-start)**
    >
    > The shared foundation, in five steps.
    
    > **[Build with your agent](/getting-started/set-up-with-your-agent)**
    >
    > Point a coding agent at these docs and have it scaffold the app.
    
    > **[Plugins](/guides/plugins)**
    >
    > Every integration, with its install id and endpoint reference.
    
    > **[Database](/concepts/database)**
    >
    > The five tables and how they stay fresh.
    
    
    # Workflow
    Source: https://docs.corsair.dev/use-cases/workflows
    
    An event in one service triggers actions in another, chained in TypeScript, not a visual builder.
    
    A workflow is what you'd reach for n8n, Zapier, or Gumloop to do: a PR is merged, you post to Slack, then open a Linear ticket. In Corsair it's a webhook hook, so the steps are ordinary TypeScript with types and your own helpers available.
    
    There's no DAG to define and no separate engine to run.
    
    **Pattern:** the webhook fires, the hook runs, then it calls any plugin's `.api`.
    
    ## The shape
    
    Every webhook event accepts an `after` hook, which runs once the event is saved to your database. Inside it you have the full `corsair` instance:
    
    > [!NOTE]
    >
    > These examples assume `multiTenancy: true` (the [quick-start](/quick-start) setup), so they scope each call with `corsair.withTenant(ctx.tenantId)`. On a single-tenant instance, drop `withTenant` and call the plugin `.api` directly.
    
    ```ts corsair.ts theme={null}
    github({
        webhookHooks: {
            pullRequestClosed: {
                after: async (ctx, result) => {
                    const pr = result.data.pull_request;
                    if (!pr.merged) return;
    
                    // ctx.tenantId is the tenant this webhook belongs to
                    const tenant = corsair.withTenant(ctx.tenantId);
                    await tenant.slack.api.messages.post({
                        channel: 'C_RELEASES',
                        text: `Merged: *${pr.title}*\n${pr.html_url}`,
                    });
                },
            },
        },
    })
    ```
    
    That's the whole workflow. Chaining more steps means writing more lines, each one a normal `await`:
    
    ```ts theme={null}
    after: async (ctx, result) => {
        const pr = result.data.pull_request;
        if (!pr.merged) return;
    
        const tenant = corsair.withTenant(ctx.tenantId);
    
        await tenant.slack.api.messages.post({
            channel: 'C_ENG',
            text: `Merged: *${pr.title}*`,
        });
    
        await tenant.linear.api.issues.create({
            title: `Post-merge: ${pr.title}`,
            description: `Follow up after ${pr.html_url}`,
            teamId: process.env.LINEAR_TEAM_ID!,
        });
    }
    ```
    
    Because these are function calls rather than a graph, branching and early returns are just `if` statements.
    
    ## Filtering with `before`
    
    Use `before` to drop events you don't care about. Throwing stops processing, and the event isn't written to your database:
    
    ```ts corsair.ts theme={null}
    github({
        webhookHooks: {
            pullRequestOpened: {
                before: async (ctx, payload) => {
                    if (payload.pull_request.draft) {
                        throw new Error('Skipping draft PR');
                    }
                    return { ctx, payload };
                },
                after: async (ctx, result) => {
                    await corsair.slack.api.messages.post({
                        channel: 'C_ENG',
                        text: `Ready for review: ${result.data.pull_request.title}`,
                    });
                },
            },
        },
    })
    ```
    
    Filtering in `before` is cheaper than filtering in `after`, since it avoids the write.
    
    ## Slow work belongs in a queue
    
    Webhook senders expect a fast response. If a step calls an LLM, sends email, or generates a report, hand it to a job queue and return:
    
    ```ts corsair.ts theme={null}
    github({
        webhookHooks: {
            pullRequestOpened: {
                after: async (ctx, result) => {
                    await inngest.send({
                        name: 'github/pr-opened',
                        data: { tenantId: ctx.tenantId, pr: result.data.pull_request },
                    });
                },
            },
        },
    })
    ```
    
    ```ts inngest/functions.ts theme={null}
    export const reviewPR = inngest.createFunction(
        { id: 'review-pr' },
        { event: 'github/pr-opened' },
        async ({ event }) => {
            const { pr, tenantId } = event.data;
            const review = await generateCodeReview(pr);
    
            await corsair.withTenant(tenantId).github.api.issues.createComment({
                owner: pr.base.repo.owner.login,
                repo: pr.base.repo.name,
                issueNumber: pr.number,
                body: review,
            });
        },
    );
    ```
    
    Pass `ctx.tenantId` through to the job, since the queue worker runs outside the request and has to re-scope itself. Adapters for [Inngest](/guides/inngest), [Temporal](/guides/temporal), [Trigger.dev](/guides/trigger-dev), and [Hatchet](/guides/hatchet) all follow this shape.
    
    ## Multi-tenant workflows
    
    Hooks receive the tenant on `ctx`, so one definition serves every customer:
    
    ```ts theme={null}
    after: async (ctx, result) => {
        const tenant = corsair.withTenant(ctx.tenantId);
        const settings = await getSettings(ctx.tenantId);
        if (!settings.notifyOnMerge) return;
    
        await tenant.slack.api.messages.post({
            channel: settings.channelId,
            text: `Merged: ${result.data.pull_request.title}`,
        });
    }
    ```
    
    Don't hardcode channel IDs or team IDs when the app is multi-tenant. Read them from your own settings table.
    
    ## Checklist
    
    * Events you don't want are rejected in `before`, not ignored in `after`.
    * Anything slow is queued; hooks return quickly.
    * `ctx.tenantId` is threaded through to background jobs.
    * Per-tenant destinations come from your settings, not constants.
    * Hooks are idempotent where the provider may redeliver an event.
    
    ## What's next
    
    > **[Workflows guide](/guides/workflows)**
    >
    > More patterns, including Slack to GitHub and multi-step chains.
    
    > **[Webhooks setup](/guides/webhooks)**
    >
    > Get a tunnel running and register your first endpoint.
    
    > **[Hooks reference](/concepts/hooks)**
    >
    > The full before/after API surface.
    
    > **[Dashboard](/use-cases/dashboards)**
    >
    > Surface what your workflows produced.
    
    
    # Execution & steps
    Source: https://docs.corsair.dev/workflows/execution
    
    Turn on workflow execution, and how step() and step.sleep() make a run durable.
    
    Workflows execute inside your app. Hub delivers each run to the route you already mounted, and your app runs it in a sandbox against a tenant-scoped `corsair` client. Because this means running Hub-delivered code, execution is **off by default**. You opt in explicitly.
    
    ## Turn on execution
    
    Add `allowWorkflowExecution: true` to the `hub` block of `createCorsair`:
    
    ```ts src/server/corsair.ts theme={null}
    export const corsair = createCorsair({
        plugins: [slack(), github()],
        database: db,
        kek: process.env.CORSAIR_KEK!,
        hub: {
            projectApiKey: process.env.CORSAIR_API_KEY!,
            signingSecret: process.env.CORSAIR_SIGNING_SECRET!,
            allowWorkflowExecution: true,
        },
    });
    ```
    
    That's the whole setup. You've already [mounted the handler](/frameworks/next) for your framework, and Hub delivers runs through it. With the flag off, delivered runs are rejected with *"Workflow execution is not enabled."*
    
    > [!WARNING]
    >
    > Leaving `allowWorkflowExecution` off is the safe default: it means your app never executes Hub-delivered code. Turn it on only once you're running workflows you trust.
    
    ## How a run is shaped
    
    A workflow is a single function you define in your code. It receives your tenant-scoped client, the trigger `payload`, and a `step` helper:
    
    ```ts theme={null}
    export const main = async (corsair, payload, step) => {
        // corsair — tenant-scoped client; call any connected plugin
        // payload — the trigger data (webhook body, or your run() payload)
        // step    — makes each unit of work durable
    };
    ```
    
    Inside, you wrap each unit of work in `step()`. That's what turns an ordinary async function into a workflow that survives retries and pauses.
    
    This body is authored in Hub; once the workflow exists there, you run it from your app with `corsair.workflows.run(id, { payload })`.
    
    ## `step(name, fn)`, run once, durably
    
    ```ts theme={null}
    const user = await step('fetch-user', async () =>
        corsair.slack.api.users.get({ user: payload.userId }),
    );
    
    await step('post-welcome', async () =>
        corsair.slack.api.messages.post({ channel: payload.channel, text: `Hi ${user.name}` }),
    );
    ```
    
    Each `step` runs its function once and **memoizes the result**. If the run retries, a step that already completed replays its saved output instead of running again, so a half-finished run never double-posts a message or re-charges a card. The step's identity is its name plus its position in the run, which keeps that memoization stable across attempts.
    
    ## `step.sleep(name, ms)`, durable pause
    
    ```ts theme={null}
    await step('open-issue', async () => corsair.github.api.issues.create({ /* ... */ }));
    await step.sleep('cooldown', 60 * 60 * 1000); // one hour
    await step('follow-up', async () => corsair.slack.api.messages.post({ /* ... */ }));
    ```
    
    `step.sleep` pauses the run durably. The run unwinds, Hub reschedules it, and a later attempt resumes past the sleep with every earlier step already memoized. A pause costs nothing while it waits, since there's no process sitting idle.
    
    ## Limits & rules
    
    > [!NOTE]
    >
    > These are the current beta constraints. Expect the authoring surface (more step types) to grow.
    
    * **30-second cap per attempt.** Each attempt has a 30s wall-clock budget; long waits belong in `step.sleep`, not in a running step.
    * **Don't rename or reorder steps mid-run.** Step identity is positional, so renaming or reordering steps changes their keys and breaks memoization for in-flight runs. Safe to change between new runs.
    * **Sandboxed.** Workflow code runs in a hardened realm with no host globals (`process`, `require`, `fetch`, timers) and no `eval`. It talks to the outside world only through the `corsair` client it's handed.
    * **Retries are Hub-managed.** You don't configure backoff in code; Hub owns the retry schedule and re-delivers with prior steps memoized.
    
    ## What's next
    
    > **[Triggering](/workflows/triggering)**
    >
    > Start and list runs from the `corsair.workflows` client.
    
    > **[Overview](/workflows/overview)**
    >
    > The author, trigger, and execute model, and why it's built in.
    
    
    # Workflows
    Source: https://docs.corsair.dev/workflows/overview
    
    Durable, multi-step workflows that run inside your app against your integrations, no external engine. Beta.
    
    > [!NOTE]
    >
    > **Corsair Workflows is in beta.** The authoring surface is still growing; the trigger and execution APIs below are stable.
    
    Corsair Workflows are durable, multi-step automations that run against the integrations you've already connected. A workflow can read from Slack, open a GitHub issue, wait an hour, then post back, and survive restarts and retries along the way. There's no Inngest or Temporal to stand up. Workflows run inside your own app, against your own tenant-scoped Corsair client, with credentials that never leave your database.
    
    ## The model
    
    A workflow moves through three places:
    
    **1. Author in Hub**
    
    Workflows are authored and managed in Hub, which handles the scheduling and durable orchestration. From your app you run and inspect them through `corsair.workflows`. Call `corsair.workflows.run(id, { payload })`, `.list()`, or `.get(id)`. These need `hub` configured on `createCorsair`.
    
    **2. Trigger**
    
    A run starts one of three ways: **manually** from your app (`corsair.workflows.run(id)`), from an incoming **webhook**, or on a **schedule** (cron/cadence) configured in Hub.
    
    **3. Execute in your app**
    
    Your app runs the delivered workflow in a locked-down sandbox, against a tenant-scoped `corsair` client. Because it executes where your integrations and credentials already live, a workflow can call any plugin you've connected, and Hub never sees a token.
    
    ## Why built-in
    
    * **No engine to wire.** No external durable-execution service to run, secure, and pay for. Workflows run in the app you already deploy.
    * **Runs where your data is.** A workflow uses the same tenant-scoped client as the rest of your code, so it calls `corsair.slack.api.*`, `corsair.github.api.*`, and friends directly.
    * **Durable by default.** Steps are memoized and sleeps are durable, so a run resumes exactly where it left off after a retry or a scheduled pause, and you don't build the bookkeeping.
    
    ## What's next
    
    > **[Triggering](/workflows/triggering)**
    >
    > Start and list runs from the `corsair.workflows` client, with manual, webhook, and schedule triggers.
    
    > **[Execution & steps](/workflows/execution)**
    >
    > Turn on execution, and how `step()` and `step.sleep()` make a run durable.
    
    > **[Workflow engines](/guides/inngest)**
    >
    > Prefer an external engine? Corsair also drives Inngest, Temporal, Trigger.dev, and Hatchet.
    
    > **[Triggers](/concepts/webhooks)**
    >
    > How incoming webhooks reach your app and can start a workflow.
    
    
    # Triggering
    Source: https://docs.corsair.dev/workflows/triggering
    
    Start and list workflow runs from the corsair.workflows client, plus webhook and schedule triggers.
    
    Once you've defined a workflow, your app reaches it through the `corsair.workflows` namespace. It's available on every client that has [Hub configured](/workflows/execution#turn-on-execution), and it's tenant-scoped like the rest of the SDK.
    
    ## Run a workflow
    
    Call `run()` with the workflow id:
    
    ```ts theme={null}
    const { status, runId } = await corsair.workflows.run('wf_123', {
        payload: { channel: 'C0123', message: 'Ship it' },
    });
    ```
    
    `run()` accepts:
    
    | Option | Type | Purpose |
    | - | - | - |
    | `payload` | `unknown` | Data handed to the workflow as its `payload` argument. Optional. |
    | `idempotencyKey` | `string` | Collapses retried triggers into a single run. Optional. |
    
    It resolves to `{ status, runId? }`, where `status` is `'ok'` when the run was accepted, and `runId` identifies it.
    
    > [!TIP]
    >
    > Pass an `idempotencyKey` whenever a trigger might fire more than once (a retried request, an at-least-once queue). Two `run()` calls with the same key produce one run, not two.
    
    ## Scope to a tenant
    
    In a multi-tenant app, resolve the tenant first. The run executes against that tenant's connected accounts:
    
    ```ts theme={null}
    await corsair.withTenant('acme').workflows.run('wf_123', { payload });
    ```
    
    In a single-tenant app, `corsair.workflows.run(...)` runs against the default tenant.
    
    ## List workflows
    
    ```ts theme={null}
    const workflows = await corsair.workflows.list();
    // [{ id, name, status, triggerType, createdAt, updatedAt }, ...]
    ```
    
    Each entry is a `WorkflowSummary`, enough to render a list, show a status, and pick an id to `run()`.
    
    ## Trigger types
    
    Manual `run()` is one of three ways a workflow starts. The other two are configured in Hub and need no call from you:
    
    > **Manual**
    >
    > Your app calls `corsair.workflows.run(id, { payload })`. The payload is yours to shape.
    
    > **Webhook**
    >
    > An incoming [trigger](/concepts/webhooks) fires the workflow; the webhook body arrives as its `payload`.
    
    > **Schedule**
    >
    > A cron or cadence configured in Hub runs the workflow on a timer; `payload` is empty.
    
    However a run starts, it executes the same way. See [Execution & steps](/workflows/execution).